Learn You A Origami!

November 11th, 2010

I’ve set up a new site called Learn You A Origami!, which features video tutorials from YouTube of how to fold several different models. I’ll be adding new models periodically.

Pentagonal Gift Box origami picture

The site uses my StepReplay software, which is a JavaScript library that puts “steps” in any YouTube video using the YouTube API. The problem with most origami video tutorials is that they go too fast for people just learning a new model, and you have to pause and rewind the video frequently. StepReplay will automatically pause the video when it reaches the next step, and with one click you can also replay the previous video. It also has an option to loop through a single step over and over.

This can be used for any instructional video on YouTube. StepReplay is released under a BSD license.

Learn You A Origami! main site.

StepReplay can be downloaded here.

Book Review: “The Evolution of Cooperation” by Robert Axelrod

November 6th, 2010

Practical, insightful, and delightful. (5 out of 5 stars.)

Axelrod’s “The Evolution of Cooperation” delivers ideas that are at the same time obvious but surprisingly insightful to human nature. It is a small and readable book which every chapter left me thinking, “Of course, why didn’t I think of it like that?”

The core of the book focuses on a computer simulation tournament of the Prisoner’s Dilemma. The Prisoner’s Dilemma is a simple game as follows: two convicts have been arrested and are interrogated separately. If they both remain silent, they only get three (or some other nominal amount) years of prison. But if one snitches on the other, he goes free and the other serves ten years. This gives both of them the incentive to snitch, however if they both end up snitching on each other, then they both get life sentences.
(more…)

Lua Cheat Sheet for Programmers

November 1st, 2010

If you don’t know Lua, the popular programming language often used as a embedded scripting language, but you do know how to program, here’s a cheat sheet that covers the basics of the language’s syntax.

The cheat sheet itself is an executable program. You can download the file here: lua_cheat_sheet.lua

For quick viewing, here it is on Pastebin

For printing, here it is as a PNG:
Lua Cheat Sheet

Pyperclip – A cross-platform clipboard module for Python

October 9th, 2010

I got tired of not having a good cross-platform module for accessing the clipboard in Python, so I put this together. It is a module that loads a getcb() and setcb() function depending on what your operating system (or window manager) is.

It has the following requirements:

  • Windows - No requirements. You don’t need the win32 module installed.
  • Mac - Requires the pbcopy and pbpaste, which come with OS X.
  • Linux - Requires the xclip command, which possibly comes with the os. If not, run sudo apt-get install xclip. Or have the gtk or PyQt4 modules installed.
  • Pyperclip runs on both Python 2 and Python 3.

Usage is simple:

import pyperclip
pyperclip.setcb('The text to be copied to the clipboard.')
spam = pyperclip.getcb()

UPDATE: (9/13/2011) I’ve fixed a small TypeError that some people were coming across that Gustav pointed out below.

UPDATE: Kenneth Reitz pointed out that he’s coded a similar module called Xerox. I missed it in my prior art search. http://github.com/kennethreitz/xerox It seems to have a fairly similar implementation as Pyperclip, except requires the win32 Python module to work on Windows.

I’m busy trying to figure out X11 programming so I can get rid of the xclip dependency.

Well, I guess there not.

September 5th, 2010

I was walking past 16th & Mission St when I saw this car. First time I’ve had to take out my new phone and take a photo in a hurry, but managed to get a good snap shot. I guess this guy thought he was being clever:

'There not straight' car

'There not straight' car

Living in hippie San Francisco, I keep forgetting that there really are people like this out there. And they really are that dim.

« Previous PageNext Page »

Powered by WordPress