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: utf8 | |
from types import * | |
import thread | |
import time | |
import multiprocessing | |
import ctypes | |
import traceback | |
class ProcessRegistry: |
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 xml.dom.minidom import parseString | |
from xml.dom import Node | |
def parse(source): | |
dom = parseString(source) | |
return AccessProxy(dom) | |
class AccessProxy(object): | |
def __init__(self, dom): | |
self.dom = dom |
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 PySide.QtCore import * | |
from PySide.QtGui import * | |
from numpy import * | |
import sys | |
app = QApplication(sys.argv) | |
matrix = arange(16).reshape(4, 4) | |
scene = QGraphicsScene() |
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
| | |
- | |
- id = main_nav | |
a 豆瓣社区 | |
a 豆瓣读书 | |
a 豆瓣电影 | |
a 豆瓣音乐 | |
a 豆瓣同城 | |
a 豆瓣FM | |
a 更多 |
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
(require 'package) (package-initialize) | |
(add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/")) | |
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) | |
(require 'ace-jump-mode) | |
; Appearance | |
(setq linum-format "%d ") (global-linum-mode 1) | |
(setq ring-bell-function 'ignore) | |
(setq scroll-step 1 scroll-conservatively 10000) |
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
package main | |
import "fmt" | |
const links int = 100 | |
const messages int = 1000000 | |
type Msg struct { | |
tag string | |
msg int |
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
package main | |
import "fmt" | |
const links int = 100 | |
const messages int = 1000000 | |
type Msg struct { | |
tag string | |
msg int |
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
package main | |
import ( | |
"fmt" | |
sf "gosfml2" | |
"time" | |
"path/filepath" | |
"os" | |
"flag" | |
"math/rand" |
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
use task::spawn; | |
use uint::range; | |
use io::println; | |
use pipes::{stream, Port, Chan}; | |
const N: uint = 100; | |
fn main() { | |
let mut chans: ~[mut (Chan<uint>, Port<uint>)] = ~[mut]; | |
for range(0, N) |_i| { |
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
package main | |
import ( | |
"sync" | |
"fmt" | |
) | |
func WorkerPool(size int) chan func() { | |
listen := make(chan func()) | |
pool := make(chan bool, size) |