Archive for the 'Uncategorized' Category

The games we play…

Montag, April 7th, 2008

I guess I’m now stuck in the blogging business forever. Previously, none of my friends blogged — some were ignorant, other paranoid or just plain lazy. And now this: an old friend, who literally pinged me for the last eleven years because I’ve been lazy enough not to send a message to good old Riga, pushes me to the edge, demanding a list of games I play. Oh well. Since modern communication is just a matter of trackbacks and comments in a blog, I guess I’ll make this public.

Geez, games… Computer games… I just don’t quite know what to write about them, since I haven’t been playing much in the last seven or eight years, I’ve willingly missed every single gaming fashion in the last decade. I’ve seen and played a bit of "Counter Strike", I’ve seen people playing "Need for Speed" or "Grand Theft Auto", I’ve talked long hours about psychological problems concerning "World of Warcraft" without having played or seen a minute of that, I’ve heard about Lineage and wondered what that might be until I’ve researched and found out it was a russian "WoW" competitor. I’ve been excited about and haven’t played a single minute of "S.T.A.L.K.E.R.", damn, even "DOOM" has been a game I’ve played three years too late. I’m a gaming failure and I admit it. Not that I’m ashamed of it…

It’s just that I find hacking my linux box, creating little scripts and reading a lot of articles and books on computing topics vastly more exciting that gaming. I’ve saved a lot of money by not buying the best graphic accelerator on the market, by not upgrading my workstation to the greatest, by not arguing about 1200dpi mice vs. 1500dpi mice with or without a battle mouse pad. I’m not an energy drink addict. I’m not into battle strategy, neither in "Counter Strike" nor in "Warcraft". I haven’t felt the need to imagine myself being a dwarf with a +8 power hammer. I’ve never been to the coma-drinking festivals called LARP. Sorry, I’m boring. I can spend the whole day and night reading about virtues of classical vs. prototype-based OO, my feed list in Google Reader is at 86 feeds at the moment, 814 entries unread — and most of them are really interesting. In fact, I’ve been going on like this since late 2000 and I’ve got every single job I’ve had since 2002 because of this. I love educating myself, so I’m doing this most of the time.

Coming back to the topic, I’m sometimes tempted to play something. Sadly, my games selection is somewhat limited by my OS, I’d have to reboot to play most of the games, so this is one more reason I’m not an active gamer. But still, sometimes I play and these are my top 3 games I’ve found entertaining recently and actually played long hours (apart from Free Cell, that is ;)):

  1. Prince of Persia This one game — or better, three games since I’m talking about all three modern PoP games — is a masterpiece. The original "Prince of Persia" has taken a lot of time playing it, kids on the block talked about having saved the princess in 20 minutes, about how to kill the reflection prince, about Jafar etc. It was the game at that time, excellent in gameplay and graphics. When the second "Prince" came out, it was a kind of disappointment, as it wasn’t that much better. Still, we played it. The third one, "Prince of Persia 3D" was a extraordinary failure and still, I tried playing it. When "Sands of Time" came out, it was like a legend coming back, stronger than ever. I’ve been telling my friends that this should have been the original "Prince" if we had 3D graphics at that time. Excellent animation, intuitive controls, extraordinary fights, it had it all. Then there was "The Warrior Within", which was just as mindblowing — combining "The Matrix", "Mortal Kombat" and "Prince of Persia" has been pure genius. The same can be told about "The Two Thrones". The game was fun to play, it was difficult enough not to fall asleep, not too hard not to be turned off and long enough to have about two weeks of continuous fun.

  2. Frets on Fire This is a new game on the block and it’s a free (as in speech) "Guitar Hero" clone. Being an extremely simple concept and providing no story at all, it’s still more fascinating than many other games currently on the market. Just play the guitar and enjoy it!

  3. Pro Evolution Soccer Well, this one is pretty simple. I like soccer, I like playing it and I like playing it on my computer. Not that I was good at it, but I still can enjoy it. PES has a hard stand against EA-produced FIFA-branded game series, but it’s nevertheless a simulator with a better game feeling. I’ve actually bought a gamepad a long time ago to play it.

Apart from these, there are some games I still know from my childhood and which can take any number of hours of my free time. These are the Monkey Island series and Alley cat. Particulary the latter is a gem of arcade gameplay, being the only game known to man that looks great in CGA, running at normal speed even on current quad-cores despite its age (try that with Digger!) and providing a simple, but fascinating aim.

I also remember playing Moorhuhnjagd a lot when it first came out and also a great night spend at a friend’s place playing Mortal Kombat and a Tron clone that whole night. By the way, Armagetron is one great game, the best implementation of the tron-principle I’ve even seen.

That’s about it, there is not a lot more to say about my gaming preferences. Hope you had fun reading this stuff :)

Interesting spam

Sonntag, April 6th, 2008

Spammers are the ones who drive the progress. They are the ones who think of most kicking way to promote their products, we actually should respect them for the quality of their work (marketing, that is) if we weren’t so pissed about it at the same time.

I’ve had some very interesting comments in this blog in the last few days, which are obviously spam (because of the links to "naked celebrities" websites), but they are both filter-proof because of the content and are also reflecting on 90% of blogs’ content. I’ll just leave them uncommented for now, they are glorious by themselves.

It is one of things I can never understand … how people can think that way. It’s so illogical that it can only be based upon moronity.


Computers have already revolutionized the way we live and work. Have they changed the way we think? After reading all posts I think they have. People, why do you write what you hear somewhere, not your own thoughts?


Well this is depressing. Stop writing like that, your posts are spoiling your reader’s mood. Boring.


This blog is simply smashing. In my humble opinion of course. As this post is rather debatable I don’t think all your blog visitors are going to agree with it.

21

Donnerstag, April 3rd, 2008

It has been a long time since I’ve last been to sneak previews at the movies. Today I’ve bit the bullet and told myself I had to go, just to vent a bit. I was lucky: out of all possible movies I’ve had "21", which I wanted to see anyway. Of course, it’s a "popcorn" movie, but Kevin Spacey was excellent as always, so it was quite enjoyable. I’m no film critic, so I won’t write a complete review, but it’s a nice movie without much moral preaching, so if you happen to go to the movies, "21" might be a good choice.

However, several topics which has been mentioned but not really analyzed or emphasized in this movie were quite disturbing. It’s mostly about how smart guys who don’t have the money usually don’t stand a chance in this society. The protagonist has been working for five years since he was sixteen to earn his A+ in high school, to get the best grades at MIT, he’s bright, talented and smart and still not good enough for some people, mostly the ones who decide about who wins and who loses by granting or not granting scholarships for those who need it. Being good at what you’re doing is simply not enough in this world. You need to be perfect. Or rich, that’s the second possibility.

Sixteen-year-old spend days and nights learning stuff they won’t need and trying to get a hold of the best grades they can get. Soon you’ll need to provide performance reports from the elementary school just to get a place at a college. Even slightest mistake in your youth, smallest performance loss and you are out. You haven’t been a normal teenager since you’ve been working hard to get somewhere you’ve always wanted to, then you fail a class and you are out. You are weak, you don’t belong here, only the strongest survive. Better luck in your next life.

What kind of crazy world are we living in? We are supposed to perform like machines from our childhood on, work 70-80 hours per week and then probably just die at the age of 50 — you’d be too old for anything anyway by then. If you don’t want this — well, it’s your choice, but your chances in this world are pretty slim then.

I’m actually one of those who worked hard for what they are. I’m 25 and I’ve been self-training for the last 14 years. I’ve learned a lot, I’m at least a bit gifted, not a genius, but still someone with "good potential". I didn’t have good grades, mostly because I’m lazy and had to work in my free time to earn at least some money for some decent life. I’m actually quite content with the life I have and which will follow: I’ll probably have a decent job, which will get me the money I need for life, family, wife, kids, I’ll have it all. I won’t be the greatest, I’ll just be a quiet good one.

But it’s sad to realize that many of extremely talented guys and girls might not get a life they are worth just because they haven’t been to the best college, haven’t had the best grades, haven’t got the money, hadn’t worked since they were eight or just had bad luck. This whole system is flawed, it’s taking from the poor and giving to the rich. Or at least making it really difficult to talented people to prove their talent.

Sometimes I really hate this world.

Thousand ways to make your life harder

Samstag, März 8th, 2008

Just a couple hours out of Lisp world I begin to miss things. It’s a bit paradox, since I didn’t even really use Lisp or any its libraries, but I’ve learned enough about them (and I still know nearly nothing!) to miss features and in some cases simplicity and expressiveness.

Right now, I’m equally excited about learning Pylons and frustrated about so-called template engines. In some weird way, PHP is a template engine too, so I’ll take it as an example to support my point.

Web development could be easily described as masochism since the amount of things you need to know for basic development is enormous. You can’t just go with HTML, CSS, JavaScript (and some theory on HTTP and browser implementations with regard to caching), they are just the basics which could be enough for a simple “home page”, but you’d need a server-side programming language to do some data-crunching.

This language of choice would produce HTML for user’s browser to render, filling pre-defined fields with data, so basically, you’d be converting some HTML template into pure HTML containing your data using your programming language. If you make this language simple enough for small manipulations, you’d get SSI, or you could also make it a full-blown language, in which case you get PHP. Depending on the drugs you take (or not), you might also end up with ASP, ColdFusion or even XSLT but the main principle stays the same and it’s not the point here (this is not a PHP rant ;))

Now the one thing I don’t understand: every single Python templating engine (with one brave exception) uses a PHP-like embedded syntax which is “almost, but not quite, entirely unlike” Python (thanks to Douglas Adams for the excellent expression). It includes things like this:

  % if action == "list":
    <% return '' %>
  % endif

So I’m supposed to learn yet another language with slight deviations to some other language I’m writing the rest of my project in. Seriously, this sucks and it’s highly error-prone. Not to mention the negative karma I’d be producing closing each and every single HTML tag in the template.

Yes, this is still a lot better than writing HTML by hand in PHP (that is, without any frameworks) or in Perl. But this is still a way to make programmer’s job harder and less fun. I’d like to quote Slava Akhmechet on this occasion:

I like HTML in the same way I like PDF - as a document serialization format that does a reasonable job and that I never want to modify by hand. This is one of the main reasons I started Weblocks framework - I never wanted to write a line of HTML again. Ironically, I ended up writing a lot of HTML and learning more about its quirks, accessibility issues, and CSS hooks than I ever wanted to, but I finally ended up with a high level user interface definition language embedded into Common Lisp. Finally, HTML is out of my life, for good. Being lazy does pay off.

Writing HTML is tedious and Slava is right there saying that HTML should be treated like some binary format and not written by hand. It’s entirely possible that it’ll become something like assembly language for the web in a couple of years and only a small group of people will still have to write it manually. We are not there yet, but we could at least make sure that writing HTML happens painlessly, and by “painless” I mean “in the currently used language”.

Common Lisp programmers mostly use CL-WHO for this, which is designed to help the programmer and using Lisp constructs inside CL-WHO expressions makes their life even easier:

 
(with-html-output (*http-stream*)
  (:table :border 0 :cellpadding 4
   (loop for i below 25 by 5
         do (htm
             (:tr :align "right"
              (loop for j from i below (+ i 5)
                    do (htm
                        (:td :bgcolor (if (oddp j)
                                        "pink"
                                        "green")
                             (fmt "~@R" (1+ j))))))))))
 

This is expressiveness I wish to have, this is what I’ve been missing about an hour ago. Luckily, there is one exception in the world of Python template engines, which looks almost like CL-WHO and it’s called Brevé. Even its syntax is like Lisp and it looks like this (more complicated example including inheritance):

 
inherits ( 'index' ) [
    override ( 'content' ) [
        h1 ( class_="main" ) [ c.title ],
        p [
            'This page doesn't exist yet.',
            a ( href=h.url_for ( action='edit', title=c.title ) [
                'Create the page.'
            ]
        ]
    ]
]

Well, even now I’d still have to know a bit about HTML, but that’s necessary evil right now and I can at least program everything in Python syntax. Not having to enter closing tags by hand could be one single killer feature in Brevé for me. It will (hopefully) make my life easier and that will account for a lot of motivation.

e-books done right

Donnerstag, Februar 28th, 2008

Just some impressions from the russian e-book market. Russia is what is called “a reading country”. Books are everywhere and are also cheap, so that most people can afford buying books just for the pleasure of reading. Because of that there is no need to buy “only the good ones”, like in Germany.

And then of course there is book piracy. I would rather call this process “popularization”, but sadly “piracy” still fits it. Since copyright enforcement has been unknown in Russia until recently, an insane amount of books has been digitalized and put into “e-libraries”, special portals for text files, either with or without categorization. Books were provided for people to read, not for any kind of profit — most e-libraries started as private collections.

Digitalization has also been the real deal: a book has been dissected, scanned, OCRed, proof-read etc. Since many books had not been available everywhere, e-libraries became one of the first sources for e-books and books in general. Since the rise of PDAs e-reading became even more popular — downloading books was a snap. It have been Russians who proposed FictionBook, an open XML-based e-book format, which became the de-facto standard for the modern e-libraries.

Someday the copyright holders came after e-libraries. The reaction has been as expected: the books have been removed at first notice, so that court and extreme costs could be avoided. Not every author did complain however, since many people bought paper versions of the books after they’ve read them on their PC — to own the ones they liked. E-books were more like a complete preview version. But the whole situation was still unbareable, since e-libraries had an uncertain legal base, their owners could receive subpoenas etc. Everybody wanted just one thing: e-libraries had to stay, the problem was how to do this right.

The solution has evolved and was as simple as it gets: biggest e-libraries founded a company, which signed contracts with authors willing to have their books online legally and also to get payed for that. There has been no changes in distribution channels (e-libraries), no changes in text format (FictionBook, text, HTML, Word, RTF, RocketBook, PalmDoc, Java etc. still were possible). The only three things that has changed were the price for the books of these particular authors, the quality and the availability date of the books. The price has been set to about a tenth of the retail paper version (e.g. 20 roubles vs. 230 retail paper version), available on the release day directly from the publisher. There is no DRM either, and the best thing is: all these books can be read online for free! If you want to pay for a download, there is a wide selection of payment methods available, from text messages to credit cards. Every downloaded book also stays available online for free in your virtual bookshelf.

This was the only possible solution on russian market. I think this is also an example to follow for every other country, since it’s a win/win situation.

Intelligent reddit filter

Donnerstag, Februar 28th, 2008

You actually don’t need a sophisticated recommendation engine to get the information you might be interested in. Or rather, you do, but it is built upon neuronal networks, not social ones. Here’s how my (untuned) version works:

  1. Subscribe to Reginald’s blog and del.icio.us feed
  2. Repeat for every other technical blogger you like and learn from

Sorry, Reg :) On a more serious note: trust and credibility matters, no matter what others say.

Webkit on Windows Mobile

Montag, Februar 11th, 2008

Yeah, right. Torchmobile is bringing a Webkit-based browser to Windows Mobile and Engadget is anticipating something big. Don’t hold your breath: Torchmobile completely misses the chance to make a change. The bar has been already raised really far in mobile surfing (Opera mini and iPhone’s browser) — the real challenge is not having some useless tab browsing, it’s about making your user happy by making him control his browser less, since that’s not what he wants, he rather wants to get his information more quickly. Even a touch interface won’t save you — if all you can offer is a complete website with a mini-viewport on it which has to be moved manually, with some optional menu-hidden zoom steps (50% and 150%), you’ve lost.

Guys, please, download Opera mini on your QVGA mobile and just get a grasp of how snappy mobile browsing can be. And leave the stage to someone who is at least capable of getting a realistic snapshot of the market. I will be right here watching over you and waiting for the new Opera Mobile 9.5 (Update: and also Skyfire, which seems to use concepts similar to what Opera mini is using).

Nokia buys Trolltech

Montag, Januar 28th, 2008

This is shocking and confusing. What is the future of Qt now? What is the future of Maemo? Will Qt get merged with kdelibs? Nobody knows at the moment, but I hope (rather naïve of me) that this offer will not get accepted by the board of directors. Trolltech can do better than letting Nokia swallow them.

Knuth is 70

Freitag, Januar 11th, 2008

I’d like to wish him long long years of life, so that he can finish TAoCP!

And noone of my colleagues knows him — this is extremely sad :(

A case against tabbed browsing

Montag, Januar 7th, 2008

Have you ever thought about tabbed browsing? Have you ever wondered why we actually need it? Why does just about any big application on the planet create tabs inside their main window? We are using a “windowing system”, right? Why not just go with windows instead?

The answer to this question is “Because tabs have made our browsing experience bearable.” But in the whole awe of excitement about some relief, most of us have forgotten to explore the real reasons why our experience sucked big time in first place. And the answer to this more fundamental question is: tabs (and also MDI) just weaken the symptoms of sicknesses called “task bar” and “window management”. Lucky MacOSX users suffer more from the latter, Linux users from the former, Windows users take the whole blow as usual.

If we forget about the performance hit when creating a new window using modern widget toolkits — which in itself is a rather different subject —, we’d conclude that all tabs do is grouping windows of some application into windows, supposedly creating some kind of context by doing so. In reality, all these windows are grouped using tabs because the would otherwise clutter our precious task bar (which seems cluttered just about anytime when more than one window is open) and also make switching between them a pain. But in our age of web applications and 3D desktops this approach does more harm than good.

Let’s assume I have a Quicksilver-like window selection. That’d mean I press a shortcut on the keyboard and start typing in the name of the application I’d like to switch to. Now, if I wanted to look into my mail inbox, instead of selecting GMail’s window directly, I’d have to select the Firefox window and then select my GMail inbox using Firefox’s internal tab selection system. Apart from being unintuitive and using twice as much typing and clicking than necessary, additional shortcuts inside Firefox deprive me of several possible additional global shortcuts. Since the shortcuts used are not standardized across applications (Opera or Eclipse might or rather will be using other shortcuts), I’d have more shortcuts to learn, less global shortcuts to define and also I will be making mistakes from time to time, which will lead to some frustration and lower productivity.

Another example: I’m watching some video on YouTube. Since it’s just a screencast, I’d just want to “keep an eye” on it, so I’d set the YouTube window to 50% opacity and also to “always on top” and look into some other web-page, like a discussion on Slashdot. Or rather I could have done this, if it has actually been a window in first place. But it’s not, I’m using tabs like everyone else, since windows produce a lot of clutter. No, sorry, no detaching tabs for you. I’m screwed in this case, possible productivity is killed.

I could have opened a new window and copy&pasted the URL, but I have to admit: deciding between windows and tabs for each website is not something I’d like to think about, especially not when I’m clicking on a link in an IM window (opens in new tab by default). I don’t really want to teach my grandfather about the concept of tabs either. It’s two different presentations of the same concept — it’s actually quite confusing to have “window selection buttons” a.k.a. tabs in the task bar and also in the application, but we are used to it. We do not ask questions, we are glad about every tiny bit of improvement. But we should be asking questions and striving for more improvement, since we are good at what we do and want to be better all the time.

The main question we should have been asking in this case is a generic one: why the hell does my web browser do window management?

UNIX folks always chant “One tool to a task” and also “He who doesn’t know UNIX is bound to reinvent it”. If we follow this principle, there should be an application completely dedicated to window management. Might seem like a stupid idea to Windows folks, but in X11 Window System, there is a whole concept called (surprise!) “window manager” [1]. Let’s use it, right?

Here we have a problem: almost none of these window managers are worth their name. Most don’t make interaction easier for the user, some don’t do much window managing at all! All they do is provide some decorations for the windows (shiny themes!) and also some buttons and, if you are lucky, keyboard shortcuts for switching/maximizing/shading them. There is rarely some pre-configuration for positioning possible (“I’d like all of those Firefox window maximized por favor and please put all terminals into some available desktop space if present”), but that is what differs a window manager from a decorator. Real window managers with almost unlimited possibilities are called ”sawfish”, ”ion”, ”xmonad” etc. It’s no wonder that all of them are “weird” in some way. They posess the power to improve people’s productivity greately, they just require some dedication from the users.

One application for one task. There might be some broad or narrow definitions of a particular task, but in general a window manager should be managing windows (sorting, tabbing and positioning them, if you like to) and a browser should be browsing the web. Otherwise, we’d have a clash: the web browsing expert team would be designing my desktop experience, which is like sending some gardeners to chop some wood — concepts are similar, but not similar enough to have expertise. And everyone wants the best tools for the job built by experts in that particular field, right?

Have you noticed the new Mozilla “product” called Pulse? Everybody seems excited, since it’s actually what everyone wants. You tell your computer what you want (“I’d like to check my mails at GMail”), your computer knows it’s a web-page and leads you to it. For you, everything is transparent. You are using your OS to start a task you know by name and then you are using it. This could work for about any page in the web, not only for “big” web applications. It’s all that is needed when the whole surrounding infrastructure is sane. Right now, it is not, but nobody seems to see a reason to improve and that’s a really sad thing.

To sum it up (again): Firefox, or rather any application with tabs, should forget everything about tabs or even windows. Your system should be able to group windows if you want to and the way you prefer [2]. Your task bar (or whatever you are using) should be able to present you the information about running applications in the way you want. And all three of them should be produced by different expert teams. If neither your task bar nor window manager are up to the challenge, you are either screwed (proprietary world) or it’s about time you file a couple of bug reports (free world).

Let’s innovate in window management, in visualizing running applications and switching between them and let Mozilla and other teams concentrate on fixing bugs in their core businesses.


[1] The mere fact that there is such a thing accounts to X11 being so old — X11 is an example of true UNIX spirit. I don’t think it’d even be network-enabled if we had to create a windowing system from scratch today.

[2] There are certainly some unsolved problems with this approach, since, well, nobody thought about that. One obvious case is “Undo close tab”. What we’d do about that? One way would be making it a OS-wide feature.

How many times have you closed a tab occasionally? Now compare that to the number of times you closed an application occasionally. Your ratio may vary, but both cases are very common and actually semantically equal. How many times have you deleted a wrong file? We do have a solution for that: a “Recycle bin”. It has a couple of shortcomings, since it’s not implemented on system level as opposed to application level, but it works. Why not apply the same principle to working applications?

Because it’s difficult. It’s about as difficult as virtualizing operating systems — you’d have to snapshot the whole application memory, but we can’t do that properly, since we do not know the time point at which it has to be done, except maybe for when the shutdown of the application is requested.

But there is an another way: we could have some system log for applications. Each application has a unique process ID and each state of the application could be saved and restored by the application itself (especially when it’s a simple UNIX-like application). Every application could save its state just before it’s shut down and provide some API for starting it in a particular restored state — there you go, you have a complete “Undo closed application”. Implementing this system would be as simple as adding an API to existing session saving systems in desktop environments.

That’s just a small idea from a guy who doesn’t do any system programming. But the first step in solving a problem might be realizing there is a problem. Don’t you wish bringing back application was a bit less painful than opening them again?