Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre nerdness (publicaciones antiguas, página 3)

Cosas que aprendí publicando una revista

¿En­ton­ce­s, que apren­dí? ¡Va­rias co­sas!

  • Lo úni­­co que se ne­­ce­­si­­ta pa­­ra pu­­bli­­car es tie­m­­po y co­n­­te­­ni­­do.

  • El tie­m­­po se pue­­de co­n­­ve­r­­tir en co­n­­te­­ni­­do, pe­­ro si es­­cri­­bís to­­­do so­­­lo es un blo­­­g, no una re­­vis­­ta. Por sue­r­­te PET atra­­jo bue­­­nos co­­­la­­bo­­­ra­­do­­­res.

  • Si que­­rés di­se­­ño uti­­li­­ta­­rio, rs­­t2­­pdf fun­­cio­­­na.

  • En al­­gu­­nos sen­­ti­­dos fun­­cio­­­na me­­jor que otras he­­rra­­mien­­ta­s.

    • Pue­­­do sa­­­car una ve­­r­­­sión co­­­­­rre­­­gi­­­da de los PDFs en 5 mi­­­nu­­­tos pa­­­ra to­­­­­dos los di­se­­­ño­­­s. ¿Cuán­­­to me lle­­­va­­­ria usan­­­do Scri­­­bus u otros DTP? En una re­­­vis­­­ta do­­n­­­de las co­­­sas de­­­ben ser co­­­­­rre­­c­­­tas eso es im­­­po­­­r­­­tan­­­te.

    • Las ta­­­blas de co­­n­­­te­­­ni­­­do (TO­­­­­C) son me­­­jo­­­­­res que la ma­­­yo­­­­­ría de las re­­­vis­­­tas en PDF ama­­­teu­­­r. La que es­­­tá en el tex­­­to es cli­­­ckea­­­ble, y la del PDF es pe­­r­­­fe­­c­­­ta.

    Los nú­­me­­ros de pá­­gi­­na en la TOC del PDF es­­tán bien (no, la ta­­pa no es la pá­­gi­­na 1)

    • Es­­­toy pro­­­­­du­­­cien­­­do 6 ve­­r­­­sio­­­­­nes en PDF: A4 (BN, co­­­­­lo­­­­­r), A5(­­­BN, co­­­­­lo­­­­­r) y li­­­bri­­­to­­­(­­­BN, co­­­­­lo­­­­­r) y po­­­­­dría agre­­­gar otra en mi­­­nu­­­to­­­s.

  • ¡A­­pren­­dí que es PDF Im­­po­­­si­­tio­­n!

Va­mos a ex­pli­car es­a:

Su­po­ne­te que que­res im­pri­mir un li­bri­to, y te­nés 32 pá­gi­nas de con­te­ni­do. ¿Co­mo lo ha­cé­s?

La for­ma más fá­cil es im­pri­mir­lo a dos pa­gi­nas por ca­ri­lla en pa­pel A4, así po­dés api­lar las ho­ja­s, do­blar­las por la mi­ta­d, abro­char­la­s, y te da un lin­do li­bri­to A5.

El pro­ble­ma es que el or­den de las pá­gi­nas es di­fí­ci­l. Por ejem­plo, pa­ra un li­bri­to de 4 pá­gi­na­s, hay que im­pri­mir una ho­ja A4 con las pá­gi­nas 4-1 de un la­do y las 2-3 del otro.

Pa­ra 8 pá­gi­na­s, es 8-1,2-7,3-6,4-5.

Por suer­te hay una for­ma de ha­cer­lo au­to­má­ti­ca­men­te:

1. Ins­ta­lá po­do­fo 3. Con­se­gui­te book­le­t-A4.­plan (ver aba­jo) 2. Co­rré es­to:

podofoimpose mis-paginas-A5.pdf mi-librito.pdf booklet-A4.plan lua

book­le­t-A4.­plan es es­to:

---Generic Booklet (A4)
---
---It is said generic as it will try to determine
---automatically how to fit the booklet onto A4
---paper sheets, scaling pages if necessary.
---it is well suited for office documents for
---which you do not care too much about resulting
---imposition artefacts since it manages to save
---paper!
---
-- print("Booklet")
-- We output an A4 booklet
PageWidth = 595.27559
PageHeight = 841.88976

print("PageCount",PageCount)

-- We assume that H > W
-- Argh, we now can do better since we have "if" ;-)
-- Scale = PageHeight / (2*SourceWidth)
if(SourceWidth <= SourceHeight)
then
--  If you A5 pages are not really A5, uncomment the next line
--  Scale = PageHeight / (2*SourceWidth)
    Scale = 1
    rot = 90
        xof = SourceHeight
        yofRA = 0
        yofRB = SourceWidth
        yofVA = 0
        yofVB = SourceWidth
else
--  If you A5 pages are not really A5, uncomment the next line
--  Scale = PageHeight / (2*SourceHeight)
    Scale = 1
    rot = 0
        xof = 0;
        yofRA = 0
        yofRB = SourceHeight
        yofVA = SourceHeight
        yofVB = 0
end

do
    rest = PageCount % 4
    totp = PageCount
    if rest ~= 0
        then
        totp = totp + ( 4 - rest)
        end
    inc = 0
    count = 0
    imax = totp/4
    while count < imax
        do
--          We assume that podofoimpose will discard invalid records
--          such as those with source page greater than PageCount
--          print(totp, inc, rot, xof,yofRA, yofRA, yofVA, yofVB)
-- Recto
        PushRecord(totp - inc , inc + 1 , rot, xof , yofRA)
        PushRecord(inc + 1 , inc + 1 , rot, xof , yofRB)
-- Verso
        PushRecord(inc + 2 , inc + 2 , rot, xof , yofVA)
        PushRecord(totp-(inc + 1) , inc + 2 , rot, xof, yofVB)

        count = count + 1
        inc = inc + 2
        end
end

El có­di­go es­tá to­ma­do de acá: http://www.oe­p-h.­co­m/im­po­se/

Y lis­to, te­nés un PDF to­do re­vuel­to con las pá­gi­nas en exac­ta­men­te el or­den co­rrec­to (y pá­gi­nas en blan­co agre­ga­das en el lu­gar ne­ce­sa­rio­).

¡Vengan a verme a Bahía Blanca este fin de semana!

Pa­ra va­ria­r, no voy a dar una de mis char­las vie­ja­s, sino una com­ple­ta­men­te nue­va, es­treno nun­ca ta­xi, que se lla­ma "El Ama­teu­r", y pro­ba­ble­men­te una li­gh­tning ta­lk o al­go así.

La ofer­ta ha­bi­tual de cer­ve­za gra­tis no va a ser po­si­ble es­ta ve­z, asi que: si men­cio­nás es­te blog en la se­sión de pre­gun­tas y res­pues­tas te ga­na­s... ca­ra­me­los gra­tis!

Des­pués de eso, voy a es­tar en FM La Tri­bu el sá­ba­do 21 de agos­to en las Char­las Abier­tas 2010 ha­blan­do de co­sas co­mo vir­tua­len­v, to­x, no­se y otros te­mas re­la­cio­na­dos a tes­tin­g.

Sale o sale: PET - Python Entre Todos

Sa­qué la cuen­ta re­gre­si­va por­que es­ta­ba equi­vo­ca­da (pro­ble­ma de ti­me­zo­ne). Pa­ra una que fun­cio­na, vean http://­re­vis­ta.­p­y­tho­n.or­g.ar

Me han me­ti­do en OPM (O­tro Pro­yec­to Má­s) y es­te es el pri­mer nú­me­ro en la his­to­ria de PET - Py­thon En­tre To­dos una re­vis­ta on­li­ne de py­tho­n.

Es­to es un emer­gen­te de PyAr la co­mu­ni­dad de Py­thon Ar­gen­ti­na, y tal vez nun­ca ten­ga un se­gun­do nú­me­ro así que aten­tos al pri­me­ro ;-)

Ven­go ha­cien­do de we­bmas­te­r, edi­ción y pro­duc­ción del PDF jun­to con Emi­liano Da­lla Ver­de Mar­co­z­zi que ayu­da por to­das par­tes y con­si­guió los ar­tícu­lo­s.

El pri­mer nú­me­ro son unas 45 pá­gi­nas A5 (o 23 A4) en le­tra chi­ca así que no es exac­ta­men­te enor­me, pe­ro tie­ne me­dia do­ce­na de ar­tícu­los apun­ta­dos a dis­tin­tos ni­ve­les de pro­gra­ma­dor py­tho­n.

¡Es­tá sien­do di­ver­ti­da de ha­ce­r, oja­lá sea bien re­ci­bi­da!

Fotos al azar de mi teléfono

La ca­li­dad es ma­la por­que mi te­lé­fono es una ba­su­ra, pe­ro creo que de­be ha­ber al­gu­na co­sa que no ha­yas vis­to an­tes.

Así que acá es­tá co­sas ra­ras que hi­cie­ron que sa­que mi te­lé­fono y to­me una fo­to, con ex­pli­ca­cio­nes.

Titanic

Lo ví en Mar del Pla­ta, es el li­bro 3D más im­pre­sio­nan­te que vi nun­ca.

Ce­rra­do:

Imagen033

Y abier­to:

Imagen032

I'm Mark Shuttleworth!

Imagen024 Imagen025

En un even­to de so­ftwa­re li­bre en Bue­nos Ai­res se su­po­nía que lo ce­rra­ba el due­ño de Ca­no­ni­ca­l, pe­ro can­ce­ló a úl­ti­mo mo­men­to. En­ton­ces Ma­d­dog Ha­ll se ofre­ció pa­ra reem­pla­zar­lo­... en per­so­na­je.

Al­guien en­contró un muy muy im­pre­sio­nan­te (y/o ho­rri­ble) tra­je de as­tro­nau­ta, y Ma­d­dog dió la con­fe­ren­cia al gri­to de "I'm Ma­rk Shu­ttlewor­th! I'm an as­tro­nau­t!" y di­cien­do que ve­nía del fu­tu­ro pa­ra dis­cu­tir unos sli­des que aca­ba­ba de en­con­trar de un ti­po des­co­no­ci­do lla­ma­do Ma­d­do­g. Muy gra­cio­so.

Python vs. Ruby

Mis­mo even­to:

Imagen023 Imagen022

Ju­ro que las sa­qué con me­nos de 10 se­gun­dos de di­fe­ren­cia.

Manteca

Imagen018 Imagen026

En el Dis­co de San Isi­dro. Sí, com­prar el pan gran­de de man­te­ca es más ba­ra­to por ki­lo. Pe­ro acá uno de 200g cues­ta ca­si lo mis­mo que uno de 100­g! Eso es ro­bar­le gui­ta a los que no co­men mu­cha man­te­ca. Yo no co­rro ries­go.

Descuento por Visa

Imagen045

Es­to era un ne­go­cio en Ave­ni­da Ale­m, Me pa­re­ció ra­ro ver un des­cuen­to y anun­ciar que vi­sa es­ta­ba sus­pen­di­da en un so­lo car­te­l. Más ra­ro me pa­re­ció la le­tra chi­ca "pre­sen­tan­do su vi­sa"... no es­ta­ba sus­pen­di­da?

Y ahí vi el res­to:

Imagen046

Ten­go unas cuan­tas más pa­ra otra oca­sión ;-)

The day we saw the dinosaur (an Ada Lovelace Day story)

To­day, March 24th is Ada Lovelace day, a day of blog­ging to cel­e­brate the achieve­ments of wom­en in tech­nol­o­gy and sci­ence.. I am tak­ing the lib­er­ty to tag this as python so it ap­pears in the right plan­et­s, but that's just to pro­mote Ada Lovelace day. Sor­ry 'bout that.

I will write about the on­ly per­son who ev­er taught me pro­gram­ming, Clau­di­a. I was young, so the earth was still luke­war­m, the day we saw the di­nosaur.

I was just a green sopho­more in the School of Chem­i­cal En­gi­neer­ing where, para­dox­i­cal­ly I would nev­er take a chem­istry class, be­ing an ap­plied math stu­dent and all that, and at the time "per­son­al com­put­er­s" were a nov­el­ty, a toy of the up­per mid­dle class.

We had spent the first two months of the se­mes­ter learn­ing how to pro­gram the ob­vi­ous way: writ­ing as­sem­bler for a fic­tion­al ma­chine on pa­per by hand, when Clau­dia broke the news, we were go­ing to see a re­al com­put­er.

No, not a PC, not even an XT, but a re­al com­put­er, the one re­al com­put­er in all the uni­ver­si­ty, and you could hear the type switch­ing to bold as she spoke about it. Sad­ly it was not as re­al as the one at the re­search fa­cil­i­ty (A Mini­VAX!) but it was a re­al enough PDP.

We would not be al­lowed to ac­tu­al­ly use it un­til the fol­low­ing year, but ... well, it was still some­thing spe­cial.

I had been programming for years, even for a year before I saw my first (seriosuly not real) computer, I had followed BASIC programs in my head for days, imagining the space invaders float on the screen of my mind, and stepped into writing machine code inside REM statements in my Timex Sinclair 1000 onto the luxury of a C64, but never noone had taught me anything.

Our small class (maybe 10 stu­dents) spent end­less hours do­ing things like tra­verse a ma­trix, first by rows, thn by column­s, then in a spi­ral from the top-left, writ­ing pro­grams that fol­lowed our end­less source of al­go­rithm­s, the nu­mer­i­cal so­lu­tions guide.

First as­sem­bler, then For­tran, we learned.

She was my Mr. Miyag­i, I was a het­ero­sex­u­al Ralph Mac­chio, and I fig­ured out the most im­por­tant thing about pro­gram­ming: I was aw­ful at it.

Over the next 20 years that sit­u­a­tion has been slow­ly im­prov­ing, but I nev­er again had some­one teach me pro­gram­ming. Clau­dia had al­ready taught me ev­ery­thing I need­ed to know, that code can al­ways im­prove, that there's more than one way to skin a cat.

That the di­nosaur was re­al and that some day soon my com­put­er would be faster and nicer than the di­nosaur was then, and that pro­gram­ming was cool, and that if I could find a way to draw a poly­no­mi­al graph hor­i­zon­tal­ly on a print­er with­out ev­er hav­ing the whole graph in mem­o­ry (it did­n't fit), those fu­ture com­put­ers would do awe­some things, and that I was one of the many who would help bring that to re­al­i­ty.

That talk­ing about code was fun in it­self, that you could make a mod­est liv­ing and be hap­py about it, that you could in any case make jig­saw puz­zles in your spare time and keep on teach­ing or what­ev­er.

And lat­er the di­nosaur's bones were scav­enged in­to a line of racks hold­ing router­s, and its glass ter­mi­nals are de­stroyed, and the gold in its teeth was stolen and the rare bus ca­bles sol­d, and its cir­cuits scrapped, but I saw the di­nosaur alive, and Clau­dia taught me how to make it jump, and for that, I will al­ways be grate­ful.


Contents © 2000-2023 Roberto Alsina