Articles - Page 6

HDR Photographs

Had my first proper go with HDR (High Dynamic Range) Photography yesterday and I have to say I am pleased with the results. One of my friends, Dave, has written a blog post about HDR which summarizes the details nicely so if you want to get clued up then head over there for more info. If you want to see more of my HDR images then head over to Flickr:

I followed this tutorial which was really easy to follow and got great results.

HDT Fisheye image of the interior of Chester Cathedral

Read post... Posted in 'Photography'

HTML5 & CSS3 Learning and Resources

EDIT: New links added 25-01-2010So you have probably been hearing a lot about HTML5 and CSS3 on the internet in the recent months and weeks. What are they? What's the deal with them? Why are they important and should I be doing anything yet?.. are a few questions you might have. I have been reading articles and saving links for a few months now so I thought I better share all the goodies with everyone else and hopefully you will be able to answer most if not all of your questions. I have tried to categorize as best I can but there is some overlap! Enjoy!



What is supported where

HTML5 feature sand usage

A Cheat sheet for html 5

HTML5 sites now!

HTML5 Tutorials


General CSS 3

http ...

Read post... Posted in 'Web development'

Accelerometer setup and usage

To use the accelerometer in an iPhone application you need to add the <UIAccelerometerDelegate> into the .h file of your application:

@interface ApplicationViewController : UIViewController {

Then in your .m file you must setup the accelerometer:

- (void)viewDidLoad {
UIAccelerometer *accel = [UIAccelerometer sharedAccelerometer];
accel.delegate = self;
accel.updateInterval = 1/30;

Update interval is in seconds so 1/30 is a 30th of a second. Now the accelerometer is setup you can use it:

-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {

xValue = acceleration.x;
yValue = acceleration.y;
zValue = acceleration.z;
Read post... Posted in 'Programming'

Creating and using an Array of objects

First we need an array to hold the objects (in this case bullets)

NSMutableArray *myBullets = [[NSMutableArray alloc] init];

Create and then add the objects

[code lang="c_mac"]
for (int i=0; i<5; i++){
     Bullet *newBullet = [[Bullet alloc] init];
//add to the array
     [myBullets addObject: newBullet];
//release the object here as its retained in the array
     [newBullet release];
//myBullets now has 5 bullets in it.

To modify the object:

theBullet = [myBullets objectAtIndex:i];
//do stuff or modify theBullet
theBullet.position.x += 1; //add 1 to the x position

To remove an object from the array use:

[myBullets removeObjectAtIndex:2];
//removes the 3rd item
//remember an array starts at 0!
Read post... Posted in 'Programming'

Changing the iPhone status bar

Just use this code to change the type of status bar shown. Stick it in the applicationDidFinishLaunching method which is usually in your MyAppDelegate.m

[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];
Read post... Posted in 'Programming'

Objective C Timer

This is a simple timer, you may need to declare some variables in the .h file.

-(void)onViewDidLoad {
//set on start up
NSDate *startTime = [NSDate date]; 
-(void)someOtherFunction {
//amount to dely by (seconds)
NSInteger *delayAmount = 1;
//work out the current delay time
NSTimeInterval elapsedTime = [startTime timeIntervalSinceNow]; 
//if the delay is bigger than the specified amount then...
if (elapsedTime >= delayAmount) {
//Do the stuff to do when the delay time has passed
NSDate *startTime = [NSDate date]; 
Read post... Posted in 'Programming'

Round a number

To round a number use the following code:

CGFloat variable = ...CGFloat result = round(variable * 1000.0) / 1000.0;


CGFloat variable = round(variable * 1000.0) / 1000.0;[/code]

Use 1000 for 3decimal places, 100 for 2 etc!

Read post... Posted in 'Programming'

Meta Tags

The tags in question are META tags. They are the bits of code that sit in between the <HEAD> </HEAD> tags and tell search engines whats in a page (except google which actually reads a pages text content).

Meta data should be put just after the <TITLE> tags in the <HEAD>. It tales the format <META name="the catagory" content="the information">. The name is usually one of 4 types - "description", "resource-type", "keywords" or "distribution". The information depends on the name. I will briefly cover the two that are most important for a search engine: "description" and "keywords". The "keywords" are a list of main topics covered by the page in question. This blog has the keywords "photoshop, illustrator, dreamweaver, Hints, Tips, Techniques, Carl Topham" since thats the main list that covers it. Separate each keyword with a comma (and space). Keywords can be two words so "Carl Topham" is counted as one keyword. Try to keep the keywords restricted to less than about 250 characters as some search engines actually reduce page ...

Read post... Posted in 'Web development'