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
| import numpy as np | |
| from time import time | |
| from random import random | |
| from pylab import * | |
| counter = {'ci':0,'cj':0,'ck':0,'cfp':0,'hyp':0} #accessing arrays once they are constructed is O(1) | |
| hyp=0 | |
| def nlog(base,value): | |
| return(np.log(value)/np.log(base)) | |
| def ranRange(n,counterkey):#assume o(n^2) |
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
| import sys | |
| import os | |
| #import and init pygame | |
| import pygame | |
| import numpy | |
| from time import sleep | |
| pygame.init() | |
| scale = 3 | |
| def getPos(angle,X,Y,o,i): |
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
| ############################################# | |
| #Package is liscensed by # | |
| # KrewnSolutions /< /? [- \/\/ |\| # | |
| #http://dev.perl.org/licenses/artistic.html # | |
| #liscense holder: kpie314(a)gmail.com # | |
| ############################################# | |
| library(Ryacas) | |
| x<-Sym("x") | |
| derivToFunc<-function(d){ |
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 getDow(n): | |
| dotw = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Firday","Saturday"] #Days of the week | |
| dow = time.strftime("%A") #Day of the week | |
| c = 0 | |
| while(dotw[c]!=dow): | |
| c+=1 | |
| dom = time.strftime("%d") #Day of the monthwClock = [a for a in dot] | |
| d = (c+int(dom)+n)%7-1 | |
| return(dotw[d]) |
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
| import sys | |
| import os | |
| class pointCharge: | |
| def __init__(self): | |
| self.location = {} | |
| self.location['x']=0 | |
| self.location['y']=0 | |
| self.location['z']=0 | |
| self.charge = 0 | |
| def setLocation(self,p): |
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
| newPointer=function(inputValue){ # see : http://www.stat.berkeley.edu/~paciorek/computingTips/Pointers_passing_reference_.html | |
| object=new.env(parent=globalenv()) | |
| object$value=inputValue | |
| class(object)='pointer' | |
| return(object) | |
| } | |
| exDb <- function(t,i,v = F){#Check if element i exists in t | |
| r = F | |
| tryCatch({ | |
| temp <- newPointer(t[[i]]) # Attempt to access variable location in question |
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
| import sys | |
| import os | |
| class pointCharge: #An object with a location and a charge | |
| def __init__(self): | |
| self.location = {} | |
| self.location['x']=0 | |
| self.location['y']=0 | |
| self.location['z']=0 | |
| self.charge = 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
| <intro> | |
| # Test based Development | |
| # Junit | |
| # Eclipse Debugger | |
| # Inheritance(Is a kind of) | |
| # Composition(Is a part of) | |
| # Try/Catch | |
| </intro> | |
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
| import sys | |
| name = sys.argv[1] | |
| link = sys.argv[2] | |
| op='' | |
| op+='<!DOCTYPE html>\n' | |
| op+='<html>\n' | |
| op+='<head>\n' | |
| op+='<meta http-equiv="Refresh" content="0;'+link+'">\n' | |
| op+='</head>\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
| # __ __ ______ ______ ______ ______ ______ | |
| #/\ \ / / /\ ___\ /\ ___\ /\__ _\ /\ __ \ /\ == \ | |
| #\ \ \'/ \ \ __\ \ \ \____ \/_/\ \/ \ \ \/\ \ \ \ __< | |
| # \ \__| \ \_____\ \ \_____\ \ \_\ \ \_____\ \ \_\ \_\ | |
| # \/_/ \/_____/ \/_____/ \/_/ \/_____/ \/_/ /_/ | |
| # kpie314(at)gmail.com | |
| # github.com/krewn -- Artistic License | |
| # ______ __ ______ __ _____ ______ | |
| #/\ ___\ /\ \ /\ ___\ /\ \ /\ __-. /\ ___\ | |
| #\ \ __\ \ \ \ \ \ __\ \ \ \____ \ \ \/\ \ \ \___ \ |