Tutorial by Examples: e

Active Patterns can be used to make calling some .NET API's feel more natural, particularly those that use an output parameter to return more than just the function return value. For example, you'd normally call the System.Int32.TryParse method as follows: let couldParse, parsedInt = System.Int32....
The @each directive allows you to iterate through any list or map. It takes the form of @each $var or <list or map> {} where $var can be any variable name and <list or map> can be anything that returns a list or map. In the following example, the loop will iterate through the $authors l...
One of the easiest examples of using shared services is when we want to store some data from a given page of our application, and then get that data again but from another page. One option could be to send that data as a parameter (for instance, if one page calls the other one) but if we want to us...
The following sqoop command will be used to import the data from RDBMS table into HBase table, if the table does not exists in HBase it will create a new table and import the data into this table sqoop import \ --query 'select emp_id, emp_name, emp_sal from employee where $CONDITIONS' \ ...
UITextView has extra paddings by default. Sometimes it's annoying especially if you want to measure some text without view instance and place them at some area precisely. Do this to remove such paddings. messageTextView.textContainerInset = UIEdgeInsetsZero messageTextView.textContainer.lineFragm...
While-loops execute a body expression as long as the loop condition evaluates to true. A while-loop which logs numbers in range 9 to 0 (inclusive) can be written as follows: var i = 10; while (i-- > 0) { trace(i); } Try the example on try.haxe.org. References "While", Ha...
Do-while-loops execute a body expression at least once, and then keep executing it as long as the loop condition evaluates to true. A do-while-loop which logs numbers in range 10 to 0 (inclusive) can be written as follows: var i = 10; do { trace(i); } while (i-- > 0); Try the example ...
Before starting you must have: Anaconda installed on your system Account on Binstar If you are not using Anaconda 1.6+ install the binstar command line client: $ conda install binstar $ conda update binstar If you are not using Anaconda the Binstar is also available on pypi: $ pip install bin...
Pre -Requsite: Download Visual Studio IDE Create a new project Install specflow visual studio integration, Nunit Adapter & Nunit framework Download specflow for visual studio as shown below
Anonymous class listener Before Java 8, it’s very common that an anonymous class is used to handle click event of a JButton, as shown in the following code. This example shows how to implement an anonymous listener within the scope of btn.addActionListener. JButton btn = new JButton("My Butto...
Simple line plot import matplotlib.pyplot as plt # Data x = [14,23,23,25,34,43,55,56,63,64,65,67,76,82,85,87,87,95] y = [34,45,34,23,43,76,26,18,24,74,23,56,23,23,34,56,32,23] # Create the plot plt.plot(x, y, 'r-') # r- is a style code meaning red solid line # Show the plot plt.show...
<html> <head> <script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script> <script src="https:...
response = requests.get("https://api.github.com/events") text_resp = response.text JSON response: for json-formatted responses the package provides a built-in decoder response = requests.get('https://api.github.com/events') json_resp = response.json() This method will raise a Valu...
The attribute status_code contains the status code of the response good_req = requests.get('https://api.github.com/events') code_200 = good_req.status_code notfound_req = requests.get('https://api.github.com/not_found') code_404 = notfound_req.status_code requests.codes.__dict__ will provid...
In Visual Studio go to your Solution Explorer then click on Project you will be adding model Right mouse. Choose ADO.NET Entity Data Model Then choose Generate from database and click Next in next window click New Connection... and point to the database you want to generate model from (Could be M...
jQuery datepicker has two options to allow displaying dropdowns for month and year selection. These options make navigation through large timeframes easier. <input type="text" id="datepicker"> <script> $("#datepicker").datepicker({ changeMont...
class AnimatedImage extends Component { constructor(props){ super(props) this.state = { logoMarginTop: new Animated.Value(200) } } componentDidMount(){ Animated.timing( this.state.logoMarginTop, { toValue: 100 ...
We have 2 way, we can install Universal app in windows 10 devices (OS/Phone). One app works for both mobile and OS 1 Install using Power Shell command Step 1: Make sure app not have any error and developed, then right click on Universal app project in solution explorer. Step 2: Select Store and C...
We can use $q to defer operations to the future while having a pending promise object at the present, by using $q.defer we create a promise that will either resolve or reject in the future. This method is not equivalent of using the $q constructor, as we use $q.defer to promisify an existing routin...
<style> input:in-range { border: 1px solid blue; } </style> <input type="number" min="10" max="20" value="15"> <p>The border for this value will be blue</p> The :in-range CSS pseudo-class matches when an element...

Page 526 of 1191