Sunday, April 8, 2007

Ditching PC Suite

Since I'm leaving Nokia, my first step will be to install Ubuntu on my laptop. Unfortunately this will mean I won't be able to run PC Suite.

Since this was the way I backed up my contact list from my N71, and I also used it to sync with Outlook, I was kinda afraid.

But, while we are at it, I won't be using Outlook, either... Google Calendar is the way to go. And goosync seems to be perfectly capable of syncing with my phone. For additional coolness points, it is able to do this without actually asking me for my google account or password. What the Liberty Alliance Project tried (and failed) to do 5 years ago, Google just went ahead and did.

For backing up the contacts... have a look at ZYB. They have syncml-based backup system, for free. I don't really see their business model, yet. Seems they wanna make money off on things like outlook and iPod synchronization.

Saturday, March 31, 2007

reversing a long

This is the other question I was asked. The straightforward method: loop 64 times, shift out from right, shift in from left. This means 128 shift operations, and 64 ANDs, 64 ORs.

My brain, of course, wouldn't let go, so I came up with something much more elegant, somewhere, half asleep on the plane:

public static final long reverse(long l) {
l = (l>>32)|(l<<32);
l = ((l>>16)&0x0000ffff0000ffffl)|((l<<16)&0xffff0000ffff0000l);
l = ((l>>8)&0x00ff00ff00ff00ffl)|((l<<8)&0xff00ff00ff00ff00l);
l = ((l>>4)&0x0f0f0f0f0f0f0f0fl)|((l<<4)&0xf0f0f0f0f0f0f0f0l);
l = ((l>>2)&0x3333333333333333l)|((l<<2)&0xccccccccccccccccl);
l = ((l>>1)&0x5555555555555555l)|((l<<1)&0xaaaaaaaaaaaaaaaal);
return l;
}


This is 12 shifts, 10 ANDs, 6 ORs.

parity

I got the question, of how do you compute the parity of an int? My first reaction was that, well, you make a loop, 32 times, shift right, and do an xor on the least significant bit. I mean, man, that is an easy question, why do you even ask?

I'm ashamed to say, that I should have thought more carefully. I woke up in the middle of the night, 8 hours later, and had a relevation:


public static final int parity(int i) {
i = (i>>16)^i;
i = (i>>8)^i;
i = (i>>4)^i;
i = (i>>2)^i;
i = (i>>1)^i;
return i&1;
}

Friday, March 23, 2007

using NTFS for my external hard drive

I bought a 250GB external hard drive. Since sometimes I need to plug it into Windows PCs, I decided it is best to have it formatted as NTFS. I installed ntfs drivers (yum install ntfs-3g), and voilá, when I plugged it into the USB port, a nice folder appeared on my Gnome desktop, and everything was accessible.

Except for it is all read-only.

Damn. Now I need to figure out who is to blame: ntfs-3g, fuse, or gnome-mount.

Update, the fix is a one-liner:
gconftool-2 -s /schemas/system/storage/default_options/ntfs/mount_options -t string '[uid=]'

Thursday, March 22, 2007

linux on my usb stick

Interesting excercise. The stick can hold 512MB, so my first thought (put the Ubuntu live CD onto the stick) failed.

So here's what I figured out:
  • debootstrap is your friend. You partition, format, mount, debootstrap, and have a functional linux.
  • oh. De only thing you don't have, is an actual linux kernel. So install it with apt-get
  • both lilo and grub is complicated and big. Use extlinux to boot
  • apt-get install xserver-xfree-drv-ati, and some fonts
  • apt-get install gnome - this is 700MB! who would have thought. skip that
  • I settled with apt-get install fvwm. Oh the old days
  • apt-get install xdm - why does this also install cpp??
  • and to get to the point: apt-get install firefox
Tadaam. Still got 100MB to spare, and can do all my stuff. I mean you can do everything with a browser, can't you :)

Friday, March 9, 2007

Dusting off C

Since I'm looking for a job, I started practicing C coding. So yesterday I've implemented:
  • bubble sort in array
  • quickshort in array
  • heapshort in array
  • search for optimal parenthesing of matrix multiplication
  • radix short of a linked list
  • binomial heap addition
Today, I'll have a look at Perl :)

Thursday, March 1, 2007

Quiz

I just saw ad in the Budapest subway. It is looking for employees, Google-style.


I couldn't figure out the solution from the top of my head. What is the execution order of the "p2(c++), p1(c)" part? When will the variable c be incremented? What will be the calling order of the p1,p2 constructors? C++ is one magic language with lots of arbitrary rules.

But, of course, I typed it in and got the solution.

Tuesday, February 27, 2007

Who invented Relativity?

Makes a rather interesting read, but be advised, that to fully understand it, you need to have some physics backround.

Friday, February 9, 2007

the real Web 2.0

This is something worth checking out: Yahoo Pipes
You can collect all kind of info from different web services, mash them, filter them, in an intuitive manner. Have to have a yahoo ID for it.

Wednesday, February 7, 2007

gazpacho

As much as I like libglade and the whole put-your-GUI-layout-in-an-XML-file approach, I always hated Glade UI-builder itself. Too many windows, let's call it GIMP-syndrome.

I've found this new fancy builder instead, that outputs the same glade xml files, but has a workable UI. And oh, by the way, it is written in Python.

It will never catch on, though. No way any sane person can remember that name...

Tuesday, January 23, 2007

Yahoo vs. Google

An interesting read.

Neo1973

Cheap, hackable Linux smartphone due soon.

A small exerpt:

FIC's approach in sponsoring the OpenMoKo project resembles that taken by Nokia, which finances a "Maemo" software development community for its 770 Internet Tablet. Moss-Pultz acknowledges, "I have to give mad props to Nokia. I just think it's a shame [the 770] is not a phone."

Sunday, January 14, 2007

Code of Ethics

I'm going through ACM's Software Engineering Code of Ethics. It is a bit tough, but this is what we should strive for...

Saturday, January 13, 2007

Six Dumbest Ideas in Computer Security

An iteresting read. I battle with those ideas every day :)

Tuesday, January 9, 2007

iPhone

What can I say? Apple is cool. They manage to sell iPods at three times the price of similar mp3 players. And people keep buying them!
The iPhone will be in the same price category as the Nokia N75, although the exclusive deal with Cingular suggests massive operator subsidizing.

It will be interesting to watch what success Apple has with this. Lately, everything they touched turned gold. And also, it will be interesting to watch the phone giants responding.

Now, for something completely different

Monday, January 8, 2007

fedora problems

I cannot update my fedora anymore. It can download the repository files, but cannot download the actual rpms. Chicken-and-egg problem is, I have no ethereal installed :)

OK, downloading it from the repo by hand was easy...

Sunday, January 7, 2007

Nokia N800

I can talk about it now, since it is out in the stores in the US.

This gadget has the highest coolness factor of all Nokia products. No skype, but there is Google Talk.

google hack won't work

unfortunately. I should've thought. Mail forwarding is not the same as mail relaying. The gmail-smtp-in.l.google.com server won't accept myaddress@tegla.net emails, even though it is set up to send in that name.

Fortunately, godaddy gives a free mail account for my domain registration, and I set up gmail to download from its POP server.

email address?

My next project is creating an email address without actually having to rent a virtual linux, or paying someone for email hosting.

Where to point the MX record? The host has to accept RCPT-TO: myemail@tegla.net

I have to look around. Gmail accepts mail forwarding from other accounts. If I can trick it to act as my mail relay, I'm done.

new domain name

I've got my own domain name. In the old days, when I was sysadmining (like, 7, 8 years ago), it was complicated. Now, I registered the domain, paid for it, got a nameserver, set up a cname record for the blog in under 10 minutes. And it costs 9 dollars a year. Why didn't I use godaddy then?

Wednesday, January 3, 2007

Why SOAP sucks

Just found this. Right out of my mouth. Back then it took me about a day to go from "wow, cool" to "this sucks".

Tuesday, January 2, 2007

New year, new blog

Ok, it seems to imply I had an "old" blog, but what the heck. I only make this to talk to myself, so who cares anyho'