Making The Road Blog

http://makingx.net/blog/

mtr2.0
Making The Road はmakingのお勉強用サイトです.PHP, Javascriptを中心にいろいろ試してoutputしていきたい.
当サイトの訪問者は24時間以内にこんな単語↓で検索されています (マウスオーバーすると単語を含むqueryを表示します!)

Programming

グラデーション文字のHTMLを吐く各種言語拡張モジュール by SWIG(PHP,Python,Perl,Ruby対応)

久々のSwigネタです.
最近,C++ばっかり書いていてPHPをほとんど書かなくなってきました.
それでライブラリを作るならPHPやPythonなどそれぞれの言語で書くより,C++で書いたものを各種言語で共通して使えるようになればいいと思うようになり,SWIGの出番になりました.

今回は腕慣らしということで簡単なモジュールを作ってみました(ダウンロード).
グラデーション文字のHTMLを吐いてくれる関数text_gradationです
C++では

std::string text_gradation(const char* text, int fr, int fg, int fb, int tr, int tg, int tb);

というインターフェイスで

text_gradation("Gooooooooooooooooooooooal", 255, 0, 0, 255, 0, 255)

を表示すると
Gooooooooooooooooooooooal
となります.
続きを読む…

カテゴリー: Python, Ruby, Perl, Swig, PHP, C | コメント( 0 ) | 2008/08/15 23:51:21 by making
ソーシャルブックマーク: add to hatena hatena.comment (2) add to del.icio.us (0) add to livedoor.clip (1) add to Yahoo!Bookmark (0) Total: 3
トラックバックURL:

顔文字関数

$ clisp
[1]> (defun ^_^ () )
^_^
[2]> (^_^)
NIL
カテゴリー: Lisp | コメント( 0 ) | 2008/08/14 02:37:38 by making
ソーシャルブックマーク: add to hatena hatena.comment (0) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 0
トラックバックURL:

C言語のdefineマクロの##とか

初心者教本にはあんまり載っていないdefineの使い方

lispのマクロとか,関数を量産できるマクロが好きです
P言語にはあるのかな?

カテゴリー: C | コメント( 3 ) | 2008/08/14 02:02:28 by making
ソーシャルブックマーク: add to hatena hatena.comment (0) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 0
トラックバックURL: