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 / PixabayResult.java
Created Oct 10, 2017
Pixabay starter code
View PixabayResult.java
package edu.ggc.lutz.pixabayretrofit;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
@rjlutz
rjlutz / ComputeFactorial.java
Created Oct 12, 2017
Abstract Classes and Interfaces (Chapter 18) -- examples from Liang Intro to Java Comprehensive 10e
View ComputeFactorial.java
import java.util.Scanner;
public class ComputeFactorial {
/** Main method */
public static void main(String[] args) {
// Create a Scanner
Scanner input = new Scanner(System.in);
System.out.print("Enter a non-negative integer: ");
int n = input.nextInt();
@rjlutz
rjlutz / AnyWildCardDemo.java
Created Oct 19, 2017
Java Generics (Chapter 19) -- examples from Liang Intro to Java Comprehensive 10e
View AnyWildCardDemo.java
public class AnyWildCardDemo {
public static void main(String[] args ) {
GenericStack<Integer> intStack = new GenericStack<Integer>();
intStack.push(1); // 1 is autoboxed into new Integer(1)
intStack.push(2);
intStack.push(-2);
print(intStack);
}
@rjlutz
rjlutz / BubbleSort.java
Last active Nov 10, 2017
Sorting and Searching (Chapter 23) -- examples from Liang Intro to Java Comprehensive 10e
View BubbleSort.java
public class BubbleSort {
/** Bubble sort method */
public static void bubbleSort(int[] list) {
boolean needNextPass = true;
for (int k = 1; k < list.length && needNextPass; k++) {
// Array may be sorted and next pass not needed
needNextPass = false;
for (int i = 0; i < list.length - k; i++) {
if (list[i] > list[i + 1]) {
@rjlutz
rjlutz / edit html
Last active Jan 16, 2018
notesf for basic cordova app w/notification dialog
View edit html
add
<button id="aboutBtn">About</button>
@rjlutz
rjlutz / steps
Last active Jan 30, 2018
Steps to import Wargo's 14.1 Media Player Example
View steps
download or clone https://github.com/johnwargo/apache-cordova-api-cookbook-code
cordova create ...
cordova platform add android
graft content from
~/Downloads/apache-cordova-api-cookbook-code-master/chapter14-media/Ex14.1 (your downloads, of course)
cordova plugin add cordova-plugin-media
cordova plugin add cordova-plugin-device
@rjlutz
rjlutz / # mumps - 2018-03-06_00-14-37.txt
Created Mar 6, 2018
mumps (udacity/carnd-mpc-project/mumps) on macOS 10.13.3 - Homebrew build logs
View # mumps - 2018-03-06_00-14-37.txt
Homebrew build logs for udacity/carnd-mpc-project/mumps on macOS 10.13.3
Build date: 2018-03-06 00:14:37
@rjlutz
rjlutz / 1 notes
Last active Apr 1, 2018
Bike and Barge notes and text bits
View 1 notes
add drawables
add to strings (can use translations or copy/paste)
create a new TableLayout underlayouts called photos.xml
add rows (can be found below)
create a new LinearLayout underlayouts called tours.xml
add stuff (can be found below)
@rjlutz
rjlutz / decToBase method
Last active May 22, 2018
Assets for Grizzly Gray (Grizzly Grayscale Picker)
View decToBase method
private String decToBase(int d, int base) {
// credit to and adapted from:
// https://stackoverflow.com/questions/13465098/decimal-to-hexadecimal-converter-in-java
// Note that there are several one-liners that can be used too
String digits = "0123456789ABCDEF";
String hex = "";
if (d <= 0) hex = "0";
while (d > 0) {
int digit = d % base; // rightmost digit
hex = digits.charAt(digit) + hex; // string concatenation
@rjlutz
rjlutz / main.dart
Created Jun 10, 2018
template for porting Palindrome.java to dart
View main.dart
// refer to the Java code here:
// https://gist.github.com/rjlutz/3c26a1be877529de8dd28049d12415d0
// complete the dart implementation below to have the same functionality
class Palindrome {
// TODO implement check
static check(String s) {
return true;
}
}
You can’t perform that action at this time.