Skip to content

Instantly share code, notes, and snippets.

Mirko Stocker misto

Block or report user

Report or block misto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:3945957
while ((audioTrack.getPlaybackHeadPosition() < duration * sampleRate)) {
try {
Thread.sleep(50 /*milliseconds*/);
} catch (InterruptedException e) {
View gist:3945882
* Für die Erzeugung der Töne brauchen wir zwei Parameter: die Länge eines
* Tons sowie die Sampling Rate, also die Abtastrate, mit der wir die Töne
* erstellen:
private final int duration = 1; // seconds
private final int sampleRate = 8000;
* Erstellt einen Byte-Array mit den Soundinformationen die wir für das
View gist:3938488
private void log(String qrCode) {
Intent intent = new Intent("ch.appquest.intent.LOG");
if (getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).isEmpty()) {
Toast.makeText(this, "Logbook App not Installed", Toast.LENGTH_LONG).show();
// Achtung, je nach App wird etwas anderes eingetragen
String logmessage = ...
View gist:3938337
private static final int SCAN_QR_CODE_REQUEST_CODE = 0;
public boolean onCreateOptionsMenu(Menu menu) {
MenuItem menuItem = menu.add("Log");
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
Intent intent = new Intent("");
misto / gist:1758655
Created Feb 7, 2012
Scala Trait linearization
View gist:1758655
Welcome to Scala version 2.9.1.r0-b20120125223512 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_02).
Type in expressions to have them evaluated.
Type :help for more information.
scala> trait A
defined trait A
scala> trait C extends A
defined trait C
You can’t perform that action at this time.