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(...
Using the command git tag lists out all available tags:
$ git tag
<output follows>
v0.1
v1.3
Note: the tags are output in an alphabetical order.
One may also search for available tags:
$ git tag -l "v1.8.5*"
<output follows>
v1.8.5
v1.8.5-rc0
v1.8.5-rc1
v1.8.5...
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...
In Kotlin, variable declarations look a bit different than Java's:
val i : Int = 42
They start with either val or var, making the declaration final ("value") or variable.
The type is noted after the name, separated by a :
Thanks to Kotlin's type inference the explicit typ...
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...
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 ...
Example of a TCA field configuration where you can select records from a table
'my_topfeatures' => array(
'label' => 'Select Topfeatures',
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'size' => '4',
...
If a file is changed, but you don't like to commit it, set the file as "Assume unchanged"
Revert "Assume unchanged"
Need some steps:
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...
DEBUG command was used to create binaries/executabled from batch file. The command is still available in 32bit versions of windows , but is able to create binaries only with 16bit instructions with makes it unusable for 64bit machines. Now CERTUTIL is used for that purpose which allows to decode/enc...
For example, consider the following that sets the contents of $@ to the contents of a given variable:
a=(1 2 3)
eval set -- "${a[@]}"
This code is often accompanied by getopt or getopts to set $@ to the output of the aforementioned option parsers, however, you can also use it to creat...
These are loops in which their loop body contains no other loops (the innermost loop in case of nested).
In order to have loop coverage, testers should exercise the tests given below.
Test 1 :Design a test in which loop body shouldn’t execute at all (i.e. zero iterations)
Test 2 :Design a test in...