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.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.marshalling.Marshaller | |
import akka.http.scaladsl.marshalling.ToResponseMarshallable.apply | |
import akka.http.scaladsl.marshalling.ToResponseMarshaller | |
import akka.http.scaladsl.model.{ ContentTypes, HttpEntity } | |
import akka.http.scaladsl.model.HttpEntity.ChunkStreamPart | |
import akka.http.scaladsl.model.HttpResponse | |
import akka.http.scaladsl.server.Directive.addByNameNullaryApply |
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.NotUsed | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.common.{ EntityStreamingSupport, JsonEntityStreamingSupport } | |
import akka.http.scaladsl.model.{ HttpEntity, StatusCodes, _ } | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._ | |
import akka.http.scaladsl.marshalling.{ Marshaller, ToEntityMarshaller, ToResponseMarshaller } | |
import akka.http.scaladsl.model.TransferEncodings.gzip |
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, ActorRef, ActorSystem, CoordinatedShutdown, Props} | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.math.BigInt | |
import scala.util.Success | |
import akka.pattern._ | |
import akka.util.Timeout | |
import scala.concurrent.duration._ |
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
IAM | |
IAM => Identity And Access Management | |
It contains Users, Groups, Roles | |
Users => Normal Person As An User. | |
Groups => Based On Functions Designate it to particular groups. Example: Dev-Ops, Engineering. | |
Roles => Machine. | |
Policies Are In Json. | |
Lease Privilege Principles. |
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
/* | |
* Self-Explanatory Protocol Buffer Lang Guide | |
*/ | |
/* | |
* Why Protocol Buffers? | |
* Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. | |
* You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages. | |
* Protocol Buffers are Schema Of Messages. They are language agnostic. |
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
/** | |
* @author ShankarShastri | |
* Algorithm: JumpingMario (https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2864) | |
*/ | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Scanner; | |
import java.util.Vector; | |
import java.util.function.BiFunction; |
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
/** | |
* @author ShankarShastri | |
* Algorithm: JumpingMario (https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2864) | |
*/ | |
import scala.io.StdIn._ | |
object JumpingMario { | |
def main(args: Array[String]): Unit = { | |
val n = readLine().toInt | |
loopWithIndex(n) { i => |
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._ | |
import akka.routing.{ Broadcast, DefaultResizer, RoundRobinPool } | |
case object Init | |
case object Pong | |
case object Ping | |
class PingActor(pongActorRef: ActorRef) extends Actor { | |
def receive: Receive = { | |
case Init => |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 protoser | |
import java.util.concurrent.atomic.AtomicReference | |
import akka.actor.ExtendedActorSystem | |
import akka.serialization.BaseSerializer | |
import com.trueaccord.scalapb.GeneratedMessageCompanion | |
class ScalaPbSerializer(val system: ExtendedActorSystem) extends BaseSerializer { | |
private val classToCompanionMapRef = new AtomicReference[Map[Class[_], GeneratedMessageCompanion[_]]](Map.empty) |
OlderNewer