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
// Main method to call to get an integer. | |
// It will block until an integer followed by a non-digit delimiter is read from the serial input stream. | |
int getInt() { | |
return getInt(0); | |
} | |
// Recursive helper method. | |
// @param sum - an accumulator that "builds" the next number, character by character. | |
int getInt(int sum) { | |
// Read a single character from the serial input stream. |
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
(*ASCIIrange = { " ","` ",". "," .","..",".:",":.","::",":#","##","#@","x@","o@","@@","@X","XX"};*) | |
(*ASCIIrange = { " "," ",".","..",".:","::",":i","io","ex","pq","Xq","AG","ZY","VW"};*) | |
(* Produces the best results by randomizing letters using a held random choice call *) | |
ASCIIrange = {" ", Hold[RandomChoice[{" ", " `"}]], ". ", "..", | |
Hold[RandomChoice[{".:", ":."}]], | |
Hold[RandomChoice[{"::", ";:", ":;", ";;"}]], | |
Hold[RandomChoice[{":x", "x:"}]], | |
Hold[RandomChoice[{"io", "ae", "oc"}]], | |
Hold[RandomChoice[{"yj", "tp", "qw"}]], |
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
StringTakeUntil[str_, delim_] := | |
If[StringMatchQ[str, delim ~~ ___] || StringLength[str] == 0, "", | |
StringTake[str, 1] <> StringTakeUntil[StringDrop[str, 1], delim]]; |
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]]] |
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
--- 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
/* | |
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
$(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
<!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
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) { |
OlderNewer