Tutorial by Examples

fn main() { // Statically allocated string slice let hello = "Hello world"; // This is equivalent to the previous one let hello_again: &'static str = "Hello world"; // An empty String let mut string = String::new(); // An empty String ...
Let's say we have an interface for logging: interface Logger { function log($message); } Now say we have two concrete implementations of the Logger interface: the FileLogger and the ConsoleLogger. class FileLogger implements Logger { public function log($message) { // Append...
Generate a certificate In order to run a HTTPS server, a certificate is necessary. Generating a self-signed certificate with openssl is done by executing this command: openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout key.pem -out cert.pem -subj "/CN=example.com" -days 3650` T...
Arrays are available in most programming languages, often using square [] or round () brackets to access the elements, e.g. Carray[6] or VBarray(6).
foo.h #ifndef FOO_DOT_H /* This is an "include guard" */ #define FOO_DOT_H /* prevents the file from being included twice. */ /* Including a header file twice causes all kinds */ /* of interesting problems.*/ /** * This is a functi...
Use of global variables is generally discouraged. It makes your program more difficult to understand, and harder to debug. But sometimes using a global variable is acceptable. global.h #ifndef GLOBAL_DOT_H /* This is an "include guard" */ #define GLOBAL_DOT_H /** * This tells ...
Basic usage: PropertyInfo prop = myInstance.GetType().GetProperty("myProperty"); // get the value myInstance.myProperty object value = prop.GetValue(myInstance); int newValue = 1; // set the value myInstance.myProperty to newValue prop.setValue(myInstance, newValue); Setting rea...
SQLiteOpenHelper is a helper class to manage database creation and version management. In this class, the onUpgrade() method is responsible for upgrading the database when you make changes to the schema. It is called when the database file already exists, but its version is lower than the one spec...

SUM

Sum function sum the value of all the rows in the group. If the group by clause is omitted then sums all the rows. select sum(salary) TotalSalary from employees; TotalSalary2500 select DepartmentId, sum(salary) TotalSalary from employees group by DepartmentId; DepartmentIdTotalSalary12000...
While static constructors are always called before the first usage of a type it's sometimes useful to be able to force them to be called and the RuntimeHelpers class provide an helper for it: using System.Runtime.CompilerServices; // ... RuntimeHelpers.RunClassConstructor(typeof(Foo).TypeHand...
To prepare your web site or web application to use Kendo UI, simply add the style and script files in the <head> section of your page. CDN services are provided for the minified versions of official Kendo UI releases, for both HTTP and HTTPS protocols. JQuery is also required to use Kendo UI...
What is a Singleton Class? A singleton class returns the same instance no matter how many times an application requests it. Unlike a regular class, A singleton object provides a global point of access to the resources of its class. When to Use Singleton Classes? Singletons are used in situations ...
This example use the default boxplot() function and the irisdata frame. > head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4 0.2 setosa 3 4.7 3.2 ...
First install Mono by going through the install instructions for the platform of your choice as described in their installation section. Mono is available for Mac OS X, Windows and Linux. After installation is done, create a text file, name it HelloWorld.cs and copy the following content into it: ...
ALTER TABLE Employees DROP CONSTRAINT DefaultSalary This Drops a constraint called DefaultSalary from the employees table definition. Note:- Ensure that constraints of the column are dropped before dropping a column.
ALTER TABLE Employees ADD CONSTRAINT DefaultSalary DEFAULT ((100)) FOR [Salary] This adds a constraint called DefaultSalary which specifies a default of 100 for the Salary column. A constraint can be added at the table level. Types of constraints Primary Key - prevents a duplicate record in...
A common pattern in C, to easily imitate returning multiple values from a function, is to use pointers. #include <stdio.h> void Get( int* c , double* d ) { *c = 72; *d = 175.0; } int main(void) { int a = 0; double b = 0.0; Get( &a , &b ); pr...
The Clojure community puts a large emphasis on interactive development, so quite a lot of interaction with Clojure happens within a REPL (read-eval-print-loop). When you input an expression into it, Clojure reads it, evaluates it, and prints the result of the evaluation, all in a loop. You should b...
Multiple inheritance is a feature that allows one class to inherit from multiple classes(i.e., more than one parent). Ruby does not support multiple inheritance. It only supports single-inheritance (i.e. class can have only one parent), but you can use composition to build more complex classes using...
Executable File Download the .exe from http://dev.sitecore.net/ and double-click to start. This .exe will do everything for you - attach databases, modify host file, and set folder permissions. The only downside is that it leaves an entry in the registry under [HKEY_LOCAL_MACHINE\SOFTWARE\Sitecore...

Page 122 of 1336