Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams Collectives™ on Stack Overflow Find centralized, trusted content and collaborate around the technologies you use most. Learn more about Collectives
ここでは、Rubyによるネットワークプログラミングの説明を行いたいと思います。 ここで対象としている読者は、ネットワークプログラミング初心者(もしくは入門者)です。 TCP 簡単なTCPサーバとクライアント TCPクライアント(エラー処理付き) 何度も受信できるTCPサーバ TCPサーバ(acceptした相手の確認) UDP UDPを使う UDPでブロードキャストを使う UDPでマルチキャストを使う(マルチキャストを送信する) UDPでマルチキャストを使う(マルチキャストを受信する) UDPでマルチキャストを使う(TTLを設定する) Web 簡単なHTTP GET(Net::HTTP) HTTP HEADと全てのHTTPヘッダの表示(Net::HTTP) HTTP POST(Net::HTTP) 簡単なRSSクライアント その他 IO::selectを使う IPアドレスからホスト名への変換
RubyによるWeb Scrapingライブラリの情報をまとめるためのWikiです。 HpricotHTMLを「Rubyらしく」扱うライブラリ MechanizeWebサイトへ自動でアクセスするためのライブラリ scRUBYt!DSLを使って簡単にスクレイピングを行うライブラリ feedalizerhtmlからRSSフィードを作るのに役立つライブラリ scrAPIパーサを定義することでHTMLを解析するライブラリ ウェブサイトから必要なデータを抽出すること。(Scrape = 削り取る) ライブラリによっては、受信したデータの解析だけでなくデータの送信にも対応している。 例: RSSを配信していないウェブサイトのHTMLをスクレイピングして野良RSSを作る Googleの検索結果をスクレイピングして自動でGoogle検索するスクリプトを書く ブログの投稿ページを解析して、コマンドラインから
未だに半年前のエントリにブクマされるみたいなので、もう少しjavascriptについて書いてみる。 今回は大規模化開発におけるJavascriptの注意点とかそういうの。当てはまらない環境の方もいます。(しかも基本的な事だらけで大したことは書いてないです) ほぼリッチクライアントを主目的としたjavascripterとコードを対象とします。 どちらかというと、ライブラリを提供する側の視点から 1.ログを出力せよ あなたが書いたコードは遅い、と必ず言われます。なので言われる前から、自分の書いたコードの処理時間をログするようにしましょう。 次のような処理時間を計測するロガーを作ります。 var TraceLog = function (){ this.startTime = -1; var outer = document.getElementById('_outer'); if(oute
Mac OS Xを使っていないプログラマは、時間の80%を無駄にしている、かどうかは知りませんが、堅いGUIとUNIX系のコマンドラインツールを使えるMac OS Xは、開発環境として使いやすいことは確か。 が、デフォルトのままでは、Terminal.appで日本語が表示できないとか、lsやfindがGNU系じゃなくてBSD系だとか、要するにOSだってカスタマイズしてなんぼというわけであります。 というわけで、私のMac OS Xのカスタマイズをこのあたりに書いておきます。 ※2008/2/3追記: Leopard版書きました > 開発環境としてのMac OS X Leopard Terminal.app Mac OS Xにはデフォルトで「ターミナル」(/Applications/Utilities/Terminal.app)が付いてきますが、これがデフォルトではまったくイケてない。主要な
Web2.0ワークショップで紹介したように、様々なケータイやPHSでユーザの現在位置が取れるようになってきていて、それを使っていろいろアプリケーションが作れるようになってきている。 その中には、実用アプリだけでなく、私も前管理人をしていたアンテナ奪取や、ケータイ国盗り合戦、Ittemiaのようなエンタメアプリも考えられるわけですが、その際に問題になってくるのが「現在位置の詐称」問題です。 ケータイ、PHSでの位置取得は、SoftBank簡易位置情報のようにHTTPヘッダ、DoCoMoのiエリアのようにPOST等で返ってくる場合もありますが、多くの場合、GETのクエリストリングとして返ってきます。 なので、一旦URLを得てしまえば、クエリストリング中の経緯度を書き換えさえすれば、簡単に詐称できてしまうのです。 実用アプリならば、飽くまで位置情報はユーザの調べる位置を現在位置とするため
今まで var element = document.createElement('style'); document.getElementsByTagName('head')[0].appendChild(element); if (ie) { var sheet = element.styleSheet; } else { var sheet = element.sheet; } みたいにやっていた。 ところが dojo のソースを眺めていたら IE には createStyleSheet という関数があるみたい。 createStyleSheet を使うとこうなる。 if (ie) { var sheet = document.createStyleSheet(); } else { var element = document.createElement('style'); doc
最近,ネットの一部で「Erlang」(発音はアーランまたはエアラン)というプログラミング言語が流行している(参考リンク)。Erlangはスウェーデンの通信機器メーカーであるエリクソンにて開発された言語で,エリクソン内部や通信業界はもちろん,Twitter(関連記事)などのオンライン・サービスでも採用されているという。 Erlangの特徴は,複数のプロセスが通信をしながら計算をする「並行プログラミング」を,言語の機能として強力にサポートしていることだ。C言語などの逐次プログラミング言語は,プロセスや通信の機能を内蔵しておらず,こうした機能をオペレーティング・システムに「外注」している。しかし,そのような外付けの仕組みは,メモリー消費量や速度,開発効率などの点でオーバーへッドが大きい。Erlangのような並行プログラミング言語では,プロセスや通信といった機能をプリミティブとして実装することによ
Catalyst::Dispatcherを見ていたら二項演算子(Multiplicative Operators)スライスを使ったハッシュの初期化をみつけた。 @{ $self->registered_dispatch_types }{@classes} = (1) x @classes; で、これを分かりやすく変えると下記のようになります。 use Data::Dumper; my @keys = qw( a b c ); my %hash; @hash{ @keys } = (1) x @keys; print Dumper \%hash; $VAR1 = { 'c' => 1, 'a' => 1, 'b' => 1 }; 要は配列をハッシュのキーにして、値は1だよと。 良く判定系の処理をするときに、配列をぐるぐる回して一致するか?とかやりたくないので、 一度ハッシュに突っ込んでから、
C言語で書かれたソースコードを読んでいるとき、関数ポインタから呼び出されている機能の実体がどこに書かれているのかを探すのに苦しんだ経験はありませんか? 私はあります、いっぱいあります!! そんなときはどうするかというと・・・ 手順1: まずは気分転換をする! 手順2: そして気合いを入れ直す! 手順3: さらに気力で読み砕く! 手順4: 最後に根性で発見する! これが、ごく一般的な作業手順(?)かと思います・・・(ごめんなさい嘘です) でもまあ、実際にここまで出来れば、そのプログラムの大まかな構成とか癖みたいなものはだいたい把握できているはずなので、他の関数ポインタについてもある程度当たりをつけて見つけだすことが出来るようにはなるかと思います。 ・・・・・が、、できれば気合いと根性を使わずに追えるなら追いたいのが人情ですよね。 straceやltraceを使えばシステムコールやライブラリコ
Jim Lyon (jplyon@attglobal.net) 10-Sep-2003 Compiled from sqlite docs, source, and yahoo postings This document is current for SQLite 2.8.6 1. Introduction 1.1. About this FAQ This FAQ is an incomplete summary of my experiences with speed-optimizing an application that uses the SQLite library. It will be of most use to people who are already familiar with using SQLite. Feel free to send any que
はじめに 配布 GNU Emacs一般公的使用許諾 コピーに関するポリシー NO WARRANTY イントロダクション 画面構成 ポイント エコー領域 モード行 文字,キー,コマンド Emacsの文字セット キー キーとコマンド Emacsの起動と終了 Emacsの終了 コマンドスイッチと引数 編集の基本的なコマンド テキストの挿入 ポイントの移動 テキストの消去 ファイル ヘルプ機能 空白行 継続行 カーソル位置の情報 数引数 変更の取り消し(Undo) ミニバッファ ファイル名用のミニバッファ ミニバッファでの編集 入力補完機能 補完の例 補完コマンド ミニバッファコマンドの繰り返し コマンド名によるコマンドの実行法 ヘルプ機能 キーの説明 コマンド名や変数名によるヘルプ機能 Apropos---入力した文字列を含むコマンドの探索 他のヘルプコマンド マークとリージョン マークの設定
著者 :リチャード・M・ストールマン, ローランド・マグラス (GNU プロジェクト) 訳者 : いのまた みつひろ / ecoop.net(技術メモ公開中) 翻訳文更新日:May 20, 2002(翻訳終了・未校正) Linux 標準搭載の make コマンド, 別名 gmake の日本語版です。 この資料の著作権は Richard.M.Stallman & Roland.McGrath と Free Software Foundation にあり、また翻訳版には前述の著作者に加えて ecoop.net に著作権があります。再配布・転載等される方はこちらを見て下さい。 GNU Project についてはgnu.org(日本語)を参照のこと。 序文はこちら GNU makeユーティリティは大きいプログラムのどの断片が再コンパイルされる必要が あるかという事と,それらを再コンパイルする発行コ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く