This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************* | |
* Lab 3 Exercise 2 | |
* Name: Abdul Haliq | |
* Student No: A0125431U | |
* Lab Group: B-08 | |
*************************************/ | |
#include <pthread.h> | |
#include "rw_lock.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class CodeCard implements FlashCard { | |
protected String question; | |
protected String output; | |
public JavascriptCard(String q, String o) { | |
question = q; | |
output = o; | |
} | |
abstract render... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.core; | |
public enum Response { | |
BYE("(?i)^b(ye)?\\s*", (i, s) -> { | |
Printer.printString("Bye. Hope to see you again soon!"); | |
s.toExit = true; | |
s.lastError = false; | |
return true; | |
}), | |
RESPONDER_NAME("regex", (commandInput, programState) -> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.core; | |
import com.core.savedata.SaveFile; | |
import com.util.datetime.DateTime; | |
import com.util.datetime.DateTimeParse; | |
import java.util.stream.IntStream; | |
import com.util.Printer; | |
import com.tasks.Deadline; | |
import com.tasks.DoableTask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// my motivation to use enum is so you dont need to create new objects everytime a command is executed | |
// instead you simply call a static method. and to iterate through a list of static methods we use enums. | |
// So this is a typical enum u encounter all the time | |
enum MyEnum { | |
A, B, C; | |
} | |
// However enums are capable of having properties and methods! | |
// if u define a method in an enum all enums will have it | |
// e.g. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let STAGE_WIDTH = 800; | |
const STAGE_HEIGHT = 400; | |
const L_BORDER = 25; | |
const COLBG = 220; | |
const COL1 = 100; | |
const COL2 = 195; | |
const PIVOTRADI = 10; | |
const LINEGAP = 5; | |
let UNITRADI = 50; | |
let DW; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NOTE read Responses.java first itll make more sense | |
public class CreateInputCommand implements ResponseFunc { | |
private String front = ""; | |
private String back = ""; | |
// handle types?? | |
@Override | |
public boolean funcCall(String i, State s) { | |
if (s.state == StateEnum.CREATE_STATE_FRONT) { | |
front = i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rate[x_] := rated[x*365] | |
rated[x_] := | |
If[x < 7, 1.5, | |
If[x < 30.4167, 3, If[x < 365/2, 5, If[x < 365, 17, 30]]]] | |
f[ip_, r_, p_, t_, n_] := | |
If[t <= 0, ip, | |
If[t < p, ip + ip*r*t - rate[t], | |
f[ip + (ip * r * p) - rate[p] - rate[0]*n, r, p, (t - p), n + 1]]] | |
g[ip_, r_, t_] := ip + ip*r*t - rate[t] | |
init := 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let global_nctx = ref Kernel.Context.empty | |
let global_ectx = ref Kernel.Context.empty | |
let js_run_repl str = | |
match String.(compare str "quit") with | |
| 0 -> "bye" | |
| _ -> | |
match String.(compare str "reset") with | |
| 0 -> | |
global_nctx := Kernel.Context.empty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************** | |
Online C++ Compiler. | |
Code, Compile, Run and Debug C++ program online. | |
Write your code in this editor and press "Run" button to compile and execute it. | |
*******************************************************************************/ | |
#include <iostream> | |
#include <string> |
OlderNewer