Posts

Featured post

c++ - Producer-consumer based multi-threading for image processing -

update: have provided reason of problem , solution in answer below. i want implement multi-threading based upon producer-consumer approach image processing task. case, producer thread should grabs images , put them container whereas consumer thread should extract images container thread. think should use queue implementation of container . i want use following code suggested in so answer . have become quite confused implementation of container , putting incoming image in producer thread. problem: image displayed first consumer thread not contain full data. and, second consumer thread never displays image. may be, there race situation or lock situation due second thread not able access data of queue @ all. have tried use mutex . #include <vector> #include <thread> #include <memory> #include <queue> #include <opencv2/highgui.hpp> #include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> mutex mu; struct threadsafecontai...

css - CSS3 selector matching value beginning with "[attribute^=value]" is not matching value that has space(s) after quotation -

the div[class^="test"] selector not match element in markup if element class=" test-something" (the intended selector had been generated on backend.) the div[class^=" test"] is not option. any suggestions? what did there ^= is: 'begins with..' div[class^="test"] { } which work on this: <div class="test and-some-class"></div> <!-- if first string in class matches "test" --> <!-- so, class=" test something-else" won't work you have use css selector: 'contains..' div[class*="test"] { } which work on <div class="class test something-else"></div> <!-- class name can anything. "test" can anywhere --> reference css3 attribute selectors: substring matching

Is Alfresco 5 compatible with JDK 1.5? -

i using alfresco 5 jdk 1.5. below jars using alfresco-opencmis-extension-0.3 alfresco-web-service-client chemistry-opencmis-client-api-0.10.0 chemistry-opencmis-client-bindings-0.9.0 chemistry-opencmis-client-impl-0.10.0 chemistry-opencmis-commons-api-0.10.0 chemistry-opencmis-commons-impl-0.10.0 i have configured parameters , i'm getting error below while getting repository -- ( repositories = factory.getrepositories(parameter) ) org.apache.jasper.jasperexception: org.apache.chemistry.opencmis.commons.exceptions.cmisconnectionexception: unexpected document! received: html document @ org.apache.jasper.servlet.jspservletwrapper.handlejspexception(jspservletwrapper.java:491) @ org.apache.jasper.servlet.jspservletwrapper.service(jspservletwrapper.java:419) @ org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:313) @ org.apache.jasper.servlet.jspservlet.service(jspservlet.java:260) @ javax.servlet.http.httpservlet.service(httpservle...

r - Turning into data.frame into a list based on ids -

i have data.frame: df <- data.frame(id=c(1,1,2,2), event=c("merged", "discussed", "merged", "discussed")) now want turn list, in such way list contains 2 entries - 1 each id (i.e. 1 , 2), , records correspond entries, such: list of 2: [1] name: "1", data.frame id event 1 1 merged 2 1 discussed [2] name: "2", data.frame id event 1 2 merged 2 2 discussed obviously looking generalizable solution scale beyond minimal example. try split split(df, df$id)

Unrecognized DB Format-Excel VBA to Access Database -

im using .accdb file , connecting following code, has worked me multiple times, don't know why corrupting file time. dbpath = activeworkbook.path & "\waitanalysisdb.accdb" tblname = "wait_data_table" strcon = "provider=microsoft.ace.oledb.12.0;data source='" & dbpath & "';" conn.open strcon does "unrecognized format" access error occur due error in connection string, or sql statement inserting records well? thanks here's code, if cares through it. in loops build sql statemetn (rcddetail variable), have if statement, says if there blank in column a, use row above isnt blank. dim conn new adodb.connection, rs new adodb.recordset, dbpath string, tblname string dim rngcolheads range, rngtblrcds range, colhead string, rcddetail string dim ch integer, cl integer, notnull boolean, strcon string, lr integer dim currentdate string dim strdbcheck string 'code checks if there records date in db ...

java - Appscan source edition - SQL Injection -

i using appscan source edition java secure coding. reporting sql injection in application. issue generating query dynamically in code cannot use prepared statement. instead have e esapi.encoder().encodeforsql(new oraclecodec(), query) . appscan not consider mitigate sql injection issue. final string s = "select name users id = " + esapi.encoder().encodeforsql(new oraclecodec(), userid); statement = connection.preparestatement(s); this code additionally not work esapi.encoder() how can resolve issue? what should is final string s = "select name users id = ?" statement = connection.preparestatement(s); statement.setstring(1, userid);

jquery - JTable Repaint Parent from a Pop-Up -

got popup used below javascript function when closed. <script> window.onunload = refreshparent; function refreshparent() { window.parent.location.reload(); </script> however, need on parent refresh/repaint jtable hooked on div tag named site. $('#site').jtable({ i tried: window.parent.$('#site').repaint(); // , window.parent.location.$('#site').repaint(); // , parent.$('#site').jtable('repaint'); however, nothing refresh data. need refresh jtable since there several back-end changes happened can not keep track of. just wondering if there way reloaded data in jtable.