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 pairs = sc.parallelize(List(("aa", 1), ("bb", 2), | |
| ("aa", 10), ("bb", 20), | |
| ("aa", 100), ("bb", 200))) | |
| /* aggregateByKey takes an initial accumulator (here an empty list), | |
| a first lambda function to merge a value to an accumulator, and a | |
| second lambda function to merge two accumulators */ | |
| pairs.aggregateByKey(List[Any]())( | |
| (aggr, value) => aggr ::: (value :: Nil), | |
| (aggr1, aggr2) => aggr1 ::: aggr2 |
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
| (setq my-helm-source-file-buffers-list | |
| (helm-make-source "Files" 'my-helm-source-file-buffers-class) | |
| my-helm-source-nonfile-buffers-list | |
| (helm-make-source "Buffers" 'my-helm-source-nonfile-buffers-class)) | |
| (setq helm-mini-default-sources '(my-helm-source-file-buffers-list | |
| my-helm-source-nonfile-buffers-list | |
| helm-source-recentf | |
| helm-source-buffer-not-found)) |
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
| import re | |
| from colorama import Back, Fore, Style | |
| def shingles(s, k): | |
| ts = set() | |
| for i in range(len(s) - k + 1): | |
| t = s[i:i+k] | |
| ts.add(t) | |
| return ts |
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
| drop table if exists succursale_saq cascade; | |
| create table succursale_saq ( | |
| no_succursale_saq text primary key, -- text to allow searching | |
| adresse text, | |
| ville text | |
| ); | |
| drop table if exists representant cascade; | |
| create table representant ( | |
| representant_id serial primary key, |
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
| $ echo 'echo "hello!"' >> hello.sh | |
| $ chmod u+x hello.sh | |
| $ ./hello.sh |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import random | |
| from hashlib import md5, sha1 | |
| from collections import defaultdict | |
| from scipy.stats import hmean | |
| import numpy as np | |
| import redis | |
| import sys | |
| def get_n_zeros(v, n_bits=128, from_right=True): | |
| """Get number of trailing or leading 0s in the binary |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.