Tutorial by Examples: ti

First, we need a custom endpoint builder. public class WSConfigurator extends ServerEndpointConfig.Configurator { @Inject private static Injector injector; @Override public <T> T getEndpointInstance(Class<T> endpointClass) throws InstantiationException { ...
It is common practice to use higher order functions instead of recursion, if there is a higher order function which expresses the right recursion pattern. In our case, sum-of-numbers can be defined using foldl: #lang racket (define (sum-of-numbers l) (foldl + 0 l)) (sum-of-numbers '(1 2 3 4 5)...
To update multiple documents in a collection, set the multi option to true. db.collection.update( query, update, { upsert: boolean, multi: boolean, writeConcern: document } ) multi is optional. If set to true, updates multiple documents that meet the query crit...
Auditing is an Alfresco feature that allows the user to trace and log some specific events during ECM platform usage. Enable auditing To enable auditing you have to add some lines of configuration to the alfresco-global.properties file, which resides in tomcat/shared/classes/ audit.enabled = true...
Consider a one to one bidirectional relationship between employee and desk. Employee.java @Entity public class Employee { @TableGenerator(name = "employee_gen", table = "id_gen", pkColumnName = "gen_name", valueColumnName = "gen_val", allocationSize...
const r = require("rethinkdb"); r.connect({host: 'localhost', port: 28015}, (conn) => console.log(conn)) // Or as a promise let rdb_conn; r.connect({host: 'localhost', port: 28015}).then((conn) => { rdb_conn = conn; }).then(() => { // Continue to use rdb_conn }); ...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.dbList().run(conn); }).then((result) => { // Prints out list of databases on the RethinkDB instance console.log(result); });
r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.db("stackoverflow").table("examples") .insert({ // If `id` is not set, will automatically generate a UUID id: 1, name: 'Thinker', // Wi...
A quick read of most developer sites will reveal that WinForms is considered inferior to WPF. One of the most often cited reasons is the supposed difficulty in making application wide changes to the "look-and-feel" of an entire application. In fact it is surprisingly easy to produce an a...
import pygame background_colour = (255,255,255) # For the background color of your window (width, height) = (300, 200) # Dimension of the window screen = pygame.display.set_mode((width, height)) # Making of the screen pygame.display.set_caption('Tutorial 1') # Name for the window screen.fil...
To make an app more cohesive, we often need to keep user's personal settings and preferences consistent across multiple devices that have been logged in with one Microsoft account. In this sample, we use roaming data to store and to load UI settings, game process and user info. But the roaming data ...
A build is also available on npmcdn. You can include the script like this: <script src="https://npmcdn.com/react-router/umd/ReactRouter.min.js"></script> The library will be available globally on window.ReactRouter.
How to implement FirebaseRealTime database in android application. Following is the steps for do it. First install firebase sdk, If you dont know how to install then following is the URL for help. Install Firebase SDK After thet register your project in firbase console, URL of the firbas...
By using the Grid.RowSpan and Grid.ColumnSpan attached properties, children of a Grid can span multiple rows or columns. In the following example the second TextBlock will span the second and third column of the Grid. <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/&...
The row heigths or column widths of multiple Grids can be synchronized by setting a common SharedSizeGroup on the rows or columns to synchronize. Then a parent control somewhere up in the tree above the Grids needs to have the attached property Grid.IsSharedSizeScope set to True. <StackPanel Gri...
Angular's builtin $http service allows us to send HTTP requests. Oftentime, the need arise to do things before or after a request, for example adding to each request an authentication token or creating a generic error handling logic.
A letter with a diacritic may be represented with the letter, and a combining modifier letter. You normally think of é as one character, but it's really 2 code points: U+0065 — LATIN SMALL LETTER E U+0301 — COMBINING ACUTE ACCENT Similarly ç = c + ¸, and å = a + ˚ combined forms To compl...
public ActionResult PopulateFoods() { IEnumerable<Food> foodList = GetAll(); // Renders a partial view, which defines a section of a view that can be rendered inside another view. return PartialView("_foodTable", foodVms);; } Action methods typically retur...
If the built in attributes are not sufficient to validate your model data, then you can place your validation logic in a class derived from ValidationAttribute. In this example only odd numbers are valid values for a model member. Custom Validation Attribute public class OddNumberAttribute : Valid...
For using Attribute Routing in areas, registering areas and [RouteArea(...)] definitions are required. In RouteConfig.cs : public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ...

Page 332 of 505