confirmation page
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 remember() that can survive recompositions and config changes but not process death. | |
@Composable | |
inline fun <T: Any> rememberRetained( | |
key: String = currentCompositeKeyHash.toString(36), // Copied from rememberSaveable() | |
crossinline init: @DisallowComposableCalls () -> T | |
): T { | |
if (retainedStore[key] == null) { | |
retainedStore[key] = init() | |
} | |
val activity = LocalContext.current.findActivity() |
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.util.*; | |
interface Node {} | |
class LeafNode implements Node { | |
String operand; | |
public LeafNode(String o) { | |
operand = o; | |
} | |
public String toString() { |
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
final Observable<String> o = Observable.create(new ObservableOnSubscribe<String>() { | |
@Override | |
public void subscribe(ObservableEmitter<String> e) throws Exception { | |
for(int i=0; i<10; i++) { | |
if(e.isDisposed()) break; | |
// make request here... | |
e.onNext(String.valueOf(i)); | |
try { | |
Thread.sleep(1000); | |
} catch(InterruptedException ie) {} |
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
var data = [[1, 2, 3], [4, 5, 6]] | |
var index = 0 | |
print(data[0]) | |
print(data[1]) | |
index = 0 | |
data[index].remove(at:0) | |
print(data[0]) |
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.util.concurrent.*; | |
public class App { | |
public static void main(String[] args) throws InterruptedException, ExecutionException { | |
final int poolSize = 2; | |
final ExecutorService executorService = | |
Executors.newFixedThreadPool(poolSize); | |
final CompletionService<String> completionService = | |
new ExecutorCompletionService<>(executorService); |
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
1. | |
Khan Academy | Mountain View, CA or REMOTE | full-time and internships | |
We're a small, non-profit tech startup bringing a free, world-class education | |
to anyone, anywhere. | |
Millions of people use our free educational platform to learn every month. The | |
testimonials at <https://www.khanacademy.org/stories> will give you a feel for | |
just how intense an impact Khan Academy has on the lives of folks in all sorts | |
of varied situations. |
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 ken; | |
import rx.*; | |
import java.util.concurrent.TimeUnit; | |
enum MotionEvent { Down, Move, Up }; | |
class Main { | |
public static void test1() { | |
Observable.just("Hello") | |
.map(s -> s+"!!!") |
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.example.ken.remote; | |
import android.content.Context; | |
import android.os.AsyncTask; | |
import android.support.v4.view.MotionEventCompat; | |
import android.util.Log; | |
import android.view.MotionEvent; | |
public class BlindGestureDetector { | |
private float mX = 0; |
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.util.HashSet; | |
class NotInArray { | |
public static void main(String[] args) { | |
int[] input = new int[] { Integer.MAX_VALUE, 3, 4, 7, 9, Integer.MIN_VALUE }; | |
System.out.println(notInArray(input)); | |
} | |
private static int notInArray(int[] input) { | |
HashSet<Integer> possibleValues = new HashSet<>(); |
NewerOlder