Tutorial by Examples: al

Task that return a value has return type of Task< TResult > where TResult is the type of value that needs to be returned. You can query the outcome of a Task by its Result property. Task<int> t = Task.Run(() => { int sum = 0; for(int i = 0; i < 500; i++) ...
Since an enum can be cast to and from its underlying integral type, the value may fall outside the range of values given in the definition of the enum type. Although the below enum type DaysOfWeek only has 7 defined values, it can still hold any int value. public enum DaysOfWeek { Monday = 1...
From within Emacs, type C-h t (Control-h, t) to get an excellent interactive tutorial within Emacs. The user learns basic navigation and editing by operating on the TUTORIAL text itself, as they read the tutorial. (Modifications to the tutorial are discarded when the tutorial is closed, so each ti...
Validation attributes are used to enforce various validation rules in a declarative fashion on classes or class members. All validation attributes derive from the ValidationAttribute base class. Example: RequiredAttribute When validated through the ValidationAttribute.Validate method, this att...
lessc [options] <source> [destination] The above command is used to compile Less files in the command line. Options are the various settings that the compiler should use either during compilation or after compilation. Options include -x or --compress for compressing or minifying the output ...
Print out all list names and the item count. $site = Get-SPSite -Identity https://mysharepointsite/sites/test foreach ($web in $site.AllWebs) { foreach ($list in $web.Lists) { # Prints list title and item count Write-Output "$($list.Title), Items: $($list.ItemCoun...
Get-SPFeature -Site https://mysharepointsite/sites/test Get-SPFeature can also be run on web scope (-Web <WebUrl>), farm scope (-Farm) and web application scope (-WebApplication <WebAppUrl>). Get all orphaned features on a site collection Another usage of Get-SPFeature can be to find ...
Partial classes provide a clean way to separate core logic of your scripts from platform specific methods. Partial classes and methods are marked with the keyword partial. This signals the compiler to leave the class "open" and look in other files for the rest of the implementation. // E...
The way Moment uses dates and times is by wrapping the existing Date() object in a moment() object and specifying useful and intuitive methods on this object. Format Dates moment().format('MMMM Do YYYY, h:mm:ss a'); // August 4th 2016, 10:41:45 am moment().format('dddd'); // Th...
C++11 Motivational example When you have a variadic template pack in the template parameters list, like in the following code snippet: template<typename ...Args> void func(Args &&...args) { //... }; The standard library (prior to C++17) offers no direct way to write enable_if...
Value is available both in configuration and run phases. angular.module('app',[]) .value('endpoint', 'http://some.rest.endpoint') // define .run(function(endpoint) { // do something with endpoint // only available in run phase }) .controller('MainCtrl', function(endpoint) { ...
A BroadcastReceiver is basically a mechanism to relay Intents through the OS to perform specific actions. A classic definition being "A Broadcast receiver is an Android component which allows you to register for system or application events." LocalBroadcastManager is a way to send ...
AsyncTask is an abstract Class and does not inherit the Thread class. It has an abstract method doInBackground(Params... params), which is overridden to perform the task. This method is called from AsyncTask.call(). Executor are part of java.util.concurrent package. Moreover, AsyncTask contains 2 ...
In some cases it may not suffice to know whether more that one methods were called. The calling order of methods is also important. In such case you may use InOrder class of Mockito to verify the order of methods. SomeClass mock1 = Mockito.mock(SomeClass.class); otherClass mock2 = Mockito.mock(Oth...
View content: adb shell ls \$EXTERNAL_STORAGE adb shell ls \$SECONDARY_STORAGE View path: adb shell echo \$EXTERNAL_STORAGE adb shell echo \$SECONDARY_STORAGE
Building and Installation on Windows 7 Prerequisites If you want to build VTK from latest sources you need git from Here or you can download a snapshot of the code as a zip and unzip on to your disk drive CMake Microsoft Visual Studio 2015 Plenty of free space - atleast a couple of GB to be ...
USE master; GO -- Set recovery every 3 min EXEC sp_configure 'recovery interval', '3'; RECONFIGURE WITH OVERRIDE;
If we have Multiple IF...ELSE IF statements but we also want also want to execute some piece of code if none of expressions are evaluated to True , then we can simple add a final ELSE block which only gets executed if none of the IF or ELSE IF expressions are evaluated to true. In the example below...
Detailed instructions on getting Robot Framework set up or installed. Robot framework is a generic test automation framework.This is implemented using Python and is supported on Python 2 and Python 3 Jython (JVM) and IronPython (.NET) and PyPy. For Acceptance testing Acceptance test-driven dev...
Download the latest version of ANTLR and extract it to a folder. You can use also Maven, Gradle, or other build tool to depend on its runtime (the classes the generated grammars use): org.antlr:antlr4-runtime. In order to automatically -as part of the build process- generate the parser in a maven ...

Page 138 of 269