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
/* | |
* This simulation demos using the routing table to send packets between chips. | |
* The NW, SE, and SW chips are all sending a packet to every core on the NE chip. | |
* On receiving a packet, the core simply prints an acknowledgement. | |
*/ | |
#include "spin1_api.h" | |
#define NORTH 3 | |
#define SOUTH 2 |
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
var person = prompt("Your name?"); | |
if ( person!=null ) { | |
x = "Hi " + person + "!"; | |
alert( x ); | |
} |
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
<html> | |
<body> | |
<script> | |
var person = prompt("What's your name?","Grace Hopper"); | |
if ( person!=null ) { | |
x = "Hi " + person + "!"; | |
alert( x ); | |
} | |
</script> |
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
<html> | |
<body> | |
<script> | |
var str = "the quick brown fox" | |
var french = str.replace("the", "le") | |
alert(french) | |
</script> | |
</body> |
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
<html> | |
<body> | |
<script> | |
var d = new Date() | |
var date = d.getDate() | |
if ( date > 20 ) { | |
alert("the month is almost over") | |
} |
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 System.Random (getStdGen, randomR) | |
import Data.MultiSet (fromList, toOccurList) | |
import Data.List (maximum) | |
import Data.Function (on) | |
import Data.List (sortBy) | |
import Graphics.Google.Chart | |
import Hledger.Cli.Utils (openBrowserOn) | |
step xs g = (newItem : xs, newG) | |
where (i, newG) = pick (length xs) g |
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
Knowing that mentality, | |
taking straightforwardness as basic, | |
taking the real mind as the Way, | |
practicing martial arts in the broadest sense, | |
thinking correctly, clearly, and comprehensively, | |
taking emptiness as the Way, | |
you see the Way as emptiness. | |
In emptiness there is good but no evil. | |
Wisdom exists, logic exists, the Way exists, mind is empty. |
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
#!/usr/bin/env python | |
import time | |
import os | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
DEBUG = 1 | |
# read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) | |
def readadc(adcnum, clockpin, mosipin, misopin, cspin): |
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 doAction = false; | |
if (condition) { | |
doAction = true; | |
} else { | |
doAction = false; | |
} | |
if (doAction) { | |
// ... |
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
// Declare your template and image | |
Mat* templ = ...; | |
Mat* img = new Mat(iplImg, true); | |
/// Source image to display | |
Mat img_display; | |
img -> copyTo( img_display ); | |
/// Create the result matrix | |
int result_cols = img -> cols - templ -> cols + 1; |
OlderNewer