Tutorial by Examples: er

Consider next example: public interface A { default void foo() { System.out.println("A.foo"); } } public interface B { default void foo() { System.out.println("B.foo"); } } Here are two interfaces declaring default method foo with the same signature. If you wi...
package main import ( "fmt" "time" log "github.com/Sirupsen/logrus" mgo "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" ) var mongoConn *mgo.Session type MongoDB_Conn struct { Host string `json:"Host"` ...
public class RecyclerTouchListener implements RecyclerView.OnItemTouchListener { private GestureDetector gestureDetector; private RecyclerTouchListener.ClickListener clickListener; public RecyclerTouchListener(Context context, final RecyclerView recyclerView, final RecyclerTouchL...
Within the Schema Builder, use the Schema facade with any connection. Run the connection() method to specify which connection to use: Schema::connection('mysql2')->create('some_table', function($table) { $table->increments('id'): });
Similar to Schema Builder, define a connection on the Query Builder: $users = DB::connection('mysql2')->select(...);
This function tells whether a given time lies within a a given time interval. (require '[clj-time.core :as t]) (def date1 (t/date-time 2016 11 5)) (def date2 (t/date-time 2016 12 5)) (def test-date1 (t/date-time 2016 12 20)) (def test-date2 (t/date-time 2016 11 15)) (t/within? (t/interva...
Above example helps us how to turn on SSH on Pi. This example is the prerequisite of above example. For Linux OS: Open the terminal and write down this ssh pi@your local IP address. Then you will need to provide the password. Note: Here pi: your raspberry pi username and your local IP address: th...
Imagine many users all running a web application that is trying to increment a counter in the database. Each user must read the current count, add one and write out the updated value. To make sure no one reads the counter while someone else is is adding one we use a transaction: ref.transaction(fun...
// Remove the auto-paragraph and auto-line-break from the content remove_filter( 'the_content', 'wpautop' ); // Remove the auto-paragraph and auto-line-break from the excerpt remove_filter( 'the_excerpt', 'wpautop' );
/** * Remove the automatic line breaks from content and excerpts. * * @since 1.0.0 */ function remove_content_auto_line_breaks() { // Remove the auto-paragraph and auto-line-break from the content remove_filter( 'the_content', 'wpautop' ); // Remove the auto-paragraph and a...
Every Heroku app runs in at least two environments: on Heroku (we’ll call that production) and on your local machine (development). If more than one person is working on the app, then you’ve got multiple development environments - one per machine, usually. Usually, each developer will also have a te...
To run the script analyzer against a single script file execute: Invoke-ScriptAnalyzer -Path myscript.ps1 This will analyze your script against every built-in rule. If your script is sufficiently large that could result in a lot of warnings and/or errors. To run the script analyzer against a w...
SET v_column_definition := CONCAT( v_column_name ,' ',v_column_type ,' ',v_column_options ); SET @stmt := CONCAT('ALTER TABLE ADD COLUMN ', v_column_definition); PREPARE stmt FROM @stmt; EXECUTE stmt; DEALLOCATE PREPARE stmt;
To allow a bokeh application to be executed like a normal .py file, you need to handle the tornado IOloop in your application, as described here. A standalone bokeh application like this can be used to implement a console script entry point in setup.py. However, this requires bokeh version >= 0....
Hot Module Replacement allows to add, change or delete app module when application is running. Page reloading is not needed in this case. Prerequisites In addition to webpack-dev-middleware packages: npm install --save-dev webpack-hot-middleware Configuration Simply update configuration of UseW...
You can use aspnetcore-spa generator for Yeoman to create brand-new single page application with asp.net core. This allows you to choose one of the popular front end frameworks and generates project with webpack, dev server, hot module replacement and server-side rendering features. Just run npm ...
This example helper class interacts with the finger print manager and performs encryption and decryption of password. Please note that the method used for encryption in this example is AES. This is not the only way to encrypt and other examples exist. In this example the data is encrypted and decryp...
The clj-time.coerce library can help converting other date-time formats to joda time format (clj-time.core/date-time). The other formats include Java long format, String, Date, SQL Date. To convert time from other time formats, include the library and use the from- function, e.g. (require '[clj-ti...
Kotlin Plugin for Android Studio support converting existing Java files to Kotlin files. Choose a Java file and invoke action Convert Java File to Kotlin File:
The simplest of the five trigger types, the Trigger is responsible for setting properties based on other properties within the same control. <TextBlock> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> <Style.Triggers> ...

Page 378 of 417