Skip to content

Instantly share code, notes, and snippets.

View hiromu's full-sized avatar

Hiromu Yakura hiromu

View GitHub Profile
@hiromu
hiromu / gist:730019
Created December 6, 2010 08:21
Python for JOI
#!/usr/bin/env python
# coding: UTF-8
# JOI用スクリプト
#
# あるフォルダに以下のファイルを置く。
# ソースコード(xxx.c もしくは xxx.cpp)
# 入力データ(ファイル名はそのままで)
# これ
# このスクリプトを実行(実行時引数にソースファイルを指定)
From 8878b67615739dc52a96031d75185fda16f9d294 Mon Sep 17 00:00:00 2001
From: Hiromu Yakura <hiromu1996@gmail.com>
Date: Sun, 9 Jan 2011 17:26:55 +0900
Subject: [PATCH] Add: sys_brainfuck(): This is interpreter of brainfuck.
---
arch/arm/include/asm/unistd.h | 1 +
arch/arm/kernel/calls.S | 2 +-
include/linux/syscalls.h | 4 +-
kernel/Makefile | 2 +-
#include <cstring>
#include <iostream>
#include <unistd.h>
#include <sys/syscall.h>
using namespace std;
#define __NR_brainfuck 223
#define OUTPUT_LEN 100
int main (void)
@hiromu
hiromu / gist:907788
Created April 7, 2011 13:39
givemac2 ソーシャルネットワークの未来像 - @hiromu1996
brainfuckのソースコードを実行すると、小論文が表示されます。
注意: UTF-8で表示させてください。
注意: インタープリタの実装によっては表示されないかもしれませんが、仕様に基づいた実装のbfやbeefなどでは動作を確認しています。
また、原文からbrainfuckの変換に使用したプログラムのソースコードも添付しております。
ライセンスはGPLv3です。
容量は以下のようになっているので、制限内です。
brainfuckのソースコード 14KB
変換プログラムのソースコード 2.1KB
より多くの方にbrainfuckに触れていただくために原文を添付していませんが、応募期間終了後に公開します。(http://tl.gd/9nb1ih)
@hiromu
hiromu / gist:909615
Created April 8, 2011 10:30
tweepyでふぁぼる
fav(user, num, api):
user - ふぁぼるユーザーのscreen_name
num - ふぁぼる回数
api - tweepy.API
このコードでは@hiromu1996を100回ふぁぼれる
@hiromu
hiromu / gist:935978
Created April 22, 2011 03:46
emerge -pv avahi
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild U ] net-dns/avahi-0.6.30 [0.6.28-r1] USE="gdbm gtk ipv6 python -autoipd -bookmarks -dbus -doc -howl-compat -mdnsresponder-compat -mono -qt4 -test" 1,215 kB
Total: 1 package (1 upgrade), Size of downloads: 1,215 kB
* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
@hiromu
hiromu / gist:937962
Created April 22, 2011 23:46
qlist avahi
/etc/avahi/services/ssh.service
/etc/avahi/services/sftp-ssh.service
/etc/avahi/avahi-dnsconfd.action
/etc/avahi/avahi-daemon.conf
/etc/avahi/hosts
/etc/init.d/avahi-daemon
/etc/init.d/avahi-dnsconfd
/usr/include/avahi-core/core.h
/usr/include/avahi-core/lookup.h
/usr/include/avahi-core/publish.h
@hiromu
hiromu / gist:944319
Created April 27, 2011 14:17
PATCH: ARToolKit for Orbit AF
diff -urN ARToolKit/Configure ARToolKit/Configure
--- ARToolKit/Configure 2006-12-06 09:37:23.000000000 +0900
+++ ARToolKit/Configure 2008-04-28 00:47:00.000000000 +0900
@@ -7,7 +7,8 @@
lib/SRC \
lib/SRC/AR lib/SRC/ARMulti lib/SRC/Gl \
lib/SRC/VideoLinux1394Cam lib/SRC/VideoLinuxDV \
- lib/SRC/VideoLinuxV4L lib/SRC/VideoSGI \
+ lib/SRC/VideoLinuxV4L lib/SRC/VideoLinuxV4L2 \
+ lib/SRC/VideoSGI \
import sys
def finish(res):
for i in res:
print str(len(i)) + ' ' + ' '.join(map(str, i))
sys.exit(0)
n = int(raw_input())
dic = []
@hiromu
hiromu / gist:1057460
Created June 30, 2011 22:35
[PATCH] This is a patch for using Intel C++ Compiler to build kernel.
From 1129c1019e4850f9232c312caef3f643a0cd9c74 Mon Sep 17 00:00:00 2001
From: Hiromu Yakura <hiromu1996@gmail.com>
Date: Fri, 1 Jul 2011 07:00:14 +0900
Subject: [PATCH] This is a patch for using Intel C++ Compiler to build kernel.
---
Makefile | 46 +++++++++----
arch/x86/Kconfig.cpu | 55 ++++++++++++---
arch/x86/Makefile | 14 ++--
arch/x86/Makefile_32.cpu | 8 ++-