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 com.google.common.base.*; | |
import com.google.common.cache.*; | |
import com.google.common.collect.*; | |
import com.google.common.hash.*; | |
import com.google.common.hash.Hashing; | |
import com.google.common.io.Files; | |
import com.google.common.io.LineProcessor; | |
import org.junit.Assert; | |
import org.junit.Test; |
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
@startuml | |
Alice -> Bob: Authentication Request | |
Bob --> Alice: Authentication Response | |
Alice -> Bob: Another authentication Request | |
Alice <-- Bob: another authentication Response | |
@enduml |
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
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /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
/** | |
* 调用getBoolean方法的时候,有几个疑问: | |
* 1. 传入bool = true和直接用true有啥区别, 看编译后的字节码, 没啥特别的,有啥不同么。 | |
* 在scala的插件中,提示建议使用bool = true的方式 | |
* 2. java的疑问:invokevirtual指令:会对long/double优先放入frame中,这样在运行时如何保证参数的调用顺序? | |
* 在检查参数的时候也使用64位类型优先? | |
**/ | |
object Test1 { | |
def main(args: Array[String]) { | |
val a = getBoolean(0.1222d, 122, true) |
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 net.pusuo.java; | |
import sun.management.HotspotThreadMBean; | |
import sun.management.ManagementFactoryHelper; | |
import java.lang.management.*; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.ScheduledExecutorService; |
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 com.esotericsoftware.kryo.Kryo; | |
import com.esotericsoftware.kryo.io.Input; | |
import com.esotericsoftware.kryo.io.Output; | |
import com.esotericsoftware.kryo.serializers.CollectionSerializer; | |
import com.esotericsoftware.kryo.serializers.MapSerializer; | |
import com.google.common.io.Files; | |
import java.io.*; | |
import java.nio.charset.Charset; |
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 sample | |
import java.io._ | |
/** | |
* 序列化测试 | |
* Created by 玄畅 on 29/10/14. | |
* | |
* 结果: | |
* 序列化之前: |
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
val a: Float = -670746245f | |
val b: Float = 1f | |
val s1 = b + a | |
/* | |
问题:a + b应该是:-670746244f, 结果是一个固定常量-670746240,怎么破 | |
s1的结果:-6.7074624E8 | |
编译后: |
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 akka.actor.{Actor, ActorSystem, Props} | |
/** | |
* 平均每秒: 2500000 | |
* cpu能跑满 | |
* a sample | |
* Created by shijinkui on 15/1/15. | |
*/ |
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 akka | |
import akka.actor.{Actor, ActorSystem, Props} | |
import scala.concurrent.duration._ | |
object AkkaScheduleTest { | |
def main(args: Array[String]) { | |
val system = ActorSystem("akka_system") | |
system.actorOf(Props[AkkaScheduleTest], "test_actor") |
OlderNewer