Tutorial by Examples: ch

The function takes the argument of the current node index, adjacency list (stored in vector of vectors in this example), and vector of boolean to keep track of which node has been visited. void dfs(int node, vector<vector<int>>* graph, vector<bool>* visited) { // check whethe...
The keyword function can be used to initiate pattern-matching on the the last argument of a function. For example, we can write a function called sum, which computes the sum of a list of integers, this way let rec sum = function | [] -> 0 | h::t -> h + sum t ;; val sum : int list -&...
1) IP based vhosts <VirtualHost 192.168.13.37> ServerName example.com DocumentRoot /var/www/domains/example.com/html ErrorLog /var/log/example.com/error.log CustomLog /var/log/example.com/access.log common </VirtualHost> <VirtualHost 192.168.47.11> ...
For registration like this: var container = new WindsorContainer(); container.Register( Component.For<FirstInterceptor>(), Component.For<SecondInterceptor>(), Component.For<ThirdInterceptor>(), Component.For<IService>() .ImplementedBy<Servi...
The following 4 properties are available for PXSelector and PXSegmentMask input controls to define size range for a drop-down window: MinDropWidth: gets or sets the minimum drop-down control width MinDropHeight: gets or sets the minimum drop-down control height MaxDropWidth: gets or sets the ma...
A binary tree is BST if it satisfies any one of the following condition: It is empty It has no subtrees For every node x in the tree all the keys (if any) in the left sub tree must be less than key(x) and all the keys (if any) in the right sub tree must be greater than key(x). So a straightf...
Build an app.js with a simple data store: app.get("/bookstore", function (req, res, next) { // Your route data var bookStore = [ { title: "Templating with Pug", author: "Winston Smith", pages: 143, y...
Note: These instructions are targeted at .NET Core 1.0.4 & 1.1.1 SDK 1.0.1 and higher. When using binary archives to install, we recommend the contents be extracted to /opt/dotnet and a symbolic link created for dotnet. If an earlier release of .NET Core is already installed, the directory and ...
To reveal the default "root" password: shell> sudo grep 'temporary password' /var/log/mysqld.log Change the root password as soon as possible by logging in with the generated temporary password and set a custom password for the superuser account: shell> mysql -uroot -p mysql...
Keychain allows to save items with special SecAccessControl attribute which will allow to get item from Keychain only after user will be authenticated with Touch ID (or passcode if such fallback is allowed). App is only notified whether the authentication was successful or not, whole UI is managed b...
To develop an application for watchOS, you should start with Xcode. Xcode only runs on macOS. At the time of writing, the latest version is Xcode 8.3. If you want to start a new project from scratch: Boot up your Mac and install Xcode from the App Store if it's not already installed. Choo...
Sometimes, we have to take input from users which should contain only alpha numeric characters. For example, lets say a Username system which allow only letters and numbers, Then this can be done with the following Regular Expression ^[a-zA-Z0-9]+$ ^ is restrict the start [a-zA-Z0-9]+ is th...
Many watchOS apps (like Workout, Weather, Music, etc) have a main WKInterfaceTable or a set of buttons which are hooked up to another controller, similar to the navigation on iOS. This is called hierarchical view structure. To connect a button, Ctrl-Drag from the button to a controller, and select ...
Within the Schema Builder, use the Schema facade with any connection. Run the connection() method to specify which connection to use: Schema::connection('mysql2')->create('some_table', function($table) { $table->increments('id'): });
This function tells whether a given time lies within a a given time interval. (require '[clj-time.core :as t]) (def date1 (t/date-time 2016 11 5)) (def date2 (t/date-time 2016 12 5)) (def test-date1 (t/date-time 2016 12 20)) (def test-date2 (t/date-time 2016 11 15)) (t/within? (t/interva...
DB backup Database backup is a must before starting any Dynamics CRM upgrade process. This is mandatory as to always have the option to rollback in case of any major roadblock. Wrong Estimation DO NOT underestimate the work involved in a CRM Upgrade process. Audit your current Microsoft Dynamics...
Now, here are some common pitfalls which might come along your way when upgrading your Dynamics CRM system. The organisation database selected for the import is a different version than the organisation database that is currently deployedCRM Organization Database To fix this issue, we need to in...
Server Side example Create Listener for server Start of with creating an server that will handle clients that connect, and requests that will be send. So create an Listener Class that will handle this. class Listener { public Socket ListenerSocket; //This is the socket that will listen ...
Example of how to calculate the output shape and overcome the difficulties of using tf.nn.conv2d_transpose with unknown batch size (when input.get_shape() is (?, H, W, C) or (?, C, H, W)). def upconvolution (input, output_channel_size, filter_size_h, filter_size_w, stride_h, str...
Dialog dlg; DialogGroup dGrp; DialogField dialogField; dlg = new Dialog("Evil Dialog"); dGrp = dlg.addGroup("A Group"); dialogField = dlg.addFieldValue(extendedTypeStr(NoYesId), NoYes::Yes, "I hereby sell my soul"); if (dlg.run()) { info(dialogField.valu...

Page 97 of 109