Tutorial by Examples

ghcjs can be invoked with the same command line arguments as ghc. The generated programs can be run directly from the shell with Node.js and SpiderMonkey jsshell. for example: $ ghcjs -o helloWorld helloWorld.hs $ node helloWorld.jsexe/all.js Hello world!
For the sake of readability, which will be useful for beginners when reading VB code as well for full time developers to maintain the code, we can use "Region" to set a region of the same set of events, functions, or variables: #Region "Events" Protected Sub txtPrice_TextCh...
$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...
Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail'); Mage::helper('catalog/image')->init($item->getProduct(), 'small_image'); Mage::helper('catalog/image')->init($item->getProduct(), 'image');
Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail()); //Thumbnail Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getSmallImage()); //Small Image Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage(...
$rootId = Mage::app()->getStore($storeId)->getRootCategoryId(); $categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('*') ->addFieldToFilter('path', array('like'=> "1/$rootId/%")) ->addAttributeToFilter('level', 2...
SET FOREIGN_KEY_CHECKS=0; -- Customers TRUNCATE `customer_address_entity`; TRUNCATE `customer_address_entity_datetime`; TRUNCATE `customer_address_entity_decimal`; TRUNCATE `customer_address_entity_int`; TRUNCATE `customer_address_entity_text`; TRUNCATE `customer_address_entity_varchar`; T...
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...
SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_payment_transaction`; TRUNCATE `sales_flat_creditmemo`; TRUNCATE `sales_flat_creditmemo_comment`; TRUNCATE `sales_flat_creditmemo_grid`; TRUNCATE `sales_flat_creditmemo_item`; TRUNCATE `sales_flat_order`; TRUNCATE `sales_flat_order_address`; TRUNCA...
SET FOREIGN_KEY_CHECKS=0; TRUNCATE `log_customer`; TRUNCATE `log_visitor`; TRUNCATE `log_visitor_info`; TRUNCATE `log_visitor_online`; TRUNCATE `log_quote`; TRUNCATE `log_summary`; TRUNCATE `log_summary_type`; TRUNCATE `log_url`; TRUNCATE `log_url_info`; TRUNCATE `sendfriend_log`; TRUNC...
{-# 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...
A static data member of the class may be fully defined within the class definition if it is declared inline. For example, the following class may be defined in a header. Prior to C++17, it would have been necessary to provide a .cpp file to contain the definition of Foo::num_instances so that it wou...
$isSecure = Mage::app()->getStore()->isCurrentlySecure(); This will return true if the current url is secure.
$store = Mage::app()->getStore(); $storeId = Mage::app()->getStore()->getStoreId(); $storeCode = Mage::app()->getStore()->getCode(); $websiteId = Mage::app()->getStore()->getWebsiteId(); $storeGroupId = Mage::app()->getStore()->getGroupId(); $storeName = Mage::app()-&...
Custom attribute in sales related tables like: sales_flat_quote, sales_flat_order_item, sales_flat_order, etc table In your installation file sql/some_setup/mysql-install-0.1.0.php: <?php $installer = $this; $installer->startSetup(); $installer->addAttribute('quote', 'custom_field'...
The extern storage class specifier can modify a declaration in one of the three following ways, depending on context: It can be used to declare a variable without defining it. Typically, this is used in a header file for a variable that will be defined in a separate implementation file. // glo...
Since a signal handler will be called by the kernel using the C calling convention, we must tell the compiler to use the C calling convention when compiling the function. volatile sig_atomic_t death_signal = 0; extern "C" void cleanup(int signum) { death_signal = signum; } int mai...
A C library header can usually be included into a C++ program, since most declarations are valid in both C and C++. For example, consider the following foo.h: typedef struct Foo { int bar; } Foo; Foo make_foo(int); The definition of make_foo is separately compiled and distributed with the...
This simple function can be used to get value from exactly one field one record query result Public Function getDataScalar(ssql As String) openConnection() Try Dim q As New MySqlCommand q.Connection = db q.CommandText = ssql getDataScalar = q.Execut...
An explicit instantiation definition creates and declares a concrete class, function, or variable from a template, without using it just yet. An explicit instantiation can be referenced from other translation units. This can be used to avoid defining a template in a header file, if it will only be i...

Page 1164 of 1336