Software


Minitube status update

The latest weeks have been exciting. The development of Minitube is such a gratification for me. I’ve been following Qt development for literally years and from time to time experimented with C++. But I never had something really useful to do with it. I mean, until now.

The response to Minitube has been overwhelming. Lots of downloads, emails, comments, two people volunteering for translation and even a 1€ donation ;)

But the most exciting thing for me is the inclusion in some Linux distributions, namely Gentoo and ArchLinux. Also the Fink project added Minitube to its repository. I’m very pleased to be able to give something back to the Free Software community.

These days I’m readying the code base for the 0.3 release. So stay tuned!

C’è vita fuori del browser

Oggi ho rilasciato la prima versione di Minitube, il mio pet project attuale. Si tratta di un player nativo per YouTube. Niente browser, niente HTML, niente Flash. Naturalmente è allo stato embrionale e ci sono una infinità di problemi. Ma tutti sanno che si rilascia presto e spesso. Ancora manca il download per Windows: non ho ancora avuto il coraggio di installare i prerequisiti sul mio Windows inscatolato nel VMware, cioè svariati giga tra DirectX, Visual Studio e Qt.

Minitube è adatto per ascoltare musica da YouTube o per sedersi sul divano o dietro 3 etti di pasta a guardare  un po’ di video randomici. Più o meno come si fa quando si guarda la tv. Spero di riuscire a mantenere alta la motivazione per portare Minitube a uno stato funzionante. Buona visione!

Picoplog, il fotoblog minimale

Picoplog logo Qualche mese fa il guru delle frese cnc e dei termostati ha iniziato a scrivere un sistema in PHP per pubblicare le sue foto. L’idea principale era quella di pubblicare la foto semplicemente uploadando sul proprio spazio web. Niente interfacce web di amministrazione, niente pannelli, niente backend; e niente database. Così è nato Picoplog.

Naturalmente quando ho visto un progetto così carino e potenzialmente utile all’umanità mi sono aggregato subito. E così io e il guru abbiamo iniziato a trasformare uno script “per uso personale” in un prodotto ad uso delle masse (si spera), affrontando gli infiniti problemi problemi di compatilità che presenta il PHP nelle sue diverse configurazioni e abomini tipo i magic quotes. E rilasciandolo sotto una licenza veramente libera, la AGPL.

[Warning: rant ahead] Oltre al divertimento intrinseco sono stato motivato a lavorare a Picoplog dalla tendenza generale a centralizzare il Web in servizi proprietari tipo Flickr. A mio avviso una tendenza dannosa e pericolosa per la libertà e soprattutto lo sviluppo di standard adeguati nel lungo termine. Il Web è pensato per essere distribuito. Ognuno dà il suo contributo (sul suo server) e si fonde con gli altri attraverso formati e protocolli standard. Ok fine della teoria.

Picoplog è ancora in alpha: stiamo definendo il sistema dei temi ed altre API che dovranno essere stabili per (improbabili) sviluppatori esterni prima della beta. Ciò nonostante (wow non credevo di poter scrivere una cosa del genere) Picoplog è già molto usabile, e anche un po’ usato.

Per concludere… Provatelo immantinente!

HTTP Headers Filter

A Java Servlet Filter that sets HTTP headers.
Implementation of javax.servlet.Filter used to set HTTP headers. The filter parameters are treated as HTTP headers. The parameter name becomes the header name, while the parameter value becomes the header value. The parameter value may contain EL expressions. If the expression evaluates to a java.util.Date or a java.lang.Long object the header is considered to be a Date header and formatted according to the HTTP spec.

These are the implicit objects available to the EL context:

now
A java.util.Date object the represents the current time.

Init-params:

negativeMapping
A regular expression matching request URIs to be ignored. The URI is obtained using HttpServletRequest.getRequestURI(). See also the regular expression documentation

This is a typical usage example:

<filter>
  <filter-name>httpHeaders</filter-name>
  <filter-class>
    org.ft.servlet.filters.httpheaders.HTTPHeadersFilter
  </filter-class>
  <init-param>
    <param-name>Expires</param-name>
    <param-value>${now.time + 1000 * 60}</param-value>
  </init-param>
  <init-param>
    <param-name>Last-Modified</param-name>
    <param-value>${now}</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>httpHeaders</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Requirements

Download

Legal

This is Open Source software distributed under the Apache License Version 2.0.

Csound syntax highlight for Kate

I wrote a Csound Highlight Definition XML file for Kate. It only supports the CSD format. Just copy the XML file to ~/.kde/share/apps/katepart/syntax/. Kate is a great text editor, if you use Csound on Linux, give it a try.

UPDATE: Added support for ORC and SCO!

Juseppe, a simple JSP framework

Juseppe is a simple framework for JSP development. I wrote it to speed up my (and my colleagues’) work, but you can use it too. Juseppe is implemented as a Java Servlet Filter and meant to be used in a JSP 2.0 + JSTL environment.

Goals

Clean URIs

With Juseppe, your URIs will not reveal the underlying technology. This is both a security advantage and a wise naming design: when you’ll reimplement your site with a new technology chances are you’ll be able to preserve the old URIs and break no links. Your URIs will look like:

http://www.dumbnews.com/politics
http://www.dumbnews.com/article/4321

and not:

http://www.dumbnews.com/politics.jsp
http://www.dumbnews.com/article.jsp?id=4321

Site structure

Juseppe simplifies JSP development and mantainance by providing a navigation system among web application resources. Instead of hardcoding links and site sections inside JSPs, Juseppe puts the website structure in a freeform XML file. URIs are then mapped to XML nodes and to JSPs using XPath expressions. This makes adding and removing sections much easier than delving inside spaghetti JSP code.

This is a typical XML configuration:

<page name="." resource="/home.jsp" display="Homepage">
<page name="politics" resource="/politics.jsp" display="Politics"/>
<page name="technology" resource="/technology.jsp" display="Technology"/>
<page name="article" resource="/article.jsp"/>
</page>

Take a look to the demo!

The quickest way to grasp the concept behind this project is trying the sample webapp included in the distribution.

Starting a new web application from scratch

  1. Drop juseppe-x.x.x.war found in the binary distribution in your servlet container web application directory.

Using Juseppe in an existing web application

  1. Extract juseppe-x.x.x.war using the jar utility (or any other zip utility).
  2. Copy the libraries found in WEB-INF/lib to your application WEB-INF/lib directory.
  3. Copy WEB-INF/juseppe.xml to your application WEB-INF directory.
  4. Open WEB-INF/web.xml, then cut’n’paste the Juseppe Filter definition and mapping to your web.xml.
  5. Customize WEB-INF/juseppe.xml according to your website structure.
  6. Possibly customize Juseppe Filter init-params in WEB-INF/web.xml.

For reference documentation see the Javadocs included in the distribution.

Status

Juseppe is production ready. It is currently used on the following (italian) sites:

Legal

Juseppe is Open Source software distributed under the Apache License Version 2.0.

Requirements

Download

JSTL patch

This is a patched version of the Jakarta Standard Tag Library
which implements the JSTL 1.1 specification. This patch makes the XML tags run 100 times faster. I wrote almost no code, I just reverted the XPathUtil class to a previous version and managed to compile the whole thing.

Originally the Standard Taglib used the Jaxen XPath processor. With version 1.1 the project switched to Xalan, decreasing performance by a factor of 100. At my company we chose to use JSTL and we’re really happy about it. But our sites must work now, so I put together this patched version. I hope to be able to use the official version very soon. In the meanwhile, if you’re using JSTL in a production environment give this version a try.

I submitted this patch to the Standard Taglib developers but it was refused because it implies a dependency on Jaxen. Here’s the original thread on the taglibs-dev at jakarta.apache.org mailing list.

To install over an existing webapp just drop in the standard-*.*.*-patched.jar and remove standard.jar.
You also need jaxen-*.*.jar from the Jaxen project.

Requirements

Download

XSLT Servlet

This servlet transforms an XML document using an XSLT stylesheet. Probably there are other Servlet implementations of this kind, but I couldn’t find one with the features I need available under an Open Source license, so I wrote this one.

Features

  • the XML document and the stylesheet can be retrieved from the local webapp or from the network (using java.net).
  • Stylesheet is preloaded at startup and then periodically reloaded in the background in order to optimize performance.
  • JSP EL expressions can be used in the Servlet init params.
  • Parameters can be passed to the stylesheet.
  • XSLT output properties can be controlled by the Servlet.
  • Not tied to a specific XML parser or XSLT processor.
    This Servlet uses javax.xml.transform (aka TrAX) for XSLT processing.

This is a sample web.xml configuration:

<servlet>
  <servlet-name>myTransformation</servlet-name>
  <servlet-class>it.kataweb.xslt.servlet.XSLTServlet</servlet-class>
  <init-param>
    <param-name>xml</param-name>
    <param-value>http://domain.org/service?param=${param.myParam}</param-value>
  </init-param>
  <init-param>
    <param-name>xslt</param-name>
    <param-value>/WEB-INF/xslt/myStylesheet.xslt</param-value>
  </init-param>
  <init-param>
    <param-name>xsltReloadInterval</param-name>
    <param-value>60</param-value>
  </init-param>
</servlet>

For reference documentation see the Javadocs included in the distribution.

Legal

This Servlet is Open Source software distributed under the Apache License Version 2.0.

Requirements

Download