The C standard says that there is very little difference between the
#include <header.h> and #include "header.h" notations.
[#include <header.h>] searches a sequence of implementation-defined
places for a header identified uniquely by the specified sequence
between the &l...
Setup
First, install the necessary packages with:
npm install express cors mongoose
Code
Then, add dependencies to server.js, create the database schema and the name of the collection, create an Express.js server, and connect to MongoDB:
var express = require('express');
var cors = require('...
This is a basic polymer element that show a list of names.
<link rel="import" href="../bower_components/polymer/polymer.html">
<dom-module id="basic-list">
<template>
<style>
</style>
<div>Name's list</div&g...
You must always unregister scopes other then your current scope as shown below:
//always deregister these
$rootScope.$on(...);
$scope.$parent.$on(...);
You don't have to deregister listners on current scope as angular would take care of it:
//no need to deregister this
$scope.$on(...);
$r...
In your functions.php you can register new sidebars with this code
/**
* Registers sidebars
*
* @param array Array with default or specified array values
* @since 1.0.0
*/
if ( function_exists( 'register_sidebar' ) ) {
register_sidebar( array (
'name' => e...
val and var
scala> val a = 123
a: Int = 123
scala> a = 456
<console>:8: error: reassignment to val
a = 456
scala> var b = 123
b: Int = 123
scala> b = 321
b: Int = 321
val references are unchangeable: like a final variable in Java, once it has been initial...
Let's pick as an example a function that takes 2 Map and return a Map containing every element in ma and mb:
def merge2Maps(ma: Map[String, Int], mb: Map[String, Int]): Map[String, Int]
A first attempt could be iterating through the elements of one of the maps using for ((k, v) <- map) and so...
Lets start with creating our first app
Open visual studio and > create new project
Enter Name and Location
Enter your developer site url created in previous step and select Provider-hosted
Popup will open which will as for login
Next step it will as for type of applicatio...
Create a new controller foreg
ControllerName: "Home",
ActionresultName :"Index"
open AreaRegistraion.cs and add the controller name and action name to be rerouted to
context.MapRoute(
"nameofarea_default",
"nameofarea/{controller}/...
If you have a list in memory already, the straightforward and usually sufficient way to process it is a simple foreach loop:
foreach my $item (@items) {
...
}
This is fine e.g. for the common case of doing some processing on $item and then writing it out to a file without keeping the data ...
Sometimes it is necessary to assert when an exception is thrown. Different unit testing frameworks have different conventions for asserting that an exception was thrown, (like NUnit's Assert.Throws method). This example does not use any framework specific methods, just built in exception handling.
...
Cusom bindings should be registered by extending the current knockout bindingHandlers object.This is done by adding a new property to the object.
ko.bindingHandlers.newBinding = {
init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
},
update: function(e...
add_action( 'init', function() {
register_post_type( 'event', array(
'public' => true,
'label' => 'Events'
);
);
});
Registers a new custom post type with a label Events and a slug event
The ProcessInstanceHistory is the object which is neither searchable nor queryable & this is the read-only object which shows all steps and pending approval requests associated with an approval process (ProcessInstance). But we can use this object to replicate the related list functionality of t...