November 20th, 2009
I’ve recently been looking at hosting a complex JBoss/Apache project at Rackspace Cloud as opposed to our own servers+pipe at work.
I had changed the application to deliver the files from a CDN (in this case Rackspace Files) but thought “well Rackspace Cloud might be on the same pipe(s) as Files and could kill two birds with one stone”.
Essentially I wanted to know the pipe difference between Rackspace Cloud Servers and Rackspace Files and if Cloud was fast enough do away with Files.
The Test
Here’s some very rudimentary results where I download a 9.6 MB zip file.
Rackspace Cloud – Average download speed: 335 kb/s – Time: 27 seconds.
Rackspace Files – Average download speed: 1154 kb/s – Time: 8 seconds.
I used curl -O http://.../content.zip for the download test.
Conclusions
Rackspace Cloud doesn’t use the same “pipes” as Rackspace Files (I’ve never read that Rackspace claim, “Cloud is as fast as Files” I wasn’t expecting the same results, just curious).
A dedicated CDN is the best way to go for delivery of large files quickly. (Rackspace Files uses the Limelight Network). I’ve heard rumours that Rackspace has Australian edge(s) and this seems to be the case.
I will still want to use Rackspace Files for large content delivery.
Misc
I use TPG ADSL2+ at home and never seen downloads faster than 1250-1300 kb/s. Using a 2.16GHz Macbook Pro.
At the time of writing: Rackspace Cloud Server is a cloud server hosting infrastructure. Rackspace Files is a Content Delivery Network.
Tags: Rackspace
Posted in Uncategorized | Comments Off
November 13th, 2009
Some thoughts on Kindle (International version) in Australia.
Screen
I absolutely love the sharpness of the text. It’s not pixelated or jaggy and to me mimics the look of printed text. Under sunlight the screen is easy to read (doesn’t wash out like LCD screens) and interestingly the more light the better the screen looks.
The screen refresh is weird, not wrong, just weird. It flicks and redraws itself. I guess there’s time to turn a physical page anyway with traditional books/magazines.
The contrast of background to text colour is fine until you’re in low light situations and you find yourself drawn to light sources, as above the more light the better the reading.
The time for a page turn (aka screen refresh) makes web surfing nigh on impossible (a moot point here in Australia as browsing outside of the US is limited to wikipedia only).
Killer features
The inbuilt dictionary (displays at bottom of page when you select a word).
The long battery life (48 hours and 2 notches down).
Conversion from doc/pdf to Kindle (send from your email address to the kindle (fee) or back to your email client (free)) is nearly a killer feature (I wish for native PDF).
Searching within a book.
Downloading a book within 60 seconds.
Weight, size and feel
The size and weight are killer features also.
There’s a “chin” to the bottom of the product, where the keyboard buttons are. I originally though this was undesirable but lying in bed resting the “chin” of the Kindle on my chest and it dawns on me. The “chin” exists by design and props itself up making reading easier than a paper novel.
The keyboard isn’t the greatest, but you use it minimally making it not a show stopper.
Audible, MP3, mobi files and text-to-speech
Getting Audible/MP3 onto the Kindle is a breeze, you use the USB cable (supplied) and it’s mounted as a volume then just copy the audio files into the existing folder structure.
3.5mm headphone jack on top. Volume on side. Easy.
Text to speech is so-so as a plus it can be turned up loud, the inbuilt speakers (2) are very strong.
Weakest links
Some of the UI elements are strange to say the least, example: To play text-to-speech press Shift and SYM. There’s no “speech” button or menu item. huh? This goes for trying to find the Web Browser, and in all honesty the Kindle Store should be linked from the Home screen (not from a menu).
By far the weakest link with the Kindle in Australia is gulp the Kindle Store itself.
I was unable to find anything from these authors: Clive Cussler, Bryce Courtney, Dan Brown, Raymond E Fiest.
Furthering the damage, there’s limited selection of books (2) from Neal Stephenson (I wanted to get Cryptonomicon) and Faye Kellerman sees only 3 books.
There’s simply not enough books (though you’re fine if you want to read the Twilight series /sigh) and I feel that Amazon really needs to work hard on the publishers and get more books into the Amazon Kindle Store.
No backlight. Not a curse, but it would have taken it to 11.
Summary
Now I have one (only 48 hours old), would I recommend one? Easily yes, and after thinking heavily price would be the only deciding factor.
Posted in Kindle | 2 Comments »
September 29th, 2009
Scenario: My base machine (mac) hosts all my source code as I want a single code point to backup. My Windows development environment is in a Virtual Machine using VMWare Fusion. (I believe this issue will apply to VMWare Workstation, Player and Fusion).
I am using the VMWare built in “Share Folder” option, and I’m sharing only the “win” folder in my ~\src\ folder.

Issue: When trying to open source using Visual Studio 2008 I’m presented with the dreaded “The project location is not trusted” error.
Solution: Open a Command-Line box (Start > Run > cmd > OK)
cd \Windows\Microsoft.NET\Framework\v2.0.50727
caspol -m -ag 1.2 -url \\.host\* FullTrust |
If you’re not using VMWare or have a share elsewhere substitute “\\.host\*” for your shared folder.
References: The project location is not trusted dialog box and The project location is not trusted dialog box when trying to use a Network Location
Posted in Uncategorized | Comments Off
August 6th, 2009
I wanted a drop dead simple Fluent NHibernate connection to a Sql Compact (.sdf) file and was able to use:
private const string DbFile = "firstProgram.db";
return Fluently.Configure()
.Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString(c =>
c.Is("data source=" + dbFile))
)
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<Program>()
)
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory(); |
Whereas the Sqlite connection was:
private const string DbFile = "firstProgram.db";
return Fluently.Configure()
.Database(SQLiteConfiguration.Standard
.UsingFile(dbFile)
)
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<Program>()
)
.ExposeConfiguration(BuildSchema)
.BuildSessionFactory(); |
When Googling I wasn’t able to find any samples so I hope to fill that void.
Tags: Fluent-NHibernate
Posted in Uncategorized | 1 Comment »
July 28th, 2009
There’s certain files and folders that you don’t want to put into source control. With Mercurial all you need is a .hgignore file in the root path of your project. A simple windowsy way of doing this is (from a command line) is by typing
notepad c:\path_to_code\.hgignore
This will create the file so now simply add the following lines to the file:
# use glob syntax.
syntax: glob
# Misc Mac/Windows stuff
.DS_Store
Thumbs.db
Desktop.ini
# builds
*.exe
*.ex_
# vb6
*.SCC
*.vbw
*.pdb
*.log
*.Log
# c-sharp
#ProjectName/bin
#ProjectName/obj
*.user
*.suo
_ReSharper.*
*.sln.cache |
Note: You need to change #ProjectName to your project foldername.
Now feel free to init/add/commit:
hg init
hg add
hg commit -m "Initial Commit with ignores" |
Tags: Mercurial
Posted in Source Control | Comments Off
June 2nd, 2009
I was having a hell of a time trying to get my UITableView to resize itself after the iPhone keyboard displayed itself. After being just a little surprised that the iPhone doesn’t resize the underlying UIView for free I figured it was up to me to do resize.
Firstly add a few variables and method declares into your ViewController.h header file:
Boolean keyboardIsShowing;
CGRect keyboardBounds;
- (void)resizeViewControllerToFitScreen; |
Now we need to register for the UIKeyboardWillShowNotification and the UIKeyboardWillHideNotification:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; |
And these notifications need somewhere to go:
#pragma mark -
#pragma mark Keyboard Handling
- (void)keyboardWillShow:(NSNotification *)notification {
NSDictionary *userInfo = [notification userInfo];
NSValue *keyboardBoundsValue = [userInfo objectForKey:UIKeyboardBoundsUserInfoKey];
[keyboardBoundsValue getValue:&keyboardBounds];
keyboardIsShowing = YES;
[self resizeViewControllerToFitScreen];
}
- (void)keyboardWillHide:(NSNotification *)note {
keyboardIsShowing = NO;
keyboardBounds = CGRectMake(0, 0, 0, 0);
[self resizeViewControllerToFitScreen];
} |
And now add the magic method to resize the view:
- (void)resizeViewControllerToFitScreen {
// Needs adjustment for portrait orientation!
CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];
CGRect frame = self.view.frame;
frame.size.height = applicationFrame.size.height;
if (keyboardIsShowing)
frame.size.height -= keyboardBounds.size.height;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.3f];
self.view.frame = frame;
[UIView commitAnimations];
} |
And super importantly de-register the ViewController from those notifications.
- (void)viewWillDisappear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
} |
See how this all comes together?
1. We register for Notifications when the Keyboard shows/hides,
2. We react when the keyboard is shown/hidden,
3. The resizeViewControllerToFitScreen method handles our resize, including animating the underlying view so it looks pretty.
There’s a few caveats:
1. I’ve not tested on Landscape mode, I’m pretty sure this will fail.
2. UIKeyboardWillShowNotification can get fired every time you enter a textbox (as I’ve only one textbox it’s not a problem for me). So you might need to look at using …TextDidBeginEditing/…TextDidEndEditing or maintaining state differently so that the view isn’t jumping all over the place.
Posted in Apple, Cocoa | 2 Comments »
May 22nd, 2009
One little gripe I’ve always had about in OS X is the apparent waste of space either side of the Dock (assuming you have it centred at the bottom of the screen).
Geektool to the rescue!

Here’s the little scripts that I use to get the weather (just change the region code ASXX0016 to your region from weather.yahoo.com. Your region code will be found in the yahoo URL):
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=ASXX0016&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' |
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=ASXX0016&u=c" | grep -E '(High:)' | sed -e 's/<BR \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<br \/>//' |
And the script for Memory usage, HDD space and Uptime:
top -l 1 | awk '/PhysMem/ {print $10}'
df -hl | grep 'disk0s2' | awk '{print $4}'
echo "Uptime: "`uptime | awk '{print "" $3 " " $4 " " $5 }' | sed -e 's/.$//g';` |
You might also be interested to check out other uses of Geektool on Flickr
To Apple: Let us put Widgets on the Desktop too please (without having to use a hack).
Posted in Apple | 2 Comments »
May 21st, 2009
I don’t like initialising my UIViewControllers and their associated nib explicitly using a string
FlipsideViewController *viewController = [[FlipsideViewController alloc]
initWithNibName:@"FlipsideView" bundle:nil]; |
But would rather my UIViewControllers know how to load themselves. This reduces the possibilities of typos, allows for only 1 place in code where your nib is referenced by name, and just looks better.
For example in FlipsideViewController.m I would add:
- (id)initWithNibName:(NSString *)nibNameOrNil
bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:@"FlipsideView" bundle:nibBundleOrNil])) {
// Initialization code
}
return self;
} |
Now you can simply initialise the ViewController using
FlipsideViewController *viewController = [[FlipsideViewController alloc]
init]; |
Posted in Uncategorized | Comments Off
May 20th, 2009
Mozketo blog is written by Ben Clark-Robinson about Cocoa development, Apple and my adventures in .net. (A strange mix, yes).

I am a c# .net software engineer by day, though once the sun sets low below the horizon and the Apple startup sequence chimes I am transformed into a Cocoa & Cocoa Touch engineer.
I have a diploma in IT and a degree in IT major Software Engineering.
Bits and pieces i’ve worked on
Websites: Mozketo (this site) or WGA.
Web applications: Servizio (Windows Mobile)
Desktop application: Membership

Home computer setup
Macbook Pro with external 22″ Benq LCD, bluetooth wireless Apple keyboard, MS Notebook Mouse 5000, and my well loved iPhone 3G.
Favoured Apple Software
CSSEdit
TextMate
Transmit
Aperture
Voodoo Pad
Littlesnapper – Quicksnapper profile
Server related
Using a Joyent shared hosting server and Wordpress with a custom Mozketo template.
Posted in Uncategorized | Comments Off
March 12th, 2009
I’m trying to find the best Bluetooth Mouse for Apple Mac OS X. I really like being able to just turn on a mouse and boom it works without having to plug in a dongle. So I’ve compiled a mini-review of the Bluetooth mice I’ve tried to date and hoping you could help me expand the list. Read the rest of this entry »
Posted in Uncategorized | 1 Comment »