「Programming Language Network」は世界中のプログラミング言語や開発者の関連をグラフ化したサービスです(GitHub、Reddit)。 丸いノードが、プログラミング言語、コンピューターサイエンティスト、Foundation、方言、実装などをあらわしていて色で区別されています。ノードの間の線も色によって意味が区別されています。詳しくはサイト左側にある説明を参照してください。 例えば日本人に馴染み深いプログラミング言語Ruby付近を拡大するとこんな感じに。Rubyはまつもとゆきひろ氏によって開発されたことが分かります。 あまりにも膨大すぎてちょっと分かりづらいかもしれませんが、さまざまなプログラミング言語間のつながりを知ることができる興味深いグラフとなっています。ちなみにRedditによると、このデータはWikipediaから抽出していて、抽出するためのソースコードが
正規表現によるバリデーション等で、完全一致を示す目的で ^ と $ を用いる方法が一般的ですが、正しくは \A と \z を用いる必要があります。Rubyの場合 ^ と $ を使って完全一致のバリデーションを行うと脆弱性が入りやすいワナとなります。PerlやPHPの場合は、Ruby程ではありませんが不具合が生じるので \A と \z を使うようにしましょう。 はじめに 大垣さんのブログエントリ「PHPer向け、Ruby/Railsの落とし穴」には、Rubyの落とし穴として、完全一致検索の指定として、正規表現の ^ と $ を指定する例が、Ruby on Rails Security Guideからの引用として紹介されています。以下の正規表現は、XSS対策として、httpスキームあるいはhttpsスキームのURLのみを許可する正規表現のつもりです。 /^https?:\/\/[^\n]+$/
「HerokuでWebアプリ開発を始めるなら知っておきたいこと」シリーズの第1回では、無料の範囲で使えるHerokuの基本スペックについて書きます。このシリーズのまとめページはこちら。 Herokuとは まず本題に入る前に、さらっとHerokuについてご紹介します。 Herokuは、ヘロクと読みます。HeroとHaikuを掛け合わせた造語だそうです。私は「ヘ↑ロ→ク↓」と発音してしまいがちですが、他の人の発音を聞いていると「ヘ→ロ→ク→」が多いような気がします。 2011年7月7日に行われた「Heroku-ja meetup #1」というイベントでは「ヘ↑ロ→ク↓」と発音する人が多かったです。 Herokuを誤解を恐れずにものすごく大雑把かつ極端に説明するといまどきのレンタルサーバーやいまどきのホームページスペースです。2010年代のジオシティーズです。年齢がバレますね。 もう少し技術者向
大阪にはキャバクラが多い街として「キタ」と「ミナミ」があるんです。 この2つの街にはいろんなキャバクラがあるし、競合店が多いことから他のエリアより時給相場が高い上、新規のお客さんも来店しやすい。 だから、関西のキャバクラで働く上で、キタ、もしくはミナミのキャバクラを選ぶことがすごくおすすめ! けど、そうは言っても「じゃあキタとミナミだったらどっちの方が良いの?」って思う方もいるかもしれませんよね(笑) なのでここでは、大阪のキタとミナミのキャバ嬢目線から見た違いについて解説していきます! 大阪のキャバクラ「キタ」と「ミナミ」の違い では大阪のキタとミナミには、キャバクラにどんな違いがあるのか、各項目に分けて紹介していきます! 大阪のキャバクラで頑張って働いていこうと思ってる方は、自分の目的やキャバ嬢としてのキャリアに合ったお店を選んでくださいね! お給料 まずはお給料について。お給料は、大
追記:ハッキリ言ってこの正規表現はネタなので,実際に素数判定を行いたい場合は,もっと別な賢いアルゴリズムを使ったほうが良いです 正規表現で素数が判定できるという記事を見たので試してみた. http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/ この記事によると /^1?$|^(11+?)\1+$/ という正規表現を使うと,素数判定が出来るらしい.ある整数 n が素数かどうか判定したい場合は,"1" * nという文字列がこの正規表現にマッチするかどうかを調べればよく,マッチすれば非素数,マッチしなければ素数となる.ただし,"1" * n は,例えば,n が 4 ならば "1111" と 1 が 4 回連続して続く文字列となる. Rubyで書いた素数判定プログラムはこん
■ Perl基礎文法最速マスターをだいたいそのまま、Rubyに置き換えてみました。 他の言語をある程度知っている人はこれを読めばRubyの基礎をマスターしてRubyを書くことができるようになる…かも知れません。無保証です。 参考: オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (1.9.2) オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (1.8.7) ■ 1. 基礎 インタラクティブRuby (irb) irbを使うと、Rubyのプログラムを簡単に練習することができます。 /Users/yhara $ irb irb(main):001:0> puts "hello" hello => nil irb(main):002:0> 1 + 1 => 2 以下の説明は、irbを起動して、自分で試しながら読むと習得が早いと思います。 表示 (print,
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く