wesley tanaka

3D models from a single photo

()

Drop, modify, change or rename a column from a SQLite table in Android

()

SQLite only supports a limited subset of ALTER TABLE, so to modify an existing column, it's necessary to create a separate table. The SQLite documentation recommends doing two separate INSERT/SELECT operations using a temporary table, instead of doing an INSERT/SELECT followed by an ALTER TABLE RENAME TO.

Running a SQLite database transaction in Android

()

The idiom for SQLite transactions in Android is:

db.beginTransaction();
try {
  // Do database operations here ...
  db.setTransactionSuccessful();
} finally {
  db.endTransaction();
}

Responsive AdSense Leaderboard ad unit for Twitter Bootstrap 2.3.2

()

Twitter Bootstrap 2.3.2 sets its media query responsive layout breaks at 768px, 980px, (and 1200px), which are suitable for including a Mobile Banner (320 x 50), Leaderboard (728 x 90), or a  Large Leaderboard (970 x 90). It's possible to do this with the new beta Responsive ad unit AdSense ad size.

Lending Club Experiment

()

I've seen references to Lending Club in several different places, including an article in The Economist, news about Google's $125 million investment in the company, and the tritium lending club boat

Oneteen

()

ME: What's this? [draws 11]

RYAN: Eeleven

ME: What's this? [draws 12]

RYAN: mm mmm what's this?

ME: twelve

RYAN: twelve!

ME: What's this [draws 13]

RYAN: fourteen

ME: thirteen

RYAN: thirteen!

...

ME: What's this [draws 15]

RYAN: fiteen

EMILY: Try 13 again

ME: What's this [draws 13]

RYAN: mm mm thir...

EMILY: Yeah, that's right!  thirteen!

RYAN: Thirteen

ME: What's this [draws 17]

RYAN: Sedenteen

ME: What's this [draws 16]

Leave you alone for five seconds

. . . and you draw all over your face with crayon.

First Math Lesson

()

ME: [trying to come up with a way to entertain Ryan while he's sitting in his high chair and I'm cooking] I'm going to teach you some math.  Do you want to learn math?

RYAN: [...]

ME: One plus one equals two.

RYAN: More Cheerios

ME: if you have one Cheerio and another one Cheerio, then you have two Cheerios

RYAN: mayihavemorecheeriospleasethankyou!

ME: [gets more Cheerios]

RYAN: [...]

ME: One plus one equals...

RYAN: [...]

ME: What is one plus one?

RYAN: [...]

Delayed gratification

()

The famous Stanford marshmallow experiment found that kids who were able to delay gratification (by forgoing one marshmallow now in favor of two marshmallows later) tended to have better outcomes later in life under various mesaures.

Disable autoraise in compiz

By default, if you enable enable sloppy focus in Unity in Ubuntu, auto-raise will be enabled. To turn it off:

sudo apt-get install dconf-tools

dconf write /org/gnome/desktop/wm/preferences/auto-raise false

This has been tested in Ubuntu 12.04 Precise Pangolin and in Ubuntu 13.10 Saucy Salamander

Syndicate content
by Wesley Tanaka