Tutorial by Examples: ble

DECLARE @Employees TABLE ( EmployeeID INT NOT NULL PRIMARY KEY, FirstName NVARCHAR(50) NOT NULL, LastName NVARCHAR(50) NOT NULL, ManagerID INT NULL ) When you create a normal table, you use CREATE TABLE Name (Columns) syntax. When creating a table variable, you use DECLARE @...
DECLARE @VariableName INT SET @VariableName = 1 PRINT @VariableName 1 Using SET, you can only update one variable at a time.
Using SELECT, you can update multiple variables at once. DECLARE @Variable1 INT, @Variable2 VARCHAR(10) SELECT @Variable1 = 1, @Variable2 = 'Hello' PRINT @Variable1 PRINT @Variable2 1 Hello When using SELECT to update a variable from a table column, if there are multiple values, it wi...
DECLARE @Var1 INT = 5, @Var2 NVARCHAR(50) = N'Hello World', @Var3 DATETIME = GETDATE()
Iterable can be anything for which items are received one by one, forward only. Built-in Python collections are iterable: [1, 2, 3] # list, iterate over items (1, 2, 3) # tuple {1, 2, 3} # set {1: 2, 3: 4} # dict, iterate over keys Generators return iterables: def foo(): # foo ...
s = {1, 2, 3} # get every element in s for a in s: print a # prints 1, then 2, then 3 # copy into list l1 = list(s) # l1 = [1, 2, 3] # use list comprehension l2 = [a * 2 for a in s if a > 2] # l2 = [6]
Use unpacking to extract the first element and ensure it's the only one: a, = iterable def foo(): yield 1 a, = foo() # a = 1 nums = [1, 2, 3] a, = nums # ValueError: too many values to unpack
HTML also provides the tables with the <thead>, <tbody>, <tfoot>, and <caption> elements. These additional elements are useful for adding semantic value to your tables and for providing a place for separate CSS styling. When printing out a table that doesn't fit onto one (pa...
using (new Sitecore.SecurityModel.SecurityDisabler()) { var item = Sitecore.Context.Database.GetItem("/sitecore/content/home"); }
Creating empty deque: dl = deque() # deque([]) creating empty deque Creating deque with some elements: dl = deque([1, 2, 3, 4]) # deque([1, 2, 3, 4]) Adding element to deque: dl.append(5) # deque([1, 2, 3, 4, 5]) Adding element left side of deque: dl.appendleft(0) # deque([0, 1, 2, ...
Often times you will see an exception Anti forgery token is meant for user "" but the current user is "username" This is because the Anti-Forgery token is also linked to the current logged-in user. This error appears when a user logs in but their token is still linked to bein...
In the example of a message bubble illustrated below: the corners of the image should remain unchanged which is specified by UIEdgeInsets, but the borders and center of the image should expand to cover the new size. let insets = UIEdgeInsetsMake(12.0, 20.0, 22.0, 12.0) let image = UIImage(na...
hashlib.new requires the name of an algorithm when you call it to produce a generator. To find out what algorithms are available in the current Python interpreter, use hashlib.algorithms_available: import hashlib hashlib.algorithms_available # ==> {'sha256', 'DSA-SHA', 'SHA512', 'SHA224', 'dsa...
The IEnumerable<T> interface has a single method, GetEnumerator(), which returns an IEnumerator<T>. While the yield keyword can be used to directly create an IEnumerable<T>, it can also be used in exactly the same way to create an IEnumerator<T>. The only thing that changes ...
For example, if t1 is currently not an InnoDB table, this statement changes its storage engine to InnoDB: ALTER TABLE t1 ENGINE = InnoDB; If the table is already InnoDB, this will rebuild the table and its indexes and have an effect similar to OPTIMIZE TABLE. You may gain some disk space improv...
It is possible, inside a closure, to use an external variable with the special keyword use. For instance: <?php $quantity = 1; $calculator = function($number) use($quantity) { return $number + $quantity; }; var_dump($calculator(2)); // Shows "3" You can go further by ...
MySQL's DELETE statement can use the JOIN construct, allowing also to specify which tables to delete from. This is useful to avoid nested queries. Given the schema: create table people ( id int primary key, name varchar(100) not null, gender char(1) not null ); insert people (id,na...
Type variables are uncapitalized names in type-signatures. Unlike their capitalized counterparts, such as Int and String, they do not represent a single type, but rather, any type. They are used to write generic functions that can operate on any type or types, and are particularly useful for writing...
Sometimes a column should show different content than just the toString value of the cell item. In this case the TableCells created by the cellFactory of the TableColumn is customized to change the layout based on the item. Important Note: TableView only creates the TableCells that are shown in the...
double literals are defined by using the suffix D or d, or by using a real number: double d = 30.5D;

Page 16 of 62