Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
改行区切りのJSON
Search
circled9
October 14, 2017
Technology
1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
改行区切りのJSON
JSON日の金曜日@新潟 9週目で発表した資料です。
circled9
October 14, 2017
More Decks by circled9
See All by circled9
キースイッチ入門
circled9
0
120
CloudflareのAI関連の機能さわってみた
circled9
0
990
0.0.0.0 day
circled9
0
150
小数の丸め誤差の話
circled9
0
160
数値の文字列をパースしよう
circled9
0
290
🔥 Hono v4 やってみた
circled9
1
250
JetBrains AI Assistant を試してみた
circled9
1
610
Fresh
circled9
0
280
React Hooks 勉強会 vol.3
circled9
2
470
Other Decks in Technology
See All in Technology
地方移住と都心キャリアの両立は「金・時間・人」のリソースをフル活用すれば実現できる!〜Snowflake女子会 vol.8
snowwmn0824
0
110
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
1.1k
Making AI Agents Safe and Fast- Jev, Obsidian, and the Meta-Harness
x5gtrn
PRO
0
140
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
2.4k
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
1
310
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
11
5.2k
おい、エージェントを使って終わらせろ
nwiizo
3
900
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
cscengineer
PRO
0
320
C#未経験の僕がAIに読めるコードを書かせるまで
maguroalternative
0
260
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.7k
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
1
210
What the customer really needed
kawaguti
PRO
3
220
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
2k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
A Tale of Four Properties
chriscoyier
163
24k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
How to make the Groovebox
asonas
2
2.5k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
Optimising Largest Contentful Paint
csswizardry
37
4k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Transcript
վߦ۠ΓͷJSON @circled9 2017-10-13 #friday13json
ࣗݾհ.json { "name": "Matsui Masashi", "twitter": ["@circled9", "@ma_2_i"], "language": ["javascript",
"ruby"], }
Agenda • ͡Ίʹ • େମڞ௨ͯ͠Δ͜ͱ • ֤ϑΥʔϚοτͷհ • ·ͱΊ
͡Ίʹ
վߦ۠ΓͷJSON • վߦΛ۠Γจࣈͱͯ͠ѻ͏ϑΥʔϚοτ • ֤ߦvalidͳJSONͷ͕ॻ͔Ε͍ͯΔ • վߦ͠ͳ͍ͷͰɺՄಡੑ͋·Γॏࢹ͍ͯ͠ ͳ͍
վߦ۠ΓͷJSONͷαϯϓϧ {"some":"thing"} {"foo":17,"bar":false,"quux":true} {"may":{"include":"nested","objects":["and","arrays"]}}
ͳͥվߦͰ۠Δͷ͔ • JSONΛύʔε͢ΔʹɺϑΝΠϧͷ࠷ޙ·Ͱ ಡΈࠐ·ͳ͍ͱ͍͚ͳ͍ • վߦจࣈͰ۠Δ͜ͱʹΑͬͯɺϑΝΠϧΛ ෦తʹύʔεͰ͖ΔΑ͏ʹͳΔ
ϝϦοτ • ฒߦॲཧͰͷಡΈॻ͖͕͘͢͠ͳΔ • ֤ߦࠓ·ͰͷJSONͱมΘΒͳ͍ͷͰɺطଘ ͷࢿ࢈͕ੜ͔͍͢͠ • CSV/TSVͱൺֱ͢Δͱɺ֤ߦ͕දݱͰ͖Δ ༰͕ॊೈʹͳΔ
େମڞ௨ͯ͠Δ͜ͱ
ڞ௨͢Δܾ·Γ͝ͱ • ۠Γจࣈվߦจࣈ • ֤ߦվߦΛؚ·ͳ͍validͳJSONͷ • ΤϯίʔσΟϯάUTF-8
վߦจࣈ • LF (\n) ʹ͓͚ͯ͠ແ • CR+LF (\r\n) Ͱͳ͍ •
CR (\r) ͩͱ·͍ͣ͜ͱ͕͋Γͦ͏ • Mac OS 9ͳΜͯී௨ͬͯ·ͤΜͶ
վߦจࣈ • CRΛ۠Γจࣈͱͯ͠ѻ͏͔ɺ֤ϑΥʔϚο τʹΑͬͯҟͳΔ • ͔͠͠ɺҎԼͷཧ༝͔ΒCR+LFͰ࣮࣭ͳ͍ • ۭߦແࢹ͢Δͷ͕௨ྫ • JSONͷύʔε࣌ʹۭനจࣈআڈ͞ΕΔ
֤ϑΥʔϚοτͷհ
֤ϑΥʔϚοτͷհ • NDJSON • LDJSON • JSON Lines • NDJ
NDJSON • MediaType application/x-ndjson • ֦ுࢠ .ndjson • CRվߦͱͯ͠ݟͳ͢
LDJSON • NDJSONͷաڈͷݺͼ໊ • MediaType application/x-ldjson • ֦ுࢠ .ldjson
JSON Lines • MediaType ಛʹݴٴͳ͠ • ֦ுࢠ .jsonl • ѹॖͯ͠
.jsonl.gz .jsonl.bz2 ͱͯ͠৴ ͢Δ͜ͱਪͯ͠Δ • CRվߦͱͯ͠ݟͳ͞ͳ͍
NDJ • MediaType ಛʹݴٴͳ͠ • ֦ுࢠ .ndj • ࠷ॳͷ1ߦʹ //
Ͱίϝϯτ͕ॻ͚Δ • CRվߦͱͯ͠ݟͳ͞ͳ͍
·ͱΊ
·ͱΊ • վߦ۠ΓͷJSONͩͱฒߦॲཧͱ͔͕ḿΔ • վߦ۠ΓͷJSON͍͔ͭ͘ϑΥʔϚοτ͕ ͋Δ • ॻ͖ํͷ༷େମಉ͡
[EOF]
ࢀߟURL • NDJSON • http://specs.okfnlabs.org/ndjson/ • LDJSON • https://github.com/ndjson/ndjson-spec/commit/ c658c26ba15bea718228b5a3d54f0d4db22ec0ba
• JSON Lines • http://jsonlines.org/ • NDJ • http://jimbojw.com/t/index.php?title=Newline_delimited_JSON