Posts about python (old posts, page 38)

2012-06-01 13:05

How I Prepare to Speak

  1. Be asked to speak
  2. Be unsure about it for a few days
  3. Be asked if you are going to move your ass and do it already
  4. Think title
  5. Send proposal at deadline +/- 48 hours
  6. Spend the next week or two thinking of cancelling
  7. Figure out what the title means
  8. Spend the next N-1 weeks until the conference with a constant dialog in your head about what you should talk about
  9. Turn that constant unorganized dialog into a little story
  10. Write down the story headings in slides
  11. Attend the conference
  12. Sit in the back while you polish slides
  13. Start talking
  14. Show slides
  15. Stop talking

2012-05-16 17:23

Hack English Instead

Lots of noise recently about Jeff Atwood's post about why you should not learn to code. I am here now telling you you should learn to code. But only after you learn a few other things.

You should learn to speak. You should learn to write. You should learn to listen. You should learn to read. You should learn to express yourself.

Richard Feynman once described his problem solving algorithm as follows:

  1. Write down the problem
  2. Think real hard
  3. Write down the solution

Most of us cannot do that because we are not Richard Feynman and thus, sadly, cannot keep all the solution in our head in step 2, so we need to iterate a few times, thinking (not as hard as he could) and writing down a bit of the solution on each loop.

And while we who code are unusually proud of our ability to write down solutions in such a clear and unforgiving way that even a computer can follow them, it's ten, maybe a hundred times more useful to know how to write it down, or say it, in such a way that a human being can understand it.

Explanations fit for computers are bad for humans and viceversa. Humans accept much more compact, ambiguous, and expressive code. You can transfer high level concepts or design to humans much easier than to computers, but algorithms to computers much easier than to humans.

I have a distrust of people who are able to communicate to computers easier than with fellow humans, a suspicion that they simply have a hole in their skillset, which they could easily fix if they saw it as essential.

And it is an essential skill. Programmers not only run on coffee and sugar and sushi and doritos, they run on happiness. They have a finite endowment of happiness and they spend it continuously, like drunken sailors. They perform an activity where jokingly they measure productivity on curses per hour, a lonely endeavour that isolates them (us) from other humans, from family and friends.

If a developer cannot communicate he isolates. When he isolates he can't cooperate, he cannot delegate. He can't give ideas to others, he can't receive them, he can't share.

And since lots of our communication is via email, and chat, and bug reports, and blogs, it's better if he can write. A developer who cannot write is at a serious disadvantage. A developer who cannot write to express an idea cannot explain, he doesn't make his fellows better. He's a knowledge black hole, where information goes to die behind the event horizon of his skull.

So, learn to write. Learn to speak. Learn to read and listen. Then learn to code.

2012-05-15 22:05

Nikola Plans

System Message: ERROR/3 (<string>, line 1)

Document or section may not begin with a transition.

I have not stopped working on Nikola, my static site generator. Here are the plans:

  1. Finish the theme installer (so you can get a theme from the site easily)
  2. Implement a theme gallery on the site (same purpose)
  3. Fix a couple of bugs
  4. Update manual
  5. Polish a few theme bits
  6. Release version 3.x (new major number because it requires manual migration)

After that, I will push on projects Shoreham (hosted sites) and Smiljan (planet generator) and make them more public. Shoreham will become a real web app for those who don't want to have their own server. For free, hopefully!

Once I have that, I have no further feature ideas, really. So I need more people to start using it, and that means I have to start announcing it more.

So, stay tuned for version 3.x sometime next week.

Post-Nikola, I will do a rst2pdf release, and then will get back to work on a book.

2012-05-09 11:35

Yendo Para PyCon

This is a short story, in spanish, so if you want to read it, click here

2012-05-08 10:54

Changing Color Schemes and Fonts in Nikola

One of the easiest ways to personalize how your site looks is using color and typography. While Nikola's "site" theme is intended to be rather bland and neutral, it doesn't have to be that way, and it's easy to change.


Bland, solid and boring.

To do these changes, you don't even need to know any CSS, HTML, or programming!

Here's the trick: Nikola is using Twitter Bootstrap to handle its styling. And they provide a handy web form to create a customized version, just for you, at their customize page.

So, if you want auvergine navigation bars and avocado backgrounds, with courier fonts all over the place, that's where you do it. Just change the value in the right variable to whatever color you want.

Once you have your, go to your site's folder, and create themes/mytheme/assets and unzip it in there, so that you have themes/mytheme/assets/css, themes/mytheme/assets/js, etc.

Create a file called themes/mytheme/parent containing the word site.

Then edit your (or if you are using the git master) and change the THEME option "mytheme".

Rebuild your site, and voilá, all your customizations are now in place.

This awfulness, for example, was done by setting just three variables (bodyBackground, textColor, and sansFontfamily):


Yes, I had a C64.

2012-05-07 13:52

PyDay Luján 5/5/2012

This saturday I attended Pyday Luján. I don't know if other places have such things as PyDays, so here's a brief summary:

  1. It is a day-long event
  2. It usually takes place in a university
  3. It has one or two tracks
  4. It's about python
  5. It's fun

This time, it took place at the Universidad Nacional de Luján which is a biiiiit too far from my home:

View Larger Map

Luckily Facundo Batista was going, and he's a driver, not a pedestrian, and took me there.

I was to speak about "Doing one thing and doing it right". These are the boring slides:

I you don't see them up there, go here.

I really, really wanted to record this. But I failed. So, combining that with my reluctance about repeating myself, it means this thing will only ever be seen by those who were there last saturday.

Great fun was had, an unwise number of choripanes was eaten, and lots of interesting conversations occured.

Hopefully soonish there will be some pictures, too (although I did not take any).

So, thanks to Yamila and the rest of the Luján organizers!

2012-05-02 10:36

PyDay Luján!

The title is "Doing one thing and doing it well" and it's not even fully haped in my head yet, which is usually a good sign.

So, come join me and a bunch of smarter people talking about programming for a whole day, for free. It will be fun!

Mentioning this blog gets you candy. Just saying.

2012-04-27 18:52

Shoreham: Blogging with Ubuntu One (a teaser)

So, today, I ripped off a great service offered by and implemented a prototype blog-through-Ubuntu-One web application. Of course, it's powered by Nikola,

The code is absolute nonsense, and it needs to be looked at by someone who understands Django, OAuth, OpenID, and programming in general better than I do, but hey, it does work (for a very loose definition of "work").

It's called Shoreham and no, you can't have it yet.

As a teaser, here's a video. With a pony.

In the near future I will do a better post about this explaining the code, etc.

2012-04-24 22:46


Alva is almost the opposite of Nikola. If Nikola is about making static sites, Alva is a dynamic site. However, as Hegel suggests, from the thesis and the antithesis comes the synthesis.

So, Alva is about dynamically creating static sites. If you want to have Nikola in your server instead of in your own computer, and have the convenience of an online tool, that's the niche Alva tries to fill.

So, you would install Alva, and use it like any other web-based blogging tool. Yet, behind the scenes, you would have Nikola, and all the performance and security benefits of static sites.

And maybe someday, I (or someone) will put up a multi-user version of Alva, and you will be able to get hosted blogs, knowing all the data is yours and you can leave anytime and do your own thing.

This is very very early stages. So early it does not work yet. But here's a teaser:


There is no firm timeframe for this, it depends on a ton of other stuff and may not even happen.

Contents © 2000-2019 Roberto Alsina