lauantaina, maaliskuuta 31, 2007

Liikennesäännöt muuttuneet!

Olen ajanut autolla melko vähän viime aikoina ja uutisten katsominenkin on jäänyt monesti väliin kun lapsemme haluaa katsoa talon ainoasta telkusta Simpsoneita (tulee siis samaan aikaan uutisten kanssa.)

Minulta on tainnut jäädä huomaamatta liikennesääntöjen muuttuminen. (Oletan, että olisihan siitä kerrottu uutisissa, ainakin ennen on niin tehty.)

Nähkääs, ennen oli niin, että kun risteystä lähestyi vastakkaisista suunnista kaksi autoa, joista toinen kääntyi oikealle ja toinen vasemmalle, vasemmalle kääntyvä väisti oikealle kääntyvää.

Eilen matkalla Kotkaan ja tänään matkalla ratsastamaan minä olin molemmissa tapauksissa oikealle kääntyvä, mutta minun oli tehtävä hätäjarrutus kun vasemmalle kääntyvä änkesi väkisin edelleni.

Yksittäisiä tollojahan liikenteessä aina tapaa, mutta kun näin kävi perättäisinä päivinä, on kyseessä varmaan jotain muuta, kuten liikennesääntöjen muuttuminen. Ehkä EU on taas tehnyt uuden direktiivin.

FINLEX sanoo:
Risteyksessä kääntyvän ajoneuvon kuljettajan on väistettävä risteävää tietä ylittävää polkupyöräilijää, mopoilijaa ja jalankulkijaa. Samoin on kuljettajan, joka muualla kuin risteyksessä, aikoo poistua ajoradalta tai muuten ylittää sen, väistettävä tien reunaa käyttävää polkupyöräilijää, mopoilijaa ja jalankulkijaa. Vasemmalle kääntyvän kuljettajan on lisäksi väistettävä vastaan tulevaa liikennettä.
Eivät ole tainneet vielä päivittää noita verkkosivuja. Vai ovatko oikealle kääntyjät osa "vastaan tulevaa liikennettä"?

tiistaina, maaliskuuta 27, 2007

Moni on kakku päältä kaunis vaan on silkkoa sisältä

Kuuntelin MacBreak weeklyä ja latasin siellä mainostetun HumaneText-"palvelun" eli OS X "service" kokeillakseni sitä. Kääntelin ja katselin sitä vähän kun kiinnosti miten se on toteutettu ja selvisihän se... perimmäisenä on shell-skripti, joka on tässä kokonaisuudessaan:

#!/bin/sh
cat|./SmartyPants.pl|./Markdown.pl

Eikös äiti jo opettanut, mitä on useless use of cat.

maanantaina, maaliskuuta 26, 2007

My fixed throttled 0.4.6

First, some background:

If I had OS X 10.4 Tiger, I could set up my kernel to do packet prioritization, but since I'm still using 10.3 Panther, I had to come up with something else.

Fortunately someone else had already done the hard part and created throttled. It is a user-space daemon that sucks all the packets in using the kernel firewall divert rule and sends them according to a few rules that make life a bit easier.

I can divide traffic to high and low priority and it also gives highest priority to packets containing the ACK bit, which has the benefit of keeping your downlink live and well even if your uplink is congested.

I also reviewed the code of throttled and having just spent the last 3 years working on a pretty tricky piece of threaded software, I discovered some thread-locking related problems in the code.

I created a patch to fix them and sent it to the authors of throttled.

Here's the email I sent to them:

Lähettäjä: sjtikka@gmail.com
Aihe: Patch for throttled
Päiväys: 1. helmikuuta 2007 22:37:12 GMT+02:00
Vastaanottaja: throttled@intrarts.com

Hello. I have been using throttled for a week now and it really works!

I was curious to see how it does its magic and took a look at the source code. I think I discovered a small problem that could lead to the sender thread going to sleep and never waking up, or at least until throttled gets a new outgoing packet.

The problem is that the size of PacketQueue is checked without holding queueMut mutex. This means that sender thread may check PacketQueue size at a moment when it is empty and decides to go to sleep. But then, just before sender calls pthread_cond_wait, scheduler runs one of the receiver threads, which places a packet into the queue _and_ calls pthread_cond_signal. This signal does nothing, because there is no-one sleeping on the condition variable. Then scheduler starts running the sender thread again, which calls pthread_cond_wait too late, it missed the signal to wake it up.

Sure, the sender gets woken up when the next outgoing packet causes receiver thread to call pthread_cond_signal, but sometimes that might take a long time.

I have made the attached patch to fix the problem. I hope you consider merging the patch to the next version of throttled.

Thanks,

-- Sami Tikka

I never heard back from them. Because I'd like others to also be able to enjoy this amazingly useful piece of software, I'm making the fixed version and the patch available.

keskiviikkona, maaliskuuta 21, 2007

Review of Skullcandy Proletariat NC headphones

I recently got myself Skullcandy Proletariat NC headphones. The "NC" stands for noise canceling. "Proletariat" stands for affordable.

The price at Digitoday Shop was 79 euros (shipping included.) This is much cheaper than noise cancelling headphones generally cost, which is over 100 euros, often more than 200.

I was initially tempted to go with Sennheiser's PXC 150 but I did not like the extra enclosure for batteries and noise canceling electronics. I already dislike the one wire from my iPod to the headphones, two would be unbearable.

The Skullcandy headphones are a bit bulky for outdoor use but they contain all the electronics and batteries in the headphones themselves.

The sound quality is fair. It is nowhere as good as my old Koss SportaPros, but much, much better than the Koss Plugs (which, in turn, are better than the headphones that come with iPod.)

The noise cancel feature really works. You can still hear sounds from your surroundings, only their level is much subdued. This means that music/podcasts can always be played at a normal volume level, regardless of the noise that surrounds you.

This is great. Before these headphones I was cranking up the iPod volume close to the max when listening to Science@NASA podcast while walking in Helsinki city centre. I had to constantly reach into my pocket to adjust the volume depending if I was sitting in the train, walking on the street, escalator or traveling in the subway. Sometimes I would just pause the iPod until I got past a particularly noisy location.

With these NC headphones I can set the volume level to something confortable to my ears and I never have to touch the volume setting during the commute. I should have gotten NC headphones years ago. I should kick myself for not doing that.

I have found a problem with the headphones: They are very sensitive to electromagnetic interference. Walking near high-voltage wires, like the ones at train station, causes a low, loud pulsing sound to emit from the headphones. The sound is so loud that I switch the NC circuit off when that happens. It only takes me a couple of minutes to get into the train or far enough from the powerlines.

The headphones are also sensitive to radio interference of mobile phones. While traveling in a train car full of commuters, each carrying a mobile phone, every couple of minutes I hear the same TA-TA-TA-TA-TA sound that you get if you place your mobile near the loudspeakers of your computer.

This is pretty annoying. None of the reviews I read on the Internet mentioned this. I think it would have been worth the money to get the Sennheisers after all, if they do not suffer from the same problem. (But how would you know?)

Also, the Skullcandy headphones are targeted to people with small heads. I have a fairly big hat size and the Skullcandy sits very tightly in my head, too tightly to be comfortable for extended periods.

Summary: Noise canceling is great but they should have been better shielded from radio interference.

lauantaina, maaliskuuta 10, 2007

Hyvin parkkeerattu?


Hyvin parkkeerattu?
Originally uploaded by sti.
Siitä onkin aikaa kun on viimeksi nähnyt näin huonosti parkkeerattun auton. S-marketin piha, Veikkola.