Tutorial by Examples: ect

An F() object represents the value of a model field or annotated column. It makes it possible to refer to model field values and perform database operations using them without actually having to pull them out of the database into Python memory. - F() expressions It is appropriate to use F() obj...
Magento has a powerful set of methods to filter collections. Since there are two types of Objects that can be contained in collections, we must first determine which type of data we are working with before we can filter it. Magento implements a EAV data model for entities such as products and catego...
Use the double negation syntax to check for truthiness of values. All values correspond to a boolean, irrespective of their type. irb(main):001:0> !!1234 => true irb(main):002:0> !!"Hello, world!" (irb):2: warning: string literal in condition => true irb(main):003:0> !...
This is an example to show how to change the allowed choices on a subCategory select field depending on the value of the category select field. To do that you have to make your subCategory choices dynamical for both client and server side. 1. Make the form dynamic on the client side for display / ...
PROC SQL options; SELECT column(s) FROM table-name | view-name WHERE expression GROUP BY column(s) HAVING expression ORDER BYcolumn(s); QUIT; Example 1: proc sql; select name ,sex from sashelp.class ; quit; The SELECT statement is specified in this order : 1....
just execute uname -a. On Arch: $ uname -a Linux nokia 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 GNU/Linuxenter code here
Mongoose connect has 3 parameters, uri, options, and the callback function. To use them see sample below. var mongoose = require('mongoose'); var uri = 'mongodb://localhost:27017/DBNAME'; var options = { user: 'user1', pass: 'pass' } mongoose.connect(uri, options, function(err){...
The Task object is an object like any other if you take away the async-await keywords. Consider this example: public async Task DoStuffAsync() { await WaitAsync(); await WaitDirectlyAsync(); } private async Task WaitAsync() { await Task.Delay(1000); } private Task WaitDire...
@IBAction func axisChange(sender: UISwitch) { UIView.animateWithDuration(1.0) { self.updateConstraintsForAxis() } } The updateConstraintForAxis function just sets the axis of the stack view containing the two image views: private func updateConstraintsForAxis() { if (axi...
A shader program, in the OpenGL sense, contains a number of different shaders. Any shader program must have at least a vertex shader, that calculates the position of the points on the screen, and a fragment shader, that calculates the colour of each pixel. (Actually the story is longer and more co...
To create a new project use the following command (HelloWorld is the name of the project and play-java is the template) $ ~/activator-1.3.10-minimal/bin/activator new HelloWorld play-java You should get an output similar to this one Fetching the latest list of templates... OK, application &...
Phalcon uses db service by default to obtain connection to databases. Assuming you have an conguration file with database field set up, you can include or autoload following code to obtain connection with database for your project: $di->set('db', function () use ($config) { $dbconf = $conf...
Using core debugger Node.js provides a build in non graphical debugging utility. To start the build in the debugger, start the application with this command: node debug filename.js Consider the following simple Node.js application contained in the debugDemo.js 'use strict'; function addTwoN...
[root@localhost ~]# docker inspect d87bf9607836 "Mounts": [ { "Name": "cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c", "Source": "/var/lib/docker/volumes/cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c/_data&quot...
[root@localhost ~]# docker run -it -v /etc:/etc1 8251da35e7a7 /bin/bash Here: /etc is host machine directory and /etc1 is the target inside container
While each mobile platforms do offer their own settings management api, there are no built in ways to read settings from a good old .net style app.config xml file; This is due to a bunch of good reasons, notably the .net framework configuration management api being on the heavyweight side, and each...
The whole ES6 spec is not yet implemented in its entirety so you will only be able to use some of the new features. You can see a list of the current supported ES6 features at http://node.green/ Since NodeJS v6 there has been pretty good support. So if you using NodeJS v6 or above you can enjoy usi...
// get existing collections $orders = Mage::getModel('sales/order')->getCollection(); $products = Mage::getModel('catalog/product')->getCollection(); $customers = Mage::getModel('customer/customer')->getCollection();
// $orders is collection $orders->addAttributeToSelect('status'); // get status attribute $orders->addAttributeToSelect('*'); // get all attributes

Page 61 of 99