Tutorial by Examples

In the following, weight is declared as a mutable field. type person = { name: string; mutable weight: int };; Remark: As far as design is concerned here, one would consider the fact that a person's name isn't likely to change, but their weight is.
Initializing a record with mutable fields isn't different from a regular record initialization. let john = { name = "John"; weight = 115 };;
To assign a new value to a mutable record field, use the <- operator. john.weight <- 120;; Note: The previous expression has a unit type.
You can use BETWEEN clause to replace a combination of "greater than equal AND less than equal" conditions. Data +----+-----------+ | id | username | +----+-----------+ | 1 | admin | | 2 | root | | 3 | toor | | 4 | mysql | | 5 | thanks | | 6 | java ...
Generally tf.gather gives you access to elements in the first dimension of a tensor (e.g. rows 1, 3 and 7 in a 2-dimensional Tensor). If you need access to any other dimension than the first one, or if you don't need the whole slice, but e.g. only the 5th entry in the 1st, 3rd and 7th row, you are b...
Starting with version 2.7 ElementTree has a better support for XPath queries. XPath is a syntax to enable you to navigate through an xml like SQL is used to search through a database. Both find and findall functions support XPath. The xml below will be used for this example <Catalog> &l...
Build the documentation for existent doc source with specified source doc directory and where to be built like following: sphinx-build -b html source build
On the machine where you'd like to make the backup, jump to the Redis CLI: redis-cli Password? If your master Redis DB (the one you want to replicate) has a password: config set masterauth <password> Start replication Run the following to begin replication: SLAVEOF <host> <...
/* creates a database for Alfresco, on SQLServer 2008- 2014 */ use master; GO CREATE DATABASE alfresco; GO /* creates a new LOGIN and associated User use alfresco; GO CREATE LOGIN alfresco WITH PASSWORD = 'alfresco'; GO use alfresco; go CREATE USER alfresco FOR LOGIN alfresco; GO ...
This example is used in specifying options that might not be included in a database of available housing and its attendant amenities. It builds on the previous example, with some differences: Two procedures are no longer necessary for a single combo box, done by combining the code into a single ...
A simple way to catch unhandled errors (exceptions) in a VFP application is to use the ON ERROR command near the beginning of your main program. The following ON ERROR command calls a method in the current program called "errorHandler". The values returned by ERROR (the VFP Error Number),...
The Java Cryptography Extension (JCE) is a framework built into the JVM to allow developers to easily and securely use cryptography in their programs. It does this by providing a simple, portable interface to programmers, while using a system of JCE Providers to securely implement the underlying cry...
While the JCE secures cryptographic operations and key generation, it is up to the developer to actually manage their keys. More information needs to be provided here. One commonly-accepted best practice for handling keys at runtime is to store them only as byte arrays, and never as strings. This i...
Needs content For most applications, the java.utils.Random class is a perfectly fine source of "random" data. If you need to choose a random element from an array, or generate a random string, or create a temporary "unique" identifier, you should probably use Random. However, m...
More information needed. A cryptographic hash function is a member of a class of functions with three vital properties; consistency, uniqueness, and irreversibility. Consistency: Given the same data, a hash function will always return the same value. That is, if X = Y, f(x) will always equal f(y) ...
navigator.mediaDevices is the common method adapted in Chrome and FF to getUserMedia as of now. A promised based call back which returns local stream on success navigator.mediaDevices.getUserMedia({ audio: true, video: true }) .then(stream => { // attach this stream to window obje...
GTKWave is a fully feature graphical viewing package that supports several graphical data storage standards, but it also happens to support VCD, which is the format that vvp will output. So, to pick up GTKWave, you have a couple options Goto http://gtkwave.sourceforge.net/gtkwave.zip and downloa...
This example uses Icarus and GTKWave. Installation instructions for those tools on OSx are provided elsewhere on this page. Lets begin with the module design. This module is a BCD to 7 segment display. I have coded the design in an obtuse way simply to give us something that is easily broken and...

Page 1178 of 1336