I start hating Netbeans: It constantly seems to get in my way.
For example, I want to debug the webapp. That causes netbeans to run all tests (via MVN). Those tests fail and that’s known, I just f*cking want to debug the app. Have not found a switch to convince Netbeans to set -DskipTests=true for debug mode.
Or: Why doesn’t netbeans automagically show the file I’m editing in the projects tab? I get sick pressing “ctrl-shift-1″ to do that.
Or: I have tons of open files all the time, why would you want to hide them randomly from the tabs and let me search them in the drop-down to the right? Eclipse and IntelliJ handle that one a lot better.
Netbeans: GO AWAY!
(and no I can’t switch or I lose project support which I don’t want to, no time for that)
April 19, 2012
Netbeans: Go away!
March 8, 2012
ReviewBoard integration for IntelliJ 11
I really like Review Board, a pre-commit review tool which helps keep coding quality high especially in distributed teams.
So far I used the command line tool “post-review”, which works perfectly in conjunction with Perforce. With Subversion or if you are using Windows, using post-review can really become a pain.
Fortunately, for IntelliJ, someone wrote a plugin which allows you to comfortably post reviews from within the IDE:
https://code.google.com/p/reviewboard-plugin-for-idea/
This plugin is not well known, and until today, it was only compatible with IntelliJ up to version 10.x. But now, thanks to main contributor Kane, you can also download the plugin for IntelliJ 11.
https://code.google.com/p/reviewboard-plugin-for-idea/downloads/list
Thanks a lot, Kane!
Cheers
Chris
September 22, 2011
Moving menu bar from one screen to the other in Mac OS X
It’s embarrassing, but it took me almost 2 years to find a way to move Mac OS X’ menu bar from one screen to my second screen:
Simply go to
System Preferences > Displays > Arrangement
then in the displays, you see a little bar on top of the main display. Simply drag it from the main display to the display you want it to be and let go.
Done!
The most embarrassing of all: It’s written on top of this settings page. And I never read the instructions. Bummer!
March 18, 2011
Setting static properties with Spring
Sometimes I need to set a static property with Spring, and each time the Google result seems a bit hard to comb through.
Partly probably because Spring guys think static property injection is evil, but sometimes it just makes sense!
So for my benefit (and yours too) here is a link to a pretty nice tutorial about this subject:
http://planproof-fool.blogspot.com/2010/03/spring-setting-static-fields.html
And if you don’t like the non-static setter to a static property (like me), here is the code to directly inject a static property for your applicationContext.xml:
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="staticMethod" value="de.inweb.blog.BadDesign.setTheProperty"/>
<property name="arguments">
<list>
<ref bean="theProperty"/>
</list>
</property>
</bean>
March 9, 2011
Ditching Cars for Bullet Trains – German press about the US transportation system
President Barack Obama wants to upgrade America’s transport system using high-speed trains, bringing a taste of what is a part of everyday life in Europe and Asia to the United States. But the car-obsessed nation is divided over the plans. Is the mammoth project doomed to failure?
Read about how renowned German magazine “Der Spiegel” thinks about this topic:
http://www.spiegel.de/international/world/0,1518,749631,00.html
February 3, 2011
Maven Quick Reference Card – a life saver!
Not much to say – how come that after years of using Maven and after endless searching for maven related stuff I find a quick reference card which pretty much contains most solutions already:
http://maven.apache.org/guides/MavenQuickReferenceCard.pdf
Cheers!
January 5, 2011
Why Google Is Awesome
Now you think I’m going to give tons of reasons why I think Google is great / awesome / cool.
But I’m going to give you only two! The first is Google Voice Search, where they manage to search Google & Google Maps with an Android cell phone:
And the second is a demo of Google Docs by Tu+, Namroc and Metcalf Anything:
It’s beautiful to still have some innovative companies and people around.
December 4, 2010
Unlikely allies: USA, Iran, France and Australia
This is really astonishing:
What do you think unites the countries USA, Iran, France and Australia?
It’s the urge to criticize and fight WikiLeaks!
Let me congratulate those four countries for their newly found alliance in the fight against freedom of speech!
The full quote of Wikipedia, marking the most ridiculous claims bold:
Most of the governments and organizations whose files have been leaked by WikiLeaks have been critical of the organization.
United States Following the November 2010 release of United States diplomatic cables, U.S. Secretary of State Hillary Clinton denounced the group saying, “this disclosure is not just an attack on America’s foreign policy interests, it is an attack on the international community.”[138] Peter King, chairman of the Homeland Security Committee of the United States House of Representatives has stated his support for listing Wikileaks as a “foreign terrorist organization” explaining that “WikiLeaks presents a clear and present danger to the national security of the United States.”[139] In a contrary statement, secretary of Defense Robert Gates has said that concerns about the disclosures were “over-wrought” in terms of their likely adverse impact on ordinary diplomatic activities.[140] Philip J. Crowley, United States Assistant Secretary of State for Public Affairs, has stated in December 2010 that the US State Department does not regard WikiLeaks as a legitimate media organization.[141]
Iran The President of Iran, Mahmoud Ahmadinejad, joined in criticism of WikiLeaks following the November 2010 release of United States diplomatic cables. Ahmadinejad claimed that the release of cables purporting to show concern with Iran by Arab states was a planned leak by the United States to discredit his government, though he did not indicate whether he believed WikiLeaks was in collusion with the United States or was simply an unwitting facilitator.[142]
France France’s Industry Minister Eric Besson said in a letter to the CGIET technology agency, WikiLeaks “violates
the secret of diplomatic relations and puts people protected by diplomatic secret in danger.” Therefore it would be ‘unacceptable’ that the site was hosted on servers based in France. The minister asked for measures to bar WikiLeaks from France.[143]
Australia On 2 December 2010 Prime Minister Julia Gillard made a statement that she ‘absolutely condemns’ Wikileaks’ actions and that the release of information on the site was ‘grossly irresponsible’ and ‘illegal.’[144] (Wikileaks founder Julian Assange is Australian and he responded two days later by accusing his prime minister of betraying him as an Australian citizen.)[145]
October 22, 2010
Timothy Geithner asks export countries like Germany to consume from the US – but what??
In an article of the guardian, US treasury secretary Timothy Geithner asks countries with an export surplus, like my home country Germany, to consume products from the US to balance demand. A second request to China to stop keeping its currency unnaturally low does not apply to Germany (we are slaves of the Euro Zone ourselves).
(I know, this statement simplifies greatly)
My problem is: What does he want me to consume from the US? Just recently I asked the US electronics company Vizio to sell me one of their big screen TVs in Germany. This was their answer:
“I apologize but at this time we have not expanded to Germany.”
OK, then it’s going to be a Samsung TV for now.
Next try. I wanted to purchase frames for a lot of my pictures which have non-metric sizes because I brought them while I was in the US. But no ebay-seller would ship to Germany.
Well, I’ll ask a neighboring frame maker to produce them locally for me then.
And then, of course, there are American Cars I could buy. But really, do you think it makes sense to import a gas-guzzling Ford F150 when I can buy a nice reliable sporty BMW 118d for less (top speed 130 mph, around 50 mpg)? And, it can handle the Autobahn much better too.
So, having lived in the US and liking lots of things there I am open to purchasing more US products, but they are either not available in Germany or they are just so bad that they don’t compare to items I can buy over here.
It is kind of sad that so many US companies don’t bother expanding internationally, or don’t know how to do it.
I am really sorry, Mr. Geithner, but your request is unrealistic.
August 27, 2010
Maven filtering with deployment profiles
When you set up a maven project, especially for web application projects (producing a WAR file), you often need to configure the WAR file before it gets deployed. I use maven filtering together with maven profiles.
There are tons of ways to accomplish this, but I prefer to integrate deployment properties into the WAR itself. This way, the build process already produces a stand-alone WAR file ready to use, and you don’t need an additional step to modify the WAR content.
This is how you can accomplish this (pom.xml):
<build>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<filtering>true</filtering>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>
${basedir}/src/main/webapp/WEB-INF
</directory>
<includes>
<include>web.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>..</targetPath>
</resource>
[...]
<resources>
[...]
<filters>
<filter>src/main/filters/filter-${env}.properties</filter>
</filters>
</build>
<dependencies>
[...]
</dependencies>
<properties>
<!-- This is the default profile if no profile is selected on the command line -->
<env>dev</env>
[...]
</properties>
<profiles>
<profile>
<id>dev</id>
<properties>
<env>dev</env>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<env>prod</env>
</properties>
</profile>
<profiles>
Now, create one filter file for each profile (for the two profiles dev and prod in the example above):
src/main/filters/filter-dev.properties src/main/filters/filter-prod.properties
insert filter token as described here, and execute your maven with a profile for deployment:
mvn clean install -P prod
