七行プログラミング (452レス)
七行プログラミング http://medaka.5ch.net/test/read.cgi/php/1036141603/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
337: nobodyさん [] 04/09/18 22:44:55 ID:9YaH2aKo age http://medaka.5ch.net/test/read.cgi/php/1036141603/337
338: nobodyさん [sage] 04/09/18 22:53:04 ID:??? >>335 使い方がわからない。。。。 http://medaka.5ch.net/test/read.cgi/php/1036141603/338
339: nobodyさん [] 04/09/20 13:46:08 ID:k3h/6iWb スクリプト -> 335.pl /* C++のヘッダファイル foo.h */ #include <iostream> #include <stdlib.h> #include "common.h" using namespace std; namespace test{ class FooTest: public Test { int total; public: Test(); ~Test(); int foo(void); int bar(int n, int m); }; // End of class FooTest }; // End of namespace test 実行方法 $ perl -Pn 335.pl < foo.h または、 $ ./335.pl < foo.h 18 test iostream stdlib.h common.h FooTest int foo(void) int bar(int n, int m) using namespace std int total 行数, namespace, includeファイル, メンバ関数, 変数の順に出力 http://medaka.5ch.net/test/read.cgi/php/1036141603/339
340: nobodyさん [sage] 04/09/20 14:43:21 ID:??? 何故わざわざ WebProg 板で? と思いつつ縮め。 #!/usr/bin/perl -n $n=$1if/^namespace\s*(\w+)/;/#include\s*[<"](.+)[">]/&&push@i,$1;/^class\s+(\w+ )\s*\:?/x&&push@c,$1;/\s*([\w\s\*]+\w\s*\(.+\))/&&push@f,$1;/\s*([\w\s\*]+\w);/ &&push@v,$1;END{print join"\n",$.,$n,"@i","@c","@f","@v",''} http://medaka.5ch.net/test/read.cgi/php/1036141603/340
341: nobodyさん [sage] 04/09/21 17:50:57 ID:??? <html> <head> <title>あ</title> </head> <body> </body> </html> http://medaka.5ch.net/test/read.cgi/php/1036141603/341
342: nobodyさん [釣られてみるsage] 04/09/21 17:58:26 ID:??? それはマークアップ言語という(ry http://medaka.5ch.net/test/read.cgi/php/1036141603/342
343: nobodyさん [] 04/10/03 15:30:49 ID:qw0lrubh Store7の圧縮してない奴ないですか? > 作者 http://medaka.5ch.net/test/read.cgi/php/1036141603/343
344: nobodyさん [sage] 04/10/03 17:06:58 ID:??? >>343 自分で展開していかないと面白味が分からないと思うなぁ、コレ。 http://cm.xrea.cc/upload.cgi?d=1096790671.tgz http://medaka.5ch.net/test/read.cgi/php/1036141603/344
345: nobodyさん [sage] 04/10/03 20:29:26 ID:??? >>344 ありがとう いや,実は>>258なんだけど機能強化されてるのでこっちを使おうかと思ってね http://medaka.5ch.net/test/read.cgi/php/1036141603/345
346: nobodyさん [age] 04/12/12 03:10:20 ID:??? あげ http://medaka.5ch.net/test/read.cgi/php/1036141603/346
347: nobodyさん [sage] 04/12/16 18:47:01 ID:??? http://internet.watch.impress.co.jp/cda/news/2004/12/16/5820.html http://medaka.5ch.net/test/read.cgi/php/1036141603/347
348: nobodyさん [sage] 04/12/17 09:19:09 ID:??? >>347 Perlのmolester-minの方はライブラリ使わず9行。(詰めれば6,7行以内に収まりそう。 http://ansuz.sooke.bc.ca/software/molester/ http://medaka.5ch.net/test/read.cgi/php/1036141603/348
349: nobodyさん [sage] 04/12/17 14:50:07 ID:??? >>348 定数をハードコーディングして可搬性を激しく落としてでも Socket.pm を使わない選択は漢だなぁ。(w 80桁ギリギリまで詰めるよう整形したら既にシェバング無し 七行達成してるし、あと 40 byte ほど縮めたらいい感じかな。 $/=$_;$,=shift;$w=$a=shift;sub g{open(F,$4)&&t($2,$a,"e$4",<F>);close F}socket S,2,1,6;$k{+shift}=1;bind S,&a;sub e{open F,">$4";print F$';close F}sub h{t($2, $_,id)for keys%k}sub i{$k{$2}=1}sub f{t($_,$2,$4)for keys%k}sub a{$w=~/:/;pack 'CxnC4x8',2,$',split'\.',$`}sub t{socket X,2,1,6;$w=shift;$k{$w}=(connect X,&a) ?print X"$, $_[0] $_[1]/".pop:$/;close X}for(listen S,5;$SIG{ALRM}=sub{}; m!^(.*?) (.*?) ([e-i])([^/]*)/!s&&$,eq$1&&&$3){alarm 9;(accept(C,S),alarm 0)? read C,$_,1e6:($_="$, $a f".shift);close C} http://medaka.5ch.net/test/read.cgi/php/1036141603/349
350: nobodyさん [sage] 04/12/17 21:57:04 ID:??? >>349 正規表現による暗黙の代入とグローバル特殊変数を使った引数渡しは使えそうだ。 PythonのTinyP2PがXMLRPC等のライブラリを使っているので、 動機のひとつにライブラリなしバージョンを作ろう、ってのがあったみたい。 サイトを良く読むとblogとかにその辺の事情も書いてる様です。 他の言語では、Java(16行), Ruby(6行)版も投稿されてます。 ttp://developers.slashdot.org/comments.pl?sid=132907&cid=11103175 ttp://developers.slashdot.org/comments.pl?sid=132907&cid=11097812 http://medaka.5ch.net/test/read.cgi/php/1036141603/350
351: nobodyさん [sage] 04/12/24 21:39:51 ID:??? ほす http://medaka.5ch.net/test/read.cgi/php/1036141603/351
352: nobodyさん [] 05/01/30 23:39:07 ID:cEoW2dZ/ >>341-342 そういえば、昔、5kっていう5KBにHTMLページを収めるってなコンテストがあったなぁ。 http://www.the5k.org/ 5Kといい、7Lといい、こういうの好きなんだわ漏れ。 7行といえば560バイトでWebPage作るってのはどう? ちょっと擦違いスマソ http://medaka.5ch.net/test/read.cgi/php/1036141603/352
353: nobodyさん [sage] 05/01/31 00:37:15 ID:??? >>352 「どう?」じゃなくて、作って晒せば? こういうのはやったもん勝ち。 面白いと思わせる事ができれば挑戦者も出てくるんじゃない? ただスレのルール的に、「560 byte」でなく、1 行は 79 byte + 改行、 7 行以内でそのまま使える、って条件を満たしてないと個人的には 受け入れ難いなぁ。 http://medaka.5ch.net/test/read.cgi/php/1036141603/353
354: nobodyさん [age] 05/01/31 14:38:02 ID:??? <? echo 'PHPもまぜてくれ'; ?> http://medaka.5ch.net/test/read.cgi/php/1036141603/354
355: nobodyさん [sage] 05/02/06 00:29:37 ID:??? じゃぁ、phpで7行wiki <? require("Text/Wiki.php");require("Cache/Lite.php");$c=&new Cache_Lite(); $s=$_SERVER[PHP_SELF];$g=$_GET;$b=&$_POST[b];$n=$g[n]?$g[n]:"FrontPage";$b&& $c->save($b,$n)&&header("Location: $s?n=$n");($b=$c->get($n))||$g[c]=e; $h="<h1>$n</h1>";if($g[c]==e)$h.="<form method=post action='?n=$n'>". "<textarea name=b rows=30 cols=80>$b</textarea><input type=submit>"; else{$w=&new Text_Wiki;$w->setRenderConf(xhtml,wikilink,new_url,"?n=%s"); $h.=$w->transform($b,xhtml)."<hr><a href='?c=e&n=$n'>e";}?><html><body><?=$h?> PEAR::Text_Wikiが必要。Cache_LiteはPEARにデフォルトで入ってる気がする。 あとshort_open_tag=Onでよろしく。 整形ルールは ttp://wiki.ciaweb.net/yawiki/index.php?area=Text_Wiki&page=SamplePage 日本語のwikinameは使えなかったりする。これはText_Wikiが対応していないせい。 http://medaka.5ch.net/test/read.cgi/php/1036141603/355
356: nobodyさん [] 2005/04/24(日) 00:09:53 ID:s2OIHVmv 保守あげ http://medaka.5ch.net/test/read.cgi/php/1036141603/356
357: nobodyさん [] 2005/04/26(火) 00:51:58 ID:UrRypboo >>355 ちょっとずるい気がする http://medaka.5ch.net/test/read.cgi/php/1036141603/357
358: nobodyさん [sage] 2005/04/26(火) 17:50:19 ID:??? どの辺が? タグを閉じていないあたり? http://medaka.5ch.net/test/read.cgi/php/1036141603/358
359: nobodyさん [sage] 2005/04/27(水) 02:12:54 ID:??? >>358 ライブラリ使い過ぎると面白さ半減ってことだろ。 http://medaka.5ch.net/test/read.cgi/php/1036141603/359
360: nobodyさん [] 2005/04/27(水) 03:24:58 ID:0BxullHs モジュール/ライブラリに関して >>46, >>135 >>136, >>174 >>175 http://cm.xrea.cc/techinfo.cgi の 0.1. ライブラリ及びモジュールの利用 >>355 requireって () 省略できるはず。 http://medaka.5ch.net/test/read.cgi/php/1036141603/360
361: nobodyさん [sage] 2005/04/27(水) 07:43:42 ID:??? >>355 まぁでも、7行で基本機能を備えたwikiが使えるなら実世界でも結構有用じゃないか。 Text_Wikiの機能のデモにはなるでしょ。 むしろwiki技術関連スレ向きとは思うが。 向こうにも一応アンカー張ってあるね。 http://medaka.5ch.net/test/read.cgi/php/1036141603/361
362: nobodyさん [sage] 2005/04/28(木) 12:12:12 ID:??? 流れを無視して、7vote が 7 行に収まったのでパッケージング。 #!perl use CGI":all";charset$c='UTF-8';${$_}=param$_ for f,n,v;$f=~s/\W//g;open F,"+<$ f"if chdir V;eval{flock F,2};$t=<F>;/\t/and$D{$`}+=$' for<F>;seek F,0,0;$n?$D{$ n}||=1:$v&&$D{$v}++,print F$t,map"$_\t$D{$_}\n",keys%D if$n||$v;$L{$K[$i++]}=$_ for radio_group(v,[@K=sort{$D{$b}<=>$D{$a}}keys%D]);put header,start_html(-lang ,ja,encoding,$c,-Title,$t),h1($t),startform,table({},Tr[map{td["$L{$_}($D{$_})" ,hr{width,$D{$_}}]}@K]),hr,p(textfield(n),hidden(f,$F),submit),endform,end_html UTF-8 になったのがちょっと悔しい。 ファイル名は \w+ にしました。 http://medaka.5ch.net/test/read.cgi/php/1036141603/362
363: nobodyさん [hg] 2005/11/07(月) 20:21:27 ID:??? 半年ぶりフォーーーーーーーーーーーーーーーーーーーーーー http://medaka.5ch.net/test/read.cgi/php/1036141603/363
364: nobodyさん [] 2005/11/23(水) 11:59:34 ID:8dGTpf7c 良スレあげ http://medaka.5ch.net/test/read.cgi/php/1036141603/364
365: nobodyさん [sage] 2006/01/21(土) 13:50:12 ID:??? #!/usr/bin/perl my@d=([qw/? ? ? ? ? ? ? ? ? ? ? ? ? ?/],[qw/☆ △ ■/]); my$c='Shift_JIS';my$l='ja';use CGI':standard';my@r=(0)x@d; print header(-charset=>$c),start_html(-encoding=>$c,-lang=>$l),start_form, (map{my$i=$_;ul li[(map{$r[$i]+=param($_);$_.textfield -name=>$_}@{$d[$i]}), "計 $r[$i]"]}0..$#d),ul(li"$r[1]÷$r[0]=".eval{$r[1]/$r[0]}),submit,end_form, end_html; http://medaka.5ch.net/test/read.cgi/php/1036141603/365
366: nobodyさん [] 2006/01/21(土) 23:54:14 ID:e+ke+qvM なぜ丸付き数字と図形なのかわからんけど面白いですね。 どういうときに使えるだろう・・・。と考えてしまう http://medaka.5ch.net/test/read.cgi/php/1036141603/366
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 86 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.017s