Perl weirdness 2010#001

Perl keeps impressing me (negatively) with weird stuff such as implicit context and so on....

but that one is really out of the ordinary...

prompt~/ perl 
print "-------\n\n";
my $x = 'hostname1.foo.net';
$x->{'datacenter'} ||= '__';
use Data::Dumper; 
print Dumper $x;
print "x".$x->{'datacenter'}."x\n";
my $y = 'hostname1.foo.neT';
print "y".$y->{'datacenter'}."y\n";
my $z = 'hostname1.foo.net';
print "z".$z->{'datacenter'}."z\n";
-------

$VAR1 = 'hostname1.foo.net';
x__x
yy
z__z
prompt~/ 

first, I thought calling ->{} on a scalar/string would crash. to my surprise, my program passed. so I wrote this test only to learning something even crazier about perl. couldn't this be a security issue?

Posted in , , , , | Posted on 30 Mar 2010 14:11by somekool | 2 comments

my Blog is back up !!!!

After several server "hick ups" my blog is now back online ! Well, it never got offline, but dreamhost is not so generous on RAM and my blog was asking for more and more, thus I had to move it. I still think dreamhost is a nice place for hosting your stuff but I am sure you know that, at some point, you might need something more dedicated to your business... So my blog is now running on my own server, I also upgraded it to the latest typo (from 4.0.3 to 5.4.1) and it feels good to be able to type here again without fearing crashes....

And just so reading this is not entirely a waste of time, here is for your viewing pleasure one of my favorite Internet classic video....  

 

 

Posted in , , , , , | Posted on 28 Mar 2010 21:41by somekool | 1 comment

my Blog is back up !!!!

After several server "hick ups" my blog is now back online ! Well, it never got offline, but dreamhost is not so generous on RAM and my blog was asking for more and more, thus I had to move it. I still think dreamhost is a nice place for hosting your stuff but I am sure you know that, at some point, you might need something more dedicated to your business... So my blog is now running on my own server, I also upgraded it to the latest typo (from 4.0.3 to 5.4.1) and it feels good to be able to type here again without fearing crashes....

And just so reading this is not entirely a waste of time, here is for your viewing pleasure one of my favorite Internet classic video....  

 

 

Posted in , , , , , | Posted on 28 Mar 2010 21:41by somekool | 1 comment

Firefox taking 1 gigabyte of ram

well, I must admit, it rarely pass 150MB in normal circumstance... I just thought it would be fun to push it further up. I could have waited more but I was tired. As funny as it may sound, my 2GB ram WinXP system did not suffer too much from it. Eventually I should try to max up the ram entirely see what would happen.

firefox taking 1GB of ram

Posted in , , | Posted on 30 Jan 2008 07:43by somekool | 3 comments

Une idée de fou pour un jeu télévisé

De plus en plus de personne sont soit bilingue ou trilingue. Ca serait cool si un jeu télévisé permetterait à ces talents de s'affronter en public.

Un participant trilingue qui parlerait, par example, les langues A, B et C se présenterais au jeu télévisé dans le but de gagner une certain sommes d'argent. Le programme se devrais de trouver une personne qui parle la langue A, une autre qui parle la langue B, et ainsi de suite.

Le participant devrait entretenir une conversation avec chacun d'entre eux au même moment sans distraction jusqu'a ce qu'une erreur se produise. Au quel moment il serait maintenant le tour du participant prochain. La meilleur performance gagne.

Tags , , , , ,

Posted in , | Posted on 10 Jun 2007 20:40by somekool | no comments

Is this art? what does it makes you think?

Is this art? what does it makes you think? comment below

art?

Tags , , , , , ,

Posted in , , , | Posted on 10 Nov 2006 00:07by somekool | no comments

Les toilettes au Japon

J'en ai deja parler au par avant. La salle de toilette (a ne pas confondre avec la salle de bain), toujours place au nord, elle est consider la piece la plus sale et degueulasse. ceci dit, a chaque fois que j'y vais ca sent toujours etonnament bon et reste extremement propre. serieusement, jai jamais sentie de truc pareil au paravant.

Tags , , , ,

Posted in , , | Posted on 21 Sep 2006 04:17by somekool | no comments

Bad programming practices(tm)

Your coming into a forum or an IRC channel, you ask a simple question, yet uncommon. and people are screaming. “Stop, Don’t do it!”, “it’s evil”, “these are bad programming practices, prove me you can’t do without”. And such, before you had time to say more than two lines.

But why is everyone trying to preach absolutely nothing without knowing a thing. They have no clue what I am working on. What would I do with this bit of information and what particular problem I’m trying to solve. but yet, they know it’s evil and I should not do it. Hell, I’m not even sure what I’m gonna do yet. I’m looking for different solutions. What exactly is evil? I have not thought of anything yet.

for people who know C and used to pointer basics have a quick look at the following example.

void foo(&var) {
  var = 42;
}
x = 0;
printf("%d\n", x);
foo(x);
printf("%d\n", x);

I was simply asking if passing a variable by reference in such a way would also be possible in [Ruby](http://ruby-lang.org). I have been refered, among other things, to an excellent page documenting [Ruby bindings](http://onestepback.org/index.cgi/Tech/Ruby/RubyBindings.rdoc/style/print). I am not sure yet if bindings is the only way to go in order to achieve something as simple as this. but what I do know, though: “ITS EVIL”…

actually, I knew Ruby bindings before. But I wanted to use something simpler, more embedded into the syntax. I thought hearing something different, more C-like that I could use. but getting actual help through all the flames was a challenge on its own. so it’s all I got.

yet, I’m not sure I’ll use it for my particular problem, for one, I was looking for something different and for two, well, its EVIL apprently. And god knows I don’t do EVIL ;)

I got another example, this one happen few months ago. I’m heading into the ruby channel again asking for a ruby+japanese related questions. no anwser, total silent. I figured nobody knows as they are almost all english and don’t deal with japanese stuff. but since Ruby programming language in born in Japan and the japanese community is quite active, I thought asking in Japanese. suddenly I got an answer.

the first one, in japanese was simply answering my question. politely and perfectly. the second one? just english screaming. “This is an english channel, talk in english, this is not a japanese or internation channel, stop, its EVIL.”

god, what the hell. you use computers and ruby you should at least appreciate the multi-cultural side the internet offers us. well, he was probably scared I was flaming about his grand-mother. what else could I think?

anyone has a decent explanation for such behavours? am I the one who is weird/wrong?

Tags , , , , , ,

Posted in , , , , | Posted on 12 Sep 2006 02:01by somekool | no comments

Yes I do think so too

[ no need to say anything ]

cheeseburger

Tags , , ,

Posted in , , , , , , | Posted on 21 Jun 2006 16:23by somekool | 6 comments

Microsoft Sound

Would everyone please shut their Windows start up sound. PLEASE !!!!

Tags , ,

Posted in , , | Posted on 15 Jun 2006 17:59by somekool | no comments

Personal Links

Categories

Archives

Tags

Subscribe

Important Links

Green Web Hosting! This site hosted by DreamHost.

Related advertising

Copyright © Mathieu Jobin's Life and Thoughts

Tech Blue designed by Hive Designs • Ported by Free WordPress Themes and Frédéric de Villamil Powered by Typo