Skip to content

Instantly share code, notes, and snippets.

View benwilson512's full-sized avatar

Ben Wilson benwilson512

  • CargoSense
  • Fairfax, VA
View GitHub Profile
#!/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
-- 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.
--
#[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];
}
});
}
#![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;
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
@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();
}
}
int[] x = [1,2,3,4,5]
int[] y;
for(int i = 0; i < x.length; i++) {
y[i] = Math.exp(x[i], 2);
}
x = 1...5
y = x.map {|n| n**2 }
class Device
attr_accessor :measurements
def initialize
@measurements = []
end
end
class Measurement
attr_accessor :frequency, :points, :magnitudes
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