Posts

asp.net - Can you help with this MVC ViewModel issue? -

i have problem mvc view cannot seem solve. here is. 1) have index view displays list of retailers data retailers table. far good. 2) want include retailer categories each retailer stored in retailerscategories table each retailer can have multiple categories i have tried few things cannot seem make work. closest came wanted using view model. have included code below. i right data of retailer records , of category records. what need 1 retailer record @ time of categories relate retailer. can show me how can achieve this? //controller public actionresult index(int? page, int country) { var viewdata = new retailersindexviewmodel(_retailerrepository.getallretailersbycountry(country), _retailerrepository.getretailercategories()); return view(viewdata); } // viewmodel public class retailersindexviewmodel { public ienumerable<retailersshipping> retailershipping { get; set; } public ienumerable<retailerscategory> retailercateg...

asp.net - Html.ValidationSummary showing duplicate error messages -

i have searched , googled answer question no avail. i'm using ef4 , asp.net mvc2 , have ef4 entity "award" non-nullable string field, "recipientid". i'm using dataannotations server-side validation, in "award" partial class i've set recipientid have required attribute. when try submit form recipientid text box empty, see error message "please enter recipient" in html.validationsummary twice. would because error being thrown both entity (in non-nullable field null value), application? whatever reason, there way "fix" , have error message show once? (fix being in quotations because i'm not sure if intended behavior or not.) didn't think necessary include relevant code, if it's needed. thank in advance help. it looks intended, according brad wilson . should have searched "constraintexception" , ef4. :) according brad, input validation fired before model bound resulting in "requi...

python - Matplotlib transparent line plots -

Image
i plotting 2 similar trajectories in matplotlib , i'd plot each of lines partial transparency red (plotted second) doesn't obscure blue. edit : here's image transparent lines. plain , simple: plt.plot(x, y, 'r-', alpha=0.7) (i know add nothing new, straightforward answer should visible).

xpath - HtmlUnit getByXpath returns null -

i coding groovy, however, don't believe language specific set of questions. i have 2 questions first question i've run issue while using htmlunit. telling me trying grab null. the page i'm testing on is: http://browse.deviantart.com/resources/applications/psbrushes/?order=9&offset=0#/dbwam4 my code: client = new webclient(browserversion.firefox_3) client.javascriptenabled = false page = client.getpage(url) //coming null title = page.getbyxpath("//html/body/div[4]/div/div[3]/div/div/div/div/div/div/div/div/div/div/h1/a") println title this prints out: [] is because page uses onclick() ? if so, how around that? enabling javascript creates mess in cmd prompt. second question i wanting image having trouble because when attempt xpath (via firebug) shows as: //*[@id="gmi-resviewsizer_img"] how handle that? first answer: /html/body/div[3]/div/div[3]/div/div/div/div/div/div/div/div/div/div/h1/a your xpath off 1 in...

How to retain/recall values of tableLayoutPanel of child form from main form button in C#(Visual Studio) 2010? -

i have 2 questions , need guidance 1) please guide me how retain/recall textboxes values of tablelayoutpanel of child form button click event of parent form in c#., scenario , have filled out values in textboxes of tablelayoutpanel in child form , return parent form . if want see/review values of (previously) filled textboxes values of tablelayoutpanel of child form, can that? please suggest me solution., 2)can redraw rows/columns of tablelayoutpanel dynamically upon changing user input(of rows/columns) . please remember in case need discard previous 1 , redraw tablelayoutpanel on again.please suggest how discard previous one? thanks , regards, asad this answer may partially towards resolving query one. for second query, can perhaps override onpaint event might mean custom drawing all controls on form, herculean task depending on how many other controls present.

ipad - Can I cache/store larger files within my native Iphone App -

we looking write app can locally store short videos , pdfs server offline viewing. possible? if so, how storage capacity allowed. so, can pull down 1gb of video view later in app? yes. up storage capacity of device. yes. note ios offers separate temporary, cache , documents folders storage. should aim use temporary or caches folder storage because documents folder backed when syncing itunes, slow if there large files transfer.

java - Fedex checksum algorithm for tracking numbers? -

how validate potential fedex tracking numbers, without hitting web service? i've heard fedex employs modified version of luhn algorithm. check google answer . there different algorithm ground , express.