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
/** | |
* Flyweight to keep track of values so long as they are valid. | |
* Values that have been fetched within [maxAge] from the time of use will be reused. | |
* If multiple requests are sent with the same key, then the value should only be fetched once. | |
* Otherwise, they will be fetched using [fetcher]. | |
* All requests will stem from the supplied [scope]. | |
*/ | |
class Flyweight<K, V>( | |
val scope: CoroutineScope, | |
val maxAge: Long, |
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
(* | |
Test code for hw1 - Comp 302 | |
*Warning* - I have no prior experience with OCaml. | |
If you encounter an issue that is not obviously solvable, let me know; | |
I may have made a mistake! | |
To use this, put this file in the same drectory as your hw1.ml, | |
launch ocaml, and execute: | |
``` |
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
import java.io.PrintStream; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by Allan Wang on 2017-09-27. | |
* <p> | |
* Tester class for Comp 202, Fall 2017, Assignment 1 | |
* You may choose to run tasks selectively by commenting | |
* out the method you don't want to run |
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 test; | |
import com.sun.istack.internal.NotNull; | |
import java.util.Comparator; | |
/** | |
* Created by Allan Wang on 2017-09-21. | |
*/ | |
public class UniversalComparator implements Comparator<UniversalComparator.Card> { |
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
(* | |
Test code for hw1 - Comp 302 | |
*Warning* - I have no prior experience with OCaml. | |
If you encounter an issue that is not obviously solvable, let me know; | |
I may have made a mistake! | |
To use this, put this file in the same drectory as your hw1.ml, | |
launch ocaml, and execute: | |
``` |
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.pitchedapps.theme.tools; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.Locale; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** |