A regular Tuesday at the Forsk

Tuesday Forsk yesterday, it was awesome.

Just great. People were their normal selves, but everyone just had that extra edge of greatness that night.

It begun with a minor planning meeting in one corner. Pragmatic. Anna F came by and planned her workshop.

StG had worked on his Rbox project, and murmured “Do you want to help program this beast?” and muttered something about the eZ80 programming environment. Suddenly, there’s a noise “yeah, it’s the MOD player I built in” and later there were graphics. “It works!” he cried, at one point, and everybody rushed to, to see the greatness. There was greatness. I won’t spoil the greatness, you can witness it at Hacknight this Saturday.

In one corner, a PHP discussion group formed, as I had installed crisis mapping software Ushahidi — which is written in PHP. “Why do they tell me to program everything in Java?” a confused PHP user asked me. I answered. “What’s a class, really?” someone else asked. I answered. “Does PHP have to be so bad?” a third person asked, and me and qzio answered, by displaying how magic methods __call, __set and __get work. qzio also showed a PDO class wrapper, which might well see action at someone’s workplace.

Some film-makers were present, scouting the location, fitting the images in their heads. It will be a glorious documentary.

A great time was had by all.

Malmö tech city

A summer’s rainy morning in Malmö.

I’ve just hopped off the morning train from Copenhagen, clutching a crumpled paper that I just finished. I got wind of it through the NoSQL Summer reading club’s Malmö instance.

On the way into the office, I saw my FOSS friend T, waiting for a car. Handing him the printed copy of the paper, I enjoyed a few minutes of database banter before heading into the building.

This is how I want my tech community to be like. Present, alive, and friendly. Thanks!

You can follow nosqlsummer on Twitter. Below is their pitch.

A seasonal, worldwide reading club for databases, distributed systems & NOSQL-related scientific papers.

A NOSQL Summer is a network of local reading groups, that will decipher & discuss NOSQL-related articles, from late June to early September 2010. Each group sets its own meeting pace (usually once a week or once every two weeks) and select which papers are up for discussion.

At every cycle, members read the selected paper at home and then meet up for an hour or so to discuss, debate and answer their own questions.

We then encourage you to produce an annotated version of the paper, or short summary that we can then publish here for the rest of world to peruse.

Please note that, in most cities, you do not need to sign up to attend NOSQL Summer meetings. You just need to have read the paper planned for the week by your local chapter and show up at the designated meeting place!

Feel free to skip a meeting or jump in at any time. We’re trying to make this low-maintenance and flexible, for everybody to get a chance to learn more about a fuzzy concept that’s here to stay.

Upcoming meetup poster: active redesigning and customizing

Prettify your web apps

Indulge me. I allowed myself to make a little poster.

Öresund JavaScript Meetup #10 on June 14, in Malmö, at Hypergene’s offices.

I guess there are a couple of things wrong with it. The date and time are lacking. Monday June 14. At 19.00. The URL says those things. (But people looking at a poster can’t click it.)

These guys would disapprove.

Update: Now, I went and added that stuff.

Still, the workshop will be great.

Outsider architects

Watts Towers, (yes, that Watts) built by an Italian immigrant (to the USA).

In Europe, same weirdness appears:

1879 – 1912
33 years of struggle
10 000 days
93 000 hours

Ferdinand Cheval was a French postman, who built “Le Palais Idéal” by working in his spare time. Here’s a Wikipedia picture:

Le Palas Idéal

Here is a large portrait of the artist who had the slogans: “The work of one man” and “Let those who think they can do better try”.

“Discover the postman’s palace” says the website Facteur Cheval. His work is now a protected cultural legacy.

Impressed.

Penrose: end-of-level math boss, or raving weirdo?

Roger Penrose, math rockstar, who later in life began to write longer and longer works. In new areas. Ever read any of his stuff?

I never did. I did read Neal Stephenson’s Anathem, and the plot contains tiling problems, quite clearly modeled on the idea of Penrose being a bad-ass math person. Anathem‘s the kind of work which makes fans create wikis about it. They want to stay in that land. I felt that the story about the “mathic world” was the strongest one in the book, and I was a little put off when the plot began to move (at the latter half of this brick of a book).

At FSCONS, someone made a simile with monastic life and working with the Open Source Ecology project. Kyrah whispered “Did you read Anathem, yet?” I nodded. A moment of geek-to-geek friendship.

Etching nametags, collection of resources

Looking around for etching stuff. People with machines have a lack of taste.

Explanation of what I want to do. Make signs, one for each engineer.

I admire his technical skill

Envious of these machines

a Polish website on laminates have pictures. They mention Rowmark (“Great people, great plastic”. Amazing.)

Do you have any thoughts or ideas on this matter? Done anything? Ever had a good nametag? Ever bought one? Do you have picture links to good ones?

Python Markdown extension example

The Python Markdown module, perhaps outdated, but the one that I use, can be extended using plugins. Here is a plugin I needed and built. It adds a user-specified CSS class to the generated P tags. It draws heavily on the examples at the above website. (I also had to read the code.)

# the name "markdown" was taken, in my module, so I aliased it
import markdown as markdownmodule
class ClassAdderTreeprocessor(markdownmodule.treeprocessors.Treeprocessor):
    """Markdown extension for h.markdownWithCssClass()"""
    def run(self, root):
        self.set_css_class(root)
        return root

    def set_css_class(self, element):
        """Sets class attribute of P tags to configured CSS class."""
        for child in element: 
            if child.tag == "p":
                child.set("class", self.ext.getConfig("css_class") ) #set the class attribute
            self.set_css_class(child) # run recursively on children

class ClassAdderExtension(markdownmodule.Extension):
    """Markdown extension for h.markdownWithCssClass()"""
    def __init__(self, *args, **configs):
        # define default configs
        self.config = {
            'css_class' : ["something-css-like",
                           "Set class name for p tags - Default: something-css-like"]
            }
        # Override defaults with user settings
        for key, value in configs.items():
            self.setConfig(key, value)

    def extendMarkdown(self, md, md_globals):
        # Insert a tree-processor that adds the configured CSS class to P tags
        treeprocessor = ClassAdderTreeprocessor(md)
        treeprocessor.ext = self
        md.treeprocessors['css'] = treeprocessor

def markdownWithCssClass(txt, cssClass):
    """Works like markdown() but adds given CSS class on generated P tags."""
    ext = ClassAdderExtension(css_class=cssClass)
    md = markdownmodule.Markdown(extensions=[ext], safe_mode='escape')
    html = md.convert(txt)
    return html

Have you written a plugin for this thing? Any other comments? Which Markdown processor in Python should I be using if not this one?