Unstable Prototypes (Big Sigma, #2)
Review:Didn't like it quite as much as the first one, but not bad at all. Looking forward to the next book in the series. |
Review:Didn't like it quite as much as the first one, but not bad at all. Looking forward to the next book in the series. |
Yes, I know that's not a real word.
So, the git master of Nikola now has plugins. In fact, not only does it have plugins, but is basically made of plugins.
You see, the code used to mostly be inside a class (called Nikola), and ... it had grown. That class had grown up to around 2000 lines of code. Which is completely ridiculous.
So, using Yapsy I turned the code inside out: almost all the code that was in that monster class was moved into plugins and the class turned into a smart plugin loader.
This has brought several advantages:
Now you can extend Nikola for your own purposes. Just create a plugin folder in your site, and put the extra functionality there.
Support for whole categories of things is now modular. Want to support a different markup? A different template system? Just write a plugin.
Want to add completely new functions to Nikola? Like, say, a way to import data from another blog tool, or something like planet software? Well, just add a "command plugin".
What has changed for the user?
You can delete dodo.py
from your site.
Use nikola build
instead of doit
Use nikola serve
instead of doit serve
Some minor things still need doing in this area (notable, fixing the docs), but the main refactoring is there.
Before I gave up on becoming an educated man, I studied math. And to this day it pisses me that noone has figured out how to make math interesting to the math-averse. Here's a small attempt.
Let's consider the following scenario, based completely on things I know, not things I do ;-)
Suppose that in a city called San Isidro, there is a house. Houses in San Isidro pay a municipal tax, in exchange for the service of garbage collection, street sweeping, tree trimming, and street lighting.
It's a very small tax, but let's say it's $100 a month because it's a nice, easy to handle number.
Also, San Isidro is in a country called Argentina. In that country there are several laws that affect the home owners:
You can't sell a house if you owe any taxes.
The owner has a 1% chance of wanting to sell the house each month.
Debts expire after 5 years.
If you are sued and you lose, you pay they other guy's lawyer fees.
Lawyer fees are capped to 25% of the money being disputed.
Lawyers are reluctant to help you sue someone if they get very little money (defined as less than $2000)
If sued by the city for owed taxes, the owner always loses.
Unpaid taxes accrue 2% compound interest monthly. So, if you don't pay your $100, you will owe $102, then $104.04, $106.0128 etc.
With all those elements in place, let's play a game called "Tax Golf"!
The game is played by an indetermined number of players called owners and one special player called city.
The game is played to 100 "months" or until all property has been sold.
The goal of the game, for the owners, is to pay as little money as they can. The score is calculated like this: amount of money you paid divided by the time you owned the house.
The owner with the lowest score is the winner.
The goal of the game for the city, is to get as much money as he can. He's not competing against the players, for him it's a sort of solitaire where he competes against his past performance.
This, my friends is math. Math is a tool that helps you (among other things) do the right thing in this sort of complicated, arbitrary, real life scenario.
So, what's a good strategy for a owner, and for the city?
In a second post next wednesday, I will give some answers to those questions, using python.
Review:This book is what it is. If what you want is a fun book about a guy who gets in a lot of trouble and then gets out of trouble (genre I think should be given a nice long german word for a name), this is one, and good at it. |
Thanks to the cooperation of Humitos who gave me his wordpress backup, I did some improvements in the wordpress.com import feature of Nikola, my static website/blog generator
So, if you were to try to use nikola_wordpress_importer
from master now, it would:
Not crash ;-)
Download attachments
Fix links to attachments so they work on the new site
However, I am now unsure of what exactly is in wordpress.com's export XML file. The posts themselves are in this form:
Muchas gracias Nico por hacer el video este. Groso, quedó muy bueno. [youtube=http://www.youtube.com/watch?hl=es&v=882qxARXa6c]
Two things jump to me:
That's not HTML
WTF is that youtube thing?
I am having some success processing it as markdown, since that handles the paragraph breaks and some other stuff. Maybe the youtube embedding is done with a markdown extension?
Anyone knows?