This file contains hidden or 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
| class ConnectedComponents { | |
| private int[] components; | |
| private int[] orders; | |
| ConnectedComponents(int size) { | |
| this.components = new int[size]; | |
| this.orders = new int[size]; | |
| for (int i = 0; i < size; i++) { | |
| components[i] = i; |
This file contains hidden or 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 java.util.Arrays; | |
| import java.util.stream.IntStream; | |
| import java.util.stream.Stream; | |
| public class Solution { | |
| static class Graph { | |
| private final int[][] adj; |
This file contains hidden or 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
| trait Enum { //DIY enum type | |
| import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia | |
| type EnumVal <: Value //This is a type that needs to be found in the implementing class | |
| private val _values = new AtomicReference(Vector[EnumVal]()) //Stores our enum values | |
| //Adds an EnumVal to our storage, uses CCAS to make sure it's thread safe, returns the ordinal | |
| private final def addEnumVal(newVal: EnumVal): Int = { import _values.{get, compareAndSet => CAS} | |
| val oldVec = get |
This file contains hidden or 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
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Client] begin handshake Client | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Client] bidirectional | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Client] bidirectional continue | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Client] wrap: status=OK handshake=NEED_UNWRAP remaining=0 out=149 | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Client] flushToTransport | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Client] sending 149 bytes | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Server] begin handshake Server | |
| [akka://TlsSpec/user/StreamSupervisor-0/flow-Server] bidirectional |