Firebird News

Monday, January 31, 2011

Rant of the day:There is something more Forked up than #XML, and #JAVA: Tal and Metal

If something can be coded wrong it will be done and coded wrong.
Or if the customers can choose the worse solution from the marked that is what you will fight next
eg:from the all cms solution you will get the worse written one and in the worse language (C#/vb anyone?) and with the worse security track and with the proprietary bells and wissels.
I think you can get the idea , now i want to talk about the template languages
from all the template languages the worse i have seen in years is the one based on xml:tal,metal and frends
Why on earth is there a need to humiliate the python language with such a horrific abomination ?
when you have such nice template languages for python such as Jinja , and Django template engine
ps:I'm not the only one that observed the complexity of the plone's templates system

One way to sweet the ugliness of plone is using jinja instead of tal

>>> from jinja2 import Template
>>> t = Template('{{ name }} rocks!')
>>> t.render(name='Guido')
u'Guido rocks!'

Sunday, January 30, 2011

#node.js and #firebird installing on Amazon EC2 instance

Here are the notes on Installing node.js module for firebird
I assume Firebird was installed from source or from tar.gz and in a linux instance (mine is the free one)


wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz
tar -zxvf node-v0.10.*.tar.gz
cd node-v0.10.*
./configure 
make ; sudo make install

Next is time to install the firebird module (Firebird was installed from source in /opt/firebird2.5.x)

git clone git://github.com/xdenser/node-firebird-libfbclient.git
cd node-firebird-lib
export PATH=$PATH:/opt/firebird2.5.x/binfbclient/

npm install

create firebird db and test table in /tmp/nodedb.fdb with isql or isql-fb

SQL>CREATE DATABASE "localhost:/tmp/nodedb.fdb" user 'SYSDBA' password '*********';
SQL> CREATE TABLE TEST (ID INT NOT NULL PRIMARY KEY, NAME VARCHAR(20));
SQL> create generator gen_test_id;
SQL> SET GENERATOR gen_test_id TO 10;
SQL> set term !! ;
SQL> CREATE TRIGGER TEST_BI FOR TEST
CON> ACTIVE BEFORE INSERT POSITION 0
CON> AS
CON> BEGIN
CON> if (NEW.ID is NULL) then NEW.ID = GEN_ID(GEN_TEST_ID, 1);
CON> END!!
SQL> set term ; !!

Then write the test.js script to connect to it



you can observe that the id is auto incremented if you run it multiple time

node test.js 
[ { ID: 5, NAME: 'new one' },
  { ID: 11, NAME: 'new one' },
  { ID: 12, NAME: 'new one' },
  { ID: 13, NAME: 'new one' },
  { ID: 14, NAME: 'new one' } ]

also in the name you can put later the
browser or the ip in one of the columns


We build now the version for the web modifying the hello world version adding the firebird database glue



you can run it with
 node firebird_example.js

Thursday, January 27, 2011

N13 PCIe Wlan driver on ubuntu 10.10 (x64)

Download the linux driver from ralink corp RT2860PCI/mPCI/CB/PCIe(RT2760/RT2790/RT2860/RT2890)
make ; sudo make install
driver is rt2860sta
install wicd and wicd-client
sudo apt-get install wicd wicd-client
disable network-manager at boot

if you are on 64bit version of maverick you will get a nice error message with


kernel: [] phy0 -> rt2800pci_load_firmware: Error - PBF system
register not ready.

That is a confirmed bug #659143
Solution was for me to install the wireles-next and to reboot
download
wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2010-12-14.tar.bz2
tar -jxvf compat-wireless-2010-12-14.tar.bz2
cd  compat-wireless-2010-12-14
./scripts/driver-select rt2x00
make 
sudo make install 
sudo reboot 
ps: at the end of the bug if you don't want to mess your wireless there is a testing kernel that solves the issue , you can try it if you don't want to compile it

Tuesday, January 25, 2011

Bug #1 Trowing user in console is wrong in #ubuntu , #debian #Linux

Sometimes you have seen it on linux , blank screen after not installing nvidia's drivers or ati's or if the card is not known , or if the card is too old and is not supported or if the driver does have bugs
Why the hack don't throw the user in standard mode
try
{boot user in proprietary mode 1600x1200 compiz enabled}
catch
{boot user in 800x600 classic and trusted vga mode , no kms shit and in amazing 2d mode}

Then the user can update or search on forums or use it in normal mode

ps: yes i look now at the blinking cursor
and it ubuntu 10.10 live cd boots with ati 6950 if you disable in grub splash screen
and quiet mode is disabled , i have added the debug in grub boot option also vga=788 would help
pps:best way to install is still alternate text mode ... lets see if grub is not fraked up
All installed fine from console seems that somewhere there is a lockup , anyway
i downloaded catalyst 10.12 for amd64 ran the installer from shell
sudo sh ati-driver-*

or better idea is to build the packages

sh ati-driver-installer-10-12-x86.x86_64.run --buildpkg Ubuntu/maverick

created the xorg conf (seems that it does't quite detects the 69xx with aticonfig)
with vi /etc/X11/xorg.conf
Section "Device"
Identifier "ATI radeon 6870"
Driver "fglrx"
EndSection 
Then i had to remove the unsupported logo on the right

cat disable_unsuported_logo.sh
#!/bin/sh

DRIVER=/usr/lib64/xorg/modules/drivers/fglrx_drv.so

for x in $(objdump -d $DRIVER|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $DRIVER
done


inspired by this thread of installing 69xx on ubuntu 10.10

pppps:
Seems that the boot problem was related by one faulty sata type cdrom
(I hate thouse things) somewhere all is locked and waiting for the fake ide
drive so is not related to the video , but the rant applies
I want debug mode in opengl window for faulty hardware :)

Saturday, January 22, 2011

Fixing the Unknown media type in type 'interface/x-winamp-skin' while updating in ubuntu/debian

I think i have seen this error message while updating ubuntu/debian for years and wondered what it is and why is not solved :it's known bug but no one does nothing to fix it in debian/ubuntu/freedesktop/kde land
seems the worse idea to keep the mime types in xml format and is quite verbose for some errors

you can see the file and the package that contains it
 dpkg -S  /usr/share/mime/packages/kde.xml
kdelibs5-data: /usr/share/mime/packages/kde.xml

what i did is to delete the lines with the errors
vi /usr/share/mime/packages/kde.xml
and deleted the lines corresponding to the error

Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Unknown media type in type 'uri/mms'
Unknown media type in type 'uri/mmst'
Unknown media type in type 'uri/mmsu'
Unknown media type in type 'uri/pnm'
Unknown media type in type 'uri/rtspt'
Unknown media type in type 'uri/rtspu'
Unknown media type in type 'fonts/package'
Unknown media type in type 'interface/x-winamp-skin'

and here is the diff on my debian
after that the update-mime-database worked without errors

update-mime-database -V /usr/share/mime

Updating MIME database in /usr/share/mime...

Wrote 959 strings at 2c - 5418

Wrote aliases at 5418 - 594c

Wrote parents at 594c - 6d34

Wrote literal globs at 6d34 - 6dec

Wrote suffix globs at 6dec - ffc8

Wrote full globs at ffc8 - 10008

Wrote magic at 10008 - 19cf0

Wrote namespace list at 19cf0 - 19d30

Wrote icons list at 19d30 - 19d44

Wrote generic icons list at 19d44 - 1a818

Wrote types list at 1a818 - 1b414

Monday, January 17, 2011

Lazy to do the django erd/uml for your models ? there is a tool for you

There is the graph models extension so you don't need to work out too much ;)
and is quite easy to install from git

The best language for 2011 is ... drums python

Seems that it won the tiobe language index for 2010 with growing pains  and i can agree : django and python are very good and winning the market
look at ubuntu development is mostly done in python (launchpad , ubuntu one ...) but is not all about it there are
other sites:
I can give the best example :reddit it is the site that won the competition with digg (still using that crap ? ahh and did you knew that reddit started as a delicious clone ?) and you can download the source and modify it
Even if you don't like it you got the power of opensource.

php and it's cousin visual basic are on the down slope , i see that free pascal and assembler !!? is growing (now assembler comeback is scary )

In other news nginx gains a lot of the webserver market against ...Microsoft . No wonder they loose the web fight with google and open source in general

Tuesday, January 11, 2011

Stunning webgl demos around the interweb

First one is a spiraling flower and another one is a Fresnel shader
All via webgl around the net



Thursday, January 06, 2011

android ndk5 tips: running sanangeles

Just installed the new android sdk 2.3 and ndk r5 + eclipse updates
and I wanted to test the sanageles in emulator and
I've got this error in res-> layout -> main.xml

Unable to resolve dimension value "match_parent" in attribute "layout_width"

so replace match_parent with wrap_content everywhere in main.xml




Hello from jni (native code) in Android

I wish that android ndk to be merged into sdk so we have one less step after installing the sdk

The NDK includes sample applications that illustrate how to use native code in your Android applications:

* hello-jni — a simple application that loads a string from a native method implemented in a shared library and then displays it in the application UI.


I unziped the ndk into my home /home/mariuz/android-ndk-r4b
added it to path
vi /home/mariuz/.bashrc

and added this line

export PATH=${PATH}:/home/mariuz/android-sdk-linux_x86/tools:/home/mariuz/android-ndk-r4b:
the use the build-ndk to build the shared library
cd /home/mariuz/android-ndk-r4b/samples/hello-jni/
ndk-build 
Gdbserver      : [arm-eabi-4.4.0] /home/mariuz/android-ndk-r4b/samples/hello-jni/libs/armeabi/gdbserver
Gdbsetup       : /home/mariuz/android-ndk-r4b/samples/hello-jni/libs/armeabi/gdb.setup
Gdbsetup       : + source directory /home/mariuz/android-ndk-r4b/samples/hello-jni/jni
Compile thumb  : hello-jni <= /home/mariuz/android-ndk-r4b/samples/hello-jni/jni/hello-jni.c
SharedLibrary  : libhello-jni.so
Install        : libhello-jni.so => /home/mariuz/android-ndk-r4b/samples/hello-jni/libs/armeabi


Next, build the sample Android applications that use the shared libraries:

* If you are developing in Eclipse with ADT, use the New Project Wizard to create a new Android project for each sample, using the "Import from Existing Source" option and importing the source from /samples/hello-jni/. Then, set up an AVD, if necessary, and build/run the application in the emulator.