Tutorial by Examples

Simple struct C++ signature: typedef struct _PERSON { int age; char name[32]; } PERSON, *LP_PERSON; void GetSpouse(PERSON person, LP_PERSON spouse); C# definition [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] public struct PERSON { public int age; [Ma...
vim is a modal editor. This means that at any time inside a vim session, the user is going to be in one of the modes of operation. Each one of offers a different set commands, operations, key bindings... Normal mode (or Command mode) The mode vim starts in. From other modes, usually accessible ...
The below examples use the new form API introduced in RC3. pw-change.template.html <form class="container" [formGroup]="pwChangeForm"> <label for="current">Current Password</label> <input id="current" formControlName="curr...
In Java, there is a built-in language-level locking mechanism: the synchronized block, which can use any Java object as an intrinsic lock (i.e. every Java object may have a monitor associated with it). Intrinsic locks provide atomicity to groups of statements. To understand what that means for us, ...
An atomic operation is an operation that is executed "all at once", without any chance of other threads observing or modifying state during the atomic operation's execution. Lets consider a BAD EXAMPLE. private static int t = 0; public static void main(String[] args) { ExecutorSe...
Press Ctrl + v to enter into visual block mode. Use ↑ / ↓ / j / k to select multiple lines. Press Shift + i and start typing what you want. After you press Esc, the text will be inserted into all the lines you selected. Remember that Ctrl+c is not 100% equivalent to Esc and will not work in this...
import pandas as pd chunksize = [n] for chunk in pd.read_csv(filename, chunksize=chunksize): process(chunk) delete(chunk)
Multidimensional arrays are basically arrays containing others arrays as elements. It is represented like [sizeDim1][sizeDim2]..[sizeLastDim]type, replacing sizeDim by numbers corresponding to the length of the dimention, and type by the type of data in the multidimensional array. For example, [2]...
Syntax for pushing to a remote branch git push <remote_name> <branch_name> Example git push origin master
Characteristics of properties : Properties that can be retrieved from an object could have the following characteristics, Enumerable Non - Enumerable own While creating the properties using Object.defineProperty(ies), we could set its characteristics except "own". Properties which...
The .vimrc file (pronounced Vim-wreck) is a Vim configuration file. It holds commands that will be executed by Vim every time it starts. By default the file is empty or non-existent; you can use it to customize your Vim environment. To find out where Vim expects the vimrc file to be stored, open V...
You can use the following extension method for comparing the contents of two IList< T > instances of the same type. By default the items are compared based on their order within the list and the items themselves, passing false to the isOrdered parameter will compare only the items themselves ...
This example hides the red box (border) if the checkbox is not checked by making use of an IValueConverter. Note: The BooleanToVisibilityConverter used in the example below is a built-in value converter, located in the System.Windows.Controls namespace. XAML: <Window x:Class="StackOverflo...
In order to work with bindings in WPF, you need to define a DataContext. The DataContext tells bindings where to get their data from by default. <Window x:Class="StackOverflowDataBindingExample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&q...
INotifyPropertyChanged is an interface used by binding sources (i.e. the DataContext) to let the user interface or other components know that a property has been changed. WPF automatically updates the UI for you when it sees the PropertyChanged event raised. It is desirable to have this interface im...
You can bind to a property on a named element, but the named element must be in scope. <StackPanel> <CheckBox x:Name="MyCheckBox" IsChecked="True" /> <TextBlock Text="{Binding IsChecked, ElementName=MyCheckBox}" /> </StackPanel>
You can bind to a property of an ancestor in the visual tree by using a RelativeSource binding. The nearest control higher in the visual tree which has the same type or is derived from the type you specify will be used as the binding's source: <Grid Background="Blue"> <Grid ...
PS > Get-Member -InputObject $anObjectInstance This will return all members of the type instance. Here is a part of a sample output for String instance TypeName: System.String Name MemberType Definition ---- ---------- ---------- Clone ...
The Django template system has built-in tags and filters, which are functions inside template to render content in a specific way. Multiple filters can be specified with pipes and filters can have arguments, just as in variable syntax. {{ "MAINROAD 3222"|lower }} # mainroad 3222 {{ 10...
If you need to add an attribute through razor that has a - (hyphen) in the name you cannot simply do @Html.DropDownListFor(m => m.Id, Model.Values, new { @data-placeholder = "whatever" }) it will not compile. data-* attributes are valid and common in html5 for adding extra values t...

Page 275 of 1336