Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Zheng Yan zyan0

🎯
Focusing
View GitHub Profile
View service-checklist.md

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@zyan0
zyan0 / WordsDetector.py
Created Aug 11, 2012 — forked from lastland/BeyesianAvg.py
尝试用这篇post: http://www.matrix67.com/blog/archives/5044 中的方法实现的一个自动中文抽词算法的Python程序
View WordsDetector.py
# -*- coding=utf-8 -*-
import feedparser
import re
import collections
import math
def info_entropy(words):
result = 0
total = sum([val for _, val in words.iteritems()])
for word, cnt in words.iteritems():
@zyan0
zyan0 / hello.rb
Created Dec 1, 2012
Hello,world! for RPG Maker XP
View hello.rb
class Window_Hello < Window_Base
def initialize
super(380 , 20, 220, 60)
self.contents = Bitmap.new(width - 32, height - 32)
@time = 0
end
def update
if @time == 0
self.contents.clear
View gist:4413606
#!/usr/bin/python
# - * - coding: UTF-8 - * -
# Copyright (C) 2010 Upsuper <quanxunzhen@gmail.com>
# License: AGPLv3
from threading import Thread, Lock
from httplib import HTTPConnection
import urllib
import cgi, json
View gist:5596417
#!/usr/bin/env python
# -*- coding: utf-8 -*-
stu_id = 'your student id'
username = password = 'use your own credential, hint: 00xxxxx'
host = '10.14.101.169'
login_url = 'http://10.14.101.169/LogOn'
lab_url ='http://10.14.101.169/TA/lab/Edit/114'
check_url = 'http://10.14.101.169/QianDao'
@zyan0
zyan0 / cube.c
Created Jun 14, 2013
Cubing Numbers Using CUDA
View cube.c
#include <stdio.h>
__global__ void cube(float * d_out, float * d_in){
int idx = threadIdx.x;
float f = d_in[idx];
d_out[idx] = f * f * f;
}
int main(int argc, char ** argv) {
const int ARRAY_SIZE = 64;
View gist:7461895
void main() {
auto f = File("name.bin", "wb");
string raw = "hai";
f.write(raw);
}
View run.sh
while true; do
sh mine.sh
sleep 10
done
View substitute.sh
#!/bin/bash
SCRIPT=substitute.sh
for f in *
do
if [ $f = $SCRIPT ]
then
echo "skip $f"
continue
View TensorFlow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.