Skip to content

Instantly share code, notes, and snippets.

@sh4869
sh4869 / yahoojaparse.rb
Created August 29, 2014 01:26
RubyでYahoo日本語形態解析APIを使って文章中から名詞を取り出すサンプル
require 'net/http'
require 'uri'
require 'rexml/document'
id = 'your appid'
text = '庭には二羽ニワトリがいる'
response = Net::HTTP.post_form(URI.parse('http://jlp.yahooapis.jp/MAService/V1/parse'),
{'appid'=> id,
'sentence' => text,
'results' => 'ma'})
@sh4869
sh4869 / gist:78437f4769fbbe986d5c
Created August 14, 2014 02:24
rbenv install error
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
@sh4869
sh4869 / QtInstallError.txt
Created August 12, 2014 08:02
Qt install error
./qt-opensource-linux-x86-5.3.1.run: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory
@sh4869
sh4869 / ruby-build_error_message.txt
Created August 2, 2014 15:00
ruby-build error message
linking shared-object racc/cparse.so
make[2]: ディレクトリ `/tmp/ruby-build.20140802233653.31888/ruby-2.0.0-p0/ext/racc/cparse' から出ます
make[2]: ディレクトリ `/tmp/ruby-build.20140802233653.31888/ruby-2.0.0-p0/ext/readline' に入ります
compiling readline.c
linking shared-object openssl.so
readline.c: In function ‘Init_readline’:
readline.c:1886:26: error: ‘Function’ undeclared (first use in this function)
rl_pre_input_hook = (Function *)readline_pre_input_hook;
^
readline.c:1886:26: note: each undeclared identifier is reported only once for each function it appears in
@sh4869
sh4869 / errorOfOauth.dart.txt
Created August 1, 2014 02:08
oauth.dart's Error message
Uncaught Error: The null object does not have a method 'expand'.
NoSuchMethodError: method not found: 'expand'
Receiver: null
Arguments: [Closure: (int) => dynamic]
Stack Trace:
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1 oauthEncode (package:oauth/src/core.dart:29:39)
#2 Parameter.Parameter (package:oauth/src/core.dart:73:29)
#3 mapParameters.<anonymous closure> (package:oauth/src/core.dart:108:34)
@sh4869
sh4869 / bf.rb
Last active August 29, 2015 14:04
ジンジャエールハッカーソンでの進捗
#coding:utf-8
class BrainFuck
def set(src)
@mark = 0
@source = src
@point = 0
@mem = Array.new(3000,0)
end
import 'dart:math';
import 'dart:convert';
import 'package:crypto/crypto.dart';
void main(){
var rnd = new Random();
var one = rnd.nextInt(pow(2,8*4));
var two = rnd.nextInt(pow(2,8*4));
var thr = rnd.nextInt(pow(2,8*3));
List<int> onel = UTF8.encode(one.toString());
# Coding: UTF-8
require 'csv'
csv = CSV.table('tweets.csv')
tweets = csv[:text]
tweets.each do |txt|
text = txt.to_s
if text.start_with?("RT","@") == false
file = File.open("tweet.txt","a")
public class Main
{
public static void main(String[] args)
{
String kokoro = "kokoro";
String pyon = "pyon";
String befo = pyon;
String res = kokoro + pyon;
String res2 = "";
int i = 1;
@sh4869
sh4869 / .vimrc
Last active August 29, 2015 14:02
My Vimrc
set number
set notitle
set nocompatible
set title
set showmatch
set wildmenu
set showcmd
set noswapfile
set smartindent
set tabstop=4