QtDesignerで作成したアプリケーションが 意図しない動作をしたので調べてみる。問題点。 QtDesigner上で、LineEdit と PushButton を設置し、 Connectionから、returnPressed() clike()を設定する。 コンパイルして実行した時、LineEditでReturnを押すと、 …

postgresql, mysqlの設定。 phpMyAdmin, phpPgAdmin の設定。

install wxPython

wxPython をコンパイル・インストール python2.3 setup.py BUILD_GLCANVAS=0 BUILD_OGL=0 build python2.3 setup.py install glcanvasをoffにしてビルド。 oglもWarningを吐いている様なのでoffにしてみる。 rootになって python setup.py installでインスト…

キーワード補間

忘れないうちにメモ。 Vi ... C-n Emacs ... M-/ 今までemacs使ってなかった理由が、 ワード補間のコマンドが解らなかったから、だったりする。emacs -nw で日本語が文字化けする。。

の挙動がおかしい。

unable to initialize frontend: Gnome perl/gnome なライブラリをインストールしてみると、 メッセージが変わった。/etc/debconf.confみてもそれらしい設定が なかったので放置。時間があれば調べる。

明日にする事。(予定)

blosxom のデータのバックアップディスクが壊れてた(涙) ログはなるべくpublishしようと思う。 zoggy ... OCamlでGui作成。使い方解らない。TODO uninstall. HeVeA ... Wanna use. GnuProlog, SwiProlog

今日やった事。

apt-get install sourceforge パッケージがあったのでインストールしようとしてみた。 postgresの設定でこける。pg_hda.confを設定しなおして再挑戦。 今度はslapdへの接続で躓く。Ldapの設定はまだ良く解らないので諦める。 Download Documentation SICP On…

ハローワールド

google.comのrefererが多いようなので、 キーワードを増やしてみる。登録されるかな?

login.py (to check password)

from urllib import urlopen, urlencode BASE_URL = 'http://d.hatena.ne.jp/' LOGIN_URL = BASE_URL + 'login' USERNAME = 'teamikl' PASSWORD = '********' param = urlencode({'key':USERNAME, 'password':PASSWORD}) urlobj = urlopen(LOGIN_URL, param)…

The Philosophy of Ruby

Interview on artima.com http://www.artima.com/intv/ruby.html

http://www-ia.tu-ilmenau.de/~czarn/gmcl/

hello.txt

This code works in ruby, tcl, expect. # Although expect is subset of tcl. $ cat > hello.txt puts "Hello, world" ^D $ ruby hello.txt Hello, world $ tclsh hello.txt Hello, world $ except hello.txt Hello, world common points No need ( ... ) t…

#!/usr/bin/awk -f BEGIN { print "Hello, world" }

program hello; begin writeln ('Hello, world'); { Comment } end. $ gpc hello.pas $ ./a.out Hello, world

Tab

---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- -------7------------------------------------…

How to use unittest

import unittest define a class for test that extends TestCase override setUp, tearDown method implement test* methods for test cases run unittest.main() import unittest class Person: def __init__(self, name): self.name = name def getname(s…

How to make server program

import SockServer class for request that extends BaseRequesthandler class for server that extend TCP/UDP Server If you needs, with Fork/Thread MixIn import SocketServer ECHO_PORT = 23456 CRLF = '\r\n' class EchoRequestHandler(BaseRequestHa…

時間を所得

string date = ctime(time()) - "\n"; 文字列A - 文字列B で、文字列Aの中から文字列Bを取り除ける。 文字列A / 文字列B で、文字列Aを文字列Bでsplitした配列を返す。

YatAnotherWayToDo ...

from operator import mul def fact(num): if num

Python, Ruby, Pike でDesignPatternのBridgeパターンを実装してみた。 C++にも挑戦してみるが、インターフェースの定義で行き詰まる(TODO)

アキュームレータ

# let accgen n = let m = ref n in fun x -> m := m!+x; !m;;

C/C++言語ライクな関数

PeterNorvig氏のPython IAQより・・・ 他にも EnumやStructの簡単な実装が書かれてあった。 enumは、僕が昨日日記に書いたのとは別の方法だった。 簡単な例では、red,green,blue=range(3)から、 他の例ではクラスを使ってクラスの__dict__に直接読み込む方法…

Adapter/Adaptee pattern

pythiusプロジェクトのaop.pyも使ってみたが、 独自の実装でAdapterパターン with AOP from types import FunctionType from __future__ import nested_scopes import sys if sys.version_info[0:2] api(_adapter, adaptee): for name,value in _adapter.ite…

Enum

Pythonで列挙体を生成するユーティリティ関数作ってみた。 コンパイル時に型チェックしない言語/環境では、 その恩恵を受けられないため軽視されがちだけど。値の生成だけでも欲しくなった。ここでは名前のリストを渡して、 値が適当に重複しない値になって…

Stringクラスにメソッドを追加する。 String.prototype.toTwoDigit = function () { return (this.length) ? "0".concat(this) : this; } Ruby等の動的なスプリプト言語なら大抵はサポートしてる機能。 Python でプリミティブ型のクラスの拡張どうやってやる…

MEMO

SeRuby : Implement Self by Ruby http://kumiki.c.u-tokyo.ac.jp/~ichiyama/mt/archives/000026.html Python 構文木へのアクセス http://kumiki.c.u-tokyo.ac.jp/~ichiyama/mt/archives/000025.html とりくんの MT http://f15.aaacafe.ne.jp/~maco/blog/tri…

http://nice.sf.net/ class Person { String : word; String : say(); } say(p@Person) { return p.word; } void main(String[] args) { let p = new Person(word: "Hello, world"); System.out.prinln(p.say()); } JAVAの拡張だけあって、JAVAで出来ること…

types and subtypes

Ada

type Hours24 is new Integer range 0 .. 23; type Hours is new Integer range 1 .. 12; Hours24 and Hours are different types. You can not assignment Hours's var to Hours24 variables. type Hours24 is new Integer range 0 .. 23; subtype Hours is…

print "Hello\ world label "Hello\ world print だとコンソールに、labelだとキャンバスの方に文字を描写する。 aptのパッケージにあった、バークレイのLOGOを使ってみたんだけど、 ウィンドウ重ねると線が消えてしまうのはバグだろうか?それとも仕様?

hello.adb with Text_IO; use Text_IO; procedure Hello is begin Put_Line("Hello, world"); end Hello; > gnatmake hello 前々からコードは読んでいたけど、コンパイルの仕方がわからなかった。 gnatmakeを使うと簡単に出来るらしい。ファイル名は拡張子 .…