Skip to content

Instantly share code, notes, and snippets.

@oimou
oimou / jsdoit.js
Created November 5, 2012 11:50
Klib.js
/**
* @fileOverview Library that expands prototype to help to write readable code.
*
* @author Keiji Yahata
* @version 1.0.0
*/
/**
* Check that a string includes a query string.
*
@oimou
oimou / install-zencoding-vim.rb
Created December 10, 2012 11:18
Batch file to install zencoding-vim.
#!/usr/bin/ruby
$dirName = "work"
def do_install_zencodingvim
puts "Start vim-zencoding install."
while File.exists?($dirName)
$dirName = "work" + rand(10000).to_s
end
# fib(20)
# 1 worker
-n 100000 -c 10000
Reply rate [replies/s]: min 2117.6 avg 2172.2 max 2226.8 stddev 77.2 (2 samples)
Reply time [ms]: response 61.8 transfer 0.0
Reply size [B]: header 71.0 content 12.0 footer 2.0 (total 85.0)
Reply status: 1xx=0 2xx=22319 3xx=0 4xx=0 5xx=0
-n 100000 -c 20000
# fib(30)
# 4 cores
server.js
-n 100000 -c 10000
Reply rate [replies/s]: min 9995.9 avg 9999.2 max 10002.4 stddev 4.6 (2 samples)
Reply time [ms]: response 1.7 transfer 0.0
Reply size [B]: header 283.0 content 124.0 footer 0.0 (total 407.0)
Reply status: 1xx=0 2xx=99996 3xx=0 4xx=0 5xx=0
-n 100000 -c 20000
@oimou
oimou / random sampling
Created January 25, 2013 18:13
Random sampling and Calculation of avg, var, and sd.
function sampling(COLLECTION_NAME, N_SAMPLE){
var people = db[COLLECTION_NAME].find().toArray();
var len = people.length;
var LABEL = db.res_tmp.find().count() + 1;
/**
* Random sampling
*/
for (var i=0; i<N_SAMPLE; i++){
window.onload = function(){
/**
* Settings for graph
*/
var width = 500
var height = 500
var svg = d3.select("#graph-matrix")
.attr("width", width)
.attr("height", height)
.append("g")
package com.oimou.hybrid;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
@oimou
oimou / jsdoit.css
Created February 13, 2013 09:45
2013-02-13 1st
* {
margin: 0;
padding: 0;
border: 0;
}
body {
background: #ddf;
font: 30px sans-serif;
}
#include <node.h>
#include <v8.h>
#include <iostream>
class Logger : node::ObjectWrap {
public:
static void init (v8::Handle<v8::Object> target);
private:
Logger () {};
// ...
watch: {
js: {
files: ["assets/js/*.js"],
tasks: ["before:jshint", "jshint", "after:jshint", "copy"]
},
// ...