摘要:
Source Folders表示的都是代码源文件目录,生成的class文件会输出到target->classess文件夹中,但是里面的源文件不会复制到target->classes文件夹中,Test Source Folders表示的都是测试代码源文件目录,生成的class文件同样会输出到targe 阅读全文
摘要:
只保留 b 中不包含的值。 阅读全文
摘要:
public static int[] deepFlatten(Object[] input) { return Arrays.stream(input) .flatMapToInt(o -> { if (o instanceof Object[]) { return Arrays.strea... 阅读全文
摘要:
public static long countOccurrences(int[] numbers, int value) { return Arrays.stream(numbers) .filter(number -> number == value) .count(); } 阅读全文
摘要:
public static T[] concat(T[] first, T[] second) { return Stream.concat( Stream.of(first), Stream.of(second) ).toArray(i -> (T[]) Arrays.copyOf(new Object[0], i, first... 阅读全文
摘要:
public static int[][] chunk(int[] numbers, int size) { return IntStream.iterate(0, i -> i + size) .limit((long) Math.ceil((double) numbers.length / size)) //返回大于或等于... 阅读全文
摘要:
递归写法: 迭代写法: 阅读全文
摘要:
(define (compose f g) (lambda (x) (f (g x)))) ((compose square inc) 6) ((compose inc inc) 6) 阅读全文
摘要:
(define (double f) (lambda (x) (f (f x)))) (define (inc x) (+ x 1)) (((double (double double)) inc) 5) ;amazing (((double (double (double double))) inc) 0) 阅读全文
摘要:
;2.2 (define (make-point x y) (cons x y)) (define (x-point p) (car p)) (define (y-point p) (cdr p)) (define (print-point p) (newline) (display "{") (display (x-point p)) (display ","... 阅读全文