Tutorial by Examples: ble

SELECT s.name + '.' + t.NAME AS TableName, SUM(a.used_pages)*8 AS 'TableSizeKB' --a page in SQL Server is 8kb FROM sys.tables t JOIN sys.schemas s on t.schema_id = s.schema_id LEFT JOIN sys.indexes i ON t.OBJECT_ID = i.object_id LEFT JOIN sys.partitions p ON i.object_id = ...
/** * Created by Alex Sullivan on 7/21/16. */ public class Foo implements Parcelable { private final int myFirstVariable; private final String mySecondVariable; private final long myThirdVariable; public Foo(int myFirstVariable, String mySecondVariable, long myThirdVariab...
The following table shows the keywords for built-in C# types, which are aliases of predefined types in the System namespaces. C# Type.NET Framework TypeboolSystem.BooleanbyteSystem.BytesbyteSystem.SBytecharSystem.ChardecimalSystem.DecimaldoubleSystem.DoublefloatSystem.SingleintSystem.Int32uintSyste...
Introduction Classes that implement this interface no longer support __sleep() and __wakeup(). The method serialize is called whenever an instance needs to be serialized. This does not invoke __destruct() or has any other side effect unless programmed inside the method. When the data is unseriali...
In order to define a variable inside a linq expression, you can use the let keyword. This is usually done in order to store the results of intermediate sub-queries, for example: int[] numbers = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var aboveAverages = from number in numbers l...
The URLVariables class allows you to define data to be sent along with a URLRequest. Example: var variables:URLVariables = new URLVariables(); variables.prop = "hello"; variables.anotherProp = 10; var request:URLRequest = new URLRequest('http://someservice.com'); request.data = v...
public function up() { $this->dropTable('post'); }
yii migrate/create create_post_table --fields="title:string,body:text" Generates: /** * Handles the creation for table `post`. */ class m150811_220037_create_post_table extends Migration { /** * @inheritdoc */ public function up() { $this->createTable('post', [ ...
public function up() { $this->createTable('post', [ 'id' => $this->primaryKey() ]); }
SELECT * FROM table1, table2 SELECT table1.column1, table1.column2, table2.column1 FROM table1, table2 This is called cross product in SQL it is same as cross product in sets These statements return the selected columns from multiple tables in one query....
.SD .SD refers to the subset of the data.table for each group, excluding all columns used in by. .SD along with lapply can be used to apply any function to multiple columns by group in a data.table We will continue using the same built-in dataset, mtcars: mtcars = data.table(mtcars) # Let's not ...
Sometimes it is appropriate to use an immutable empty collection. The Collections class provides methods to get such collections in an efficient way: List<String> anEmptyList = Collections.emptyList(); Map<Integer, Date> anEmptyMap = Collections.emptyMap(); Set<Number> anEmptySe...
The @var keyword can be used to describe the type and usage of: a class property a local or global variable a class or global constant class Example { /** @var string This is something that stays the same */ const UNCHANGING = "Untouchable"; /** @var string $some_s...
Given any value of type Int or Long to render a human readable string: fun Long.humanReadable(): String { if (this <= 0) return "0" val units = arrayOf("B", "KB", "MB", "GB", "TB", "EB") val digitGroups = (Mat...
Sample Data: CREATE TABLE table_name ( id, list ) AS SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list SELECT 3, NULL FROM DUAL UNION ALL -- NULL list SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
Common table expressions support extracting portions of larger queries. For example: WITH sales AS ( SELECT orders.ordered_at, orders.user_id, SUM(orders.amount) AS total FROM orders GROUP BY orders.ordered_at, orders.user_id ) SELECT sales.ordered_at, sales.total,...
Generate a random number between 0 and 1.0. (not including 1.0) Random rnd = new Random(); var randomDouble = rnd.NextDouble();
This query selects all employees not on the Supervisors table. SELECT * FROM Employees WHERE EmployeeID not in (SELECT EmployeeID FROM Supervisors) The same results can be achieved using a LEFT JOIN. SELECT * FROM Employees AS e LEFT JOIN Supervisors AS s ON s.E...
Double-quoted strings use interpolation and escaping – unlike single-quoted strings. To double-quote a string, use either double quotes " or the qq operator. my $greeting = "Hello!\n"; print $greeting; # => Hello! (followed by a linefeed) my $bush = "They misunderestimat...

Page 11 of 62