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
fun reduce(action: Action, state: State): Effect |
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
val commandHandler: CommandHandler | |
var runtimeData: RuntimeData | |
fun RuntimeKernel.receive(action) { | |
//the runtime maintains its own main loop | |
marshallToRuntimeMainThread { | |
val transition = reduce(action, runtimeData) | |
runtimeData = transition.runtimeData | |
//effect system, describes commands and runtimeData state change operations | |
val transitionOperations = describe(transition) |
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
public byte[] encrypt(byte[] in) | |
{ | |
... | |
byte[] iv = new byte[IV_LENGTH]; | |
new SecureRandom().nextBytes(iv); | |
cipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv)); | |
byte[] cipherBytes = cipher.doFinal(s.getBytes("UTF-8")); | |
return concat(iv, cipherBytes); | |
} |
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
/** | |
* A PilotStack that also holds a ref to a Dagger Component. This is useful for easy Activity-Scoped DI as the PilotStack has to already live | |
* on past the host-Activities config-change events by some mechanism (project dependent). | |
* | |
* @param <D> A Dagger Component to supply all deps for this stacks frames. | |
*/ | |
//todo unused - here for dagger activity scope refactor (See trello) | |
public class DaggerPilotStack<D> extends PilotStack | |
{ | |
D scopedDaggerComponent; |
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
#ps | |
USER PID PPID VSIZE RSS WCHAN PC NAME | |
root 1 0 4524 908 SyS_epoll_ 0000000000 S /init | |
shell 503 1 9952 700 0000000000 S /sbin/adbd | |
shell 17432 29176 5744 1156 0 7f8b5d6c7c R ps | |
shell 29176 503 5800 1444 sigsuspend 7f9663f37c S /system/bin/sh |
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
//in your root build.gradle | |
//--------- Version Increment ----------// | |
//can call this like `./gradlew incrementVersionCode build` | |
task incrementVersionCode { | |
description = "Increments the version code in the version.properties file" | |
doLast { | |
File versionPropsFile = file('version.properties') |
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
### Keybase proof | |
I hereby claim: | |
* I am doridori on github. | |
* I am dori (https://keybase.io/dori) on keybase. | |
* I have a public key whose fingerprint is CC45 C7F9 5462 AD1D 729C CA47 83C4 30D2 BC60 9EB5 | |
To claim this, I am signing this object: |
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
byte aByte = -112; //0b1001_0000 | |
byte bByte = (byte) (aByte >> 4); //would expect 0b1111_1001 (-7) | |
System.out.println(bByte); //-7 | |
byte cByte = (byte) (aByte >>> 4); //would expect 0b0000_1001 (9) | |
System.out.println(cByte); //-7 |
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
/** | |
* Allows easy swapping of production and test modules to satisfy Dagger dependencies | |
*/ | |
public class DaggerHelper | |
{ | |
//DAGGER | |
private static ObjectGraph sObjectGraph; | |
private static final List<Object> productionModules; |
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
public final class GsonObjectPersister<T> extends InFileObjectPersister<T> | |
{ | |
// ============================================================================================ | |
// FIELDS | |
// ============================================================================================ | |
private final Gson gson; | |
// ============================================================================================ | |
// CONSTRUCTOR |
NewerOlder