Life in the Netherlands

A not so long while ago, I completed my studies at the Utrecht University. Now I'm looking for the next thing to do. Here, I would like to write about my experiences throughout the last couple of years, without going too deeply into details and nuances. Of course, my account is biased for multiple reasons: my contact with the Dutch people was done mostly through the university. Furthermore, my observations perhaps say more about the countries where I lived previously rather than the Netherlands.

The Netherlands is a great place to live. There is an atmosphere of social justice with deep roots, and most people are fair and respectful of others. The Dutch definitely know how to manage money and how to save it – and save it they must, since everything is so expensive. Train tickets, bus tickets, a meal at the restaurant, etc. costs considerably more compared to other countries in Europe (as far as my experience goes).

Biking

As you may know, bikes are omnipresent. Biking has been enjoyable in general, with one exception: during the busiest semester, I had to bike over 10km every workday, which I did not like together with the university workload that had to be handled. But biking was still the best choice, since the alternative would have been taking a time-consuming detour by bus. Plus, biking, as any physical activity does, gives a boost of energy and enthusiasm.

Gadgets

Without wanting to inadvertently offend anyone, the Dutch people seemed less materialistic and less concerned with electronic gadgets. Never have I seen anyone boasting about their latest phone or laptop – that is not to say they do not have them, they do, but they are just daily, common objects.

Renting a room

There was a subtle bias against Romanians when it came to finding accommodation from private owners, and the average Dutch person may judge others too harshly using all the dubious stereotypes they heard before. To keep things clear, though, in my book, being born in a certain country doesn't require one to justify the behavior of others born in the same country. The point is, although some Dutch are not so bright, the majority are quite alright, and some are great. Furthermore, speaking Dutch already helps a lot (more on this later on). Regardless, I had a great experience with landlords overall. A family of Chinese descent was particularly kind and managed everything well.

Cooking

While renting a room, you get to live with people and sometimes you get to cook together and share the food. This is great for saving money, as cooking more food than usual is quite easy. I've learned how to prepare lots of (ostensibly) delicious recipes (if I may say so myself). I recommend recipes that contain tomatoes and coconut milk – this is a great mix.

Dutch language & culture

There are many foreigners who move into the Netherlands, who do not learn Dutch (nor do they speak English, which helps communicate at least to a certain degree). The Dutch are unhappy with this, and probably feel that their core values are being spoiled. Some of these foreigners are also antisocial – for example, they damage bikes (happened to my bike twice), enter unlocked cars, etc. There are reasons why the Dutch do not like them. However, once the Dutch language is mastered, it is much, much easier to get along with everybody.

Sadly, I am still not able to hold a conversation in Dutch, which I consider a slight personal failure from my behalf, and hopefully I have not annoyed too many good folks because of this. At the beginning of my stay I planned to learn the language. With more dedication and more Dutch classes, I would have been able to pick it up. However, English was sufficient for me – most of the time, one can get by using it. In my defense, learning a very unfamiliar language is a difficult task, and I made considerable progress. This is a sample of what Dutch may sound like: http://www.youtube.com/watch?… (Note: this is probably Frisian, a language very close to Dutch which has many variations throughout the country anyway).

Timely buses

The first contact with time-tables for buses has been that of confusion, however I've grown accustomed to the many things one has too keep in mind to have an enjoyable trip outside. Otherwise, not knowing when to catch the last bus for instance can result in having to walk a long way home at night. Biking alleviates this – there is no dependency there. However, now I much prefer to know the times at which I can catch buses.

Conclusion

I definitely recommend The Netherlands and its education system to anyone who wants to study there. For anybody who wants to live there, I strongly recommend learning the language, even though English is so widely used.

POST#0080 2011-OCT-7

Add Comment

How do rail car wheels manage to go round the curve?

Recently I remembered a puzzle I thought about a few years ago: „How do rail car wheels manage to go round the curve?“. Some ex-colleagues and I were in a train returning from a trip to the mountain. The train had a small incident, something related to a short-circuit and electric failure: there was a bolt of electricity which could be seen from under the train reaching a considerable distance and touching a nearby house. The train came to a stop and there was some smoke, but we were fine and we got back home safely. So, going back to wheels, well, this event made us more conscious that we are actually traveling in a train, on a set of wheels on a track, and someone posed the question.

Take a normal car, the one that can be driven on the road. Have you observed that, while you're inside it, when the car steers, a part of the vehicle moves more than the other? Consequently, when in a curve, some of the wheels have to roll more than the others. To make this possible, cars are equipped with differentials placed between them on the axis, allowing wheels to turn independently one from another.

Rail vehicles, however, use no differentials: the axis and two wheels are all connected in one piece. This shows that the problem of trains negotiating curves is not as easy as one can initially think. My first guess was that tracks are tilted in curve, allowing trains to bank when needed. It turns out that this is true, this type of curves are called cants1. They allow trains to change their direction while maintaining a greater speed. However, we're not done yet, there's something more at work…

Another instance of curved tracks I observed is that which is used by tram-ways. There is at least one place in Bucharest where the tracks lead trams in a tight curve (it's actually a U-turn at the end of the line). They slowly pass through it, making a lot of noise resulting from the friction of metal. In this case, the wheels are spinning at the same speed, except superelevation (or banking) and the centrifugal force cause more weight to be placed on the inside wheels. Since there is less force placed on the outside wheels, they skid over the rail (producing the friction noise).

But leaving the trams aside and going back to trains, the most interesting fact, seems to be this one: the wheels and track have such a geometry that, as the car enters a curve, the lateral displacement causes the rolling radius of the left and right wheel to change. This means that the wheels start to behave as a cone rather than a cylinder, allowing the car to steer freely through the curve.

So yes, have you ever wondered why are railroad wheels shaped the way they are? it seems that there is indeed a purpose to their geometry, and to that of rail tracks as well.


1: „http://en.wi­kipedia.org/wi­ki/Cant_(road/ra­il)“

POST#0076 2009-JUN-2

Add Comment

The arguments not against Religion

I was brought up in a religious country. Even now, in Romania, religion is quite a big deal. Since now we're close to Easter holidays, you should know that foreigners witnessing the orthodox tradition are surprised by the amplitude of the events happening on Easter day. Basically everyone goes to church, listens to the priest's hypnotic discourse, and lights up candles, making sure to „take the light“, that is – to light their candle from the „official“ candlestick (or other candles as long as they are lit from there).

I have kept thinking and writing in the past about the arguments against religion, but never why it's useful in the first place. It's sometimes required to think from people's perspec­tive, so here it is – cases where I think religion could be a positive thing:

  • Missionaries are the first to intervene in a third world country, wherever there is a society needing this, even if it costs them their lives – they try to educate people and get them to coexist peacefully.
  • Sometimes (not so often today), people or groups of people are found in situations where there is no visible way out. Religion helps them cooperate in difficult settings and gives them hope to overcome hardships easier. It also eases the psychological pain when sacrifice is needed (for instance, there are 40 virgins waiting for you in heaven if you die). This may explain the emergence of religion through an evolutionary standpoint: the communities that were supported by a religious belief may have acted in bolder ways, and therefore had greater chances of survival.
  • When someone dies, the priest giving the mess somehow provides comfort. This is something I experienced. I guess it has to do with the superstitious nature of humans. For example, think of a disgusting insect, but made of chocolate. It's not a real insect, you know it's edible, but would you easily eat it? In the same way, I guess priests provide some comfort for the loss of someone – somehow they appeal to our superstitious self, telling us the deceased are in a better place.

In conclusion, we are fortunate that today we are living a better life, closer to the truth, and in chance there is a God, then it's most probably something stretching a lot the definition that religions give of God.

POST#0070 2009-APR-15

Add Comment

Anti-bad Luck Society

You would think that the fight against superstition (today taking the form of anti-creationism) is a new and contemporary movement. An empty cage, a challenge for a Creator to place a new animal in it? In contrast, here's what people thought 150 years ago[1]:

„ANTI–BAD LUCK SOCIETY — The only way to prove the position that superstition is nonsense is by a bold defiance. Some brave Frenchmen are trying to do this. A society has been formed at Bordeaux to put down the superstition of evil omens. As everybody knows, it is ‘bad luck’ to begin anything on a Friday, or to sit down at a table with thirteen, or to spill salt between yourself and a friend. The new society proposes to have regular dinners on Friday, to have thirteen guests, and spill salt around before commencing.“ March 1859

A note from the article then mentions „It appears that the society has not in fact survived.“

[1]: Scientific American March 2009: „50, 100 & 150 years ago“

POST#0065 2009-MAR-23

Add Comment

Large file uploads using PHP and the PUT HTTP verb

A week ago I made some modifications to the generic file uploading system I use in web development.

It is basically a stand-alone PHP web application that has the sole purpose of storing files. Right now it is dependent on Zend Framework, but in the final version, it should be easy to install anywhere and it should require minimal configuration. It should also be secure. I will call it the Media Repository

One possible use case is when building a classic HTML file upload form with PHP: after the temporary file is stored on the disk, it should get relayed to the Media Repository and stored there.

The Problem

In short, the problem is you can't upload large files. Initially, I was using the Zend Framework HTTP Client to relay the file to the repository. Problem is – when constructing the POST request to the Media Repository, the large file is stored as a string inside the Zend_Http_Client class. This is okay for small files, but it can become a problem for large files. The upload time and size is limited by the following settings:

  • The total amount of memory that PHP can allocate (php.ini memory_limit)
  • The maximum execution time and maximum input time (php.ini max_execution_ti­me and max_input_time)
  • The maximum post size (php.ini post_max_size)
  • The maximum file upload size (php.ini upload_max_fi­lesize)

The Solution

  • Increase max_execution_ti­me and max_input_time. If your configuration allows it, it can be done with the ini_set() function, without having access to php.ini
  • Use the cURL extension. to check if your PHP installation has cURL, see How to check if an extension is installed. cURL allows you to avoid reaching the memory_limit when preparing the request. Using the CURLOPT_INFILE setting, you can instruct curl to transfer specific stream, instead of a string. It avoids storing the entire file content to memory.
  • It's also a better practice to use the PUT http verb instead of POST when posting files as raw data:
$ch = curl_init();

$source_file = 'example.txt'
$upload_url = 'http://example.com/folder/example.txt'

// Open the sourcefile
$readfile = fopen($source_file, 'rb');

curl_setopt($ch, CURLOPT_URL, $upload_url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_PUT, true);

curl_setopt($ch, CURLOPT_INFILE, $readfile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Relay the file to http://example.com/
$response = curl_exec($ch);

// Close the source file
fclose($readfile);

// close cURL resource, and free up system resources
curl_close($ch);

On the other side of the problem, to recieve the transmission on the Media Repository, again you have to avoid storing the whole content in a variable. This time, the POST input can be retrieved by opening the php://input stream:

$read_handle = fopen('php://input', 'rb');

// The filename where the input must be stored.
$target_filename = 'example.txt';

// Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length.
// If the file does not exist, attempt to create it.
$write_handle = fopen($target_filename, 'wb');

if (($read_handle == false) || ($write_handle == false))
    $success = false;

while ($success && !feof($read_handle))
{
    $chunk = fread($read_handle, 4096);
    $success = $success && (fwrite($write_handle, $chunk) !== false);
}

$success = $success && fclose($write_handle);
$success = $success && fclose($read_handle);

So this I think should be helpful when dealing with large file uploads in PHP.

POST#0057 2009-FEB-7

Add Comment

Connection problems with the Alice Gate 2+ ADSL modem

Alice is a brand owned by Telecom Italia, one of the largest fixed phone operator in Italy. Alice is dedicated to offering ADSL Internet, also servicing Germany, France, San Marino and the Netherlands (http://en.wikipedia.org/…lecom_Italia).

The Alice Gate 2+ is the default ADSL modem you receive after installing an ADSL line for the Internet in Italy. One model has a Wi-Fi antenna and some ports you can use to connect devices via cable. There is also a version featuring a VoIP service which you can use instead of the primary land-line phone, but forces you to change your phone number.

After the physical installation of the modem, there are a few problems you could possibly run into. Depending on the operating system used, you can have no Internet connectivity at all or you can have problems with file uploads and downloads.

Fortunately, they're quite easy to solve. The way to go is to edit your operating system tcp settings.

Ubuntu, Linux, Mac OS X

Symptom: after a few sent/received bytes, the network traffic stops. To fix this, open /etc/sysctl.conf as root (create it if it doesn't exist). Make sure it contains the following values:

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_ecn= 0

Windows Vista

In Windows Vista, it's impossible to upload files and sometimes downloads stop after the first few kilobytes. If this is what's happening to you, open a new Command Prompt as Administrator and see the current tcp configuration:

netsh interface tcp show global

Then disable the autotuninglevel and ecncapability:

netsh interface tcp set global autotuninglevel=disabled
netsh interface tcp set global ecncapability=disabled

This will probably help you fix the problem with this modem, but you can find more about it at the source I used for this article: http://www.lemiefrequenze.org/…archives/162

POST#0055 2009-JAN-11

Add Comment

Kiwibanana God

This is a satirical article about religion written in Romanian. I might translate it to English at some point.

O veste uimitoare! Azi dimineata la ora 11:29:51 m-am trezit din somn si Universul a fost creat. A fost creat de zeul Kiwibanana (Poza alaturata).

Capitolul 1. Geneza

La inceput nu a fost nimic, dar dintr-o data zeul Kiwibanana a fost creat, si este compus dintr-o Pasare Kiwi si o Banana, aceste nobile si sfinte obiecte de pret simbioza dintre vegetal si animal. Astfel a decis sa creeze Universul asa cum il cunoastem, si pentru ca este atotputernic si atotstiutor l-a creeat in starea in care este, cu noi si cu toate amintirile care ne dau impresia de vechime. Noi credem ca este vechi de milioane si miliarde de ani, dar in momentul in care scriu acest post nu are nici macar o zi!

PS. Poza zeului nu am facut-o in Photoshop, ci este este efectiv facuta cu camera! Traiasca zeul Kiwibanana si profetul sau (eu). M-a rugat sa intervin asupra ochilor putin, ca sa-l fac mai autoritar.

Intrebat care sunt urmatorii pasi pe care ii va urma, Kiwibanana a declarat reporterilor:

Am o mare problema acum, sunt ridiculizat si nu reusesc sa ma impun in fata oamenilor carora le-am dat constiinta, independenta si putere de decizie, dar e OK, pentru ca am vorbit cu profetul meu [eu] si l-am delegat pe el ca sa arate calea infidelilor. GEM! [Glorie Eterna Mie]

Capitolul 2. Explicatie

Nu, nu am luat-o razna, ceea ce vreau sa demonstrez este ca orice idee stupida poate constituti o religie care nu poate fi atacata din punct de vedere stiintific. Vreau sa folosesc ironia pentru a convinge familia mea (oameni religiosi) sa imi respecte ideile si convingerea agnosticista asa cum le-am respectat-o si eu pe-a lor, pana acum (adica mambo jambo-ul cu Dumnezeu, care bine-nteles este inclus si planificat pana la cel mai mic detaliu de catre Kiwibanana, bine-nteles). Ochii lor trebuiesc deschisi pentru a vedea mecanismele din spatele religiei!

Ce alt mod mai potrivit exista decat de a initia o religie? Astfel, odata cu crearea Universului de azi dimineata, sper ca realitatea se va contura si pentru ei, iar imaginea va fi de cristal.

Capitolul 3. Concluzie

A inceput operatiunea de prozelitism explicit. Raspanditi vestea! Fanatismul este intotdeauna binevenit. Un numar mare de adepti opteaza pentru acesta religie pentru a transmite vestea nasterii Universului si a indeplini vointa zeului Kiwibanana! Acum, este timpul sa adoptati noua credinta si va adaptati noilor timpuri! Supuneti-va suprematiei lui, altfel distrugere si ha–i–os vor urma!

POST#0018 2007-MAY-5

Add Comment