Foreign Police registration in Prague

March 24, 2008 | Filed Under Prague | Leave a Comment 

I have dual citizenship (Finnish and Australian). I recently registered with the Foreign Police here in Prague, and also applied for a temporary residence permit for my partner (an Australian citizen). I found it difficult to get an accurate list of which documents were necessary for the application, so I wrote up my experience here in the hope that it will help other people in the same situation.

Disclaimer: this is only my personal experience. Your situation may be different!

Required documents

We entered the Czech Republic on 90 day tourist visas in January 2008. In March 2008 we went to the office of the Foreign Police in Prague and submitted our application for temporary residency. Here is a list of what I assembled:

My wife, as an Australian citizen provided:

Notes

Once we had the right forms and documents together, the actual application process was straightforward. Total time spent in the office (waiting and submitting the application) was under an hour (but make sure you pick the right ticket from the machine at the door!). Some companies here play on the fear that all expats have regarding Czech bureaucracy, and I’ve heard of people paying hundreds of dollars to have an agency submit the paperwork for you. If you are an EU citizen or the family member of an EU citizen then these agencies are not necessary.

Useful links

Information about Residency for Citizens of the European Union and Their Family Members in the Czech Republic.

Advice for living in the Czech Republic.

Application forms. Scroll down to Cizinci (foreigners). An EU citizen applying for temporary residence of his/her family needs two forms:

Addendum 1

Be warned that picking up your residence permit can take a long time. We picked up ours and the process took a bit over 5 (five) hours. Around 4 hours was spent in a queue, simply waiting, and the last hour or so was spent waiting for the actual permit to be printed. Bizarrely they don’t actually print your residence permit until you turn up to collect it. This wastes everyone’s time.

The Foreign Police here in Prague could solve the problem of huge waiting times using some fairly basic techniques (book appointments for people, accept online applications, use temp staff to deal with busier periods, provide basic and correct information in English). In the mean time, take a good book.

Addendum 2

I accidentally deleted a reader’s question on how long it took for the Foreign Police to prepare our permits. The answer: the Foreign Police never sent anything saying that our permits were ready to be picked up, we were just told to come back two weeks after making the initial application.

Addendum 3

I’ve recently heard that people have had to wait anything up to 3 months to pick up their residence permits, so take my advice here with a grain of salt.



Cython vs C++

March 4, 2008 | Filed Under sage | 6 Comments 

Edit (2008-11-09): Robert Bradshaw posted a patch to my code and the Cython implementation is now a lot faster. Click here to read more.

In a comment on a recent post, Robert Šámal asked how Cython compares to C++. The graph below shows a comparison of a greedy critical set solver written in Cython and C++ (both use a brute force, naive, non-randomised implementation of a depth first search):



So things look good until n = 10. In defence of Cython, I must point out that my implementation was a first attempt and I am by no means an expert on writing good Cython code. Also, the Cython code is probably fast enough – in my experience, solving problems (computationally) for latin squares of order 10 is futile, so the code is more convenient for testing out small ideas.

edit: the code is here



An exact cover solver for Sage

March 1, 2008 | Filed Under sage | Leave a Comment 

For a while now I’ve been using my own C++ implementation of Knuth’s Dancing Links algorithm. The algorithm is quite fast for solving the 0-1 matrix exact cover problem. More importantly, a number of other combinatorial problems can be converted into an exact cover framework, such as finding latin square completions, enumerating latin bitrades, and computing the chromatic number and chromatic polynomial of graphs (those last two are from comments by Tom Boothby on the sage-devel mailing list).

The thread started by Tom inspired me to make my code public, license it with GPL, write a few doctests, and learn the necessary Cython to write a wrapper for my C++ code so that it would be usable from Sage. The code is available here, in particular dancing_links.sage (top level Sage wrapper), dancing_links.spyx (Cython code that calls my C++ code), and finally dancing_links.cpp (the actual solver).

Not surprisingly, the C++ version is a fair bit faster than the Python implementation adapted by Tom when used as a latin square solver for finding “greedy” critical sets:



x-axis: n, y-axis: number of seconds to compute the greedy critical set of B_n (addition table for Z_n), blue is Python, red is C++.