Tutorial by Examples: ai

In Ruby, a string is just a sequence of bytes along with the name of an encoding (such as UTF-8, US-ASCII, ASCII-8BIT) that specifies how you might interpret those bytes as characters. Ruby strings can be used to hold text (basically a sequence of characters), in which case the UTF-8 encoding is us...
public class LoginActivity extends BaseAppCompatActivity { @BindView(R.id.tIETLoginEmail) EditText mEditEmail; @BindView(R.id.tIETLoginPassword) EditText mEditPassword; @Override protected void onResume() { super.onResume(); FirebaseUser firebaseUs...
public class ForgotPasswordActivity extends AppCompatActivity { @BindView(R.id.tIETForgotPasswordEmail) EditText mEditEmail; private FirebaseAuth mFirebaseAuth; private FirebaseAuth.AuthStateListener mAuthStateListener; @Override protected void onCreate(Bundle saved...
public class ChangeEmailActivity extends BaseAppCompatActivity implements ReAuthenticateDialogFragment.OnReauthenticateSuccessListener { @BindView(R.id.et_change_email) EditText mEditText; private FirebaseUser mFirebaseUser; @OnClick(R.id.btn_change_email) void onChangeE...
STEP 1: CREATE A DIRECTORY IN HDFS, UPLOAD A FILE AND LIST CONTENTS Let’s learn by writing the syntax. You will be able to copy and paste the following example commands into your terminal: hadoop fs -mkdir: Takes the path URI’s as an argument and creates a directory or multiple directories. Usag...
To work with ConstraintLayout, you need Android Studio Version 2.2 or newer and have at least version 32 (or higher) of Android Support Repository. Add the Constraint Layout library as a dependency in your build.gradle file: dependencies { compile 'com.android.support.constraint:constraint...
To be able to debug an application is very important to understand the flow of an application's logic and data. It helps solving logical bugs and adds value to the programming experience and code quality. Two popular gems for debugging are debugger (for ruby 1.9.2 and 1.9.3) and byebug (for ruby &g...
Using regular recursion, each recursive call pushes another entry onto the call stack. When the recursion is completed, the application has to pop each entry off all the way back down. If there are much recursive function calls it can end up with a huge stack. Scala automatically removes the recurs...
With methods in golang you can do method "chaining" passing pointer to method and returning pointer to the same struct like this: package main import ( "fmt" ) type Employee struct { Name string Age int Rank int } func (empl *Employee) Promote() *...
Use itertools.chain to create a single generator which will yield the values from several generators in sequence. from itertools import chain a = (x for x in ['1', '2', '3', '4']) b = (x for x in ['x', 'y', 'z']) ' '.join(chain(a, b)) Results in: '1 2 3 4 x y z' As an alternate constructo...
Step 1: Create a new Rails app gem install rails -v 4.1 rails new angular_example Step 2: Remove Turbolinks Removing turbolinks requires removing it from the Gemfile. gem 'turbolinks' Remove the require from app/assets/javascripts/application.js: //= require turbolinks Step 3: Add Angu...
Always use Rails.logger.{debug|info|warn|error|fatal} rather than puts. This allows your logs to fit into the standard log format, have a timestamp and have a level so you choose whether they are important enough to be shown in a specific environment. You can see the separate log files for your appl...
$ read -r foo <<EOF > this is a line >EOF $ printf '%s\n' "$foo" this is a line
Basic usage If the value of the href-attribute begins with mailto: it will try to open an email client on click: <a href="mailto:[email protected]">Send email</a> This will put the email address [email protected] as the recipient for the newly created email. Cc and ...
You can use method chaining while working with JSONObject and JSONArray. JSONObject example JSONObject obj = new JSONObject();//Initialize an empty JSON object //Before: {} obj.put("name","Nikita").put("age","30").put("isMarried","true&quot...
Disclaimer: In no way does this example advocate the use of singletons. Singletons are to be used with a lot of care. In PHP there is quite a standard way of implementing a singleton: public class Singleton { private $instance; private function __construct() { }; public function...
Let's say your launch activity is called MainActivity, in your app com.example.myapp. In the manifest: <activity android:name=".MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN"/> ...
You can make a task available to Artisan and to your application in the app/Console/Kernel.php file. The Kernel class contains an array named $commands which make your commands available to your application. Add your command to this array, in order to make it available to Artisan and your applicat...
function createGoogleDriveFileOfMimeType() { var content,fileName,newFile;//Declare variable names fileName = "Test File " + new Date().toString().slice(0,15);//Create a new file name with date on end content = "This is the file Content"; newFile = DriveApp.cre...
This error occurs when tables are not adequately structured to handle the speedy lookup verification of Foreign Key (FK) requirements that the developer is mandating. CREATE TABLE `gtType` ( `type` char(2) NOT NULL, `description` varchar(1000) NOT NULL, PRIMARY KEY (`type`) ) ENGINE=InnoD...

Page 18 of 47