Posts

Showing posts from January, 2010

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 duplicated. select `number`, count(`number`) `count`, `user_id` `phones` group `number` having `count` > 1 thank :) you can use group_concat on use

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

ios - Creating and attaching a .txt file to email in Xcode -

i want make ios app makes/creates text file (.txt) sends email. the issue having data encrypted pops error "use of undeclared identifier" [mailcontroller addattachmentdata:datatobeencrypted mimetype:@"text/plain" here .m file // // fileioviewcontroller.m // fileio // // created flare gun on 6/24/14. // copyright (c) 2014 flaregunapplications. rights reserved. // #import "fileioviewcontroller.h" @interface fileioviewcontroller () @end @implementation fileioviewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } -(void) writetotextfile{ //get documents directory: nsarray *paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; //make file name w

c# - HttpWebRequest using Saml2SecurityToken -

i have saml2security token provided thinktecture identity server cannot life of me figure out how use token when making httpwebrequest server side. can me? when think of samltoken think of being generated on identity server side , http post relying party. after post iclaimsprinciple (with wif , .net) populated , relying party server have claims user. there can persist them in cookie using jsonwebtoken or in manner. relying party server trying make webrequest to, or if talking javascript client has saml token might easier use simple web token or json web token symetric key rather samltoken.

math - Overhead of error correcting codes as the error rate increases -

Image
i looking understanding overhead (# of additional symbols need transmitted) associated error correcting codes (like reed-solomon) error rate designed handle increases. instance if process needs able correct 1 wrong symbol per 500 overhead compared 1 in 100. i realize in practice complex schemes used (cds use overlapping sets of encoding, etc), trying sense of simplest case first. relationship between overhead , error rate approximately linear? quadratic? exponential? realize big o notation isn't right tool here, please forgive me if not how math community formulates problem. i thrilled answer calculated overhead associated following error rates reed-solomon encoding: 1 symbol error per 10000 1 symbol error per 2000 1 symbol error per 1000 1 symbol error per 500 1 symbol error per 50 look hamming bound . there read code has hamming distance d , i.e. can detect d −1 single digit errors , correct t =⌊( d −1)/2⌋ single digit errors, has size of @ different code

javascript setInterval is slow in ie8 -

1) chrome, firefox fine slow in ie8 2) slow after browser zoom in/out, resize, etc 3) why? memory leak? or ? function movex(object, coord){ var v = (coord < 0) ? -1 : 1; var timer = setinterval(function(){ var x = object.offsetleft + v; v *= 2; if((v < 0 && x > coord) || (v > 0 && x < coord)) object.style.left = x + "px"; else{ clearinterval(timer); object.style.left = coord + "px"; } }, 25); } first off, mentioned in comments, make sure multiple timers aren’t running @ same time. next, not forcing offsetleft calculated each time offer quite speedup. function movex(object, coord) { var v = coord < 0 ? -1 : 1; var x = object.offsetleft; var timer = setinterval(function () { x += v; v *= 2; if ((v < 0 && x > coord) || (v > 0 && x < coord)) { obj

built in - Python all() and bool() empty cases? -

when using help(all), returns: all(iterable)=>bool return true if bool(x) true values x in iterable. if iterable empty, return true help(bool) returns: bool(x) -> bool | | returns true when argument x true, false otherwise. | builtins true , false 2 instances of class bool. | class bool subclass of class int, , cannot subclassed. when trying: >>>bool() false >>>all([]) true my question is, in case all's input empty list/dict/tuple(i.e. iterator), what's passed bool?? , how come returns true, it's dependent on bool? bool() never invoked if all() 's argument empty. that's why docs point out behavior of all() on empty input special case. the behavior bool() == false irrelevant all() in case. way, in python bool subclass of int , bool() == false necessary compatible int() == 0 . as why, e.g., all([]) true , it's preserve useful identities. importantly, non-empty sequence x it's desirab

jquery - How to change text in a html table cell based on value in another cell -

i have html table tens of columns , hundreds of rows. want change value of 1 table cell (td) based on value of column. (i need 3 pairs of columns). since have no control on data source, order of columns may vary in browsers. steps i've taken: for(i=0;i<3;i++){ for(j=0;j<2;j++){ if(!!(jq("div[displayname='"+updateviewerfields[i][j]+"']"))){ updateviewer[i][j]=(jq(this).find(jq("div[displayname='"+updateviewerfields[i][j]+"']")).parent().index())+1; }}} this stores index location of 3 fields in array - 'updateviewer'. names of 3 fields coming in 'updateviewerfields'. var updateviewerfields=[["phase 1","phase 1 - comments"],["phase 2","phase 2 - comments"],["phase 3","phase 3 - comments"]]; var updateviewer=[[0,0],[0,0],[0,0]]; now, iterate through each row applying formatting: jq(this).find("tr&

java - Source code not getting added in pom.xml -

i have project converted maven project using eclipse configured pom.xml , added dependency jars , build ear using maven build options in eclipse install -e ear created not contain source code in it. there jars inside ear. can please me out , let me know how code added in pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.avizva.fbvision</groupid> <artifactid>enrollment_guid</artifactid> <packaging>ear</packaging> <name>enrollment_guid</name> <build> <sourcedirectory>${basedir}/src</sourcedirectory> <resources> <resource> <directory>${basedir}/src</directory> <includes> <include&

ios - The runtime for selected device is not installed error -

Image
i trying run application using xcode 6 on ios8 simulator getting error "the runtime selected device not installed ". i have set command line tool in preferences no luck. please help. this happened me right after beta update yosemite 10.10 , xcode 6.6. still have xcode 5 installed, , thought may have been deleting xcode 6.5, putting in applications did not help. first, make sure have devices installed in simulator. fix right off bat. ios simulator --> hardware --> device --> manage devices i had correct devices installed, however, , still getting error. fixed it: xcode --> open developer tool --> ios simulator ios simulator --> reset content , settings restart computer

regex - split sql statements in php on semicolons (but not inside quotes) -

i have system causing errors when users use semicolon in free format field. have traced down simple explode statement: $array = explode( ";", $sql ); because line in subroutine called on system replace line split things properly, without breaking rest of system. thought onto winner str_getcsv, isn't sophisticated enough either. @ following example $sql = "begin;insert table_a (a, b, c) values('42', '12', '\'ab\'c; def');insert table_b (d, e, f) values('42', '43', 'xy\'s z ;uvw') on duplicate key update f='xy\'s z ;uvw';commit;"; $array = str_getcsv($sql, ";", "'"); foreach( $array $value ) { echo $value . "<br><br>"; } when run outputs following: begin insert table_a (a, b, c) values('42', '12', '\'ab\'c def') insert table_b (d, e, f) values('42', '43', 'x

unity3d - Unity: How to detect mouse click in a script without attaching the script to an object? -

in unity, using c#, how detect click anywhere in screen, without attaching script object? to specific, looking individual clicks, not mouse downs. e.g. code below checks mouse down, want clicks instead // update called once per frame void update () { // 1 vector3 currentposition = transform.position; // 2 if( input.getbutton("fire1") ) { // } } you going need monobehaviour can use update() function advantage. attach empty gameobject, not uncommon game have 1 empty gameobject has few scripts handle things. check getmouseup count clicks.

After moving the wordpress site to different server admin section is blank -

i moved 1 wordpress site different server. after moving different server frontend works admin section blank. if rename plugins directory admin section works. how fix this? after find plugin causing problem, check plugin main php file (ex. - myplugin.php) , check whether php tag opening , closing proper or not (<?php ,?>) . some times because of can cause problem because may code outputting before header sent (" header sent error ") , "white screen of death" try removing closing tag (?>) end of file or check tag. hope work you.

c# - Get rid of the GAC -

we have old application can extended using com exposed assemblies. there way work without gac. extension want provide existing .net component. want provide extension without putting required references in gac well. came solution this. i'll host wcf service in windows service , use named pipe endpoint. endpoint consumed com component. way com component forwarding call's , don't need dependant assemblies in gac. two questions setup: 1. there better ways want? 2. how can keep com component small possible? (it's forwarding point)

linux use board init file and device tree simultaneously -

is possible simultaneously use "board init file" , "device tree" peripheral device configuration in linux kernel? example have set of peripherals. half of them fixed , other harf changeable. can keep fixed peripherals in "board init file" , rest in "device tree"? @kiran if check code, still haven't removed board file. can safely both used in parallel. not advisable keep half of peripheral in device tree , other half in board file. goes against reason why device tree brought in first place.

c# - DirectoryServicesCOMException was unhandled Invalid DN syntax in Directory service -

i tried connect our ad using ldap query through c# . directoryentry de = new directoryentry("ldap://ldap.mysite.gov.sa:389/ou=mysitecsp,ou=government ca,o=national center ,c=la"); // de.refreshcache(); directorysearcher dsearch = new directorysearcher(de); dsearch.filter = "(cn=aabs@mysite.gov.sa)"; //search how want. google "ldap filter" more. searchresultcollection rc = dsearch.findall(); x509certificate stt = new x509certificate(); and error :- system.directoryservices.directoryservicescomexception unhandled hresult=-2147016654 message=an invalid dn syntax has been specified. source=system.directoryservices errorcode=-2147016654 extendederror=13 extendederrormessage=invalid dn syntax stacktrace: @ system.directoryservices.directoryentry.bind(boolean throwiffail) @ system.directoryservices.directoryentry.bind() @ system.directoryservices.directoryentry.get_adsobject() @ system.directoryservices.direc

javascript - AngularJS Promise Response Undefined -

i've read multiple articles on using $promise in angularjs , still can't figure out why i'm getting error code below: controller code: eventsapp.controller('eventcontroller', function eventcontroller($scope, eventdata) { $scope.sortorder = 'name'; eventdata.getevent().$promise.then(successongetevent(event), errorongetevent(response)); function successongetevent(event) { $scope.event = event; console.log(event); }; function errorongetevent(response) { console.log(response) }; }); service code: eventsapp.factory('eventdata', function($resource) { return { getevent: function() { return $resource('/data/event/:id', {id:'@id'}).get({id:1}); } } }); in chrome console window, error: referenceerror: response not defined any appreciated. thank you. in line... eventdata.getevent().

gradle - Android - Manifest placeholders for different build types -

i hyped new possibility of manifest placeholders in gradle + android build. i've found in gradle documentation can specify own placeholders this: productflavors { free { } pro { manifestplaceholders = [ activitylabel:"proname" ] } } but have 1 placeholder dependent on build type , not on product flavors. when insert placeholder specification build type settings takes no effect. know how achieve this? because seems me stupid have 3 build types , 3 flavors associated it. thanks starting today gradle plugin 0.13.0 working.

python - sklearn.linear_model.LogisticRegression returns different coefficients every time although random_state is set -

i'm fitting logistic regression model , setting random state fixed value. every time "fit" different coefficients, example: classifier_instance.fit(train_examples_features, train_examples_labels) logisticregression(c=1.0, class_weight=none, dual=false, fit_intercept=true, intercept_scaling=1, penalty='l2', random_state=1, tol=0.0001) >>> classifier_instance.raw_coef_ array([[ 0.071101940040772596 , 0.05143724979709707323, 0.071101940040772596 , -0.04089477198935181912, -0.0407380696457252528 , 0.03622160087086594843, 0.01055345545606742319, 0.01071861708285645406, -0.36248634699444892693, -0.06159019047096317423, 0.02370064668025737009, 0.02370064668025737009, -0.03159781822495803805, 0.11221150783553821006, 0.02728295348681779309, 0.071101940040772596 , 0.071101940040772596 , 0. , 0.10882033432637286396, 0.64630314505709030026, 0.09617956519989406816, 0.0604133873444507169

javascript - How to Convert HTML file TO GIF -

Image
i creating wait cursor using css , google js file. now want convert html file gif file... because using other js file in project page conflict google js file. this link of html page want convert. https://docs.google.com/file/d/0b_r9lchwcj7zmnqtdnruac1duja/edit one way screen capture software. create video of loader, clip 1 cycle. then, if have mac, download gifrocket app , converts video gif. had rough go @ it, , result:

forms - Separated input text fields for single input field -

is there symfony2 option show separated text fields 1 single text field in form? try use form customization feature. please check article more information - http://symfony.com/doc/current/cookbook/form/form_customization.html example: form_theme.twig.html {% block file_widget %} {% spaceless %} <td>{% set type = type|default('file') %} <input type="{{ type }}" {{ block('widget_attributes') }} /> </td> {% endspaceless %} {% endblock file_widget %} template.twig.html {% form_theme form 'mybundle:form:form_theme.html.twig' %} {{ form_row(form.contract) }}

vectorization - Accelerating Iterations- MATLAB -

consider 2 vectors a = [20000000 x 1] , b = [20000000 x 1 ] i need find sum of corresponding every unique element of b. although looks easy, taking forever in matlab. currently, using u = unique(b); length_u = length(u); c = zeros(length_u,1); = 1:length_u c(i,1) = sum(a(b==u(i))); end is there anyway make run faster? tried splitting loop , running 2 parfor loops using parallel computing toolbox(because have 2 cores). still takes hours. p.s: yes, should better computer. you must see this answer first. if must, can use combination of histc , accumarray a = randi( 500, 1, 100000 ); b = randi( 500, 1, 100000 ); ub = unique( b ); [ignore idx] = histc( b, [ub-.5 ub(end)+.5] ); c = accumarray( idx', a' )'; see toy comparison naive for -loop implementation on ideone . how work? we use second outout of histc map elements of b (and later a ) bins defined elements of ub (the unique elements of b ). accumarray used sum entries of a acc

C++ multicharacter literal -

i didn't know c , c++ allow multicharacter literal : not 'c' (of type int in c , char in c++), 'tralivali' (of type int !) enum { actionleft = 'left', actionright = 'right', actionforward = 'forward', actionbackward = 'backward' }; standard says: c99 6.4.4.4p10: "the value of integer character constant containing more 1 character (e.g., 'ab'), or containing character or escape sequence not map single-byte execution character, implementation-defined." i found used in c4 engine . suppose not safe when talking platform-independend serialization. thay can confusing because strings. multicharacter literal's scope of usage, useful something? in c++ compatibility c code? considered bad feature goto operator or not? i don't know how extensively used, "implementation-defined" big red-flag me. far know, mean implementation choose ignore character designa

mysql - InnoDB hierarchical data: recursively delete fragment of a tree -

this table: create table `pages` ( `id` int(11) not null auto_increment, `parent` int(11) default null, `label` varchar(255) not null, primary key (`id`) ) engine=innodb default charset=utf8; where id unique id (autoincrement) , parent id same table. if parent null, page hasn't got parent. what want? if delete 1 parent, should auto delete childs in same table. i believe can done using on delete cascade, , way want :). i've tried many configurations of code, , none of them work. either table cannot created, or insert query not working, because of error looks similar "key not exist". what found? how recursively delete items table? - answer great, none of code. answer same question: https://stackoverflow.com/a/9260373/1125465 doesn't work me. there problems table creation. think answer made in hurry, , there key word missing? recursive mysql query relational innodb 1 simmilar, not same case, there few tables. sql server - recu

sorting - Sort all DataTable in Dataset for vb.net -

i need sort datatables in mt dataset . have tried using defaultview , it's sorting datatable after loop datatable looks same without sorting. this tried: each dt datatable in albumlistds.tables dt.defaultview.sort = "imagedata asc" dt = datatable.defaultview.totable dt.acceptchanges() albumlistds.acceptchanges() next please correct me if did wrong. the changes made datatable when inside loop local element returned iterator of each. msdn says modifying collection elements . current property of enumerator object readonly (visual basic), , returns local copy of each collection element. means cannot modify elements in each...next loop. modification make affects local copy current , not reflected underlying collection. so, when recreate datatable dt = datatable.defaultview.totable the new dt instance not same instance contained in dataset. , changes lost @ same moment when loop on datatable element. in striking cont

php - finding email with preg_match_all -

i have code find email addresses in given text: preg_match_all("|[a-za-z0-9-_.]+@[a-za-z0-9-]+.[a-za-z]+|", "</b>a@bexample </b> a@bexample.co ",$out, preg_pattern_order); and output this: array ( [0] => array ( [0] => a@bexample//error 1 [1] => a@bexample.co ) ) the first answer isn't true. why? i forgot "\" before "." should this "|[a-za-z0-9-_.]+@[a-za-z0-9-]+\.[a-za-z]+|"

android - Bamboo CI build script for different store apk -

so, have android app uses different endpoints each store (play store, amazon store). i'm trying create build script in bamboo able build "x" store. want give variable in custom run build option in bamboo. right i'm building locally , have .properties file have flag store. (file "myproperties.properties" contains: "amazon_build = false" playstore build) how should handle ? thank you. instead of using properties file, pass property via build command line ant -damazon_build=false i output apk store specific folder make easier pickup artifact. then run build once each store

viewpagerindicator - when am setting styles to to tab page indicator it is not applying in android -

when trying set style titlepageindicator in android not getting applied. following lines styles.xml code when trying set fragment activity these style not applying. <style name="styledindicators" parent="@android:style/theme.light"> <item name="vpicirclepageindicatorstyle">@style/customcirclepageindicator</item> <item name="vpilinepageindicatorstyle">@style/customlinepageindicator</item> <item name="vpititlepageindicatorstyle">@style/customtitlepageindicator</item> <item name="vpitabpageindicatorstyle">@style/customtabpageindicator</item> <item name="vpiunderlinepageindicatorstyle">@style/customunderlinepageindicator</item> </style> <style name="customtitlepageindicator"> <item name="android:background">#18ff0000<

java - NumberFormatException: For input string: "xxxx" -

i'm trying display data on jsp page using jstl. i'm getting error numberformatexception: input string: "expense_id" . code list expense = entitymanager .getentitymanager() .createnativequery( "select e.expense_id, format(e.expense_amount,2) expense_amount, date_format(e.expense_date, \"%y-%m-%d\") expense_date, e.expense_desc, e.payment_method, g.expense_group_name, c.company_name, e.comment wd_expense e " + "join wd_expense_group g on e.expense_group_id = g.expense_group_id " + "left join wd_company c on e.company_id = c.company_id") .getresultlist(); // set request request.setattribute("expenses", expense); // redirect expense_list.jsp util.redirect(request, response, "/web-inf/expense/expense_list.jsp"); jsp code <tbody> <c:foreach items="${requestscope.expenses}" var="expense&q

angularjs - Uncaught Object when minifying simple Angular app with Grunt -

i have simple angular app defined so: index.html <body ng-app="waapp"> <div ng-controller="indexcontroller"> <h3>{[ test ]}</h3> </div> </body> waapp.js (function() { var waapp = angular.module('waapp', [], function($interpolateprovider) { $interpolateprovider.startsymbol('{['); $interpolateprovider.endsymbol(']}'); }); })(); indexcontroller.js (function() { var waapp = angular.module('waapp'); waapp.controller('indexcontroller', ['$scope', function($scope) { $scope.test = 'angular works, , grunt too.'; }]); })(); as can see, prepare variable mangling during minification using angular's array syntax while defining controller's dependencies. yet when concatenate these files , minify them using grunt, so: gruntfile.js module.exports = function(grunt) { grunt.initconfig({ pkg: grunt.file.readjson(&#

ios - UITapGestureRecognizer on a subview of MKAnnotationView not working -

i trying add tap recognizer show additional information callout. tried calling selector "showpersoninfo" directly , it's working. but, when try add in uitapgesturerecognizer on subview of mkannotationview working on. selector not firing when tap. this code inside .m of subclass of mkannotationview - (void)layoutsubviews { [self addsubview:self.imagecontainerview]; uitapgesturerecognizer *tap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(showpersoninfo:)]; [self.imagecontainerview addgesturerecognizer:tap]; } - (void)showpersoninfo:(uitapgesturerecognizer *)tap { nslog(@"annotation imageview touched"); [self addsubview:self.personinfoview]; } you can use mapview delegate method adding actions annotation view - (mkannotationview *)mapview:(mkmapview *)mapview viewforannotation:(id <mkannotation>)annotation { if (annotation == mapview.userlocation) return nil;

java - How to fix WARNING: use of system property netbeans.home has been obsoleted -

this complete message: warning [org.netbeans.topsecuritymanager]: use of system property netbeans.home has been obsoleted in favor of installedfilelocator/places @ org.netbeans.clusters.relativedirswithhome(clusters.java:137) any idea? this documented bug in netbeans platform 7.4: "bug 226333 - prevent warning use of system property netbeans.user" the bug reported fixed in nightly build in february 2013. however, team still seeing warning despite fact downloaded 7.4 in december 2013 , have applied subsequent updates. therefore think easiest fix upgrade version 8.0 . i going suggest download 7.4 source code , override appropriate utils.java class in versioning module apply fix ondrej vrabec documented here . class final, upgrade appears option.

modelica - Integration Methods in OpenModelica -

i have noticed there several integration methods available in openmodelica simulation setup. dont know these are. can sort of information regarding these? quality of results vary if integration methods changed? short document on integration methods available in openmodelica: https://openmodelica.org/svn/openmodelica/trunk/doc/simulationruntime/integrationalgorithms/ yes, quality (simulation speed, finding solution) vary if choose different methods. default dassl.

java - Google adt/gwt support for eclipse 4.4 (Luna) -

have gotten release version of eclipse 4.4 work adt(android development) and/or google web toolkit(gwt). it seems gwt/adt plugins don't works eclipse 4.4, there secret place download new versions or should keep using 4.3 -( edit: reason thought adt not working documentation( http://developer.android.com/sdk/installing/installing-adt.html ) says plugin called "adt plugin" not. google released official sdk eclipse luna: https://developers.google.com/eclipse/docs/getting_started

how to get Cell Signal Strength in Lte without getAllCellInfo in android -

i using bellow code signal strength in lte. for (final cellinfo info : tm.getallcellinfo()) { if (info instanceof cellinfolte) { final cellsignalstrengthlte lte = ((cellinfolte) info).getcellsignalstrength(); lte.getdbm(); } } but getallcellinfo in returning null . way initialize cellsignalstrengthlte without calling tm.getallcellinfo ? api version 17.

c# - Entity-Framework Editing a many-to-many table -

i'm designing application table keep track of transportation. i have 4 tables: create table [dbo].[trips] ( [tripid] int not null primary key identity, ... ) create table [dbo].[drivers] ( [driverid] int not null primary key identity, ... ) create table [dbo].[vehicles] ( [vehicleid] int not null primary key identity, ... ) , 1 table called vehicletrip create table [dbo].[vehicletrip] ( [tripid] int not null , [vehicleid] int not null, [driverid] int not null, primary key ([tripid], [vehicleid], [driverid]), constraint [fk_tripids_trips] foreign key (tripid) references trips(tripid), constraint [fk_vechicleid_vehicles] foreign key (vehicleid) references vehicles(vehicleid), constraint [fk_driverid_driverid] foreign key (driverid) references drivers(driverid) ) using ef, i'm trying edit record in vehicletrip public class tripvm { public int tripid { get; set; } public int vehicleid { get; set; } p

Setting connection timeout in RestEASY -

jboss tells us http://docs.jboss.org/seam/3/rest/latest/reference/en-us/html/rest.client.html that set timeout resteasy clientrequest must create custom clientexecutor, call deprecated static methods on connmanagerparams. seems rather hokey. there better way? resteasy 2.3.6. here clean working solution :-) @singleton public class resteasyconfig { @inject @myconfig private integer httpclientmaxconnectionsperroute; @inject @myconfig private integer httpclienttimeoutmillis; @inject @myconfig private integer httpclientmaxtotalconnections; @produces private clientexecutor clientexecutor; @postconstruct public void createexecutor() { final basichttpparams params = new basichttpparams(); httpconnectionparams.setconnectiontimeout(params, this.httpclienttimeoutmillis); final schemeregistry schemeregistry = new schemeregistry(); schemeregistry.register(new scheme("http", 80,

sql - How to find all checked out packages in Sparx Enterprise Architect? -

similar this question except i'd find all checked out packages (and ideally list checked them out) rather own. am assuming there must way of doing modifying sql provided ea's search builder answer linked question - couldn't figure out how... here current attempt adapted built in "my checked out packages" search query: select t_object.ea_guid classguid, t_object.object_type classtype,t_object.name object, t_object.object_type [type], t_object.stereotype, t_object.scope,t_object.status, t_object.phase, t_object.createddate, t_object.modifieddate, mid(t_package.packageflags, instr(t_package.packageflags, 'checkedoutto') + 13, instr(mid(t_package.packageflags, instr(t_package.packageflags, 'checkedoutto') + 13), ';') - 1) checkedoutto t_object, t_package t_object.object_type='package' , #db=other#t_object.pdata1 = cstr(t_package.package_id)#db=other# #db=oracle#t_object.pdata1 = to_char(t_package.package_id) #db=ora

multithreading - Java - Define a timeout for Callable within a ExecutorCompletionService -

i've got following problem using executorcompletionservice . want call lot of callable in different threads. these callable don't share information each other. need define timeout each callable, eg. not run longer 5 seconds. each callable can run in different time not know when starting. after timeout thread should stopped/killed , result not interesting more me. other 'normal' running threads should not infuenced. so lets take following example simple callable , current java code. import java.util.date; import java.util.concurrent.callable; public class job implements callable<integer> { int returnvalue = 0; long millis = 0; public job(long millis, int value) { this.millis = millis; this.returnvalue = value; } @override public integer call() throws exception, interruptedexception { try { system.out.println(new date() + " " + returnvalue + " started"); thread.sl