Posts

Showing posts from January, 2011

.net - PrintPreview Window in C# -

in windows application in .net, need have print preview option excel file. followings codings. //excel.application excelapp = new excel.application(); excel.workbook wb = excelapp.workbooks.open(@"c:\\documents , settings \\admin \\desktop \\docomo\\ news5.xls", type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing); excel.worksheet ws = (excel.worksheet)wb.worksheets[1]; ws.printpreview(type.missing); the compilation successful. didn't print preview window. there requirement of additional parameters or other. don't know how achieve . please guide me.i great full our "techies" timely help. from, m.thillai make sure worksheet has data in it, , make sure visible.

asp.net - Using a different viewmodel in partial view using Spark view engine -

using asp.net mvc & spark, have view listing number of searches. view has following declaration @ top: <viewdata model="ienumerable<searchmodel>" /> on same search page, render partial used content of popup window enables users add new searches. my problem is: in partial view want make use of typed html helpers , write: ${html.textboxfor(model => model.searchphrase)} but when add another: <viewdata model="createsearchmodel" /> at top of partial view file, spark fails only 1 viewdata model can declared. i can use normal html helpers, how might benefit of using typed html helpers in partial view - or there better way of doing this? instead of <use file="partial"/> try # html.renderpartial("partial", mydata); this should workaround single model limitation.

jquery - Broken DOM in IE and FF after Ajax call -

i strange behaviour of ie , ff while perfoming ajax callm; chrome works expected me ;) in grails use <g:formremote/> tag results in following code : <form onsubmit="jquery.ajax({type:'post', data:jquery(this).serialize(), url:'/url/morurl', success:function(data,textstatus){}, error:function(xmlhttprequest,textstatus,errorthrown){} complete:function(xmlhttprequest,textstatus){performaction(xmlhttprequest)} });return false" method="post" action="/url/morurl" name="tmpform" asynchronous="false" id="tmpform">` in all tested browsers ajac call done , reached complete:function(xmlhttprequest,textstatus){performaction(xmlhttprequest)} callback performs also. after ff , ie doing weird , s...

iPhone Core Data does not fetch any data from Sqlite3 -

i copied filled, existing sqlite3-file project; found (i check with - (void)createeditablecopyofdatabaseifneeded { nslog(@"checking if have create editable copy of database"); // first, test existence. bool success; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; nserror *error; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *writabledbpath = [documentsdirectory stringbyappendingpathcomponent:@"hvw.sqlite"]; success = [filemanager fileexistsatpath:writabledbpath]; if (success) return; nslog(@"creating editable copy of database"); // writable database not exist, copy default appropriate location. nsstring *defaultdbpath = [[[nsbundle mainbundle] resourcepath] stringbyappendingpathcomponent:@"hvw.sqlite"]; success = [filemanager copyitematpath:defaultdbpath to...

java - Replacing JWSDP jar files with up-to-date equivalents from Maven repo -

i inherited old project uses jwsdp, , upgrade maven 2 , java 6. the project uses following jwsdp jar files: jwsdp-jax-qname-1.5.jar jwsdp-jaxrpc-api-1.5.jar jwsdp-jaxrpc-impl-1.5-patched-1.10.jar jwsdp-jaxrpc-spi-1.5.jar jwsdp-namespace-1.5.jar jwsdp-relaxngdatatype-1.5.jar jwsdp-saaj-api-1.5.jar jwsdp-saaj-impl-1.5.jar jwsdp-xalan-1.5.jar jwsdp-xercesimpl-1.5.jar jwsdp-xsdlib-1.5.jar as far understand, up-to-date equivalents these jars should part of glassfish , ones need, , available in maven 2 repository? if want upgrade jwspd 1.6 versions of given artifacts, you'll need following dependencies (that can find in http://mvnrepository.com/ ): <dependencies> <dependency> <groupid>javax.xml</groupid> <artifactid>jax-qname</artifactid> <version>1.1</version> </dependency> <dependency> <groupid>javax.xml</groupid> <artifactid>jaxrpc-api</artifactid...

java - Do I have to learn AWT before learning Swing? -

if want code desktop application in windows java, should buy book swing , skip reading books/tutorials awt? or have learn awt before using swing? just go straight swing . ignore awt . there no benefit getting head around awt, swing replacement it.

php script to stay for few second in some page and redirect -

is there way make page display few seconds in php , redirect page ? the meta redirect want, can in php too, this: <?php header("refresh: 10;url=http://www.yourdestination.com/"); ?> where 10 number of seconds wait.

java - Simple way to add escape characters to a string -

does have simple tool can convert non-escaped string escaped string? for example, i'm trying paste following data java string datatype: <?xml version="1.0" encoding="utf-8" standalone="yes"?> i manually have add slashes: <?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?> then can paste java code: string xml="<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>"; adding slashes gets annoying when it's 3mb string. know find/replace can work in lot of tools, need faster way. this must common issue. developers do? i'm thinking emacs macro trick didn't see obvious. if it's 3mb string read file instead of hard-coding in source code.

actionmailer - Rails initializers folder -

i'm having little trouble understanding how files inside intializers folder used. files within directory loaded automatically? or need specify ones in location? the above question came play because wanted setup action mailer. created file called smtp_gmail.rb inside folder defined actionmailer::base.smtp_settings = { ... }. sufficient let action mailer know use these settings? my guess files in initializers folders loaded, , if configuration specific set, used. yes, files in config/initializers loaded automatically. here's detailed article on subject . see section 2.7.27.

jquery - How to get jqGrid reload to go to server? -

we use jqgrid navigator reload button on grid loadonce set true. the reload button not go server data - how can reload go server latest data? i believe can use beforerefresh callback set grid data json instead of local i'm not clear how configure beforerefresh method - don't understand docs. you not person has problem. answerd the same question before. reload grid content server should reset datatype parameter original value "json" or "xml" , refresh grid. example jquery("#list").jqgrid('setgridparam',{datatype:'json'}).trigger('reloadgrid'); updated : call line inside of beforerefresh event handler can following jquery("#list").jqgrid('navgrid','#pager', { edit:false,view:false,add:false,del:false,search:false, beforerefresh: function(){ alert('in beforerefresh'); grid.jqgrid('setgridparam',{datatype:'json'}).trigger(...

c# - Enable listview columHeader checkBox Click -

here wants have checkbox in listview header. , wrote below code that, can me out here enable check-box . now able see checkbox- not click on it. has idea on , can handled listview3_columnclick event..?? in advance. private void listview3_drawcolumnheader_1(object sender, drawlistviewcolumnheadereventargs e) { textformatflags flags = textformatflags.leftandrightpadding; e.drawbackground(); //checkboxrenderer.drawcheckbox(e.graphics, clientrectangle.location, system.windows.forms.visualstyles.checkboxstate.uncheckednormal); checkboxrenderer.drawcheckbox(e.graphics, clientrectangle.location, textrectangle, "", this.font, textformatflags.horizontalcenter, clicked, state); e.drawtext(flags); } i think have got private void listview_columnclick(object sender, columnclickeventargs e) { if (!clicked) { clicked = true; state = checkboxstate.checkedpressed; ...

wpf - AvalonDock : Controling the Splitter position -

using avalondock , odyssey outlookbar in wpf desktop application. doesn't make sense have vertical splitter in resizingpanel have full range of screen width. resizewidth attached property on dockablepane control initial position. can moved full left right. there way of controlling range, or worst case fixing position. <my:dockingmanager grid.row="1" > <my:resizingpanel x:name="resizepanel" > <my:dockablepane my:resizingpanel.resizewidth="200" > <my:dockablecontent x:name="outlookbar" title="outlookbar" also, resizingpanel.effectivesize for, needs size object, eg "100,100" thanks john you can try set minimum size on each of panes. no idea effectivesize for, sounds might intended read-only property similar actualwidth/height.

Troubles with Internet Explorer when hosting TinyMCE on Amazon S3 -

i using tinymce rich text editor on site. instead of hosting tinymce files on main site, using amazon's s3 hosting serve js, image, , other files in tinymce package. with firefox, life good. tinymce get's served nice quick. internet explorer, access denied and/or security warning. my research has me believing cross-domain scripting issue. assuming domain www.mycompany.com , tried creating cname static.mycompany.com still access denied error message internet explorer 8.0. is there anyway around not getting error message using configuration without manually relaxing security within internet explorer? thanks help... regards, matthew pomar maybe can help: http://wiki.moxiecode.com/index.php/tinymce:cross_domain_loading

sql - How do I order by on a varchar field that could contain numbers alphabetically? -

i sure must quite common problem guess microsoft have solved problem. googling skills not scratch. have field want order by, varchar field, example q num 10 num 1 a num 9 num 2 f now expect result be a f num 1 num 2 num 9 num 10 q but not. follows (notice num 10 comes after num 1 , not num 9 expected) a f num 1 num 10 num 2 num 9 q now know reason don't need explain :) can't remember how solve or if there nice flag or command can use right. edit: the examples above example. column contain value. combination of letters , digits. there way sort humanly alphabetically instead of ascii value alphabetically? edit 2: answers far. talking arbitary data. if in fixed position or preceded easy , wouldn't asking. asking general solution problem arbitary data. not patterns, no rules, no nothing. this age old problem of ascii sort order vs. natural sort order see http://www.codinghorror.com/blog/archives/001018.html further detai...

What is the time complexity for looking up an item in a Perl hash? -

suppose have file n words. read each word in file, store in hash (in perl). when go , word in hash, time complexity of looking string(word) in hash? for example: my %seen = (); @arr=("one","two","three"); foreach $item (@arr){ if($seen{$item}) {//do something} } in program, looking item in hash. time complexity of looking string in hash? also, elaborate on how hash implemented in perl? (internally happens in hash? or associative array) perl hashes provide constant-time lookups. implemented true hash tables (with automatic retuning necessary), not associative arrays.

Dynamic order by in JPA/Hibernate? -

the naive attempt query this: query query = em.createquery("from org.domain.resource r r._parent = ? order ?"); this not work parameters should data , not column names or syntax asc or desc. what kind of workarounds have figured out dynamic ordering? concatenating ordering string query string obvious 1 there better ones? this unfortunately how must done jpa. i vaguely remember having used numbered parameters (?1, ?2..) ordering native queries ( em.createnativequery ) on hibernate (but wrong). anyway solution (if using jpa2 or hibernate) use criteria api

jquery - Cascading dropdownlist not working -

i tried change cascading dropdownlist example http://www.codedigest.com/articles/jquery/224_building_cascading_dropdownlist_in_aspnet_using_jquery_and_json.aspx but message "microsoft jscript runtime error: object expected" maybe has idea? <asp:content id="content1" contentplaceholderid="contentplaceholderhead" runat="server"> </script src="~/_scripts/jquery-1.4.2.js" type="text/javascript"> <script language="javascript"> $(document).ready(function () { $("#<%=ticket_artdropdownlist.clientid %>").change(function() { $("#<%=ticket_statusselect.clientid %>").html(""); var ticket_art = $("#<%=ticket_artdropdownlist.clientid %> > option:selected").attr("value"); if (ticket_art != 0) { $.getjson('ticketdetails.ashx?ticket_art=' + ticket_art, function(ci...

iphone - Implement Back action into UITabBarController -

i have controllerview (menucontrollerview) button inside, when click on button new viewcontroller appear tabbarcontroller created programmatically this: uiview* topview = [[uiview alloc] initwithframe:cgrectmake(0,0,320,480)]; tabbarcontroller = [[uitabbarcontroller alloc] init]; viewcontroller1 = [[viewcontroller1 alloc] init]; viewcontroller2 = [[viewcontroller2 alloc] init]; viewcontroller3 = [[viewcontroller3 alloc] init]; viewcontroller4 = [[viewcontroller4 alloc] init]; tabbarcontroller,viewcontrollers = [nsarray arraywithobjects:viewcontroller1 , viewcontroller2 , viewcontroller3 ,viewcontroller4, nil]; [[self tabbarcontroller] setselectedindex:1]; [topview addsubview:[tabbarcontroller view]]; instead of displaying viewcontroller1 first button item, want put action in return menuviewcontroller, don't know how how it. thanks have considered presenting uitabbarcontroller modal view controller , implementing uitabbarcontrollerdelegate? e.g. seems work me ...

iphone - How do I determine the location of each pixel in a square drawn via Core Graphics? -

i trying each pixel point of square drawn using core graphics.here making stroke color black color,i drawing square.please give me idea how pixel point on square drawn. - (void)drawrect:(cgrect)rect { cgmutablepathref path = cgpathcreatemutable(); cgcontextref ctx = uigraphicsgetcurrentcontext(); cgpathmovetopoint(path, null, 30.0f, 30.0f); cgpathaddlinetopoint(path, null, 130.0f, 30.0f); cgpathaddlinetopoint(path, null, 130.0f, 130.0f); cgpathaddlinetopoint(path, null, 30.0f, 130.0f); cgpathclosesubpath(path); cgpathretain(path); cgcontextsetfillcolorwithcolor(ctx, [uicolor clearcolor].cgcolor); cgcontextsetstrokecolorwithcolor(ctx,[uicolor blackcolor].cgcolor); cgcontextsetlinewidth(ctx, 2.0); cgcontextsavegstate(ctx); cgcontextaddpath(ctx, path); cgcontextrestoregstate(ctx); cgcontextstrokepath(ctx); cgcontextrestoregstate(ctx); cgcontextrestoregstate(ctx); [self setneedsdisplay]; cgpathrelease(...

c++ - Win32: How can i set the color of windows Title, Scrollbar etc.? -

i updating gui of win32 application in white text on black background. thats simple content. how can change color of child windows (titlebar, scrollbar etc.). know there wm_ctlcolordlg set color of dialogs. know there wm_ncpaint , leave painting (i.e of scrollbars) me. want, set colors of choice. you can use setsyscolors() change colour window captions, borders, etc. (see http://msdn.microsoft.com/en-us/library/ms724940(vs.85).aspx ). change colour windows, not yours, @ least unfriendly thing do. one option use setsyscolors() change active window caption colour when application has focus , reset defaults when loses focus. i'd that's klunky , not in keeping practice (suppose application crashes? , there might flickering). wm_ncpaint there can things this. bit of pain, maybe that's discourage creating non-standard windows... ;-)

c# - Performance counters and threading -

i creating custom performance counters. creating tasks on thread pool , incrementing/decrementing counters within multiple worker threads. do need give each thread new counter object? safe share performance counter object cross-thread (for increment/decrement) the performancecounter class uses threadsafe wrapper, internal class named sharedperformancecounter. uses interlocked.increment() increment counter value example. there's no need lock yourself.

How can server push asynchronous changes to a HTML page created by JSF? -

when create jsf page, client request allows generation of html dynamically using combination of java code , html. can introduce hooks in html page using jsf framework, allow server update html page based on asynchronous events occurring later @ server, via different threads? jsf 2.3+ you can use @push , <f:websocket> this. below kickoff example updates data table upon application scoped event fired backend. <h:datatable id="notifications" value="#{bean.notifications}" var="notification"> <h:column>#{notification.message}</h:column> </h:datatable> <h:form> <f:websocket channel="push"> <f:ajax event="updatenotifications" render=":notifications" /> </f:websocket> </h:form> @named @applicationscoped public class bean { private list<notification> notifications; @inject private notificationservice service; ...

c# - LINQ: How to Append List of Elements Into Another List -

i have following class public class element { public list<int> ints { get;private set; } } given list<element> , how find list of ints inside list<element> using linq? i can use following code public static list<int> findints(list<element> elements) { var ints = new list<int>(); foreach(var element in elements) { ints.addrange(element.ints); } return ints; } } but ugly , long winded want vomit every time write it. any ideas? return (from el in elements in el.ints select i).tolist(); or maybe just: return new list<int>(elements.selectmany(el => el.ints)); btw, you'll want initialise list: public element() { ints = new list<int>(); }

launch gdb and print out variable value using ruby -

i want write ruby program inspect variable value of program launch gdb , print value. how achieve this? if in shell, : shell > gdb test [...gbd started] (gdb) p variable $1 = 20 (gdb) i hear other ways can achieve same goal, not necessaliy use gdb. try open4 , allows open stdin, stdout, stderr arbitrary command. use open4 run gdb describe, have done , works quite nicely. might want create wrapper class handles running commands , returning status, open4 gives file handles.

What makes Haskell's type system more "powerful" than other languages' type systems? -

reading disadvantages of scala type system versus haskell? , have ask: it, specifically, makes haskell's type system more powerful other languages' type systems (c, c++, java). apparently, scala can't perform of same powers haskell's type system. it, specifically, makes haskell's type system (hindley–milner type inference) powerful? can give example? what it, specifically, makes haskell's type system it has been engineered past decade both flexible -- logic property verification -- , powerful. haskell's type system has been developed on years encourage relatively flexible, expressive static checking discipline, several groups of researchers identifying type system techniques enable powerful new classes of compile-time verification. scala's relatively undeveloped in area. that is, haskell/ghc provides logic both powerful , designed encourage type level programming. unique in world of functional programming. some papers give flavor...

jquery - how to select specific <span> under <div> -

i have structure similar to, <div class="div1"> <a class="myimg" href="#">clickme1</a> <span>myspan1</span> </div> <div class="div2"> <a class="myimg" href="#">clickme1</a> <span>myspan2</span> </div> css <style type="text/css"> .div1 { border: 1px solid red; } .div2 { border: 1px solid black; } .test { border: 1px solid yellow; } </style> <script type="text/javascript"> $(function () { $("a.myimg").click(function () { alert($(this).html()); $("span").addclass("test"); }); }); now when click on <a> span in both divs getting affected, want if click on div1 <a> should affect span1, ...

java - Helps needed for implementing a button action in html page -

problem analysis: when i'm clicking submit button of html form function related button called , work.after completing work mail notification sent consuming time.after confirmation message displayed on same html (without using ajax i,e page refreshed). my question , need: i want avoid user clicking submit button number of times in confusion during waiting period of sending mails.so i'm thinking disable button after pressed once. 1) how it? 2) can please suggest other technique achieve goal without disabling button? i belive work: onclick="this.disabled=true"

multithreading - Visual C#, Child Thread halts processing on parent thread. Why? -

i using visual c# .net via visual studio 2008 express , launching thread forms applications wait on incoming data in loop. so, each loop waits till data available, gets data, , starts again waiting. the main reason why i'm waiting data in separate thread form still allow interaction while other sits there waiting data. for whatever reason, form lock while other thread waiting. unfortunately, forced use proprietary function acquire data. processing literally stop @ function till data returned (which waits on hardware inputs). so, user can click in vain on menu options no effect, till child thread returns data , clicked menu options change status , lock again. so, question is: why child thread holding form? isn't supposed independent? can force form continue function if child thread waiting on something? i making thread this: controlthread = new thread(new threadstart(run)); controlthread.start(); where run function this: public void run() { while (!stope...

web services - Too aggressive bot? -

i'm making little bot crawl few websites. now, i'm testing out right , tried 2 types of settings : about 10 requests every 3 seconds - ip got banned, said - ok , that's fast. 2 requests every 3 seconds - ip got banned after 30 minutes , 1000+ links crawled . is still fast ? mean we're talking close 1.000.000 links should message "we don't want crawled ?" or still fast ? thanks. edit tried again - 2 requests every 5 seconds - 30 minutes , 550 links later got banned . i'll go 1 request every 2 seconds suspect same happen. guess i'll have contact admin - if can find him. here guidelines for web crawler politeness . typically, if page takes x amount of seconds download, polite wait @ least 10x-15x before re-downloading. also make sure honoring robots.txt well.

Prolog: Doubling the value of each element in a list of lists and returning a single list -

i need write set of clauses take list of integer lists , return single list elements doubled. for example: ?- double([[1,2],[3]], x). yes x = [2,4,6] i have set of clauses called mega_append return single list list of lists. for example: ?- mega_append([[1,2],[3]], x). yes x = [1,2,3] here progress (m_a short mega_append): double([],[]). double(list,[h1|t1]) :- m_a(list,[h2|t2]), h1 2 * h2, double(t2, t1). i'll try explain how thought work. flatten first list , split head , tail (h2 , t2). split second list head , tail (h1 , t1). check make sure h1 (the doubled value) equal 2 times h2 (the original value). if check rest of list. if match correctly should left 2 empty lists should match first clause , return yes. it works when there single value (for example: double([[1]], x) ). can offer insight doing wrong? logic or code incorrect? your problem t2 single list list after recursive call not list of lists. to solve can first use meg...

javascript - Shifting elements in a div with overflow auto -

i experiencing problem layout of page controls shifting when attempt change class using javascript event. can ideas around problem. seems problem in ie when left scroll bar appears. here example of html <div id="container" style="overflow:auto;"> <div id="control1container" style="left:17%;top:145px;display:inline;position:absolute;"> <div id="control1" class="listout" >i control</div> </div> <div id="control2container" style="left:67%;top:145px;display:inline;position:absolute;"> <div id="control2" class="listout" >i control</div> </div><!-- more controls here --> </div> so imagine controls within container div take enough space overflow margin appears on left i.e. controls extend below bottom of container div. if attempt change listout class on control1 listin using javascript control shift...

javascript - .getScript() is not working when loaded from a .load() -

you can see way suppose work visiting: link text that loading using standard loading. you can attempt load dynamically here: link text and simple click "parts" link... can see no alert every comes me. i have feeling has ability of detecting when fire getscript..as ondomready wouldn't reload when loading dynamically. here main script load content: $('#sub-navigation li a').click(function(){ var toload = $(this).attr('href')+' #content-container > *'; $('#content-container').hide('fast',loadcontent); var href = $(this).attr('href'); if (href == ".") { window.location.hash = ""; } else { window.location.hash = href; } // first remove selected class active 1 $('#sub-navigation li.selected').removeclass('selected'); // find parent li of clicked element , add selected class $(this).parents('li').addclass(...

python - App Engine regex issues directing URL to script and handlers -

i trying break app separate scripts. part of effort meant breaking api calls it's own file. calls api (like http://example.com/api/game/new no longer work). app.yaml contains this: - url: /api.* script: api.py which seems redirecting because configuration works: def main(): application = webapp.wsgiapplication([('/.*', testpage)], debug=true) util.run_wsgi_app(application) however 1 doesn't: def main(): application = webapp.wsgiapplication([('/game/new$', creategame), ('/game/(d+)$', gamehandler)], debug=true) util.run_wsgi_app(application) the url patterns use in wsgi application have full path - eg, /api/game/.... app engine infrastructure uses regular expressions in app.yaml route requests, not modify request path based on them.

javascript - Problems using HTML Canvas & Greasemonkey not able to drawImage() on 2D context -

in greasemonkey script, when obtain handle on htmlimageelement want use html canvas, following error in firefox's error console (i assume it's because it's enclosed in xpcnativewrapper) : error: component returned failure code: 0x80040111 (ns_error_not_available) [nsidomcanvasrenderingcontext2d.drawimage] putting gm_log() statements throughout code, have traced image object i'm trying use it's initial assignment through until try use html canvas. it's wrapped in xpcnativewrapper: [object xpcnativewrapper [object htmlimageelement]] i've unwrapped htmlimageelement obtaining reference image.wrappedjsobject . my canvas code: var canvas = document.createelement("canvas"); canvas.width = image.width; canvas.height = image.height; var ctx = canvas.getcontext("2d"); ctx.drawimage(image, 0, 0); any ideas why firefox throwing above component failure code? i should have looked more thoroughly on google. im...

debugging - Memory leak with Delphi/DBExpress -

Image
i've weird problem application, memory usage goes few hundred megabytes @ once every , , application freezes. application written delphi, uses database, com (for opc) , tcp/ip. with fastmm i've got following screen shot of memory usage. i'm not sure how read table, looks has allocated 296463552 bytes (0x100fb000, "magic number"?) 3 times. any ideas? there way track non-delphi-mm memory allocations? i'm using delphi 2007 fastmm 4.96. edit: i wrote small helper class using imallocspy track com memory allocations. here's excerpt got: 00119023 5:52:27.484 [4496] tcomallocspy.prerealloc size: 269462304 00119024 5:52:27.734 [4496] (0002760c){ntdll.dll } [7c82860c] kifastsystemcallret + $0 00119025 5:52:27.734 [4496] (0009f83a){myapp.exe} [004a083a] jcldebug.jclcreatethreadstacktrace (line 3943, "jcldebug.pas" + 7) + $1e 00119026 5:52:27.734 [4496] (003d496a){myapp.exe} [007d596a] comleakhelper.tcomallocspy.debugstack (...

PHP select statement from MySql to Excel. Formatting date to YYYYMMDD -

note: in mysql database, "dob" varchar , in format: mm/dd/yyyy date of birth, cvrg effective date, & cvrg expiration date need changed mm/dd/yyyy yyyymmdd when arrives in excel. please see code below: <?php if($qry == "ok"){ // db connection include("connection string goes here"); $select = "select 'a' 'transaction type', policyno 'uhcsr policy no', school 'campus location description', code 'campus location number', '' 'date received uhcsr', '' 'date stamped school', '' 'social security number', ssn 'studentid number', lname 'lastname', fname 'firstname', mi 'middle initial', dob 'date of birth', gender 'gender', concat( concat(address1, ' '), address2) '(mailing) address ln 1','' '(mailing) address ln 2',city...

random - Advantage of using static variables in Java -

say have 2 classes this: class a{ private static random random = new random(); public a(){ // something. } public integer methodgetscalledquiteoften(){ return random.nextint(); } } class b{ private random random; public a(){ random = new random(); // something. } public integer methodgetscalledquiteoften(){ return random.nextint(); } } in scenario both of them instantiated multiple times , both of these classes' instances' method methodgetscalledquiteoften gets called lot, there real advantage/disadvantage (time, memory) in using static variable holds random() in class opposed creating new random() object in every single instance, in class b? the application multithreaded , higher level of randomness think going static securerandom . if real speed factor after profiling might choose else. real advantage/disadvantages depend on real code. in other wo...

Magento Ajax - How to get only body part? -

i trying use ajax call magento. when call block page via ajax, html including head, css, javascript, , body. how body part? if can provide little more information "block page" calling may easier discern issue. default, magento includes <default> layout tag pages, give page headers , footers on ajax calls. to send page without extra, have few options. firstly, can simple set output manually on own, avoiding layout system entirely. magento one-page checkout feature: $result = array( 'foo' => 'foo', 'bar' => 'bar', ); $this->getresponse()->setbody(zend_json::encode($result)); you can modify method use custom layout handler this: protected function loadpage() { $layout = $this->getlayout(); $update = $layout->getupdate(); $update->load('your_custom_handle'); $layout->generatexml(); $layout->generateblocks(); $output = $layout->getoutput(); $result = array...

iphone - trying to programmatically create rightBarButtonItem -

this doesn't seem working. doing wrong? -(void)awakefromnib{ uibarbuttonitem *rightbarbuttonitem = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemadd target:self action:@selector(showneweventviewcontroller)]; self.navigationitem.rightbarbuttonitem = rightbarbuttonitem; nslog(@"awaked"); [rightbarbuttonitem release]; } i put code in viewdidload method rather awakefromnib method; i'm not sure if that's problem lies. "not working" mean?

c - right way to define pointer to the function -

everyone, have piece of code: void foo(int var, int var1) { printf("%d\n", var); printf("%d\n", var1); } void foo_for_foo( void (*some_function)(int, int)) { int x = 5; some_function(x, x); } int main() { void (*ptr_foo); // <- here ptr_foo = &foo; foo_for_foo(ptr_foo); return 0; } does matter how define pointer function: 1) void (*ptr_foo); 2) void (*ptr_foo)(int, int); my compiler receives both versions thanks in advance explanations of difference the 2 forms not equivalent. void (*ptr_foo) not function pointer @ all. it's normal, non-function void pointer. parentheses superfluous , misleading. it's if had written void* ptr_foo . void (*ptr_foo)(int, int) proper way declare function pointer function taking 2 int s , returning void . the reason works because in c, void pointers implicitly convertible other type of pointer. is, can assign other pointer void* , , can assign void* other pointer. but fact wo...

html - z-index and anchor tag -

i have div position relative , z-index :-1 . , have placed <a> on div. seems <a> not working when give postion :relative parent. when change position absolute starts working. tell me why happening. want link work , far possible need keep parent div position :relative , z-index:-1; position:relative make z-index relative parent. http://www.w3.org/tr/css21/visuren.html#propdef-z-index

count concatenate column in mysql -

i want this , case not function. example table: date model no line range lot status 2010-08-01 kd-g435 1 01 1-100 013a accept 2010-08-01 kd-g435 2 01 1-100 013a accept 2010-08-01 kw-tc800 1 01 1-200 001a null 2010-08-01 kw-tc800 2 01 1-200 001a null 2010-08-01 kw-tc800 3 01 1-200 001a null 2010-08-01 kd-r411 1 05 1-100 021a reject 2010-08-01 kd-r411 2 05 1-100 021a reject create table if not exists `inspection_report` ( `id` int(11) not null auto_increment, `model` varchar(14) not null, `serial_number` varchar(8) not null, `lot_no` varchar(6) not null, `line` char(5) not null, `shift` char(1) not null, `inspection_datetime` datetime not null, `range_sampling` varch...

javascript - innerHTML causes IE6 to (permanantly) lock up -

on site working on load series of images can animated using controls implemented w/javascript. works fine in browsers ie6 locks , never recovers; @ least not w/in 15min let sit there. the part choking on portion try modified contents of particular div. before problem: <div id='animation_image'></div> after problem: <div id="animation_image"> <div id="daily_loop_image_13" class="loop_image"> <img name="animation" src="/path/to/image/13/20100119/world_14.gif" class="hiddenelements" border="0"> </div> <div id="daily_loop_image_12" class="loop_image"> <img name="animation" src="/path/to/image/12/20100119/world_13.gif" class="hiddenelements" border="0"> </div> <div id="daily_loop_image_11" class="loop_image"> <img nam...

c# - Creating a very simple linked list -

i trying create linked list see if can, , having trouble getting head around it. have example of simple implementation of linked list using c#? examples have found far quite overdone. a linked list, @ core bunch of nodes linked together. so, need start simple node class: public class node { public node next; public object data; } then linked list have member 1 node representing head (start) of list: public class linkedlist { private node head; } then need add functionality list adding methods. involve sort of traversal along of nodes. public void printallnodes() { node cur = head; while (cur.next != null) { console.writeline(cur.data); cur = cur.next; } } also, inserting new data common operation: public void add(object data) { node toadd = new node(); toadd.data = data; node current = head; // traverse nodes (see print nodes method example) current.next = toadd; } this should provide sta...

c# - what is Image Processing? -

i going create application user can edit pictures color balance effect, gray sheet effect, invert effect , red eye fix etc. my application quite resemble acdsee software. wanna know can application called image processing software ? in point of view image proccessing means playing image's enhancing image's. thanks in advance in electrical engineering , computer science, image processing form of signal processing input image, such photograph or video frame; output of image processing may either image or, set of characteristics or parameters related image. image-processing techniques involve treating image two-dimensional signal , applying standard signal-processing techniques it.[1] so, think can call software image processing software, once check definition propose. [1] http://en.wikipedia.org/wiki/image_processing

internationalization - How can I programmatically find the list of codecs known to Python? -

i know can following: >>> import encodings, pprint >>> pprint.pprint(sorted(encodings.aliases.aliases.values())) ['ascii', 'base64_codec', 'big5', 'big5hkscs', 'bz2_codec', 'cp037', 'cp1026', 'cp1140', 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', 'cp1256', 'cp1257', 'cp1258', 'cp424', 'cp437', 'cp500', 'cp775', 'cp850', 'cp852', 'cp855', 'cp857', 'cp860', 'cp861', 'cp862', 'cp863', 'cp864', 'cp865', 'cp866', 'cp869', 'cp932', 'cp949', 'cp950', 'euc_jis_2004', 'euc_jisx0213', 'euc_jp', 'euc_kr', 'gb18030', 'gb2312', 'gbk', 'hex_codec', 'hp_roman8', ...