Tutorial by Examples: amp

Creating a chart that displays a static dataset is relatively simple. For example, if we have this array of objects as the data: var data = [ {title: "A", value: 53}, {title: "B", value: 12}, {title: "C", value: 91}, {title: "D", value: 24...
super keyword performs important role in three places Constructor Level Method Level Variable Level Constructor Level super keyword is used to call parent class constructor. This constructor can be default constructor or parameterized constructor. Default constructor : super(); Pa...
Select a font and fontsize, select location, show string. %!PS /Palatino-Roman 20 selectfont 300 400 moveto (Hello, World!) show showpage Notes and common pitfalls: Failing to set a font (resulting in either no text or a default (ugly) font) Using findfont and setfont but forgettin...
WampServer is a Windows web development environment. It allows you to create web applications with Apache2, PHP and a MySQL database. Alongside, PhpMyAdmin allows you to manage easily your databases. WampServer is available for free (under GPML license) in two distinct versions : 32 and 64 bits. Wa...
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...
app.component.ts: import {Component,OnInit} from "@angular/core"; import placeholder = require("ui/placeholder"); let application= require("application"); @Component({ selector: "my-app", templateUrl: "app.component.html", }) export...
If the SQL statement is constructed like this: SQL = "SELECT * FROM Users WHERE username = '" + user + "' AND password ='" + pw + "'"; db.execute(SQL); Then a hacker could retrieve your data by giving a password like pw' or '1'='1; the resulting SQL statement will ...
Count articles connected to a particular person over time MATCH (n)-[]->(l) where l.name='Donald Trump' RETURN n.date,count(*) order by n.date Search for other People / Locations connected to the same news articles as Trump with at least 5 total relationship nodes. MATCH (n:NewsArticle)-[...
Startup # Load library setwidth on start - to set the width automatically. .First <- function() { library(setwidth) # If 256 color terminal - use library colorout. if (Sys.getenv("TERM") %in% c("xterm-256color", "screen-256color")) { library("col...
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 ...
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...
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 ...
Visual Studio (IDE) WPA (performance analyzer) WinDbg (debugger) IDA Pro (disassembler) dotPeek (decompiler for .NET) WinMerge (diff tool) HxD or 010 editor (hex editor) Speedcrunch (calculator) Firefox (browser) Rohitab API monitor (API call monitoring) SOS (a WinDbg extension for .NET)...
The following is a simple example Perl test script, that gives some structure to allow for testing of other methods in the class/package under test. The script produces standard output with simple "ok" / "not ok" text, which is called TAP (Test Anything Protocol). Typically the...
#!/usr/bin/env perl use Dancer2; get '/' => sub { "Hello World!" }; dance;
Writing and executing a simple TestNG program is mainly 3 step process. Code - write business logic of your test and annotate it with TestNG annotations Configure - add information of your test in testng.xml or in build.xml Run TestNG - it can be invoked from command line, ANT, IDE like Eclipse...
<?php // hook into the init action and call create_book_taxonomies when it fires add_action( 'init', 'create_book_taxonomies', 0 ); // create taxonomy genres for the post type "book" function create_book_taxonomies() { // Add new taxonomy, make it hierarchical (like categorie...
Given: --- variable_name: True Then, these tasks with always run. - name: This is a conditional task module: src=/example/ dest=/example when: variable_name - name: This is a conditional task module: src=/example/ dest=/example when: True This task will never run. - name: T...
Real life use cases for Singleton pattern; If you are developing a client-server application, you need single instrance of ConnectionManager, which manages the life cycle of client connections. The basic APIs in ConnectionManager : registerConnection: Add new connection to existing list of connec...
In most cases, the range_lookup is used as FALSE (an exact match). The default for this parameter is TRUE - it is less commonly used in this form, but this example shows one usecase. A supermarket gives a bonus based on the customers monthly spend. If the customer spends 250 EUR or more in a mon...

Page 18 of 46