Prototyping and Rails
Marlon said: I've been a fan of HAML since before I was a fan of SASS! I love not having to remember to close tho...
[More]
Ayn Rand's Objectivism Embodied
jason olmsted said: @Hal - I really should remember to check your blog more frequently, I enjoy the thought provoking ar...
[More]
Posted At : November 20, 2010 5:14 PM
| Posted By : Admin
Related Categories:
Puzzle,Code
Here's another little puzzle. Here, we're trying to come up with the least processor-intensive algorithm for determining, given an array of random integers, how many are even?
I have a solution that works, but I'm not sure it's the most efficient. What's your solution? (If you want to see mine, highlight the space below -- the code is white on white).
function evens( arr ) {
var numFound = 0;
var i = arr.length;
while ( i-- ){
if ( arr[ i ] % 2 > 0 ) {
continue;
} else{
numFound++;
}
}
alert ( numFound );
}
Posted At : November 20, 2010 1:13 PM
| Posted By : Admin
Related Categories:
Puzzle,Code
Here's a fun puzzle for you to try in the language of your choice. We have two boolean contrarians, A and B. (A contrarian might be too-simply defined as someone who opposes the conventional wisdom on a topic.) Since they're contrarians, we expect/want them to not agree on a topic. If they do, we're in trouble.
What's the shortest function that will return true if A is true AND B is true OR A is false AND B is false?
Posted At : March 6, 2009 10:18 AM
| Posted By : Admin
Related Categories:
Puzzle
There I was the other night at a poker table, doing my part to stimulate the economy by going all in with 7-2 when someone said this: "So there's this guy who leaves home, goes a little way, turns left, goes a little way, turns left, goes a little way again, then turns left and again goes a little way. When he returns home, a man was is waiting for him. Who is it?"
After a little reflection, I confidently gave the answer. What's yours?
Posted At : January 29, 2009 9:50 PM
| Posted By : Admin
Related Categories:
Puzzle
Ah, yes. Time for another puzzler.
An evil magician has enslaved your true love. You, of course, come riding to the rescue. "Forsooth, evil magician," you say. "Release my true love."
"Yeah, well maybe not," he replies (evil magicians being predominately male and all). "But I'll tell you what. Are you feeling lucky?"
"Luck?" you say. "What need have I of luck when I am filled with virtue?"
"OK, Virtuous One. Here's the deal: you see these three cups that magically appeared in front of you? Well, one of them is poisonous, the other two are samples from my private stock of excellent wines. Pick the right one and your true love will go free."
Posted At : January 16, 2009 8:26 AM
| Posted By : Admin
Related Categories:
General,Puzzle
Perhaps, like me, you like your entertainment somewhat mentally stimulating. If so, see if you can switch the letters in these words around to, more or less, aptly describe them. I'll give you a couple of examples.
Posted At : January 13, 2009 1:48 PM
| Posted By : Admin
Related Categories:
Puzzle
My first "So You Think You're Smart?" puzzle was solved fast -- too fast! Here's the next one: let's see how long it takes to solve this one:
An interesting fact is that three U.S. presidents had mothers named "Rose". The three were: John Kennedy, Bill Clinton, and Woodrow Wilson.
Now, we know that mothers see their sons in the kindest light possible. Yet, in spite of this, one of these mothers (alive at the time of their son's election) didn't vote for their own son!
Question: which Rose didn't vote for her baby -- and why?
Posted At : January 1, 2009 1:57 AM
| Posted By : Admin
Related Categories:
Philosophy,General,Puzzle
Happy New Year to all. This post marks the first in an ongoing series of fun puzzles. After a week, I'll post my answer. Ready?
Buzz is a bee sitting on the front of the engine pulling the New York Chief train. The train is traveling 55 mph towards Los Angeles. Buzz is just going along for the ride -- for now.