Runtime | Create | Process |
---|---|---|
C++ | 0.30 | 0.13 |
HL | 1.35 | 0.36 |
JS | 0.55 | 0.07 |
This file contains hidden or 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
fun nonRepeating(string: String): Int { | |
return when (string.length) { | |
0 -> 0 | |
1 -> 1 | |
else -> nonRepeatingActual(string, 0, 1) | |
} | |
} | |
fun nonRepeatingActual( | |
string: String, |
This file contains hidden or 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
//@flow | |
/** | |
* The model, broken down into three parts (data, ui, & effects). | |
* | |
* data - canonical representation/interface with various backends. | |
* ui - the UI state | |
* effects - effects we want to trigger | |
* | |
* Model should probably be a parameterized type |
This file contains hidden or 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
public final class Thoughts { private Thoughts() {} } | |
/** | |
* # Introduction | |
* | |
* A number of thoughts/concerns floating in my head: | |
* 1 - DDD Aggregates, specifically transaction boundaries [1] | |
* 2 - Entity-Component-Systems, how games are data oriented, high performance | |
* databases [2][3] | |
* 3 - How 1 & 2 work with relational databases |
This file contains hidden or 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
/** | |
* This code hasn't been tested, but this gives you an idea of what to throw together to get this to work | |
* | |
* You also need to go into your jooq generator config and setup the following: | |
* | |
* <forcedTypes> | |
* <forcedType> | |
* <name></name> | |
* <expression>(?i:Table.field)</expression> | |
* <types>(?i:DATETIME(\s*\(\d+\))?)</types> |
This file contains hidden or 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.util.NoSuchElementException; | |
import java.util.Optional; | |
import java.util.concurrent.Callable; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.function.Supplier; | |
public abstract class Try<T> { | |
private Try() { |