Skip to content

Instantly share code, notes, and snippets.

View cbourke's full-sized avatar

Chris Bourke cbourke

View GitHub Profile
@cbourke
cbourke / BallController.cs
Created January 3, 2020 03:57
auto-posted gist
using UnityEngine;
using System.Collections;
using Valve.VR;
using Valve.VR.InteractionSystem;
public class BallController : MonoBehaviour
{
//drag drop the Joystick child in the Inspector to animate
// the joystick when moved
public Transform Joystick;
@cbourke
cbourke / Sorting.java
Created November 14, 2018 16:00
auto-posted gist
package cse.unl;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class Sorting {
@cbourke
cbourke / searchingSorting.md
Created November 13, 2018 15:55
auto-posted gist

Searching & Sorting

  • Processing data is a fundamental operation in Computer Science
  • Two fundamental operations in processing data are searching and sorting
  • Form the basis or preprocessing step of many algorithms
  • Large variety of algorithms have been developed

Searching

@cbourke
cbourke / fibDemo.c
Created November 6, 2018 02:00
auto-posted gist
#include <stdlib.h>
#include <stdio.h>
long fibonacci(int n) {
if(n == 0 || n == 1) {
return 1l;
} else {
return fibonacci(n-1) + fibonacci(n-2);
}
@cbourke
cbourke / Demo.java
Created October 30, 2018 17:32
auto-posted gist
package cse.unl;
import java.time.LocalDate;
public class Demo {
public static void main(String args[]) {
LocalDate dateOfBirth = LocalDate.of(1990, 7, 9);
Student s1 = new Student(35140602, "Chris", "Bourke", 4.0, dateOfBirth);
@cbourke
cbourke / encapsulation.md
Created October 30, 2018 01:22
auto-posted gist

CSCE 155E - Computer Science I

Fall 2018

Encapsulation: Structures & Objects


  • Built-in primitive types (int, double, char) are limiting: not everything is a number or character
  • Real world entities are made up of multiple pieces of data
  • Example: Lab 10 sorting "teams"
@cbourke
cbourke / fileIO-H.md
Created October 23, 2018 18:00
auto-posted gist

File I/O

  • A file is a unit of stored memory, usually on disk
  • A file can also be... directories, buffers (standard input/output are files), a socket could be a file, a program is a file
  • You can write to and read from a file
  • Files may be plaintext or binary (or plaintext but not intended for human consumption: EDI, XML, JSON, base-64 encoding)
  • The basic steps to follow are:
    1. Open the file
    2. Process the file
@cbourke
cbourke / fileIO.md
Created October 23, 2018 01:30
auto-posted gist

File I/O

  • A file is a unit of stored memory, usually on disk
  • A file can also be: directories, buffers (standard input/output are files), a socket could be a file, a program is a file
  • You can write to and read from a file
  • Files may be plaintext or binary (or plaintext but not intended for human consumption: EDI, XML, JSON, base-64 encoding)
  • The basic steps to follow are:
    1. Open the file
    2. Process the file
@cbourke
cbourke / stringProcessing-155H.md
Created October 18, 2018 17:17
auto-posted gist

String Processing

  • Strings represent data that may need to be processed
  • Common to deal with CSV (Comma separated value) or similar formatted data
  • Standard library functions can help, but processing involves designing algorithms

More Convenience functions in C

  • There is a ctype.h library that provides several "check" functions for single characters: isalpha(c), isdigit(c), islower(c), isupper(c), isspace(c), conversion: toupper(c), tolower(c), etc.
@cbourke
cbourke / arrayTester.c
Created October 17, 2018 14:53
auto-posted gist
#include<stdlib.h>
#include<stdio.h>
#include "array_utils.h"
int main(int argc, char **argv) {
int n = 5;
int a[] = {1, 6, 7, 2, 3};
int b[] = {9, 4, 2, 5, 2};