Skip to content

Instantly share code, notes, and snippets.

View sayopaul's full-sized avatar
🏠
Working from home

Sayo Paul sayopaul

🏠
Working from home
View GitHub Profile
@sayopaul
sayopaul / SimpleDemoGA.java
Created September 23, 2019 20:02 — forked from Vini2/SimpleDemoGA.java
A simple implementation of a genetic algorithm
import java.util.Random;
/**
*
* @author Vijini
*/
//Main class
public class SimpleDemoGA {
@sayopaul
sayopaul / php-binary-search.php
Created July 2, 2019 14:37
Binary search PHP implementation
<?php
function binarySearch($list,$itemToBeFound){
$firstIndex = 0;
$lastIndex = (count($list) - 1);
$found = false;
while($firstIndex <= $lastIndex && $found == false){
$midpoint = floor(($firstIndex + $lastIndex) / 2);
if ($itemToBeFound == $list[$midpoint]){
@sayopaul
sayopaul / ubuntu-php7-install.bash
Created December 27, 2016 01:04
Ubuntu 14.04 PHP7 (Install from Source)
#!/usr/bin/env bash
sudo -i;
apt-get update;
apt-get install --yes \
git \
bison \
autoconf \