Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1505548
  • 博文数量: 399
  • 博客积分: 8508
  • 博客等级: 中将
  • 技术积分: 5302
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-14 09:28
个人简介

能力强的人善于解决问题,有智慧的人善于绕过问题。 区别很微妙,小心谨慎做后者。

文章分类

全部博文(399)

文章存档

2018年(3)

2017年(1)

2016年(1)

2015年(69)

2013年(14)

2012年(17)

2011年(12)

2010年(189)

2009年(93)

发布时间:2015-05-02 09:07:34

Scala 是构建在 JVM 上的静态类型的脚本语言,而脚本语言总是会有些约定来增强灵活性。灵活性可以让掌握了它的人如鱼得水,也会让初学者不知所措。比如说 Scala 为配合 DSL 在方法调用时有这么一条约定:1) 在明确了方法调用的接收者的情况下,若方法只有一个参数时,调用的时候就可以省略点及括号。如 “0 to 2”,实.........【阅读全文】

阅读(783) | 评论(0) | 转发(0)

发布时间:2015-05-02 00:33:36

package STMimport scala.concurrent.stm.Refimport scala.concurrent.stm.atomicimport scala.concurrent.stm.retryimport scala.concurrent.stm.retryForimport java.util.Timerimport java.util.TimerTaskimport java.util.concurrent.TimeUnitobject SensibleWait {  val start = System.nanoTime()&.........【阅读全文】

阅读(747) | 评论(0) | 转发(0)

发布时间:2015-05-02 00:09:48

......【阅读全文】

阅读(855) | 评论(0) | 转发(0)

发布时间:2015-05-01 20:17:25

public class AccountService { public boolean transfer(final Account from, final Account to, final int amount) throws LockException, InterruptedException {    final Account[] accounts = new Account[] {from, to};     Arrays.sort(accounts);     .........【阅读全文】

阅读(1139) | 评论(0) | 转发(0)

发布时间:2015-05-01 20:10:48

public class FileSize {    private final static ForkJoinPool forkJoinPool = new ForkJoinPool();    private static class FileSizeFinder extends RecursiveTask<Long> { final File file;    public FileSizeFinder(final File theFile) { file = theFile;} .........【阅读全文】

阅读(831) | 评论(0) | 转发(0)
给主人留下些什么吧!~~

我本痴情2013-12-26 15:33

谢谢你的分享,收益颇多,谢谢

回复  |  举报

shiluodan2013-08-08 20:55

还只是菜鸟,不过还是希望能看到那些很厉害的博文。很感谢你的分享。

回复  |  举报
留言热议
请登录后留言。

登录 注册