Posted on May 5, 2011

Machine Learning cheat sheet

For a recently taken course in Machine Learning, a substantial part involved learning and applying linear classifiers and clustering algorithms on smaller data sets. In order to summarise the most important material, I created a cheat sheet in LaTeX. I figured someone else might appreciate it as well, so why not make it available for more people than myself?

cheat sheet preview

.pdf can be downloaded here.
.tex-file is on Github here; feel free to modify or add information. Please let me know if you find mistakes!

Note that his document was really only created for my own study purposes, and hence might be of limited use for others. Hopefully not, though.

EDIT: Discussion on Hacker News: http://news.ycombinator.com/item?id=2515612

Posted on Apr 12, 2011

Implementing durability for in-memory databases, on SSDs

As the examination for a recently completed course in Database Systems Implementation, students had to implement a durable, high-throughput, in-memory key/value database for strings, coincidently the same problem as this year’s SIGMOD programming contest. I thought I’d present aspects of my own implementation of durability, focusing on problems I encountered and how I solved them. I also relate parts of my solution to existing NoSQL databases as well as how SSD disks can reduce the sophistication needed for a good-enough solution.

Perhaps the main problem of the programming contest lies in implementing the in-memory data structure itself, with issues such as concurrency control and efficient string comparisons. I will, however, assume such an arbitrary data structure, and focus this post on implementing durability.

Disclaimer
This is by no means efficient, beautiful or advanced, and ideas should probably not be copied without first dissecting them with experienced eyes. I learned as I proceeded, and I have essentially no prior knowledge of databases up until this course and assignment. This post is written for unexperienced enthusiasts like myself; for others there is probably little new.
Continue Reading

Posted on Oct 21, 2010

Dumb pipes — a (young) developer’s perspective

The openness of the internet is no doubt the major contributing factor for its success. Through the simplicity of dumb pipes, and with timeless principles such as the end-to-end principle and network neutrality, the internet grew and became what it is today: relevant for everyone, everywhere.

At least this is my opinion. Others, mainly telecom companies, argue that a more regulated and “smart” internet is necessary for its future expansion. Through “smart pipes” a better internet can be constructed, where the idea seems to be that intelligent wiring allows for more features and markets to be exploited, mainly by telecoms.

However, I believe there are important issues to be raised, and for relevant arguments to be heard, in favor for the pipes to remain dumb.

First and foremost, the fact that no smart pipes were needed to build today’s state-of-the-art should be a strong argument. On the other hand, the established internet is different today than it was during its build-up phase. The question is, then, whether the future expansion demands deep-packet inspection and other such technologies?

This question can only be answered with business cases detailing important end-user problems that would be solved, should these technologies be implemented. Examples where smart pipes are falsely claimed to solve problems are spam protection (already solved for end-customers; I haven’t seen spam in 5+ years), location (already solved by GPS, or location-databases such as Skyhook) or streaming (my YouTube works fine, thank you very much).

Regarding tiered pricing, service-specific connectivity or any such regulatory “innovation”, I’m afraid they will produce walled gardens that are, at best, only slightly cheaper for the end-customer — a discount not worth paying for.

In the future, three scenarios may emerge. Hopefully smart pipes will be used for solving some problem in need of real innovation. Alternatively, they will simply produce software-services by companies whose core-business is not software — harmless but useless. Finally, and most dangerously, they might contribute to a radical change in end-user connectivity. This scenario is frightening because there is nothing I, as a developer, dislike more than walled gardens.

The vast majority of the creative and profitable internet is the product of young programmers’ ideas, and therefore the industry’s continued growth is largely dependent on these people remaining innovative. Dumb openness is the way to go — because creativity does not thrive within walls.

Posted on Sep 14, 2010

That big magical goal

There is a fine concept called “fuck you money” (which proves that it comes from America) that essentially means a large enough amount of money that allows you to completely decide over your lifestyle. It’s enough so that you can say “fuck you” to anyone, anywhere, because you don’t need to reassure your wealth.

While those amounts of money are rather hard to make, there is a much finer achievement of equal or greater significance that anyone can reach. Call it the “fuck you goal”, or simply that big magical goal.

You know it by certain characteristics, and it’s completely personal; only you yourself know what it might be. When you reach it, though, it will define you from there on — because you will have proven something to yourself that no one can take away from you. You will then, only then, realize your full capacity and further potential.

Reaching that goal is, however, really really hard. Today’s modern society, especially in Sweden with all its social safety nets, has almost completely removed the requirement for effort needed to accomplish anything. There are government agencies who find jobs for you. You apply to university through at most three clicks — no letters of recommendation needed, no interviews or even a letter of your own. And you most definitely don’t need to kill your own food each day.

While fantastic from a welfare state point of view, the complete removal of effort from everyday life and the simplicity of survival leaves many people disillusioned and merely half alive. When you don’t have to do much but still have everything you need to go about your day, you never really get to know your human capacity.

Philippe Petit, known as the “Man on Wire”, says it best:

“I am not advocating to live in danger, but at the same time, to force birds to carry a leash is to kill the idea of what a bird is.”

That big magical goal is exactly what will remind you of what you can do. It will create an inner calm, with an added assurance that whatever you do thereafter doesn’t really matter. Not so much because your achievement can’t be topped (on the contrary — it will enable you to go much farther), but because you already hit the upper plateau. Once you’ve reached it, it takes huge effort to fall back down again. And once you’re up there, you no longer have the stress of proving yourself to anybody, because you did something of real meaning — to yourself. That’s worth more than fuck you money.

Posted on Aug 9, 2010

Among slaves and losers

The problem of “doing one’s best” is that you eventually realize you can do virtually anything. Then comes the responsibility of choosing only those tasks truly deserving your invaluable attention. Then comes the burden of comparing yourself to everyone else; you could be them too! Then comes the realization that you will be forever stuck in the rat-race of the capable, with only the losers jumping ship. Then comes the regret of not having fully utilized what time you’ve been given this far on earth.

Where could I have been, had I only better invested my energy?

How far can I go if I make clever decisions, apply myself and focus on my critical path?

How can I make up for wasted time, lost opportunities and circumstantial disadvantages throughout my youth?

What am I doing here, putting ink on paper regarding matters meta, when I could be doing productive work?

This game, exclusive for those fortunate enough to play on top of Maslow’s pyramid, is truly bizarre. Participate at your own risk.

Posted on Apr 24, 2010

The next logical step

Ok, so you’ve got (or will soon have) your university diploma. You have decent to good grades; some industry experience. Extra-curriculars. And so have hundreds—thousands—of other people around you. Welcome to white collar nation.

At each stage of your career there are a set of alternatives which are considered the next logical steps forward. They are not trivial to obtain, yet completely within reach. Consecutively ticking these off will undoubtedly move you forward at a steady pace, but at each new conquest of merit you will still find yourself around just as many people as before.

This is the prime indicator of the path of mediocrity—it is predetermined and planned ahead, proven good enough by the many people who have followed it before. It’s the only real alternative for the faux ambitious who want to prove their capacity.

Each next step completely logical and anticipated. Good but not great. Mediocre.

Once you start walking down this path you’re likely to be stuck there. Why? Because those around you giving career advice walked the same road as you. And because those who achieved real success are too busy accomplishing something—yet they are the ones who would most happily share their secrets. But do you really want to listen?

The next logical step is not Plan A. It’s plan Z. Skip steps and go after the next stage set out for you—years ahead of “schedule.” You’ll be surprised of how few people even try. It’s perfectly possible to get your dream job right away.

Better yet: forget the standard path and pursue your own projects and goals. Create something of your own. It makes you a thousand times more interesting and whole as a person.

Take Fredrik as an example, saying “Screw this, I’m moving to Japan. Because I want to.” Or a really cool person I met last week, Viktor, saying “Screw this, I’m going to Singapore. With my bike.” Both leaving behind a half-finished education in engineering.

Or every entrepreneur on earth.

Always operate outside of your comfort zone. Make up your own set of alternative next steps. Make bold moves. That’s all there is to it.

Posted on Mar 30, 2010

Beware of perfect conditions

Picture a common scenario for a student: you’re two weeks from an exam, you work part time doing things far more enjoyable than university, and you have a household to care for. Plus maintaining your social responsibilities; birthdays, saying hi to mum and brunch with friends. You’ve got a brand new day ahead of you. What do you do?

Most people belong to two categories who both make the wrong decisions: the perfectionists and the procrastinators.

Unless the perfectionists finish every task in correct order and to their full satisfaction they get a mental itch; the exam and some email have the same priority since both need to be completed. Even though the perfectionist would have aced the exam, he or she would still have felt like a failure since the email wasn’t written.

The procrastinators are better at prioritizing, since they know the exam is more important than the email. However, they seek “perfect conditions” before starting to work on the most important task. This is why so many people need to polish the bathroom mirror the week before the exam. They can’t study until every small, unimportant task is completed.

Most people would agree that keeping to a strict prioritization of tasks is crucial to getting things done, see also my post White space time management. You can’t afford to be a perfectionist regarding your schedule. But what is just as important is to avoid the trap of beginning with the seemingly important clutter on the todo list.

Perfect conditions don’t exist; there will always be yet another reason not to start working on what’s really important. But this argument goes deeper than to only justify the importance of prioritization: some minor tasks perhaps steal a disproportional amount of attention and thus need to be dealt with. Or perhaps a clear desk is simply a necessity to concentrate.

By keeping in mind that perfect conditions are an illusion, one can set out to find what finite preconditions are really necessary, and which ones are just an itch (if you’re a perfectionist) or which ones are just excuses to postpone what’s important.

Posted on Jan 31, 2010

White space time management

The naïve approach to graphic design is usually to include as much information as possible on a given canvas. White space is nothing more than unused space, ready to be filled with more graphics and copy. However, this is obviously a bad strategy since all it does is confuse the viewer and obscure the message. This is why Google became king of search, and why Apple keeps being awesome.

Similarly, the naïve time management strategy is to fit in as much work and meetings in a schedule as possible. The person with the busiest calendar is clearly very good at managing his time and responsibilities. Or is he?

There is a difference between busy following a schedule, and busy solving a problem. This is essentially the same as a design busy presenting information and a design conveying a message.

Strangely, the concept of simplicity is never the natural state but always the result of carefully considered choices. Just as a design process should be about removing clutter until the bare essence is left, time management should be about removing appointments. Not adding new ones where they fit.

White space is a powerful element, necessary for creating dynamics between the essential components of a design. In the same way, free time is essential for effective time management. Leisure time works in your favor when alternated with creative problem solving. Mindlessly adding more work is thus nothing else than adding clutter.

True productiveness is just as much a product of free time, as of hard work. This is why the most creative people always tend to have hobbies, read books, write and travel — while the mediocre majority complain about being busy.

Posted on Dec 27, 2009

Making the most of college

The (proper) education of the youth is one of those timeless topics that are equally fit for discussion in the finer lounges as well as at the dinner table. Allow me to chime in with my own most significant take-aways for how to make the most out of your time invested in university.

University is not nearly as much about knowledge as it is about networking, as I wrote about in What is the purpose of university? While all knowledge can be found in books and on Wikipedia, which are equally accessible for non-students, it is synthesized within a “forum.” This is thus the most important aspect of higher education. But who to target and how to establish great contacts?

Go the extra mile in interesting courses.
Most ambitious students who feel they have the capacity to squeeze in more hours per week choose to either get a part-time job or participate in more courses. I know many students studying at 150-200% of full-time pace. While this is impressive, putting all that extra energy into one or two interesting courses can result in some very useful consequences.

First of all, you get a chance to actually establish a relationship with a teacher. The lack of personal interaction with teachers is a serious flaw in today’s education system. I would be surprised if more than three teachers know an arbitrary student’s name. But through making the most out of an interesting course you will undoubtedly get noticed and be remembered for being ambitious and interested. This is far more useful than an extra course in your transcript.

Secondly, you get a different kind of intellectual satisfaction when aiming for quality studies as opposed to quantity studies. I’m not saying specialization is to be preferred over diversity, but it is an alternative worth pursuing.

Get noticed by your fellow students, and notice them too.
While getting to know teachers is very useful, I’d say that fellow students should have equal priority for being included in your network. For well-educated people the market is very small; you will stumble upon your class mates in every corner of the world later in life. Take every chance to show ambition and competence towards students as towards teachers.

It’s simple, really. Join different people when doing projects. There is no better way of getting to know people than to work with them; it’s the one way of establishing life-long contacts, both professionally and privately.

Make great presentations. Don’t just throw together the reports — write well and relevant. Answer the teachers’ questions at the lectures. Use new tools, and always share your knowledge with enthusiasm. And while doing this, make sure to notice the other students who show interest and involvement. Those are probably the ones you want to get to know.

Lastly, while university is a major investment and an important step in one’s career, you will want to relax and just enjoy the ride. The overly serious student almost certainly fails to discover that knowledge is all about new toys for the brain to play with.

Posted on Nov 30, 2009

The Game 3.0

Yet another game is now complete and over. I’d have to say this was one of the better ones we’ve made! It’s always very difficult to judge the quality and difficulty of tasks beforehand, but based on player response the conclusion is that it was successful. I thought I’d share some of the problems that were in the game. For more about the game me and Fredrik make, see The Game and The Game 2.0.
Continue Reading