16032010 Python
mixiにあったはずなのに消えてた。
皆さんこんにちは。Linuxのwhoコマンドのアウトプットを時間昇降順にソート(qsort()を使って)したいと思っています。
pyutmpを使って。
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from pyutmp import UtmpFile
from time import ctime
utmps = [utmp for utmp in UtmpFile()]
for utmp in sorted(utmps,cmp=lambda x,y: cmp(ctime(x.ut_time),ctime(y.ut_time))):
print '%s %s %s' % (utmp.ut_user, utmp.ut_line, ctime(utmp.ut_time))
起きていることはすべて正しい―運を戦略的につかむ勝間式4つの技術
自分の小さな「箱」から脱出する方法





Machine Learning: An Algorithmic Perspective (Chapman & Hall/Crc Machine Learning & Patrtern Recognition)
「履歴書のウソ」の見抜き方 調べ方
世界の凄腕ビジネスマンと渡り合う日本人弁護士の 負けない議論術
ブラック会社限界対策委員会
Google Androidアプリケーション開発入門 画面作成からデバイス制御まで――基本機能の全容