Skip to content

Instantly share code, notes, and snippets.

package earthquake_detector;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
import com.buglabs.bug.accelerometer.pub.IAccelerometerSampleProvider;
import com.buglabs.bug.swarm.connector.pub.ISwarmConnector;
import com.buglabs.application.ServiceTrackerHelper;
package earthquake_detector;
import java.io.IOException;
import java.util.Map;
import com.buglabs.bug.accelerometer.pub.AccelerometerSample;
import com.buglabs.bug.accelerometer.pub.IAccelerometerSampleProvider;
import com.buglabs.bug.swarm.connector.pub.IReplicatedModel;
import com.buglabs.bug.swarm.connector.pub.IReplicationPolicy;
import com.buglabs.bug.swarm.connector.pub.ISwarmConnector;
package earthquake_detector;
import java.util.Map;
import com.buglabs.bug.swarm.connector.pub.ISyncFilter;
/**
* Given a previous sample and the current sample, determine if the difference is great enough to pass data to the server.
*
*/
public class AccelerometerSampleFilter implements ISyncFilter {
package earthquake_detector;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
import com.buglabs.bug.accelerometer.pub.IAccelerometerSampleProvider;
import com.buglabs.bug.module.gps.pub.IPositionProvider;
import com.buglabs.bug.swarm.connector.pub.ISwarmConnector;
import com.buglabs.application.ServiceTrackerHelper;
package earthquake_detector;
import java.io.IOException;
import java.util.Map;
import org.osgi.util.position.Position;
import com.buglabs.bug.accelerometer.pub.AccelerometerSample;
import com.buglabs.bug.accelerometer.pub.IAccelerometerSampleProvider;
import com.buglabs.bug.module.gps.pub.IPositionProvider;
package earthquake_detector;
import java.util.Map;
import com.buglabs.bug.module.gps.pub.IPositionProvider;
import com.buglabs.bug.swarm.connector.pub.ISyncFilter;
/**
* Given a previous sample and the current sample, determine if the difference is great enough to pass data to the server.
*
* @author kgilmer
@ckundo
ckundo / githire_troll
Created January 26, 2012 18:50
clone ALL the things (githire.com troll)
$ git clone git://github.com/joyent/node.git && cd ./node
$ git remote set-url origin git@github.com:ckundo/node.git
$ git push origin master
$ ???
$ profit!!!!1
@ckundo
ckundo / nws-alert-sample.rb
Created April 20, 2012 21:27
parsed NWS weather alert
{"xmlns"=>"urn:oasis:names:tc:emergency:cap:1.1",
"identifier"=>
"NOAA-NWS-ALERTS-CA124CA67E64F4.SpecialWeatherStatement.124CA68BE340CA.MTRSPSMTR.ecd31f12c4bd3c764af59e8e38f87c9f",
"sender"=>"w-nws.webmaster@noaa.gov",
"sent"=>"2012-04-20T04:57:00-07:00",
"status"=>"Actual",
"msgType"=>"Alert",
"scope"=>"Public",
"note"=>
"Alert for Coastal North Bay Including Point Reyes National Seashore; East Bay Hills and the Diablo Range; East Bay Interior Valleys; Mountains Of San Benito County And Interior Monterey County Including Pinnacles National Monument; North Bay Interior Valleys; North Bay Mountains; Northern Monterey Bay; Northern Salinas Valley, Hollister Valley and Carmel Valley; San Francisco; San Francisco Bay Shoreline; San Fransisco Peninsula Coast; Santa Clara Valley Including San Jose; Santa Cruz Mountains; Santa Lucia Mountains and Los Padres National Forest; Southern Monterey Bay and Big Sur Coast; Southern Salinas Valley, Arroyo Seco and Lake San Antonio (California) Issued by the Nationa
@ckundo
ckundo / simple_form.html
Created October 14, 2012 21:29 — forked from runemadsen/simple_form.html
Simple Form Example
<!DOCTYPE html>
<html>
<head>
<title>Simple Form Example</title>
<style type="text/css">
body {
width: 30%;
background: white;
}
h1 {
{"file_title"=>"report",
"file_data"=>
{"curr_custs_aff"=>
{"areas"=>
[{"area_name"=>"CONED",
"areas"=>
[{"area_name"=>"Bronx",
"areas"=>
[{"area_name"=>"Central Bronx",
"custs_out"=>2,