My Recent Pastes (38 and counting)
Pastes by Yi Qiang (38 and counting)
Below are the 15 most recent pasties by Yi Qiang.
May 09, 2008
5:55PM EDT
by Yi Qiang
#!/usr/bin/env python import pdb; pdb.set_trace() n = [x for x in range(1,10)] print 'Hello'
March 22, 2008
11:50PM EDT
by Yi Qiang
View all 12 lines
sage: from sage.dsage.misc.misc import find_open_port
sage: port = find_open_port().next()
sage: dsage.server(blocking=False, port=port, verbose=False, ssl=False, log_level=3)
Going into testing mode...
sage: dsage.worker(blocking=False, port=port, verbose=False, ssl=False, log_level=3, poll=0.1, authenticate=False)
March 21, 2008
5:47PM EDT
by Yi Qiang
View all 23 lines
from twisted.trial import unittest from twisted.internet import reactor from twisted.internet import defer from twisted.internet.protocol import ServerFactory, ClientFactory
March 21, 2008
4:49PM EDT
by Yi Qiang
View all 20 lines
sage: d = dsage.start_all() Spawned twistd -d /Users/yqiang/.sage/dsage --pidfile=server.pid --logfile=/Users/yqiang/.sage/dsage/server.log -y dsage_server.tac (pid = 43461) Spawned python /Users/yqiang/Software/sage-2.10.4/local/bin/dsage_worker.py -s localhost -p 8081 -u yqiang -w 2 --poll 1.0 -l 0 -f /Users/yqiang/.sage/dsage/worker.log --privkey=/Users/yqiang/.sage/dsage/dsage_key --pubkey=/Users/yqiang/.sage/dsage/dsage_key.pub --priority=20 --ssl --noblock (pid = 43469)
March 21, 2008
4:02PM EDT
by Yi Qiang
View all 69 lines
/home/yqiang/Downloads/sage-2.10.4/local/lib/python2.5/site-packages/twisted/trial/reporter.py:219: twisted.trial.reporter.BrokenTestCaseWarning: REAC TOR UNCLEAN! traceback(s) follow: Traceback (most recent call last): File "/home/yqiang/Downloads/sage-2.10.4/local/lib/python2.5/site-packages/twisted/trial/unittest.py", line 635, in _cleanUp util._Janitor().postCaseCleanup()
March 16, 2008
12:45PM EDT
by Yi Qiang
View all 8 lines
File "/home/yqiang/Software/sage-2.10.4.alpha0/local/lib/python2.5/site-packages/twisted/internet/base.py", line 561, in runUntilCurrent call.func(*call.args, **call.kw) File "/home/yqiang/Software/sage-2.10.4.alpha0/local/lib/python2.5/site-packages/twisted/internet/tcp.py", line 508, in resolveAddress d = self.reactor.resolve(self.addr[0]) File "/home/yqiang/Software/sage-2.10.4.alpha0/local/lib/python2.5/site-packages/twisted/internet/base.py", line 332, in resolve
February 15, 2008
8:34PM EDT
by Yi Qiang
View all 13 lines
def init_db_sa(db_file): from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import mapper from sage.dsage.database.model import metadata, jobs, clients, workers
December 17, 2007
10:21PM EDT
by Yi Qiang
# complete ssh hosts local _myhosts _myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} ) zstyle ':completion:*' hosts $_myhosts
November 19, 2007
2:21AM EDT
by Yi Qiang
\prob{18.8a} Let $Y$ be an ordered set in the order topology. Let $f, g: X \to Y$ be continuous. Show that the set $\{x: f(x) \leq g(x)\}$ is closed in $X$. \eprob
November 08, 2007
8:58PM EDT
by Yi Qiang
View all 108 lines
var count = 10; // Default count
function getServerDetails () {
$('#server_details').load('get_server_details');
showServer()
November 05, 2007
2:18AM EDT
by Yi Qiang
View all 15 lines
class Toplevel(resource.Resource):
addSlash = True
def __init__(self, dsage_server):
self.dsage_server = dsage_server
May 04, 2007
11:19PM EDT
by Yi Qiang
View all 14 lines
def get_job_by_id(self, job_id):
"""
Returns a job by the job id.
Parameters:
April 12, 2007
11:48PM EDT
by Yi Qiang
Suppose F = [√2] and K = [√3]. For contradiction, suppose that φ : F → K is a field isomorphism. Then there ∃(a + b√2) ∈ [√2] s.t. φ(a + b√2) = √3. But we know that φ must map to . It follows then that φ(a + b√2)2 = φ((a + b√2))2 = φ(a2 + 2ab√2 + b2 ) = √3 2 = 3. Then since φ is a homomorphism and a, b ∈ , we have a 2 + 2ab√2 + b2 = 3. But then we must have that 2ab√2 = 0 ⇒ 2ab = 0 ⇒ a = 0 ∨ b = 0. If b = 0, then a 2 = 3 ⇒ a = √3 which is a contradiction. But b
April 12, 2007
11:23PM EDT
by Yi Qiang
View all 9 lines
sage: import gestalt --------------------------------------------------------------------------- <type 'exceptions.ImportError'> Traceback (most recent call last) /Users/yqiang/<ipython console> in <module>()
March 29, 2007
10:18PM EDT
by Yi Qiang
View all 13 lines
=============================================================================== [ERROR]: sage.dsage.twisted.tests.test_remote.MonitorRemoteCallsTest.testget_killed_jobs_list Traceback (most recent call last): File "/Users/yqiang/Software/sage/local/lib/python2.5/site-packages/twisted/internet/selectreactor.py", line 139, in _doReadOrWrite