Over the years I have been using several kinds of solutions to backup stuff. Here’s a description of the ones I can remember. Many of them focus on being low-cost, simple and straightforward, but are far from a perfect solution in many other ways.
Archive for the ‘Misc.’ Category
Buggy software is cheap enough
If software would be made bug-free, that would force prices to be so high that nobody could buy them. How so?
Well, let’s think about what it means to build bug-free software. There actually exists some software, which is built with goal of “zero-defects”. By that, I’m not referring to the constant hype from latest agile method cult who may have some extravagant claims. I mean software where it’s of utmost importance to really have no bugs, no matter the costs. A case where a single bug may mean loss of lives or failure of the whole project. This kind of software is built for space missions, nuclear facilities, and so on. And such a policy on quality is inherently very very expensive.
Imagine if Windows, for example, would have been built with such policy. It’s a really complex and huge piece of software compared to ones normally built with zero-defect policy. But, given the option, would you pay $19,900 of your operating system, if it would never crash? It’s quite a no-brainer that “everybody” would rather pick the same software for $199 and just put up with the few problems they encounter. (The price difference was picked by Stetson-Harrison method. It’s a guess to illustrate the point. The difference could be actually lot worse for niche market software which isn’t aimed for mass market.)
Back from Japan

I was away for about 2.5 weeks to visit Japan, more exactly Kyoto and Tokyo. The trip was excellent, and in retrospect it was clearly a good idea to visit both cities. While Kyoto is a modern city, it still has a bit more traditional feel to things. For example, the local laws forbid building tall skyscrapers, so there aren’t much taller buildings than we have in Helsinki.
Tokyo in other hand is very modern city with lots of skyscrapers. When going to see the city view from top of Mori building in Roppongi hills, you can see the city expands in every direction to the horizon as far as you can see. There is also extremely well developed public transportation, just check the Tokyo subway map (PDF). The public transportation in Helsinki is also quite good, but Helsinki is so tiny compared to a big metropolitan city so that our subway is tiny as well – just compare the above one to the current Helsinki metro map. ^_^

Interestingly when going to USA it feels that everything is bigger. When going to Japan, it feels the opposite. Maybe that’s partly because there is a whole different class of small cars which are narrower than we’re used to. I think the average width of streets is a bit less as well. There are also typical big western cars, so there’s just more variety of different sized cars. There’s even mini garbage trucks as you can see. However, not everything is small; I think in Japan they just tend to make things small by default, but aren’t afraid of making things big when there’s a reason to do so.
Also some things seemed to be done in an opposite way of what we’ve used to. Not just the left-hand driving and walking, but cars are also almost always parked backing to parking spot so that it’s slower to park car but easy to leave. And at least in Kyoto the buses worked so that you go in from a single back door and pay when you exit through the front door. Curiously in Japanese language the verb is also put last in sentences (think of Yoda-speak).
Smiling parenthesis in parentheses
Time for some trifling thoughts.
When writing you sometimes want to put a sidenote in parentheses, and then end it with a smiley.
This raises a question: Should you write one or two ending parentheses?
This seems to be an awkward problem for many. XKCD even made a comic about it (link at end of this post).
My solution is to use just a single parenthesis, so the ending parenthesis becomes part of the smiley. It just looks better that way! However, this way really sucks if you are writing in e.g. some chat system which automatically replaces smileys with small graphic icons. In that case the ending parenthesis just disappears and it feels like the sidenote keeps going on and on and the whole paragraph starts feeling unbalanced. So, if I know that the system will replace my smileys with icons, I will use double parenthesis.
At this point you’re probably wondering why I don’t show an example? I often overuse such sidenotes for some remarks, which is of course the reason I have even realized this earth-shattering problem. However, I have also realized that the best way to fix it is actually just to not use such sidenotes. Often the sidenote may actually be just a natural thing to say in the next sentence. Or perhaps you can consider using a footnote. I feel footnotes don’t work that well in web pages but I prefer them in print publications.
Anyway, I should save you the trouble (of constructing examples yourselves :).
Or maybe you already tried yourself (I know you did! :-) ).
No entry for LD48, SD update out
The Stair Dismount 1.2.0 (iPhone/iPod touch) update should be out now!
In other “news”, I didn’t end up making an entry for the last weekend’s Ludum Dare 48h game dev compo. The theme was “Exploration” – I wasn’t really fond of the theme, but I still had a solid idea very quickly I went forward with. However, I ended up honing gameplay nuances for too long in my head and without actually doing much of implementation. I ended up writing some level generator thing and the supporting draw code etc. Might come back to those later if I want to work more on the idea; or perhaps even integrate with my summer efforts for making a little game for Assembly which also turned out not to be.
On the other hand, at least there was nice chance to have sort of “role reversal” for the weekend, since I was the one who went to buy groceries and made some food, and my wife made a nice little game to entry in the same LD48 compo.
Twittering
So, my Twitter account is jlauha. I configured the blog posts to be automatically updated there, so that’s one way to follow my stuff if you’re into that. We’ll see if I start occasionally posting something else as well.
Tool: Binary data to embeddable char array
Sometimes there’s a need to embed some little bit of binary data in the executable. The reasons may vary – perhaps it is for a resource you want to exist even if data files are missing, or it could be even something you want to “hide” from some curious wannabe-hackers.
In the past years my typical use case was as follows. I used to make “64 KB intros” (such as this one), and for those I needed to embed a few data files to the executable as object data, so that I could exploit compression of the executable packer without writing a proper compression tool myself (such as UPX).
Tool: pngprep
When programming visuals, I often need to fix color values of pixels in image data where alpha is 0. Here’s a little tool called pngprep which can do some pre-processing of image data and save the result as a 32 bpp png file.
(more…)
Tool update: psdslayer 1.1
A while ago I posted psdlayerstga 1.0. I have now updated it to support saving to PNG files, which is also now the default output format. The tool also got renamed to psdslayer, since I was constantly imagining, and even mistyping, the name to be “psd slayer” rather than “psd layers“. And I find it funny.
(more…)
Tool: psdlayerstga
UPDATE: psdlayerstga has been renamed to psdslayer with addition of saving the layers as png files. Get the new tool from here.
I took DrPetter’s PSDImage code for extracting layers from PSD images, and combined it with stb_image just for saving out the layers easily as TGA files. And then I included some simple options and output of the metadata (i.e. name and position of each layer). Result is a little command-line utility, “psdlayerstga”. Use it for anything, but do so at your own risk. (The PSDImage code uses that same license, and stb_image is public domain.)
Download here, including C/C++ source and a pre-built executable for windows:
psdlayerstga.zip
Go get newer version (psdslayer) from here.
Edit: Don’t miss psdparse below (suggested by Toby), an alternative tool for the same task.