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
ffmpeg -video_size 3840x2160 -framerate 60 -f x11grab -i :1 -f pulse -ac 2 -i default -c:v libx264 -crf 0 -qp 0 -preset ultrafast github_actions.mp4 |
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 java.io.InputStream | |
import org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils | |
import org.apache.spark.sql.{ DataFrame, Row } | |
import org.postgresql.copy.CopyManager | |
import org.postgresql.core.BaseConnection | |
val jdbcUrl = s"jdbc:postgresql://..." // db credentials elided | |
val connectionProperties = { |
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 test | |
import org.apache.spark.rdd.RDD | |
import org.apache.spark.sql.SparkSession | |
import scala.collection.mutable | |
class DisjointSet() extends Serializable { | |
private val parentMap = mutable.Map[Int, Int]() |
This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.
- Call by value: evaluates the function arguments before calling the function
- Call by name: evaluates the function first, and then evaluates the arguments if need be
def example = 2 // evaluated when called
val example = 2 // evaluated immediately
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
Notes from Coursera course 'Functional Programming Principles in Scala": | |
https://class.coursera.org/progfun-004 | |
✔ Week 1: Functions & Evaluations @done (14-05-01 17:20) | |
✔ Lecture 1.1 - Programming Paradigms (14:32) @done (14-04-27 17:54) | |
3 paradigms: imperative, functional, logic | |
OO: orthogonal | |
imperative: |