Friday, November 18, 2011

Catch that error


try {
watermelon();} catch (err) {console.log('name is: '+err.name); console.log('message is: '+err.message);}



Outputs:
name is: ReferenceError
message is: watermelon is not defined

Thursday, August 11, 2011

Turn, turn, turn

This picture is just great:

Then, a ratchet inside the machine basically just works the star into the monkey's face. Turn, turn, turn until they're attached.

A game of go

At the beginning of working with this company, I spoke to one of my coworkers about hobbies, and I mentioned I like board games, and he asked which one I play, so I mentioned Go and asked if he knew how to play. He said, "Oh yeah, I play that sometimes on the computer!" I brought in my travel magnetic set for my desk, and then didn't bring it up at all thereafter, until today.

"You remember when you mentioned you play go?" I asked, as we were preparing our lunches. He hadn't remembered, so I reminded him, and he said "Oh yeah, that's the game where there are white and black stones and you are trying to change them all to your color... okay."

So months ago he had been thinking of Reversi when he mentioned that he plays it on the computer sometimes.

As I'm about to be leaving my current position, I suggested we play a game over lunch, that I could teach him the rules. In the course of half an hour, I show him how stones get captured, and how you shan't commit suicide, and how to make a living group. Then we play a few games of capture go. On the last game, I give him 4 stones on a 9x9 board, and after a while state: "atari."

He doesn't save his stone, so I say "Okay, I'll take it." Chuckling, he says "so now it's over, is it?" In capture go, it would be, but in regular go, not so much. I explain about territory, and we proceed with the game as is, but using regular go rules. I only had a spindly strand of white stones, and he had formations on either side of it.

I was able to kill one of the sides, but black still won by two points. "Much different from Othello, isn't it?"

Monday, May 16, 2011

just got better

So when you sign on to Bing with Facebook, you get a pop-up implying that you just entered a whole new world of awesome on the internet.

I just wish I could enter that world but make the pop-up go away. It appears my options are to enjoy this new world of frivolity and who-knows-what-else with an explicit reminder that it is only due to Bing's alliance with Facebook that it's so much better, or I can choose Disable. Where's the middle ground? Where's the faithful acceptance button "OK"? Why am I binging?

Thursday, March 24, 2011

python in python in python


$ python
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('python')
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system('python')
Python 2.6.5 (r265:79063, Jun 12 2010, 17:07:01)
[GCC 4.3.4 20090804 (release) 1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
0
>>> exit()
0
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()
$

Friday, February 18, 2011

Last Night's Dream

Last night I dreamed: I'm traveling by plane for some reason, and have the misfortune of having two layovers that aren't really layovers cause I sit on the plane while others get off and then on again.

It was snowy, so the landings were terrible. The first one, there was also a lot of wind, and the plane had to make a sharp turn after landing onto a street being used by cars and jeeps, too. The turn wasn't made properly and we skidded to a halt in a bout a half foot of snow, coming to a 90 degree stop. To recover, the pilot just turned the engines on, then, and taxied to the terminal.

The second landing, the plane wasn't centered on the runway, which was icy, so we rolled off the edge and had a bumpy ride on unpaved ground before finally going into a parking lot and narrowly missing a big red pickup truck.

Then the dream turned into a different dream :)

* What airfield would design a landing strip where the planes have to turn right after touchdown? The airfield of my dreams, apparently. Also, your red pickup truck is too big, and it's in the way.

Thursday, February 17, 2011

Joke from the newsletter

My synagogue puts out a newsletter with a joke inside. This week's is good for sharing:

A man walked to the top of hill to talk to God. The man asked, "God, what's a million years to You?"

And God said, "A minute."

Then the man asked: "Well, what's a million dollars to You?"

And God said, "A penny."

Then the man asked, "God--can I have a penny?"

And God said, "Sure--in a minute."
[From Oy! The Ultimate Book of Jewish Jokes, David Minkoff, Ed.]