Tutorial by Examples

Create web directory in same folder as the vendor directory. Create index.php file in web directory with contents <?php // web/index.php require_once __DIR__.'/../vendor/autoload.php'; $app = new Silex\Application(); $app->get("/", function () { return "Hello wo...
Detailed instructions on getting ansible-playbook set up or installed.
There are several ways interact with an Xml file. Xml Document XDocument XmlReader/XmlWriter Before LINQ to XML we were used XMLDocument for manipulations in XML like adding attributes, elements and so on. Now LINQ to XML uses XDocument for the same kind of thing. Syntaxes are much easie...
To enable MySQL, a database driver is needed. For example github.com/go-sql-driver/mysql. import ( "database/sql" _ "github.com/go-sql-driver/mysql" )
Opening a database is database specific, here there are examples for some databases. Sqlite 3 file := "path/to/file" db_, err := sql.Open("sqlite3", file) if err != nil { panic(err) } MySql dsn := "mysql_username:CHANGEME@tcp(localhost:3306)/dbname" db, e...
Detailed instructions on getting slf4j set up or installed.
Detailed instructions on getting IBM MQ set up or installed.
Django REST Framework has some authentication methods already built in, one of them is Token based, so first thing to do is to tell our project we’re going to use rest framework’s authentication. Open settings.py file and add the highlighted line. INSTALLED_APPS = ( 'django.contrib.admin', ...
Token authentication functionality assigns a token to a user, so each time you use that token, the request object will have a user attribute that holds the user model information. Easy, isn’t it? We’ll create a new POST method to return the token for this user, as long as the request holds a correc...
Let’s create a new View that requires this authentication mechanism. We need to add these import lines: from rest_framework.authentication import TokenAuthentication from rest_framework.permissions import IsAuthenticated and then create the new View in the same views.py file class AuthView(AP...
If a curl would be run against this endpoint curl http://localhost:8000/auth/ op : {"detail": "Authentication credentials were not provided."}% would return a 401 error UNAUTHORIZED but in case we get a token before: curl -X POST -d "user=Pepe&password=aaaa&qu...
Components let you split the UI into independent, reusable pieces. This is the beauty of React; we can separate a page into many small reusable components. Prior to React v14 we could create a stateful React component using React.Component (in ES6), or React.createClass (in ES5), irrespective of wh...
Access modifiers are used to control the access to an object or to a function/method. This is a main part of the concept of Abstraction. Different programming languages use different access modifiers. Here are some examples: Java Java has 4 access modifiers. private - These attributes can ...
use Time::HiRes qw( time ); my $start = time(); #Code for which execution time is calculated sleep(1.2); my $end = time(); printf("Execution Time: %0.02f s\n", $end - $start); This will print execution time of Code in seconds
<div class="row"> <div class="col-sm-9"> Level 1: .col-sm-9 <div class="row"> <div class="col-xs-8 col-sm-6"> Level 2: .col-xs-8 .col-sm-6 </div> <div class="col-xs-4 col-sm-6&quo...
If you want to take a screenshot of a particular View v, then you can use the following code: Bitmap viewBitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.RGB_565); Canvas viewCanvas = new Canvas(viewBitmap); Drawable backgroundDrawable = v.getBackground(); if(backgroundD...
If you installed Laravel via Composer or the Laravel installer, below configuration you will need. Configuration for Apache Laravel includes a public/.htaccess file that is used to provide URLs without the index.php front controller in the path. Before serving Laravel with Apache, be sure to enabl...
Detailed instructions on getting cpanel set up or installed.
The first code block is written in Bootstrap 3. In Bootstrap 3 there are 4 types of column specifications, namely col-md-* col-lg-* col-sm-* col-xs-* . A fully responsive layout will look like this in Bootstrap 3: <div class="row"> <div class="col-lg-4 col-md-8 col-sm-8...
In twitter-bootstrap 4 the support for IE8, IE9, and iOS 6 has been dropped. v4 is now only IE10+ and iOS 7+. For sites needing either of those, use v3. In twitter-bootstrap 4 the official support for Android v5.0 Lollipop’s Browser and WebView has been Added. Earlier versions of the Android Brows...

Page 1142 of 1336