This file contains 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
boolean view[7][7]; | |
void setup() { | |
for (int i = 0 ; i < 14 ; i++) { | |
pinMode(i, OUTPUT); | |
digitalWrite(i, LOW); | |
} | |
for (int x = 0 ; x < 7 ; x++) { | |
for (int y = 0 ; y < 7 ; y++) { |
This file contains 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 Zen.*; | |
public class MyGame extends ZenGame { | |
// What code should happen when you click run? | |
public static void main(String[] args) { | |
MyGame game = new MyGame(); | |
game.setName("My first game!"); | |
game.setSize(800, 600); | |
game.run(); |
This file contains 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 random | |
currentround = 0 | |
rounds = 5 | |
while currentround < rounds: | |
currentround + 1 | |
answer = input("Select rock paper or scissors") | |
while answer != "rock" and answer != "paper" and answer != "scissors": | |
print "Bad answer" |
This file contains 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
int getKey() { | |
int A = 2; | |
while (A <= 5) { | |
pinMode(A, OUTPUT); | |
digitalWrite(A, HIGH); | |
int B = 6; | |
while (B <= 9) { | |
pinMode(B, OUTPUT); | |
pinMode(B, INPUT); | |
if (digitalRead(B) == HIGH) { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> | |
<script type="text/javascript" src="http://cdn.firebase.com/v0/firebase.js"></script> | |
<script type="text/javascript" src="https://cdn.firebase.com/js/simple-login/1.4.1/firebase-simple-login.js"></script> | |
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css"> | |
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> | |
<style> |
This file contains 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
$(document).ready(function() { | |
$('#productList').empty(); | |
for (var i in products) { | |
var product = products[i]; | |
$('#productList').append( | |
$('<div></div>') // make a div | |
.addClass('col-md-4 portfolio-item') | |
.append( | |
$('<a></a>') | |
.attr('href', 'linktome.html') |
This file contains 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
/* | |
Web Server | |
A simple web server that shows the value of the analog input pins. | |
using an Arduino Wiznet Ethernet shield. | |
Circuit: | |
* Ethernet shield attached to pins 10, 11, 12, 13 | |
* Analog inputs attached to pins A0 through A5 (optional) | |
This file contains 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
--- in example.target --- | |
WEB_LOCATION=1.2.3.4 # remote location | |
PEM_LOCATION=example.pem # pem file location | |
DIR_LOCATION=/path/to/your/website # directory location | |
REM_LOCATION=~/htdocs # the directory on the server to write to | |
REM_USER=admin # change to the server's user account name | |
--- in upload --- | |
source $1.target |
This file contains 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
my $cmd = ""; | |
my $base = "/path/to/dlogger.pl"; # Change this to the path where the provided PERL utility is kept | |
my $auth = " admin:1234"; # Change this to the authentication you use to log in to your switch | |
my $status = ""; | |
my $buffer = ""; | |
my $temp = ""; | |
my @outlets; | |
my @outletstatus; |
This file contains 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
Templatize[source_, replacement_] := If[StringQ[replacement], | |
StringReplace[source, {"<!--$[]-->" -> ToString[replacement]}, 1], | |
If[ListQ[replacement] && Length[replacement] > 0, | |
Templatize[Templatize[source, First[replacement]], | |
Rest[replacement]], | |
If[Head[replacement] === Rule, | |
If[ListQ[Last[replacement]], | |
Templatize[ source, (First[replacement] -> #) & /@ Last[replacement]], | |
StringReplace[ source, {"<!--$[" <> ToString[First[replacement]] <> "]-->" ->ToString[Last[replacement]]}, 1]], source]]] |