[[PageOutline]] [[TitleIndex(Dev,format=group)]] * [http://semver.org/ Semantic Versioning] * [http://stackoverflow.com/ Stack Overflow] * Stack Overflow is a collaboratively edited question and answer site for programmers – regardless of platform or language. It's 100% free, no registration required. * [http://esolangs.org/wiki/Language_list Language list - Esolang] * [http://www.mwsoft.jp/column/program_top10.html プログラミング言語人気TOP10の簡易解説] > 【参考URL】各言語の実行速度はこの辺を見るとわかりやすい http://shootout.alioth.debian.org/ * [http://wiki.liris.org/article/bittorrent BitTorrentのファイル配信メカニズム - Emerge Technology] * via twitter:suma90h/status/7399039460 * [http://anlyznews.blogspot.com/2011/02/objective-c.html Objective-Cの『遅さ』を計測したら、JavaやC++の5倍も遅かった: ニュースの社会科学的な裏側] * via twitter:Flast_RO/status/40657392437829632 > ベンチマーク方法は簡単に、1変数、1メソッドのオブジェクトを作成し、ループして2,147,483,647回、同一のメソッドを呼び出した。メソッドはint引数が一つあり、int値を戻す。AMD機でUbuntu LinuxのGCC 4.4.3でコンパイルをし、実行を行った。 * 代表的なスクリプト言語も比較に入っている * wikipetan:竹内関数 * [http://caca.zoy.org/wiki/PWNtcha PWNtcha - captcha decoder] * [http://msdn.microsoft.com/ja-jp/library/aa515822.aspx 3D 座標系とジオメトリ] * via twitter:santarh/status/132423516854296577 * [http://www.w3.org/TR/2008/WD-jlreq-20081015/ja/ 日本語組版処理の要件(日本語版)] * [http://www.nminoru.jp/~nminoru/programming/ プログラミングに関係すること] * addr2line > addr2line はプログラム内のアドレスをファイル名と行番号に変換する。アドレスと実行 ファイルが与えられると、 addr2line は実行ファイルのデバッグ情報を用いて、アドレスに関連付けられているファ イル名と行番号を求める。 * [http://jd.benow.ca/ Java Decompiler] * [https://gist.github.com/rokugasenpai/cdaff5eac2e88e6b9efe412982e7ae31 各ストリーミング配信のダウンロード方法(要curl・ffmpeg・rtmpdump・chrome・limechat・wireshark)] * [https://stackoverflow.com/questions/1945075/how-do-i-create-binary-patches patch - How do I create binary patches? - Stack Overflow] * [https://stackoverflow.com/questions/688504/binary-diff-tool-for-very-large-files windows - Binary diff tool for very large files? - Stack Overflow] * [http://www.orefolder.net/blog/2017/03/platform-tools/ もっと簡単!ADBコマンドを使えるようにする方法-ダウンロードして解凍してパスを通すだけでOK | orefolder.net] = Malbolge = * [http://ja.wikipedia.org/wiki/Malbolge Malbolge - Wikipedia] * 次のMalbolgeプログラムは"Hello, world"を出力する。 {{{ (=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk** hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O< }}} * human readableどころかwritableですらない。 * [http://d.hatena.ne.jp/Robe/20060824 最凶言語 Malbolge - ロベールの小部屋] = Grass = * [http://www.blue.sky.or.jp/grass/ Grass the grass-planting programming language] = Python = * [https://gist.github.com/737366 gist: 737366 - GitHub] * twitter:hktechno/status/13583915394531330 Twitpic の特定のユーザーの画像 ID を全部取得してくるスクリプト。 * [http://www.python.jp/doc/release/tutorial/ Python チュートリアル — Python v2.6.2 documentation] * [http://snipplr.com/view/56085/update-all-easyinstall-python-eggs/ Update All Easy_Install Python Eggs - Python - Snipplr Social Snippet Repository] * [http://qiita.com/ohkawa/items/368e6bcadc56a118adaf Python - 正規表現で取りうる値をすべて取得する方法 - Qiita] * [http://moguranosenshi.hatenablog.com/entry/2014/02/28/%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%A7%E5%8D%98%E8%AA%9E%E3%82%AB%E3%82%A6%E3%83%B3%E3%83%88 コマンドで単語カウント - moguranosenshi] * [http://qiita.com/HirofumiYashima/items/b47e87b4cd1eb1578476 python2.7 - テキストファイルの中で、出現回数の多い単語を、「指定した品詞」に絞って、多い順番に 「指定件数」分だけ、画面に一括出力する対話式 コンソール・アプリケーションをつくってみた - Qiita] = OCaml = * [http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html Module Pervasives] OCaml > The initially opened module. > > This module provides the basic operations over the built-in types (numbers, booleans, strings, exceptions, references, lists, arrays, input-output channels, ...). > > This module is automatically opened at the beginning of each compilation. All components of this module can therefore be referred by their short name, without prefixing them by Pervasives. * [http://www.i.kyushu-u.ac.jp/~bannai/ocaml-intro/install.html OCaml プログラミング入門 (インストール)] > ==== ledit ==== > OCaml の対話的環境を提供するコマンド: ocaml は ライセンス上の問題から、 C-a で行頭に戻ったりする事や、ヒストリ機能、 などと言った GNU の readline ライブラリを使った便利な機能がありません。 emacs から対話的環境を使うのが一つには考えられます が、どうしてもターミナルから実行したい人は、 ledit と言うコマンドを使えば大丈夫です。 ledit ocaml と起動するだけです。 * リンクが死んでいるので、 http://pauillac.inria.fr/~ddr/ledit/ へ * http://pauillac.inria.fr/~ddr/camlp5/ も必要 = Makefile = * [http://www.unix.com/shell-programming-scripting/96486-makefile-debug-target.html Makefile debug target - The UNIX and Linux Forums] > Call the same makefile recursively in the debug target including the required flags. Don't set $(DEBUG) as a macro, but pass it in on the recursive call. Something like... > {{{ > (snip) > > debug: > $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG" > }}} * [http://stackoverflow.com/questions/1079832/how-can-i-configure-my-makefile-for-debug-and-release-builds make - How can I configure my makefile for debug and release builds? - Stack Overflow] > You can use [http://www.gnu.org/software/make/manual/make.html#Target%5F002dspecific Target-specific Variable Values]. Example: > {{{ > (snip) > debug: CXX += -DDEBUG -g > debug: CC += -DDEBUG -g > debug: executable > }}} = System Programming = * [http://cboard.cprogramming.com/networking-device-communication/93683-checking-if-file-descriptor-valid.html#post678998 Checking if a file descriptor is valid] > {{{#!c > int is_valid_fd(int fd) > { > return fcntl(fd, F_GETFL) != -1 || errno != EBADF; > } > }}} * [http://www.linuxquestions.org/questions/programming-9/sockets-af_packet-versus-pf_packet-942143/ sockets: AF_PACKET versus PF_PACKET] > Yes. AF_foo means address family foo, and PF_foo means protocol family foo. In Linux, they are always been the same values, I believe. > Traditionally, the PF_foo constants were used for socket(), but AF_foo in the struct sockaddr structure. > > Thus, today, there really should be no difference between AF_foo and PF_foo. * [http://d.hatena.ne.jp/enakai00/20120522/1337650181 PF_PACKETの仕組み - めもめも] > Socketをオープンする際のお作法(呪文?)は次のとおりで、通常は、第一引数に「PF_INET」(もしくはAF_INET)を指定します。 > {{{ > sock = socket(PF_INET, SOCK_STREAM, htons(ETH_P_IP)); > }}} > ここに「PF_PACKET」を指定することで、受信直後の生パケットをユーザ空間のアプリケーションで受け取ることができるようになります。これは、パケットのコピーを受け取っているだけなので、このパケットを受け取るべき本来のアプリケーションにもちゃんと同じパケットは届きます。 * [http://togetter.com/li/283316 TCP socketではwriteの後すぐにcloseしてはいけない - Togetter] > TCP socketではwriteの後すぐにcloseしてはいけない。 > 相手側に全てのデータが届いてからcloseする必要がある。 > shutdown で書き込み側だけハーフクローズするとよい。 > 相手側がcloseしてから、こちらをcloseする。相手側がcloseしたことは、readを呼んでブロックさせておくと、読み込みバイト数==0 つまりEOFになったことでわかる。 * [http://stackoverflow.com/questions/14028401/how-to-use-epoll-with-data-ptr-instead-of-data-fd how to use epoll with data->ptr, instead of data.fd? - Stack Overflow] > You can put whatever you want in data. It's not used by epoll itself, it just returns it when the event occurs on the fd specified in the argument list. * epoll_event構造体は以下のように定義されていた > {{{#!c > typedef union epoll_data { > void *ptr; > int fd; > uint32_t u32; > uint64_t u64; > } epoll_data_t; > > struct epoll_event { > uint32_t events; /* epoll イベント */ > epoll_data_t data; /* ユーザデータ変数 */ > }; > }}} * [http://d.hatena.ne.jp/yupo5656/20040715/p1, UNIX上でのC++ソフトウェア設計の定石 (3) - memologue] > 鉄則3: マルチスレッドのプログラムでのforkはやめよう > * 回避方法2: fork直後に子プロセスがexecを呼ぶようにする > ... 子プロセスはfork直後に、どんな関数(printfなどを含む)も呼ばずにすぐにexeclなど、execファミリーの関数を呼ぶようにします。もし、"execしないfork"を一切使わないプログラムであれば、現実的な回避方法でしょう。 * ただし、fork()からexec*()までの間に「非同期シグナルセーフな関数を呼ぶのは規格準拠」 * [http://mkosaki.blog46.fc2.com/blog-entry-886.html 革命の日々! マルチスレッドプログラムはforkしたらexecするまでの間はasync-signal-safe な関数しか呼んではいけない]