Posts

python - How to download a file from Mozilla Firefox using HTML? -

my task is, if user clicks download link download file, file should automatically downloaded. done task , got successful output in browsers chrome , ie.now problem is, code not working browsers mozilla firefox , safari. please me solve issue. ff = open('sample.html','a') ms = """<h2>product summary</h2> <center><table border = "1"> <tr> <th>product id</th> <th>product download</th> </tr>""" ff.write(ms) row in __builtin__.product_info: ff.write("<tr>") ff.write("<td> %s</td>" %str(row[0]).strip()) ff.write("<td>") ff.write("<a href= '%s' download>download</a>" %str(row[1]).strip()) #(the problem here..) ff.write("</td>") ff.write("</tr>") m = """</center></table> <br> </pre> </b...

c# - Error : possible unintended reference comparison to get a value comparison cast the right hand -

i have following code gives warning "possible unintended reference comparison; value comparison, cast right hand side type string ": // ocontrol of type control if ((ocontrol.name == odatarowview["conname"].tostring())) { //do stuff } else { //do other stuff } i've tried fix using each of following still warning if ((ocontrol.name == convert.tostring(odatarowview["conname"]))) { //do stuff } else { //do other stuff } if ((ocontrol.name == (string)odatarowview["conname"])) { //do stuff } else { //do other stuff } please explain reason still warning , best practice way deal this? these options work: if (equals(ocontrol.name, odatarowview["conname"])) // best option if ((string)ocontrol.name == odatarowview["conname"].tostring()) // assuming neither item null if (ocontrol.name string == odatarowview["conname"] string) // assuming second item string

java - Declaring scope for a bean -

my code: <?xml version="1.0" encoding="utf-8" standalone="no"?> <!doctype beans public "-//spring//dtd bean //en" http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="person" class = "org.dalai.listpers.person" scope = "singleton"> </bean> </beans> i think doing right, anyway error on line 4 : attribute "scope" must declared element type "bean" any hints how solve appreciated the scope attribute supported in spring 2.0, , have using correct dtd/schema. you can refere below link same. http://forum.spring.io/forum/spring-projects/aop/22379-why-does-scope-attribute-cause-xml-parsing-exception

oracle - Extract text from CLOB PL/SQL NameSpace -

i trying extract data clob column , see in separate column. query using: select xmltype(t.detailbericht).extract('//tekst_reden_afwikkeling/text()').getstringval() ozg_if.mtwk_abcdef t the colum t.detailbericht contains clob text following contents: <ns0:zaak xmlns:ns0="http://www.xxxxx.xx/xxx_xxx_xxxxxxxxxxxx/text_text_v002"> <ns0:code_reden_afwikkeling>d99</ns0:code_reden_afwikkeling> <ns0:tekst_reden_afwikkeling>volledig betaald</ns0:tekst_reden_afwikkeling> <ns0:code_koptekst>490</ns0:code_koptekst> <ns0:omschrijving_koptekst>volledig voldaan.</ns0:omschrijving_koptekst> </ns0:zaak> anybody got ideas? hmm apparently seems work when replace ns0: nothing code using: xmltype(replace(t.detailbericht,'ns0:','')).extract('//tekst_reden_afwikkeling/text()').getstringval() tekst_reden_afwikkeling

html - What is wrong with my CSS code? -

i'm new html / css. want build web site stumbled across problem. my divs inside "content div" have blank space @ top line div, , can't seem figure out causing problem. can please help? apreciate it. thank you! <head> <meta charset="utf-8"> <title>vlad olar</title> <style type="text/css"> body { padding:0; margin:0; font-family:lato, segoe, "segoe ui", "dejavu sans", "trebuchet ms", verdana, sans-serif; background-color:#d8dce1; } .clear { clear:both; } .fixedwidth { width:960px; margin:0 auto; padding:0 0; } #topbar { background-color:#4c7585; height: 40px; width: 100%; } #front { height: 360px; width: 100%; background-color:#d8dce1; } #line { height:10px; width:100%; background-color:#4c4c4c; } #foto { height:120px; wid...

how to send JSON to a REST web service -

i wrote simple web service in mailrest class path: @path("/service") the post method want test is: @post @path("/sendtest/") @consumes(mediatype.application_json) @produces(mediatype.text_plain) public string test(jsonobject json) { string input = (string) json.get("input"); string output = "the input sent is:" + input; system.err.println(output); return "hello"; } my mailrestclient class is: static final string rest_uri = "http://localhost:9999/mail"; static final string mail = "service/sendtest"; public static void main(string[] args) { mail mail = new mail(); mail.setfrom("testfrom"); mail.setto("testto"); byte[] attachment = new byte[] {}; string attachmentbase64encoded = datatypeconverter.printbase64binary(attachment); gson g = new gson(); string json = g.tojson(mail); ????? } i understand best method calling i saw exam...

vba - Excel file contains invalid hidden characters that can't be removed -

i have peculiar problem hidden characters in excel spreadsheet uses vba create text file. i've attached link test version of file, , i'll explain best can issue. the file creates plain txt file can used feed data system use. works normally, we've been supplied approximately 15,000 rows of data, , @ random points throughout there hidden characters. in test file, there's 1 row , it's cell b11 has hidden characters @ beginning , end of value. if put cursor @ end of it, , press backspace key, if nothing has happened, you've deleted 1 of characters. as far excel concerned, hidden characters question marks, they're not, text stream parse those, doesn't, , instead throws invalid procedure call error. i've tried using excel's clean formula, i've tried vba equivalent, tried using 'replace', nothing seems recognise characters. excel convinced they're question marks, ascii character call gives me same answer (63), replace doesn...