Skip to content

Instantly share code, notes, and snippets.

View jaceklaskowski's full-sized avatar
:octocat:
Enjoying developer life...

Jacek Laskowski jaceklaskowski

:octocat:
Enjoying developer life...
View GitHub Profile
@jaceklaskowski
jaceklaskowski / machine-learning.md
Last active June 21, 2020 07:10
Machine Learning for the very Impatient

How much of machine learning is statistics and vice versa?

Learning using https://www.coursera.org/learn/machine-learning/home/welcome

  • machine learning = teaching a computer to learn concepts using data — without being explicitly programmed.
  • Supervised learning = "right answers" given
  • Regression problem
    • continuous valued output
    • deduce the function for a given data set and predict other values
  • "in regression problems, we are taking input variables and trying to map the output onto a continuous expected result function."
@jaceklaskowski
jaceklaskowski / docker-for-the-impatient.md
Last active October 28, 2022 08:24
Docker for the Impatient

aka "Let's take some notes about using Docker on Mac OS X to turn deployment of Scala applications into a much better experience."

DISCLAIMER The doc is a compilation of different articles and videos found on the Internet. Almost nothing's mine - mostly layout. See CREDITS section below to know who to praise. All mistakes are mine and are not intended. Drop me an email at [email protected] if you spot any errors or just share what you think about the doc.

The document lives at https://gist.github.com/jaceklaskowski/ca55be80cb76e84ce478

Intro

I'm on Mac OS X and so you're going to see a lot of setup tweaks for the platform that are not necessarily needed for your environment, esp. Linux one. When you see boot2docker and you're on Linux, just disregard the line or even entire paragraph.

@jaceklaskowski
jaceklaskowski / deployment-tool-ansible-puppet-chef-salt.md
Last active July 11, 2025 05:01
Choosing a deployment tool - ansible vs puppet vs chef vs salt

Requirements

  • no upfront installation/agents on remote/slave machines - ssh should be enough
  • application components should use third-party software, e.g. HDFS, Spark's cluster, deployed separately
  • configuration templating
  • environment requires/asserts, i.e. we need a JVM in a given version before doing deployment
  • deployment process run from Jenkins

Solution

@jaceklaskowski
jaceklaskowski / javap.scala
Created April 21, 2015 20:10
:javap in Scala REPL
➜ sandbox scala
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :javap
:javap [-lcsvp] [path1 path2 ...]
scala> case class AAA(s: String)
defined class AAA
@jaceklaskowski
jaceklaskowski / scala-compiler-slain.md
Last active August 29, 2015 14:15
The compiler of Scala 2.11.5 crashes in REPL with "That entry seems to have slain the compiler"
[sbt-learning-space]> console
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.11.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val m = Map(1->2, 0->3)
m: scala.collection.immutable.Map[Int,Int] = Map(1 -> 2, 0 -> 3)
@jaceklaskowski
jaceklaskowski / HelloSpec.md
Created January 28, 2015 23:08
specs2 DataTables
import org.specs2._

class HelloSpec extends Specification with matcher.DataTables { def is =
  "adding integers should just work in scala"  ! e1

  def e1 =
    "a"   | "b" | "c" |                                   // the header of the table, with `|` separated strings
     2    !  2  !  4  |                                   // an example row
 1 ! 1 ! 2 |> { // the > operator to "execute" the table
@jaceklaskowski
jaceklaskowski / scala-2.11.5-busted.md
Created January 19, 2015 22:20
Scala 2.11.5 busted?

That works in 2.11.4:

scala> scala.util.Properties.versionString
res0: String = version 2.11.4

scala> val s = Seq(1 -> 2)
s: Seq[(Int, Int)] = List((1,2))

scala> s.groupBy(_._1)
@jaceklaskowski
jaceklaskowski / sbt-launch-snapshot.md
Created January 18, 2015 17:15
How to use sbt 0.13.8-SNAPSHOT
➜  sbt-snapshot  curl -o sbt-launch-0.13.8-SNAPSHOT.jar https://repo.typesafe.com/typesafe/ivy-snapshots/org.scala-sbt/sbt-launch/0.13.8-SNAPSHOT/sbt-launch.jar
➜  sbt-snapshot  tree
.
|-- project
|   `-- build.properties
`-- sbt-launch-0.13.8-SNAPSHOT.jar

1 directory, 2 files
➜  sbt-snapshot  cat project/build.properties
@jaceklaskowski
jaceklaskowski / Flow[HttpRequest, HttpResponse].md
Last active August 29, 2015 14:12
How Spray benefit from Flow[HttpRequest, HttpResponse], if any?

From the scaladoc for trait Flow[-In, +Out] (package akka.stream.scaladsl):

A Flow is a set of stream processing steps that has one open input and one open output.

Therefore, Flow[HttpRequest, HttpResponse] is a set of stream processing steps that has one open HttpRequest input and one open HttpResponse output.

It appears that inputs are called Sources and outputs are Sinks. Connecting a Source to a Sink creates a flow graph.

That's pretty much the good ol' Spray.

@jaceklaskowski
jaceklaskowski / About Cake Pattern.md
Last active November 2, 2016 12:51
About Cake Pattern