会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
...............洋葱的秋秋空间.......................
欢迎来到洋葱的秋秋空间
博客园
首页
新随笔
联系
管理
上一页
1
2
3
4
5
6
7
下一页
2018年2月4日
idea classpath
摘要: Source Folders表示的都是代码源文件目录,生成的class文件会输出到target->classess文件夹中,但是里面的源文件不会复制到target->classes文件夹中,Test Source Folders表示的都是测试代码源文件目录,生成的class文件同样会输出到targe
阅读全文
posted @ 2018-02-04 01:39 R4mble
阅读(183)
评论(0)
推荐(0)
2018年2月3日
(五)返回两个数组之间的差异
摘要: 只保留 b 中不包含的值。
阅读全文
posted @ 2018-02-03 01:57 R4mble
阅读(170)
评论(0)
推荐(0)
(四)数组扁平化
摘要: public static int[] deepFlatten(Object[] input) { return Arrays.stream(input) .flatMapToInt(o -> { if (o instanceof Object[]) { return Arrays.strea...
阅读全文
posted @ 2018-02-03 01:43 R4mble
阅读(118)
评论(0)
推荐(0)
(三)计算数组中某个值出现的次数
摘要: public static long countOccurrences(int[] numbers, int value) { return Arrays.stream(numbers) .filter(number -> number == value) .count(); }
阅读全文
posted @ 2018-02-03 01:20 R4mble
阅读(307)
评论(0)
推荐(0)
(二)连接两个数组返回新数组
摘要: 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...
阅读全文
posted @ 2018-02-03 01:09 R4mble
阅读(172)
评论(0)
推荐(0)
(一)将数组分割成特定大小的小数组。
摘要: public static int[][] chunk(int[] numbers, int size) { return IntStream.iterate(0, i -> i + size) .limit((long) Math.ceil((double) numbers.length / size)) //返回大于或等于...
阅读全文
posted @ 2018-02-03 00:15 R4mble
阅读(430)
评论(0)
推荐(0)
2018年1月31日
1.43(计算f的n次重复应用)
摘要: 递归写法: 迭代写法:
阅读全文
posted @ 2018-01-31 23:56 R4mble
阅读(180)
评论(0)
推荐(0)
1.42(函数的复合)
摘要: (define (compose f g) (lambda (x) (f (g x)))) ((compose square inc) 6) ((compose inc inc) 6)
阅读全文
posted @ 2018-01-31 23:54 R4mble
阅读(180)
评论(0)
推荐(0)
1.40(玩弄函数:对一个参数应用两次函数的函数)
摘要: (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)
阅读全文
posted @ 2018-01-31 23:20 R4mble
阅读(145)
评论(0)
推荐(0)
2.2(点,线段,矩形的构造)
摘要: ;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 ","...
阅读全文
posted @ 2018-01-31 22:44 R4mble
阅读(164)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告