Skip to content

Instantly share code, notes, and snippets.

View rjlutz's full-sized avatar

Bob Lutz rjlutz

  • Georgia Gwinnett College
  • Lawrenceville, GA
View GitHub Profile
@rjlutz
rjlutz / detect.py
Last active March 19, 2024 00:47
Starter code and data files for neural net / python practice assignment
## 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 / .Palindrome Helper Files
Last active January 18, 2024 20:42
Bits to build a palindrome app, class with static method that tests a string to see if its a palindrome
We couldn’t find that file to show.
@rjlutz
rjlutz / DiceNotation.java
Last active September 25, 2023 01:02
Class to Perform Creation of Die Set
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 / MainActivity.kt
Last active August 21, 2023 20:38
Utility Class
package edu.piedmont.cs.palindromepractice2
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
import android.view.View
import android.widget.EditText
import android.widget.ImageView
@rjlutz
rjlutz / activity_main.xml
Created August 21, 2023 20:36
the accompanying layout
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<EditText
android:id="@+id/etInput"
@rjlutz
rjlutz / Circle.java
Last active April 28, 2023 11:41
Abstract Classes and Interfaces (Chapter 13) -- examples from Liang Intro to Java Comprehensive 10e
public class Circle extends GeometricObject {
private double radius;
public Circle() {
}
public Circle(double radius) {
this.radius = radius;
}
@rjlutz
rjlutz / palindromeexample.dart
Created June 9, 2020 15:49
Palindrome and Flutter Stuff
void main() {
print('Should all be true:');
print(Palindrome.check('radar'));
print(Palindrome.check('noon'));
print(Palindrome.check(''));
print(Palindrome.check('123321'));
print(Palindrome.check('12,32,1'));
print(Palindrome.check('1 2 3 2 1'));
print(Palindrome.check('1 2 3 2 1'));
@rjlutz
rjlutz / AddNotationDialogFragment.java
Last active November 15, 2022 12:03
homework help
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 / AppleTester.java
Last active April 21, 2022 16:21
Inheritance and Polymorphism (Chapter 11) -- examples from Liang Intro to Java Comprehensive 10e
public class AppleTester {
public static void main(String[] args) {
Apple apple = new Apple();
System.out.println(apple.toString());
}
}
public class Apple extends Fruit {
public class MathStuff {
public int timesTwo(int n) {
if (n >= Integer.MAX_VALUE)
throw new IllegalArgumentException("Value can't be bigger than" + Integer.MAX_VALUE/2);
if (n <= Integer.MIN_VALUE)
throw new IllegalArgumentException("Value can't be less than" + Integer.MIN_VALUE/2);
int product = 2 * n;
return product;