Skip to content

Instantly share code, notes, and snippets.

View BrandonDyer64's full-sized avatar

Brandon Dyer BrandonDyer64

View GitHub Profile
@BrandonDyer64
BrandonDyer64 / AJAJ.java
Created April 25, 2016 15:44
Async Java and JSON. This is an AJAX like class for Android used to POST to servers.
import android.os.AsyncTask;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.entity.UrlEncodedFormEntity;
public static float dist(float x1, float y1, float x2, float y2) {
return (float) Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}
public static float getRayCast(float p0_x, float p0_y, float p1_x, float p1_y, float p2_x, float p2_y, float p3_x, float p3_y) {
float s1_x, s1_y, s2_x, s2_y;
s1_x = p1_x - p0_x;
s1_y = p1_y - p0_y;
s2_x = p3_x - p2_x;
import java.util.Arrays;
import java.util.Random;
public class MLP {
public static final Random random = new Random(Driver.SEED + 1);
public static class MLPLayer {
float[] output;
@BrandonDyer64
BrandonDyer64 / build
Last active April 6, 2018 20:40
WM Table Build Script
#!/bin/sh
# A script to make our lives easier
# Place this script into the table_config_files directory of any WM project.
build_script_version="2.4.0"
# Version
if [ "$1" == "--version" ]
then
echo "$build_script_version"
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
$table_type = "master_id_with_auto";
unset($field);
unset($index);
$table = "${master}_note";
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
unset($field);
unset($index);
$table = "${master}_document";
$table_type = "master_id_with_auto";
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
unset($field);
unset($index);
$table = "${master}_status";
$thing_display = preg_replace("/_/", " ", $table);
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
unset($field);
unset($index);
$table = "${master}_status_update";
<?php
include("../../bin/do_not_change/standard_validation_regex.php");
unset($field); unset($index);
// TODO: Table Name
$table = "sample_table";
/* Table Plural *
$table_plural = "sample_tables"; /*/
$table_plural = $table . 's'; /**/
#!/bin/sh
create_script_version="1.2.0"
# Version
if [ "$1" == "--version" ]
then
echo "$create_script_version"
exit 0
fi