Categories
Uncategorized

CUSEC 2010 Keynote: Matt Knox – “On Weakness”

CUSEC 2010 "goto 10" logoThis is the first of a series of notes that I took while attending CUSEC, the Canadian University Software Engineering Conference, which took place last week in Montreal. CUSEC is the biggest conference held by and for university students interested in software development. True to the Canadian techies punching well above their weight class (a great tradition started by Alexander Graham Bell), CUSEC manages to pull in big-name and up-and-coming speakers who’ve given talks that have outshined those I’ve seen an thousand-dollar-plus conferences.

The first keynote was given by Matt Knox, who has probably distributed more Scheme runtimes than anyone else in the world (and this is a larger number than you might think), which he did in the name of putting adware on millions of machines. He’s since come to his senses and seems quite contrite.

His presentation, On Weakness, is about his life on the Dark Side and the lessons he gleaned from it. It’s based on his talk, Crimes Against Humanity, Writ Small, which he gave at FutureRuby last year, but it was good to see it again, and its message is probably even more valuable to students. My notes (which I polished for comprehensibility) and photos from his session appear below:

Matt Knox, standing at the lectern, delivering his keynote at CUSEC

An Evil Job

  • How many of you are:
    • Technical, as opposed to business or arts students?
    • Engineering students?
    • Programmers?
    • Evil?
  • That’s what this talk is about
  • One way to describe one of my former jobs is doing “Windows hijinks with Scheme”
  • During my time with that job, I released many scheme runtimes
  • Aaron Swartz – I think it was at a Y Combinator startup camp – said this of me: "He uses Scheme for evil!"
  • It was more than just Scheme – I was writing stuff that had alternately “hard” (statically-typed languages) and “soft” (dynamically-typed languages) layers
  • I was in the adware business, which is like walking into a big monkey knife fight…
  • …except I was using a death ray! (Scheme == death ray, C == knife)
  • I started with good intentions, in the business of building spam filters
  • Business wasn’t so hit, and I ran out of money
  • My job search failed, but luckily, a job went looking for me
  • I was so pleased with being found that I  forgot to talk salary
  • I showed up for the interview and at the end, was invited to work for them
  • I did terribly when it came time to discuss what I would be paid
    • I didn’t research the New York City job market and cost of living
    • I asked for $40K
    • When I saw the look of shock of the guy’s face, I thought that I had asked for too much
    • Start reducing what I asked for; luckily he stopped me
  • We want you to come in an analyze our distribution chain, they said
  • It turned out to be an adware company:
    • Bought people’s “digital tchochkes” or mini-apps, such as screensavers
    • They had realized that there’s no lower bound for how cheesy something can be and still be a big seller on the internet
    • They took these mini-apps and gave them away online for free, bundled with software that gives you "special offers" from time to time
  • Some of these bundled apps turned out to be worms
    • So the company had me write software to remove any worms from a system and added them to the bundle
    • So now we were bundling my anti-malware along with their adware
    • I felt like "an assassin working for the mob, but killing terrorists". The mob were bad, but the terrorists were worse
    • "Awesome! I can probably keep up with Norton…it’ll be great!"
    • And for a while, the best way to eradicate worms your system was to install their adware with my anti-malware bundled with it
  • Low-level coding is dangerously seductive
    • In the beginning, it’s "like getting kicked in the face over and over again by buffer overruns"
    • But then it becomes fascinating
  • I wanted to do it in Scheme, but that would require embedding a Scheme interpreter
    • Such an interpreter would have to fit into a single TCP/IP packet (about 64K)
    • Scheme is great. For any superlative — “best performance”, “smallest app”, and so on – there are usually two contenders: some other language, and Scheme.
    • I managed to squeeze a Scheme interpreter down to 19K
  • My success with killing the worms led to a new request: In addition to your all this malware on other machines, why not eliminate all the competitor’s adware?
    • Now I felt like “an assassin for the mob, killing other mobsters”. Not as noble.
  • Then the next request came: How about keeping our software from being killed…by anything? (including Norton)
    • The only way to uninstall the adware was to use the uninstaller, which came with it
    • I initially viewed this as "a really interesting technical problem"
  • All this was made possible by a couple of Windows quirks…
    • CreateRemoteThread
    • Scheduler
      • You can have a process tell the scheduler that it needs to do a do-over — "I’m not done yet, I need more time", and the scheduler will grant that time
      • You can tell even Windows that a process is so important that if it fails, it needs to protect the user by presenting a blue screen
  • Windows is interesting from a purely archaeological perspective
    • Consider that all strings in Windows are 16-bit unicode, which means that nulls can be embedded in strings
    • But C strings, which is what’s used in the underlying DOS, are null-terminated and therefore can’t contain nulls
    • Interesting effects when moving null-containing strings between these layers

What Drives People to Take Up Evil Jobs?

Matt Knox, standing at the lectern, delivering his keynote at CUSEC

  • Aftermath of my working at the adware company:
    • Company got sued for $190 billion (by Elliot Spitzer!)
    • I was the first employee at the company — everyone else was a contractor
  • I left the company with these questions:
    • "Whut happen?"
    • "Is this who I am?"
  • Some jobs pay lots of money, but it’s hard to transition out of them
  • Will I be stuck in adware for the rest of my life?
  • There are some historical precedents:
    • Albert Speer
      • A promising architect who liked soaring buildings
      • He hooked up with rising politicians with the same aesthetic sense, one of whom was Hitler
      • He started with creating buildings, but then became the Nazis’ chief logistics guy
      • Later, a leader of the U.S. Air Force said that had he been aware of Speer’s involvement as the Nazi’s chief logistics guy, he would’ve dedicated an entire wing of the Air Force exclusively to killing him
      • It’s been suggested that Speer prolonged the war by a year or two by running the German forces more efficiently
    • Manhattan Project staff
  • But I didn’t want anecdotes…I wanted science!
    • There’s a scientific study of otherwise good people doing evil things: the Milgram Experiment
      • How many people would go all the way?
      • 1% of the population is psychotic – it was hypothesized that the number of people who’d go all the way would be similar
      • Instead, 70% did
      • Results replicatable with people from all walks of life
      • Women, it turned out, “went evil” in a slightly greater proportion than the men
      • "Most human evil lives here"
  • Read The Black Book of Communism
  • For a more mundane example of blind obedience to authority leading to evil, see "The strip search McDonald’s prank call"
    • In the prank, the prankster calls a McDonald’s, gets an employee on the line and says “I’m a police officer. We have reason to believe that there is a thief in your restaurant and we need you to take them into the back and hold them until we arrive.”
    • They provide a description vague enough so that someone in the restaurant will match it
    • Once coralled in the back, the prankster starts giving orders to torture and/or humiliate the customer, and many employees have complied
  • So what does this mean?
    • The human brain has a remote root exploit in 70% of the installed base
  • "With or without religion, you would have good people doing good things and evil people doing evil things. But for good people to do evil things, that takes religion." — Steven Weinberg
    • Nope. Just authority.
  • There is hope: people who were subjects of the Milgram experiments turned out to be better at resisting authoritative coercion

The Power of Communication

Matt Knox, standing at the lectern, delivering his keynote at CUSEC

  • Math: "There are only three reasonable numbers: 0, 1 and infinity"
  • When Robert Andrews Millikan did his oil drop experiments to determine the charge on an electron, he initially got the value wrong by 30 – 40%
    • People who repeated the experiment or conducted similar experiments with results close to Millikan’s erroneous number published their results
    • People who did so but got the correct value – which did not match Millikan’s value – didn;t publish, worried that they’d done something wrong, since their numbers didn’t agree with the number published by the authority on the subject
  • The world pre-blogs was so different from this world
    • Very first open source project: Oxford English Dictionary
      • Done via mail
    • Ever wondered where the term "flying off the handle" comes from?
      • It’s from sword-making – until they figured out the process of making swords as one-piece, with hand-friendly stuff wrapped around the base so you could hold them, swords often flew off their handles in battle
      • It took 900 years to evolve swords to one piece
  • Not everything has been solved, but it’s easier today
  • Rails is such a solution
    • It’s a series of incremental improvements
    • Can you out-Rails Rails?

This article also appears in Canadian Developer Connection.

Categories
Uncategorized

Montreal Bound

porter plane Photo by Tom Purves.

I’m boarding a Porter flight bound for Montreal, where I’ll be attending CUSEC (Canadian University Software Engineering Conference). I’ll be there from today through Saturday afternoon, watching technical presentation, flying the Microsoft banner, hosting DemoCamp and having a beer (or twelve) with my fellow conference-goers. I’ll be posting notes and photos from the presentations and other goings-on, so watch this space!

This article also appears in Canadian Developer Connection.

Categories
Uncategorized

My Presentation at CUSEC 2009: “Squeezeboxes, Start-Ups and Selling Out: A Tech Evangelist’s Story”

cusec 2009 logoMicrosoft was a sponsor of CUSEC last year – that’s Canadian University Software Engineering Conference, the premier conference on building software aimed specifically at students. One of the perks of sponsorship was a “corporate speaker” slot, and it was decided that the presentation should be given it to the then-new guy…namely, me.

At the time I got slotted in as the speaker, I’d barely been a Microsoft employee for two months and was still feeling my way around both the company and its technology. By the time I would stand on the podium, I would have just passed my three-month probationary period. If I was going give a talk for forty-five minutes, it would have to be something other than “what it’s like to work at The Empire”.

Luckily, I did have something to talk about: a not-quite-normal career in tech, and the lessons I picked up along the way. The end result was a presentation titled Squeezeboxes, Start-Ups and Selling Out: A Tech Evangelist’s Story (yes, it’s a bombastic title, but it’s the sort of thing you’d expect from a guy whose personal blog’s name is The Adventures of Accordion Guy in the 21st Century.)

The presentation was scheduled for the end of Day 2 (it’s a three-day conference), which is a challenge. The audience would be tired and being students, they were likely to be more focused on the big drinkfest that would take place that evening. I decided to go for “offbeat” and built my presentation around the abstract I gave to them, which was:

You’ll spend anywhere from a third to half (or more) of your waking life at work, so why not enjoy it? That’s the philosophy of Microsoft Developer Evangelist Joey deVilla, who’s had fun while paying the rent. He’ll talk about his career path, which includes coding in cafes, getting hired through your blog, learning Python at Burning Man, messy office romances, go-go dancing, leading an office coup against his manager, interviewing at a porn company and using his accordion to make a Microsoft Vice President run away in fear. There will be stories, career advice and yes, a rock and roll accordion number or two.

They recorded my session and unleashed it on the world yesterday. I share it with you below:

If you watched the video, you’ll note that I skipped a couple of stories, namely “learning Python at Burning Man”, “messy office romances”, “go-go dancing” and making a Microsoft Vice President run away in fear. I’ll save those for another presentation. (By the bye, the guy I made run away is a President now.)

I had a blast doing this presentation, and the general consensus of the attendees was that it was one of the highlights of the conference. I’m honoured that I was invited back to host DemoCamp, and look forward to chatting with everyone. See you in Montreal!

This article also appears in Canadian Developer Connection.

Categories
Uncategorized

Netbook Experiment Report #1

the netbook experimentIn case you hadn’t read my article from Friday, I’m conducting a little experiment this week – I’m seeing what it’s like to use a “netbook“ computer (a Dell Latitude 2100, to be specific) as my primary machine for the whole week. I’m trying this out as a response to Jeff “Coding Horror” Atwood’s article, in which he rebuts my argument that the computers we typically classify as “netbooks”, occupy a neither-here-nor-there, worst-of-both-worlds middle ground between smartphones and laptop computers.

As I promised in that earlier article, I’d report on my experiences. This is the first of a number of such reports that I plan to file throughout the week.

Jeff Atwood Replies

Jeff saw my article and replied in Global Nerdy, warning me that I’d be disappointed with my particular netbook’s performance due to its Intel Atom processor:

I can guarantee you’ll be unhappy with the Atom CPU. It’s OK for light web browsing, but that’s it. That’s all. No mas.

I was disappointed, but not surprised, that Intel shows zero interest in making the next-gen Atom faster. Pineview is much better power wise but nil improvement in performance.

The good news is that the CULV Pentiums — like the dual core model in the Acer Aspire 4100 I wrote about — are about 2x faster than the Atom and surprisingly power efficient. Totally acceptable for medium duty laptop stuff.

The key to being satisfied with a netbook is to get out of the Intel Atom ghetto that Intel wants to keep them in…

Visual Studio Express 2010: Too Slow

visual studio 2010 icon As a Developer Evangelist for Microsoft, one of the tools I use most often is Visual Studio, the integrated development environment that’s typically used for developing applications for Microsoft-based platforms, from the desktop to web applications hosted on Windows Server, to mobile apps for Windows Phone and Zune to console apps for the Xbox 360. I currently run both Visual Studio 2008 and Beta 2 of Visual Studio 2010.

Visual Studio 2010 (along with the free Express versions) is the first version of Visual Studio to be built using WPF – Windows Presentation Foundation – the relatively new graphics framework for Windows desktop applications, which makes it easier to give apps the sort of modern appearance that users have come to expect these days. Visual C# Express 2010 and Visual Web Developer 2010 are based on the full version of Visual Studio 2010, and the combination of WPF and the fact that they’re beta 2 and not yet fully optimized proved to be too much for the netbook. I spent a lot of time waiting as they loaded, created new projects, switched views and built apps – more time than I thought was reasonable. I’ve since uninstalled them.

Visual Studio Express 2008: Works Just Fine

visual studio 2008 icon On the other hand, Visual C# Express 2008 and Visual Web Developer 2008 work just fine. I’m having no trouble building apps in ASP.NET MVC, Silverlight or XNA and experiencing no slow-downs. It remains to be seen if the final versions of Visual Studio 2010 with their final optimizations will run without the slowdowns.

I’ll post more updates as I have more experiences!

This article also appears in Canadian Developer Connection.

Categories
Uncategorized

The “Mythbusters” Poster

I love this “Drew”-style poster featuring the cast of Mythbusters:

mythbusters poster

If you’ve been to the movies sometime within the past 30 years, you’ve probably seen a poster by Drew. You can see a catalogue of his posters that were released here; there’s also a page of his “posters that never were”.

This article also appears in The Adventures of Accordion Guy in the 21st Century.

Categories
Uncategorized

CUSEC 2010: Montreal, January 21 – 23

CUSEC 2010 logo

For the latter half of this week, I’ll be at CUSEC – the Canadian University Software Engineering Conference – the annual Montreal-based conference by and for Canadian university students interested in topics on software development and engineering. For a conference that’s aimed at students, it punches above its weight class, having hosted some big name speakers including:

This year’s speaker list is pretty good. Among them are:

  • Douglas Crockford, Senior JavaScript Architect at Yahoo!.  If you truly want to understand JavaScript, listen to this guy! When people were dismissing JavaScript as a toy language – a strange concept in these Ajax-powered days, but this really was the case – he wrote articles like JavaScript: The Wrrrld’s Most Misunderstood Programming Language and other must-read pieces, all of which live at javascript.crockford.com. He’s also the author of the book JavaScript: The Good Parts, which is required reading for web developers. I had the pleasure of meeting him and seeing him speak at the Ajax Experience conference in Boston in 2006, and he’s both a great presenter and guy to hang out with at apres-conference events.
  • Greg Wilson, Assistant Professor at U of T. Greg is many things: much-sought-after provider to academic advice and support at U of T, co-editor of Beautiful Code, DemoCamp Toronto steward, and now, the guy behind the best presentation at the Stack Overflow DevDays Toronto: Bits of Evidence: What We Actually Know About Software and Why We Believe It’s True. It was the presentation so nice, he’s doing it twice – this time at CUSEC. Don’t miss this one!
  • Reg Braithwaite, Superprogrammer-at-large. Whether you know him as “Reg” or “raganwald”, you know that he’s got some seriously big-ass ideas about programming. Very few people push Ruby metaprogramming to its limits the way he does. Every time I see one of his presentations, I come out a little bit smarter.
  • Pete Forde, Unspace. Pete’s one of the “corporate speakers”, a designation that probably makes him feel very uncomfortable. He’s one of the guys behind the Toronto-based development shop Unspace and behind two of the best conferences I’ve ever attended, RubyFringe (2008) and FutureRuby (2009). It’s anyone’s guess as to what he’ll talk about, but it should be good, and we can only hope that he begins it with a dance number, like he did with his presentation at the Mesh 2009 conference.
  • Leigh Honeywell, Symantec. Leigh has forgotten more about security than I will ever learn, and she’s also one of the founders of HacklabTO, the Toronto “hackerspace”.

I had the opportunity to speak at last year’s CUSEC and had a wonderful time both speaking and hanging out with the students. I love the conference vibe – the energy, brainpower and passion of the attendees is palpable, and it makes me optimistic for the future of tech in Canada. I’m only too glad to be able to attend this year, and I’m honoured to be invited to host their DemoCamp event, which will take place Thursday evening.

I’ll be filing reports from CUSEC, so watch this space!

This article also appears in Canadian Developer Connection.

Categories
Uncategorized

jQuery 1.4 Released / 14 Days of jQuery

jQuery logo: "Write less, do more."In case you hadn’t heard the news last week, the newest version of the jQuery JavaScript library, version 1.4, has been released! Even with the new features, it’s still tiny: the uncompressed development version is 156KB and the minified production version is a svelte 23KB when gzipped.

To celebrate this release, the jQuery folks have created a site called The 14 Days of jQuery, where they’ll post all sorts of supporting articles on the jQuery 1.4 for 14 days, starting on the day that was both the release date of jQuery and its birthday, January 14th. So far, they’ve posted the expected download links to jQuery 1.4 as well as a Q&A session with some of the jQuery team, a jQuery podcast with John Resig, a contest for the coolest use of jQuery, a presentation of how to get involved in the jQuery community and more.

This article also appears in Canadian Developer Connection.