Tutorial by Examples: st

To access a member function of a class, you need to have a "handle" to the particular instance, as either the instance itself, or a pointer or reference to it. Given a class instance, you can point to various of its members with a pointer-to-member, IF you get the syntax correct! Of course...
To access a member of a class, you need to have a "handle" to the particular instance, as either the instance itself, or a pointer or reference to it. Given a class instance, you can point to various of its members with a pointer-to-member, IF you get the syntax correct! Of course, the poi...
A static member variable is just like an ordinary C/C++ variable, except with scope: It is inside a class, so it needs its name decorated with the class name; It has accessibility, with public, protected or private. So, if you have access to the static member variable and decorate it correctl...
string nullString = null; string emptyString = ""; string whitespaceString = " "; string tabString = "\t"; string newlineString = "\n"; string nonEmptyString = "abc123"; bool result; result = String.IsNullOrEmpty(nullString); ...
Simple constraint: interface IRunnable { run(): void; } interface IRunner<T extends IRunnable> { runSafe(runnable: T): void; } More complex constraint: interface IRunnble<U> { run(): U; } interface IRunner<T extends IRunnable<U>, U> { runSafe...
The lubridate package provides convenient functions to format date and datetime objects from character strings. The functions are permutations of LetterElement to parseBase R equivalentyyear%y, %Ym (with y and d)month%m, %b, %h, %Bdday%d, %ehhour%H, %I%pm (with h and s)minute%Msseconds%S e.g. ymd(...
$this->helper('customer/data')->getAccountUrl(); OR Mage::helper('customer/data')->getAccountUrl();
The easiest way to get started with Gremlin is to install the Gremlin Console. The Gremlin Console is a REPL that allows immediate feedback on the results of Gremlin traversals. As a prerequisite, Java 8 is required for the Gremlin Console to run. Ensure that it is installed prior to moving forward...
Detailed instructions on getting titan set up or installed.
You can redirect the debug output to a text file by adding a TextWriterTraceListener to the Debug.Listeners collection. public static void Main(string[] args) { TextWriterTraceListener myWriter = new TextWriterTraceListener(@"debug.txt"); Debug.Listeners.Add(myWriter); Deb...
System time gives you the CPU time required to execute a R expression, for example: system.time(print("hello world")) # [1] "hello world" # user system elapsed # 0 0 0 You can add larger pieces of code through use of braces: system.time({ li...
Mage::helper('customer')->getCustomer(); or Mage::getSingleton('customer/session')->getCustomer();
The border-style property sets the style of an element's border. This property can have from one to four values (for every side of the element one value.) Examples: border-style: dotted; border-style: dotted solid double dashed; border-style can also have the values none and hidden. They ...
It is possible to limit the tests executed by manage.py test by specifying which modules should be discovered by the test runner: # Run only tests for the app names "app1" $ python manage.py test app1 # If you split the tests file into a module with several tests files for an app $ p...
Drupal Console The new CLI for Drupal. A tool to generate boilerplate code, interact with and debug Drupal. First, we need to install Drupal Console. Drupal Console is needed not only for this time, but for future installations. # Run this in your terminal to get the latest project version: cur...
<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...
You can define the signing configuration to sign the apk in the build.gradle file using these properties: storeFile : the keystore file storePassword: the keystore password keyAlias: a key alias name keyPassword: A key alias password In many case you may need to avoid this kind of info in ...
Make sure to have a file input on your page: <input type="file" id="upload"> Then in JavaScript: document.getElementById('upload').addEventListener('change', readFileAsString) function readFileAsString() { var files = this.files; if (files.length === 0) { ...
When you want to allow only certain keys in your arrays, especially when the array comes from request parameters, you can use array_intersect_key together with array_flip. $parameters = ['foo' => 'bar', 'bar' => 'baz', 'boo' => 'bam']; $allowedKeys = ['foo', 'bar']; $filteredParameters =...
The return statement can be a useful way to create output for a function. The return statement is especially useful if you do not know in which context the function will be used yet. //An example function that will take a string as input and return //the first character of the string. function...

Page 74 of 369