Tutorial by Examples: c

class My_Plugin() { function __construct() { add_action( 'wp_enqueue_scripts', array( $this, 'init_fe_assets' ) ); } public function init_fe_assests() { wp_enqueue_style( 'my-plugin', plugin_dir_url( __FILE__ ) . 'assets/css/frontend/plugin.css', array(), '0.0.1', true ); ...
When using instances of QML files by directly declaring them, every property creates a binding. This is explained in the above examples. This is how you dynamically create components: var component = Qt.createComponent("Popup.qml"); var popup = component.createObject(parent, {"widt...
Let's pick as an example a function that takes 2 Map and return a Map containing every element in ma and mb: def merge2Maps(ma: Map[String, Int], mb: Map[String, Int]): Map[String, Int] A first attempt could be iterating through the elements of one of the maps using for ((k, v) <- map) and so...
The following is an example for setting and reading cookies using the cookie-parser module: var express = require('express'); var cookieParser = require('cookie-parser'); // module for parsing cookies var app = express(); app.use(cookieParser()); app.get('/setcookie', function(req, res){ ...
In Express, you can define middlewares that can be used for checking requests or setting some headers in response. app.use(function(req, res, next){ }); // signature Example The following code adds user to the request object and pass the control to the next matching route. var express = req...
The XML document, I will be using throughout the examples is - <a> <b>test-value</b> <d>fragment-d</d> <c-root> <d>fragment-d</d> <e>fragment-e</e> </c-root> </a> The following queries ...
xdmp:estimate(cts:search(fn:doc(), cts:element-value-query(xs:QName("d"), "fragment-d"))) xdmp:estimate can not be used on XPaths unlike fn:count is used in previous example xdmp:estimate actually gives the number of matching fragments
The XML document to consider in this example - <a> <b>test-value</b> <d>fragment-d</d> <c-root> <d>fragment-d</d> <e>fragment-e</e> </c-root> </a> A fragment root is declared on <c-r...
Lets start with creating our first app Open visual studio and > create new project Enter Name and Location Enter your developer site url created in previous step and select Provider-hosted Popup will open which will as for login Next step it will as for type of applicatio...
Here I'm taking the example of a basic news app Open the SharePoint developer site and create a list to store our news articles Create a custom list and Add 3 more columns Body, Summery, ThumbnailImageUrl Go back to our SharePoint app, Open AppManifest.xml file, click on permission...
We have already created first page which will show all the news articles. This page will show Complete article. Add One more Action Method to HomeController [SharePointContextFilter] public ActionResult Aticle(int ArticleId) { User spUser = null; var spContext = SharePointContext...
QStack<T> is a template Qt class providing stack. Its analogue in STL is std::stack. It is last in, first out structure (LIFO). QStack<QString> stack; stack.push("First"); stack.push("Second"); stack.push("Third"); while (!stack.isEmpty()) { cout ...
QVector<T> provides dynamic array template class. It provides better performance in most cases than QList<T> so it should be first choice. It can be initialized in various ways: QVector<int> vect; vect << 1 << 2 << 3; QVector<int> v {1, 2, 3, 4}; Th...
void DispatchToMainThread(std::function<void()> callback) { // any thread QTimer* timer = new QTimer(); timer->moveToThread(qApp->thread()); timer->setSingleShot(true); QObject::connect(timer, &QTimer::timeout, [=]() { // main thread ...
Q_OBJECT macro appears in private section of a class. Q_OBJECT requires the class to be subclass of QObject. This macro is necessary for the class to declare its signals/slots and to use Qt meta-object system. If Meta Object Compiler (MOC) finds class with Q_OBJECT, it processes it and generates C+...
Multiplicity in Entity Relationships Multiplicities are of the following types: One-to-one: Each entity instance is related to a single instance of another entity. One-to-many: An entity instance can be related to multiple instances of the other entities. Many-to-one: multiple instances of an ...
Usually you'd want to create a stack of services to form a replicated and orchestrated application. A typical modern web application consists of a database, api, frontend and reverse proxy. Persistence Database needs persistence, so we need some filesystem which is shared across all the nodes in ...
insert into schema.table (field1, field2) select 'Static Value', foreignField from schema.otherTable;
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target= target is important. ex:0.16.1 npm rebuild Create a folder for sqlite db. Remember sequalize.sync();
Given a non-empty cv::Mat img of some size, we can fill it to a solid color in several ways: img = cv::Scalar(blueVal,greenVal,redVal); or, the more general, mask supporting, cv::Mat::setTo(): img.setTo(cv::Scalar(blueVal,greenVal,redVal)); If you are using the older OpenCV C API with IplIma...

Page 537 of 826