It’s not uncommon that as part of a complex transaction you need to insert a row into a table with an auto-incrementing primary key and then use the key from the row you just generated as a foreign key in another insert within the same transaction. Java provides a mechanism to return the auto-generated keys from an insert query without the need to execute a second query by means of the function java.sql.Statement.getGeneratedKeys(). Unfortunately the PostgreSQL JDBC connector does not appear to support this feature (at least the version I am using does not). Given the fact that we do not have this functionality available to us when using a PostgreSQL database we need to use a separate query to retreive the value of the key we just generated. It goes without saying that we need to do this two-step process as part of a transaction but it may not go without saying that the correct way to extract the value for the key is by querying the sequence that the key is being generated from and not by querying the table directly. It is true that most of the time the highest value of the incrementing variable will be the value just inserted but that is not a guarantee.

Read more

Tagged with:

Two New Toys

Filed Under Computers & Tech on December 8, 2007 | 1 Comment

It’s been a while since that last time I got some new hardware, I think my iPod Touch was the last bit of new tech I’d gotten before this week. So, this week I made up for lost time and got myself new network printer and a new USB headset. I have to say I’m very happy with both, they just worked, no drivers, no messing. Actual, genuine, plug and play. Oh, and I was testing these on Leopard.

[tags]Apple, OS X, HP, Logitech[/tags]

Read more

Tagged with:

Contrary to popular belief Astronomers do in fact have a sense of humour! I have below incontrovertible evidence! Oh … and they can also sing pretty bloody well!

Note: This articles was written for, and first published in, the NUI Maynooth student news paper The Maynooth Advocate.

With the recent Eircom controversy the security of our home networks has at last come to the attention of the press. That attention has focused mainly on one particular flaw in Eircom wireless routers but all broadband users could do with giving their broadband connection a quick security once-over.

Read more

More QuickLook Goodies

Filed Under Computers & Tech on December 5, 2007 | Leave a Comment

I’ve already posted about two third party QuikLook generators (QLEnscript & Folder QuickLook Plugin) that I’ve come across and like. Today I have another one to add to that list, BetterZipQL. As its name suggests this generator is released by the people behind BetterZip. It’s completely free and doesn’t require BetterZip to be installed to work. The download and buy buttons on the top right of that page are NOT for the QuikLook generator but for the actual BetterZip program. The link to download it is in the text of the article just be low the screen shot. As you’ve probably guessed this generator allows you to see the contents of a wide variety of archive file formats using QuickLook.

On a related note, there is now a 1.0 version of QLEnscript available.

[tags]Apple, OS X, Leopard, QuickLook[/tags]

Tagged with:

According to this article on Boing Boing the MPAA were hit with a DMCA take-down notice for copyright infringement. I have to say I actually laughed out loud when I heard this first. Then I stopped and thought about it and am just disgusted at their hypocrisy. They spend all their time up on their high horse as defenders of the rights of artists and here they are, violating the rights of a different breed of artist, programmers. I for one can not believe the MPAA are actually genuine about their desires to protect those poor artists copyright when they shit upon the copyright of others from a height. The MPAA is about money, not the defense of the rights of copyright holders and here we have yet more proof of that. Down off your high horse already!

Skype has a feature called Automatic Gain Control which it uses to try to improve the audio quality of your call. When skype thinks your sound levels are not right it starts messing with your volume controls behind your back. Most of the time this works fine but not always. And when it gets things wrong you have a problem. There is no way to turn this feature off anymore! It used to be an option in older versions of Skype but not anymore. To be honest that’s a pretty retarded thing for the Skype people to do. Myself and Allison Sheridan ran into this problem when we tried to record our weekly ‘chit chat across the pond’ segment for the NosillaCast podcast over skype. No matter what Allison did her levels always dropped too low. She’d put them just right and then within 20 seconds they’d be all wrong again. Took us a while to figure out what was causing this, but in the end we figured out that it was Skype’s Automatic Gain Control ‘feature’. It took a lot of Googling but Allison found the right answer in the end.

[tags]Skype, Automatic Gain Control[/tags]

Read more

I’ve been looking for a good fast fixed-focus lens for a while. It was quite tough because I have a Nikon D40 and very few lenses autofocus on this camera because it doesn’t have it’s own built-in focusing motor. This means that only lenses that contain their own motor will auto-focus on the D40. After a lot of searching I finally settled on the Sigma 30 mm F1.4 DC lens. It arrived earlier this week so I’ve been doing a little playing around with it since.

[tags]30mm, Sigma, DSLR, Nikon D40[/tags]

Read more

Tagged with:

Apple’s security reputation takes another dent this week with yet another zero-day exploit in its QuickTime media player. There is now proof-of-concept code out there which uses this exploit to remotely compromise computers running both Windows and Mac OS X. The vulnerability exists in QuickTime’s handling of media streamed over the RTSP protocol. If you are a bad guy all you have to do to use this exploit to attack someone is to get them to open a specially crafted RTSP URL (a url starting with rtsp://). If the victim’s browser has JavaScript enabled you can make things even easier for yourself, you can get JavaScript to open the RTSP URL for you! What this all means is that you can now have your Mac compromised by simply visiting a web page. This is a lot worse than the Trojan that I discussed a few weeks ago where you had to actually download and install a program giving it admin access in the process in order to be compromised. I should mention that this exploit does NOT give the attacker admin access to your machine, it ‘just’ lets the attacker run any code they want as the user running QuickTime. This is not as bad as an exploit which would allow the attacker to execute any command as root/admin but it’s still very bad.

You can get more details from US-CERT. That page also gives you some guidance on protecting yourself. However, those instructions are very windows-centric.

[tags]Apple, QuickTime, Zero Day Exploit[/tags]

Read more

Tagged with:

« go back