Monthly Archives: December 2008

Selecting row number in MySQL

Michael Yakobi sent us this clever use of MySQL’s user defined variable syntax to return row numbers in a result set:

Occasionally, one wants to execute a query and have the rows in the results set numbered. This could be done using a variable. For example:

SELECT @row := @row + 1 as row, t.*
FROM some_table t, (SELECT @row := 0) r

I haven’t used this feature of MySQL before, but it looks like it could be pretty useful. The user defined variables are scoped to a connection but persist between statements, so you can use them to store intermediate state information between queries or even perform iterative calculation within a single query, as was done in the example above.

MySQL User-Defined Variables


It may not be immediately clear that the Objective C BOOL "type" is not actually a boolean type at all. This is a legacy from the original C language, which does not have an intrinsic boolean type (the iPhone GCC C compiler supports the ISO C99 standard which does define a bool type). To clarify, […]

Protected: X-MAS Party 2008 Gallery

This content is password protected. To view it please enter your password below:

iPhone 3G software unlock

The friendly iPhone Dev Team hackers have been hard at work over the holidays and have promised to release the iPhone 3G software unlocking utility, called yellowsn0w, sometime tomorrow for New Year’s Eve.

A few details from the iPhone Dev Team blog:

We have been working hard on a few other things. The main one being the 3G unlock codenamed “yellowsn0w”. This is now completed and is currently being packaged into a user-friendly application with the simplicity that you see in QuickPwn or BootNeuter.

  • The target release date for the unlock is New Year’s Eve 2008.
  • This unlock method is available to iPhone 3Gs that have 2.11.07 baseband or earlier, we did warn you.
  • You can tell what version baseband you have by going to Settings->General->About->Modem Firmware
  • The unlock requires a jailbroken 3G iPhone. It’ll be installable via Cydia and so it doesn’t matter if you have a Mac or PC.
  • Please refrain from updating your baseband, regardless of what version you’re at.
  • We’ll have complete directions on New Year’s Eve.
  • We’ll stream a live demo of the unlock before Christmas (see the update at the end of this post)

The software exists, as you can see from the video above, which was released last week, so I’m pretty confident we’ll see the release as promised. From what I understand, the software is non-invasive and needs to be run every time the phone is booted, which will be executed during boot and invisible to the end user.

You do need an un-upgraded <2.11.07 version of the baseband, and for the near future you'll have to be careful not to upgrade it if you want to keep your phone unlockable. If you want to upgrade your phone but not kill the possibility of unlocking it, the team has some information on using PwnageTool to upgrade the iPhone firmware while keeping the baseband firmware intact. If you've already updated your baseband, consider yourself stuck with AT&Tuntil a new hack comes along.

Dev Team Blog (watch here for updates)
Original yellowsn0w Announcement
yellowsn0w Preview Demo

SiteLauncher Adds Keyboard Shortcuts to Your Bookmarks [Featured Firefox Extension]

All platforms with Firefox: The SiteLauncher extension adds a keyboard launcher for your favorite bookmarks in Firefox.

Hit the extension's default launcher shortcut—Ctrl+Alt on my Mac, Ctrl+Space on Windows—then hit the key you see next to your bookmark of choice in the dark prompt panel shown below.

Once you’ve memorized the keys that go along with your most-used bookmarks, you can just hit the “Direct to Site Hotkey” plus the letter and off you go, no prompt involved. Of course all the URLs and keys associated with them are configurable. Quicksilver lovers will recognize this interface, which is a little easier to get used to than straight-up Firefox bookmark keywords. SiteLauncher is a free download that will work wherever Firefox does; thanks to the creators for including Lifehacker as a default entry.

Burn More Reliable Discs with QuickPar [Step By Step]

Reader ST discovered that aging data backup CDs he had burned had become unreadable, so now he uses QuickPar to make recovering data on disc with bad sectors possible. Here’s how he does it.

ST writes:

I have some discs burnt years ago and recently I found them not 100% readable. I’m buying more reliable discs now but I realize even with better media as times goes by the data will become more precious and inevitably…damaged (due to the physics nature of optical media). So from now on when I compose a disc to nearly full, instead of wasting the spare space I use freeware QuickPar to generate recovery volumes and burn them together.

As Usenet mavens know, QuickPar creates “parity volumes” which can verify and recover information for a file or a group of files. If some files are damaged or missing but the needed information is contained in the parity volume, QuickPar may be able to reconstruct the originals from the damaged files and the PAR volumes.

ST explains how to use QuickPar.

Drag the about-to-burn files to QuickPar, adjust the redundancy level so the “recovery data size” matches the spare space on disc (I always drag files to the burning tool first to see how much space left), then press Create.

After a while it will generate bunch of files with extension .PAR2.

Then drag them to the burning tool. Together with original files they should fit on one disc perfectly.

From there, you’re good to go burn your disc. Then, in case you need recovery, your PAR files will come in handy. ST continues:

One day when “bad sectors” occur I’ll use the free IsoBuster (or any other bad disc saver like Badcopy) to extract the most from my disc, with of course some files missing and some files partially missing.

I only hope not all PAR2 files are missing. Then here comes QuickPar again: double click on any .PAR2 file, the QuickPar will open and start to scan every file it finds, hopefully and very likely (if the disc is not heavily damaged), it will repair your precious data!

Tip 1: QuickPar only accepts files but not folders. But here’s a small hack: open windows search and search * in your desired folder then drag the result files to QuickPar
Tip 2: You can choose to only protect VIF (Very Important Files) instead of the whole disc with QuickPar
Tip 3: This method is Windows only, but the idea is universal so I believe Linux users have better solutions.
Tip 4: This is very useful when you back up a lot of movies.

Congratulations, ST! You just won yourself a signed copy of our latest book, Upgrade Your Life. Tell us your best time saver of 2008 to win your own.

FireTorrent Adds BitTorrent Powers to Firefox [Featured Firefox Extension]

Windows/Mac/Linux (Firefox): FireTorrent’s alpha-level release aims at letting anyone using Firefox start downloading torrents from any source, no separate software required. For quick or one-shot downloads, it’s pretty darned convenient.

The add-on, technically in the alpha stage and pseudo-invite-only (the link below gets past that requirement, however), doesn’t have any preferences to configure, and limits your upload speed to 15 kb/s, most likely to preserve Firefox’s basic browsing ability while you download. What it does do is simply convert any .torrent link you click on into a download, handled by Firefox just as if you were downloading a file directly. So if you want to grab something and imagine you’ll be done with the download by the time you’re out of your browser, FireTorrent fits the bill just fine. Configurable preferences are expected to arrive in the next release, according to the developer.

FireTorrent is a free download, works anywhere Firefox does (but make sure you install the right version for your OS).

NSNumber and NSInteger

If you’ve ever found yourself scratching your head thinking “now which one should I be using, NSNumber or NSInteger?” the short summary below should help.
NSInteger is nothing more than a synonym for an integer. What follows is how NSInteger is defined:

#if __LP64__ || NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;

MediaPortal 1.0 Released, Brings Open-Source DVR to Windows [Featured Windows Download]

Windows only: Open-source application XBMC has received all of the attention in the media center arena lately, but it still can’t replace your TiVo. MediaPortal can, and it just hit its official 1.0 release.

MediaPortal is a Windows-only media center application that was originally spawned as a fork of XBMC almost five years ago. Today the application has been entirely redesigned, and apart from offering much of the same functionality of other popular media center applications, MediaPortal works with hardware TV tuners to add DVR functionality to your PC. We showed you how to roll your own DVR and media center with MediaPortal a couple of years back, but now the full featured MediaPortal is better than ever.

As an added bonus, now that MediaPortal has hit that official 1.0 release, the MP developers are starting to ramp up for MediaPortal II, which aims to bring a better design and more stable architecture to MediaPortal. MediaPortal is a free download, requires .NET 2.0 or higher. I haven’t used MediaPortal extensively since we last covered it, so if you’ve got more experience with it, let’s hear your thoughts in the comments.

Hive Five Winner for Best Online Job Search Site: Indeed [Hive Five Followup]

The relatively new job search engine Indeed won top honors in this weekend’s Hive Five Best Online Job Search Sites. Monster pulled in second billing, followed by the always-popular Craigslist. For more options for finding a great job online, check out our job sites call for contenders.

WP Like Button Plugin by Free WordPress Templates