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
Parallel.For(0, H, y => | |
{ | |
int j = y * 3 * W; | |
//for(; y<ymax; ++y) | |
{ | |
for (int x = 0; x < W; ++x) | |
{ | |
float a = max, | |
b = max, | |
c = max; |
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 win32com.client import Dispatch | |
# Get a NetworkListManager object | |
networkListManager = Dispatch("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}") | |
print networkListManager.IsConnectedToInternet |
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
colors = [ | |
(0,0,0), | |
(150,75,0), | |
(255,0,0), | |
(255,165,0), | |
(255,255,0), | |
(154,205,50), | |
(100,149,237), |
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
#!/bin/bash | |
# If this doesn't work, ensure you have UNIX line endings in this file | |
# (\n, not \r\n.) You can use Notepad++ to switch them. | |
# Cygwin package requirements: gcc-mingw, pkg-config | |
# If you want to pass -z to mkbundle: mingw-zlib1, mingw-zlib-devel | |
# crash immediately if anything bad happens | |
set -o errexit | |
set -o nounset |
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
""" | |
Usage: | |
(1) on host A: | |
python ploss.py recv <port> | |
(2) on host B: | |
python ploss.py send <A's hostname> <port from step 1> | |
(3) watch output on host B | |
""" |
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 matplotlib.pyplot as plt | |
from scipy import stats | |
import numpy as np | |
# parse CSV file | |
# format is <size>, <recv_time>, <send_time> | |
# recv_time and send_time may be on different clocks so we can only compare vs. mean | |
lines =[] | |
for l in open('client_data/0.csv'): | |
parts = [float(x) for x in l.strip().split(',')] |
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
LUA: | |
-- prints "nil" | |
print(undefined_var) | |
AS3: | |
// doesn't even compile, gives you "Access of undefined property" compiler error. | |
trace(undefined_var); |
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
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.IO; | |
using System.Linq; | |
using Microsoft.Xna.Framework.Content; | |
namespace Platformer | |
{ | |
/// <summary> |
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
#include <LiquidCrystal.h> | |
// Notes: | |
// - LCD has an on-board current limiting resistor for the LED backlight (510 ohm I think.) | |
// So it can be connected directly to +5V and GND. | |
// LCD backlight LED draws 34 mA. | |
// - The whole LCD only draws about 35-36 mA, so the backlight is the majority of the power. | |
// - The included contrast trim pot is 10K. | |
// - Line 1 wraps to line 3 and line 2 wraps to line 4, although LiquidCrystal::setCursor() works(!) | |
// So LCDWrite may require some adjustment... |
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
#include <SPI.h> | |
#define CE_0 2 | |
#define CE_1 3 | |
#define CS_0 4 | |
#define CS_1 5 | |
#define IRQ_0 6 | |
#define IRQ_1 7 | |
#define PIN_SS 10 |
OlderNewer