Tutorial by Examples: c

Similar to enabling all HTTP content, all configuration happens under the App Transport Security Settings. Add the Exception Domains dictionary (NSExceptionDomains) to the top level ATS settings. For every domain, add a dictionary item to the Exception Domains, where the key is the domain in questi...
The time for Scheduler Tasks are measured in Ticks. Under normal conditions, there are 20 ticks per second. Tasks scheduled with .scheduleSyncRepeatingTask will be run on the Main Thread Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() { @Override public void run(...
One can initialize a Julia array by hand, using the square-brackets syntax: julia> x = [1, 2, 3] 3-element Array{Int64,1}: 1 2 3 The first line after the command shows the size of the array you created. It also shows the type of its elements and its dimensionality (int this case Int64 ...
It may become necessary to traverse the elements of a series or the rows of a dataframe in a way that the next element or next row is dependent on the previously selected element or row. This is called path dependency. Consider the following time series s with irregular frequency. #starting pytho...
If you have multiple libraries in the same solution, you can add local (project) references between them: { "dependencies": { "NETStandard.Library": "1.6.0", "MyOtherLibrary": { "target": "project" } }...
function test($x) { return $x; } $server = new SoapServer(null, array('uri' => "http://test-uri/")); $server->addFunction("test"); $server->handle();
The summation 1/1 + 1/2 + 1/3 + 1/4 + ... + 1/n is equal to the nth harmonic number, denoted Hn. The nth harmonic number obeys the inequalities ln (n + 1) ≤ Hn ≤ (ln n) + 1 and therefore Hn = Θ(log n). The harmonic numbers often arise in the analysis of algorithms, with randomized quicks...
The summation 1/1 + 1/4 + 1/9 + 1/16 + ... out to infinity converges to π2 / 6, and therefore any summation of the form 1/1 + 1/4 + 1/9 + 1/16 + ... + 1/n2 is Θ(1).
Create an empty directory somewhere ... mkdir HelloWorld cd HelloWorld Then use the built in scaffolding technology to create a Hello World sample dotnet new console -o This command creates two files: HelloWorld.csproj describes the project dependencies, settings, and Target Framework ...
You can add hours, minutes, seconds and nanoseconds: LocalTime time = LocalTime.now(); LocalTime addHours = time.plusHours(5); // Add 5 hours LocaLTime addMinutes = time.plusMinutes(15) // Add 15 minutes LocalTime addSeconds = time.plusSeconds(30) // Add 30 seconds LocalTime addNanoseconds = ti...
This basic example shows how an application can instantiate a classloader and use it to dynamically load a class. URL[] urls = new URL[] {new URL("file:/home/me/extras.jar")}; Classloader loader = new URLClassLoader(urls); Class<?> myObjectClass = loader.findClass("com.exampl...
If two pointers are compared using <, >, <=, or >=, the result is unspecified in the following cases: The pointers point into different arrays. (A non-array object is considered an array of size 1.) int x; int y; const bool b1 = &x < &y; // unspecified int ...
If the underlying type is not explicitly specified for an unscoped enumeration type, it is determined in an implementation-defined manner. enum E { RED, GREEN, BLUE, }; using T = std::underlying_type<E>::type; // implementation-defined However, the standard does require th...
A reference is not an object, and unlike an object, it is not guaranteed to occupy some contiguous bytes of memory. The standard leaves it unspecified whether a reference requires any storage at all. A number of features of the language conspire to make it impossible to portably examine any storage ...
This example combines multiple variants of MonoBehaviour singletons found on the internet into one and let you change its behavior depending on global static fields. This example was tested using Unity 5. To use this singleton, all you need to do is extend it as follows: public class MySingleton ...
If a function has multiple arguments, it is unspecified what order they are evaluated in. The following code could print x = 1, y = 2 or x = 2, y = 1 but it is unspecified which. int f(int x, int y) { printf("x = %d, y = %d\n", x, y); } int get_val() { static int x = 0; r...
C++11 All standard library containers are left in a valid but unspecified state after being moved from. For example, in the following code, v2 will contain {1, 2, 3, 4} after the move, but v1 is not guaranteed to be empty. int main() { std::vector<int> v1{1, 2, 3, 4}; std::vector&l...
To use additional packages within the Rcpp ecosystem, the correct header file may not be Rcpp.h but Rcpp<PACKAGE>.h (as e.g. for RcppArmadillo). It typically needs to be imported and then the dependency is stated within // [[Rcpp::depends(Rcpp<PACKAGE>)]] Examples: // Use the RcppAr...
Most printable characters can be included in string or regular expression literals just as they are, e.g. var str = "ポケモン"; // a valid string var regExp = /[Α-Ωα-ω]/; // matches any Greek letter without diacritics In order to add arbitrary characters to a string or regular expression,...

Page 469 of 826