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
#!/Users/yanxu/jython2.2.1/jython | |
# encoding: utf-8 | |
""" | |
poi.py | |
Created by yanxu on 2008-04-09. | |
Copyright (c) 2008 sina. All rights reserved. | |
""" | |
from org.apache.poi.hssf.usermodel import * |
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
''' | |
Django filter | |
/ 2026M 11%;/data0 107775M 0%;/tmp 2026M 3%;/usr 12186M 5%;/var 10154M 2%;/data1 138236M 0%;/data2 138236M 0%;/data3 138236M 0% | |
-> | |
/ 2026M 11% | |
''' | |
@register.filte | |
def formatRootFSInfo(text): | |
if text==None:return '' | |
diskinfo=text.split(';') |
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
float randShift=.2; | |
int quadW=15; | |
int quadH = quadW; | |
float[] q={-quadW/2,-quadH/2,quadW,quadH}; | |
void setup() { | |
size(900,600); | |
background(255); | |
smooth(); | |
noStroke(); |
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
django link_to_remote document: | |
ajax+param Example: | |
{% ajax %} | |
link_to_remote | |
url => /dashboard/serverstatus/ | |
update => #server_status_body | |
data => maxcount=10 | |
{% endajax %} | |
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
1.domid的部分可以写一个div的id | |
2.setInterval中的时间单位是毫秒 |
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 django.contrib import admin | |
from app1.models import * | |
class MembershipInline(admin.TabularInline): | |
model = Membership | |
extra = 1 | |
class PersonAdmin(admin.ModelAdmin): | |
inlines = (MembershipInline,) | |
class GroupAdmin(admin.ModelAdmin): | |
inlines = (MembershipInline,) |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> | |
<title>China Python User Group</title> | |
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> | |
<style type="text/css" media="screen">@import "http://iui.googlecode.com/svn/tags/REL-current/iui/iui.css";</style> | |
<script type="application/x-javascript" src="http://iui.googlecode.com/svn/tags/REL-current/iui/iui.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
#!/usr/local/bin/python | |
from __future__ import with_statement | |
import sys | |
import MySQLdb | |
class Log2DB(object): | |
"""hadoop log result into database""" | |
def __init__(self): | |
self.DB_USER='root' | |
self.DB_PASS='' |
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/python | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import pickle | |
import urllib2 | |
def getStar(url,regx): | |
'''根据url获取明星''' |
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
/* | |
* Python的内存分为 | |
* Block | |
* Pool | |
* arena | |
* 内存池几个部分 | |
*/ | |
#undef PyObject_Malloc | |
void * |
OlderNewer