The Decommissioning of Ashtrays

Ellen spotted this – excellent – letter from The IT this morning:


Madam, – In announcing the commencement date for the workplace-smoking ban, has Minister Martin fully thought the matter out?

Not a word have I heard about what must be one of the most important aspects of its implementation – namely, the decommissioning of ashtrays.

Will the Minister confirm that he intends to set up an independent body (with appropriate powers of search and seizure) to supervise the disposal of these soon-to-be-redundant objects? Following State-wide collection of tens of thousands of them from pubs, restaurants and offices, they could perhaps be displayed on the plinth at Leinster House where he, and we, would see tangible evidence that they have permanently been put beyond further use.

Some should, of course, be retained by the National Museum for the enlightenment of future generations. – Yours, etc.,

BRIAN GAFFNEY


 
---

My Brand New Friend

Irish Dictionary

No, just kidding…

 
---

Interview With Myself

As I looked into the mirror, looking at my red eyes and pale face, I said to myself: “You should really go to bed earlier.” Last week, I went to bed at 3am every single night and my body happily followed that hectic rythm. The result is just what you’d expect: I was unable to sleep before 4am. Not to say that was a pretty tough Monday morning when I had to fight with my alarm-clock around 7.30am… Anyway, as I just cannot seem to think straight, I decided I would interview myself to collect my own thoughts about Weblogism.

Q. Hello, seb, you look damn tired.


A. (sighing) Don’t even mention it, I’m just shattered.

Q. Do you mind me asking what you’ve been doing to look so crap?


A. May I remind you that c*** is a fairly rude word?

Q. Oh, excuse my French.


A. No offence. Anyway, to answer your question, I’ve been working on sites, including Weblogism. For the moment, the site online is just an early release, still to be finished.

Q. What’s your opinion so far about your site?


A. Well, too blue, I’m afraid. I had done the layout at some late hours of night a while ago, and now that I stare at it right now at work, I just cannot help but thinking that it’s darn too blue. Apparently, the lettering is also somewhat too small. That’s a pity because that’s probably the only thing I’m quite happy with.

Q. So everything’s not that bad…


A. Oh God no! Weblogism has just reached its aim: teach me how to develop a web site in a proper and satifying manner. It uses a tableless design – pretty fashion, eeh –, URL rewriting to have nice and human-readable addresses. I still have to add lots of functions that run in my head, but so far, I’m not that unhappy with it.

Q. Do you think there’s anyone reading those lines out there?


A. (smiling) I must admit I have no clue. I don’t look at the stats. It looks like people are being a bit pissed off – oops, beg your pardon – irritated by the fact I write in English. They think I just show off. Don’t know what the heck I could be showing off…

Q. Just one last question: don’t you think writing a blog is just a narcissistic thing to do?


A. Well… I guess you’re allowed to ask and I’m sure every blogger on Earth just wonders why he does blog. Of course, I think it is narcissistic but still, I think some of the things I write in there interest some people.

Q. Fair enough. What about we grab a coffee right now?


A. (cheerful) Good thinking, Batman!

Comments [3]

 
---

The Wall

I had to use this striking Pink Floyd-like Reuters photograph.

A boy reaching for a high wall in the West Bank.

 
---

Dealing with Vanished Pages

I use URL rewriting for the site I’m currently working on in order to both provide the users with more user-friendly addresses and improve results in search engines queries. However, since all the URI have been modified, I have to take into account :

  • that the users may have kept the former addresses in their bookmarks,
  • that the search engines still index the former addresses.

I have therefore been led to create a plain custom Error 301 page to deal with those two problems. It is not finished yet since it must still make the difference between the two cases, but it does a great job so far for redirecting the user on the right track – and the right page.

First of all, I added in my .htaccess file the former pages to associate them with the error 301:


RewriteEngine On

#Former URI
RewriteRule ^(.*)plan.php$ http://mydomain/?a=plan [R=301]
RewriteRule ^(.*)accueil.php$ http://mydomain/ [R=301]
RewriteRule ^(.*)rdv.php$ http://mydomain/?a=rdv [R=301]
[…]

Those pages are redirected with a 301 error code.

Then, I must specify the address of my brand new 301 error page:

# Any other name would suit better, I guess
ErrorDocument 301 /301.php

And here’s what I do so far in this page:

<?php
$uri_deplacee = $_SERVER['REQUEST_URI'];
$nlle_uri = "";
$prefix = "/";
if (strpos($uri_deplacee, "news.php") > 0)
{
ereg("id_news=([0-9]*)$", $uri_deplacee, $regs);
$nlle_uri = $prefix."news,".$regs[1];
}
else 
{
switch ($uri_deplacee)
{
case $prefix."plan.php" : $nlle_uri = $prefix."plan"; break;
case $prefix."accueil.php" : $nlle_uri = $prefix; break;
case $prefix."rdv.php" : $nlle_uri = $prefix."rendez_vous"; break;
default: break;
}
}
?>

The first if checks if the page is news.php which is a page displaying the news item whose id is provided by the query parameter id_news. Since the news pages now call the news this way: http://mydomain/news,45, a little regexp is necessary to strip all the useless bits and find the id of the news to build the new URI. The else is a plain switch to redirect to the right page. I’m sure there is a way to use the URI used for the redirection in the .htaccess file, but I haven’t thought that far yet.

Then, the page displays a little text warning the user and redirects towards the right page thanks to the following meta:

<meta http-equiv="refresh" content="3;URL=<?=$nlle_uri?>" />

Don’t forget to provide the user with a link to $nlle_uri as well, just in case the redirection wouldn’t work.

The next step is to analyse the referer to the page, in order to know whether the user came here via a search engine or simply because of his/her outdated bookmark. More refinements to come, then.

 
---

<em>Bloody Sunday</em> Inquiry to Hear its Last Witness

After 4 years, the Bloody Sunday inquiry is to hear its last witness today, the 919th. Journalists, politicians (like Martin McGuinness and Edward Heath), members of OIRA and PIRA, soldiers gave evidence and the hearing transcripts, all available on the Internet, are 14 million words long. The report is not expected to be released before the end of December 2004.¶

 
---

Redundancies: <em>Épilogue</em>

I never quite mentioned how it all finished. Very sadly, by all means. The 171 all received their letters telling them to go away (“Well done, thank you and don’t forget to shut the door, will you.”). In my department, we used to be 85. We were cut down to 70, and at the end, with all the people sent somewhere else, we have reached the really amazing figure – for share-holders, that is – of 35. A drastic 40 and odds per cent cut. The consequences are somewhat pathetic: when a course is due, which happens from time to time, I have to print the documents myself, set up the machines and so on. I wonder when I’ll be asked to clean the toilets and to check the IDs at the entrance…

I’ve been lucky “enough” for not leaving. But this all looks like a temporary relief to all those remaining. I think I need a bit of fresh air; I’m flying to Stockholm tomorrow afternoon. I guess I deserve a longer weekend after all the work I’ve done to improve a Struts course. Geez, this all sounds so boring. Probably because it is.¶

 
---

11.02.04

,

<acronym title="Flash of Unstyled Content">FOUC</acronym> – Watch your Mouth!

I was wondering why some sites were adding empty in their (Amongst those, bBlog’s templates I’m working on at the moment)… Nosy person that I am, I quickly stumbled upon BlueRobot which explains what FOUC is (Flash of Unstyled Content, no connection whatsoever with Janet Jackson). You probably have noticed it before without really paying attention to it: the page appears without any style applied and then the style goes into action (For the herd of French-speaking readers that might be willing to know more about FOUC in their mother tongue, go there).


According to BlueRobots, this occurs with IE when the @import rule is used to import styles – even though I’m pretty sure I experienced it while using Mozilla on that very same site, which uses two style sheets: the first one (default one) is applied and the pages look white and then my styles are applied and it all becomes normal.


That solution to that problem is fairly simple, though I’m not quite sure I understand why it works: add a
<SCRIPT> or <style> afterwards. And here is my mysterious empty tag entering the scene! Unknown solution to an unknown problem, woaw, it’s been a heck of a day!¶

 
---

The Fox is on Fire

Mozilla Firebird becomes Mozilla Firefox – to be pronounced with a hot spud in the mouth. The logo is quite nice, somewhat reminiscent of the eye of the lizzard, dinosaur, whatever, in small sizes (Cf. the favicon on Firebird, sorry, fox website). It shows a fox wrapped around the globe, the tail on fire. The globe is politically correct enough for not displaying any particular continent or country, but instead some imaginary wonderland on a blue planet. I like that.

Anyway, the animal – we don’t quite know anymore whether it’s a monster, a legendary bird, or a goupil, all those brand faces just induce confusion at the end of the day – provides us with the version 0.8 and the following new features:

  • A powerful new download manager that makes tracking multiple downloads easier;
  • Numerous improvements to bookmarks handling […];
  • Improved handling of extensions […];
  • An easy to use installer for Microsoft Windows users;
  • A new default theme for Mac OS X users that integrates seamlessly with the OS X desktop environment.

Have a nice trip, you guys.¶

 
---

Disconnected

It’s not until you cannot access freely to the Internet that you realise how much room it takes in your life. I have not posted in here since “last year” just because of that: my modem has just decided to give up when I came back from holidays at the beginning of January. When I came back home, all lights were off and my computer desperately refused to go online. My ISP is that efficient that I’m still waiting for another modem today.

2004 has started in Belfast, where I used my brand new digital camera for the first time. I also got to go to Kilkenny to celebrate this new year with a good pint. All this should be online some day, as soon as I get a connection back. Kilkenny is a really nice place, I must say. We stayed in a lovely B&B, just outside the City Centre and got to see a fair bit of the place, even though it was pretty misty.

Anyway, as soon as everything is back to normal, I should be back to work to provide you with the most useless posts ever. “Just a cause”. And until then, you may have a look to a post I could have written myself, having come across the same problem quite a few times without even trying to solve it. I am also looking at JSF, at the moment, so I might bother you with quite a few remarks about them pretty soon.

If you are more into politics, a quick look there might be worth it.¶

 
---

“’Cause We All Shine On!”

As blogs are appearing here and there, someone out there decided it was time to give a bit of “humanity” to this cornucopia of faceless sites. And this someone came up with XFN, a way to link to people’s site and specify your connection with those people. This can be done by simply specifying the rel in the &lt;a&gt; tag.

Pretty simple. Let’s take Nidhogg’s blog. If I were to use XFN to show my connections with him, the link would become:

&lt;a href="http://stup.org/blogs/nidhogg" hreflang="en" &para;
title="Yggdrasil: Home of Nidhogg" rel="friend met" &para;
accesskey="n"&gt;Nidhogg&lt;/a&gt;

Let’s imagine for a sec I have a crush on a Tatiana. I link to her blog, specify a rel attribute such as crush friend met. If on her side, she links to my blog with acquaintance met, there might be a chance that our blog-based relationship might not work. On the other hand, should she write that she has a crush on me as well, a web-service could alert us both about our mutual feelings and thus help us start a wonderful story.

Beyond this somewhat flowery picture, the interest of this feature is to go deeper in the linking between weblogs. So far, the existing links define and highlight a common interest (what you talk about interest me, I link to your page to show this interest, like “subscribing to a RSS feed shows a commitment to reading what someone else writes.”*). XFN describes more precisely the “nature” of this link, allowing the reader to know about the relationship between those two blogs – and therefore “analyse” the way information might be exchanged between them. Well, that’s the conclusion I came to, because otherwise, I really can’t think of what use it could be.¶

* I goddamn know I’ve read that on another blog but I just cannot find which one anymore. Sorry to the original author, I’ll do my best to find him/her back.

 
---

.Net: Give Me My ID Back!

Working as a designer on a .Net project must be hellish, I thought yesterday as I was struggling with label tags. The “official” web-designer was lying sick in his warm bed and I had to do the job on my own. And that’s how I came to design a form with .Net.

The label HTML tag is handy. When used with the for attribute, the normal behaviour is to position the cursor in the associated field when clicking onto the label. The for attribute must contain the id of the associated field to get this behaviour. But the thing is that .Net rewrites the id of the fields to meet its purposes: thus, the id for the text field you initially called “MyTextField” becomes something like “MyWonderfulUserControl_MyTextField”. And the label no longer works.

The same problem occurs when you want to work with JavaScript. When using getElementById, there’s no way you’re going to find your element since its id has changed. The only fix I came up with was to get the elements with getElementsByTagName, and then check if the name contains the original id:

var label = document.getElementsByTagName('label');
for (i = 0 ; i &lt; label.length ; i++)
{
    var tmp = label[i];
    if (tmp.id.indexOf('MonLabel') &gt; -1 ) {
     // do something, silly billy...
    }
}

That being said, I’m no .Net expert, there might be something I am missing there. At the end of the day, the thought of .Net playing with ids leaves me somewhat bemused.¶

 
---

<abbr title="PHP: Hypertext Preprocessor">PHP</abbr>: <abbr title="File Transfer Protocol">FTP</abbr> Recursive rm

As a contributor of Webmasters-fr.net couldn’t make his recursive FTP rm work, I began to look at the examples provided in the PHP manual… I couldn’t make them work either.

That’s why I ended up rewriting the ftp_rmAll, and it now works fine on my FTP server. I still have to play around to make sure it does work in any situation, but here is the code:


function ftp_rmAll($conn_id,$dst_dir){ if (!@ftp_chdir($conn_id, $dst_dir)) { die(“Couldn’t change directoryn”); } $ar_files = ftp_nlist($conn_id, “”); if (is_array($ar_files)){ // makes sure there are files for ($i=0;$i < sizeof($ar_files);$i++){ // for each file $st_file = $ar_files[$i]; // don’t care about . and .. if ($st_file != ‘.’ && $st_file != ‘..’) // check if it is a directory if (ftp_size($conn_id, $st_file) == -1){ ftp_rmAll($conn_id, $st_file); // if so, use recursion } else { ftp_delete($conn_id, $st_file); // if not, delete the file } } }

ftp_rmdir($conn_id, $dst_dir); // delete empty directories }

$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

ftp_rmAll($conn_id, “/repertoire”);

 
---

15.12.03

,

Accept-Language in Firebird

I was a bit surprised this morning to realise you cannot modify your accept-language settings in the options panel with Firebird. It looks however like a basic feature to be able to tell your browser in which language you would like to view the pages you are calling.

Luckily, Google answered quite politely to my question and brought me to that link (well not quite there, first to the W3C i18n page which was recommending TTLO extension). I immediately deleted that en-us entry which is useless to me and put fr as my first choice as I usually do with my browsers.

I’m quite curious to know the reason behind that: why would Firebird people decide to leave out such a feature which has become essential on today’s Internet? They are obviously not aware of a site like this which automatically displays its homepage in the language specified by the browser (also, on this site, everything you wanted to know about encoding). It’s a bit as if a tour operator decided to send a bunch of French tourists on a trip with an English-speaking guide to visit French monuments. Ridiculous.¶

 
---

Sankta Lucia i Stockholm

Spend the 13th of December in Stockholm is something you have to do some day. It is really amazing. I’m just back from there and I must say it’s been one of the most amazing days I’ve spent so far in Sweden. Lucia was a saint from Sicily and was celebrated on the 13th December under the Julian calendar, which happened to be the shortest day of the year and therefore light was coming back from that day on. The fact that her name is close to the word “ljus” (light) in Swedish must be another reason for her popularity in Sweden – she must be the only Catholic saint celebrated in Sweden, as far as I know… Anyway, when you go around in shops, you come across groups of people singing, amongst whom stands a girl dressed in white, with a red belt and a crown of candles on the head. The finest Lucia must have been Ellen who happened to be the one for her company.

I’ve had the chance to go to the Luciakonsert in the Globe which is a huge building for ice hockey matches, and that was simply amazing. Hundreds of kids all carrying a candle and dressed in white entered in the dark, singing Christmas songs and the famous Då i vårt mörka hus, stiger med tända ljus, Sankta Lucia. The acme was the entering of Lucia, carrying a crown with candles and walking till the middle of the stage: really moving. And then dances and more singing with even more light entering the Globe, this all finished with the building of a big virtual Christmas tree made of steel rings onto which all the kids came to lay their candles.

Another thing to do in Sweden is, BTW, go to a ice hockey match, but that’s entirely somthing else and a somewhat different atmosphere!¶

 
---

← Older Newer →