Tutorial by Examples: pre

The following configuration can be used as a base config for bundling up your project as a library. Notice how the module config contains a list of preLoaders and loaders. // webpack.config.js var path = require('path'); module.exports = { entry: path.join(__dirname, '..', 'src/index.js...
Express router allows you to create multiple "mini apps" so you can namespace your api, public, auth and other routes into separate routing systems. var express = require('express'); var app = express(); var router = express.Router(); router.get('/', function(req, res){ ...
CategoryOperatorAssociativityPostfix() []Left to rightUnary! ~Right to leftMultiplicative* / %Left to rightAdditive+ -Left to rightShift>> >>> <<Left to rightRelational> >= < <=Left to rightEquality== !=Left to rightBitwise and&Left to rightBitwise xor^Left to ri...
Often, the routes in a controller all start with the same prefix. For example: public class ReviewsController : Controller { // eg: /reviews [Route(“reviews”)] public ActionResult Index() { … } // eg: /reviews/5 [Route(“reviews/{reviewId}”)] public ActionResult Show(i...
using System.Diagnostics.Contracts; public int IncrementByRandomAmount(int input) { Contract.Requires<ArgumentNullException>(input != null); // Don't allow null parameter. Contract.Requires<ArgumentOutOfRangeException>(input < int.MaxValue); // We can't do anything if...
public static Expression<Func<T, bool>> GetExpression<T>(IList<QueryFilter> filters) { Expression exp = null; // Represents a named parameter expression. {parm => parm.Name.Equals()}, it is the param part // To create a ParameterExpression need the ty...
For one filter: Here is where the query is created, it receives a expression parameter and a filter. private static Expression GetExpression<T>(ParameterExpression param, QueryFilter queryFilter) { // Represents accessing a field or property, so here we are accessing for example: ...
ConstantExpression must be the same type of the MemberExpression. The value in this example is a string, which is converted before creating the ConstantExpression instance. private static ConstantExpression GetConstant(Type type, string value) { // Discover the type, convert it, and create Co...
The latest JVMs supports Garbage First GC ( G1 GC) and consists of set of regions which accumulate to make young and old generation. The JVM will have approximately 2048 reagions and set heap region size accordingly from 1 MB to 32 MB and power of 2 bounds. This is important parameter which decide ...
Write some tests Install dispatch:mocha-phantomjs: meteor add dispatch:mocha-phantomjs Add a test-command to your package.json. { "name": "awesome meteor package", "scripts": { "test": "meteor test --driver-package dispatch:mocha-...
Install openfire or any chat server in your system or on server. For more details click here. Create android project and add these libraries in gradle: compile 'org.igniterealtime.smack:smack-android:4.2.0' compile 'org.igniterealtime.smack:smack-tcp:4.2.0' compile 'org.igniterealtime.smack:smac...
Logical && is logical AND, || is logical OR. == is equality, /= non-equality, < / <= lesser and > / >= greater operators. Arithmetic operators The numerical operators +, - and / behave largely as you'd expect. (Division works only on fractional numbers to avoid rounding issue...
Create engaging user interfaces for Windows Desktop Applications with Blend for Visual Studio, the premier professional design tool for XAML applications. Build beautiful transitions and visualizations using Blend’s full suite of vector drawing tools, powerful template editing features, real-time an...
import numpy as np import cv2 #access a video from your disk #to use the GIF in this example, convert to avi! cap = cv2.VideoCapture('eg_videoRead.avi') #we are going to read 10 frames #we store the frames in a numpy structure #then we'll generate a minimum projection of those frame...
SQL Server 2008 The ROW_NUMBER function can assign an incrementing number to each row in a result set. Combined with a Common Table Expression that uses a BETWEEN operator, it is possible to create 'pages' of result sets. For example: page one containing results 1-10, page two containing results 11...
Writing a gzipped file To write a gzipped file, use the module IO::Compress::Gzip and create a filehandle by creating a new instance of IO::Compress::Gzip for the desired output file: use strict; use warnings; use open qw( :encoding(UTF-8) :std ); # Make UTF-8 default encoding use IO::Compres...
By using the method GET_SUBMATCH of class CL_ABAP_MATCHER, we can get the data in the groups/subgroups. Goal: get the token to the right of the keyword 'Type'. DATA: lv_pattern TYPE string VALUE 'type\s+(\w+)', lv_test TYPE string VALUE 'data lwa type mara'. CREATE OBJECT ref_regex EX...
NSString *emailRegex = @"[A-Z0-9a-z]([A-Z0-9a-z._-]{0,64})+[A-Z0-9a-z]+@[A-Z0-9a-z]+([A-Za-z0-9.-]{0,64})+([A-Z0-9a-z])+\\.[A-Za-z]{2,4}"; NSString *firstNameRegex = @"[0-9A-Za-z\"'-]{2,32}$"; NSString *firstNameRegex = @"[ 0-9A-Za-z]{2,32}$"; NSString *lastNa...
By default, when data is imported to the PowerBI Desktop, each table or query stores data source details separately, even if they use the same data source. This makes it tedious, for example, to change the source database of an entire PowerBI report - which requires changing each query source param...
// Set up Express var express = require('express'); var app = express(); // Specify mount path, '/static', for the static directory app.use('/static', express.static('public')); // Start Express server app.listen(3030);

Page 25 of 34