Skip to content

Instantly share code, notes, and snippets.

@KylePiira
KylePiira / test.java
Created September 24, 2018 11:38
A simple Java program to test integer arithmetic errors.
public class IntDivision {
public static void main(String[] args) {
System.out.println("int / int = int");
System.out.println("1 / 3 = " + 1 / 3);
System.out.println("int / float = float");
System.out.println("1 / 3. = " + 1 / 3.);
System.out.println("Another Example:");
@KylePiira
KylePiira / test.java
Created September 24, 2018 11:40
Simple Java program to test integer division.
public class IntDivision {
public static void main(String[] args) {
System.out.println("int / int = int");
System.out.println("1 / 3 = " + 1 / 3);
System.out.println("int / double = double");
System.out.println("1 / 3. = " + 1 / 3.);
System.out.println("Another Example:");
@KylePiira
KylePiira / life.py
Created November 25, 2018 00:02
Game of Life in Python
"""
Kyle's Game of Life Implementation
1) live cells die if they have 0, 1, or 4+ neighbors
2) empty cells have a birth if they have exactly three neighbors
"""
import numpy as np
# Create a blank board
board = np.zeros((5, 5))
@KylePiira
KylePiira / ebay.urls
Last active December 2, 2018 03:28
Ebay URLs
This file has been truncated, but you can view the full file.
https://www.ebay.com/b/Tablet-eBook-Accessory-Bundles-for-Microsoft/176971?LH_BOPIS=1&_udhi=14.0&LH_AS=1&LH_GD=3&LH_Sold=1&LH_RPA=1&Compatible%2520Brand=For%2520Microsoft&rt=nc
https://www.ebay.com/b/Wireless-Webcam/4616?LH_BOPIS=1&LH_FS=1&LH_Sold=1&Connectivity=Wireless&rt=nc&LH_RPA=1
https://www.ebay.com/b/Other-Laptop-Desktop-Accessories/31534/bn_1648493?rt=nc&LH_AV=1&LH_BOPIS=1&LH_FS=1&LH_RPA=1&_udlo=2.0&_udhi=4.0&LH_Complete=1
https://www.ebay.com/itm/01-02-03-04-05-LEXUS-IS300-BLACK-STEERING-WHEEL-4510053100C0/283096997398?epid=1711248407&hash=item41e9e55e16:g:eUsAAOSwOD9bbgDT
https://www.ebay.com/itm/1973-1974-1975-1976-1977-Oldsmobile-Cutlass-Speedometer-Gauge-Cluster/302778690760?hash=item467f042cc8:g:gZ0AAOSwjOVbKwFa
https://www.ebay.com/itm/-/223044310681
https://www.ebay.com/itm/1-2-3-Shade-Vinyl-Room-Darkening-Temporary-Pleated-Shades-Cordless-White-/401017127026?oid=232166307994
https://www.ebay.com/b/Apple-2018-Release-Year/111422/bn_108854339?rt=nc&LH_FS=1&LH_GD=1&_udhi=390.0&_udlo=115.0&LH_So
{
"app": "steemit",
"elastic_host": "http://localhost:9200",
"elastic_index": "steem",
"elastic_user": "",
"elastic_pass": "",
"start_block": 30061000
}
@KylePiira
KylePiira / P217.java
Last active September 22, 2019 17:09
Problem 2.1.7c
public class P217 {
public static void main(String[] args) throws Exception {
// Example
boolean[][] r = {
{false, false, false, true, false, false},
{false, false, true, false, false, false},
{false, true, false, false, false, false},
{false, false, true, false, false, false},
{false, false, false, false, false, true},
{false, false, false, true, false, false},
@KylePiira
KylePiira / pong.ino
Last active October 4, 2019 05:51
A Pong implementation for the UMass CICS 290M Makerboard
// Imports
#include <Adafruit_SSD1306.h>
// Globals
#define UP_BUTTON 34
#define DOWN_BUTTON 0
#define RESET_BUTTON 35
#define BUZZER 17
// Game State
from tensorflow.keras.models import Model
from tensorflow.keras.layers import (
Input,
Conv2D,
Activation,
Reshape,
Flatten,
Lambda,
Dense,
)
import RPi.GPIO as GPIO
channels = [
{'label': 'LEFT_MOTOR_POWER', 'pin': 11},
{'label': 'LEFT_MOTOR_FORWARD', 'pin': 13},
{'label': 'LEFT_MOTOR_BACKWARD', 'pin': 15},
{'label': 'RIGHT_MOTOR_POWER', 'pin': 23},
{'label': 'RIGHT_MOTOR_FORWARD', 'pin': 21},
{'label': 'RIGHT_MOTOR_BACKWARD', 'pin': 19},
]

Keybase proof

I hereby claim:

  • I am kylepiira on github.
  • I am kylepiira (https://keybase.io/kylepiira) on keybase.
  • I have a public key ASB3ub66FFTHKS1Pz8zIMezwHA66kVmu1LolYJxEDC_SbQo

To claim this, I am signing this object: