Tutorial by Examples: ti

In SQLAlchemy core, the result is RowProxy. In cases where you want an explicit dictionary, you can call dict(row). First the setup for the example: import datetime as dt from sqlalchemy import ( Column, Date, Integer, MetaData, Table, Text, create_engine, select) metadata = MetaData() u...
Let's suppose we have a reference to the JQuery type definition and we want to extend it to have additional functions from a plugin we included and which doesn't have an official type definition. We can easily extend it by declaring functions added by plugin in a separate interface declaration with ...
You can open a connection (i.e. request one from the pool) using a context manager: with engine.connect() as conn: result = conn.execute('SELECT price FROM products') for row in result: print('Price:', row['price']) Or without, but it must be closed manually: conn = engine.co...
If you only want to execute a single statement, you can use the engine directly and it will open and close the connection for you: result = engine.execute('SELECT price FROM products') for row in result: print('Price:', row['price'])
You can use engine.begin to open a connection and begin a transaction that will be rolled back if an exception is raised, or committed otherwise. This is an implicit way of using a transaction, since you don't have the option of rolling back manually. with engine.begin() as conn: conn.execute(...
There are multiple ways to populate an array. Directly 'one-dimensional Dim arrayDirect1D(2) As String arrayDirect(0) = "A" arrayDirect(1) = "B" arrayDirect(2) = "C" 'multi-dimensional (in this case 3D) Dim arrayDirectMulti(1, 1, 2) arrayDirectMulti(0, 0, 0...
In Android there is a default options menu, which can take a number of options. If a larger number of options needs to be displayed, then it makes sense to group those options in order to maintain clarity. Options can be grouped by putting dividers (i.e. horizontal lines) between them. In order to a...
Detailed instructions on getting mvvmcross set up or installed.
A java.util.Date object does not have a concept of time zone. There is no way to set a timezone for a Date There is no way to change the timezone of a Date object A Date object created with the new Date() default constructor will be initialised with the current time in the system default timezo...
Detailed instructions on getting resharper set up or installed.
To fetch the latest version of an item in the current language: Sitecore.Context.Database.GetItem(new ID("{11111111-1111-1111-1111-111111111111}"));
To fetch the latest version of an item in the current language: Sitecore.Context.Database.GetItem("/sitecore/content/Sitecore")
Python has only limited support for parsing ISO 8601 timestamps. For strptime you need to know exactly what format it is in. As a complication the stringification of a datetime is an ISO 8601 timestamp, with space as a separator and 6 digit fraction: str(datetime.datetime(2016, 7, 22, 9, 25, 59, 55...
Install JDK 8 (Windows, Linux) and set the path (Windows). Install Scala (Linux), For Windows visit http://www.scala-lang.org/download/ download and install binary distribution, set the environment variable for scala in PATH which is in \scala\bin. Installing Typesafe activator (It contains Scal...
Constructor overloading is not available in As3. In order to provide a different way to retrieve an instance of a class, a public static method can be provided to serve as an alternative "constructor". An example for that is flash.geom.Point, which represents a 2D point object. The coor...
To ensure encapsulation, member variables of a class should be private and only be accessible to public via public get/set access methods. It is a common practice to prefix private fields with _ public class Person { private var _name:String = ""; public function get name():S...
There are situations when you need to calculate something really large in your Flash application, while not interrupting the user's experience. For this, you need to devise your lengthy process as a multi-step process with saved state between iterations. For example, you need to perform a background...
This is a short summary of the GitLab guide on Install a GitLab CE Omnibus package. Requirements In order to install the GitLab Community Edition on your server, you should read the requirements page. To make it brief, the recommended requirements are: OS: Ubuntu, Debian, CentOS, RHEL Ruby ver...
A class in Scala is a 'blueprint' of a class instance. An instance contains the state and behavior as defined by that class. To declare a class: class MyClass{} // curly braces are optional here as class body is empty An instance can be instantiated using new keyword: var instance = new MyClas...
The only way to catch exception in initializer list: struct A : public B { A() try : B(), foo(1), bar(2) { // constructor body } catch (...) { // exceptions from the initializer list and constructor are caught here // if no exception is thrown h...

Page 98 of 505