You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
![json.vim](https://cdn-ak-scissors.b.st-hatena.com/image/square/1ef26f6cb4349557952890dbe3e567f7f98dc151/height=288;version=1;width=512/https%3A%2F%2Fgithub.githubassets.com%2Fassets%2Fgist-og-image-54fd7dc0713e.png)
jQueryのgetJSON()ではJSONの解析がwindow.eval()で行なわれてしまいますが、プラグインとして別途提供されているjquery-jsonを使うとJSONを安全に解析できます。 プラグインをインポートすると、「$.evalJSON」と「$.secureEvalJSON」の2つのJSON解析APIが追加されます。 「$.evalJSON」は安全性チェックなしに「window.eval()」してJSONを解析します。 「$.secureEvalJSON」は安全性を事前にチェックしてから「window.eval()」します。 チェックでエラーになった場合は、例外をスローします。 なお、どちらの関数も「JSON.parse」が使用可能であればそちらを優先して使用します。 なのでFireFox3だとどちらの関数を使っても安全な解析が可能だったりします。 以下は各解析メソッドで普
Why JSON Schema?While JSON is probably the most popular format for exchanging data, JSON Schema is the vocabulary that enables JSON data consistency, validity, and interoperability at scale. Streamline testing and validationSimplify your validation logic to reduce your code’s complexity and save time on development. Define constraints for your data structures to catch and prevent errors, inconsist
End of line: JSON needs no concept of an end-of-line, but JavaScript does, if nothing more so that comments may be parsed correctly. However some JSON modules may also wish to detect end-of-lines for help in creating error messages with line numbers. In JavaScript the following sequences of whitespace characters are to be treated as end-of-line indicators (the longest match occurs first): U+000A U
僕自身も僕の周辺もJSONをよく使います。でも、細かい点でけっこうミスをやらかしています(苦笑)。このエントリーで、JSONを使う上で注意すべきこと/間違いやすい点をすべて列挙します。 内容 兼チェックリスト: 仕様原典さえ読めば完璧(のはずだが) 数値の前にゼロを付けてはいけない 16進数表記も禁止だよ 数値の前にプラスを付けてはいけない 小数点からはじまる数値はダメ 用語法が違うよ:プロパティとメンバー メンバー名には常に文字列を使う 空文字列""もメンバー名に使える 配列要素はキッチリと並べよう 文字列を囲むには二重引用符だけ 文字列内のエスケープが微妙に違う 仕様にないエスケープは構文エラー undefinedもNaNもありません ラッパーオブジェクトは使わないのが吉 型システムとtypeofに関する注意 最後に 仕様原典さえ読めば完璧(のはずだが) JSONは、小さくて簡単な仕様
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
先日から数年振りにC言語でコーディングしている。 その前はrailsだったのでコードを書く量が多くて、面倒な上、このうえなし。 それにしても、ポインタ使うの久しぶりだわ。 そんな事はどうでもいいとして。 その作成中のソフトで、外部から設定ファイルを読み込む仕様があったので、拡張性等も考慮しjson形式で定義することにした。 jsonを扱えるC言語ライブラリは、いくつかあるのだが、今回はJSON-Cをチョイス。 だが、JSON-Cのサンプルコードがググってもなかなか無い(他のライブラリでも似たようなものだが) それはそれ、こことか参考にしながら、とりあえずjsonフォーマットが自由自在にパースできるところまできた。 これで何とかなりそう。 ついでにテストで作ったコードを晒してみる。 こんな情報を知りたがる人がいるかどうか不明だが、ないよりは良いだろうということで。 あ、そう
From: Karl Dubost <karl@w3.org> Date: Mon, 14 Jul 2008 12:29:51 +0900 To: david@allsopmedia.com, Olivier Théreaux <ot@w3.org> Cc: "public-qa-dev@w3.org list" <public-qa-dev@w3.org>, Henri Sivonen <hsivonen@iki.fi> Message-Id: <3982968C-B28D-4EFF-BD6F-947936FFFF0A@w3.org> Hi, this morning around 11:20am (Japan Time), I had a discussion with David about JSON output for markup validator on IRC (#w3c/
ウレタン系高反発マットレスでよく言及されるのが密度です。それを頑張って分かりやすく説明してみます。
Back in March/April of this year there was a lot of hub-bub concerning the discovery of a JSON data leak, or sorts. What it boils down to is “JavaScript is incredibly flexible, even to the degree of letting you redefine basic objects, like Array or Object itself.” For example, here’s an exploit that works in Firefox 2, Opera 9, and Safari 3. It goes about redefining the global Array object then ma
最近perlの勉強してて、naoyaのはてなダイアリー - Web::ScraperでWeb::Scraperを知り、試しにはてブのAPIを真似してニフティクリップのコメントを吐くJSONを作った。 #!/usr/local/bin/perl -T # # use strict; use warnings; use URI; use Web::Scraper; use JSON::XS; use CGI; use Encode; my $q = new CGI; print $q->header( -type=>'text/plain', -charset=>'UTF-8'); my $path_info = $q->path_info; my $path = $path_info =~ m{^/?(nobracket/)?(http\w?)://?(.*)$}xms ? $2.'://'
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く