le Wadablog

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

mardi 27 mars 2012

Article dans une vraie revue du monde réel

(In English after the French §)
Certains savent que j'adore les livres et que je rêve d'un jour écrire un cycle comparable à Dune. 

Après une déception sur un projet qui n'a pas vu le jour (un chapitre sur mon WadRobotFramework dans un livre consacré à Wave chez un gros éditeur américain), 

En 2010 et 2011, j'ai eu la joie de tenir des livres où mon nom apparaissait dans la préface pour indiquer la qualité de ma collaboration en tant que relecteur technique.

Mars 2012,  j'ai le plaisir d'annoncer que j'ai écrit un article qui doit paraître dans un Hors Série d'une revue que j'apprécie particulièrement. 
Un premier article (rémunéré) dont je reparlerai quand il apparaitra en kiosque.

Je vais proposer un 2e article pour creuser le sujet, pour un numéro suivant.

J'espère participer à un livre en 2013 et pourquoi pas en co-signer un en 2014.

MAJ 2012-04-16 : j'apprends ce matin qu'il y aura DEUX HS Android à la suite.
Le premier sortira le 27 avril. Je ne sais pas encore si mon article sera dedans ou dans le suivant.
MAJ 2012-04-28 :  Mon article sera dans le suivant.
MAJ 2012-07-06 :  Mon article est paru dans GNU/Linux Magazine France, Hors-série n°61 Android. Vous le trouverez page 64.
http://diamond.izibookstore.com/produit/169/9786000049683/GNULinux%20Magazine%20HS%20n61%20%20Creez%20vos%20applications%20Android%20comme%20un%20pro%20 

Hi guys,
I have signed an article to be published in a real magazine later this year.

In 2010 & 2011, I had the pleasure to see my name in the prefaces of excellent Android books in sentences underlining the quality of my contribution. And its still huge memories for me to have worked with people I already respected for their previous books/blogs/dW articles (even kilometers of dW articles).

2012 is when I will finally have something published as author : an article in a special issue of a well-known French magazine.

Next step is propose & write a second, to go deeper into the topic.

My envy for 2013 is participating to a book. And co-sign one in 2014.

Dreams are what we live for. Aren't we ?
Update : My article will be in the issue to be published in July.
Update : My article is published. You can browse the magazine online at http://diamond.izibookstore.com/produit/169/9786000049683/GNULinux%20Magazine%20HS%20n61%20%20Creez%20vos%20applications%20Android%20comme%20un%20pro%20 , see page 64

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 
@Entity
@Table(name="a_name")

to

@Entity(name="a_name")
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  
AuthenticationUtil.getFullyAuthenticatedUser();
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

HELL, THAT NEARLY SCREWED MY LAUNCH !
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() {
@Override
public void onChange(ChangeEvent event) {...}
}


But do not forget to
listbox.addKeyUpHandler(new KeyUpHandler() {
@Override
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 ?

mardi 3 janvier 2012

ORMLite for Android - episode 1

If you read my blog, you certainly know I am an Android fan.

But I am not fond of its SQL features. Some times ago, I looked for alternatives and I found ORMLite for Android.
My first use was very simple (yet unpublished).

Recently, I tried it with a parent-child relation. There is a persistent object in another persistent object.

As I wrote in https://plus.google.com/u/0/117007069948230044999/posts/fGyVgXPPf57

After some browsing, I found that parentDao.refresh(parent) must be done explicitly, else the child is not loaded.
Well ... ok ... its weird for me, as I'm used to server-side ORMs.

Unfortunately it did not work with only
@DatabaseField(foreign= true) on the child field (yes, I believe in magic ;) )

so, I annotated it with

@DatabaseField(foreign= true, foreignAutoRefresh = true, foreignAutoCreate = true) and it worked.

I have not tested the updates behaviour yet or the performance as for the moment, I just want to load my db.

This lib is a nice tool for your android toolbox.

vendredi 23 décembre 2011

Exchange, JavaMail & le temps perdu

"Le temps perdu" (the lost time) including extra hours trying to solve this problem ...

I managed to have a sort of "hello world" of email sending working with exchange and javamail.

First, let's make things clear. I'm in a corporate environment. I am forced to use exchange, I have to deal with the proxy, a slow machine and a lack of documentation.
Fortunately, the web access is not too restrained. 

Thank you http://stackoverflow.com !
With all the threads openned on javamail + exchange I could 'compile' something.

If ever that can help someone else than me, here are the ingredients I used (might differ in your environment)
  • use TLS props.put("mail.smtp.starttls.enable","true");
  • use port 587  (not 25, not 685)
  • use a javax.mail.Authenticator
  • add the necessary certificates to the keystore used by your VM

    On a *nix system, try   find / -name cacerts |more
    and find / -name .keystore |more
  • You will find the certificates from your browser settings
Other findings
  • McAffee protection against 'mass emailing worms'  prevents you from developing on your dev station
What I should not write
  • Write simple test programs on the PROD env. to be sure it CAN work
And now a poem
LE TEMPS PERDU (de Jacques Prévert)
Devant la porte de l'usine
le travailleur soudain s'arrête
le beau temps l'a tiré par la veste
et comme il se retourne
et regarde le soleil
tout rouge tout rond
souriant dans son ciel de plomb
il cligne de l'oeil
familièrement
Dis-donc camarade soleil
tu ne trouves pas
que c'est plutôt con
de donner une journée pareille
à un patron?

mercredi 30 novembre 2011

NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference

Got this while compiling my GWT app
Java.lang.NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference

It did not occur when compiling with previous GWT compiler, but occurred with 2.4.0. Another WTF?!?? -- code was unchanged.

A handy message on the GWT Google group says that the order of export put in place by Maven was guilty.
I up-ped the GWT dev and user JARs
 with my answer

mercredi 9 novembre 2011

Alfresco - install on a linux VM, protip from real life

As I was installing an Alfresco on a Linux machine, I learned AGAIN.
Damn Alfresco, I know it since the "not yet 1.0" version (was 0.6??) and everytime I use it, I learn new stuff.

Problem:
It all started with my test user seeing mixed languages, English and French in the web interface despite the choice of English at login time. 


OK, problem is solved but it was a pita as I had to "DROP DATABASE alfresco;". Was empty, fortunately.

Short version :
As the "system spaces" like "data dictionnary" are created upon first boot of the webapp, you must not leave YOUR language packs (.properties files) in the .war file. Main culprit was bootstrap-spaces_fr.properties in alfresco.war\WEB-INF\classes\alfresco\messages\

Long version :
I installed on a Linux machine, not using the 1-click installer provided by Alfresco but it would not have changed a thing considering it's the .war file the guilty.

I am not a US resident, nor EN.
I use a Linux VM that I have not set up, physically located in fr_FR, which I tend to forget as I mostly write/code in english (sometimes frenglish).

On first start, the .war file deployed in Tomcat is unpacked and its content is used by the initial process -- including the deadly bootstrap-spaces_fr.properties. 

This process creates what I'll call the "system spaces" (like "data dictionnary") and they are created accordingly to the locale whenever the files are available. If not, the default are used and they are plain English, which is better for a system to be used by people around the world.

The culprit file can be found at alfresco.war\WEB-INF\classes\alfresco\messages\bootstrap-spaces_fr.properties. I moved all _fr.properties files to a subfolder -- just in case.

My advice is to remove all I18N files from the .war before to use it.
Or, you'll have to drop the database and empty the alf_data folder and of course, bear with another looong first start. 


Hint: Setting the JVM's locale to "en_US" could be an option (not verified) at install time.

jeudi 9 juin 2011

The Sam Tab 10.1

As I have already said, I am the happy owner of a Galaxy Tab 10.1 :D
This may sound like a conclusion but do not stop reading yet.

It runs Android 3.0 for the moment and I have not used it for hours and hours ...

My main expectation with this device was access to the v3 API branch, due to the slowness of the emulator on my C2D laptop.

However, since I have received it, I have not had time to code :(

Still I had enough time and concentration to test a few apps.
Thus, the apps cons

  • browser : it closed automatically too often.
  • Maps : it closed automatically too often. Too. Seems multitouch is a cause.
  • market : have not found the "only free apps" checkbox.
  • tweetdeck : a font size superior to the max. of 27 would be cool.
  • gmail : a few times, the "reply" button did not work ....
  • Helix HD lite free : slower then on the EVO on which I usually play
  • Robo Defense : I prefer to play on the EVO too. Even if it drains the battery.

That's it for the general cons.

Now the general pros :)

  • beautiful object
  • very responsive (had previous exp. with cheap tablets. Used several in stores)
  • approved by kid, haz passed the "haz angry birds" test :P
  • good sound


On the "general cons" side.

  • one non-standard connector (is it direct to mainboard ?)
  • does not recharge during use (wtf ?)



However, this is balanced by

  • "toys, toys, toys" --- I like toys
  • the newest, the better
  • I USE IT
  • I plan to code for it specificly.



I expect more stability with the announced 3.1 OTA. Despite the listed cons, I am an happy owner.

Thanks again Santa ;)

mercredi 27 avril 2011

Android recycling

This post is not about teaching a phone to eat all your waste :)

What to do of "old" phones

As time goes by, one (developper) gets more and more smartphones and specs evolve, leaving older phones behind in terms of daily use.

Thus the question that arises is what to do of "old" phone ?

Of course, the quick and easy answers are :

  • let it rest in a drawer for ... hum ... future use.
  • give/sell it to someone


What else ... ???

HACKING !

There is a computer in the phone ! Remember ?
Depending on the phone model and the work done for it by the wonderful community, you can :

  • install another system, like Ubuntu on a Nexus One
  • install uncommon services
  • use as a remote home-monitoring system (camera to take pics periodically and upload to web if delta)
  • Experiment (roms, ...) : nice way to learn


To give an example to that second point, it would be to install a web server with a few pages, tie it to a dynamic dns (you'll need to configure your box/modem of course)

There is web servers for Android, you are not forced to install Ubuntu + Apache :) or even to cook your own.

It all depends all your available time

That is how innovation happens.

Maybe one day, we'll see Tomcat running on a mobile phone without slowing it to death.

mardi 26 avril 2011

Joli texte

Hommage aux départements de France, la patrie de Jean Lambert.

Ce n'est pas compliqué : Il faut d'abord s'assurer qu'elle est Seine Gironde et bien en Cher.
Lorsque l'on sent son Eure venue on commence par lui caresser le Haut-Rhin puis on descend vers le Bas-Rhin.
On contourne alors l'Aisne pour rentrer dans la Creuse.
Là on trouve quelquechose de bien Doubs.
Sans perdre le Nord on attend que ça Vienne et si on ne se débrouille pas comme un Manche on peut y rester jusqu'à l'Aube.

En Somme il ne s'agit Pas-de-Calais pour être un Hérault.


Merci à Karim de me l'avoir envoyée

jeudi 24 mars 2011

(FR) Application "Contrepeteries" pour Android

Entre autres choses, j'apprécie les traits d'esprit et les jeux de mots.
Il y a quelques années, je me suis intéressé aux contrepeteries et j'ai constaté que le web n'en manquait pas, mais qu'il y avait souvent les mêmes, dupliquées de sites en sites.
J'ai initié le site http://contrepeteries.free.fr pour qu'il soit collaboratif : que les visiteurs l'enrichissent et puissent récupérer les contrep's pour les utiliser sur d'autres supports.
Il y a eu des échanges fructueux avec le créateur d'une appli pour mac, des visiteurs qui ont beaucoup participé (Merci encore à Maud du fond du champ).
Mais le site vivote à 50 visites par jour.

Comme dirait le chien parlant que je n'ai pas : ça c'est de la niche !

A partir des données de mon site, j'ai créé une appli pour smartphones Android.

Elle s'enrichira au fil des versions. Aujourd'hui (v1.1), elle permet de

  • consulter +500 contrepeteries au hasard
  • partager la contrepeterie affichée (par mail, facebook, twitter, etc ...)
  • voir la liste des évolutions à venir (affichage des solutions est l'évolution la plus demandée)


Voici le lien vers le market web https://market.android.com/details?id=org.wadael.contrepeteries

Et le QR code correspondant

Amusez-vous bien et donnez-moi votre avis.
Merci

lundi 14 mars 2011

Android Market & efforts

Today,
I have decided to publish a small app dedicated to spoonerisms (in French).

It is titled "Contrepeteries".

Another day, another occasion to learn.
I built apps mostly for myself so this was the occasion to 'market' an app.

From my coder point of view, it is quick but not as direct as should be.

Guess what, after all the ProGuard errors solved (thx to Guillaume of Capptain), I had errors on installing my own app !

"not signed correctly"

"Damn how can it be ?" I thought, considering I was using the very last version of the tool provided.
Isn't it checked right after I upload the apk ?

Based on what I've read on the web and this experience, what one must do is :

  • clean the package before signing (remove useless files)
  • uninstall from your test phone before to install from the market.



Coming back to the ProGuard point, as I use Capptain and AdMob on this app, a working proguard configuration can be found at https://docs.google.com/document/d/1r-zv0XDsJNDmkuhQYTNRW2Tv46WOSBV0QAA3hHcN3IM/edit?hl=en


Find Capptain at http://pages.capptain.com/homepage_01/

Find my app at https://market.android.com/details?id=org.wadael.contrepeteries

mardi 18 janvier 2011

AD-jacking

Today's new concept is

AD-jacking a word based on "AD" (for advertisement) for prefix and "-jacking" (same idea is hijacking, carjacking etc...).

Means : benefiting from another advertisement.

That is, your ad reuse a word, concept or element of language introduced to the audience by a previous advertisement, thus benefiting from it in terms of time. Anything known by your audience does not have to be explained by your own ad, making it shorter than in the opposite case.

Alternate syntax : adjacking, ADjacking, ADJacking

First references I get from googling it refer to hacking with online ads using XSS techniques.
So I might have invented this term.

lundi 15 novembre 2010

Drops computing

I do not intend to produce a reference material with this blog post. At most, I'll get 'prior art' reference and avoid a corporation to patent this. 

Definition

Yet another "new" term for IT. 

What I mean with this "drops computing" is "distributed computing involving both machines 'in the cloud' and smaller connected machines like smartphones".

My point is that global computing power has grown in an important way in the last years. I am thinking of all the smartphones that have been sold lately.
What a waste of power to have them mostly do ... phone calls.

Nowadays, smartphones have capacities that sound similar to desktop PCs available a few years ago.
Altough they have different CPU architecture and less storage, I think you'll agree.

Do you remember that those PCs were used for distributed calculations via programs like Seti@Home ?
Whether it is decrypting alien gossip or the human genome, computing power is here, in our pockets.

Limitations

Battery

Description 

Imagine continuous usage of the phone. Battery would drain quickly.

Solution

Calculations only happen when the phone is charging OR battery level higher then a percentage to be determined by user.


Complexity

Description

Smartphones cannot hold a complex model in memory.

Solution

Give "easy jobs" to smartphones.

Network

Description

Connectivity is not always available.

Solution

Be honest. Advise users without a real unlimited data plan not to join. 




Side note :
An architecture involving cloud computing machines and portable machines (drops) could be called "rain computing". But that would not be a very bankable term.

mardi 19 octobre 2010

Smudge attack parade ideas

I have read a post from Eric Vetillard (javacard expert amongst all and a colleague), about smudge attack against android terminals.

To quote his post :

this attack targets the authentication pattern that is used to unlock an Android phone. .... owners also know that smudge really is dangerous for this authentication technique. I have tried it with a colleague: after picking up my phone, it took him 3 tries to get my combination

Why that ? Because :

  • fingers are sweaty or greasy or both (weather is good in the south of France, isn't it Eric ?) so they leave traces on our shining screens
  • there is only one path to unlock the phone
  • this path 'looks' always the same on the phone



So, that post triggered some thinking. I think I've found possible solutions :)

First proposal
The pattern has to not be static. To reach that, my proposal is to have the dots or equivalents to be in a circle that will rotate.
Not randomly but more like a compass.
Just like a compass has an arrow, an arrow is used so that the user has a landmark and not get lost
Then either link the dots to unlock. (5 tries are allowed instead of 3)
With that, you will never not touch the screen at the same place (unless you unlock only at the very same place, with the same position of the body)
Derivated proposal :
A keyboard which keys are never at the same place, used to enter PIN code.
Most of us already know that, as this is used by online banks. The proposal is to integrate it as a proposed unlocking system.

Third proposal, I call it the psycho-camembert :)
It looks like a camembert (or pie chart) with equal parts coloured differently and having patterns (stripes, dots, etc ..).
This camembert is centered on the screen. Those parts are displayed in a random order.
To unlock, parts have to be dragged toward the exterior. Therefore, the traces on the screen are all lines from the center to the outside.
Of course, its a memory thing and one will have to memorize a colour order. Sorry for those who cannot distinguish colors, thats why patterns can be added.

I hope this contribution will find its way to the good ears.
Let's be frank, all the better if it brings me an all-inclusive invitation to IO 2011 !
I really liked San Francisco and have no idea on how to deserve an invite for next year.

Feel free to indicate me the classes of the API to look at in order to implement it.


Cheers,

Jérôme


Eric's post is here http://javacard.vetilles.com/2010/10/18/smudge-attacks-on-android
You can follow Eric on Twitter : @evetillard http://twitter.com/evetillard

mercredi 22 septembre 2010

More French Love in SF

Frisco ce n'est pas QUE de superbes voitures, on y trouve aussi des voitures de caractère.

Pour preuve ....

Jérôme / Wadaël

lundi 20 septembre 2010

At least, S.F F.D truck

Last May, I visited San Francisco.

One of my preferred shots is :




It is a firemen truck. Red, huge, shiny : a boy's dream !!
Actually, my boy dreamed of it :)



21or22 May 2010, San Francisco, near North Beach

mardi 14 septembre 2010

DIY - Memory extension for long-haired people

Hi all,
this post is the first of my DIY serie, it reveals the "geekweller" (geek + jeweller) in me.


It's goal is to realize THIS ! An astonishing memory extension for people !


This not only a hair barrette (or hair slide, I'm not sure of the English for this) but by the mighty power of the Coué method, it is also a memory extension for people !

Let me stress this, it is for people not for your Afghan hound ! It has absolutely no effect on dogs.

So what do we need for this ?

Parts & tools & ...

The most obvious components are a RAM bar and a barrette. The RAM bar used here certainly comes from far in the past, as it was an incredible computer part when the 386 platform appeared. However, the size is perfect and it is symetric then beautiful.

The barrette comes from a broken barrette, but you can find new one in the shops my wife like, like (the expensive) 'Loisirs & créations' in France.

We will need some strong glue, we aim to glue plastic with metal.
Look at your glue's description.

And a heat source and that's all. It can be candle, gas from the kitchen.



Steps

Bending

Maybe there is no spoon but there is somme bending to do so that the RAM bar gets the same curve as the barette.

To reach that goal, I did several trials of bending it above the gas in the kitchen, holding it by the side with tools (plier and pincer). 

If you are above the minimum age for that manipulation, be cool and it will be ok, do not burn yourself and beware of possible fumes.

This step ends when the curves of the barrette and the RAM bar match.


Gluing

Let the bar cool down so not to burn your fingers. Then, glue the bar and the barrette. I used clothespin to do the holding

Admiring

Et voila !  You now have the RAM extension you always desired ! Never forget important things anymore !



Prologue

I am like a red fish sometimes, thus the idea of that barrette but I have short hair :) so I use my smartphone to store data like birthdays, meetings, et caetera ...
All the more I own a Nexus One that has way more memory than that 1 Mb bar :)

I might update this tutorial with more picture if you beg for it in the comments.


Jérôme

vendredi 3 septembre 2010

Wave in a box

Wave open source next steps: "Wave in a Box"

As announced here, the project will contain : 

  • an application bundle including a server and web client supporting real-time collaboration using the same structured conversations as the Google Wave system
  • a fast and fully-featured wave panel in the web client with complete support for threaded conversations
  • a persistent wave store and search implementation for the server (building on contributed patches to implement a MongoDB store)
  • refinements to the client-server protocols
  • gadget, robot and data API support
  • support for importing wave data from wave.google.com
  • the ability to federate across other Wave in a Box instances, with some additional configuration
This is fantastic. This means possible company-wide + company-only Wave servers.
Very good ! A nice start for a friday today !

Most of the world will not care but "robot support" means that the time I spent on the WadRobotFramework will not be have been wasted. 

Jérôme / Wadaël

- page 2 de 4 -