Posts

Architecture of an Excel application -

after 10 years of programming find myself daunting task of creating first excel application in excel 2007. have programmed in vba before on ms access not technical challenge me it's real change of "paradigm" dare say. now have implement excel app talks sqlserver (on dedicated database create), typical crud stuff cannot read on book (excel bible, excel power programming, etc...) how supposed structure app. can give names columns , use them database column when sending data sqlserver when retrieve data what's expected of spreadsheet app example retrieve id, description (hiding id in column , showing description) or should use description , store denormalized data in sqlserver tables, making them equivalent of server side excel sheet? if want use normalized data lookuptable (id, country) should store id, country information in range , if so, how force user pick value range (id, country) without using proper combobox? when retrieve data sqlserver should model ...

How I can create a log for web services in a dynamic web project in Java? -

i'm having problem creating own logs application i'm developing in work, next code have works running in single class method main. try { logmanager lm = logmanager.getlogmanager(); logger logger; filehandler fh = new filehandler(filelogger,true); logger = logger.getlogger(filelogger); lm.addlogger(logger); logger.setlevel(level); fh.setformatter(new simpleformatter()); logger.log(level, message); logger.addhandler(fh); fh.close(); } catch (exception e) { system.out.println("exception thrown: " + e); e.printstacktrace(); } but, when want call function in doget webservice, log appended in catalina log , not in 1 i'm creating. know catalina appends information of call webservice but, how can create new log calls want? thanks!! you should looking @ logging frameworks log4j , logback gives lot of flexibility i...

mysql - Simple SQL Select Query between 2 tables -

i have 2 table first table - usertable usedid username 1 somename 2 someothername second table - ratingtable userid ratingvalue 1 5 1 3 1 5 1 3 2 5 2 5 2 3 2 5 i need write sql query userid in ascending order number of times rated (5 star) select u.userid, u.username, count(*) ratingcount usertable u inner join ratingtable r on u.userid = r.userid , r.ratingvalue = 5 group u.userid, u.username order ratingcount

android - How do I detect the FIXED keyboard on Droid Pro? -

i use getresources().getconfiguration().hardkeyboardhidden detect if device has sliding keyboard drawer open (like on g1). now have droid pro, , returns 1 always, app thinks has slider open. is there way can tell device has keyboard, , it's open ? tia i'm facing similar issue, in cm, phone application. to date phone app behave that: if keyboard open, screen stay on during call. proximity sensor won't used query if device on hear or not: mishardkeyboardopen being true leads screenonimmediately being set true also: boolean screenonimmediately = (isheadsetplugged() || phoneutils.isspeakeron(this) || ((mbthandsfree != null) && mbthandsfree.isaudioon()) || mishardkeyboardopen); in case of fixed physical keyboard, open (not slidding, , in open position). if keep actual code, phone app never off screen using proximity sensor. if there's no way of guessing if keyboa...

getting a delphi app to close a dialog that popped up from a driver -

i have delphi app tries open webcam. under windows 7 fails (that's story/ question /thread) webcam driver pops dialog titled "video source" inviting me select one. if try open driver repeatedly in loop , close dialog manually each time appears, can going. close dialog app. findwindow (nil, 'video source') doesn't find it. if process explorer dialog shown belonging app. if force close pe closes app!. how close dialog? have suspicion (confirmed) app hanging while dialog open, make pretty difficult execute code close dialog. if main application thread stalled waiting user input due popup dialog solution have thread running regularly attempts locate popup. when find use postmessage uses wm_close or similar popup handle. might have send either mousedown/mouseup messages button on popup. further, write small debug application uses windows api windowfrompoint find out popup window, ie. not it's visible caption it's class. can use debug...

wpf - Binding preference: Name or Type? -

knowing mycontrol has depprop. px1 , binding should prefeer, line1 or line2 ? <usercontrol x:class="myproject.mycontrol" xmlns:my="clr-namespace:myproject" x:name="parentcontrol"> <canvas> <line x:name="line1" x1="{binding relativesource={relativesource ancestortype={x:type my:mycontrol}}, path=px1}" /> <line x:name="line2" x1="{binding elementname=parentcontrol, path=px1}" /> </canvas> </usercontrol> i mean, should ensure uniqueness of name "parentcontrol" per possible parents in second case? i prefer latter syntax in cases, it's easier read intent, long choose clear name parentcontrol. down side fails if change name, whereas first continue work. side note: px1 doesn't need dp, long usercontrol implements inotifypropertychanged , notifies when px1 changes. ...

jquery - How to use jsonp to get javascript based ad calls onto a page, asyncronously -

i trying use jsonp solve page performance problem i've been having. on site display ads writing out script tag document.write("<scr" + "ipt src='advendor.com\myad.php'></scr" + "ipt>"); . , except fact sites script tags point have nasty habit of being slow. when have page 5 ads on it can hold entire pages load time due blocking syncronous requests. so idea make jsonp call ad service give me script tag needs written page. problem there <script> tag on page but, script tag nothing. script work if written before document.ready? clarification: have our server side code making calls ad serving system determines ad code server side(in script tag "src=" points vendors site, generates actual ad , tracking). i'm trying stop ad calls blocking loading of content. want content first , ads next. putting script tags @ bottom of page not acceptable solution because need determine ads appear on page. ie, <div id=...