Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2014-09-01から1ヶ月間の記事一覧

CodeIQ | 『第7回デスマコロシアム』問題 集計報告 @tbpgr #CodeIQ

概要 『第7回デスマコロシアム』問題 詳細 『第7回デスマコロシアム』問題 の参加状況集計です。 https://codeiq.jp/ace/tbpgr_colosseum_manager/q1069 残言語 挑戦者0名の言語は以下です。 Ada Assembler (gcc-4.8.1) Assembler (nasm-2.10.01) bc CLIPS C…

Ruby | Numeric | divmod

概要 Numeric#divmod(other) -> [Numeric] 詳細 self を other で割った整数の商 q と余り r を返却。商はNumeric#div 余りはNumeric#modulo と同じ値。 サンプルコード p 5.divmod(2) p 5 / 2 p 5.div(2) p 5 % 2 p 5.modulo(2) p 4.divmod(2) p 2.divmod(4…

Grunt

概要 JavaScriptのタスクランナーGrunt 内容 項目 内容 基礎 http://d.hatena.ne.jp/tbpg/20140905/1409925604 Gruntfile http://d.hatena.ne.jp/tbpg/20140905/1409925670 参照 Grunt Official http://gruntjs.com/

Gruntfile

概要 Gruntfile の設定に関して ファイル Gruntfile は Gruntfile.js か Gruntfile.coffee として作成します。 構成 ・ wapper 関数 ・ プロジェクト、タスクの設定 ・ Pluginのロード ・ カスタムタスク からなります。 wapper 関数 module.exports = (grun…

Grunt 基礎

概要 JavaScript のタスクランナー Grunt の基礎。 目的 Grunt は ・ minification ・ compilation ・ unit testing ・ linting ・ etc...など、開発中に何度も繰り返す作業を簡単なものにし、 その労力をゼロに使づけます。 Gruntの特徴 巨大なエコシステム…

Ruby | Numeric | coerce

概要 Numeric#coerce(other) -> [Numeric] 詳細 self と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返却。 Number クラスのサブクラスを新たに定義する際に、実装が必要となる。 デフォルトは Float に変換。coer…

Ruby | Numeric | div

概要 Numeric#div(other) -> Integer 詳細 self を other で割った整数の商 q を返却。div は内部的には Numeric の継承先で実装される 「/」メソッドを 呼び出している。 サンプルコード p 3.div(2) p 3 / 2 p 4.div(2) p 2.div(4) class EvenNumber < Nume…

Ruby | Numeric | abs2

概要 Numeric#abs2 -> Numeric 詳細 絶対値の2乗を返却。 サンプルコード p -2.abs2 p 0.abs2 p 2.abs2 出力 $ ruby numeric_abs2.rb 4 0 4 参照 http://docs.ruby-lang.org/ja/2.0.0/method/Numeric/i/abs2.html

Ruby | Numeric | abs

概要 Numeric#abs other -> bool 詳細 自身が 0 以上ならば self を、そうでない場合は -self を返却。 つまり、絶対値を取得する。 サンプルコード p -1.abs p 0.abs p 1.abs 出力 $ ruby numeric_abs.rb 1 0 1 参照 http://docs.ruby-lang.org/ja/2.0.0/me…

Reveal.js

概要 Reveal.js 詳細 HTMLを利用した、美しいプレゼンテーションを作成するための 小さなフレームワークである Reveal.js について 内容 項目 内容 使用手順 http://d.hatena.ne.jp/tbpg/20140901/1409576612 参照 Reveal.js GitHub https://github.com/haki…

Reveal.js | 使用手順

概要 Reveal.js の使用手順 手順 reveal.jsの取得 # reveal.js の GitHub リポジトリから tar.gz を取得 $ wget https://github.com/hakimel/reveal.js/archive/2.6.2.tar.gz $ tar xvf 2.6.2.tar.gz $ rm 2.6.2.tar.gz $ mv reveal.js-2.6.2 sample_slide i…

Ruby | Numeric |

概要 Numeric# other -> bool 詳細 self と other を比較し、 同じなら 0 self が小さければ -1 self が大きければ 1 比較できなければ nil を返却します。 サンプルコード p 1 <=> 0 p 1 <=> 1 p 1 <=> 2 p 1 <=> 'a' 出力 1 0 -1 nil 参照 http://docs.rub…