Tutorial by Examples

with Ada.Text_IO; procedure Hello_World is begin Ada.Text_IO.Put_Line ("Hello World"); end Hello_World; Alternatively, after importing the package Ada.Text_IO, you can say use Ada.Text_IO; in order to be able to use Put_Line without explicitly declaring what package it should c...
If the type on which the static constructor is declared is generic, the static constructor will be called once for each unique combination of generic arguments. class Animal<T> { static Animal() { Console.WriteLine(typeof(T).FullName); } public static void Yawn...
with Ada.Text_IO; procedure Main is type Fruit is (Banana, Orange, Pear); X : Fruit := Orange; begin Ada.Text_IO.Put_Line (Fruit'Image (X)); end Main; Result ORANGE
with Ada.Text_IO; procedure Main is X : Integer := 17; begin Ada.Text_IO.Put_Line (Integer'Image (X)); end Main; Result 17
with Ada.Text_IO; procedure Main is X : Float := 2.71; begin Ada.Text_IO.Put_Line (Float'Image (X)); end Main; Result 2.71000E+00
If a static constructor throws an exception, it is never retried. The type is unusable for the lifetime of the AppDomain. Any further usages of the type will raise a TypeInitializationException wrapped around the original exception. public class Animal { static Animal() { Consol...
It is unlikely for a developer to not come across a deprecated API during a development process. A deprecated program element is one that programmers are discouraged from using, typically because it is dangerous, or because a better alternative exists. Compilers and analyzers (like LINT) warn when a...
This is a huge topic, but it is also the most important "performance" issue. The main lesson for a novice is to learn of "composite" indexes. Here's a quick example: INDEX(last_name, first_name) is excellent for these: WHERE last_name = '...' WHERE first_name = '...' AND ...
innodb_buffer_pool_size should be about 70% of available RAM.
x IN ( SELECT ... ) turn into a JOIN When possible, avoid OR. Do not 'hide' an indexed column in a function, such as WHERE DATE(x) = ...; reformulate as WHERE x = ... You can generally avoid WHERE LCASE(name1) = LCASE(name2) by having a suitable collation. Do no use OFFSET for "paginatio...
Here are some things that are not likely to help performance. They stem from out-of-date information and/or naivety. InnoDB has improved to the point where MyISAM is unlikely to be better. PARTITIONing rarely provides performance benefits; it can even hurt performance. Setting query_cache_size...
You can find the Chef documentation at https://docs.chef.io/.
Detailed instructions on getting material-design set up or installed.
You can change the url of an existing remote by the command git remote set-url remote-name url
Example below shows how to create a BroadcastReceiver which is able to receive BOOT_COMPLETED events. This way, you are able to start a Service or start an Activity as soon device was powered up. Also, you can use BOOT_COMPLETED events to restore your alarms since they are destroyed when device is ...
For the sake of this example, let us assume that we have a server for handling the POST requests that we will be making from our Android app: // User input data. String email = "[email protected]"; String password = "123"; // Our server URL for handling POST requests. String UR...
For a Django project with requirements and deployment tools under source control. This example builds upon concepts from the Two Scoops of Django. They have published a template: repository/ docs/ .gitignore project/ apps/ blog/ migrations/ ...
Casting: The Basics Casting is used to transform data from long to wide format. Starting with a long data set: DT = data.table(ID = rep(letters[1:3],3), Age = rep(20:22,3), Test = rep(c("OB_A","OB_B","OB_C"), each = 3), Result = 1:9) We can cast our data using the...
The FETCH clause was introduced in Oracle 12c R1: SELECT val FROM mytable ORDER BY val DESC FETCH FIRST 5 ROWS ONLY; An example without FETCH that works also in earlier versions: SELECT * FROM ( SELECT val FROM mytable ORDER BY val DESC ) WHERE ROWNUM <= 5;
Defined in header <numeric> template<class InputIterator, class T> T accumulate(InputIterator first, InputIterator last, T init); // (1) template<class InputIterator, class T, class BinaryOperation> T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation...

Page 580 of 1336