# Define a class
class TypeName
{
# Property with validate set
[ValidateSet("val1", "Val2")]
[string] $P1
# Static property
static [hashtable] $P2
# Hidden property does not show as result of Get-Member
hidden [int] $P3
# Constructor
Ty...
A JavaScript Iterator is an object with a .next() method, which returns an IteratorItem, which is an object with value : <any> and done : <boolean>.
A JavaScript AsyncIterator is an object with a .next() method, which returns a Promise<IteratorItem>, a promise for the next value.
...
Groups can be configured under Suite and/or Test element of testng.xml. All groups which are marked as included in tesng.xml will be considered for execution, excluded one will be ignored. If a @Test method has multiple groups and from those groups if any single groups is excluded in testng.xml that...
The following command backs up the 'Users' database to 'D:\DB_Backup' file. Its better to not give an extension.
BACKUP DATABASE Users TO DISK = 'D:\DB_Backup'
Define the function using the vararg keyword.
fun printNumbers(vararg numbers: Int) {
for (number in numbers) {
println(number)
}
}
Now you can pass as many parameters (of the correct type) into the function as you want.
printNumbers(0, 1) // Prints "0&qu...
import curses
import traceback
try:
# -- Initialize --
stdscr = curses.initscr() # initialize curses screen
curses.noecho() # turn off auto echoing of keypress on to screen
curses.cbreak() # enter break mode where pressing Enter key
...
BEGIN TRY -- start error handling
BEGIN TRANSACTION; -- from here on transactions (modifictions) are not final
-- start your statement(s)
select 42/0 as ANSWER -- simple SQL Query with an error
-- end your statement(s)
COMMIT TRANSACTION; -- finalize all transa...
The simple use-case is to refer to a single icon in its normal size:
<i class="fa fa-camera-retro"></i> (View result in this fiddle.)
Create an empty tag (it is recommended to use <i> used for that) and assign class "fa" and the class corresponding to the desi...
Font icons are usually placed inside a <i> tag. Ionic has default css styles for the icons for easy use. The most basic example of use:
<i class="icon ion-home"></i>
In this example I define two custom function.
1 - countryFilter function get's the country short code as input and return the country full name.
2 - _countPrinterTasks is used to calculate the no of tasks assigned to a particular user.
<?php
namespace DashboardBundle\Twig\Extension;
use ...
R-markdown code chunks
R-markdown is a markdown file with embedded blocks of R code called chunks. There are two types of R code chunks: inline and block.
Inline chunks are added using the following syntax:
`r 2*2`
They are evaluated and inserted their output answer in place.
Block chunks hav...
Preemptive basic authentication is the practice of sending http basic authentication credentials (username and password) before a server replies with a 401 response asking for them. This can save a request round trip when consuming REST apis which are known to require basic authentication.
As descr...
Using HttpClient as RestTemplate's underlying implementation to create HTTP requests allows for automatic handling of basic authentication requests (an http 401 response) when interacting with APIs. This example shows how to configure a RestTemplate to achieve this.
// The credentials are stored he...
Possessive quantifiers are another class of quantifiers in many regex flavours that allow backtracking to, effectively, be disabled for a given token. This can help improve performance, as well as preventing matches in certain cases.
The class of possessive quantifiers can be distinguished from laz...
A Bootstrap modal dialog is a Bootstrap component which creates a modal dialog window which floats over page-level content.
Here is an example of the basic usage of a Bootstrap modal dialog in HTML:
<div class="modal fade" tabindex="-1" role="dialog">
<div...
Modal dialog components can be instantiated via jQuery with the function $('#myModal').modal(options), where $('#myModal') is a top-level reference to the specific modal dialog and options is a Javascript object specifying the modal dialog's default attributes.
The options object allows for multipl...