2013年03月11日18:15 カテゴリTipsLightweight Languages ついに顕在化しはじめたArrayリスク JavaScript: The Definitive Guide (Kindle ed.) David Flanagan [邦訳:JavaScript 第6版] 以下のようにした理由は、実はJavaScriptのArrayが配列ではないことに起因します。 404 Blog Not Found:Algorithm - Ruby 2.0 や Haskell の遅延リストを JavaScript で これに対して、List.Lazyではmapやfilterを関数合成で実現しています。JavaScriptのArrayが、(整数個のデータ構造が順序よくならんだ古典的な意味での)配列でないことは、以下のように確認できます。 JavaScript var ary = ne
2012-05-04 2013-03-13追記 この記事が@matzさんにツイートされたのを受けて、各処理系の最新版で再度試してみました。 lua, V8, ruby, mrubyでfib(39)の実行時間比較 2013-03-12版をご参照ください。 mruby (軽量ruby) ソース公開 | quredo-styleを見て、自分の環境でlua, luajit, V8, ruby, mrubyで試してみた。 テスト環境 Model: MacBook Air 13-inch, Mid 2011 CPU: 1.7GHz Intel Core i5 RAM: 4GB 1333MHz DDR3 OS: Mac OS X Lion 10.7.3 lua fib.lua function fib(n) if n < 2 then return n end return fib(n-2) + fib
開発者泣かせの問題児ブラウザ、Internet Explorerですが、IE5.5、IE6、IE7、IE8をモダンブラウザの挙動にする神JSがGoogle Codeで配布されていました。 とりま、 attripのデザイン崩れはこれで解決できました! 使い方は簡単!下記のコードを貼り付ければOK! まじ仏。 「IE9.js」は、IEを普通のモダンブラウザの挙動にするJSです。IE5、IE6でも透過PNGが使えるようになります。 「css3-mediaqueries.js」は、IEでCSS3 Media Queriesを使えるようにするJS。レスポンシブデザインのサイトをIEでも見れるようにします。 ちなみに、border-radiusや、box-shadow はできませんでした。 あと、IEでの見え方をチェックする方法はこちら↓↓ IE9環境でIE6/IE7/IE8/IE9表示する方法(共存
Kazuho Oku @kazuho 公開ed! ウェブブラウザ上で JavaScript より速く動作するプログラミング言語です。よろしくお願いします m(__)m / “JSX - a faster, safer, easier alternative to Java…” http://t.co/UdsmdvI3 2012-05-31 07:52:09 Takuto Wada @t_wada DeNA が開発したオブジェクト指向、静的型付け、(ほとんど)型安全なプログラミング言語。コンパイルすると JavaScript が生成される。ライセンスは MIT. / “JSX - a faster, safer, easier …” http://t.co/eONyUpS8 2012-05-31 08:15:41
zombie.jsとは jsdomというnode製のDOMシミュレータがあります。これを使えば、ブラウザを使わずにDOMイベントを発行することができます。 zombie.jsはセッション管理とブラウザのアクションを管理するjsdomのラッパーです。 個人的には、Ajaxのテストは無理せずJavaScriptでやれとおもってるので、その点zombieは素直に動いてくれます。 利点 AjaxでDOMを書き換えたりするイベントもテストできる (qt-webkitと比較して) 無茶苦茶早い コンパイルが楽(というかQTは定期的に互換崩れてバイナリ壊れてる… 論よりコード サンプルをアップロードしてあります mizchi/zombie-tester-example https://github.com/mizchi/zombie-tester-example インストール等はReadme見てもらうと
Twitterのタイムラインが面白すぎて、ついうっかり言語を擬人化して脳内で言語女子会なるものを開いてしまいました。なお、登場人物と実在の人物は1対1に対応しません。 undefinedとnullの両方必要なの? とあるプログラミング言語が集う女子会にて: Perl: そういえばさ、なんでJavaScriptちゃんってundefinedとnullの両方もってるの? JavaScript: えっ、未定義の変数にアクセスした時undefined返したいじゃない? Python: 例外投げて死ねばいいじゃん Ruby: 例外投げて死ねばいいよね Python & Ruby: ねー♡ Java: いやそこは参照型ならnull、数値型なら0で初期化すべきでしょ C: これだから最近の若い子は…初期化にだってコストが掛かるんだからね!デフォルトで初期化するなんて無駄遣いよ!必要な人だけが責任をもって初
はてなブックマークボタンを表示する 行動情報の取得について はてなブックマークボタンは、2011年9月1日より興味関心に基づく広告の掲載を目的とした行動情報の取得(個人情報以外)をしています。 この行動情報は株式会社マイクロアドのプラットフォームを利用し、Cookie を用いて取得されます。取得される情報は、ユーザーのみなさまが使用しているブラウザにおいて閲覧したページ履歴情報などで、これらはすべて匿名のものとして収集されます。個人が特定されうる情報(生年月日、メールアドレス、はてなIDなど)は一切収集されません。 Cookieと行動情報の取得は、広告配信の目的に限定しています。また、この取り組みは「一般社団法人 インターネット広告推進協議会(JIAA)」が定めるガイドラインに遵守しております。 匿名のブラウザ閲覧行動の取得・分析によって、ユーザーのみなさま1人1人が興味関心を持っているも
IE6 への対応が一段落した昨今、 IE7 もいよいよ事実上市場から姿を消す日が近づいてきたようです。flickr が今年以降リリースする新機能にて IE7 をサポートしないことを表明しました。私の勤務先でも、今ものすごい勢いで IE7 のシェアが低下しており、今年の夏から冬にかけて、今の IE6 と同じくらいのシェアになるかもしれない勢いです。 というわけで、 IE の最低動作保証バージョンが 7 から 8 になったら何ができるようになるのか、僕らの caniuse.com を見てざっと洗い出してみましたのでご参照ください。 CSS inline-block display:inline-block が使えます。IE 6/7 では "display:inline; zoom:1;" で代用していたと思います。 Table Display display:table 、 display:t
以前、WSH/JScriptでファイルのダウンロードをする方法をメモしましたが、今回は、その非同期バージョン。HTAなんかを作ったときは、こちらの方がUIが固まらなくて便利です。 // ファイルをダウンロードする関数 function downloadFile(url, savefile, callback) { // HTTP通信を行うためのオブジェクト var http = new ActiveXObject("Msxml2.XMLHTTP"); // コールバックを登録する http.onreadystatechange = function () { if (http.readyState == 4) { if (http.status == 200) { // バイナリファイルを保存するためのオブジェクト var strm = new ActiveXObject("Adodb.S
スマートフォンを含む最近のブラウザでは、戻るボタンで前のページに戻った際に、JavaScriptも含めて前回の最後の状態を復元します(Back Forward Cacheと呼ばれます)。これはとても便利なのですが、ページを作成する立場からすれば、余計なお世話であることもあります。 Back Forward Cacheの無効化はとても簡単に実現できます。ページの中にonunloadを書くだけです。 <!DOCTYPE html> <html><head><title>onunload test</title> <script> window.onunload = function() {}; window.onload = function() { var count = 0; var loop = function() { document.getElementById("num").in
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く