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
%!PS-Adobe-3.0 EPSF-3.0 | |
%%Creator: sora | |
%%Title: rainbow.eps | |
%%BoundingBox: 0 0 640 640 | |
%%EndComments | |
/Radius 200 def | |
/W 320 def /H 320 def | |
/cshow { dup stringwidth pop 2 div neg 5 rmoveto show } def |
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
import os, sys, gzip | |
cnt = 0 | |
wf = open('result.txt', 'a') | |
for file in sys.argv[1:]: | |
for line in gzip.open(file, 'rb'): | |
if cnt % 10000 == 0: | |
print cnt | |
o1 = o2 = o3 = o4 = str() | |
ipaddr, name = line[:-1].split(' ') | |
o1, o2, o3, o4 = ipaddr.split('.') |
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
import os, sys | |
cnt = 0 | |
for file in sys.argv[1:]: | |
for line in open(file, 'r'): | |
if cnt % 1000 == 0: | |
print cnt | |
o1 = o2 = o3 = o4 = str() | |
ipaddr = line[:-1] | |
o1, o2, o3, o4 = ipaddr.split('.') |
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
# ISO-3166|"capital city"|Lat|Long | |
AD|"Andorra la Vella"|42.50779|1.52109 | |
AE|"Abu Dhabi"|24.46667|54.36667 | |
AF|"Kabul"|34.52813|69.17233 | |
AG|"St. John's"|47.56494|-52.70931 | |
AI|"The Valley"|18.21704|-63.05783 | |
AL|"Tirana"|41.3275|19.81889 | |
AM|"Yerevan"|40.18111|44.51361 | |
AN|"Willemstad"|12.1084|-68.93354 | |
AO|"Luanda"|-8.8368|13.23317 |
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
use strict; | |
use warnings; | |
my( %lat, %name, %info, %extra ); | |
open LAT, '<capitallatlong.txt'; | |
open NAME, '<asname-20110606.txt'; | |
open INFO, '<asn-20070110.txt'; | |
open EXT, '<asinfo_20110406.list'; |
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/env Python2.6 | |
# coding: utf-8 | |
# by sora | |
if __name__ == '__main__': | |
import sys, math | |
argvs = sys.argv | |
topodir = "dat/" | |
peers = open(argvs[1]).readlines() |
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
(set-language-environment 'Japanese) | |
(prefer-coding-system 'utf-8) | |
(define-key global-map [ns-drag-file] 'ns-find-file) | |
(global-set-key "\C-h" 'backward-delete-char) | |
(setq backup-inhibited t) | |
;(require 'linum) | |
;(global-linum-mode) | |
;(setq linum-format "%3d ") |
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
;; tex | |
(require 'tex-site) | |
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode) | |
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) | |
(setq reftex-toc-split-windows-horizontally t) | |
;(setq-default TeX-master nil) | |
(setq TeX-view-program-selection '((output-pdf "Skim"))) | |
(setq TeX-view-program-list '(("Skim" "/Applications/Skim.app/Contents/SharedSupport/displayline %n %o %b"))) | |
(custom-set-variables | |
'(LaTeX-command "latex -synctex=1")) |
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
`define dbg 1 | |
module stack #( | |
parameter width = 96, // default item width | |
parameter depth = 10922, // default stack depth | |
parameter log2depth = 14 // default stack depth's address range | |
)( | |
input CLK, | |
input RST, | |
input push, |
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 "slabtbl.vh" | |
module slabtbl ( | |
input CLK, | |
input RST, | |
input request, | |
output reg complate | |
); | |
parameter integer maxslabsize = `PAGE_SIZE / `GROW_FACTOR; |
OlderNewer