Skip to main content

Ralsina.Me — Roberto Alsina's website

PHP is for Lucre (II)

I prob­a­bly should have charged more.

Things I learned in this pro­jec­t:

  • If they tell you the de­sign is im­­por­­tan­t, it does­n't mat­ter that said de­sign in­­­cludes:

    • Fixed pix­el-height text in­­­puts (so when you re­­­size fonts you can't see what you write)

    • Mis­­­aligned fields and la­­­bels

    So, I need­ed to use Smar­­ty to gen­er­ate the ex­act same HT­M­L, work­ing just as bad as the orig­i­­nal. And it is thrice the work of do­ing it right.

  • If de­­ploy­­ment is on Win­­dows, re­­gard­­less of hav­ing the same ver­­sion of PH­P, you are go­ing to get in trou­ble one way or an­oth­er.

    In or­der to do it quick & cheap & good, I used PEAR mod­­ules ex­ten­­sive­­ly. And now I have to make sure all of them are in the serv­er... where there is no re­­mote ad­min so­lu­­tion us­able. So I have to be on­site to de­­ploy. I can't even re­mem­ber the last time I had to do such a thing :-(

So, I was cheap­er than the oth­er pro­pos­al­s, and maybe I was a bit too cheap. Live and learn :-)

Neat KDE style: Domino

To­day I was fid­dling with my desk­top and de­cid­ed to check what KDE styles were avail­able in Arch Lin­ux.

Then I test­ed Domi­no.

It's very, very, very nice.

domino.png domino2.png

I have no idea how good it is per­for­mance-­wise (my note­book is pret­ty brawny) but hey, I am a bor­ing guy, and I'm wowed.

Giving BartleBlog the push it needs

I found a cou­ple of hours to hack, and de­cid­ed to spend them on Bartle­Blog.

Here's what got done:

  • UI for blog pre­f­er­ences (still need to do maybe ten of these lit­­tle mod­­ules).

  • Search for files in rea­­son­able places (in­stead of us­ing the DB in the cur­rent fold­er, for ex­am­­ple).

  • Start­ed work on a first-use wiz­­ard

  • Start­ed work­ing on a orig­i­­nal and sim­­ple help sys­tem (re­­source files, yay! ;-).

  • Im­­ple­­men­t­ed (lame­­ly) post­ing of "s­­to­ries" which are stat­ic pages that are not part of the blog's flow.

I in­tend to spend a cou­ple of hours on it ev­ery day for the next ten days or so. Af­ter that, who knows, maybe a re­lease will be rea­son­able.

Why you don't have to take economists too seriously

I bet you have seen be­fore some ar­ti­cle about how some econ­o­mist cal­cu­lates the val­ue of things.

For ex­am­ple, if you pre­fer not to have health in­sur­ance worth $100 a year, and that means you are X% more like­ly to die in 20 years, then some num­ber-­mas­sag­ing will tell you you val­ue your life at $Y (the num­bers are not re­al­ly im­por­tan­t).

Here is an ex­am­ple in Slate mag­a­zine which in­cludes a rather clear ex­pla­na­tion of how this process work­s.

It shows that a Chica­go drug deal­er val­ues its life at be­tween $50000 and $100000.

Now, this is all based on the fact that that per­son choos­es to go on his life in a cer­tain way for a cer­tain amount of mon­ey. How­ev­er, I am pret­ty sure if of­fered $100000 or life, he would choose life.

Since that choice is just as his as the one used to reach that num­ber, it's clear that hu­man be­ings are in­co­her­en­t, or maybe that the dif­fer­ence in val­ue be­tween a 10% chance of death and a 100% chance of death is way larg­er than econ­o­mists es­ti­mate.

Per­son­al­ly, I can't even think of an amount of mon­ey that would make me take a 50% chance of death. But I am aware that, for ex­am­ple, my di­et caus­es me a cer­tain risk, maybe 1% or 10% (no idea).

How about you? Do you be­lieve in economist­s?

PHP is for lucre. Filthy, filthy lucre.

Got comis­sioned a small job for a cus­tomer:

  • Take a form done in an­­cient HTML us­ing dreamweaver.

  • Re­­do it in PH­P+MySQL

  • Make it work.

  • Add val­i­­da­­tion.

  • Make it look the same.

Ok, it's not ter­ri­bly hard, but it's not ter­ri­bly sim­ple, ei­ther, spe­cial­ly if you are not all that up­-­to-­date on PH­P.

But hey, us­ing HTM­L_Quick­Forms and Ren­der­er_Table­less, it's kin­da done.

But boy, do I now re­mem­ber how I don't like PH­P!