Skip to content

Instantly share code, notes, and snippets.

View hideki's full-sized avatar

Hideki Itakura hideki

View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import MeCab
m = MeCab.Tagger("-Ochasen")
print m.parse("今日は初めてGrouponでクーポンを買った。")
JAVA_BASE=/System/Library/Frameworks/JavaVM.framework/Versions/1.6
JAVA_HOME=$(JAVA_BASE)/Home
TARGET=MeCab
JAVAC=$(JAVA_HOME)/bin/javac -encoding utf-8
JAVA=$(JAVA_HOME)/bin/java -Dfile.encoding=utf-8
JAR=$(JAVA_HOME)/bin/jar
CXX=g++
INCLUDE=$(JAVA_BASE)/Headers
PACKAGE=org/chasen/mecab
#!/usr/bin/env python
# -*- coding: utf-8 -*-
str = "FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmea
@hideki
hideki / test-http-curl-chunk-problem.js
Created January 24, 2011 02:29
Customized nodejs test file: Use md5sum instead of shasum
We couldn’t find that file to show.
@hideki
hideki / pow.js
Created April 26, 2011 08:34
simple power function demo using Node on cloudfoundry.com
var http = require('http');
var url = require('url');
var host = process.env.VCAP_APP_HOST || 'localhost';
var port = process.env.VCAP_APP_PORT || 3000;
var pow = function(x, n) {
if(n < 0){
return 0;
}
@hideki
hideki / post.py
Created April 30, 2012 01:53
AppEngine DataStore Model which is disabled index
class Post(db.Model):
id = db.StringProperty(required=True, indexed=False)
from_name = db.StringProperty(required=True, indexed=False)
from_id = db.StringProperty(required=True, indexed=False)
message = db.TextProperty(required=False, indexed=False)
type = db.StringProperty(required=False, indexed=False)
created_time = db.StringProperty(required=False, indexed=False)
@hideki
hideki / Issue330Test
Created January 16, 2015 00:01
Sample code how to set custom SSLSocketFactory for Couchbase Lite Android/Java
package com.couchbase.lite;
import android.net.SSLCertificateSocketFactory;
import android.os.Build;
import android.test.AndroidTestCase;
import android.util.Log;
import com.couchbase.lite.android.AndroidContext;
import com.couchbase.lite.replicator.Replication;
import com.couchbase.lite.support.CouchbaseLiteHttpClientFactory;
package com.couchbase.lite.test;
import java.net.URL;
import java.util.List;
import java.util.Set;
import com.couchbase.lite.Database;
import com.couchbase.lite.DocumentChange;
import com.couchbase.lite.JavaContext;
import com.couchbase.lite.Manager;
@hideki
hideki / gist:d0c5ebe01f8880131f66
Created March 20, 2015 00:20
testGoOffline() failure Log
3-19 20:14:27.769 1329-1360/? D/Batcher﹕ com.couchbase.lite.support.Batcher@b1e87fd0: /waitForPendingFutures
03-19 20:14:27.769 1329-1360/? W/Sync﹕ [fireTrigger()] => WAITING_FOR_CHANGES
03-19 20:14:27.769 1329-1360/? E/Sync﹕ PullerInternal stopGraceful.run() finished
03-19 20:14:27.779 1329-1347/? D/Sync﹕ firing trigger: WAITING_FOR_CHANGES
03-19 20:14:27.779 1329-1347/? I/StateMachine﹕ Firing WAITING_FOR_CHANGES
03-19 20:14:27.779 1329-1347/? V/Sync﹕ [onExit()] IDLE => IDLE
03-19 20:14:27.779 1329-1347/? V/Sync﹕ [onEntry()] IDLE => IDLE
03-19 20:14:32.759 1329-1347/? D/Sync﹕ com.couchbase.lite.replicator.PullerInternal@b1ef1828: saveLastSequence() called. lastSequence: 2 remoteCheckpoint: null
03-19 20:14:32.759 1329-1347/? I/Sync﹕ com.couchbase.lite.replicator.PullerInternal@b1ef1828: start put remote _local document. checkpointID: 1103cab91f0be83bb51e2671b97324671205d0c3 body: {lastSequence=2}
03-19 20:14:32.789 1329-1347/? D/dalvikvm﹕ GC_FOR_ALLOC freed 443K, 16% free 3954K
04-15 20:08:32.446 23041-23041/self.hideki.issue498 E/Issue498﹕ startReplicator() is clicked
04-15 20:08:32.450 23041-23041/self.hideki.issue498 W/Sync﹕ [fireTrigger()] => START
04-15 20:08:32.482 23041-23158/self.hideki.issue498 D/dalvikvm﹕ GC_FOR_ALLOC freed 343K, 11% free 3445K/3836K, paused 2ms, total 2ms
04-15 20:08:32.494 23041-23158/self.hideki.issue498 W/Sync﹕ [fireTrigger()] => RESUME
04-15 20:08:32.498 23041-23158/self.hideki.issue498 E/Issue498﹕ PULL replication event. Source: com.couchbase.lite.replicator.Replication@527feb70 Transition: INITIAL -> RUNNING Total changes: 0 Completed changes: 0
04-15 20:08:32.790 23041-23159/self.hideki.issue498 D/dalvikvm﹕ GC_FOR_ALLOC freed 389K, 11% free 3567K/4004K, paused 1ms, total 2ms
04-15 20:08:32.954 23041-23159/self.hideki.issue498 W/Sync﹕ com.couchbase.lite.replicator.PullerInternal@527fb274: starting ChangeTracker with since=null mode=OneShot
04-15 20:08:32.954 23041-23159/self.hideki.issue498 W/Sync﹕ com.couchbase.lite.replicator.PullerInterna