For all of you wanting this feature there's a great option out there if you're willing to step beyond Signal: Conversations. There's no primary/secondary distinction: it does true-multi-device multi-key encryption (they adopted libsignal and built on it and I'm very grateful that OWS developed and released it so it could be built upon), as well as video chat, file attachments (encrypted, of course), and cross-device history syncing, and all that at 1/3rd the size of Signal, and without a dependency on push notifications. And you can pretty easily set up alt identities and use them on the same devices so there's no need to worry about [giving out a private number](https://www.vice.com/en_us/article/9kaxge/how-to-use-signal-without-giving-out-your-phone-number-a-gender
Okay, I've got a need to build Firefox from source, and I'd like to do that on a remote machine, and then copy build result back to my laptop. With Nix, using bastion host. I'll note details of my successful adventure.
Here's the list of resources I've used actively:
- https://nixos.wiki/wiki/Distributed_build
- https://nixos.org/nix/manual/#conf-trusted-substituters and various other configuration parameters
- https://github.com/NixOS/nixpkgs/blob/release-19.09/nixos/modules/services/misc/nix-daemon.nix which contains mappings from Nix config names to NixOS config names (damn, they are different!)
Here's my setup:
This is the second article in a series of articles around Rusts new async/await
feature. The first article about interfaces can be found
here.
In this part of the series we want to a look at a mechanism which behaves very
different in Rust than in all other languages which feature async/await
support. This mechanism is Cancellation.
| from line_profiler import LineProfiler | |
| def do_profile(follow=[]): | |
| def inner(func): | |
| def profiled_func(*args, **kwargs): | |
| try: | |
| profiler = LineProfiler() | |
| profiler.add_function(func) | |
| for f in follow: | |
| profiler.add_function(f) |
Git sees every file in your working copy as one of three things:
- tracked - a file which has been previously staged or committed;
- untracked - a file which has not been staged or committed; or
- ignored - a file which Git has been explicitly told to ignore.
Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:
- dependency caches, such as the contents of /node_modules or /packages
- compiled code, such as .o, .pyc, and .class files
| # Use this script to test that your Telegram bot works. | |
| # | |
| # Install the dependency | |
| # | |
| # $ gem install telegram_bot | |
| # | |
| # Run the bot | |
| # | |
| # $ ruby bot.rb | |
| # |
| def train_network(samples, neural_network, nr_epochs=10, batch_size=64): | |
| optimizer = optim.Adam(neural_network.parameters()) | |
| neural_network.train() | |
| for epoch_nr in range(nr_epochs): | |
| sample_ids = np.random.shuffle(range(len(samples))) | |
| for start in range(0, len(samples) // batch_size, batch_size): | |
| mini_batch = samples[sample_ids[start: start + batch_size]] | |
| boards, pis, vs = zip(*mini_batch) |
| environment = environments.GoEnvironment(board_size=19) | |
| player_mcts = mcts.MCTS( | |
| environment, | |
| networks.NeuralNetwork(board_size=environment.getStateSize(), action_size=environment.getActionSize()), | |
| ) | |
| training_samples = collections.deque(maxlen=opt.training_samples_buffer_size) | |
| for iteration_number in range(opt.num_iters): |