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 com.amazonaws.services.sqs.AmazonSQSClient; | |
| import org.apache.camel.CamelContext; | |
| import org.apache.camel.builder.RouteBuilder; | |
| import org.apache.camel.impl.DefaultCamelContext; | |
| import org.apache.camel.impl.SimpleRegistry; | |
| import java.time.ZonedDateTime; | |
| import java.time.format.DateTimeFormatter; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| import java.util.concurrent.atomic.AtomicReference; |
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.ActorSystem | |
| import akka.http.scaladsl.Http | |
| import akka.http.scaladsl.server.Directives._ | |
| import akka.stream.{ ActorMaterializer, Materializer } | |
| import com.typesafe.scalalogging.StrictLogging | |
| import scala.concurrent.Await | |
| import scala.concurrent.duration._ | |
| import scala.language.postfixOps |
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 cats.data.{ Xor, XorT } | |
| import cats.std.future._ | |
| import cats.syntax.xor._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.duration.Duration | |
| import scala.concurrent.{ Await, Future } | |
| object XorDemo extends App { | |
| sealed trait Error |
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 cats.data.XorT | |
| import cats.std.future._ | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| import scala.concurrent.duration.Duration | |
| import scala.concurrent.{ Await, Future } | |
| object XorDemo extends App { | |
| sealed trait Error |
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
| object Payments { | |
| trait PaymentProcessorType { | |
| } | |
| object DefaultPaymentProcessorType extends PaymentProcessorType | |
| trait PaymentProcessor { | |
| def processorType: PaymentProcessorType | |
| def process(payment: Payment): Unit |
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 com.google.common.collect.Lists; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.concurrent.ExecutionException; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.Future; | |
| public class ParallelGroups { |
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
| object HelloWorld extends App { | |
| implicit val system = ActorSystem() | |
| implicit val executor = system.dispatcher | |
| implicit val materializer = ActorMaterializer() | |
| val routes: Route = path("check") { | |
| get { | |
| complete("Hello, World") | |
| } | |
| } |
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.Random; | |
| public class MaxSubArray { | |
| public static int maxSubArray(int[] arr) { | |
| if (arr.length == 0) { | |
| return 0; | |
| } | |
| int maxEndingHere = arr[0]; | |
| int maxSoFar = arr[0]; |
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.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| public class MergeRangesJava { | |
| public static class Range { | |
| public final int start; | |
| public final int end; |
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.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.Iterator; | |
| import java.util.List; | |
| public class MergeRangesJava { | |
| public static class Range { | |
| public final int start; | |
| public final int end; |
NewerOlder