Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Saturday, November 8, 2008

Parancoe 2.0

Last week the Parancoe Team (me and other smart people :) ) released the version 2.0 of the Parancoe meta-framework. With this release Parancoe achieved a great level of maturity.

In the next weeks, starting with this post, I will demonstrate how easy and pleasant is to develop applications with Parancoe.

First demonstration! :) How difficult is to start a new project with Parancoe? No difficult at all. Install Maven and type the following command:

mvn archetype:create -DarchetypeGroupId=org.parancoe \
-DarchetypeArtifactId=parancoe-webarchetype \
-DarchetypeVersion=2.0.1 \
-DgroupId=com.mycompany \
-DartifactId=testApp \
-DpackageName=com.mycompany.testapp

It will generate a new complete project ready for your next development. I repeat, complete, the new application is already working, you can build and deploy it on your application server and use it. You'll see a simple layout, administrative tasks, debug information in page (when deployed in development mode), user authentication and authorization, user management.

With a good IDE :) the start-up task is even easier. Watch this my previous, still valid, screen-cast.

Don't miss to read the new Parancoe Reference Guide, both in HTML and in PDF.

Have fun!

Monday, July 21, 2008

PDF Unencrypting

Updated 07/29/2008: added the copy of the bookmarks (index) from the original document.


Usually, when you buy a PDF book, it's encrypted and protected by a password. No problem, I agree with authors and publishers that need to protect their work, even if this technique is a very poor protection.

Unfortunately usually some portable readers, like my PRS-505, don't have encryption/password support, so you can't upload those PDFs on them.

So you need to unencrypt the PDF for reading it on the device, a perfectly legal operation if you legally bought the book.

The easiest way to unencrypt a PDF should be to use the pdftk command line tool:

pdftk abook.pdf input_pw your_password_here output abook_unencrypted.pdf

Unfortunately it always emits this error:

Error: Failed to open PDF file:
abook.pdf
OWNER PASSWORD REQUIRED, but not given (or incorrect)

Of course the password was correct and I tried with different combinations of input/owner/user password parameters. I think it's a bug of pdftk (version 1.41).

So I wrote a small Java program for unecrypting my files:

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfCopy;
import com.lowagie.text.pdf.PdfImportedPage;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.SimpleBookmark;
import java.io.FileOutputStream;
import java.io.IOException;

public class Unencrypt {
public static void main( String[] args )
throws IOException, DocumentException {
String inFile = args[0];
String outFile = args[1];
String password = args[2];
PdfReader pdfReader = new PdfReader(inFile, password.getBytes());
Document document = new Document();
PdfCopy copy = new PdfCopy(document, new FileOutputStream(outFile));
document.open();
for (int i = 1; i <= pdfReader.getNumberOfPages(); i++) {
PdfImportedPage importedPage = copy.getImportedPage(pdfReader, i);
copy.addPage(importedPage);
}
copy.setOutlines(SimpleBookmark.getBookmark(pdfReader));
document.close();
pdfReader.close();
}
}
For executing it, download this file, and type:

java -cp bpdf.jar com.benfante.bpdf.Unencrypt \
abook.pdf abook_unencrypted.pdf \
your_password_here

*WARNING*: I'm not responsible of the use you can do of this code. It's not intended as a tool for infringing copyrights, just for reading PDFs you legally owns on devices that don't support encrypting.

Friday, July 18, 2008

Pattern matching

Lo so, è un oszvnrioseae baanle, ma sepsso il nstoro celvelro fiouznna mtolo mliego di qlsaauisi cotemupr. Ad emspeio, a meno che il vrosto clevlreo non aibba qlachue pomeblra, dsvtoere eesrse peatentertfme in gdaro di lrggeee qeusto tteso, anhce se le lrtetee dllee plraoe, a parte la pirma e l'ulmita, snoo sttae messe alla rnfiusa. Quetso adcace perhcè qnaduo lgeaimgo in rtlaeà non psatemiro aioetntzne alle sngiole ltrteee, ma alla porala nel suo clspemoso.

Se volete giocare a ricombinare le parole di vostri testi, provate questo piccolo programmino che ho scritto:


Scarica questo file se vuoi dare un'occhiata ai sorgenti (rilasciati sotto Apache License, Version 2.0).

Questa e molte altre informazioni, e alcuni suggerimenti di miglioramento delle proprie capacità di apprendimento, le potete trovare in un interessante libro che sto leggendo: "Pragmatic Thinking and Learning" di Andy Hunt.

Update 08-14-2008: I just finished to read this book, of course on my PRS-505. It's a great book, a must-to-read if you need to be a continuous learner. And if you are in the IT business, of course you need to be. I'm a self-employed, mostly home-based, consultant and developer: the "Manage Focus" chapter is illuminating, and very helpful for trying to enhance the productivity of my work environment. In general the book is perfect for acquiring consciousness of your learning paths and deficiencies, with a lot of good tips for improving yourself. What I bought from the book? At present, I started writing "Morning Pages"; I already have a two monitor desktop, and as a Linux user I'm already used to virtual desktop; limiting "down" time and being conscious of it; caring of distractions; trying a better deliberate reading and acquiring of information.

Thursday, February 8, 2007

Zappe sui piedi...

Una breve riflessione su come il mondo open-source riesca a farsi del male, promuovendo iniziative lodevoli, ma arrivando totalmente impreparati a domande assolutamente banali e prevedibili.

Lo spunto mi arriva ascoltando uno stralcio di un'intervista (o semplicemente una domanda del giornalista presente, non so) durante la conferenza stampa di presentazione dell'associazione Progetto Linguistico Italiano OpenOffice.org. Lo stralcio è andato in onda durante la puntata del 3 Febbraio 2007 del programma 2024 su Radio 24:

Enrico Pagliarini (Giornalista di Radio 24): Naturalmente quando si parla di suite da ufficio viene subito alla mente Office, il classico Office di Microsoft. Siamo in presenza di un software che sostanzialmente è molto simile.

Davide Dozza (Presidente del PLIO): Sì, è un diretto concorrente di Microsoft Office. Tant'è che supporta in tutto e per tutto i formati di Office. E' una compatibilità molto alta, non al 100%, perché ovviamente i formati di Microsoft sono formati proprietari, e quindi sono supportati solo in termini di reverse-engineering come si dice tecnicamente. Cioè solo la possibilità di copiarne le funzionalità senza avere accesso alle specifiche vere e proprie. Per cui ci si avvicina molto alle funzionalità di Office, ma mai del tutto proprio per queste caratteristiche di chiusura dei formati.


A questo punto gli ascoltatori cosa avranno capito? Sicuramente che [OpenOffice] "si avvicina molto alle funzionalità di Office, ma mai del tutto". Non propriamente una buona comunicazione.

Perchè parlare di funzionalità in merito ai formati, quando le funzionalità si riferiscono al software? Non bastava dire che OpenOffice permette di ottenere gli stessi risultati che si ottengono con Microsoft Office, e in maniera molto simile? Naturalmente, trattandosi di software differenti, OpenOffice ha funzionalità che Office non ha, e viceversa. Se si voleva parlare dei formati, era sufficiente dire che OpenOffice è in grado di leggere (e scrivere) praticamente tutti i file prodotti da Office, con un ottimo grado di approssimazione, trattandosi di formati proprietari.

Personalmente sono passato ad OpenOffice da molto tempo, ed è da molto tempo che non ho problemi di compatibilità con i formati di Office. Probabilmente sarò fortunato...ma felice.