Tutorial by Examples: c

import React, { Component } from 'react'; type Props = { posts: Array<Article>, dispatch: Function, children: ReactElement } class Posts extends Component { props: Props; render () { // rest of the code goes here } }
The reference to the outer class uses the class name and this public class OuterClass { public class InnerClass { public void method() { System.out.println("I can access my enclosing class: " + OuterClass.this); } } } You can access fields and ...
Download Play! 1. Goto http://www.playframework.com/download and download latest Play! release (play-2.5.X.zip at the time of this writing). Unzip in a directory of your choice. We’ll refer to uncompressed folder directory as PLAY_HOME. Add PLAY_HOME folder to you PATH environment variable, so that...
While writing jQuery plugins is simple, we want to enclose our plugins in a local scope. This will avoid namespace conflicts as well as polluting the global namespace, on top of ensuring that jQuery is loaded before our plugin extends it. // Encapsulate our plugins in a local scope (function($) { ...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create a WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); //fill cell data with a loop, note that row and column indexes start at 1 Random rnd...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create a WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1"); //fill cell data with a loop, note that row and column indexes start at 1 Random rnd...
The async package provides functions for asynchronous code. Using the auto function you can define asynchronous relations between two or more functions: var async = require('async'); async.auto({ get_data: function(callback) { console.log('in get_data'); // async code to ...
You can delete trailing spaces with the following command. :%s/\s\+$//e This command is explained as follows: enter Command mode with : do this to the entire file with % (default would be for the current line) substitute action s / start of the search pattern \s whitespace character \+ e...
You can convert tabs to spaces by doing the following: First check that expandtab is switched off :set noexpandtab Then :retab! which replaces spaces of a certain length with tabs If you enable expandtab again :set expandtab then and run the :retab! command then all the tabs becomes spaces...
import WatchConnectivity var watchSession : WCSession? override func awake(withContext context: Any?) { super.awake(withContext: context) // Configure interface objects here. startWatchSession() } func startWatchSession(){ if(WCSession....
//create a list to hold all the values List<string> excelData = new List<string>(); //read the Excel file as byte array byte[] bin = File.ReadAllBytes("C:\\ExcelDemo.xlsx"); //or if you use asp.net, get the relative path byte[] bin = File.ReadAllBytes(Server.MapPath(&q...
Let's say that you have the following class: public class PersonInfo { public int ID { get; set; } [Display(Name = "First Name")] [Required(ErrorMessage = "Please enter your first name!")] public string FirstName{ get; set; } [Display(Name = "L...
//set the formatting options ExcelTextFormat format = new ExcelTextFormat(); format.Delimiter = ';'; format.Culture = new CultureInfo(Thread.CurrentThread.CurrentCulture.ToString()); format.Culture.DateTimeFormat.ShortDatePattern = "dd-mm-yyyy"; format.Encoding = new UTF8Encoding(); ...
In the file myConfig.groovy is the following content. message = 'Hello World!' aNumber=42 aBoolean=false aList=["apples", "grapes", "oranges"] Then in your main script you create a ConfigSlurper for your myConfig.groovy file which is really just another groovy sc...
public String getCitiesByCountry(String countryName) throws MalformedURLException, IOException { //Code to make a webservice HTTP request String responseString = ""; String outputString = ""; String wsURL = "http://www.webservicex.com/globalweather.asm...
Define a new visitor class by overriding some of the methods of ExpressionVisitor: class PrintingVisitor : ExpressionVisitor { protected override Expression VisitConstant(ConstantExpression node) { Console.WriteLine("Constant: {0}", node); return base.VisitConstant(...
For iterating more than two lists simultaneously within list comprehension, one may use zip() as: >>> list_1 = [1, 2, 3 , 4] >>> list_2 = ['a', 'b', 'c', 'd'] >>> list_3 = ['6', '7', '8', '9'] # Two lists >>> [(i, j) for i, j in zip(list_1, list_2)] [(1, '...
Go to https://ftp.mozilla.org/pub/firefox/releases/ Find the list of older versions in the above link. Select the operating system you want to install in. Select the Language you want to install in. An executable will be downloaded. Run the .exe file to install the firef...
The following tests range A2 to A7 for duplicate values. Remark: This example illustrates a possible solution as a first approach to a solution. It's faster to use an array than a range and one could use collections or dictionaries or xml methods to check for duplicates. Sub find_duplicates() ...
Where command line arguments are supported they can be read in via the get_command_argument intrinsic (introduced in the Fortran 2003 standard). The command_argument_count intrinsic provides a way to know the number of arguments provided at the command line. All command-line arguments are read in ...

Page 665 of 826