All of the interesting technological, artistic or just plain fun subjects I'd investigate if I had an infinite number of lifetimes. In other words, a dumping ground...

Thursday, 31 July 2008

Google finance API

Monday, 28 July 2008

Java access to Microsoft file formats

Apache POI - Java API To Access Microsoft Format Files


The POI project consists of APIs for manipulating various file formats based upon Microsoft's OLE 2 Compound Document format using pure Java. In short, you can read and write MS Excel files using Java. Soon, you'll be able to read and write Word, PowerPoint and Visio files using Java. POI is your Java Excel solution as well as your Java Word solution. However, we have a complete API for porting other OLE 2 Compound Document formats, and welcome others to participate.

OLE 2 Compound Document Format based files include most Microsoft Office files such as XLS and DOC as well as MFC serialization API based file formats.

At this time, none of our releases support the new Office Open XML file formats, such as .xlsx or .docx. Work to support these is in progress, and people interested should follow the dev list. We expect this support to make it into a full release by the summer.

As a general policy, we try to collaborate as much as possible with other projects to provide this functionality. Examples include: Cocoon for which there are serializers for HSSF; Open Office.org with whom we collaborate in documenting the XLS format; and Lucene for which we provide format interpretors. When practical, we donate components directly to those projects for POI-enabling them.


Friday, 25 July 2008

lisp

Steel Bank Common Lisp (SBCL) is an open source (free software) compiler and runtime system for ANSI Common Lisp. It provides an interactive environment including an integrated native compiler, a debugger, and many extensions.

SBCL runs on a number of POSIX platforms, and experimentally on Windows. See the download page for supported platforms, and getting started guide for additional help.

The most recent version is SBCL 1.0.18, released June 29, 2008 (release notes).


The Common Lisp Reasoner project aims to create a practical technology that exploits the synergy between its three major components to make AI-related applications, such as scheduling and diagnosis, easier to develop. These components are:

  • A portable extension of the Common Lisp Object System (CLOS)
  • The Assumption-Based Truth-Maintenance System (ATMS) of de Kleer
  • A rule language comprising non-directional constraints as well as unidirectional rules

Because CLOS permits, by means of the Metaobject Protocol, open-ended extension, it is both the implementation language and the kernel of the implemented system, within which a set of sound principles appropriate to the practice of knowledge representation rather than programming have been realized.

In reasoning applications, the values stored into the slots of an instance (the data to be reasoned with) are accumulated rather than replaced. Permitted values are specified in the class of the instance. They are either other instances, or enumerated ranges of (mutually exclusive) values that may subsequently be narrowed by reasoning activity.

Each stored value is encapsulated in an ATMS node—a record not only of the value, but also its justification (derivation) and the resultant belief states (or environments), determined by the ATMS, in which it holds. An environment is given by a set of primitive assumptions; an assumption constitutes an explicit, problem-specific decision to assume some datum or data. The ATMS enables environments to be explored systematically and efficiently.

The rule language permits the expression of arbitrarily complex logical sentences. The slot definitions of classes collectively constitute a vocabulary of attributes that can be referred to in rule definitions. When reasoning, classes and instances provide an efficient means of retrieving rules and the data upon which they operate.

Source code may be downloaded via the project page. Before downloading, consult the release notes to determine compatibility with your Common Lisp implementation of choice.

Thursday, 24 July 2008

video transcoding

Transcode Wiki

Transcode

Transcode is a suite of command line utilities for transcoding video and audio codecs, and for converting beween different container formats. Transcode can decode and encode many audio and video formats, e.g.

A variety of video and audio pre and post-processing filters are available, including (but not limited to):

  • video de-interlacing
  • audio resampling
  • framerate conversion
  • smoothing
  • cutting

Transcode can import DVDs on-the-fly, or record from Video4Linux (including V4L2 video capturing) devices.

See General Information for a more detailed description of Transcode's capabilities. Or scroll down and choose your topic of interest from the documentation part below.


What is VirtualDub?

VirtualDub is a video capture/processing utility for 32-bit Windows platforms (95/98/ME/NT4/2000/XP), licensed under the GNU General Public License (GPL).  It lacks the editing power of a general-purpose editor such as Adobe Premiere, but is streamlined for fast linear operations over video.  It has batch-processing capabilities for processing large numbers of files and can be extended with third-party video filters.  VirtualDub is mainly geared toward processing AVI files, although it can read (not write) MPEG-1 and also handle sets of BMP images.

Wednesday, 16 July 2008

Joke

I, Caesar, when I learned of the fame
Of Cleopatra, I straightway laid claim.
Ahead of my legions,
I invaded her regions,
I saw, I conquered, I came.

From http://tech.slashdot.org/comments.pl?sid=613895&cid=24191477

Monday, 14 July 2008

web based terminal

http://antony.lesuisse.org/qweb/trac/wiki/AjaxTerm

Ajaxterm

Ajaxterm is a web based terminal. It was totally inspired and works almost exactly like http://anyterm.org/ except it's much easier to install (see comparaison with anyterm below).

Ajaxterm written in python (and some AJAX javascript for client side) and depends only on python2.3 or better.
Ajaxterm is very simple to install on Linux, MacOS X, FreeBSD, Solaris, cygwin and any Unix that runs python2.3.
Ajaxterm was written by Antony Lesuisse (email: al AT udev.org), License Public Domain.



temperature sensors

http://www.geocities.com/kiwi_36_nz/tlog/tlog.htm
Source code unavilable

http://www.logictechs.com/DS1921LoggerKit.htm
$US43 for the kit
needs a serial port

https://www.instrumentchoice.com.au/store/index.php?_a=viewProd&productId=116

TC - The General Thermocron Logger



http://www.anotherurl.com/therm/logger.htm
http://au.farnell.com/jsp/displayProduct.jsp?sku=9760911&CMP=KNC-GAU-FAU-GEN-SKU-MIC

Friday, 11 July 2008

C++ unicode library

What is ICU?

ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode and Globalization support for software applications. ICU is widely portable and gives applications the same results on all platforms and between C/C++ and Java software.

ICU is released under a nonrestrictive open source license that is suitable for use with both commercial software and with other open source or free software.

Here are a few highlights of the services provided by ICU:

  • Code Page Conversion: Convert text data to or from Unicode and nearly any other character set or encoding. ICU's conversion tables are based on charset data collected by IBM over the course of many decades, and is the most complete available anywhere.

  • Collation: Compare strings according to the conventions and standards of a particular language, region or country. ICU's collation is based on the Unicode Collation Algorithm plus locale-specific comparison rules from the Common Locale Data Repository, a comprehensive source for this type of data.

  • Formatting: Format numbers, dates, times and currency amounts according the conventions of a chosen locale. This includes translating month and day names into the selected language, choosing appropriate abbreviations, ordering fields correctly, etc. This data also comes from the Common Locale Data Repository.

  • Time Calculations: Multiple types of calendars are provided beyond the traditional Gregorian calendar. A thorough set of timezone calculation APIs are provided.

  • Unicode Support: ICU closely tracks the Unicode standard, providing easy access to all of the many Unicode character properties, Unicode Normalization, Case Folding and other fundamental operations as specified by the Unicode Standard.

  • Regular Expression: ICU's regular expressions fully support Unicode while providing very competitive performance.

  • Bidi: support for handling text containing a mixture of left to right (English) and right to left (Arabic or Hebrew) data.

  • Text Boundaries: Locate the positions of words, sentences, paragraphs within a range of text, or identify locations that would be suitable for line wrapping when displaying the text.

And much more. Refer to the ICU User Guide for details.

Friday, 4 July 2008

Common programming on Linux tools and tips

A friend from work has started writing down good programming, compiling and editing practices for Linux.

Thursday, 3 July 2008

Copy constructor and copy assignment test C++

#include <iostream>
#include <list>
#include <pthread.h>

/*
 * test copy constructors and copy assignment
 * g++ -Wall copyctor.cc -o copyctor
 * ./copyctor
 * valgrind -v --leak-check=full --show-reachable=yes ./copyctor
 */


using namespace std;

class CopyCtor {
    private:
        pthread_mutex_t pMutex;
        int * passed_in;
        int * created_1;
        int * created_2;
        list<int> functions;
   
   
    public:
        CopyCtor();
        CopyCtor(int * passedin);
        CopyCtor(const CopyCtor &cc);                     // copy constructor
        CopyCtor& operator=(const CopyCtor &cc); // copy assignment
        ~CopyCtor();
}; 
   
CopyCtor::CopyCtor(): passed_in(NULL), created_1(NULL), created_2(NULL) {}
   
// Ctor
CopyCtor::CopyCtor(int * passedin): passed_in(passedin) {
   
    pthread_mutex_init(&pMutex, NULL);
    created_1 = new int(1);
    created_2 = new int(2);
    cout << "CopyCtor::ctor: passed_in " << *passed_in << "," << passed_in << ", created_1: " << *created_1
         << "," << created_1 << ", created_2: " << *created_2 << "," << created_2 <<  endl;
}  
   
   
// copy constructor
CopyCtor::CopyCtor(const CopyCtor & cc) {
    // want to get a new lock
    pthread_mutex_init(&pMutex, NULL);
    pthread_mutex_lock(&pMutex);
    //if (passed_in)
    //    delete(passed_in);
    passed_in = cc.passed_in;
    /*if (created_1)
        delete created_1;
    if (created_2)
        delete created_2;*/
    created_1 = new int(*cc.created_1);
    created_2 = new int(*cc.created_2);
    cout << "CopyCtor::copy ctor: passed_in " << *passed_in << "," << passed_in << ", created_1: " << *created_1
         << "," << created_1 << ", created_2: " << *created_2 << "," << created_2 <<  endl;
    pthread_mutex_unlock(&pMutex);
}

// copy assignment operator
CopyCtor & CopyCtor::operator=(const CopyCtor& cc)
{
    if (this != &cc) {
        // want to get a new lock
        pthread_mutex_init(&pMutex, NULL);
        pthread_mutex_lock(&pMutex);
        //if (passed_in)
        //    delete(passed_in);
        passed_in = cc.passed_in;
        if (created_1)
            delete created_1;
        if (created_2)
            delete created_2;
        created_1 = new int(*cc.created_1);
        created_2 = new int(*cc.created_2);
        cout << "CopyCtor::operator=: passed_in " << *passed_in << "," << passed_in << ", created_1: " << *created_1
             << "," << created_1 << ", created_2: " << *created_2 << "," << created_2 <<  endl;
        pthread_mutex_unlock(&pMutex);
    } else {
        pthread_mutex_lock(&pMutex);
        cout << "CopyCtor::operator=: this == &cc: passed_in " << *passed_in << "," << passed_in
             << ", created_1: " << *created_1
             << "," << created_1 << ", created_2: " << *created_2 << "," << created_2 <<  endl;
        pthread_mutex_unlock(&pMutex);
    }
    return *this;
}

CopyCtor::~CopyCtor()
{
    cout << "~CopyCtor" << endl;
    delete created_1;
    delete created_2;
}

int main()
{
    int first = -1;
    int second = -2;
    CopyCtor *cc = new CopyCtor(&first);
    CopyCtor *cd = new CopyCtor(&second);
    *cd = *cc;
    CopyCtor *ce;
    ce = new CopyCtor(*cd);
    CopyCtor cf = *ce;
    cf = cf;
    delete(ce);
    delete(cc);
    delete(cd);
}

Tuesday, 1 July 2008

C++ multi thread optimisations & off file system & clipperz passowrd storer & mozilla C++ networking code & Google style guide

Optimizations That Aren't (In a Multithreaded World)

This article appeared in C/C++ Users Journal, 17(6), June 1999.

Google C++ Style Guide

How Clipperz works

Clipperz lets you submit confidential information into your browser, but your data are locally encrypted by the browser itself before being uploaded. The key for the encryption processes is a passphrase that never gets sent or saved to the server! Therefore no one except you can access your data.

Clipperz is simply in charge of delivering the Ajax code to your browser and then storing your data in an encrypted form on its servers. All encryption and decryption operations take place inside your browser.

The OFFSystem

What is OFF?

The Owner-Free Filesystem (or OFF) is a distributed filesystem in which everything is stored in reference to randomized data blocks, as opposed to a 1:1 copy of the original data being inserted. The creators of the Owner-Free Filesystem have coined a new term to define the network: A brightnet. Nobody shares any copyrighted files, and therefore nobody needs to hide away.

Mozilla C++ networking bug - upload progress bar

Javascript code prettifier

A Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page.
Look at the test page to see if it works in your browser.

tim's shared items

Add to Google Reader or Homepage