Skip to content

Instantly share code, notes, and snippets.

View DanielHenrichs's full-sized avatar

Daniel Henrichs DanielHenrichs

View GitHub Profile
@DanielHenrichs
DanielHenrichs / snifftelnet.c
Created July 21, 2020 15:18
telnet sniffer
#include <pcap.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
/**
*The purpose of this class is to create functions that allow for the user to manipulate the BST. The methods within
* this class allow the user to insert into the tree, search the tree, get a count of words in the BST, and unique words
* in the BST, as well as allowing the user to return all the words in the BST and the number of times they occur in
* the BST.
* @
* @author Daniel Henrichs
* @version 1.0
* @since 2019-07-30
* @see BSTFunctions
/**
* Description: The purpose of this class is to build the GUI for the program. It gives the user the option to select a
* file, list the contents of the file in alphabetical order with the number of occurrences of each word in the file,
* the total number of words in the file, and the number of unique words in the file. It also allows you to add a file
* to continue to build the BST.
* @author Daniel Henrichs
* @version 1.0
* @since 2019-07-30
* @see GUI
*/
class Listeners implements ActionListener {
public void actionPerformed(ActionEvent evt) {
File file = new File(directory.getText() + "\\" + GUI.this.file.getText());
BSTFunctions bstf = new BSTFunctions();
if (evt.getSource().equals(browse)) {
JFileChooser pickFile = new JFileChooser();
pickFile.setMultiSelectionEnabled(true);
int dialog = pickFile.showOpenDialog(GUI.this);
File[] files = pickFile.getSelectedFiles();
import javax.swing.*;
import java.awt.*;
public class SnowMan extends JPanel {
JLabel label;
public void paint(Graphics g) {
setSize(500, 500);
@DanielHenrichs
DanielHenrichs / Implementing a Stack Data Structure as a Python Class
Last active August 29, 2015 14:19
Implementing a Stack Data Structure as a Python Class
# Programming Assignment: Linear Regression Model
# Course: 1523 Monday 4:00PM - 6:00PM
# Students Name: Nathan Hess
# Labratory Partner: Daniel Henrichs
# Instructor: Warren Sceaffer
import random #Imports the random module to randomly generate integers later
import time # Imports time so that we can delay output for presentation
# Programming Assignment: Vreating and importing module lab
# Course: 1523 Monday 4:00PM - 6:00PM
# Students Name: Daniel Henrichs
# Labratory Partner: Nathan Hess
# Instructor: Warren Sceaffer
# imports all needed modules
import velocity
import kinetic
import math
@DanielHenrichs
DanielHenrichs / Kinetic Energy Module
Created March 30, 2015 22:43
Kinetic Energy Module
# Function that computes the Kinetic energy of mass, m,
# at velocity, v.
#
#
# For the Kinetic Energy Function:
# m - expressed in Kilograms
# v - Expressed in meters per sec
#
# Example calculation, assume mass of 1 kilogram and a
# velocity of 100 meters per second.
@DanielHenrichs
DanielHenrichs / Velocity Module
Created March 30, 2015 22:38
Velocity Module
import math
# Function that impors the velocity of a freely
# falling object subject to acceloration due to
# gravity, a , from an initial height of x.
#
# For the velocity function:
# x - expressed in meters
# a - expressed in meters/sec*sec
# example calculation:
# Assume x = 100 meters, a = 9.8 meters/(sec^2)
file=open(Regression.dat,'r')
for line in file:
print (line)