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
private String getRawResource(int resource) { | |
String res = null; | |
InputStream is = getContext().getResources().openRawResource(resource); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
byte[] b = new byte[1]; | |
try { | |
while ( is.read(b) != -1 ) { | |
baos.write(b); | |
}; | |
res = baos.toString(); |
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
int W = 1024; | |
int H = 700; | |
float K1 = 0.4; | |
float K2 = 0.6; | |
float LEN_DEC1 = 0.66; | |
float LEN_DEC2 = 0.5; | |
float ANGLE1 = PI/6; | |
float ANGLE2 = -PI/6; | |
int STEPS = 14; |
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
<html> | |
<head> | |
<title>My first Three.js app</title> | |
<style> body { margin: 0; } canvas { width: 100%; height: 100% } </style> | |
<script src="js/three.min.js"></script> | |
<script src="js/TrackballControls.js"></script> | |
</head> | |
<body> | |
<script> |
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.mlatu.clojure.test.main | |
(:use [neko.activity :only [defactivity set-content-view! *a]] | |
[neko.threading :only [on-ui]] | |
[neko.notify] | |
[neko.resource])) | |
(fire (*a) :notification | |
(notification :icon (get-resource (*a) :drawable :ic-launcher) | |
:ticker-text "You've got mail" |
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
#!/usr/bin/clojure | |
; Created: Fri Jan 9 16:10:56 EET 2015 | |
; encoding: utf-8 | |
(defn burrows-wheeler [s] | |
(let [size (count s)] | |
(->> | |
(repeat size s) | |
(apply str) |
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
#!/usr/bin/clojure | |
; Created: Fri Jan 9 16:10:56 EET 2015 | |
; encoding: utf-8 | |
(defn burrows-wheeler [s] | |
(let [size (count s)] | |
(->> | |
(repeat 2 s) | |
(apply str) |
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 | |
# Send power button press if screen is off | |
(adb shell dumpsys power | grep -q "Display Power: state=OFF" ) && adb shell input keyevent KEYCODE_POWER | |
# Send menu key press to unlock | |
adb shell input keyevent 82 | |
# Even if failed let the gradle build continue | |
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
-> ice ~ % adb shell input | |
Usage: input [<source>] <command> [<arg>...] | |
The sources are: | |
mouse | |
keyboard | |
joystick | |
touchnavigation | |
touchpad | |
trackball |
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
private void init() { | |
paint = new Paint(); | |
paint.setColor(Color.BLUE); | |
paint.setAntiAlias(true); | |
paint.setStrokeWidth(50); | |
paint.setStyle(Paint.Style.STROKE); | |
paintFill = new Paint(); | |
paintFill.setColor(Color.RED); | |
paint.setAntiAlias(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
@Override | |
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
float scale = getMeasuredWidth() / mMaxImageWidth; | |
int width = Math.round(getMeasuredWidth() * scale); | |
int height = Math.round(getMeasuredHeight() * scale); | |
setMeasuredDimension(width, height); | |
} |
OlderNewer