Off the record

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

mardi 23 janvier 2007

Les favorites sur Flickr...

Voila, j'ai une petite place sur flickr explore ! Loin loin loin de la première place, mais ça fait plaisir quand même : 333/500 et 416/500...Peut mieux faire 8-)



Sinon ça faisait un bout de temps que je n'avais pas publié la liste des photos les plus vues/favorisées/commentées...->la suite !

Lire la suite

vendredi 19 janvier 2007

En bref.

last.fm fonctionne super, mais il a des concurrents : Pure Volume par exemple, pourraient lui faire du tort...
De même du coté du social networking, même si la vague MySpace (myspace sur wikipédia ) n'a pas vraiment atteint la France, 4,46% du trafic internet aux états-unis a été généré par ce site en Juillet dernier selon mashable, qui nous renseigne également sur le nombre de personnes inscrites sur Myspace début août, c'est à dire le nombre de personnes ayant créé leur profil et leur blog sur myspace : 100 millions...
C'est quasi inimaginable. Pourtant un certain challenger nommé virb.com semble vouloir rafler sa part du gateau. A suivre.

jeudi 18 janvier 2007

Panorama avec Holga

L'art du panorama est difficile, et il faut faire quelques essais avant de réussir quequechose de correct.

  • toujours de gauche à droite, sinon...les photos unitaires seront dans le mauvais ordre.
  • Cette rêgle intêgre seulement le fait que l'image est transformée par une symétrie centrale, eg le soleil en haut à droite se retrouve en bas à gauche après passage par la lentille. Cependant, cela est valable pour la configuration de lentille du Holga, mais pas forçément pour d'autres appareils, il faut donc tester avec l'appareil ouvert et un calque en lieu et place du film afin de voir si l'image est ou non inversée.

Un chouette exemple... et un autre.

lundi 15 janvier 2007

Mock objects

Let's say you are a programmer.
Let's say you are aware of the traps a big IT project can fall into, and you decide to adopt a test driven approach.
On the next day, you find out that this huge (900 md) part of the code that is done by this other contractor will not be delivered until 2009, and of course you need this part to test your code...Treat yourself and build a mock object that will simulate the behaviour of the missing part of the code !

Wikipedia says you normally need this (these) mock object because this damn contractor code :

  • produces non-deterministic results like current time or current temperature
  • has states that are difficult to create or reproduce (e.g. a network error);
  • is slow (e.g. a complete database, which would have to be initialized before the test); (You don't run a test that is slo 100 times a day...especially if you have 100 tests like this one 8-O )
  • does not yet exist or may change behavior;
  • would have to include information and methods exclusively for testing purposes (and not for its actual task).

A proper conception of your mock object will be the following :
Upon a commonly agreed interface with the ... contractor :

  1. he builds his code
  2. you call the interface to interact with his object
  3. you buil a mockup implementing the interface, who will act in the same way as the other guy's code
  4. you deliver !

Ok, but a test class can do the job, why would i want a mockup?
Probably in the cases where you interact with some objects that are complex to mimic (you do not want to build them in messy test cases), when these objects are slow to build, or cost time to calculate (remember a big project usually involves a suite of hundreds of test, and the suite needs to be run fast...), when you need to test states like DB is down, but you do not want to stop the db to run your test ;-)

vendredi 12 janvier 2007

2 minutes db+ user creation

Where is this damn script supposed to create a database and a user with all the rights on it? Well here, it should work with almost all the db you use for dev purposes (Oracle, MySQL, HSQL...) :

create database myDB;
grant all on myDB.* to 'myUser'@'localhost' identified by 'myUser' with grant option;
grant all on myDB.* to 'myUser'@'localhost.localdomain' identified by 'myUser' with grant option;

vendredi 5 janvier 2007

Retrieve LDAP informations in BEA Portal

The object ProfileFactory delivers user profiles based on the user name and the group name, however, the group seems to be optional so far...
From there, you can access all the LDAP properties (permitted by the login/pass provided by Weblogic...) !
For instance, if we want the userTown field, "request" being a HttpServletRequest Object :

ProfileWrapper p = ProfileFactory.getProfile(request.getRemoteUser(), null);
p.getProperty("LDAP_RepositoryName_In_BEA", "userTown");


That's it.
Nota, from version 9.2 on, an entry point to the user segments is provided in the API !