Tutorial by Examples: at

In this XML file, we are specifying the servlet class DispatcherServlet that acts as the front controller in Spring Web MVC. All the incoming request for the HTML file will be forwarded to the DispatcherServlet. <?xml version="1.0" encoding="UTF-8"?> <web-app version...
PHP exposes a number of so-called global variables which contain information about the HTTP request, such as $_POST, $_GET, $_FILES, $_SESSION, etc. The Request class contains a static createFromGlobals() method in order to instantiate a request object based on these variables: use Symfony\Componen...
use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; require 'vendor/autoload.php'; $app = new \Slim\App; $app->get('/employee/view', function ($req, $res) { $con = new mysqli('localhost','USERNAME','PASSWORD','DATABASE'); ...
Sympy is made for symbolic math, so let's have a look at some basic integration and differentiation. from sympy import symbols, sqrt, exp, diff, integrate, pprint x, y = symbols(...
The ternary operator (?:) Support for the extended ternary operator was added in Twig 1.12.0. {{ foo ? 'yes' : 'no' }} Evaluates: if foo echo yes else echo no {{ foo ?: 'no' }} or {{ foo ? foo : 'no' }} Evaluates: if foo echo it, else echo no {{ foo ? 'yes' }} or {{ f...
You can use django rest framework permission classes to check request headers and authenticate user requests Define your secret_key on project settings API_KEY_SECRET = 'secret_value' note: a good practice is to use environment variables to store this secret value. Define a permission ...
Prior to iOS 7 when you want to scan a QR code, we might need to rely on third party frameworks or libraries like zBar or zXing. But Apple introduced AVCaptureMetaDataOutput from iOS 7 for reading barcodes. To read QR code using AVFoundation we need to setup/create AVCaptureSession and use captureO...
One of the features in SugarCRM 7.x is being able to easily add and extend custom endpoints to accomplish what you require. In this example, we'll create a couple of custom endpoints to return some data about the request. This custom file is being placed in custom/clients/base/api/DescriptionAPI.p...
Both are used to define error handling for a website, but different software refers to different config elements. customErrors are a legacy (backwards compatable) element, used by Visual Studio Development Server (aka. VSDS or Cassini). httpErrors are the new element which is only used by IIS7. T...
A quick way to test your xpath is in your browser developer tool console. Format is $x('//insert xpath here') $ - specifies it is a selector. x - specifies it is using xpaths Example: $x("//button[text() ='Submit']") When this command is entered it will return all occurrences...
Suppose you want the user to select keywords from a menu, we can create a script similar to #!/usr/bin/env bash select os in "linux" "windows" "mac" do echo "${os}" break done Explanation: Here select keyword is used to loop through a list ...
In Kotlin, if, try and others are expressions (so they do return a value) rather than (void) statements. So, for example, Kotlin does not have Java's ternary Elvis Operator, but you can write something like this: val i = if (someBoolean) 33 else 42 Even more unfamiliar, but equally expressive, ...
Create the Newsletter model: rails g model Newsletter name:string email:string subl app/models/newsletter.rb validates :name, presence: true validates :email, presence: true Create the Newsletter controller: rails g controller Newsletters create class NewslettersCont...
Templates/Text.html <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> <f:layout name="Default" /> <f:section name="Main"> <f:format.html>{data.bodytext}</f:format.html&gt...
If we want to remove some database connection from the list of database connections. we need to use QSqlDatabase::removeDatabase(),however it's a static function and the way it work is a little wired. // WRONG WAY QSqlDatabase db = QSqlDatabase::database("sales"); QSqlQuery query(&...
Here's an example with the technique(hack) invented by the dostips forums' user Liviu: @echo off echo Printed by CMD.EXE cscript //nologo "%~f0?.wsf" //job:JS //job:VBS exit /b %errorlevel% ----END OF BATCH CODE--- <package> <job id="JS"> <script...
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>project-info-reports</artifactId> <version>2.9</version> <executions> ...
<dependencies> <dependency> <groupId>{ejbModuleGroupId}</groupId> <artifactId>{ejbModuleArtifactId}</artifactId> <version>{ejbModuleVersion}</version> <type>ejb</type> </dependency> &...
An Array Data Structure is used to store similar objects (or data values) in a contiguous block of memory. Array Data Structure has fixed size, which determines the number of data values that can be stored in it. Array : The C++ Way In C++ Programming Language, we can declare a static arr...
1- First all, install https://www.meteor.com/install 2- Create a project. (--bare is to create an empty project) meteor create --bare MyAwesomeProject 3- Create the minimal file structure (-p to create intermediate directories): cd MyAwesomeProject mkdir -p client server imports/api imports/ui/...

Page 419 of 442