This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding: utf-8 | |
import sys | |
import gobject | |
import dbus | |
import dbus.mainloop.glib | |
from service import service_name, object_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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个元素,*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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个元素,*/ |
OlderNewer