Posts

c# - What is cross check in computer vision? -

i looking @ api emgu , brutheforcematcher . if create bruteforcematcher(t)(distancetype) constructor, not cross check. however, not know cross check is, , doesn't seem mentioned in api. in terms of emgu , computer vision, cross check? from c++ api documentation : crosscheck – if false, default bfmatcher behavior when finds k nearest neighbors each query descriptor. if crosscheck==true, knnmatch() method k=1 return pairs (i,j) such i-th query descriptor j-th descriptor in matcher’s collection nearest , vice versa, i.e. bfmatcher return consistent pairs. such technique produces best results minimal number of outliers when there enough matches. alternative ratio test, used d. lowe in sift paper. edit: from understood i'm quite sure can sum above saying that, if found closest match b feature a , tuple (a,b) considered consistent pair , therefore returned if a closest match feature b . a 1d example: -----a------b---c in case though b best mat...

duplicates - MySQL: select phones that belongs to different users -

i have task can't solve myself because of lack of experience, , need help. let's assume have table following fields: "phone_number" , "user_id". goal find numbers belongs more 1 user. the result should looks that: +---------------------------+---------------------------------+ |     phone_number     |     counts     |     users     | +---------------------------+---------------------------------+ |     (xxx)xxx-xxx         |         5         |     1, 5, 9    | +---------------------------+---------------------------------+ phone_number - phone number repeats counts - how many times number repeats users - ids of users having number, separated comma. example (1, 5, 9) i have following query finds number duplicates, need compare id of user. , ids of users number...

actionscript 3 - Wrap items in a grid -

im making inventory system , iv managed add/remove , sort items on x axis. add , remove , resort them on 1 line. cant seem figure out how make go down 1 y space every 10 tiles, or so. im using method thing in game, idk.. ic ant figure out how inventory tile.x = tile_size * (i % 800); tile.y = tile_size * (j % 600); heres code adds items inventory protected function addinvitem(item:movieclip, c:class) { item = new c(); inventory.itemsininventory.push(item); inventory.inventorysprite.addchild(item); item.x = (inventory.itemsininventory.length-1)*40; item.y = 0; item.width = 30; item.height = 25; item.addeventlistener(mouseevent.click, inventory.useitem); } this code deletes , sorts inventory when u click on item public function useitem(e:mouseevent) { var item:movieclip = movieclip(e.currenttarget); inventorysprite.removechild(item); it...

Reading from cache instead of MySQL, except the first user who creates it (PHP) -

in web application, many users post data , request calculated result. since calculation time-consuming, want cache result of first user , let other users read cache. if ( cache::exist( $dataid ) ) { return cache::read( $dataid ); } $result = getdatafromdatabaseandcalcresult( $dataid ); cache::write( $dataid, $result ); return $result; however, when tried program, more 100 requests come in simultaneously , of them find no cache, call getdatafromdatabaseandcalcresult method. server runs out of cpu resource. is there idea first user calls getdatafromdatabaseandcalcresult. should implement job-queue or mysql-locking-system or something?

Do you really need to version the trunk of a maven project? -

in trunk based development branching model, develop on trunk , release branch, every release requires updates pom files in both trunk , new branch. for example, if version in trunk set 1.0-snapshot, release branch needs updated 1.0, , trunk 1.1-snapshot. i'd alternative strategy preclude need update version on trunk, , associated tasks goes this. thinking it, shouldn't need apply version number trunk. version number becomes relevant during release process, maven (for multitude of reasons) requires version number. as alternative, set version on trunk 0.0-snapshot, denote special build. problem though, place before every other version, far maven concerned. an alternative might use large number. @ least place after every other version, true if trunk represents tip of development. feels bit arbitrary though. the other option can see, use string version - e.g. head or latest, wouldn't conform latest maven versioning scheme. besides losing snapshot functionality, be...

c# - Why isn't a CancellationToken included in the Task<T> monad? -

task<t> neatly holds "has started, might finished" computation, can composed other tasks, mapped functions, etc. in contrast, f# async monad holds "could start later, might running now" computation, along with cancellationtoken . in c#, typically have thread cancellationtoken through every function works task . why did c# team elect wrap computation in task monad, not cancellationtoken ? more or less, encapsulated implicit use of cancellationtoken c# async methods. consider this: var cts = new cancellationtokensource(); cts.cancel(); var token = cts.token; var task1 = new task(() => token.throwifcancellationrequested()); task1.start(); task1.wait(); // task in faulted state var task2 = new task(() => token.throwifcancellationrequested(), token); task2.start(); task2.wait(); // task in cancelled state var task3 = (new func<task>(async() => token.throwifcancellationrequested()))(); task3.wait(); // task in cancelled state ...

javascript - AngularJS Directive to directive communication -

i've directive nested within directive in below fiddle. http://jsfiddle.net/sriramr/t7w6t/3/ my question is: if variable in parent directive changes value, how automatically update value of variable in child directive computed parent variable? var myapp = angular.module('myapp',[]); myapp.directive('parentdir', parentdir); function parentdir() { return { restrict:'e', controller: function ectrl($scope) { $scope.parval = 100; $scope.$on("event",function(e,data) { console.log("emit") $scope.parval = 200; }) }, template:'<div><first-dir></first-dir</div>' } } myapp.directive('firstdir', firstdir); function firstdir() { return { restrict:'e', controller: function($scope) { //$scope.$watch('parv...