googlecharts gem URI::InvalidURIError fixed
Yesterday i was wondering who is right about the URI and as it turns out the culprit is the googlecharts gem. The RFC defines ‘UNWISE’ characters, the ruby URI implementation seem to correctly fail on them and the Google API defines the just the URI, not how it has to be encoded/escaped.
I posted the scary URI regex from the ruby open-uri package which fails to grasp the Google Charts URIs. Debugging such thing is no fun so i went for a quick fix instead and actually could find it in the googlecharts gem. Just replace:
jstize(@@url + query_params.join('&')) from ...ruby/gems/1.8/gems/googlecharts-0.2.0/lib/gchart.rb with:
unwise = []#%w({ } | \ ^ [ ] `)
query_params.each do |p|
unwise.each { |c| p.gsub!(c, "%#{c[0].to_s(16).upcase}") }
end
jstize(@@url + query_params.join('&'))this escapes the ‘|’ (pipe) characters which were causing the exception, like this one:
/opt/local/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?): http://chart.apis.google.com/chart?chdl=requests(cached)|requests&chd=s:Fb9JJfgZ,Fb9KJfgq&cht=lc&chs=300x200 (URI::InvalidURIError)
Technorati Tags: ruby, googlecharts, google, gem, fix
ruby google charts api wrapper, RFC2396 and ruby open-uri woes
UPDATE:found a simple fix/hack for the googlecharts gem
Uhh!, this for sure is one of the more scary regular expressions you normally encounter. Its URI::REGEXP::PATTERN::ABS_URI from uri/common.rb:137. Looks complete, doesn’t it? And still it fails to grasp my seemingly valid Google Charts URL which is: http://chart.apis.google.com/chart?chdl=requests(cached)|requests&chd=s:Fb9JJfgZ,Fb9KJfgq&cht=lc&chs=300x200
It’s the googlecharts gem which creates this URL here(not me!), but than bails out when trying to download an image from it.
/opt/local/lib/ruby/1.8/uri/common.rb:436:in `split': bad URI(is not URI?):...Now, who is right? Google? The URI RFC2396? The googlecharts gem? Debugging such things are the less thrilling moments in life. Besides that, even when bailing out on this one, the googlecharts gem feels good. It offers efortless chart creation and basic cases are already covered, the advanced stuff will follow i think. Go check it out when in search for an easy charting solution. Googlecharts gem felt better to me than the gchartrb which is another wrapper for the same service, but your milage may vary.
have fun
Technorati Tags: ruby, googlecharts, api
nuke the planet!
reminds me to the old alt.destroy-the-earth newsgroup. Now the folks at Los Alamos finally worked out a concept to bring light to darkness without the hassle of an ICBM. Their convenient “portable nuclear reactor is the size of a hot tub”. You just “bury it underground”(see picture corners) and voila! clean green energy for 25,000 Homes.
An annual production of 4,000 unit will be up by late 2012. Great! Oh, just in case you’re worried about security, listen to Deborah Blackwell, spokeswomen of Hyperion:
“Like you don’t open a double-A battery, you just plug [the reactor] in … You don’t ever open it or mess with it.”
Right, just don’t mess with it! Deborah, ever watched a malicious 7 year old while not opening a double-A battery just to find out what’s in there?
But i guess they will solve that easily by only allowing people with an nuclear reactor license to install the hot tub in their homes. As that already works so well to keep hand guns in the rightful hands. The hands of the god loving people, in the land of the brave and the free.
have fun
Fortran for Playstations…?
actually not quite, but i could not skip these. IBM released a Fortran compiler for the Cell processor, thank you. Cell is the CPU which superpowers the PS3 for those amongst you how didn’t knew already. Now i jump and dig up my old medical volumen renderer code and might port it the the Playstation3! But as an old fellow of mine always said: “you can write bad fortran in any language”, and i prefer ruby nowerdays.
Technorati Tags: cell, ps3, fortran, ruby, ibm
my (old) laptop got stolen
the one i used before this macbook. R51 IBM Thinkpad with 2GB Ram, gentoo installed and a “ususal suspect” 21C3 sticker on back of the screen. not nice. i would not mind a miracle to bring it back. It was up and running and connected to the network when it got stolen on friday, 16. feb 07.
Sofameilen!!!???
Belohn´ Dich beim Fernsehen
… mit Sofameilen, dem ersten TV-Bonussystem das laufend während des Fernsehens gesammelt werden kann. Beantworten sie Fragen während sie fernsehen auf dem Display der Betty-Fernbedienung und erhöhen sie ständig ihren Kontostand.
arerrgh, das kann ich aus verstaendlichen gruenden natuerlich nicht unerwaehnt lassen. Ich habe schon lange aufgehoert mich ueber diese leute vom fernsehn zu wundern.
Stupid devices: The Blackberry
Oh yeah, i also became one of those blackberry users. It is a really good on-the-go traveling email device. When last year i was wasting days and days on airports while traveling back and forth to lots of meetings the blackberry gave me back some productivity. Because of the blackberry i could spend the precious time at my desk with getting real things done instead of wading through dozens of mails.
But, the blackberry is a phone, and an organizer, and therefore contains all kinds of smartphone application. And there is an alarm-clock wake-up application you might think. No, it is not. It is an annoyance. First, the meeting calendar can’t be used for wake up because it only pops up a little reminder windows and makes a mellow ‘ping’. Not for me to wake up from. And then there is the Alarm clock. Easily to define your wake up time with the thumbweel and you set you daily alarm. Yep, thats right, a daily alarm, every day. There is no option of only setting up a single alarm for the next morning but only a daily alarm for all days to come. This works perfect for getting you out of the bed the next day. I am kind of sleepy then and normally don’t like to bother to unconfigure the alarm clock. And usually i forget that also for the rest of the day. And this it what kicks me out of bed the day after. The forgotten alarm clock remembers its daily duties and kicks in on 6:45 saturday morning. I don’t like having electronics next to my bed and so i can’t even switch it off from there. stupid device, great email road warrior though.
good morning
Technorati Tags: stupid, blackberry, usecase
The lunatics have taken over the asylum
in Monschau, Germany(the middle of nowhere), “The Web´s most ambitious RUBY ON RAILS Startup” started looking for some fellow ruby coder to kick-off their project. But there is a twist, a big one:
MUST BE BORN BETWEEN JULY 24 AND AUGUST 22 OR NOVEMBER 23 AND DECEMBER 19 AND BE BETWEEN 18 AND 99 YEARS YOUNG
And seemingly the search with increasing despair:
15th Jan: Startup looking for web designer/programmer/co-founder
16th Jan: The Web´s most ambitious RUBY ON RAILS Startup based in Monschau Germany is looking for a Ruby on Rails guru to lead our development team as Co-founder and Co-CEO
and latest to date:
18th Jan: The most ambitious Ruby on Rails project calls for a Rail’s guru to lead team as Co-founder
RoR, TDD, AJAX!, scalable websites, whatever you like, you name it you get it, its all there and you can become “importend” part and development team lead, Co-founder even!
“NOVEMBER 23 AND DECEMBER 19 “, sigh, and so another bright future fades away for me, 16th Nov, misssed by a few days, phew.
oh, and some more requirements are piling up, you won’t make it without
a deep love for humanity and the relentless will to facilitate happiness and emotional fulfilment for all.
yep, ok for me!, but as i said, wrong dates. The position is “Full-Time”, but please keep in mind:
There is no immediate compensation for the first few months. Once the first round of financing is finalized then we will begin paying a salary.
so better bring you own, for the “entrepreneurial” spirit i guess. Me beeing you would contact Gabriella von Schadewitz right away in case i would be more lucky with the stars.
have fun
and oh, don’t forget to check their website: http://simplyooh.com
Hohe Kopfprämie für Studies
Wie auf Spiegel Online nachzulesen war: Holtzbrinck schnappt sich StudiVZ. Die Mergers & Aquisition Manie hat Deutschland erreicht. Für angebliche 100Millionen Euro hat die Samwer Brüder gewuppte Firma den Besitzter gewechselt. Herzlichen Glückwunsch kann man da nur sagen, man sollte meinen die Samwers bräuchten eigentlich kein Geld mehr nach Alando, Ebay, Samba und nun StudieVZ. Und auch unsere amerikanischen Freunde berichten schon, über unser kleines german facebook Derivat, natürlich nicht unbegleitet von hämischen Kommentaren. Wie immer sind meine Informtionen natürlich bloße Spekulation und ich weiss nichts und kenne niemanden der was weiss. Lassen wir uns doch mal kurz ein bisschen mit den Grundrechenarten spielen. Wenn ich es recht entsinne hat Rupert Murdoch 900Millionen Dollar für MySpace bezahlt. Das sind ca. 688.284 Million Euro. Bei 60.000.000 Millionen gesignten Usern zu dem Zeitpunkt sind das 12 Euro pro Nase. Wenn ich nun die 1 Millioen User von StudieVZ mit den 100 Millionen von Holzbrink verrechne komme ich auf 100 Euro pro Student. Daraus ergibt sich das ein deutscher Student 8.3 mal mehr wert ist als eine MySpace Nase. Unter diesem Gesichtspunkt war die 900Millionen USD MySpace Aquisition ein echtes Schnäppchen, wer hätte das gedacht, besser gut geklaut als schlecht erfunden möchte man da sagen. Diese deutschen Medienmanager sind doch echte Blicker. Man erinnert sich, schon die Napster Transaktion war ja ein totaler Knaller, für insgesammt kaum 100 Millionen USD konnte sich damals Bertelsman die totale Kontrolle über den ehemals disruptiven Tauschbörsen Markteinsteiger sichern. Und dank “Bertelsmann plans to introduce … the Bing Crosby Jewish Holiday Collection, Barry Manilow Sings the Blues, Kenny G. meets P. Diddy, Glenn Miller Verve Pipe, and Deepak Chopra Non-Stop Dancing among others. “ war der der deal sicher auch schon kurze Zeit später amortisiert. Und demächst an dieser Stelle rechnen wir dann mal das unvermeidliche YouTube durch und wenn ich Langeweile habe versuch ich mal die VoiceStreams Übernahme der Deutschen Telekom nachzuvollziehen. Ich habe wage in Erinnerung das Ron Sommer damals 12.000 DM aka 6000 Euro pro Kopf gezahlt hat. Das kann doch gar nicht sein? oder?
UPDATE: ich konnt’s nicht lassen und hab mal nachgesehen, VoiceStream/Telekom Übernahme: 23,9 Milliarden USD bei 2.3 Millioen Kunden macht eine Kopfprämie von 10400 USD, aka 8000 Euro. Was sagt uns das? Eindeutig, in Sachen Übernahme ist noch reichlich Luft nach oben. Also fleissig rein in die Web2.0 Aktien!
Technorati Tags: marketing, community, business, web2.0, money, myspace, telekom
FEUER!
Balkon in Flammen, ist aber gerade nochmal gutgegangen. Ich war vor auf die Ecke gegangen und als ich gegen 00:30 heimschlenderte seh ich schon die begeisterte Menschenmenge zu den lodernden Flammen aufblicken. Vorderhaus, 4.Stock, meine Wohnung, keine Frage. Ich sprinte also in 2.1 sekunden von der strasse in den 4 Stock wo auch schon die freundlichen Nachbarn, auf dem Stuhl stehend, sich in unqualifizierten Einbruchsversuchen durch das Oberlicht der Wohungstür diletieren. Amateure! Die Tür war offen! Aber nun denn, hineingeeilt und siehe da, auf dem Balkon hat die seit Jahren vor sich hin gammelnde Bastmatte der Funkenflug ereillt. Alles halb so wild. In hohen Bogen die lodernde Matte raus auf die Strasse(toller Effekt, und kein Auto getroffen!), noch einen Eimer Wasser über die kokelnden Reste und schon war der Spuck vorüber. Der Harz IV Empfänger mit dem Pitbull aus dem 2. Stock hat in der Zwischenzeit klammheimlich seine beiden grossen Körbe vor dem Haus mit den Überresten des aus osteuropäischer Produktion stammenden imperialen Feuerwerks gefüllt und die Strasse vor dem Haus samt seiner schier unerschöpflichen Raketenreserven geräumt. So hat eben alles seine zwei Seiten. War ich doch mit meinen deutschen Böllern und Raketen auch effektmässig voll im Abseits, so hat es doch gewisse sicherheitstechnische Vorteile wenn die Raketen erst über Haushöhe detonieren und wenn die bengalischen Feuer und Vulkane sich auf bescheidene 3-4 Meter beschränken anstatt in unkontrolliert chaotischer Farbenpracht die Hausfassade vom ersten bis zum 6 Stock in eine Symphonie des Feuers zu tauchen. In diesem Sinne, frohes neues!
have fun