Tutorial by Examples: all

Using sequence function you can easily describe a message that calls a list of other messages. It's useful when dealing with semantics of your messages. Example 1: You are making a game engine, and you need to refresh the screen on every frame. module Video exposing (..) type Message = module Vid...
Detailed instructions on getting optimization set up or installed.
ArgumentCaptor will to receive the actual invocation arguments that has been passed to method. ArgumentCaptor<Foo> captor = ArgumentCaptor.forClass(Foo.class); verify(mockObj).doSomethind(captor.capture()); Foo invocationArg = captor.getValue(); //do any assertions on invocationArg For ...
In order to install asyncio: pip install asyncio Notice that python asyncio requires Python 3.3 or later. This module became part of the Python standard library since Python 3.4.
In this example 2000 bytes will be transfered using DMA, Transmit Half Complete and Transmit Complete interrupts achieving the best performance. The first half of the transmit buffer is loaded with new data by the CPU in the Transmit Half Complete interrupt callback while the second half of the buf...
One of several applications of bit manipulation is converting a letter from small to capital or vice versa by choosing a mask and a proper bit operation. For example, the a letter has this binary representation 01(1)00001 while its capital counterpart has 01(0)00001. They differ solely in the bit in...
Create a file called hello.html with the following content: <!doctype html> <html> <head> <script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.0.0/dygraph.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com...
This example is a quick setup of Angular and how to generate a quick example project. Prerequisites: Node.js 6.9.0 or greater. npm v3 or greater or yarn. Typings v1 or greater. Open a terminal and run the commands one by one: npm install -g typings or yarn global add typings npm install -...
The MSBuildWorspace is built around the concept of handling MSBuild solutions (.sln files) and their respective projects (.csproj, .vbproj). Adding new projects and documents to this workspace is not supported. string solutionPath = @"C:\Path\To\Solution\Sample.sln"; MSBuildWorkspace ...
This example shows how to submit the WFFM form in code. var controlResults = new List<ControlResult>(); controlResults.Add(new ControlResult(Pdf_Request_Form.Name.ItemID.ToString(), "Name", name, string.Empty)); controlResults.Add(new ControlResult(Pdf_Request_Form.Email.ItemID.To...
Swift: centralManager.scanForPeripherals(withServices: nil, options: nil) Objective C: [centralManager scanForPeripheralsWithServices:nil options:nil];
var syntaxRoot = await document.GetSyntaxRootAsync(); var semanticModel = await document.GetSemanticModelAsync(); var sampleMethodInvocation = syntaxRoot .DescendantNodes() .OfType<InvocationExpressionSyntax>() .First(); var sampleMethodSymbol = semanticModel.GetSymbolI...
Install virtualenv via pip / (apt-get): pip install virtualenv OR apt-get install python-virtualenv Note: In case you are getting permission issues, use sudo.
If you look at the bin directory in your virtualenv, you’ll see easy_install which has been modified to put eggs and packages in the virtualenv’s site-packages directory. To install an app in your virtual environment: $ source test_project/bin/activate $ pip install flask At this time, you do...
Installing lxml is very easy, had become an easy jobs since Python 2.7.9 (because it comes with an utility which helps developers to download install dependency in an easy manner like Maven for Java) at first you have to run the command then start coding. pip install lxml The second way is to in...
std::call_once ensures execution of a function exactly once by competing threads. It throws std::system_error in case it cannot complete its task. Used in conjunction with std::once_flag. #include <mutex> #include <iostream> std::once_flag flag; void do_something(){ std::ca...
Use top command to exam CPU time allocation between user space and kernel space. Explanation: 24.8 us (user space): 24.8% of CPU time is spent on user process. 0.5 sy (system): 0.5% of CPU time is spent on kernel space. ni (niceness): the ratio of CPU time spent on low priority processes. i...
var a = 11, b = 22; a = a ^ b; b = a ^ b; a = a ^ b; console.log("a = " + a + "; b = " + b);// a is now 22 and b is now 11
We can create dynamic component and get the instances of component into an array and finally rendered it on template. For example, we can can consider two widget component, ChartWidget and PatientWidget which extended the class WidgetComponent that I wanted to add in the container. ChartWidget.ts ...
Detailed instructions on getting caliburn.micro set up or installed.

Page 102 of 113