Skip to content

Instantly share code, notes, and snippets.

@ahmedfgad
ahmedfgad / ga.py
Last active September 7, 2022 21:47
import numpy
# This project is extended and a library called PyGAD is released to build the genetic algorithm.
# PyGAD documentation: https://pygad.readthedocs.io
# Install PyGAD: pip install pygad
# PyGAD source code at GitHub: https://github.com/ahmedfgad/GeneticAlgorithmPython
def cal_pop_fitness(equation_inputs, pop):
# Calculating the fitness value of each solution in the current population.
# The fitness function caulcuates the sum of products between each input and its corresponding weight.
@AidanHak
AidanHak / OptimalPageReplacement.java
Created October 21, 2017 03:05
Optimal page replacement algorithm in Java
import java.util.Scanner;
import java.io.IOException;
public class OptimalPageReplacement
{
public static void main(String[] args) throws IOException
{
Scanner in = new Scanner(System.in);
int frames = 0;
int pointer = 0;
@AidanHak
AidanHak / LRUPageReplacement.java
Created October 21, 2017 02:59
Least recently used page replacement algorithm in Java
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class LRUPageReplacement
{
public static void main(String[] args) throws IOException
{
Scanner in = new Scanner(System.in);
int frames = 0;
@deanrather
deanrather / Github Web Hosting.md
Last active March 1, 2026 17:47
Free Hosting on GitHub

Free Hosting on GitHub

This guide will take you from zero webserver knowledge, to having your own free site hosted on GitHub. The only non-free bit is registering a domain name, which can be as cheap as $5/year.

This guide uses CrazyDomains as the Registrar, FreeDNS as the DNS, and GitHub as the Webserver.


1) Domain Registration and Setup

@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active March 13, 2026 01:00
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line