Tutorial by Examples: st

Use dynamic_cast for converting pointers/references within an inheritance hierarchy. Use static_cast for ordinary type conversions. Use reinterpret_cast for low-level reinterpreting of bit patterns. Use with extreme caution. Use const_cast for casting away const/volatile. Avoid this unless you ar...
Code get_the_title( 44 ); Output The title of the post id:44.
add_theme_support( 'post-formats', array( 'formatone', 'formattwo' ) );
add_theme_support( 'post-thumbnails', array( 'post' ) ); The above code only allows post thumnails on all posts. To enable the feature on all post types, do: add_theme_support( 'post-thumbnails' );
After you have set a few data to database and have get a structure consisting of several nodes like this; "user" : { "-KdbKcU2ptfYF2xKb5aO" : { "firstName" : "Arthur", "lastName" : "Schopenhauer", "userName&q...
Create enum of custom errors enum RegistrationError: Error { case invalidEmail case invalidPassword case invalidPhoneNumber } Create extension of RegistrationError to handle the Localized description. extension RegistrationError: LocalizedError { public var errorDescription...
public function someAction(){ // Action's code return new Response($error, 500); } Another example: public function someAction(){ // Action's code $response = new Response(); $response->setStatusCode(500) $response->setContent($content); ...
In a data declaration, prefixing a type with a bang (!) makes the field a strict field. When the data constructor is applied, those fields will be evaluated to weak head normal form, so the data in the fields is guaranteed to always be in weak head normal form. Strict fields can be used in both rec...
The following example demonstrates using Lumen in WAMP / MAMP / LAMP environments. To work with Lumen you need to setup couple of things first. Composer PHPUnit git (not required but strongly recommended) Assuming you have all these three components installed (at least you need composer), f...
C++17 The if constexpr statement can be used to conditionally compile code. The condition must be a constant expression. The branch not selected is discarded. A discarded statement inside a template is not instantiated. For example: template<class T, class ... Rest> void g(T &&p, Re...
DIGEST() functions generate a binary hash of the given data. This can be used to create a random hash. Usage: digest(data text, type text) returns bytea Or: digest(data bytea, type text) returns bytea Examples: SELECT DIGEST('1', 'sha1') SELECT DIGEST(CONCAT(CAST(current_timestamp AS...
There are many responsive scenarios where it's necessary to have column units exceeding 12 in a single .row element. This is known as column wrapping. If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line. For example, cons...
wire a; wire b; reg q; always @(a) // b missing from sensativity list q = a & b; // In simulation q will change only when a changes In hardware, q will change whenever a or b changes.
In latex we can use built-in commands to execute code whether the conditions are true or not. Comparing two integers: \ifnum\value{num}>n {A} \else {B}\fi This code executes A if num>n else B. We can substitute > with < and =. If a number is odd: \ifodd\value{num} {A}\else {B}\fi If ...
You can create custom dialogs which contains many component and perform many functionality on it. It behaves like second stage on owner stage. In the following example an application that shows person in the main stage tableview and creates a person in a dialog (AddingPersonDialog) prepared. GUIs c...
The following regex includes 50 states and also Commonwealth/Territory (see www.50states.com): regex <- "(A[LKSZR])|(C[AOT])|(D[EC])|(F[ML])|(G[AU])|(HI)|(I[DLNA])|(K[SY])|(LA)|(M[EHDAINSOT])|(N[EVHJMYCD])|(MP)|(O[HKR])|(P[WAR])|(RI)|(S[CD])|(T[NX])|(UT)|(V[TIA])|(W[AVIY])" For exampl...
In a terminal run sudo apt-get install maven Once the install is over check that it works correctly with mvn -v the output should look like: Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_121, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-openjdk-amd64/j...
General Properties: An Azimuthal Equidistant projection is best recognized when used in polar areas. It is used in the UN's emblem. From the center point, angle and distance are preserved. But the projection will distort shape and area to achieve this, especially as one moves further from the cente...
Note in this example we will use PostgreSQL DBMS, but you can use any DBMS We will use a database bd_test witch contain a Schema: sch_test and two tables users and test : CREATE TABLE sch_test.users ( id serial NOT NULL, username character varying, password character varying, CONSTRAI...
The new Bootstrap 4 Navbar Component is improved over it’s Bootstrap 3.x predecessor. In Bootstrap 4, the Navbar is responsive by default and utilizes flexbox to make alignment of Navbar content much easier. It’s also a simple matter of using the new navbar-toggleable-* classes to change the Navbar ...

Page 318 of 369