Tutorial by Examples: c

ACCEPT variable. ACCEPT variable FROM CONSOLE. ACCEPT variable FROM ENVIRONMENT "path". ACCEPT variable FROM COMMAND-LINE. ACCEPT variable FROM ARGUMENT-NUMBER ACCEPT variable FROM ARGUMENT-VALUE ACCEPT variable AT 0101. ACCEPT screen-variable. ACCEPT today FROM DATE. ACCE...
NIO appeared in Java 1.4 and introduced the concept of "Channels", which are supposed to be faster than regular I/O. Network-wise, the SelectableChannel is the most interesting as it allows to monitor different states of the Channel. It works in a similar manner as the C select() system ca...
It is very common to get a StackOverflowError error while calling recursive function. Scala standard library offers TailCall to avoid stack overflow by using heap objects and continuations to store the local state of the recursion. Two examples from the scaladoc of TailCalls import scala.util.cont...
C# allows using pointer variables in a function of code block when it is marked by the unsafe modifier. The unsafe code or the unmanaged code is a code block that uses a pointer variable. A pointer is a variable whose value is the address of another variable i.e., the direct address of the memory l...
In C#, an array name and a pointer to a data type same as the array data, are not the same variable type. For example, int *p and int[] p, are not same type. You can increment the pointer variable p because it is not fixed in memory but an array address is fixed in memory, and you can't increment th...
For compiling unsafe code, you have to specify the /unsafe command-line switch with command-line compiler. For example, to compile a program named prog1.cs containing unsafe code, from command line, give the command: csc /unsafe prog1.cs If you are using Visual Studio IDE then you need to enabl...
$ gzip extremelylargefile.txt & $ bg $ disown %1 This allows a long running process to continue once your shell (terminal, ssh, etc) is closed.
Simple single port RAM with async read/write operations module ram_single_port_ar_aw #( parameter DATA_WIDTH = 8, parameter ADDR_WITDH = 3 )( input we, // write enable input oe, // output enable input [(ADDR_WITDH-1):0] waddr, // ...
a Character evaluates to true if it's value is not zero, false if zero assert ! new Character((char)0) assert ! new Character('\u0000Hello Zero Char'.charAt(0)) assert new Character('Hello'.charAt(0))
a Matcher evaluates to true if it can find at least one match, false if no match is found // a match is found => true assert 'foo' =~ /[a-z]/ // the regexp does not match fully => no match => false assert !( 'foo' ==~ /[a-z]/ ) // a match is found => true assert 'foo' =~ /o/ // no...
The evaluation of a closure is the evaluation of the result of the closure. All rules applies : if the closure returns a null , zero number or empty String, Collection, Map or Array it evaluates to false otherwise to true. // Closure return non zero number => true assert { 42 }() // closure ...
There are frequent behavior patterns that can result in a lot of boilerplate code. By declaring a method that takes a Closure as a parameter, you can simplify your program. As an example, it is a common pattern to retrieve a database connection, start a transaction, do work, and then either commit ...
app.ts import {Component} from '@angular/core'; import {Platform, ionicBootstrap} from 'ionic-angular'; import {StatusBar} from 'ionic-native'; import {LoginPage} from './pages/login/login'; import {FIREBASE_PROVIDERS, defaultFirebase, AuthMethods, AuthProviders, firebaseAuthConfig} from 'angul...
It is (almost always) a bad idea to call System.gc(). The javadoc for the gc() method specifies the following: "Calling the gc method suggests that the Java Virtual Machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick re...
The Path class is used to programmaticaly represent a path in the file system (and can therefore point to files as well as directories, even to non-existent ones) A path can be obtained using the helper class Paths: Path p1 = Paths.get("/var/www"); Path p2 = Paths.get(URI.create("f...
The object-fit property will defines how an element will fit into a box with an established height and width. Usually applied to an image or video, Object-fit accepts the following five values: FILL object-fit:fill; Fill stretches the image to fit the content box without regard to the image...
Elm defines the following special type variables that have a particular meaning to the compiler: comparable: Comprised of Int, Float, Char, String and tuples thereof. This allows the use of the < and > operators. Example: You could define a function to find the smallest and largest eleme...
Open Computing Language (OpenCL) is a framework for writing programs that execute on CPUs, GPUs, and other parallel processors and accelerators. OpenCL specifies a programming language (based on C) that provides access to named on-chip memory, a model for executing tasks in parallel, and the abilit...
Renaming a column can be done in a single statement but as well as the new name, the "column definition" (i.e. its data type and other optional properties such as nullability, auto incrementing etc.) must also be specified. ALTER TABLE `<table name>` CHANGE `<old name>` `<n...
MERGE INTO targetTable t USING sourceTable s ON t.PKID = s.PKID WHEN MATCHED AND NOT EXISTS ( SELECT s.ColumnA, s.ColumnB, s.ColumnC INTERSECT SELECT t.ColumnA, t.ColumnB, s.ColumnC ) THEN UPDATE SET t.Colum...

Page 476 of 826