Skip to main content

Posts

The Evolution of the FOR loop

The most widely and commercially used languages today are largely based on the imperative and structured programming paradigms and many have a direct and strong roots in the C language of the early seventies. Even though there seems to have been little fundamental change in main stream programming languages over the  last 40 years, there have been subtle shifts in usage patterns, even for things as simple and fundamentally low-level as doing some things repeatedly or in a loop. As a perfectly and randomly useless example to illustrate the evolution of looping, we are creating a list of squared numbers from the positive members of an input list. In C or any similar imperative language of its time, the most basic way to do something like this would be something like: out_size = 0; for (i = 0; i < in_size; i++) { if (a[i] > 0) { b[out_size++] = a[i] * a[i]; } } Languages like C++ and Java, which includes a standard library of higher level collection data types,...

Learning Computers

On Feb 29, the Raspberry Pi foundation launched the sales of a $25 credit-card sized computer, which sold out in minutes. The goal of the Raspberry Pi is to stimulate computer literacy education in schools, inspired by the impact which the BBC Micro computer had on schools in the UK - compared with a similar wave of popular home-computers elsewhere - e.g. the Commodore 64 . I understand the elements of nostalgia of people growing up around the 1980ies for the time when computers where new and exciting. Around that time, I thought myself programming in C and M68000 assembler on a Commodore Amiga and probably learned more in basic understanding about programming and computer architecture than during the years afterwards in engineering school. The home-computers of that era were hackable enough to encourage tinkering and simple enough to allow really getting to the bottom of how they worked. The gap between what could be produced by determined hobbyists and professional software pu...

Tiny, low-cost Linux Device

Recently I was looking around for cheapest, smallest device which easily can run linux and which can be bought in small quantities down to one. The particular application in mind was to build a linux based print-server which exposes legacy USB or network connected printers via Apple AirPrint for iPads and iPhones or Google CloudPrint for ChromeBooks or some Android devices and maybe could provide some other services to such thin-client, "cloud-top" devices (local file server and/or backup, wifi/network gateway etc.). A few years ago, I had a first compact, fan-less home-server in the form-factor of a mac-mini, i.e. about the foot-print of the optical drive it contains. Like the mac-mini, this was basically a compact PC, made largely out of laptop parts. It seems that the clear winner in terms of cost today is the new Raspberry Pi board at $25/$35, whose launch this week caused an Apple-style opening-hour stampede on the online store selling its first production batch...

Securing Gmail

For heavy users of Google services, the gmail account has over the years evolved into a "Google account" and holds the key to an increasing amount of our online activities and presence. Judging from a random sampling of the gmail support forum or some reports in the press (E.g. this recent article from the Atlantic Magazine ) - gmail account hijacking is an increasingly widespread and serious problem. Stolen account IDs from major web-mail providers (gmail, hotmail, yahoo mail etc.) seem to be collected and used at industrial scale for spam generation and fishing for  419 style advance fee fraud  schemes like the infamous " mugged in London " scam described in the article above. The mechanics of some common threats used to steel account passwords is described in this blog post in some detail, but in short it boils down to weak passwords, password re-use and password sniffing malware. Given how prevalent malware infestations are on major OS platforms, even use...

GWT - An Experience Report

As noted before , I am not a big fan of JavaScript as a language for complex web application projects. Recently I got the chance to get some first-hand, comparative experience with GWT (Google Web Toollkit)  as part of an application re-write/upgrade. The original system was a web-app built web 1.5 style in Java, on top of the OpenSymphony WebWork  framework, combined with an XML based template engine and guice for dependency injection on the server side. On the client side, there was a growing amount of JavaScript code for each page, using the Closure JavaScript compiler and library . The app is reasonably non-trivial, resulting in about 40k client-side Java code after the rewrite. For a project of this nature and complexity, I am very positively surprised and impressed with GWT. For the base architecture of the new client, we had basically followed some of the best practices advice for large-scale GWT applications from GoogleIO talks in 2009 , 201 1 or in this docu...

Why Time is hard

At least since the "Y2K problem" entered the public consciousness around the turn of the last century, nobody doubts that correctly representing time in computer systems is somehow hard. While today nobody is hopefully trying to save a few bytes by representing years in 2 digits, the state of time computations in many programming environment is still over-simplistic to say the least. Having (almost) gotten caught by surprise by last years changes to civil time in Russia, this article is an attempt to understand, what it takes to handle time somewhat correctly for business related computer applications. There are 2 common uses of time in computer systems: a monotonically increasing measure representing a global reference clock of some sorts and which can be used to determine an absolute ordering of all events in the system as well as their relative duration. Representation of civil time as it is used by communities of people living in some particular place to go about t...

Android 4.0 (Ice Cream Sandwich) on Galaxy Nexus

I have been very happy with my Nexus One for over two years now, but the news that the Nexus One will not be upgradable to the new 4.0 version of Android put my loyalty somewhat in question. Even though I still prefer the physical look and feel of the Nexus One over the Galaxy Nexus, the larger, crisper display and generally much faster hardware make a switch tempting. There is nothing really in Android 4.0 which is a must-have for me. The new UI design may be crisper, but no quantum leap in usability. One new feature I like is the tracking and control of network usage by application - a feature, I had been missing since day one. With its size, the Galaxy Nexus is practically a "phablet" a phone/table hybrid. It is starting to get borderline in size for me to balance on one hand and still reach all the controls on the screen with the opposable thumb. On the other hand, I find myself to do more reading of news articles than before, using some newspaper apps which have star...

Android 2.3 - Gingerbread?

Maybe it is a sign of maturity for the Android platform that for the first time, I don't find at least one highly anticipated new feature in a new Android release or new phone. When comparing supposedly new flagship phone Nexus S with Android 2.3 with my current Nexus One with Android 2.2, I actually prefer my Nexus One. Gingerbread looks much like a maintenance release, providing a lot of internal cleanup and a very subtle UI face-lift. Since I don't play any games, I didn't notice any of the speed improvements supposedly coming from using native hardware graphics acceleration. The only new major feature - support for NFC tags - is of no use to me, since there are no NFC tags around where I live. Comparing the new Nexus S to the Nexus One, there is not as much of a wow factor either. Performance is about comparable, battery life supposedly a bit worse even, display, physical design and overall build quality mostly a matter of preference. There is clearly not as much of a...

Mutability Considered (Somewhat) Harmful

We recently had a coffee-room discussion on the futility of trying to introduce new relevant programming languages. Computer scientists seem to invent new programming languages on a daily basis - it's an important contribution to conceptual research in computer science and having at least one language to one's name seems to be important for bragging rights in certain circles. However for a programming language to become practically relevant is extremely rare. We can make the somewhat flippant educated guess, that since the dawn of commercial computer use in the 1960ies, there have been about 5 major commercially successful languages: FORTRAN, COBOL, C, C++ and Java - roughly about 1-2 per decade. Certainly, there have been many other vendor and/or domain specific languages over the years or others with a significant popularity, just not enough to make it into the all-time A-list. There are multiple surveys which try to measure which are currently the most popular programmin...

Privacy: the Transatlantic Divide

Despite what the likes of Mark Zuckerberg may say, there are still some people who strongly care about privacy.  This seems to be more so the further east you go from Silicon Valley. And even in the Valley, an increasing number of people are becoming aware of this, even though they may not understand or appreciated the alternate viewpoints. Whenever I am asked for an opinion on the European "obsession" with privacy or for an explanation on why the Germans seem so incredibly hung-up on privacy, my standard answer goes about as follows: Yes, there are indeed differences in the approach and attitude to privacy in particular between the US and non Anglo-Saxon continental Europe, but in substance the differences may be smaller than the commonality. And yet we humans seem to be particularly good a picking out small (cultural) differences and get disproportionately stressed-out over over them. In robotics when a humanoid model is close, but just doesn't feel quite right,  th...

I @#$%&* JavaScript!

I am by no means an expert web developer or particularly familiar with JavaScript, which might influence my distaste for it. My experience is mostly from making small changes in moderately complex existing applications. JavaScript was originally intended as a small domain-specific glue-language to ad some client-side behavior to otherwise largely server-side web applications: do some client-side input validation, dynamically modify the page based on user input, etc. But with the growing popularity of AJAX style web-applications, much of the JavaScript client-side code has grown into monstrosities - mostly because of a lack of inherent support for modularity and encapsulation. One of the most important properties a language environment should support in order to scale to large projects is a way to divide an conquer. There should be a way for one programmer to build upon the work of others without having to understand the implementation details of these building blocks which might be...

The Psychology of Marginal Cost

One of the side-effects of moving internationally is that one is typically required to completely re-evaluate the set of services which we are generally accustomed to - e.g water, power, telecommunications, transport etc. Partly because traditional utilities are very local and partly because the circumstances of life are more or less subtly organized differently in different places. One such difference can be the available pricing models for a particular service - most commonly some form of flat-rate or metered pricing. In areas where both flat-rate and metered pricing plans exist, analysis often shows that even though many consumer prefer flat-rate, the typical user would be better off with metered pricing, as only very few heavy users manage to fully use or "abuse" the plan. Consumers often quote predictable cost and "no bad surprise" at the end of the month as a key benefit of flat-rate pricing. But another interesting observation to take into account is that in ...

Android 2.2 - Froyo

I just finally got the new Android 2.2 release for my Nexus One (it's a long story...). Most of the significant features of this release are behind the scene like increasing java execution performance through just-in-time compilation or increasing javascript performance in the browser by using the V8 JavaScript engine from Chrome. Not sure I really notice much of a difference in everyday use, since I mostly use apps which are UI and framework bound for their performance (no CPU heavy games...) and most web-pages are light in JavaScript and browser performance is limited by network and rendering performance. But still these are very welcome optimization to help improve the platform overall. There are a few small enhancement - most significant for me is the ability to switch auto-correct/complete languages for the on-screen keyboard on the fly, since I write emails and SMS in multiple languages on any given day. There is now also finally a switch to disable the use of cellular data i...

Push Notifications for Android

After struggling with a few apps which use lots of battery and network resources while trying to sync half the Internet onto the device, one wonders if Apple didn't accidentally have a point with their claim that most apps don't really need background processing as long as there is a way to push background notifications to the device. This leads to a split application design, where part of the application resides on a server in the Internet, doing whatever the background service on the device would be doing, but with a lot less worries about power and bandwidth. If there is something new and interesting, a small notification is pushed to the device to alert the user, that there is something worth looking at. As long as the device has network connectivity when the user acts on this notification, the details of this notification might be about is loaded on demand. If mobile networks are ubiquitous and fast enough, the resulting experience is almost as good as an app which contin...

Thoughts on "Making Sense of Privacy and Publicity"

This year's SXSW keynote by danah boyd is probably one of the most insightful contributions to the debate on privacy and social networking. For those who have not yet seen it, the rough transcript can be found here . It puts a finger on so many important points, that it should be required reading for anybody who wants to work on consumer web services. To summarize a key point: in real life things are usually not as simple as they seem. And that's bad news for the technocrats who typically build and run the virtual environments where social interactions are taking place online. Engineers and scientists like to simplify and standardize problems, apply Occam's razor, optimize systems along the dimensions of an assumed known quantitative model etc. The operators of today's large web properties study and analyze their users behavior and think to understand them better than the users understand themselves, but behind the user behavior observable from web logs are layers of s...

From UGC to UCC

I have noticed, that a good part of the articles I read online have been suggested by members of my various social networks. Maybe it is a part of the true utility of social networks to be a platform for "User Curated Content". While the web in its first phase tried to mirror the offline world, by moving every brick and mortar institution and service online, the so called web 2.0 promised a new world of participatory media, where everybody can create content. While digital media have drastically lowered the production costs, the web has driven distribution costs to near zero. Looking around on blogging sites, flickr, YouTube or other cornerstones of the "User Generated Content" revolution there are some seriously talented people out there! Some people have managed to make a mark, some even managed to make a living or become minor Internet celebrities in some field. Some other stuff is whimsical, funny or personal. There are unexpected viral hits or observers who ha...

A day in the life of the Internet

Todays top suggestions on google.com search for "How do I" are: how do i delete my facebook account how do i find my ip address how do i get a passport how do i know if im pregnant how do i love thee how do i look Out of which only #5 has a relatively straightforward answer: ... Let me count the ways. I love thee to the depth and breadth and height My soul can reach, when feeling out of sight For the ends of Being and ideal Grace. I love thee to the level of everyday's Most quiet need, by sun and candle-light. I love thee freely, as men strive for Right; I love thee purely, as they turn from Praise. I love thee with a passion put to use In my old griefs, and with my childhood's faith. I love thee with a love I seemed to lose With my lost saints, --- I love thee with the breath, Smiles, tears, of all my life! --- and, if God choose, I shall but love thee better after death. Sonnet 43, Elisabeth Barret Browning

IT != IT - the Case for a Differentiated Immigration Policy

The Swiss government recently reduced the quota for work-permits for applicants from so called 3rd-states - which typically means countries outside the EU and not covered by the free-trade treaties between the EU and Switzerland. After a highly publicized protest led by high-tech companies like Google, Microsoft and IBM, the Swiss government has rather quickly reverted its decision. In the midst of a recession with higher than usual unemployment and increased levels of immigration from the EU following the free-trade agreements, the general mood in the population is not very supportive of any increase in immigration quotas. This is seen as yet another attempt by greedy corporation to undercut the Swiss standard of living by importing cheap labor from overseas - typically from south-east Asia in what is generally by called the IT or information technology sector. How can there be a shortage of IT labor, if almost everybody knows someone who is unemployed and supposedly somehow "in ...

A Game Changer for Public Transportation Users

My favorite and most used app on Android isn't even an app, but rather a service. It is the Google Transit public transportation directions feature in Google maps, which can also be accessed more easily through the Maps application on Android - or on any other mobile platform which supports Google Maps for mobile . In combination with the extremely dense and frequent network of public transportation in Switzerland, the transit directions on the phone offer a level of spontaneous mobility, which is generally associated with driving. When it came to using public transportation networks, people tended to know the routes by heart which they frequently travel (e.g. daily commute), while anything else required thorough planing by poring over books of printed time-table - an activity enjoyed only by the most hard-core train buffs. The Swiss public transportation systems has always been particularly well integrated, across all providers and including everything from urban transit, buses, ...

One Password to rule them all

I am notoriously bad at memorizing. If not, I might have gone to medical school and chosen a more lucrative career than Engineering... But as the number of online services I uses increases, so does the number of account username and password combinations. I try to standardize as much as I can on the same usernames(s) but some sites make this really hard by requiring strange and unusual conventions (name must be at least 8 characters long and include at least special character and number??? Whose name looks like that?) or by dictating that the username be whatever 10 digit number their database uses as the unique key for the account record. Same drama for the passwords, except that using a standard password everywhere has the added disadvantage that once the password is compromised, the attacker would have access to all my various online service accounts - if sHe could guess those bloody convoluted usernames... ;-) Things got particularly bad for accounts, which I use very rarely and w...