Tutorial by Examples

Throughout the topics and examples here we'll see many declarations of variables, functions and so on. As well as their name, data objects may have attributes. Covered in this topic are declaration statements like integer, parameter :: single_kind = kind(1.) which gives the object single_kind...
Using the document-ready event can have small performance drawbacks, with delayed execution of up to ~300ms. Sometimes the same behavior can be achieved by execution of code just before the closing </body> tag: <body> <span id="greeting"></span> world! <sc...
You can create a task (Console Command) in Laravel using Artisan. From your command line: php artisan make:console MyTaskName This creates the file in app/Console/Commands/MyTaskName.php. It will look like this: <?php namespace App\Console\Commands; use Illuminate\Console\Command; c...
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...
When your command is made available to your application, you can use Laravel to schedule it to run at pre-defined intervals, just like you would a CRON. In The app/Console/Kernel.php file you will find a schedule method that you can use to schedule your task. <?php namespace App\Console; ...
The scheduler can be run using the command: php artisan schedule:run The scheduler needs to be run every minute in order to work correctly. You can set this up by creating a cron job with the following line, which runs the scheduler every minute in the background. * * * * * php /path/to/artisan...
Detailed instructions on getting LabVIEW set up or installed.
Plot With Grid Lines import matplotlib.pyplot as plt # The Data x = [1, 2, 3, 4] y = [234, 124,368, 343] # Create the figure and axes objects fig, ax = plt.subplots(1, figsize=(8, 6)) fig.suptitle('Example Of Plot With Grid Lines') # Plot the data ax.plot(x,y) # Show the grid lin...
The easiest method to bypass cache is to change the URL. This is used as a best practice when the URL contains a version or a checksum of the resource, e.g. http://example.com/image.png?version=1 http://example.com/image.png?version=2 These two URLs will be cached separately, so even if …?versi...
This example displays a transaction for an image view with only two images.(can use more images as well one after the other for the first and second layer positions after each transaction as a loop) add a image array to res/values/arrays.xml <resources> <array name=&...
tree = log --oneline --decorate --source --pretty=format:'"%Cblue %h %Cgreen %ar %Cblue %an %C(yellow) %d %Creset %s"' --all --graph example * 40554ac 3 months ago Alexander Zolotov Merge pull request #95 from gmandnepr/external_plugins |\ | * e509f61 3 months ago Ievg...
It is common for an AsyncTask to require a reference to the Activity that called it. If the AsyncTask is an inner class of the Activity, then you can reference it and any member variables/methods directly. If, however, the AsyncTask is not an inner class of the Activity, you will need to pass an A...
If your team is following a rebase-based workflow, it may be a advantageous to setup git so that each newly created branch will perform a rebase operation, instead of a merge operation, during a git pull. To setup every new branch to automatically rebase, add the following to your .gitconfig or .gi...
Copy foo.txt from /path/to/source/ to /path/to/target/folder/ cp /path/to/source/foo.txt /path/to/target/folder/ Copy foo.txt from /path/to/source/ to /path/to/target/folder/ into a file called bar.txt cp /path/to/source/foo.txt /path/to/target/folder/bar.txt
copy folder foo into folder bar cp -r /path/to/foo /path/to/bar if folder bar exists before issuing the command, then foo and its content will be copied into the folder bar. However, if bar does not exist before issuing the command, then the folder bar will be created and the content of foo wil...
head [1..10] -- 1 last [1..20] -- 20 tail [1..5] -- [2, 3, 4, 5] init [1..5] -- [1, 2, 3, 4] length [1 .. 10] -- 10 reverse [1 .. 10] -- [10, 9 .. 1] take 5 [1, 2 .. ] -- [1, 2, 3, 4, 5] drop 5 [1 .. 10] -- [6, 7, 8, 9, 10]...
To change the URL of the repository you want your remote to point to, you can use the set-url option, like so: git remote set-url <remote_name> <remote_repository_url> Example: git remote set-url heroku https://git.heroku.com/fictional-remote-repository.git
Express is based on Connect, which is what provides the middleware functionality of Express. To understand what connect is, you can see that it provides the basic app structure that you use when you use express const connect = require('connect') const app = connect() app.listen(3000) This wi...
Middleware are attached to the app object, usually before listen is called. Example of a simple logging middleware: app.use(function (req, res, next) { console.log(`${req.method}: ${req.url}`) next() }) All this will do is log GET: /example if you where to GET localhost:3000/example. ...
If we would like to limit the access to our app, we could write a middleware for that too! This example only grants you access on thrusdays, but a real world example could, for example, be user authentication. A good place to put this would be after the logging middleware but before any content is s...

Page 541 of 1336