08 February, 2009

Top 10 Albums 2008

2008, the year of Chinese Democracy is over. Unfortunately, neither the one nor the other worked out. I don't even want to append as expected because I can hardly imagine anybody was actually expecting anything. And all the hope for 2008 was already used up.

Anyways, in 2008 I bought again around 40 CDs, most of them within the last days of my trip to Philadelphia because CDs are so much cheaper in the US than in Germany - and that's not only due to the Euro exchange rate. So I only influenced the US Amazon 2008 charts, but not the German one. Maybe that's why not even one of my personal Top 10 made it into the latter :-)

And what does it tell you about the year 2008 in music (or the people buying music) if the first 3 places are taken by albums from 2006 and 2007? I found some great CDs though and here it is, my personal Top 10:

  1. The Walkmen - You & Me

  2. Gus Black - Today Is Not The Day...

  3. Rainald Grebe - 1968

  4. MGMT - Oracular Spectacular

  5. Kings Of Leon - Only By The Night

  6. Fleet Foxes - Fleet Foxes

  7. Sun Kil Moon - April

  8. Vampire Weekend - Vampire Weekend

  9. The Mountain Goats - Heretic Pride

  10. Randy Newman - Harps And Angels


Most surprisingly there is a German album on the list. I can't remember when the last one was even close to that. But '1968' by Rainald Grebe is so amazingly sarcastic - I'm still laughing whenever I listen to it. As a sample his performance in German satirical TV show Neues aus der Anstalt: Der Präsident.

Most of the other 12 songs are even better, but this one fits Germany's Presidential elections this year. Since the president doesn't have actual power in Germany (that's also what the song is about) the parliamentary elections at the end of September are more interesting. Though German democracy isn't actually endangered let's see what uses up our hopes this year :-)

02 February, 2009

The Good, the Bad and the Ugly

Reading an article about Angela Merkel reminded me of finishing my classification of politicians which I have in my drawer since quite some time: The Good, the Bad and the Ugly. Don't ask me why but somehow this movie title came to my mind. More serious it's the programmatic, the ideologist and the opportunist. Of course this classification isn't scientific at all, I just made it up during last year's US election campaign.

Let's start with the ideologist, the obvious example is George W. Bush. His 2 terms can be characterized by the ideology of the everlasting fight of Good vs. Evil. Unfortunately, for pursuing his goal of spreading democracy especially in the Middle East to "build a safer world" he regarded every means as justified - including those I consider to be preserved for the Evil:
Those methods, including the use of stress positions and forced nudity, continued to spread through the military detention system, and their use “damaged our ability to collect accurate intelligence that could save lives, strengthened the hand of our enemies, and compromised our moral authority.”

Not talking about all the problems that got out of focus, ignored and grew into crises on their own. Even looking back Bush shows hardly any sign of regret (and even less does Vice President Dick Cheney). I consider that very typical for people blinded by ideology.

The second characterization is opportunist. There is no ideology he blindly sticks to, but the lack of leadership and predictability is also the problem in these times of crisis - just as with German Chancellor Angela Merkel:
She put together a rescue package for banks that so far hasn't had much effect. She has come up with an economic stimulus package that may not be enough. She hasn't made a single major speech. There is no sign of a claim to leadership, whether in Germany, Europe or the world.

Former Vice Chancellor and Foreign Minister Joschka Fischer of the Green Party describes her style in an interview as follows:
Until now, if opinion polls are anything to judge by, this approach has served her well. She always takes positions that allow her to maintain a majority. However, in this global crisis, that is simply the wrong attitude. What is needed now is strategic, large-scale planning -- in the European spirit.

A more recent article is even more excoriating:
A major crisis actually presents an opportunity for a chancellor. Everyone is at a loss, everyone is plagued by uncertainty, and virtually everyone is waiting for someone to take charge. And what has Merkel done? She has joined those who are waiting. She has become the leader of the waiting game. [..] What counts for her is that she has a result. It doesn't matter what it is. It is typical of a chancellorship that searches for harmony but lacks leadership.

Of course her behavior could be interpreted simply as cautious - if she just wouldn't change her opinion too often. Not long ago environment was an important topic for the former Minister of Environment:
Chancellor Angela Merkel has gone out of her way to show herself as a climate saviour. In August 2007, she had herself photographed on a block of ice in Greenland in order to draw attention to the consequences of climate change. Just a short time before she helped to negotiate a global climate "roadmap" at the G-8 summit in Germany.

Now that's no longer valid since it might cost jobs? This argument sounds very familiar, just like the failed strategy of the US economy, in particular car industry. If only many experts would not see green technologies as a chance to create thousands of jobs. In my opinion she endangers Germany's leading position in environmental technologies and so jobs in the long run.

Or the economic crisis:
The chancellor seemed unsure of herself when it came to preventing the impending collapse of the banking system. [..] First she touted an international solution before eventually bowing to pressure from German banks and agreeing to a coordinated European approach. [..] Merkel also flip flopped when it came to the political consequences of the economic downturn. At first, her office announced that she and Steinbrück had agreed to bring forward a plan to make health insurance premiums tax-deductible. But then she dropped the plan when it came in for sharp criticism.

Sure, she is still by far preferable to French Omni-President Nicolas Sarkozy with his aimless actions for the sake of acting. But I'd like to know what she is actually up to.

Somewhere in the middle is the programmatic, with a general plan laying out the base for the politics, an idea, but not blindly sticking to it like an ideology. The means are chosen as the cases arise but according to the greater plan. For being successful this needs good judgment and a strong team of experts - and a strong leader for this team.

My hope is that the new US President Barack Obama will fulfill this role. So far he has laid out the general guideline in his speeches: being a president for all US Americans, no matter what descent, what religion, what region or walk of life. The speech in Berlin showed that he doesn't intend to limit the guideline to the US, but also apply them internationally.

He has also chosen his team of experts for which he received praise from left and right (actually more from right since the lefts are kind of disappointed he didn't choose more radical candidates). He now has to prove his judgment and his leadership of this alleged team of rivals.

As little scientific my classification is as blurred are the borders between the groups. Bush was forced by the "circumstances" aka economic crisis to give up the neoconservative ideology and rather spend a whole lot of money to bail out banks - which just underlines his failure even more. A weak leader will switch from his program to opinion polls as guideline of his politics just when leadership and guidance is needed the most. (That is what I think actually happened with Angela Merkel.)

The last 2 months were a lame duck season not only in the US but also in Germany if not Europe. Everybody seemed to wait for the inauguration of Barack Obama. Now Obama made an impressive start. Let's see how it is going to work out.

Update: There is a new article on Angela Merkel's failure:
[..] A chancellor without a compass, a head of government without authority and a party leader who lacks the support of her own people.

10 November, 2008

The Speeches to the White House

Last Tuesday, on November 4, 2008 Barack Hussein Obama was elected the 44th President of the United States. His way to the White House has been marked by great speeches. I want to start with the keynote address at the Democratic Convention on July 27, 2004 in Boston. It was the first time he and his central message became known to a broader audience beyond the borders of Illinois (not to me though):
There is not a liberal America and a conservative America — there is the United States of America. There is not a black America and a white America and Latino America and Asian America — there's the United States of America.

At the end of 2004 Obama didn't feel ready for running for president in 2008. Within the next 2 years he had changed his mind no longer ruling out to run:
When the election is over and my book tour is done, I will think about how I can be most useful to the country and how I can reconcile that with being a good dad and a good husband. I haven't completely decided or unraveled that puzzle yet.

It was the time when the media recognized his qualifications but questioned his experience to be ready in 2008. But there was no question he was going to play a bigger role in American politics in the future. At the end of October in 2006 the Time had a cover story on "why Barack Obama could be the next President". And the German author Florian Gathmann wrote recently in retrospect (German) to his 2-months scholarship in the summer of 2006 at the Chicago Tribune that there was no way around Obama:
In den folgenden zwei Monaten, die ich in Chicago bei der "Tribune" verbringe, ist an Barack Obama kein Vorbeikommen mehr.

His article "Der Gesegnete" (German, "The Blessed") was released on October 27, 2006 in German newspaper Thüringer Allgemeine, refering to Obama's first name Barack meaning "blessed" in Swahili. On February 10, 2007 Obama finally announced his candidacy giving the guideline for his politics:
That is our purpose here today. That is why I'm in this race. Not just to hold an office, but to gather with you to transform a nation. I want to win that next battle — for justice and opportunity. I want to win that next battle — for better schools, and better jobs, and better health care for all. I want us to take up the unfinished business of perfecting our union, and building a better America.

It's this style of patriotism - loving the country, but looking for ways to perfect it, not ideologically! - that's so atypical for a politician and that impresses me the most.

But on July 7, 2007, when I flew to the US to work for one year in Philadelphia, I still had not heard of Obama at all. It must have been at some point within the next 3 months that I got to know him since I remember being all for Obama already at the Democratic debate at Drexel University in Philadelphia on October 30, 2007.

Eventually, on January 3, 2008 the primary season started - when Senator Hillary Rodham Clinton was still expected to wrap up the nomination of the Democratic party on Super Tuesday (February 5, 2008). But she had a false start with losing Iowa to Obama - and no plan for beyond Super Tuesday.

Obama had it's own struggles with the unwelcome race issue bubbling up incarnated by Reverend Jeremiah Wright, Obama's pastor for 20 years. He could rebut the cliche of the "angry black man" by giving a speech on race in Philadelphia on March 18, 2008. He analyzed that "black anger" and "white resentments" result from historical discrimination and social injustice (and the perception of it) nowadays - and that they have to be taken seriously. But it takes more than talking about the symptoms to fix one single cause. The idea must be to overcome race:
It requires all Americans to realize that your dreams do not have to come at the expense of my dreams; that investing in the health, welfare and education of black and brown and white children will ultimately help all of America prosper. [..]

This time we want to talk about the crumbling schools that are stealing the future of black children and white children and Asian children and Hispanic children and Native American children. This time we want to reject the cynicism that tells us that these kids can't learn; that those kids who don't look like us are somebody else's problem. [..]

This time we want to talk about how the lines in the emergency room are filled with whites and blacks and Hispanics who do not have health care. [..]

This time we want to talk about the shuttered mills that once provided a decent life for men and women of every race, and the homes for sale that once belonged to Americans from every religion, every region, every walk of life. This time we want to talk about the fact that the real problem is not that someone who doesn't look like you might take your job. [..]

This time we want to talk about the men and women of every color and creed who serve together, and fight together, and bleed together under the same proud flag.

Again the central points are 1. perfecting the 2. one America.

At the end Obama secured the nomination as Democratic candidate for the presidential election with the last primaries on June 3, 2008. In the evening he gave his nomination speech in St. Paul with the main focus on reuniting the party after the tough fight with Hillary Clinton. His opponent on the Republican ticket was Senator John McCain who secured his candidacy 3 months before on March 4, 2008.

On a campaign tour around the world Obama introduced himself to international leaders in the Middle East and Europe. The highlight on this tour was for sure his speech on July 24th, 2008 in Berlin to 200,000 people around the Victory Column in Berlin - and the millions in front of the TV screens in the US. Here he put his message with profound references to history not only of Berlin into a global context:
The walls between old allies on either side of the Atlantic cannot stand. The walls between the countries with the most and those with the least cannot stand. The walls between races and tribes; natives and immigrants; Christian and Muslim and Jew cannot stand. These now are the walls we must tear down. [..]

In this century - in this city of all cities - we must reject the Cold War mind-set of the past, and resolve to work with Russia when we can, to stand up for our values when we must, and to seek a partnership that extends across this entire continent.

Unfortunately, it was only two weeks later when so many called for the next Cold War when the conflict for South Ossetia between Russia and Georgia broke out - and called Obama's inexperience to people's mind and his comfortable lead in the polls started to shrink. But while many Western politicians including McCain ("Today, we are all Georgians!") were very fast to blame the Russians while the the sequence of events wasn't actually that clear.

Another three weeks later, on August 28, 2008 Obama accepted the nomination at the Democratic Convention in Denver after choosing Joe Biden as his running mate for Vice President. With the general election entering the critical stage his speech was much more aggressive, but still he did not divide the country but only separated himself clearly from John McCain:
The times are too serious, the stakes are too high for this same partisan playbook. So let us agree that patriotism has no party. I love this country, and so do you, and so does John McCain. The men and women who serve in our battlefields may be Democrats and Republicans and Independents, but they have fought together and bled together and some died together under the same proud flag. They have not served a Red America or a Blue America - they have served the United States of America.


The next day McCain presented Governor Sarah Palin as his running mate for Vice President. In my opinion he chose her to appeal to both disappointed Democratic voters of Hillary Clinton in the primaries and to the conservative Republican base. The surprising choice seemed to work out for McCain by electrifying the Republican base. He even took the lead in CNN's national polls of polls in early and mid September.

It was not before Palin gave two disastrous interviews and especially the economic crisis became acute that Obama gained ground again. McCain was criticized for his crisis management, not having a consistent campaign. He couldn't untie himself from the Bush government, which was hold responsible for the economic crisis, despite his reputation as maverick. As last argument he tried to denounce Obama as friend of a terrorist (because of his alleged connection to Bill Ayers) and socialist (because of his tax plan) while Obama could simply keep a steady hand: In his 30-minutes infomercial six days before the election Obama presented his program without even mentioning Bush or McCain. Simply everything played into Obama's cards. On November 4, 2008, after a nearly flawless campaign of more than 20 months, Senator Barack Hussein Obama was elected the 44th President of the United States and gave his victory speech later in the evening in Chicago.

So what do I expect from the President Obama? Not less than "changing the world"! That doesn't mean he is supposed to fix all problems the US face at the moment or even the world. He will have a hard time to solve only part of them within the next 4 years: tumbling economy, 2 wars, crumbling infrastructure, cracked image in the world, inefficient social security systems and imbalances in the constitutional powers. But I expect him to introduce another tone in US politics, to reach across the aisle not only in the US but also work together with the partners in a multilateral world.

I might be naive but I'm positive this will allow Obama to address the problems. If some of them can't be solved in his first term and not even in a possible second term it still might pave the way for the future. The world isn't just black and white as it was seen in the last 8 years. Obama often showed in the debates or his speeches that he is willing to see gray shades - and hopefully this change leads the world into a bright future :)

03 June, 2008

Cause and Effect

Just 2 weeks ago I wrote about the Students for Concealed Carry on Campus arguing that allowing students to carry weapons on campuses would make them safer places. Obviously I don't agree with it, but think that's rather ridiculous. Now in the face of everyday incidents the British government started an advertising campaign supporting my point of view:
If you carry a knife, you are more likely to get stabbed yourself.
The question is if this statement can stand deeper investigation, especially in terms of cause and effect. I expect at least the statistical correlation to be verifiable. I would not be surprised though if the actual correlation is between the crime rate of the districts those people live in and the chance of getting stabbed (which is a quite logical conclusion since stabbing is a crime on its own). And those people just carry knives with them to feel safer.

The campaign wants to make 2 points directly supporting their view though: The chance your knife is being used against you: A knife that you don't carry with you can obviously not be used against you. And (not only out of this) the only imaginary safety, similar to what I asked 2 weeks ago ("How do they think this is going to work out?"):
When someone is attacked by a knife they normally find out AFTER they have been stabbed.
Whatever cause and effect are, the point is made - and I highly support it. Imagine only few people don't carry a knife anymore. The next time they argue they can't pull their knives immediately. They stay with words - or fists which are at least not as harmful as knives. Now just imagine what this means for the US and guns!

If you are not too sensitive watch the videos like the imaginary knife wounds lecture.

20 May, 2008

Some people just don't get it!

I would have thought students are just more intelligent but it seems that's not compelling reasoning. Have you heard of the SCCC, the Students for Concealed Carry on Campus? This organization is not affiliated with the NRA, but has the same ridiculous mindset: Guns for everyone will make this world a safer place. Actually I wrong them because they don't want guns for everyone but only
those individuals--age twenty-one and above, in most states--who possess valid concealed handgun licenses/concealed carry weapons permits to be afforded the same right to carry on college campuses that they are currently afforded virtually everywhere else.

But that's not the point. The question is how more guns should make this happen. I mean how do they think this is going to work out? The person running amok is presenting himself and everybody got a free shot? I would rather fear that in such a situation full of panic self-proclaimed wannabe heroes just shoot wildly around and cause even more casualties. Ever heard of friendly fire? More than one fifth of the deaths in the Operation Desert Storm has been killed by friendly fire - and we are talking about professional soldiers here, in a "controlled" operation (as far as it is possible). Not hobby shooters with people running around panicking.

Also what do you think is going to happen when everybody is allowed to carry a weapon? Isn't it likely that the potential gunman will just take more powerful weapons, e.g. full-automatic ones or grenades? Just think about it, we are talking about people that want to cause as much damage and casualties as possible. There own life usually doesn't matter to them anymore. Another example, what happens in case of somebody taking hostages? Do you want to have uncontrollable people around trying to free the hostages and endangering their lifes?

The believe in weapons is naive to say it mildly. It's just hard to scare somebody who wants to sacrifice his life. That's why George W. Bush's War on Terror had to fail and that's why the idea of the SCCC or the NRA can't work - neither on campuses nor on the streets. Maybe it's just a problem of too many guns on the streets. Maybe somebody should just start thinking about the actual problems in the (American) society. But that would require intelligent people which I would have hoped you can find easily on universities.

10 February, 2008

Sharia is for Everyone!

One of the most ridiculous proposals I read lately was the one by the Archbishop of Canterbury, Dr. Rowan Williams, who is also leader of the Anglican church. He proposed to allow certain parts of the Sharia, the central body for the Islamic law, to be used in western societies. By allowing Muslims to apply the Sharia in questions of day-to-day life like marital or financial matters he wants to raise the acceptance of Muslims for western life style.

In the first place I wonder why this is necessary at all? Yes, everybody should have the right to move to a place where he wants to live. And western societies seem to be very appealing because of their prosperity. But this prosperity results from a certain society model. So if somebody wants his part of the prosperity he has to be part of the society - including its rules and laws. It's not necessary to like everything, and there are definitely many things that can be improved in these societies. But immigrating people first have to accept the rules and laws - and not the rules and laws have to be changed for immigrating people!

Second why is the church that tolerant against the Islam? Let's have a look at other relevant groups like homosexuals. The same Dr. Rowan Williams on an openly gay bishop:
In most of our provinces the election of Canon Gene Robinson would not have been possible since his chosen lifestyle would give rise to a canonical impediment to his consecration as a bishop.

If his consecration proceeds, we recognise that we have reached a crucial and critical point in the life of the Anglican Communion and we have had to conclude that the future of the Communion itself will be put in jeopardy.
In my opinion that's hypocritical.

Another issue with this proposal is outlined by Henryk M. Broder (That's where the title of this post is from.): Can British who are not Muslims also select the rules of the Sharia - and only marry for a certain period? No longer "Until Death Do Us Part" for Christian marriage?

Broder writes often about inter-cultural matters. Lately he wrote an article entitled Suicide for Fear of Dead (German). And that's really what the actions (German) in these western societies look like:

  • In Brussels (Belgium) policemen were instructed to no longer smoke and drink in public during Ramadan - to not offend Muslims.

  • In Zürich (Switzerland) they should even refrain from drinking and eating for one day - to learn more about Islamic culture.

  • The BBC appends "Peace be upon him" whenever they name the Prophet. Broder mentions that it might be ridiculous when the BBC reports about suicide bombers in the name of Allah and the Prophet, peace be upon him.

  • Following the British interior ministry "Islamic extremism" is now "anti-Islamic activities".

  • The Bishop of Breda (Netherlands), Tiny Muskens, proposed to rename God to Allah.

  • In Canada completely veiled women are allowed to vote when they have two identity certifications and one witness of identity.


Respect for other cultures is good - but this goes way too far. Do officials in Arabic countries fast during the Lenting season? Can basic rights in voting still be assured if the person voting can not even be identified? I wonder what they are doing on the air ports - or is security more important than those fundamental rights?

Another ridiculous proposal came from the Turkish Prime Minister Recep Tayyip Erdogan: Germany should establish Turkish high schools and universities. (Turks are by far the biggest group of immigrants in Germany.) Necla Kelek calls his push for Turkish educational institutions an "intrigue against integration" (German) - and I fully agree with her. This does not help with integration but makes the separation permanent.

Yes, a lot has been done wrong in integration of immigrants in many western societies. But the examples above are misunderstood integration. Integration means helping the immigrants to adapt their way of living, to learn the language and the culture. It does not mean that the immigrants have to give up their own culture - as long as the habits comply with the rules and laws. And especially it does not mean that the affiliating society has to change for the immigrants.

Lately there was also a discussion in Germany about integration. It all got started with a brutal attack on a pensioner by a Greek and a Turkish young man in Munich. State Governor of Hesse, Roland Koch, used this as an opportunity to make an embarrassing and polemic election campaign against "criminal young foreigners". Indeed the ratio of foreigners to the whole population is disproportionate to the committed crimes in Germany. (The numbers are quite different. While they form around 10% of the German population around 20% of the suspected criminals (German) are immigrants.) But this is probably more a problem of social background than origin - foreigners are just not criminals per se. And here we are back to the questions of integration. According to the PISA study in hardly any country the social background determines the future chances as much as in Germany. By the way, not suprisingly Roland Koch got applause from the Neo-Nazis for his campaign - and luckily it backfired though his party still won the election.

So the western societies definitely have to do their homework in questions of integration - not by giving up their culture or basic rights, but by welcoming the immigrants, by helping them to get started and provide fair chances. Starting a new life in Germany does not seem to be easy. The people still have to learn a lot, even after 50 years of major integration. Eventually Germany can't without immigrants.

Update: There is now also an article about Dr. Rowan Williams available on the English Spiegel Online website, taken from Der Spiegel magazine, which provides more background information.

Update: Henryk M. Broder wrote a new article on this topic, in particular on Geert Wilders and the recently released Islam-critical video "Fitna". Due to serious threats to the LiveLeak staff the video had to be removed for some time from the web site though it's now back online. Is there any further need to comment on this?

12 January, 2008

Top 10 Albums 2007

I'm neither a journalist nor a musician. I can't really describe why I like this or that album. It has to be somehow good music. Interesting. It should be able to "entertain" me more than three times. It's unlikely that an album which is easily accessible becomes one of my favorite ones.

I'm also not limited to a particular genre or kind of music. If you really want to subsume it somehow then maybe under Alternative. But this probably does not mean much more than that hardly any of the albums I like will be in a Top 10 chart list (based on sales). Ok, this time there are actually two albums in Amazon's Top 10 (The White Stripes on 8 and The Shins on 9, next is Wilco on 25). Which makes me think the Americans have a better music taste than the Germans. I admit I even own the number 1 from the latter list, but it's not that I only like what others dislike. Herbert Groenemeyer is very famous in Germany and he has a good mixture of "difficult" songs and stadium hymns. "12" was a bit disappointing though. Back to the German charts, the next one I like is only on 22, the Red Hot Chili Peppers' "Stadium Arcadium", which is actually from 2006, and only on 29 there is finally one of my 2007 Top 10 albums, "Our Earthly Pleasures" by Maxïmo Park. Also in Germany there is hardly any store where you get more than the most recent Tool album - while in America so found I found hardly any store which does not have all of their albums.

Anyway, back to 2007, here is my Top 10:

  1. Kings of Leon - Because of the Times

  2. Wilco - Sky Blue Sky

  3. Arcade Fire - Neon Bible

  4. The Shins - Wincing The Night Away

  5. Clap Your Hands Say Yeah - Some Loud Thunder

  6. Maxïmo Park - Our Earthly Pleasures

  7. Soulsavers - It's Not How Far You Fall, It's The Way You Land

  8. Modest Mouse - We Were Dead Before The Ship Even Sank

  9. Radiohead - In Rainbows

  10. Bloc Party - A Weekend In The City


Some of the bands I really like released new albums last year, but didn't make it onto the list. Editors, Interpol and especially Spoon did not quite meet my expectations - or their former albums were just way better. I neither wanted to put a Best Of or Live album on such a list like R.E.M.'s "Live".

By the way, I bought 42 albums in 2007 (compared with 36 in 2006 and 79 (!) in 2005 - I admit that year was crazy). Many of them were older though since I often wait until I get a good bargain and I completed my collections of Wilco and Spoon. By also selling 26 albums (mostly on Amazon) I have now more than 450 albums on CD.

15 December, 2007

Spring AOP: Dynamic Proxies vs. CGLib proxies

Spring's AOP is proxy-based. Spring provides two different options to create the proxies. One is based on JDK dynamic proxies and works with interfaces, the other one utilizes CGLib and is based on classes. (That's why the property is called proxyTargetClass respectively proxy-target-class.) For the moment I just want to provide a quick summary on the pros and cons of both options:

JDK dynamic proxies:

  • The class has to implement interfaces. Otherwise you will get ClassCastExceptions saying that $Proxy0 can not be casted to the particular class.

  • Eventually dynamic proxies force you to program to interfaces since you can not cast the proxy to the class - a feature I really like about them.


CGLib proxies:

  • The proxies are created by sub-classing the actual class. This means wherever an instance of the class is used it is also possible to use the CGLib proxy.

  • The class needs to provide a default constructor, i.e. without any arguments. Otherwise you'll get an IllegalArgumentException: "Superclass has no null constructors but no arguments were given." This makes constructor injection impossible.

  • The proxying does not work with final methods since the proxy sub class can not override the class' implementation.

  • The CGLib proxy is final, so proxying a proxy does not work. You will get an IllegalArgumentException saying "Cannot subclass final class $Proxy0". But this feature is usually not needed anyway. (This issue might be solved in the future.)

  • Since two objects are created (the instance of the class and the proxy as instance of a sub class) the constructor is called twice. In general this should not matter. I consider changing the class' state based on constructor calls a code smell anyway.

  • You have CGLib as additional dependency.


Both options suffer from some issues (not really issues, but you have to be aware of them):

  • Most important proxy-based AOP only works from "outside". Internal method calls are never intercepted.

  • Second, the object has to be managed by the Spring container. Instantiating it yourself using new does not work.

  • The proxies are not Serializable.


Regarding performance of the one or the other method I have read different things. I remember having read a blog post about CGLib proxies being better, one of the comments says dynamic proxies are. Actually the Spring reference has a paragraph on this itself:
There's little performance difference between CGLIB proxying and dynamic proxies. As of Spring 1.0, dynamic proxies are slightly faster. However, this may change in the future. Performance should not be a decisive consideration in this case.

I emphasized the last sentence by intention.

Especially for enforcing programming to interfaces and allowing constructor injection I strongly prefer the JDK dynamic proxies.

04 December, 2007

Please tell Microsoft about this problem

If you are a Windows user you probably know this request quite well. No, this post is not yet another Microsoft or Windows bashing (though I switched to Mac OS X lately). It's only about an incident I had last weekend on the Times Square in New York where I really did not expect to see that message:



(I took the picture on Nov 24th 2007, around 4:30 pm.)

When I saw this on one of the big screens I really had to laugh. How embarrassing is this? For Windows and Flash (though I was surprised and impressed that these screens are running on Windows and Flash). It will be (justified) bad press for them though. Everybody sees his prejudices proved on the big screen. But it is especially embarrassing for the advertiser. How many thousands of people are walking over the Times Square on Thanksgiving's Saturday? At least it was incredibly crowded and I was probably not the only one who noticed that.

14 September, 2007

When the shit hits the fan ...

Not that long ago I received my first Mac, more exactly the top MacBook Pro with 17" high resolution wide screen. I was quite unhappy with the Mac OS X - and actually I am still not satisfied. One of the things I first complained about was the way of deleting files. It's not possible to do this directly, but it always has to happen via the trash bin. Now I know why they handle it that way which did not help me though ...

Now what actually happened? On last Monday I visited the overly expensive King Tutankhamun exhibition. They have impressive stuff there, but the most famous golden mask is missing - and you are not allowed to take any pictures. But it was a nice evening and on the way home I took the one or the other picture. At home I wanted to copy them to my MacBook and here the story actually starts.

Mac OS X has some really strange features. The first one is the mentioned above: I'm not able to delete files directly. Of course I want to delete the pictures from the memory card after having them copied to the hard disk. Here we get to strange feature 2: Deleting them on the memory card does not free the memory since they are still on the card's trash bin. But you neither can selectively delete items from the trash bin - it's an all or nothing and strange feature 3. I want to keep stuff in the trash bin where it makes sense, being forced to empty the trash bin completely is rather stupid.

Now I found a workaround which seemed quite comfortable. I use CocoViewX for viewing and managing my pictures. It's not as good as IrfanView which I used to use on Windows, but much better than iPhoto. The latter is kind of unacceptable for me since it insists on managing them in its own directory structure and creates 3 copies (originals, data, modified) of all of them - I have 3.5 GB photos! Anyway, CocoViewX notices when there is a memory card with photos and offers to import them with the 3 options of keeping the photos on the card, moving them to trash or deleting them directly on the card. The last one is what I'm looking for and used. So far, so good. It creates an import folder where it puts the new pictures.

After I sorted the pictures and moved them to my folders I wanted to delete the import folder. Again CocoViewX offers the three possibilities to keep it, to move it to trash or delete it. I knew this folder is empty and I'm very, very sure that I want to delete it. But I was to lazy to switch to the mouse and wanted to switch the buttons with the keyboard. I played around with Tab and left key to which I'm used from Windows, with different combinations of the modifier keys. I only found Apple+Left changing the directory in the background but nothing moved the focussed button. Apple seems to be completely unusable without a mouse!

Anyway, in the second screen shot you see were I ended and I selected "Yeah, throw it away". And what happened? Due to the changed context in the background it threw away my complete "Bilder" (meaning pictures in English) folder! Despite the question is still for the import folder! It took some seconds until I noticed what happened.

Then I slowly started to think about what I really lost: 200 pictures of my last two months here in Philadelphia, so since I arrived in the US. Beneath them pictures of my trips to Washington D.C. and New York City. Some I sent already to friends, so I could get at least little variants of those ones, 12 to be exact.

Then I thought about what and how to rescue. Undelete for Mac OS X! Everything I found was anything but promising. I found references to tools like Stellar Phoenix, File Salvage, Data Rescue II and Virtual Lab Data Recovery, but none of them was free. But wait, there is still the memory card! I have a second notebook here running on Windows XP. I knew there are free undelete tools for Windows and with one of them, FreeUndelete 2.0 I could recover most pictures from my NYC trip.

And the rest? All 4 Mac OS X tools offered evaluation versions where you can search your disk for recoverable files, but not actually recover them. I tested all by downloading them directly to a second 1 GB memory card. Stellar Phoenix did not even found my logical drive, Virtual Lab could not (potentially) restore my pictures to the memory card if I remember correctly. Both File Salvage and Data Rescue II worked at least and I scanned my disk. They found more than 5,000 JPEGs. Wow! Paying $100 and then additionally the work of filtering files? I nearly gave up and only wanted to ask a colleague of mine the next day who has more experience with Mac OS X. Unfortunately he has never been in need for such a tool.

But in the evening I started again to search for a tool. A Unix/Linux operating system but no open source tool for undelete?! I finally found one called PhotoRec by CGSecurity. It's rather low-level, started from the shell, but provides a menu. Unfortunately, it can not just scan the free space but only the whole hard disk. It groups restored files by 500 in one directory. Since I knew I would run out of space on my 1 GB memory card I cleaned up the directories as soon as they were "finished", i.e. had 500 files in them. PhotoRec found thousands of useless operating system files, mostly very small, some bigger ones like the background images. I had no problem to keep the space usage on the card rather low. As soon as it got to my actual pictures I could not keep up, the card filled more and more. When the free space reached 10 MB I stopped the process in hope I could continue afterwards - unfortunately not. Anyway, after more than 5 hours and scanning around 55% of the sectors of my hard disk and restoring 19,000 (!) JPEGs I also had most of my pictures from Washington D.C. and Philadelphia back - and was quite happy.

I sent Christophe Grenier (that's what CGSecurity stands for) an email about my observations with the tool. He responded pretty fast. Regarding scanning the whole disk instead of only the free space he wrote
Currently this feature is only available for FAT and NTFS. I hope to provide it for Ext2/ext3, HFS/HFS+ isn't planned.

He also told me how to start from a specific sector by modifying photorec.ses. This file contains a huge list of scanned sector ranges starting from 0. All entries up to those ones that should be scanned must be dropped. This worked pretty well on evening 3. It took only another hour for scanning the rest and restoring another 1,000 JPEGs, nearly all to be deleted anyway.

Yeah, so overall I had to filter out around 120 pictures out of 20,000. First criteria was of course the size, which should have sorted out around 80% of the pictures. Since my hard disk is rather new it is also not that fragmented yet and my pictures came mostly in groups. I could easily delete the ones I had on my backup and keep the other groups. All in all it were 2.5 days because of annoying features in Mac OS X and bugs in CocoViewX - where I consider the first one worse than the latter.

It really annoys me that Mac OS X does not allow me to delete things directly especially since I can't delete stuff selectively from the trash bin. This might be good in general since it is so hard to restore deleted files. But I usually know what I'm doing and don't want to be patronized by my operating system. Since there are more issues I have with Mac OS X (about which I might blog in the near future as well) it might even happen that I switch to another one (with Linux more likely than Windows).