Skip to content

Instantly share code, notes, and snippets.

View keizo042's full-sized avatar

Koichi Nakanishi keizo042

  • japanese company
  • Japan
View GitHub Profile
WORK=/tmp/go-build685671399
mkdir -p $WORK/net/rpc/_obj/
mkdir -p $WORK/net/
cd /usr/lib/go/src/net/rpc
/usr/lib/go/pkg/tool/linux_amd64/6g -o $WORK/net/rpc.a -trimpath $WORK -p net/rpc -complete -D _/usr/lib/go/src/net/rpc -I $WORK -pack ./client.go ./debug.go ./server.go
mkdir -p /usr/lib/go/pkg/linux_amd64/net/
cp $WORK/net/rpc.a /usr/lib/go/pkg/linux_amd64/net/rpc.a
go install net/rpc: open /usr/lib/go/pkg/linux_amd64/net/rpc.a: permission denied
@keizo042
keizo042 / webapp.go
Created February 19, 2015 18:51
てきとーなWebapp
package main
/*
git clone して
go build webapp.go
./webapp
としたあと
http://localhost:8080
にアクセス
*/
import Control.Monad.Writer
sayHello :: Writer (Sum Int, Sum Int) String
sayHello = do
tell (0,1)
return "hello"
sayGoodbye :: Writer (Sum Int, Sum Int) String
sayGoodbye = do
@keizo042
keizo042 / ghr.go
Created January 20, 2015 17:00
ghc pretty wrapper for easy compile on sandbox (under MITL, author keizo)
package main
import (
"flag"
"fmt"
"os"
"os/exec"
)
func main() {
@keizo042
keizo042 / samidare.rb
Last active August 29, 2015 14:13
軽空母美人さん揃いだねぇ
# encoding : utf-8
module Kankore
attr_accessor :長門, :陸奥, :伊勢, :日向, :雪風, :赤城, :加賀, :蒼龍, :飛龍, :島風,
:吹雪, :白雪, :初雪, :深雪, :叢雲, :磯波, :綾波, :敷波,
:大井, :北上,
:金剛, :比叡, :榛名, :霧島,
:鳳翔,
:扶桑, :山城, :天龍, :龍田, :龍驤,
:睦月, :如月, :皐月, :文月, :長月, :菊月, :三日月, :望月,
:球磨, :多摩, :木曽,
@keizo042
keizo042 / collision.vim
Created November 29, 2014 12:34
vim plugin collision xml.vim typescript.vim
"keizo'vimrc
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
filetype indent off
call neobundle#begin(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
@keizo042
keizo042 / newton.c
Created August 9, 2014 13:45
newton法、美しいアルゴリズム
#include<stdio.h>
#include<stdlib.h>
double newton(double c)
{
double x;
int i;
x = ( c + c / c ) / 2;
@keizo042
keizo042 / eratosthenes.c
Created August 8, 2014 16:14
エラトステネスの篩を実装したかったが断念
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define LEN 1000
#define PRIME int
struct list{
struct list *next;
@keizo042
keizo042 / fileutils.scala
Created July 1, 2014 12:26
file io scala
import scala.io._
object FileUtils {
def main( args: Array[String] ) : Unit = {
Source.fromFile(args(0) ).foreach{
print
@keizo042
keizo042 / MyzipWith.hs
Last active August 29, 2015 13:59
zipWith 実装してみようと思ったけど上手くかね。わかんね。
--zipTwo :: ( a -> b -> c ) -> [a] -> [b] -> [c]
--zipTwo _ [] _ = []
--zipTwo _ _ [] = []
--zipTwo f (x:xs) (y:ys) = f x y : f xs ys
--分かった 再帰を使っているのに引数にとった関数を使おうとしているから
-- 上手くいかなかった
zipTwo :: (a -> b -> c) -> [a] -> [b] -> [c]
zipTwo f [] _ = []
zipTwo f _ [] = []