Tutorial by Examples: st

Static class properties that are defined with the public visibility are functionally the same as global variables. They can be accessed from anywhere the class is defined. class SomeClass { public static int $counter = 0; } // The static $counter variable can be read/written from anywhere...
let someValue : String = "Something the user entered" let text = NSMutableAttributedString(string: "The value is: ") text.appendAttributedString(NSAttributedString(string: someValue, attributes: [NSFontAttributeName:UIFont.boldSystemFontOfSize(UIFont.systemFontSize())])) ...
Functionality in metaclasses can be changed so that whenever a class is built, a string is printed to standard output, or an exception is thrown. This metaclass will print the name of the class being built. class VerboseMetaclass(type): def __new__(cls, class_name, class_parents, class_dict)...
Most of the time that you'll be using Vuex will be in larger component based applications where you likely be using a module bundler such as Webpack or Browserify in conjunction with Vueify if you're using single files. In this case the easiest way to get Vuex is from NPM. Run the command below to ...
Detailed instructions on getting jvm set up or installed.
Like the built-in python interactive shell, IPython is a REPL (Read-Evaluate-Print Loop) shell, with a variety of features that make it more pleasant to use for day-to-day Python development than the built-in REPL shell. Installation To install it: pip install ipython Or, via Anaconda: # To i...
There are three MonoBehaviour methods that can be made coroutines. Start() OnBecameVisible() OnLevelWasLoaded() This can be used to create, for example, scripts that execute only when the object is visible to a camera. using UnityEngine; using System.Collections; public class RotateObje...
Let's set yourself up to build your own awesome Progressive Web App with Polymer! Before you can start installing Polymer you require the following: Node.js - check out the StackOverflow Installing Node.js Documentation Bower - you can install Bower using the Node Package Manager installe...
Avoid unnecessary operations and method calls wherever you can, especially in a method which is called many times a second, like Update. Distance/Range Checks Use sqrMagnitude instead of magnitude when comparing distances. This avoids unnecessary sqrt operations. Note that when using sqrMagnitude,...
You create new ScriptableObject instances through ScriptableObject.CreateInstance<T>() T obj = ScriptableObject.CreateInstance<T>(); Where T extends ScriptableObject. Do not create ScriptableObjects by calling their constructors, ie. new ScriptableObject(). Creating ScriptableO...
preg_match can be used to parse string using regular expression. The parts of expression enclosed in parenthesis are called subpatterns and with them you can pick individual parts of the string. $str = "<a href=\"http://example.org\">My Link</a>"; $pattern = "/...
Pre-requisites This article demonstrated installing oozie-4.3.0 on Hadoop 2.7.3 Java 1.7+ Hadoop 2.x (here, 2.7.3) Maven3+ Unix box Step1: Dist file Get oozie tar.gz file from http://www-eu.apache.org/dist/oozie/4.3.0/ and extract it cd $HOME tar -xvf oozie-4.3.0.tar.gz Step2: Build ...
Ansible is best used from a checkout. It runs as you (not root) and it has minimal python dependencies. Python pip dependency install with pip: sudo pip install paramiko PyYAML Jinja2 httplib2 six Next, clone the Ansible repo from GitHub: cd ~/Documents git clone git://github.com/ansible/ans...
Detailed instructions on getting image-processing set up or installed.
Detailed instructions on getting vb6 set up or installed.
You can obtain information about EC2 instances using: aws ec2 describe-instances You can obtain information about specific EC2 instances using: aws ec2 describe-instances --instance-ids ... where ... contains one or more instance identifiers. For example: aws ec2 describe-instances --instan...
A class or struct can also contain another class/struct definition inside itself, which is called a "nested class"; in this situation, the containing class is referred to as the "enclosing class". The nested class definition is considered to be a member of the enclosing class, b...
The VBA editor only allows 1023 characters per line, but typically only the first 100-150 characters are visible without scrolling. If you need to assign long string literals, but you want to keep your code readable, you'll need to use line-continuations and concatenation to assign your string. Deb...
VBA defines a number of string constants for special characters like: vbCr : Carriage-Return 'Same as "\r" in C style languages. vbLf : Line-Feed 'Same as "\n" in C style languages. vbCrLf : Carriage-Return & Line-Feed (a new-line in Windows) vbTab: Tab Character vbNul...
Const appName As String = "The App For That"

Page 124 of 369