Posts

Featured post

clojurescript - Clojure newbie struggling with protocols -

clojurescript - Clojure newbie struggling with protocols - i attempting build out concept of cursor in clojurescript, backed atom. cursor recursive zipper mechanism editing immutable nested associated datastructure. i newbie @ clojure, can help me spot errors? (defprotocol cursor (refine [this path]) (set [this value]) (value [this])) (defn- build-cursor* [state-atom paths] (reify cursor (set [this value] (swap! state-atom (assoc-in @state-atom paths value))) (refine [this path] (build-cursor* state-atom (conj paths path))) (value [this] (get-in @state-atom paths)))) (defn build-cursor [state-atom] (build-cursor* state-atom [])) (comment (def s (atom {:a 42})) (def c (build-cursor s)) (assert (= (value c) {:a 42})) (set c {:a 43}) ;; warning: wrong number of args (2) passed quiescent-json-editor.core/set @ line 1 <cljs repl> (assert (= (value c) {:a 43})) (def ca (refine c :a)) ;; warning: wrong number of args (2) passed quiescent-js

java - jena.query.ResultSet: hasNext() evaluates false but should contain something -

java - jena.query.ResultSet: hasNext() evaluates false but should contain something - i seek query dbpedia 3.9 datasets on virtuoso (local, 7.0.0). query works fine on sparql endpoint, when using jena, resultset virtuoso query execution not contain nil (hasnext() false). had here , here, still have pb. below code using. have thought of what's wrong? thanks. import virtuoso.jena.driver.virtgraph; import virtuoso.jena.driver.virtuosoqueryexecution; import virtuoso.jena.driver.virtuosoqueryexecutionfactory; import com.hp.hpl.jena.query.querysolution; import com.hp.hpl.jena.query.resultset; import com.hp.hpl.jena.rdf.model.rdfnode; import com.hp.hpl.jena.rdf.model.resource; public static void testdbpedialex(resource dbpedia) { string query = " prefix lexvo: <http://lexvo.org/ontology#> \n" + " prefix rdf: <http://www.w3.org/2000/01/rdf-schema#> \n\n" + " select ?lexlabel { \n" + "

angularjs - Simulate Network Delay Jasmine Unit Test with $httpBackend -

angularjs - Simulate Network Delay Jasmine Unit Test with $httpBackend - i have angularjs directive uses ng-mouseenter trigger phone call backend data. if phone call backend goes longer time, loading indicator presented. i'd test loading indicator gets presented when network phone call taking longer specified period of time. is there way simulate delay $httpbackend? the code triggers these actions (inside directive): scope.triggerpopover = function () { if (angular.element('.my-element-style').length === 0) { scope.detailprom = $timeout(function () { makerestcall(attrs.assetid || ''); }, 200); //waits length before makes phone call backend //we want loading icon come little bit later, because seem flicker //when calls fast scope.loadingprom = $timeout(function () { showloadingpopover(); }, 500);

Batch File: How to delete files sort by date if there are subfolders in the folder? -

Batch File: How to delete files sort by date if there are subfolders in the folder? - here 1 example: there 4 files: c:\test\1002.bak -- created on oct 2nd,2014 c:\test\1009.bak -- created on oct 9th,2014 c:\test\subfolder\1001.bak -- created on oct 1st,2014 c:\test\subfolder\1008.bak -- created on oct 8th,2014 i want batch file delete older files sorted date, files including subfolders. it should sorted like: c:\test\subfolder\1001.bak c:\test\1002.bak c:\test\subfolder\1008.bak c:\test\1009.bak but if run below command, result has been separated subfolder. instance, "dir /a-d /od /s > result.txt" result.txt: volume in drive c has no label. volume serial number aadb-db05 directory of c:\test 2014/10/02 11:40 4,220,416 1002.bak 2014/10/09 07:02 1,453,321,216 1009.bak 2014/10/09 18:44 0 result.txt 3 file(s) 1,457,541,632

excel formula - Multiple Or Conditions in a Countifs Statement -

excel formula - Multiple Or Conditions in a Countifs Statement - is possible have multiple or conditions in countifs statement? i trying write statement counts number of records relationship either 'contractor' or 'supplier' , if severity either 'serious' or major. first or status work, first status in sec or statement beingness picked up. here have written: =(countifs(data!f:f,{"contractor","supplier"},data!e:e,{"serious","major"})) =sumproduct((data!f:f="contractor")+(data!f:f="supplier"),(data!e:e="serious")+(data!e:e="major")) the (data!f:f="contractor") produce array of true/false size of column f, true column f "contractor". the (data!f:f="supplier") produce array of true/false size of column f, true column f "supplier". the above 2 arrays "added" - converts them 1/0s instead , adds 2 arrays toget

c++11 - C++ shared_ptr and Java native Object ownership -

c++11 - C++ shared_ptr and Java native Object ownership - while exposing functionalities c++ library java faced problem regarding c++ shared_ptr pointers. case object jlong handle related object lives whithin java portion subsequent structures access object using smart pointers. the problem got is: when smart pointer gets destroyed or reset underlying object gets deleted well. java reference points still object. i tried lot did not manage maintain ownership on java-side. there best practices or solutions problem ? if want hold object long java keeps reference it, here useful pattern: jlong java_xxx_getnativeref(...) { std::shared_ptr<myobject> *pnew = new std::shared_ptr<myobject>; *pnew = whatever-you-do obtain std::shared_ptr<myobject>; homecoming reinterpret_cast<jlong>(pnew); } java_xxx_releasenativeref(..., jlong nativeref) { std::shared_ptr<myobject> *psp = reinterpret_cast<std::shared_ptr<myobject> *&g

vb.net - SSRS deploy report by rs.exe set "Limit report processing.." propeties -

vb.net - SSRS deploy report by rs.exe set "Limit report processing.." propeties - any body know how set propeties processing options -> study timeout -> limit study processing next number of seconds: study deploy rs.exe utility vb scripts parameter? have vs script deploy reports rs server, cant find name of method set needed properties. have found list of methods http://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010_methods.aspx cant' find 1 can help me set time-out. dim definition [byte]() = nil dim warnings warning() = nil dim rsreportspath string = "/" + rsfolder dim is_error boolean public sub main() rs.credentials = system.net.credentialcache.defaultcredentials is_error = false 'create parent folder seek rs.createfolder(rsfolder, "/", nothing) console.writeline("parent folder created: {0}", rsfolder) grab e exception console.writeline(e.