Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
package recursion; | |
import java.util.Scanner; | |
/** | |
* | |
The base case for the problem is n = 1. If n == 1, you could simply move the disk from A | |
to B. When n > 1, you could split the original problem into the following three subproblems | |
and solve them sequentially. | |
1. Move the first n - 1 disks from A to C recursively with the assistance of tower B, |
package Java_FP.Timing; | |
import java.util.Date; | |
import java.util.function.Consumer; | |
import java.util.function.Supplier; | |
/** | |
* Created by liuyufei on 19/10/16. | |
*/ | |
public class Timing { |
package Java_FP.Timing; | |
import java.util.concurrent.atomic.AtomicReference; | |
/** | |
* Created by liuyufei on 19/10/16. | |
*/ | |
public class TimingTest { | |
@org.junit.Test |
package Java_FP.Timing; | |
import java.util.logging.LogManager; | |
import java.util.logging.Logger; | |
import static Java_FP.Timing.Timing.timed; | |
/** | |
* Created by liuyufei on 19/10/16. | |
*/ | |
public class Example { |
package Java_FP.FP; | |
/** | |
* Created by liuyufei on 18/10/16. | |
*/ | |
@FunctionalInterface | |
public interface FunctionOverTime { | |
double valueAt(int time); |
package Java_FP.FP; | |
/** | |
* Created by liuyufei on 18/10/16. | |
*/ | |
public class Example { | |
final static double[] EXPECTED_SALES_JAN_TO_DEC = | |
new double[]{42.0, 45.6, 43.6, 50.2, 55.6, 54.7, | |
58.0, 57.3, 62.0, 60.3, 71.2, 88.8 |
package Java_FP.collection; | |
import java.util.Arrays; | |
import java.util.Optional; | |
import java.util.function.BinaryOperator; | |
import java.util.function.Function; | |
import java.util.function.Predicate; | |
import java.util.stream.Stream; | |
/** |
package Java_FP.salesFP; | |
import java.util.*; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
/** | |
* Created by liuyufei on 19/10/16. | |
*/ |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,
package chapter4 | |
import akka.actor.{Actor, ActorSystem, Props} | |
import akka.routing.RoundRobinPool | |
/** | |
* Created by Administrator on 2017/1/6. | |
*/ | |