Useful for accessing a computer that does not have a public IP address, over the internet. The machine can be behind multiple firewalls and NATs.
| import logging | |
| from time import gmtime | |
| # https://stackoverflow.com/a/7517430/49489 | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s.%(msecs)03dZ [%(name)s] %(message)s", | |
| datefmt="%Y-%m-%dT%H:%M:%S", | |
| ) | |
| logging.Formatter.converter = gmtime |
| The Witcher 3 - Facts | |
| Source: http://www.vertigofx.com/public/games/tw3/tw3facts.txt | |
| == dlc/bob/data/gameplay/community/dialogues/chats/chat_beauclair_citizens_01.w2scene: | |
| lw_ww_geralt_of_rivia_wine | |
| == dlc/bob/data/gameplay/community/dialogues/chats/chat_beauclair_citizens_02.w2scene: | |
| mq7015_done |
| # -*- coding: utf-8 -*- | |
| """ rwlock.py | |
| A class to implement read-write locks on top of the standard threading | |
| library. | |
| This is implemented with two mutexes (threading.Lock instances) as per this | |
| wikipedia pseudocode: | |
| https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Using_two_mutexes |
| def soft_dice_loss(y_true, y_pred, epsilon=1e-6): | |
| ''' | |
| Soft dice loss calculation for arbitrary batch size, number of classes, and number of spatial dimensions. | |
| Assumes the `channels_last` format. | |
| # Arguments | |
| y_true: b x X x Y( x Z...) x c One hot encoding of ground truth | |
| y_pred: b x X x Y( x Z...) x c Network output, must sum to 1 over c channel (such as after softmax) | |
| epsilon: Used for numerical stability to avoid divide by zero errors | |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
If you hate git submodule, then you may want to give git subtree a try.
When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.
When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.
Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:
| package config | |
| import ( | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/x509" | |
| "encoding/pem" | |
| "io/ioutil" | |
| "github.com/CodeCollaborate/Server/utils" |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "log" | |
| "net" | |
| ) | |
| func main() { |
| """ | |
| Multivariate Wald-Wolfowitz test for two samples in separate CSV files. | |
| See: | |
| Friedman, Jerome H., and Lawrence C. Rafsky. | |
| "Multivariate generalizations of the Wald-Wolfowitz and Smirnov two-sample tests." | |
| The Annals of Statistics (1979): 697-717. | |
| Given multivariate sample X of length m and sample Y of length n, test the null hypothesis: |