Search Results

Search found 9122 results on 365 pages for 'cartesian product'.

Page 83/365 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • Javascript push Object to cookies using JSON

    - by Hunkeone
    Hi All on click button I need to add object to array and then write array to cookies. From the start this array can be not empty so I parse cookie first. function addToBasket(){ var basket = $.parseJSON($.cookie("basket")) if (basket.length==0||!basket){ var basket=[]; basket.push( { 'number' : this.getAttribute('number'), 'type' : this.getAttribute('product') } ); } else{ basket.push( { 'number' : this.getAttribute('number'), 'type' : this.getAttribute('product') } ); } $.cookie("basket", JSON.stringify(basket)); } And HTML <button type="button" class="btn btn-success btn-lg" number="12" product="accs" onclick="addToBasket()">Add</button> Unfortunately I'm getting Uncaught ReferenceError: addToBasket is not defined onclick. Can't understand what am I doing wrong? Thanks!

    Read the article

  • How to do a cost-benefit analysis for platform-level features?

    - by Callister Park
    I work on a development team that works closely with Product Managers. There is mutual agreement between the developers and Product Managers that there should be a business case behind every feature the development team builds. My question is, what is an effective way to make a business case for platform-level features that have higher up front cost but will provide long term benefits? For example, the development team would like to implement a plug-in framework. There is the higher up-front cost to implement a plug-in framework but delivering the subsequent features as plug-ins will be cheaper in the long run. This is obvious to everyone including the Product Managers. Is there a standard/simple way to express the cost-benefits? Is there a simple way to visualize it with a graph?

    Read the article

  • Alternative to slip string in this scenario?

    - by MEM
    I have the following information to dynamicaly display: Product XYZ Very nice Very good Very cool Those Very nice, very good, very cool are advantages of a given product, textual, description advantages, normally display in a form of bullets. I guess that it makes no sense to store those on a separate table called advantages, because it will never be used to anything else despite display, and I fill it as too overkill. So I was thinking about creating a varchar255 field on this product table, and allow values to be inserted like: Very nice;Very good;Very cool On a free-form text input field. Then split those on a php array. My question is: Is it out there, a better approach ?

    Read the article

  • How can I use Tier Pricing with Configurable Products? (Magento 1.4+)

    - by Rad The Mad
    How can I use/setup Tier Pricing with Configurable Products? (Magento 1.4+) There was an extension to do this but I think it is only for Magento 1.3. Tried to setup tiers in my Simple Products, but those do not show up, or do not activate when I add to cart from my Config Product page. Any help is appreciated! Thanks. Edit: In my case, I would like to use the Tier Pricing FROM the Simple Product. and not use the Tier Pricing from the Config. Product

    Read the article

  • Iterating ListView items in Android

    - by pocoa
    I want to iterate a list of items into a ListView. This code below is not enough to iterate all the items into the list because of the weird behaviour of getChildCount() function which only returns the visible item count. for (int i = 0; i < list.getChildCount(); i++) { item = (View)list.getChildAt(i); product = (Product)item.getTag(); // make some visual changes if product.id == someProductId } My screen displays 7 results and when there are more than 7 items into the list, it's not possible to access to the 8th item or so.. Only visible items.. Should I use ListIterator instead? Thanks.

    Read the article

  • jquery specific show buttons on hover

    - by bob
    I have an application creating a bunch of divs through a loop. Each div has the class "product" so it looks like <div class="product"> !.....stuff here ....! <div class="show_on_hover">...buttons here... </div> </div> so there are about 12 of these same divs per page. I would like to hover over a specific one and show the specific "show_on_hover" div which is initially set to display:none. $('.product').hover(function() { $(.show_on_hover).show(); }, function () { $(.show_on_hover).hide(); } ); That is what I have so far but it will show ALL of the .show_on_hovers on the page so I am wondering how to get only the specific one you have moused over to show. This effect is seen on youtube when you mouseover any of the comments, and some comment tools pop up. Thanks!

    Read the article

  • CASE + IF MysQL query

    - by terence6
    Problem is as follows. I have a product that can be in one of three categories (defined by category_id). Each category table has category_id field related to category_id in product table. So I have 3 cases. I'm checking If my product.category_id is in table one. If yes, I take some values. If not I check in tables that are left. What can I write In the ELSE section? Can anyone correct my query ? CASE WHEN IF EXISTS(SELECT * FROM table1 WHERE category_id='category_id') THEN SELECT type_id FROM table1 WHERE category_id='category_id'; WHEN IF EXISTS(SELECT * FROM table2 WHERE category_id='category_id') THEN SELECT value_id FROM table2 WHERE category_id='category_id'; WHEN IF EXISTS(SELECT * FROM table3 WHERE category_id='category_id') THEN SELECT group_id FROM table3 WHERE category_id='category_id'; ELSE "dont know what here"; END;

    Read the article

  • c# How to make linq master detail query for 0..n relationship?

    - by JK
    Given a classic DB structure of Orders has zero or more OrderLines and OrderLine has exactly one Product, how do I write a linq query to express this? The output would be OrderNumber - OrderLine - Product Name Order-1 null null // (this order has no lines) Order-2 1 Red widget I tried this query but is not getting the orders with no lines var model = (from po in Orders from line in po.OrderLines select new { OrderNumber = po.Id, OrderLine = line.LineNumber, ProductName = line.Product.ProductDescription, } ) I think that the 2nd from is limiting the query to only those that have OrderLines, but I dont know another way to express it. LINQ is very non-obvious if you ask me!

    Read the article

  • How to introduce multi-column constraint with JPA annotations?

    - by plouh
    I am trying to introduce a multi-key constraint on a JPA-mapped entity: public class InventoryItem { @Id private Long id; @Version private Long version; @ManyToOne @JoinColumn("productId") private Product product; @Column(nullable=false); private long serial; } Basically (product, serial) pair should be unique, but I only found a way to say that serial should be unique. This obviously isn't a good idea since different products might have same serial numbers. Is there a way to generate this constraint via JPA or am I forced to manually create it to DB?

    Read the article

  • What is the most efficient approach to fetch category tree, products, brands, counts by subcategory

    - by alex227
    Symfony 1.4 + Doctrine 1.2. What is the best way to minimize the number of queries to retrieve products, subcategories of current category, product counts by subcategory and brand for the result set of the query below? Categories are a nested set. Here is my query: $q = Doctrine_Query::create() ->select('c.*, p.product,p.price, b.brand') ->from('Category c') ->leftJoin('c.Product p') ->leftJoin('p.Brand b') ->where ('c.root_id = ?', $this->category->getRootId()) ->andWhere('c.lft >= ?', $this->category->getLft()) ->andWhere('c.rgt <= ?', $this->category->getRgt()) ->setHydrationMode(Doctrine_Core::HYDRATE_ARRAY); $treeObject = Doctrine::getTable('Category')->getTree(); $treeObject->setBaseQuery($q); $this->treeObject = $treeObject; $treeObject->resetBaseQuery(); $this->products = $q->execute();

    Read the article

  • Preventing decompilation of C# application

    - by Kalpak
    Hi, We are planning to develop a client server application using C# and MySQL. We plan to sell the product on the shelf like any other software utility. We are worried about the decompilation of our product which does have some sort of edge over our competitors in terms of usability and bundled functionality. How can we prevent our software from decompilation, so the business logic of the product remains intact? We have heard about Reflector and other decompilers which makes our code very much vulnerable for copying. Our customer base is not Corporates by medical practitioners who themselves may not do it but our competitors may want to copy/disable licensing so value of our software goes down. Any suggestion to prevent this is most welcome. regards.. Obelisk

    Read the article

  • How to use unlinked result of linq?

    - by user46503
    Hello, for example I'm trying to get the data from database like: using (ExplorerDataContext context = new ExplorerDataContext()) { ObjectQuery<Store> stores = context.Store; ObjectQuery<ProductPrice> productPrice = context.ProductPrice; ObjectQuery<Product> products = context.Product; res = from store in stores join pp in productPrice on store equals pp.Store join prod in products on pp.Product equals prod select store; } After this code I cannot transfer the result to some another method because the context doesn't exist more. How could I get the unlinked result independent on the context? Thanks

    Read the article

  • How do I use a named_scope to filter records in my model

    - by kibyegon
    I have a model "Product" with a "description" field. Now I want to have a link in the index page that when clicked will show all products where the description is blank (empty). In the model I have defined a named_scope like this named_scope :no_description, :conditions => { :description => "" } I have checked that the named_scope works by calling Product.no_description.count on the console. As far as I know, the controller is then supposed to handle the filter request from the link on the "index" action but be able to distinguish it from the default which is view all products. def index @products = Product.all ... My problem is getting the controller handle the different request, what route to setup for the link on the view and the actual link on the view. Hope I explained my problem.

    Read the article

  • Remove specific string from multiple database rows in SQL

    - by Scott
    I have a column that contains page titles, which has the website name appended to the end of each. (e.g. Product Name | Company Name Inc.) I would like to remove the " | Company Name Inc." from multiple rows simultaneously. What SQl query commands (or query itself) would allow me to accomplish this? To re-illustrate, I want to convert multiple rows of 1 column from this: Product Name | Company Name Inc. To this: Product Name

    Read the article

  • How do I make a serilaization class for this?

    - by chobo2
    Hi I have something like this(sorry for the bad names) <root> <product></product> <SomeHighLevelElement> <anotherElment> <lowestElement> </lowestElement> </anotherElment> </SomeHighLevelElement> </root> I have something like this for my class public class MyClass { public MyClass() { ListWrapper= new List<UserInfo>(); } public string product{ get; set; } public List<SomeHighLevelElement> ListWrapper{ get; set; } } public class SomeHighLevelElement { public string lowestElement{ get; set; } } But I don't know how to write the code for the "anotherElement" not sure if I have to make another wrapper around it.

    Read the article

  • How can I get a property as an Entity in Action of Asp.Net Mvc ?

    - by Felipe
    Hi all, i'd like to know how can I get a property like an entity, for example: My Model: public class Product { public int Id { get; set; } public string Name { get; set; } public Category Category { get; set; } } View: Name: <%=Html.TextBoxFor(x => x.Name) %> Category: <%= Html.DropDownList("Category", IEnumerable<SelectListItem>)ViewData["Categories"]) %> Controller: public ActionResult Save(Product product) { /// produtct.Category ??? } and how is the category property ? It's fill by the view ? ASP.Net MVC know how to fill this object by ID ? Thanks!

    Read the article

  • JSF selectItem question

    - by DD
    Hi, Is there a way to dynamically create a selectItem list? I dont really want to have to create lots of bean code to make my lists return List<SelectItem>... I tried this: <ice:selectManyCheckbox> <ui:repeat var="product" value="#{productListingService.list}"> <f:selectItem itemLabel="#{product.description}" value="#{product.id}"/> </ui:repeat> </ice:selectManyCheckbox> but it doesnt work. Any ideas?

    Read the article

  • How to add an object into an object

    - by FlyingCat
    I am trying to add an object into another object. My previous post helped me on the array issue but I also need to add object into an object too. I have something like var temp = {}; for(var i=0; i<test.length; i++){ console.log(test[i]) console.log(product[i]) temp.test[i] =product[i]; } Both of console.log show values. However, I am getting "Uncaught TypeError: Cannot set property '0' of undefined" for the temp.test[i] =product[i] Can someone help me out on this? Thanks a lot

    Read the article

  • Suggestions on including free database products to include in an application - SQL Server Express or

    - by superartsy
    I am working on an enterprise level product that is designed around SQL Server Express and specifically its features (views, concurrent users, stored procedures, CASE and IF statements). Though we don't use any advanced SQL Server features, the database size limit of 4GB in the Express edition may up being a limitation. A work-around is that customers can move to more full-featured versions of SQL Server. The problem is that SQL Server Express deployment is not easy, and the installer size is huge. This is a major drawback for someone looking to try our product. You don't want end-users to not buy a product because the download is huge. Does anyone have any recommendations of a database that has a smaller footprint but all the features of Express and which can be migrated to express?

    Read the article

  • What is a better way to sort by a 5 star rating?

    - by Vizjerai
    I'm trying to sort a bunch of products by customer ratings using a 5 star system. The site I'm setting this up for does not have a lot of ratings and continue to add new products so it will usually have a few products with a low number of ratings. I tried using average star rating but that algorithm fails when there is a small number of ratings. Example a product that has 3x 5 star ratings would show up better than a product that has 100x 5 star ratings and 2x 2 star ratings. Shouldn't the second product show up higher because it is statistically more trustworthy because of the larger number of ratings?

    Read the article

  • Currency Conversion and display fetched from Server

    - by user198725878
    I am fetching the in app purchase items for my app from my web server.the web-server gives the product title, description and price... Currently i am displaying the each product using the product title,description and price.Currently i am showing the currency in $. Now i am having the doubt that , can i display the prices as such?when i referred some URL, it seems that prices needs to be localized. So do i need to display the prices localized which is fetched from my-server? please let me know how should i proceed? Thanks a lot for stopping by..

    Read the article

  • Select products with users

    - by Ploppe
    I have not worked with SQL for quite a long time, and I need some help for a basic query. I have the three following tables: users (id, name) products (id, name) owners (userid, productid, date) One product can be sold by user A to user B and then back to A. Now, I want the list of all products currently owned by every single user with the date of transaction. Currently, my query is this one, but I'm stuck with old data (first association of one product to one user, and not the newest one): SELECT users.name, products.name, date FROM products JOIN owners ON products.id = owners.id JOIN users ON owners.id = user.id GROUP BY product.id Do you have some hints? Thanks

    Read the article

  • Display (tier) prices with qty increments and taxes

    - by witrin
    I need to display (tier) prices based on the qty increments of a product. E.g. a simple product, with a regular price of 50¢, no taxes and qty increments of 20 should be displayed on product views with "$10 per 20". Without using taxes this should be quite easy. But there seems to be no "default" helper or model to do this with taxes enabled and different calulation algorithms (e.g. Mage_Tax_Model_Calculation::CALC_UNIT_BASE); expect for quotes in Mage_Tax_Model_Sales_Total_Quote_Tax and Mage_Tax_Model_Sales_Total_Quote_Subtotal. Did I miss something here, or do I have to write the business logic on my own? And how I would best encapsulate it?

    Read the article

  • Humanizing time

    - by keruilin
    I have a number of products that are perishable. Therefore, each product has an attribute called hours_expiration that tells how many hours the product can be used before it goes bad. For ex, apple expires in 168 hours; nut expires in 4320 hours. Given, the product's hours-to-expiration and the current time (Time.now or Date.now), how can I humanize the time-to-expiration in some of the following sample ways? Your item is set to expire in about: 6 months and 14 days 1 month and 13 days 1 month and 1 day 27 days 1 day 23 hours 1 hour 50 minutes 1 minute Looking for something robust and simple!

    Read the article

  • date enable disable

    - by Newbie
    I have an "add new product page" and I have a field in the database table "jos_stockmovement", "start_week" which contains data for the year and week. In my "Add New Product" page I have a field dropdown-list named "Start Week" which holds the year and week, for example, "2012/36". How do I disable the past week? I all I want to enable is the current week. Heres my code: <td colspan="99"> <%= fld.select :start_week, options_for_select( StockMovement.order("year DESC, week DESC").map { | val | [ "#{ val.year }/#{ val.week }", val.id ] }, :selected => @product.start_week ), :class => "ddl_SW" %> </td>

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >