Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
(Chapters marked with * are already written. This gets reorganized constantly | |
and 10 or so written chapters that I'm on the fence about aren't listed.) | |
Programmer Epistemology | |
* Dispersed Cost vs. Reduced Cost | |
* Verificationist Fallacy | |
* Mistake Metastasis | |
The Overton Window | |
Epicycles All The Way Down | |
The Hyperspace Gates Were Just There |
# Assume we are in your home directory | |
cd ~/ | |
# Clone the repo from GitLab using the `--mirror` option | |
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git | |
# Change into newly created repo directory | |
$ cd ~/my-repo.git | |
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
val sqlContext = new org.apache.spark.sql.SQLContext(sc) // optional | |
val df = sqlContext.load("jdbc", Map( | |
"url" -> "jdbc:mysql://<ip.address.your.db>/<table>?user=<username>&password=<pwd>", | |
"dbtable" -> "<tablename>")) | |
df.select("<col1>","<col2>","<col3>").save("</path/to/parquet/file.parquet>","parquet") | |
//Alternatively, to save all the columns: |
import shapeless._ | |
import scalaz._ | |
import Scalaz._ | |
object console extends App { | |
trait Foo[A] { | |
type B | |
def value: B |
package nl.mdj | |
import scala.concurrent.duration._ | |
import scala.concurrent.{Await, Future} | |
import scala.util.{Failure, Success, Try} | |
import scalaz.Scalaz._ | |
import scalaz._ | |
object Transformers extends App { |
defmodule MyApp.Client do | |
@moduledoc """ | |
Generic client wrapper for an API service. Pass in an adapter like HTTPoison. | |
""" | |
alias MyApp.Service # API credentials struct | |
def build_url(path, %Service{url: url, auth: %{}}), do: append(url, "/") <> path | |
def build_url(path, queries, service) do | |
query_params = URI.encode_query(queries) | |
build_url(path, service) <> "?" <> query_params |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x