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 <iostream> | |
#include <sstream> | |
#include <functional> | |
#include <vector> | |
template <typename T, typename U> | |
U foldLeft(const std::vector<T>& data, | |
const U& initialValue, | |
const std::function<U(U,T)>& foldFn) { | |
typedef typename std::vector<T>::const_iterator Iterator; |
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
//To compile: | |
//cc vlcsms.c -o vlcsms -lvlc | |
//This source is by Tim Sheerman-Chase and it is released as public domain. | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <inttypes.h> | |
#include <vlc/vlc.h> |
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 com.googlecode.lanterna.TextColor | |
import com.googlecode.lanterna.gui2._ | |
import com.googlecode.lanterna.screen.Screen | |
import com.googlecode.lanterna.screen.TerminalScreen | |
import com.googlecode.lanterna.terminal.DefaultTerminalFactory | |
object Main { | |
def main(args:Array[String]) = { | |
val terminalFactory = new DefaultTerminalFactory | |
terminalFactory.setSuppressSwingTerminalFrame(true) |
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
trait ListAdapter[+T] extends Reactive { | |
def isEmpty:Boolean = size <= 0 | |
def indexes:Range = 0 to maxIndex step 1 | |
def maxIndex:Int = size - 1 | |
def apply(index: Int):T = item(index) | |
def size:Int | |
def item(index: Int):T | |
def createItemString(index: Int): String | |
} |
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
package typedactordemo | |
import akka.actor._ | |
import akka.dispatch.Future | |
import akka.pattern.ask | |
import akka.util.Timeout | |
import akka.util.duration._ | |
case class Request(payload: String) | |
case class Response(payload: String) |
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 | |
PORT=5555 | |
echo "Getting device ip..." | |
PHONE_IP=`adb shell ip -f inet addr show wlan0 | grep inet | cut -d: -f2 | awk '{ print $2 }' | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"` | |
echo "Device ip: $PHONE_IP" | |
echo "Enabling adb tcpip on port $PORT" | |
adb tcpip $PORT | |
echo "adb tcpip enabled. Connecting..." | |
adb connect $PHONE_IP:$PORT | |
echo "Adb over wifi connected. Now you can remove your usb cable." |
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.app.AlarmManager; | |
import android.app.IntentService; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import java.io.*; | |
import java.net.*; |
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 A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
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
language: android | |
os: | |
- linux | |
jdk: | |
- oraclejdk8 | |
cache: | |
directories: | |
- $HOME/.m2/repository | |
- $HOME/.sbt | |
- $HOME/.ivy2 |
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
box: dant3/android | |
build: | |
steps: | |
- script: | |
name: install sbt-launcher | |
code: | | |
curl -o sbt-launcher.sh https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt | |
chmod a+x ./sbt-launcher.sh | |
- script: | |
name: start emulator for tests |