Posts

Get repeated rows in based on child table from Parent table

SELECT   *   FROM   `parents`   WHERE   id IN   ( SELECT   parent_id FROM   `tbl_parent_child`   GROUP   BY   parent_id HAVING   COUNT (   parent_id   )   = 2 )

Mysql InnoDB optimization

query_cache_size = 512M query_cache_limit = 256M tmp_table_size = 256M key_buffer_size = 64M read_buffer_size = 128M read_rnd_buffer_size = 128M bulk_insert_buffer_size = 64M myisam_sort_buffer_size = 128M myisam_max_sort_file_size = 128M myisam_max_extra_sort_file_size = 128M myisam_repair_threads = 2 myisam_recover innodb_additional_mem_pool_size = 256M innodb_log_buffer_size = 128M innodb_log_file_size = 128M innodb_log_files_in_group = 2 innodb_flush_log_at_trx_commit = 0 innodb_buffer_pool_size = 512M innodb_data_home_dir = /var/lib/mysql/ innodb_data_file_path = ibdata1:256M:autoextend innodb_autoextend_increment=32 max_allowed_packet = 16M wait_timeout = 1800 connect_timeout = 120 Notice the above is adjusted for a DB dedicated server with 2GB of RAM.

Magento Interview Questions and Answers

Magento Interview Q & A

What Is The Universe?

Image

Sanitize Phone no, if phone no length is more than 10 then, Remove 0, +91, 91 from phone no

Sanitize Phone no, if phone no length is more than 10 then, Remove 0, +91, 91 from phone no. All Indian phone no's length is 10 digits including with STD code /**  *  Sanitize Phone no, if phone no length is more than 10 then  */ function sanitizePhoneNo(phone){ if(phone.length >= 10) { if(phone[0] == 0) { phone = makePNo(phone, 1); }else if( (phone[0] == 9) && (phone[1] == 1) ){ phone = makePNo(phone, 2); }else if( (phone[0] == '+') && (phone[1] == 9) && (phone[2] == 1) ){ phone = makePNo(phone, 3); } } return phone; } function makePNo(val, cnt){ var a=''; for(var i=0; i<=(val.length)-1; i++){ if(i>=cnt){ a += val[i];} } return a; } /**  *  Validate Phone no with regular expression  */ function validatePhoneNo(phone){ if( /^[0-9\ \-]+$/.test(phone)){ if(phone.length==10){return true;}else {return false;} }else {return false;} }

Lok Satta Videos: Lok Satta Leader Hyma With Kommineni Srinivas Rao ...

Lok Satta Videos: Lok Satta Leader Hyma With Kommineni Srinivas Rao ...

MAGENTO, How to find Product Tax Rate OR Tax Percentage

## MAGENTO, How to find Product tax rate foreach ($productIds as $productId) { $_product = Mage::getModel('catalog/product')->load($productId); $productsPrice = floatval($_product->getData("price")); // Get the product's tax class' ID $taxClassId = $_product->getData("tax_class_id"); echo 'Tax Class ID '.$taxClassId.' '; // Get the tax rates of each tax class in an associative array $taxClasses = Mage::helper("core")->jsonDecode( Mage::helper("tax")-         >getAllRatesByProductClass() ); echo  'Tax Classes '.$taxClasses.' '; // Extract the tax rate from the array $taxRate = $taxClasses["value_".$taxClassId]; echo 'Tax Rate '.$taxRate.' '; } ?>