Tutorial by Examples: c

if you want to iterate over numbers in reverse order? It's simple. You can use the downTo() function defined in the standard library for (i in 4 downTo 1) print(i) // prints "4321"
Is it possible to iterate over numbers with arbitrary step, not equal to 1? Sure, the step() function will help you for (i in 1..4 step 2) print(i) // prints "13" for (i in 4 downTo 1 step 2) print(i) // prints "42"
To create a range which does not include its end element, you can use the until function: for (i in 1 until 10) { // i in [1, 10), 10 is excluded println(i) }
By default structures are padded in C. If you want to avoid this behaviour, you have to explicitly request it. Under GCC it's __attribute__((__packed__)). Consider this example on a 64-bit machine: struct foo { char *p; /* 8 bytes */ char c; /* 1 byte */ long x; /* 8 bytes */ ...
This will be a very basic app which will illustrate different ModalpresentationStyle in iOS. According to documentation found here, There are 9 different values for UIModalPresentationStyle which are as follows, fullScreen pageSheet formSheet currentContext custom overFullScreen overCurrent...
When generating new Angular 2 components in a .NET Core project, you may run into the following errors (as of version 0.8.3): Error locating module for declaration SilentError: No module files found OR No app module found. Please add your new Class to your component. Identica...
Like other value types, GUID also has a nullable type which can take null value. Declaration : Guid? myGuidVar = null; This is particularly useful when retrieving data from the data base when there is a possibility that value from a table is NULL.
This is an Example which print rectangle and fill color in the rectangle. https://i.stack.imgur.com/dlC5v.jpg Most methods of the Graphics class can be divided into two basic groups: Draw and fill methods, enabling you to render basic shapes, text, and images Attributes setting methods, whic...
Dim rng As New Random() This declares an instance of the Random class called rng. In this case, the current time at the point where the object is created is used to calculate the seed. This is the most common usage, but has its own problems as we shall see later in the remarks Instead of allowin...
The following example declares a new instance of the Random class and then uses the method .Next to generate the next number in the sequence of pseudo-random numbers. Dim rnd As New Random Dim x As Integer x = rnd.Next The last line above will generate the next pseudo-random number and assign ...
#include <windows.h> static Windows::Foundation::DateTime GetCurrentDateTime() { // Get the current system time SYSTEMTIME st; GetSystemTime(&st); // Convert it to something DateTime will understand FILETIME ft; SystemTimeToFileTime(&st, &ft); ...
Jenkins: The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project. Sonar Qube: SonarQube provides the capability to not only show health of an application but also to highlight issues newly introduced. Apache Ant: A...
A clean way to handle booleans is using an inline conditional with the a ? b : c ternary operator, which is part of Swift's Basic Operations. The inline conditional is made up of 3 components: question ? answerIfTrue : answerIfFalse where question is a boolean that is evaluated and answerIfTrue...
Suppose there is a peak of normally (gaussian) distributed data (mean: 3.0, standard deviation: 0.3) in an exponentially decaying background. This distribution can be fitted with curve_fit within a few steps: 1.) Import the required libraries. 2.) Define the fit function that is to be fitted to th...
The function EventEmitter.eventNames() will return an array containing the names of the events currently subscribed to. const EventEmitter = require("events"); class MyEmitter extends EventEmitter{} var emitter = new MyEmitter(); emitter .on("message", function(){ //list...
Function dotNETCheck Alternatively you can use the function I wrote below. This one makes use of LogicLib.nsh. It should work out-of-the-box without having to know the .NET versions value from the Release key in the registry. As it is written right now it only checks for versions between 4.5–4.7. ...
We can call an action result in another action result. public ActionResult Action1() { ViewData["OutputMessage"] = "Hello World"; return RedirectToAction("Action2","ControllerName"); //this will go to second action; } public ActionResult...
##= # The variable $Bit will hold either 64 or 32 depending on system architecture # This is used with ${Register::DLL} and ${UnRegister::DLL} # Use this in the beginning of your code. # This snippet should only be used once. # Var Bit System::Call "kernel32::GetCurrentProcess()i.s&quot...
##= # The variable $Bit will hold either 64 or 32 depending on system architecture # This is used with ${Register::DLL} and ${UnRegister::DLL} # Use this in the beginning of your code. # This snippet should only be used once. # Var Bit System::Call "kernel32::GetCurrentProcess()i.s&quo...
If You have Role: +-----------------------------+ | roleId | name | discription | +-----------------------------+ Rights: +-----------------------------+ | rightId | name | discription| +-----------------------------+ rightrole +------------------+ | roleId | rightId | +----------...

Page 786 of 826