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
def adc_voltage_to_ohms(adc_value): | |
v = (adc_value * 5.0)/4096.0 | |
return -1000/((0.0174*v) - 0.925411808) -1000 | |
def ohms_to_celcius(ohms): | |
return (ohms - 100) * (138.4 / 100.0) |
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
class Ball { | |
float angle = radians(50.0); | |
float velocity = 50.0; | |
float i = velocity * cos(angle); | |
float j = velocity * sin(angle); | |
int x = 10, y = 250; | |
float t = 0.1; | |
float deltaT = t; | |
int lastX = x, lastY = 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
#!/usr/bin/env perl | |
use warnings; use strict; use Data::Dumper; | |
sub foo { | |
my ($ref1, $ref2) = @_; | |
my @arr1 = @{$ref1}; | |
my @arr2 = @{$ref2}; | |
print Dumper \@arr1; | |
print Dumper \@arr2; |
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
val arr = Array(1, 2, 2, 3, 4, 5) | |
println("I drank a very fine beer, when I was " + (0 /: arr) { _+_ }) |
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
<script> | |
setInterval(function() { | |
var images = document.getElementsByTagName('img'); | |
for(var i = 0; i < images.length; i++) { | |
var image = images[i]; | |
var source = image.src; | |
if( source.indexOf('?') != -1 ) { | |
source = source.substring(0, source.indexOf('?')); | |
} | |
image.src = source + '?' + Math.floor(Math.random()*1000000); |
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
for fname in `svn stat | grep ^M | awk '{print $2}'` ; do mate $fname ; done |