This file contains hidden or 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 com.bitgrind.android.guice; | |
| import com.google.common.base.Throwables; | |
| import com.google.inject.Binder; | |
| import com.google.inject.Guice; | |
| import com.google.inject.Injector; | |
| import com.google.inject.Module; | |
| import com.google.inject.util.Modules; | |
| import android.app.Application; |
This file contains hidden or 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/python | |
| # Handles call to adb and prompts for device selection if | |
| # necessary when more than once device is connected. | |
| # | |
| # by Mark Renouf <mrenouf@google.com> | |
| # To install: | |
| # 1. Place this script somewhere in your path, and make it executable. | |
| # 2. Make sure 'adb' is also in your path. |
This file contains hidden or 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 | |
| ADB="/home/mrenouf/bin/adb" | |
| # We need root on the host to mess with networking | |
| if [[ $(whoami) != "root" ]]; then | |
| echo "You must be root to run this script!" | |
| exit 1 | |
| fi; |
This file contains hidden or 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 com.bitgrind.control; | |
| public class PID { | |
| /** | |
| * Low pass filter cutoff frequency for the derivative term. | |
| */ | |
| private static final int LOWPASS_CUTOFF_HZ = 20; | |
| private static final double RC = 1 / (2 * Math.PI * LOWPASS_CUTOFF_HZ); |
This file contains hidden or 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 | |
| # Handles proper use of Meld from Git. | |
| # | |
| # Instead of launching meld with $MERGED as the base revision, this | |
| # script makes a copy of $BASE and handles copying the result back | |
| # to $MERGED if the result was saved. | |
| # As an extra tweak, it also presents branch names (if known) as | |
| # the file name prefix, instead of just "LOCAL" and "REMOTE". |
This file contains hidden or 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
| /* | |
| * Copyright (C) 2011, Mark Renouf | |
| * | |
| * This code is licensed to you under the Apache License, | |
| * Version 2.0 (the "License"); you may not use this file except | |
| * in compliance with the License. You may obtain a copy of the | |
| * License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * |
This file contains hidden or 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
| public static void copyFile(File sourceFile, File destFile) throws IOException { | |
| if (!destFile.exists()) { | |
| destFile.createNewFile(); | |
| } | |
| FileInputStream fIn = null; | |
| FileOutputStream fOut = null; | |
| FileChannel source = null; | |
| FileChannel destination = null; | |
| try { | |
| fIn = new FileInputStream(sourceFile); |
This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <script type="text/javascript" language="javascript" src="demo/demo.nocache.js"></script> | |
| </head> | |
| <body> | |
| <input type="text" id="passphrase"> | |
| <input type="key" id="key"> | |
| <textarea id="plaintext"></textarea> |
This file contains hidden or 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 com.bitgrind.text; | |
| import org.junit.experimental.theories.DataPoints; | |
| import org.junit.experimental.theories.Theories; | |
| import org.junit.experimental.theories.Theory; | |
| import org.junit.runner.RunWith; | |
| import static org.junit.Assert.assertThat; | |
| import static org.junit.Assume.assumeNotNull; |
This file contains hidden or 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
| /* | |
| * Original code from: | |
| * Mattias Fagerlund | |
| * http://lotsacode.wordpress.com/2010/03/05/singularization-pluralization-in-c/ | |
| * Matt Grande | |
| * http://mattgrande.wordpress.com/2009/10/28/pluralization-helper-for-c/ | |
| * | |
| * Converted Java by Mark Renouf | |
| */ |