celery -A app.celery worker
python app.py
;;; pli.el --- A Major mode for demo | |
;; Description: A Major mode for demo | |
;; Created: 2014-09-01 01:12 | |
;; Author: dongweiming [email protected] | |
;; URL: http://github.com/dongweiming/pli-mode | |
;; Keywords: test, emacs | |
;; Version: 1.0 |
import multiprocessing | |
import time | |
import pymongo | |
start = time.time() | |
db = pymongo.MongoClient()['test'] | |
def mapper(i): | |
if i['a'] > 0.95: |
#!/usr/bin/expect | |
#ไฝฟ็จexpect็ป้ๆๅกๅจ่ๆฌ | |
#dongweiming 2013.04.02 | |
set timeout 5 | |
set server [lindex $argv 0] | |
set port [lindex $argv 1] | |
set password [lindex $argv 2] | |
set tbjpass XXX |
class ProcessStates: | |
STOPPED = 0 | |
STARTING = 10 | |
RUNNING = 20 | |
BACKOFF = 30 | |
STOPPING = 40 | |
EXITED = 100 | |
FATAL = 200 | |
UNKNOWN = 1000 |
ๅจ.emacs.d/core/prelude-core.elๆๅๆทปๅ ๅฝๆฐ | |
(defun prelude-py-taglist (arg) | |
"็ฎๆ็taglist" | |
(interactive "P") | |
(let ((buffer-other | |
(if arg | |
"*py-taglist*" | |
(format "*py-taglist from %s*" (buffer-name))))) | |
(occur-1 "class \\|def " nil |
#!/bin/env python | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web | |
import tornado.httpclient | |
import time |
def getCareful(self, stat): | |
return self.__limits_list[stat][0] | |
def getWarning(self, stat): | |
return self.__limits_list[stat][1] | |
def getCritical(self, stat): | |
return self.__limits_list[stat][2] | |
# TO BE DELETED AFTER THE HTML output refactoring |
def __getattr__(self, name): | |
""" | |
According to invoke methods to obtain data | |
""" | |
base_type = ['Careful', 'Warning', 'Critical'] | |
base_module = ['CPU', 'LOAD', 'Process', 'STD', 'MEM', 'SWAP', 'TEMP', 'HDDTEMP', 'FS'] | |
get_type = ['get'+n for n in base_type] | |
get_module = ['get'+m+t for m in base_module\ | |
for t in base_type] |
(defun score (dice) | |
(reduce #'+ (mapcar #'(lambda (n) | |
(let ((coun (count n dice))) | |
(case n | |
(1 (cond ((= coun 3) 1000) | |
((< coun 3) (* 100 coun)) | |
((> coun 3) (+ 1000 (* 100 (- coun 3)))))) | |
(5 (cond ((= coun 3) 500) | |
((< coun 3) (* coun 50)) | |
((> coun 3) (+ 500 (* (- coun 3) 50))))) |