Tutorial by Examples: al

NLTK requires Python versions 2.7 or 3.4+. These instructions consider python version - 3.5 Mac/Unix : Install NLTK: run sudo pip install -U nltk Install Numpy (optional): run sudo pip install -U numpy Test installation: run python then type import nltk NOTE : For older versions of P...
Structure for Binary Search Tree (BST) nodes: struct node { int data; node * left; node * right; } Search Algorithm // Check if a value exists in the tree bool BSTSearch(node * current, int value) { if (current->data == value) { return true; } e...
Creates an image representing a gradient of colors radiating from the center of the gradient radial-gradient(red, orange, yellow) /*A gradient coming out from the middle of the gradient, red at the center, then orange, until it is finally yellow at the edges*/
--dataset schemas must be identical SELECT 'Data1' as 'Column' UNION ALL SELECT 'Data2' as 'Column' UNION ALL SELECT 'Data3' as 'Column' UNION ALL SELECT 'Data4' as 'Column' UNION ALL SELECT 'Data5' as 'Column' EXCEPT SELECT 'Data3' as 'Column' --Returns Data1, Data2, Data4, and Data5
SAP Crystal Reports can be installed as a standalone program or integrated into Visual Studio. (SAP Crystal Reports for Visual Studio) - Both of which require very little effort outside of the installation wizard.
SimpleDateFormatter is great in a pinch, but like the name suggests it doesn't scale well. If you hard-code "MM/dd/yyyy" all over your application your international users won't be happy. Let Java do the work for you Use the static methods in DateFormat to retrieve the right formatting ...
In Python 2, writing directly to a file handle returns None: Python 2.x2.3 hi = sys.stdout.write('hello world\n') # Out: hello world type(hi) # Out: <type 'NoneType'> In Python 3, writing to a handle will return the number of characters written when writing text, and the number of by...
Setting up key value observing. In this case, we want to observe the contentOffset on an object that our observer owns // // Class to observe // @interface XYZScrollView: NSObject @property (nonatomic, assign) CGPoint contentOffset; @end @implementation XYZScrollView @end // // Clas...
Often times you will need to be able to manage your notifications, by being able to keep track of them and cancel them. Track a notification You can assign a UUID (universally unique identifier) to a notification, so you can track it: Swift let notification = UILocalNotification() let uuid = NS...
Local variables (unlike the other variable classes) do not have any prefix local_variable = "local" p local_variable # => local Its scope is dependent on where it has been declared, it can not be used outside the "declaration containers" scope. For example, if a local va...
Global variables have a global scope and hence, can be used everywhere. Their scope is not dependent on where they are defined. A variable will be considered global, when prefixed with a $ sign. $i_am_global = "omg" class Dinosaur def instance_method p "global vars ca...
The easiest way to install and manage various versions of Ruby with rbenv is to use the ruby-build plugin. First clone the rbenv repository to your home directory: $ git clone https://github.com/rbenv/rbenv.git ~/.rbenv Then clone the ruby-build plugin: $ git clone https://github.com/rbenv/rub...
It is best to use latest SLIME from Emacs MELPA repository: the packages may be a bit unstable, but you get the latest features. Portale and multiplatform Emacs, Slime, Quicklisp, SBCL and Git You can download a portable and multiplatform version of Emacs25 already configured with Slime, SBCL, Qui...
In Emacs M-x slime will start slime with the default (first) Common Lisp implementation. If there are multiple implementations provided (via variable slime-lisp-implementations), other implementations can be accessed via M-- M-x slime, which will offer the choice of available implementations in mini...
// This iterates through a range between two DateTimes // with the given iterator (any of the Add methods) DateTime start = new DateTime(2016, 01, 01); DateTime until = new DateTime(2016, 02, 01); // NOTICE: As the add methods return a new DateTime you have // to overwrite dt in the itera...
Suppose the make fails: $ make Launch it instead with make VERBOSE=1 to see the commands executed. Then directly run the linker or compiler command that you'll see. Try to make it work by adding necessary flags or libraries. Then figure out what to change, so CMake itself can pass correct argum...
Example: Invoke different constructors by passing relevant parameters import java.lang.reflect.*; class NewInstanceWithReflection{ public NewInstanceWithReflection(){ System.out.println("Default constructor"); } public NewInstanceWithReflection( String a){ ...
Reflection is useful when it is properly used for right purpose. By using reflection, you can access private variables and re-initialize final variables. Below is the code snippet, which is not recommended. import java.lang.reflect.*; public class ReflectionDemo{ public static void main(St...
Minikube creates a local cluster of virtual machines to run Kubernetes on.It is the simplest method to get your hands dirty with Kubernetes on your local machine. Documentation for Minikube can be found at http://kubernetes.io/docs/getting-started-guides/minikube/ Requirements On macOS, xhyve ...
// Obtain an instance of JavaScript engine ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("nashorn"); try { // Set value in the global name space of the engine engine.put("name","Nashorn"); // E...

Page 107 of 269