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 | |
require 'Win32API' | |
require 'win32ole' | |
class Win32API | |
class Rect | |
def initialize(left,top,right,bottom) | |
@left = left |
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
#method chain feature for a Java object in JRuby | |
class MethodChain | |
def initialize(underlying) | |
@underlying = underlying | |
end | |
def method_missing(name, *args, &block) | |
@underlying.send(name, *args, &block) | |
return self | |
end |
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
module Roman | |
where | |
roman' n (one:five:ten:[]) | n == 0 = [] | |
| n == 4 = [one, five] | |
| n == 5 = [five] | |
| n == 9 = [one, ten] | |
| n > 5 = five : (roman' (n-5) (one:five:ten:[]) ) | |
| otherwise = (roman' (n-1) (one:five:ten:[]) ) ++ [one] |
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
module Sort | |
where | |
import IO | |
cat = bracket | |
(openFile "a.txt" ReadMode) | |
hClose | |
(\h -> docatloop h) | |
where docatloop h = do |
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 | |
require 'Win32API' | |
require 'win32ole' | |
class Win32API | |
class Rect | |
def initialize(left,top,right,bottom) | |
@left = left |
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
/* written by ooharak 2012. */ | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <poll.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/ip.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
# | |
# written by ooharak 2012. https://github.com/ooharak | |
# Usage: | |
# # an example test target | |
# def target(): | |
# import os | |
# os.putenv('DUMMY', os.getenv('PATH')+'#'+os.getenv('USER')) | |
# | |
# ... | |
# |
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
#!/bin/sh | |
## | |
## by ooharak 2012. | |
## | |
## _merge_entries target_file < merge_file | |
## update entries in target_file with merge_file. | |
function _merge_entries { | |
local file=$1 | |
local entry | |
while read entry ; do |
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
module Triplet | |
where | |
import List | |
newtype Triplet = Triplet Int | |
deriving(Show,Read) | |
instance Eq Triplet where | |
Triplet i == Triplet j = i == j | |
instance Ord Triplet where | |
(Triplet i) `compare` (Triplet j) |
OlderNewer