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
#!/bin/bash | |
#Initial wifi interface configuration | |
ifconfig $1 up 10.0.0.1 netmask 255.255.255.0 | |
sleep 2 | |
###########Start dnsmasq, modify if required########## | |
if [ -z "$(ps -e | grep dnsmasq)" ] | |
then | |
dnsmasq | |
fi |
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
-- File "seemingly-impossible.hs", | |
-- automatically extracted from literate Haskell | |
-- file http://www.cs.bham.ac.uk/~mhe/papers/seemingly-impossible.html | |
-- | |
-- Martin Escardo, September 2007 | |
-- School of Computer Science, University of Birmingham, UK | |
-- | |
-- These algorithms have been published and hence are in the | |
-- public domain. | |
-- |
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
#[bench] | |
fn test_overflow(b: &mut Bencher) { | |
let nums = [0i, ..1000000]; | |
b.iter(|| { | |
let mut x = 0i; | |
for i in range(0, nums.len()) { | |
x = nums[i]; | |
} | |
}); | |
} |
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
#![feature(simd)] | |
#![allow(experimental)] | |
extern crate test; | |
extern crate time; | |
use std::simd::f64x2; | |
use std::sync::{Arc,Future}; | |
static CHUNKS: uint = 4; | |
static POINTS: uint = 10000000; |
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
Categories below - after internal discussion we reduced the reparations as follows: | |
Severe - sacrifice captial or other major city: | |
Diablito (Swinging London) | |
LauraChristine (Complete) | |
Xandrosch | |
Keeves (Almost complete) | |
Sooner | |
Wuzzel/Wuzzy |
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
@Kroll.method | |
public void getWirelessNetworks(KrollInvocation invocation) { | |
if (Util.gEmulatorMode == false) { | |
wifiMgr = (WifiManager) invocation.getTiContext().getActivity().getSystemService(Context.WIFI_SERVICE); | |
receiver = new WifiReceiver(); | |
invocation.getTiContext().getActivity().registerReceiver(receiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); | |
wifiMgr.startScan(); | |
} | |
} | |
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[] x = [1,2,3,4,5] | |
int[] y; | |
for(int i = 0; i < x.length; i++) { | |
y[i] = Math.exp(x[i], 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
x = 1...5 | |
y = x.map {|n| n**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
class Device | |
attr_accessor :measurements | |
def initialize | |
@measurements = [] | |
end | |
end | |
class Measurement | |
attr_accessor :frequency, :points, :magnitudes |
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
last_file = Dir.open('.').select{|d| d.include?("output")}.sort.last | |
current_session = last_file ? last_file.match(/[0-9]{1,}/).to_s.to_i + 1 : 0 | |
File.open("output#{current_session}.txt", 'a') do |f| | |
puts "Session: #{current_session}" | |
while thought = gets != "that's all for now\n" | |
print "\e[2J\e[f" # clear the screen. | |
f.write(thought) | |
end | |
end |
OlderNewer