One of my co-workers was asked to colorize an excel file. The task is simple but fastidious: for each row that has the value of the column `status' equal to 0, the background should be in red. If the value is 1, it should be with a pink background. Other values should be left untouched. The spreadsheet file contained about 2000 rows, and the order of the rows should not be modified.
I first thought about a macro to perform the task, but if I show her how this tedious task could be done that way, she would come to me everytime she think a task could be achieved by using macro, and she's not geek enough to learn how to write macros. Two more thinkings and I come to a simpler solution.
The first thing to do is to add an additional column to the table. It is called rank and have the value 1, 2, ... and so on incremented by 1 to the number of rows. It's very simple with Microsoft Excel to create a column with values autoincremented by 1: simply by writing 1 on the first row, 2 on the second, selecting these 2 cells and enlarging the selection to the entire column by dragging down the bottom-right corner of the selection. This additional column will help us preserve the original ordering of rows. Next thing is to select the entire sheet, then order it by the column status. All rows with the value 0 or 1 for the column status are now grouped. They can be selected respectively only once by dragging the mouse on the line number column. After having applied the color attributes, I just have to reorder the entire sheet by the column rank I created to get the initial ordering of rows, and to finish, I have just to remove this column and voilà.
The most pleasant thing is that the co-worker understood perfectly all the manipulations I've showed her. And I understood that writing cool and smart macro codes is not always cool and smart; many times, I just need to keep my thoughts simple and stupid.
Since the release of Mozilla Firefox 1.0 in late 2004, and when Firefox got more than 10% of marketshare, the second browser war was announced. The simple term "Browser war" benefited the users in different ways.
But it seems like this war has reached its summum on the month of june 2008. If it hasn't yet really started, then june 2008 is its beginning, and if it has already begun, june 2008 is its hotest period, at least so far.
Safari 3.1.1 was announced to be the fastest web browser on any platform
, as it loads pages up to 1.9 times faster than Internet Explorer 7 and up to 1.7 times faster than Firefox 2
. Safari 4 increases again Javascript performance by 53%. Since Firefox is also about to release the version 3, more performant in term of speed, seeding Safari 4 to developers seems to be Apple's answer to maintain an aspect of the browser war: tha browser speed race. Arul N S says Safari 4's Javascript engine, Squirrelfish will be faster than SpiderMonkey, the Firefox 3's engine.
Less than a week after that, and less than a week before Firefox 3 final is scheduled to be released, Opera releases the version 9.5, emphasizing on keywords web standards and speed and performance, again.
Mozilla found the most exciting idea for the release of its Firefox 3. It's the Download Day 2008: the goal is to set a Guinness World Record for most software downloads in 24 hours. At the time of writing this post, 75 minutes before the hour H, (1.702.903) 1.721.775 pledged to download it during that day.
Internet Explorer 8 beta 2 will be released soon, probably between July 1st and September 30th. It could also be released during this month of june, who knows.
According to the w3schools statistics, the winner of the browser war is still ... Internet Explorer who had 54.8% of the marketshare in April 2008. Mozilla and Firefox get about 40%, Safari has only 2.2% and Opera 1.4%.
According to my stats, ie the visitors of my site, the result is a bit different: Mozilla and Firefox has 51.73%, Internet Explorer is at second position with 44.20%, Safari has 3% and Opera 1%.
One thing is sure, however: Mozilla's market share is constantly increasing, gaining more than the other browsers, and Internet Explorer is, on the other hand, constantly decreasing day after day.
To predict the future, I see Internet Explorer going under 30% in the next 12 months, Mozilla Firefox will grow up to 60%, Safari will get 10% or less, Opera will stay at 1%, unless it choose to go opensource.
Today, my task is to receive from the iSeries a huge table (500 Mb in the CSV format). Although I have a so-called ADSL connection, downloading this file through Client Access would take hours (about 8 hours I presume).
The solution is to compress the file before transfer, then decompress it on Windows. But, I didn't know how to compress data on the iSeries, in a format that can be decompressed on Windows. After searching, I finally found that I wouldn't need to download or install anything to the iSeries. Hope this post can help someone.
Everyone knows how to do this : It's the command CPYTOIMPF which I've used to create a CSV format of the database, directly to the iSeries' IFS. This is how I did it :
CPYTOIMPF
FROMFILE(MYLIB/MYFILE)
TOSTMF('/home/mycsvfile.csv')
MBROPT(*REPLACE)
STMFCODPAG(*STMF)
RCDDLM(*CRLF)
FLDDLM(';')
Before we will compress the text file, it is really important to convert the file to have a CCSID that your Windows program could read. Have in mind that, when you will compress the text file, the compressed file you get is somewhat another binary file. If you download a text file by ftp, your transfer will be in text mode, and an implicit conversion may occur, so you don't have to bother about character set conversion. But while the ftp client will see the compressed file as binary, it cannot do the implicit conversion anymore. You will be able to download the compressed file and decompress it, but the decompressed file may be in an EBCDIC encoding.
What you need to know is the respective CCSIDs of your file in the iSeries and of the decompressed file on Windows. On iSeries, it is generally your job's CCSID. If you don't know, you could use the command WRKLNK '/home/mycsvfile.csv', then use option 8 to display it. On Windows, you may wish to use the iso8859-1 encoding, which have a CCSID value of 819. The other commonly used encoding is UTF-8 Unicode, which has a CCSID value of 1208.
A simple command to perform the conversion is CPY.
CPY
OBJ('/home/mycsvfile.csv')
TOOBJ('/home/mycsvfile.pcformat.csv')
FROMCCSID(37)
TOCCSID(819)
DTAFMT(*TEXT)
To compress the text file, we use the jar tool in QSHELL. If you didn't never use QSHELL (this was the first time for me), QSHELL is like the console on Windows® or Unix. To start it, just type STRQSH. You'll get a screen like this :
QSH Command Entry
$
===>
F3=Exit F6=Print F9=Retrieve F12=Disconnect
F13=Clear F17=Top F18=Bottom F21=CL command entry
All we need is then to go to the IFS folder where we put our text file, and launch the jar command there.
cd /home jar cvfM mycsvfile.jar mycsvfile.pcformat.csv
When compressing is finished, you can type F3 to exit the QSHELL environment.
The compression ratio is generally above 90% because it's just text file, and it is rarely below 75%. I was able to reduce the size of my download from 500 to 24 M Mb. On Windows®, I use the opensource software 7-zip to uncompress the jar file.
The whole process can be done in batch. QShell can perform tasks in batch, as long as those tasks don't need any input from the user.
Previously, we invoked the QShell "console" without parameters to begin an interactive session. Now, in order to perform any tasks in batch, we supply a parameter CMD which is a string representing a semicolon separated QShell commands.
But, a precaution to take is to remove the v modifier in the jar command. So, we will change cvfM to cfM. The v standed for verbose : it allowed the interactive session to display useful informations about the compression process, but it also required an input from the user after the process has finished. To conclude, this is the CL command that create the jar file in batch :
QSH CMD('cd /home; jar cfM mycsvfile.jar mycsvfile.pcformat.csv')
Ahhhh, a little final note : QShell may have problems with filename containing special characters like $, @, ... Consider using filename consisting of letters from a to z, numbers and period only.
I used to say Gmail is great, Google apps rock, ... but today, Google has deceived me.
At work, the webmail tab of my browser never closes without my browser. In other words, I receive and send a lot of electronic mails every day, and most of my mails are urgent. The company where I'm working chose the simplest solution for mails: a free webmail service. So, I have a Gmail account as business coordinates.
Today, I got an error during about 6 hours, and the guys at Google call it Temporary Error (502). Temporary?
We're sorry, but your Gmail account is currently experiencing errors. You won't be able to use your account while these errors last, but don't worry, your account data and messages are safe. Our engineers are working to resolve this issue.
Please try accessing your account again in a few minutes.
Temporary? Actually, it lasted for 6 hours, and I don't know yet if it will be available again today. I hope my boss didn't send an urgent message to me. (If he did, I could be fired by not answering...).
Y a-t-il une place pour un nouveau FAI à Madagascar? Hier, mon épouse s'est plainte que la connexion chez où elle bosse, assurée par Blueline soit coupée tout le temps. C'est normal que ça ne va pas, ils n'ont même pas honte d'afficher Site en reconstruction sur la page d'accueil de leur site web alors que ce sont les pros dans le domaine.

De mon côté, cela fait un bail que j'essaie de me connecter au site ohloh et DTS me dit que le site ou le réseau est peut-être hors service. Le site n'est pas hors service car je peux le voir en utilisant des proxies ouverts. Essayez d'envoyer un mail de réclamation à DTS et ils vous répondront quand les poules auront des dents. Essayez de téléphoner, et le dynamique agent vous conseillera d'écrire un mail au service client.

Ce problème semble affecter plusieurs sites aléatoirement, et la durée de ce blocage peut aller jusqu'à plusieurs mois. En effet, un blog auquel je voulais commenter utilisait le service de Haloscan. Pendant deux mois au moins, le fournisseur d'accès m'a jeté ce message d'erreur chaque fois que je tentais d'ajouter un commentaire. Heureusement que les sites affectés jusqu'à ce jour ne sont pas des sites sur lesquels nous travaillons quotidiennement, mais si jamais l'un des sites que nous devons impérativement utiliser soit bloqué, cela finira très mal pour quelqu'un.
Au pays des cons, les FAI sont rois.
After almost 3 years using Vim as my preferred text editor, I continue to learn and to find tips and tricks I didn't see before. I imagine that to become really involved in any software and to really know most of its potentiality, one should become an active membre of its community, through forums, mailing lists, IRC ...
Today, I found out how to make tabulations visible, so, from now on, I can easily see if any source I'm editing isn't following our Coding Guidelines about whitespaces.
Here is the .vimrc settings:
set listchars=tab:.\ : listchars consists of a comma separated list of string settings. The string setting that interests me is tab, which consists of 2 characters to be used to show a tab. The first one is used once to mark the start of the space occupied by the tab, the second is repeated to fill the remaining spaces. Note that, here, my second character is not a backslash, but a space. It needed to be escaped, that's why you see a backslash character here. My tabs are now showing as a dot followed by spaces, so I can count the number of tabs by counting the number of dots.hi SpecialKey guifg=#224488 guibg=#002266: But, I need to make a visual difference between a tab and any dots followed by blanks. For this purpose, I've added a special highlighting for the SpecialKey family, for them to have another background-color. (For this, I edited Vim71/colors/darkblue.vim, as darkblue is the only colorset I use.)set list: This is the clue for showing tabs. Unfortunately, this option made one of my preferred vim setting inactive: the linebreak option which is not used when the list option is on, according to the documentation.And here's how it sounds :
2007 arrive à terme, je vais essayer de faire un petit bilan, bilan personnel de cette trop courte année. Le billet n'est pas du tout intéressant pour ceux qui n'aiment pas le voyeurisme.
2007 a commencé très calmement, c'était un début d'année morose pour moi, et apparemment, pour d'autres aussi. C'était la routine, et à part la routine, rien à dire.
L'évenement personnel marquant cette année est mon changement d'emploi. Depuis le premier juillet, j'ai intégré une nouvelle société, d'une dimension plus petite. Toujours dans le même domaine (programmation sur les mainframes, langage RPG/400, CLP, ...) C'était ma deuxième postulation cette année. C'est une bonne chose de changer d'emploi, mais cela s'accompagne de sacrifices personnels : J'ai vendu mes jours de congés contre un préavis trop court, donc, moins de temps libres, beaucoup moins; j'ai dû bosser plus dur pour arriver à maitriser le langage SQLRPG; le siège social de la société se trouve plus loin de chez moi, et en fin de compte, je dépense plus d'heures au boulot et pour aller au boulot. D'un autre côté, j'avoue que cela donne du tonus de pouvoir reformater son disque dur, de tout oublier sur l'aspect métier de son ancien emploi et de repartir à zéro avec le nouveau.
Ceci expliquant cela, notre petite famille a décidé de commencer la construction de notre futur chez-nous. Une entreprise qui a un peu débuté dans la douleur car le terrain qu'on a acheté ferait l'objet d'une double vente, et que l'autre supposé acheteur s'est manifesté après nous avoir vu sur le terrain faire la fondation et prier Dieu de nous aider dans cette construction.
J'ai pu serrer la main de quelques amis que j'ai l'habitude de cotoyer sur Internet. Ces rencontres IRL étaient quelque chose d'important pour moi vu l'emploi du temps chargé de ces personnes qui passent un court moment à Madagascar. Cela me donne l'air d'être assez important pour quelqu'un d'important. Je regrette de n'avoir pas pu participé à la rencontre Antananarivo miblaogy 4.0 ni aux autres rendez-vous, la précédente section de ce billet pourrait expliquer en partie cette non disponibilité, et j'ajouterais que je ne me considère pas comme un vrai bloggueur, juste quelqu'un qui écrit de temps en temps.
Que de projets en 2007 et dont le but n'a pas encore été atteint.
Mon logiciel de vérification orthographique de langue Malgache n'a avancé que d'un iota. J'ai bien voulu arriver à un brouillon présentable avant la fin de cette année, mais, faute de temps et de disponibilité; il reste encore au stade de fumiciel malgré l'intérêt affiché par les internautes comme Lova, Tattum et d'autres.
La vérification orthographique manuelle d'une biographie en malgache écrite par une amie s'est terminée en queue de poisson. Le nouveau job y est pour quelque chose, mais le plus grave a été la faillite de la société qui hébérgeait mon site. Cette société a fermé boutique, sans préavis, et les données de tout un travail ont été perdues. Cela m'aura appris la valeur et le prix des sauvegardes. J'ai préféré oublier tout le contenu qu'il y avait dans mon ancien site et repartir de rien. Pour cette vérification orthographique, il me faudra une semaine pour réparer les dégats, et cette semaine, je ne l'ai toujours pas eu. A notre rythme de départ, on aurait bouclé le livre avant la fin de cette année...
WikkaWiki, le moteur wiki opensource auquel je participe, n'a pas réussi à sortir la version attendue 1.1.7 malgré (ou à cause de, c'est selon...) le grand travail entrepris par toute l'équipe. On a été contraint de revoir la priorité et de faire des releases intermédiaires à cause des attaques de spams. J'ai peut-être porté la poisse, qui sait?
Notre chez-nous est en cours de construction, une chose de plus d'inachevée. Même une partie du terrain n'est pas encore titrée à notre nom.
Smiley, du haut de ses deux printemps et 2 mois, ne bavarde toujours pas. (Smiley est le pseudo que j'attribue à ma fille quand je suis sur Internet). Elle sait dire "Papa, maman, bebe, masiso, maiaiy" et d'autres mots; elle chante "Petit Papa Noël" et d'autres chants pour enfants, et c'est tout.
A part la mort de Chris Benoit, de sa femme et de son fils (Non, je ne connais pas personnellement Chris Benoit), je dirai que 2007 a été une bonne année, un seul enterrement et deux visites à l'hopital pour ma grande famille. 2007 était un pont vers une année meilleure, une vie meilleure
Dieu, Je te remercie de tout ce que Tu m'as offert au cours de cette année 2007. C'était une bonne année, et bien que je n'ai pas été sage, Tu m'as toujours soutenu et aidé. C'est par ta grâce que je suis là où je suis. Pardonnes mes pêchés et enseignes-moi à devenir meilleur chaque jour. Pour 2008, je Te demande de m'aider afin que les objectifs que je me fixe soient atteints. Donne moi du temps, la santé, l'enthousiasme, la force, Ta bénédiction pour accomplir mon travail et mes travaux. Mais que seule Ta volonté soit faite. Amen.
PS: Je ferai tout pour être de la partie pour Antananarivo miblaogy 5.0
One day, I've created a program in the SQLRPG language, with RPG400 (and not RPGIV). It was something like the snippet shown below, except that it had about two dozens of fields in the SELECT clause.
C/EXEC SQL C+ DECLARE C1 CURSOR FOR SELECT A, B, C FROM T C/END-EXEC * ... C/EXEC SQL C+ FETCH NEXT FROM C1 INTO :A, :B, :C C/END-EXEC
When compiling, I've got the strange SQL0326 error message.
A little command DSPMSGD SQL0326 QSQLMSG shows me that it meant
Too many host variables specified.
I restart counting again and again, but I definitely had the same number of
host variables as the number of fields in my SELECT clause.
Googling didn't help, seems like I didn't have the right search keywords or
no one before encountered this issue. I tried every figure I could imagine,
blindly, and after one day of searching, I finally found the trick!
Some fields in the database had 300 characters length. In fact, they represented in one string an array of 6 50 characters sub-elements. In my program, I declared the variable as an array of 6 elements of 50 charcters long. I thought it as a clever way to get automagically the value of each element, but that was the problem.
In an RPG/400 program, a string variable can have a length less that 256 characters. This doesn't apply to arrays, so, even if the total length of the variable array was 300, the compiler didn't see it as a problem. But at the FETCH instruction, I think fields having a length larger that 256 characters weren't considered. The solution was to, either use SUBSTR in my SELECT clause to limit the length of the strings fetch to be under 256, or CVTRPGSRC to pass to RPGIV, which does not have this limitation.
C/EXEC SQL C+ DECLARE C1 CURSOR FOR SELECT C+ SUBSTR(A, 1, 250) AS A1, SUBSTR(A, 251, 50) AS A2, B, C FROM T C/END-EXEC * ... C/EXEC SQL C+ FETCH NEXT FROM C1 INTO :A1, :A2, :B, :C C/END-EXEC
Pour ma chère et tendre, à l'occasion du troisième anniversaire de notre mariage, ce 30 octobre 2007.
fa izay alehanao no halehako, ary izay itoeranao no hitoerako, ... hataon'i Jehovah amiko anie izany, eny, mihoatra noho izany aza, raha tsy ny fahafatesana ihany no hampisaraka antsika.
Où tu iras j'irai, où tu demeureras je demeurerai; ... Que l'Éternel me traite dans toute sa rigueur, si autre chose que la mort vient à me séparer de toi!
for where you go, I will go; and where you lodge, I will lodge; ... Yahweh do so to me, and more also, if anything but death part you and me.
Et me voici en train de jouer avec blosxom.
J'ai essayé WordPress, et WordPress m'a vraiment plu, mais maintenant, je me tourne vers Blosxom pour plusieures raisons, qui sont, par ordre d'importance (décroissante) :
Après deux heures d'essai, je suis assez impressionné par blosxom, par sa simplicité. J'espère seulement qu'il ne soit pas trop simple pour qu'il y ait des fonctionnalités que j'aimerais avoir et qui ne sera possible qu'en modifiant un peu le coeur du programme. La fonctionnalité qui me vient à l'esprit actuellement est de pouvoir mettre un bon titre à chaque page lue. J'ai remarqué que le titre de la page reste toujours le même. J'ai déjà eu l'occasion d'expliquer en malgache l'importance de pouvoir mettre un bon titre sur une page web.
Polyglot était un plugin que j'aimais bien sous WordPress, je tenterai de chercher si il y a un plugin semblable pour blosxom (quoique je ne suis pas certain d'en trouver), mais je n'ai pas non plus le temps d'écrire le même texte en 3 langues différentes maintenant.