Skip to content

Instantly share code, notes, and snippets.

View kuenishi's full-sized avatar
🎴

UENISHI Kota kuenishi

🎴
View GitHub Profile
@wtokuno
wtokuno / jackson.md
Created March 7, 2012 21:07
Jackson - JSON Processor

下書き

Jacksonとは

JacsonはJSON(JavaScript Object Notation)と呼ばれるデータ記述言語を扱うためのJavaライブラリ。

ウェブアプリケーション開発ではJSONが必須の技術になってきている。 JavaでJSONを扱うためのAPIがJava EE 7に含まれる予定。JSR 343として仕様策定中。

function declitimg(img) {
var cv = document.createElement('canvas');
cv.width = img.width;
cv.height = img.height;
var ctx = cv.getContext('2d');
ctx.drawImage(img, 0, 0);
var imd = ctx.getImageData(0, 0, img.width, img.height);
var s = '';
for (var i = 0; i < imd.data.length && imd.data[i] !== 0;) {
var c1 = imd.data[i++];
@shimizukawa
shimizukawa / buildout.cfg
Created December 14, 2011 11:07
sphinx japanese patch ver
[buildout]
parts = app docutils
extensions = gp.vcsdevelop
vcs-extend-develop = hg+http://bitbucket.org/uchida/sphinx/@tip#egg=sphinx
vcs-update = true
[app]
recipe = z3c.recipe.scripts
eggs =
@eiichiroi
eiichiroi / fluent_logging_glog.cpp
Created October 30, 2011 12:00
Fluent Logger for glog
#include <iostream>
#include <sstream>
#include <string>
#include <ctime>
#include <glog/logging.h>
#include <msgpack.hpp>
#include <pficommon/text/json.h>
#include <pficommon/network/socket.h>
tagged branch
defined#milestone#2011automn
taichi#task#001
closed#task#002
defined#ticket#003
ブランチ名にメタデータを含んだ状態にする。
単に名前付けするよりも長くなる傾向にあるとは思うものの、DB無しで状態管理出来るし、
既存のGitクライアントからでも状態変更出来る。
@micrypt
micrypt / gist:1048924
Created June 27, 2011 14:10
Riak Quick Start from GitHub
# Install Erlang
$ sudo apt-get install autoconf
$ curl -O https://raw.github.com/dreverri/kerl/master/kerl; chmod a+x kerl
$ ./kerl build R14B03 r14b03
$ ./kerl install r14b03 /opt/erlang/r14b03
$ . ~/.kerl/installs/r14b03/activate
# Build Riak from source
$ git clone git://github.com/basho/riak.git
$ cd riak
@moriyoshi
moriyoshi / test.cpp
Created March 10, 2011 09:11
Recursively traverse directories.
#include <boost/filesystem/convenience.hpp>
#include <boost/foreach.hpp>
#include <boost/range.hpp>
#include <iostream>
int main(int, char**)
{
namespace bf = boost::filesystem;
BOOST_FOREACH(bf::path path,
boost::make_iterator_range(
@postmodern
postmodern / c_parser.rb
Created January 16, 2011 04:24
An ANSI C Parser using the Ruby Parslet library.
#
# A C Parser using the Parslet library.
#
# ANSI C Grammar:
#
# * http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
# * http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
#
require 'parslet'
let print x =
let tag = Obj.tag x in
if (tag == Obj.string_tag) then
Printf.printf "%s\n" (Obj.obj x)
else if(tag == Obj.int_tag) then
Printf.printf "%d\n" (Obj.obj x)
else if(tag == Obj.double_tag) then
Printf.printf "%f\n" (Obj.obj x)
else
Printf.printf "Unknown Type!\n"