- How to copy from vim to windows clipboard?
- How to copy from tmux to windows clipboard?
- How to copy from remote tmux/vim to windows clipboard?
| from random import random | |
| NUM_SAMPLES = 10000 | |
| def sample(p): | |
| x, y = random(), random() | |
| return 1 if x*x + y*y < 1 else 0 | |
| count = sc.parallelize(xrange(0, NUM_SAMPLES)).map(sample) \ | |
| .reduce(lambda a, b: a + b) | |
| print "Pi is roughly %f" % (4.0 * count / NUM_SAMPLES) |
| iex(38)> map | |
| %{"key" => "value"} | |
| iex(39)> Poison.Encoder.encode(map, []) | |
| [123, [[34, ["key"], 34], 58, [34, ["value"], 34]], 125] |
| library(dplyr) | |
| data <- read.csv("gau12jbs Master 100715.csv", header=TRUE) | |
| names <- select(data, starts_with("RV"), starts_with("RC"), starts_with("SW"), starts_with("SN"), starts_with("WC"), starts_with("AP"), starts_with("PH"), starts_with("SD"), starts_with("SY"), starts_with("RH"), starts_with("FS") ) %>% | |
| na.omit %>% | |
| row.names | |
| train_names <- sample(names, length(names) * 7/10, replace = FALSE) | |
| test_names <- setdiff(names, train_names) |
| [pankracy@piotrek-fedora blog]$ MIX_ENV=prod mix release | |
| Building release with MIX_ENV=prod. | |
| You have dependencies (direct/transitive) which are not in :applications! | |
| The following apps should to be added to :applications in mix.exs: | |
| earmark => earmark is missing from blog | |
| Continue anyway? Your release may not work as expected if these dependencies are required! [Yn]: |
| function anonymous() { | |
| var world = new CAWorld({ | |
| width: 192, | |
| height: 128, | |
| cellSize: 3 | |
| }); | |
| world.palette = [ | |
| '68, 36, 52, 1', |
| # https://stackoverflow.com/questions/652276/is-it-possible-to-create-anonymous-objects-in-python | |
| from typing import Dict | |
| class MicroMock: | |
| def __init__(self, **kwargs: Dict) -> None: | |
| self.__dict__.update(kwargs) | |
| MicroMock(text="aaa") |
| import heapq | |
| import time | |
| from collections.abc import Callable | |
| from typing import Any | |
| class _Cache: | |
| def __init__(self, my_fun: Callable, cache_limit: int = 3) -> None: | |
| self.cache_limit = cache_limit | |
| self.my_fun = my_fun |
| import pickle | |
| class Board: | |
| def __init__(self): | |
| self.board = [['.']*3 for i in range(3)] | |
| def mark(self, x, y, sign): | |
| self.board[x][y] = sign | |