Tutorial by Examples: am

When invoking a def, parameters may be assigned explicitly by name. Doing so means they needn't be correctly ordered. For example, define printUs() as: // print out the three arguments in order. def printUs(one: String, two: String, three: String) = println(s"$one, $two, $three") ...
It crops the images in square shape. This cordova project uses two plugins: Cordova Camera Plugin -- https://github.com/apache/cordova-plugin-camera Cordova Crop Image Plugin -- https://github.com/jeduan/cordova-plugin-crop The Camera plugin is combined with the Crop Image Plugin by ...
index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *"/> ...
You can extend C++ with named operators that are "quoted" by standard C++ operators. First we start with a dozen-line library: namespace named_operator { template<class D>struct make_operator{constexpr make_operator(){}}; template<class T, char, class O> struct half_a...
public class ManagedCamel implements Managed { public static final String REDIS_TEMPLATE = "redisTemplate"; public static final String LISTENER_CONTAINER = "listenerContainer"; public static final String REDIS_SERIALIZER = "redisSerializer"; privat...
// 1.0 function beforeLoad(type, form, request) { nlapiLogExecution("DEBUG", "Before Load", "type=" + type); } // 2.0 /** * @NApiVersion 2.x * @NScriptType UserEventScript * @NModuleScope SameAccount */ define(["N/log"], function (log) { ...
In this example we have a file called file.js. Let's assume that you have to parse an URL using JavaScript and NodeJS querystring module. To accomplish this all you have to do is to insert the following statement in your file: const querystring = require('querystring'); var ref = querystring.pa...
While launching an application firstly main thread is executed. This Main thread handles all the UI concept of application. If we want to run long the task in which we don't need the UI then we use thread for running that task in background. Here is the example of Thread which describes blow: new ...
NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; attachment.image = [UIImage imageNamed:@"imageName"]; attachment.bounds = CGRectMake(0, 0, 35, 35); NSAttributedString *attachmentString = [NSAttributedString attributedStringWithAttachment:attachment];
In the manifest we have fours dangerous runtime permissions from two groups. <!-- Required to read and write to shredPref file. --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTE...
This is an actual useful strategy to differentiate member data from parameters... Lets take this example : // Dog Class Example #include <iostream> #include <string> using std::cout; using std::endl; /* * @class Dog * @member name * Dog's name * @function bark * ...
seemed the only way to add a comment. One thing that's easy to forget is that if you string some variables like the example above, and the resulting length is SHORTER than what was originally in the receiving variable (o- string above) then"trailing"characters are left in place. For exam...
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...
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...
// 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)...
Sometimes we need to collect data from google spreadsheets. We can use gspread and oauth2client libraries to collect data from google spreadsheets. Here is a example to collect data: Code: from __future__ import print_function import gspread from oauth2client.client import SignedJwtAssertionCred...
The following example will contain a block of code that is meant to be split into several source files, as denoted by // filename comments. Source Files // my_function.h /* Note how this header contains only a declaration of a function. * Header functions usually do not define implementations...
using System; [assembly:CLSCompliant(true)] namespace CLSDoc { public class Car { //Warning CS3005 Identifier 'Car.CALCULATEAge()' differing only in case is not CLS-compliant public int CalculateAge() { return 0; } ...
In a const-correct function, all passed-by-reference parameters are marked as const unless the function directly or indirectly modifies them, preventing the programmer from inadvertently changing something they didn't mean to change. This allows the function to take both const and non-cv-qualified ...
Copy paste this code and launch your program : @Theme(ValoTheme.THEME_NAME) //[optional] adds Vaadin built in theming public class SampleUI extends UI { @Override protected void init(VaadinRequest request) { final VerticalLayout rootLayout = new VerticalLayout(); Label...

Page 85 of 129