- make changes
git stash savegit checkout -b xxxgit stash pop
where xxx is the new branch name
| import datetime as dt | |
| class datetime(dt.datetime): | |
| def __divmod__(self, delta): | |
| seconds = int((self - dt.datetime.min).total_seconds()) | |
| remainder = dt.timedelta( | |
| seconds=seconds % delta.total_seconds(), | |
| microseconds=self.microsecond, | |
| ) |
git stash savegit checkout -b xxxgit stash popwhere xxx is the new branch name
| # ATTENTION PLEASE! | |
| # NOTE BY @riwazp7 | |
| # Note for future visitors of this gist: Mac OS has Apache Benchmark by default ab --help | |
| curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz | |
| tar -xzf libtool-2.4.2.tar.gz | |
| cd libtool-2.4.2 | |
| ./configure && make && sudo make install | |
| # brew install 'https://raw.github.com/simonair/homebrew-dupes/e5177ef4fc82ae5246842e5a544124722c9e975b/ab.rb' |
https://pkgs.alpinelinux.org/package/main/x86_64/uwsgi-python
This is when trying to run uwsgi:
server_1 | open("./http_plugin.so"): No such file or directory [core/utils.c line 3675]
server_1 | !!! UNABLE to load uWSGI plugin: Error loading shared library ./http_plugin.so: No such file or directory !!!
server_1 | open("./python_plugin.so"): No such file or directory [core/utils.c line 3675]
| # Public Domain CC0 license. https://creativecommons.org/publicdomain/zero/1.0/ | |
| """MongoDB Apache Beam IO utilities. | |
| Tested with google-cloud-dataflow package version 2.0.0 | |
| """ | |
| __all__ = ['ReadFromMongo'] | |
| import datetime |
| from __future__ import print_function | |
| import requests | |
| import json | |
| import cv2 | |
| addr = 'http://localhost:5000' | |
| test_url = addr + '/api/test' | |
| # prepare headers for http request | |
| content_type = 'image/jpeg' |
| __all__ = ['WriteToMongo'] | |
| import json | |
| from pymongo import MongoClient | |
| from apache_beam.transforms import PTransform | |
| from apache_beam.io import iobase | |
| class _MongoSink(iobase.Sink): | |
| """A :class:`~apache_beam.io.iobase.Sink`.""" |
| MOZILLA/MDN/kuma master ✔ | |
| ▶ docker-compose up | |
| Starting kuma_mysql_1 ... done | |
| Starting kuma_redis_1 ... done | |
| Starting kuma_elasticsearch_1 ... done | |
| Recreating kuma_api_1 ... done | |
| Recreating kuma_kumascript_1 ... done | |
| Recreating kuma_web_1 ... done | |
| Recreating kuma_worker_1 ... done | |
| Attaching to kuma_redis_1, kuma_mysql_1, kuma_elasticsearch_1, kuma_api_1, kuma_kumascript_1, kuma_web_1, kuma_worker_1 |
An easy-to-use Python script to sync up with the state of a java.util.Random generator after supplying a few samples. The internal seed has 48 bits, and every sample you give to the program will give some amount of bits of information. Here is a table to get an idea of how many samples you should provide per amount of bits in your input number:
| bits | bound | samples (±) |
|---|---|---|
| 4 | 16 | 25 |
| 6 | 64 | 12 |
| 8 | 256 | 8 |
| 16 | 65536 | 4 |