Recently I needed a fast an reliable hash function with good statistics on distribution and I came across what is commonly known as the FNV-hash function. FNV is short for Fowler / Noll / Vo the last names of the three most prominent people contributing to the hashing function.
Basically the FNV algorithm is a very simple one but it is effective and yields astonishingly well differentiated hashes. It has been used in many different codes and both the algoritm itself and a standard source coude has been released into the public domain.
Pseudo code
hash = offset_basis
for each octet_of_data to be hashed
hash = hash * FNV_primehash = hash xor octet_of_data
return has
The above is called the FNV-1 algorithm. If the multiplication and the XOR change place we get a variant called the FNV-1a which is very similar in all aspects of the first one. I decided to implement both and hash both as 32 bit numbers and then put them together into one 64 bit number creating a very fast and even spread of hashed numbers.
Kungsträdgården is one of the most remarkable underground metro stations in the Stockholm Metro system. It is the south end point of the blue line and from here it goes to both Akalla and Hjulsta. The Kungsträdgården stop is just one stop south of the central station, T-Centralen.
The station is located in the bedrock under Jakobsgatan, Jakobs church and Arsenalsgatan through the Kungsträdgården park area. The platform is about 35 meters below ground and can be reached through the entrances placed at Regeringsgatan/Gallerian or Arsenalsgatan. There are two tracks here and trains going to Hjulsta and Akalla always starts from the same side. The Akalla line sometimes have to cross tracks with south going trains and this causes frequent delays. Both tracks may change sides to left hand side traffic north of the platform since the whole metro system makes use of left hand side driving of the trains.
The artist who did the fabulous work in this station is called Ulrik Samuelson and he has found inspiration from the palaces around kungsträdgården. The red man here is a war god that used to sit on Riddarhusets (house of knights) roof there are also male and female torsos and many many other beautiful things to see here. If you are visiting Stockholm don’t miss this station!
In Sweden there is a lowered tax on fuels considered environmentally friendly and cars that can use such fuels (or are extremely conservative with normal fuels) are considered environmentally friendly and therefore get a lot of benefits such as lower taxes. The government even pays you the equivalent of €120, $1500 when you buy that kind of car instead of a normal petrol or diesel-guzzling vehicle. You can park for free in many places in the city if you have a car like that, you don’t have to pay congestion charge for going in and out of the city in the day and so on. These things are done to stimulate people to chose more environmentally friendly cars.
For the last few years the ethyl alcohol or methanol cars have been touted as the environmental friendly personal transport for the future; and subsequently a whole chain of events started that probably could have been foreseen but was never really looked into when the decision was made. On the surface it looks like a good deal, alcohol is rather cheap, it is bio-renewable the exhausts are far cleaner than gasoline/petrol or diesel vehicles gives us and above all, most cars engines can be converted to run on alcohol without too much trouble or cost.
These days many petrol stations have designated pumps for alcohol fueled cars and more are coming. The fuel is called E85 and consists in the summertime of 15% ordinary gasoline and 85% ethanol. However most environmentally friendly alcohol cars are still driven on ordinary petrol and the reason are that the difference in price is not really encouraging people to spend the extra time finding a place where you can fill it up. Other problems are also that the energy content per liter of fuel is not that good meaning the car is a little thirstier than usual so if you add that up you don’t save a lot of money and you get a lot of extra hassle trying to find a station to fill it up with alcohol. On top of that it is also difficult to start cars that runs on pure alcohol in the north of Sweden when it is really cold meaning that in the winter time you will have to mix it with more petrol. The fuel does not burn easily when its -30 °C and so that is also a problem that is perhaps more specific to us in the north here. Therefore in the winter the mixture is not 85/15 any more but changed to contain far more gasoline than in the summer time.
What’s even worse is that the industrial alcohol used is made from sugar beets, a crop that does exist but is not wide spread here because of the climate so lots of them are from Brazil where rain forests have to give in for vast plantations of the fermentation friendly vegetable. This is madness in more than one way of course but that’s the way it is – the cheapest route to make alcohol is to ferment a sugar mash basically. It is also made from various grains – that’s basically human food – this drives up the price of wheat and other grains suitable for putting into fermentation to get alcohol, prices that we in the west may have the money to pay for our foods but certainly people in the third world can’t. So while people starve we use their food to power our vehicles. Triple madness.
So what would be a good alternative? Fuel cells are not really ready for this kind of application yet, hydrogen/oxygen is hard to store, extremely volatile, has to be kept refrigerated (or hydrogen dissipates) under high pressure – there are still ways to go here. There are of course natural gas engines and this is coming more and it could be an alternative but the whole point of the exercise is really to get away from fossil fuels, is it not?
The most successful environmentally friendly car right now over here is the petrol/electrical hybrid car. At best it cuts the petrol use by half by using an assisting electrical engine, a rather large and heavy battery bank and in most cases it still saves something like 20-30% compared to a similar all-petrol car. The most used, liked and famous car is the Toyota Prius which I think pretty much every taxi driver is using these days. Lovely car, would not mind one myself really. At least not until it is time to renovate the battery bank in it.
The fully electrical car is being talked about a lot and for many people the thought of driving into your ”gas”-station, connect an electrical cord to charge your car while you get two packs of milk and some candy for the kids is a very compelling picture. The problem here is that it won’t work. First of all the energy spent going to and from the store would require several hours of charging to replenish. For many people charge over night, go to work, charge at work, go home could work – but for longer trips it would not work. Battery chemistry is just not good enough that you can re-charge them so quickly. Not to mention that the sheer current needed is much higher than what any normal household outlet can deliver. We are now talking industry sized connectors here carying at least a hundred ampere in order to charge enough energy to drive around for a day in say ten minutes time. So not a very practical solution.
The collective transport system here in Stockholm is excellent if not even brilliant but in many parts of the country, the rural parts and in the north there aren’t as many choices as here. I get around in the city almost exclusively by collective transport these days using the underground metro, commuter trains, buses and ferries daily but in the country side you have only buses really and the need for people to transport themselves is not going to become less in the future, if anything the new economy requires people to be able to transport themselves even more than before as the job market becomes more dynamic.
I don’t really have a working solution but I know that ethanol is not the solution, instead it has pretty much stopped the Swedish car manufacturers Volvo and SAAB from continuing a sound development of hybrid cars or alternate fuels since it was so much easier to convert what was already there to alcohol fuel which we now are starting to realize actually in many ways is not at all better for the environment than ordinary petrol (which already has a 15% mix-in of ethanol if you did not know that).
Today the Swedish radio reported that in one year the most commonly used medication against influenza viruses; Tamiflu the medication each and everyone stockpiled in 2005 and actually one of the few medications that was somewhat useful in the treatment of bird flu infected humans have lost a lot of its potency because the flu strains has become resistant to it.
This is a problematic development because there are not many other medications that have effect on this dangerous illness and the scare that it would combine with an ordinary flu to form a ”super flu” for which we do not have a treatment has been actualized again because of this.
In fact several countries who stockpiled Tamiflu are now just going to destroy it – basically incinerate it. In many cases this is a result of decision makers not listening to the scientists telling them that Tamiflu would probably not be the best way to spend the resources to combat avian flu virus.
Last time when the bird flu was on everybody’s lips (figuratively) many voices where heard crying out that the government should start stockpiling Tamiflu, licencse it and start whole new factories to make extremely large quantities of such medications in order to have ”enough medication for everyon” in the event that bird flu should become the pandemic that some thought it might become.
The scientists at the time tried to explain that it was a bad use of resources for several reasons including the very true reason that the human version of the bird flu, the ”super flu” would be different from the bird flu virus in several ways and the Tamiflu medication may not have any effect at all on this form if it formed and in fact it was better to work from the other end with more research on bird flu itself and to prepare to find a more suitable medication tailored to the new flu when it emerged.
But this is very difficult to do unless you have an infected population to work from and to create a medication for an illness that does not exist is very difficult to not say rather impossible.
The Avian Flu virus have mutated into several strains since it was observed closely in 2005 and common antigens have been found but there is enough variation within the group of avian flu viruses that it is not possible to create a single ”strike all” medication and therefore stockpiling the Tamiflu is at best a waste of money.
Now we have observed strains that are resistant to the drug and therefore can not effectively be treated with it so if the resources had been spent on more and better research instead we might have had a broad spectrum antiviral agent or at least better anti-ful agents for the strains that are most likely to combine with a human flu and form a ”super flu” that we all dread.
I am sometimes fascinated by bridges. They have been around a long time and take many shapes and forms and they are always a bit suggestive to photograph.
Over the years I have been collecting a few bridges and I want to present some of my favourites here.
These bridges are my favourite bridges so far in the world. Of all of them the bridge in Skopje is the most symbolic and the one I like the best. I miss going to Macedonia meeting the great people there and the country side and the food and everything else…
There are many houses around this area with old ”commercial messages”. One of the most famous ones is the Stomatol tooth paste ad that you can see if you are looking towards Slussen from the traffic careousel at Södermalmstorg.
On purpose I changed the contrasts and sepia-coloured this photography. I think it is rather timeless with a few exceptions, the Taxi Stockholm car is pretty new and shiny and the traffic light also tells us it is a modern picture. But the storefront windows, the house and the ads on top of it are pretty historical in a modern sense… :)
On my way from Gamla Stan, the old town, to the south end of the city I stopped on the bridge and decided to try to get a handheld panorama of this part of the city. Usually I am not too much a fan of panorama pictures, they have a tendency to be awkward to frame if you know what I mean.
But I shot using my 16-85 set somewhere around 30 mm focal length and handheld. This pano is composed of 6 stitched pictures, all done manually in Photoshop. If you really want to see the picture you must click on it and view it full size, the limits in width on this blog does in no way make it justice.
I did not modify the picture in any way except that I worked a little bit with the contrast since it was a bit of a dull light in the air.
The tower in the far background is actually the city hall.
Fatburen is a small area in the south end of Stockholm. These days you find it between Medborgarplatsen and the Stockholm Södra train station roughly and the blocks in between. There are many very modern buildings here and fortunately the Fatburen park has been saved, fatbursparken in Swedish.
I passed by here last Monday and had the camera with me which was quite lucky because I got a picture that I have had in my head for some time now that we have finally gotten a bit of proper winter even here in Stockholm.
The picture is a full colour picture but the whole world seemed very black and white at this moment. The park was full of people as well and tourists taking pictures of each other with their cameras. So I had to wait for the right moment before I could squeeze off a few pictures and this is the result.
At the left in the very far reach of the picture is part of the railway that goes under the city into the Central station. This part will be rebuilt and probably covered to the dismay of some of the train spotters who use this place to spot trains passing by. I just hope that they will preserve this park even if it is a park that has a bit of a drug problem going in the late summer evenings…
I did not realise it until last time I uploaded yet another picture of my favourite padlock that I have come back to this place over and over again visiting the same place and always stopping to take a picture of that.
I wonder what compelled me to take a photograph of it the first time, but I think I know what it was now, the structure on the steel casing. It is a hard steel casing in stainless steel alloy, hardened to make it difficult to saw into and break yet not too brittle as to be easy to crack with a switft blow of a stone.
The first time I just wanted to see how well my campera would focus and then it became a ritual, now I have shot this padlock with pretty much every lens I have ever used. Strange thing that.
Now you have seen three representative pictures of an Anchor padlock. But wait. The one in the middle picture is actually not the same lock. Take a look at the numbers at the top of the lock. In the middle picture the numbers are not the same or are they? Perhaps the lock has just been turned around. Or did they chage it and then back again?
Dear people today is the 1st of March 2009 and I have not had much time lately to spend on my website so this weekend I have done some changes, mostly ”under the hood” but you may also notice that the appearance changed drastically today. This new theme is quite more Leonardo DaVinci looking rather than the old sleek modern-and-chrome thing I used before. It signifies some changes as well and that I have moved parts of the photography article things away from this place over to the Swedish site fotonen.se which is a place that I will be developing more in the coming months.
Those of you who have followed me around since I started Ichimusai.org a long time ago, before the new millennium knows that about once a year I usually do change something around, and I think this is a part of my process of developing – not only the webbskillz per see but my focus in life also seems to shift a bit.
I will still use this place to post my own personal photographs, manipulations and ideas and musing on anyway so don’t worry about that. I also hope to translate most of the Swedish articles to English and publish here because I know from comments and emails I have a small but much interested bunch of readers out there around the world. Much obliged! :)
In my life there has been some changes also – as most of you are aware I changed jobs and are now working for the local company providing the underground metro train services, commuter train services, bus services and some of the ferries in the city and close archipelago. The company is Storstockholms Lokaltrafik (SL). My position there is as an engineer on the radio team. The company has several radio systems that it maintains for fleet supervision, traffic radio for the metro trains and so on and we are currently involved in many interesting projects so I was taken onboard so to speak to support that.
Jeanette and the cats here are doing well as well, and my fiancee Jeanette has now got her own blog started which you can take a look at (all in Swedish).