15 Sep 2009

Ridiculous "Enterprise Architecture"


Ain't it ridiculous ? (or may be pathetic...)

And the text in the mail is on the same level:

What is Enterprise Architecture (EA)?


Enterprise Architecture (EA) is a revolutionary concept which is being used to manage and align an organization's business processes along with Information Technology (IT) to meet the organization's overall business goal. A strong EA helps to answer basic questions like: What are the organization's business processes, and how is IT supporting those processes?



buzz words, I think you got them all :D

10 Sep 2009

Howto wipe 130 virus infected files in 25min

Short story: Install linux :-)

Long story:
I recently pluged back my old computer to internet, 15 min later my firefox homepage had change to a website with "ladies" if you see what I mean :(

My windows version was old, I had not started this computer for 1 year...
  • Running norton + windows tool to detect malware => 3 hours
  • Hitting the "repair" button => 10min (and then I gave up)
  • Booting under ubuntu + install + update to latest version: 25 min
note1: I was infected with virus.win32.virut.ce
note2: Me beeing fed up with "re-installing" windows all the time


Technorati tags:

27 Aug 2009

Life Back

Reading "lifehacks three tips for managing the stream" recently echoes to my latest blog post: 2 weeks vacation :(

If you understand the image below, that's a sure sign you're doommed ! ;)

24 Aug 2009

2 weeks vacation it's ...

2 weeks vacation it's ...
  • 25 emails in personal inbox (including 5 spam)
  • 41 work emails
  • 480 items in google reader
  • 1 java update
  • 3 firefox plugins update
  • 1 new google chrome version
  • 2 spammers wanting to add me as contact in skype
  • 99 msg in 1 conversation in skype
  • 2 small videos (and many more links waiting in skype, mails, google reader...)
  • 1 adobe reader update
  • 1 tortoise svn update
  • 4 new twitter followers (including 2 spammers)
it could be worst ;) (me thinking of last year's joost internal mailing list and commit list, argh!)


29 Jul 2009

Links to Google Maps in Gmail


I just received a new mail with an address in it.

Guess what, gmail added a google maps link on the right of the message! Freaky!

2 Jul 2009

Firefox 3.5: la guerre des browser faire rage

Nouvelle version majeure de Firefox: 3.5

  • Les onglet detachables sans plugin additionnel !
  • La video sans avoir besoin d'nstaller un plugin (flash) supplémentaire (http://fr.www.mozilla.com/fr/firefox/3.5/whatsnew/) intéressant
  • Et un petit bouton '+' pour ouvrir un nouvel onglet (comme chrome ?)

29 Jun 2009

Playing with Javascript namespaces

I often have javascript colisions when using different ajax frameworks in the same page...
So I was wondering how namespaces works in javascript...

I found the beginning of an explanation in this article: 24-javascript-best-practices-for-beginners

But there doesn't seems to be any real convention about this looking at this blog and the associated comments: JavaScript Namespaces

I tried various versions, it seems to me the simplest/shortest is the best... my 2 cents

// simple namespace like ExtJs
Project = {
name : "joe"
}

// a bit like java package but with underscore
com_company_project = {
name : "joe"
}


// java package style
com = {
company : {
project : {
name : "joe"
}
}
}

// Yahoo style
// var X = YAHOO.util.Dom.get();
PROJECT = {
core : {
Functionality : {
name : "joe"
}
}
}

function display() {
console.log("namespaces");
console.log("root: " + Project.name);
console.log("unscore: " + com_company_project.name);
console.log("nested: " + com.company.project.name);
console.log("yahoo: " + PROJECT.core.Functionality.name);
}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Javascript</title>
<script type="text/javascript" src="namespaces.js"></script>
</head>
<body>
<h1>Javascript</h1>
<h2>consoleLog</h2>
<div id="consoleLog">
<input type="submit" value="console.log" onclick="javascript:display();"/>
</div>
</body>
</html>


25 Jun 2009

Eclipse Galileo is out (1 year since Ganymede)

I was talking with someone recently and he told me he was using eclipse 3.3...
I'm using eclipse 3.4.

I told him, he should update since eclipse releases are not so frequent and just a minor number change is actually many months of efforts...

But I didn't know if it was 2, 4 or 6 months.

Well it turn out it's actually 1 year excatly between releases!

So now that Galileo is out you should really update your eclipse version or you'll have a 2 year old software ;)

I think many people don't update eclipse that often because of the quality of it, there is so few bugs that you don't feel the urge to update (my 2 cents)

Release Date Platform version Projects
Eclipse 3.0 28 June 2004 3.0
Eclipse 3.1 28 June 2005 3.1
Callisto 30 June 2006 3.2 Callisto projects
Europa 29 June 2007 3.3 Europa projects
Ganymede 25 June 2008 3.4 Ganymede projects
Galileo 24 June 2009 3.5 Galileo projects

source: wikipedia

17 Jun 2009

Eclipse and Updates

Eclipse is a great tool as a Java IDE and also an excellent plateform for application development (nothing new here).

But I've always found the software update system "awkward".

Not on the technical side, as explain by Benjamin Cabé: Déployer avec Equinox p2 [fr], the technology behind it is good, it's even more than just a "plugins updates" system.

But from a usability point of view I think they could enhance it much more, for example:
  • I would never expect it to be in the "Help" menu
  • Automatic updates could be "on" by default (see how firefox pushes update automatically), I suppose expert users would turn this off but for "Average Joe" it's a diferent story
  • I found the "software list" scary, I keep asking myself
    "Do I really need to update so many things?! I'm pretty sure something will break..."
    I think it would be better to hide it or group things in big categories like "update eclipse (core)", update spring plugin" etc...

No more desktoptopia.com wallpaper ?

Last few months, I have been using a windows tool (exist also for Mac) made by http://www.desktoptopia.com/ to change wallpaper every day.
What I like about it, is that they have quality images... but lately I kept getting the same images over and over :(

At first I thought it was a bug but it's far more simple the website is down :(

I don't know for how long but I think it's be going on for quite a long time... too bad I was looking for such a tool for a long time with minimum setup and nice images...

If you know something equivalent, drop me a line in the comment area ;)



16 Jun 2009

Polyglot programming

I was trying to explain the concept of Ployglot programming to someone but couldn't find a clear definition. I stumble on this link recently: Polyglot programming.



...writing good multi-threading code is hard. Very hard. So why bother? Why not use a language that handles multiple threads more gracefully?

Need a nice web-based user interface? Why not use Ruby on Rails via JRuby

It's all about choosing the right tool for the job and leveraging it correctly.

3 Jun 2009

XPath notepad ('like' queries)

Nothing fancy in this post, I just don't want to forget how to do 'like' queries in xpath

XPath: //category[@name='abc']
is equivalent to
Sql: select * from category where name ='abc'

XPath: //category[contains(@name, 'abc')]
is equivalent to
Sql: select * from category where name like '%abc%'

5 May 2009

When automatic information gathering goes wrong...

I have google alerts about my name, I just got an alert about 123people.com. It seems to automatically gather informations about me from various websites...

Looking at this page, you would get a wrong opinion of me:
      I talk a lot about sylvain wallez ?! (I don't think you are my main topic sylvain sorry ;))
      I am associted with a video of Christina Aguilera in spanish (wtf?!) Por Siempre Tú on joost

If someone search my name before an interview, I wonder what he will think of me ?! Hopfully I'm not associated with offending content !

31 Mar 2009

Log4J Patch: SSL support for Gmail Notifications

I wanted to send email notifications with log4j using Gmail smtp.
The patch already exist, but it wasn't fully functionnal... I had to add some few extra things...
But I coulnd't find any release since 2007...

So I made a fork with github of log4j 1.2.15 svn tag and patched it ;)

You can find documentation on the project wiki page.
You can download the jar file in the download section.
Or you can review the source and even fork it if you need something more ;)
http://github.com/francisoud/log4j-1.2.15-ssl-patch/tree/master

I have a sense that git is going to change the way we think of branching... might do a post on this subject one day ;)

Dilbert@IBM

While reading this dilbert strip, I couldn't help thinking about IBM and especially websphere's console :D




I'm actually convince IBM has such a "vice president of marginally legal activities" ;)
I don't see any other explanation to the websphere console complexity!

20 Mar 2009

[Rant] Oracle and the Boolean Type

A long time ago I used Oracle (I think it was something like 7 or 8 version)... there was no boolean type at that time, ok.

Then I mainly used SqlServer, MySql and PostgreSql.
They all have some sort of boolean type:
How is it possible that a database costing $40 000 per cpu, DOESN'T HAVE A BOOLEAN TYPE!! (and they have boolean in plsql!)

Apparently you need to use an number(1) to store those kind of values... How lame!

And don't get me started on the auto-increment columns ;)

11 Feb 2009

RSync for windows, mac and linux: Unison ?

Lately I re-installed all my home computers, that means backuping everything to DVD(s).
It's always a really painfull operation, there are differents files and differents folders structure across computers /os (windows, ubuntu...). Some files are the same, some where deleted but not everywhere etc...
So usually I spend almost a week-end cleanup the mess accumulated over 2 or 3 years.

I tried to use subversion to backup files so that I could use associate tools to ease the job. It was a failure for many reasons:
- Using svn add/move everytime you do something with a word, pdf etc... is painfull
- That means synchronising with some kind of server and I don't want to have a running computer all day long at home
- I don't need versions on those documents
- You need a big storage place (+ extra svn info) for the repository

For the sotrage problem I bought a 1To USB external drive! Should be fix now :)

For the rest, I think rsync is better for what I need!
Unfortunatly there is no such thing for windows unless you use cygwin... I'm not really found of cygwin (it's better than nothing but...)

I just found Unison, an implementation of rsync but available on multiple plateforms. Windows, Mac, Linux clients.
I did some tests under windows and it seems to work :)
I only used the client line since the graphical client need Gtk+ (I don't want to install it just for that) and it will be ugly (as usual with gtk).

I need to test the linux client and I should be ready to go...

6 Feb 2009

Jetty - change default java.io.tmpdir value and override web.xml parameters

Jetty is really nice, amongst the amazing things you can do some of my favorites are:
  • Change java.io.tmpdir default value
  • override params define in the web.xml embedded in a war file


java.io.tmpdir


<?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/test</Set>
...
<!-- change java.io.tmpdir default value -->
<Call class="java.lang.System" name="setProperty">
<Arg>java.io.tmpdir</Arg>
<Arg>/some/where</Arg>
</Call>
</Configure>

Change default values in web.xml


<?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/test</Set>
...
<Set name="overrideDescriptor">
<SystemProperty name="jetty.home"
default="."/>/contexts/test.d/override-web.xml</Set>
</Configure>

Create an 'override-web.xml'
<?xml version="1.0"  encoding="UTF-8"?>
<web-app ...>
<!-- Add or override context init parameter -->
<context-param>
<param-name>my.param/param-name>
<param-value>on</param-value>
</context-param>
</web-app>

29 Jan 2009

Postgresql and the trigger of death

Description of the problem:
I have a table with 2 columns date_acq and time_acq as text

CREATE TABLE "shapefiles" (gid serial PRIMARY KEY,
"date_acq varchar(10),
"time_acq" varchar(8));


I want a colum with a datetime time with the informations from date_acq and time_acq so that I can use the < and > sql operator.


I added a new column datetime_acq of type datetime and a trigger getting the information from date_acq and time_acq and putting them into the new column.
The trick is that the date is express in french format that is DD/MM/YYYY.


After learning and fighting with postgres stored procedure language I finally got a nice looking solution:

BEGIN;
ALTER TABLE shapefiles DROP COLUMN datetime_acq;
ALTER TABLE shapefiles ADD COLUMN datetime_acq timestamp with time zone;
COMMIT;

DROP FUNCTION IF EXISTS datetime_acq_timestamp() CASCADE;
CREATE FUNCTION datetime_acq_timestamp() RETURNS trigger AS $datetime_acq_timestamp$
DECLARE
temp_date text;
french_pattern text := 'DD/MM/YYYY';
BEGIN
-- Check that date_acq and time_acq are given
IF NEW.date_acq IS NULL THEN
RAISE EXCEPTION 'date_acq cannot be null';
END IF;
IF NEW.time_acq IS NULL THEN
RAISE EXCEPTION 'time_acq cannot be null';
END IF;

-- Updating datetime_acq column
SELECT TO_CHAR(TO_DATE(NEW.date_acq,french_pattern), 'YYYY-MM-DD') into temp_date;
NEW.datetime_acq := temp_date || ' ' || NEW.time_acq;
RETURN NEW;
END;
$datetime_acq_timestamp$ LANGUAGE plpgsql;

CREATE TRIGGER datetime_acq_trigger BEFORE INSERT OR UPDATE ON shapefiles
FOR EACH ROW EXECUTE PROCEDURE datetime_acq_timestamp();

"Et voilà!" Now I have a nice column with valuable informations:

XSD schema validation for XSL and auto-completion in eclipse (second edition)

In Jan 8, 2006 I made a post about making xsl autocompletion work under eclipse... but I was in a hurry so the old post is not top quality ;)

Let fix it and make it a first class citizen :)

First you can download 2 already pre-configured empty files:

  • test-default-namespace.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemalocation="http://www.w3.org/1999/XSL/Transform
    http://www.w3.org/2005/02/schema-for-xslt20.xsd"
    version="2.0">

    </stylesheet>


  • test-not-default-namespace.xsl

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemalocation="http://www.w3.org/1999/XSL/Transform
    http://www.w3.org/2005/02/schema-for-xslt20.xsd"
    version="2.0">

    </xsl:stylesheet>


Now you need to setup eclipse, Go to Windows > Preferences then XML > XML Catalogs.
Copy the exact same informations that the screen capture below!!




Validate your the xsl with Right click on the file in eclispe > Validate

When you hit Ctrl+Space, it should work now!
You shouldn't have any error or warning, especially the warning telling you that eclipse couldn't find the dtd or xml schema for xsl namespace!

Gotchas:
  • Especially if you internet connection is slow, you need to wait a few seconds after opening the xsl before hitting Ctrl+Space because eclipse is downloading the file from http://www.w3.org/2005/02/schema-for-xslt20.xsd
  • I don't know why because I have to close/reopen the eclipse editor for changes to take place

Technorati tags: xsl eclipse

Fomatting messages

I always found formatting Strings was painful in Java. Especially since I learn Ruby where you can do:
some = 'foobar'
my_string = "Here are #{some} value"

In Java, a basic example would be:
String searchPolygon = "POLYGON((" + lowerLeft + ", " + 
lowerRight + ", " + upperRight + ", "
+ upperLeft + ", " + lowerLeft + "))";

If you have too many parameters or you are looking for more efficiency, you can do something like (you can use StringBuffer instead of StringBuilder see javadoc):
StringBuilder searchPolygon = new StringBuilder();
searchPolygon.append("POLYGON((");
searchPolygon.append(lowerLeft);
searchPolygon.append(", ");
searchPolygon.append(lowerRight);
searchPolygon.append(", ");
searchPolygon.append(upperRight);
searchPolygon.append(", ");
searchPolygon.append(upperLeft);
searchPolygon.append(", ");
searchPolygon.append(lowerLeft);
searchPolygon.append("))");
searchPolygon.toString();

But still, it's ugly :(


Or you can use MessageFormat wich make the code more much readable in my opinion ;)

MessageFormat polygonFormatter =
new MessageFormat("POLYGON(({0}, {1}, {2}, {3}, {4}))");
Object[] values = new Object[] {
lowerLeft, lowerRight, upperRight, upperLeft, lowerLeft };
String searchPolygon = polygonFormatter.format(values);


It could have even be better if we could have use a map with key/value instead of indexes... but I didn't found anyting in the java language itself that does this :(