Thursday, April 29, 2010

Free (as in speech) Pascal / Lazarus History and Future

If you need a good intro to Pascal History and it's  Successors then Wirth wrote a good paper
with the birth and evolution of the Pascal Language.
Another tutorial where there is a very good introduction to Pascal/Lazarus IDE history.
He seems a little too pessimistic about the pascal disappearing from history in the next 20 years !
but if you watch Tiobe language index you will see that Delphi+Pascal is growing over the years
and in terms of how fast you can build an application without writing too much (Rad way)
Lazarus is the fastest way to create desktop and in the near future web2.0 application
I think for web2.0 it needs a Webkit WYSIWYG form and designer + webcontrols
You don't believe  me ?  see what you can do with extjspascal and that is just the beginning

http://web.me.com/macpgmr/ObjP/MacXPlatform_Part7.html
http://prime.fmsoft.net/out/dbdemo.dll

Also another example app shows how to
create a Web app that's optimized for a mobile device like the iPhone.
Take a look at ExtPascal_Video2.mov:
http://web.me.com/macpgmr/ExtPascal/



I will highlight some good quotes and points for pascal and lazarus from the history

Pascal is free-flowing, unlike {insert other cryptic language}, and reads very much like a natural language, making it very easy to understand code written in it.


Turbo Pascal was truly revolutionary. It did take some shortcuts and made some modifications to standard Pascal, but these were minor and helped it achieve its greatest advantage: speed. Turbo Pascal compiled at a dizzying rate: several thousand lines a minute.

I still remember the old days at school watching how fast the x80286/x80386 based pc compiled the source code we wrote in TP
And today Free Pascal beats the s**t out of the gnu c++/gcc compilers ,
You don't believe me here are the times on compiling the FreePascal Compiler 2.4.0 itself with
the same version of the compiler (that comes in Ubuntu Lucid Lynx)
this compiles the units too
tar -zxvf fpc-2.4.0.source.tar.gz
cd fpc-2.4.0
time make all

real 2m9.143s
user 1m46.835s
sys 0m16.937s

this on an old Intel Pentium CPU E2180 @ 2.00GHz

Monday, April 26, 2010

Using lazarus ide with firebird in ubuntu lucid lynx

Start lazarus from command line or from main Menu Programming -> Lazarus

$sudo lazarus-ide or

SQLdb tab also contains a component TIBConnection that you can place it on the form





we will connect to /var/lib/firebird/2.1/data/employee.fdb



On the form put an TIBConnection, TSQLTransaction,TSQLQuery,TDatasource and an TDBGrid
























TIBConnection is configured to have DatabaseName=/var/lib/firebird/2.1/data/employee.fdb



Password=masterkey



Username=sysdba



and Transaction=SQLTransaction1



You can put it to be Connected = True







Then configure SQLTransaction1



to use




Database=IBConnection1



Active =True;










Configure TSQLQuery  this way




Database:IBConnection1



SQL=select * from employee;



Active = True;











Configure TDatasource



DataSet=SQLQuery1






Configure TDBGrid




DataSource = DataSource1










Next you can put an button and make them active from run time





procedure TForm1.Button1Click(Sender: TObject);
begin
SQLQuery1.Active:=true;
end;













ps: screenshots are from a previous article and by default now lazarus usese gtk2 so it looks nicer than the above ones

Friday, April 23, 2010

Getting started with #firebird and #lua on #ubuntu

I needed lua for a work related project and for database persistence i use firebird

So on ubuntu lucid lynx i have installed this way the Firebird Lua client

sudo apt-get install luarocks
sudo luarocks install fbclient

Tested with my local django db , Here is my test script for firebird connection



Then i wanted to insert some values
for that i have used exec_imediate and the interesting fact you must use double quote for insert statement otherwise you wil get Column unknown JACK if you try to put the name in single quote



The complete example would be with insert and read like this

Monday, April 05, 2010

Dirty Socks and Dirty Woman

This is dedicated to Csaby
Yes the cat it was crying in the night and i couldn't sleep after reading some vampire book (twilight)
and the original idea for Dirty Socks was to be more happy but i think the happy version will be in Romanian language only :)

No cats were harmed during the writing and inspiration but only some spiders (rip)
and some persons can feel that i described them here , maybe is false and it's only fictional
and yes i have a washing machine and wash my clothes :)


Dirty Socks and Dirty Woman (Blues for Csaby v 1.0 )

I'm really Lonely and my socks are Dirty
She really left me with my Laundry Dirty
Can You sense that she is really Dirty
I Can Cray but she is really Flirty

I feel the pain but she really doesn't care
She really left me with the cat only
I'm really drunk but she really doesn't care
The only love i have is from the cat only


I feel the socks and i know i'm lonely
I know for sure she is not lonely
Can you sense that now i'm lonely
I can cry but i'm still sadly


She broke my heart but she really doesn't care
I sing my song in front of the cat only
She is still hot but she really doesn't care
The only care i've got is from cat only


(here the rithm is more intense and rocky )

I'm really lonely and i washed my socks
She really left me i know my life sucks
Can you sense that she really sucks
I can't cry now because i washed my socks

(the rhythm intensifies here it's the end after all )
I don't feel the socks
and i don't feel nothing for you
I know for sure that i won't be lonely
I washed my socks and washed my soul

I'm not really Lonely and my socks clean
She really left me but my Laundry is clean
Can You sense that who is really Dirty
She Can Cry now but i'm really Flirty

[guitar scratches and you can burn it after is finished :)]

Build me a Woman that will ...

Last night i couldn't sleep to well so i had to write these verses from my mind
it's a blues and some words might be too harsh but this is how the things are in this
world rough and uncut (the style of blues sound i had in my mind it was something like Johnny Lee Hooker and maybe combined with some Doors )




ps: i know is a little too dark but this is v 1.0 and i hope to improve the verses over time

Saturday, April 03, 2010

Crazy Fishy Pasta - The Road to Hell

Inspired by the song The Road to Hell here is one kind of recipe for pasta

What you need :
-one onion
-some garlic
-2x fish cans (I have some RioMare PerPasta all'Arrabbiata that contains already a lot of paprika )
-one pack of spaghetti barilla
-dolmio or any tomato sauce would do
I brought double tomato paste made in Italy (made of real tomatoes not some fake shit that you can find in Romanian shops) also i have some sauce with some olives (Made by Baneasa again in Italy!)
-celery
-parsley
-paprika
-basil
-lovage
-chili
more
-chili
and yes more
-chili
This is the road to hell after all

The mixing and the process

First you need to chop the onion and garlic and put it the pot with some olive oil for a few minutes. Then put the tomatoes sauce in the pot and stir Put the fish from cans over and stir until it does have some nice color for about 5 minutes . At this point you can season the food with the condiments from above and others. And you can put the pasta in the same pot and mix it after it was boiled and washed or you can put the above mix on top of pasta when you serve it in
the dish.

To make things more interesting i have added for diversity some Sage , Cinnamon, All spice

For wine i have some Tokay and i think i need a beer (Siva Black edition) to wash my mouth burns
Tomorrow i will see if it burns twice yes I love Paprika :P and Chili and you can't eat it without thinking what will happen in second day

I will get out with my bike after this meal just to burn the calories and oxygenate my brains
For music I recommend for this food
Cris Rea - Road to hell
Dire Straits :Money for Nothing and Sultans of Swing
And this should work too AC/DC Highway to Hell