Skip to content

Instantly share code, notes, and snippets.

@enijkamp
enijkamp / usbreset
Created May 5, 2014 20:43
usbreset
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <linux/usbdevice_fs.h>
// send reset to USB device
int main(int argc, char **argv)
{
@enijkamp
enijkamp / gist:bac4f67658e3a08bbe3d
Created May 15, 2014 14:35
TestObject Public IPs
5.9.102.226
5.9.5.210
5.9.108.238
85.10.246.164
78.47.166.109
217.9.62.21
5.9.24.243
public class DumpCommand extends Command {
private static final File DEFAULT_DUMP_FILE = new File(
Environment.getExternalStorageDirectory(), "window_dump.xml");
public DumpCommand() {
super("dump");
}
@Override
5091970-01-01 01:00:00.000 WARN: ? : FATAL EXCEPTION: main
5101970-01-01 01:00:00.000 WARN: ? : Process: com.example.avatarservice.avatarservice, PID: 28516
5111970-01-01 01:00:00.000 WARN: ? : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.avatarservice.avatarservice/activities.Landing}: android.os.NetworkOnMainThreadException
5121970-01-01 01:00:00.000 WARN: ? : at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
5131970-01-01 01:00:00.000 WARN: ? : at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
5141970-01-01 01:00:00.000 WARN: ? : at android.app.ActivityThread.access$800(ActivityThread.java:135)
5151970-01-01 01:00:00.000 WARN: ? : at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
5161970-01-01 01:00:00.000 WARN: ? : at android.os.Handler.dispatchMessage(Handler.java:102)
5171970-01-01 01:00:00.000 WARN: ? : at android.os.Looper.loop(Looper.java:136)
5181970-01-01 01:00:00.000 WARN: ? : at android.
class ParseTask extends AsyncTask<String, Void, ParseResult> {
protected ParseResult doInBackground(String url) {
URL url= new URL(url);
// do your network IO here
}
}
new ParseTask().execute(url)
<section class="main">
<div class="container">
<h2><span>Publications</span></h2>
{% for r in site.data.publications %}
<div class="card-highlight">
<h5><a href="{{ r.url }}" target="_blank">{{ r.name }}</a></h5>
<p>{{ r.authors }} ({{ r.venue }})</p>
</div>
{% endfor %}
</div>
First, given the PDF we determine the corresponding CDF. While the following notation is mathematically not entirely correct, it simplifies the illustraion:
f1(x) = x/144 if 0 < x < 12
f2(x) = (24-x)/144 if 12 < x < 24
F1(x) = x^2/288 + c if 0 < x < 12
F2(x) = x/6-x^2/288 + c if 12 < x < 24
Next, we find the probabilities that:
3
4533 Campus Dr, Irvine, CA
1111 Figueroa St, Los Angeles, CA
3799 S Las Vegas Blvd, Las Vegas, NV
5
LATLONG
STEPS
TOTALTIME
TOTALDISTANCE
ELEVATION
# python wrapper functions for R pseudo random number generators
# allows us to compare numerical results between R and python implementations
# source activate <env>
# pip install rpy2 --upgrade
import numpy as np
import readline
import rpy2.robjects as robjects
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{hhline}
\usepackage{multirow}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}}
\newcommand\mr[1]{\multirow{3}{5em}{#1}}
\begin{document}
\begin{tabular}{|c||c|c|c|c|}
\mc{} & \mc{} & \mc{AOT} & \mc{baseline} & \mc{ours} \\ \hline