The Sudoku Challenge

I’ve challenged myself to create a game of Sudoku. Why you ask? Because it is broad enough to exercise all of the different Javascript skills I want to work on, while not being so complex as to be a big time sink on any one area.

In computer programming, it is not often the case that the challenge you end up with is the same as you conceived beforehand. Three days into it, I’m happy to say it is exactly as I had hoped for.

The Sudoku puzzle, like most web apps, breaks apart nicely into the MVC model. I wrote the model first and it was pretty easy. I made a two dimensional array to represent the squares, and a square object to fill each square. I hit a major snag when my outputs showed everything as working as it should, but then when I tried to output the board all at once, every square was filled with the value of the last square! It turned out at that point I didn’t understand closures as well as I thought I did, and instead of creating the 81 squares of the sudoku board, I was creating only one and changing it’s value. It was a pain to debug, but I came out of it really understanding Javascript closures.Read More

Why So Many Programming Languages?

Not that long ago my wife asked me why there are so many programming languages. I gave her an answer, but that question has been bouncing around in my head because there are so many different answers, yet of all of the many I’ve been kicking around, none of them really seem complete.

Before college I had already studied a few programming languages (ignoring markup): basic, visual basic, C/C++ and the one in my TI-81 calculator, TI-Basic. (The TI was the weakest but had been most useful in high school math classes). BASIC was cool because for a time it came in every PC, packaged with MS-DOS, and as a kid I thought it was really cool to get these adventure books from the library that came with little Q-Basic programs that you would type in to see something that went alongside the story.Read More

Photoshop Sunday

I spent the day on Photoshop, learning basic techniques as they are supposed to be done. Every once in a while you just have to sit down with the latest version of Photoshop and re-learn the basics. It’s a real timesaver.

So it was appropriate I would run across this blog post, Was That Photoshopped? It Doesn’t Matter! by Rick Berk. What I love about it is he compares digital “darkroom” techniques to an Ansel Adams. Ansel Adams taught me to use the darkroom. Not literally, I’m neither that old nor that lucky. But his were the first photography books I read, when I was in high school and had access to an actual projectors and chemicals darkroom.

Ansel Adams was a technical master. He approached photography in such a methodical, technical way that most people would never have considered possible before digital. And he was also a realism purist. He did not like photographs that abstracted from the original subject. His goal was always to catch the feeling of being in a place at a particular time while being 100% literal. He co-founded the famous photography group, Group f/64, named after a very tiny aperture setting (the lens on my camera now only goes to f/32). At f/64 everything in your frame is going to be in focus, which implies being absolutely faithful to what is in front of the lens.

But he wrote extensively about darkroom techniques such as dodging and burning which allow you to selectively darken or lighten an image. He also talked about how if you tilted the bellows on the projector or the easel your print was resting on, you could distort horizontal and vertical lines. This might be done to correct distortions on the film, but anti-Photoshop “purists” would probably still object. I don’t remember if he talked about retouching, but I remember in my high school photography class we were taught how to remove unwanted spots and lines on our prints with India Ink and a fine-tipped paintbrush.

One thing that sticks with me that Ansel Adams talked about, was how as he got older his images became more theatrical. He was still making prints from some of his old negatives, and a print made in his later years might have more dramatic contrast, clouds and shadows. I think about this often when I’m working on my photos. It encourages me to be a little more dramatic than my instinct, to bump up that contrast and saturation just a hair more than I otherwise would have.

Before edit (only a crop is applied)

Before edit (only a crop is applied)

Book on Digital Black and White Photography

I just got a book from the library called Advanced Digital Black and White Photography by John Beardsworth. Apparently it’s his second book on the subject. I’ve already read about all the books on photography my library has to offer, but this one was new and it should be no secret I’m big on the subject.

Skimming through it I picked up a couple of tricks here and there. The book pretty much describes my workflow, Lightroom to Nik Silver Efex Pro. One piece of technical info I wanted to share here (and keep for myself as reference) is about sharpening. Sharpening is a technically difficult thing that we rarely want to have to think about (most of the time I just let Lightroom take care of it and cross my fingers). But Beardsworth nails the problem very succinctly:

…sharpening is like a rim or halo around the edges within the picture, and remains effective yet imperceptible if it is around 1/100 of an inch (.25mm) on the final output. If you correctly sharpened a picture and printed it at Letter or A4 size on a 300 DPI inkject printer, that sharpening rim would be too small to be effective if you then decided to resize the picture and make a smaller print.

Anyway, if you’re getting interested in B&W digital photography I would recommend this book. If you’ve already read a bunch of photography books though, I wouldn’t pay for it (try to do what I do and get it from the library), it’s totally worth the skim but as you would already know these books cover a lot of the same material over and over again. I really like that it reserved a whole section for photographic presentation.

Another take on Panoramas

Here’s another solution for panoramas. It’s actually a 360 degree pan viewer, one of those virtual world things that are about as old as interactivity on the world wide web. But the person (Audrey Scott) using it is a travel photographer and her goal is to present a beautiful photograph of the pyramid at the Louvre. The solution has it’s problems, but I’m taking it into account as I think about my lightbox project.

My immediate question is, Is it Photography?

Technically, yes. It uses a cameraRead More

WordPress Recipe Plugin

Want a simple, easy to use and fully customizable recipe plugin for WordPress? I spent a few hours today putting it together. Although it’s still in early beta, I’m pretty happy about it. It features a custom recipe post type, categories and tags that are specifically for your recipes rather than for all of your posts together, and shortcodes to include the recipes in your posts.

We’ve been using a different plugin at Indiaphile for our recipes and it just wasn’t working out well. You could only have one recipe per post, and you were completely restricted to that plugin’s formatting. This one is completely open, it uses shortcodes to describe what certain information is, such as [ingredients]your ingredients here (separated by line breaks)[/ingredients]. This gives you complete freedom to add in additional notes and information that doesn’t necessarily fit into someone else’s rigid formatting.

It is definitely in a workable state, but there are other features on the way, such as custom formatting options and a shortcode generator. As it is now, you can format the recipes with your own custom css as the whole thing is wrapped in a div.stp_recipe

I just used it to convert the recipes in an old post at indiaphile: Tandoori Paneer Pizza. That was so easy!

You can download the plugin here. Remember, this is an early development release, you’ll either have to understand the code or have to talk to me about how to use it. But trust me, it’s pretty darn simple and powerful if you know how it works!

Screenshots:
Read More

A Fitting Display for Panoramas

I’ve never been happy with any Lightboxes I’ve come across on the Internet. It’s true, I’m very picky and hypercritical about these things. I’ve come to have very strong opinions on UI, particularly when it comes to photography.

So I’ve started a little sideproject on designing my own Lightbox, with an emphasis on the proper display of panoramas. From my notes:

To me the beauty of a panorama is looking at it whole and wide, and then walking in on it to see the details.

As a photographer I experience this with my own panos when I first stitch them together in photoshop, then zoom in in various ways to edit it. But how do I share this experience with my viewer? It would be easy in a physical gallery, just make a large print, let the viewers approach from a distance then zoom and pan with their feet. This is a very satisfying way to look at a large, detailed photograph. My goal is to capture this in digital form.

Well, I’m still mulling around the problem. So far I’ve just got the basic lightbox made, it works much like the lightbox you find in facebook or any random photo sharing or news website– nothing special. And I thought I’d finish it before blogging about it, but I came across an interesting solution here. This artist makes complex images starting with photographs then digitally repeating elements to create very high resolution, realistic but surreal, patterned images.

The ability to view the whole, then zoom in and explore are a must for his images. I like the simplicity of the zooming and panning, although I might make a few different choices on how the panning works. There also seems to be some ajax built in, which is something I’ve been mulling. Is it better to load one very large image at the beginning, or start with a lower resolution image then bring in higher ones as needed? The solution he uses is Adobe Flash based, which works for him, but is not acceptable to me if only because Flash is so 2000’s. The solution I am working on will be in Javascript with jQuery, and probably presented as a WordPress plugin.

Camping at Lake Cuyamaca

In Rancho Cucamonga, where I grew up, you can drive 45 miles south, east or west and barely feel like you left the place. Driving north is the rare exception as it takes you up over the Cajon Pass, into a portal to that very different, high desert world.

Here in San Diego we are surrounded by these “portals.” The cliffs of Torrey Pines and a walk along Black’s Beach are certainly transportive, the coastal drive up the 5 freeway is other-worldly as you reach the barely touched expanse of Camp Pendleton, or of course down south into Mexico, but none so striking a change happens until you drive east. My wife, Puja, and I got our first taste of this about a month ago when drove out to hike Mt. Woodson. The urban effects of the city rapidly drop off as you pass El Cajon, into Lakeside and find yourself in the rising elevations of the Cleveland National Forest.

 

Read More

My Badass 1895 Business Card

Amazing how such a simple item can lead you to so many questions. What is the business card for today? What role does it play? Do we even need one? Should it be simple and to the point or should it be attention grabbing? Fun? Classy? Chic?

And while you are trying to cram all of your personality into your card, what about information? Today we have more information to put onto a business card than ever, yet most of it is so much less important than it used to be. Look at these choices: Business Address, personal address, mailing address, name, cell phone number, fax number (maybe, not me), business phone number, personal phone number, e-mail address (which one?), website url, facebook url, twitter handle, or a billion other social networks, the list goes on.

To me, ideally my card would have my website address and that would be all. Somebody would have my card, go to my website address and get all the information they needed there. I mean, everyone carries a smartphone these days, right? They can do it before we’ve even shaken hands to part.

And the worst part of all of this is, how often am I even going to hand my card out? I’ve never been very good about that, and I feel less and less guilty about it every day because lets face it, the art of exchanging business cards has pretty much gone the way of the pager. When a person leaves a conversation with me I want them to know one specific thing about me: Read More