Tutorial by Examples: al

public class Singleton { private static class InstanceHolder { static final Singleton INSTANCE = new Singleton(); } public static Singleton getInstance() { return InstanceHolder.INSTANCE; } private Singleton() {} } This initializes the INSTANCE vari...
Prerequisites The Windows version of Elasticsearch can be obtained from this link: https://www.elastic.co/downloads/elasticsearch. The latest stable release is always at the top. As we are installing on Windows, we need the .ZIP archive. Click the link in the Downloads: section and save the file t...
function social_profiles( $contactmethods ) { $contactmethods['facebook_profile'] = 'Facebook Profile URL'; $contactmethods['twitter_profile'] = 'Twitter Profile URL'; $contactmethods['google_profile'] = 'Google Profile URL'; $contactmethods['linkedin_profile'] = 'Li...
OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library. The OpenSSL toolkit is licensed under an Apache-style license, wh...
Detailed instructions on getting math set up or installed.
data(AirPassengers) class(AirPassengers) 1 "ts" In the spirit of Exploratory Data Analysis (EDA) a good first step is to look at a plot of your time-series data: plot(AirPassengers) # plot the raw data abline(reg=lm(AirPassengers~time(AirPassengers))) # fit a trend line For...
from datetime import datetime import pandas_datareader.data as wb stocklist = ['AAPL','GOOG','FB','AMZN','COP'] start = datetime(2016,6,8) end = datetime(2016,6,11) p = wb.DataReader(stocklist, 'yahoo',start,end) p - is a pandas panel, with which we can do funny things: let's see what...
Unnamed class types may also be used when creating type aliases, i.e. via typedef and using: C++11 using vec2d = struct { float x; float y; }; typedef struct { float x; float y; } vec2d; vec2d pt; pt.x = 4.f; pt.y = 3.f;
extern crate serde; extern crate serde_json; #[macro_use] extern crate serde_derive; use std::collections::BTreeMap as Map; #[derive(Serialize)] struct Resource { // Always serialized. name: String, // Never serialized. #[serde(skip_serializing)] hash: String, ...
Let's have a basic failing program: #include <iostream> void fail() { int *p1; int *p2(NULL); int *p3 = p1; if (p3) { std::cout << *p3 << std::endl; } } int main() { fail(); } Build it (add -g to include debug info): g++ -g -o m...
Initializing std::array<T, N>, where T is a scalar type and N is the number of elements of type T If T is a scalar type, std::array can be initialized in the following ways: // 1) Using aggregate-initialization std::array<int, 3> a{ 0, 1, 2 }; // or equivalently std::array<int, 3...
This example has been lifted from the Q & A section here:http://stackoverflow.com/a/1008289/3807729 See this article for a simple design for a lazy evaluated with guaranteed destruction singleton: Can any one provide me a sample of Singleton in c++? The classic lazy evaluated and correctly de...
Detailed instructions on getting websphere-mq set up or installed.
assert ['cat', 'dog', 'fish']*.length() == [3, 3, 4] Note that when mixing types in the collection if the method not exists on some of the elements, a groovy.lang.MissingMethodException could be thrown: ['cat', 'dog', 'fish',3]*.length() // it throws groovy.lang.MissingMethodException: No sign...
In development, you may find that using require() on the same module multiple times always returns the same module, even if you have made changes to that file. This is because modules are cached the first time they are loaded, and any subsequent module loads will load from the cache. To get around ...
Polymer prodives a lot of well built elements for you to use in your app. Browse them in their Element Catalog. Let's go through the workflow of using an element by including paper-input (Documentation) Download the Element To Download an element there are two ways: Bower The convinient way is...
Occasionally, we may want to display dialogs with more than one pane of content. jQuery UI offers tabs that can be used in tandem with a dialog to make this possible. While it may be more common to have tabs within a dialog's content container, this example will demonstrate how to make a list of t...
Higher-order functions can be used to implement generic algorithms, giving up the responsibility of providing final details to the user. For instance List.sort expects a comparison function, which allows to implement various ways of sorting. Here we implement case-insensitive sorting of strings: le...
Although modules are ideal, if the library you are using is referenced by a global variable (like $ or _), because it was loaded by a script tag, you can create an ambient declaration in order to refer to it: declare const _: any;
A message with important, and usually time-sensitive, information. <div role="alert" aria-live="assertive">Your session will expire in 60 seconds.</div> Note that I've included both role="alert" and aria-live="assertive" at the same time. The...

Page 71 of 269