Tutorial by Examples: cte

This trick helps you select an element using the ID as a value for an attribute selector to avoid the high specificity of the ID selector. HTML: <div id="element">...</div> CSS #element { ... } /* High specificity will override many selectors */ [id="element&quo...
The DatePicker class has a property, SelectedDate, which enable you to get or set the selected date. If there is none selected, it means its value will be null. if (datePicker.SelectedDate == null) { // Do what you have to do }
2005 The following iterates over the characters of the string s. It works similarly for looping over the elements of an array or a set, so long as the type of the loop-control variable (c, in this example) matches the element type of the value being iterated. program ForLoopOnString; {$APPTYPE ...
This test class will test the IsBlank(...) method of SomeClass. Below is the example SomeClass. This class has only the one, basic static method, but you will be unable to deploy it to a production instance for use until you have reached the code coverage threshold. public class SomeClass { ...
POSIX character classes are predefined sequences for a certain set of characters. Character classDescription[:alpha:]Alphabetic characters[:alnum:]Alphabetic characters and digits[:digit:]Digits[:xdigit:]Hexadecimal digits[:blank:]Space and Tab[:cntrl:]Control characters[:graph:]Visible characters ...
This example shows how to get every year from this year to 2011 (2012 - 1). WITH yearsAgo ( myYear ) AS ( -- Base Case: This is where the recursion starts SELECT DATEPART(year, GETDATE()) AS myYear UNION ALL -- This MUST be UNION ALL (cannot be UNION) -- Recurs...
From lists def lst = ['foo', 'bar', 'baz'] // for each entry return a list containing [key, value] lst.collectEntries { [it, it.toUpperCase()] } // [foo: FOO, bar: BAR, baz: BAZ] // another option, return a map containing the single entry lst.collectEntries { [(it): it.toUpperCase()] } // [...
Since an enum can be cast to and from its underlying integral type, the value may fall outside the range of values given in the definition of the enum type. Although the below enum type DaysOfWeek only has 7 defined values, it can still hold any int value. public enum DaysOfWeek { Monday = 1...
Information about the database connections SELECT a.mon$attachment_id as Attachment_ID, a.mon$server_pid as Server_PID, case a.mon$state when 1 then 'active' when 0 then 'idle' end as State, a.mon$attachment_name as Database_Name, ...
Some character may be reserved for HTML and cannot be used directly as it may obstruct the actual HTML codes. For example, trying to display the left and right angle brackets (<>) in the source code may cause unexpected results in the output. Similarly, white spaces as written in the source co...
To generalize type_trait creation:based on SFINAE there are experimental traits detected_or, detected_t, is_detected. With template parameters typename Default, template <typename...> Op and typename ... Args: is_detected: alias of std::true_type or std::false_type depending of the validi...
#include <iostream> #include <string> int main() { const char * C_String = "This is a line of text w"; const char * C_Problem_String = "This is a line of text ኚ"; std::string Std_String("This is a second line of text w"); std::string...
As the characters/digits can be anywhere within the string, we require lookaheads. Lookaheads are of zero width meaning they do not consume any string. In simple words the position of checking resets to the original position after each condition of lookahead is met. Assumption :- Considering non-wo...
The method charCodeAt retrieves the Unicode character code of a single character: var charCode = "µ".charCodeAt(); // The character code of the letter µ is 181 To get the character code of a character in a string, the 0-based position of the character is passed as a parameter to charCo...
C++14 It is often useful to define classes or structures that have a variable number and type of data members which are defined at compile time. The canonical example is std::tuple, but sometimes is it is necessary to define your own custom structures. Here is an example that defines the structure ...
Sometimes it's useful to test private & protected methods as well as public ones. class Car { /** * @param mixed $argument * * @return mixed */ protected function drive($argument) { return $argument; } /** * @return bool *...
Most printable characters can be included in string or regular expression literals just as they are, e.g. var str = "ポケモン"; // a valid string var regExp = /[Α-Ωα-ω]/; // matches any Greek letter without diacritics In order to add arbitrary characters to a string or regular expression,...
Create a testing class in the src/test/scala directory, in a file named HelloWorldSpec.scala. Put this inside the file: import org.scalatest.{FlatSpec, Matchers} class HelloWorldSpec extends FlatSpec with Matchers { "Hello World" should "not be an empty String" in { ...

Page 8 of 14