Skip to content

Instantly share code, notes, and snippets.

View rcliao's full-sized avatar

Eric Liao rcliao

View GitHub Profile
@rcliao
rcliao / machine.js
Last active August 23, 2020 19:50
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine(
{
id: 'giftcard-code-states',
initial: 'NULL',
context: {
balance: 0,
},
states: {
NULL: {
on: {
@rcliao
rcliao / lint-directories.js
Created May 22, 2020 15:47
lint-directories
const fs = require('fs');
const path = require('path');
const serviceDirectories = [
'services/auth',
'services/email',
'services/golive',
'services/logger',
'services/payouts',
'services/points',
@rcliao
rcliao / build.gradle
Created April 11, 2017 17:20
Gradle task to generate classpath for Javac linter
// Javac related task to generate classpath for linter
task generateClasspath {
description 'Generate classpath file for Javac linter'
ext.destFile = file("$buildDir/classpath.txt")
outputs.file destFile
doLast {
def classpathString = sourceSets.main.runtimeClasspath.collect{ it.absolutePath }.join(File.pathSeparator)
if (!destFile.parentFile.exists()) {
destFile.parentFile.mkdirs()
}
@rcliao
rcliao / cheat.sh
Created May 23, 2016 00:32
A simple shell to detect same file for cheating.
#!/bin/bash
FILES=*/*.py
for filename in $FILES; do
for other in $FILES; do
if [ "$filename" != "$other" ]
then
cmp -s "$filename" "$other"
retval=$?
if [ $retval -eq 0 ]
then
@rcliao
rcliao / example.html
Created April 7, 2014 16:29
Simple HTML file
<html>
<head>
<title>Assignment 1</title>
</head>
<body>
<!-- change the link in the href to your post -->
<a href="http://csns.calstatela.edu/department/cs/forum/topic/view?id=4507427">Link to the forum</a>
</body>
</html>
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv as csv
import numpy as np
from sklearn import tree
from sklearn.externals.six import StringIO
import pydot

Why Am I Here?

For fun.

To present another way to predict Titanic's survival

Review

Types of Learning

  • Supervised Learning Teacher provides labeled examples
  • Unsupervised Learning
import java.util.Scanner;
public class BiddingGameEngineSimple
{
static int player1 = 100;
static int player2 = 100;
static int draw = 0;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
public class BinaryDigit
{
private int digit;
public BinaryDigit(int digit)
{
this.digit = digit;
}
public String getBinaryString() {
@rcliao
rcliao / AI_Template.java
Last active August 29, 2015 13:56
CS 201 Project Template
import java.util.Scanner;
// change the class name to be AI_YourLastName
public class AI_Template {
// Feel free to create method to support your logic
static int calculate_bid(int player, int pos, int[] first_moves,
int[] second_moves) {
// simplify the information to myMoney, and enemyMoney
int[] info = calculateMoney(player, first_moves, second_moves);