Posts

php - SQL query with multiple joins impacting performance -

i have relational mysql database 4000 records. contacts table related both keywords , notes tables manny-to-many relationships. wrote query (with php) retrieve each contact record and, each contact, related notes , keywords in group concat function. if grab contacts, query performs relatively 2 left joins , group concat, takes 30 seconds. there way speed up? here query: select c.*, group_concat(distinct n.id, '[-]', n.value, '' separator '---') notes, group_concat(distinct kk.id, '[-]', kk.value) keywords contacts c left join notes n on c.id n._contactid left join ( select k.*, kc._contactid contactid keywords k inner join keywords_contacts kc on k.id kc._keywordid ) kk on kk.contactid c.id group c.id order c.`last name`, c.`first name` i query can see c.id n._contactid , here making performace low use = operator , give index foreign key field _contactid . ...

Javascript: How to replace document.all in this case? -

in html: <td><input type="checkbox" name="checkall" onclick="doconfirmcheckall()"></td> ...and in js: document.all.checkall.checked = false; i have replace construct same meaning cannot use document.all (e.g. because of unsupport in ie11). what should use? document.getelementsbytagname("*").checkall.checked idea? if checkall name attribute, you'd use document.getelementsbyname ("checkall")[0].checked = false; if checkall id attribute, you'd use document.getelementbyid ("checkall").checked = false;

android - In Scroll View Edit text has scroll both are worked but in edit text if we type no of lines user can't see edit text it is scroll to top. -

in layout have scroll view in scrollable edit text.both working using setontouchlistener .if touch edittext scroll , layout scroll interact. problem when user typing edittext moving top of layout , user can't see edit text field. at time user typing both scrolls working. think solution when user clicked on edit text need stop layout scroll.in way edit text visible user , not moving when user typing.but don't know how implement if know please me. layout code:- <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margi...

arrays - C# foreach loop take values from outer loop to inner loop -

i have below code. int[] = new int[] { 8, 9 }; for(int i=0;i<n;i++) { print i; int z; //during first iteration z=8; during second iteration z=9; } output should this. during first iteration i=0 , z=8 during second iteration i=1 , z=9 array contains 2 elements. n , number of elements in array same. next loop execute. during first iteration want z value should 8(first element of array ) , second iteration z value should 9. want map 1st element of integer array first iteration of loop , on. try for (int = 0; < a.length; i++) // or < n if want { print i; int z = a[i]; // line value 1 one, 0, 1, 2, 3 , on... } edit 1 - after seeing comments on other answer, array 'a' turns out dynamic array have size n (which 2) the revised edition: int n = 2; int[] = new int[n]; string input = null; (int = 0; < a.length; i++) // or < n if want { print i; input = console.readline(); try { a[i] =...

Why can't Ifind Input Id in sap ui5 using the function sap.u.getcore.byId()? -

i'm trying access input field in controller of ui5 i'm not able fetch input box? i'm using sap.ui.getcore().byid('id of input'); i faced similar issue when started using ui5. id not same anymore because sap ui5 dynamically concatenates other properties id different. hope helps. try finding out id after has been changed resources.

php - Download redirect only in woocommerce -

i customize function handles redirect virtual product purchase page. this method: /** * redirect file start download * @param string $file_path * @param string $filename */ public static function download_file_redirect( $file_path, $filename = '' ) { header( 'location: ' . $file_path ); exit; } how can update without modify core class in way? public static function download_file_redirect( $file_path, $filename = '' ) { header( 'location: ' . $file_path . '&order=' . $_get['order'] ); exit; } updating class works like. not change woocommerce core. there way filter method? not have time modify core each update hooks available in woocommerce same, hope below code you. // define woocommerce_download_product callback function action_woocommerce_download_product( $download_data_user_email, $download_data_order_key, $download_data_product_id, $download_data_user_id, $download_data_downloa...

Is it possible to add a flag icon using the Magento admin panel? -

using magneto website , need display 2 different languagse. have set flag icon each location. 1 english , 1 arabic. possible add flag icon using magento admin panel, not in root folder. you can use extension https://www.magentocommerce.com/magento-connect/easy-flags-module.html can customize in way.