Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Prototyping 3 — Data
Search
Florian Plank
June 12, 2012
Programming
190
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Prototyping 3 — Data
Brief overview over YAML and how to use it within a prototype for I18n and other purposes.
Florian Plank
June 12, 2012
More Decks by Florian Plank
See All by Florian Plank
Ready, set, immersion!
polarblau
0
220
Prototyping all the things
polarblau
2
200
CoffeeScript vs. ECMAScript 6
polarblau
5
3.7k
Design for a complex Reality — Siili Breakfast Edition
polarblau
0
180
Enabling Design for a Complex Reality
polarblau
2
160
A primer on Content Security Policy
polarblau
1
480
Rails and the future of the open web
polarblau
3
150
Brief Ruby/Ruby on Rails intro
polarblau
3
210
Ruby Idioms
polarblau
3
620
Other Decks in Programming
See All in Programming
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
630
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.8k
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
270
MySQLとPostgreSQLって何が違うの?
akagami
0
150
T3DD26: From RAGs to Riches
martinhelmich
0
130
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
250
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
240
まだ間に合う!今年の夏こそSchemeのマクロ展開器を完全理解!
omasanori
0
590
プロポーザルを書いてもらう
pvcresin
0
590
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
570
Introducing Stack Pull Request in GitHub
kkamegawa
0
120
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.6k
Featured
See All Featured
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
310
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
A designer walks into a library…
pauljervisheath
211
24k
How GitHub (no longer) Works
holman
316
150k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Ruling the World: When Life Gets Gamed
codingconduct
0
310
Test your architecture with Archunit
thirion
2
2.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The SEO Collaboration Effect
kristinabergwall1
1
540
Transcript
Prototyping in the browser
III / Data
CONTENT
XML
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
“XML is like violence. — If it hasn’t solved your
problem, you’re not using enough of it.”
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
<?xml version="1.0" encoding="UTF-8" ?> <books> <book id="1"> <title>Pride and Prejudice</title>
<author>Jane Austen</author> </book> <book id="2"> <title>Brave New World</title> <author>Aldous Huxley</author> </book> </books>
<?xml version="1.0" encoding="UTF-8" ?><books><book id="1"><title>Pride and Prejudice</title><author>Jane Austen</author></book><book id="2"><title>Brave New
World</title><author>Aldous Huxley</author></book></ books>
Length? => 216 Content length? => 60 Markup / Content
ratio? => 2.6:1
JSON
{ "books": { "book": [ { "id": 1, "title ":
" Pride and Prejudice", "author ": " Jane Austen" }, { "id": 2, "title": "Brave New World", "author": "Aldous Huxley" } ] } }
{ "books": { "book": [ { "id": 1, "title ":
"Pride and Prejudice", "author ": "Jane Austen" }, { "id": 2, "title": "Brave New World", "author": "Aldous Huxley" } ] } }
Length? => 148 Content length? => 60 Markup / Content
ratio? => 1.5:1
YAML
YAML Ain’t Markup Language* * recursive acronym
--- books: - id: 1 title: Pride and Prejudice author:
Jane Austen - id: 2 title: Brave New World author: Aldous Huxley
--- books: - id: 1 title: Pride and Prejudice author:
Jane Austen - id: 2 title: Brave New World author: Aldous Huxley
Length? => 139 (including whitespace and header) Content length? =>
60 Markup / Content ratio? => 1.3:1
I18n / serve
require File.join(File.dirname(__FILE__), 'lib', 'nested_ostruct')
require 'active_support/inflector' I18n.load_path = Dir['locale/**/*.yml'] I18n.reload!
module ViewHelpers # … def list(key, &block) data = t(key).clone
rescue {} raise data if data =~ /translation missing/ data = NestedOstruct.import(data) raise data unless data.is_a? Array data.each {|i| yield i } end def t(key, args={}) I18n.t(key, args) end end
--- en: foo: bar: Bat
#container %h2= t 'foo.bar'
--- books: - id: 1 title: Pride and Prejudice author:
Jane Austen - id: 2 title: Brave New World author: Aldous Huxley
#container %ul - list 'books' do |book| %li %strong= book.title
= "(#{book.author})"
<ul> <li> <strong>Pride and Prejudice</strong> (Jane Austen) </li> <li> <strong>Brave
New World</strong> (Aldous Huxley) </li> </ul>
PROTOTYPES