Posts

ios - Filter an NSArray based on distance from certain point and longitude and latitude -

i have entity objects in it. these objects have longitude , latitude . want following. i want objects 5000 meters current location. question is, best way off doing , keeping in mind entity can contain 5000 records. i thinking on making nspredicate , somehow longitude can have deviation of 0.005 or something? don't have idea of or bad ?

array's key match with another array php -

ex : first array: array ( [0] => id [1] => address [2] => address1 [3] => name ) second array: array ( [id] => 1 [name] => ankit [city] => surat ) required output : [id] => 1 [address]=> [address1]=> [name] => ankit here can see value of first array address,address1 doesn't exist in array 2 key, need value set null address,address1 , unnecessary field of array 2 city key doesn't exist in first array values need unset result array code : $field_arr= array('0'=>"id", "1"=>"address", "2"=>"address1", '3'=>"name", ); $arr=array("id"=>"1", 'name'=>"ankit", "city"=>"ahmedabad"); $matching_fields =(array_diff_key(array_flip($field_arr),(array_intersect_key($arr,array_flip(...

Disable developer mode extensions pop up in Chrome -

Image
since latest release of chrome (34.0.1847.116) last week, have been receiving “disable developer mode extensions" when running automated tests using watir-webdriver. this seems offensive extension doesn't make sense me potentially hazardous extension given used chromedriver. anyone has found fix this, unable roll previous version or find installer older version roll , playing havoc tests. while creating chrome driver, use option disable it. working without extensions. use following code snippet chromeoptions options = new chromeoptions(); options.addarguments("chrome.switches","--disable-extensions"); system.setproperty("webdriver.chrome.driver",(system.getproperty("user.dir") + "//src//test//resources//chromedriver_new.exe")); driver = new chromedriver(options);

java - Log4j file appender for each instance of a class -

i have scenario class, has list of test cases. there way can save each test case execution separate file name: testcasename.log ? i have done before java.util.logging adding file handler in code, have no idea how log4j. you can configuring separate org.apache.log4j.rollingfileappender each test case class. can check link http://logging.apache.org/log4j/2.x/manual/configuration.html configuring this.

php - Can't replace table name with variable in SQL query -

i've little problem. here request ( work ): $reponse = $bdd->prepare('select * student username = ? , password = ? '); $reponse->execute(array($name,$pass)); it's work when want replace 'student' php variable it's doesn t works :/ : $table="stackoverflow" $reponse = $bdd->prepare('select * '$table' username = ? , password = ? '); $reponse->execute(array($name,$pass)); have idea ? more simple if can replace table name variable. sorry bad english. time spend me. in php, join 2 strings or variables period character (.). therefore, concatenate table name , statements before , after table name, should changing line $reponse = $bdd->prepare('select * '$table' username = ? , password = ? '); to $reponse = $bdd->prepare('select * '.$table.' username = ? , password = ? ');

handling dependencies for iOS Framework project -

i've created ios framework project using method: https://github.com/jverkoey/ios-framework works pretty neat i'm little confused on how include libraries/frameworks needed framework work and, in particular, how in case 3rd party client app uses framework can include these libs without conflicts. let's framework code needs these 2 things: facebooksdk.framework libflurry.a the first 1 ios framework. when add "link binary libraries" phase in framework , try compile the client project uses framework linker complains missing symbols - need add facebooksdk client project great: there no possibility of conflicts if client apps wants use facebook. however when same flurry static library duplicate symbols error when compiling client project. confuses me bit, because isn't facebooksdk.framework packaged static library? ukaszs-imac:facebooksdk.framework lukasz$ file versions/a/facebooksdk versions/a/facebooksdk: mach-o universal binary 3 architecture...

Websocket SignalR does not start -

i deployed mvc web app windows server 2012. has windows 8 , iis v8 installed. application uses signalr, , use websockets, gives errors. in every browser (chrome ff, ie) error same: "networkerror: 500 internal server error - https://domain.com/signalr/connect?transport=websockets&connectiontoken=wiir333%2bkbku0ex2spzle9w9x6eam5lbssbjxbqcvl0qpjaigthkn1xiiqhygi3o4ddliv7whtahvb8ll5kfwjnrzazadycapwj5awm6d1czzxh89k%2bouhzibh7dct9i&connectiondata=%5b%7b%22name%22%3a%22charthub%22%7d%5d&tid=8" the detailed error message be: exception information: exception type: invalidoperationexception exception message: not valid web socket request. @ microsoft.aspnet.signalr.transports.websockettransport.acceptwebsocketrequest(func`2 callback) @ microsoft.aspnet.signalr.persistentconnection.processrequest(hostcontext context) @ microsoft.aspnet.signalr.hubs.hubdispatcher.processrequest(hostcontext context) @ microsoft.aspnet.signalr.persistentconnecti...