Tutorial by Examples: er

Given the following model class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) name = Column(Text, nullable=False) birthday = Column(Date) You can filter columns in the query: import datetime as dt session.query(User).filter(User.name == 'Bob')...
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 ...
Declare public variables and methods type in the interface to define how other typescript code can interact with it. interface ISampleClassInterface { sampleVariable: string; sampleMethod(): void; optionalVariable?: string; } Here we create a class that implements the interface. ...
Installation npm install -D webpack typescript ts-loader webpack.config.js module.exports = { entry: { app: ['./src/'], }, output: { path: __dirname, filename: './dist/[name].js', }, resolve: { extensions: ['', '.js', '.ts'], }, module: { loaders: [...
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...
Implicit parameters can be useful if a parameter of a type should be defined once in the scope and then applied to all functions that use a value of that type. A normal function call looks something like this: // import the duration methods import scala.concurrent.duration._ // a normal method...
To retrieve a list of all servers registered on the instance: EXEC sp_helpserver;
Similar to int but accepts only positive integers (useful for pagination when there is a page parameter. Define: module.config(['$urlMatcherFactoryProvider', function($urlMatcherFactory) { $urlMatcherFactory.type('page', { decode: function(val) { return +val; }, encode: function(val) ...
Define: module.config(['$urlMatcherFactoryProvider', function($urlMatcherFactory) { $urlMatcherFactory.type('boolean', { decode: function(val) { return val == true || val == "true" }, encode: function(val) { return val ? 1 : 0; }, equals: function(a, b) { return this.is(...
In this code example, the char pointer p is initialized to the address of a string literal. Attempting to modify the string literal has undefined behavior. char *p = "hello world"; p[0] = 'H'; // Undefined behavior However, modifying a mutable array of char directly, or through a poin...
If you need to get a specific language or version of an item, you can use these overloads of GetItem() Sitecore.Context.Database.GetItem("/sitecore/content/Sitecore", Language.Current, new Version(5));
A hexadecimal number is a value in base-16. There are 16 digits, 0-9 and the letters A-F (case does not matter). A-F represent 10-16. An octal number is a value in base-8, and uses the digits 0-7. A binary number is a value in base-2, and uses the digits 0 and 1. All of these numbers result in ...
This example adds a list of places with image and name by using an ArrayList of custom Place objects as dataset. Activity layout The layout of the activity / fragment or where the RecyclerView is used only has to contain the RecyclerView. There is no ScrollView or a specific layout needed. <?x...
There can be situations when you decide that one set of display objects should always be above another set of objects, for example, arrows over heads, explosions over something that just exploded, etc. To perform this as simple as possible, you need to designate and create a set of Sprites, arrange ...
$parameters = @{ From = '[email protected]' To = '[email protected]' Subject = 'Email Subject' Attachments = @('C:\files\samplefile1.txt','C:\files\samplefile2.txt') BCC = '[email protected]' Body = 'Email body' BodyAsHTML = $False CC = '[email protected]' Credential = Get-Crede...
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...
import flash.net.URLRequest; import flash.media.Sound; import flash.events.Event; var req:URLRequest = new URLRequest("click.mp3"); var snd:Sound = new Sound(req); snd.addEventListener(Event.COMPLETE, function(e: Event) { snd.play(); }
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...
Prerequisites sudo apt-get install build-essential sudo apt-get install python [optional] sudo apt-get install git Get source and build cd ~ git clone https://github.com/nodejs/node.git OR For the latest LTS Node.js version 6.10.2 cd ~ wget https://nodejs.org/dist/v6.3.0/node-v6.10....

Page 80 of 417