牌語備忘録 -pygo

あくまでもメモです。なるべくオフィシャルの情報を参照してください。

牌語備忘録 -pygo

2010-01-01から1年間の記事一覧

何となく Google カレンダーに RTM の サイドバーガジェットを追加したしらた削除の仕方が解らなくて焦ったのでメモ

[環境:MacOS10.4, Firefox3.6] ヘルプにやり方あった Remember The Milk - Services / Remember The Milk for Google Calendar / Sidebar Gadget / FAQ の『I want to remove this feature』 To remove this feature from Google Calendar: 1. In Google …

ランダムに8文字のパスワードみたいなモノを作るスクリプトをPythonで

#!/usr/bin/env python # *-# -*- coding: utf-8 -*- import random num = 8 arr = list('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') print "".join([random.choice(arr) for i in range(num)]) もっとスマートな方法あったような?…

もう春だし何となくEmacsのカラーテーマを変えてみた

[修正]window-system ではない環境での Emacs 起動時にエラーにならないよう color-theme を読み込まない設定に変更。あと若干色変更。 Inspiration っていう Color Theme ジェネレータサイトがあるんだけど、いくらやってもしっくりこないんで結局自分で…

Perl5.10 をMacports で MacOSX10.5 に インストールしようとしたらエラーでた(´・ω・`)

なんだかPerlと自分は昔から相性悪い気がする... MacBook-2:~ username$sudo port -d install perl5.10 Password: DEBUG: Found port in file:///opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/perl5.10 DEBUG: Changing to port d…

初めてのPerl 5.5.1「配列とprintf」をPythonで

Perl my @items = qw( wilma dino pebbles ); printf "The items are:\n" . ("%10s\n" x @items), @items; Python items = ["wilma", "dino", "pebbles"] print "The items are:\n" + "%10s\n" * len(items) % tuple(items) 実行結果 The items are: wilma d…

ちょっとしたGUIアプリを作ってみたくなったからwxPythonのメモ

修正:準備のインスコで py25-setuptools と py25-py2app 追加 とりあえずスクリプトをアプリ(.app)にしてみるメモ。 (環境:MacOSX10.4, Python2.5) 準備 MacPortsで次のものをインストール py25-wxpython py25-setuptools py25-py2app wxPythonのサンプ…

『数学ガール』4-2-5の解答4-1(フィボナッチ数列の一般項)をPythonで

積読状態の『数学ガール』をいまさら読み始めたのでなんとなく。 解答4-1(フィボナッチ数列の一般項) from math import sqrt def fib(n): return int(1 / sqrt(5) * (((1 + sqrt(5)) / 2) ** n - ((1 - sqrt(5)) / 2) ** n)) print [fib(i) for i in range…

Pythonのdatetimeをちょいといじってみた

>>> import datetime >>> datetime.datetime.now() datetime.datetime(2010, 1, 30, 11, 49, 0, 364016) >>> d = datetime.datetime.now() >>> d datetime.datetime(2010, 1, 30, 11, 49, 16, 339859) >>> str(d) '2010-01-30 11:49:16.339859' >>> d.strfti…

Firefox3.5から3.6にアップデートしたらMouseoverDictionaryが動かなくなったので動くようにしてみた。

自己責任でお願いします。 (環境 Power Mac G5、MacOS10.4) mouseoverdictionaryの中身を書き換えてインストールする 本家サイトから現時点で最新の『mouseoverdictionary-0.6.5.xpi』ダウンロード mouseoverdictionary-0.6.5.xpiをemacsで開くと解凍しな…