MacからCoolTermでXBeeを設定する

『XBeeで作るワイアレスセンサーネットワーク』を手引きに、Mac用の CoolTerm をダウンロードして起動したものの、Serial Port Optionにusbserial-xxxが表示されない。ターミナルからls /dev/tty.*を実行してみると、やはりドライバが表示されない。
そもそもドライバをインストールしておく必要があるのではと思い、検索したところ(
http://weblog.nekonya.com/2011/01/macxbeeusb-exploler.html)、FDTI Chipのページ
http://www.ftdichip.com/Drivers/VCP.htm
からVirtual COM Port Driverをダウンロード&インストールするのだね。
結果、ls /dev/tty.*で/dev/tty.usbserial-A100RR6Cを確認、CoolTermからも認識し、無事ATコマンドの実行に成功。


クラゲ

Chromeウェブストアをみてたら、Audiotoolをみつけて、おお、すげえと。でも、フェーダーやつまみをマウスで操作するのは、つらい。

ウェブストアの動向を追っていたら、

Chrome ウェブストア日本版スタート!
はてブディレクターがGoogleに聞いてみた
http://b.hatena.ne.jp/articles/201105/3570

おお、クラゲだ。

Chrome Experiments - WebGL
http://www.chromeexperiments.com/webgl/

WebGLOpenGL ESが基本だけど、これがなかなか難しい。
WebGLのいいチュートリアルを見つけた。

Learning WebGL
http://learningwebgl.com/blog/?p=1786

Hack The WebGL (WebGL勉強会)による翻訳もあった
https://sites.google.com/site/hackthewebgl/learning-webglhon-yaku/the-lessons/lesson-5

斜戦略-1

Once the search is in progress, something will be found

何かが見つかるだろう、いったんsearchが進行すれば

闇雲に探すのではなく、
注意深く、組織立ったやり方で、調べる、探す

Change nothing and continue with immaculate consistency

何も変えない、矛盾のない整合性/一貫性をもって、続ける


この気づきは間違ってない
曇りを消して
明確にすること

風性常住、無処不周

麻浴山宝徹禅師、扇を使うちなみに、僧きたりて問う、
「風性常住、無処不周なり、なにをもてかさらに和尚扇を使う」。
師いはく、「なんぢただ風性常住をしれりとも、いまだところとしていたらずといふことなき道理をしらず」と。
僧いはく、「いかならんかこれ無処不周底の道理」。
ときに、師、扇を使うのみなり。
僧、礼拝す。


仏法の証験、正伝の活路、それかくのごとし。常住なれば扇を使うべからず、使わぬをりも風をきくべきといふは、常住をもしらず、風性をもしらぬなり。風性は常住なるがゆえに、仏家の風は、大地の黄金なるを現成せしめ、長河の蘇酪を参熟せり。

ImageMagick++でサムネールに変換

C++はなんども挫折してるのだが、サムネール処理がいる、というのでMagick++を使ってみた。

#include <Magick++.h> 
#include <iostream> 

class ImageFactory {

public:
    ImageFactory(int width, int height);
    ~ImageFactory();
    void thumbnail(const char *source_image, const char *thumb_image);

private:
    Magick::Image image;
    Magick::Geometry size;
    int _width;
    int _height;
    float _ratio;
};
#include "ImageFactory.h"

using namespace std;
using namespace Magick;

ImageFactory::ImageFactory(int width, int height) {
    _width = width;
    _height = height;
    _ratio = (float) width / (float) height;
};

ImageFactory::~ImageFactory() {
};

void
ImageFactory::thumbnail(const char *source_image, const char *thumb_image) {
    float ratio;
    try {
        // Read a file into image object 
        image.read(source_image);

        size = image.size();
        if (size.height() != 0) {
            ratio = (float) size.width() / (float) size.height();
        }
        // Crop the image to specified size (width, height, xOffset, yOffset)
        if (ratio > _ratio) {
            // 横長:
            image.zoom(Geometry((int) (_height * ratio), _height, 0, 0));
            image.crop(Geometry(_width, _height,
                    (int) ((image.size().width() - _width) / 2), 0));
        } else {
            // 縦長:
            image.zoom(Geometry(_width, (int) (_width / ratio), 0, 0));
            image.crop(Geometry(_width, _height, 0,
                    (image.size().height() - _height) / 2));
        }

        image.magick("png");

        // Write the image to a file 
        image.write(thumb_image);
    } catch (Exception &error_) {
        cout << "Caught exception: " << error_.what() << endl;
    }
};