Tech Thought

Tech tips, hints, and general musings. PHP, Perl, Mysql, Javascript, AJAX, JSON, Linux, Mac OSX

How-To Fix: MAMP won’t start

Okay, so sometimes our shiny friend and development support buddy MAMP won’t start properly.  I’ve found this often happens when you’ve first booted up your Mac and you try to start getting stuck into your code.

Symptoms are pretty simple to diagnose – you start MAMP, and it’s control panel pops up and shows that everything is running:

MAMP Control Panel

But for some reason you can’t access your webserver or database:

MAMP not working

What to do?  Restarting the servers generally doesn’t solve the problem.  However, there is a trick I’ve discovered.  Open up the control panel and click the “Preferences…” button.  Once this popups up, choose the “Ports” tab, change nothing – and click OK:

MAMP Preferences Pane

MAMP will automatically restart – and you should be up and running!

WWDC 2009 Update: Keynote Summary for iPhone

WWDC: Today’s keynote included many things we already knew about the iPhone, and few things we didn’t. Here’s a quick summary from the team at WSP Online – on site at the Keynote in Moscone Center, San Francisco CA.

[Read the rest of this entry...]

The Hidden Park: iPhone gaming to get your kids off the couch

Bulpadok has just published The Hidden Park, an adventure game with a difference – you!  Developed in association with WSP Online Solutions, and Conduct, The Hidden Park uses the iPhone’s GPS to immerse you in a world within your local park (currently 10 parks around the world are supported, with more promised).  Using the accelerometer, camera, GPS and touch screen, The Hidden Park fully utilises all capabilities of the iPhone.

Hidden Park iPhone Screenshot

As you navigate throughout the park, you receive instructions from a character called ‘Trutton’ and learn that the park is in trouble.  Your challenge is to help Trutton save the park before its too late by navigating the park, solving puzzles and interacting with characters throughout.  The game provides a beautifully illustrated map of the park, with your location being represented by an Avatar, who moves as you move around the map.

Gameplay takes about an hour to complete, making the game an ideal day out for families, and provides a perfect opportunity to get the kids off the couch and out exploring a magical world in their local park.  Currently the Hidden Park supports the following locations:

  • Melbourne Botanical Gardens, Australia
  • Sydney Botanical Gardens, Australia
  • High Park, Toronto, Canada
  • Boston Common, Boston, USA
  • Central Park, New York, USA
  • Kensington Gardens, London, UK
  • Tokyo Ueno Park, Tokyo, Japan
  • Englischer Garten, Munich, Germany
  • Zoological and Botanical Gardens, Hong Kong

The Hidden Park is available on the App Store for $6.99 and comes highly recommended.

More information is available at TheHiddenPark.com.

BudTrap: An easy way to solve iPhone/iPod headphone tangles

The guys at BudTrap have a great idea.  Create a device, which clips into your iPhone/iPod, stops your headphone getting tangled, and costs just $5 – with $1 being donated to charity.  On top of which, you get 5 additional “buddy” devices which you can share with your friends.

BudTrap In Use

They are also into working out how much time you save by using their device – which they use as a global tally to show how much time the world is saving by removing the need to untangle headphones.

This is a really novel idea and a cool device.  Head over to BudTrap.com now to start saving your tangle time.

NRL Live on your iPhone – Finally!

I’m not sure about you, but we’re well into the 2009 NRL season and the lack of a decent dedicated NRL app has been something that has bugged me.  The AFL has had dedicated iPhone Apps since the start of the season, while the NRL has been stuck with rubbish apps that simply link to websites.

Finally, WSP Online has released League 2009 – NRL.  This provides the same beautiful interface as their successful Footy 2009 app, along with live coverage of the NRL season including:

  • Live Scores for all games in the 2009 NRL season
  • News – with the fully article viewable inside the App, fully licensed by the ABC
  • Fixture – full fixture with game time and venue
  • Ladder – ladder is updated live after each game

See screen shots below:

img_0030 img_0029

img_0033 img_0028

It sells for $3.99 in the App Store and is well worth the purchase price.

How-To: Move change the address of a SVN repository

So you’ve changed where you host your subversion repository for a particular project and you want to update your local copy so that it points at the correct address?   How do you do this?  Simple:

svn switch --relocate http://oldserver.com/PROJECT 
                      http://newserver.com/PROJECT

This will recursively modify all the .svn folders contents so they point to the correct location.

How-To: Detect if users have turned off the iPhone GPS

Simple and common situation.  You have an app that needs to use the GPS to function correctly.  However, users have the last say in this and can simply say “No” when the iPhone asks them if your application asks to turn on the GPS.  If you don’t deal with this situation, then it’s likely that Apple will reject your application.

So what to do?  Simple, implement the following CLLocationManager delegate method:

- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *)error

Inside this method, make sure you deal with not receiving any GPS locations in a sensible manner (show a popup, skip etc).

A solution to: Application failed codesign verification

Okay, so you’ve spent months working hard on your iPhone project, and you finally go gold.  You get sign off from your client, you’ve squashed the last of your bugs and you think “I’m ready to submit this bad boy!”.  You package it up for release as per Apple’s instructions, and then try and upload it using the Application Loader that Apple supplies.

[Read the rest of this entry...]

How To: Fix iCal slowness

So you’ve been using iCal for a while, and suddenly it starts working very slowly… One solution I found was to remove your calendar from your computer and let iCal download it from your server (ONLY use this if you use server based calendars):

Open terminal and type: rm -r ~/Library/Calendars/

Various solutions are discussed here.

How To: Determine Folder Size on Mac OS with JDiskReport

Okay, so you’ve got a big folder full of stuff, its got a complicated directory structure and you want to know what what folders are taking up all the space.  Simple?  Well, no – not really.  Unless you have something like JDiskReport.

jdiskreport_med

JDiskReport is a Java based application that traverses your folder structure, and gives you a nice graphical representation of the folder sizes.  It works on Mac, Windows and Linux and comes highly recommended.

Fairies Everywhere – Now on your iPhone

Bulpadok has just released their first iPhone app – Fairies Everywhere is a great camera based game that brings your iPhone to life!

Take a photo, shake your iPhone and magic fairies appear everywhere around you.  Save the photo to your camera roll, and you can print the pictures for your kids.

Fairies Everywhere original2 original3

Great fun and only $.99 (US) on the app store.  www.fairieseverywhere.com

How-To: Remove grey shadow from iPhone UIWebView

By default, when you create a clickable HTML element in a webpage (or in HTML that is displayed in a UIWebView) the iPhone adds a grey shadow/box thing over the top of it when you touch it.

Sometimes you don’t want this ‘highlight’ to appear – or you want it to be another color.  Here is the code that will help you in this situation:

Remove the grey highlight completely:

-webkit-tap-highlight-color:rgba(0,0,0,0);

Change the color of the highlight:

-webkit-tap-highlight-color:your-color-here;

AFL iPhone: Footy 2009 available now

WSP Online Solutions have just launched Footy 2009 – a fantastic fully featured AFL app which is now available on the App Store.   You can purchase it from the App Store here.

It features:

  • Latest AFL news fully licensed from the ABC, displaying full news articles within the App.
  • Live Scores including game details, goal kickers, possession getters etc supplied by www.sportsflash.com.au
  • Live Ladder (view any ladder back to 1990)
  • Upcoming Matches and Results
  • Compare Teams function (view team results and stats going back to 1990)

livematches compareladder newsarticle matches

Footy 2009 is available on the App Store for $3.99.

How-To: Solve ‘modifying layer that is being finalized’ iPhone SDK

Okay, so I’ve been getting the ‘modifying layer that is being finalized’ error message when i’m trying to release a subview from a superview:

[self.popupPreviewView release];
self.popupPreviewView = nil;

The best way to solve this (that I’ve found – please post a comment if you can provide a better one) is to remove the view from it’s superview rather than release it:

[self.popupPreviewView removeFromSuperview];
self.popupPreviewView = nil;

iPhone App Icon Doesn’t appear on iPhone, works in Simulator

If your iPhone App icon isn’t appearing on your phone, but works fine on the simulator, it may be a problem with the way you’ve saved your Icon.png file:

Blank iPhone App icon

I had this problem, until I chose to “show” the extension of the Icon.png file when I saved it from within Preview.  Once I’d done this, re-saved the image and added it back to the project, the Icon appeared on the phone!  Bizarre, but it works!

Fairfax Radio News – As Featured by Apple

One of my favorite applications for the iPhone, Fairfax Radio News, is currently being featured by Apple in the New section of the App Store in Australia:

Fairfax Radio News Featured on the App Store

Fairfax Radio News provides the latest national 3 minute radio news bulletin (for Australia) direct to your iPhone – and it’s updated 24/7. Very handy when you are on the train/tram/bus on the way to work and just want the latest news headlines.

Fairfax Radio News sells for $1.19.

CFA Bushfire Google Map now iPhone Friendly

The CFA Bushfire map that I developed last weekend to help people find where the CFA incidents were occuring during Victoria’s worst ever bushfires has been updated, and is now more iPhone friendly. Browse to here on your iPhone:

http://blog.evandavey.com/firemap/

And you will now be able to more easily search and use the map on your iPhone:

CFA Firemap iPhone

The new version of the map also includes the ability to add “wind” markers which display the latest wind speed and direction from the BOM.

How-To: Make UIWebView transparent

Common problem, need to apply nice HTML formatting for a section of your page, but want the UIWebView not to appear as a big white box – only the content of the UIWebView to appear. How to do it?

myWebView.opaque = NO;
myWebView.backgroundColor = [UIColor clearColor];
[myWebView loadHTMLString:
@"<html><body style='background-color: transparent'>
       Content Here</body></html>" baseURL:nil];

The above works in 2.2.

Live Google Map of Victorian Bushfires (based on CFA Incidents)

UPDATE: Google is now tracking this information in a gadget. You can view here:

http://blog.evandavey.com/firemap/google.php

You can view the map I built (with historical incidents and wind direction) here:

http://blog.evandavey.com/firemap/

You can view metropolitan incidents at the MFB site here:

http://www.mfb.vic.gov.au/Incidents/Major-Incidents-Map.html

Original Post:

I know a lot of people who could’t find an easy way to visualise where all the fires have been burning across the state over the past day.  There are lots of places (DSE, CFA) that list incident information, and DES does have a map – but its very hard to navigate as its really just a static image.

The CFA, however, lists all their incidents and provides them in a very handy RSS feed, so I’ve turned them into a Google Map.

CFA Bushfire Incidents

You can see it at blog.evandavey.com/firemap.  This is updated periodically (every 10 minutes), and allows you to see where the incidents have occured.  Amazing that you can almost make out the shape of victoria because of all the pins.

My thoughts are with those who have lost their homes, possessions or loved ones.  Saturday the 7th of Feburary 2009 will forever be remembered as one of the worst bushfire days in our history.

How-To: URL Encode NSString in Objective-C

It’s very easy to URL Encode an NSString in Objective-C (i.e. make a string safe to send using a GET request).  Simply do this:

NSString* escapedUrlString =
   [unescapedString stringByAddingPercentEscapesUsingEncoding:
                        NSASCIIStringEncoding];

Simply use the escapedUrlString in your NSURL object and you’re on your way.