Ramblings of a Mad Deanius

A stream-of-thought blog on tech, music and fitness

Returning to Dagobah, to Learn, to Teach

It’ll be good to return to teaching. I’ve left development for teaching before. It was developer training, but it was teaching nonetheless. This time around however I’m a lot more excited and a lot more nervous.

That time, in the early 2000’s, it was Microsoft .Net and Office products I focused on, and only a little web stuff. This time it’ll be Open Source and community driven products like Rails and Node, and as much front-end HTML and JavaScript I can manage. That time, I felt pretty alone at the school – no teachers had the career experience in software that I did, and I hardly even met other teachers. This time, I know several of the people I’ll be teaching with from the field already, and I even consider some of them mentor-level figures. There will be a more communal aspect of the school where teachers and students mingle more freely – that’s part of the value proposition for the students, and will help me out quite a bit too.

Education has undergone a phase transition since 10 years ago. I felt it coming – people were turning more to online resources, and attendance had started dropping at the training centers I worked at. But we’ve now come out the other side and learned that online resources have their place, and yet the value of the in-person instructor has been restored. Schools like DevBootCamp, Startup Institute, Starter League and the Experience Institute are heralding the rebirth of an educational style focused on learning-by-doing. They don’t promise you certifications, they promise transformations in what you are capable of. Having met and known several students of these schools, you bet that they are going to unleash transformations on their worlds in kind, so it’s an exciting thing to be witnessing.

Jess, my fiancee, is a 6th grade Math teacher, and very up on the latest standards. She speaks of the “flipped classroom” where conceptual learning – what used to be ‘lecture’ – is now conveyed through reading and video watching assignments to be done at home. Then students come in and do exercises together, with the teacher present. Homework in class, lecture at home – flipped classroom !

I have historically gone to great lengths to come up with interesting metaphors, diagrams and stories that reveal the concepts being learned, and tried to ‘perform’ them for my classes. There is great tradition here – the SICP lectures and Richard Feynmann lectures on QED are great influences to me. I learned them so well I could probably perform sub-parts of either lecture years after my last viewing of them. Will this go away in the modern classroom ? I hope not. But I will be assessing how and when to use this style of instruction.

On the one hand I am relieved however. The schools I’m partnering with this time around have more and better curriculum prepared. So the ‘at-home’ part of the instruction- even the goals for the in-class exercises and labs – are defined for me, which will let me focus on the just-in-time individual help I’ll be able to give. But I have a feeling I will still come up with fun lectures periodically because I do enjoy that quite a bit :)

PS It will be interesting to compare notes with Jess as she elaborates upon her own flipped classroom concepts and multi-modal learning concepts for the youth. Perhaps I will even get some vicarious education just living with her while she undertakes her next degree in education this winter.

We Dont Need No Stinking WiFi! (Offline Apps)

So ladies and gentlemen, Meteor App #2, an online/offline app that works with or without an internet connection, is online now, dubbed SignMeUp.

The other day I was at the expo for a large sporting event, chatting up the various vendors in their booths, when one of them asked me if I’d like to sign up for their mailing list. I expressed my interest, he gestured toward an iPad in a nice stand with a sign-up web page. This is where it got embarassing for them.

You see, they merely pointed me at a public page on their public website – in a room where thousands of visitors had completely saturated the little cellular connection there was, and where wifi was either also saturated, or poorly placed. You get the idea. The sign-up process was a debacle. We finally got the webpage loaded, and adding insult to injury, there was a Captcha I had to solve, which of course I did not get right the first time ! I stuck through it, but I know they lost several people due to this process. I know the expression goes “you can’t take it with you”, but when it’s an iPad in a zone of little connectivity, and your signup app matters, you’d better take it with you !

So the way you do this is described below, and to see it in action, check out SignMeUp

First, while online, you visit the page in Mobile Safari (or any other browser on a tablet, mobile device or computer). The page saves any collected names and emails to HTML5 Local Storage. This collection persists in the browser (up to 2.5Mb), even if the browser or device is shutdown and restarted. An admin view lets you see all collected names and emails.

Secondly, the page and its static assets persist in the HTML5 Application Cache, so the browser will not lose them if you are offline. Even if you visit http://signmeup.meteor.com while in Airplane mode, you will not get the dreaded WSOD (white screen of death).

Fortunately for me, the Meteor appcache package made it compelling to make even this simple one-page project into a Meteoric one. With a simple meteor add appcache, the entire app persists, even if the device goes into airplane mode. The manifest files are written for you, invalidated as needed, and you and your customers get to grin and not even notice the lack of WiFi !

When combined with “Add to Home Screen”, you get an offline application, without browser chrome, that doesn’t need internet connectivity to function. In other words – an App, but without the pain of an App Store, and portable to any device with a few lines of CSS.

Feel free to use this page as you see fit – your data and others don’t mingle because it never even gets sent to the internet. I hope this helps you make your data collection robust in the face of network uncertainty. Have fun with it !

Why, Have You Returned ?

Let me regale you with the tale of a programmer who saw the light. His name is “Why, The Lucky Stiff”. He knew that programming could be literate, humorous, even poignant.

"Why graphic"

He saw programming as the liberator of the mind that it can be, as poetry, and sought to bring that to the world. He forsaw the Chunky Bacon movement and peppered his works liberally with those words. (No, really, to a ridiculous extent, he did)

Why’s seminal text, Why’s (poignant) guide to Ruby has encouraged many a n00b to embark on a path to l33t mastery. Has turned programmers in “boring” languages into fans of dynamic expressive ones. Has turned people working in ‘safe’ (eg ‘financially secure’) companies into rebels who’ll take time to program just for fun !

He disappeared online (went John Galt?) in 2009 – quite uncommon for someone who speaks at conferences and has thousands of hits on his website.

Whether his return occurs this year, or next – Why, you have been a great influence on many others including myself. While people I met introduced me to Ruby, it was your text that gave it almost a mythology. I used to say I had “a crush” on Ruby, and the desire to truly understand the “class << self” graphic was a huge part. I’d still be a programmer without you, but it’s doubtful I’d have become the Mad Deanius that I have. So – Why, thanks ! As I go forth and teach others, your style will be with me !

Promises and Futures - the Tardises of JavaScript

I do like to wax eloquent from time to time on a coding concept that gives me warm fuzzies.

Other times, it’s been done so well for me already that I have to tip my hat and give credit where credit is due. This is one such time: I present to you Jose on Code’s Promises Article

The money quote: “Promises are about … providing a direct correspondence between synchronous functions and asynchronous functions.”

They are a concept which – once grokked, allow you to break the standard falling-dominoes metaphor of coding, jumping effortlessly between the present, the future, back to the present and of course Back to the Future (oh yes, i did)

In the short future (that’s a Promises/Futures reference), I will detail how I used jQuery’s Deferred framework to clean up some code that had been written in the uglier callback style. I have to get the code cleaned up and on gists, but it’ll be less instructive I think than Jose’s link.

They are not going away anytime soon, and frankly they’re so plainly an improvement that until they’re beaten by another standard, they’re the only game in town, so you may as well learn them. I’m certainly glad I did.

You Got JavaScript in My C# App!

People who use Microsoft Office tools on a daily basis often like to get to data that is stored on websites directly through their Excel, or Outlook. My former company was in the business of managing financial and CRM data for their clients, and while there was a fabulous website on which they could work with their data, salespeople wanted access to it in Outlook, analysts wanted the data in Excel, and everyone wanted to style up pie charts and line graphs.

To that end, and with my previous C# skills in mind I was asked to head up development of addins for Outlook and Excel, to connect to the company’s data. It went really well, and within a year from my first code, almost 70% of the firm’s clients were using the addins I started. Talk about the right solution at the right time ! The one-person team that I was became a 6 person team due to the success of the products.

While many people and decisions had factors in this success, one decision I made that I think helped it out, was to build as much of the addin as possible in HTML5, CSS and Javascript. This is something you don’t just generally do – all the information you see online says you build addins in C# or VB.Net ! I still used C# for hosting, installation, and server communication, but the Web UI delivered interactivity and style. Javascript components that users were familiar with from the company website, could be used directly, whether or not an equivalent existed in WPF or .Net. The UI could be, and was, developed without the need for Visual Studio. And the app could be maintained by a larger percentage of the company’s staff – nearly 100% knew HTML, only about 5% were .Net-savvy.

One thing this really helped was getting fast feedback cycles. LiveReload and a browser are a much faster iteration environment than Visual Studio’s compile/launch cycles, especially for addins. Even when the addin was ‘installed’, HTML files and app resources could be sourced from a server for central updating. This reduced Administrator involvement compared to the usual Windows Update methods. To me, being Agile means you need tight feedback loops, even while developing.

Can this approach work for apps as well ? Maybe, but mobile devices have different constraints than desktop apps, and sometimes App Stores have their own rules. I’d like to think that the ease of building and updating benefits I described would transfer over, but the Stores are trying very hard to discourage it for their own commercial reasons.

For now I’ll just keep increasing the reach of my coding skills by using the most broadly applicable technologies to build solutions. The hundreds of happy customers of my former company have not been complaining.


Technical details: A WebControl was embedded in the addin. Due to security restrictions, I could not source a page from the file system or a remote URL directly from the WebControl – so the content was fetched by .Net and injected ala document.write. The Knockout JS framework was used for interactivity. The WebControl had a C# instance of a view model set as the ObjectForScripting property so that JS could talk to C#. Some marshaling code was written so that code which updated the C# ViewModel would automatically update the JS viewmodel, and knockout would re-render the page. All in all this worked very well, and I would heartily recommend this architecture going forward.

Flip the Phone, Not the Bird, With HTML5 Gesture Support

With the new HTML5 APIs, features once available only to native apps have become available to browser developers. Combined with adding an icon for the app to the home screen, and the use of HTML5 appcache features, web developers now have a rich array of options for adding native-like behavior to pages and sites which they develop.

Here is a demo on YouTube of a magic-trick type of web page which relies on double-tap detection and handling of orientation-change events to give a truly hands-on effect to the illusion.

The trick can be added to your home screen by navigating to Fliparoo and adding it to your home screen.

I’m excited as the gap between ‘installed’ and web software grows smaller every day!