all posts | tags | all posts, latest updates first | latest comments
As per rule no 36, I did not have to write a rant about how general purpose
computing will be outlawed in the near future. Cory Doctorow did it 
Here is a transcript of the talk, taken from https://github.com/jwise/28c3-doctorow/blob/master/transcript.md.
La tecnología hoy en día está tan avanzada... Podemos fabricar extensiones de luces navideñas que se dañan solas, sin maltrato mecánico ni de ningún otro tipo. Sin que les dé la luz del sol, ni la humedad. Sólo hace falta un almacenamiento seguro, en un lugar oscuro y seco, por un año, y ya: cables rotos, bombillos fundidos, clavijas dañadas...
Los pobres que las fabrican, los que las transportan, los que nos las venden, de algo tienen que vivir, ¿verdad? ¿de qué otra forma podríamos cumplir con las metas de crecimiento exponencial de la economía?
Say you have a computer with dual boot, using Linux and Windows. Say also that you use the NTFS Windows partition from Linux, both reading and writing data there. Now do this:
- Start Windows, and put it into hibernation.
- Start Linux, write something in the NTFS partition.
- Resume Windows.
The changes you made to the NTFS partition whist in Linux will not be visible from Windows; this will manifest as either not being able to see whatever changes you made, or as "file corruption" or some bull like that.
Solution: Reboot Windows.
Nice experiment that I'd like to do but I'm just too lazy: Check if a hibernated Linux can spot the changes made to the NTFS partition whilst using Windows.
No había pensado antes en esta justificación para maquillarse:
|
"What was the question again"
Don't look, don't bring it up, I know what I'm up against,
Barry M, my oldest friend, what can you do for me now?
Close your eyes and think of Erin O'Connor or pretend I'm Lily Cole,
And we'll be ok, alright, ok for one night,
Close your eyes and think of Erin O'Connor or pretend I'm Lily Cole,
Barry M, my oldest friend, what can you do for me now?
Barry M, my oldest friend, what can you do for me now?
Close your eyes and think of Erin O'Connor or pretend I'm Lily Cole,
Close your eyes and think of Erin O'Connor or pretend I'm Lily Cole,
And we'll be ok, alright, ok, |
(how oblivious can jerojasro be...?)
Aquí yace la identidad digital de Mark Pilgrim. Parió dos panecillos y una abeja.
Me quedó la inspiración general para el diagramado de este blog, el tipo de letra, y el CSS para las citas. Y un mayor y mejor dominio de Python, de expresiones regulares, y de la importancia de la ley de Postel. Y el recuerdo (y el archivo) de algunas de las mejores rants que he leído.
Y me quedo estupefacto preguntándome qué puede llevar a alguien con el deseo y con el músculo necesarios para crear y mantener adecuadamente su identidad digital, a terminar con ella.
Porque no es el primero. Ya pasó con why the lucky stiff, y casi pasa con Steve Yegge. Y podría decirse que pasó también con Tuomo Valkonen.
Sentencia C 804 de 2006 de la Corte Constitucional.
Richard Dawkins, The Blind Watchmaker
I am distressed to find that some women friends (fortunately not many) treat the use of the impersonal masculine pronoun as if it showed intention to exclude them. If there were any excluding to be done (happily there isn't) I think I would sooner exclude men, but when I once tentatively tried referring to my abstract reader as 'she', a feminist denounced me for patronizing condescension: I ought to say 'he-or-she', and 'his-or-her'. That is easy to do if you don't care about language, but then if you don't care about language you don't deserve readers of either sex. Here, I have returned to the normal conventions of English pronouns. I may refer to the 'reader' as 'he' but I no more think of my readers as specifically male than a French speaker thinks of a table as female. As a matter of fact I believe I do,more often tan not, think of my readers as female, bur that is my personal affair and I'd hate to think that such considerations impinged on how I use my native language.
El poder de la estupidez, y La corte posmoderna, de Alejandro Gaviria.
Un resumen interesante en gacetilla.org.
I was trying to overwrite an existing file with another file I created, with a
Python script, using os.rename. Instead of doing what the tin says,
os.rename failed with the rather intimidating message:
OSError: [Errno 18] Invalid cross-device link
WTF? DuckDuckGo to the rescue. I found a thread from the Python mail-list, which I'll reproduce below:
Scott Whitney wrote:
os.rename(oldName,newName) gives: OSError: [Errno 18] Invalid cross-device link
mv from the shell works fine. This is Python 2.2.3 from RedHat 9.0.
Any suggestions (other than os.system('mv %s %s')?)
catch exception and copy if error == errno.EXDEV. (this is what "mv" does, of course)
or use shutil.move:
>>> import shutil >>> help(shutil.move) Help on function move in module shutil: move(src, dst) Recursively move a file or directory to another location. If the destination is on our current filesystem, then simply use rename. Otherwise, copy src to the dst and then remove src. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over.
And a subsequent mail from that thread:
mv is a surprisingly complex program, while os.rename is a wrapper around rename(2) which is probably documented on your system to return EXDEV under these circumstanes.
os.xxx is generally a fairly thin wrapper around what your OS provides, and inherits all the "gotchas". For some activities, os.shutil provides something that is between os.xxx and os.system("xxx") in complexity and capability.
The (somewhat silly) moral of the story: the os module might not be what you
want. Or, the os module is a rather awkward way of learning about your OS's
system calls.
La ópera me aburre. Y la gran mayoría de piezas para orquesta. Y Mozart.
Lo mismo el teatro.
«Madame Bovary» no fue nada del otro mundo.
«Ciudadano Kane» es buena, pero, de nuevo, nada del otro mundo. Lo mismo pasa con las películas de los hermanos Marx, y con la de «lo que el Viento se Llevó» (pusieron a una boba a hacer el papel de Scarlett).
No me gusta la versión de Glenn Gould de las Variaciones Goldberg.
No me entra el whisky, y empieza a pasarme lo mismo con el vino.
Y me molestan sobremanera las decoraciones en el plato de comida, en particular si no son comestibles, o si no saben a nada, o saben a algo pero no «combinan» con el sabor del plato.
There, I said it
Thursday night
I went looking for the contest start date and time, and bumped into the problem statement. Didn't get a iota about it (that's soo silly! why do you have functions that return functions that return functions?!), and went to bed after deciding to skip the contest this year.
Friday
woakas writes me about the contest in the morning. Went to read the problem statement again, and got hooked. I searched for some tutorials, and kept reading the statement at night.
Saturday
woakas and I met in my house in the morning, talked about the problem, and
agreed on a task list: 1) get a simple simulator for every player's slots, 2)
arrange the program to use stdin and stdout as required in the match, and 3)
get a Bot that plays a very simple strategy: repeatedly kill the slot 0 of the
opponent using the dec card. We would worry about "programming" with S and K
later.
That was done by the afternoon. It's worth mentioning that we did pair programming to write the simulator/VM, and it worked really really well. We sent the bot to play and took a break. Ah, right, the team name. Jeu. (woakas hit the keyboard, and that was it.)
At night, we found that, when the program crashes, the opponent wins. We noticed that our program wasn't validating types properly (e.g., using a constant as a function). We corrected that and added that same instruction as a first attack. It won us at least one match.
The first 5 submissions (all of them implementing the same simple strategy) kept crashing in the tournaments. The cause was a stupid bug in one of the cards; we found it by throwing random (but syntactically valid) strings to the bot. After fixing it, we called it a day and stopped working.
Sunday
We could not meet that day; we spent the day trying to learn how to program using lambda calculus, and combinatory logic.
update 2011/06/21: I forgot to mention that woakas wrote a program to search for a loop using a brute force approach, which did yield something useful: the command sequence
('2', '0', 'get')
('1', 'S', '0')
('2', '0', 'dbl')
('2', '0', 'zero')
Which causes yet another infinite loop. It would prove useful.
I finally understood that last part of the problem statement (the one about translating lambda terms to CL expressions) and understood (maybe) why they wrote that there.
I re-read a tutorial I found on Friday, and finally understood it. It proved insightful (although not useful for the contest). The author explains how to:
- Build numerals (Church numbers).
- Build the
succfunction. - Build addition.
- Build the
pred(n)function, the predecessor of a number. - Define
TRUEandFALSE, and all the logic operators. - Define tests (compare a number to zero, return
TRUEorFALSE) - Define loops, using the Y combinator, and getting the loop to stop using a test. I don't fully understand this part yet.
With that, and (sort of) knowing how to translate lambda calculus to CL (with
the hints provided at
wikipedia),
I tried to do that with the succ function.
T[\w.\y.\x.(y((wx)y))]
T[\w.T[\y.\x.(y((wx)y))]]
T[\w.T[\y.T[\x.(y((wx)y))]]]
T[\w.T[\y.(S T[\x.y] T[\x.((wx)y)])]]
T[\w.T[\y.(S (K T[y]) T[\x.((wx)y)])]]
T[\w.T[\y.(S (K T[y]) (S T[\x.(wx)] T[\x.y]))]]
T[\w.T[\y.(S (K T[y]) (S (S T[\x.w] T[\x.x]) T[\x.y]))]]
T[\w.T[\y.(S (K y) (S (S T[\x.w] T[\x.x]) T[\x.y]))]]
T[\w.T[\y.(S (K y) (S (S (K T[w]) I) (K T[y])))]]
T[\w.T[\y.(S (K y) (S (S (K w) I) (K T[y])))]]
T[\w.T[\y.(S (K y) (S (S (K w) I) (K y)))]]
T[\w.T[\y.((S (K y)) (S (S (K w) I) (K y)))]]
T[\w.(S T[\y.(S (K y))] T[\y.(S (S (K w) I) (K y))])]
T[\w.(S (S T[\y.S] T[\y.(K y)]) T[\y.(S (S (K w) I) (K y))])]
T[\w.(S (S (K S) T[\y.(K y)]) T[\y.(S (S (K w) I) (K y))])]
T[\w.(S (S (K S) (S T[\y.K] T[\y.y])) T[\y.(S (S (K w) I) (K y))])]
T[\w.(S (S (K S) (S (K K) I)) T[\y.(S (S (K w) I) (K y))])]
T[\w.(S (S (K S) (S (K K) I)) T[\y.((S (S (K w) I)) (K y))])]
T[\w.(S (S (K S) (S (K K) I)) (S T[\y.(S (S (K w) I))] T[\y.(K y)]))]
T[\w.(S (S (K S) (S (K K) I)) (S (S T[\y.S] T[\y.(S (K w) I)]) T[\y.(K y)]))]
...
...
it... got out of control, and since I was doing that manually, after I finished I wasn't too sure of its correctness.
I stopped there.
The wife had already put the Wii back together, and I was playing Super Mario
Galaxy in no time after stopping 
Monday
I think one can skip using the Y combinator, and perform a limited form of iteration (call something a fixed number of times), using the Church numerals; if you want to call something N times, build a Church numeral for it, and then apply it to the function you want to call, and its argument. We'll see if I don't run out of gas this week and get something along those lines.
Lessons learned
- Do your best to understand completely the problem statement; don't get stuck on it, but do get back to it ASAP, once you get your head clear. That's a stupid mistake I've made twice.
- I don't know a iota about functional programming. All of the sudden I felt like stopping mocking Haskell and its funny error messages, and got a moderate desire of learning to program using it. (update I think I'll skip types and go play with Umlambda instead. You know, I don't have chest hair yet, need to earn my manhood yaddayaddayadda.)
- Going to bed before midnight, and getting up before 8am are far better strategies that coding 'till you can't stay awake and getting up at noon the next day feeling like crap.
And stuff that I already knew:
- Pair programming is an excellent way of tackling nasty programs.
- Clean dishes and good supplies of food (food, not Bachelor Chow (TM)) are exceedingly valuable resources. Make sure of having plenty of both before the contest starts (that would have saved us at least 2 hours.)
Notes and stuff
The Git repository for the code is available at http://git.devnull.li/icfp2011.git. You can clone it using that URL (it wasn't working in the morning, but it works now.)
Some interesting links:
- Unlambda: a programming language that provides you S, K, I, some abbreviations for common idioms, and that's it. The author explains how to do loops, boolean tests, and numbers using it.
- A tutorial introduction to the Lambda Calculus. Excellent.
When looking for information about how to program using CL, many pages made
references to a book, to Mock a Mockingbird, about CL puzzles using birds as
metaphors for S, K, derivatives and friends; it does look interesting. Dear
Santa, yaddayaddayadda 
See you next year.