Tutorial by Examples: du

The Windows API is provided by means of a C-callable interface. Success or failure of an API call is reported strictly through return values. Exceptions aren't part of the documented contract (although some API implementations can raise SEH exceptions, e.g. when passing a read-only lpCommandLine arg...
Setting up settings.py from django.utils.translation import ugettext_lazy as _ USE_I18N = True # Enable Internationalization LANGUAGE_CODE = 'en' # Language in which original texts are written LANGUAGES = [ # Available languages ('en', _("English")), ('de', _("Germ...
#Post to pagerduty.com notification pagerduty { post = https://events.pagerduty.com/generic/2010-04-15/create_event.json contentType = application/json runOnActions = false body = `{ "service_key": "myservicekey", "incident_key": {{.|jso...
Removing duplicate values in a list can be done by converting the list to a set (that is an unordered collection of distinct objects). If a list data structure is needed, then the set can be converted back to a list using the function list(): names = ["aixk", "duke", "edik&...
Variables don't necessarily have to expand to their values - substrings can be extracted during expansion, which can be useful for extracting file extensions or parts of paths. Globbing characters keep their usual meanings, so .* refers to a literal dot, followed by any sequence of characters; it's ...
Simple Dual Port RAM with separate addresses and clocks for read/write operations. module simple_ram_dual_clock #( parameter DATA_WIDTH=8, //width of data bus parameter ADDR_WIDTH=8 //width of addresses buses )( input [DATA_WIDTH-1:0] data, //da...
ClientContext clientContext = new ClientContext(siteUrl); Web oWebsite = clientContext.Web; ListCreationInformation listCreationInfo = new ListCreationInformation(); listCreationInfo.Title = "My Announcements List"; listCreationInfo.TemplateType = (int)ListTemplateType.Announcements;...
You can give alias names to a struct: typedef struct Person { char name[32]; int age; } Person; Person person; Compared to the traditional way of declaring structs, programmers wouldn't need to have struct every time they declare an instance of that struct. Note that the name Pers...
Properties can be set when an object is instantiated. var redCar = new Car { Wheels = 2, Year = 2016, Color = Color.Red };
When you document your code with @doc, you can supply code examples like so: # myproject/lib/my_module.exs defmodule MyModule do @doc """ Given a number, returns `true` if the number is even, otherwise `false`. ## Example iex> MyModule.even?(2) true ie...
struct FileAttributes { unsigned int ReadOnly: 1; unsigned int Hidden: 1; }; Here, each of these two fields will occupy 1 bit in memory. It is specified by : 1 expression after the variable names. Base type of bit field could be any integral type (8-bit int to 64-bit int). Using u...
The cmath module is similar to the math module, but defines functions appropriately for the complex plane. First of all, complex numbers are a numeric type that is part of the Python language itself rather than being provided by a library class. Thus we don't need to import cmath for ordinary arith...
Use module_info on Erlang modules you wish to inspect: iex> :math.module_info [module: :math, exports: [pi: 0, module_info: 0, module_info: 1, pow: 2, atan2: 2, sqrt: 1, log10: 1, log2: 1, log: 1, exp: 1, erfc: 1, erf: 1, atanh: 1, atan: 1, asinh: 1, asin: 1, acosh: 1, acos: 1, tanh...
The __info__/1 function takes one of the following atoms: :functions - Returns a keyword list of public functions along with their arities :macros - Returns a keyword list of public macros along with their arities To list the Kernel module’s functions: iex> Kernel.__info__ :functions [...
In development, you may find that using require() on the same module multiple times always returns the same module, even if you have made changes to that file. This is because modules are cached the first time they are loaded, and any subsequent module loads will load from the cache. To get around ...
A module is an importable file containing definitions and statements. A module can be created by creating a .py file. # hello.py def say_hello(): print("Hello!") Functions in a module can be used by importing the module. For modules that you have made, they will need to be in t...
props are used to pass data and methods from a parent component to a child component. Interesting things about props They are immutable. They allow us to create reusable components. Basic example class Parent extends React.Component{ doSomething(){ console.log("Parent comp...
strsplit is a useful function for breaking up a vector into an list on some character pattern. With typical R tools, the whole list can be reincorporated to a data.frame or part of the list might be used in a graphing exercise. Here is a common usage of strsplit: break a character vector along a co...
It is very rare that you'll ever want to use Select or Activate in your code, but some Excel methods do require a worksheet or workbook to be activated before they'll work as expected. If you're just starting to learn VBA, you'll often be suggested to record your actions using the macro recorder, t...
This illustrates that union members shares memory and that struct members does not share memory. #include <stdio.h> #include <string.h> union My_Union { int variable_1; int variable_2; }; struct My_Struct { int variable_1; int variable_2; }; int main (void) { ...

Page 11 of 47