Tech Thought

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

Augmented Reality Developers in Melbourne

The team at Two Bulls have just posted a really nice page on their Augmented Reality technology.  Based in Melbourne, Two Bulls provide a range of development services including Augmented Reality, iOS and Android Development and come highly recommended.

Russell Spence Photography

I’ve recently got into amateur photography, picking myself up a Canon 550D digital SLR and snapping away on a variety of trips over the past few months.  In that light, Russell Spence has just launched his photography website, which includes some great landscape and nature shots. You can check out the full collection at russellspence.net

Two Bulls

Our very good friends at Two Bulls have just launched their new website at two-bulls.com.  The striking design is appropriate given they specialise in “immersive” mobile applications.  Checkout their multi-award winning app The Hidden Park for an example.

Currently with offices in Melbourne and New York, Two Bulls also provide a range of specialist mobile consulting services to leading global brands and businesses.  They recently relocated their melbourne office, and to celebrate, had a cake made featuring their logo – very cool.

How to Set Title of UITabBarItem Differently to UINavigationController title

A handy code snippet for doing as the title of the post says. Place this in the View Controller:

- (void)awakeFromNib
{
self.navigationItem.title = @"My Long Navigation Item Title";
self.tabBarItem.title = @"Short Title";

[super awakeFromNib];
}

Countries of the world in PHP array

A handy snippet to share with anyone who needs access to the countries of the world (Australia/New Zealand at the top in my example) as a PHP list:
[Read the rest of this entry...]

How-to Fix: The application-identifier entitlement is not formatted correctly

A new error has started showing up when submitting iPhone Apps through iTunes Connect:

“The application-identifier entitlement is not formatted correctly; it should contain your 10-character App ID Seed, followed by a dot, followed by your bundle identifier.”

From what I can tell, the way to fix this to create a NEW entitlements file (see my previous post on creating adhoc builds for instructions on how to do this).  Previously we’d only had to create an entitlements file and uncheck “get-task-allow”.

However now it appears you also need to add a new “keychain-access-group” and add an item which includes your App Identifier (get this from the iTunes Provisioning Portal) and your bundle identifier (com.mycompany.bundle_name).

See an example below:

Ikea Ad for Kevin Rudd

Ikea has obviously had their marketing team working overtime to get this out for today’s papers:

How To: iPhone SDK – Play and Record Audio concurrently

Unfortunately, it’s quite a fiddly process to record audio and play it back at the same time on the iPhone.  By default, the sound output is very quiet from the iPhone’s speaker when you are recording sound.  So how do we fix this?

First, setup your audio session to record audio:

NSURL *url = [NSURL fileURLWithPath:@"/dev/null"];
NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys:
   [NSNumber numberWithFloat: 44100.0],                 AVSampleRateKey,
   [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey,
   [NSNumber numberWithInt: 1],                         AVNumberOfChannelsKey,
   [NSNumber numberWithInt: AVAudioQualityMax],         AVEncoderAudioQualityKey, nil];

recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error];
if (recorder) {
   [recorder prepareToRecord];
   recorder.meteringEnabled = YES;
   [recorder record];
} else {
   NSLog(@"Error: %@", error);
}

Then tell the device you want to record and play audio at the same time:

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = nil;
[audioSession setCategory :AVAudioSessionCategoryPlayAndRecord error:&err];

Then, and this is the key, allow the volume from the speakers to also be loud when recording:

UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,
sizeof(audioRouteOverride),&audioRouteOverride);

The end result? You can happily play audio at full volume while recording from the device’s microphone. Happy days.

WSP Digital

WSP Digital, who provide a range of products and services, from the world leading EIATRACK service through to advanced iPhone development, launched their new website yesterday:

Taking inspiration from origami in it’s design, look and feel, the website is a nice example of the power of WordPress to produce effective platforms to inform customers of your services.

Facebook Connect Mobile: XML Schema Error on Mobile Devices

If you’re getting an XML error when you’re using Facebook Connect to post to a users stream using the function:

$facebook->render_prompt_feed_url()

Then ensure the following:

  • You don’t have any double quotes in your attachment
  • You don’t have any ampersands in your return URL

For some reason the content is being placed in a hidden field on the page on “mobile” devices.  This isn’t escaping the contents of the post, and hence breaks if you have any of the above.

Highly frustrating!  Hope this helps someone.

New iPhone: Torch, Flash and Front/Rear cameras?


After the recent release to developers of iPhone SDK 4.0, the inevitable scramble to review the new APIs has been on in earnest.  One of the first things noticed were the following new AVCaptureDevice class properties:

  • AVCaptureDevice – isFlashMode Supported
  • AVCaptureDevice – isTorchMode Supported
  • AVCaptureDevice – position (Front or Rear)

These new properties relating to the iPhone SDK class AVCaptureDevice, a class used for audio and video capture and management, suggest that the new iPhone (to be announced at WWDC 2010??) may well include a “Flash”, a “Torch” and a front camera.

If this was to turn out to be true, then a front camera for the phone would make video calls possible, the ability to take photos while viewing the camera feed, and the flash would allow you to take photos in the dark!

All very cool new potential features.  Let’s keep our fingers crossed that this turns out to be the case!

Product Ecology: LCA and Compliance meet usability

WSP Digital today released Product Ecology, a new web based sustainability tool providing Life Cycle Assessment (LCA) and Product Compliance support.

Aimed at product designers, industrial designers, product developers, engineers, environmental managers and brand owners the tool provides three key features:

  • Compliance Navigator – a compliance guidance tool, covering EU RoHS, EU Batteries and EPEAT with EuP and many other compliance requirements to be rolled out over the coming weeks and months
  • Lifecycle Designer – an easy to use and powerful LCA tool backed by data from the Swiss EcoInvent database
  • ecoCompare – a powerful material/process/transport/waste comparison tool

It’s clear that the tool has been developed with usability in mind, providing a unique and powerful web-based tool for the design community.

Online Tool to Convert .ICS file to Excel/CSV

I couldn’t find a decent way online to convert ICS files into an Excel type format for easy manipulation, or adding to documents etc.  So I’ve built a simple one that is now available online:

http://csv2sql.evandavey.com/ical2csv.php

This takes an iCal URL and provides you with a CSV file as a download.  Makes it much easier to get a list of dates from ICS files and use them for other purposes.

Also available is the CSV2SQL converter that I made last year, taking CSV files and coverting them into INSERT/UPDATE statements for use on a database.

How-To: Force VMWare Restart/Shutdown (Mac)

I love using VMWare Fusion on Mac, it’s perfect as I can run everything I need on one machine, and minimise my exposure to windows.  However, sometimes things go astray – windows “goes to sleep” and won’t come back to allow me to restart or shutdown the virtual machine.  How do you fix this?

Screen shot 2010-02-12 at 9.04.33 AM

Hold down the “option” key and then go to the “Virtual Machine” menu option. You’ll notice that the options switch from “Shutdown” to “Force Shutdown” when you hold down the “option” key.  Simply choose your required “Force” option and you should be back in business!

How To: PHP OAuth Twitter

So, you’re building a web based twitter client in PHP.  Easy, just use a simple Twitter API client and call the Twitter API directly.  But what if you don’t want to store the user’s Twitter authentication information anywhere?  It’s a security risk anyway and some people don’t want to give up their account details to a 3rd party.  So what to do?  The solution is to use OAuth with Twitter. [Read the rest of this entry...]

How-To: Remove Applications from Startup (Mac)

To remove applications that start automatically when you boot up is a simple process on the Mac, however still one that I get asked by friends and family regularly how to control. To manage the applications that launch when you first boot up, follow these steps:

  1. Click the Apple Icon in the top left corner of the screen
  2. Select “System Preferences” from the drop-down menu
  3. Select “Accounts” then click the “Login Items” tab
  4. From here you can now remove or add applications that start automatically when you log in

How-To: Backup all files on your Mac or PC

Okay, I normally don’t come straight out with a non-technical answer to something like “what’s the best way to backup all my files?”, except that there is a really really simple way to do this.

Backblaze is a backup-to-the-cloud service which costs $5 a month for unlimited backups. It deals with external hard drives, duplicate files, etc etc and requires zero configuration. Simply install and you’re done. Thoroughly recommended.

How-To: Check root DNS settings for domain

Using “dig” you can determine what IP address or CNAME your domain is pointing to quite easily. However what I didn’t know was that you can actually check what the root server thinks your domain is pointing at, so you can check if its set correctly when you are migrating to a new IP address.

To do this, simply type:

dig domaintolookup.com +trace

How-To: Flip Rows/Columns in Excel

This is really easy, but something I never knew until I just tried this:

  1. Copy the cells you want to flip
  2. Right-Click “Paste Special”
  3. Tick the Transpose checkbox

You’re done! Best Excel trick ever!

How-To: Create my.cnf file in MAMP

This is a simple process, however not something I could find documented anywhere easy to find. MAMP supplies you with a range of sample configuration files:

/Applications/MAMP/Library/share/mysql/my-huge.cnf
/Applications/MAMP/Library/share/mysql/my-innodb-heavy-4G.cnf
/Applications/MAMP/Library/share/mysql/my-large.cnf
/Applications/MAMP/Library/share/mysql/my-medium.cnf
/Applications/MAMP/Library/share/mysql/my-small.cnf

To setup one of these for MAMP, simply issue the following command:

sudo cp /Applications/MAMP/Library/share/mysql/my-choicehere.cnf /Applications/MAMP/Library/my.cnf