This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// HttpConnectionWrapper.h | |
// | |
// Created by Hiroki Yagita on 11/04/09. | |
// Copyright 2011 Hiroki Yagita. All rights reserved. | |
// | |
/*! @file */ | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# indent.rb PATH | |
# -> PATH.new というインデント済みのファイルが生成されます。 | |
# | |
require "stringio" | |
out = StringIO.new | |
File.foreach(ARGV[0]) do |line| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
const char *files[] = { | |
"/usr/share/dict/american-english", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/timer.h> | |
#include <linux/jiffies.h> | |
static void mykmod_timer_handler(unsigned long data); | |
static unsigned long onesec; | |
DEFINE_TIMER(mytimer, mykmod_timer_handler, 0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/workqueue.h> | |
static void mykmod_work_handler(struct work_struct *w); | |
static struct workqueue_struct *wq = 0; | |
static DECLARE_DELAYED_WORK(mykmod_work, mykmod_work_handler); | |
static unsigned long onesec; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obj-m := mykmod.o | |
KDIR := /lib/modules/$(shell uname -r)/build | |
PWD := $(shell pwd) | |
default: | |
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bsearch" # http://0xcc.net/ruby-bsearch/index.html.en | |
class SuffixArray | |
attr_accessor :word # original string(String) | |
attr_accessor :sary # suffix array(Array) | |
def initialize word | |
@word = word | |
@sary = Array.new(@word.size) {|i| i } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct SuffixArray | |
{ | |
unsigned ip; /* index point */ | |
char *suffix; | |
}; | |
static int compare(const void *l, const void *r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://www.ibm.com/developerworks/jp/linux/library/l-ubuntu-inotify/index.html */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/inotify.h> | |
#define EVENT_SIZE ( sizeof (struct inotify_event) ) | |
#define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defencoding utf-8 | |
escape ^z^z | |
termcapinfo * hs@ | |
hardstatus alwayslastline "[%02c] %`%-w%{=b bw}%n %t%{-}%+w" |