Playlist formats : m3u, pls, xspf and others

Last update : June 16, 2012;
M3U is a file format to store multimedia playlists. It was first used by Winamp. PLS does the same, but is a more expressive format than basic M3U, as it can store  information on the song title and length (this is supported in extended M3U only). With PLS version 2, playlists also include a PLS version declaration.

iTunes, QuickTime Player, Real player, Winamp, XBMC, XMPlay, VLC media player and many other programs play PLS files without any extra codecs.

Xiph.Org Foundation, a non-profit organization that produces free multimedia formats and software tools, created in 2004 the XML Shareable Playlist Format (XSPF, called spiff) for sharing the kind of playlist that can be played on every personal computer or portable device. The home of XSPF is the website xspf.org.

XSPF is supported by the DLNA server Seviio. The playlists handle not only audio, but also video or other multimedia files.

Google Text-to-Speech (TTS) support

Last update : 30 April 2011

On november 16th, 2009, Google announced on their official blog that english text-to-speech was added to the translation tools.  Google used eSpeak, which is an open source software speech synthesizer for this service.

In may 2010,  Google Translate added more audio translations languages, including Afrikaans, Albanian, Catalan, Chinese (Mandarin), Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Haitian Creole, Hindi, Hungarian, Icelandic, Indonesian, Italian, Latvian, Macedonian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Spanish, Swahili, Swedish, Turkish, Vietnamese and Welsh.

The speech audio is in MP3 format and is queried via a simple HTTP GET (REST) request. For english, an example url is:

http://translate.google.com/translate_tts?tl=en&q=how are you?

The TTS web service is restricting the text to 100 characters and the service returns 404 (Not Found) if the request includes a Referer header.

December 3, 2010, Google acquired Phonetic Arts, a company specialised in speech synthesis. Phonetic Arts Limited delivers technology that generates natural expressive speech. The products include Phonetic Morpher,  Phonetic LipSync  and Phonetic Synthesizer. Phonetic Arts, formerly known as Tayvin 356 Limited, was founded in 2006 and is based in Cambridge, UK.  The Phonetic Arts technology generates natural computer speech from small samples of recorded voice and should improve the voice output quality of Googles text-to-speech applications.

Google does not only provide speech output tools, but also speech input tools (Voice Search, Voice Input, Voice Actions), mainly in relation with the mobile phone OS Android.

Version 11 of the Google Chrome browser includes the HTML5 Speech Input API.

An amusing application of the Google TTS system is the Google Translate Beatbox.

Errror-reporting in php

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level. Some examples are given hereafter:

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

PHP-Developers appreciate the 

// Reporting E_NOTICE can be good too (to report uninitialized variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors
error_reporting(E_ALL);

PHP-Developers appreciate SimpleTest, a PHP unit test and web test framework. The most recent version is 1.0.1 released 2008-04-08, available at SourceForge. JAVA-Developers are  familiar with JUnit, originally written by Erich Gamma and Kent Beck. SimpleTest Interfaces are similar to JUnit.

Mozilla Messaging : Thunderbird 3.1 with IMAP

Mozilla Thunderbird Mail Client

Mozilla is a global community of people creating a better Internet. As a wholly owned subsidiary of Mozilla, Mozilla Messaging organizes the development and marketing of email and messaging products encouraging choice, innovation, and opportunity in messaging on the Internet. Thunderbird, as a messaging system, is uniquely positioned as the tool that users can use to integrate as many of their communications as they want.

By combining an open architecture, a powerful extensibility and customization framework, and a person-centric perspective on communications, Thunderbird is a powerful yet enjoyable tool to help individuals manage their online interactions, whether that’s email, instant messaging, social networking messages, or other types of message.

Today, I installed version 3.1 of  Thunderbird on my PC running Vista.

The profiles are saved to C:/Users/username/AppData/Roaming/Thunderbird/..

To import the messages from my Windows Mail Client, I installed the ImportExportTools from Kosmos Website. This is done with the menu Tools >> AddOns in the Thunderbird Client. I added a folder “WindowsMail” under “Local Folders” with three subfolders Inbox, SentItems and DeletedItems. After installing the ImportExportTools, a new Menu Import/Export appears when right clicking on a folder tab. All .eml files in the Windows Mail Folder are imported, even with the option of including subfolders.

The Windows Mail messages are located at C:/Users/username/AppData/Local/Microsoft/Windows Mail/Local Folders/…

Finally I installed the freeware MozBackUp 1.4.10 to MozBackup, a simple utility for creating backups of Mozilla Firefox, Mozilla Thunderbird, Mozilla Sunbird, Flock, SeaMonkey, Mozilla Suite, Spicebird, Songbird and Netscape profiles. It allows you to backup and restore bookmarks, mail, contacts, history, extensions, passwords, cache etc.

I configured the Thunderbird Client to use IMAP (Internet Message Access Protocol ) for incoming messages. The current version, IMAP 4 revision 1 (IMAP4rev1), is defined by RFC 3501. IMAP supports both on-line and off-line modes of operation. E-mail clients using IMAP generally leave messages on the server until the user explicitly deletes them. This and other characteristics of IMAP operation allow multiple clients to manage the same mailbox.

Web-Sniffer : View HTTP Requests and Responses

Last update : October 21, 2016

HTTP Response Headers are just lines of text sent from the server to the browser before the page content. They are terminated with a blank line, after which the page content is deemed to begin. HTTP Requests are lines of text sent from the browser  to the server.

A very useful tool to check HTTP Request and Response Headers is available at the web-sniffer.net website.

A typical output of a HTTP Request Header by the web-sniffer is shown below :

HTTP Request Header

Connect to 80.90.45.105 on port 80 ... ok

GET / HTTP/1.1[CRLF]
Host: www.saraproft.net[CRLF]
Connection: close[CRLF]
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; 
rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 GTB7.1 
( .NET CLR 3.5.30729; .NET4.0C)[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no[CRLF]
Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
Referer: http://web-sniffer.net/[CRLF]
[CRLF]

HTTP Headers are strings terminated by a CR (carriage return) and LF (Line feed) character (‘rn’ string). The order of header lines withing the HTTP header has no significance. Any header fields which are not understood should be ignored. A CRLF string after the last header is followed by the content part of the webpage.

Web-Sniffer is also available as free desktop app for Windows and Mac (version 1.0.0 Beta, Build 26, released on June 23, 2013).

Web-Sniffer App on Mac OS X El Capitan

Web-Sniffer App on Mac OS X El Capitan

ECLIPSE and TOMCAT (web applications)

Apache Tomcat & Eclipse Platform make a great Web development platform. Tutorials about this development environment are available on the following websites:

I use the Tomcat version 5.5.23 as localhost because this version is available on my hosted website provided by my ISP Visual Online. My Eclipse version is Galileo (3.5.2). The Java SDK is 1.6.

Web applications are deployed on the Tomcat server with a WAR file (which stands for “web application archive” ) A WAR file is a ZIP file used to distribute a collection of JavaServer Pages, servlets, Java classes, XML files, tag libraries and static Web pages that together constitute the Web application.

There are special files and directories within a WAR file.

  • The /WEB-INF/classes directory contains the .class files (servlets, …)
  • The /WEB-INF/lib directory contains the .jar files with the Java librairies
  • The /WEB-INF directory contains a file named web.xml which defines the structure of the web application

The main elements of the web.xml file are shown below :

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app id=”WebApp_ID” version=”2.4″ xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”>

<display-name>MyExampleWebProject</display-name>
<description>Describe What the application is doing and add comments</description>

<servlet>

<servlet-name>MyServlet</servlet-name>
<servlet-class>saraproft.com.servlet.FirstApp</servlet-class>
<description>Une application très simple</description>

<init-param>
<param-name>size</param-name>
<param-value>123</param-value>
</init-param>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>echo</url-pattern>
</servlet-mapping>

</web-app>

The elements of a web.xml file are :

  • the name of the application : <display name>
  • the name, class and parameters of the servlet : <servlet>
  • the mapping of the servlet : <servlet-mapping>
  • context parameters : <context-param>
  • session parameters : <session-config>
  • list of index files : <welcome-file-list>
  • MIME mapping : <mime-mapping>
  • other parameters referring to security, errors, filters, …

The other files (html, jsp, iamges, …) are stored in the root or in folders located in the root of the WAR file. They can’t be included in the WEB-INF directory.

Cellspark animator

Cellspark version 2

The CellSpark animation editor creates compact flash-like vector graphics animations for nearly all Java enabled phones.

Developped by Colin Mummery a few years ago, this tool allows to create presentations, screen savers and more for different handsets.

Runnable midlets can be created for Midp 1 and Midp 2 devices. In 2005, during the Luxembourg Presidency of the Council of the European Union from 1st January till 30th June 2005, I used the licensed version of Cellspark to create a multimedia show about the member states of the European Union as a Midlet for the Nokia handset 6680.

Today, a reinstalled Cellspark (a java program) on my new labtop running Vista and Java 6 without any problems. The program is still very useful, userfriendly and fascinating.

BlackBerry .cod and .alx files

Last update : August 1, 2012

jar/jad 2 cod/alx

BlackBerry uses .cod and .alx files to deploy Java applications from the PC desktop (BB Desktop Manager) to a BlackBerry device. These files are generated automatically by the BlackBerry JDE or by the Eclipse BlackBerry plugin.

.alx is an XML-based BlackBerry application descriptor which can be generated by hand. An example for the Java application FirstApp.cod is shown below :

<loader version="1.0">
    <application id="FirstApp">
        <name >
        </name>
        <description >
        </description>
        <version >
        </version>
        <vendor >
        </vendor>
        <copyright >
            Copyright (c) 2010
        </copyright>
        <fileset Java="1.5">
            <directory >
                MyFolder
            </directory>
            <files >
                FirstApp.cod
            </files>
        </fileset>
    </application>
</loader>

To download a BlackBerry application over the air to a BlackBerry device, a standard .jad file is used to describe the application. The .jad file is selected from the browser to load the .cod file. If the BlackBerry service to download standard MIDlets is enabled,  the Mobile Data Service feature of the BES provides a built-in transcoder that converts .jar files into .cod files.

Brandon Dante Swift developped an offline conversion tool from .jar/.jad files to .cod/.alx files (JAR2ALX). The free version 1.5.1 is available at the website Brandon Swift Creations. The pro version 1.5 is now also available free of charge. Brandon developed another useful tool that makes capturing your Blackberry’s screen to an avi video as easy as a click of a button (PC program BeVi with usb connection). Donations are appreciated for all three programs.

BlackBerry Desktop Manager

Last update :  December 7, 2014

Today I installed the BlackBerry Desktop Manager Version 5.0.1.37 (march 10, 2010).

This dashboard offers the following functions:

BlackBerry Desktop Manager

  • Media Sync (synchronise iTunes or Windows Media Player music with BlackBerry device)
  • Application Loader (add or remove applications, update software)
  • Backup and Restore (backup or restore device data)
  • Device Switch Wizard (transfer data from one device to another : BlackBerry, Palm or Windows mobile)
  • Synchronize (synchronize email and organizer data)
  • IP modem (set up BlackBerry device as a wireless modem for internet access)

The desktop manager works with my three different BlackBerry devices : 7100v, 8100 et 9000. It does not support my new Blackberry Z10.

The firmware and microedition versions are shown below :

7100v

  • BlackBerry 7100v
  • v 4.0.2.35
  • Platform 1.8.0.138
  • CLDC-1.1
  • MIDP-2.0
  • JTW 1.0
  • Media 1.1
  • PIM 1.0
  • 2005

8100

  • BlackBerry 8100
  • v 4.2.1.109
  • Platform 2.3.0.85
  • CLDC-1.1
  • MIDP-2.0
  • JTW 1.0
  • Media 1.1
  • Pim 1.0
  • File 1.0
  • 2007

9000

  • BlackBerry 9000
  • v 4.6.0.216
  • Platform 4.0.0.183
  • Branding 1.0.194.166
  • CLDC-1.1
  • MIDP-2.0
  • JTWI 1.0
  • Media 1.1
  • PIM 1.0
  • File 1.0
  • Bluetooth 1.1
  • Location 1.0.1
  • Security and Trust 1.0
  • WLAN 2.4.0.71
  • 2008

My desktop manager was updated in 2011 to version 6.1.0.35 (Bundle 34), released on June 7, 2011, in 2012 to version 7.0.0.59 (Bundle 60), released on May 17, 2012 and recently to version 7.1.0.41 (Bundle 42), released on March 26, 2013.

Screenshot of the Blackberry update window

Screenshot of the Blackberry update window

With my Blackberry Z10, the Blackberry Desktop Manager was replaced by Blackberry Link, the latest version 1.2.3.56 was released on July 3, 2014.

WLAN, WiFi, WEP, WPA, WPA2, TKIP, PSK, AES

Logo de Wi-Fi Alliance

La norme IEEE 802.11 (ISO/IEC 8802-11) est un standard international décrivant les caractéristiques d’un réseau local sans fil (WLAN), appelé encore Wi-Fi ou WiFi, comme contraction de Wireless Fidelity.

Pour remédier aux problèmes de confidentialité des échanges sur les réseaux sans fils, le standard 802.11 intègre un mécanisme simple de chiffrement des données, il s’agit du WEP (wired equivalent privacy).

Le WEP est un protocole chargé du chiffrement des trames 802.11 utilisant l’algorithme symétrique RC4 avec des clés d’une longueur de 64 bits ou 128 bits.

Comme le WEP n’est pas suffisant pour garantir une réelle confidentialité des données, il convient d’utiliser le cryptage WPA ou WPA2 pour obtenir un niveau de sécurité supérieur.

WPA (WiFi protected Access) est une solution de sécurisation de réseau WiFi proposé par la WiFi Alliance, afin de combler les lacunes du WEP. Le WPA est une version « allégée » du protocole 802.11i, reposant sur des protocoles d’authentification et un algorithme de cryptage robuste : TKIP (Temporary Key Integrity Protocol). Le protocole TKIP permet la génération aléatoire de clés et offre la possibilité de modifier la clé de chiffrement plusieurs fois par secondes, pour plus de sécurité.

Le fonctionnement de WPA repose sur la mise en oeuvre d’un serveur d’authentification permettant d’identifier les utilisateurs sur le réseau et de définir leurs droits d’accès. Pour les petits réseaux, une version restreinte appelée WPA-PSK (Pre-shared Key), est mis en oeuvre déployant une même clé de chiffrement pour l’ensemble des équipements.

La Wi-Fi Alliance a créé en 2004 une nouvelle certification, baptisée WPA2, pour les matériels supportant le standard 802.11i. Contrairement au WPA, le WPA2 permet de sécuriser aussi bien les réseaux sans fil en mode infrastructure que les réseaux en mode ad hoc. Il s’appuie sur l’algorithme de chiffrement TKIP, comme le WPA, mais supporte également l’AES (Advanced Encryption Standard), beaucoup plus sûr.