Tutorial by Examples

Remember to create folder for upload (uploads in example). install multer npm i -S multer server.js: var express = require("express"); var multer = require('multer'); var app = express(); var fs = require('fs'); app.get('/',function(req,res){ res.sendFil...
Module MainPrompt Public Const PromptSymbol As String = "TLA > " Public Const ApplicationTitle As String = GetType(Project.BaseClass).Assembly.FullName REM Or you can use a custom string REM Public Const ApplicationTitle As String = "Short name of the application" Sub M...
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*/
This module defines functions and classes which implement a flexible event logging system for applications and libraries. The key benefit of having the logging API provided by a standard library module is that all Python modules can participate in logging, so your application log can include your o...
--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
help <command> This will display the Bash help (manual) page for the specified built-in. For example, help unset will show: unset: unset [-f] [-v] [-n] [name ...] Unset values and attributes of shell variables and functions. For each NAME, remove the corresponding variable or ...
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.
An example of a RLMObject base model class that uses a primary key and some generic default properties. Subclasses can then set metadata specific to their needs. @interface BaseModel : RLMObject @property NSString *uuid; @property NSString *metadata; @end @implementation BaseModel + (N...
Ruby hashes use the methods hash and eql? to perform the hash operation and assign objects stored in the hash to internal hash bins. The default implementation of hash in Ruby is the murmur hash function over all member fields of the hashed object. To override this behavior it is possible to overrid...
Assigning string to different string types and how the runtime environment behaves regarding them. Memory allocation, reference counting, indexed access to chars and compiler errors described briefly where applicable. var SS5: string[5]; {a shortstring of 5 chars + 1 length byte, no trailing `0`...
Counting references on strings is thread-safe. Locks and exception handlers are used to safeguard the process. Consider the following code, with comments indicating where the compiler inserts code at compile time to manage reference counts: procedure PassWithNoModifier(S: string); // prologue: Inc...
To get current page width and height (for any browser), e.g. when programming responsiveness: function pageWidth() { return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.bo...
Java provides the instanceof operator to test if an object is of a certain type, or a subclass of that type. The program can then choose to cast or not cast that object accordingly. Object obj = Calendar.getInstance(); long time = 0; if(obj instanceof Calendar) { time = ((Calendar)obj).ge...
It can be useful to load a resource (image, text file, properties, KeyStore, ...) that is packaged inside a JAR. For this purpose, we can use the Class and ClassLoaders. Suppose we have the following project structure : program.jar | \-com \-project | |-file.txt \-Test.class ...
One potential implementation of Redis as a backend caching utility is the django-redis-cache package. This example assumes you already have a Redis server operating. $ pip install django-redis-cache Edit your settings.py to include a CACHES object (see Django documentation on caching). CACHES ...
One potential implementation of Redis as a backend caching utility is the django-redis package. This example assumes you already have a Redis server operating. $ pip install django-redis Edit your settings.py to include a CACHES object (see Django documentation on caching). CACHES = { 'de...
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 ...
dput() and dget() The easiest way to share a (preferable small) data frame is to use a basic function dput(). It will export an R object in a plain text form. Note: Before making the example data below, make sure you're in an empty folder you can write to. Run getwd() and read ?setwd if you need t...
Package reproducibility is a very common issue in reproducing some R code. When various packages get updated, some interconnections between them may break. The ideal solution for the problem is to reproduce the image of the R code writer's machine on your computer at the date when the code was writt...

Page 548 of 1336