Learning Programming Part 4: "Programming is Hard"

Previously: [Part 1][programming1], [Part 2][programming2], and [Part 3][programming3].

> Programming, it turns out, is hard.
> —[Eloquent Javascript][eloquent javascript] (and typical)

A few months ago, a girl expressed to me her frustrations about, in particular, the attitude expressed many engineers on her attempts to learn to programming.

“They act like learning programming is hard. They imply that if you haven’t been programming since you were seven, there’s no hope for you,” she explained.

I opined, “If someone can learn to program when they are seven, then it must not be that difficult.”

Think of all the things you couldn’t do when you were seven—programming is less difficult than all of those.

[eloquent javascript]: http://eloquentjavascript.net/ “Eloquent Javascript”
[programming1]: http://terrychay.com/article/learning-programming.shtml “Learning Programming Part 1: 5 million”
[programming2]: http://terrychay.com/article/learning-frameworks.shtml “Learning Programming Part 2: Programming Frameworks”
[programming3]: http://terrychay.com/article/learning-programming-part-3-c-cplusplus-superiority.shtml “Learning Programming Part 3: C/C++ superiority”

Conan on a roll

Marie showed me two videos the other day from Conan’s new show on TBS.

The first is Triumph at Occupy Wall Street:

And the other is Louis C.K., who was there to promote [his new web-streaming comedy concert][louisck web] commenting on social media

Both were from the same episode.

[louisck web]: http://artsbeat.blogs.nytimes.com/2011/11/04/louis-c-k-plans-online-broadcast-of-comedy-concert/ “Louis C. K. Plans Online Broadcast of Comedy Concert—Art Beats @ New York Times”

Super Tuesday

When I first moved to San Francisco, the PHP meetup group hadn’t had a meeting in a year. That was before [Touge][touge] took it up, and, along with [Mariano][mariano], does the hard work of actually scheduling people to come shoot the shit.

Apparently, it’s time for my shit to be shot.

[Tomorrow, I'm giving a talk][talk] at [SFPHP][sfphp] on [DevOps][devops] for PHP developers. I’ve giving this talk before as the [closing keynote][lineman phpcomcon] at [PHP Community Conference][phpcomcon] and [to sysadmins][lineman oscon] at OSCON.

> **Living without Your Linemen: The Programmer Becomes System Operator in the Cloud**
>
> If a website architect is the quarterback, then site operations is the offensive line—overworked, under-appreciated, and only noticed when it fails. They make you look good. However, four years ago cloud computing networks like Amazon Web Services and Slicehost have appeared. While deficiencies in frameworks in other languages have forced those worlds to adopt Infrastructure-as-a-Service, the PHP world—with it’s ultra-cheap shared-hosting (on one end) and tradition of dominance on some of the most trafficked websites (on the other)—has been slow to move. But as the technology continues to disrupt, modern web engineers will be expected to use their programming skills to not only build, but also provision and maintain fast, scalable websites.
>
> The efficiencies of a web-based language and experience in scalable website architecture offer a unique opportunity for programmers to transfer their skills when wearing a sysop hat. Not to mention some of the best libraries for programming them are written in PHP! When going from a small pet project to a go-live site, maybe we can learn to live without our linemen.

Trust me, you’ll like it.

[Please come][talk]!

Also, If you are an American citizen, go vote! :-)

[talk]: http://www.sfphp.org/events/33726032/ “Living without Your Linemen: The Programmer Becomes System Operator in the Cloud—SFPHP”
[sfphp]: http://www.sfphp.org/ “The SF PHP Meetup Group—SFPHP”
[mariano]: http://twitter.com/marianopeterson
[touge]: http://www.grepmymind.com/ “Grep My Mind”
[devops]: http://en.wikipedia.org/wiki/DevOps “DevOps—Wikipedia”
[lineman oscon]: http://www.slideshare.net/tychay/2011-07-lineman-opsoscon “2011 07 Living without your Linemen—OSCON”
[lineman phpcomcon]: http://www.slideshare.net/tychay/living-without-linemen “Living Without Linemen—PHP Community Conference 2011″
[phpcomcon]: http://phpcon.org/ “PHP Community Cpnference”

Just keep shooting

One brunch, I noticed that a trio of my friends all had single-letter twitter names. I asked them to activate their wonder-tweet powers. They obliged:

@a @c @k
@a @c @k
Zazie’s, Cole Valley, San Francisco, California

Olympus E-P1, M.ZUIKO Digital 17mm 1:2.8 Pancake
2 exposures, 1/60sec @ ƒ2.8, ISO400, 17mm (35mm)

After discussing the [kissy ass face][kissy anus face] video, I asked my friends to pose one of the things that were “too dirty for [College Humor][college humor].”

Do the kissy-anus-face
Do the kissy-anus-face
Eddie Rickenbacker’s, SoMa, San Francisco, California

Leica M8, Cosina-Voigtländer NOKTON 35mm F1.2 Aspherical
3 exposures @ 1/30sec, iso 320, 35mm (47mm)

One thing I like to do is keep shooting even after people are done posing, the smiles are more honest.

[kissy anus face]: http://vimeo.com/344008 “Jeff and I at the Rejection Show—Vimeo”
[college humor]: http://www.collegehumor.com/ “College Humor”

My cousin Juno

It’s been four years [since I last wrote about my cousin Juno][thanksgiving chicken]. I haven’t changed much but a baby grows up a lot in that time.

While technically he’s my nephew, he calls me “사촌”—사촌 (sa-chon) means cousin in Korean, so I refer to him as my cousin Juno. And apparently I’m a big hit with him—Juno constantly pesters his parents before family get togethers, “Is Sa-chon Terry going to be there?”

The reason why is I have a secret weapon…

iPhone attention
Vicolleto, North Beach, San Francisco, California

Leica M8, Voigtländer Nokton 35mm F1.2
1/60sec, ISO160, 35mm (47mm)

…an iPhone loaded with [tons of free and $1 games][nintendo vs iphone].

Unfortunately because I never actually *play* the games, I hadn’t unlocked enough levels in [Krazy Kart][krazykart]. Marie had to help out:

Here is how you do that
Here is how you do that
Vicolleto, North Beach, San Francisco, California

Leica M8, Voigtländer Nokton 35mm F1.2
1/60sec, ISO160, 35mm (47mm)

What an amazing device, and an amazing cousin. Oh, to be a kid right now! Wait a minute…

Photobooth - Me, Juno, Marie

We still are!

[thanksgiving chicken]: http://terrychay.com/article/thanksgiving-chicken-story.shtml “It isn’t Thanksgiving without the kimchee”
[krazykart]: http://itunes.apple.com/us/app/krazy-kart-racing-us/id329373629?mt=8 “Krazy Kart Racing (US)—iTunes Store”
[nintendo vs iphone]: http://www.penny-arcade.com/comic/2011/8/1/ “The Fire—Penny Arcade”

Focus on the eyes

The eyes are the most expressive part of a person.

One thing people forget about smaller-sensor cameras is that it is easier to do close-up photography. Even if the subject is a person, it’s okay to crop everything out, just remember to focus on the eyes. The closer the subject the smaller the depth-of-field gets so even with a small sensor, you have to get the focus just right.

Eyes
Eyes
The Richmond, San Francisco, California

Olympus E-PL3, Lumix G 20/F1.7
1/60sec @ ƒ1.8, ISO500, 20mm (40mm)

What attracted me to photographing Marie was the way the light from the bay windows caught her eyes. Unfortunately, my camera blocked a lot of that.

This camera has face and eye detection. I can even select which eye to prefer (I always select closest eye of the closest subject), but it is not always accurate. This photo suffers a little because the camera mistakenly focused on the distal eye—probably because I am near the close-focusing limit of this lens (the sensor isn’t small enough and the lens is a pancake).

It is interesting my appreciation of this image is interrupted because as the photographer, I see my mistakes: the off-focus and camera [gobo][gobo], but my friends don’t.

### Other tips

Even though the image is highly cropped it’s okay. A closely cropped photo rarely suffers and you can crop a person anywhere as long as it isn’t near a joint. As with “focus on the eyes”, these sort of photographing decisions are derived from our evolution.

Just remember, you will have to retouch the portrait a bit. Soften the skin (a little, not too much) and add definition and saturation to the eyes and lips. You should probably remove some of the color from the whites of the eyes, but I didn’t need to in this photo. Note that retouching tools have gotten very good as computers have gotten very powerful. I didn’t even need to leave Aperture (or use the RAW image) to retouch.

[gobo]: http://en.wikipedia.org/wiki/Gobo_(lighting) “Gobo (lighting)—Wikibedia”

AVCHD movies in Aperture

My new camera takes video, but unlike my previous ones, the highest resolution video (1080p) only writes in the should-never-have-been-invented [AVCHD specification][avchd].

AVCHD has weird support on Mac OS X. If you insert a card with it, iMovie will recognize it. However, Apple Aperture and iPhoto will not. Since the video and metadata for the clips are [split over many files][file structure], you can’t do a straight import into any of the above.

While there is [an excellent free tool for viewing AVCHD video streams][vlc], this means that in order to work with this video *as a photographer*, I need to transcode the video. This was not obviously done until I ran into [this post on AVCHD on the Mac][AVCHD video workflow].

ClipWrap diskimage

There exists many other cheaper ([and free][handbrake]) solutions for transcoding, but I opted for the more expensive [ClipWrap][clipwrap] mentioned in the article for a couple reasons:

1. Most other transcoders, re-encode the video. On the other hand QuickTime is a container format, not a codec. What ClipWrap can do is re-wrap the AVCHD in a quicktime container without changing the codec. This is much faster, but, more importantly, *it preserves the original encoding with no loss*.
2. ClipWrap can also transcode the video like other converters.
2. In both cases, ClipWrap can preserves the video creation date.

ClipWrap conversion

There are some caveats though:

1. A rewrapped file may not be viewable on the computer without the free tool, [Perian][perian].
2. A rewrapped file cannot be directly worked with in iMovie, instead you need to transcode into [AIC][aic]. I think you are fine if you are a Final Cut Pro user, but I stopped using that product a long time ago since I’m not a videographer.
3. Be aware of the funky file structure. Look for the videos in /PRIVATE/AVCHD/STREAM/*.MTS, not your camera’s media folder. You lose any of the other metadata also (pretty much worthless)
4. Be aware that AIC files are uncompressed more than H.264 in a ClipWrap Quicktime/AVCHD . This means you want to store it in this format, only work with it this way.
5. I don’t (yet) have a workflow for converting from rewrapped Quicktime to AIC. :-(

This means that I store:

1. In my archive originals folder, I keep the original *.MTS files.
2. In Apple Aperture, I import re-wrapped quicktime MOVs.
3. If I need to work on videos, I transcode the AVCHD MTS’s into AIC and then import into iMovie. I lose the Aperture integration this way. :-(

I did get it to work this way. Here’s an example I edited from the [Plantronics][plantronics] Launch Party last week:

If you don’t have video working, here are two photos I took with my other camera:

Water pool
Water pool
Plantronics Launch Party, Dogpatch, San Francisco, California

Nikon D3, Nikkor 24-70mm f/2.8G
1/100sec @ ƒ2.8, ISO3200, 28mm

Dry ice cocktail and champagne
Dry ice cocktail and champagne
Plantronics Launch Party, Dogpatch, San Francisco, California

Nikon D3, Nikkor 24-70mm f/2.8G
1/30sec @ ƒ3.2, ISO5000, 48mm

Now if only I can come up with a work flow for the RAW images that doesn’t involve [a lot of work][unsupported RAW] or [exiftool][exiftool] [hacking][exifhack].

[More photos and videos from the Plantronics Launch Party][plantronics photos].

[plantronics photos]: http://www.flickr.com/photos/tychay/sets/72157627846839069/ “2011-0138 SF Potrero Hill—Plantronics Launch Party @ Obscura Digital—tychay @ Flickr”
[exiftool]: http://www.sno.phy.queensu.ca/~phil/exiftool/ “Exiftool by Phil Harvey”
[exifhack]: http://forums.dpreview.com/forums/readflat.asp?forum=1041&message=39314992&changemode=1
[unsupported raw]: http://terrychay.com/article/unsupported-raw-apple-aperture.shtml “Unsupported RAW workflow in Apple Aperture”
[plantronics]: http://www.plantronics.com/us/ “Plantronics WIreless Heasets, Bluetooth Headset, Office and Contact Center, Enterprise Solutions”
[AVCHD video workflow]: http://echeng.com/journal/2010/07/08/avchd-hd-video-workflow-on-mac-os-x/ “AVCHD HD video workflow on Mac OS X—ECHeng”
[avchd]: http://en.wikipedia.org/wiki/AVCHD “AVCHD—Wikipedia”
[file structure]: http://en.wikipedia.org/wiki/File:AVCHD_actual_file_structure.svg “File:AVCHD actual file structure—Wikipedia”
[handbrake]: http://handbrake.fr/ “HandBrake”
[perian]: http://perian.org/ “Perian: The swiss-army knife of QuickTime components”
[clipwrap]: http://www.divergentmedia.com/clipwrap “ClipWrap”
[aic]: http://en.wikipedia.org/wiki/Apple_Intermediate_Codec “Apple Intermediate Codec—Wikipedia”
[vlc]: http://www.videolan.org/vlc/ “VideoLAN: Official page for the VLC media player: the open source video framework”

World Bike Festival

CNN informed me that[a photo of mine][amsterdam photo] was selected for [a slideshow about the World Bike Festival][cnn article]:

World Bike Festival highlights benefits of cycling around the globe - CNN.com

It occurred to me that this combines a ton of my passions—photography, internet, writing, cycling, and activism—with my ethnicity.

Save the world, one bike ride at a time. :-)

[amsterdam photo]: http://www.flickr.com/photos/tychay/5700378467/ “Amsterdam bicycle parking—tychay @ Flickr”
[cnn article]: http://www.cnn.com/2011/10/21/living/world-bike-festival/index.html “World Bike Festival highlights benefits of cycling around the globe”

You have a camera

“I want to tell you the most important tip I learned about photography.”

“What is it?”

“You have a camera.”

Frame that shot!
Frame that shot!
Zazie’s, Cole Valley, San Francisco, California

Olympus E-P1, M.ZUIKO Digital 17mm 1:2.8 Pancake
1/60sec @ ƒ2.8, ISO1000, 17mm (35mm)

Coley teases my habit of photographing my friends.

Recently some colleagues had a contest: “Guess how many cameras Terry has on him right now?”

Even though I have one, too often, I forget I carry a camera.

Smiling Sean Coates
Smiling Sean Coates
The Invisible Dog, Brooklyn, New York City, New York

Olympus E-PL3, Lumix G 20/F1.7
1/60sec @ ƒ1.8, ISO500, 20mm (40mm)

Sean is embarassed to have my camera in his face… or happy that he guessed how many cameras I was carrying.

You have a camera, shoot it! You never know what will happen.