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
ID | entry time | exit time | total price | user ID | site | |
---|---|---|---|---|---|---|
1 | 2023-01-01T05:17:09.615170-05:00 | 2023-01-01T05:47:09.615170-05:00 | 4.23 | 123 | Indianapolis | |
2 | 2023-01-02T06:17:09.615170-05:00 | 2023-01-02T06:47:09.615170-05:00 | 4.17 | 123 | Indianapolis | |
3 | 2023-01-03T07:17:09.615170-05:00 | 2023-01-03T07:47:09.615170-05:00 | 3.23 | 567 | Bloomington | |
4 | 2023-01-04T08:17:09.615170-05:00 | 2023-01-04T08:47:09.615170-05:00 | 3.17 | 567 | Bloomington | |
5 | 2023-01-05T09:17:09.615170-05:00 | 2023-01-05T09:47:09.615170-05:00 | 4.23 | 123 | Indianapolis | |
6 | 2023-01-06T10:17:09.615170-05:00 | 2023-01-06T10:47:09.615170-05:00 | 4.17 | 123 | Indianapolis | |
7 | 2023-01-07T11:17:09.615170-05:00 | 2023-01-07T11:47:09.615170-05:00 | 3.23 | 567 | Bloomington | |
8 | 2023-01-08T12:17:09.615170-05:00 | 2023-01-08T12:47:09.615170-05:00 | 3.17 | 567 | Bloomington |
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 playground | |
import java.util.zip.DataFormatException | |
import scala.io.Source | |
import scala.util.{Failure, Success, Try} | |
object RogerFun { | |
case class MovieRecord(name: String, runtime: Double, rating: Double) |
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 fix | |
import scalafix.v1._ | |
import scala.meta._ | |
class CaseClassConstructorNamedArguments extends SemanticRule("CaseClassConstructorNamedArguments") { | |
override def fix(implicit doc: SemanticDocument): Patch = { | |
//println(s"Tree.syntax: " + doc.tree.syntax) | |
//println(s"Tree.structure: " + doc.tree.structure) |
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
// Traditional callback (using a continuation) | |
def program(a: A, k: B => Unit): Unit | |
// Let's start moving this towards a Future | |
def program(a: A)(B => Unit): Unit | |
// now introduce the following type alias | |
type Future[+T] = (T => Unit) => Unit | |
def program(a: A): Future[B] |
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
val data = Map(("a" -> Some(1)), ("b" -> None), ("c" -> 1), ("d" -> "dfd")) | |
val test1 = data.filter({case (key, value) => value != None}).collect { | |
case (key, Some(value)) => key -> value | |
case (key, value) => key -> value | |
} |
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
def counter(file: String) = scala.io.Source.fromFile(file) | |
.getLines | |
.flatMap(_.split("\\W+")) | |
.foldLeft(Map.empty[String, Int]){ | |
(count, word) => count + (word -> (count.getOrElse(word, 0) + 1)) | |
} |
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 com.angieslist.example.client | |
import com.angieslist.example.model.GetAttributesForCategoryRequest | |
import com.angieslist.example.model.GetAttributesForCategoryResponse | |
import com.angieslist.example.model.GetCategoriesRequest | |
import com.angieslist.example.model.GetCategoriesResponse | |
import com.angieslist.example.model.GetQuestionsRequest | |
import com.angieslist.example.model.GetQuestionsResponse | |
import com.angieslist.example.model.GetSurveyRequest | |
import com.angieslist.example.model.GetSurveyResponse |
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
def counter(file: String) = { | |
scala.io.Source.fromFile(file) | |
.getLines | |
.flatMap(_.split("\\W+")) | |
.foldLeft(Map.empty[String, Int]){ | |
(count, word) => count + (word -> (count.getOrElse(word, 0) + 1)) | |
} | |
} |
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 com.angieslist.common.play.controller | |
import com.angieslist.common.http.DispatchHttpClientComponent | |
import com.angieslist.common.{Logger, LoggerComponent} | |
import com.ning.http.client.FluentCaseInsensitiveStringsMap | |
import com.typesafe.config.{Config, ConfigFactory} | |
import dispatch.{url, _} | |
import play.api.mvc._ | |
import scala.collection.JavaConversions._ |
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 A { | |
def foo(text: String) = printf("a says:" + text) | |
} | |
trait B extends A { | |
override def foo(text: String) = printf("b says:" + text) | |
} | |
trait C extends A { | |
override def foo(text: String) = printf("c says:" + text) |
NewerOlder