Tutorial by Examples

Let's say we have the following function: (defn nat-num-count [nums] (count (remove neg? nums))) We can write a spec for this function by defining a function spec of the same name: (clojure.spec/fdef nat-num-count :args (s/cat :nums (s/coll-of number?)) :ret integer? ...
Meteor has it's own package repository on atmospherejs.com You can add new packages from atmosphere by running: meteor add [package-author-name:package-name] For example: meteor add kadira:flow-router Similarly, you can remove the same package by: meteor remove kadira:flow-router To see...
Hibernate can use two types of fetch when you are mapping the relationship between two entities: EAGER and LAZY. In general, the EAGER fetch type is not a good idea, because it tells JPA to always fetch the data, even when this data is not necessary. Per example, if you have a Person entity and th...
While there are many parameters that can be changed and variations that can be added depending on the desired functionality, this example lays out the basic framework for launching PowerPoint. Note: This code requires that the PowerPoint reference has been added to the active VBA Project. See th...
$ man -w find /usr/share/man/man1/find.1.gz $ man -w printf /usr/share/man/man1/printf.1.gz $ man -w man /usr/share/man/man1/man.1.gz
Content has been moved back to the good 'ol JSF wiki page
Suppose we have an interface: interface IPerson { name: string; age: number; breath(): void; } And we want to create more specific interface that has the same properties of the person, we can do it using the extends keyword: interface IManager extends IPerson { managerId:...
The ng-show directive shows or hides the HTML element based on if the expression passed to it is true or false. If the value of the expression is falsy then it will hide. If it is truthy then it will show. The ng-hide directive is similar. However, if the value is falsy it will show the HTML elemen...
Install jquery via npm : npm install jquery --save Install typings for the library: To add typings for a library, do the following: typings install jquery --global --save Add jquery to angular-cli-build.js file to vendorNpmFiles array: This is required so the build system...
The most common way to test Angular 2 apps is with the Jasmine test framework. Jasmine allows you to test your code in the browser. Install To get started, all you need is the jasmine-core package (not jasmine). npm install jasmine-core --save-dev --save-exact Verify To verify that Jasmine is...
You can search for man pages containing a particular string in their description using: man -k <string> For example: man -k unzip Might return: man -k unzip IO::Uncompress::Bunzip2(3pm) - Read bzip2 files/buffers IO::Uncompress::Gunzip(3pm) - Read RFC 1952 files/buffers IO::Uncom...
The following terms describe different ways to case identifiers. Pascal Casing The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized. You can use Pascal case for identifiers of three or more characters. For example: BackColor Camel Casing Th...
Use a signal's connect method to connect a function to a signal. When a signal is sent, each connected function is called with the sender and any named arguments the signal provides. from flask import template_rendered def log_template(sender, template, context, **kwargs): sender.logger.in...
An example XML file <Sample> <Account> <One number="12"/> <Two number="14"/> </Account> <Account> <One number="14"/> <Two number="16"/> </Account&gt...
The default Angular router allows navigation to and from any route unconditionally. This is not always the desired behavior. In a scenario where a user may conditionally be allowed to navigate to or from a route, a Route Guard may be used to restrict this behavior. If your scenario fits one of the...
File app.routes Protected routes have canActivate binded to Guard import { provideRouter, Router, RouterConfig, CanActivate } from '@angular/router'; //components import { LoginComponent } from './login/login.component'; import { DashboardComponent } from './dashboard/dashboard.component'; ...
File main.ts (or boot.ts) Consider the examples above: Create the guard (where the Guard is created) and Add guard to route configuration, (where the Guard is configured for route, then APP_ROUTER_PROVIDERS is exported), we can couple the bootstrap to Guard as follows import { bootstrap }...
You can use the ** keyword argument unpacking operator to deliver the key-value pairs in a dictionary into a function's arguments. A simplified example from the official documentation: >>> >>> def parrot(voltage, state, action): ... print("This parrot wouldn't", ac...
Consider the following dictionaries: >>> fish = {'name': "Nemo", 'hands': "fins", 'special': "gills"} >>> dog = {'name': "Clifford", 'hands': "paws", 'color': "red"} Python 3.5+ >>> fishdog = {**fish, **dog}...
Create an interface decorated with a ServiceContract attribute and member functions decorated with the OperationContract attribute. namespace Service { [ServiceContract] interface IExample { [OperationContract] string Echo(string s); } } Create a concrete...

Page 287 of 1336