Postgres and REALBasic

I’m learning REALBasic and starting to shift over to writing cross platform desktop apps, and one thing I wanted to do is to talk to a postgres database. Here is a quick and dirty bit of code:

dim pgdb as PostgreSQLDatabase
dim sql as string
dim rs as RecordSet

pgdb = new PostgreSQLDatabase
pgdb.DatabaseName = “database.name”
pgdb.Host = “database.hostname”
pgdb.UserName = “user”
pgdb.Password = “password”

if pgdb.Connect then

sql = “SELECT foo FROM bar WHERE woo=’yay’;”
rs = pgdb.SQLSelect(sql)
if rs <> nil then
while not rs.EOF
EditField1.Text = rs.Field(”foo”)
rs.MoveNext()
wend

else
EditField1.Text = “NULL RETVAL”
end if
else
MsgBox “Connect Fail”
end if

Endpoint Compliance Systems

I have had some experience with a certain Endpoint Compliance System (ECS) and have been thinking about how I could write a cross-platform compatible ECS myself using freeRADIUS as its authenticating agent.

An ECS has an agent which is installed on a user’s machine, runs checks and reports back to a central server which then decides whether or not to allow elevated access to a wireless network.

On my development server, I already have a working RADIUS which talks to a database, and my wireless network is authenticating against the RADIUS, so all I need to do now is to write the small application which can do the following:

  • Run specific checks on the client machine
  • Report back to the RADIUS server on whether or not to allow the device

I think this system would be really useful for networks which can support multiple networks – have one which is locked down and one which is authenticated by RADIUS for network / Internet traffic.

UFO sighting last night

Last night I was out in my garden and I saw some strange lights, so naturally I took some photos on a camera which were not really suited for in-the-dark photography. It was really bizarre watching them go across the sky..

ufocloseup
noflash

The close-up one was taken when I was resting the camera on something to keep it steady.

After an hour or so after tweeting the pictures, I had a reply from @andytoots who has experienced a similar display of orange lights in the sky, and his images can be found here: http://andytoots.wordpress.com/2009/09/12/the-aliens-are-coming/

Stepping things up a bit

So far, my experiment in blogging is not going very well. I havent updated for a while, and here I am writing a draft on my Blackberry whilst feeding my youngest son.

I have spent most of my time a somewhat ‘hacky’ coder – everything from obscure variable names, to no comments and no formatting. Over the last few months, I have been straightening things up, comments, formatting, logical thought processes.

My development VM at home now has the debugger module running, so I am excited about giving it a go, but being on my own for a weekend with two ‘little angels’ may mean I’ll be spending my time playing Bloons 3 instead.

Until later, need to provide yogurt to the little one now.