Friday, November 21, 2014

I now have German citizenship!

This May I finally completed something I've been on for last 2.5 years - I'm finally holding a burgundy-red German passport with my name and picture in it!

Left: Temporary passport which I got the same day as the certificate of naturalization
Right: Germany allows having several passports to circumvent certain travel restrictions
I learned that I could be qualified for naturalization in Germany from my alma mater's alumni magazine where one of our alumni said that the years you spend in Germany as a student (on a student residence permit) fully count towards citizenship. I was so surprised, since before I only knew about US immigration where the time you spend on student visa doesn't count towards anything. Also, naturalization and residence permits in Germany are done by completely different entities, and therefore it's a different set of laws!

I then had to complete German language requirements (level B2 for me, since I wanted to qualify for a fast-track naturalization through special integration), and also pass the citizenship test. The citizenship test was honestly a joke - I expected to learn much more about German history and culture, but I passed it with full points even without speaking good German.

Ideally I wanted to keep my Azerbaijani citizenship because, well, why should something I have be taken away from me? It may also take around a year to renounce it, and since I wanted to move to US, my goal was to get German passport as soon as possible. Besides, dealing with Azerbaijani authorities wasn't exactly something I was very excited about, and I also wasn't excited about having to get a tourist visa every time I visit Azerbaijan (visa-on-arrival in Azerbaijan was canceled in 2010).

Things however aren't ideal. All my attempts to convince German authorities to let me have dual citizenship miserably failed (thank you Roland Koch), and I had to renounce my Azerbaijani nationality. Having had some other issues, I ended up being stateless for half a year. This was one of the most miserable things I had to live through, and I'm very happy it's over. 

Overall, I understood that I had to be pushy and it was solely my job to ensure that the process was moving forward. Cases sometimes get lost or forgotten, and just being in waiting rooms I've witnessed many cases where authorities did not respond for as long as a year. Also the letter confirming that I don't have the Azerbaijani citizenship anymore was lost in the mail, and I wouldn't find out about it if I didn't have a habit of calling the embassy every now and then to inquire about my case. 

Benefits I have? Well, now I can live and work in any EU country, and I have much less travel restrictions compared to Azerbaijani passport. I can travel to 174 countries visa-free, and as someone who loves traveling this gives me a travel-gasm. I got a 5-year F1 visa for US, instead of 1-year one given to Azerbaijanis. I also got lucky that starting starting 1st September 2014 there's a visa facilitation agreement between Azerbaijan and EU, so having close relatives in Azerbaijan, I get free one-year visas.

Whether it was worth all the trouble, especially considering that I live in US now? I don't know. But I'm proud that I did not give up and got through this. 

Wednesday, October 17, 2012

Pre-Exam Warm Up

It's been a while since I have blogged! A lot has happened to me in last year. I was admitted into Goethe Universitaet Frankfurt to Master's program in Wirtschaftsinformatik (Business informatics), with extreme luck I'd say, since they did not see that I don't have required DSH. Then I had to learn German, and eventually got DSH 3. And I also went and still going through legal troubles to get German passport.

Last semester went pretty tough for me. Not that I managed to switch from full-time job to part-time job only in the middle of the semester, due to possibility of losing work permit and consequently ability to apply for German passport, but I also had to pass all the preparatory economics courses during that semester (because of a mistake of my academic adviser, not telling me that I have to be done with them in first 2 semesters). Oh, and all of that was in German, which I still had troubles with.

But it all went pretty well. In the beginning of June I finally got permanent residence, which enabled me to switch to part-time job, and then after a short vacation I was day and night in the library, when not at work or in the lectures. I knew I had to work hard: first, I had to catch up with the material, second, I had to spend more time on material, because it was in German, and third, I had to pass all the exams not to be kicked out. And since usually in German universities the grade for the course comes from a single final exam at the end of the semester, I also needed concentration during finals' period. So I came up with something I call the pre-exam warm-up technique.

Most of exams in Uni Frankfurt last 1.5 hours, which is pretty short, so you don't want to loose any time. What I noticed before from exams, is that when you go in, it may take up to 10 minutes until your brain becomes fully focused on material. It's like the warm-up phase that athletes need to catch their "second wind". In 1.5 hour exam that is a lot of time, it's most likely the time you don't want to loose. So I did what I learned in Thai Boxing, that when you have a fight, you warm-up BEFORE entering the ring, so that in the ring your body is already warm and on its top performance. I warmed up my brain BEFORE entering the exam, so that I start the exam with my brain fully concentrated on the subject. I usually did this by coming around half an hour earlier to university, and repeating exam material, either by last-minute memorization, or just solving/skimming over practice problems. If the exam is early in the morning, I have to mention the importance of right sleeping: it's best if the night before the exam you sleep and then wake up 1-2 hours earlier than usual. The only break that you get is when you have to remove your books/materials right before the exam, but that is negligible, your brain is already awake enough to be on its top performance, but still has energy for 1.5 hours of exam.

This especially helped me a lot with one exam, where there are a lot of question, and there is barely time to finish them all. I finished it in the last minute right before I had to give it in, and consequently not only passed, but also got a pretty good grade from it. Overall, I passed all the exams in last semester, even thought not all of them with good grades, but I still feel good about it :) A month after the finals were over, I had to take DSH exam, which I also passed, so now I can continue my master's studies without any hindrance.

A new semester started now, and I am really looking forward it, I have a lot of interesting courses this semester. Good luck to all fellow students! :)

Wednesday, July 18, 2012

Transferring Glassfish 2.1 Server

I needed to set-up a new Glassfish server, but because it was heavily customized and configured because of the project I am working on, it was better to transfer it - that is to pack it in old location, and unpack in new one. After a bit of tweaking, I made it run, however it would not start due to following error:

[#|2012-07-18T17:19:52.818+0200|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=e0307780-d207-48c1-81ba-0be61d2f1037;|java.lang.RuntimeException: EMBEDDED Broker start failure:code = 1

This happened because the Glassfish on the other computer was packed while running, thus some lock file was there. ( Lesson for the future: shut down the server before transferring)

So what you have to do is remove the following file {domain_folder}\imq\instances\imqbroker\lock, and the server will work just fine.

Source: http://old.nabble.com/Glassfish-V2-failed-to-start,-broker%3Dembedded,-failure:code-%3D-1-td17728741.html

Friday, May 4, 2012

Recursively deleting .svn folders.

In Windows, create a clearSvn.cmd file and put following contents in it:


for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *svn') do (
    rd /s /q "%%i"
)

Running it should do the job. Alternatively .cvs or any other recursively occurring folders can be deleted by this script.

For MacOS, Linux and other Unix-compatible systems, the command would be even simpler:
rm -rf `find . -type d -name .svn`


However when you check out the project for the first time and want to later delete svn dependencies, it is better to use svn export.

Thursday, April 19, 2012

Removing Glassfish 3 Windows Service

I've recently tried removing the Glassfish 3.1 server that I had installed long ago, and came into the problem that even after uninstalling the Glassfish from the system, there was still a windows service that was starting the server on startup. So I needed to get rid of the windows service. Its a pretty straightforward task, achieved simply by the command

sc delete <service_name>

run in the command prompt with administrator right (right-click -> "Run as Administrator"). However its pretty much irreversible, which means you have to be sure that you will not want it anytime soon. I am managing my application server runtimes through eclipse anyway, so its not the desired way of things for me.

The Glassfish server is usually stored under the name glassfish, so executing sc delete glassfish should do the task. However to be sure, you can open the list of services, and find the Glassfish service, and copy the value from "Service Name" (do not confuse with "Display Name").

Thursday, January 19, 2012

Think Business

Its not a new discovery that priorities in commercial and scientific/academic software development are different.   For example, if you need to delete an arbitrary record, but keep its data in the database, you just add "delete" attribute to the record, and set it to true when the record has been deleted. Straightforward, right?

Not really - believe it or not, most likely a deleted or cancelled record will want to have at least a "comment" and a "timestamp" section. Maybe also the username of the one, who deleted/cancelled the record. It may not be in the specification, so many programmers are likely to apply YAGNI principle, however sooner or later the change request is likely to come in any more or less serious project, especially if it is an agile project, with no hard-written specification. The last time I had such an issue, we decided to go with "deleted flag" option, and the change request came in 2 weeks.

So this was my small experience to "incorporate changes". I guess that is where the "industrial experience" is about: being able to correctly predict the changes, and thinking about business value of a feature from the user perspective. 

Tuesday, December 13, 2011

Calling a JMX Bean method in JBoss with an example of clearing JMS Queue

I needed to empty one JMS (Java Message Service) queue in JBoss 4.2.2, but I found out that JMS does not have a standard way to delete messages and empty the queue, and emptying a queue is provider-dependent operation. So I figured out that in JBoss 4.2.2 I will need to call removeAllMessages() method from Management Bean (MBean) that is associated with the queue that we want to empty. So here are the steps: