Skip to content

Instantly share code, notes, and snippets.

View wbadry's full-sized avatar
🎯
Focusing

Waleed El-Badry wbadry

🎯
Focusing
View GitHub Profile
@wbadry
wbadry / BoyerMoore.cs
Created March 12, 2020 18:15 — forked from mjs3339/BoyerMoore.cs
C# High Performance Boyer Moore Byte Array Search Algorithm
public class BoyerMoore
{
private int[] _jumpTable;
private byte[] _pattern;
private int _patternLength;
public BoyerMoore()
{
}
public BoyerMoore(byte[] pattern)
{
@wbadry
wbadry / simple_gradient_descent.py
Created January 8, 2019 00:31
Simple implementation of Gradient Descent using Python
import numpy as np
import matplotlib.pyplot as plt
def gradientdescentoptimizer(param, c, learning_rate =0.01):
# Forward Propagation
param["cost"] = c[0][0] * param["w"] ** 2 + c[1][0] * param["w"] + c[2][0]
# Backward Propagation
param["dw"] = 2 * c[0][0] * param["w"] + c[1][0]
# Update Omega
@wbadry
wbadry / tfRegExample.py
Last active April 25, 2018 18:38
This is an example of using TensorFlow for simple Linear Regression of 1M points
# imports
import tensorflow as tf
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Create linear spaced million points
xData = np.linspace(0.0, 10.0, 1000000, dtype=float)
# Create million random points
noise = np.random.randn(len(xData))
#include <Servo.h>
#include <Wire.h>
#include <Firmata.h>
#define I2C_WRITE B00000000
#define I2C_READ B00001000
#define I2C_READ_CONTINUOUSLY B00010000
#define I2C_STOP_READING B00011000
#define I2C_READ_WRITE_MODE_MASK B00011000
#define I2C_10BIT_ADDRESS_MODE_MASK B00100000