Tutorial by Examples: st

user.model.js var mongoose = require('mongoose') const UserSchema = new mongoose.Schema({ name: String }) const User = mongoose.model('User', UserSchema) module.exports = User; user.routes.js var express = require('express'); var router = express.Router(); var UserController...
If the promise doesn't return anything, the async task can be completed using await. try{ await User.findByIdAndUpdate(user._id, { $push: { tokens: token } }).exec() }catch(e){ handleError(e) }
Valgrind is GPLv2-licensed collection of dynamic analysis tools, which uses binary instrumentation (dynamic recompilation). Six tools are included to detect memory management (Memcheck) and threading errors (Helgrind and DRD), to generate call-graph and profile programs (with optional cache and bran...
val re = """\((.*?)\)""".r val str = "(The)(example)(of)(repeating)(pattern)(in)(a)(single)(string)(I)(had)(some)(trouble)(with)(once)" re.findAllMatchIn(str).map(_.group(1)).toList res2: List[String] = List(The, example, of, repeating, pattern, in, a, ...
class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var firstTabNavigationController : UINavigationController! var secondTabNavigationControoller : UINavigationController! var thirdTabNavigationController : UINavigationController! var fourth...
The most simple way to create this is to use Alamofire and its UIImageViewExtension. What we need is a tableview with a cell that has an imageView in it and lets call it imageView. In the cellForRowAt: function of the tableView we would download the image and set in the following way: let url = UR...
Sometimes the download takes longer than the cell is being displayed. In this case it can happen, that the downloaded image is shown in the wrong cell. To fix this we can not use the UIImageView Extension. We still will be using Alamofire however we will use the completion handler to display the im...
var assert = require('assert'); describe('String', function() { describe('#split', function() { it('should return an array', function() { assert(Array.isArray('a,b,c'.split(','))) }); }); });
Let's first brush up with what are the Instance Variables: They behave more like properties for an object. They are initialized on an object creation. Instance variables are accessible through instance methods. Per Object has per instance variables. Instance Variables are not shared between object...
Creating an Snackbar without the need pass view to Snackbar, all layout create in android in android.R.id.content. public class CustomSnackBar { public static final int STATE_ERROR = 0; public static final int STATE_WARNING = 1; public static final int STATE_SUCCESS = 2; publi...
Detailed instructions on getting graph set up or installed.
Numerous packages are created specifically to access some databases. Using them can save a bunch of time on reading/formating the data. Eurostat Even though eurostat package has a function search_eurostat(), it does not find all the relevant datasets available. This, it's more convenient to brow...
Human Mortality Database Human Mortality Database is a project of the Max Planck Institute for Demographic Research that gathers and pre-process human mortality data for those countries, where more or less reliable statistics is available. # load required packages library(tidyverse) library(ext...
Detailed instructions on getting odoo-10 set up or installed.
Detailed instructions on getting url set up or installed.
Detailed instructions on getting user-interface set up or installed.
This is a good step by step guide for setting up asp net Identity and Identity server for authorization and authentication. https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity You can also follow the official docs examples and IdentityServer4 quickstart samples on Github ...
Detailed instructions on getting es6-promise set up or installed.
Detailed instructions on getting office-interop set up or installed.
using (SPSite site = new SPSite("http://server/sites/siteCollection")) using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["Some list"]; // It is always better and faster to query list items with GetItems method with // empty SPQuery object than to use...

Page 363 of 369