This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Description: | |
Part1: | |
I created the following helper functions: | |
loadmdb Loads a File into a list | |
printString Prints the MdbRec struct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import random | |
import pylab | |
from VirusClasses import * | |
def simulationDelayedTreatment(numTrials): | |
""" | |
Runs simulations and make histograms for problem 1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |