Posts

Python pseudocode to code -

i having problems implementing code need write based on pseudocode have. code in python (because have limited experience it), have having problems "for" statement. my pseudocode is: patterncount(text, pattern) count ← 0 ← 0 |text| − |pattern| if text(i, |pattern|) = pattern count ← count + 1 return count with input of strings text , pattern , need output of count(text, pattern) i think should work: text.count(pattern)

database - MySQL query takes ages to return on a huge table -

i have big table , following code takes 990 sec. complete. bdate , itype indexed. else need optimize/change? select s, count(*) total `mt_ex_15` bdate > '2014-10-01' , bdate < '2014-11-01' , itype = '3' group s order total desc edit: here explain id select_type table type possible_keys key key_len ref rows 1 simple mt_ex_15 ref itype,bdate,s itype 2 const 44157686 using where; using temporary; using filesort edit: think need optimize db or my.cnf because following query took 40 secs. select count(*) total `mt_ex_15` bdate > '2015-02-01' , bdate < '2015-03-01' and here explain: id select_type table type possible_keys key key_len ref rows 1 simple mt_ex_15 range bdate bdate 3 null 4494019 using where; using index for query: select s, count(*) total `mt_ex_15` bdate > '2014-10-01' , bdate < '2...

jquery - Cannot hover on dynamically generated div element -

i dynamically generating row , col-xs-6 col-sm-4 inside #locations-content div element. <div id="locations-content"> <div class="row"> <div class="col-xs-6 col-sm-4"><img class="img-thumbnail" src="assets/img/boston.jpg" id="boston-img-popup"></div> </div> </div> i trying image fade on hover, doesn't appear working. there wrong code: $('#locations-content').on('hover', '.row > .col-xs-6.col-sm-4', function(event){ $(this).find('img').fadeto('slow', 0.4); $(this).find('img').fadeto('slow', 1); }); i believe need use mouseenter instead of hover $('#locations-content').on('mouseenter', '.row > .col-xs-6.col-sm-4', function(event){ $(this).find('img').fadeto('slow', 0.4); $(this).find('img').fadeto('slow', 1); })...

.net - Old C# project pushed to repository, but fails compiling because missing DLLs in VS2013 -

Image
last year ex-employee pushed visual studio project our gitblit repository, once checked out , tried compile it, says error 51 metadata file 'd:\git\epimst\mstdao\bin\debug\mstdao.dll' not found d:\git\epimst\epimst\csc epimst error 47 metadata file 'd:\git\epimst\epidao\bin\debug\epidao.dll' not found d:\git\epimst\epiapputils\csc epiapputils error 48 metadata file 'd:\git\epimst\epidao\bin\debug\epidao.dll' not found d:\git\epimst\mstdao\csc mstdao error 50 metadata file 'd:\git\epimst\epidao\bin\debug\epidao.dll' not found d:\git\epimst\epimst\csc epimst so solution copy these dlls our deployed software , copy them various directories. fixed 'count not found' errors, host of undefined code errors came up. seeing how code did work @ point , live packages still function, cant figure out went wrong between code being checked in , checked out me. unfortunately cant in touch 1 employee ...

cq5 - Is there a way to have components in CQ 5.6 inherit editConfig properties? -

i'm trying figure out how set cq:disabletargeting=true components can added parsys. tried setting cq:childeditconfig in parsys cq:editconfig approach did not work. believe because each component has it's own cq:editconfig . there way set property child components can inherit within own cq:editconfig ? if components inheriting ( sling:resourcesupertype ) foundation/components/parbase example, can make overlay of component defining cq:editconfig new settings. still have problem if 1 of components have overwrite cq:editconfig other settings.

semantic web - Why is owl:Restriction reasoning not working in Blazegraph? -

with following rdf in blazegraph (taken this answer ): :eats rdf:type owl:objectproperty . :vegetable rdf:type owl:class ; rdfs:subclassof owl:thing . :vegetarian rdf:type owl:class ; owl:equivalentclass [ rdf:type owl:restriction ; owl:onproperty :eats ; owl:somevaluesfrom :vegetable ] . :carrot rdf:type :vegetable , owl:namedindividual . :john rdf:type owl:namedindividual , owl:thing ; :eats :carrot . the following sparql returning blank: select ?who { ?who :vegetarian . } here blazegraph namespace configs (blazegraph running nanosparqlserver command line): com.bigdata.namespace.kb.spo.com.bigdata.btree.btree.branchingfactor 1024 com.bigdata.relation.container test-ng-2 com.bigdata.journal.abstractjournal.buffermode diskrw com.bigdata.journal.abstractjournal.file bigdata.jnl com.bigdata.journal.abstractjournal.initialextent 20...

javascript - Can't get correct values from each statement -

i have object (called alluserinfo that's this: object { available_client_ids: array[2] 0: "demo" 1: "4532t78" available_client_names: array[2] 0: "demo" 1: "bobs bakery" email: "jmr@example.com } i need available_client_ids , available_client_names , keep coming undefined or worse. i'm trying this: $.each(alluserinfo, function(index, value) { $('.clients_available3').append("<option>" + index.available_client_names + "</option>"); }); this give me many undefined things appended select ( clients_available3 ). needs like: $.each(alluserinfo.available_client_names, function(index, value) { $('.clients_available3').append("<option>" + index.available_client_names + "</option>"); }); but doesn't work either. edit if this, $.each(alluserinfo.available_client_names, function(index, value) { $('.clients_ava...