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) |
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
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
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
# 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
#ifndef FOOTEST_H | |
#define FOOTEST_H | |
class FooTest : public Test | |
{ | |
public: | |
// List of shapes | |
b2Body *dynamicBody; // The players shape | |
b2Body* lowerground; // The horizontal platform | |
b2Body* sideground; // The vertical platform |
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
sudo sh | |
apt-get update | |
apt-get install python2.7 | |
apt-get install python-numpy | |
apt-get install python-opencv | |
apt-get install eclipse-platform | |
apt-get install eclipse-cdt | |
apt-get install g++ | |
apt-get install clang | |
apt-get install git |
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
//Create an RGB image from a grayscale image. Grayscale is grayScaleImage | |
result_image = cvCreateImage(cvGetSize(grayScaleImage),IPL_DEPTH_8U, 3); | |
cvMerge(grayScaleImage, grayScaleImage, grayScaleImage, NULL, result_image); |
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
bool keys[255]; | |
// constructor | |
EventHandler::EventHandler() | |
{ | |
for(int i = 0; i < 255; i++) | |
keys[i] = false; | |
} | |
EventHandler::keyPressed(unsigned char key) |
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 time | |
from threading import * | |
key = "lol" | |
def getInput(): | |
global key | |
lock = Lock() | |
while True: | |
with lock: | |
key = raw_input() |
OlderNewer