Tutorial by Examples: ai

You would need to install ruby before you can install rails. Mac already comes with ruby installed based on how recent your macOS is? Depending on what ruby version you want for your development, the best way to install Ruby is to use RVM. In your terminal, type the command below listed in step...
public class Foo { public string prop { construct; get; } } Pure-Vala and lightweight class. This is useful if you need a compromise between efficiency of a struct and the feature of a full blown GObject class.
Say "Hello", Rails To get Rails saying "Hello", you need to create at minimum a controller and a view. A controller's purpose is to receive specific requests for the application. Routing decides which controller receives which requests. Often, there is more than one route t...
Now that you have every connection ready, you have to obtain an instance of this interface and invoke its methods to obtain the object you need: VehicleComponent component = Dagger_VehicleComponent.builder().vehicleModule(new VehicleModule()).build(); vehicle = component.provideVehicle(); Toast.m...
See Ellie for a working example. This example uses the NoRedInk/elm-decode-pipeline module. Given a list of JSON objects, which themselves contain lists of JSON objects: [ { "id": 0, "name": "Item 1", "transactions": [ { "id&quo...
You can create a new paint with one of these 3 constructors: new Paint() Create with default settings new Paint(int flags) Create with flags new Paint(Paint from) Copy settings from another paint It is generally suggested to never create a paint object, or any other object in onDraw() as it ...
Text drawing settings setTypeface(Typeface typeface) Set the font face. See Typeface setTextSize(int size) Set the font size, in pixels. setColor(int color) Set the paint drawing color, including the text color. You can also use setARGB(int a, int r, int g, int b and setAlpha(int alpha) setLet...
setStyle(Paint.Style style) Filled shape FILL, Stroke shape STROKE, or both FILL_AND_STROKE setColor(int color) Set the paint drawing color. You can also use setARGB(int a, int r, int g, int b and setAlpha(int alpha) setStrokeCap(Paint.Cap cap) Set line caps, either ROUND, SQUARE, or BUTT (none)...
Having type column in a Rails model without invoking STI can be achieved by assigning :_type_disabled to inheritance_column: class User < ActiveRecord::Base self.inheritance_column = :_type_disabled end
You have to create a XAML file that defines the main window that contains our menu and drawing space. Here's the XAML code in MainWindow.xaml: <!-- This defines the main window, with a menu and a canvas. Note that the Height and Width are overridden in code to be 2/3 the dimensions of the...
namespace Spirograph type MainWindow(app: App, model: Model) as this = inherit MainWindowXaml() let myApp = app let myModel = model let whenLoaded _ = () let whenClosing _ = () let whenClosed _ = () let menuExitHandler _ = System.Wind...
# Define the txt which will be in the email body $Txt_File = "c:\file.txt" function Send_mail { #Define Email settings $EmailFrom = "[email protected]" $EmailTo = "[email protected]" $Txt_Body = Get-Content $Txt_File -RAW $Body = $Body_...
We can use command uname with various options to get complete details of running kernel. uname -a Linux df1-ws-5084 4.4.0-64-generic #85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux As per man page here few more options Usage: uname [OPTION]... Print certain system inf...
First, install ipset if needed. Please refer to your distribution to know how to do it. As an example, here is the command for Debian-like distributions. $ apt-get update $ apt-get install ipset Then create a configuration file to define an ipset containing the IPs for which you want to open ac...
add_theme_support( 'post-thumbnails', array( 'post' ) ); The above code only allows post thumnails on all posts. To enable the feature on all post types, do: add_theme_support( 'post-thumbnails' );
&& chains two commands. The second one runs only if the first one exits with success. || chains two commands. But second one runs only if first one exits with failure. [ a = b ] && echo "yes" || echo "no" # if you want to run more commands within a logical c...
A semicolon separates just two commands. echo "i am first" ; echo "i am second" ; echo " i am third"
The | takes the output of the left command and pipes it as input the right command. Mind, that this is done in a subshell. Hence you cannot set values of vars of the calling process wihtin a pipe. find . -type f -a -iname '*.mp3' | \ while read filename; do mute --noise &quot...
Note: You need to know which data referenced by getReference() first before you can completely understand this example. There are three common method to get your data from Firebase Realtime Database: addValueEventListener() addListenerForSingleValueEvent() addChildEventListener() When w...
import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.widget.T...

Page 40 of 47