File Not FoundSorry for the inconvenience, the page you requested could not be found.
File Not FoundSorry for the inconvenience, the page you requested could not be found.
A crude JavaScript implementation of the first stage of Super Mario Brothers has been making the rounds today. It’s roughly playable but misses many key aspects (no mushrooms, no flag, no one-ups, etc.). However, that’s not what’s particularly interesting about the game. Perhaps the most interesting part of the application is not within the game mechanics itself but in the fact that all of the gam
Welcome Waxy.org and Slashdot readers. I blog about JavaScript, like it’s my job, feel free to subscribe for a ton more posts like this. Related Posts: Running Java in JavaScript JavaScript Talk at Northeastern University State of ECMAScript 4 The World of ECMAScript JavaScript As A Language Note: I’m not the creator of HotRuby, as mentioned elsewhere – it is the work of a highly-skilled Japanese
A new JavaScript Engine has hit the pavement running: The new V8 engine (powering the brand-new Google Chrome browser). There are now a ton of JavaScript engines on the market (even when you only look at the ones being actively used in browsers): JavaScriptCore: The engine that powers Safari/WebKit (up until Safari 3.1). SquirrelFish: The engine used by Safari 4.0. Note: The latest WebKit nightly
Recently I gave two talks at the Web 2.0 Expo in New York City and one for the Boston IxDA. Learning Advanced JavaScript An advanced talk on the JavaScript language. Explored functions, closures, function prototypes, and inheritance. The entire presentation was given using an interactive site/presentation (tested in Firefox and Safari). Feel free to browse through the presentation (I’m not sure ho
new は予約語なので、代わりにneoで*1 Function.prototype.neo =function(){ var obj={}; obj.__proto__ = this.prototype; var ret = this.apply(obj,arguments); if( ret && typeof(ret)=='object' ){ delete obj; obj = ret; } return obj; }ふむ… obj={} は obj= new Object なので「実装する」と偉そうに言ったわりにアレだが、別に実装が目的ではなくてJavascriptのnew(とthis)の動きを理解するためのサンプルだからこれでいいのだ。 プロトタイプチェーン __proto__ をいじれる系(firefoxとか)なら、だいたいうまくいくはず。 // クラス定義のようなもの fun
JavaScript-XPath とは JavaScript-XPath は、 DOM 3 XPath を実装していないブラウザに対して、実用的な速度で動作する DOM 3 XPath のエンジンを追加します。 一言で乱暴に言ってしまえば、どのブラウザでも document.evaluate って関数で XPath 使えるようになるよ!ってことです。 以下が公式サイトになります。 http://coderepos.org/share/wiki/JavaScript-XPath DOM 3 XPath ってなんなの!? めっちゃ簡単(で、ちょっとだけ適当)なDOM 3 XPath の説明をします><。 JavaScript でよく使う document.getElementById や document.getElementsByTagName って関数ありますよね? DOM 3 XPath
いろいろ試行錯誤をしていて JavaScript の関数を作って呼び出すのと Haskell のそれとの決定的な違いを見つけた。 それは、たぶんものすっごい単純で当たり前なことだけど、これが分かったとたんに僕の周りのピースが一気に繋がったので、恥をしのんで書く。 僕は以下のように脳内変換していて Haskell a = 1 iszero i = if (i == 0) then True else False Javascript a = function() { return 1 } iszero = function(i) { return i()/*評価は関数呼出し*/ == 0 ? True : False } // True False はこう True = function() { return true } False = function() { return false
行数を数えているのですが、コメント欄他のstr.split(/\n/).lengthはかっこいいけどoverkill 404 Blog Not Found:javascript - String.prototype.tr() released 本当でしょうか? 実際に試してみましょう。変数 s が対象文字列を指しているものとします。 // charAt var lines = 1; for (var i = 0, n = s.length; i < n; i++) if (s.charAt(i) == "\n") lines++; // Array var lines = 1; var chars = s.split(""); for (var i = 0, n = chars.length; i < n; i++) if (chars[i] == "\n") lines++; // sp
TinySegmenterはJavascriptだけ書かれた極めてコンパクトな日本語分かち書きソフトウェアです。 わずか25kバイトのソースコードで、日本語の新聞記事であれば文字単位で95%程度の精度で分かち書きが行えます。 Yahoo!の形態素解析のように サーバーサイドで解析するのではなく、全てクライアントサイドで解析を行うため、セキュリティの 観点から見ても安全です。分かち書きの単位はMeCab + ipadicと互換性があります。 デモ 日本語の文章を入力し、解析ボタンをクリックしてください。 ダウンロード TinySegmenterはフリーソフトウェアです. 修正BSDライセンスに従って本ソフトウェアを使用,再配布することができます. Download TinySegmenter version 0.2 使い方 <script type="text/javascript" src
Kanasan.JS JavaScript 第 5 版読書会 #5 に行ってきました (当日のチャットログ、参加者のブログ記事一覧)。今回からはいよいよ第 2 部、クライアントサイドスクリプトということで、13 章全体を読みました。 控えめな JavaScript JavaScript をどのように使うかの指針として、「控えめな JavaScript (unobtrusive JavaScript)」(WaSP DOM Scripting Task Force の声明文) というキーワードが挙げられています。 HTML マークアップと JavaScript コードを分離する。 正常に機能を停止する。ブラウザがある機能を持たない、もしくは JavaScript 自体が動作しない場合であっても、コンテンツが利用可能であるようにする。 アクセシビリティを低下させるのではなく、向上させる。 これは
1.7になったので,久々の続編。 for(i=0,s="string to iterate";c=s[i++];)print(c) /* ↓ */ for(i in s="string to iterate")print(c=s[i]) // IE・Rhinoでは不可能な操作(なので盲点だった)。 // SpiderMonkey専用? (4) /* ↓ */ for([i,c]in"string to iterate")print(c) // 1.8では使えなくなるらしいので今のうち。(9) for([,c]in"string to iterate")print(c) // 分割代入の左辺は省略も可能。for eachは用無し。(10) r=[];for(k in d)r.push(k) /* ↓ */ r=[i=0];for(r[i++]in d); // 「JavaScript第五版
Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at
Notes No data is sent to the server (i.e. everything is done in JavaScript). Conversion from Unicode to other encodings such as Shift_JIS can be slow first time as it needs to initialize internal conversion tables. Surrogate pairs in UTF-16 are supported. Try inserting \uD840\uDC0B in the second form. Three-byte characters in EUC-JP are not supported. Links JavaScript Unicode Charts Try GNU Libidn
XPathの習作。あるページのパラグラフのループを見つけてXPath式で取得するための支援ツール。 http://ldride.googlecode.com/svn/trunk/readme.html ブックマークレットで起動してるので、IEでもSafari2でも動きます。XPath評価には id:amachangのこれつかってます。 ナビゲーションとしては、最初に親となるコンテナエレメントを指定して、その後パラグラフに相当する場所をクリックしてxpathを取得する感じ。 名前はAutoPagerize IDEにちなんで、LDRize IDEに。でもLDRizeはあまり使ったことなかったりして、どれほどほんとに使えるのか分かりませんが。今のところlinkのところは自分で書く必要あり。 ユーザ支援じゃなくて、自動化してる試みは結構あるみたいなんで、そっちの方もおもしろそう。 http://l
JavaScript(thanks to id:koyachi / del.icio.us/rtk2106) 最終更新 2008/1/21以下は、JavaScriptのLisp/Schemeインタープリタ実装のリンクです。 GoldenScheme - Scheme on JavaScriptGreenbear Laboratory - BiwaSchemenew function(){this.id=’gnarl’} - 言語開発合宿での成果物:jsでScheme言語ゲーム - 俺様言語 Lazy を作る。CodeZine:JavaScriptでつくるSchemeインタプリタの基礎の基礎(lisp)The Little JavaScripterScheme in JavascriptJoe Ganley’s Lisp in JavaScriptCryptopunk - A Lisp to
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く