Skip to content

Instantly share code, notes, and snippets.

View odds-get-evened's full-sized avatar
sailing away

Chris... odds-get-evened

sailing away
View GitHub Profile
@odds-get-evened
odds-get-evened / heartbeat.py
Last active August 31, 2023 10:00
i was bored so i built a machine thing.
import asyncio
import random
import sys
import time
"""
i was bored and couldn't come up with a concept to work on
so i made this pseudo-machine. =)
"""
def bound_int(n: int, minv: int, maxv: int) -> int:
@odds-get-evened
odds-get-evened / BinarySearch.java
Last active August 10, 2023 21:10
a modernized version of Sedgewik's BinarySearch class
package algorithm;
import org.apache.commons.lang.ArrayUtils;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.stream.IntStream;
import static java.lang.System.out;
@odds-get-evened
odds-get-evened / Main.java
Created June 11, 2023 18:32
Grid Window (Main)
package org.mintaka5;
import org.mintaka5.ui.GridWindow;
import java.util.Random;
public class Main {
public static void main(String[] args) {
int[][] randGrid = randomGrid(25, 25);
package org.mintaka5.ui;
import javax.swing.*;
import java.awt.*;
public class GridWindow extends JFrame {
private final int[][] theGrid;
private int[] dimensions = {10, 10};
@odds-get-evened
odds-get-evened / youtube-trimsies.sh
Last active September 17, 2022 19:28
download and trim YouTube vids
#!/bin/bash
# youtube-dl --format mp4 UF8uR6Z6KLc
# ffmpeg -i video.mp4 -ss 00:03:32 -to 00:05:32 clip.mp4
# youtube video id
vid="$1";
echo "[youtube-dl] download video from youtube in .mp4 format...";
youtube-dl --format mp4 $vid -o '%(title)s.%(ext)s';
if [ "$2" == --trim ]
@odds-get-evened
odds-get-evened / steps-in-object-oriented-design.md
Last active April 21, 2022 22:31
steps in object-oriented design

steps in object-oriented design

  • evaluate objects created in the analysis phase
    • helps identify more objects needed for overall solution
    • refines existing object properties and methods
  • specify class dependencies
    • establishes relations between objects
    • determines appropriate classes to represent respective objects
      • relationships:
  • inheritance - allows a class to inherit the properties and methods of another class
@odds-get-evened
odds-get-evened / object-oriented-analysis.md
Last active April 21, 2022 22:31
object-oriented analysis

problem definition:

  • write a problem statement

requirement specification:

  • understand the objectives after creating the problem statement
  • it should state:
    • a list of outputs that are required.
  • a list of processes that will produce these outputs
@odds-get-evened
odds-get-evened / sha256_simple.cpp
Last active April 21, 2022 22:32
toying with c++ hashing
#include <iostream>
#include <openssl/sha.h>
#include <sstream>
#include <string>
#include <iomanip>
using namespace std;
string sha256_simple(const string s)
{
@odds-get-evened
odds-get-evened / NeuralInput.java
Last active January 21, 2022 02:07
a simple neuron model
package org.white5moke;
import org.apache.commons.lang3.math.NumberUtils;
import org.hipparchus.analysis.function.Sigmoid;
import org.hipparchus.analysis.function.Tanh;
import org.openscience.cdk.math.RandomNumbersTool;
import java.security.SecureRandom;
import java.time.Instant;
import java.time.ZoneId;
@odds-get-evened
odds-get-evened / peer5.java
Created January 13, 2022 23:31
somewhat of a peer/bot
package org.white5moke;
import java.io.IOException;
import java.net.*;
import java.nio.charset.StandardCharsets;
class Peer5 {
public Sender sender;
public Receiver receiver;
public int port;