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 akka.actor.SupervisorStrategy.Restart | |
import akka.actor.{Actor, ActorInitializationException, ActorSystem, OneForOneStrategy, Props} | |
object Main extends App { | |
var attempt: Int = 0 | |
class FailingActor extends Actor { | |
if (attempt == 0) { | |
// throw exception only for the first time, simulating first attempt to create an actor that fails |
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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"id": "uuid-schema", | |
"description": "Validation for UUID", | |
"type": "string", | |
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" | |
} |
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
{ | |
"data": { | |
"id": "1", | |
"type": "chapters", | |
"attributes": { | |
"title": "A Long-expected Party", | |
"ordering": 1, | |
"created_at": "2017-06-18 11:30:17", | |
"updated_at": "2017-06-18 11:30:17" | |
}, |
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
{ | |
"data": { | |
"id": "1", | |
"type": "books", | |
"attributes": { | |
"date_published": "1954-07-29", | |
"title": "The Fellowship of the Ring", | |
"created_at": "2017-06-18 11:30:16", | |
"updated_at": "2017-06-18 11:30:16" | |
}, |
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
package uk.co.real_logic; | |
import static java.lang.System.out; | |
/* | |
Original exercise did during "Lock Free Workshop" by Martin Thompson: http://www.real-logic.co.uk/training.html | |
*/ | |
public final class PingPong { | |
private static final int REPETITIONS = 100_000_000; |
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 scala.util.Random | |
object Suit extends Enumeration { | |
val Clubs, Spades, Hearts, Diamonds = Value | |
} | |
object Rank extends Enumeration { | |
val Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen, King, Ace = Value | |
} |
NewerOlder