Tutorial by Examples: dis

creating-listview.component.html <ListView [items]="countries" (itemTap)="onItemTap($event)"> <template let-country="item" let-i="index"> <StackLayout orientation="horizontal"> <Label [text]='(i + 1) +...
ngfor.component.html <StackLayout> <Label *ngFor="let item of items" [text]="item"></Label> </StackLayout> ngfor.component.ts import { Component } from "@angular/core"; var dataItems = ["data-item 1", "data-item 2&quo...
It is possible that the client browser does not support Javascript or have Javascript execution disabled, perhaps due to security reasons. To be able to tell users that a script is supposed to execute in the page, the <noscript> tag can be used. The content of <noscript> is displayed whe...
const url = 'http://api.stackexchange.com/2.2/questions?site=stackoverflow&tagged=javascript'; const questionList = document.createElement('ul'); document.body.appendChild(questionList); const responseData = fetch(url).then(response => response.json()); responseData.then(({item...
This can be done with a bit of modification in the above regex ^(?=.{10,}$)(?=(?:.*?[A-Z]){2})(?=.*?[a-z])(?=(?:.*?[0-9]){2}).*$ or ^(?=.{10,}$)(?=(?:.*[A-Z]){2})(?=.*[a-z])(?=(?:.*[0-9]){2}).* Let's see how a simple regex ^(?=(?:.*?[A-Z]){2}) works on string abcAdefD Image Credit :- ht...
C++17 The [[nodiscard]] attribute can be used to indicate that the return value of a function shouldn't be ignored when you do a function call. If the return value is ignored, the compiler should give a warning on this. The attribute can be added to: A function definition A type Adding the a...
From dataframe: mtrdd <- createDataFrame(sqlContext, mtcars) From csv: For csv's, you need to add the csv package to the environment before initiating the Spark context: Sys.setenv('SPARKR_SUBMIT_ARGS'='"--packages" "com.databricks:spark-csv_2.10:1.4.0" "sparkr-shel...
When pasting text through a terminal emulator, the auto-indent feature may destroy the indentation of the pasted text. For example: function () { echo 'foo' echo 'bar' echo 'baz' } will be pasted as: function () { echo 'foo' echo 'bar' echo 'baz' ...
private final Logger logger = Logger.getLogger(getClass().getCanonicalName()); WebView webView = new WebView(); webEngine = webView.getEngine(); webEngine.setOnAlert(event -> logger.warning(() -> "JS alert: " + event.getData()));
On Julia, you can define more than one method for each function. Suppose we define three methods of the same function: foo(x) = 1 foo(x::Number) = 2 foo(x::Int) = 3 When deciding what method to use (called dispatch), Julia chooses the more specific method that matches the types of the argument...
class ImageCreationExample { static Image createSampleImage() { // instantiate a new BufferedImage (subclass of Image) instance BufferedImage img = new BufferedImage(640, 480, BufferedImage.TYPE_INT_ARGB); //draw something on the image paintOnI...
public static void saveImage(String destination) throws IOException { // method implemented in "Creating a simple image Programmatically and displaying it" example BufferedImage img = createSampleImage(); // ImageIO provides several write methods with different outputs ...
$ gzip extremelylargefile.txt & $ bg $ disown %1 This allows a long running process to continue once your shell (terminal, ssh, etc) is closed.
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\EventDispatcher\GenericEvent; // you may store this in a dependency injection container for use as a service $dispatcher = new EventDispatcher(); // you can attach liste...
This combines queries such that the best (that is, highest-scoring) match of it's subqueries contributes to the final score. List<Query> disjuncts = new ArrayList<Query>(); disjuncts.add(new TermQuery(new Term("fieldname", "hello"))); disjuncts.add(new TermQuery(...
In order to begin using WebRTC you need to get camera and microphone permission.For that you need following things: adapter.js, you can get it from here A html webpage with a video tag and little bit of js code The adapter.js is a JavaScript shim for WebRTC, maintained by Google with help fro...
This is a screenshot of a video playing. You see a normal 16:9 video like you would expect to see in any modern video solution. This - the aspect ratio that the viewer sees - is what is called the display aspect ratio or DAR. From the illustrated parameters, we see that DAR = 1280:720 = 16:9 = 1....
The SwipeDismissBehavior works on any View and implements the functionality of swipe to dismiss in our layouts with a CoordinatorLayout. Just use: final SwipeDismissBehavior<MyView> swipe = new SwipeDismissBehavior(); //Sets the swipe direction for this behavior. ...
import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.sw...
The following command backs up the 'Users' database to 'D:\DB_Backup' file. Its better to not give an extension. BACKUP DATABASE Users TO DISK = 'D:\DB_Backup'

Page 10 of 18