Tutorial by Examples: f

/// <summary> /// Overrides the onDisconnected function and sets the user object to offline, this can be checked when other players interacts with them... /// </summary> /// <param name="stopCalled"></param> /// <returns></returns&gt...
Exporting data from employees table to /tmp/ca_employees INSERT OVERWRITE LOCAL DIRECTORY '/tmp/ca_employees' SELECT name, salary, address FROM employees WHERE se.state = 'CA'; Exporting data from employees table to multiple local directories based on specific condition The below query shows how ...
The following configuration can be used as a base config for bundling up your project as a library. Notice how the module config contains a list of preLoaders and loaders. // webpack.config.js var path = require('path'); module.exports = { entry: path.join(__dirname, '..', 'src/index.js...
Here's how to create an Express server and serve index.html by default (empty path /), and page1.html for /page1 path. Folder structure project root | server.js |____views | index.html | page1.html server.js var express = require('express'); var path = require('path')...
First we can specify the directories of header files by include_directories(), then we need to specify the corresponding source files of the target executable by add_executable(), and be sure there's exactly one main() function in the source files. Following is a simple example, all the files are a...
For multiple databases, you have the database.php file where you can set as many databases as you need. If you want to "switch" a database for a specific model on the fly, use the setDataSource() method. For example, if you have two databases, you can define them in the database.php file...
Start by downloading the latest stable release from https://hive.apache.org/downloads.html -> Now untar the file with $ tar -xvf hive-2.x.y-bin.tar.gz -> Create a directory in the /usr/local/ with $ sudo mkdir /usr/local/hive -> Move the file to root with $ mv ~/Downloads/hive-2.x.y /...
SELECT ROWNUM NO FROM DUAL CONNECT BY LEVEL <= 10
#lang racket (for ([path (in-directory)] #:when (regexp-match? #rx"[.]rkt$" path)) (printf "source file: ~a\n" path)) The #lang line specifies the programming language of this file. #lang racket we are using the baseline, battery-included Racket programming language. O...
// my-feature.module.ts import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { MyComponent } from './my.component'; import { MyDirective } from './my.directive'; import { MyPipe } from './my.pipe'; import { MyService } from './my.service...
Create class and add imports to parse information: import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.IgnoreExtraProperties; //Declaration of firebase references private DatabaseReference mDatabase; //Declaration of firebase atributtes public Stri...
To enable a CORS policy across all of your MVC controllers you have to build the policy in the AddCors extension within the ConfigureServices method and then set the policy on the CorsAuthorizationFilterFactory using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Cors.Internal; ... pub...
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...
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: ...
buildscript { repositories { jcenter() } dependencies { classpath 'io.spring.gradle:dependency-management-plugin:0.5.4.RELEASE' } } apply plugin: 'io.spring.dependency-management' apply plugin: 'idea' apply plugin: 'java' dependencyManagement { imp...
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...
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 ...

Page 302 of 457