Tutorial by Examples: c

You can create a new branch and switch to it using git checkout -b AP-57 After you use git checkout to create a new branch, you will need to set that upstream origin to push to using git push --set-upstream origin AP-57 After that, you can use git push while you are on that branch.
3D transforms can be use to create many 3D shapes. Here is a simple 3D CSS cube example: HTML: <div class="cube"> <div class="cubeFace"></div> <div class="cubeFace face2"></div> </div> CSS: body { perspective-origin: 5...
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");
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, ...
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...
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...
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);
Suppose we want to receive a function as a parameter, we can do it like this: function foo(otherFunc: Function): void { ... } If we want to receive a constructor as a parameter: function foo(constructorFunc: { new() }) { new constructorFunc(); } function foo(constructorWithParams...
The type constructor for lists in the Haskell Prelude is []. The type declaration for a list holding values of type Int is written as follows: xs :: [Int] -- or equivalently, but less conveniently, xs :: [] Int Lists in Haskell are homogeneous sequences, which is to say that all elements mus...
To process lists, we can simply pattern match on the constructors of the list type: listSum :: [Int] -> Int listSum [] = 0 listSum (x:xs) = x + listSum xs We can match more values by specifying a more elaborate pattern: sumTwoPer :: [Int] -> Int sumTwoPer [] = 0 sumTwoPer (x1...

Page 189 of 826