Tutorial by Examples: ee

When one wishes to convert a list to a vector or data.frame object empty elements are typically dropped. This can be problematic which a list is created of a desired length are created with some empty values (e.g. a list with n elements is created to be added to an m x n matrix, data.frame, or data...
An object pointer (including void*) or function pointer can be converted to an integer type using reinterpret_cast. This will only compile if the destination type is long enough. The result is implementation-defined and typically yields the numeric address of the byte in memory that the pointer poin...
installing npm install web-component-tester --save-dev setting up wct.conf.js module.exports = { verbose: true, plugins: { local: { browsers: ['chrome'] } } }; running node node_modules/web-component-tester/bin/wct test/index.html <html...
Extension Resources in Azure are resources that extend other resources. This template creates an Azure Key Vault as well as a DiagnosticSettings extension. Things to note: The extension resource is created under the resources attribute of the parent resource It needs to have a dependsOn attrib...
Follow this steps for adding splash screen into WPF application in Visual Studio: Create or get any image and add it to your project (e.g. inside Images folder): Open properties window for this image (View → Properties Window) and change Build Action setting to SplashScreen value: R...
If your application is lightweight and simple, it will launch very fast, and with similar speed will appear and disappear splash screen. As soon as splash screen disappearing after Application.Startup method completed, you can simulate application launch delay by following this steps: Open App.x...
enum Util { /* No instances */; public static int clamp(int min, int max, int i) { return Math.min(Math.max(i, min), max); } // other utility methods... } Just as enum can be used for singletons (1 instance classes), it can be used for utility classes (0 instance...
To interact with WebElements in a webpage, first we need to identify the location of the element. By is the keyword available in selenium. You can locate the elements By.. By ID By Class Name By TagName By Name By Link Text By Partial Link Text By CSS Selector By XPath Using JavaScript ...
CSS div.needle { margin: 100px; height: 150px; width: 150px; transform: rotateY(85deg) rotateZ(45deg); /* presentational */ background-image: linear-gradient(to top left, #555 0%, #555 40%, #444 50%, #333 97%); box-shadow: inset 6px 6px 22px 8px #272727; } HTML <div c...
This method behaves as a combination of TryParse and ParseExact: It allows custom format(s) to be specified, and returns a Boolean result indicating success or failure rather than throwing an exception if the parse fails. TryParseExact(string, string, IFormatProvider, DateTimeStyles, out DateTime) ...
Enable and configure the experimental Gradle plugin to improve AndroidStudio's NDK support. Check that you fulfill the following requirements: Gradle 2.10 (for this example) Android NDK r10 or later Android SDK with build tools v19.0.0 or later Configure MyApp/build.gradle file Edit the dep...
Using the document-ready event can have small performance drawbacks, with delayed execution of up to ~300ms. Sometimes the same behavior can be achieved by execution of code just before the closing </body> tag: <body> <span id="greeting"></span> world! <sc...
Use quasiquotes to create a Tree in a macro. object macro { def addCreationDate(): java.util.Date = macro impl.addCreationDate } object impl { def addCreationDate(c: Context)(): c.Expr[java.util.Date] = { import c.universe._ val date = q"new java.util.Date()" // this...
Also known as triple equals. This operator does not test equality, but rather tests if the right operand has an IS A relationship with the left operand. As such, the popular name case equality operator is misleading. This SO answer describes it thus: the best way to describe a === b is "if I ...
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...
Once you installed Ubuntu, you might want to get the latest patches and updates. Using Ubuntu's easy to use package manager Aptitude, the OS along with all future packages that is installed using this manner can be kept up to date. Download the latest package lists by refreshing information from ...
git log master..foo will show the commits that are on foo and not on master. Helpful for seeing what commits you've added since branching!
As all threads are running in the same process, all threads have access to the same data. However, concurrent access to shared data should be protected with a lock to avoid synchronization issues. import threading obj = {} obj_lock = threading.Lock() def objify(key, val): print("O...
Code running in different processes do not, by default, share the same data. However, the multiprocessing module contains primitives to help share values across multiple processes. import multiprocessing plain_num = 0 shared_num = multiprocessing.Value('d', 0) lock = multiprocessing.Lock() ...
Place Picker is a really simple UI widget provided by Places API. It provides a built-in map, current location, nearby places, search abilities and autocomplete. This is a sample usage of Place Picker UI widget. private static int PLACE_PICKER_REQUEST = 1; private TextView txtPlaceName; @Ove...

Page 19 of 54