Skip to content

Instantly share code, notes, and snippets.

View xatier's full-sized avatar
🍰
吃點心

xatier xatier

🍰
吃點心
  • ド田舎
View GitHub Profile

a hint for Archlinux install on SD cards

(for booting on MacBookAir)

Environment

@xatier
xatier / test.asm
Last active December 27, 2015 05:59
; move $t0, 0 ; change to the real memory address
lui $t1, 4 ; $t0[0] = 4
sw $t1, 0($t0)
lui $t1, 5 ; $t0[1] = 5
sw $t1, 4($t0)
lui $t1, 3 ; $t0[2] = 3
sw $t1, 8($t0)
lui $t1, 2 ; $t0[3] = 2
sw $t1, 12($t0)
@xatier
xatier / slides.html
Last active December 26, 2015 02:29
the slides for 10/21 meeting
<!DOCTYPE html>
<html>
<head>
<title>Meeting II</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css" media="screen">
/* Slideshow styles */
@import url(http://fonts.googleapis.com/css?family=Droid+Serif);
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@xatier
xatier / crypto_hw1.py
Created October 16, 2013 16:23
the homework of cryptographic 2013, NCTU
#!/usr/bin/env python3
import operator
# build the alphabet frequency table according to the sequence
def freq_count(seq):
freq = { chr(i+ord('A')) : 0 for i in range(26) }
for i in seq:
freq[i] += 1
return freq
@xatier
xatier / note.md
Last active December 25, 2015 15:58
cs-note temp

10/16 cryptography

descrete log problems

you don't have a easy approach to solve the descrete log problems, so the algorithm is secure. the factorization problem is hard too.

@xatier
xatier / panda.pl
Created August 31, 2013 05:42
再度填上心眼吧!
#!/usr/bin/env perl
use 5.014;
use WWW::Mechanize;
use List::MoreUtils qw(uniq);
# XXX: change me!
my $url = "625301/282f4c93aa/";
@xatier
xatier / npnt.me.pl
Created August 16, 2013 07:45
請用心眼填上適當的網址 ;-)
#!/usr/bin/env perl
use 5.014;
use WWW::Mechanize;
use List::MoreUtils qw(uniq);
# iframe printer
sub iframe_p {
my ($title, $id, $url) = @_;
@xatier
xatier / db proj 3 ans
Last active December 19, 2015 01:09
彭文志 db 2013 porject 3 demo 題目
# 1
彭文志老師在101學年度總共開了幾門課?
SELECT COUNT(C.id) FROM Course C, Professor P WHERE P.name = "彭文志" AND P.id = C.pro_id
# 2
資訊工程學系在上學期有幾門不同的課? (課名相同而老師不同視為相同)
SELECT COUNT(DISTINCT C.name) FROM Course C, Department D WHERE D.name = "資訊工程學系" AND D.id = C.department AND C.year = '1'
@xatier
xatier / gol.py
Created June 13, 2013 08:12
A simple game of life in Python, idea from Allen Downey's Think Complexity Book http://www.greenteapress.com/compmod/
#!/usr/bin/python
import random
import time
class gol:
def __init__(self):
self._w = 30 # map width
self._prob = 0.5 # probability
self._map = []