Older blog entries for ralsina (starting at number 672)

Mama Don't Let Your Baby Grow Up To Be a Cowboy^W Lisper

Forget about it, cowboys are fine. Let them grow up to be cowboys, I don't care. But Lispers... nah. Ok, no, there isn't anything wrong about Lisp, or about using Lisp, or about people that use Lisp.

There is, however, something wrong about being a Lisper, the kind of person that takes advantage of any moment to look down on any code and say "oh, this in Lisp would be cleaner/easier/shorter/faster/trivial/whatever".

And I must confess I have become that person, but with Python instead of Lisp. So I will be doing some non-python coding projects this year. Because closeness means bad perspective, and because I don't want to be that person.

So, C++ here I come (back). I see you've changed. So have I. Let's give us a chance.

Syndicated 2013-01-08 08:41:28 from Lateral Opinion

The Golden Ring

When I was in Paris, it happened to me ten times or more. Walking on a public place, a man or a woman would pop out of nowhere, golden ring in hand, and say "hey, mister, is this yours?"

It's a well known scam. You get to keep the ring, and the ring bearer will ask you for some compensation. It will turn out the ring is worthless, so you will be out a couple of euros or so.

It's interesting in some ways, though.

  • It relies on the victim being dishonest, since the ring is not theirs.
  • The amount of money gained by the scammer is at the victim's discretion.
  • If you don't give the scammer anything, he will, at most, yell at you for being a cheap bastard, and it's done in very public places, so the danger of violence is negligible.
  • Since the victim is also doing something morally reprehensive, and lying, the risk of the scammer being charged with anything is negligible.

It's almost like some sort of weird sale:

"Here's something of no value that looks valuable! Is it yours? (I know it isn't)" "I will bet on it being valuable and pretend it's mine!" "So, how much is appeasing your remorse about scamming me out of a probably worthless ring worth?" "I'd say 3 euros, my good man!" "Deal!"

How can it be worth their while to do this? I would guess their success rate at perhaps 5% and they probably don't make more than 5 euros on a successful transaction

All in all, it seems fairly harmless, just annoying, and french people have actually chased me down the street to return me something I forgot in a bar. Then again, I also was peed on a foot by a badly burn-disfigured guy in a wheelchair, on Champs Elysees, so YMMV.

Syndicated 2013-01-03 12:08:58 from Lateral Opinion

2012

So, this is 2013. Could have fooled me if you claimed it was 2012. I did a resolutions post a year ago. How did it go?

  • I aimed to write a post a day. That was 366 posts, and I failed miserably. I did post 215 times, though, which is a heck of a lot.
  • I aimed at improving at my work. I think I did do better for a while, and dipped a little near year's end because of tiredness. I will give myself a pass there.
  • My health got better. I did lose some weight (although I recovered some of it) and my blood pressure is looking good. My energy levels have improved.
  • My marriage is doing much better. Probably happiest since 2008.
  • I did not get my teeth fixed because of insurance issues. That should be ok after march.

As bonuses:

  • Took my mom to Paris.
  • Made some moves to achieve financial security in the far future.
  • I gave the closing conference at PyconAr
  • I revived my free software projects

So, not horrible!

As for 2013:

  • Again, will try to get my mouth fixed.
  • Will try to lose much more weight.
  • I will aim for 200 posts.
  • I will try to finally write a whole book.
  • I will have eye surgery to get rid of the glasses.

We'll see how that goes.

Syndicated 2013-01-01 20:55:09 from Lateral Opinion

Client-rendered, one-URL, dynamic, static site.

My vacations end tomorrow. So, the time to spend hacking fun, personal, free stuff is going to be limited because of the time spent coding fun, free stuff for money. So, I decided to finish with a bit of whimsy.

I implemented a completely client-rendered, one-URL, dynamic blog. Which is actually totally static.

In fact, that blog is this blog, just with a twist. If you go to this URL you will see what's basically this very site, with comments and everything as usual. But if you click on "Previous Post" ... well, it stays in the same page, even though it displays a different post :-)

The magic is the new, experimental, dynamic task_mustache plugin for my static site generator, Nikola. which does the following:

  1. Renders post data as JSON files instead of HTML
  2. Creates a HTML file that is really a mustache.js template
  3. Creates a HTML file with some bits of Javascript that loads the template and the newest post's data.
  4. If you access that mustache.html with a fragment, it uses that to fetch JSON data and rewrite itself.

And that's it. It actually loads fast, and regenerates very fast, since it does much less than the real site. There are a bunch of things that will dump you out of the "dynamic" site, like tag links, and whatever, but it works surprisingly well (and if you want to theme it, it's just one template).

This is the first of a new kind of thing for Nikola, the "extra plugins". Basically, stuff that is too weird, specific or useless for the general distro, will go there, and to use those plugins, you have to create a plugins/ folder in your site and add it there manually.

Enjoy!

Syndicated 2013-01-01 19:03:43 from Lateral Opinion

Nikola 5.1 released.

Nikola , my static blog/site generator. Details, changelog, etc, at Nikola's site

Syndicated 2012-12-31 20:48:33 from Lateral Opinion

Creating a Theme for Nikola From Scratch (almost)

There is some documentation about creating themes for Nikola, but maybe a tutorial is also a useful way to explain it. So, here it is. I'll explain how to create a theme (almost) from scratch. Alternatively, you can take an existing theme and modify only parts of it via inheritance, but that's for another document.

I will try to create a theme that looks like Vinicius Massuchetto's Monospace Theme.

Read more...

Syndicated 2012-12-28 21:12:38 from Lateral Opinion

Nikola Feature-by-request: tag cloud!

I asked for feature requests for Nikola my static site generator. I got some. One was from long-time user Kay Hayen, so I just couldn't say no.

He asked for tag clouds. Look:

Anything in here will be replaced on browsers that support the canvas element

Cute, isn't it? And it's real, actual tag data from this very site. With links!

How it's done:

Nikola generates a JSON file that has the cloud data (tag name, size, link), and that's processed by JQuery and tagCanvas and ... well, it works.

You have to add jquery.tagcanvas.min.js somewhere and embed a whole pile of raw HTML (see here for details) but hey, it works.

Hope you are happy, Kay, you made me code javascript, dude ;-)

It's probably rather "easy" to make it use any of these instead of tagCanvas if anyone is so inclined.

Syndicated 2012-12-27 22:31:23 from Lateral Opinion

New in Nikola: slideshows (work in progress)

This is nowhere near ready for release, but why not show it?

Nikola can now turn this:

.. slides::

   /galleries/london-paris-2012/P1000198.JPG
   /galleries/london-paris-2012/2P1000235.JPG
   /galleries/london-paris-2012/3_P1000298.JPG

Into this (which will not look good in RSS):

Missing:

  • Customization
  • Support for slideshows that are not made of images
  • Styling

This is based on slidejs which seemed neat, but I am not 100% sure it's the way to go (it seems to look bad if the images are not all the same width, for example).

Syndicated 2012-12-27 13:52:22 from Lateral Opinion

Why Use Something Else?

I wrote a static site generator, called Nikola a while ago, and it's starting to get some adoption and contributions.

I think it's a fairly nice piece of code, to be honest, and it pretty much does everything I need. On the other hand, it's fun to code with.

So, if you are using another static site generator, or are researching into it, or just have opinions about it... what's missing? What should it have that it doesn't have now?

No feature too small, no idea too crazy, please share! I promise to make a good effort to implement any that seem like a good idea :-)

Syndicated 2012-12-26 20:22:58 from Lateral Opinion

New in Nikola Master: Interactive Console

Inspired by Django's interactive console, I added one to Nikola, so that if you want to play with its internals, you can do it easily. Here's an example session:

$ nikola init pepe
A new site with some sample data has been created at pepe.
See README.txt in that folder for more information.
$ cd pepe
$ nikola console
Scanning posts
.
.
done!
You can now access your configuration as conf and your site engine as SITE
>>> [p.title('en') for p in SITE.timeline]
[u'Listings Demo', u'Nikola: it generates static', u'Welcome to Nikola',
u'A reStructuredText Primer', u'A reStructuredText Reference', u'Sample
Nikola Config File', u'The Nikola Handbook', u'Theming Nikola']

Have fun!

Syndicated 2012-12-25 19:34:09 from Lateral Opinion

663 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!