Skip to main content

Posts

Internet Explorer free under Ubuntu Linux with VirtualBox

This is a title I found on a blog (http://www.railsgeek.com/). You all know this kind of crisis when delivering a web application developed on your favourite Linux with FireFox : your piece of software crashes on Internet Explorer. You also know how it's difficult to have a IE quickly running on your Ubuntu. Perhaps you tested IE4Linux but it's an old projet. Thanks to Microsoft (yes, I can say this), you have a solution from now.

1) Go to the Microsoft download website : http://www.microsoft.com/downloads
2) Enter 'vpc images' in the search text field
3) You will have an answer titled :

IE App Compat VHD
VPC Hard Disk Images for testing websites with different Internet Explorer versions on Windows XP and Windows Vista

4) Click on the link and download an image (I took IE7-XPSP3.exe)
5) Rename it with the rar extension (ie IE7-XPSP3.rar) and unrar it
6) Install VirtualBox with Synaptic. This excellent software is able to read Microsoft Virtual PC image disk (VHD)
7) The first …

Zenika Wicket Contest / Concours Wicket Zenika

It's exceptional but I wrote this post in french. It's about a contest which proposed to developed a tiny Apache Wicket project with another framework. I tried to implement it with SmartGWT.

Bon et bien voilà : je livre mon appli ZenContact migrée en GWT. Je vous préviens, je ne vais pas trop mâcher mes mots. L'objectif du concours est assez clair : refaire une petite appli de gestion de contacts réalisée à l'occasion d'une présentation Wicket au Paris JUG; le tout avec un petit défi en plus car cette présentation menée par Zenika n'a duré qu'une heure.

Bref, devant l'enthousiasme général, j'ai entrepris de la refaire en GWT. Et comme il fallait aller vite, j'ai choisi de m'appuyer sur des outils et API pour avoir le moins à coder possible. Je fixe rapidement la stack de travail : Eclipse 3.4, Maven 2, SmartGWT. Bon, c'est parti! New maven project -> template gwt. Je teste l'application générée par le plugin Maven. Jusque là tout es…

Why can I access to port 8080 only from localhost on Ubuntu?

To achieve the previous post, I had some problems today to access to my tomcat server from another machine. Ping OK but telnet 8080 KO... Humm, this smells firewall rules. Bingo! I didn't considered iptables as a firewall but it's one!

So, if you are in a secure network area, you can disable it temporarily with the following command :
sudo iptables -FYou can go further by reading this how-to page : https://help.ubuntu.com/community/IptablesHowTo

TCP Port 80 blocked on Ubuntu

While working on project, I had to bind my Tomcat to port 80 (instead of deploying an Apache and configuring its mod_jk). But, as you should know, Unix systems contains default security rules. Ports below 1024 are only allowed to the root user. Humm... it was time to work with iptables!

The following commands would show you how to add a rule to redirect request on port 80 to port 8080 and how to remove this rule.

Adding a rule :

sudo iptables -t nat -I OUTPUT --src 0/0 --dst [YOUR_IP_HERE] -p tcp --dport 80 -j REDIRECT --to-ports 8080

Saving it :

sudo iptables-save

Listing rules :

sudo iptables -t nat --line-numbers -n -L

This will show rules ordered by REDIRECT, PREROUTING, POSTROUTING and
OUTPUT. Each line start wil a number.

Deleting a rule :

sudo iptables -t nat -D [REDIRECT, PREROUTING, POSTROUTING or OUTPUT] number

Ex : sudo iptables -t nat -D OUTPUT 1

Why is agile software development like teenage sex?

Today, Romain Gauthier (OCTO Technology, for the moment) sent me a funny post on Agile development. I really like Agile methods but it's so funny that I had to paste it here :

Why is agile software development like teenage sex?
It's on everyone's mind all the time.Everyone is talking about it all the time.Everyone thinks everyone else is doing it.Almost no one is really doing it.The few who are doing it are:
doing it poorlyhopeful it will be better next timenot practicing it safelyUnfortunately, it sticks to reality... Bahhh, Romain, I hate you. You tried to shake me but I will continue to promote SCRUM.

Source : http://dnicolet1.tripod.com/agile/index.blog?entry_id=1877790

How your XML parser can detect encoding?

I've just fined a tiny article which describe how XML parsers detect document encoding. I hope you already know this but it always good to read it again. In a few words, parsers use the first document characters which are the same in all xml document and try different ways to read them and evaluate encoding.
http://www.xfront.com/specifying-encoding/index.html


Maven best practices

Today, my friend Marco sent me a great blog entry on Maven best practices. In a few words, it says :

Automate Snapshot Deployment by integrating your project in a CI system (like Hudson)Isolate Local Repositories using use -Dmaven.repo.local=xxxx option to define the unique local repositories for each build.Regularly Purge Local Repositories (mvn dependency:purge-local-repository)Enable Batch Mode with the -B option to reduce log sizeEnable Full Stack Traces (-e) when there's a build errorPrint Test Failures to Standard Output (in your settings.xml : true)Always check for Snapshots (-U option); useful when your project is split in modules and libraries. This ensures you always have the last dependency library release on your project.

Click here to see the full post : http://blogs.sonatype.com/people/2009/01/maven-continuous-integration-best-practices/

Thanks Marco!

Making Eclipse look better on Ubuntu

I started today to find the simplest way to make my Eclipse look better on Ubuntu. I've got a laptop (so, I'm used to work with an LCD screen). Here is my solution :

Step 1 : install the ttf-liberation package
Step 2 : open your system->preferences->apparence menu. Go to the font tab and change fonts like that :

Application/Document/Desktop font: Liberation Sans, size 9
Window title font: Liberation Sans Bold, size 10
Fixed with font: Liberation Mono, 10

Select the LCD screen optimization features (including in the User Details options).

That's all!

Let's talk about design patterns

Do you know the difference between Adapter and Decorator patterns?

These two patterns are made to wrap objects. Humm... Same goals? Not exactly. On the first hand, the Adapter pattern is used to transform your class interface contract to another one. In the real world, you use it to "adapt" your code to an external piece of code you need.

In the other hand, with the decorator pattern, your class keeps its interface contract. You just wrap your code to bring some new features. For example, you decorate a class to integrate a counter on method calls and perform a performance test.

IntelliJ shortcuts vs Eclipse shortcuts

Recently, I started to work with IntelliJ. But, honestly, after several years with Eclipse, it's hard to be effective because of key shortcuts which are different between the two IDEs. A little request on Google and I found this (great!) :

DescriptionEclipse shortcutIntelliJ ShortcutNavigate a Java TypeCTRL + ALT + TCTRL + NNavigate a ResourceCTRL + ALT + RCTRL + SHIFT +NLast Modified SourceALT + Left arrowCTRL + ALT + left arrowDebugF11Shift + F9Open DeclarationF3CTRL + SHIFT + BOpen HierarchyF4CTRL + HOrganize ImportsCRTL + SHIFT + OCTRL + ALT + OFindCTRL + FCTRL + FFind Again/ previousF3 / SHIFT + F3F3 / SHIFT + F3Step IntoF5F7Step OverF6F8Step OutF7Shift + F8ResumeF8F9To find impl of an abstract Method?Ctrl + Alt + BTo find usageCTRL + SHIFT + GAlt + F7

Let's SCRUM

Yes, it's time to start a new project. A classic fact is that user specifications are not yet completely defined. Humm, but I need to start the project. The only solution will be to be agile. So, let's SCRUM. It's the first time for me. I read some docs from the past but I never really tried it. Thus, I spent this evening reading charts, blogs, etc... I also found a good french video preformed by a SCRUM senior (having 4,000 hours flying on agile projects) :


Planification et gestion de projet informatique : SCRUM
par intellicore

Google App Engine will support Java

Excellent news! There was an empty place on the web : it was barely impossible to find free hosting for java applications. The main reason is certainly due to the runtime heavyweight. For example, a java apps consume a lot of cpu and i/o charges on JVM startup. Another reason is the total cost ownership of java servers. Let me try a little comparison : if a PHP engine is like a old car (not really powerful but strong for many usages and maintenance free), a Java engine is like a Ferrari : really performant but really horrible to manage, to tune, to maintain, etc... Now imagine that you're at the head of a low cost rental company. What should you prefer : offering PHP cheap engine or Ferrari ones? You see what I mean... But, in the other hand, what's a frustration for millions of java developers like me! I was forced to program in PHP for my webapps. (and I'm really not a PHP killer). Hopefully, graceful to Google, you will be able to have online apps using Google App En…

Database design

Database design is often made by programmers. This is common mistake . Only a few developers know internal db structure and mechanisms. Let's doing a tiny test :
1) Describe me what's an hash table?
2) Give two link of indexes and when it should be used?
3) What about isolation transaction levels?
OK, OK, I stop here.

Although db design should be done by specialists, it's never to late to improve our knowledges. Thanks to my friend Marco, I put here a link to a website which published db models. From know, before designing your model, don't forget to check if a similar one already exists.

http://www.databaseanswers.org/