Tutorial by Examples

An array of values describes periods of time in which the device is vibrating and not vibrating. window.navigator.vibrate([200, 100, 200]);
The official website contain good exemple of apps: https://www.opencpu.org/apps.html The following code is used to serve a R session: library(opencpu) opencpu$start(port = 5936) After this code is executed, you can use URLs to access the functions of the R session. The result could be XML, h...
OS X Download and run the OS X installer. Windows Download and run the Windows installer 32-bit 64-bit. Debian/Ubuntu Run the following to add our apt repository and install the CLI: $ sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./" $ curl -L https...
You will be asked to enter your Heroku credentials the first time you run a command; after the first time, your email address and an API token will be saved to ~/.netrc for future use. It’s generally a good idea to login and add your public key immediately after installing the Heroku CLI so that yo...
class User extends Model { public function setPasswordAttribute($password) { $this->attributes['password'] = bcrypt($password); } ... } Above code does "bcrypting" each time password property is set. $user = $users->first(); $user->password ...
Suppose we have a SharePoint list and it has four fields viz. Title, Full Name, Email, Mobile Number etc. Now if you want to apply custom validation in New/Edit Item form, you can easily do it with CSR code. The below mentioned can validate following conditions in forms: Blank values in fields ...
Tracking your app in git Before you can push an app to Heroku, you’ll need to initialize a local Git repository and commit your files to it. For example, if you have an app in a directory, myapp, then create a new repository for it: $ cd myapp $ git init Initialized empty Git repository in .git/...
app\Exceptions\Handler.php public function render($request, Exception $exception) { if ($exception instanceof ModelNotFoundException) { abort(404); } return parent::render($request, $exception); } You can catch / handle any exception that is thrown in Laravel.
One example of machine learning algorithms is the Random Forest alogrithm (Breiman, L. (2001). Random Forests. Machine Learning 45(5), p. 5-32). This algorithm is implemented in R according to Breiman's original Fortran implementation in the randomForest package. Random Forest classifier objects ca...
Heroku aggregates three categories of logs for your app: App logs - Output from your application. This will include logs generated from within your application, application server and libraries. (Filter: --source app) System logs - Messages about actions taken by the Heroku platform infras...
Each log line is formatted as follows: timestamp source[dyno]: message Timestamp - The date and time recorded at the time the log line was produced by the dyno or component. The timestamp is in the format specified by RFC5424, and includes microsecond precision. Source - All of your app...
To fetch your logs, use the heroku logs command. $ heroku logs The logs command retrieves 100 log lines by default. You can specify the number of log lines to retrieve (up to a maximum of 1,500 lines) by using the --num (or -n) option. $ heroku logs -n 200 Real-time tail Similar to tail -f,...
If you only want to fetch logs with a certain source, a certain dyno, or both, you can use the --source (or -s) and --dyno (or -d) filtering arguments: $ heroku logs --dyno router 2012-02-07T09:43:06.123456+00:00 heroku[router]: at=info method=GET path="/stylesheets/dev-center/library.css&quo...
- name: Run script as foo user command: bash.sh become: true become_user: foo
- hosts: all become: true - name: Start apache service: apache2 state: started
Lets say continue with User example (you may have controller with store method and update method). To use FormRequests you use type-hinting the specific request. ... public function store(App\Http\Requests\StoreRequest $request, App\User $user) { //by type-hinting the request class, Larave...
Lets have a look at the native app lifecycle methods for different platforms. Android. //Xamarin.Forms.Platform.Android.FormsApplicationActivity lifecycle methods: protected override void OnCreate(Bundle savedInstanceState); protected override void OnDestroy(); protected override void OnPause()...
If the engine is able to correctly predict you're using a specific small type for your values, it will be able to optimize the executed code. In this example, we'll use this trivial function summing the elements of an array and outputting the time it took: // summing properties var sum = (functio...
SELECT item.item_id, ANY_VALUE(uses.tag) tag, COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id shows the rows in a table called item, the count of related rows, and one of the values in the related table called uses. You can th...
If you have a ActiveRecord User class with name and email attributes, you could create a factory for it by making the FactoryGirl guess it: FactoryGirl.define do factory :user do # it will guess the User class name "John" email "[email protected]" end end ...

Page 1075 of 1336