depicus

  just another nerd on the interweb…



  • home
  • gallery
  • play page
  • privacy
  • support
  • videos
  • what is depicus

Archive for May, 2011

OSX Trash stuck and how to fix

Tuesday, May 31st, 2011



If you have something stuck in the trash that will just not delete when you empty it then simply

sudo rm -rf ~/.Trash/*

and it should all be gone.

Tags: Empty, OSX, Trash
Posted in Apple, Computers | Comments Off

Adding a GIT repository to an existing XCode 4 project

Saturday, May 28th, 2011



Simple really.

1. Close XCode 4
2. Open Terminal and cd to your project folder
3. Type git init
4. Then git add .
5. And finally git commit -m “First commit of XCode project”

Reopen XCode and fingers crossed you are now all GITed up.

The original article is here

Tags: GIT, XCode
Posted in Computers, OS X, Software Development | 2 Comments »

Stop Apache serving .DS_Store files – or any files

Thursday, May 19th, 2011



If you view or copy files from a Mac to a webserver it will place .DS_Store files in that directory. To fix add in your http.conf or .htaccess file

View Code TEXT
1
2
3
4
5
<Files .DS_Store>
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

Then restart Apache for this to kick in.

Tags: Apache, OSX
Posted in Interweb | Comments Off

Getting EXIF data from images on iOS

Saturday, May 7th, 2011



Working on a project that needed to show images with their information so looked into extracting EXIF data from the image itself rather than banging it into a db. Note this requires jpg files as png’s didn’t seem to work.

View Code OBJC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    NSString *myPath = [[NSBundle mainBundle] pathForResource:@"IMG_2733" ofType:@"JPG"];
    NSURL *myURL = [NSURL fileURLWithPath:myPath];
    CGImageSourceRef mySourceRef = CGImageSourceCreateWithURL((CFURLRef)myURL, NULL);
    NSDictionary *myMetadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(mySourceRef,0,NULL);
    NSDictionary *exifDic = [myMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary];
    NSDictionary *tiffDic = [myMetadata objectForKey:(NSString *)kCGImagePropertyTIFFDictionary];
    NSLog(@"exifDic properties: %@", myMetadata); //all data
    float rawShutterSpeed = [[exifDic objectForKey:(NSString *)kCGImagePropertyExifExposureTime] floatValue];
    int decShutterSpeed = (1 / rawShutterSpeed);
    NSLog(@"Camera %@",[tiffDic objectForKey:(NSString *)kCGImagePropertyTIFFModel]);
    NSLog(@"Focal Length %@mm",[exifDic objectForKey:(NSString *)kCGImagePropertyExifFocalLength]);
    NSLog(@"Shutter Speed %@", [NSString stringWithFormat:@"1/%d", decShutterSpeed]);
    NSLog(@"Aperture f/%@",[exifDic objectForKey:(NSString *)kCGImagePropertyExifFNumber]);
    NSNumber *ExifISOSpeed  = [[exifDic objectForKey:(NSString*)kCGImagePropertyExifISOSpeedRatings] objectAtIndex:0];
    NSLog(@"ISO %i",[ExifISOSpeed integerValue]);
    NSLog(@"Taken %@",[exifDic objectForKey:(NSString*)kCGImagePropertyExifDateTimeDigitized]);

Obviously change the image name and be aware that images loaded in a UIImageView seem to have their EXIF data stripped out.

Tags: Canon, EXIF
Posted in Canon, iOS, Software Development | 4 Comments »

Adding a UILabel to a UIToolbar the easy way…

Friday, May 6th, 2011



I simply quote…

“For those using Interface Builder to layout your toolbar, it is also possible to do this using Interface Builder alone.

To add a label to a toolbar you need to add a generic UIView object to your Toolbar in IB by dragging a new UIView object over your UIToolbar. IB will automatically create a UIBarButtonItem that will be initialized with your custom UIView. Next add a UILabel to the UIView and edit the label graphically to match your preferred style. You can then visually set up your fixed and/or variable spacers as desired to position your label appropriately.

You must also set the background of both the UILabel and the UIView to clearColor to get the toolbar to show through correctly under the label.”

Genius and simple. Thanks to Matt R and Stackoverflow

Tags: Hints, XCode
Posted in iOS | Comments Off

<< Previous

  • how i pay the bills

  • depicus in africa

    depicus in africa
  • my charity page

    JustGiving - Sponsor me now!
  • friends

    • Agency Manager
    • AllClear Travel
    • Climbing Tikes
    • Globe Bloggers
    • Marchday
    • The Travel Toad
  • gallery

    IMG_2246 IMG_4242 IMG_3127 Bisley Developments Ltd
  • videos

    Vimeo

    YouTube
  • twitter

    • No public Twitter messages.
  • recent comments

    • john coull: correction to above, its www.oakley-ukstore.com
    • john coull: they are at it again. adverts on facebook . they are being hosted by enotch.com on ip address...
    • steve: The site are selling £120+ Oakley sun glasses for £13.00 I think its safe to say they may be either...
    • rob: have received a pair of glasses not what ive ordered they are now telling me the ones ive ordered are out of...
    • phil: hi i have purchased some (stupidly),not arrived yet, will they arrive/will they be fake/plz help

Copyright © - depicus | Entries (RSS) | Comments (RSS)

WordPress theme butchered and amended by me.