le Wadablog

Aller au contenu | Aller au menu | Aller à la recherche

dimanche 1 mars 2015

PROTIP : Download the same Forge version for the shell, that you have in JBoss Developper Studio

PROTIP : In order to download the same Forge version for the shell, that you have in JBoss Developper Studio, you can cheat with the URL given on the website, which is


and replace LATEST with the expected number, like 2.13.0.Final to be in synch with the version available in JBDS GA v8.0.2

This way, you will not get version issues by compiling your addon with a version different that the one used at runtime.

New article in the kiosks / Nouvel article dans la presse

(FR) Retrouvez mon article sur JBoss Forge dans GNU/Linux Magazine France n°180 de mars 2015.

(EN) My article on JBoss Forge is published in GNU/Linux Magazine France #180, March 2015.

lundi 21 avril 2014

Anecdotes, DevoxxFr 2014

As always, DevoxxFr was a wonderful conference with plenty of talks, worth inventing cloning in order to attend them all.
It's also the occasion to meet people from the interwebs I mean person I communicated with via electronic means, former colleagues and more people.

Because that's what it is, an event to fill up the brain, generate crazy ideas (more on that in a few months) and meet people who actually talk the same IT lingo.

I have had the luck to meet Phillipe, whom I consider highly because of his publications like his Play! ebook. He is also a good curator for technologies.
Emmanuel, former co-detainee.
Antoine of CDI fame
Christophe, friend & former colleague   
Fabien, in my tech sphere for years.
And José, Nicolas, Antonio
There were also international geeks like Arun Gupta, David Delabassee (whose Arduino prez. of last year was awesomely clear).
New Java Champion David Gageot was here too.
Audrey of Ted & Devoxx4Kids fame.
Didier, François, ....

Also lots of talented people
I also met again Horacio (http://www.lostinbrittany.org/blog/).
First anecdote is that he trained & worked with Jerome, my coworker (yes, two Jerome in a room).

As he happened to be with Thierry Chatel of AngularJS training fame, I told them how I learned to use AngularJS.
And because they found it funny, here we go for this post.

There was two determining facts for me to use AngularJS. First, I was looking for something more productive than JQMobile for a next mobile app.
Second, I wanted to try this new stuff.

Also, I found that I was writing some repetitive code for a Spring-based project using stored procedures.
And that bored me.
And I'm a guy who generates SQL or Java code with a spreadsheet.
So I used Angular to generate my Java code.
There will not be any screen capture because confidentiality and also, because I'm at home :)

How it works.

Display page
Input procedure name & validate. Query is made to the server, its a simple Spring controller that will return JSON describing the input parameters for the procedure (JDBC metadata).
JSON is used to create a dynamic form.
User inputs values & validates.
Controller uses the values to execute the procedure. Then returns JSON describing the output.
For each column, there is a line in a second form. 
Users inputs the types and names to be used in Java, a description that will become a comment.
Other inputs are for the DTO & DAO names.
Under the user's eyes is generated the wiki page (wiki syntax)
The rest of the page contains the sources for the DTO, the DAO, the interfaces.
Everything just needing some copy/paste in the IDE and some tuning because all camelCase is not perfect).

There is way more to say about this conf'.
To make it short, I want to go again next year, hoping to see my friend Romin in this part of Earth : Palais des congrès de Paris, 8-10 april 2015.

dimanche 23 février 2014

StartApp banner ads in an Android app built with AndroidAnnotations

If you want to put a StartApp ads banner in an Android app built with AndroidAnnotations, as the documentation says that you must do StartAppAd.init() in the onCreate() which you don't write when you use AA, well this is how to do
public void pub() {
StartAppAd.init(this, "XXXXXX", "XXXX");
and of course, you insert the relevant xml copy-pasted from the StartApp pdf, in your layout

It works on my machine :)

mardi 2 juillet 2013

Play! framework is neat

In this tweet, https://twitter.com/wadael/status/352160038682497025, I wrote

my solution for a quick REST backend is play1 + crud & secure modules on Heroku. Local tests quicker&simpler than jee.

I want to create a backend server to serve data to a mobile app. I need some admin pages. I don't want a sexy web app with JS animations and a marquee :)

hy Play! framework ?

I had fun doing some testing of it (the documented sample) and regretted not to be able to use it in a project. Time went by. Didn't use it for pet project either...
This had to be repared :)
Play is available on cloudbees, heroku and more.
Play is JSON friendly, you cant beat this, JEE
public static void allCategories() {
renderJSON( Categorie.findAll() );

One method and its route is all it takes to serve stuff as JSON.

There is a wonderful free ebook on Play1, in French (so rare), written by @k33g org and @loic_d
Thanks a bunch to them !

Why Play v1 ?

OK, v1 is not maintained, I know. Thus, I started a v2 project buuuut .... the CRUD (scaffolding) module is v1 only. Dammit.

Play Tips

Declare your members public. Yes, feels weird. But this seems to be the cause for my JSON to be uncomplete (only ids appeared)
The Play v1 clickstart (for CloudBees) I found on the web, bugged three times.
The creation of the virtual host failed to complete.
Then, only v2 is available on CB.
Heroku still offers v1 hosting, their tools are neat (git to commit & deploy). No need to change some config file to change between dev & prod.

Fears, uncertainties and doubts

Will I have some v1 hosting over the whole lifespan of my app ?
Will Heroku service still be free in that period ?
Will my app be a success ?

vendredi 28 juin 2013

Notes about JEE7 on GF4 on CloudBees

Things to remember 

Context: just want to create a JPA backend with JAX-RS to serve JSON for an Android app. Simply. Quickly
  1. Use   @Produces("application/json; charset=UTF-8")  to get the accents right (so long for the convenient Mediatype.APPLICATION_JSON)
  2. @ Context private UriInfo uriInfo;  causes errors 
(to be continued)

lundi 17 juin 2013

Speaker again

My subject has been selected for the BarCamp of DroidCon Paris 2013.

Persisting data on Android, why? how ?
After some mind refreshers, I spoke mostly of ORMLite on Android

The slides are there  https://slid.es/alwad/persistence-des-donnees-pour-android 

They miss the oral comments, sorry :)

lundi 8 avril 2013

On BatooJPA on the Andoid platform

As you may know, I've done more serverside than mobile dev.
Therefore, I was looking for a way to unite the JEE serverside part and the mobile app.
You know, not having to code same things twice. 
Thus the idea to share code between the two. Not the UI of course, but the JPA entities.

I found BatooJPA (https://github.com/BatooOrg/BatooJPA) which is a competitor to Hibernate and has a sample project for use on Android (it creates data and displays a listview).

Seemed like a good finding however, that does not really match well with me because : 
* Maven based (I used maven 1 and still have nightmares) 
* maven plugin to build & install 
* eclipse 3.7 only 
* uses H2 instead of SQLite 
* Android sample not maintained anymore 
** has to tweak it to make it recognized as an Android project in Eclipse 
** a dependency seems not to be in maven central anymore 
* heavyload APK & app (several Mb) 
* class not found exception at runtime 
As the sample was not working out of the box, I had to recreate it. 
I did it with http://androidkickstartr.com/ then updated the pom and copy/pasted the code.
Should had been ok but ended with a runtime exception. 
I concluded that its not the time for BatooJPA on mobile yet. 
Its sad because, I wanted to present it at DroidCon Paris ... 
Consequently, I recommend to use BatooJPA on the serverside and to make your mobile app a dumb REST consumer if you can afford your app to need network at all time. 
Alternatively, with a need for local storage, one can write a converter from JPA to ORMLite annotations. 
Or lets fund +Gray Watson and +Kevin Galligan to make ORMLite JPA compliant (hi guys).

jeudi 11 octobre 2012

Hands On Cloud Foundry chez Xebia

A nouveau dans les magnifiques locaux de Xebia pour un évènement communautaire hier soir.

Cette fois, le sujet était Cloud Foundry, proposé par @jduchessfr et présenté par @ebottard et @fbiville.

A nouveau, des têtes connues mais pas Sam, pour une fois ....

L'avantage de l'évènement est que cela me fait gagner du temps et d'avoir accès à des connaisseurs, par rapport à découvrir la ptforme chez soi et forcément, bugger sur les écueils habituels. 

Nous avons pu tester le net @ Xebia par OVH.
Qui n'aime pas bcp Maven ;)

De mon côté, je ne suis pas fan de Spring et de son côté BDD. Bof.
Je me dis qu'il me faut vérifier le support de JEE étant donné que Spring, Rails et Node, ne m'attirent pas.
Sauf si je fais générer une app Spring avec Roo ...

Bref, une fois rentré, un tweet m'apprends que TomEE peut être mis sur CloudFoundry :)

Excellent, reste à savoir quelle sera la politique de facturation à la sorte de phase béta.
J'espère une tranche (confortable) gratuite pour les petites applis, comme GAE fait (faisait?).

Bref, je prends CF comme backend de ma prochaine app (ou celle d'après)

vendredi 5 octobre 2012

BL'IMEI, a new app

Hi all,

Just pushed an app on the playstore last night.


Blimey, it will show you your IMEI (International Mobile Equipment Identity, see http://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity)

It can show it via the ussd/samsung/dialer bug AND via the normal way of calling the dialer with an intent.

So that you'll know your IMEI without removing the battery.

Don't tell me it looks ugly, I know it :)

mercredi 26 septembre 2012

Go on Rasp Pi

Nothing new here, I'm not the first to install Golang on the ARM-based Raspberry Pi.

What was fun was to open a terminal on my nexusOne, open a SSH session on 3G to my Pi @ home then apt-get the dependencies, hg clone and make it.
Next geek time at home, I'll give a try to the web frameworks for Go

Now I need to open more ports :)

Have a nice day

lundi 17 septembre 2012

Screen configurations

My dual screen eclipse configuration @ work

left screen (secondary) :
3/4 for console + other tabs (javadoc, junit, problems, ..)
1/4 for package explorer (+ navigator, error logs)

front screen (main):
3/4 for editors
1/4 for outline

both are large

Home hacking config is
laptop (16/10) + 4/3 17p external monitor
most of time only laptop

lundi 13 août 2012

Hunt for dead code

I recently tweeted that I was not happy with CodePro's feature of finding dead code.

I am to maintain an old Swing based software that has seen several years and people.
It has classes named like Class AB with A & B being meaningful complicated words.
Trouble is also that it can have a class BA for each class AB.
Not forgetting that there is AB classes in several packages.

Do you feel the pain ??

I do.
Therefore, I thought I should remove the unused code, hoping there would be a lot of code to remove.
Thus the use of CodePro plugin

Having used source-manipulating tools before, I know they can do more bad than good.
So I commented by hand the unused classes and methods.

Good idea !
I ended de-commenting the previously commented lines of code.

The tool did not work well for me, presumably because there is a custom classloader in use. I have not looked deeper.

dimanche 24 juin 2012

OSGi/Eclipse plugin, I'm puzzled

Some time ago, I found a pretty dead simple solution to a problem with GWT compiler (issue 5621).
It leaves files in TMP dir.
Sometimes BIIIIG  files (not for me).
And it slows down Eclipse even more.
AArrgghh, someone has to do something about it.

So I took my best cape and thought of a bundle that would clean the mess on start and stop of Eclipse.

That is level 1 OSGi, an Activator that does the job.

Its also for I will have to do something that must autoload JARs at work.

Then, boom ! In my face !
The Activator does not get activated even though I explicitly set lazy loading to false.

WTF ??
The module either appears as LAZY or RESOLVED depending on the MANIFEST.MF configuration.

This adds one more line to the funky stuff I found in the little I know about OSGi
* General Manifest syntax
* 80 columns Manifest
* unclear lazy loading directives, combinations 
and now,
* Activators that do not auto-start

And I do not know much.
I presume, I'll look at the bare Java modules (JDK7 ? 8?) for the job.

If you have an idea, share it in the comments. 



2012/07/06 Update : The truth is in the source. The wizard added a line in the Manifest.mf that was making it lazy. Dropping that line made the plugin work as intended. The project can be found on GitHub   https://github.com/wadael/GWTCleaner , the path comes from user mudelta

vendredi 4 mai 2012

GWT(F)'s ListBox

Nothing new but yesterday, I was doing some upgrade to a GWT based app.

Surprisingly, the ListBox class has none of these methods. 
  • getValue() to return the selected value
  • empty() / clear()  to remove all values
  • addAll(List<String> newValues)  to add a group of new methods
And it was a shock again.
Subclass my friends, subclass !

mardi 10 avril 2012

Nouvelle app pour bientôt / New App soon

Ma nouvelle appli sera bientôt sur le market.
Elle commence à avoir une tête présentable, il y a encore et il y aura toujours des détails à améliorer.

L'annonce est pour bientôt. 

Quelques éléments tout de même, pour un peu de teasing :
  • la cible franco-française (IDF dans un premier temps)
  • utilise ORMLite
  • utilise AndroidAnnotations
Comme la précédente, je n'y passe que quelques heures de temps en temps en soirée donc ce n'est pas la meilleure appli du monde.
Néanmoins, je crois qu'elle sera utile.

Fin du teasing :)

My next app is to be released soon, it will target mostly French ppl or French-speakers living around Paris. I did not do any I18N.
I used AndroidAnnotations and ORMLite to build it.

I recommend both although I was kind of deceived by ORMLite, as I'm coming from Hibernate/JPA grounds.

lundi 9 avril 2012

Android tip of tonight

As I work on an app that loads stuff in DB, I frequently have to go to "Manage Apps" then find my app in the list then click on it and then "clear data". 
As my app's name starts with "P" and I'm using my everyday phone, thats quite a quantity of apps to browse before I find mine.

Easy tip : prefix your app's name with "_____" for example, to have it at the top of the list of your apps.

mardi 7 février 2012

JPA, EclipseLink and the DOH!

There is something you must know exists when you encounter problems of the "does not work as expected" kind.

This is
<property name="eclipselink.logging.level" value="FINEST"/>
that you must put in persistence.xml to get spammed in your console and check, for example, that all your entities are recognized.

Oh, and prefer 


if you want to master the table name used. 

Else this is your entity that is renamed and you'll get your queries wrong ;-)

jeudi 19 janvier 2012

Alfresco's AuthenticationUtil.getFullyAuthenticatedUser()

I am using version 3.4.d community and I plugged custom pages in for company specific matters.
In those page, I need to know the logged in user.

So, I found  
which I later found out does return the authenticated user but the last one who logged in.
So, I had a fucking problem with my app reacting like the user in front of the screen is someone else.

Oo !!!??!!! WTF ???

Guess what .... Its written black on white in the javadoc  (see http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/data-model/source/java/org/alfresco/repo/security/authentication/AuthenticationUtil.java)


 * Get the fully authenticated user. 
* It returns the name of the user that last authenticated and excludes any overlay authentication set
* by {@link #runAs(org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork, String) runAs}.
* @return Returns the name of the authenticated user
* @throws AuthenticationException

Lessons learned, again :
  • do not assume people use meaningful names.
  • method name is not enough
  • reading first line of javadoc is not enough
  • one never stops learning with Alfresco

Fortunately, this has been detected during internal tests.

mardi 17 janvier 2012

GWT ListBox & events - for records

Note for future self :) (and yesterday's self)

On a GWT ListBox widget, it is natural to write 

listbox.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {...}

But do not forget to
listbox.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {...}

for else, the event "the listbox has been selected and value is modified with the keyboard arrows"
will not be handled even though the value "changes".

Now, shouldn't the ChangeHandler be called ChangeByMouseHandler ? No ?

- page 1 de 3