• It seems iPad lack of Flash support is the debate of the moment. On one camp: “You can’t use the web without Flash”, on the other camp: “We don’t need no stinking Flash”. Although I do realize how a technology like Flash is sometimes needed, I’m more on the second camp. The less flash, the better.

    I think iPad’s lack of Flash cause two things to happen:

    • Slow down the adoption of the iPad: surely someone will say “No Flash, No iPad“.
    • Speed up the adoption of HTML5: surely someone will consider using HTML5 to support the tablet.

    Giving that the iPad is a closed device, probably the closedest non-phone computer consumers ever had access to and that HTML5 is good progress for the web, I consider both results of the iPad not having Flash positive. If I have to say anything about it, it’d be: please, stop trying to wake Steve Jobs up regarding this, you’ll ruin it.

  • SpamMy email address, pupeno@pupeno.com, existed since around 1998 and was never obfuscated or protected in any way. Spam wasn’t such a huge problem in those days. Today my Spam folder has 3200 mails.

    My spam filter is quite good, but I still like going through my spam in case some non-spam message was thrown in there. I’ve tried cleaning it weekly, daily, whenever I have free time and even inbox zero. It’s a hassle and I’m tired of it.

    My new way to deal with spam is ignoring it. Since my spam is deleted automatically whenever it is more than 30 days old, filling up my inbox won’t be my problem; and whenever I someone tells me “I’ve sent you an email, haven’t you receive it?” I’ll be able to search for it and find it if it was on the spam folder unless it’s more than 30 days old. The cases I won’t be able to spot are mails that just went there. Life is tough.

  • I strongly believe in revision control. Back in the days when there wasn’t any other choice that CVS I spent countless hours setting up CVS servers and re-freshing my mind on its obscure commands and arguments, which were almost all of them. If you drop my copy of Professional Linux Programming it’ll open on the CVS chapter by itself (much like my copy of The C Programming Language will open itself on the pointers chapter, somewhere on the pointers to pointers section).

    Then came Subversion and it was somewhat better. After that we got the explosion of revision control systems with the introduction of distributed ones. We’ve got Darcs, Git, Mercurial, Arch, Bazaar, etc. My choice right now is Git. It used to be Darcs, but unfortunately it stagnated for a long time and I moved on to the next new thing. I’ve used Mercurial as well. From my perspective Mercurial and Git are almost equivalent.

    For me distributed revision control was a breakthru. There’s one small feature that makes a huge difference for me. In the old days I used to set up CVS or Subversion servers/repositories (in those, a repository is essentially a server-side thing). I had to decide where that repository was going to reside, how it was going to be named, how it was going to be accessed (ssh, http, custom protocol?), by whom, etc.

    Today with Git I just do this

    git init

    That’s it. I’m done. The directory where I am is now a repository. I can start committing, branching, rolling back, looking at the history, generating patches, stashing, etc. It’s that simple. The fact that it’s so simple goes from a quantitative advantage to a qualitative advantage. What I mean is that I not only revision-control things faster but that I revision-control things I wouldn’t have otherwise. For example the configuration directories on my servers.

    I know many people will complain: “But with no centralized repository chaos will ensue”. The fact that it’s distributed doesn’t mean there can’t be a central repository. When I want to collaborate with someone using Git I create one repo somewhere, in my servers or GitHub and we both push and pull from there. The difference is that I commit a lot locally, and when the chances are ready I push them. That means that I can commit broken code, without worrying.

    At work we don’t use a distributed revision control system, we use a centralized one and we have a very string peer reviewing policy. My current tasks involve touching code in many different files in many different systems never getting familiar to any of them. That means that it’s common for my peer reviews to say things like “all this methods don’t belong here, these two should go there, that one should be broken into three different ones going here, there and somewhere else”.

    Now I have a problem. I can’t commit because my peers don’t consider my code ready. My code works but it has to be refactored in a very destructive way. What happens if during the refactoring it stops working. For example copying and pasting I loose a piece of code. I can’t roll back to my working state and start over. If we were using a distributed revision control system I could.

    So, being able to commit non-finished code locally while colaborating with other people is one of my other crucial features in DVCS.

    The third one is being able to branch locally. In a similar vein as the last example. When I find myself thinking about a very destructive refactoring that I’m not sure if it’s going to get me anywhere and worst than that is going to take me three days to do; I just create a local branch. I experiment in that branch. If at any time I get tired or I need to do anything else I go back to the main one. That is what branching is about.

    Why is locally branching better than globally or centralized branching? Well, one reason is that a local branch doesn’t have to make sense to anyone else. I don’t have to pick a name that’s descriptive for anyone else than me. I don’t have to justify myself for creating a branch with anyone else. Let’s suppose I had an argument with a co-worker where I believe something is doable and (s)he believes is not. Do I want him/her to see that I created a branch to prove him/her wrong? I don’t. And if I prove myself wrong I want to quietly delete that branch and never ever talk about it.

    But I am starting to go into the very hypothetical realm. In short, for me, DVCS is about this:

    git init

    and get to code.

  • I like Erlang and I like gen_servers, I end up coding a lot of stuff as gen_servers and I like behaviors in generally. I even wrote some myself. I haven’t used Erlang for a while. I’ve been playing with it in the last couple of days, hopefully I’ll announce something soon.

    I ended up creating my own gen_servers template to get started. It’s a very verbose one and I’m putting it here more for me to know where it is that anything else; but, maybe it’s of use for someone else:

    -module(module).
    -compile(export_all).
    
    -behaviour(gen_server).
    -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
    
    %% Public API
    
    start() ->
      gen_server:start({local, ?MODULE}, ?MODULE, [], []).
    
    stop(Module) ->
      gen_server:call(Module, stop).
    
    stop() ->
      stop(?MODULE).
    
    state(Module) ->
      gen_server:call(Module, state).
    
    state() ->
      state(?MODULE).
    
    %% Server implementation, a.k.a.: callbacks
    
    init([]) ->
      say("init", []),
      {ok, []}.
    
    
    handle_call(stop, _From, State) ->
      say("stopping by ~p, state was ~p.", [_From, State]),
      {stop, normal, stopped, State};
    
    handle_call(state, _From, State) ->
      say("~p is asking for the state.", [_From]),
      {reply, State, State};
    
    handle_call(_Request, _From, State) ->
      say("call ~p, ~p, ~p.", [_Request, _From, State]),
      {reply, ok, State}.
    
    
    handle_cast(_Msg, State) ->
      say("cast ~p, ~p.", [_Msg, State]),
      {noreply, State}.
    
    
    handle_info(_Info, State) ->
      say("info ~p, ~p.", [_Info, State]),
      {noreply, State}.
    
    
    terminate(_Reason, _State) ->
      say("terminate ~p, ~p", [_Reason, _State]),
      ok.
    
    
    code_change(_OldVsn, State, _Extra) ->
      say("code_change ~p, ~p, ~p", [_OldVsn, State, _Extra]),
      {ok, State}.
    
    %% Some helper methods.
    
    say(Format) ->
      say(Format, []).
    say(Format, Data) ->
      io:format("~p:~p: ~s~n", [?MODULE, self(), io_lib:format(Format, Data)]).
    

    Update 2010-01-04: I keep changing the actual contents of the template as I’m coding a little Erlang app. I’ve recently added, among other things, a call to get the state of the process, useful for debugging.

  • First and foremost I’m a coder, a coder who strongly believes in revision control. Second I am also a sysadmin; but only by accident. I have some servers and someone has to take care of them. I’m not a good sysadmin because I don’t have any interest on it so I learn as little as possible and also because I don’t want to be good at it and get stuck doing that all the time. What I love is to code.

    I’m always scare of touching a file in /etc. What if I break something? I decided to treat /etc the same way I treat my software (where I am generally not afraid of touching anything). I decided to use revision control. So far I’ve never had to roll back a change in /etc, but it gives me a big peace of mind knowing that I can.

    In the days of CVS and Subversion I thought about it, but I’ve never done it. It was just too cumbersome. But DVCS changed that, it made it trivial. That’s why I believe DVCS is a breakthru. Essentially what you need to revision-control your /etc with Git is to go to /etc and turn it into a repository:

    cd /etc
    git init

    Done. It’s now a repo. Then, submit everything in there.

    git add .
    git commit -am "Initial commit. Before today it's prehistory, after today it's fun!"

    From now on every time you modify a file you can do

    git add <filename>
    git commit -m "Description of the change to <filename>"

    where <filename> is one or many files. Or if you are lazy you can also do:

    git commit -am "Description to all the changes."

    which will commit all pending changes. To see your pending changes do:

    git status

    and

    git diff

    When there are new files, you add them all with

    git add .

    and if some files were remove, you have to run

    git add -u .

    to be sure that they are remove in the repo as well (otherwise they’ll stay as pending changes forever).

    That’s essentially all the commands I use when using git and doing sysadmin. If you ever have to do a rollback, merge, branch, etc, you’ll need to learn git for real.

    One last thing. I often forget to commit my changes in /etc, so I created this script:

    #!/usr/bin/env sh
    
    cd /etc
    git status | grep -v "On branch master" | grep -v "nothing to commit"
    true # Don't return 1, which is what git status does when there's nothing to do.

    on /etc/cron.daily/git-status which reminds me, daily, of my pending changes.

    Hope it helps!

  • I apparently speak Spain, United States, United Kingdom and Canada.

    I would also like to speak Germany because it might be useful in Switzerland, you see, in Switzerland they speak a version of Germany, something like Swiss Germany.

    As seen on http://easportsactive.com. And by the way, the reason why I was at their site is to try to figure out whether EA Sports Active, here in Switzerland at least, comes multilingual or not. From the box it seems to be only in German (or should I say Germany?), searching on-line I’ve found conflicting results. It seems EA Sports doesn’t dig multilingualism, they should support Esperanto to not have to deal with that problem (of course I’ve had to drop some Esperanto propaganda!).

  • 150 years ago a great man was born. His name was Ludovic Lazarus Zamenhof and he was born to a world divided by language, a world of constant violence between polish, jews, russians, etc. All speaking different languages. He thought the problem of the world was that people could not understand each other and set himself the task of fixing it.

    He invented what latter on became know as Esperanto. You can go to the Wikipedia and check the article on Esperanto and on Zamenhof to get a lot of encyclopedic information. If you want to actually taste or learn the language, my recommendation is to go to Lernu. And with that you can learn your first Esperanto word (if you don’t know any yet): lernu means learn, as in “you learn”. Lerni means to learn.

    In this post I will tell you some things I find interesting about Esperanto.

    Let’s go on with lerni. School is lernejo. See the relationship? lern – ej – o is school. Ej means a “a place for”, so lernejo is literarily a place to learn. There are other places like laborejo, which is the place to work. Laboro means work (think of ‘labor unions’).

    Zamenhof thought about the task of creating the Esperanto dictionary and the task was so big he thought it was the end. Until he came up with the idea of allowing people to build words. My English-Esperanto, Esperanto-English dictionary is 75% for English, 25% for Esperanto. There are less words to learn in Esperanto.


    Did you know the Wikipedia is available in Esperanto? If you go to wikipedia.org, you’ll see it among the languages with more than 100000 articles.

    Esperanto Wikipedia

    And if you go to the English wikipedia homepage, Esperanto is the only constructed language listed on the left column. Do you want to know something amazing? Vikipedio, the Esperanto Wikipedia is actually bigger than the Encyclopedia Britannica.

    The legend goes that Zamenhof released his book about Esperanto, called La Unua Libro (the first book) and six months latter someone nocked at his door speaking Esperanto and asking to practice the language. Esperanto spread like wildfire, unlike any other constructed language.


    Pasporta-servoToday it is estimated that there are 2 million Esperantists in the world. If you consider that 122 years ago there was only one Esperanto speaker, it’s growing quite fast. I would expect its growth is accelerating but it’s very hard to know. No census asks about Esperanto. I know someone that made a informal survey asking for people that spoke Esperanto on the streets of Zürich and then actually asking questions in Esperanto and he got 3% positive response.

    Those 2 million speakers are not concentrated in one location, they are spread through the world so you are very likely to find Esperanto-speakers everywhere if you know where to look.

    There are even an estimate of 1000 native Esperanto speakers. Basically that happens when a family is formed by a man and a woman who only share Esperanto as a common language. Even if they don’t actively teach their children Esperanto, they learn to be able to understand their parents. I know a couple of people that speak it natively.


    When talking about how many people speaks the language, it’s important to mention that Esperanto speakers were hunted by many totalitarian goverments. The Nazi government specially targeted them because Zamenhof was jewish and according to Hitler as expressed in his My Fight, Esperanto was the language to be used by the International Jewish Conspiracy to set a new world order.

    In the Soviet Union Esperanto was embraced at first. Most socialists parties saw the potential for international communication and understanding. Joseph Stalin saw it as a way to spread the ideals of communism until they realized that it was a two way street, new ideas would come from outside, including capitalism, and denounced Esperanto as the language of spies. Imperial Japan didn’t like the language either.

    In all those cases of totalitarism, Esperanto was forbidden and Esperantists hunted, exiled or even executed.


    The first Esperanto congress was held in 1905, bringing 600 people together from across the world. since then it was held every year except during the world wars with an average of 2000 participants. When it was done in China it was the biggest gathering of foreign people ever to happen in China.


    There’s a very practical reason to adopt Esperanto. Currently we waste a lot of resources pretending English is an adequate medium of international communication and in translation. Let me give you one example. In 1975 the World Health Organization denied the following requests:

    • $ 148,200 to improve the health service in Bangladesh
    • $ 83,000 to fight leprosy in Burma
    • 50 cents per patient to cure trachoma, which causes blindness.
    • $ 26,000 to improve hygiene in the Dominican Republic

    All those requests denied. It seems the World Health Organization didn’t have much money. But that same year they approved Arabic and Chinese as working languages requiring lots of translations and increasing the expenses of the WHO by $ 5,000,000 per year. That’s right, 5 million dollars per year spent on translation when they couldn’t give 50 cents to cure trachoma.


    Esperanto is probably the easiest to learn usable language out there. The Institute of Cybernetic Pedagogy at Paderborn compared how long it would take French speaking people to learn different languages to reach the same level:

    • 2000 hours studying German
    • 1500 hours studying English
    • 1000 hours studying Italian
    • 150 hours studying Esperanto

    Yes, a tenth of the time it takes to learn English and less than that when compared to German. And something very interesting happens here. The third language you learn takes less effort than the second one.

    If you want to learn another language, let’s say, German, it’ll take you less time to learn Esperanto and then learn German than to just learn German. Yes, you’ve read right. Less time to learn two languages than one.

    That experiment was done by teaching one year of Esperanto and four of French to some students while five of French to others. The amount of time studying was the same but those that spoke Esperanto first reached a better French level. So even if you never utter a single Esperanto word out there, it makes economical sense to learn it first, before you learn another language.


    Many said that Esperanto will never take off and they proceed to never learn it and accept a divided broken world. If you are among those, I’m sorry about your defeat. I’d rather hope and do my part and learn Esperanto. It’s not that hard.

  • mikPmjuI still haven’t found a good music player, for my computer that is. The one that got the closest to it was Amarok, but still it was very far away. My problem is that I don’t know what to listen to, really! I’m only just finding out what music to use  for coding. There’s one thing I really want from a music player: for it learn what to play for me. It’s not the same as learning what I like. It’s much more complex. Amarok learns what I like, but not really what to play for me.

    In Amarok, when you jump to the next song it checks how much of the song you listened and assigns a score based on that. For songs that you listen completely you get a high score and for songs you listen only for a couple of seconds a low score. Over time, as you listen, those you like most and listen most will get high scores while those you despise and jump immediately will get a lower score.

    Amarok has a special playing list, or used to have in the 1.4 version, which is called “dynamic” and plays those songs with the highest score. That sounds excellent, but it’s not enough. This music player I’d like to have would not compute how much I like a song, like Amarok, but how probable it is that  I’ll like it when it plays that song.

    Let’s call this player Pamup, Pablo’s Music Player, and let’s see how it could provide such a magic feat as playing songs that you want to listen (even if you don’t know you want to listen to them).

    Pamup would have a scoring for the songs but instead of being a linear score it’ll be multidimensional. Let’s start with two simple dimensions and the rest will be clear: percent of playing time and time of the day. Song A you play 100% and song B 50%. That means that you like song A better than B. That is what Amarok does. Pamup would instead record:

    • Song A in the morning: 100%
    • Song B in the morning: 50%
    • Song A in the evening: 50%
    • Song B in the evening: 100%

    You like A as much as B, but you are more likely to want to listen to A in the morning, and B in the evening. Of course adding the time of the day will probably not improve the equation by much. The idea would be to add as many dimensions as possible. Some dimensions may be irrelevant and they should cancel themselves out, like in this case:

    • Song A in the morning: 100%
    • Song B in the morning: 50%
    • Song A in the evening: 100%
    • Song B in the evening: 50%
    In that case, you like A better than B, in the evening and in the morning. The time of the day is irrelevant. Maybe it’s only irrelevant for some songs but not for other:
    • Let it be, I like it at all times.
    • O Fortuna of Carmina Burana, please, don’t wake me up with that (or maybe yes, please do, not sure).

    Maybe it’s irrelevant for some people, but not for others. I don’t know and we don’t need to know.

    I can think of many other dimensions to add to the system and I’m sure many other people will think of more and as technology improves we’ll be able to have even more:

    • What program are you using? I want music that helps me concentrate when I’m using my text editor to write code while I don’t care much about what I’m listen to while web browsing.
    • What are you browsing? Maybe I do care about the music while I’m web browsing. Redditing and Facebooking can be done pretty much with any music, but if I’m at Lambda the Ultimate, I need something to concentrate. Even some analysis of the web site could give some important hints: lot’s of dense text, no pictures, play Mozzart; a photo blog, play whatever.
    • How are you controlling the player? Are you using the keyboard with global shortcuts? you are probably doing something else. Are you using the remote control? you are probably away from the computer. Are you using the mouse directly into the players window with the lyrics window open? Ok, let’s play something with lyrics because you probably feel like reading, maybe even signing.
    • Are you singing? When can find that out using the computer’s microphone. Let’s play things that are in your vocal range, and mostly by the same gender as you are. Let’s also play things you liked singing before.
    • Are you using only one app or switching between various apps?
    • Which apps are you switching with?
    • Is there any other sound coming out from the computer? If so, maybe soothing background music with not much volume is what the player should play.
    • Are you dancing? Let’s disco! You think that’s a tough one? Most smart phones have accelerometers in them, if you have the smart phone on your pocket I’m sure I can find out if you are in the couch or dancing, or maybe moving but not dancing. Even the raw input of the accelerometer could be used as a signal, because it’ll be different depending how tired you are and how you are dancing.
    • Are you alone? You think that’s a hard one as well? Many people are using wifi, so, what’s the strength signal received on other devices on the same network?. If another computer has a similar signal level as yours and it is being used, you probably are not alone. It could also be done using smart phones, although with a smart phone you don’t require to be in use, you require it not to be on the table. If it’s plugged into the computer, you can ignore it, if it’s flat and not moving (accelerometer again), you can ignore it.
    • Who are you with? I hope by now you realize how much we can find out. Let’s make it social, let’s have the app in every device. Why would people install it? Well, when you visit me, if you have it on your device, you’ll device will tell my computer what you like, and my computer knows what I like, so it’ll try to find a common ground for us (and it won’t trust me that much when I skip a song, because maybe it’s you skipping it). We could make you use your own smart phone to skip it, and then Pumap knows who is skipping it.
    • Who are you talking with? If you are talking with other people, using voice recognition you may identify that people, or at least how many there are. If there’s cutlery clater in the background, people are eating, let’s just play background music for a nice evening. If it’s only you speaking, maybe you are in an old land-line phone (if you were using your smart phone, Pumap would know), let’s cut the music altogether, probably it’s distracting.

    I believe this program should not work with special cases but have some very sofisticated machine learning system where we input all these signals and does the right thing. And as more signals become available, they are added and analyzed as well. I would like to have that music program! Because honestly, really, I’m not sure what music I want to listen to. I want my computer to figure it out for me.

  • As stories can be told in first person, or third person, in the form of a diary or a tale, as book or comic or movie; I was thinking that blogging could be a literarly style as well.

    I can think of two sub-genres. Historic and fantastic blogging.

    For historic imagine a blog written in the context of -70 (minus 70) years. So that on October 19th 2009 you’d get a post for October 19th 1939. Who would be the blogger? It could be an important person, what would Churchil blog? Or it could be an unnamed person, an anti-nazi frenchman for example. They could also have a Twitter account! It would be an interesting way to learn history.

    The other genre would be total fantasy. A blogger in the future, imagine if for some strange reason, blog posts of a guy surviving the singularity travel back in time? What if blog posts from a galaxy far away? I would certainly follow those blogs! But of course, it’s hard work that requires a very good writer.

    Another thing that could be applied to any fictional blogging is having a network of blogs. Imagine reading the blogs of a frenchman in the resistance, a nazi soldier, a Russian red-army member. All blogging about the same, from different perspective! What about reading the Twitter feeds of Frodo, Sam, Gandalf, Aragorn, Saruman?

    I think it would be very entertaining.

  • I like knowing when something goes wrong with my web apps, so I’m using Super Exception Notifier to get by email a report should any exception be raised in the app. If you go to Super Exception Notifier’s site you’ll see some instructions on how to add it to your project. This is how I do it.

    Add the gem requirement in environment.rb:

    config.gem 'super_exception_notifier', :version => '~> 2.0.0', :lib => 'exception_notifier'
    

    Then be sure to have gemcutter in your gem sources:

    gem sources
    *** CURRENT SOURCES ***
    
    http://gemcutter.org
    http://gems.rubyforge.org/
    http://gems.github.com
    

    If you don’t have it, you can add it this way:

    gem install gemcutter
    gem tumble

    To install the gem, in your Rails project run:

    sudo rake gems:install

    Create a file in config/initializers, I’ve called it exception_notifier.rb and inside I’ve set up the only really needed value for the notifications, the email address:

    # Notification configuration
    ExceptionNotifier.configure_exception_notifier do |config|
      config[:exception_recipients] = %w(pupeno@pupeno.com)
    end
    

    The last task is to make your application controller noisy by adding one line to it (the second one of course):

    class ApplicationController < ActionController::Base
      include ExceptionNotifiable
      #...
    end
    

    You also need to be sure that you have ActionMailer properly configured, otherwise no mail is going to get through.