Tutorial by Examples

typeof is the 'official' function that one uses to get the type in javascript, however in certain cases it might yield some unexpected results ... 1. Strings typeof "String" or typeof Date(2011,01,01) "string" 2. Numbers typeof 42 "number" 3. Bool typeo...
Dim duplicateFruits = New List(Of String) From {"Grape", "Apple", "Grape", "Apple", "Grape"} 'At this point, duplicateFruits.Length = 5 Dim uniqueFruits = duplicateFruits.Distinct(); 'Now, uniqueFruits.Count() = 2 'If iterated over at this poin...
Often you want to lock the entire object while you perform multiple operations on it. For example, if you need to examine or modify the object using iterators. Whenever you need to call multiple member functions it is generally more efficient to lock the whole object rather than individual member fu...
You can define the signing configuration to sign the apk in the build.gradle file. You can define: storeFile : the keystore file storePassword: the keystore password keyAlias: a key alias name keyPassword: A key alias password You have to define the signingConfigs block to create a signin...
When one with typeof operator one gets type object it falls into somewhat wast category... In practice you might need to narrow it down to what sort of 'object' it actually is and one way to do it is to use object constructor name to get what flavour of object it actually is: Object.prototype.toSt...
In this app i am directly opening InAppBrowser when the user tap the app icon instead of loading first page of app. So that would look like to user that they are viewing the app of the same website/webapp.
platform.ready().then(() => { // Okay, so the platform is ready and our plugins are available. // Here you can do any higher level native things you might need. var url= "https://blog.knoldus.com/"; var browserRef = window.cordova.InAppBrowser.open(url, &qu...
Instead of this (unfortunately too often seen in the real code) "masterpiece": function isEven(n) { return n % 2 == 0; } function isOdd(n) { if (isEven(n)) { return false; } else { return true; } } You can do the parity check much more effecti...
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 ...
<iframe "id="iframe_Login1"> <iframe "id="iframe_Login2"> <iframe "id="iframe_Login3"> </iframe> </iframe> </iframe> To switch into frame in selenium use swithTo() and frame()...
The Roslyn Quoter A tool for converting an sample C# program to syntax tree API calls. The tool itself can be found here. Enhanced source viewer An easy way to view the Roslyn source code can be found here.
Postman is an API Development Environment that helps people to build, test, document, monitor and publish documentation for their APIs. The main features of Postman are Sending requests (with support for different authentication schemes, Cookies, certificates, headers, query parameters, request ...
Here we are having a list of todo items that is passed to the props of our component. Each todo item has a text and id property. Imagine that the id property comes from a backend datastore and is a unique numeric value: todos = [ { id: 1, text: 'value 1' }, { id: 2, te...
If you don't have unique database ids at hand, you could also use the numeric index of your array like this: render() { const { todos } = this.props; return ( <ul> { todos.map((todo, index) => <li key={ `todo-${index}` }> { todo.text } &...
app = QApplication( sys.argv ) box = QMessageBox() # Window Title box.setWindowTitle( "Hello World." ) # Icon: Information, Warning, Question, Critical box.setIcon( QMessageBox.Information ) # Short version of the information box.setText( "Hello World!" ) # Inform...
Detailed instructions on getting caliburn.micro set up or installed.
This is especially useful if we have a class that we want to extend in the rule. See example below for a more convenient method. import org.junit.rules.TestRule; import org.junit.runners.model.Statement; public class AwesomeTestRule implements TextRule { @Override public Stateme...
JUnit has an abstract implementation of @TestRule that lets you write a rule in a more simpler way. This is called ExternalResource and provides two protected methods that can be extended like this: public class AwesomeTestRule extends ExternalResource { @Override protected void befor...
Add the hyperloop gem to your rails (4.0 - 5.1) Gemfile bundle install Add the hyperloop manifest to the application.js file: // app/assets/javascripts/application.js ... //= hyperloop-loader Create your react components, and place them in the hyperloop/components directory # app/hyperl...

Page 1230 of 1336