Tutorial by Examples: c

PHPUnit provides the following function to assert whether an object is an instance of a class: assertInstanceOf($expected, $actual[, $message = '']) The first parameter $expected is the name of a class (string). The second parameter $actual is the object to be tested. $message is an optional ...
For the following schema: {name: 'Tom', age: 28, marks: [50, 60, 70]} Update Tom's marks to 55 where marks are 50 (Use the positional operator $): db.people.update({name: "Tom", marks: 50}, {"$set": {"marks.$": 55}}) For the following schema: {name: 'Tom', age:...
After a statement was executed, a call to sqlite3_reset() brings it back into the original state so that it can be re-executed. Typically, while the statement itself stays the same, the parameters are changed: const char *sql = "INSERT INTO MyTable(ID, Name) VALUES (?, ?)"; sqlite3_stmt...
/_build /cover /deps erl_crash.dump *.ez /rel
/_build /db /deps /*.ez erl_crash.dump /node_modules /priv/static/ /config/prod.secret.exs /rel
When ever a user connects to your hub, the OnConnected() is called. You can over ride this function and implement your own logic if you need to keep track of or limit the number of connections public override Task OnConnected() { //you logic here return base.OnConnected()...
Overloading the disconnect function allows you to handle what to do when a user disconnects. public override Task OnDisconnected(bool stopCalled) { //Your disconnect logic here return base.OnDisconnected(stopCalled); }
/// <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...
Containers in the same docker network have access to exposed ports. docker network create sample docker run --net sample --name keys consul agent -server -client=0.0.0.0 -bootstrap Consul's Dockerfile exposes 8500, 8600, and several more ports. To demonstrate, run another container in the same ...
Networks can be specified in a compose file (v2). By default all the containers are in a shared network. Start with this file: example/docker-compose.yml: version: '2' services: keys: image: consul command: agent -server -client=0.0.0.0 -bootstrap test: image: alpine tty...
The docker --link argument, and link: sections docker-compose make aliases to other containers. docker network create sample docker run -d --net sample --name redis redis With link either the original name or the mapping will resolve the redis container. > docker run --net sample --link red...
Employee entity. package com.thejavageek.jpa.entities; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Joi...
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...
Example code : In main.html <template name="test"> <input type="checkbox" id="checkbox1" name="name" value="data">Check Me {{showData}} </template> In Main.js var check_status=''; //Reactive Var Initialization...
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')...
To use an Asset Catalog, you need to do the following: Double-click the Info.plist file in the Solution Explorer to open it for editing. Scroll down to the App Icons section. From the Source dropdown list, ensure AppIcons is selected. From the Solution Explorer, double-click the Assets.xcasset...
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...
If you have a moment object you can use add and substract to manipulate it or set any property of the time directly moment("2016-01-01").add(1, 'year').format('YYYY-MM-DD') // -> "2017-01-01" Or use .day(), .month(), .year(), .seconds(), .milliseconds() to set those val...
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. //Declare the search bar and add it to the header of the table searchBar = new UISearchBar(); searchBar.SizeToFit(); ...
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...

Page 555 of 826