Programming Brain Teaser
Monday, July 7th, 2008
I’ve titled this post as a “Programming” brain teaser because ideally you could solve it in any language. For the sake of the exercise, I’m going to show sample code in JavaScript, but feel free to use your language of choice.
But first and foremost, the reason I’m writing about this is because I ran into a logic problem last week which I thought I would be able to solve in two seconds. Sadly it wasn’t the case so I’d like to share that same problem (in obfuscated form) with you, the readers. I know what you’re thinking. You’re at work, and you’ve got a few minutes to whip up a simple answer. Cool then, go for it. Be sure to share your answer with the rest of us by linking to it offsite, but do not share code in the comments directly as others will most likely want to solve it themselves.
Continue reading | 64 Comments
Prototypes
- Simple Image Popouts
Submitted by Matt Snider - Creating an After Effects Numerical Input
Submitted by Josh - Using the XML DOM Without Writing 15,0000 Lines of Code
Submitted by Stephen Sorensen - SWF Integrator
Submitted by daweed - dsHistory Browser History Manager
Submitted by Andrew Mattie - Forcing references/pointers to any variable in JavaScript - a simple hack
Submitted by Stephen Sorensen - Visual JavaScript
Submitted by Ray Hauge - Simple, Semantic Rating System
Submitted by Matt Snider - SearchPlay using Prototype
Submitted by Mats Lindblad - iPhoto-Like Thumbnail Browser
Submitted by Jim Rutherford
Dailies
- Should cyclists be allowed to go through Stop signs?
- Please stop peeing in the sink
- The Sartorialist: Fashion Design and Photography
- The San Francisco Wiggle Bike Route
- Nikon Rumors have an official flickr page
- Ashton Kutcher shoots Nikon
- The Nikon D700, manual photo scan (in german)
- Act first, think later. A good motto I've followed for a while. Here is some science that proves it's a good idea
- Loophole in eval negates the need for JavaScript module pattern
- The Nikon D700 was a spoof based off the D300
- The CSS Column module detailed specifications
- Obama doesn't want to work on Maggie's Farm no more
JavaScript Video Tutorial Screencasts
Learn the fundementals of the Yahoo! User Interface utilities
and how to add progressive enhancements to your webpages with only applying the basics.
Download QT Movie (19MB)
Learn how to add Ajax to your website using the Yahoo! UI Connection Manager with
minimal code and maximum flexibility.
Download QT Movie (31MB)
Learn how to write a client-side Web Service API in JavaScript using Object
Oriented methodologies along with a best-practices approach that will allow you to
play nice with the other JavaScript kids in your neighborhood.
Download QT Movie (19MB)
People
Podcasts
Episode 16: A fictional JavaScript tale
This episode was done solo as I tell a fictional tale about five JavaScript kids (among others) that I wrote during a night I wasn’t able to get any sleep. It features a few of the greatest JavaScripters around as the characters including the following:
- Dustin Diaz (myself)
- Dan Webb
- John Resig
- Peter Paul
- Justin Palmer
- Copy Paste Boy (Billy)
Episode 15: Venni viddi vicci of Events
Justin Palmer in many ways felt like the brother I never had even though I will claim to have other JavaScript mafia brothers as well.
Aside from that matter, the “Experience Engineer” from Encytemedia (and Prototype enthusiast) and I spoke about the various forms of Events that all encompass JavaScript. And indeed; we came, we saw, and we conquered.
About ./with Imagination
Hi, my name is Dustin Diaz and I am a User Interface Engineer for Gooooogle and author of JavaScript Design Patterns. This is my website. Welcome!
On this site I write about JavaScript; I have some podcasts; I also have a few screencasts for those of you who are visual learners. All that aside, if you learn something from me: Excellent. I appreciate you dropping by.
If you have any more interest in learning more about what I do, how long I've been doing it, or how to get a hold of me, you can do that on the about page. Cheers.
















