Posts

asp.net - In javascript how to find the height and width -

i having .aspx , masterpage page. in masterpage loading aspx page . in aspx page design using generating table structure using code-behind server in javascript how find height , width . regards, kumar if you're looking table height , width, should it var tbl = document.getelementbyid('tbldemo'); alert(tbl.offsetwidth + '\n' + tbl.offsetheight);

multithreading - BackgroundWorker thread in ASP.NET -

is possible use backgroundworker thread in asp.net 2.0 following scenario, user @ browser's end not have wait long time? scenario the browser requests page, sendemails.aspx sendemails.aspx page creates backgroundworker thread, , supplies thread enough context create , send emails. the browser receives response composeandsendemails.aspx, saying emails being sent. meanwhile, background thread engaged in process of creating , sending emails take considerable time complete. my main concern keeping backgroundworker thread running, trying send, 50 emails while asp.net workerprocess threadpool thread long gone. if don't want use ajax libraries, or e-mail processing long , timeout standard ajax request, can use asynchronouspostback method "old hack" in .net 1.1 days. essentially have submit button begin e-mail processing in asynchronous state, while user taken intermediate page. benefit can have intermediate page refresh as needed, without worrying ...

asp.net - When to use HtmlControls vs WebControls -

i htmlcontrols because there no html magic going on... asp source looks similar client sees. i can't argue utility of gridview, repeater, checkboxlists, etc, use them when need functionality. also, looks weird have code mixes , matches: <asp:button id='btnok' runat='server' text='ok' /> <input id='btncancel' runat='server' type='button' value='cancel' /> (the above case in event wanted bind server-side event listener ok cancel runs javascript hides current div) is there definitive style guide out there? should htmlcontrols avoided? it might useful think of html controls option when want more control on mark ends getting emitted page. more control in sense want every browser see same markup. if create system.web.ui.htmlcontrols like: <input id='btncancel' runat='server' type='button' value='cancel' /> then know kind of code going emitted. though of t...

iphone - How do I display data in a UITableView cell from an NSDictionary? -

hi received 2000 of datas udp , display values in tableview .what easiest method ? now using 2 nsthreads , 1 thread receive data via udp , stores in nsmutabledictionary.another thread update tableview using these dictionary values. crashes app. here code used i stored received values this nsmutabledictionary *dictitem customitem *item = [[customitem alloc]init]; item.sno =[nsstring stringwithformat:@"%d",sno]; item.time=currenttime; [dictitem setobject:item forkey:[nsstring stringwithformat:@"%d",sno]]; [item release]; delegate method used , used customtablecells display data column vice. - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { return 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [dictitem count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *identifier = @"customta...

Output all possible SQL statementes in a Rails Application -

i have inherited medium sized rails application , want try optimize right away. want start database ensure indexes placed need forth. therefore need find out possible sql statements activerecord might make can compare database schema , see immediate optimization can made. in short: there equivalent rake routes output possible sql templates? the hard way the rails development log file should contain of sql used during execution of server. grep file select statements - perhaps getting little smarter using regexp. unfortunately you're unlikely ever able process of information therein manage exception a better way use simple monitoring solution alert when request runs (e.g. scout ). @ rails log file see if problem related db. use db tools most dbs alert via log file somewhere if query runs - mysql example has 'slow queries log'.

java - Eclipse: Working with Systemresources -

based on feedback url load resources classpath in java have changed project, include image resources images.jar my project setup now /program.jar /images.jar in code load images using inputstream connectedimage = classloader.getsystemresourceasstream("images/logo.png"); my eclipse setup is /src/... /images/logo.png my problem eclipse cannot find systemresource based on url. in order work, have manually create images.jar containing image folder add images.jar file eclipse project what need how can configure eclipse can use same code load image either images.jar (if run commandprompt) or images folder(if run eclipse)? is there way make eclipse include /images/ folder when creating runnable jar file of program? not include besides refereced jar files , source code. this do: set directory source folder: right click -> build path -> use source folder change structure of images.jar image files on root (not under directory) chang...

python - How would you design a very "Pythonic" UI framework? -

i have been playing ruby library "shoes". can write gui application in following way: shoes.app t = para "not clicked!" button "the label" alert "you clicked button!" # when clicked, make alert t.replace "clicked!" # ..and replace label's text end end this made me think - how design nice-to-use gui framework in python? 1 doesn't have usual tyings of being wrappers c* library (in case of gtk, tk, wx, qt etc etc) shoes takes things web devlopment (like #f0c2f0 style colour notation, css layout techniques, :margin => 10 ), , ruby (extensively using blocks in sensible ways) python's lack of "rubyish blocks" makes (metaphorically)-direct port impossible: def shoeless(shoes.app): self.t = para("not clicked!") def on_click_func(self): alert("you clicked button!") self.t.replace("clicked!") b = button("the label", click=se...