Tutorial by Examples: du

Let's say we want to eliminate duplicated subsequence element from a string (it can be more than one). For example: 2,14,14,14,19 and convert it into: 2,14,19 Using gsub, we can achieve it: gsub("(\\d+)(,\\1)+","\\1", "2,14,14,14,19") [1] "2,14,19" ...
This example demonstrate how to dynamically insert data into MySQL using Python Scrapy. You do not need to edit pipelines.py file for any project. This example can be used for all your project. Just yield you_data_dictionary from your Spider and inside pipelines.py a query will be created automat...
$model = Mage::getModel('catalog/product')->getCollection() Filter based on store: $mode->addStoreFilter($storeId) Filter based on product type: $mode->addAttributeToFilter('type_id', 'configurable') $mode->addAttributeToFilter('type_id', 'simple') Filter based on status: $m...
SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_product_bundle_option_value`; TRUNCATE TABLE `catalog_product_bundle_selection`; TRUNCATE TABLE `catalog_product_entity_datetime`; TRUNCATE TABLE `catalog_product_entity_decimal`; TRUNCATE TAB...
{-# LANGUAGE RecordWildCards #-} import Text.XML.Light data Package = Package { pOrderNo :: String , pOrderPos :: String , pBarcode :: String , pNumber :: String } -- | Create XML from a Package instance Node Package where node qn Package {..} = node qn [ un...
Let's take an scenario to understand advance function in better way, struct User { var name: String var age: Int var country: String? } //User's information let user1 = User(name: "John", age: 24, country: "USA") let user2 = User(name: "Chan", age...
These are the “bit fiddling” types. They have logical operators, too, such as xor, and they “wrap around” at the upper bound, to 0 again. type Bits is mod 2**24; L : Bits := 2#00001000_01010000_11001100# or 7;
Once using is used to introduce the name cout from the namespace std into the scope of the main function, the std::cout object can be referred to as cout alone. #include <iostream> int main() { using std::cout; cout << "Hello, world!\n"; }
You can see the running demo by clicking here. HTML: <p> <span>Counter State</span><br /> (<em>Will increase each minute</em>): <p> <span id="counter-state" style="font-weight: bolder"></span> </p> &l...
If all you need is serializing mongo results into json, it is possible to use the json module, provided you define custom handlers to deal with non-serializable fields types. One advantage is that you have full power on how you encode specific fields, like the datetime representation. Here is a ha...
$> perl -MFoo::Bar\ 9999 $> Foo::Bar version 9999 required--this is only version 1.1.
To extend and expand upon the binding experience we have converters to convert one a value of one type into another value of another type. To leverage Converters in a Databinding you first need to create a DataConverter class tht extens either IValueConverter(WPF & UWP) or IMultiVal...
Partial Update: Used when a partial document update is needed to be done, i.e. in the following example the field name of the document with id doc_id is going to be updated to 'John'. Note that if the field is missing, it will just be added to the document. doc = { "doc": { ...
Android extensions also work with multiple Android Product Flavors. For example if we have flavors in build.gradle like so: android { productFlavors { paid { ... } free { ... } } } And for example, only the free flavor has ...
Pack your com.stackoverflow.${whatever} clases on a jar called stackoverflow.jar Create folder com/stackoverflow/main on ${WILDFLY_HOME}/modules Put the jar on the last dir Create a file called module.xml with the following content: <?xml version="1.0" encoding="UTF-8"...
For some reason you develop a new version of com.stackoverflow (say version 1.1), then you should: Create folder com/stackoverflow/1.1 on ${WILDFLY_HOME}/modules Put the new jar on last dir Create file module.xml on last dir with the following content <?xml version="1.0" encodin...
By default modules are placed on ${WILDFLY}/modules directory but you can have more directories with modules, just edit your standalone.conf (or standalone.conf.bat if you are on Microsoft Windows) and properly set the variable JBOSS_MODULEPATH For example in Unix/Linux/MacOSX: JBOSS_MODULEPATH=&q...
using only the for <timeout> clause, it is possible to get an unconditional wait that lasts for a specific duration. This is not synthesizable (no real hardware can perform this behaviour so simply), but is frequently used for scheduling events and generating clocks within a testbench. This e...
Alfresco Share is one of the one part of the Alfresco as product- it's user interface on the Alfresco repository (platform), by default it is avaiable on <host>:<port>/share. It is built on the Surf framework. The Surf framework was developed by Alfresco, but in 2009 Alfresco began wor...

Page 42 of 47