Tutorial by Examples: am

This UNION ALL combines data from multiple tables and serve as a table name alias to use for your queries: SELECT YEAR(date_time_column), MONTH(date_time_column), MIN(DATE(date_time_column)), MAX(DATE(date_time_column)), COUNT(DISTINCT (ip)), COUNT(ip), (COUNT(ip) / COUNT(DISTINCT (ip))) AS Ratio ...
Suppose you have a button in your Java program that counts down a time. Here is the code for 10 minutes timer. private final static long REFRESH_LIST_PERIOD=10 * 60 * 1000; //10 minutes Timer timer = new Timer(1000, new ActionListener() { @Override public void actionPerformed(ActionEve...
Install openfire or any chat server in your system or on server. For more details click here. Create android project and add these libraries in gradle: compile 'org.igniterealtime.smack:smack-android:4.2.0' compile 'org.igniterealtime.smack:smack-tcp:4.2.0' compile 'org.igniterealtime.smack:smac...
Create a class name ErrorMatcher inside your test package with below code: public class ErrorMatcher { @NonNull public static Matcher<View> withError(final String expectedErrorText) { Checks.checkNotNull(expectedErrorText); return new BoundedMatcher<View, ...
libraryDependency is the SettingKey that handles 'managed' library dependencies, which are dependencies that are automatically downloaded, matching the supplied versions. To add a single dependency: libraryDependencies += "com.typesafe.slick" %% "slick" % "3.2.0-M1" ...
Q. Why we need compilation? Ans. We need compilation for achieving higher level of efficiency of our Angular applications. Take a look at the following example, // ... compile: function (el, scope) { var dirs = this._getElDirectives(el); var dir; var scopeCreated; dirs.forEach(functi...
If you want to instantiate an instance of user control inside ASPX code behind page, you need to write user control declaration on Page_Load event as follows: public partial class Default : System.Web.UI.Page { protected void Page_Load(Object sender, EventArgs e) { Control contr...
Assume that we are using Page object model. Page Object class: import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public cla...
This example illustrates how to read various-type struct entries from MATLAB, and pass it to C equivalent type variables. While it is possible and easy to figure out from the example how to load fields by numbers, it is here achieved via comparing the field names to strings. Thus the struct fields ...
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SDKSample.ControlTemplateButtonWindow" Title="Button with Control Template" Height=&quo...
// register activation hook register_activation_hook( __FILE__, 'example_activation' ); // function for activation hook function example_activation() { // check if scheduled hook exists if ( !wp_next_scheduled( 'my_event' )) { // Schedules a hook // time() - the f...
from selenium import webdriver # Create a new webdriver driver = webdriver.Chrome() # Get a page that has a popup window (Use mouse to click "try it" button) driver.get("http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert") # Accept the opened alert driver.switch_t...
This examples shows how to build a JavaFX application, where the language can be switched dynamically while the application is running. These are the message bundle files used in the example: messages_en.properties: window.title=Dynamic language change button.english=English button.german=Germa...
Sometimes a build combines multiple source directories, each of which is their own 'project'. For instance, you might have a build structure like this: projectName/ build.sbt project/ src/ main/ ... test/ ... core/ src/ main/ ... test/ ... webapp/ src/ main/ ... test/ ... In t...
If you've got an interface with a generic type parameter, Spring can use that to only autowire implementations that implement a type parameter you specify. Interface: public interface GenericValidator<T> { public T validate(T object); } Foo Validator Class: @Component public class...
import numpy as np import cv2 #access a video from your disk #to use the GIF in this example, convert to avi! cap = cv2.VideoCapture('eg_videoRead.avi') #we are going to read 10 frames #we store the frames in a numpy structure #then we'll generate a minimum projection of those frame...
There are many classes available in CIM and WMI which are separated into multiple namespaces. The most common (and default) namespace in Windows is root/cimv2. To find the righ class, it can useful to list all or search. List available classes You can list all available classes in the default name...
When Java annotations were first introduced there was no provision for annotating the target of an instance method or the hidden constructor parameter for an inner classes constructor. This was remedied in Java 8 with addition of receiver parameter declarations; see JLS 8.4.1. The receiver param...
myfunc(){ echo "I will never be executed." } another_func(){ # this "redeclare" overwrites original function myfunc(){ echo "I am the one and only"; } } # myfunc will print "I will never be executed" myfunc # but if we call another_func fi...
Django Admin comes with some Models registerd by default. There a some occasions where you might want to remove a Model from the admin pages. This is done in the admin submodule. If your app wass created using manage.py startapp, the admin.py file should already lay in your app module. Otherwise cr...

Page 81 of 129