Tutorial by Examples: er

GCobol >>SOURCE FORMAT IS FIXED *> *************************************************************** *> Purpose: Demonstrate a merge pass *> Tectonics: cobc -x gnucobol-merge-sample.cob *> *************************************************************** ...
If you want to perform a user input validation of your textfield use the following code snippet: // MARK: - UITextFieldDelegate let allowedCharacters = CharacterSet(charactersIn:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvxyz").inverted func textField(_ textField:...
A common approach to get the top most UIViewController is to get the RootViewController of your active UIWindow. I wrote an extension for this: extension UIApplication { func topViewController(_ base: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController ...
Using the NotificationCenter of iOS, which can be very powerful, you are able to intercept certain app-wide events: NotificationCenter.default.addObserver( self, selector: #selector(ViewController.do(_:)), name: NSNotification.Name.UIApplicationDidBecomeActive, o...
Before reading this example, it is required to have a brief idea on edge-relaxation. You can learn it from here Bellman-Ford Algorithm is computes the shortest paths from a single source vertex to all of the other vertices in a weighted digraph. Even though it is slower than Dijkstra's Algorithm, i...
In case of problems, enable the internal logger <nlog internalLogFile="c:\log.txt" internalLogLevel="Trace"> <targets> <!-- target configuration here --> </targets> <rules> <!-- log routing rules --> </rules&gt...
In case of problems, enable the internal logger. C# example: // set internal log level InternalLogger.LogLevel = LogLevel.Trace; // enable one of the targets: file, console, logwriter: // enable internal logging to a file (absolute or relative path. Don't use layout renderers) InternalL...
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...
[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. ...
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...
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...
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 =...
Reading numbers from standard input is a combination of reading strings and parsing such strings as numbers. The parse function is used to parse a string into the desired number type: julia> parse(Int, "17") 17 julia> parse(Float32, "-3e6") -3.0f6 The format expec...
public class MyClass { public void foo() { Logger logger = Bukkit.getLogger(); logger.info("A log message"); logger.log(Level.INFO, "Another message"); logger.fine("A fine message"); // logging an exception try { ...
Templates require compile-time generation of code: a templated function, for example, will be effectively turned into multiple distinct functions once a templated function is parameterized by use in source code. This means that template function, member function, and class definitions cannot be del...

Page 304 of 417