My Octopress Blog

A blogging framework for hackers.

Inconvenience Means Unsecure

It’s been said many times many ways, but the weakest point of a security system is the user.

Feynman had a great story about the commanding officer at Los Alamos demanding the most advanced safe available for all his secret documents. This was problematic when the CO passed on before revealing the combination. An amateur lock-picker, Feynman was extremely interested in how the “pros” solved it. It turned out to not be that hard, as it was still on the default combination.

There is a door on campus that is extremely convenient to use as an entrance, but for “security reasons,” it was designated as an exit-only door, and cannot be opened from the outside. Enter ingenuity. We put a doorstop in it, propping it open, nullifying all the security value it would have otherwise had.

Tyler, a friend of mine, pointed this fact out - that by making the “real” solution difficult, they’ve shot themselves in the foot.

Another appropriate example is one of our computer labs. On the entrance, there’s a device that requires a password and a fingerprint scan, but anyone who’s seen “Spaceballs” could guess the combination, and the scanner at this point doesn’t recognize any fingerprints - it just requires that there’s a finger placed on it. An alternate method to gain entry is to slip in a credit card into the door. As a result of the scanner being difficult to set up, any purpose it might have had is gone.

Of course, it’s difficult to get onto campus in the first place, so this aren’t huge issues in my mind, but they seem overtly serious about security when clearly they are not. I get hassled regularly by security guards demanding to see my ID, and yet I’ve had a backpack, a camera and a Nintendo DS stolen. In separate incidents. The camera was even taken from a drawer which is locked more than 95% of the time. In my office. In the building with the highest security priority.

Call for Applications: Professional Smooth-Maker

My colleagues and I have formulated a new position (unfortunately fictitious) for KAUST: professional smooth-maker.

There are a number of small problems here, and under the collective weight of these straws, the camel’s back is breaking. No working printers in the library. No wifi access in most classrooms. No working projectors in many classrooms. No dishes in my home. No solution in sight.

With the money that KAUST is dishing out for various events and items, they would be better-served to set aside a certain amount in their embarrassingly large budge to fix problems in an ad-hoc fashion. Many of these issues will not be fixed in the near future, and in the mean time, we don’t have books for some classes still. People are scrambling to put the permanent solutions in place, but in the mean time, it’s as if we’re holding our breaths - hoping that we’ll surface from the ocean of incompetence soon.

A man about campus, man of the people, he’d trawl around seeing problems and fixing them. Hire a guy for this, buy that piece of crucial equipment.

While the rest of the administration is bogged down in bureaucratic black holes of paperwork, he’d be a classic cowboy hero - arrive just in time to save the day and ride off into the sunset. Victory for all.

This may not work in implementation, but students are forming their own ad-hoc solutions. Like a wiki for information about how things work on campus (like when the medical center is open) as the school hasn’t made it easy to find out. Or a forum for addressing issues as the school’s pricy issue-tracking software wasn’t rolled out in time. Why not embrace that this project is in flux and subject to rapid change and facilitate these solutions?

Home

A few days ago, I finally moved into what I’m told will be my permanent residence at KAUST.

I left the United States on August 16th making it almost two months of living out of a suitcase, sleeping in eight different beds in various places and cohabitating with a number of people. It’s far from perfect, but to have a home that will remain the same is enough for now. About half of the possessions I brought with me had not left my suitcase for those two months.

I’m moving furniture around and cleaning this weekend, but I’m very excited to nest. This may very well be where I live for the next several years of my life.

I’d post pictures, but the camera I got this summer (a Nikon D60) was stolen this week. My backpack and headphones preceded it in disappearing, and so my friend Tyler and I will be setting up a hidden spy camera in our office to hopefully get some of our belongings back or at least catch some nefarious individuals as security staff has been less than helpful.

OpenGLot

As a teaching tool for a course last semester, I put together an interactive plotter in openGL which I endearingly named “openGLot.” (For those who missed it, “openGL” + “plot” = “openGLot.”) See, I felt like I had to give it a very unsavory name so that if it ever became widely used, people would be forced to use its ill-sounding moniker.

At any rate, I originally wrote in Ruby, but have been slowly porting it to C++ with high hopes for its use and applicability. I still have a bunch of interactive demos for numerical methods (from Newton’s method to the trapezoidal rule for numerical integration) in the Ruby version, but I’ll be bringing those to the C++ version one of these days. I started a sourceforge project for it a while ago, which was kind of exciting.

At any rate, as a brief (albeit nerdy) respite from the academic onslaught today, I added a class for parameterized curves. [caption id=”attachment_618” align=”aligncenter” width=”289” caption=”A demo of a parameterized curve in openGLot”]A demo of a parameterized curve in openGLot[/caption]

I’ve got a bunch more primitives to add to it (scalar and vector fields, for example), but those will surely come one of these days. I’ve added adaptive mesh refinement (so that “busier” functions require more sampling to get a more accurate visual representation), but I’m still not quite happy with it. [caption id=”attachment_619” align=”aligncenter” width=”289” caption=”A "busy" function with no adaptive refinement”]A "busy" function with no adaptive refinement[/caption]

[caption id=”attachment_620” align=”aligncenter” width=”289” caption=”The same "busy" function with recursive refinement.”]The same "busy" function with recursive refinement.[/caption]

I’ve also got a 3D version, but that’s not been polished or formalized, but everyone loves a pretty graph: openGLot3D

Netcat(1) [Command Line Ninja Magic]

The best way to learn what command-line tools you should be using is to hang out around system administrators. There are a couple in this office space, and they’re always willing to give advice about which utility you should use instead of another.

I’ve been using scp and rsync since I started using bash, and thought they were the bee’s knees. Of course, they certainly have their purpose, but when it comes to sending files over the tubes quickly, I’ve learned of a better one: nc / netcat.

It goes like this: you’ve got a big file to transfer, and the tubes aren’t really your bottleneck. You might not care about security in this instance, but just want to get it done quickly. You start the netcat daemon on the remote machine, it listens on a port, and then things that get sent to that port are output to a file on that box:

my-remote-machine $> netcat -l -p 1234 > ubuntu.iso

And then on the machine I’m transferring from:

my-local-machine $> netcat #remote-ip 1234 < ubuntu-9.04-desktop-i386.iso

With scp for this same task, I was clocking about 28 MBps, but netcat posted 47 MBps pretty consistently. This is a neat little tool I will be using with some regularity.

Empirical Mathematics

As I read in a lecture recently, Richard Hamming described his philosophy of computing with, “the purpose of computing is insight, not numbers.”

On a relatively regular basis, I use numerical methods to verify an analytical solution I’ve reached and occasionally, to reach an analytical result. At one point, I was playing around with the time complexity of heapsort, and I came across a statement about which I was unsure. I verified that it was the case, but it brought about other questions about a more general case.

How does this converge for different ’s?

I played around with it for a little bit to see if I saw any pattern that emerged, like with a geometric series or an arithmetic sum, but I came up with nothing. So, I decided to explore the numbers a little bit, writing a short little Ruby script to take the first 100-or-so elements. It turns out that even this approximation provided the insight to get the general expression:

  • $$n=2 \Rightarrow 2$$
  • $$n=3 \Rightarrow 0.75 = \frac{3}{4}$$
  • $$n=4 \Rightarrow 0.4444… = \frac{4}{9}$$

The expression thus seemed to be:

Of course this needed to be verified, but that task is easy enough. The point is, that sometimes the numerical approximation can give you the exploratory insight needed to solve a problem. Sure, it’s rough around the edges, and isn’t as elegant as I would necessarily like, but it’s very useful.

KAUST Panorama

kaust_cropped

Probably the most attractive (read: finished) part of KAUST at the moment.

The Incredible Screen Capture

It has occurred to me recently (or rather the possibility was suggested by a friend) that as a computer scientist, I’ve become so far removed from the “normal” use of computers by “Joe Sixpack.” I have a set of tools, programs, utilities that I use and love and imperialistically think everyone should use and love. I caught myself suggesting that someone use a command-line tool called “ffmpeg” to convert his videos.

That said, there is something incredibly useful that I think more people should know about and use: screen captures. They’ve been around forever, but they’re usually a deeply-buried feature (at least in OS’s I’ve used). I clearly focus on how to do this in Mac (sorry fanboys of other OS’s).

How To:

  1. Command-Shift-3 - Captures the whole screen. If you have multiple monitors, it will capture everything visible.
  2. Command-Shift-4 - Captures a selectable area.
  3. Command-Shift-4, then Space - This is the one I use most often as it allows you to select a window. It’s quicker than drawing a box around the window, and the results look much nicer.
  4. Home-Power Button - On the iPhone / iPod Touch, hold the home button and press the power button. Release.

iPhone / iPod Touch:

  1. Quick-and-Dirty Save - I saw a friend scribbling down notes off of his iPod touch onto some paper. I asked if his battery was low, and he told me that it wasn’t, but he didn’t have wifi where he was going and might need to reference something. A screen capture is a great way to get a quick-and-dirty save of information you might need to reference. It’s not perfect, but it’s dead-simple.
  2. Slow Connection - Whether you’re out in the boonies or just on an incredibly slow connection or have had to navigate some terrible website, once you get some information, instead of playing Safari-Roulette (whether or not it will decide to refresh from the server), a picture might be sufficient.
  3. GPS - The built-in Google Maps doesn’t have waypoints, and so when I’m out and about with friends or on a hike, at the beginning, get your location on Google Maps and screen capture it. That way you don’t have to remember the intersection or where the trailhead was.
  4. Directions - I love the Google Maps app, and though it has destroyed my sense of direction, it’s pretty useful. However, when you see the list of directions, if you close out the app (and sometimes even if you don’t), it will re-ping the GPS and that consumes time and precious battery life. Screen capture all the directions for a quick reference.
  5. Anything Laggy - The general principle is if it might be slow to get back to, take a screen cap. I had a lab I needed to repeatedly reference in the field, but viewing the whole PDF was very laggy, but I didn’t need to see it in full resolution.

Computer:

  1. Diagnosing Problems - If you are friend, family or colleague get in touch with me on AIM or email to help you solve your tech problem, do me this incredible favor and include screen captures of what you’re trying to do and what’s happening.
  2. Describing How To - When conveying how something’s done, instead of describing where this button or that button is, or what text field to enter something, show the person. Screen captures make people feel confident that they’ve entered everything in correctly.
  3. Spotting Bigfoot - Being quick on the keystrokes can be essential for documenting anomalies. My favorite such screen capture is I once got a debugger (not just any debugger - gdb) to crash. The tool one uses to figure out why programs crash, crashed.

Look and Feel - Here are some examples of what the different methods look like: [gallery link=”file”]

Bonus : Marking It Up - Whenever you want to mark things up a little bit to draw attention, there are a bunch of tools out there.

  1. Skitch - http://skitch.com/ - You can quickly and easily mark up pictures and upload them to Flickr, Skitch and other places. [caption id=”attachment_597” width=”300” caption=”Drawing focus to certain areas.”]Drawing focus to certain areas.[/caption]
  2. OmniDazzle - http://www.omnigroup.com/applications/omnidazzle/ - Highlight as if with a spotlight (or other visualizations) certain areas of the screen. I use this all the time when lecturing or demonstrating something. [caption id=”attachment_598” width=”300” caption=”A demonstration of OmniDazzle”]A demonstration of OmniDazzle[/caption]

How to Ensure Failure

Manhole Fail

Why are manhole covers round?

I was reading an interesting piece recently about survivor bias. It was a book (I’ll try to find it again in the library) talking about building strong companies and they presented a criticism of other such books: that they only tell you what strong companies do. It’s equally important to understand the reason for failure among companies that flounder. They gave a very tangible and compelling example:

During World War II, the Royal Air Force would send planes out on missions and some would return home and some would not. They noticed that of those that made it back, bullet holes were concentrated on certain regions (like the wings and rear gunner positions). Seeing as reinforcing against bullets was costly and also added a lot of weight to the planes, they came up with a perfectly-reasonable-sounding idea - let’s just reinforce the areas that seem to get hit most. They followed through with this inspired idea but found that they did not see any improvement in the rate of planes that returned home.

What they should have done, as this book points out, is to reinforce the places that didn’t seem to get hit on the planes that return. That’s because that’s precisely where the planes that didn’t make it back were hit, and they were seeing a sort of negative filter of the weakest points on the aircraft. Survivor bias - a systematic skewing of data based on patterns in groups from which you gather your data. In some sense, talking about what’s great about successful companies is committing the same mistake.

I am a big believe in `lessons-learned.’ After a project, it’s good to reflect on it, and think about what you’d change. What worked well, and equally importantly, what did not. Similarly, I encourage people to report negative results in their work, as they are sometimes just as useful.

In terms of ensuring failure, I’ve been taking note of a lot of things in the management of this project (the instantiation of this school) that I would change. If you want to make your life more difficult, here are some things you might try:

  1. Keep No Real Records - What we see when we go to the housing office is a couple of guys sitting at a solitary computer and a man with a cell phone and sticky notes sitting at a table. We tell this guy what’s wrong with our apartments, or what we’d like to know, and so forth, and he writes this down on a sticky note. I’ve been asked over a dozen time for my email address by the housing office alone, and I’ve had to explain to them as many times that I don’t have a cell phone. And yet, when developments occur, they try to contact me by phone. It’s an endless game of “telephone” where over successive conveyances of information, the message becomes utter garbage. My friend Ben has had his dishwasher checked 4 times by housing maintenance, but it’s his washing machine that’s broken. At the point of collection, make widely-accessible notes of the issues. Better yet would be to allow students to describe in writing their problems directly. (This is especially important when accents are often so thick as to be unintelligible.) It’s almost as if there were dozens of commercial and free tools out there.
  2. Don’t Use Your Products - I swear that our toilet paper dispensers were designed by people who don’t use toilet paper, and our faucets by people who don’t use water faucets. With respect to the faucets, the area of activation for the soap dispenser is a superset of the area of activation for the water, meaning you can’t get access to water to rinse your hands without having more soap applied. There are more examples, I’m sure.
  3. Foster Resentment - Treat your clients like incompetents and infantilize them at every step. When they ask for assistance, give it to them in the most inconvenient way possible. I’ve been moved twice since on campus, and each time they’ve given me a 30-minute window from the time I bring up the problem. I have since learned to pack all my belongings in about 15 minutes, but it’s not how I’d like to be treated. Our campus recently hosted 60+ leaders of various nations as part of the inauguration and other VIPs totaling 3,500. There was no room made for the student body one tenth that size. I was sure that the reason for this was the security concerns, until the night of the event they realized they wouldn’t fill the space and sent out buses to campus to round up random people to stand in for the event. It sends a clear message about who this event was for. Even now, some of us have been moved into the maid’s quarters of houses on campus; these serve as a bedroom - 30 square feet all to yourself.

I didn’t mean for this to turn into a rant, but I meant rather to illustrate some organizational observations. Tying this back to the picture at the top, it’s a question commonly asked at interviews (from PhD programs to Microsoft) - why are manhole covers round? It’s because otherwise hard hats would have to be a lot harder. If it’s square (like this one on KAUST campus), the 100+ pound plate can fall down the manhole itself.

The Middle-of-the-Road Truth About KAUST

KAUST is a beautiful idea. In the king’s wisdom, he saw that oil would not last forever and for reasons pure and pragmatic, he commissioned an institution that would provide clever people with the tools they needed to grow science. And for this, I am very grateful to the king. Thank you.

That said, there have been issues. Birthing pains. And there were bound to be some. Anyone who writes code knows that nothing compiles the first time around, and even when it does, it rarely works exactly as planned. Early adopters know that a product is a brilliant idea in principle but there may still be design flaws in the implementation.

Last night saw the inauguration of the school. The king came to the school (along with 3,500 of his closest friends - leaders from various countries, nobel laureates, distinguished guests) and there was a very long and involved ceremony. Given the guest list, I understand that there are security concerns and not everyone can attend, but the initial plan for the ceremony did not include students. Or much of the faculty. Upon learning of this, a petition went around, was signed, and we are told eventually reached the king himself and he extended an invitation to one student per country. These students were then included on stage during a reading of poetry to the king.

I find it very symbolic that these students were then not guests, but performers. Perhaps it’s ego-centric or self-involved to think that it’s the students and faculty who make the school the school, but they’ve been telling us this from the beginning. Why then, did we watch on TV an event that was happening on campus? And as far as the security concerns go, we all submitted to background checks, and “police clearances” and the extensive medical tests. Oh the medical tests! I literally gave more blood samples and stool samples for getting my visa than I have in the rest of my life. We’re academics - not zealots or crazy and dangerous people.

I imagine that it’s different in a monarchy. I realized in watching the festivities, that the people presenting and speaking at the event were proffering a gift, or a thanks. A promise to the king that they hoped and prayed he would find pleasant as a man with absolute power in the land. I tried to imagine an analog in the United States and I couldn’t think of one. There are ceremonies like this stateside, but they are displays of gratitude without the fear or reverence.

KAUST has to walk a fine line - the Saudi general population sometimes feels as though this is too free or too liberal a place while many of the people who constitute the school feel it’s too restrictive. That’s in part because we were promised that there would be no segregation when we got here, and there is. We were promised that there would be no dress code, and though it’s not always strictly enforced, there is one. We were promised we would have unfettered access to the internet (we were incredulous, but that’s what they said up until we got here), but many legitimate things are censored. I understand that there is a tight-rope walk in play here, but at the same time, it’s hard to ask people to stay and work in the name of the king when there is greener grass elsewhere.

I stay and will stay because I believe in the dream. I laud King Abdullah for his insight and inspiration. It’s with certain implementation issues that I take exception.

I have been asking for two weeks whether or not my permanent residence is ready. I look forward to making this campus my home, but while we’re living out of suitcases for the last six weeks, it’s impossible to be settled. And despite asking and asking the people they’ve told us to ask, no one can tell me if my home is ready for me. The people who will be my next-door neighbors once I move in… they have been living there since the beginning. Sure there may be a problem with my apartment only, but why can no one tell me?

Things are getting better (we’re getting put in touch more directly with the people in charge of housing, IT, and other issues), but there’s still a ways to go. Perhaps with this inauguration over, things will clear up more, but I feel it’s been very trying and a lot to ask of students. And more than students, it has been a lot to ask of the families of students and faculty that have joined them here. Some professors haven’t been able to live in a house with their wives and children under the same roof because their homes aren’t ready.

The coverage of the school that we see is all roses and sunshine. And by and large, I agree - it’s very impressive and I very much look forward to working here. But I take that coverage as a slight. I find the KAUST Inauguration Twitter feed particularly revealing.

On the one hand, it’s hard to look a gift horse in the mouth, but I would a smaller and less problematic gift horse. They’ve given us t-shirts and messenger bags and thumb drives, but I want a web page with the bus schedule on it. They’ve given us apartments with 10 chairs and granite countertops, but I want a reliable internet connection. I don’t need or want the flash - I want the tools I need to do the work and research for which I came to this institution. Access to a printer that works has gone a long way. More paper for it, however, would be much appreciated. All these great whiteboards everywhere in the office area where I do my work are awesome! There are the whiteboards where interesting and important discussions will will take place. Markers would help. I don’t need a doorman at the entrance to every building. I need someone to fix my washing machine.

It’s not as though there aren’t resources enough - it’s as though the pieces are there but they’re not clicking. We have the money to actually have books in the library, but somewhere along the lines, the people in charge of ordering books neglected to do so, and so the staff is driving to Jeddah on a daily basis, buying books at what is essentially Borders, and driving them back here. I’m sure there’s a repository of paper and markers somewhere on campus, for the life of any of us, no one can tell us where that is. There is a symposium today that’s going to be very inspiring and filled with impressive people that I’ve been looking forward to for two weeks. We had to RSVP a week and a half in advance, but I haven’t been told what time it starts or where. And yet no fewer than 6 people have come by my desk to check whether or not my lamp works. My lamp works. My phone and internet connection don’t.

In order to get onto the compound, we have to present student IDs. Presumably, then, people walking into academic buildings carrying a backpack are students and are allowed to be there and are trusted. But I have to sign in at a security desk if I go in the main entrance to my building, and occasionally have my bag searched.

This has grown longer than I intended, but the thing I hope to have impressed upon you is this: I’m grateful to the king. Very grateful, and I wish I knew how best to convey my gratitude. That said, I wish we could get to work, manage ourselves as competent and trusted colleagues. We very much want to build this community and start making our homes here. To the administration: please allow us to do so.