Skip to content

Instantly share code, notes, and snippets.

Bob Lutz rjlutz

Block or report user

Report or block rjlutz

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
rjlutz /
Last active Feb 21, 2017
File/Web IO and HTML Writing Example
public class BadTickerException extends IllegalArgumentException {
private static final long serialVersionUID = 1L;
public BadTickerException() {
public BadTickerException(String s) {
rjlutz /
Created Mar 14, 2017
example showing how to traverse chargepoint pojo
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
ChargePoint chargepoint = gson.fromJson(results.get(i).getJson(),
StationList slist = chargepoint.getStationList();
List<Summary> summaries = slist.getSummaries();
Summary summary = summaries.get(0);
long available = summary.getMapData().getLevel2().getPaid()
String toSpeak = available + "! " +
((available == 1) ? "charger is" : "chargers are") +
View gist:3e000bcffb0cfb48e8aba76715c556ac
public class MainActivity extends AppCompatActivity implements SensorEventListener // class decl
SensorManager manager = (SensorManager) getSystemService(SENSOR_SERVICE); // oncreate
manager.registerListener(this, manager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), // oncreate or onresume
manager.unregisterListener(this); // ondestory or onpause
rjlutz / Palindrome Utility
Last active Aug 15, 2018
Bits to build a palindrome app, class with static method that tests a string to see if its a palindrome
View Palindrome Utility
public class Palindrome {
public static boolean check(String _s) {
return check(_s, 0, _s.length()-1);
private static boolean check(String _s, int _start, int _end) {
// base case
if (_start >= _end) return true;
rjlutz / html changes
Last active May 24, 2017
Guacamole Cordova Walkthrough
View html changes
<!-- link rel="stylesheet" href="" />
<script src=""></script>
<script src=""></script -->
<link rel="stylesheet" href="lib/" />
<script src="lib/jquery-2.1.4/jquery-2.1.4.min.js"></script>
<script src="lib/"></script>
<div align="center">
View Bruschetta strings.xml
<string name="app_name">Recipe</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="tvTitle">Bruschetta</string>
<string name="description">Recipe Image</string>
<string name="btnRecipe">View Recipe</string>
<string name="tvIngredients">Ingredients</string>
<string name="tvIngredients1">4 plum tomatoes</string>
rjlutz /
Created Jun 5, 2017
helper class for Pixabay Response. Since we need to cache query results for 24 hours, this method will be used for caching a result. It will also fetch all the bitmaps and cache these too, since those fetches can be long running and can be initiating from a backround task.
package edu.ggc.lutz.pixabay;
import android.util.Log;
rjlutz /
Created Jun 7, 2017
Elementary Programming - examples from Liang Intro to Java Comprehensive 10e
public class ComputeArea {
public static void main(String[] args) {
double radius; // Declare radius
double area; // Declare area
// Assign a radius
radius = 20; // New value is radius
// Compute area
area = radius * radius * 3.14159;
View ..lowPass highPass methods
// de-emphasize transient forces
private float lowPass(float current, float gravity) {
// ALPHA indicates the influence level of past observations
return current * (1-ALPHA) + gravity * ALPHA;
// de-emphasize constant forces
private float highPass(float current, float gravity) {
return current - gravity;
rjlutz /
Last active Jun 11, 2017
Selections - examples from Liang Intro to Java Comprehensive 10e
import java.util.Scanner;
public class AdditionQuiz {
public static void main(String[] args) {
int number1 = (int)(System.currentTimeMillis() % 10);
int number2 = (int)(System.currentTimeMillis() / 7 % 10);
// Create a Scanner
Scanner input = new Scanner(;
You can’t perform that action at this time.