Help us understand the problem. What is going on with this article?
この記事は Vim Advent Calendar の 274 日目の記事です。昨日は id:osyo-manga さんの unite-highlight つくった でした。 はじめに 先週の日曜日(8/25)になごやまつりというイベントがあり、そこで Haskell を Vim で書く方法というネタで LT をしてきました。発表するのが決まったのが前日ということもありちゃんとまとまった内容になっていなかったので、本エントリで少し補足を書きたいと思います。 すごいVimでhaskellを書こう@なごやまつり from cohama とりあえず、インデントをどうにかする 発表では「Haskell のデフォルトのインデントプラグインは全然ダメ」という発言をしましたが、間違いでした。訂正します。 「Haskell のデフォルトのインデントプラグインなんてなかった!」 まさか、ないとは...。 と
列挙順自体はとくに意味ありません。あと「どの最適化がどのくらい速くなるのか?」を詳細に計ったことはないですし、「原理的にこうなってるから(ry」というのを説明するに過ぎません。中には「JITで無意味になるようなどうでもいい細かすぎること」も書いてありますし、最適化のトレードオフとして失うものもあるので、そのあたり自己責任でお願いします。本当に最適化が必要とされる場合は、以下のものを無闇に実行するよりまず計測したほうがいいのは、言うまでもありません。*1 1. private[this]をつかえ scalaのvalやvarは、private[this]にしたときのみ、直接のフィールドアクセスになります(それ以外ではメソッド呼び出し)。シングルトンのobjectの場合も同様です。private[this]をつけられる場合はできるだけつけましょう 2. なんでもかんでもListをつかうな 最初の
追記 手順が抜けて手落ちだったし、これとほぼ同じ事をもっとわかりやすく書いてある記事があったので、ものすごく恥ずかしくなってきました... 以下の記事を参照された方がいいです。ブックマークも以下の記事にしていただいた方がよろしいかと! MacでClojure + Vim環境を作る - komagata 以下、書いた記事を一応残しておきます。 Macbook ProにClojureのセットアップをしました。 特にVimClojureの導入が、調べてもなかなか簡単な方法がなくて大変だったので、試行錯誤しながら確認したベストな解決策をメモとして残しておきたいと思います。 環境 Mac OS X Lion Vim バージョンは7.3 homebrewでインストールしたもの *1 プラグインはNeoBundleで管理 Macのパッケージ管理 homebrewのみでMacPortsは使ってない ちなみ
前に RubyでMySQLに繋ぐためのruby-mysqlとmysql2 - tagomorisのメモ置き場 というエントリで書いたとおり、いまおそらく最もよく使われそうな mysql2 という ruby用のmysqlドライバにはprepared statementを扱うためのAPIがない。MySQLではprepared statementを使っても使わなくても速度に影響は無いらしい(後のtweet参照)し、O/R Mapperを経由しての使用がメインだから不要、という判断なのだろう。 (p19)MySQLの場合: PreparedStatementプール機能の利用有無は、性能にまったく影響しません・パラメータのバインド機構の利用有無は、性能にまったく影響しません / Microsoft PowerPoint - URL 2012-04-18 11:49:15 via Hatena しかし
Web サーバやアプリケーションサーバは、リクエスト数やメモリ使用量がある閾値を超えたらプロセスの再起動を行う仕組みが用意されています。 Apache にも IIS にもそのための設定項目が用意されていて、この仕組みを一般にリサイクルと呼ぶようです。 UA からのリクエストをさばくワーカープロセスが疲弊せず、パフォーマンスを維持するための仕組みですね。 Ruby で人気のアプリケーションサーバである Unicorn ですが、残念ながらこのリサイクルの機能を持っていません。 どうにかできないかなーと思って調べていたら、この短所を補完する Gem がリリースされていました。 Unicorn Worker Killer | github そのまんまですね。 この Gem でできるのは、以下のようなリサイクルです。 ・一定のリクエスト数を超えたらランダムで再起動する(上限に達したら必ず再起動)。
Gemfileについてよくわかってなかったので調べてみた。 そもそもGemfileって? Bundler用の設定ファイル。 BundlerはGemfileの記述にしたがって、gemの依存関係を示したGemfile.lockを生成する。 じゃあ、Bundlerって何さ? アプリケーションで使用するgemのバージョン管理を行うプログラム。 「お前が書いたコード動かないんだけど?」 「ハァ? 俺の環境では動いてるし。バージョン違うんじゃねーの? 死ねよ」 ってならないためのツール。 Railsをはじめ、SinatraやRubyMotionでも使われている。*1 ちなみに、Bundlerの公式サイトにはこう書いてある。 The best way to manage your application's dependencies ベストらしいので使わない手はない。 source gemが置いてある場
15.1 Facadeパターンとは 第15章ではFacadeパターンを学びます。プログラムを作っていくと、最初は小さなものでも、だんだん大きくなっていきます。 たくさんのクラスが出来て、相互に関係しあい、複雑になっていきます。 クラスを使う場合には、それらの関係を正しく理解して、 正しい順番にメソッドを呼び出す必要があります。 大きなプログラムを使って処理を行う場合、 関係しあっているたくさんのクラスを適切に制御しなくてはいけません。 その処理を行うための「窓口」を用意しておくと、 個別にたくさんのクラスを制御しなくても、「窓口」に対して、要求するだけですみます。 Facadeパターンは、既存のクラスを複数組み合わせて使う手順を、「窓口」となるクラスを作ってシンプルに利用できるようにするパターンです。 ちなみに、facadeとはフランス語を語源とする単語で「建物の正面」という意味です。発音
Redis でのデータの永続化方法について調べたので、忘れないうちにまとめておきます。 調べた時の Redis のバージョンは 2.6.13 です。 スナップショット(RDB) Redis のデフォルトの永続化の仕組み この設定が有効な場合、Redis は定期的にデータベースの内容をディスクに出力する Redis を再起動するとこのファイルからデータが読み込まれ復元される 一定回数の更新 + 一定間隔でディスクにファイル出力 ファイル出力タイミングは設定ファイル、CONFIG コマンドで変更可能 無効にもできる 出力は非同期で行われるため、プロセスがクラッシュした場合には前回のスナップショット以降のデータが失われる可能性あり 多少のデータロスを許容できるようなデータならスナップショットのみでもイケそう 手動で実行するには SAVE コマンドまたは BGSAVE コマンドを実行 SAVE は
勾配の緩やかな初心者向け Scheme 入門ページです。 コンピュータは使ったことがあるが、プログラミング経験があまりない人を想定しています。 Scheme の解説はすでに山ほど優れたものがありますが、あえて解説記事を書いてみました。 Scheme のような抽象的な話題は波長が合えばすんなりと理解できますが、あわないと全く理解できません。 他の解説を読んで今ひとつよく理解できなかった人は試しに読んでみてください。 この記事の目標はコンピュータ科学の教科書の決定版である SICP を読める程度の Scheme の知識を提供することです。 目次: 処理系のインストール Scheme を電卓代わりに使う リストを作ろう 関数を定義しよう 分岐 局所変数 繰り返し 高階関数 入出力 代入 文字、文字列 シンボル型 連想リスト、ハッシュ表 ベクトルと構造体 構文の定義 (マクロ) 継続 遅延評価 非
仕事でよく使うフリーソフトをまとめました。 最近、客先での仕事などで、PCの入替え作業が続いていたので、その都度探し回らなくて済むよう、自分の忘備録としての意味合いが強いです。 Windowsフリーソフトコンプリート1000 2011-12 (INFOREST MOOK) 出版社/メーカー: インフォレスト発売日: 2011/08/16メディア: ムック クリック: 43回この商品を含むブログ (2件) を見る 前提 Windows7 Professional 32bitで動作確認してます。 Web/メール ブラウザ Firefox FirefoxSyncがあるおかげで、複数PCの環境が同期取れて素晴らしいです。 (PR)わかるFirefox―人気ブラウザの「基本操作」から「アドオン」まで (I・O BOOKS) Chrome Webアプリの動作検証用に入れてます。Firefoxよりもサク
はじめに本書の構成 (1)本書の対象読者本書の表記本書の使い方執筆時点でのGaucheバージョン謝辞第1部: 思想LispとScheme (4)Gaucheの特徴 (1)すべて式であるすべてリストである (1)lambdaは空気のような存在である (2)プログラミングとは名前付け(bind)であるすべて再帰である (2) (2)Schemeのすごい点 (4)すべてオブジェクトである (もしそれがお望みなら)Gaucheの設計思想や誕生の背景Schemeの評価モデルとは? (3)「Lisp脳」の謎に迫る - Schemeプログラマの発想第2部: 実用Schemeスクリプトを書こうSchemeスクリプトを書く (1)コマンドライン引数の値を得るユニットテストを書く (1)CGIを書こうSchemeスクリプトをCGIとして実行するwww.cgiライブラリを利用する (1)手軽にHTMLを生成する
2010年02月03日21:31 Ruby Rubyで "&" を使うと幸せになれるらしいよ (*´Д`)ノ なんか似たようなタイトルを見たことあるな…まぁいいか。 Perlで+を使うと幸せになれるよ (*´Д`)ノ - (゚∀゚)o彡 sasata299's blog ブロック処理 ( do...end もしくは {...} ) の例としてはこのような3種類があります。 #1 ブロックの中に直接処理を書く方法 #2 ブロックの中でやらせたい処理の Proc オブジェクトを呼び出す方法 #3 ブロックを使わずに Proc オブジェクトに & を付けて渡してあげる方法 3つとも全く同じ処理です。#3 みたいに書く事も出来るんですね〜。& が Proc オブジェクトをブロックに変換してくれます。 #1 3.times do puts 'hogehoge' end proc = Proc.new
Groovy(グルービー)は、Javaプラットフォーム上で動作する動的プログラミング言語である。 Groovy の処理系はオープンソースソフトウェアであり、James Strachan と Bob McWhirter らを中心に、オープンソース開発サイトであるコードハウス上で、2003年8月27日に開発が開始された(CVSへの最初のコミットがなされた)。その後、開発の主体は Guillaume Laforge と Jeremy Rayner らに移り開発が続けられている。2015年3月31日までは Pivotal がスポンサー企業となり、開発者をフルタイム雇用していたが、3月末をもって終了し、Apacheソフトウェア財団の管理に移行した[3]。 GroovyはJava仮想マシン (JVM) 上で動作する言語処理系および言語の名称であり、Javaとの直接的な連携を特徴とする。例えばGroov
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く