A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
| import pandas as pd | |
| def _map_to_pandas(rdds): | |
| """ Needs to be here due to pickling issues """ | |
| return [pd.DataFrame(list(rdds))] | |
| def toPandas(df, n_partitions=None): | |
| """ | |
| Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is | |
| repartitioned if `n_partitions` is passed. |
| import pickle | |
| import numpy as np | |
| import pdb | |
| img_width, img_height = 300, 300 | |
| box_configs = [ | |
| {'layer_width': 38, 'layer_height': 38, 'num_prior': 3, 'min_size': 30.0, | |
| 'max_size': None, 'aspect_ratios': [1.0, 2.0, 1/2.0]}, | |
| {'layer_width': 19, 'layer_height': 19, 'num_prior': 6, 'min_size': 60.0, | |
| 'max_size': 114.0, 'aspect_ratios': [1.0, 1.0, 2.0, 1/2.0, 3.0, 1/3.0]}, |
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1
| def _to_one_hot(y, num_classes): | |
| scatter_dim = len(y.size()) | |
| y_tensor = y.view(*y.size(), -1) | |
| zeros = torch.zeros(*y.size(), num_classes, dtype=y.dtype) | |
| return zeros.scatter(scatter_dim, y_tensor, 1) | |
| print(_to_one_hot(torch.as_tensor([2, 4, 7]), num_classes=10)) | |
| print(_to_one_hot(torch.as_tensor([[1, 5 ,6], [2, 4, 7]]), num_classes=10)) |
| \%23c Matches in a specific column. (23), example :%s/\%1c/#/ (insert # on first column of all rows) | |
| :% (all rows), :. (this row), :$ (last row), :.,$ (this->last row), :5,$ (5th->last row) | |
| s, substitute. :%s/a/b/g, change all a->b on all rows. | |
| u, undo | |
| p, paste | |
| m+a, set mark a [works for a-z] | |
| '+a, go to mark a [works for a-z] | |
| <<, de-indent row | |
| >>, indent row | |
| J, join rows |