This file contains hidden or 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 | |
Python 2.7.6 (default, Mar 22 2014, 22:59:56) | |
[GCC 4.8.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import regs_180k_200k_conca | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "regs_180k_200k_conca.py", line 5484 | |
This file contains hidden or 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
################################################################### | |
# | |
# Code to support simultaneous multiple editing | |
# sessions by different clients of a single object. This uses | |
# the Differential Synchronization algorithm of Neil Fraser, | |
# which is the same thing that Google Docs uses. | |
# | |
# * "Differential Synchronization" (by Neil Fraser). | |
# * http://neil.fraser.name/writing/sync/ | |
# * http://www.youtube.com/watch?v=S2Hp_1jqpY8 |
This file contains hidden or 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
def f(n): | |
return n * n | |
This file contains hidden or 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
def foo(n): | |
return n*n + 1 |
This file contains hidden or 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
def f(n): | |
return n * n | |
This file contains hidden or 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 | |
import os, sys | |
argv = sys.argv | |
if len(argv) < 4: | |
print "*********\nThis is the replace command, by William Stein (was@math.harvard.edu)\n*********" | |
print "\tUsage: %s [-f] <from> <to> [file 1] [file 2] ..."%argv[0] | |
print "Optional argument -f is to not ask for confirmation."; | |
sys.exit(0) |
This file contains hidden or 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
def tofile(s): | |
maxout=500 | |
import uuid | |
filename = str(uuid.uuid4()) +'.log' | |
o = open(filename,'w') | |
stdout = sys.stdout | |
class Stdout: | |
def __init__(self): | |
self.t = 0 |
This file contains hidden or 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
############################################################################### | |
# Copyright (c) 2013, William Stein | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# 1. Redistributions of source code must retain the above copyright notice, this | |
# list of conditions and the following disclaimer. | |
# 2. Redistributions in binary form must reproduce the above copyright notice, |
This file contains hidden or 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
%time | |
filename_pattern = '/tmp/plt-%04d.png' | |
@parallel | |
def frame(n, filename): | |
t = Tachyon(xres=800,yres=800, camera_center=(2,5,2), look_at=(2.5,0,0), antialiasing=True) | |
t.light((0,0,100), 1, (1,1,1)) | |
t.texture('r', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1,0,0)) | |
for i in range(n): |
This file contains hidden or 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
# SageMath Cloud backend architecture talk at Sage Days 56 | |
## Guiding principles | |
- A place for everybody to use *all* math-related software easily, especially (but not only!) open source | |
- High availability: automatically survive failure of any proper subset of datacenters | |
- Make it very hard to permanently lose work: | |
- everything has synchronization |
OlderNewer