Diversia ported to FreeBSD
This week I finished the FreeBSD port of Diversia. The information about the FreeBSD port can be found in the...
Recently I found an interesting piece of code again which I would like to share with you.
I produced the code about a year ago for a project which needed offline data logging.
I used the piece of code to print a line to a matrix printer from PostgreSQL. The matrix printer was connected to the database server and supplied with endless paper. I used a matrix printer, because you can print directly to the device.
With the method, described below, it’s possible to print with a SQL query or print something initiated by a trigger. Using this method you can log specific data ‘offline’.
The print_line method consists of three files; print_line.c which contains the code to address the printer, a Makefile to compile the print_line.c file and a print_line.sql file which creates the function in SQL.
Makefile
MODULES = printhash
PGXS := $(shell pg_config --pgxs)
include $(PGXS)
print_line.sql
CREATE FUNCTION print_line(text) RETURNS integer
AS '/usr/local/libexec/print_line.so', 'print_line'
LANGUAGE C STRICT;
Installation:
mkdir /home/user/print_line
cd /home/user/print_line
unzip print_line.zip
make
cp print_line.so /usr/local/libexec/
// open postgresql command line client and execute:
# \i /home/user/print_line/print_line.sql
Usage:
SELECT print_line('Hello World!');
Download:
Download print_line.zip
Deze week is een interview met mij over Diversia in Linux Magazine verschenen.
“Verder spraken we voor deze editie met de ontwikkelaar van Diversia, een open source-variant op Second Life. Waarom Diversia wel een succes wordt, terwijl Second Life langzaam verandert in een spookstad, legt projectleider Melvin Rook uit in een rijk geïllustreerd artikel.”
Inmiddels heb ik ook al veel positieve en leuke reacties op het artikel ontvangen.
A while ago I decided to buy a Synology DS1010+ to backup my data. People keep me asking why I bought a Synology. Well, next to the fact it runs on open source software, Linux and has wide variety of features, I guess the following video explains everything.
More information on Synology NAS systems can be found at www.synology.com
This week I finished the FreeBSD port of Diversia. The information about the FreeBSD port can be found in the...
Update (April 13, 2010): I asked myself how to file a bug report. It seems blogging is a way to...
In the weekend a lightning storm passed Arnhem. It was too hot to sleep, so I decided to film it...
After some puzzling I found out how to setup a nice development environment with wxFormBuilder and Code::Blocks on Mandriva Linux...
Someone apparently hacked into an electronic road sign in Hamilton County Monday morning, prompting stares and giggles from motorists because...
Last week Raymond and me finished the Linux device driver for the Texas Instruments TMP421, TMP422 and TMP423 temperature sensors....
Somehow I was reminded of an old project of mine. After a little search in my archive I found all...
How to begin with game development? That’s the very same question I asked myself a few years ago. I think,...
Yet another brilliant firefox extension: Pirates of the Amazon Add-on “How can you compete with free? You cant!” – Lawrence...
Recent Comments-