Home
Alessandro Melandri
Cancel

Compact font styles

This is a simple tip that can help you reduce your style sheet size. Take a look at this CSS portion: .myClass{ font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 1.1em; font-weight...

Remove leading zeroes in XSL

A useful XSL template for removing leading zeros <xsl:template name="removeLeadingZeros"> <xsl:param name="originalString"/> <xsl:choose> <xsl:when test="starts-...

Zipped folder backup

A simple bash script that zips a folder and sets the archive name to the current date. #!/bin/bash # Archive name structure: ddMMYYYY_HHmmss.zip archiveName=`date +%d%m%Y_%H%M%S`.zip folderName...

Install OpenOffice 3.1 on Ubuntu

These are the steps to install OpenOffice 3.1 on Ubuntu. First of all download OpenOffice 3.1 from the official web site. When you’re done, follow these steps: 1. Remove previous version sudo apt...

Java tail

A java implementation of the Unix tail command. This is a small customization of the java tail class created by Luigi Viggiano. I’ve just added some controls and added the update time parameter. i...

VMWare and Linux

If you install VMware on linux you may find that some keys (up/down keys, home key, etc…) don’t work in the guest operating system. You need to create a config file inside the .vmware folder in you...

Install Sun JDK on Linux

I’ve tested this procedure on Fedora 10 and Ubuntu 9.04 but it should work on other distributions too. First of all download the latest JDK package from the SUN page: be sure to download the bin f...

Get the WEB-INF folder path

This is a simple example on how to get the WEB-INF directory path in a J2EE web application. public class MyClassName { private static final String WEBINF = "WEB-INF"; public String getWebIn...

Connect to MySql using Java

This is a simple class that I usually use to connect to a MySQL database. Obviously the right MySQL JDBC driver must be in your classpath. import java.sql.Connection; import java.sql.DriverManager...