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: http://www.flickr.com/photos/carlosthedesigner/collections/72157623175252182/

I followed this tutorial http://www.photoshopcafe.com/tutorials/HDR_ps/hdr-ps.htm 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!

BOTH

http://net.tutsplus.com/tutorials/html-css-techniques/html-5-and-css-3-the-techniques-youll-soon-be-using/

HTML 5

What is supported where

http://a.deveria.com/caniuse/

HTML5 feature sand usage

http://diveintohtml5.org/

A Cheat sheet for html 5

http://woorkup.com/wp-content/uploads/2009/12/HTML5-Visual-Cheat-Sheet.pdf

HTML5 sites now!

http://seogadget.co.uk/html5-examples-in-the-wild/

HTML5 Tutorials

http://www.smashingmagazine.com/2009/08/04/designing-a-html-5-layout-from-scratch/

http://html5tutorial.net/

CSS 3

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++){
//create
     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;

or

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'