JavaScriptで、もう連想配列の最後のカンマに悩まない!(※追記あり) · DQNEO起業日記 で言及いただいていたので今の自分の意見を。 その発想は無かったし、無いですね。 2012-05-02 09:55:29 via Twitter for iPhone です。 要素数が変わる、無駄なkeyが入る Node.jsなんかではECMA Script 5のObject.keys()が使えるので var len = Object.keys(obj).length; とか Object.keys(obj).forEach(function (e) { console.log(e) }); とかでオブジェクトのキーを走査したり、ということを普通にやります。そんなときに"dummy"なんてキーが入ってたら邪魔でしょうがないです。 メモリ領域の無駄、はたいして気にならないでしょうけど、とにかく
Node.js で WebSocket-Node を使って実装しました。 転送するめぼしい画像が見当たらなかったので、デスクトップをスクリーンキャプチャして転送してみました。 ブラウザはChrome 17以上か、Firefox 11以上が必要です。サーバ側は scrrencapture コマンドを利用している関係で Mac OS X限定です。 デモ 上半分が転送元のデスクトップ、下半分が転送された画像をブラウザで表示したものです。ニコ動のコメントの飛び具合を見るとわかると思いますが、800*600の解像度の画像を、横640に縮小して転送して、1FPSくらいです。(※ これはWebSocket の限界ではありません。速度は向上させる余地はかなりありますが、今回の本質ではないので気にしないことにします) ソースは github に置いてあります。 hakobera/screencast · G
RequireJS 2.0 draft This is a draft plan for RequireJS 2.0. Subject to change, particularly the naming of things, but this is a solid first pass, and there is an experimental implementation that can be tried out. If you want to give feedback on the general direction or this draft, leave a comment in the RequireJS 2.0 draft issue. Why There has been a good deal real world usage of requirejs, and th
Examines the challenges in controlling the text cursor in a web application. The requirements of Google Tasks are discussed to motivate the problem. A little over two years ago, I left Google. In my farewell blog post, I noted: "One of the many things Google has taught me is that building simple things is often extremely complicated and [Google Tasks] was no exception. (I think I've spent at least
zlib.js English version zlib.js は ZLIB(RFC1950), DEFLATE(RFC1951), GZIP(RFC1952), PKZIP の JavaScript 実装です。 使い方 zlib.js は必要な機能ごとに分割されています。 bin ディレクトリから必要なものを利用してください。 zlib_and_gzip.min.js: ZLIB + GZIP (Raw) rawdeflate.js: Raw Deflate raw.js: Raw Inflate zlib.min.js: ZLIB Inflate + Deflate inflate.min.js: ZLIB Inflate deflate.min.js: ZLIB Deflate inflate_stream.min.js: ZLIB Inflate (stream mode) (GZ
猫も杓子もCoffeeScriptの世の中、CoffeeScriptに手を出してしまったがために(JavaScriptの世に)帰らぬ人となりつつある人はたくさんいると思う。 僕も最近CoffeeScriptに手を染め五分で帰り途を見失ってしまった。 CoffeeScriptの編集にはujihisa氏のshadow.vimが便利だ。 shadow.vimを手短に紹介すると、main.js を開いて編集していると思ったら実はmain.js.shd(中身はCoffeeScript)を編集していて、気づいた時にはすでにmain.js.shdのコンパイル結果がmain.jsに保存されている、というvim-pluginである。 さて、JavaScriptを本格的に使うには、モジュールシステムを避けて通る事はできない。 グローバル変数を多用することも許されているJavaScriptでは、ライブラリによる
Getting CommonJS There are several implementations of the CommonJS standard, and you can choose the one that fits what you're trying to do. // Formatting has been cleaned up around the site and on the Modules 1.0 page. // This website has been replaced with a new one backed by the wiki so it can be edited by the whole commonjs community. // We are no longer using the bulk 0.1 and 0.5 specification
Closure Compilerは言わずと知れたGoogle製のJavaScript最適化ツール。http://code.google.com/intl/ja/closure/compiler/昨日のYUI CompressorとかUglifyJSの話の続きで、この系統のツールを調査していたのだが、Closure Compilerはまた別の魅力があるように思える。「ああ、これは役に立つな」と思ったのがアノテーション機能。http://code.google.com/intl/ja/closure/compiler/docs/js-for-compiler.html例えば、@defineアノテーションを使って、 /** * @define {boolean} */ var ENABLE_DEBUG = true; if (ENABLE_DEBUG) { alert("debug!"); }
This is a copy of the "AMD" document in the repo, kept here to maintain historical links. If this document differs from the one in the repo, the repo version is the correct one. The Asynchronous Module Definition (AMD) API specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded. This is particularly well suited for the browser environment w
Read it now on the O’Reilly learning platform with a 10-day free trial. O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers. Book description You may have definite ideas about writing code when working alone, but team development requires that everyone use the same approach. With the JavaScript practices in
WebOS Goodies へようこそ! WebOS はインターネットの未来形。あらゆる Web サイトが繋がり、共有し、協力して創り上げる、ひとつの巨大な情報システムです。そこでは、あらゆる情報がネットワーク上に蓄積され、我々はいつでも、どこからでも、多彩なデバイスを使ってそれらにアクセスできます。 WebOS Goodies は、さまざまな情報提供やツール開発を通して、そんな世界の実現に少しでも貢献するべく活動していきます。 よく見たら、今週の話題以外の記事はほぼ 3 ヶ月ぶりですね・・・久々となる本日は、 Closure Library の goog.tweak という機能のご紹介です。 Web アプリを開発する際には、皆さんデバッグ用の機能をいろいろと実装することと思います。一部の機能を変更・無効化したり、内部の状態を上書きしたりとかですね。でも、そうした機能の設定はどこに書いてい
How does it work? Like this: <script src="jquery.js"></script> <script src="lake.js"></script> <script> $(function() { $('#lake-img').lake({ 'speed': 1, 'scale': 0.5, 'waves': 10 }); }); </script> ... <img id="lake-img" src="lake.png" style="display: none;"/> Lake.js takes an img element and inserts a canvas element displaying the image and its flipped reflection directly after the img element. Th
Flip is a jQuery plugin to apply flip animation to any element.0.4.1 Fixed some regression in Chrome and Safari 0.4 Fixed some bugs with transparent color. Now Flip! works on non-white backgrounds! 0.3 Added the content setting: now you can define the next content of your Flip!box. 0.2 Fixed jQuery chainability and buggy innerText rendering (Thanks xNephilimx for your tips!) 0.1 Kick off
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く