Archive for the 'tech' Category

Aperture batch export AppleScript

February 3rd, 2010

While in Australia and New Zealand, I shot a ton of photos.

Normally, my photos sit on a hard drive and no one sees them. I wanted to make sure that didn’t happen this time.

First, I grouped the photos in to folders in the Finder. Then, I created a new project in Aperture and imported all of the folders as albums. Then, I went through each folder and rated the photos. If a photo was 4 or 5 stars, I deemed it good enough for flickr.

I wrote the following AppleScript to find the albums, iterate through them, and export JPEGs of all the photos I had starred.

property basePath : “harddrive:Users:me:some_photos:”

with timeout of 600 seconds
  tell application “Aperture”
    set myProject to get project “some_project”
    set myAlbums to every album of myProject whose name starts with “NZ”
    set albumCount to count items in myAlbums
    –set myAlbums to items 16 through albumCount of myAlbums
   
    repeat with currentAlbum in myAlbums
      set folderName to name of currentAlbum & ” selects”
     
      set imageList to (every image version in currentAlbum whose main rating is greater than 3)
     
      try
        tell application “Finder” to make new folder at basePath with properties {name:folderName}
      end try
     
      export imageList to basePath & folderName using export setting “JPEG – 50% of Original Size”
    end repeat
  end tell
end timeout

Privacy by Design

February 2nd, 2010

The latest CDT Policy Post discusses the importance Privacy by Design. They extensively reference Anne Cavoukian (Ontario’s kickass Privacy Commissioner and author of Who Knows).

The seven principles of Privacy by Design are:

  • Proactive, not Reactive; Preventative, not Remedial
  • Privacy as the Default
  • Privacy Embedded into Design
  • Full Functionality – Positive-Sum, not Zero-Sum
  • End-to-End Lifecycle Protection
  • Visibility and Transparency
  • Respect for User Privacy

Any system you build should take these in to account.

MAPLight’s awesome Money Near Votes tool

September 13th, 2009

If you haven’t heard of MAPLight.org before, here’s what they do (which is fantastic):

MAPLight.org, a groundbreaking public database, illuminates the connection between campaign donations and legislative votes in unprecedented ways. Elected officials collect large sums of money to run their campaigns, and they often pay back campaign contributors with special access and favorable laws.

They’re a 501(c)(3) nonprofit, non-partisan organization.

MAPLight recently announced Money Near Votes, which shows you how campaign contributions closely mirror voting records:

…combines information on campaign finance and congressional votes. Journalists, citizen activists and bloggers can easily track campaign contributions from special-interest groups given within a month, a week, or a day of each vote in Congress.

It’s available for every bill they track. It’ll be interesting to follow HR 3200, America’s Affordable Health Choices Act with Money Near Votes.

A Chrome funny

August 6th, 2009

I’ve been playing with the prerelease version of Chrome for Mac OS X and found a rather amusing bug:
Chrome funny

Doctorow: reign in ISPs to foster innovation

May 27th, 2009

Writing for The Guardian, Cory Doctorow explains why net neutrality is essential and dispells myths about billing to show us we need a free and open Internet to allow for innovation:

Take filtering: by allowing ISPs to silently block access to sites that displease them, we invite all the ills that accompany censorship – Telus, a Canadian telcom that blocked access to a site established by its striking workers where they were airing their grievances. Around the world, ISPs co-operate with censorious governments in their mission to keep their citizens in the dark: for example, ISPs in the United Arab Emirates are blocking access to stories about a UAE royal family member who was video-recorded torturing a merchant with whom he had a business dispute. As a matter of policy, Transport for London isn’t allowed to block us from riding the tube to a rally in support of striking transit workers; British Gas doesn’t turn our heat off if they suspect we’re housing a benefits cheat; and BT doesn’t divert our phone calls if we’re ringing up a competitor to change carriers. Giving an ISP censorship powers — and then layering censorship in secrecy and arbitrariness — we make the internet a less trustworthy and less useful place to be.

the app store submission process

May 11th, 2009

Steven Frank explains the app store submission process:

  1. Develop app
  2. Submit app
  3. App rejected
  4. Blogs raise a stink
  5. App approved

Randall Munroe is a sloppy programmer

April 19th, 2009

Can't sleep

The title attribute says “If androids someday DO dream of electric sheep, don’t forget to declare sheepCount as a long int.”

Actually, you want to declare sheepCount as an unsigned int.

Mike Lazaridis is on crack

April 19th, 2009

Mike Lazaridis:

A: I look at it this way. I say that our browser technology was developed with very different requirements. By writing our browser in Java, that provides our CIOs and wireless managers the assurances they need, to allow the browser to access internal information at the same time it accesses external information. So the overriding design criteria for our browser has been to not compromise on that experience in the enterprise phase.

I couldn’t make sense of this.

Tony explains: “he just had to get the words java, enterprise and assurance in a sentence.”

Citability.org slidecast

April 19th, 2009

Citability looks like a terrific, useful project:

HOWTO set the default target in Xcode

March 4th, 2009

Your Xcode project has one or more targets. Each target builds something—a command-line tool, a framework or an application.

The Target popup menu lets you determine the active target. The active target gets built when you click “Build” or “Build & Go.”

But what about the default target? What is it, and why do you care? Well, if you build from the command line—using xcodebuild—the default target (and only the default target) gets built.

So how do you set it? I looked around in the help, and it wasn’t obvious. Turns out the answer is in the xcodebuild man page:

By default, xcodebuild builds the first target listed in your project, with the default build configuration. The order of the targets is a property of the project and is the same for all users of the project. The active target and active build configuration properties are set for each user of the project and can vary from user to user.

The default target is the first target listed. In this example, the default target and active target are the same — The “Palm Pre UI” Cocoa application:
before

Suppose we wanted to make the “Shell tool” command-line tool the default target. Simply drag it so it becomes the first item on the list:
during

Now we’re done. The active target is still the “Palm Pre UI” Cocoa application, but the default target is the “Shell tool” command-line tool:
after