Tutorial by Examples: app

var express = require('express'); var app = express(); var router = express.Router(); app.route('/user') .get(function (req, res) { res.send('Get a random user') }) .post(function (req, res) { res.send('Add a user') }) .put(function (req, res) { res.send...
Using more than one theme in your Android application, you can add custom colors to every theme, to be like this: First, we have to add our themes to style.xml like this: <style name="OneTheme" parent="Theme.AppCompat.Light.DarkActionBar"> </style> <!--...
The length of line-wrapping when using the l command is implementation defined. From the standard: Long lines shall be folded, with the point of folding indicated by writing a followed by a ; the length at which folding occurs is unspecified, but should be appropriate for the output device. ...
Adding the aurelia-configuration to a cli application sometimes produces a build error. This is caused by a missing dependency so we simply add the dependency to the build bundle. Try the following: npm install deep-extend --save npm install aurelia-configuration --save Now add the followi...
1)In project.json, add below dependencies- "Serilog": "2.2.0", "Serilog.Extensions.Logging": "1.2.0", "Serilog.Sinks.RollingFile": "2.0.0", "Serilog.Sinks.File": "3.0.0" 2)In Startup.cs, add below lines in constru...
The ApplicationData.Current.LocalFolder api allows us to get access to the application cache : var file = await ApplicationData.Current.LocalFolder.CreateFileAsync("myFile.dat", CreationCollisionOption.ReplaceExisting); The FileIO class contains a set of utility methods to easily add d...
To use an in memory cache in your ASP.NET application, add the following dependencies to your project.json file: "Microsoft.Extensions.Caching.Memory": "1.0.0-rc2-final", add the cache service (from Microsoft.Extensions.Caching.Memory) to ConfigureServices method in Startup...
Donald Knuth is often quoted as saying this: "Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered....
For starting tvOS I assume must have knowledge of swift and iOS app. One can start reading article from apple reference document. There are 2 type of Tv app we can create one is traditional app, i.e created in xcode code would be similar as we do in iOS app. Here we take example of other type of t...
amazingservice: url: 'http://amazing.com' client_id: 'test_client_1' client_secret: 'test_secret' This is a basic example for create configuration in yml format, for following the yml format you can take deeper configuration.
Adding a icon to your tray-bar let tray = null; let mainWindow = null; let user = null; app.on('ready', () => { /** * Tray related code. */ const iconName = 'icon.png'; const iconPath = path.join(__dirname, iconName); tray = new Tray(iconPath); tray.setT...
Maybe Maybe is an applicative functor containing a possibly-absent value. instance Applicative Maybe where pure = Just Just f <*> Just x = Just $ f x _ <*> _ = Nothing pure lifts the given value into Maybe by applying Just to it. The (<*>) function applies...
We can statically bootstrap an application by taking the plain ES5 Javascript output of the generated factory classes. Then we can use that output to bootstrap the application: import { platformBrowser } from '@angular/platform-browser'; import { AppModuleNgFactory } from './main.ngfactory'; //...
A crashed web dyno or a boot timeout on the web dyno will present this error. 2010-10-06T21:51:04-07:00 heroku[web.1]: State changed from down to starting 2010-10-06T21:51:07-07:00 app[web.1]: Starting process with command: `bundle exec rails server -p 22020` 2010-10-06T21:51:09-07:00 app[web.1]:...
The official website contain good exemple of apps: https://www.opencpu.org/apps.html The following code is used to serve a R session: library(opencpu) opencpu$start(port = 5936) After this code is executed, you can use URLs to access the functions of the R session. The result could be XML, h...
Suppose we have a SharePoint list and it has four fields viz. Title, Full Name, Email, Mobile Number etc. Now if you want to apply custom validation in New/Edit Item form, you can easily do it with CSR code. The below mentioned can validate following conditions in forms: Blank values in fields ...
app\Exceptions\Handler.php public function render($request, Exception $exception) { if ($exception instanceof ModelNotFoundException) { abort(404); } return parent::render($request, $exception); } You can catch / handle any exception that is thrown in Laravel.
Lets have a look at the native app lifecycle methods for different platforms. Android. //Xamarin.Forms.Platform.Android.FormsApplicationActivity lifecycle methods: protected override void OnCreate(Bundle savedInstanceState); protected override void OnDestroy(); protected override void OnPause()...
The following example shows how to apply custom fonts to a Navigation Bar and includes fixes for some quirky behaviors found in Xcode. One also may apply the custom fonts to any other UIControls such as UILabels, UIButtons, and more by using the attributes inspector after the custom font is added to...
This example demonstrates how to develop a simple UWP application. On creation of a "Blank App (Universal Windows)" project there are many essential files that are created in your solution. All files in your project can be seen in the Solution Explorer. Some of the crucial files in your...

Page 24 of 33