わけのかわらないタイトルですが,そのままです.
import sys;from itertools import ifilterfalse, count;[globals().__setitem__('compile',lambda bf_src : '[globals().__setitem__("dx",0), globals().__setitem__("dseg",[0] * 32768)] '+bf_src.replace('[',' and [ifilterfalse(bool$( dseg#__getitem__(dx) != 0 and [ True ').replace(']',' ] for i in count()))#next() ] ').replace('.',' and [sys#stdout#write(chr(dseg[dx]))] ').replace('+',' and [dseg#__setitem__(dx$dseg[dx] + 1 )] ').replace('-',' and [dseg#__setitem__(dx$dseg[dx] - 1 )] ').replace('>',' and [globals()#__setitem__("dx"$dx + 1 )] ').replace('<',' and [globals()#__setitem__("dx"$dx - 1 )] ').replace(',',' and [globals()#__setitem__("dx"$ord(raw_input(">")[0]))] ').replace('#','.').replace('$',',')),sys.stdout.write('from itertools import ifilterfalse, count;' + compile(sys.argv[2])) if sys.argv[1] == '-s' else eval(compile(sys.argv[1]))]
takano32 のこれを見て
http://taka.no32.tk/diary/20060908.html#p01
と思って書いてみました.
yoshiori@yoshiori-ubuntu [3]$ python bf.py '>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]<.>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>++++++++[<++++>-]<+.[-]++++++++++.' Hello World!
こんな感じになるのですが,これだけだと面白くないので,コンパイルしたソースも表示出来るようにしました.
引数に [-s] を追加すると中間コード(Python-oneliner)が出力されます.
上記の Hello Workd! を表示する bf は下記のようにコンパイルされます.
yoshiori@yoshiori-ubuntu $ python bf.py -s '>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]<.>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>++++++++[<++++>-]<+.[-]++++++++++.'
import sys;from itertools import ifilterfalse, count;[globals().__setitem__("dx",0), globals().__setitem__("dseg",[0] * 32768)] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx - 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [sys.stdout.write(chr(dseg[dx]))] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx - 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx - 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx - 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [globals().__setitem__("dx",dx + 1 )] and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [globals().__setitem__("dx",dx - 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [sys.stdout.write(chr(dseg[dx]))] and [ifilterfalse(bool,( dseg.__getitem__(dx) != 0 and [ True and [dseg.__setitem__(dx,dseg[dx] - 1 )] ] for i in count())).next() ] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [dseg.__setitem__(dx,dseg[dx] + 1 )] and [sys.stdout.write(chr(dseg[dx]))]
これで,「難解プログラミング言語」は読めねーよ!! って人も読みやすくて有名な Python に変換されるので良かったですね!!
ちなみに id:kazuhooku のマジメに素数探索を実行すると
1分くらいかかります.
yoshiori@yoshiori-ubuntu [3]$ time python bf.py '>++++[<++++++++>-]>+++++++[<++++++++>-]<+>+++++++++>>++++++++++[<++++++++++>-]<--[>[-]<[->+>+<<]>>[-<<+>>]<-[>[-]<<[->>+>+<<<]>>>[-<<<+>>>]<+[>>[-]>[-]<<[>+>+<<-]>>[<<+>>-]<>[-]+<[>-<[-]]>[-<<<<[->>+>>+<<<<]>>>>[-<<<<+>>>>]<<+>>]<<-<-]> >[-]+<[[-]>-< ]>[-<>>[-]+<<<<[-]+>>>]<<<-]>>>> >[-]+<[[-]>-< ]>[-<<<<<<<<.>>>[-]++++++[<<++++++++>>-]<<.>>++++++[<<-------->>-]<<<<.>>>>>>>>>]<<<<<<->>[-]<<<[->>+>+<<<]>>>[-<<<+>>>]<>+<[[-]>-<<<->>]>[-<<<+++++++++<->>>>]<<]' 97 89 83 79 73 71 67 61 59 53 47 43 41 37 31 29 23 19 17 13 11 07 05 03 02 python bf.py 57.01s user 0.04s system 99% cpu 57.496 total
java-ja 温泉開催します.
Python 温泉(PySpa)にインスパイアして開催している,というか,
PySpa が大体 6 月と 10 月開催なので 3 月くらいにもやらないの?
と思ったら,id:voluntasに「メンドイ,お前がやればいいじゃん」
と言われたのが元なので PySpa と場所も期間も変りません.
違いは「お酒飲んでもいいよ」って事だけです.
なので,ほとんど PySpa のパクりになっちゃうけど,纏めると以下になります.
@yamashiro @yoshiori という意見がありますよ RT @tomerun: @voluntas 参加資格のところがよく分からなかったのでとまどった、というのがあります
http://twitter.com/voluntas/status/8280172789
簡単に言ってしまうと
成人のチンコクラスタなのですが,もうすこし説明すると
成人男性(何かあっても自分で責任がとれる人)
です.
言語とかも関係ありません.
お金が無い人!! 安心してください!!
無線 LAN 完備,3 日間,朝晩飯付きで 24 時間温泉に入れて 2 万円は高くないと思うのですが,
相場として高い安いは別にしても払えなくて参加出来ない人がいるのはかわいそうだよねと,
参加したいっていう折角の意気込みを「お金」がネックになっちゃうのは不毛だ!!
っていう男気溢れる人が参加費を負担してくれちゃいます!!
なんて太っ腹!!!
最初はそういう学生とかにも参加して欲しいよねって事で立ち上がったのですが,
別に学生じゃなくても良くね?って事で学生じゃなくても申し込めるので,おきがるにどうぞ!!
| id:t_yano | http://d.hatena.ne.jp/t_yano/20100105/1262668611 |
| id:warufuzaketaichi | http://d.hatena.ne.jp/warufuzaketaichi/20091226/1261833543 |
2010/3/20, 2010/3/21, 2010/3/22の2泊3日
熱海/来宮 芳泉閣
貸し切りです
すでに予約済み
2万円です.
余った金額は PySpa と協力して旅館の設備(LAN環境など)にまわします.
Java 書かなきゃいけないとかの縛りもないので,みんな好き勝手に書いています.
また,ボドゲとかが大好きすぎる人間が数人いるので,大ボドゲ大会が開かれたりもしました.
お酒が入るのを少し心配していたのですが,そもそもその場で寝ちゃってもいい会場なので,
何も問題無く終りました.
という事で,是非申し込んでくだしあ><
ドワンゴのパブリックイメージってどうなんだろうねーって
このまえ社内で話してました.
「汚ない格好でコンビニ袋さげて時間関係なく出社」なんて
2ch で書かれてたりしましたし,
「ふざけてる」,「遊んでる」,「破滅」とかまぁ,そんな感じかなぁと……
で,まぁ,大体あってます.
あってるし,否定しないし,しかも,
そう思われてるのを寧ろカッコイイと思ってしまう
駄目男気な人の集りなのです.
ただ,まぁ,本当にふざけて遊んで破滅してるだけだと何も出来ないので,
実際の開発がどんな感じで進んでるのかをちょっと発表してみようと思います.
(僕は裏方の開発なのですが,サービス側の開発の話しも入れる予定)
「java-ja 第1回チキチキ 地方巡業withひがやすを飲み会in富山」で発表した時に,
id:t-wada からこんなブコメを頂きました.
良い発表でした! 資料もすばらしい。ドワンゴでの試みをぜひ他所でも今後聞きたいなと思いました。私は転ぶメタファを優先するから三本柱というけど、三種の神器の方が語呂としてはカッコいいな。
http://b.hatena.ne.jp/t-wada/20090408#bookmark-12852198
このころから漠然と「あぁ,さらにプロジェクトが進んだら続きを話したいなぁ」と
思っていました.
で,次にJJUG で「15分で0からCIまで用意してTDD開発」というのをやりました.
(これはライブコーディングだったので資料ありません><)
今回の発表が集大成的な感じになるんじゃないかなぁと思っています.
TDD,CI と開発手法的なものが続きましたが,今回はそれにプラスして
タスク管理と見積りの話しをしようと思っています.
遅れって書いてるとネガティブなイメージとか卑屈っぽいイメージで取られてしまうかもしれませんが,そんなつもりは毛頭ありません!!
という感じです.
方向を示し(一周目),道を通す(二周目)の人たちがいたからこそ
高速道路の設置が三周目で出来る事を伝えられればいいなぁという
前向きどころか前のめりな三週目です.
方向を示し,道を通してきた人達がいるからこそ,アクセル限界まで踏み込める今の環境と,さらなる高速化のための高速道路の設備的な発表です.
で,XP なんですが,正直僕がプログラマになったころはプログラムの文法やらアルゴリズムを覚えたり考えたりするのが精一杯で,XP とか アジャイルとかは
「何言ってるの??」的なスタンスでした.
ちょっと胡散臭い宗教的な目でも見てました.
でも,実際にやってみると,そうじゃない,例えそうであっても,その宗教の崇める神はコードであり,そこから生まれるソフトウェアであり,さらにそこから生まれる価値なんだという事がわかりました.
なので,逆に昔の僕みたいな考えの人にも是非聞いてもらいたい感じです.
なんか気がつけばサブチームのリーダになっていたので,今まで苦手で逃げてきていた,タスク管理や見積りもしなくてはいけなくなりました.
覚えなくてはいけないのでスキルとして身に付けるために,社内で有志を募って
「アジャイルな見積りと計画づくり」の読書会を開いて勉強しつつ,タスク管理や見積りをしました.
やっていくうちに感じた
「お,これってパフォーマンスチューニングなんじゃね?」
とかも含めてどうやってタスク管理しているのか,見積りしているのかを発表したいと思っています.
(今のところ)特に箝口令とかないので,話せるギリギリまで話すつもりです.
成功の部分だけでなく実際にやって失敗したところとかも含めて話しますので
是非,聞きにきてください!!><
2010年2月19日(金)の 13:10〜14:00 ,B(夢扇)で話します!!
@yoshiori はじめましてこんにちは。LinkedListのsize()とArrayListのsize()は、Linkedの方がパフォーマンスが悪い、という認識は合っていますでしょうか?
http://twitter.com/bar_row/statuses/7984257052
多分,このへんを読んでの感想なんだと思うんだけど
http://yoshiori.org/blog/2006/12/javaiterator.php
size() に関してはパフォーマンスはまったく変りませぬ.
実装もどちらも
/** * Returns the number of elements in this list. * * @return the number of elements in this list */ public int size() { return size; }
です.
List#add などでサイズを変更して,
キャッシュしてるサイズの値を返しているだけなのでコストは変りません.
あ、あと、はじめまして!! こんにちは!!
foursquare はじめますた!!
で,折角初めたので友達いっぱいにしたいので
下記で検索です!!!
http://foursquare.com/import/twitter
僕は友達が少ないので心配したのですが,「dankogai」って検索したら
いっぱい出てきました!!
わーい!!
で,ボタンを押すだけの簡単なお仕事が嫌なのでブックマークレット作りました.
javascript:(function(){$('img[alt=add],img[alt=accept]').click()})();
ブラウザのアドレスバーに貼りつけても動きます!!!
あと,友達申請してくる人がいっぱいいた時も上記ブックマークレットで承認できます!!
というわけで,僕とも友達になってください><
http://foursquare.com/user/yoshiori
元ネタ
foursquare の /manage_friends ページで javascript:$('img[alt=accept]').click() を実行で、全 accept 出来て楽ちん
http://twitter.com/amachang/status/7939074036
コンテンツ委員なしんちゃんに
「なんぞwww」と微妙なコメントでお勧め(?)いただいていますが,
デブサミで「【13-A-6】ひよこクラブ ver.Engineer」やります!!