Friday, September 08, 2006

discovering more perl goodness

so what do you call a Linux Apache Postgresql Perl setup?
LAPP?
i always wondered why so many people used MySQL.
admittedly i started using it when i started playing with databases but i always wanted to play with Postgres and this app i am writing is allowing me to do that.
i started using MySQL initially but it was not co-operating properly so i switched to SQLite but then that was getting annoying cause Catalyst::Plugin::DBIC::Schema wasnt generating Classes for the views i was using.
so i wanted to avoid MySQL and it not working gave me a decent excuse to do that so i ported the DB to Postgres and all is happy and i get generated classes for my views. (i don't actually use the generated classes in the app but its nice to have them as reference and i just copy them across to the actual classes when i change the DB.)

oh yeah the extra perl goodness.
(yeah i rambled again hence the title of the blog)
i needed some functions in the DB to generate totals and percentages an such and conditionally adding delivery costs to the totals.
then i hit a snag cause using the Pg money data type is really annoying cause when you want to do division it refuses to work and i cant seem to cast it as anything else and division is kinda essential when doing percentages.
so i went looking for docs on how to cast money as something useful and discovered that the money data type is being phased out (probably due to the problems i encountered) but i found this plperl function (thanks dude if you ever read this) to convert money to numeric (which can be basically setup like money but without the currency tag on the front)
so i imported it and it worked like a charm.
so i thought i would try writing the functions in plperl and they are short but do exactly what i needed.
and now i am thinking i should have planned the thing a bit better and did this from the start.
but then i wouldn't have had the fun of learning as i go which is how my brain works.

ok i am gonna run off and install Kubuntu Edgy i386 so i can play with the test release of KDE4.
(i already have an Edgy install but it is amd64 and the KDE4 testing packages only got released on i386)

Saturday, September 02, 2006

Intro

I discovered the meaning of Business recently.
Especially new startup businesses, well kinda new it has been running since early this year but i guess that counts as new.
Anyway rambling again.
Business means busy-ness. just that. being busy most of the time doing little else that isn't related to the business.

I have been writing some software for a client that was going to be running on his server but that got taken back by his former business partner so he needed an entire office setup.
6 client machines and a server, kinda cool for a new startup doing an office setup but the coolest bit was he wants the whole system to run linux and me being a huge linux geek jumped at the chance. also being a huge KDE fan i decided that our preferred choice of distro (ie Kubuntu) would work rather nicely since i believe KDE is easier to use for people who are used to Windows.
So to make it even easier to keep updated i decided to run the clients as diskless workstations, which i have never done but that has never stopped me before, and have the server be the desktop for the Managing Director so all he has to do is click a few buttons stick in a password and the whole office gets updated.
So now (well once the thing gets delivered) we can call ourselves a Linux business.
This makes me happy because that was the original idea behind the business.

The software i am writing is fun because i got to write it in anthing i like.
So me being me i chose perl, well Catalyst to be exact. It is great because i needed to get back into perl programming and i get to do database programming and can avoid using SQL. I still need to finish the thing but it has taught me a bunch of new stuff which is always good.