I hereby claim:
- I am skabed on github.
- I am gmadorell (https://keybase.io/gmadorell) on keybase.
- I have a public key whose fingerprint is 897E 80B3 E945 C2C4 6BAE 0E79 BEC3 5ED9 C941 7C2F
To claim this, I am signing this object:
| import cats.{Id, Monad} | |
| import cats.implicits._ | |
| object AccumulateConventional extends App { | |
| trait Console { | |
| def write(text: String): Unit | |
| def read(): String | |
| } |
| 04ec44b00cfb41006348b0e9eb8dc855133acada345f3a1f5bc1700b5582be3e10b0d3870dc7fc47c2e7913a2f138d37e47fb730e19f1aea20dde2134bfa5d85c5 |
| #!/bin/bash | |
| set -e | |
| PROJECT_NAME="$1" | |
| SCALA_VERSION="2.11.8" | |
| SCALATEST_VERSION="3.0.0" | |
| echo " . Creating project folder with name: $PROJECT_NAME..." | |
| mkdir $PROJECT_NAME |
| import com.mongodb.*; | |
| import java.net.UnknownHostException; | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.List; | |
| public class Main { | |
| static final String DELIMITER = "---------------\n"; |
| package fizzbuzz | |
| object Fizzbuzz { | |
| def fizzbuzz(n: Int): String = n match { | |
| case _ if (n % 3) == 0 && (n % 5) == 0 => "fizzbuzz" | |
| case _ if (n % 3) == 0 => "fizz" | |
| case _ if (n % 5) == 0 => "buzz" | |
| case _ => "" | |
| } |
| def cache_in_file(filepath, object_creation_function): | |
| if os.path.exists(filepath): | |
| with open(filepath, "r") as dump_file: | |
| obj = pickle.load(dump_file) | |
| else: | |
| obj = object_creation_function() | |
| with open(filepath, "w") as dump_file: | |
| pickle.dump(obj, dump_file) | |
| return obj |
| def backup_file(file_path, backup_path=None, verbose=True): | |
| """ | |
| If the given 'file_path' exists, this function creates a copy of it. | |
| Backup is done at 'backup_path'.backup# (backup_path defaults to | |
| 'file_path'. | |
| If 'verbose' is set (defaults to True), prints output when backing up. | |
| """ | |
| if not os.path.isfile(file_path): | |
| return | |
| if not backup_path: |
| import os | |
| TOP_LEVEL_NAME = "lorayne_numbers" | |
| def __get_current_path(): | |
| return os.path.dirname(os.path.abspath(__file__)) | |
| def get_top_level_path(): |
I hereby claim:
To claim this, I am signing this object:
| import numpy as np | |
| # http://stackoverflow.com/questions/16970982/find-unique-rows-in-numpy-array | |
| def find_unique_rows(array): | |
| b = array[np.lexsort(array.reshape((array.shape[0],-1)).T)]; | |
| return b[np.concatenate(([True], np.any(b[1:]!=b[:-1], axis=tuple(range(1,array.ndim)))))] | |
| if __name__ == "__main__": |