Skip to content

Instantly share code, notes, and snippets.

View kakkun61's full-sized avatar
🚂
Choo-choo

Kazuki Okamoto kakkun61

🚂
Choo-choo
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define MAX_N 100
typedef struct {
double real;
double imag;
@kakkun61
kakkun61 / Solar.slconf
Created June 15, 2011 00:27
My configuration file of Solar (Twitter client)
<?xml version="1.0" encoding="utf-8"?>
<Settings xmlns="http://2.star.glasscore.net/software/solar/" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Settings.Accounts>
<AccountToken
Name="kakkun61"
OAuthToken="9820592-7yshyyoc6tHZifzwD9mLgNjIjSEqpPZdqEVEQ6NarE"
OAuthTokenSecret="gsqGlysTPXAC51l5YApcA1aNPQwsjECR4PSzR7pKCY"
UserID="9820592" />
</Settings.Accounts>
<Settings.CategoryGroups>
@kakkun61
kakkun61 / ibus-skk.json
Created July 3, 2011 12:31
My ibus-skk configuration file
// ~/.config/ibus-skk.json
{
"custom_rom_kana_rule": {
"!": [null, "!"],
"\"": [null, "”"],
"z\"": [null, "“"],
"#": [null, "#"],
"$": [null, "$"],
"%": [null, "%"],
"&": [null, "&"],
#!/bin/bash
# /etc/pm/sleep.d/10_touch-pad-off
# うまくいかんねー
case "$1" in
hibernate|suspend)
# nothing
;;
resume|thaw)
@kakkun61
kakkun61 / gist:1148954
Created August 16, 2011 12:25
Real World Haskell, Ex. 3.2.6 (p.72 in Ja)
import Data.List
sortByLength = sortBy ord
where ord l1 l2 = if length l1 < length l2
then LT
else if length l1 > length l2
then GT
else EQ
where l1l = length l1
l2l = length l2
-- 8:8: parse error on input `where'
short s;
double d;
s = d; // compilation error
s += d; // compilation ok
@kakkun61
kakkun61 / Parser.jj
Created December 22, 2011 06:48
Java Advent Calendar 2011 code 1
PARSER_BEGIN (Parser)
public class Parser {
}
PARSER_END (Parser)
void List(): {
} {
"Hello World.\n"
}
@kakkun61
kakkun61 / Main.java
Created December 22, 2011 06:50
Java Advent Calendar 2011 code 2
public class Main {
public static void main (String[] args) {
try {
Parser parser = new Parser(System.in);
parser.List();
} catch (TokenMgrError ex) {
System.out.println("字句解析エラー:" + ex.getMessage());
} catch (ParseException ex) {
System.out.println("構文解析エラー:" + ex.getMessage());
}
@kakkun61
kakkun61 / Parser.jj
Created December 22, 2011 07:36
Java Advent Calendar 2011 code 3
PARSER_BEGIN (Parser)
public class Parser {
}
PARSER_END (Parser)
SKIP: {
" "
}
TOKEN: {
<HELLO: "Hello World.">
@kakkun61
kakkun61 / Parser.jj
Created December 22, 2011 08:06
Java Advent Calendar 2011 code 4
PARSER_BEGIN (Parser)
public class Parser {
}
PARSER_END (Parser)
SKIP: {
" "
}
TOKEN: {
<INTEGER: (["0"-"9"])+>