LLAP

February 28th, 2015 by ggl

Leonard Nimoy, the actor who played Mr. Spock has died a few days ago at age 83 of end-stage chronic obstructive pulmonary disease. If you like both Star Trek, and smoking now it’s a good time to quit the latter.

Skydiving

January 27th, 2015 by ggl

An excellent article from Charlotte Magazine about skydiver and champion, Cheryl Stearns‘ career and bicycle accident that temporarily got her grounded before the 20k-th jump. Streans currently holds the women’s world record for the most jumps in a single day: 352. That’s one jump every four minutes, on average. Damn!

Sadly, I am fuly aware of this. Ten years after I gave up paragliding because I thought it was too dangerous, I had my first serious bicycle accident from which I still haven’t fully recovered. My neck still squeaks in the morning. As we said back then, accidents always happen on the ground. Not in the sky. It’s always the ground that you’re hitting. Most aviation accidents involve proximity to the ground or water bodies.

Streans, do get well, and see you soon in the sky again.

Tot Secu

January 9th, 2015 by ggl

Securiștii profită de atentatele din Franța ca să introducă pe ordinea de zi, în regim de urgență, un pachet de măsuri legislative care încalcă drepturile omului. Este vorba despre legea stocării datelor de trafic ale utilizatorior de telefonie și internet, precum și de legea privind identificarea utilizatorilor de cartele telefonice prepay. Aceste două legi au fost declarate neconstituționale de Curtea Constituțională a României în cursul anului trecut. În Franța există deja astfel de legi, ceea ce nu i-a împiedicat pe atentatori să ucidă mai multe persoane.

Russian propaganda

January 7th, 2015 by ggl

An excellent article by Peter Pomerantsev about present day Russian TV propaganda. We have featured another one by him back in 2013. It looks like he also finished his book in the meantime. I should probably read it.

Just yesterday I have been reading an article about Kremlin extending its news tentacles around the world. As if RT wasn’t enough already. Below is such an example of pro-Kremlin media news reporting:

One of our readers has recently sent me an article from RT, claiming a radioactive leak occured at the Ukrainian Zaporizhzhya nuclear power plant and blaming it on the operator’s attempts to fuel one of the plant’s reactors with nuclear fuel supplied by Westinghouse Electric. I won’t even bother to link to such fiction. After a bit of research I found out that reactors of similar design located in Czech Republic had already used Westinghouse fuel without any incidents, but later switched to Russian made nuclear fuel provided by TVEL because it was more cost efficient. Additionally, two reactors at the the South Ukraine NPP have been running on nuclear fuel assemblies from mixed suppliers.

Diacritice

November 23rd, 2014 by ggl

M-am trezit după cinci ani că scriu cu caractere turcești și catalane. Știu că am stat oarecum sub turci aproape 400 de ani (mă rog, nu neapărat noi, ardelenii, ci românii din Dobrogea și Țara Românească), dar totuși avem propriile ș-uri și ț-uri, motiv pentru care am remediat problema cu acest script, yay.

Wacky voters

November 16th, 2014 by ggl

Victoraș pisoiaș nu cred că a urmărit vreodată la desenul animat Wacky Races, în care personajul Dick  Dastardly pierdea întotdeauna cursa din cauză că era prea procupat să ciolească. Dacă n-ar fi făcut fazele total lipsite de fair-play de la alegerile astea, aveau șanse să câștige. Așa, probabil că nu.

Democrația nu se dă, nu se bagă la alimentară, ci se câștigă în stradă cu scandal.

CCR vs. Secu

September 21st, 2014 by ggl

Curtea Constituțională a României a declarat neconstituționale două legi care îngrădesc drepturile fundamentale referitoare la viață intimă, familială și privată și la secretul corespondenței, precum și a libertății de exprimare. Securiștii sunt supărați că nu mai pot nu mai pot monitoriza legal persoane private care nu au încălcat legea.

Perl class builders

June 23rd, 2014 by ggl

I was more than pelasantly surprised today while benchmarking Moo against Mo, Class::Tiny and Mojo::Base. It turns out the latest version of Moo doesn’t have much of a speed penality when compared to Mo or Mojo::Base. Needless to say it’s two times faster than Class::Tiny. All of this without Class::XSAccessor installed. With it installed it’s on par with Mo, sometimes even faster. If I’d start a new project today I’d probably use either Moo or Mojo::Base.

Rate ct moo mo mb
ct 76799/s -45% -50% -61%
moo 139184/s 81% -10% -29%
mo 154844/s 102% 11% -21%
mb 195491/s 155% 40% 26%

Moo only has features that make sense, such as inheritance, roles plus some safeguards that make sloppy programming a headacke. Some of them are rather annoying, for example fatal warnings, which can be defused by using Moo::Lax. If you want type checking with Moo, there are some documented extensions for that, or you can use Type::Tiny. Moo also provides an easy migration path to Moose and in order to use it you only need to install just about eight non-core dependencies, as opposed to half the CPAN.

Mojo::Base is really minimal, has zero core dependencies and is part of the excellent Mojolicious framework. If you’re already using that you probably don’t need another object builder. The syntax is also Moose-like.

Perl and JSON

May 31st, 2014 by ggl

I like JSON a lot when it comes to seralizing data and REST web services. Perl has very good support for JSON and several libraries to pick from. While selecting the best components for my projects, I have been testing and timing a few Perl modules that produce JSON. These are JSON::PP, which has been in the Perl core since 5.13.9, Mojo::JSON, part of the excellent Mojolicious web framework, JSON::Tiny, a stand-alone adaptation of the latter, JSON::XS, written in C for blazing speed and Cpanel::JSON::XS, a fork of the latter. I also tested JSON:DWIW, an older module also written in C. Let’s see how they perform.

Rate jpp jt mj jdwiw jxs cpjxs
jpp 4437/s -6% -11% -82% -97% -97%
jt 4718/s 6% -5% -81% -97% -97%
mj 4977/s 12% 5% -80% -97% -97%
jdwiw 24917/s 462% 428% 401% -83% -85%
jxs 145479/s 3179% 2983% 2823% 484% -10%
cpjxs 161266/s 3534% 3318% 3140% 547% 11%

If you don’t want to bother, JSON::MaybeXS is a wrapper module that automatically selects the best out of three of them and can also operate like the core JSON, so you only have to change your use statement and leave the rest of your code untouched. JSON::PP, JSON:DWIW and the XS modules are packed with features, while Mojo::JSON and JSON::Tiny are minimalistic libraries and only produce inline compacted JSON suitable for machine consumption.

Rare

April 14th, 2014 by ggl

Playing with sharp objects outside evals.

‘And what would humans be without love?’
‘RARE, said Death.”

– Terry Pratchett, Sourcery