Tutorial by Examples

import std.format; void main() { string s = "Name Surname 18"; string name, surname; int age; formattedRead(s, "%s %s %s", &name, &surname, &age); // %s selects a format based on the corresponding argument's type } Official documentatio...
By default a property is a primary key if a property on a class is named “ID” (not case sensitive), or the class name followed by "ID". If the type of the primary key property is numeric or GUID it will be configured as an identity column. Simple Example: public class Room { // Pri...
To get template item by template Id. TemplateItem templateItem = Sitecore.Context.Database.GetTemplate(new ID("{11111111-1111-1111-1111-111111111111}"));
Input the name of the template to get the template by using GetTemplate Method. TemplateItem templateItem = Sitecore.Context.Database.GetTemplate("NameOfTheTemplate");
While you can create LaTeX documents using any editor and compiling using the console, there exist several plugins for widely used editors to simplify creating LaTeX documents, and there are specialized LaTeX editors. An exhaustive list of LaTeX editors is available on TeX.SE (the StackExchange site...
A WM_CREATE message is sent to your window procedure during the window's CreateWindowEx call. The lp argument contains a pointer to a CREATESTRUCT which contains the arguments passed to CreateWindowEx. If an application returns 0 from WM_CREATE, the window is created. If an application returns -1, ...
This message is sent to your window procedure when a window is being destroyed. It is sent after the window is removed from the screen. Most applications free any resources, like memory or handles, obtained in WM_CREATE. If you handle this message, return 0. LRESULT CALLBACK winproc(HWND hwnd, UINT...
Sent when an application's close button is clicked. Do not confuse this with WM_DESTROY which is sent when a window will be destroyed. The main difference lies in the fact that closing may be canceled in WM_CLOSE (think of Microsoft Word asking to save your changes), versus that destroying is when t...
This message is sent to the window's window procedure after it's size has changed. The most common reason for handling this message is to adjust the position of any child windows. For example, in Notepad, when the window is resized the child window (edit control) is also resized. Return 0 if you han...
Sent to a window procedure when: the user selects an item from a menu a control sends a notification to its parent window an accelerator keystroke is translated Message SourceHIWORD(wp)LOWORD(wp)lpMenu0Menu ID (IDM_*)0Accelerator1Accel ID (IDM_*)0Controlnotification codeControl idHWND of con...
SQL Server 2012 You can utilize the new function: FORMAT(). Using this you can transform your DATETIME fields to your own custom VARCHAR format. Example DECLARE @Date DATETIME = '2016-09-05 00:01:02.333' SELECT FORMAT(@Date, N'dddd, MMMM dd, yyyy hh:mm:ss tt') Monday, September 05, 2016 ...
The Windows API documentation for functions taking one or more string as argument will usually look like this: BOOL WINAPI CopyFile( _In_ LPCTSTR lpExistingFileName, _In_ LPCTSTR lpNewFileName, _In_ BOOL bFailIfExists ); The datatype for the two string parameters is made of several ...
When you have an input with well defined boundaries and are expecting more than one match in your string, you have two options: Using lazy quantifiers; Using a negated character class. Consider the following: You have a simple templating engine, you want to replace substrings like $[foo] whe...
In comparison to regular classes – case classes notation provides several benefits: All constructor arguments are public and can be accessed on initialized objects (normally this is not the case, as demonstrated here): case class Dog1(age: Int) val x = Dog1(18) println(x.age) // 18 (success!...
[^0-9a-zA-Z] This will match all characters that are neither numbers nor letters (alphanumerical characters). If the underscore character _ is also to be negated, the expression can be shortened to: [^\w] Or: \W In the following sentences: Hi, what's up? I can't wait for 2017!...
[^0-9] This will match all characters that are not ASCII digits. If Unicode digits are also to be negated, the following expression can be used, depending on your flavor/language settings: [^\d] This can be shortened to: \D You may need to enable Unicode character properties support expl...
To get version 5394 use: svn co --revision r5394 https://svn.example.com/svn/MyRepo/MyProject/trunk Or the shorter version: svn co -r 5394 https://svn.example.com/svn/MyRepo/MyProject/trunk Or by using pegged revisions: svn co https://svn.example.com/svn/MyRepo/MyProject/trunk@5394 If al...
Dynamic scoping means that variable lookups occur in the scope where a function is called, not where it is defined. $ x=3 $ func1 () { echo "in func1: $x"; } $ func2 () { local x=9; func1; } $ func2 in func1: 9 $ func1 in func1: 3 In a lexically scoped language, func1 would alway...
If you have an instance of a generic type but for some reason don't know the specific type, you might want to determine the generic arguments that were used to create this instance. Let's say someone created an instance of List<T> like that and passes it to a method: var myList = new List&lt...
SequenceEqual is used to compare two IEnumerable<T> sequences with each other. int[] a = new int[] {1, 2, 3}; int[] b = new int[] {1, 2, 3}; int[] c = new int[] {1, 3, 2}; bool returnsTrue = a.SequenceEqual(b); bool returnsFalse = a.SequenceEqual(c);

Page 305 of 1336