Posts

c++ - How can I use POCO to parse an xml file and extract a particular node to a std::string? -

i want extract individual node using poco's libraries can't figure out how it. i'm new xml. the xml looks (abbreviated): <?xml version="1.0" encoding="utf-8"?> <!-- created xmlprettyprinter on 11/28/2012 --> <sbml xmlns = "http://www.sbml.org/sbml/level2/version4" level = "2" version = "4"> <model id = "cell"> <listofspecies> </listofspecies> <listofparameters> <parameter id = "kk1" value = "1"/> </listofparameters> <listofreactions> <reaction id = "j1" reversible = "false"> ... stuff here .. </listofreactions> </model> </sbml> i want extract in listofreactions node , store in std::string, later md5 hashing. i have tried this: ifstream in(joinpath(gtestdatafolder, "test_1.xml").c_str()); inputsource src(in); domparser parser; autoptr<document>...

.net - Virtual Host in Apache downloads the file instead of displaying it -

i'm using apache2 w/ mono mod , works fine when go local ip. 192.168.1.210 but when try go virtual host www.example.com it download webpage instead of displaying it. file: mod_mono.conf gnu nano 2.2.6 addtype application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx directoryindex index.aspx # include web application definitions generated mono-server{2,4}-update. # # if want use asp.net 2.0 (via mono-apache-server2), use: # include /etc/mono-server2/mono-server2-hosts.conf # # if want use asp.net 4.0 (via mono-apache-server4), use: # include /etc/mono-server4/mono-server4-hosts.conf include /etc/mono-server4/mono-server4-hosts.conf <virtualhost *:80> servername example.com serveralias www.example.com serveradmin web-admin@example.com documentroot /var/www/html # monoserverpath can changed specify version of asp.net hosted # mod-mono-...

java - Large file does not download with jsp -

i sending ajax post request script inside jsp. inside controller reading file location , return byte array. fileinputstreamreader = new fileinputstream(file); byte[] bytes = new byte[(int) file.length()]; fileinputstreamreader.read(bytes); filedata = base64.getencoder().encode(bytes); response.setheader("content-disposition", "attachment; filename=" + filename); response.setcontentlength((int) file.length()); fileinputstreamreader.close(); then on front end crating invisible link , downloading file. $.ajax({ url : url, type : 'post', data : nodedata, beforesend : function(jqxhr, settings) { setcsrfheader(jqxhr); }, success : function(data) { hideloader(); /* window.open("data:"+contenttype+";base64, " + data); */ var uri = 'data:'+contenttype+';base64,' + data; var downloadlink = document.createelem...

android - loading only a specific element properly in webview -

i trying load specific element in webview webpage ('contentbody'). dont know how modify code load only. can block elements in webview using simple javascript. public void onloadresource(webview view, string url) { super.onloadresource(view, url); // removes element id = 'masthead' view.loadurl("javascript:(function() { " + "(elem = document.getelementbyid('smsform')).parentnode.removechild(elem); " + "})()"); } an option might use jsoup , load html page website, extract desired portion of html, , load webview. small example of how done: document doc = jsoup.connect("http://example.com/").get(); mywebview.loaddatawithbaseurl("http://example.com/", doc.select(".contentbody").first().outerhtml(), "text/html", "utf-8", null); with this, use jsoup extract first item contentbody class html, , directly load web...

ruby - Rails create task or model to update the schema -

i have list of tables(postgres database), , want create rake task or method not know 1 better change schema existing table. i have done lot of googling , found multi schema used multi tenant applications, have 2 schema alone , use in db this i have list of tables user profile projects , more, update schema while rake db:drop or rake db:migrate example: user , profile stays in public schema , task should create new schema "dashboard" , move project table dashboard. how create task or method update schema while drop , migrate?

java - Spring error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL -

i learn spring , have problem: org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in url [file:/c:/users/pantau_acc/desktop/spring/target/classes/applicationcontext.xml]: invocation of init method failed; nested exception javax.persistence.persistenceexception: [persistenceunit: com.donutek] unable build hibernate sessionfactory @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1578) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:545) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) @ org.springframework.beans.fac...

how to insert anchor tag in export csv report php? -

i want insert anchor tag ( url open csv report ) in csv export. i have 2 variables header , data respectively $csv_header , $csv_lines. in $csv_lines have urls , want export it. my csv code $csv_header = "\"developer name\",\"url\" \n"; $csv_lines =eregi_replace(" ", " ", "\"$developer_name\",\"$url\" \n"); for example $url = <a href="http://www.example.com">example</a> $file_time = date("y-m-d h:i:s"); $csvfilename = "report_$us$file_time.csv"; header('content-type: application/octet-stream'); header("content-disposition: attachment; filename=\"$csvfilename\""); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: public'); ob_clean(); flush(); echo $csv_header; echo $csv_l...