I create new theme in Magento and want to show latest or new products on home page with pagination and number of show product. I copied catalog/product/list.phtml from it's cored file to my template so that i can customize it. Below is code in layout update in homepage: <reference name="content"> <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml"> <action method="setCategoryId"><category_id>3</category_id></action> <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> <block type="page/htm
Problem I need to give some priority for scrolling events in my Activity. I'm using aiCharts (charts library) and I need to zoom, pan, etc. on my areas. Without any ScrollViews it works fine, but, if I use the mentioned Layout, these features works bad. I think because of priority of views. Possible solution I tried to use setOverScrollMode(View.OVER_SCROLL_ALWAYS); on views that need to be on "top" of ScrollView and HorizontalScrollView but doesn't work properly. Layout <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <HorizontalScrollView android:layout_w
I am developing a Chrome extension to capture the Authentication information. I want to get the HTTP Authorization Header. I tried the Chrome API webRequest.onSendHeaders, but it didn't work following is my code: /***************onsendHeaders*************/ chrome.webRequest.onSendHeaders.addListener(function(details) { console.log(details.url, details.requestHeaders); for(var i = 0; i < details.requestHeaders.length;i++) { var header = details.requestHeaders[i]; if(header.name.toLowerCase() == "authorization") { alert("AUTH!"); /*Never get alert when I login to websites*/ } } }, {"urls":["*://
https://github.com/joeyrobert/bloomfilter uses Random class for the hash function which is a performance killer. What I'm trying to do is input the class with byte[]s instead of a generic argument(T) and get rid of private int Hash(T item) { return item.GetHashCode(); } I know there is a huge performance benefit but I have no idea how to replace _random.Next(_bitSize) here: #region Public Methods /// <summary> /// Adds an item to the bloom filter. /// </summary> /// <param name="item">Item to be added</param> public void Add(T item) { _random = new Random(Hash(item)); for (int i = 0; i < _numb
Given a list, is there a way to get the first non-None value? And, if so, what would be the pythonic way to do so? For example, I have: a = objA.addreses.country.code b = objB.country.code c = None d = 'CA' In this case, if a is None, then I would like to get b. If a and b are both None, the I would like to get d. Currently I am doing something along the lines of (((a or b) or c) or d), is there another way?
I know we can manually enable or disable 8.3 short path name support by setting NtfsDisable8dot3NameCreation. But how do I read this system information through code? I have to disable some functionality based on whether the system has 8.3 enabled or not.
I have 3 tables, restaurants, orders, users. orders table has fields restaurant_id, status and user_id. restaurant -> hasMany orders orders belogsTo Restaurant orders belongsTo users I need to find only those restaurants that have order with status = 1, and at the same time need to fetch user's info. So, I am making inner join with orders table, $options['joins'] = array( array('table' => 'orders', 'alias' => 'Order', 'type' => 'INNER', 'conditions' => array( 'Restaurant.id = Order.restaurant_id', ) ) ); But how Can I also get users' information along with this, because according to cake docum
I have some client side script in an ASPX file that enables or disables a required field validator based on whether the form field is visible or not. var oVal1 = document.getElementById(v1); var oVal2 = document.getElementById(v2); ValidatorEnable(oVal1, true); ValidatorEnable(oVal2, false); When I alert the enabled properties of oVal1 and oVal2, they show the correct settings for this condition - oVal1 is enabled, oVal2 is disabled. The problem is the validators are ALWAYS firing. I need to selectively disable one since the field isn't visible, it's not required in this case.
I am working on a Win 7-64 bit machine. I have a software installation package which contains the .msi file, a CAB file and some MST files. I wanted to modify the cabinet file. So I extracted the cab file using CABARC utility. But before making any changes to the extracted files, just for testing the utility I removed the original cab file from the current directory. And created a new cab file from the files extracted from the original cab file, again using CABARC utility. But now if I run the .msi file, it shows the error: ERROR:1334. The file "XYZ" cannot be installed because the file cannot
I have been looking for some time now for a solution to my sticky sidebar problem. I have a specific idea of how I would like it to act; effectively, I would like it to stick to the bottom as you scroll down, and then as soon as you scroll back up I would like it to stick to the top, in a fluid motion (no jumping). I am unable to find an example of what I am trying to achieve, so I have created an image that I hope will illustrate the point clearer: Sidebar sits under the header. As you scroll down the sidebar remains level with the content of the page so that you can scroll through both sideb
I currently have a WordPress site installed where users can book a tour of our facility (we are a university). I have used the ContactForm7 plugin to create a form within a page where visitors can enter their contact information and then can use a datepicker field to select the specific date that they want to take their tour on. My question is (I've searched high and low for a solution to this but to no avail) is there a way that I can disable or block specific dates from being selected in this datepicker field in the form? For example, there are a number of days when tours are not available (
I am using MVC extensions for Kendo UI editor. Is there an option to set the minimum and maximum number of characters excluding the HTML content. I used StringLength attribute but that includes the HTML content.
I'm trying to read data from a BLE device but keep getting permission error. Demo project can be found here: https://github.com/sergiomtzlosa/CoreBluetooth-Demo (keep in mind - my codes are a bit different than this one). No problem with connection and reading value in general but there are some characteristics (which are essential) give permission error. Console log: Update error!!! Characteristic: "Unknown (< fff4 >)" with error: "Reading is not permitted". So, when I subscribe or read data from that characteristic, it sends me NULL everytime (probable reason: no read permission). Console lo
My laravel installation was working fine yesterday but today I get the following error: Forbidden You don't have permission to access / on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request. Does anyone know where I am going wrong?
I have been reading as much as possible about the php.ini file and i have found nothing about whether or not its bad/dangerous to not set the session.cookie_domain in the php.ini. We are in a production environment and this is not set. Are there security issues with not setting this. Cookies appear to be working well, no real issues. The php.ini file looks like this: session.cookie_domain =
I have a video in a div with a 40% width. In the html, width="100%" height="auto" makes the video disappear. Setting a specific size in pixels won't fit the div. Leaving the html blank leaves the video the wrong size and with black bars on the sides. I've tried the suggestions in most other posts, but can't seem to get it to work. <div id="box"><video id="trialvid" class="video-js vjs-default-skin" controls preload="auto" width="auto" height="auto" poster="images/reelthumbnail.jpg" data-setup='{"example_option":true}'> <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'
I have a question related to data noise and principal component analysis (PCA). Situation I have a data matrix containing X, Y, Z joint data. I have applied PCA, with the stipulation of retaining 98% of the variance. However, even after reduction the data still remains very noisy. Problem I have spent a few hours reading, and I'm unsure of the best approach to take. I need to perform PCA for dimension reduction. However, the noise present in the dataset still presents several issues. I need an intermediate step before applying PCA to reduce the noise contained in the dataset. I have been advis
I have a question related to data noise and principal component analysis (PCA). Situation I have a data matrix containing X, Y, Z joint data. I have applied PCA, with the stipulation of retaining 98% of the variance. However, even after reduction the data still remains very noise. Problem I have spent a few hours reading, and I'm unsure of the best approach to take. I need to perform PCA for dimension reduction. However, the noise present in the dataset still presents several issues. I need an intermediate step before applying PCA to reduce the noise contained in the dataset. I have been advis
Does C++ have a more accurate data type than float or double, or do I just have to settle for the fact that my calculations will be off? EDIT: As Mr. Lister has pointed out, my question is regarding the precision. It's a bit frustrating when you add two floats/doubles together and the number is off half the time comparing to the calculation done by hand.
I'm trying to block some requests in a Chrome app. I created a JavaScript listener that does this validation: chrome.webRequest.onBeforeRequest.addListener( { urls: ["*://site.com/test/*"] }, ["blocking"] ); But the requests are not blocking. Did I miss something in this code? My manifest: "background": { "scripts": ["listener.js"], "persistent": true }, "permissions": ["tabs", "http://*/*"], "manifest_version": 2,
I used SMTP protocol for sending email in my system.The system is developed with Codeigniter.in the system two types of email sending functionality, one is from codeigniter Email libraries and other is from swift mailer.In codeigniter it is working but in swift mailer an authentication failure message is shown. Both functions use same login details.The port used is 25.
I am new to SharePoint branding. I want to put a background-image that covers the entire content part of one page. When I put it in the Master page (e.g.,Additional Page Header), it bleeds onto all pages,lists, etc. in the site. How do I do this?
I have image in blob format from DB , i am holding that blob image in byte array and converting it to Binary Base64 format. For encoding the blob to binary base 64 I am using below code, byte[] imageByte = getblob();//from DB byte[] encodedImage = Base64.encodeBase64(imageByte); is there any other way to do it or am doing it in right way please help me?
While reviewing my website code, I've noticed that my uploadify is working fine on all browsers except for Firefox, and this is only happening on Firefox which is on a MAC machine. It is very odd, but the files are actually uploading fine, its just that the loading progress bar % does not increase and stays at 0 until the script is actually completed. Code is the same for all browsers and it is even working in IE 8. Ive tried on all browsers, PC and mac. I have used the onUploadProgress callback function 'onUploadProgress' : function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBy
I have a python script that uses ReportLab to create a report, the script has been tested and works as expected however on occasions I get the following error message TraceBack info: File "C:\tools\LegionellaTool.py", line 605, in <module> createReport(selectedCoolingTowers, Report_outputs_folder, dbo_COLGIS, openPDF) Error Info: ..\Objects\moduleobject.c:50: bad argument to internal function Line 605 is createReport(selectedCoolingTowers, Report_outputs_folder, dbo_COLGIS, openPDF) createReport is the function that ...creates the report. I have debugged through the code and I havent got any e
I am trying to call web service through a JS but anyhow it doesnt get call. I am trying to make sum of 2 number. Page contains of 3 textbox and it has it text set hard codded as : <form id="form1" runat="server"> <div> <asp:TextBox ID="Text1" Text="5" runat="server"> </asp:TextBox> <asp:TextBox ID="Text2" Text="2" runat="server"> </asp:TextBox> <asp:TextBox ID="Text3" runat="server"> </asp:TextBox> </div> </form> My code are as follows: <script type="text/javascript"> $(document).ready(function () { debugger; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "C:/Users
I have a hosted web application, I would like to prevent signup from proxy/VPN/VPS ip address. How do i check whether the users ip address is proxy/vpn/vps syste. For example clixsense.com site, users can't create account, it shows cannot access from proxy/vpn/vps ip address. Thanks in advance.
What are some of C++11 std::unique_ptr uses and gotchas? Can I use std::unique_ptr also to store dynamically allocated arrays? Can I use std::unique_ptr also with resources using a custom deletion mechanism?
I'm working in a E-Commerce website, with JSF 2. In order to communicate with the company that makes all the operation with the banks, I need to send this XML to them (it's just a sample provided from them): <?xml version="1.0" encoding="ISO-8859-1"?> <requisicao-transacao versao="1.2.0" id="6560a94c-663b-4aec-9a45-e45f278e00b4" xmlns="http://ecommerce.cbmp.com.br"> <dados-ec> <numero>1001734898</numero> <chave>e84827130b9837473681c2787007da5914d6359947015a5cdb2b8843db0fa832</chave> </dados-ec> <dados-pedido> <numero>1603662828</numero> <valor>100</valor> <moeda>986</moeda> <data-hora>2010-07-
I have a container view set up in my storyboard file but I want to embed the view controller programmatically after setting some properties. This is my code in the parent VC's viewDidLoad: _workoutVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"entryTableVC"]; _workoutView = _workoutVC.tableView; [self addChildViewController:_workoutVC]; [_workoutVC.tableView setFrame:_container.bounds]; [_container addSubview:_workoutView]; However, viewDidLoad in the child is not called at any time. When I run the simulator my container view is blank. I've