It’s good to make people happy, but it’s better to help people make themselves happy. Design for strength.

Advertisements
Quote

ImportError: No module named _ctypes

I got the error when I ran my application on localhost which was started via Google App Engine Launcher. It seems to occur on Max OSX and Python 2.6. To fix that, set python path in preference of GAE Launcher as below instruction.

Issue 985 – googleappengine – Import Error: Failed to import ctypes to load dll on windows – Project Hosting on Google Code

Comment 10 by mike.j.dobbs, Feb 11, 2010

Changing preferences–>“my python path” to “/usr/bin/python2.5” and restarting
GoogleAppEngineLauncher fixed this on my Snow Leopard.

Comment 11 by kmallea, Mar 22, 2010

Make sure you hit {enter} in the input field, or the Python Path you type in will not
save. I believe this is a bug in the GAE GUI; I read this somewhere else, I forgot
where exactly.


(Japanese)

OSX で GoogleAppEngineLauncher を使ってて動作確認する時に urllib を使ってる部分でエラーがでた。回避策は上のページにあるように Python 2.5 を使う事だけど、GAE Launcher の設定画面で Python の Path を設定する時は、入力したら Enter キーを押さないと設定が反映されない、というところではまった。。

ImportError: No module named _ctypes

JavaScript snippets (trim, supplant)

17 Hours of JavaScript from the Masters で紹介されてるビデオの The JavaScript Programming Language の Part 3 にでてきたコードをメモ。

12:40 あたりに出てくる trim

String.prototype.trim = function() {
    return this.replace(
        /^\s*(\S*(\s+\S+)*)\s*$/, "$1");
};

ちなみに SnipplrJavaScript trim で検索するといくつかヒットするけど、それぞれ微妙にやり方が違ってて面白い。

その後、13:00 あたりから出てくる supplant

String.prototype.supplant = function(o) {
    return this.replace(/{([^{}]*)}/g,
        function (a, b) {
            var r = o[b];
            return typeof r === 'string' ? r : a;
        }
    );
};

それの使い方(ビデオでは使い方が先に出てくる)。

var template = '<table border="{border}">' +
    '<tr><th>Last</th><td>{last}</td></tr>' +
    '<tr><th>First</th><td>{first}</td></tr>' +
    '</table>';

var data = {
    first: "Carl",
    last: "Hollywood",
    border: 2
};

mydiv.innerHTML = template.supplant(data);

同じようなものに RND template があって、これを参考に(ほとんどコピペして)こんなのを書いたりしたけど、やっぱり書き方が微妙に違う。

JavaScript snippets (trim, supplant)

taitems:

tmblg:

Dan Pink on What Motivates Us

This is an amazing video that sadly rings far too true for where I work. Innovation is so forbidden that people are instructed (on the sly of course) to innovate privately, in their downtime or on the weekends. When these innovations turn out to be amazing features that management never knew they wanted, they get merged in to our regular product like that was the goal all along.

Self improvement, self management and fulfilment are of course my end goals. That’s why I contribute to the jQuery UI project. That’s why I have another cool announcement on the horizon relating to the VLC player. That’s why people are inherently good.

Video