StackOverflow Summaries and Opinions 2011

January 18th, 2012

I’ve not been posting on this WordPress blog very often this past year. That’s despite actually doing more programming-related explorations than I had in a long time. One of the key reasons is because I found more “instant gratification” (and sometimes “instant frustration”) by participating in the online question-and-answer site StackOverflow.

Like Wikipedia, StackOverflow is a collaboratively-edited body of knowledge. Also like Wikipedia, it is curated by (mostly) volunteers who’ve agreed to use the “Creative Commons Attribution-Share Alike 2.5 Generic License” a.k.a. CC-Wiki. But unlike Wikipedia, S.O. is a closed-source system written using proprietary server-side Microsoft technologies. The people running it are a for-profit business, with paid advertisers and venture capital investors. Their profitability enables them to keep $100 bills in jars of their company snack room:

the StackOverflow snack jars

I don’t begrudge them their success. But while the site can be snapshotted and mirrored, it’s certainly not free of lock-in for tracking question history and other integral site features. Due to the aesthetics of the programmer-types running it, quality and improvements have moved ahead quickly…so far. I will remind everyone that seemingly trustworthy and upstanding programmers have sold out sites hosting my content in the past for something “as petty as money”. (Remember LiveJournal when Brad Fitzpatrick ran it, vs. when it was sold and covered with full-pop-up-video advertisements, feature stagnation, and possible KGB oppression by its new Russian owners?)

So I remain a little skeptical. But I did learn a lot by participating, which for me meant reading a lot then answering many more questions than I asked. I’ve been at times awed by the extremely detailed knowledge some people have…and how quickly one can get a thorough and elegant answer. At other times I’ve been amazed at what jerks some of those same incredibly knowledgeable people can be, for no apparent reason. (It’s less surprising when people whose knowledge does not impress me are jerks…that’s status quo for the Internet!)

Because I’ve recently taken on the organizer role of the Austin C/C++ Meetup, I’ve been introducing myself and sharing links to this creaky old WordPress site. So it seems good to share a few of the high-and-low points of what has been my substitute for a programming blog in the latter half of 2011. Sometimes funny, sometimes enlightening, sometimes lame—and sometimes all three! Read on…

Read the rest of this entry »

Virtual Machines and the *Very* Genuine Windows Dis- Advantage

June 17th, 2011

Over the years I have come a long way toward a close philosophical alignment with the Free Software movement. Yet I’ll shamefully admit that my two computers are an iMac running OS/X and a Acer running Windows 7. Of course, nearly all of my projects are undertaken in Linux virtual machines which I fire up in the host environment. I just didn’t want to cope with issues of finding drivers for the proprietary hardware of machines that were already “working”.

This week I took one more token step toward a free software stack, by migrating from proprietary-ol’ VMWare over into open-source VirtualBox. Although they use different virtual disk formats (VMDK vs. VDI) it is possible to convert between them using a free tool, just like this:

VBoxManage clonehd image.vmdk image.vdi --format VDI

Yet the format of the virtual disk file is a minor hurdle in the scheme of things. The real problem with switching from one virtualization system to another is that all the “virtual hardware” changes. You basically have a whole new video card, processor, BIOS, sound device, keyboard, ethernet interface—everything changes. There can be problems booting after the switch if the operating system tailored the installation for only the hardware you had at the moment you ran the setup.

Fortunately modern operating systems were designed to roll with such punches. Manufacturers and users alike will pull parts out of the computer and put new ones in. So there’s enough of a “lowest common denominator” lingo that even super-futuristic graphics cards can go into a 640×480 mode long enough to let you see the dialog boxes for installing a smarter driver designed for it. My Linux installs came through just fine.

But I keep a VM for Windows XP too, that I pull out in those circumstances when I need such a thing. Predictably…Windows had some esoteric trouble on VirtualBox with agp440.sys and intelppm.sys. A helpful article I found suggested to essentially delete them and it starts working. I did a little reading and agp440.sys is related to a deprecated standard called the Accelerated Graphics Port; it seems that removing it does not seem to prevent the Virtual Machine from having accelerated 3D services. intelppm.sys is related to power management and turns off the processor if the CPU is effectively idle, so it is likely superfluous to a virtual machine.

(Note: I did have to turn on the VirtualBox setting for enabling “‘IO APIC” to appease mup.sys but did not see the CPU utilization bug mentioned in Ticket #638. So I decided not to follow the convoluted process of using SysPrep to rewire things so that I could turn that check box off.)

So after a couple hours of tinkering, my Windows VM came up under VirtualBox…though it gave me a warning. My hardware had changed sufficiently that its “Genuine Windows” status was invalidated. It told me I would have to activate it again within 3 days.

“Or what?”, you may ask.

In this case the “or what” is “we won’t let you into your system”. You type in your password and it announces that you’ll be going into the activation process right now, else no soup for you. It didn’t even give me the 3 days it claimed; in the course of less than 24 hours it decided to jump me straight to OS death row.

(A long way to go, just to harass users of an operating system the company DOES NOT EVEN SELL ANYMORE.)

My one copy of XP is very old. The wily holographic disk has the orange license key sticker stuck directly on it. I’ve used it on several computers, all of which basically either died and got thrown away…or were formatted with Linux and given away to charitable causes sans any of my personal info. Yet I don’t know how many times I can push this magic “activate” button before it decides to say no. Plus I hadn’t even installed the VirtualBox tools that let Windows magically embrace things like integrating the mouse pointer with the host…what if I activated, then installed those, and it decided it was a new computer all over again?

As it happens, I restarted in Safe Mode and it decided to let me in. I installed the VirtualBox tools and rebooted and clicked “activate”. It let me activate (for now…at least while these activation servers happen to be around.) But this is another zen lesson about what it means for something to be Defective By Design. My small dependence on a few Windows tools and desire to assist people with problems (such as porting solutions to not need Windows) will hopefully be phased out before I should ever encounter another Genuine Windows Disadvantage!

South By Southwest and Austin Migration

March 11th, 2011

Sorry for the lack of updates to the blog, but February was a busy month of leaving Los Angeles for Austin, March was taken up by SXSW, and April will involve finding a new apartment and furnishing it. But I hope to return to recreational programming and writing articles about it soon enough!

(Note: If you’re visiting the site because you met me in Austin and got my card & want to talk more then please feel free to email/call or leave a comment.)

UI Should Be More Than The Data Structure

January 10th, 2011

There was an interesting question on the User Interface discussion board at StackExchange. It regarded how to make an interface for letting a user enter numeric ranges, and then specify a label for anything that falls in that range.

A real-world example might be how percentages are turned into letter grades, such as 97-100 for an A+ and 94-96 for an A… and so on. But the mock-up data used in the provided example was:


Less than 20 Default
20 .. 40 blah
40 .. 80 next
More than 80 something

A constraint was that the ranges would not be allowed to overlap, and the question was what would be the best UI for this task. Rather than just draw a picture in response, I open-sourced a working online implementation of something I called jquery-numband:

Though it’s only a prototype, it offers an efficient angle on this question which starts with a freeform input box. You can paste any text into that box and it will only pay attention to the numeric values (which need not be integers). These numbers are sorted, it will throw out the duplicates, and generate the appropriate non-overlapping bands for you.

Once the bands are formed, you can enter mapped values for each. You can also click on some triangles next to the numbers to indicate if occurrences of that precise value should be considered in the band above -or- below it.

Editing the split points directly on the bands isn’t allowed (for now) but you can amend the main text box. If such an edit disrupts the boundaries of bands you’ve already used then it saves a “history” record to avoid data loss. If that precise band should reappear, the history record is reabsorbed to repopulate it.

You can try it out online to get a feel for how it works:

http://hostilefork.com/shared/jquery-numband/

I wrote this to make a point…

Programmers are clever because they find ways to keep the system from getting into a bad state. If the spec asks for non-overlapping bands you don’t want the user accidentally winding up with a dozen identical bands. It’s also desirable to stop nonsense like ranges from (0.2 .. Banana). The ability of software to constrain this is a big part of user interface.

However this can lead programmers into a blind spot when looking at this kind of a problem. They make the only elements on the screen ones that correspond to some piece in the final target data structure. UI buttons aren’t allowed to break the “programming rules” of that underlying data, so they become tantamount to an exposure of the API for operating on it. The result leads to a modal interface that handcuffs the user.

I avoided that trap by bringing in a freeform text box and a range history, while still keeping the user’s eyes on the final data structure. The result let me exploit a lot more of what computers bring to the table, such as sorting the numbers and quickly filtering through information that might even come from a copy/paste.

I’ll come back with more detail in this post, but in the meantime you can see examples of what I’m critiquing in the other interfaces here:

http://ui.stackexchange.com/questions/2898/how-to-create-bands-of-number-ranges-for-a-field/

Imagination Squared (Plus OpenZoom)

September 12th, 2010

There is a community driven art project in Jacksonville Florida, called Imagination Squared. The idea was to have hundreds of members of the local artist community each contribute a small square that they’d decorated. The squares were all a standardized size, and they were all tiled together in an art installation.

Curious as to what people had sent in, I looked through the site. The art page had hundreds of 100×100 pixel thumbnails, and you had to click on individual ones to get to a larger-resolution 300×300 picture. This struck me as an obvious application for the Microsoft Research PhotoSynth/SeaDragon zooming that was infamously demonstrated at the TED conference by Blaise Aguera y Arcas.

I wondered how the Free Software folks had been faring in creating an open-source variant of SeaDragon. Doing some searching I was pleased to find the OpenZoom project. You can see they have a number of cool examples, and I thought the ImaginationSquared project would be an example that would interest a lot of people (the hundreds who contributed squares, at least!)

So here’s the promo video for what I just released the source code to this morning:

Though I’m not going to host the player on hostilefork.com, I pushed the source code out to GitHub today for both the generator (written in Ruby) and the viewer (written in ActionScript 3). I’m also happy to provide built versions of the data and component to individuals who want them:

http://github.com/hostilefork/openzoom-squared

Neither of those two are languages I’ve used before. So I’ll use the rest of this blog entry to talk about my thoughts on that.

Read the rest of this entry »


Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported