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
Author: みやむこ かつゆき <URL:mailto:miyamuko@gmail.com> Home URL: <URL:http://miyamuko.s56.xrea.com/xyzzy/json-syck/intro.htm> Version: 0.1.1 1 NAME json-syck - syck を利用したそこそこ速い JSON パーサ 2 SYNOPSIS (require "json-syck") (use-package :json-syck) (json-load "{\"title\":\"\\u306f\\u3066\\u306a\\u30b9\\u30bf\\u30fc\\u65e5\\u8a18\", \"uri\":\"http://d.hatena.ne.jp/hatenastar/\", \"star_count\":\"75630\"}") ;
Author: みやむこ かつゆき <URL:mailto:miyamuko@gmail.com> Home URL: <URL:http://miyamuko.s56.xrea.com/xyzzy/json/intro.htm> Version: 0.1.2 1 SYNOPSIS (require "json") (use-package :json) (json-decode "{\"title\":\"\\u306f\\u3066\\u306a\\u30b9\\u30bf\\u30fc\\u65e5\\u8a18\", \"uri\":\"http://d.hatena.ne.jp/hatenastar/\", \"star_count\":\"75630\"}") ;;=> (("title" . "はてなスター日記") ;; ("uri" . "http://d.hatena.n
##### 指定マシンのログをMongoDBからJsonで取り出し ##### # マシン名はクエリーで指定。 # ex: machuneLog.ps1?V3 write-host "Conten-type:application/json" write-host "" # ドライバ読み込み $DRIVER_PATH = "C:\MongoDB\CSharpDriver-1.11.0"; Add-Type -Path "$DRIVER_PATH\MongoDB.Bson.dll"; Add-Type -Path "$DRIVER_PATH\MongoDB.Driver.dll"; # MongoDBの、logsデータベースの、osコレクションに接続 $client = New-Object MongoDB.Driver.MongoClient("mongodb://S2016TP4");
ActiveModel::Serializersとは Railsなどで簡単で素早くjsonを作れるgemです。 ActiveModel::Serializersより、 ActiveModel::Serializers brings convention over configuration to your JSON generation. 実際に試してはないですが、ActiveModelに依存しているだけなのでSinatraなどでも使えるはずです。 なぜActiveModel::Serializersを使うのか 簡単で速いので使ってます。 簡単 Railsではjbuilderを使うことが多いですが、記法が直感的じゃなくて多少憶えにくいかな思ってます。 json.(@message, :content, :author) => {content: 'hello', author: 'kakk
When I first embarked on creating an API for a project, I couldn’t find a ton of resources on how to test it with RSpec, so I decided to write a blog post about it. Let’s say we’re building an app that allows users to list their second bedrooms to short-term guests. We all love Airbnb :) This would be an application with many models that have complex associations, but let’s focus on what a host ca
Ruby JSON parse changes Hash keys ruby 1.9.3p393 json (1.8.0) $ pry [1] pry(main)> require 'json' => true # hashをjsonへ変換 [2] pry(main)> json = {:key_a => "value2", :key_b => "value3"}.to_json => "{\"key_a\":\"value2\",\"key_b\":\"value3\"}" # 普通にparseしてもらうと keyはString [3] pry(main)> p JSON.parse(json) {"key_a"=>"value2", "key_b"=>"value3"} => {"key_a"=>"value2", "key_b"=>"value3"} # optionを指定すると、k
{"id": 1, "nickname": "joker1007", "comments": [{"id": 1, "body": "comment body"}, {"id": 2, "body": "next comment"}] SELECT CONCAT( '{', '"id":',users.id, ',"nickname":',IF(users.nickname, CONCAT('"', users.nickname, '"'), "null"), ',"comments":',CONCAT('[', GROUP_CONCAT((CONCAT('{"id":', comments.id), CONCAT(',"body":"',comments.body,'"}')), ']'), '}' ) AS payload FROM users INNER JOIN comments
PHP初心者のときに混乱したし、未だに初心者が困ってるのをよく見掛ける。 はやわかり ファイル全体をまるごと読み込みたい→ file_get_contents() ファイルの中身をまるごと出力したい→ readfile() 行単位のテキストファイルを配列として読み込みたい→ file() ファイルをバイト単位で読み込みたい→ fopen()+fread() CSVを読み込みたい→ SplFileObjectクラス オブジェクト指向的に操作したい→ SplFileObjectクラス クラウドとかFTPとかにあるファイルを読み込みたい→ League\Flysystemライブラリ バイナリファイルを操作したいとか事情がない限り、feof()とかfclose()とかの出番はない。 file_get_contents() (PHP: file_get_contents - Manualより抜萃、2
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く