Skip to content

Instantly share code, notes, and snippets.

jon@li5-50:~$ cat /proc/cpuinfo
processor : 0
vendor_id : User Mode Linux
model name : UML
mode : skas
host : Linux host33.fremont.linode.com 2.6.20.6-1-bigmem #1 SMP Fri Apr 13 09:24:46 EDT 2007 i686
bogomips : 4548.19
jon@li5-50:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU L5420 @ 2.50GHz
stepping : 6
cpu MHz : 2500.086
cache size : 6144 KB
fdiv_bug : no
from datetime import datetime
from time import clock
# the python docs say to use time.clock() for benchmarking. it returns seconds.
def datetime_period():
testvar2='9.00'
print "Testing with datetime measurement, test variable %s" % testvar2
startTime = datetime.now()
join=[]
filehandle=open('testwriting.txt','w')
jon@euterpe:~/tmp$ python test.py
Testing with datetime measurement, test variable 9.00
0:00:03.108696
0:00:04.613864
Testing with datetime measurement, test variable 9a00
0:00:02.957224
0:00:04.480506
Testing with clock measurement, test variable 9.00
2.82
3.5
@implementation TileDocumentView : CPView
{
}
- (void)mouseDragged:(CPEvent)anEvent
{
var point = [self convertPoint:[anEvent locationInWindow] fromView:nil];
var view = [self hitTest: point];
if (view && view != self)
/*
* AppController.j
*
* Created by __Me__ on __Date__.
* Copyright 2008 __MyCompanyName__. All rights reserved.
*/
@import <Foundation/CPObject.j>
@import "Tile.j"
@import "TilePreview.j"
class ReturnFourOhFour(object):
_exception = "foobar"
def __call__(self, environ, start_response):
start_response("404 Not Found", [])
return []
class SomeController(BaseController):
def __before__(self):
return ReturnFourOhFour()
[
{
"uuid":"ba28bdbe93ef4fa196b11464dbb69291",
"position":
{
"x":0,
"y":0
},
"index":4
},
if asbool(static_files):
# Serve static files
static_app = StaticURLParser(config['pylons.paths']['static_files'])
app = Cascade([static_app, app])
app = URLMap(app)
app['/tile_image_files'] = StaticURLParser(config['pylons.paths']['tiles'])
class Table(Base):
__tablename__ = 'tables'
id = Column(Integer, primary_key=True)
user_tables = relation("UserTable", backref='table', cascade="all, delete, delete-orphan")
users = association_proxy("user_tables", "user")
class UserTable(Base):
__tablename__ = "user_tables"