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
rjlutz / info.text
Last active Oct 10, 2019
onFinishAddNotationDialog
View info.text
code is now here: https://gist.github.com/rjlutz/95b4952310a790493dc68208b83a877e
View AddNotationDialogFragment.java
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
@rjlutz
rjlutz / strings.xml
Created Sep 25, 2019
Building zybooks BandDatabase example in Android Studio with Master/Detail Pattern
View strings.xml
<resources>
<string name="app_name">The Band Database</string>
<string-array name="bands">
<item>The Beatles</item>
<item>Nirvana</item>
<item>U2</item>
</string-array>
<string-array name="descriptions">
@rjlutz
rjlutz / Circle.java
Last active Jun 25, 2019
Lists, Stacks, Queues and Priority Queues (Chapter 20) -- examples from Liang Intro to Java Comprehensive 10e
View Circle.java
public class Circle extends GeometricObject {
private double radius;
public Circle() {
}
public Circle(double radius) {
this.radius = radius;
}
@rjlutz
rjlutz / HexagonalRing.pde
Created May 30, 2019
HexagonalRing Class for Shapes_Practice_Coding_Challenge
View HexagonalRing.pde
public class HexagonalRing extends Shape {
float sInner;
float sOuter;
HexagonalRing(float a, float b, float c, float d) {
// super(); // this happens, silently, even if omitted
x = a;
y = b;
sInner = c;
@rjlutz
rjlutz / DiceNotation.java
Created Feb 25, 2019
Class to Perform Creation of Die Set
View DiceNotation.java
package edu.ggc.lutz.dungeonmasterdiceroller;
// adapted from:
// https://stackoverflow.com/questions/35020687/how-to-parse-dice-notation-with-a-java-regular-expression
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class DiceNotation {
@rjlutz
rjlutz / generate-images.script
Last active Jan 19, 2019
Automate JMol to created multiple 2d images through looping
View generate-images.script
# script to systematically create many images of molecular structures
# R Lutz 19 Jan 2019
set antialiasImages FALSE # the following is recommended to avoid ragged
# edges around the image, per JMol docs
# ====================================================================
# CONFIGURABLE PARAMS
var rot_max = 2.0 # in degrees
var output_width = 600 # shouldn't be > 600, according to automl guidance
@rjlutz
rjlutz / detect.py
Last active Jan 17, 2019
Starter code and data files for neural net / python practice assignment
View detect.py
## modified from:
## https://github.com/miloharper/simple-neural-network and
## https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1
## thanks!
import csv
from numpy import exp, array, random, dot
class NeuralNetwork():
def __init__(self):
@rjlutz
rjlutz / CircleWithException.java
Last active Nov 21, 2018
Exceptions and File I/O (Chapter 12) -- examples from Liang Intro to Java Comprehensive 10e
View CircleWithException.java
public class CircleWithException {
/** The radius of the circle */
private double radius;
/** The number of the objects created */
private static int numberOfObjects = 0;
/** Construct a circle with radius 1 */
public CircleWithException() {
this(1.0);
@rjlutz
rjlutz / storage.dart
Last active Nov 13, 2018
helpful artifacts for the flutter student picker app
View storage.dart
// thanks - https://flutter.io/docs/cookbook/persistence/reading-writing-files
import 'dart:async';
import 'dart:io';
import 'package:path_provider/path_provider.dart';
import 'student.dart';
class Storage {
Future<String> get _localPath async {
final directory = await getApplicationDocumentsDirectory();
You can’t perform that action at this time.