Skip to content

Instantly share code, notes, and snippets.

View medicalwei's full-sized avatar

Yao Wei medicalwei

View GitHub Profile
#!/usr/bin/python3
import itertools
import operator
def ab(x,y):
a=sum(map(operator.eq,x,y))
b=len(set(x).intersection(y))-a
return (a,b)
q=list(itertools.permutations(range(10), 4))
@medicalwei
medicalwei / .fonts.conf
Last active September 24, 2015 21:47
medicalwei's ~/.fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Bitstream Vera Serif</string>
<string>DejaVu Serif</string>
@medicalwei
medicalwei / sobel.c
Created February 20, 2011 14:41 — forked from anonymous/CODE
// ImageReadingDoc.cpp : implementation of the CImageReadingDoc class
//
#include "stdafx.h"
#include "ImageReading.h"
#include "ImageReadingDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
void setup()
{
Serial.begin(9600); // Use serial with 9600 baud rate
pinMode(13, OUTPUT);
}
void loop()
{
if(Serial.available()) // Check if there is something for Arduino to read
問題(如果有辦法發問的話)
* 工程倫理的學生 需要問的問題
* 員工超時工作事件
* 責任制工作
* Postmortem
* 與西方的工作態度差異 (e.g. Apple)
* 是否已有修正
* NOWnews:「宏達電主管昨天表示,雖然公司採「自由上下班」制,但已經開始提醒同仁注意下班時間,初步希望員工加班不要超過晚上十一點。」
* 理想與現實的差異
@medicalwei
medicalwei / gist:1050403
Created June 28, 2011 03:06
Processed (with 1 errors): Re: Bug#631739: gitk: session crash when scrolling to specific lines
Processing commands for control@bugs.debian.org:
> reassign 631739 xserver-xorg-video-intel
Bug #631739 [awesome] awesome: segfault when scrolling gitk window to certain lines
Bug reassigned from package 'awesome' to 'xserver-xorg-video-intel'.
> retitle 631739 xserver-xorg-video-intel: gitk caused session crash
Bug #631739 [xserver-xorg-video-intel] awesome: segfault when scrolling gitk window to certain lines
Changed Bug title to 'xserver-xorg-video-intel: gitk caused session crash' from 'awesome: segfault when scrolling gitk window to certain lines'
> when scrolling to certain lines
Unknown command or malformed arguments to command.
@medicalwei
medicalwei / gist:1102434
Created July 24, 2011 09:16
HIT Wargame 2011 Forensics 3 Crack
function send_key_b(){
var tmp = function(data){
if (data.search("Matched") != -1){
alert(data);
setTimeout(function(){window.location.reload()}, 3000);
}
$(".response").html(data);
document.send.key.value = "";
};
var ar = ["0900500294","0900500520","0900500696","0900500810","0900501471","0900501802","0900502219","0900502381","0900502839","0900502953","0900503228","0900503412","0900503784","0900503823","0900504398","0900504589","0900505185","0900505296","0900505393","0900505528","0900506028","0900506210","0900506234","0900506549","0900506643","0900506968","0900507008","0900507158","0900507203","0900507486","0900508170","0900508310","0900508560","0900508864","0900508894","0900509060","0900509406","0900509559","0900509916","0900509964","0900510025","0900510028","0900510114","0900510125","0900510171","0900510172","0900510174","0900510175","0900510196","0900510236","0900510251","0900510322","0900510338","0900510342","0900510369","0900510370","09
@medicalwei
medicalwei / fonts.conf
Created November 10, 2011 10:59
fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="pattern">
<test name="family" qual="any">
<string>serif</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>Bitstream Vera Serif</string>
<string>DejaVu Serif</string>
@medicalwei
medicalwei / Cakefile
Created April 30, 2012 05:25
Cakefile used for every coffeescript project
fs = require 'fs'
{print} = require 'util'
{spawn} = require 'child_process'
build = (callback) ->
coffee = spawn 'coffee', ['-c', '-l', '.']
coffee.stderr.on 'data', (data) ->
process.stderr.write data.toString()
coffee.stdout.on 'data', (data) ->
@medicalwei
medicalwei / gist:2922067
Created June 13, 2012 05:38
default hanzi font list
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW MBE:style=Light
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai CN:style=Book
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai HK:style=Book
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW:style=Book
/usr/share/fonts/truetype/arphic-bkai00mp/bkai00mp.ttf: AR PL KaitiM Big5,文鼎PL中楷:style=Regular
/usr/share/fonts/truetype/arphic-gkai00mp/gkai00mp.ttf: AR PL KaitiM GB,文鼎PL简中楷:style=Regular
/usr/share/fonts/truetype/arphic-gbsn00lp/gbsn00lp.ttf: AR PL SungtiL GB,文鼎PL简报宋:style=Regular
/usr/share/fonts/truetype/arphic-bsmi00lp/bsmi00lp.ttf: AR PL Mingti2L Big5,文鼎PL細上海宋:style=Reguler,Regular
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW MBE:style=Book
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW:style=Light