Posts

java - Error: the method getId() is undefined for the type List<Product> -

i have method create list of objects of class public list<product> initproducts(){ list<product> product = new arraylist<product>(); product prod = new product(product.getid(),product.getitemname(),product.getprice(),product.getcount()); product.add(prod); return product; } my product class is: public class product { int itemcode; string itemname; double unitprice; int count; /** * initialise fields of item. * @param name name of member of product. * @param id number of member of product. * @param price price of member of product. */ public product(int id, string name, double price, int c) { itemcode=id; itemname=name; unitprice=price; count = c; } public int getid() { return this.itemcode; } public string getitemname() { return this.itemname; } public double getprice() { return this.unitprice; } public int getcount() { return this.count; } /** * print details members of product class text...

c# - Hyperlink - content binding -

i have textbox user inputs uri. becomes navigateuri property of hyperlink, allowing user click on link open page. <!-- input textbox --> <textbox x:name="linkbox" width="175" text="{binding path=docref, mode=twoway}" /> <!-- hyperlink --> <textblock> <hyperlink datacontext="{binding elementname=linkbox}" navigateuri="{binding path=text}" requestnavigate="hyperlink_requestnavigate"> <textblock datacontext="{binding elementname=linkbox}" text="{binding path=text}" /> </hyperlink> </textblock> this works inputting whole (absolute) uri in textbox. however, user wants input 'document.extn' bit of uri, , have application prepend rest of resource (ie, ' http://www.example.com/ ' bit). how set base part of uri , append document reference (preferably in xaml)? came across hyperlink's ba...

php - MYSQL getting error when using correct syntax and also logged in as a restricted anonymous user -

i have searched on internet , asked several people @ work how resolve issue i'm ready give up... installed mysql on laptop can't log in user. raymunds-macbook-pro:~ raymundsinlao$ /usr/local/mysql/bin/mysql welcome mysql monitor. commands end ; or \g. mysql connection id 2149 server version: 5.6.13 mysql community server (gpl) copyright (c) 2000, 2013, oracle and/or affiliates. rights reserved. oracle registered trademark of oracle corporation and/or affiliates. other names may trademarks of respective owners. type 'help;' or '\h' help. type '\c' clear current input statement. mysql> -u root -p; error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near '-u root -p' @ line 1 mysql> when try login tells me syntax wrong. have tried ton of different possible ways , doesn't work. my other problem anonymous user can't access databases other information_schema , test....

testing - How to mock Perl module Time::HiRes -

there great perl module time::hires . heavily use in library , want write tests. have found 2 cpan modules mocks perl time() function, both of them don't support time::hires : time::mock test::mocktime how can mock time::hires sub gettimeofday() ? ps want fix tests module time::eta . use ugly hack sleep "mock", sometimes works , not . you can write own module with blackjack , hookers mock gettimeofday. modifications of test::mocktime wrote: #!/usr/bin/perl package mymocktime; use strict; use warnings; use exporter qw( import ); use time::hires (); use carp; our @fixed = (); our $accel = 1; our $otime = time::hires::gettimeofday; our @export_ok = qw( set_fixed_time_of_day gettimeofday restore throttle ); sub gettimeofday() { if ( @fixed ) { return wantarray ? @fixed : "$fixed[0].$fixed[1]"; } else { return $otime + ( ( time::hires::gettimeofday - $otime ) * $accel ); } } sub set_fix...

css - Magento Grid - Products Collapsed Vertically -

i have added many products in magento site when user clicks on category products more 3 items collapsed vertically, can 1 suggest me solution? http://onlyresult.com/ec/mag2/mag/index.php/keyboard.html?limit=9 thanks in advance.

I can't add new options to "select" element using jQuery -

i have mvc application , there's view javascript code. data service , return json string (not object). here'e controller code: public jsonresult getdatatableasjson() { return json(mobileserviceclient.getallcashdesks(), jsonrequestbehavior.allowget); } the javascript code in view: $.ajax({ ... html.push('<select id="options">'); html.push('</select>'); $.ajax({ url: hostname + 'search/getdatatableasjson', contenttype: "application/json; charset=utf-8", datatype: "json", crossdomain: "true", async: false, success: function (data1) { var dt = json.parse(data1); $.each(dt, function(key, value) { $('#options').append($("<option></option>").attr("value", value.cityname).text(value.cityname)); ... what happen? list empty, there should items...

performancecounter - DTLB miss number counting discrepency -

i running linux on 32-nm intel westmere processor. have concern seemingly conflicting data on dtlb miss numbers performance counters. ran 2 experiments random memory access test program (single-threaded) follows: experiment (1): counted dtlb misses using following performance counter dtlb_misses.walk_completed ((event 49h, umask 02h) experimt (2) counted dtlb misses summing following 2 counter value mem_load_retired.dtlb_miss (event cbh, umask 80h) and mem_store_retired.dtlb_miss (event 0ch, umask 01h) i expected output of these experiments similar. found numbers reported in experiment (1) twice of in experiment (2). @ loss why case. can shed light on apparent discrepancy? thanks arka that expected since first event counts number of misses tlb levels caused possible reasons (load, store, pre-fetch), including memory accesses performed speculatively, while other 2 events count retired (that is, non-speculative) load , store operations, , among them didn’...