Tutorial by Examples: c

This example just illustrates how this keyword can be used. int a = 10; // Assume that type of variable 'a' is not known here, or it may // be changed by programmer (from int to long long, for example). // Hence we declare another variable, 'b' of the same type using // decltype keyword. de...
program ForLoopWithContinueAndBreaks; {$APPTYPE CONSOLE} var var i : integer; begin for i := 1 to 10 do begin if i = 2 then continue; (* Skip this turn *) if i = 8 then break; (* Break the loop *) WriteLn( i ); end; WriteLn('Finish.'); end. Outpu...
std::lock uses deadlock avoidance algorithms to lock one or more mutexes. If an exception is thrown during a call to lock multiple objects, std::lock unlocks the successfully locked objects before re-throwing the exception. std::lock(_mutex1, _mutex2);
std::async: performs an asynchronous operation. std::future: provides access to the result of an asynchronous operation. std::promise: packages the result of an asynchronous operation. std::packaged_task: bundles a function and the associated promise for its return type.
We will look at a simple dispatch event with the example usage. (ns myapp.events (:require [re-frame.core :refer [reg-event-db]])) ...
One problem with the PIVOT query is that you have to specify all values inside the IN selection if you want to see them as columns. A quick way to circumvent this problem is to create a dynamic IN selection making your PIVOT dynamic. For demonstration we will use a table Books in a Bookstore’s dat...
This sample used to common function for all type object serialization and deserialization. using System.Runtime.Serialization.Formatters.Binary; using System.Xml.Serialization; namespace Framework { public static class IGUtilities { public static string Serialization(this T obj) ...
When a remote session is created via the New-PSsession cmdlet, the PSSession persists until the current PowerShell session ends. Meaning that, by default, the PSSession and all associated resources will continue to be used until the current PowerShell session ends. Multiple active PSSessions can b...
Copy: Sub CopyFile() Dim fso as Scripting.FileSystemObject Set fso = CreateObject("Scripting.FileSystemObject") fso.CopyFile "c:\Documents and Settings\Makro.txt", "c:\Documents and Settings\Macros\" End Sub Move: Sub MoveFile() Dim fso as Scri...
Create: Sub CreateFolder() Dim fso as Scripting.FileSystemObject Set fso = CreateObject("Scripting.FileSystemObject") fso.CreateFolder "c:\Documents and Settings\NewFolder" End Sub Copy: Sub CopyFolder() Dim fso as Scripting.FileSystemObject Set fso...
ChainMap is new in version 3.3 Returns a new ChainMap object given a number of maps. This object groups multiple dicts or other mappings together to create a single, updateable view. ChainMaps are useful managing nested contexts and overlays. An example in the python world is found in the implemen...
The first major distinction is between the dynamically generated directories which will be used for hosting and source directories. The source directories will have a config file or folder depending on the amount of configuration you may have . This includes the environment configuration and busi...
To let RestTemplate understand generic of returned content we need to define result type reference. org.springframework.core.ParameterizedTypeReference has been introduced since 3.2 Wrapper<Model> response = restClient.exchange(url, HttpMethod.GET, ...
F() expressions can be used to execute arithmetic operations (+, -, * etc.) among model fields, in order to define an algebraic lookup/connection between them. Let model be: class MyModel(models.Model): int_1 = models.IntegerField() int_2 = models.IntegerField() Now lets assum...
This example demonstrates the use of GET, POST, PUT and DELETE HTTP Methods in doing CRUD operations on a REST resource I am using the below software, frameworks and tools: Jersey 2.25.1 JDK 1.7.x (Java 7) Eclipse IDE Kepler Apache Maven 3.3.9 Apache Tomcat 7.x Please follow the below ste...
The first standalone R script Standalone R scripts are not executed by the program R (R.exe under Windows), but by a program called Rscript (Rscript.exe), which is included in your R installation by default. To hint at this fact, standalone R scripts start with a special line called Shebang line, ...
As a workaround, you may use the wildfly-specific VFS api and write your own ResourceAcessor implementation, such as this one below. public class WildflyVFSClassLoaderResourceAccessor extends AbstractResourceAccessor { private ClassLoader classLoader; public WildflyVFSClassLoaderResou...
In a terminal run brew install maven Once the install is over check that maven works correctly with mvn -v. The output should look something like: Apache Maven 3.3.9 Maven home: /usr/local/Cellar/maven/3.3.9/libexec Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /Library/Ja...
As mentioned in another example a subset of the elements of an array, called an array section, may be referenced. From that example we may have real x(10) x(:) = 0. x(2:6) = 1. x(3:4) = [3., 5.] Array sections may be more general than this, though. They may take the form of subscript trip...
Given I have entered <FirstOperand> into the calculator And I have also entered <SecondOperand> into the calculator When I press add Then the result should be <Result> on the screen |FirstOperand|SecondOperand|Result| |20 |30 |50 |...

Page 772 of 826