Skip to content

Instantly share code, notes, and snippets.

View bcho's full-sized avatar
💍
一起来发财吧!Let's make some money!

hbc bcho

💍
一起来发财吧!Let's make some money!
View GitHub Profile
@bcho
bcho / average_image_color.py
Created July 22, 2012 04:48 — forked from olooney/average_image_color.py
Average Image Color
from PIL import Image
def average_image_color(filename):
i = Image.open(filename)
h = i.histogram()
# split into red, green, blue
r = h[0:256]
g = h[256:256*2]
b = h[256*2: 256*3]
@bcho
bcho / Hover-Box
Created July 26, 2012 12:29 — forked from Kaiyuan/Hover-Box.html
Hover-Box
<div class="box">
<img class="image" src="https://dl.dropbox.com/u/6450050/demo/music-player-air/images/359167072-1.jpg" alt="">
<div class="text">
<h2>title</h2>
<p>This's Photo.</p>
</div>
</div>
<style type="text/css">
.box {
width: 100px;
int FPS = 4;
int COUNT = 20;
int SIZE = 10;
int MAP_WIDTH = COUNT * SIZE;
int MAP_HEIGHT = COUNT * SIZE;
color BACKGROUND_COLOR = color(255, 255, 255, 0);
/* cells */
bool DEAD = false;
bool ALIVE = true;
#coding: utf-8
import sys
import gobject
import dbus
import dbus.mainloop.glib
from service import service_name, object_path
@bcho
bcho / except.c
Created January 11, 2013 04:36 — forked from anonymous/except.c
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "except.h"
#define T except_t
except_frame *except_stack = NULL;
void except_raise(const T *e, const char *file, int line)
@bcho
bcho / index.html
Created January 25, 2013 11:21 — forked from anonymous/index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>metro</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container grid-home grid-wrap">
<div class="grid-block-wrap grid-block-span1" data-grid-row="1" data-grid-col="1"></div>
#!/usr/bin/env bash
deliver_target=([email protected] [email protected])
smtp_account="[email protected]"
smpt_password="******"
issue_archive_dir="/srv/ebook-deliver/archives"
issue_name="solidot-$(date +%Y%m%d)"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>know your web</title>
<link rel="stylesheet" href="web.css" />
</head>
<body>
<h1 class="title cool">hello, world!</h1>
<script type="text/javascript" src="web.js"></script>
@bcho
bcho / anyview
Created October 3, 2013 02:13 — forked from anonymous/anyview
2.16③ 已知指针la和lb分别指向两个无头结点单链表中
的首元结点。 下列算法是从表la中删除自第i个元素起共
len个元素后,将它们插入到表lb中第i个元素之前。试问
此算法是否正确? 若有错,则请改正之。
实现下列函数:
Status DeleteAndInsertSub(LinkList &la, LinkList &lb,
int i, int j, int len);
// la和lb分别指向两个单链表中第一个结点, */
/* 本算法是从la表中删去自第i个元素起共len个元素,*/
2.16③ 已知指针la和lb分别指向两个无头结点单链表中
的首元结点。 下列算法是从表la中删除自第i个元素起共
len个元素后,将它们插入到表lb中第i个元素之前。试问
此算法是否正确? 若有错,则请改正之。
实现下列函数:
Status DeleteAndInsertSub(LinkList &la, LinkList &lb,
int i, int j, int len);
// la和lb分别指向两个单链表中第一个结点, */
/* 本算法是从la表中删去自第i个元素起共len个元素,*/