code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
'''
Created on 2009-12-02
@author: beaudoin
'''
import wx, PyUtils, GLUtils
from Handle import BaseHandle, Handle
from PosableCharacter import PosableCharacter
from ToolSet import ToolSet
from EditorWindow import EditorWindow
from MathLib import Vector3d, Point3d, Trajectory3dv
class Model(object):
... | Python |
from Model import Model
| Python |
'''
Created on 2009-11-23
@author: beaudoin
'''
import UI, wx
class ToolSet(UI.ToolSets.ToolsetBase):
def __init__(self, toolPanel, model):
"""Adds a tool set for the keyframe editor to a toolpanel."""
super(ToolSet,self).__init__()
self._too... | Python |
'''
Created on 2009-09-08
@author: beaudoin
Contains a abstract syntactic tree visitor for printing
nested function calls in a nice way. Used for cleaning-up
output of the serialize method.
See the python standard ast module for details.
'''
import ast
class Fancify( ast.NodeVisitor ):
de... | Python |
'''
Created on 2009-10-06
@author: beaudoin
A collection of useful functions for creating stock rigid bodies
'''
import Physics, MathLib, Mesh, PyUtils, math
from MathLib import Point3d, Vector3d
def createBox( size=(1,1,1), colour=(0.6,0.6,0.6), moiScale = 1, withMesh = True, **kwargs ):
"""
... | Python |
'''
Created on 2009-09-16
@author: beaudoin
A Python version of the C++ Observable class found in Utils
'''
class Observable(object):
def __init__(self):
self._observers = []
self._hasChanged = False
self._batchChangeDepth = 0
def setChanged(self):
... | Python |
'''
Created on 2009-09-02
@author: beaudoin
'''
def callOnObjectOrList( objectOrList, function ):
"""Apply the specified function on :
- The single element passed as first parameter
- The list of elements passed as first parameter, if this is a list or tuple
- The list of values ... | Python |
from Utils import *
from Enum import enum
from Observable import Observable
import Mesh
import RigidBody | Python |
'''
Created on 2009-10-06
@author: beaudoin
A collection of useful functions for creating stock meshes
'''
import GLUtils, PyUtils, MathLib, math
from MathLib import Point3d, Vector3d
def create( vertices, faces, colour=(0.6,0.6,0.6) ):
"""
Creates a mesh having the specified vertices and faces... | Python |
'''
Created on 2009-09-28
@author: beaudoin
'''
def enum( *args ):
"""
Creates an enum class.
Pass a dictionnary { choice : value, ... }
Here, choice needs to be a string and value is an integer
Can also pass a list or a tuple, then the values will be given automatically, starting a... | Python |
'''
Created on 2009-11-27
@author: beaudoin
'''
import Core
import random, math
from MathLib import Point3d, Vector3d
class WalkController(Core.IKVMCController):
def __init__(self, character):
super(WalkController,self).__init__(character)
def typeName(self):
ret... | Python |
'''
Created on 2009-11-27
@author: beaudoin
'''
import Core
import random, math
from MathLib import Point3d, Vector3d
class DanceController(Core.IKVMCController):
def __init__(self, character):
super(DanceController,self).__init__(character)
def typeName(self):
r... | Python |
from DanceController import DanceController
from WalkController import WalkController | Python |
import Utils
Utils.test() | Python |
'''
Created on 2009-09-26
@author: beaudoin
'''
import wx, UI
class Animation(object):
# Available speeds on the buttons
_buttonSpeeds = ( '1/16', '1/8', '1/4', '1/2', '1', '2', '4' )
def __init__(self, toolPanel):
"""Adds a tool set for animation information to a toolpanel.""... | Python |
'''
Created on 2009-10-02
@author: beaudoin
'''
import wx, UI, PyUtils
class SnapshotTree(object):
def __init__(self, toolPanel):
"""Adds a tool set for animation information to a toolpanel."""
self._toolPanel = toolPanel
self._toolSet = toolPanel.createToolSet( "Snapsho... | Python |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx, math
class _OptionData(object):
def __init__(self, checkBox, getter, setter):
self.checkBox = checkBox
self.getter = getter
self.setter = setter
self.update()
def update(self):
... | Python |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx
from ToolsetBase import ToolsetBase
class Options(ToolsetBase):
def __init__(self, toolPanel):
"""Adds a tool set for various options information to a toolpanel."""
super(Options, self).__init__()
... | Python |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx
from ToolsetBase import ToolsetBase
class Camera(ToolsetBase):
def __init__(self, toolPanel):
"""Adds a tool set for camera information to a toolpanel."""
super(Camera, self).__init__()
se... | Python |
'''
Created on 2009-09-26
@author: beaudoin
'''
import UI, wx, PyUtils, os, Core
class ControllerTree(object):
"""A toolset that can be used to display an editable tree of the loaded controllers."""
def __init__(self, toolPanel):
"""Adds a tool set that display a tree of controllers ... | Python |
from ToolsetBase import ToolsetBase
from ControllerTree import ControllerTree
from Animation import Animation
from Options import Options
from Camera import Camera
from SnapshotTree import SnapshotTree | Python |
'''
Created on 2009-08-30
@author: beaudoin
Allows creation of a vertical collection of collapsible tool sets
'''
import wx
class ToolSet(wx.Panel):
"""A simple class that maintain tools and that can be hidden or showed."""
_triUp = None
_triDown = None
def __init__(sel... | Python |
'''
Created on 2009-09-30
@author: beaudoin
'''
import wx, GLUtils, PyUtils
class CurveEditorCollection(GLUtils.GLUIContainer):
"""A collection of curve editor that observes the curve editors of the application."""
def __init__( self, parent, x=0, y=0, width=0, height=0, minWidth=-1, minHei... | Python |
'''
Created on 2009-12-02
@author: beaudoin
'''
import GLUtils
from OpenGL.GL import *
class ControlPoint(object):
"""Base class for any type of control point.
Derived classes must implement:
getPos() returns the x, y position of the control point."""
def __init__( self ):... | Python |
from CurveEditorCollection import CurveEditorCollection
from WindowWithControlPoints import WindowWithControlPoints, ControlPoint | Python |
'''
Created on 2009-08-24
This module contains the main OpenGL application window that is used by all SNM applications
@author: beaudoin
'''
import wx
import UI
class MainWindow(wx.Frame):
"""The class for the main window."""
MIN_TOOLPANEL_WIDTH = 200
MIN_CONSOLE_HEIGHT = 100
... | Python |
'''
Created on 2009-09-24
@author: beaudoin
'''
import Utils, wx
import PyUtils
class MemberDisplay(Utils.Observer):
"""
This class wraps an element and displays its content in a table with a grid sizer
"""
def __init__(self, table, sizer):
super(MemberDisplay,self).__i... | Python |
'''
Created on 2009-10-08
@author: beaudoin
'''
import wx
class ToggleBitmapButton(wx.BitmapButton):
def __init__(self, parent, id=wx.ID_ANY, bitmap=wx.NullBitmap, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr, selected=Fals... | Python |
from ToggleBitmapButton import ToggleBitmapButton | Python |
import ToolSets
import GLUITools
import Ext
from InfoTree import InfoTreeBasic, InfoTree
from GLPanel import GLPanel
from PythonConsole import PythonConsole
from ToolPanel import ToolPanel
from MainWindow import MainWindow
| Python |
'''
Created on 2009-09-14
@author: beaudoin
'''
import wx
import Utils
from MemberDisplay import MemberDisplay
# Unique list for all the images
_iconList = None
_iconDict = {}
_unknownIcon = '../data/ui/unknownIcon.png'
def _getIconList():
global _iconList
if _iconList is None :
_... | Python |
'''
Created on 2009-08-30
@author: beaudoin
This file contains a class that can be used as a python interpreter console
'''
import wx
import sys
class PythonConsole(wx.Panel):
"""A console to output python and a command line interprete.
You should only have one of this as it seize the standard ... | Python |
'''
Created on 2009-08-30
@author: beaudoin
'''
try:
import wx
from wx import glcanvas
except ImportError:
raise ImportError, "Required dependency wx.glcanvas not present"
try:
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
except ImportError:
... | Python |
'''
Created on 2009-08-25
Basic controller editor
@author: beaudoin
'''
import sys
sys.path += ['.']
import wx, App, math
movieResolution = (1280,720)
movieSetup = False # True if we want a movie
glMovie = False # True if we're only interested in recording the GL canvas
# False ... | Python |
'''
Created on 2009-08-28
@author: beaudoin
'''
from App.Proxys import *
data = RigidBody(
name = "ground",
locked = True,
cdps = [ BoxCDP( (-50,-1,-50), (50,0,50) ),
PlaneCDP( (0,1,0), (0,-1,0) ) ],
frictionCoeff = 2.5,
restitutionCoeff = 0.35 ) | Python |
'''
Created on 2009-08-28
@author: beaudoin
'''
from App.Proxys import *
data = RigidBody(
name = "ground",
locked = True,
cdps = [ PlaneCDP( (0,1,0), (0,0,0) ) ],
frictionCoeff = 2.5,
restitutionCoeff = 0.35 )
| Python |
'''
Created on 2009-08-28
@author: beaudoin
'''
from App.Proxys import *
data = RigidBody(
name = "dodgeBall",
meshes = [ ("../data/models/sphere.obj",(0.8,0,0,1)) ],
mass = 2.0,
moi = ( 0.2,0.2,0.2 ),
cdps = [ SphereCDP( (0,0,0), 0.1 ) ],
pos = (1000, 1000, 0.2),
frictionC... | Python |
'''
Created on 2009-08-28
@author: beaudoin
'''
from os import path
meshDir = path.join( path.dirname(__file__), "Meshes" )
colourDark = ( 0.5, 0.5, 0.5, 1 )
colourLight = ( 0.8, 0.8, 0.8, 1 )
from App.Proxys import *
data = Character(
name = "Bip",
... | Python |
from App.Proxys import *
data = SimBiController(
name = 'Turning',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 200.0, kd = 30.0, tauMax = 10000.0, scale = ( 1... | Python |
from App.Proxys import *
data = SimBiController(
name = 'Jumping',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 1000.0, kd = 100.0, tauMax = 10000.0, scale = (... | Python |
'''
Created on 2009-09-09
@author: beaudoin
'''
from App.Proxys import *
data = SimBiController(
name = 'Walking',
startingState = 0,
controlParamsList = [
ControlParams( joint = 'root', kp = 3000, kd = 300, tauMax = 10000, scale = ( 1, 0.2, 1 ) ),
ControlParams( join... | Python |
from App.Proxys import *
data = SimBiController(
name = 'Walking',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 200.0, kd = 30.0, tauMax = 10000.0, scale = ( 1... | Python |
'''
Created on 2009-09-09
@author: beaudoin
'''
from App.Proxys import *
data = SimBiController(
name = 'Running',
startingState = 0,
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
Contr... | Python |
from App.Proxys import *
data = SimBiController(
name = 'Running',
controlParamsList = [
ControlParams( joint = 'root', kp = 3000.0, kd = 300.0, tauMax = 10000.0, scale = ( 1.0, 0.2, 1.0 ) ),
ControlParams( joint = 'pelvis_torso', kp = 1000.0, kd = 100.0, tauMax = 10000.0, scale = (... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 300.0, kd = 100.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0, ... | Python |
'''
Created on 2009-09-09
@author: beaudoin
'''
from App.Proxys import *
data = SimBiController(
name = 'Walking',
startingState = 0,
controlParamsList = [
ControlParams( joint = 'root', kp = 3000, kd = 300, tauMax = 10000, scale = ( 1, 0.2, 1 ) ),
ControlParams( join... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = WalkController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 500.0, kd = 50.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0, 1.... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
from App.Proxys import *
data = IKVMCController(
name = '',
controlParamsList = [
ControlParams( joint = 'root', kp = 1000.0, kd = 200.0, tauMax = 200.0, scale = ( 1.0, 1.0, 1.0 ) ),
ControlParams( joint = 'pelvis_lowerback', kp = 75.0, kd = 17.0, tauMax = 100.0, scale = ( 1.0, 1.0,... | Python |
'''
Created on 2009-08-28
@author: beaudoin
'''
from os import path
meshDir = path.join( path.dirname(__file__), "Meshes" )
blue = ( 0.5, 0.6, 0.8, 1 )
green = ( 0.5, 0.8, 0.6, 1 )
red = ( 0.892, 0.716, 0.602, 1 )
gray = ( 0.5, 0.5, 0.5, 1 )
from App.Proxys import *
data = Character(
... | Python |
'''
Created on 2009-08-28
@author: beaudoin
'''
import PyUtils
import Core, wx
File = "Jumping"
#File = "Running"
#File = "SideRunning"
#File = "JumpWalk"
#File = "Walking"
#File = "Turning"
#PyUtils.load( "RigidBodies.FlatGround" )
PyUtils.load( "RigidBodies.FiniteFlatGround" )
PyUtils.loadMany( ... | Python |
'''
Created on 2009-11-26
@author: beaudoin
'''
import PyUtils
import Core, wx
import Controllers
PyUtils.load( "RigidBodies.FiniteFlatGround" )
PyUtils.loadMany( "RigidBodies.DodgeBall", 5 )
character = PyUtils.load( "Characters.BipV3" )
character.computeMass();
controller = Controllers.DanceControl... | Python |
'''
Created on 2009-08-28
@author: beaudoin
This file is just a proxy to indicate which one is the desire framework for typical applications
'''
import BipFramework | Python |
'''
Created on 2009-11-23
@author: beaudoin
'''
import PyUtils
PyUtils.load( "RigidBodies.FiniteFlatGround" ) | Python |
'''
Created on 2009-11-26
@author: beaudoin
'''
import PyUtils
import Core, wx
import Controllers
PyUtils.load( "RigidBodies.FiniteFlatGround" )
PyUtils.loadMany( "RigidBodies.DodgeBall", 5 )
character = PyUtils.load( "Characters.BipV3" )
character.loadReducedStateFromFile( "Data/Characters/BipV3/Contro... | Python |
from App.UtilFuncs import fancify
print fancify(
"""Character(
root = ArticulatedRigidBody(
name = "pelvis",
meshes = [ (path.join(meshDir, "pelvis_2_b.obj"), colourDark),
(path.join(meshDir, "pelvis_2_s.obj"), colourLight) ],
mass = 12... | Python |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | Python |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | Python |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.... | Python |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basena... | Python |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | Python |
#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| Python |
#!/usr/bin/env python
import math
import sys
try:
verilogfilename = sys.argv[1]
verilog = open(verilogfilename,'r')
PADS_PER_SIDE=int(sys.argv[2])
except:
print >> sys.stderr, "USAGE: %s mapped/design.v pads_per_side"%sys.argv[0]
sys.exit(2)
TOTALPADS=4*PADS_PER_SIDE
# Gather up all the pads to ... | Python |
#!/usr/bin/env python
for i in range(32):
print "PADINOUT U%d ( .DO(nBUSOUT[%d]), .DI(nBUSOUT[%d]), .OEN(OE), .YPAD(BUSOUT[%d]) );"%(i+3,i,i,i)
| Python |
#!/usr/bin/env python
import math
import sys
try:
verilogfilename = sys.argv[1]
verilog = open(verilogfilename,'r')
PADS_PER_SIDE=int(sys.argv[2])
except:
print >> sys.stderr, "USAGE: %s mapped/design.v pads_per_side"%sys.argv[0]
sys.exit(2)
TOTALPADS=4*PADS_PER_SIDE
# Gather up all the pads to ... | Python |
#!/usr/bin/env python
for i in range(32):
print "PADINOUT U%d ( .DO(nBUSOUT[%d]), .DI(nBUSOUT[%d]), .OEN(OE), .YPAD(BUSOUT[%d]) );"%(i+3,i,i,i)
| Python |
#!/usr/bin/env python
import math
import sys
try:
verilogfilename = sys.argv[1]
verilog = open(verilogfilename,'r')
PADS_PER_SIDE=int(sys.argv[2])
except:
print >> sys.stderr, "USAGE: %s mapped/design.v pads_per_side"%sys.argv[0]
sys.exit(2)
TOTALPADS=4*PADS_PER_SIDE
# Gather up all the pads to ... | Python |
#!/usr/bin/env python
for i in range(32):
print "PADINOUT U%d ( .DO(nBUSOUT[%d]), .DI(nBUSOUT[%d]), .OEN(OE), .YPAD(BUSOUT[%d]) );"%(i+3,i,i,i)
| Python |
#!/usr/bin/env python
import math
import sys
try:
verilogfilename = sys.argv[1]
verilog = open(verilogfilename,'r')
PADS_PER_SIDE=int(sys.argv[2])
except:
print >> sys.stderr, "USAGE: %s mapped/design.v pads_per_side"%sys.argv[0]
sys.exit(2)
TOTALPADS=4*PADS_PER_SIDE
# Gather up all the pads to ... | Python |
#!/usr/bin/env python
for i in range(32):
print "PADINOUT U%d ( .DO(nBUSOUT[%d]), .DI(nBUSOUT[%d]), .OEN(OE), .YPAD(BUSOUT[%d]) );"%(i+3,i,i,i)
| Python |
import pbkdf2
def hx(s):
return s.encode('hex').upper()
vectors=pbkdf2.PBKDF2_tests
for i in range(len(vectors)):
args, res = vectors[i]
print
print '******************************************************************'
print 'UNIT %d'%i
wu = list(pbkdf2.workunits(*args))
if len(wu) != 1:
... | Python |
# Generate a couple of 672-bit test vectors to feed through the HashBlock
from hashlib import sha1
import random
random.seed(12345)
datalen_bits=672
datalen=datalen_bits/8
def mkhdata():
return ''.join([chr(random.randint(0,255)) for x in range(datalen)])
def hx(s):
return s.encode('hex')
def cenc(s):
... | Python |
import hashlib
import math
import os
B = 64 # SHA-1 block size, bytes
hLen = 20 # SHA-1 hash output length, bytes.
def sha1(d):
return hashlib.sha1(d).digest()
def mkKo(P):
if len(P) == B:
return P
if len(P) > B:
return sha1(P)+chr(0)*(B-hLen)
if len(P) < B:
return P+chr(0)... | Python |
'''
Created on 21-03-2011
@author: maciek
'''
def formatString(format, **kwargs):
'''
'''
if not format: return ''
for arg in kwargs.keys():
format = format.replace("{" + arg + "}", "##" + arg + "##")
format = format.replace ("{", "{{")
format = format.replace("}", "}}")
for... | Python |
'''
Created on 21-03-2011
@author: maciek
'''
from IndexGenerator import IndexGenerator
from optparse import OptionParser
import os
import tempfile
import shutil
import logging
logging.basicConfig(level = logging.DEBUG)
parser = OptionParser()
parser.add_option('-n', '--app-name', action='store', dest='appName', hel... | Python |
'''
Created on 21-03-2011
@author: maciek
'''
from formater import formatString
import os
class IndexGenerator(object):
'''
Generates Index.html for iOS app OTA distribution
'''
basePath = os.path.dirname(__file__)
templateFile = os.path.join(basePath,"templates/index.tmpl")
releaseUrls = ""
... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.0'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 1.0
'''
try:
import json
except ImportError:
import simplejson as json
import time
import hmac
import uuid
import base64
import urllib
impo... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.04'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 2.
'''
try:
import json
except ImportError:
import simplejson as json
import time
import urllib
import urllib2
import logging
def _obj_ho... | Python |
#!/usr/bin/env python
"""
client module for memcached (memory cache daemon)
Overview
========
See U{the MemCached homepage<http://www.danga.com/memcached>} for more about memcached.
Usage summary
=============
This should give you a feel for how this module operates::
import memcache
mc = memcache.Client(... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import web
from framework import WebError
import urls
__author__ = 'Michael Liao'
class PageHandler(object):
def __init__(self):
self.mapping = {}
for s in dir(urls):
f = getattr(urls, s)
if callable(f) and ge... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = '1.04'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 2.
'''
try:
import json
except ImportError:
import simplejson as json
import time
import urllib
import urllib2
import logging
def _obj_ho... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import web
from framework import WebError
import urls
__author__ = 'Michael Liao'
class PageHandler(object):
def __init__(self):
self.mapping = {}
for s in dir(urls):
f = getattr(urls, s)
if callable(f) and ge... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Michael Liao'
import json
import time
from datetime import date
from datetime import datetime
from datetime import timedelta
import urllib2
import hashlib
import logging
import web
from weibo import APIClient
from framework import handler
from framework i... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
APP_KEY = 'hidden'
APP_SECRET = 'hidden'
| Python |
# mako/runtime.py
# Copyright (C) 2006-2011 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides runtime services for templates, including Context,
Namespace, and various helper funct... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.