Run repair on a particular partition range.
nodetool repair -pr
Run repair on the whole cluster.
nodetool repair
Run repair in parallel mode.
nodetool repair -par
Sometimes it's really useful to know the type of child component when iterating through them. In order to iterate through the children components you can use React Children.map util function:
React.Children.map(this.props.children, (child) => {
if (child.type === MyComponentType) {
......
Usually, J and K move up and down file lines. But when you have wrapping on, you may want them to move up and down the displayed lines instead.
set wrap " if you haven't already set it
nmap j gj
nmap k gk
PHP Classes are powerful tool for improving code organization and minimizing naming collisions. At some point or another, the question of how to create an action hook for a class method inevitably arises.
The $function_to_add argument is often shown as a string containing the function's name, howev...
Python
Code
import numpy as np
import cv2
#loading haarcascade classifiers for face and eye
#You can find these cascade classifiers here
#https://github.com/opencv/opencv/tree/master/data/haarcascades
#or where you download opencv inside data/haarcascades
face_cascade = cv2.CascadeClassi...
With Ruby you can modify the structure of the program in execution time. One way to do it, is by defining methods dynamically using the method method_missing.
Let's say that we want to be able to test if a number is greater than other number with the syntax 777.is_greater_than_123?.
# open Numeric...
Monkey patching's main issue is that it pollutes the global scope. Your code working is at the mercy of all the modules you use not stepping on each others toes. The Ruby solution to this is refinements, which are basically monkey patches in a limited scope.
module Patches
refine Fixnum do
...
public override async void ViewDidLoad(){
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
Title = "Pull to Refresh Sample";
table = new UITableView(new CGRect(0, 20, View.Bounds.Width, View.Bounds.Height - 20));
//table.Aut...
drop table table01;
drop table table02;
create table table01 (
code int,
name varchar(50),
old int
);
create table table02 (
code int,
name varchar(50),
old int
);
truncate table table01;
insert into table01 values (1, 'A', 10);
insert in...
The simplest approach to parallel reduction in CUDA is to assign a single block to perform the task:
static const int arraySize = 10000;
static const int blockSize = 1024;
__global__ void sumCommSingleBlock(const int *a, int *out) {
int idx = threadIdx.x;
int sum = 0;
for (int i ...
Doing parallel reduction for a non-commutative operator is a bit more involved, compared to commutative version.
In the example we still use a addition over integers for the simplicity sake.
It could be replaced, for example, with matrix multiplication which really is non-commutative.
Note, when ...
Multi-block approach to parallel reduction in CUDA poses an additional challenge, compared to single-block approach, because blocks are limited in communication.
The idea is to let each block compute a part of the input array, and then have one final block to merge all the partial results.
To do t...
Multi-block approach to parallel reduction is very similar to the single-block approach.
The global input array must be split into sections, each reduced by a single block.
When a partial result from each block is obtained, one final block reduces these to obtain the final result.
sumNoncommSin...
Sometimes the reduction has to be performed on a very small scale, as a part of a bigger CUDA kernel.
Suppose for example, that the input data has exactly 32 elements - the number of threads in a warp.
In such scenario a single warp can be assigned to perform the reduction.
Given that warp execut...
Sometimes the reduction has to be performed on a very small scale, as a part of a bigger CUDA kernel.
Suppose for example, that the input data has exactly 32 elements - the number of threads in a warp.
In such scenario a single warp can be assigned to perform the reduction.
Given that warp execut...