New stuff is out!

Yet another clone of Burmese Syllables - Japanese Hiragana syllables.



Good luck with Linux

I decide to install some Linux box on a spare, old PC I've found standing useless. Its main purpose: to install Lazarus and compile ZenGL to see if I can build Linux versions of my games. After all expanding user base is always a good idea.

I consider myself quite familiar with all sorts on unix-like systems. I had a lot of experience back in my days as an admin (ca 1995-2003). And here I am... It is the 4th day of my still failed efforts to install somy/any Linux.

The hadrware: Celeron 433MHz, 512 MB RAM, 8 GB HDD, 128MB Radeon 9200 AGP VGA. As I said, old and weak, but should be satisfactory anyway.

Short history of failed installations:

1. CentOS 6.3 - failed because: not enought RAM.

2. Ubuntu 12.04.3 - failed because: needed 8.06 GB(or was it 8.6) disk, also does not detect that the network is connected (while it also says IT IS connected), so "continue" button stays inactive. Why did it say "for best results..." net/disk is needed then?

3. Fedora 4 - actually succeded, but too old to use

4. Fedora 19 (netinstall CD) - failed because: after installation and reboot the system is not bootable (!). Stupid grub2. I need to mention here, that it took hours to download the system from "nearest" source, and that it hungs on Libreoffice download. I tried several times, starting from clean DOS fdisk to remove partitions for sure. I've also read a lot about how to fix grub2 booting and what to do when grub rescue "console" is showing up. No success.... What were they thinking (the authors of F19) creating a system that by default does not boot after first, clean install? If I've ever created such a lame software solution I'd have to live under the bridge...

5. Mandrake 9.2 - failed because: apparently it takes more than the one CD I have, and no spare CDR-s at the moment.

6. Slackware 9.1 - failed because: same reason as above, need more media to complete installation.

7. Slackware 8 - failed because: during network config at the end of the installation I accidentally pressed something and # shell appeared, but unresponsive. After reboot, it seemed OK for a while, but then login as root was not possible because of some lacking /dev/tty* or sth. Fdisk-ed the crap.

I'm now installing Mandriva 2007 - apparently old, probably will fail too.

Yet up my sleeve - Red Hat 9 - will it be too old?

If it fails I will have to aquire some DVDR-s and get me yet another distro...

Mandriva got installed, but it seems pretty old, and now I can't manually compile the damp RPM to the version required by fpc.
And why is it that every problem I encounter has "resolution set to wontfix" ?! Like here http://www.rpm.org/ticket/61.



> Assume there are 7 billion (7*10^9 = 7000000000) people on Earth.

Assumption entered.

> Assume the distance between Earth and the Moon to be 384400 km.

Assumption entered.

> Assume every human is exactly 1.5 m long with arms fully extended.

Assumption entered.

> Calculate, how many times would a "chain of humans" 
suprass the distance to the Moon?


A chain of humans would measure 1.5*7*1e9 = 10500000000 meters,

which is 10500000000/1000 = 10500000 km,

so it would be 10500000/384400 = 27.315296566077 times

The answer to your inquiry is:

If every human 1.5 m long kept each other at arms full length 
in a chain, the length of that chain would be equal to a little 
more than 27 times the distance form Earth to the Moon.



BLUE CAT FACTORY GAMES - updated update

updated again

My first game (more of a virtual toy for small kids that an actual game) Blocks For Kids is out! It is the 7th from the 8 I started coding in last 8 months, but the first to see the light of the day.

see game trailer video



Seems I must be a geek. For my 40th birthday I got Arduino Uno kit with some extras like cool LCD display. It was already preloaded with a DEMO (old style) with greetings and wishes in scroll. :)

This my own (first ever) play with the device (apparently the RGB LED is too bright):

and source (it is newer than what the video shows):

GDC TEST 20130414

// Pin 13 has an LED connected on most Arduino boards.
const int led = 13;
const int led12 = 12;
const int led11 = 11;
const int led10 = 10;

const int greenLEDPin = 7;
const int redLEDPin = 6;
const int blueLEDPin = 5;

// the setup routine runs once when you press reset:
void setup() {               
  pinMode(led, OUTPUT);
  pinMode(led12, OUTPUT);
  pinMode(led11, OUTPUT);
  pinMode(led10, OUTPUT);
  pinMode(greenLEDPin, OUTPUT);
  pinMode(redLEDPin, OUTPUT);
  pinMode(blueLEDPin, OUTPUT);

void Blink(int l, int d)
  digitalWrite(l, HIGH);
  digitalWrite(l, LOW);

void RGB(unsigned char r, unsigned char g, unsigned char b, int d)
  analogWrite(redLEDPin, r);
  analogWrite(greenLEDPin, g);
  analogWrite(blueLEDPin, b);

// the loop routine runs over and over again forever:
void loop() {
  int i;
  for(i=1;i<8;i++) Blink(led, 150);
  RGB(255, 0, 0, 700);
  RGB(0, 255, 0, 700);
  RGB(0, 0, 255, 700);
  RGB(255, 255, 0, 700);
  RGB(255, 0, 255, 700);
  RGB(255, 64, 8, 700); 
  RGB(0, 200, 255, 700);
  RGB(255, 255, 255, 700);
  for(i=0;i<256;i++) RGB(i, 0, 0, 10);
  for(i=0;i<256;i++) RGB(255-i, 0, 0, 10);
  RGB(0, 0, 0, 0);
    Blink(led12, 500-i*100);
    Blink(led11, 500-i*100);
    Blink(led10, 500-i*100);



Blue Cat Factory is now officially on!


I hope to finish and publish a few casual games soon.



On numbers and combinations

TAKE an image of 8x8 pixels. Assume it can only be black & white.
A boring b&w 8x8 icon with not much space for something really creative.

How many DIFFERENT such icons can there be?

There is total 8*8 = 64 pixels, each can be 0 (black) or 1 (white),
that gives us total
2^64 = 1.84467440737096E19 of possible 8x8 icons,
that is 1 with 19 zeros or 10000000000000000000,
or more (but not quite) precisely about 18446744073709600000.

Now let's think how much time it would take to see them all - one second each:

It would take us (86400 = 24*3600 seconds in a day)

1.84467440737096E19/86400 = 213503982334602 days


1.84467440737096E19/86400/365 = 584 942 417 355.074 years

not adjusting for leap years of course to make it simplier.

Let's assume there are 7 billion people living today.

If we ask them all to do nothing but stare at our 8x8 set of icons constantly,
one every 1 second it would require

584942417355.074/7e9 = 83.5632024792963 years

So if we want to see ALL POSSIBLE 8x8 b&w icons, one second of time for each
and even if 7 billion people were engaged in the process it would stll require over 83 years...

Isn't that amazing?



On the need to do backup

A view from a philosophical and from a practical perspective.


Recently I survived a rather nasty case of data loss, or TOTAL SYSTEMIC FAILURE as it looked like. At this moment data is moslty restored and new preliminary backups were just made. No data was really lost, only time and my health. And as the occasion arised I'd like to share some observations on the subject of backups.

I can't be 100% sure what actually happened.
It seems to be a chain of unrelated events that just coincided in time.

FIRST one on my systems stopped booting up (I know I did the mess). I decided to restore system from install disc. But stupid installer decided that some of my disks suddenly require a chkdsk. After that lots of files (yet unbackuped) just dissapeared from one partition. Also the reinstall finally failed and I had to switch to backup image of system partition.
The files were meant to be backuped - later, just a loose collection of stuff to be sorted and then archived later (like old mails, some mp3 lectures, some photos, some installers). After painstaking NTFS undelete I ran another chkdsk only to discover that all files are back there again.
Annoying waste of time, but no harm done.

THEN one impatient hard reset too many (I guess that is the reason, not a virus, no HD failure, hm.. Well my PC fails to start sometimes and it turns itself off then just after power on - that however remotely may have been the reason too) did some more nasty things to my other partitions.
First I discovered that apparently one program I created (that was tested and working ok) started to say some weird dll entry didn't exists in kernel32.dll.
The binary was just several bits defferent than it should be (why there was no some CRC fail - I do not know).
I checked it by diff on hexdump-s of one copy of apparently bad and one copy of good exe.
So I tried to recompile. but then I realized my BDS compiler stopped working (one dll got broken in the same way). Fortunatelly reinstall fixed it.
But then I found out that the sources don't compile anymore!!! Damn, were I furious!
Some random bits were also changed in one or two files - 'd' changed to 'e' or so. Text files don't have checksums.
But HDD should somehow stay consistent none the less, right? I never imagined this could REALLY happen. But, well... I was WRONG!

So I spent last 6 days painfully checking all my projects against latest backups, doing diffs and restoring what seemed corrupted.
Older projects untouched for long time had good and consistent (old) backups. Also the were not affected. Actually, most projects were clean.
But some - recent - had some files corrupted. And some of those recent had no good backups yet as they were just heavilly changed.

A lot of work, no profit. Not to mention system restoration and extensive AV checks.


Do backups. I really mean it. Do them. Do them often. And do them smart.
Do backups. I always repeat that to everyone and on every occasion. But I ALMOST failed in that practice myself.
If you do (create) anything worth doing - it is also worth backing up.
If what you do is not worth a backup, it is probably not worth doing. You'd be better off going for a walk.
One can say: what you do is perhaps less important than the way in which you backup it.

And by smart I mean:
1) implement backup policy that works for you, eg. so you won't be too lazy to do backup in an overcompilcated way
2) automate backup procedures if you can,
3) check if backups are restorable,
4) store backups safely (safe place, but also on multiple media - extrernal offline drive + DVD + more),
5) consider using remote backup 'in the cloud',
6) encrypt what is sensitive,
7) be paranoid (despite what people may think, it can be useful),
8) learn from your (or, preferably, others) mistakes and adapt


I think it is highly beneficial for admins to be able to think like a programmer. And for a programmer to think like an admin. At least from time to time. Especially the latter. Take the time to understand the need to prepare for distaters. Take steps to prepare. And - again - do backups or at least make sure they are done by people responsible. But don't blindly assume they will do their job. Better take care of your data yourself too. Of course you may be too limited to do that in your particular work environment. I write this from a freelancer's point of view. But ask yourself this: what good is if you commit to your SVN every 30 seconds if there is no backup of that SVN?


Story 1:

There was allegedly an admin in one Polish telecom that had a saying "Real men don't do backups". I don't know if the story is true, but it is said that he didn't work there for long. (*)

Story 2:

My old workplace (10 years ago). There has always been one admin assigned to backups (or the backups were responsibility of one). And that one was always most likely to be fired (**). Of course we didn't know that back then. But now I can see it clearly. We did one or maybe two incremental tape backups every day (VSS, Exchange, other stuff, don't remember really, but it's not important), also one extra full backup every week. The tapes had like 100GB back then, which was a lot. But they were slow, and they were faulty.
When the distater happened - and it happened sometimes - and it very soon got obvious that the tape is unreadable or that yesterday's backup didn't really run... there has always been a mess.

(*) it wasn't me
(**) I was the third in the row


Of course: Implement the method that is best for you.

I personally don't use SVN for my own projects, that is when there is no team collaboration (most of my projects). I prefer fast and simple (for me) method of just zip-ing project's folder and naming it with date, exe version and number. Till now for each project in its root I had 'zipstorage' subfolder for such backups.
Then, periodically, I would copy latest zip-s to offline USB drive (sometimes encrypted) or pendrive (in that case ENCRYPTED). When? When I feel like it (THAT WAS A MISTAKE). For example after major milestone or when I think it's time for 'backup day'. In effect each project would have multiple backups on multiple destination media. But in no consistent fashion (THAT WAS A MISTAKE). And a lot zip-s in 'zipstorage'. Another 'backup day' arrives when I do 'projects snapshot' DVD - current snapshot of everything is burnt - usually unzipped. The 'big backup day' is when I copy some selected (newest * most important) zip-s to multiple destinations at one time. I even once had it scripted - one click would do nicely named zip-s via USB, but it didn't work (THAT IS TO BE CORRECTED). Probably I'm still going to do most of my backups manually. The only difference: I'll probably use some remote storage (after encryption).

Advantages of my method:
- easy,
- woks against enthropy - any file can be destroyed, but probably not all of them, so the more copies the better,
- full control - what, when, where.
- full backup (all/whole files are duplicated) - this can be disadvantage too for big, seldom changing files.

- done manually,
- need to rember to do backup (zip may soon become too old to restore from it),
- difficult to restore after major failure,
- I now know that one common 'zipstorages' is better - it is easier (faster) to backup multiple project snapshots w/o zips in them.


I really bless the author or authors of Windiff. I'd be lost without it. OR I'd had to invent one myself. That was the miracle tool I used to check my projects (one by one) against zipped-unzpped-again backups. Also plain chkdsk appears really effective in fixing NTFS partitions. Other cool software I'd like to mention here: 7Zip, True Crypt, DrvImageXP. The last one makes backup of whole partitions. It helped me to aviod reinstalling the whole system from scratch.


It is simple. Tools may vary, methods may vary, policies may vary.
Don't learn it the hard way. SAVE YOUR ASS, DO BACKUPS!


This may have been a virus after all. But again I can't be 100% sure.
AVAST found one (Win32:Malware-gen) in some MSI installer in \%system%\Installers.
It came with Spectaculator (I payed some good money for that).
But it can still be a false positive. I will try to verify...

I still don't feel sure if all is really OK with my system.
Some weird bahavior I saw (that never happened before) could indicate some virus:
- very slow compilation,
- clipboard not working with screen capture images in some programs,
- DNS suddenly not resolving popular addresses,
- http traffic lost while other protocols worked fine.
Maybe there was a virus and it just layed dormant until now?

One thing is sure: my backups saved me. But I should do them more often.



For some time now I've been working on 'experimental video masher' software.
I'm not sure it will ever mature, become a product, or even become fully usefull for myself.

But see this...
or this


Of course, /tmp frustration outburst is only way of 'cooling down'. And it is safe, since nobody really reads this blog. I'd like to say, I'm still doing my best, working on the stuff, getting poorer by-the-minute...This is only my own
log entry...

Sad as it may be....

I have 'only' 34188 days left on my licese for BDS 2006 (Borland Developer Studio 2006)...
It is much more, than I have to live, that's for sure, but...
What will be the number on this license, when I die?

93.7 years? IT IS A LOT, but I don't have that much.

I feel so underappreciated right now...
Maybe I create poor software? Or am I just stupid and naive - looser?

What is wrong with Python?

Sorry, but I'm not sure anymore.... I mean WTF?!

1. Java had sooooo many 0-day exploits recently, is it valid/safe to use it anymore?
2. Peopole (employers) say it's only cool to code in C# and .NET nowadays...
3. I tried... I really tried to have some fun with Python, I really did man, but see this:

and this....

I know how it is with floating point calculations,
but I'd rather expect it to be more around 0... like exactly 0 :)