Archive for the 'Software development' Category

Another Short One…

Lipanj 21, 2006

I'm not really that much into writing these days, because I have my final high-school exams to prepare for Friday (keep your fingers crossed :)), but here's an interesting and extremely useful link found on Dado's blog.

It's a brillant reference service which offers references for many different languages (HTML, JavaScript DOM, CSS, PHP, My/PostgreSQL, RoR, Perl etc. – Python coming soon! :)), and it allows you to add and remove available references as you wish. It also has a cool search feature, and it's probably the dream of every developer :). I ran into something similar few months ago, but it was limited to a few languages (HTML, PHP, MySQL and CSS, if I remember correctly) and it didn't have any customization options.

So, here's the link: Enjoy!


Think Twice Before Pressing Enter

Lipanj 14, 2006

I just ran into this while surfing around on Reddit, ironically titled "Why is Lisp unpopular? Maybe it's a "community" like this." It's an article from a Usenet discussion on comp.lang.lisp newsgroup.

In short, the guy (BobF) asks a question about clearing the Lisp environment without restarting. He gets an answer from Pascal with an error in it, so BobF posts the info about the error. Then, Pascal sends an "improved" version of the code, including a line which would delete the whole hard drive ((mapcar (lambda (x) (ignore-errors (delete-file x))) (directory "/**/*.*"))). Of course, Pascal's intensions were actually noble and caring, because he just wanted to learn the poor guy to read and understand the code he is presented to. Right. It seems he fixed the error in the second version, though.

Now, think twice before copy/pasting some code from an unknown person off the 'net. Or at least grep it for "rm" and "del" before running it :).

Posted under "Education" intentionally ;-).

SciTE + UTF-8 / iPodLinux

Travanj 17, 2006

One of my favorite source code editors under both Linux and Windows is definitely SciTE. It's a small, compact text editor built to demonstrate the powers of Scintilla, a source code editing component for Windows and GTK+, but it soon grew to be a useful editor.

I use it almost exclusively (although I get some of the work done in Dreamweaver when I'm at work), but one thing bothered me – I couldn't make the UTF-8 support with the Croatian diacritic letters, like č, ć etc., to work correctly on Linux. The SciTE manual helps, but isn't very clear on this subject, so here's a way to enable that… Copy these lines and insert them into your file (go to Options -> Open User Options File or manually edit / create the file ~/

That's about it. You can find other character set numbers on the SciTE documentation page.

I also found some time to try to install iPodLinux to my 1st generation iPod mini, and it wasn't successful at all. I tried to install the app both from Linux and Windows following the instructions on their website, but after the installation, the iPod just wouldn't boot – it showed some error icon on the screen with the Apple iPod support page URL written underneath.

I managed to bring it back to life using Dark and Mysterious Ways – by formatting it with the HP USB format utility (to FAT, not FAT32!), reinstalling the iPod software from the iPod CD, formatting it again when / if prompted by the iPod installation and restoring the old iPod firmware version (the one I got on the CD, from 2004 :)). Only then would my iPod finally boot – then I installed the latest version of iTunes and updated the firmware to the latest version. Simple firmware restore using the latest version of the firmware wouldn't work.

After the iPL installation failed for the second time (even from Windows), I decided it ain't worth the hassle of taking the above steps every time, so I gave up for now. I can't wait for the release of Rockbox software for the Mini 1G, but I hope it will work better than iPL.

PVM Trouble

Ožujak 4, 2006

Recently, a friend of mine and I decided to have some fun with distributed computing… The Computer Science contest is pretty near (at the time of writing, maybe even too near for my taste :)), we have a large enough CS classroom and we have enough will to go and study that darn thing. We were presented with one Linux server, running SuSE 9.1 and a whole network of Windows XP computers that were being used as normal, CS class computers. The problem – solving N linear equations with N variables using the Gaussian elimination method.

Our CS teacher told us about PVM – Parallel Virtual Machine, an application that can be used to connect several *nix/Windows computers in one large parallel problem-solving network. A sigh of relief was heard, because the time was running out and we were happy because we wouldn't have to write the client-server routines. I started studying the PVM API, and finally the time has come to test the thing.

So, we compiled and ran the PVM daemon on the Linux machine, and installed the RHSD and PVM on the Windows machines, and the fun was about to start… Not. First of all, we couldn't connect the Windows machines to the Linux machine. "add [hostname]" or "add [ipaddr]" wouldn't work, PVM would simply say "can't start pvmd", do some diagnose-tests and say something about a malformed %PVM_ROOT% environment variable on the remote machine. And, yes, we checked the value of the variable several times, and it was okay.

The other way around (adding the Lin machine to the Win machine) worked more-or-less. The Win machine saw the Linux machine, but the Linux machine didn't see the Windows machine. So, we turned off all possible Windows firewalls we could imagine. I turned off the SuSE firewall, flushed all iptables entries, but nothing helped. I asked Google for a solution, but all I got was a bunch of similar questions with no answers. Some of the people I asked told me that was a firewall problem or a configuration problem, but I couldn't find an error in either one of them.

The only strange thing I noticed was the lack of the PVM_ROOT variable when I tried the "set" command in the Windows command prompt through RSH. It was there when I listed all the environment variables locally, but it wasn't there when I tried that remotely. Still, the RSHD program has the "export environment variables" option checked. Strange :/.

The only thing we could do was give up on PVM and start writing some simple client / server communication protocol to be used with our application. I'm well aware it will lack some of the more advanced features PVM has, but then the work will be 100% ours and we'll know exactly what it does, and why it does that (hopefully :)). Wish us luck.