Tutorial by Examples: v

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...
F# Interactive, is a REPL environment that lets you execute F# code, one line at a time. If you have installed Visual Studio with F#, you can run F# Interactive in console by typing "C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\Fsi.exe". On Linux or OS X, the command is fsh...
Worksheets in excel have three options for the Visible property. These options are represented by constants in the xlSheetVisibility enumeration and are as follows: xlVisible or xlSheetVisible value: -1 (the default for new sheets) xlHidden or xlSheetHidden value: 0 xlVeryHidden xlSheetVeryHidd...
Below are the operators that can be overloaded in classes, along with the method definitions that are required, and an example of the operator in use within an expression. N.B. The use of other as a variable name is not mandatory, but is considered the norm. OperatorMethodExpression+ Addition__add...
By default you will get de codes and id's for optionsets and lookups. If you want to get the label as well, you need to add an extra header to the call. $.ajax({ url: Xrm.Page.context.getClientUrl() + '/api/data/v8.0/contacts', headers: { 'Accept': 'Application/json', ...
my_vector = [0, 2, 1, 3, 9]; for i = 1:numel(my_vector) my_vector(i) = my_vector(i) + 1; end Most simple things done with for loops can be done faster and easier by vectorized operations. For example, the above loop can be replaced by my_vector = my_vector + 1.
When is an IEnumerable<T> a subtype of a different IEnumerable<T1>? When T is a subtype of T1. IEnumerable is covariant in its T parameter, which means that IEnumerable's subtype relationship goes in the same direction as T's. class Animal { /* ... */ } class Dog : Animal { /* ... */ }...
Prerequisite: Installing Gradle Once you have Gradle installed, you can setup a new or existing project by running cd $PROJECT_DIR gradle init --type=java-library Note that there are other project types like Scala you can get started with, but we'll use Java for this example. You will end up ...
When is an IComparer<T> a subtype of a different IComparer<T1>? When T1 is a subtype of T. IComparer is contravariant in its T parameter, which means that IComparer's subtype relationship goes in the opposite direction as T's. class Animal { /* ... */ } class Dog : Animal { /* ... */ }...
let x = true match x with | true -> printfn "x is true" yields a warning C:\Program Files (x86)\Microsoft VS Code\Untitled-1(2,7): warning FS0025: Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s). ...
Incorrect usage: In the following snippet, the last match will never be used: let x = 4 match x with | 1 -> printfn "x is 1" | _ -> printfn "x is anything that wasn't listed above" | 4 -> printfn "x is 4" prints x is anything that wasn't listed abov...
>>> code = """for i in range(5):\n print('Hello world!')""" >>> exec(code) Hello world! Hello world! Hello world! Hello world! Hello world!
>>> expression = '5 + 3 * a' >>> a = 5 >>> result = eval(expression) >>> result 20
compile built-in function can be used to precompile an expression to a code object; this code object can then be passed to eval. This will speed up the repeated executions of the evaluated code. The 3rd parameter to compile needs to be the string 'eval'. >>> code = compile('a * b + c', '&l...
>>> variables = {'a': 6, 'b': 7} >>> eval('a * b', globals=variables) 42 As a plus, with this the code cannot accidentally refer to the names defined outside: >>> eval('variables') {'a': 6, 'b': 7} >>> eval('variables', globals=variables) Traceback (most ...
You can fetch the current properties of the Annotation by using Reflection to fetch the Method or Field or Class which has an Annotation applied to it, and then fetching the desired properties. @Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation { String key() default "foo";...
It is possible to create a QtQuick view directly from C++ and to expose to QML C++ defined properties. In the code below the C++ program creates a QtQuick view and exposes to QML the height and width of the view as properties. main.cpp #include <QApplication> #include <QQmlContext> #...
If you want to mock AR that doesn't try to connect to database you can do it in the following way (if using PHPUnit): $post = $this->getMockBuilder('\app\model\Post') ->setMethods(['save', 'attributes']) ->getMock(); $post->method('save')->willReturn(true); $post->meth...
The Application directive defines application-specific attributes. It is provided at the top of the global.aspx file. The basic syntax of Application directive is: <%@ Application Language="C#" %> The attributes of the Application directive are: AttributesDescriptionInheritsThe...
The control directive is used with the user controls and appears in the user control (.ascx) files. The basic syntax of Control directive is: <%@ Control Language="C#" EnableViewState="false" %> The attributes of the Control directive are: AttributesDescriptionAutoEv...

Page 57 of 296