Skip to content

Instantly share code, notes, and snippets.

View dulimarta's full-sized avatar

Hans Dulimarta dulimarta

  • School of Computing and Information Systems, Grand Valley State University
  • Grand Rapids, Michigan
View GitHub Profile
@dulimarta
dulimarta / gist:6c70dab93b71154947e1
Last active October 28, 2015 16:43
Polynomial.hpp
/*
* Polynomial.hpp
*
* Author: "Hans Dulimarta <dulimarh@cis.gvsu.edu>"
*/
#ifndef POLYNOM_H_
#define POLYNOM_H_
#include <algorithm>
@dulimarta
dulimarta / GUI.java
Last active October 30, 2015 13:58
Sierpinski Triangle with animation
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
/**
* Draw a recursive 2D graphics
*
* @version Fall 2015
* @author Hans Dulimarta
@dulimarta
dulimarta / hw513_main.cpp
Last active November 2, 2015 21:18
hw513_main.cpp
#include "gvsu_cis.h"
#include "Polynomial.hpp"
#include <sstream>
TEST_CASE ("Getter")
{
/* 8x^100 - 3x^5 + 9 */
Polynomial<float> one("[8 100] [-3 5] [9 0]");
@dulimarta
dulimarta / GVList.java
Last active November 9, 2015 16:05
GVSU CIS163 Project
package cis163.text_scrambler;
/**
* Created by Hans Dulimarta on Fall 2015.
*/
public interface GVList<GVElement> {
/**
* Check if the list is empty
* @return true/false
@dulimarta
dulimarta / STGUI.java
Created November 13, 2015 07:11
GUI files for ScrambledText Part B
package cis163.text_scrambler.ui;
import cis163.text_scrambler.GVList;
import cis163.text_scrambler.Scrambler;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
@dulimarta
dulimarta / GVList.java
Last active November 16, 2015 13:24
CS163-Text-Scrambler-PartB
package cis163.text_scrambler;
/**
* Created by Hans Dulimarta on Fall 2015.
*/
public interface GVList<GVElement> {
/**
* Check if the list is empty
* @return true/false
@dulimarta
dulimarta / icpc2345-nc.cpp
Created November 17, 2015 18:09
CS263 HW07 Sample Files
//
// Created by Hans Dulimarta
//
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
@dulimarta
dulimarta / ScramblerTester.java
Last active January 29, 2016 15:25
ScramblerTester.java
package cis163.text_scrambler.test;
import cis163.text_scrambler.GVList;
import cis163.text_scrambler.Scrambler;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
import java.util.Random;
@dulimarta
dulimarta / tp_main.cpp
Last active January 29, 2016 15:27
CS263 text predictor unit testing
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <iostream>
#include "TextPredictor.h"
using namespace std;
TEST_CASE ("Scan") {
vector<pair<string,vector<string>>> expected_follower {
{"ability", {"to","when"}},
{"about", {"it","the","that","him","his","something","a","in","to","you","how","me","on","them","concluded","he","much","project","until","again","all","an","and","announced","any","by","doing","done","eh","etexts","everything","five","having","made","marveled","my","myself","next","one","ready","right","running","seven","slowly","so","some","stop","ten","there","they","this","those","three","time","twenty","two","watching","what","while","with","working","your"}},
@dulimarta
dulimarta / TextPredictor.h
Last active January 29, 2016 15:27
CS263 TextPredictor.h
//
// Created by Hans Dulimarta
//
#ifndef TEXTPREDICTOR_TEXTPREDICTOR_H
#define TEXTPREDICTOR_TEXTPREDICTOR_H
#include <fstream>
#include <vector>
#include <map>