Tutorial by Examples: c

C++14 C++14 introduced a standard way of deprecating functions via attributes. [[deprecated]] can be used to indicate that a function is deprecated. [[deprecated("reason")]] allows adding a specific reason which can be shown by the compiler. void function(std::unique_ptr<A> &&a...
Thread-local storage can be created using the thread_local keyword. A variable declared with the thread_local specifier is said to have thread storage duration. Each thread in a program has its own copy of each thread-local variable. A thread-local variable with function (local) scope will be in...
Cross-site request forgery, also known as one-click attack or session riding and abbreviated as CSRF or XSRF, is a type of malicious exploit of a website where unauthorized commands are transmitted from a user that the website trusts. Learn more To enable CSRF protection, add the CsrfViewMid...
First, add the HTML File to your Project (If you are asked to choose options for adding the file, select Copy items if needed) The following line of code loads the content of the HTML file into the webView webView.loadRequest(NSURLRequest(URL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForRe...
Members of objects or classes can be accessed using the object operator (->) and the class operator (::). class MyClass { public $a = 1; public static $b = 2; const C = 3; public function d() { return 4; } public static function e() { return 5; } } $object = new MyCl...
The hash package offers a hash structure in R. However, it terms of timing for both inserts and reads it compares unfavorably to using environments as a hash. This documentation simply acknowledges its existence and provides sample timing code below for the above stated reasons. There is no ident...
Although package:listenv implements a list-like interface to environments, its performance relative to environments for hash-like purposes is poor on hash retrieval. However, if the indexes are numeric, it can be quite fast on retrieval. However, they have other advantages, e.g. compatibility with ...
$params = @{ Uri = "https://your.hipchat.com/v2/room/934419/notification?auth_token=???" Method = "POST" Body = @{ color = 'yellow' message = "This is a test message!" notify = $false message_format = "text" ...
#include <iostream> #include <string> int main() { const char * C_String = "This is a line of text w"; const char * C_Problem_String = "This is a line of text ኚ"; std::string Std_String("This is a second line of text w"); std::string...
display: inline-block; The display property with the value of inline-block is not supported by Internet Explorer 6 and 7. A work-around for this is: zoom: 1; *display: inline; The zoom property triggers the hasLayout feature of elements, and it is available only in Internet Explorer. The *di...
C99 Since C99 the C library has a set of safe conversion functions that interpret a string as a number. Their names are of the form strtoX, where X is one of l, ul, d, etc to determine the target type of the conversion double strtod(char const* p, char** endptr); long double strtold(char const* p...
Here is a very simple example to illustrate how to write a NIF. Directory structure: nif_test ├── c_src │   ├── Makefile │   └── nif_test.c ├── rebar.config └── src ├── nif_test.app.src └── nif_test.erl This structure can be easily initialized using Rebar3: $ rebar3 new lib nif_...
Official documentation: http://erlang.org/doc/man/erl_nif.html The most important structs, types and macros of the Erlang C API are the following: ERL_NIF_TERM: the type for Erlang terms. This is the return type that NIF functions must follow. ERL_NIF_INIT(MODULE, ErlNifFunc funcs[], load, relo...
var client = new AmazonDynamoDBClient(); Table booksTable = Table.LoadTable(client, "Books"); // Store item Document book = new Document(); book["Title"] = "Cryptonomicon"; book["Id"] = 42; book["Authors"] = new List<string> { "Ne...
This example consists of two parts: first, we must define our Book type; second, we use it with DynamoDBContext. [DynamoDBTable("Books")] class Book { [DynamoDBHashKey] public int Id { get; set; } public string Title { get; set; } public List<string> Authors { ...
The Collections class allows for you to move objects around in the list using various methods (ls is the List): Reversing a list: Collections.reverse(ls); Rotating positions of elements in a list The rotate method requires an integer argument. This is how many spots to move it along the line b...
Comparator.comparing(Person::getName) This creates a comparator for the class Person that uses this person name as the comparison source. Also it is possible to use method version to compare long, int and double. For example: Comparator.comparingInt(Person::getAge) Reversed order To create ...
Suppose we have a component which will hide at a certain window width. import { Component } from '@angular/core'; @Component({ ... template: ` <div> <p [hidden]="!visible" (window:resize)="onResize($event)" >Now you see me...</p> &lt...
Starting with Java 8, you can use lambda expressions & predicates. Example: Use a lambda expressions & a predicate to get a certain value from a list. In this example every person will be printed out with the fact if they are 18 and older or not. Person Class: public class Person { p...
An anonymous inner class is a form of inner class that is declared and instantiated with a single statement. As a consequence, there is no name for the class that can be used elsewhere in the program; i.e. it is anonymous. Anonymous classes are typically used in situations where you need to be abl...

Page 453 of 826