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
// m:2-2=10 for scanning for URL frames (00 = UID, 20 = TLM) | |
BeaconParser eddystoneURLBeaconParser = new BeaconParser().setBeaconLayout("s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-13,i:14-19"); | |
beaconManager.getBeaconParsers().add(eddystoneURLBeaconParser); | |
//....(search for beacons with didRangeBeaconsInRegion() etc.) | |
String url = new String(beacon.getId1().toByteArray(), "UTF-8"); |
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
#include <lmic.h> | |
#include <hal/hal.h> | |
#include <SPI.h> | |
// TODO: fill in your credentials here | |
static const PROGMEM u1_t NWKSKEY[16] = ; | |
static const u1_t PROGMEM APPSKEY[16] = ; | |
static const u4_t DEVADDR = ; | |
void os_getArtEui (u1_t* buf) { } |
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
# -*- coding: utf-8 -*- | |
import paho.mqtt.client as mqtt | |
import time | |
import json | |
import base64 | |
def on_connect(client, userdata, flags, rc): | |
print("Connected with result code " + str(rc)) | |
dev_eui = 'ZZZZZ' |
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
import android.os.Handler; | |
import android.os.Looper; | |
import com.squareup.otto.Bus; | |
public class MainThreadBus extends Bus { | |
private final Handler mainThread = new Handler(Looper.getMainLooper()); | |
@Override public void post(final Object event) { | |
if (Looper.myLooper() == Looper.getMainLooper()) { |
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
(ns com.freiheit.clojure.appengine.appengine-local | |
(:use | |
[compojure.http routes servlet helpers] | |
clojure.contrib.test-is | |
compojure.server.jetty | |
[clojure.contrib def str-utils duck-streams]) | |
(:require | |
[clojure.contrib.logging :as log]) | |
(:import | |
[com.google.appengine.api.labs.taskqueue.dev LocalTaskQueue] |
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
(defn pearson-fast | |
[v1 v2] | |
(let [dim (double (count v1)) | |
meanv1 (/ (areduce v1 i ret 0 | |
(+ ret (aget v1 i))) dim) | |
meanv2 (/ (areduce v2 i ret 0 | |
(+ ret (aget v2 i))) dim) | |
sum (areduce v1 i ret 0 | |
(+ ret (* (- (aget v1 i) meanv1) | |
(- (aget v2 i) meanv2)))) |
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
(defn euclidean | |
"berechnet den (modifizierten) euklidischen abstand zwischen zwei usern" | |
[active other] | |
(Math/sqrt (reduce + (map (fn [movie] | |
(let [features (item-map movie)] | |
(reduce + (map (fn [feat] (diff active other movie feat)) features)) )) | |
(common-items active other))))) |
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
(defn process-file | |
[file-name line-func line-acc] | |
(reduce line-func line-acc (read-lines file-name))) | |
(defn process-line-data | |
[acc line] | |
(let [l (.split line "\t")] | |
(assoc acc (first l) (vec (rest l))))) |
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
### Keybase proof | |
I hereby claim: | |
* I am dermatthias on github. | |
* I am dermatthias (https://keybase.io/dermatthias) on keybase. | |
* I have a public key whose fingerprint is AC02 AA14 BA11 3F8D E75E 9D0A D870 E61F DA5A 94C4 | |
To claim this, I am signing this object: |