- https://dzone.com/articles/postgres-autovacuum-is-not-the-enemy
- https://aws.amazon.com/blogs/database/a-case-study-of-tuning-autovacuum-in-amazon-rds-for-postgresql/
- https://blog.newrelic.com/product-news/tuning-postgresql-autovacuum/
- https://www.cybertec-postgresql.com/en/autovacuum-wraparound-protection-in-postgresql/
- https://info.crunchydata.com/blog/managing-transaction-id-wraparound-in-postgresql
- https://www.2ndquadrant.com/en/blog/autovacuum-tuning-basics/
- https://www.keithf4.com/per-table-autovacuum-tuning/
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
(use 'clojure.set) | |
(use 'clojure.math.numeric-tower) | |
(def data | |
{:Hailey {"Broken Bells" 4, | |
"Deadmau5" 1, | |
"Norah Jones" 4, | |
"The Strokes" 4, | |
"Vampire Weekend" 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
(use 'clojure.set) | |
(def data | |
{:Hailey {"Broken Bells" 4, | |
"Deadmau5" 1, | |
"Norah Jones" 4, | |
"The Strokes" 4, | |
"Vampire Weekend" 1} | |
:Veronica {"Blues Traveler" 3, |
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
(fn fb [acc tamanho] | |
(if (< (count acc) tamanho) | |
(recur (conj acc (apply + (take-last 2 acc))) tamanho) | |
acc)) | |
(fb [1 1] 6) |
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
public static void main(String[] args) { | |
Optional<String> mapped = getMerchantOrderIdFromUrl("haveId").map(orderId -> { | |
return orderId + " mapped"; | |
}); | |
System.out.println(mapped); | |
Optional<Optional<String>> merchant = getMerchantOrderIdFromUrl("haveId").map(orderId -> { | |
return getMerchant(orderId); | |
}); |
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
(defn letras-faltantes [palavra acertos] | |
(remove (fn [letra] | |
(contains? acertos (str letra))) palavra)) | |
(defn acertou-a-palavra-toda? [palavra acertos] | |
(empty? (letras-faltantes palavra acertos))) | |
(defn le-letra! [] (read-line)) | |
(defn acertou-chute? [letra palavra] |
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
http://content.udacity-data.com/course/hadoop/forum_data.tar.gz |
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
#!/usr/bin/env python | |
import sys | |
import re | |
import csv | |
p = re.compile(ur'[^\s+\,\.\!\?\:\;\"\(\)\<\>\#\$\=\-\/]+') | |
reader = csv.reader(sys.stdin, delimiter='\t') | |
next(reader, None) # skip headers | |
for line in reader: |
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
List(1, 2, 3, 4, 5) match { | |
case (a1 @ 1) :: (a2 @ 2 ):: c :: _ => c | |
case List(a1 @ 1, a2 @ 2, c) => c | |
case _ => "no" | |
} | |
sealed trait State | |
case class WithOffer(offer: Offer) extends State |
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
@Test | |
public void test() { | |
loadName(1) | |
.onSuccess(n -> log(format("onSuccess before recovery: %s", n))) | |
.andThen(n -> log(format("and then log this before recovery: %s", n))) | |
.onFailure(e -> log("error before recovery")) | |
.recoverWith(IllegalArgumentException.class, e -> loadNameFromFallback()) | |
.onSuccess(n -> log(format("onSuccess after recovery: %s", n))) | |
.onSuccess(n -> log(format("another onSuccess: %s", n))) | |
.andThen(n -> log(format("and then log this after recovery: %s", n))) |