Skip to content

Instantly share code, notes, and snippets.

View LouisJenkinsCS's full-sized avatar
💭
Fellow of the Department of Energy's Computational Sciences Graduate Fellowship.

Louis Jenkins LouisJenkinsCS

💭
Fellow of the Department of Energy's Computational Sciences Graduate Fellowship.
View GitHub Profile
@LouisJenkinsCS
LouisJenkinsCS / Mergsort_In_pseudocode
Last active August 29, 2015 14:14
Attempt at making a Merge Sort in pseudocode
A[] = { 28, 39, 48, 27, 9, 88, 11, 4, 7} // Global variable, disregard bad programming practices
Function Split(int low, int hi){ // Adding brackets because not only am I used to java, it should help readability
if (hi - low) < 2 then
return array of elements from [low, hi]
mid = (hi + low) / 2
B[] = split(low, mid-1) // Either I do mid-1 or mid+1, the results seem the same
C[] = split(mid, hi) // Same problems as above
D[] = Merge(B[], C[])
return D[]
#include <stddef.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include "client.h"
/*
* File: main.c
* Author: theif519
*
* Created on March 27, 2015, 11:45 AM
*/
#include <stddef.h>
#include <stdio.h>
#include <signal.h>
/*
* File: client.h
* Author: theif519
*
* Created on March 27, 2015, 1:37 PM
*/
#ifndef CLIENT_H
#define CLIENT_H
/*
* File: server.h
* Author: theif519
*
* Created on March 27, 2015, 1:27 PM
*/
#ifndef SERVER_H
#define SERVER_H
#include "String_Utils.h"
#define BUF_SIZE 50
int main(void){
size_t iteration = 0;
char **array = malloc(sizeof(char *));
char *temp = malloc(BUF_SIZE);
while(1)
{
array[iteration] = malloc(BUF_SIZE);
memset(temp, 0, BUF_SIZE);
@LouisJenkinsCS
LouisJenkinsCS / Good_MergeSort_Results.txt
Created June 9, 2015 17:17
Log from a good result from the merge sort.
01:14:39 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_One: { 0, 5, 12, 6, 16, } Size: 5
01:14:39 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_One: { 0, 5, } Size: 2
01:14:39 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_One: { 0, } Size: 1
01:14:39 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_Two: { 5, } Size: 1
@LouisJenkinsCS
LouisJenkinsCS / Bad_MergeSort_Result.txt
Created June 9, 2015 17:23
Log from a bad result from the merge sort.
01:17:37 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_One: { 0, 2, 18, 21, 28, } Size: 5
01:17:37 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_One: { 0, 2, } Size: 2
01:17:37 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_One: { 0, } Size: 1
01:17:37 PM: [VERBOSE](./Data_Structures/Linked_List/Linked_List.c:25) List_Two: { 2, } Size: 1
/*
Interface which every GameObject must implement.
*/
public interface GameObject {
// Called when an object needs to be updated.
void update();
// Called when a collision was detected. The obj argument is the other object it collided with.
void onCollision(GameObject obj);
}
public class RecorderService extends Service {
/**
* Enumerations used to describe the current state of the object, even
* having a direct string representation. For this example, my fragment has a
* text-view which is updated with each state change.
*/
public enum RecorderState {
DEAD("Dead"),
ALIVE("Alive"),