Tutorial by Examples: c

When publishing Sitecore item programmatically the developer should keep in mind that Sitecore could be configured for several publishing targets, as well that several languages could be defined for item. ID targetDatabaseFieldId = ID.Parse("{39ECFD90-55D2-49D8-B513-99D15573DE41}"); ...
public class HomepageTests { private IWebDriver _driver; [SetUp] public void LoadDriver() { _driver = new ChromeDriver(); } [Test] public void Valid_Home_Page_Title() { _driver.Navigate().GoToUrl("Your homeoage url / loc...
Gridviews are more useful if we can update the view as per our need. Consider a view with a lock/unlock feature in each row. It can be done like: Add an update panel: <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> </asp:UpdatePane...
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) { ......
Assuming you know the productID: First import StoreKit Then in your code let productID: Set = ["premium"] let request = SKProductsRequest(productIdentifiers: productID) request.delegate = self request.start() and in the SKProductsRequestDelegate: func productsRequest(request: ...
package com.mcf7.spring; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringDataMicroServiceApplication { public static void main(String[] args) { SpringApplication....
int get_l2cap_connection () { First off, all the variables we need, explanation for will follow at the appropriate spot. int ssock = 0; int csock = 0; int reuse_addr = 1; struct sockaddr_l2 src_addr; struct bt_security bt_sec; int result = 0; First, we need to cre...
set mouse=a This will enable mouse interaction in the vim editor. The mouse can change the current cursor's position select text
The most basic application of add_action() is to add custom code to be executed at a certain location in a WordPress installation's source-code - either using actions supplied by the Core of WordPress, or ones created by third-party code such as plugins and themes. To add content to the <head&g...
Any number of functions may be "hooked" to any given action. In some instances it is important for a hooked function to execute before or after others, which is where the third parameter to add_action(), $priority comes into play. If the $priority argument is omitted, the function will be...
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 ...
Image img = new Image(); BitmapImage bitmap = new BitmapImage(new Uri("ms-appx:///Path-to-image-in-solution-directory", UriKind.Absolute)); img.Source = bitmap;
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...
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...

Page 557 of 826