Tutorial by Examples: a

To understand this example, it is recommended to have a brief idea on Bellman-Ford single source shortest path algorithm which can be found here In Bellman-Ford algorithm, to find out the shortest path, we need to relax all the edges of the graph. This process is repeated at most (V-1) times, where...
Create one log file for each day. The log files will have the following names (dependent of culture) 2016-06-05.log 2016-06-06.log 2016-06-07.log ... <?xml version="1.0" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://w...
using NLog; using NLog.Config; using NLog.Targets; namespace MyNamespace { [Target("MyFirst")] public sealed class MyFirstTarget: TargetWithLayout //or inherit from Target { public MyFirstTarget() { //set defaults ...
[LayoutRenderer("hello-world")] public class HelloWorldLayoutRenderer : LayoutRenderer { /// <summary> /// I'm option and not required or default /// </summary> public string Config1 { get; set; } /// <summary> /// I'm required option. ...
To understand this example, it is recommended to have a brief idea about Bellman-Ford algorithm which can be found here Using Bellman-Ford algorithm, we can detect if there is a negative cycle in our graph. We know that, to find out the shortest path, we need to relax all the edges of the graph (V-...
declare is an internal command of bash. (internal command use help for displaying "manpage"). It is used to show and define variables or show function bodies. Syntax: declare [options] [name[=value]]... # options are used to define # an integer declare -i myInteger declare -i another...
This would be a basic setup in wich we will send all the log messages to the console and to a log file. Let's start with the libraries. Will use maven for that: <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifact...
Here is an example of a basic page using the Materialize CSS framework which incorporates the grid system and materialboxed. <!DOCTYPE html> <html> <head> <title>Materializecss Example webpage</title> <!--Import Google Icon Font--> <link href="ht...
Adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a vertex in a graph. It takes less memory to store graphs. Let's see a graph, and its adjacency matrix: Now we create a list using these values. This is called adjacen...
Descriptor objects can allow related object attributes to react to changes automatically. Suppose we want to model an oscillator with a given frequency (in Hertz) and period (in seconds). When we update the frequency we want the period to update, and when we update the period we want the frequency ...
use std::ops::Deref; use std::fmt::Debug; #[derive(Debug)] struct RichOption<T>(Option<T>); // wrapper struct impl<T> Deref for RichOption<T> { type Target = Option<T>; // Our wrapper struct will coerce into Option fn deref(&self) -> &Option...
Deref has a simple rule: if you have a type T and it implements Deref<Target=F>, then &T coerces to &F, compiler will repeat this as many times as needed to get F, for example: fn f(x: &str) -> &str { x } fn main() { // Compiler will coerce &&&&&&a...
>>> from sympy.solvers.inequalities import solve_univariate_inequality >>> from sympy import var >>> x=var('x') >>> solve_univariate_inequality(2*x**2-6>1,x,relational=False) (-oo, -sqrt(14)/2) U (sqrt(14)/2, oo) The relational=False parameter simply ind...
Floyd-Warshall's algorithm is for finding shortest paths in a weighted graph with positive or negative edge weights. A single execution of the algorithm will find the lengths (summed weights) of the shortest paths between all pair of vertices. With a little variation, it can print the shortest path ...
// 1.0, Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { /** * User Event 1.0 example detailing usage of the Submit events * * @appliedtorecord employee */ var exports = {}; function beforeSubmit(type)...
For this example, we want to make sure that any Employee who is marked as a Project Resource also has an appropriate Labor Cost defined. // 1.0, Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { /** * User Event 1.0 example detailing...
After the record gets stored in the database, we want to inspect what was changed on the record. We'll do this inspection by comparing values between the old and new record instances. // 1.0, Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { ...
// 1.0 // Utilize the type argument and raw Strings to filter your // execution by the action function beforeLoad(type, form, request) { // Don't do anything on APPROVE // Note that `type` is an Object, so we must use ==, not === if (type == "approve") { return...
In SuiteScript 1.0, we retrieve the current execution context using nlapiGetContext().getExecutionContext(), then we compare the result to the appropriate raw Strings. // 1.0 in Revealing Module pattern var myNamespace = myNamespace || {}; myNamespace.example = (function () { var exports =...
The STDIN stream in Julia refers to standard input. This can represent either user input, for interactive command-line programs, or input from a file or pipeline that has been redirected into the program. The readline function, when not provided any arguments, will read data from STDIN until a newl...

Page 786 of 1099