Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
package main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" |
Suppose you have two classes that should be registered with Spring context exclusively, e.g. only one of the beans must exist in the context at any time based on some boolean property value. Of course you can do it by adding explicit if
condition into your @Configuration
class. But if the classes have no common interface it may be quite cumbersome. As an alternative you can use @ConditionalOnProperty
annotation on your classes, e.g.:
@Service
@ConditionalOnProperty(name = "use-left-service", havingValue = "true", matchIfMissing = false)
public class LeftService
In this article I’ll tell you about my pure functional library for Software Transactional Memory (STM)
that I’ve built in C++. I adopted some advanced functional programming concepts that make it composable and convenient to use. Its implementation is rather small and robust, which differentiates the library from competitors. Let’s discuss what STM is and how to use it.
Some Jenkinsfile examples |
''' | |
Implementation of 2 Phase Commit as explained at Wikipedia: | |
https://en.wikipedia.org/wiki/Two-phase_commit_protocol | |
''' | |
import random, logging, time | |
from threading import Thread, Semaphore, Lock | |
_fmt = '%(user)s:%(levelname)s >>> %(message)s' | |
logging.basicConfig(format=_fmt) | |
LOG = logging.getLogger(__name__) |
[==========] Running 3 tests from 1 test case. | |
[----------] Global test environment set-up. | |
[----------] 3 tests from CNN | |
[ RUN ] CNN.PropConv | |
[ OK ] CNN.PropConv (59 ms) | |
[ RUN ] CNN.PropPool | |
[ OK ] CNN.PropPool (0 ms) | |
[ RUN ] CNN.PropPoolRandom | |
[ OK ] CNN.PropPoolRandom (4 ms) | |
[----------] 3 tests from CNN (63 ms total) |
#include <thread> | |
#include <iostream> | |
#include <queue> | |
std::mutex mx; | |
std::condition_variable cv; | |
std::queue<int> q; | |
bool finished = false; |
#include <iostream> | |
#include <utility> | |
#include <typeinfo> | |
#include <type_traits> | |
#include <string> | |
template <size_t arg1, size_t ... others> | |
struct static_max; | |
template <size_t arg> |