Tutorial by Examples: e

A whole class may be declared as friend. Friend class declaration means that any member of the friend may access private and protected members of the declaring class: class Accesser { public: void private_accesser1(); void private_accesser2(); }; class PrivateHolder { public: P...
In every applications life-cycle comes a day where it's components needs to be updated. Everyone knows the pain of updating every single dependency one-by-one. Well here you just need to issue the command: npm update (-g) If the "-g" is there then npm will update the global packages. ...
This is a protected and non-static method of the Object class. This method is used to perform some final operations or clean up operations on an object before it gets removed from the memory. According to the doc, this method gets called by the garbage collector on an object when garbage collecti...
Fast and short way to extract extension from file name in JavaScript will be: function get_extension(filename) { return filename.slice((filename.lastIndexOf('.') - 1 >>> 0) + 2); } It works correctly both with names having no extension (e.g. myfile) or starting with . dot (e.g. .h...
Fast and short way to format value of type Number as money, e.g. 1234567.89 => "1,234,567.89": var num = 1234567.89, formatted; formatted = num.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); // "1,234,567.89" More advanced variant with support of any number o...
function assign(obj, prop, value) { if (typeof prop === 'string') prop = prop.split('.'); if (prop.length > 1) { var e = prop.shift(); assign(obj[e] = Object.prototype.toString.call(obj[e]) === '[object Object]' ? obj[e] ...
Use DOMContentLoaded when the <script> code interacting with DOM is included in the <head> section. If not wrapped inside the DOMContentLoaded callback, the code will throw errors like Cannot read something of null document.addEventListener('DOMContentLoaded', function(event) { ...
Here is an example of how to import a function that is defined in an unmanaged C++ DLL. In the C++ source code for "myDLL.dll", the function add is defined: extern "C" __declspec(dllexport) int __stdcall add(int a, int b) { return a + b; } Then it can be included into ...
""" ================================================================================ DRAW MULTIPLE LINES IN THE SAME PLOT ================================================================================ """ import matplotlib.pyplot as plt ...
JavaFX 8 The following example demonstrates how to add custom properties that can be styled from css to a custom Node. Here 2 DoublePropertys are added to the Rectangle class to allow setting the width and height from CSS. The following CSS could be used for styling the custom node: StyleableRe...
Objective-C supports a special type called `instancetype that can only be used as type returned by a method. It evaluates to the class of the receiving object. Consider the following class hierarchy: @interface Foo : NSObject - (instancetype)initWithString:(NSString *)string; @end @interf...
UCanAccess is a pure Java JDBC driver that allows us to read from and write to Access databases without using ODBC. It uses two other packages, Jackcess and HSQLDB, to perform these tasks. Once it has been set up*, we can work with data in .accdb and .mdb files using code like this: import java.sq...
You can create and configure build types in the module-level build.gradle file inside the android {} block. android { ... defaultConfig {...} buildTypes { release { minifyEnabled true proguardFiles getDefaultProguar...
Can be used to show/hide DOM elements. Similar to using if, except that visible will still build the element and set display:none. <div data-bind="visible: shouldShowMessage"> You will see this message only when "shouldShowMessage" holds a true value. </div> ...
Similar to repeaters used in other languages. This binding will allow you to replicate a block of html for each item in an array. <div data-bind="foreach:contacts"> <div class="contact"> <h2 data-bind="text:name"> <p data-bin...
a simple example of how to define a custom shape with 2 inlets and 3 outlets. case class TwoThreeShape[-In1, -In2, +Out1, +Out2, +Out3]( in1: Inlet[In1@uncheckedVariance], in2: Inlet[In2@uncheckedVariance], out1: Outlet[Out1@uncheckedVariance], out2: Ou...
We know that 'best practise' dictates that a range object should have its parent worksheet explicitly referenced. A worksheet can be referred to by its .Name property, numerical .Index property or its .CodeName property but a user can reorder the worksheet queue by simply dragging a name tab or rena...
Add akka-actor dependency (SBT example) libraryDependencies += "com.typesafe.akka" % "akka-actor_2.11" % "2.4.8" Create actor classes: Actor for string output: class OutputActor extends Actor { override def receive: Receive = { case message => p...
When working with multiple open Workbooks, each of which may have multiple Sheets, it’s safest to define and set reference to all Workbooks and Sheets. Don't rely on ActiveWorkbook or ActiveSheet as they might be changed by the user. The following code example demonstrates how to copy a range from...
Gnuplot is a portable command-line driven graphing utility. This example will show how to setup gnuplot in the various platforms. Windows Download the latest version of the installer from gnuplot site. Run the downloaded file and allow it to run as administrator if requested On the ...

Page 381 of 1191