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
from time import sleep, time | |
from threading import Thread | |
class Worker(Thread): | |
def run(self): | |
count = 0 | |
while True: | |
print "worker says hi. %r" % time() | |
sleep(0.1) |
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
<?php | |
$item = json_decode('{"key": "value"}'); | |
print_r($item); | |
$other_item = json_decode('{"key": "value"'); | |
print_r($other_item); | |
echo is_null($other_item); | |
$things = ["one": 1, "two": 2]; |
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
<?php | |
$item = json_decode('{"key": "value"}'); | |
print_r($item); | |
$other_item = json_decode('{"key": "value"'); | |
print_r($other_item); | |
echo is_null($other_item); |
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
{ | |
"playerstats": { | |
"steamID": "76561198040832845", | |
"gameName": "ValveTestApp260", | |
"stats": [ | |
{ | |
"name": "total_kills", | |
"value": 1895 | |
}, | |
{ |
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
{ | |
"playerstats": { | |
"steamID": "76561197972495328", | |
"gameName": "Team Fortress 2", | |
"stats": [ | |
{ | |
"name": "Scout.accum.iBuildingsDestroyed", | |
"value": 112 | |
}, | |
{ |
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
{ | |
"game": { | |
"gameName": "ValveTestApp260", | |
"gameVersion": "237", | |
"availableGameStats": { | |
"stats": [ | |
{ | |
"name": "total_kills", | |
"defaultvalue": 0, | |
"displayName": "Enemy players killed" |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
) | |
var options struct { | |
s string | |
i int |
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
9100 => int clockPort; | |
"localhost" => string clockHost; | |
OscSend send; | |
send.setHost(clockHost, clockPort); | |
send.startMsg("/subscribe", "si"); | |
send.addString("localhost"); | |
send.addInt(9000); | |
OscRecv recv; |
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
size(300, 300); // size of the drawing | |
background(255); // the background should be white | |
strokeWeight(4); // make the lines we draw 4 pixels wide | |
stroke(0); // things we draw will be black | |
line(0, 0, 20, 20); // draw a black line from the corner of the screen to 10, 10 | |
translate(150, 150); // we're going to move to the middle of the screen. | |
stroke(255, 0, 0); // things we draw will be red. | |
line(0, 0, 20, 20); // draw a red line from the middle of the screen, to middle.x + 10, middle.y + 10 |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
err := fmt.Errorf("this is an error.") | |
// these two lines print the same thing when err is non-nil |