Skip to content

Instantly share code, notes, and snippets.

@choupi
choupi / keras VGG-Face Model.md
Created September 8, 2017 11:04 — forked from EncodeTS/keras VGG-Face Model.md
VGG-Face model for keras

VGG-Face model for Keras

This is the Keras model of VGG-Face.

It has been obtained through the following method:

  • vgg-face-keras:directly convert the vgg-face matconvnet model to keras model
  • vgg-face-keras-fc:first convert vgg-face caffe model to mxnet model,and then convert it to keras model

Details about the network architecture can be found in the following paper:

@choupi
choupi / client.py.patch
Last active June 11, 2017 13:37
FB chatbot for pycon 2017 QA game with modified fbchat
--- client.py.orig 2017-06-11 21:28:19.232693710 +0800
+++ client.py 2017-06-09 15:25:46.000000000 +0800
@@ -442,7 +442,7 @@
users.append(User(entry))
return users # have bug TypeError: __repr__ returned non-string (type bytes)
- def send(self, recipient_id=None, message=None, is_user=True, like=None, image_id=None, add_user_ids=None):
+ def send(self, recipient_id=None, message=None, is_user=True, like=None, image_id=None, add_user_ids=None, payload=None):
"""Send a message with given thread id
import sys
import csv
import math
from sklearn import metrics
EPS=1e-15
rd=[]
y=[]
with open(sys.argv[1], 'rb') as f:
@choupi
choupi / ctos.c
Last active December 24, 2015 03:29
glibc
#include <stdio.h>
//void my_init(void) __attribute__ ((constructor));
void my_init(void)
{
printf("ctos\n");
}
typedef void (*ctor_t)(void);
ctor_t __attribute__((section(".ctors"))) my_init_p=&my_init;
@choupi
choupi / extand fork()
Last active December 23, 2015 12:18
init/main.c: process 0 -> process 1
int fork(void)
{
long __res;
__asm__ volatile ("int $0x80"
: "=a" (__res)
: "0" (__NR_ fork)) ;
if (__res >= 0)
return (int) __res;
errno = -__res;
return -1;
@choupi
choupi / COSCUP 2013 Day 1
Last active December 20, 2015 14:59 — forked from denny0223/COSCUP 2013 Day 1
COSCUP 2013 IRC log
--- Day changed Sat Aug 03 2013
00:11 < tsai> :)
00:13 < pichuang_> 好多人
00:14 < darkgerm> 差點忘記進來了XD
00:17 < darkgerm> pichuang: 學弟好 (?
00:17 < Jedi_> 隨手亂拿了一些奇怪的小禮品,實用性可疑,笑果若干,今、明兩天如果你剛好帶著拙著《簡報原力》或我的其他著作/譯作出席,請來跟我打個招呼,領取隨機小禮~ :p
00:22 < darkgerm> pichuang: 啊!原來是學長... 只看學號以為是學弟 <冏>
00:23 < chihhsin> darkgerm: 黑駿~
00:23 < pichuang> 沒關係 我現在還沒有搞清楚狀況中XD
00:25 < darkgerm> chihhsin: hihi~
@choupi
choupi / gist:3851535
Created October 8, 2012 09:04 — forked from chihchun/gist:753181
NextVOD
壹多媒體娛樂服務股份有限公司 壹網樂/網樂通, https://www.nextvod.com.tw/ #nextvod #nextv
H/W
STMicroelectronics STx7105 (Renesas SuperH Core)
VIA VT6113 (Ethernet)
NANYA NT5TU64M16GG-AC (DRAM DDR2 64Mx16 PC800 BGA) * 2
Samsung NCDOM08GMS-MLC (USB DOM 8GB)
Winbond 25Q80 1MB Spi Flash (Onboard Flash)
Console Pin headers
@choupi
choupi / JN5121.c
Created May 30, 2012 07:52 — forked from aqzhh/JN5121.c
開放-JN5121 coordinator
@@@@@@@@@@@@
edit test @@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@
/****************************************************************************
*
* MODULE: WSN - Coordinator
*
* COMPONENT: $RCSfile: WSN_Coordinator.c,v $
*
mpla :: [[Float]] -> [Float] -> [Float] -> (Bool, [Float])
mpla [] [] c = (False, c)
mpla (a:ax) (b:by) (c:cc) = (fl&&(s<0), rc)
where
s = b*(c+(mdot a cc))
nc = case (s<0) of
True -> [c+(b*head a)] ++ (vadd a cc b)
False -> [c] ++ cc
(fl, rc) = mpla ax by nc
@choupi
choupi / mgcd.hs
Created January 7, 2015 03:01
GCD in haskell
mgcd :: Int -> Int -> Int
mgcd a b
| b > a = mgcd b a
| b==1 = 1
| b==0 = a
| otherwise = mgcd b (a `mod` b)
main = print (mgcd 45 6)