Tutorial by Examples: e

Pre-processing in caret is done through the preProcess() function. Given a matrix or data frame type object x, preProcess() applies transformations on the training data which can then be applied to testing data. The heart of the preProcess() function is the method argument. Method operations are ap...
It is possible to perform ViewActions on a view using the perform method. The ViewActions class provides helper methods for the most common actions, like: ViewActions.click() ViewActions.typeText() ViewActions.clearText() For example, to click on the view: onView(...).perform(click()); onVi...
With the ViewMatchers you can find view in the current view hierarchy. To find a view, use the onView() method with a view matcher which selects the correct view. The onView() methods return an object of type ViewInteraction. For example, finding a view by its R.id is as simple as: onView(withId(...
Classes are vital aspects of OOP. A class is like the "blueprint" of an object. An object has the properties of a class, but the characteristics are not defined within the class itself. As each object can be different, they define their own characteristics. Public Class Person End Class ...
Inherits Specifies the base (or parent) class Public Class Person End Class Public Class Customer Inherits Person End Class 'One line notation Public Class Student : Inherits Person End Class Possible objects: Dim p As New Person Dim c As New Customer Dim s As New Student ...
Overridable Allows a property or method in a class to be overridden in a derived class. Public Class Person Public Overridable Sub DoSomething() Console.WriteLine("Person") End Sub End Class Overrides Overrides an Overridable property or method defined in the base...
The MyBase keyword behaves like an object variable that refers to the base class of the current instance of a class. Public Class Person Public Sub DoSomething() Console.WriteLine("Person") End Sub End Class Public Class Customer Inherits Person Public S...
Me uses the current object instance. MyClass uses the memberdefinition in the class where the member is called Class Person Public Overridable Sub DoSomething() Console.WriteLine("Person") End Sub Public Sub useMe() Me.DoSomething() End Sub ...
Overloading is the creation of more than one procedure, instance constructor, or property in a class with the same name but different argument types. Class Person Overloads Sub Display(ByVal theChar As Char) ' Add code that displays Char data. End Sub Overloads Sub Display...
Public Interface IPerson Sub DoSomething() End Interface Public Class Customer Implements IPerson Public Sub DoSomething() Implements IPerson.DoSomething Console.WriteLine("Customer") End Sub End Class
Chart.js can be included in several different ways: NPM Run the following command on your NPM project directory npm install chart.js --save CDN Include a script tag in your HTML linking to the chart.js CDN <html> <body> <script type="text/javascript" s...
In C, character constants and string literals are different things. A character surrounded by single quotes like 'a' is a character constant. A character constant is an integer whose value is the character code that stands for the character. How to interpret character constants with multiple charac...
To know the path of the directory your file is in you can use: Esc to enter command mode :pwd This will print the path to the directory at the bottom of the editor, like this I'm a ninja ~ ~ ~ ~ ~ /home/ubuntu/myfolder 1,5 All Now...
SQLite is a lightweight, disk-based database. Since it does not require a separate database server, it is often used for prototyping or for small applications that are often used by a single user or by one user at a given time. import sqlite3 conn = sqlite3.connect("users.db") c = con...
Interface declaration for downloading a file public interface ApiInterface { @GET("movie/now_playing") Call<MovieResponse> getNowPlayingMovies(@Query("api_key") String apiKey, @Query("page") int page); // option 1: a resource relative to your bas...
Returns a string (varchar or nvarchar) where all occurrences of a specified sub string is replaced with another sub string. Parameters: string expression. This is the string that would be searched. It can be a character or binary data type. pattern. This is the sub string that would be replaced...
# will retrieve my home path ENV['HOME'] # => "/Users/username" # will try retrieve the 'FOO' environment variable. If failed, will get 'bar' ENV.fetch('FOO', 'bar')
There are two ways to get singleton class of an object singleton_class method. Reopening singleton class of an object and returning self. object.singleton_class singleton_class = class << object self end
Singleton classes share their instance/class variables with their object. class Example @@foo = :example end def Example.foo class_variable_get :@@foo end Example.foo #=> :example class Example def initialize @foo = 1 end def foo @foo end end e = Ex...
In Normal, type the following to delete a range of lines into a named register :10,20d a This will delete lines 10,20 in register "a. We can verify this by typing :reg This will show the text that was delete in register "a. To paste the contents in "a, just type "ap ...

Page 511 of 1191