Tutorial by Examples: ect

To find the largest or smallest element stored in a vector, you can use the methods std::max_element and std::min_element, respectively. These methods are defined in <algorithm> header. If several elements are equivalent to the greatest (smallest) element, the methods return the iterator to th...
<svg width="400" height="400"> <defs> <pattern id="pattern1" width="0.2" height="0.2" patternUnits="objectBoundingBox"> <circle cx="10" cy="10" r="10" fill="#0000ff" /&...
Clickjacking is a malicious technique of tricking a Web user into clicking on something different from what the user perceives they are clicking on. Learn more To enable clickjacking protection, add the XFrameOptionsMiddleware to your middleware classes. This should already be there if you didn...
if we want to change the Controllers directory we need: Move and/or rename the default Controllers directory where we want it. For example from app/Http/Controllers to app/Controllers Update all the namespaces of the files inside the Controllers folder, making they adhere to the new path, re...
function assign(obj, prop, value) { if (typeof prop === 'string') prop = prop.split('.'); if (prop.length > 1) { var e = prop.shift(); assign(obj[e] = Object.prototype.toString.call(obj[e]) === '[object Object]' ? obj[e] ...
JavaFX 8 The following example demonstrates how to add custom properties that can be styled from css to a custom Node. Here 2 DoublePropertys are added to the Rectangle class to allow setting the width and height from CSS. The following CSS could be used for styling the custom node: StyleableRe...
UCanAccess is a pure Java JDBC driver that allows us to read from and write to Access databases without using ODBC. It uses two other packages, Jackcess and HSQLDB, to perform these tasks. Once it has been set up*, we can work with data in .accdb and .mdb files using code like this: import java.sq...
Case classes provide a copy method that creates a new object that shares the same fields as the old one, with certain changes. We can use this feature to create a new object from a previous one that has some of the same characteristics. This simple case class to demonstrates this feature: case cla...
A Subject in RxJava is a class that is both an Observable and an Observer. This basically means that it can act as an Observable and pass inputs to subscribers and as an Observer to get inputs from another Observable. Subject<String, String> subject = PublishSubject.create(); subject.subscr...
PublishSubject emits to an Observer only those items that are emitted by the source Observable subsequent to the time of the subscription. A simple PublishSubject example: Observable<Long> clock = Observable.interval(500, TimeUnit.MILLISECONDS); Subject<Long, Long> subjectLong = Publi...
This example connects to a Wi-Fi access point with WEP encryption, given an SSID and the password. public boolean ConnectToNetworkWEP(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID ...
This example connects to a Wi-Fi access point with WPA2 encryption. public boolean ConnectToNetworkWPA(String networkSSID, String password) { try { WifiConfiguration conf = new WifiConfiguration(); conf.SSID = "\"" + networkSSID + "\""; // Please note th...
R has a number of build in constants. The following constants are available: LETTERS: the 26 upper-case letters of the Roman alphabet letters: the 26 lower-case letters of the Roman alphabet month.abb: the three-letter abbreviations for the English month names month.name: the English names fo...
I have the following list: 1. Alon Cohen 2. Elad Yaron 3. Yaron Amrani 4. Yogev Yaron I want to select the first name of the guys with the Yaron surname. Since I don't care about what number it is I'll just put it as whatever digit it is and a matching dot and space after it from the beginni...
Managing AWS resources that scale up and down runs into the limits of the static inventory host file, that's why we need something dynamic. And that's what the dynamic inventories are for. Let's start: Download these ec2.ini and ec2.py files to the your project folder: cd my_ansible_project wget...
CREATE TABLE stack( id INT, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL ); INSERT INTO stack (`id`, `username`, `password`) VALUES (1, 'Foo', 'hiddenGem'); INSERT INTO stack (`id`, `username`, `password`) VALUES (2, 'Baa', 'verySecret'); Query SELECT id FROM ...
Query SELECT * FROM stack; Result +------+----------+----------+ | id | username | password | +------+----------+----------+ | 1 | admin | admin | | 2 | stack | stack | +------+----------+----------+ 2 rows in set (0.00 sec) You can select all columns from one table...
Query SELECT * FROM stack WHERE username = "admin" AND password = "admin"; Result +------+----------+----------+ | id | username | password | +------+----------+----------+ | 1 | admin | admin | +------+----------+----------+ 1 row in set (0.00 sec) Query...
CREATE TABLE stack ( id int AUTO_INCREMENT PRIMARY KEY, username VARCHAR(100) NOT NULL ); INSERT stack(username) VALUES ('admin'),('k admin'),('adm'),('a adm b'),('b XadmY c'), ('adm now'), ('not here'); "adm" anywhere: SELECT * FROM stack WHERE username LIKE "%adm%&q...
SQL aliases are used to temporarily rename a table or a column. They are generally used to improve readability. Query SELECT username AS val FROM stack; SELECT username val FROM stack; (Note: AS is syntactically optional.) Result +-------+ | val | +-------+ | admin | | stack | +----...

Page 32 of 99