Code Bubbles

Posted on March 11, 2010 by (author unknown).
Categories: Contributors.

Note: This blog post contains video or JavaScript effects that are illegal in RSS and will be removed by most feed readers. It should display perfectly if you open it in Safari, Chrome, or Firefox, though.


I really like this concept for a spatial, zoomable IDE.



If you require a short url to link to this article, please use http://ignco.de/255

3M Self-Sealing Pouches

Posted on March 10, 2010 by (author unknown).
Categories: Contributors.

These are very sturdy, inexpensive self-laminating folders to make luggage tags, or actually any gear. I wanted to make my own tags from my business cards and these were far and away the best option I found. I’ve now used them for two years of heavy business travel, and they’ve held up really well. We are buying another set, so the kids can make tags for their backpacks and sports bags.

-- Jon Margolis

Self-Sealing Glossy Laminating Pouches with Loops for Luggage Tags
$6 (5 Pack)

Available from Amazon

Manufactured by 3M

How to Send Email with Attachments – Example Using iPhone Camera to Email a Photo

Posted on by John Muchow.
Categories: Contributors, Email.

In this post: Camera Application to Take Pictures and Save Images to Photo Album, I demonstrated how you can take photos with the iPhone camera and save the captured images to the Photo Album. A reader asked if it would be possible to email the camera image in place of writing to the Photo Album, which is the focus of this tip.

Building on the previous post, the example created here starts the camera on the iPhone, and once a photo is snapped, launches the email application, attaching the resulting image to the email.

Start the iPhone Camera

The user interface of this application is quite simple, there is one button on the UI that will start the camera. Once the button is tapped, the method shown below will be called. Here we create an image picker controller, set the source type to the camera, point the delegate to self and specify not to allow image editing. From there, simply show a modal view controller to enable the camera.

- (void)buttonPressed:(UIButton *)button
{
  // Create image picker controller
  UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
 
  // Set source to the camera
  imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
 
  // Delegate is self
  imagePicker.delegate = self;
 
  // Allow editing of image ?
  imagePicker.allowsImageEditing = NO;
 
  // Show image picker
  [self presentModalViewController:imagePicker animated:YES];	
}
Convert Camera Image to NSData Object

Once the camera has taken a photo, the method below will be called, passing in a dictionary of related information, such as the original image, edited image (if any), URL to a movie (when applicable), etc. We grab the image from the dictionary and create a UIImage object. From there, dismiss the camera, then pass the camera image to the method emailImage where we will construct an email and append the image.

-- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
  // Access the uncropped image from info dictionary
  UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
 
  // Dismiss the camera
  [self dismissModalViewControllerAnimated:YES];
 
  // Pass the image from camera to method that will email the same
  // A delay is needed so camera view can be dismissed
  [self performSelector:@selector(emailImage:) withObject:image afterDelay:1.0];
 
  // Release picker
  [picker release];
}
Email Camera Image

The last step is to compose an email and attach the image from the camera. We begin be creating a MFMailComposeViewController object, setting the delegate to self. We then step through the configuration preferences for the email, setting the subject, the list of recipients (to, carbon copy, and blind carbon copy) and creating the body of the message.

Our next step is to convert theUIImage from the camera into an NSData object, which we can attach to our email. As you’ll notice in the code below, I’ve created the NSData as a PNG representation, you could also use JPG format if you prefer (which allows you to specify a value for image compression).

Once the image is attached to the email, we show a modal view controller which will launch the email application – one note, I am making the assumption that iPhone OS 3.x is the active platform.

- (void)emailImage:(UIImage *)image
{
  MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
  picker.mailComposeDelegate = self;
 
  // Set the subject of email
  [picker setSubject:@"Picture from my iPhone!"];
 
  // Add email addresses
  // Notice three sections: "to" "cc" and "bcc"	
  [picker setToRecipients:[NSArray arrayWithObjects:@"emailaddress1@domainName.com", @"emailaddress2@domainName.com", nil]];
  [picker setCcRecipients:[NSArray arrayWithObject:@"emailaddress3@domainName.com"]];	
  [picker setBccRecipients:[NSArray arrayWithObject:@"emailaddress4@domainName.com"]];
 
  // Fill out the email body text
  NSString *emailBody = @"I just took this picture, check it out.";
 
  // This is not an HTML formatted email
  [picker setMessageBody:emailBody isHTML:NO];
 
  // Create NSData object as PNG image data from camera image
  NSData *data = UIImagePNGRepresentation(image);
 
  // Attach image data to the email
  // 'CameraImage.png' is the file name that will be attached to the email
  [picker addAttachmentData:data mimeType:@"image/png" fileName:@"CameraImage"];
 
  // Show email view	
  [self presentModalViewController:picker animated:YES];
 
  // Release picker
  [picker release];
}
 
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{
  // Called once the email is sent
  // Remove the email view controller	
  [self dismissModalViewControllerAnimated:YES];
}
Caveat

To keep things simple, this application runs on a single thread. It works fine, however, there is a few second delay when moving from the camera application to the email application. Ideally you would add a little logic to better manage the user interface.

Source Code

Here is the link to the source code: Email Camera Image Application.

SecondBar Puts a Menu Bar on All Your Mac’s Monitors [Downloads]

Posted on March 9, 2010 by Whitson Gordon.
Categories: Contributors, Downloads, Featured Mac Download, Mac OS X, Top, Utilities.
Mac only: Multiple monitors do great things for your desktop space, but your menu bar sticks to one screen. If you're looking for more menu access, free utility SecondBar puts one at the top of each monitor. More »


Best VPN Tool: OpenVPN [Hive Five Followup]

Last week we asked you to share your favorite VPN tool, then we rounded up the top five contenders for a vote. Now we're back with the results. More »