Posts

How to edit cell value in VB.net - Using .Interop.Excel -

this simple question. have code: currentrow = 3 mycolumn = 2 currentcell = (currentrow & "," & mycolumn) workingsheet.cells(currentcell).value = (clientname & " " & "(" & clientlocation & ")" & " " & extradefinition) i thought place data on 'workingsheet' in position "b3" places data in cell "af1". why this? thanks, josh cell not expected used using it; have input row , column indices (as integers) separated comma. right code is: workingsheet.cells(currentrow, mycolumn).value = (clientname & " " & "(" & clientlocation & ")" & " " & extradefinition) another alternative have using range . example: workingsheet.range("b3").value = (clientname & " " & "(" & clientlocation & ")" & " " & extradefinition)

android - How to prevent double-click on refresh button -

i'm developing android app i've refresh button in action bar. button call function re-open same activity. activity contains asynctask load content. at moment i'm encountering problem. when click on refresh button works fine, if click on refresh button when asynctask still working (i've progress bar check status) app crashes. the error receive is: nullpointerexception is possible disable button until activity (and asynctask) loaded? in button's onclicklistener , execute asynctask , add code: button.setenabled(false); in onpostexecute() method of asynctask , place this: button.setenabled(true); if give 'cancel' option user(i.e. if have overridden oncancelled() method in asynctask ), enable button in oncancelled() . edit 1 : declare boolean flag in activity: boolean menubuttonisenabled = true; in onclicklistener , set flag false: menubuttonisenabled = false; in onpostexecute() method of asynctask : menubuttonisenable...

.net - making sql query to get first id of a tourist and then all of it's surcharges -

i've got these tables in database: tourist - first table tourist_id - primary key excursion_id - foreign key name...etc... extra_charges extra_charge_id - primmary key excursion_id - foreign key extra_charge_description tourist_extra_charges tourist_extra_charge_id extra_charge_id - foreign key tourist_id - foreign key reservations reservation_id - primary key ..... tourist_reservations tourist_reservation_id reservation_id - foreign key tourist_id - foreign key so here example: i've got reservation reservaton_id - 27 reservation has 2 tourists tourist_id - 86 , tourist_id - 87 tourist id 86 has charges extra_charge_id - 7 , and extra_charge_id - 11; tourist id 87 has charge id - 10; is possible make sql query , name , id of tourist , of charges sothe output like: tourist_id: 86, name:john, charges: 7,11 (here query made extra_charge_description of of tourists reservation_id = 27 ) select extra_charges.extra_charge_description,touri...

c# - Why does this not display the display name? -

i'm trying display displaynames properties in html in asp.net mvc 4 application. though i've set displaynames in viewmodel raw variable names still gets displayed instead. the viewmodel: public class manage_managepasswordviewmodel { [display(name="name")] public string name; [display(name = "subid")] public string subid; [display(name = "conversions")] public int conversions; [display(name = "password")] public string password; public userprofile owner; public manage_managepasswordviewmodel(protectedpassword pw) { name = pw.name; subid = pw.subid; conversions = pw.getconversions(); password = pw.password; owner = pw.owner; } } the cshtml file: @model areas.admin.models.viewmodels.manage_managepasswordviewmodel <div class="editor-label"> @html.displaynamefor(m => m.name): @html.displaytextfor(m => m.name) <...

.net - AppFabric NHibernate provider does not forward requests to DB if Cache Cluster fails -

i've given assignment setup appfabric 2nd level caching using nhibernate appfabric cache provider (by simon taylor ). i've setup , it's working. in failure scenario, if cache cluster or whole service stops working (assuming have 1 cache server) application requests don't forward database. when restart cluster, application works intented. so, despite having 1 cache server isn't practically right, should make application use db in such failure cases? any suggestions appreciated.

javascript - PHP - How to avoid "echo" HTML when there is a need for conditional html blocks for example -

echoing html blocks in php pain, echoed parts not marked , parsed ide's since it's string. deficiency makes difficult edit , change echoed html (especially javascript). wonder if there elegant solution except using include in such cases. here example using alternative if-syntax: <?php if($a == 5): ?> <p>a=5</p> <?php endif; ?>

Convert string to image in python -

i started learn python week ago , want write small programm converts email image (.png) can shared on forums without risking lots of spam mails. it seems python standard libary doesn't contain module can i`ve found out there's pil module (pil.imagedraw). my problem can't seem working. so questions are: how draw text onto image. how create blank (white) image is there way without creating file can show in gui before saving it? thanks :) current code: import image import imagedraw import imagefont def getsize(txt, font): testimg = image.new('rgb', (1, 1)) testdraw = imagedraw.draw(testimg) return testdraw.textsize(txt, font) if __name__ == '__main__': fontname = "arial.ttf" fontsize = 11 text = "example@gmail.com" colortext = "black" coloroutline = "red" colorbackground = "white" font = imagefont.truetype(fontname, fontsize) width, heigh...