Tutorial by Examples: du

Reduce takes a function and a collection of items. It returns a value that is created by combining the items. This is a simple reduce. It returns the sum of all the items in the collection. total = reduce(lambda a, x: a + x, [0, 1, 2, 3, 4]) print(total) =>10
This example expects an error, as the hello-world bucket already exists and S3 uses a global namespace. New-S3Bucket -BucketName "hello-world" New-S3Bucket : The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a dif...
Lightweight simple translation module with dynamic json storage. Supports plain vanilla node.js apps and should work with any framework (like express, restify and probably more) that exposes an app.use() method passing in res and req objects. Uses common __('...') syntax in app and templates. Stores...
Every Heroku app runs in at least two environments: on Heroku (we’ll call that production) and on your local machine (development). If more than one person is working on the app, then you’ve got multiple development environments - one per machine, usually. Usually, each developer will also have a te...
Hot Module Replacement allows to add, change or delete app module when application is running. Page reloading is not needed in this case. Prerequisites In addition to webpack-dev-middleware packages: npm install --save-dev webpack-hot-middleware Configuration Simply update configuration of UseW...
cf logs AppName --recent Note, depending on who is hosting your CF app, the size of this log may be limited.
Creating app project When creating an Android app ready for the app store it's important when using ionic start that we add --appname|-a and --id|-i flags which is used for google play to identify your app from other apps. If you're starting a new mobile app project you can use the cli example b...
Configuration In the following paragraphs there wil be an example per browser for the configuration in Json and setup in C#. This example expects you to have all the drivers in your path variable and browsers installed. Microsoft Edge C# code to create a remote webdriver // Defining webdriver v...
PowerShell looks for modules in the directories listed in the $Env:PSModulepath. A module called foo, in a folder called foo will be found with Import-Module foo In that folder, PowerShell will look for a module manifest (foo.psd1), a module file (foo.psm1), a DLL (foo.dll).
By default, only functions defined in a module are visible outside of the module. In other words, if you define variables and aliases in a module, they won't be available except in the module's code. To override this behavior, you can use the Export-ModuleMember cmdlet. It has parameters called -F...
To add a module called GuestModule, run: $ ng g m guest installing module create src/app/guest/guest.module.ts To enable .spec files creation add --spec or -sp flag $ ng g m guest --spec installing module create src/app/guest/guest.module.spec.ts create src/app/...
<div sec:authorize="isAuthenticated()"> This text is displayed for authenticated users. </div>
Design Patterns provide solutions to the commonly occurring problems in software design. The design patterns were first introduced by GoF(Gang of Four) where they described the common patterns as problems which occur over and over again and solutions to those problems. Design patterns have four ess...
Before deploying the angular project in server we need to build angular project for production. We also need to change the routing path in index.html file from <base href=”/”> to <base href=”./”> if it is not done then your project wouldn’t get loaded properly there will be some routing ...
ng build –prod Above given command with extra option like –prod would generate the production build project bundle. Once the above command gets executed in the root directory of your project would appear a directory called dist. In which all the production build bundle of your project appears in ...
Once the dist directory is ready with your production built bundles. Just open the dist directory and open the command prompt type the following command to create the war file to deploy your project on apache tomcat server. jar cvf dist.war . Once the above jar commands gets executed. It wou...
Node.js is a Javascript engine (Google's V8 engine for Chrome, written in C++) that allows to run Javascript outside the browser. While numerous libraries are available for extending Node's functionalities, the engine comes with a set of core modules implementing basic functionalities. There's curr...
The TestProducerfrom this example produces Integerobjects in a given range and pushes them to its Subscriber. It extends the Flowable<Integer> class. For a new subscriber, it creates a Subscription object whose request(long) method is used to create and publish the Integer values. It is impor...
math.js 'use strict'; const Promise = require('bluebird'); module.exports = { // example of a callback-only method callbackSum: function(a, b, callback) { if (typeof a !== 'number') return callback(new Error('"a" must be a number')); if (typeof b !== 'number...
We will start with creating a simple node application with a basic structure and then connecting with local sql server database and performing some queries on that database. Step 1: Create a directory/folder by the name of project which you intent to create. Initialize a node application using npm ...

Page 43 of 47