Skip to content

Instantly share code, notes, and snippets.

@Sietesoles
Sietesoles / Portfolio and Stock manager.java
Last active October 21, 2021 02:35
Stock and Portfolio manager in Java
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
@Sietesoles
Sietesoles / 1 - Server in C + 40-Byte-File Database support.txt
Last active August 29, 2015 14:04
Server in C + 40-Byte-File Database support
Description:
I wrote the following C files in addition to the main http-server.c:
HandleMdbLookup.c
HandleTCPClient.c
http-server.c:
Takes as arguments the server port, webroot, mdb-lookup-server host and port.
It creates a socket and binds it to the port. It then calls HandleMdbLook. It also calls setsockopt as SO_REUSEADDR to get rid of the "bind() failed: address already in use" error message. It then runs an infinite loop where it calls accept() and HandleTCPClient().
Description:
Part1:
I created the following helper functions:
loadmdb Loads a File into a list
printString Prints the MdbRec struct
@Sietesoles
Sietesoles / Virus Populations.py
Created September 6, 2014 15:53
Stochastic simulation of Patient and Virus population dynamics
import numpy
import random
import pylab
from VirusClasses import *
def simulationDelayedTreatment(numTrials):
"""
Runs simulations and make histograms for problem 1.
@Sietesoles
Sietesoles / BayesAntivirus.java
Last active August 29, 2015 14:06
Antivirus using Bayes Formula
public class BayesAntivirus {
/**
* Starts off the antivirus by calling the GUI.
* @param args
*/
public static void main(String[] args) {
GUI gui = new GUI();
gui.loadView();
@Sietesoles
Sietesoles / AGraphMap13.java
Last active August 29, 2015 14:06
Graph of world cities - Implements Dijkstra's Algo
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Serializable;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;