altre destinazioni

ultimi post

ultimi commenti

tag principali

archivi

powered by

  • WPFrontman + WP

friends

copyright

  • © 2004-2011
    Ludovico Magnocavallo
    tutti i diritti riservati

Categories, Date Archives or both?

17 settembre 2004

I’m rewriting the mess of scripts I use to manage this site to give them more stability, something like an architecture, and to add some important features. Up until tonight I knew how to implement categories and archives, then when I was walking the dogs (which is my usual — and only — zen-like moment) I started wondering what should happen to archives when you are inside a category.

I have always thought of categories as just a kind of alternative, filtered index and syndication pages for new entries. It’s a good feature, one that not all blogs use, which better defines entries and allows me to offer only my Python category feed to planetpython without cluttering it with unrelated stuff. And I always thought of archives as, well archives, a date-based hierarchy ordered by year/month and possibly day, where for each date you have an index page offering different levels of details on the relevant entries, eg a blog/2004/ page with entry titles, a blog/2004/January page with titles and abstracts, and so on.

But what should happen when you’re looking at a category page, and click on an archive link? Should you get a filtered archive page displaying only Python entries for that period? Does it make any sense, would it be useful? Or are archives just “storage”, a different sort of categorization, unrelated to categories? Is it enough to show the entries’ categories in the archives pages (eg next to the tile in the year view), to allow people to “visually” filter out entries?

Tangled in these deep thoughts, I came back home and had a look at a few well known blogs. Guess what? Everybody does things differently. Some blogs have categories, some archives, some both but categories are just index pages with no effect on archives, etc. Since I will be generating static .html pages the difference in implementing category archives will be huge, not in terms of code but in terms of time taken to rebuild the site, and load on the storage backend. But then you won’t need to rebuild the site that much (publishing or modifying an entry means regenerating only the relevant pages), and you might gain something in search engines visibility by more deeply crosslinking your site. Uhm…..

Rilasciato Gnome 2.8

15 settembre 2004

In perfetto rispetto delle scadenze prefissate, è stato rilasciato oggi Gnome 2.8. Come già scritto in passato, le innovazioni principali sono: un nuovo sistema per la gestione dei tipi di file che sarà a breve unificato con quello di KDE; discovery delle risorse di rete tramite Rendezvous; automounting delle periferiche removibili; nuovi temi per il desktop, tra cui Glider; una nuova gestione delle preferenze di tastiera; una nuova gestione degli applet del panel; integrazione tra il calendario del panel e quello di Evolution; l’inclusione di Evolution 2.0, e altre innovazioni minori.

Concierto

15 settembre 2004

Jim Hall - Concierto

I’m at work trying to decide what to do about the Swiss job (the offer is so-so, and they’re rushing things a bit too much for me to feel comfortable), compiling a UML editor for Linux, and listening to “Concierto de Aranjuez” from Jim Hall’s Concierto. It’s a sad, beautiful, and romantic song composed by Spanish composer Joaquin Rodrigo Vidre between 1938 and 1939, and performed by Jim Hall accompanied by a stunning Jazz supergroup formed by Chet Baker, Paul Desmond, Roland Hanna and Ron Carter. It doesn’t help my already blue mood, but it’s definitely a masterpiece.

LinuxWorld Conference and Expo 2004

15 settembre 2004

Mancano ancora due giorni prima che vengano chiuse le registrazioni gratuite al LinuxWorld Conference and Expo 2004, che si terrà a Milano da mercoledì a venerdì della settimana prossima (22-24 settembre 2004) al Crowne Plaza Milan Linate di S. Donato Milanese.

HTTP Status Codes (linked to RFC2616)

15 settembre 2004

As I cannot sleep since I got woken up by a loud burglar alarm nearby, I might as well post something new here. Recently I had the need to display hits on a web site grouped by HTTP status code, so to turn a quick few lines of code into something a bit more interesting, I decided to display each status code in the summary cross-linked to the relevant part of the HTTP 1.1 specification.

The spec looks like a docbook-generated HTML set of pages (just a guess) with sections and subsections each having a unique URL built following a common rule, so once you have a dict of status codes:section numbers, it’s very easy to build the links:

HTTP_STATUS_CODES = {
    100: ('Continue', '10.1.1'),
    101: ('Switching Protocols', '10.1.2'),
    200: ('OK', '10.2.1'),
    201: ('Created', '10.2.2'),
    202: ('Accepted', '10.2.3'),
    203: ('Non-Authoritative Information', '10.2.4'),
    204: ('No Content', '10.2.5'),
    205: ('Reset Content', '10.2.6'),
    206: ('Partial Content', '10.2.7'),
    300: ('Multiple Choices', '10.3.1'),
    301: ('Moved Permanently', '10.3.2'),
    302: ('Found', '10.3.3'),
    303: ('See Other', '10.3.4'),
    304: ('Not Modified', '10.3.5'),
    305: ('Use Proxy', '10.3.6'),
    306: ('(Unused)', '10.3.7'),
    307: ('Temporary Redirect', '10.3.8'),
    400: ('Bad Request', '10.4.1'),
    401: ('Unauthorized', '10.4.2'),
    402: ('Payment Required', '10.4.3'),
    403: ('Forbidden', '10.4.4'),
    404: ('Not Found', '10.4.5'),
    405: ('Method Not Allowed', '10.4.6'),
    406: ('Not Acceptable', '10.4.7'),
    407: ('Proxy Authentication Required', '10.4.8'),
    408: ('Request Timeout', '10.4.9'),
    409: ('Conflict', '10.4.10'),
    410: ('Gone', '10.4.11'),
    411: ('Length Required', '10.4.12'),
    412: ('Precondition Failed', '10.4.13'),
    413: ('Request Entity Too Large', '10.4.14'),
    414: ('Request-URI Too Long', '10.4.15'),
    415: ('Unsupported Media Type', '10.4.16'),
    416: ('Requested Range Not Satisfiable', '10.4.17'),
    417: ('Expectation Failed', '10.4.18'),
    500: ('Internal Server Error', '10.5.1'),
    501: ('Not Implemented', '10.5.2'),
    502: ('Bad Gateway', '10.5.3'),
    503: ('Service Unavailable', '10.5.4'),
    504: ('Gateway Timeout', '10.5.5'),
    505: ('HTTP Version Not Supported', '10.5.6')}


def getHTTPStatusUrl(status_code):
    if not status_code in HTTP_STATUS_CODES:
        return None
    description, section = HTTP_STATUS_CODES[status_code]
    return '''<a
        href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec%s"
        >%s - %s</a>''' % (section, status_code, description)

To get and parse the server log files, and store them in MySQL I’m using a small app I wrote with a colleague at work in Python (what else?), which started as a niche project and may become a company standard. The app uses components for both the log getting (currently http:// and file://) and parsing (our apps custom logs, and apache combined), uses HTTP block transfers to get only new log records, and a simple algorithm to detect log rotations and corruptions. The log records may be manipulated before handing them off to the db so as to insert meaningful values (eg to flag critical errors, etc.). The app has a simple command line interface, uses no threading as it would have complicated development too much (we use the shell to get registered logs and run one instance for each log), and has no scheduler, as cron does the job very well. At work, it is parsing the logs of a critical app on a desktop pc, handling something like 2 million records in a few hours, and it does it so well we are looking into moving it to a bigger machine (maybe an IBM Regatta) and DB2 (our company standard), to parse most of our applications logs and hand off summaries to our net management app. It still needs some work, but we would like to release its code soon. If you’re interested in trying it, drop me a note.

Firefox 1.0 Preview Release e Live Bookmarks

14 settembre 2004

Live Bookmarks in Firefox 1.0

È stata rilasciata oggi la Preview Release di Firebird 1.0, il noto browser di Mozilla. Tra i tanti miglioramenti di questa release, è stato inserito il supporto a Live Bookmarks, che consente di aggiungere news feed come "bookmark intelligenti", che possono essere aggiornati e visualizzati come cartelle contenenti i link agli articoli del feed. Un primo passo verso una migliore integrazione tra browser e syndication, e una funzionalità utile per chi non intende utilizzare un aggregatore di news specializzato.

NetFront per S60 con attivazione gratuita

13 settembre 2004

I possessori di cellulari Nokia con sistema operativo S60 possono scaricare la versione di prova del browser NetFront e, postando le loro impressioni d’uso, ricevere una chiave di attivazione gratuita che rimuove le limitazioni di tempo della versione di prova. Una recensione dettagliata di NetFront è disponibile su Gadgetophile. Secondo l’autore della recensione NetFront, nonostante i crash occasionali (particolarmente se la connessione GPRS viene chiusa da un’altra applicazione), offre vantaggi non trascurabili rispetto al browser Opera installato di default sui cellulari S60. Il vantaggio principale sarebbe la funzionalità Smart-Fit, che adatta il layout ed i contenuti della pagina alle dimensioni ridotte dello schermo, mantenendo la gerarchia e l’importanza dei contenuti.

Gallina: un blog basato su GMail!

11 settembre 2004

Da quando gli inviti a caselle GMail hanno cominciato a diffondersi, diversi utenti hanno dato via libera alla propria fantasia nei modi più strani creando tools e anche un filesystem.

L’ultimo nato della famiglia degli hack di GMail e’ un blog che sfrutta la casella di posta come metodo per l’archiviazione dei post.

Jonathan Hernandez ha sviluppato, utilizzando le librerie php libgmailer, Gallina, una piattaforma di blogging che utilizza i messaggi come entries.

Per capire bene il funzionamento dovrete scaricarvi sorgenti e documentazione anche se, già dalla Homepage, potrete farvi un’idea più precisa. Interessante leggere che Jonathan ha pensato di utilizzare i messaggi come post e le risposte come comment, i messaggi che sono in stared status sono quelli che vengono pubblicati.

Esisteva anche una demo della piattaforma, disattivata da quando il sito è stato Slashdotted.