Posts

android - stop START_STICKY service -

i want bulid app run in background when press "start service" , continue in background if app closed or killed. use start_sticky , works, problem when want kill service-the app closed(like want) , error(unfortunately process service has stopped). , service try run again. how stop service? p.s-i searched solution on web without success. my code mainactivty public class mainactivity extends appcompatactivity { private textview textview; private intent i; private static button killserbut; private static final string tag="com.example.elicahi.service"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview=(textview) findviewbyid(r.id.textview1); killserbut=(button)findviewbyid(r.id.kill); killserbut.setonclicklistener(new view.onclicklistener() { @override public void onclick...

php - Slow MySQL query with multiple joins, max() and group by -

i've got serious problem. our intranet getting slower , slower. 1 of mainreasons seems slow mysql-query (it appears in slow-query.log). query asked every time intranet-site opened. looks this: select w.datetime, w.user_id, w.status, e.lastname worktimes w inner join employees e on w.user_id=e.id right join (select max(datetime) datetime, user_id worktimes datetime>".$today." // variable of today 0.00 o'clock , location='".$llocation['id']."' // variable of 1 of 9 locations group user_id) v on v.user_id=w.user_id , w.datetime=v.datetime order e.lastname; the worktimes-table greater 200k rows (momentary 90k testing reasons) , 13 columns. whole query goes through loop 3 9 cycles. has idea how make queries faster? edit: wished here explain-result. id select_type table type possible_keys key key_len ref rows 1 primary <derived...

jmap command not found and java path not found -

i got jmap command not found error while trying create histograms. , tried command provided check package included jmap. got following output: yum whatprovides '*/jmap' loaded plugins: product-id, subscription-manager 1:java-1.6.0-openjdk-devel-1.6.0.0-1.66.1.13.0.el6.x86_64 : openjdk development environment repo : rhel6.5_64-server matched from: filename : /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/jmap , 1:java-1.7.0-openjdk-devel-1.7.0.45-2.4.3.3.el6.x86_64 : openjdk development environment repo : rhel6.5_64-server matched from: filename : /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.45.x86_64/bin/jmap but when directed directory lib there's no folder called jvm. but, our tibco using our tibco jre path everything. tried export path, got same error. should install java separately or other solution this? please help.

c# - Send data to Web Api from ASP.NET MVC -

in web api have simple method takes model student : // post api/values [httppost] public void createstudent([frombody]student student) { db.students.add(student); db.savechanges(); } method of mvc application: public void form(string name, string surname, string qualification, string specialty, double rating) { student student = new student { name = name, surname = surname, qualification = qualification, specialty = specialty, rating = rating }; //here must send student object web api ulr "http://localhost:2640/api/values" } and want send mvc application object student web api, dont know how can it. must do? assuming web api controller this: public class studentscontroller : apicontroller { // post api/students [httppost] public ihttpactionresult post(student student) { db.students.add(student); db.savechanges(); return ok(); } } located @ followin...

javascript - AngularJS. Adding $watch to the particular model -

i new angularjs , don't know how add $watch particular model. when going through angularjs tutorial facing issue. mentioned doubt in comments part. please go through this. (function(angular) { angular.module('controllerasexample', []) .controller('settingscontroller1', settingscontroller1); function settingscontroller1() { this.name = "john smith"; this.contacts = [ {type: 'phone', value: '408 555 1212'}, {type: 'email', value: 'john.smith@example.org'} ]; } //how add $watch ng-model 'settings.name' /*$scope.$watch("settings.name", function(oldval, newval){ console.log(oldval + " + " + newval); });*/ settingscontroller1.prototype.greet = function() { console.log(this.name); }; })(window.angular); html code.. <body ng-app="controllerasexample"> <div id="ctrl-as-exmpl" ng-controller="settingscontroller1 settings"> ...

android - AudioFlinger server died. Play RTSP stream won't start on Lollipop device only. -

i'm testing libstreaming library . app description: 1 device stream video camera device via rtsp. working on kitkat devices huawei p8 lite (lollipop) can't run stream beacause: w/audiosystem: audioflinger server died! w/imediadeathnotifier: media server died e/mediaplayer: error (100, 0) e/mediaplayer: error (100,0) my stream server side: // configures sessionbuilder sessionbuilder.getinstance() .setsurfaceview(surfaceview) .setprevieworientation(90) .setcontext(getapplicationcontext()) .setaudioencoder(sessionbuilder.audio_none) .setaudioquality(new audioquality(16000, 32000)) .setvideoencoder(sessionbuilder.video_h264) .setvideoquality(new videoquality(320,240,20,500000)); // starts rtsp server this.startservice(new intent(this,rtspserver.class)); play stream side: private void play() { if(...

codeigniter - Getting information from .xml -

i have codeigniter library use load xml file using simplexml_load_file(); how ever can cdata information on xml file cannot name="" xml how can correct name="" xml <file name="controllers/test.php"> full xml <?xml version="1.0" encoding="utf-8" ?> <modification> <file name="controllers/test.php"> <!-- need name=""--> <operation> <search><![cdata[class test extends ci_controller {]]></search> <add position="after"><![cdata[public function __construct() {}]]></add> </operation> </file> </modification> var dump of simplexml_load_file() object(simplexmlelement)[16] public 'file' => object(simplexmlelement)[17] public '@attributes' => array (size=1) 'name' => string 'controllers/test.php...