-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.html.erb
225 lines (198 loc) · 10 KB
/
index.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html lang="<%= lang %>">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="MessagePack,msgpack,JSON,alternative,better json,faster json,serializer">
<link href='favicon.ico' rel='icon' type='image/x-icon'>
<link rel="alternate" hreflang="en" href="index.html">
<% (langs - ['en']).each do |alt| %> <link rel="alternate" hreflang="<%= alt %>" href="<%= alt %>.html">
<% end %>
<title><%= t 'title' %></title>
<link media="all" rel="stylesheet" href="css/yuibase.css">
<link media="all" rel="stylesheet" href="js/prettify/prettify.css">
<link media="all" rel="stylesheet" href="css/all.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web:400,200">
<script src="js/all.js"></script>
<script src="js/prettify/prettify.js"></script>
<script src="js/prettify/run_prettify.js"></script>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery.leanModal.min.js" ></script>
<script src="js/msgpack.js" ></script>
<style>
<%= t 'css' %>
</style>
<script type="text/javascript">
// select initially-selected quick start randomly
$(function(){
var index = Math.floor(Math.random()*(document.getElementsByClassName('qs').length-1));
changeQuickStart(document.getElementsByClassName('qs')[index].id,document.getElementsByClassName('qs-a')[index])}
);
$(function() {
$('pre > code').addClass('prettyprint');
prettyPrint();
});
$(function() {
$('a[rel*=leanModal]').leanModal({
top: 100,
overlay : 0.5,
closeButton: ".modal_close"
});
$(document).keydown(function(e) {
if (e.keyCode == 27) {
$('#lean_overlay').fadeOut(200);
$('#json-to-msgpack').css({'display':'none'});
}
});
});
</script>
<script type="text/javascript">
$(function() {
$("#json-text").keyup(function(event) {
var text = $("#json-text").val();
var obj;
try {
obj = JSON.parse(text);
} catch (e) {
return;
}
var msg = msgpack.pack(obj);
var hex = jQuery.map(msg, function(e,i) {
return ("0" + e.toString(16)).slice(-2);
}).join(" ");
$("#msgpack-text").text(hex);
var textLength = encodeURIComponent(text).replace(/%../g,"%").length;
$("#json-bytes").text(textLength.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + " bytes");
$("#msgpack-bytes").text(msg.length.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + " bytes");
$("#msgpack-percent").text(Math.round(msg.length / textLength * 100).toString() + " %");
}).keyup();
$("#msgpack-text").keyup(function(event) {
var hex = $("#msgpack-text").val().replace(/ +/g,'');
var msgbytes = [];
for(var i=0; i< hex.length-1; i+=2){
msgbytes.push(parseInt(hex.substr(i, 2), 16));
}
var msg = String.fromCharCode.apply(String, msgbytes);
var obj=msgpack.unpack(msg);
var text=JSON.stringify(obj);
$("#json-text").text(text);
var textLength = encodeURIComponent(text).replace(/%../g,"%").length;
$("#json-bytes").text(textLength.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + " bytes");
$("#msgpack-bytes").text(msg.length.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + " bytes");
$("#msgpack-percent").text(Math.round(msg.length / textLength * 100).toString() + " %");
});
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-17125377-1', 'auto', {'allowLinker': true});
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
</head>
<body>
<header>
<div>
<h1><a href="/">MessagePack</a></h1>
<nav id="topnav">
<ul>
<li><a rel="leanModal" href="#json-to-msgpack" class="i18n_nav"><%= t 'nav_try' %></a></li>
<li><a href="https://github.com/msgpack/msgpack/blob/master/spec.md" class="i18n_nav"><%= t 'nav_spec' %></a></li>
<li><a href="https://twitter.com/search/MessagePack%20OR%20msgpack" class="i18n_nav"><%= t 'nav_tag' %></a></li>
</ul>
</nav>
</div>
</header>
<main>
<section id="introduction">
<div id="description">
<h2 class="i18n"><%= t 'h2_html' %></h2>
<p class="i18n"><%= t 'desc_html' %></p>
</div>
<div id="next">
<h3 class="i18n_head i18n_next"><%= t 'next_head' %></h3>
<p class="i18n"><%= t 'next_body_html' %></p>
</div>
</section>
<%= '<!--' if lang != 'en' %>
<section id="usecases">
<div id="testimonials">
<div class="tmset">
<div class="tm">
<a class="tmlogo" href="https://redis.io/"><img src="images/redis.png" alt="Redis" width="150" height="50" /></a>
<p class="tmtext">Redis scripting has support for MessagePack because it is a fast and compact serialization format with a simple to implement specification. I liked it so much that I implemented a MessagePack C extension for Lua just to include it into Redis.</p>
<p class="tmauthor">Salvatore Sanfilippo, creator of Redis</p>
</div>
<div class="tm">
<a class="tmlogo" href="https://fluentd.org/" style="height:100px;margin-top:-35px;"><img src="images/fluentd.png" alt="Fluentd" width="245" height="85" /></a>
<p class="tmtext">Fluentd uses MessagePack for all internal data representation. It's crazy fast because of zero-copy optimization of msgpack-ruby. Now MessagePack is an essential component of Fluentd to achieve high performance and flexibility at the same time.</p>
<p class="tmauthor">Sadayuki Furuhashi, creator of Fluentd</p>
</div>
</div>
<div class="tmset">
<div class="tm">
<a class="tmlogo" href="https://www.treasuredata.com/"><img src="images/treasuredata.png" alt="Treasure Data" width="242" height="52" /></a>
<p class="tmtext">Treasure Data built a multi-tenant database optimized for analytical queries using MessagePack. The schemaless database is growing by billions of records every month. We also use MessagePack as a glue between components. Actually we just wanted a fast replacement of JSON, and MessagePack is simply useful.</p>
<p class="tmauthor">Kazuki Ohta, CTO</p>
</div>
<div class="tm">
<a class="tmlogo" href="https://www.pinterest.com/pinterest/"><img src="images/pinterest.png" alt="Pinterest" width="197" height="50" /></a>
<p class="tmtext">MessagePack has been simply invaluable to us. We use MessagePack + Memcache to cache many of our feeds on Pinterest. These feeds are compressed and very quick to unpack thanks to MessagePack while Memcache gives us fast atomic pushes.</p>
<p class="tmauthor">Marty Weiner, Software Engineer</p>
<p class="tmcontribute">Also use MessagePack? <a href="https://github.com/msgpack/website">Waiting for your testimonial!</a></p>
</div>
</div>
</div>
<div id="twitter">
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/search?q=msgpack+OR+MessagePack+lang%3Aen" data-widget-id="343624208380735490" width="350" height="500">Tweets about "msgpack OR MessagePack"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</section>
<%= '-->' if lang != 'en' %>
<section id="usage">
<div id="languages">
<h3 class="i18n_head"><%= t 'languages' %></h3>
<ul class="qslist">
<% repos.each do |repo| %>
<li><a class="qs-a" onclick="changeQuickStart('qs-<%= repo[:msgpack_repo_id] %>',this)"><%= repo[:msgpack_lang] %> <span class="qs-sub"><%= repo[:full_name].split('/').first %></span></a></li>
<% end %>
</ul>
</div>
<div id="api">
<h3 class="i18n_head"><%= t 'api' %></h3>
<h4 id="language"> </h4>
<div id="quickstart" class="qsholder"></div>
<p id="quickstart-guide"><a href="https://github.com/msgpack/website/blob/master/README.md#how-to-list-up-your-project-on-msgpackorg"><%= t 'list_your_impl' %></a></p>
<% repos.each_with_index do |repo,i| %>
<div id="qs-<%= repo[:msgpack_repo_id] %>" class="qs"><h4><a href="<%= repo[:msgpack_repo_homepage] %>" target="_blank"><%= repo[:full_name] %> <span class="qs-url"><%= repo[:msgpack_repo_homepage] %></span></a></h4>
<%= repo[:msgpack_quickstart_html] %>
</div>
<% end %>
</div>
</section>
<section id="related">
<h3><%= t 'related_projects' %></h3>
<div class="paragraphs">
<h4><a href="https://github.com/dotcloud/zerorpc-python">ZeroRPC</a> by DotCloud</h4>
<p>zerorpc is a flexible RPC implementation based on zeromq and messagepack. Service APIs exposed with zerorpc are called "zeroservices".</p>
<h4><a href="https://github.com/pfi/pficommon">pficommon</a> by Preferred Infrastructure, Inc.</h4>
<p>General purpose C++ library for Preferred Infrastructure, Inc. It includes MessagePack-RPC implementation for C++</p>
</div>
</section>
<div id="json-to-msgpack">
<h3>JSON <span class="bytes" id="json-bytes"></span></h3>
<textarea type="text" id="json-text">{"compact":true,"schema":0}</textarea>
<h3>MessagePack (hex) <span class="bytes" id="msgpack-bytes"></span> <span class="bytes" id="msgpack-percent"></span></h3>
<textarea readonly id="msgpack-text"></textarea>
</div>
</main>
<footer>
<div>
<div id="thanks">
<p>MessagePack ™ Copyright © 2008-2021 Sadayuki Furuhashi</p>
</div>
</div>
</footer>
</body>