Tutorial by Examples

GridView definition on ASPX page As shown below, first column of grid is defined as a checkbox column, which is conditionally cleared as shown in further examples below (the header checkbox is only for selecting/un-selecting all rows on current page, but same can be extended for all on grid easily)...
MongoDB stores data records as BSON documents. BSON is the binary representation of JSON. $ python >>> from pymongo import MongoClient >>> client = MongoClient() >>> col = client.mydb.test Create Insert a single document insert_one(document) >>> result = ...
Clearing the content of a web element: (note - when simulating user actions in tests, it's better to send backspace, see next action) interactionWebElement.clear(); Entering data - simulating sending keystrokes: interactionWebElement.sendKeys("Text"); interactionWebElement.sendKeys(K...
Although not necessary in PHP however it is a very good practice to initialize variables. Uninitialized variables have a default value of their type depending on the context in which they are used: Unset AND unreferenced var_dump($unset_var); // outputs NULL Boolean echo($unset_bool ? "tr...
Fluent wait is a superclass of explicit wait (WebDriverWait) that is more configurable since it can accept an argument to the wait function. I'll pass on implicit wait, since it's a best practice to avoid it. Usage (Java): Wait wait = new FluentWait<>(this.driver) .withTimeout(drive...
Go to File > Settings > Keymap and select the Keymaps option from: Mac OS X Emacs Visual Studio Eclise Netbeans Jbuilder and others, to map the shortcuts to the wanted tool ones.
Available since Rails 4.2, Active Job is a framework for declaring jobs and making them run on a variety of queuing backends. Recurring or punctual tasks that are not blocking and can be run in parallel are good use cases for Active Jobs.
class UserUnsubscribeJob < ApplicationJob queue_as :default def perform(user) # this will happen later user.unsubscribe end end
instanceof requires that the variable is of type any. This code (try it): class Pet { } class Dog extends Pet { bark() { console.log("woof"); } } class Cat extends Pet { purr() { console.log("meow"); } } function example(foo: any) { ...
typeof is used when you need to distinguish between types number, string, boolean, and symbol. Other string constants will not error, but won't be used to narrow types either. Unlike instanceof, typeof will work with a variable of any type. In the example below, foo could be typed as number | str...
You can declare functions that serve as type guards using any logic you'd like. They take the form: function functionName(variableName: any): variableName is DesiredType { // body that returns boolean } If the function returns true, TypeScript will narrow the type to DesiredType in any bl...
This error message may be produced by the OpenSSH ssh client. It means that the TCP connection between the client and the server was abnormally closed by the server immediately after being accepted. Common reasons for this message include: The SSH server process is malfunctioning--for example, it...
This error message may be produced by the OpenSSH ssh client. It means that the TCP connection between the client and the server was closed by the server immediately after being accepted. This message generally indicates the SSH server has been configured not to accept connections from the client fo...
To compare the difference of two dates, we can do the comparison based on the timestamp. var date1 = new Date(); var date2 = new Date(date1.valueOf() + 5000); var dateDiff = date1.valueOf() - date2.valueOf(); var dateDiffInYears = dateDiff/1000/60/60/24/365; //convert milliseconds into years ...
There is no imshow in the java, you need to write a method for this. This method is a Mat2bufferedImage. Takes mat object as parameter and returns image. public static void main(String[] args) { Mat frame = new Mat(); //0; default video device id VideoCapture camera = new VideoCaptur...
Just a simple hello world to start. Copy paste the below into the document, save then double click. MsgBox "Hello World" Explanation "MsgBox" displays a message in a dialog box and waits for the user to respond. This is a good method to inform users of actions to be pe...
Detailed instructions on getting parse-server set up or installed.
1)In project.json, add below dependencies- "Serilog": "2.2.0", "Serilog.Extensions.Logging": "1.2.0", "Serilog.Sinks.RollingFile": "2.0.0", "Serilog.Sinks.File": "3.0.0" 2)In Startup.cs, add below lines in constru...
A Functor is defined in category theory as a structure-preserving map (a 'homomorphism') between categories. Specifically, (all) objects are mapped to objects, and (all) arrows are mapped to arrows, such that the category laws are preserved. The category in which objects are Haskell types and morph...

Page 1042 of 1336