ralsina is currently certified at Master level.

Name: Roberto Alsina
Member since: 2000-01-17 16:52:26
Last Login: 2010-01-19 13:43:49

FOAF RDF Share This

Notes:

I'm a 36 year old amateur (in the literal sense) programmer. I tend to code either the obvious or the weird. The real blog is at http://lateral.netmanagers.com.ar

Articles Posted by ralsina

Recent blog entries by ralsina

Syndication: RSS 2.0

Moving the feed off Feedburner

Since Google seems to be leaving behind RSS and they own Feedburner, and this site's feed is hosted there, I am regaining control of it starting now. If you are reading this site via feedburner, the new RSS feed is here

I am stopping the feedburner updates so this will be visible there as long as the service stays up.

Syndicated 2013-03-14 07:11:40 from Lateral Opinion

No, no hablo de eso.

Así que Bergoglio es papa. Sí, Bergoglio, el que dijo que en el matrimonio igualitario "está la envidia del Demonio que pretende destruir la imagen de Dios", porque la imagen de su dios discrimina.

Sí, el Bergoglio que dice que ve prostitutas de once años en la calle, pero en vez de hacer una denuncia policial lo que hace es un discurso.

Si, el Bergoglio que dijo "hay dos proyectos: el de nuestra fe, que reconoce a Dios como Padre, y hay justicia y hay hermanos. Y otro proyecto, el que engañosamente nos pone el enemigo, que es el del Dios ausente, la ley del más fuerte, o el del relativismo sin brújula" como si porque no creo en su dios soy una herramienta de su demonio, y mala persona.

Sí, el Bergoglio que dijo "Lo peor que le puede pasar a un ser humano es dejarse arrastrar inadecuadamente por las luces de la razón", y que obviamente ha resistido esa tentación por más de setenta años.

Si, ese Bergoglio ahora es el soberano absoluto de la ciudad estado del Vaticano. No, no tengo nada que decir al respecto.

Syndicated 2013-03-13 17:21:00 from Lateral Opinion

Standalone Search in Nikola

This has been in the master branch of Nikola for a while but only now have I tried to fully integrate it, and polish all (most) of the rough edges.

By default, Nikola comes with support for search forms using Google and Duckduckgo. Some people disapprove of them for different reasons [1] so there was a request about supporting a standalone search engine.

The best of breed of those things seems to be Tipue so that's what I supported.

To use this, you need to enable a plugin, and do some configuration changes.

The plugin is called task_localsearch and you can find it in the Nikola source tree

Suppose your site is in a folder called mysite then to enable this plugin you need to create mysite/plugins and then copy task_localsearch.plugin and task_localsearch in there.

Then, in your site's conf.py find these options and change them accordingly:

SEARCH_FORM = """
<form action="#" class="navbar-form pull-left">
<input type="text" id="tipue_search_input">
</form>"""

ANALYTICS = """
<script type="text/javascript" src="/assets/js/tipuesearch_set.js"></script>
<script type="text/javascript" src="/assets/js/tipuesearch.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('#tipue_search_input').tipuesearch({
        'mode': 'json',
        'contentLocation': '/assets/js/tipuesearch_content.json',
        'showUrl': false
    });
});
</script>
"""

EXTRA_HEAD_DATA = """
<link rel="stylesheet" type="text/css" href="/assets/css/tipuesearch.css">
<div id="tipue_search_content" style="margin-left: auto; margin-right: auto; padding: 20px;"></div>
"""

How does it work? Here's a demo site for you to try!

I would not recommend doing this for a big site, since it may load a multi-megabyte javascript file when you search, but for small to medium sites, it may be ok.

[1] My own reason for disapproving of duckduckgo site search? It finds nothing.

Syndicated 2013-03-12 20:09:06 from Lateral Opinion

Unfortunate Phrases by Famous People

Like this one:

When your country is at risk, everything is allowed, except not defending it.

—José de San Martín

For non-argentinian readers, imagine if that was said by a combination Washington/Lincoln level figure famous for leading three countries to get rid of the spaniards and also for a list of advices for young ladies, whose biography is titled "The saint with a sword".

So, anyway, he said that. And that phrase is bad, bad, bad, unfortunate and horrible.

It's that bad because while a nice slogan to rally farmers into becoming soldiers in the army of a nation that doesn't quite exist yet, it's awful advice for people who live in an actual nation, with actual laws, an actual army, and people who worship whatever crap you happened to say, José.

It starts with the flaky premise "when your country is at risk" which means too little, or too much, depending on just how much you need an excuse to do something horrible.

If you really want to be a bad person, I am sure you can convince yourself that gays, immigrants, foreigners, muslims, jews, the young are all a danger to your country, somehow. You just need to stretch "danger" a little or maybe push "your country" somewhat.

And once you jumped that hurdle, and you are convinced your "country" is "at risk", why, then you can do anything. Unsurprisingly this stupid line is often framed in military offices, and is a tired trope in military speeches.

I quite like José de San Martín. This quote, however, is unfortunate.

Syndicated 2013-03-11 18:15:34 from Lateral Opinion

Doing Your Homework, With Style

Note

The original poster claims this is not a school homework. Accepting that, it still doesn't mean how to answer to homework requests is not worthy of discussion.

As usual in all programming lists, every once in a while someone will post a question in the Python Argentina list which is obviously his homework. To handle that there are two schools of thought.

  1. Telling the student how to do it is helping them cheat.
  2. Telling the student how to do it is teaching him.

I tend more towards 1) but I think I have discovered a middle road:

1.5) Tell the student a solution that's more complicated than the problem.

That way, if he figures out the solution, he has done the work, and if he doesn't figure it out, it's going to be so obviously beyond his skill the teacher will never accept it as an answer.

As an example, here's the problem for which help was requested:

Given an unsorted list of two-letter elements (une lowercase, one uppercase), for example:

['eD', 'fC', 'hC', 'iC', 'jD', 'bD', 'fH', 'mS', 'aS', 'mD']

Sort it by these criteria:

  1. Create subsets according to the uppercase letter, and sort them by the number of members in ascending order, like this:

    ['fH', 'mS', 'aS', 'fC', 'hC', 'iC', 'jD', 'bD', 'eD', 'mD']
    
  2. Then sort each subset in ascending order of the lowercase letter, like this:

    ['fH', 'aS', 'mS', 'fC', 'hC', 'iC', 'bD', 'eD', 'jD', 'mD']
    

Ignoring that the problem is not correctly written (there are at least two ways to read it, probably more), I proposed this solution, which requires python 3:

from collections import defaultdict
d1 = defaultdict(list)
[d1[i[1]].append(i) for i in  ['eD', 'fC', 'hC', 'iC', 'jD', 'bD', 'fH', 'mS', 'aS', 'mD']]
{i: d1[i].sort() for i in d1}
d2 = {len(d1[i]): d1[i] for i in d1}
print([item for sublist in [d2[i] for i in sorted(d2.keys())] for item in sublist])

This produces the desired result: ['fH', 'aS', 'mS', 'fC', 'hC', 'iC', 'bD', 'eD', 'jD', 'mD'] but it's done in such a way that to understand it, the student will need to understand roughly three or four things he has probably not been taught yet.

Syndicated 2013-03-10 20:23:32 from Lateral Opinion

698 older entries...

 

ralsina certified others as follows:

  • ralsina certified ralsina as Journeyer
  • ralsina certified kuro5hin as Journeyer
  • ralsina certified cmc as Journeyer
  • ralsina certified acme as Journeyer
  • ralsina certified Svartalf as Journeyer
  • ralsina certified taj as Master
  • ralsina certified tronical as Master

Others have certified ralsina as follows:

  • ralsina certified ralsina as Journeyer
  • kai certified ralsina as Journeyer
  • xach certified ralsina as Journeyer
  • strlen certified ralsina as Journeyer
  • Acapnotic certified ralsina as Journeyer
  • cannam certified ralsina as Journeyer
  • scottj certified ralsina as Journeyer
  • mjs certified ralsina as Journeyer
  • andrei certified ralsina as Journeyer
  • kuro5hin certified ralsina as Journeyer
  • cmc certified ralsina as Journeyer
  • marcelo certified ralsina as Journeyer
  • higb certified ralsina as Journeyer
  • cbbrowne certified ralsina as Journeyer
  • charlie certified ralsina as Journeyer
  • nixnut certified ralsina as Journeyer
  • Svartalf certified ralsina as Journeyer
  • bruder certified ralsina as Journeyer
  • jono certified ralsina as Journeyer
  • manu certified ralsina as Journeyer
  • jhasler certified ralsina as Journeyer
  • taj certified ralsina as Journeyer
  • tronical certified ralsina as Journeyer
  • jarod certified ralsina as Journeyer
  • neil certified ralsina as Master
  • tackat certified ralsina as Journeyer
  • Guillaume certified ralsina as Journeyer
  • maragato certified ralsina as Journeyer
  • fxn certified ralsina as Journeyer
  • pcburns certified ralsina as Journeyer
  • badvogato certified ralsina as Journeyer
  • ittner certified ralsina as Journeyer

[ Certification disabled because you're not logged in. ]

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!

X
Share this page