Tutorial by Examples: l

For example if the given tree is: Level order traversal will be 1 2 3 4 5 6 7 Printing node data level by level. Code: #include<iostream> #include<queue> #include<malloc.h> using namespace std; struct node{ int data; node *left; node *right; }; ...
// Create a new read-only List<String> val list = listOf("Item 1", "Item 2", "Item 3") println(list) // prints "[Item 1, Item 2, Item 3]"
Visual Basic for Applications (VBA) is the macro language behind all Microsoft Office products and is essentially identical across all Office products. What differs from product to product is the Object model. Excel has workbooks, worksheets and cells. Access has tables and attributes. Outlook h...
You can pass parameters by Bundle: Bundle myBundle = new Bundle(); myBundle.putString(MY_KEY, myValue); Get the value in onCreateLoader: @Override public Loader<String> onCreateLoader(int id, final Bundle args) { final String myParam = args.getString(MY_KEY); ... }
CIDER function cider-eval-last-sexp can be used to execute the the code while editing the code inside the buffer. This function is by default binded to C-x C-e or C-x C-e. CIDER manual says C-x C-e or C-c C-e will: Evaluate the form preceding point and display the result in the echo area and/or ...
Consider the tree: Lowest common ancestor of nodes with value 1 and 4 is 2 Lowest common ancestor of nodes with value 1 and 5 is 3 Lowest common ancestor of nodes with value 2 and 4 is 4 Lowest common ancestor of nodes with value 1 and 2 is 2
You can create a Sequential model by passing a list of layer instances to the constructor: from keras.models import Sequential from keras.layers import Dense, Activation model = Sequential([ Dense(32, input_dim=784), Activation('relu'), Dense(10), Activation('softmax'), ]) ...
The idea is to measure a layout before and after each change and if there is a significant change you can be somewhat certain that its the softkeyboard. // A variable to hold the last content layout hight private int mLastContentHeight = 0; private ViewTreeObserver.OnGlobalLayoutListener keyboa...
P( glasses | reading ) = Count( reading glasses ) / Count( reading ) We count the sequences reading glasses and glasses from corpus and compute the probability.
//MySingletonClass.h @interface MYSingletonClass : NSObject + (instancetype)sharedInstance; -(instancetype)init NS_UNAVAILABLE; -(instancetype)new NS_UNAVAILABLE; @end //MySingletonClass.m @implementation MySingletonClass + (instancetype)sharedInstance { static MySingleto...
The following would work in IE9+ import React from 'react' class App extends React.Component { constructor () { super() this.state = {someData: null} } componentDidMount () { var request = new XMLHttpRequest(); request.open('GET', '/my/url', true); request...
/* This is a simple query which can generate a sequence of numbers. The following example generates a sequence of numbers from 1..100 */ select level from dual connect by level <= 100; /*The above query is useful in various scenarios like generating a sequence of dates from a given date. The ...
Consider the BST: Lowest common ancestor of 22 and 26 is 24 Lowest common ancestor of 26 and 49 is 46 Lowest common ancestor of 22 and 24 is 24 Binary search tree property can be used for finding nodes lowest ancestor Psuedo code: lowestCommonAncestor(root,node1, node2){ if(root == NULL) ...
This example demonstrates how to install Tomcat as a service on Ubuntu using the *.tar.gz releases of both Tomcat as well as Java. 1. Install the Java Runtime Environment (JRE) Download the desired jre .tar.gz release Extract to /opt/ This will create a directory /opt/jre1.Xxxx/ Create a sym...
This method allows non-implementation-specific code to be written and deployed across multiple jms platforms. Below basic example connects to activemq jms server and sends a message. import java.util.Properties; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.QueueConne...
You'll need Sitecore 6.6 or later (including Sitecore 8.x). Note that for Sitecore 6.6 compatibility you must have .NET 4.5 installed. Install Unicorn. This is as simple as adding the Unicorn NuGet package to your project. PM> Install-Package Unicorn When you install the NuGet package, a...
Clone the repository Place a copy of your Sitecore.Kernel.dll assembly in /lib/sitecore/v7 (for v7/v8) Build the project for your Sitecore version using Visual Studio 2012 or later Copy Unicorn.dll, Rainbow.dll, Rainbow.Storage.Sc.dll, Rainbow.Storage.Yaml.dll and Kamsar.WebConsole.dll to your ...
General Description A formula in Acumatica is a DAC field that is calculated based on the values of other object fields. To calculate a formula, Aсumatiсa framework provides a set of various operations and functions (such as arithmetical, logical, and comparison operations and string processing fu...
An anonymous function can be defined without a name through a Lambda Expression. For defining these type of functions, the keyword lambda is used instead of the keyword defun. The following lines are all equivalent and define anonymous functions which output the sum of two numbers: (lambda (x y) (...

Page 710 of 861