Skip to content

Instantly share code, notes, and snippets.

@hktechn0
hktechn0 / googleime-cgi.py
Created November 29, 2010 15:14
Google CGI API for Japanese Input sample script
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import urllib, urllib2
import json
class GoogleIMECGI(object):
request_url = 'http://www.google.com/transliterate'
langpair = ("ja-Hira", "ja")
@hktechn0
hktechn0 / Makefile
Created November 9, 2010 07:43
Multiboot Specification Sample
CFLAGS = -fno-builtin -fhosted -ffreestanding -nostdlib -nodefaultlibs
all:
nasm -f elf boot.asm -o boot.o
gcc $(CFLAGS) -o kernel.o -c kernel.c
ld -Ttext=0x100000 --oformat elf32-i386 boot.o kernel.o -o os.bin
XOR r1, r1
XOR r2, r2
XOR r3, r3
XOR r4, r4
XOR r5, r5
ADD r4, 10
ADD r2, 1
ADD r3, 2
# z99-android.rules
# Nexus One
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
# IS01 (SHARP)
SUBSYSTEM=="usb", SYSFS{idVendor}=="04dd", MODE="0666"
@hktechn0
hktechn0 / mandelbrot_set.pde
Created October 18, 2010 17:30
Mandelbrot Set
int width = 640;
int height = 480;
float[][] c = new float[width][height];
double aspect = (double)height / (double)width;
int offsetx = width / 2;
int offsety = height / 2;
double da = pow(2.0f, -7);
boot_pbr: file format binary
Disassembly of section .data:
00000000 <.data>:
0: eb 52 jmp 0x54
2: 90 nop
3: 4e dec %si
import time
if __name__ == "__main__":
s = set()
l = list()
N = 10000000
a = time.clock()
for i in xrange(N):
win7_mbr: file format binary
Disassembly of section .data:
00000000 <.data>:
0: 33 c0 xor %ax,%ax
2: 8e d0 mov %ax,%ss
4: bc 00 7c mov $0x7c00,%sp
7: 8e c0 mov %ax,%es
#include <stdio.h>
#include <stdlib.h>
#define MAX 100
#define SIZE 100
#define newnode() ((struct node *)(calloc(sizeof(struct node), 1)))
#define pop() ((struct node *)(*(--sp)))
#define push(P) ((*(sp++)) = (struct node *)P)
struct node {
# Default xorg.conf for Xorg 1.5+ without PCI_TXT_IDS_PATH enabled.
#
# This file was created by VirtualBox Additions installer as it
# was unable to find any existing configuration file for X.
Section "Device"
Identifier "VirtualBox Video Card"
Driver "vboxvideo"
EndSection