Posts

multithreading - Long running background thread causes HTTP request to timeout -

i have spring 3.0 webmvc application running on tomcat 7. on application startup kick off background thread load in-memory cache records db. thread typically takes on hour load data db. in same application have @controller annotated class exposes rest interface clients can objects loaded cache. one of our requirements rest requests made prior data load being finished return service_unavailable (503) http code client immediately. accomplish set simple check of boolean flag each request method in controller makes before doing work. if value false method should return 503 code. loader thread set flag true once completed load allow request methods function normally. the problem background thread seems causing http requests sent controller timeout after 30 seconds instead of hitting flag , returning 503 code client. i'm not expert in tomcat threading issues , wonder if i'm doing wrong when creating long running background thread? using "implements runnable" method ...

How to populate a textbox in vb.net -

i have gridview contais textbox in row 0. i able read textbox 2 instructions: dim control control = gridview.rows(0).findcontrol("textbox") dim valueintextbox textbox = ctype(cntrol, textbox) my question is, how can send data textbox, example sent letter "a" textbox?. suggestion? i using line try populate textbox textbox disappear: gridview.rows(0).cells(0).text = "a" thanks. you can set text using following lines: dim control control = gridview.rows(0).findcontrol("textbox") if control isnot nothing dim valueintextbox textbox = ctype(cntrol, textbox) valueintextbox.text = "some text" end if

iOS - How To Align UIAlertActions Properly? -

i adding checkmark item selected user in uialertcontroller(actionsheetstyle). however, once checkmark added, item checkmark not aligned other items. since items center-aligned this: item aaa item bbb ✓ item ccc i want them this: item aaa item bbb ✓ item ccc so tried added spaces @ end of labels no checkmark. still has no effect on alignment. is there anyway this? thanks! try add invisible unicode symbols.

winforms - C# Form Button Padding -

Image
in c# form i'am trying make nicely looking button cant on text "padding" problem. problematic button desired button i made mind of how should can't achieve it. supposed flat button black borders , "options" text in (like on second picture). kind of "padding" hides pretty big part of text. changing font size kinda helped want perserve button's ~16px height , font small can fit in there unreadable. i've tried setting button's padding property 0. thinking workaround overriding onpaint event / making multiple controls (like, combine label) i'am worried performance impact. hm took shot @ it, best do. i used image flat button, border providing grey area beyond black border. sort of workaround. whatever. here image button background . and code button: // // button1 // this.button1.backcolor = system.drawing.color.fromargb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.button1.b...

javascript - How to access json object using node.js express.js -

Image
my json this var jsonobj = json.stringify(arr, null, 4); console.log(jsonobj); my output this i want access each , every element in json. plese provide me solution task from can tell looks have array of objects , within object sub array ("subacts"). able iterate on objects in "subacts" array need iterate on way: jsonobject.foreach(function(object) { object.subacts.foreach(function(subobject) { console.log(subobject); }); }); this iterate through entire object , print console subacts array objects.

Retrieving data while rendering form in django -

i have form fields. want display fields in form except two. 1 field data needs displayed. able form not able retrieve data db display. model.py class company(models.model): status_choices=( ('service','service'), ('product','product'), ) user=models.onetoonefield(settings.auth_user_model) company_name=models.charfield(max_length=250) company_address=models.charfield(max_length=250) company_telephone=models.charfield(max_length=250,blank=true) company_email=models.charfield(max_length=250,blank=true) company_website=models.charfield(max_length=250,blank=true) vat=models.charfield(max_length=250,blank=true) service_tax=models.charfield(max_length=250,blank=true) company_pan=models.charfield(max_length=250,blank=true) company_bankdetails=models.charfield(max_length=250,blank=true) invoice_type=models.charfield(max_length=250,choices=status_choices,default=...

Can we assign more memory to the Spark APP than cluster it self? -

say spark cluster stand alone cluster. master having 1gb memory , slave having 1gb memory. when submit application cluster, can specify how memory driver program , worker program can have. possible specify higher value 10gb driver , 10gb worker? i mean happen if program submitted requiring more memory cluster self. (let assume physical computer having enough memory) spark has feature called "dynamic allocation". can turned on using spark.dynamicallocation.enabled = true more details here http://www.slideshare.net/databricks/dynamic-allocation-in-spark