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 / 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 / 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
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;
main() {
// should result in true,false,true,false,true,false
print(Palindrome.check('radar'));
print(Palindrome.check('raxdar'));
print(Palindrome.check('noon'));
print(Palindrome.check('nxoon'));
@rjlutz
rjlutz / EditDialogFragment.java
Last active September 1, 2021 00:09
Dialog Fragment RGB, passes values back to Activity
package edu.ggc.lutz.dialogfragmentrgbpractice1sep;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
@rjlutz
rjlutz / student.dart
Created June 10, 2020 15:00
Thorns Roses in Flutter
class Student {
final String name;
bool hidden;
Student(this.name, this.hidden);
}
@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 / import for COLUMN_NAME_CONTENT
Last active June 1, 2020 16:55
WordList DB Helper Code Fragments
// remember to adjust the package hierarchy so that it matches you project
import static edu.ggc.lutz.sqlprototype.WordListContract.WordListEntry.COLUMN_NAME_CONTENT;
@rjlutz
rjlutz / activity_chooser.xml
Created January 28, 2020 17:00
layouts for NavUp example
<?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=".ChooserActivity">
<SeekBar
android:id="@+id/sbGrayScale"
@rjlutz
rjlutz / info.text
Last active October 10, 2019 13:17
onFinishAddNotationDialog
code is now here: https://gist.github.com/rjlutz/95b4952310a790493dc68208b83a877e