Tutorial by Examples: ect

$collection = Mage::getModel('catalog/product') ->getCollection() ->setPageSize(20) ->setCurPage(1);
Sample table (say Employee) structure Column NameDatatypeIDINTF_NameSTRINGL_NameSTRINGPhoneSTRINGAddressSTRING Project all the columns Use wild card * to project all the columns. e.g. Select * from Employee Project selected columns (say ID, Name) Use name of columns in the projection list. e...
Java Code import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.highgui.Highgui; import org.opencv.highgui.VideoCapture; import org.opencv.objdetect.CascadeClassifier; publ...
//Before: antipattern 3 global variables var setActivePage = function () {}; var getPage = function() {}; var redirectPage = function() {}; //After: just 1 global variable, no function collision and more meaningful function names var NavigationNs = NavigationNs || {}; N...
This example shows how to take image and display it correctly on the Android device. Firstly we have to create sample application with one button and one imageview. Once user clicks on the button camera is launched and after user selects picture it will be displayed with the proper orientation on ...
Consider a structure of the following classes should be constructed in XAML an then read into a CLR object: namespace CustomXaml { public class Test { public string Value { get; set; } public List<TestChild> Children { get; set; } = new List<TestChild>(); ...
Consider a structure of the following classes should be constructed in XAML an then read into a CLR object: namespace CustomXaml { public class Test { public string Value { get; set; } public List<TestChild> Children { get; set; } = new List<TestChild>(); ...
T qobject_cast(QObject *object) A functionality which is added by deriving from QObject and using the Q_OBJECT macro is the ability to use the qobject_cast. Example: class myObject : public QObject { Q_OBJECT //... }; QObject* obj = new myObject(); To check whether obj is a my...
QObjects come with their own alternative lifetime concept compared to native C++'s raw,unique or shared pointers. QObjects have the possibility to build an objecttree by declaring parent/child relationships. The simplest way to declare this relationship is by passing the parent object in the const...
To get data from testcollection collection in testdb database where name=dev import org.bson.Document; import com.mongodb.BasicDBObject; import com.mongodb.MongoClient; import com.mongodb.ServerAddress; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoCursor; import c...
A Kubernetes cluster is controlled using the kubectl command. The method of configuring kubectl depends on where Kubernetes is installed. Google Cloud (Container Engine) To install kubectl using the Google Cloud SDK: gcloud components install kubectl To configure kubectl to control an existing...
First why we should use depedency injection in our code ? We want to decouple other components from other classes in our program. For example we have class AnimalController which have code like this : public class AnimalController() { private SantaAndHisReindeer _SantaAndHisReindeer = new San...
Extract all file contents of a zip file import zipfile with zipfile.ZipFile('zipfile.zip','r') as zfile: zfile.extractall('path') If you want extract single files use extract method, it takes name list and path as input parameter import zipfile f=open('zipfile.zip','rb') zfile=zipfile.Z...
Scenario: You need to select an implementation of address validation when a sales order is submitted, and the validator is determined by the country to which the order is shipping. The factory needs to inspect some value passed as an argument to select the correct implementation. First, write an in...
Before starting work with scrapy you have to start a project where you want to store your code. Enter the directory and run this code scrapy startproject helloProject The third part of this code is project name. This code will create a "helloProject" directory with the following conten...
Write some tests Install dispatch:mocha-phantomjs: meteor add dispatch:mocha-phantomjs Add a test-command to your package.json. { "name": "awesome meteor package", "scripts": { "test": "meteor test --driver-package dispatch:mocha-...
At first, You should create database with mysql, phpMyAdmin, HeidiSQL or another instruments to work with Database and let user create new one. After that procedure, You should provide access to database for project. You need to go into file /path/to/your/project/config/app.php,then look up for Da...
Accounts on crates.io are created by logging in with GitHub; you cannot sign up with any other method. To connect your GitHub account to crates.io, click the 'Login with GitHub' button in the top menu bar and authorise crates.io to access your account. This will then log you in to crates.io, assumi...
The standard structure for a project built by SBT is: projectName/ build.sbt project/ <SBT sub-build information> src/ main/ scala/ <Scala source files> java/ <Java source files> resources/ ...
If your project has this: scalaVersion := 2.11 // Replace '2.11' with the version of Scala your project is running on Then you can use %% to automatically get the version of the library compiled against the version of Scala the project is using: libraryDependencies += "com.typesafe.slick&...

Page 69 of 99