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
# Sender client | |
import socket | |
HOST = '127.0.0.1' # The remote host | |
PORT = 1756 # The same port as used by the server | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((HOST, PORT)) | |
print"Please enter your message:" | |
msg = raw_input() |
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 socket | |
#Create the socket connection | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind(("", 1756)) # Bind the connection | |
s.listen(1) # Listen for the connection. Will not advance unless a connection is received | |
conn, addr = s.accept() # Accepts a connection | |
print "Listening..." # Debug | |
while 1: | |
data = conn.recv(1024) # Receive transmission |
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
function resetDailyStats() | |
//EFFECTS: Creates a new object to store in the array of stats, | |
// resets the various station's stats | |
{ | |
console.log("resetDailyStats() was called"); | |
App.tempStats = App.Stats.create(); | |
var day = App.SimObject.get('simDay'); | |
console.log(day); | |
console.log(App.tempStats.get('greenIdle')); | |
App.SimObject.set(simStats[day], App.tempStats); |
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
#Donal Mac Carthy, simple projectiles | |
import math | |
#Calculates the distance in the specified direction at the given time | |
def distattime(u, a, t): | |
#A formula | |
x = (u*t)+(0.5*a*t*t) | |
#Ignore if the distance is negative | |
if( x >= 0): | |
return x |
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
#I assume here that all the memory addresses are set up correctly. | |
IMPORT main | |
EXPORT start | |
start | |
ldr r0,=VICVectAddr0 | |
ldr r1,=irqhan | |
str r1,[r0] ; associate our interrupt handler with Vectored Interrupt 0 | |
ldr r0,=VICVectCtrl0 | |
mov r1,#Timer0ChannelNumber+(1<<IRQslot_en) |
NewerOlder