Posts

c# - Executing function based on pointer location -

Image
i working arcgis sdk dot net. programming using vc#. want execute piece of code mouse pointer enters particular longitude/latitude on map or if mouse clicked on location. there many event handlers don't know how retrieve location mouse pointer at. e.g want display picture mouse pointer @ longitude 25 , lat 33. add mousemove listener mapview . your listener method have parameter of type mouseeventargs . call getposition(null) on parameter screen point. use mapview.screentolocation(point) mappoint in map coordinates. if map isn't in longitude/latitude, use geometryengine.project(geometry, spatialreference.create(4326)) convert longitude/latitude. check longitude , latitude see if they're in range want. i tried posting source code here stack overflow gave me error, here screenshot:

php - (AuthComponent::user('role') in cakephp not returning data correctly in cakephp -

login: public function login(){ if($this->request->is('post')){ if($this->auth->login($this->request->data)){ return $this->redirect($this->auth->redirecturl()); }else{ $this->session->setflash('invalid username or password'); } } } this return value: if(authcomponent::user() but when use this: if((authcomponent::user('role'))==1) it does't return value @ all i can login-logout normally when authenticating users, attached authentication objects checked in order attached. once 1 of objects can identify user, no other objects checked. sample login function working login form like: public function login() { if ($this->request->is('post')) { // important: use login() without arguments! see warning below. if ($this->auth->login()) { return $this->redirect($this->auth->redirecturl())...

newInstance() is not displayed for XML file creation in java -

i had imported javax.xml.parsers.documentbuilder , javax.xml.parsers.documentbuilderfactory xml manipulation. while creating reference document builderfactory, newinstance() not displayed. me fix it? syntax: documentbuilderfactory factory = documentbuilderfactory .newinstance();

android - In GCM: Does API Project account have to be the same as Google Play Store account? -

i have backend sending gcm push notifications uses api-project (sender_id) created under google-account. works great app published under google play store account (same google-account api-project). now have publish app friend under google play store account, , use same sender_id use in own app (that way not need changes on backend). is possible? can app under google play store account use sender_id (api-project) created different google-account google play store google-account? if answer positive: there possibility google requires in future api-project , google play store have in same google-account? (for security reasons, example) thanks! i believe thing requires same api project account , play store account if have link application google play services. using same senderid welcomed (see this question ). if application not yours, there obvious downsides of being harder maintain , debug, if you're fine that, having different accounts should work fine. ...

javascript - angular ui bootstrap: promise resolved/rejected when modal closed -

i'm working on angular , bootstap, using angular-ui-bootstrap bridge library. thing want achieve reuse modal component , wrap in promise resolved when modal closed (when pressing ok button) or rejected ( cancel button pressed or clicked outside of modal). as far can see, there $modal service comes bridge library, has 1 method available: open(options) . there built-in angular promise implementation : $q . i'm looking way on how combine two. i want have custom component (a service, factory?) provide startflow method return promise. calling startflow open bootstrap modal. when modal closed (positively or negatively), promisewould resolved or rejected. can give hint on how implement that? ddin't manage find existing solution far... the result property on object returned open promise behaves describe. in fact example in documentation @ https://angular-ui.github.io/bootstrap/#/modal uses it: var modalinstance = $modal.open({ templateurl: 'mymod...

Android Studio Gradle - JavaExec classpath configuration - Java Reflection - class access -

im working on android project have process .java-files possibly generate .java-files should compiled , packed .apk-file. lets assume have 2 files processed library, file_a.java , file_b.java. now need access these files within library via reflection, e.g. with: class.forname("com.test.entities.file_a"); class.forname("com.test.entities.file_b"); the problem i'm not able access class files, think because of missing classpath configuration. use task call .jar-file: task (mytask, type: org.gradle.api.tasks.javaexec) { classpath(files('libs/myjar.jar')) main('com.test.testmain') } prebuild.dependson mytask i found ressources on web, don't work. i tried add following classpath: sourcesets.main.runtimeclasspath (main unknown) android.sourcesets.main.runtimeclasspath (runtimeclasspath unkown). so how can access class files in library? try task execute(dependson: ['compilereleasejavawithjavac'], ...

memory - Are non-static fields static until they're changed in Java? -

let's consider following code: public class testing { static int = 47; public static void main(string[] args) { testing t1 = new testing(); testing t2 = new testing(); system.out.println(t1.i == t2.i); i'm creating static field belonging testing class , field shared among 2 instances of class t1 , t2 well. test if reference same value in memory , indeed, do, result true. , that's clear me. however, if delete static keyword declaration of int i , unexpected happen. public class testing { int = 47; public static void main(string[] args) { testing t1 = new testing(); testing t2 = new testing(); system.out.println(t1.i == t2.i); i expect 2 instances t1 , t2 both have 47 value of field fields in different memory addresses. surprisingly, when test t1.i == t2.i true in case - why? field int = 47; not static anymore expect in different memory addresses every instance of class equality yields true....