I hereby claim:
- I am yashsriv on github.
- I am yashsriv (https://keybase.io/yashsriv) on keybase.
- I have a public key whose fingerprint is A351 1A95 1BA5 498E C9B6 41A9 0A90 380A 06FD 4E64
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| " Settings | |
| set noautofocus | |
| set numerichints | |
| set typelinkhints | |
| set smoothscroll | |
| set autoupdategist | |
| let barposition = "bottom" | |
| let searchlimit = 10 |
| import akka.actor.ActorSystem | |
| import akka.http.scaladsl.Http | |
| import akka.http.scaladsl.model._ | |
| import akka.http.scaladsl.server.Directives._ | |
| import akka.stream.ActorMaterializer | |
| import scala.io.StdIn | |
| object HttpStream extends App { | |
| implicit val system = ActorSystem("my-system") | |
| implicit val materializer = ActorMaterializer() |
| object collection { | |
| def main(args: Array[String]):Unit = { | |
| // Different types of sequences | |
| // Base class Seq whose base class is Iterable | |
| // List | |
| val l: List[Int] = List(1, 2, 3, 4) | |
| /** Head access faster | |
| * Useful for recursive algorithms | |
| * accessing any element takes time |
| object Factorial { | |
| def factorial(n: Int): Int = { | |
| /** Martin Odersky in Lecture 1.7 mentions | |
| * this implementation of factorial as tail | |
| * recursive but when I put @tailrec annotation, | |
| * compile fails | |
| **/ | |
| //@tailrec | |
| def loop(acc: Int, n: Int): Int = | |
| if(n == 0) acc |