Posts

php - Extract heading and paragraphs of a docx-file -

i need read docx-file i.e. headings , content of document in variables. i'm reading file this: function read_file_docx($filename){ if(!$filename || !file_exists($filename)) return false; $zip = zip_open($filename); if (!$zip || is_numeric($zip)) return false; while ($zip_entry = zip_read($zip)) { if (zip_entry_open($zip, $zip_entry) == false) continue; if (zip_entry_name($zip_entry) != "word/document.xml") continue; $content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); zip_entry_close($zip_entry); } zip_close($zip); //$striped_content = strip_tags($content); return $striped_content; } my problem how i.e. heading1, heading2 , heading 3 , content of parts in array further processing.

How to access nested array JSON file in blackberry 10 using qml -

i have following json file trying access time, percent, amount above nested array json file using qml. not able these data. want data fill in table has 3 columns. please tell me how it. sample.json: { "rates": [ { "time": "3 months", "interest": [ { "percent": "0.01", "amount": "2500" }, { "percent": "0.02", "amount": "5000" }, { "percent": "0.09", "amount": "10000" } ] }, { "time": "6 months", "interest": [ { "percent": "0.10", "amount": "2500" }, { "percent": "0.11", "amount": ...

sql - Count non empty fields in MYSQL -

i have simple mysql table1: id 1 2 3 and table2: id | question | answer 1 | how | 2 | | fine 3 | | ok and simple query: select table1.id,count(answer not null) table1 left join table2 on table1.id = table2.id i want count non empty answer fields. tried not null it's not working answer column not null , not applicable lead main query return nothing you try this, capture blank: select count(id) table answer not null or answer <>'' that should grab , count row has value in "answer". or, if there join: select table1.count(id), table2.question table1 left outer join tabel1 on table1.id = table2.id group table1.id,table2.question having (table2.answer <> '') or (table2.answer not null)

c# - .net Cookie dissapears after session Timeout -

i have bit of problem handling cookies/session timeout, need persistent cookie expire not @ session timeout, after. problem is, when .net session dissapears after timeout, cookie value not being found, here's code use set cookie , retrieve it. code sets cookie: httpcookie cookiecontext = new httpcookie("cookiecontext"); datetime = datetime.now; cookiecontext["context"] = "mb"; cookiecontext.expires = now.addhours(5); httpcontext.current.response.cookies.add(cookiecontext); code gets cookie @ errorout page when timeout happens (verifycookie() function clears cookie after using it): if (httpcontext.current.request.cookies["cookiecontext"] != null ) { if (httpcontext.current.request.cookies["cookiecontext"]["context"] == "mb") { ...

javascript - Custom numerical search in Adobe Acrobat -

i haven been trying figure out how write greater / less custom search in adobe acrobat, can't seem figure out. i have consulted this , seems apply text search. i wrote this, didn't work: search.query(> "1000","activedoc"); i'm not sure i'm doing wrong. can please provide guidance? thanks. i able working, though i'd rather able search through numbers (using normal search function) versus having open javascript console answers. for (var p=0; p<this.numpages; p++) { (var n=0; n<this.getpagenumwords(p); n++) { var w = this.getpagenthword(p, n); if (w >= 10000) { console.println(w); } else if (w <= -10000) { console.println(w); } } }

objective c - IOS: Is it possible preserve the State of UIViewController in Background -

am developing ios app. need make images upload server. using nsurlsession , uploadtaskwithrequest this. every thing working fine in normal way. requirement user wants store post more 10 images in app using database sqllite. , later show stored posts in uitableview button each uitableviewcell . when user tap on each button should start uploading each post server. thought should persist uiviewcontroller in appdelegate process of uploading should not killed when user go view controllers. my problem: when user close app process in uiviewcontroller post uploading stoping. know how keep uiviewcontroller live in app go close or go background. is there better way fulfill requirement. here better ways! use singleton. in apps, i'll create class called "datahandler" handles of nsurlsession/coredata/etc stuff have is [datahandler uploadimages:images]; and when need information i'll call self.tabledata = [datahandler lastuploadedimages]; thi...

c# - wcf router doesn't expose metadata -

there 30 wcf services , use wcf router distribute requests client. wcf services hosted windows service. when put client , service in same computer, client , service can contact each other. however, when in different machines, client can't contact service. used wcftestclient test service , can't add service, or can't add service if use added client project test it. individual service use net.pipe , router uses net.tcp if service in different machine client. have been working on couple of weeks , problem still there. can point out possibly wrong it? lot! we have setting configuration file end users input name of service server address. port number in setting file also. if (!this._issinglecomputer) { // add protocol conversion router uri routerbaseaddress = new uri(publicbaseaddress, "router"); _routingsvchost = new servicehost(typeof(routingservice), routerbaseaddress); _routingsvchostmex = new ser...