June 2nd, 2008
I wrote an utility class to simplify the configuration of a flexunit testsuite. All methods starting with “test” are added automatically as test cases when the suite is created in the following way:
The ReflectiveTestCase uses reflection to read all “test” methods. In this way you will never forget to add your tests to the suite!
April 27th, 2008
Come passa il tempo, 3 anni fa ho avuto la possibilità di fare il volontario il cinquantenario, quest’anno al sessantenario! Impazzito? No!Da qualche anno ormai mi sono trasferito in Svezia (tutta colpa di Intercultura che nel ‘95 mi spedì in Danimarca facendo nascere in me la passione per la Scandinavia).E fu proprio durante il viaggio da Stoccolma verso la festa di Torino in cui il passeggero seduto al mio fianco aprì la sua cartellina per dare un ultimo sguardo all’invito ricevuto per la festa del cinquantenario.
Quell’uomo era Anders Fernlund, tuttora portavoce di AFS Sweden, il quale mi aprì la strada verso una “nuova” associazione ma con lo stesso nome e gli stessi principi. Da allora mi vanto di essere iscritto alle associazioni di entrambi i paesi e grazie a Quick vengo aggiornato sulle novità di Colle e non solo.Ieri, 26 aprile, AFS Sweden ha festeggiato 60 anni di attivitá e ho avuto l’onoro di lavorare all’organizzazione. Vi risparmio i dettagli della festa ricordando soltanto la presenza di Tachi Cazal e del nostro Simone Caporali.Voglio però con fierezza sottolineare il supporto dato da Intercultura ad AFS Sweden che ultimamente non naviga in buone acque e soprattutto ringraziare i volontari e lo staff italiani per aver dato, negli anni, delle basi così solide alla nostra associazione tali da poter agire come modello e come supporto per altri paesi. Grazie ragazzi, a tutti!(da una lettera a quic, mensile di Intercultura)
April 15th, 2008
It seemed very strange to me that in FlexBuilder you have to tell the context on which a flex application using LiveCycle Data Services will be deployed. FlexBuilder requires you to fill in the “Context Root” variable which will be then saved inside .flexProperties as serverContextRoot. You may want to deploy the same application to different contexts and you don’t want to compile each of them separately. Fortunately, you can override the endpoint value of the RemoteObjects with any value. In my case, I set endpoint="../messagebroker/amf" since my main sfw file resides in a directory called client
February 2nd, 2008
Last week I got 30, and I also got chicken pox. My mother was sure I had already got it when I was very young. She was definitely wrong. I actually thought about publishing a picture of me while infected but then I thought that my reputation could be seriously hurt by such a thing.
Now I have definitely something in common with my little god daughter Stella, since it was her that gave me the infection on her 1st birthday party. I imagine myself in a few years telling her stories about my youth and about how we are linked together by stuff in our blood :-D
I first saw some bubbles on my body last Sunday (day 1) and it was not hard to check on the internet that those bubbles really looked like chicken pox. But my mother had told med… I was immune! I slept very little that night and in the morning a doctor confirmed that I had been infected (it is called vattkoppor in Swedish)
The first two days were not bad, no itchy at all and not so many bubbles, mainly in the neck and in the head. I even kept working from home. But Tuesday afternoon (day 3) I felt that the fever was coming up (38,3) and it never left me, while more bubbles were appearing on my face (and lots of them). I had a long night, showering a couple of time to get rid of the itch (it works).
On Wednesday (day 4), I woke up at 12 with a fever (39,3) which is the highest fever I have ever measured on myself. I used an ice pack and some paracetamol to get it down to 38 in the evening, which felt like normal. During the whole day an headache gave me company.
Yesterday and today (day 5 & 6) I have had no fever and my head has been alright. The bubbles are drying up and the hitch is not a problem anymore, it feels like soon it will be over.
Or at least I will not be contagious, because it will take a while until all my fresh wholes will be filled with skin again ;-) I am so tired of being sick! What have I done? Is this the life after 30? Getting sick every 2 weeks? I already spent 2 weeks of the last month in bed with a fever!
This year I find all excuses for not training for my Vasaloppet. No snow…I’ve been sick twice in january… I just can’t go! Seriously, I think I’ll stay home this year, I need more preparation than I have and I need my body to recover.
January 14th, 2008
An article on Cap&Design, about our filecentral
September 28th, 2007
I’m a big fan of unit testing. Everybody who has been working with me knows it. Unit testing makes you sleep well at night. If you have not understood the advantage of unit testing your code you should really try to do it!
Lately I’ve been working a lot with Javascript for obvious reasons. Ajax is very hype and if more and more websites require a deep knowledge of the Javascript secrets.
Javascript is not hard but some common mistakes can make your development a pain. Projects get larger and larger and you really need to have good tools to help you not having to pray every time you make a small change.
I will not try to convince you to test your code (maybe I will try in an other article) but I will show you a couple of tricks I use when testing my code.
To run the unit tests I use jsUnit which is a port of the famous jUnit. It is pretty simple to install and if you have used jUnit you basically know how to use it.
Javascript is a dynamic language. It means that you can change the prototype of an object after the object has been defined. That means that if you have an object for which a given method is defined, you can add methods on the fly. And you can do for only one instance or for all instances! Let’s give an example:
That was pretty easy and straightforward if you know the basic of object oriented Javascript.
The cool stuff is that you can use the dynamicity of Javascript to make your testing very simple. Mocking has never been easier!
Let’s make and example and test the following object:
The DiscountCalculator object has basically one method which is useful: discountPrice.
“getPrice” and “getDiscount” are two ajax calls that could be implemented with DWR or any other remoting technique. Since we want to run the test without a remote server providing some real values, we have to mock those calls.
Now, lets write our test. This is the specifiation of the test:
“If an item costs 100 and I get 10% discount I will pay 90”
Can you believe it? What I did is to simulate the two ajax calls by changing the prototype of the “discountCalculator” instance. I replaced the “complex” ajax calls with a simpler implementation that returns values which I can control. Do you remember “If an item costs 100 and I get 10% discount I will pay 90”? I just simulate the “if” part mocking my object.
That is pretty cool! To do that in java or in an other non dynamic language it would have needed a couple of other objects around…
September 28th, 2007
Time is up! The innebandy season for Bandydos is beginning next week. If you are in Sweden and want to play innebandy (aka floorbal) please visit our site on playing innebandy in Stockholm
August 13th, 2007
July 10th, 2007
I hade to give my dream of the “Svenska klassiker”. Last sunday I had to give up while swimming the Vansbrosimmning (3 km in open water). I was too slow and after 2 km I was forced to stop.
I really underestimate this race, what a pity.
May 31st, 2007
Today I reached 1000 km of bike training since 1st march! This was the goal I had in mind before the Vätternrunda, the 300 km race I will run in a couple of weeks.
Unfortunately today the weather was the worst weather I have ever biked in. It was not raining but the air was so humid that it felt like.
« Previous Page — Next Page »