Posts

Showing posts from July, 2013

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&

Javascript roll dice animation -

hello made roll dice function small animation @ end have problem cuz animation doent go end : <body> <img id="die1" src="die1.png" width="48" height="48"> <img id="die2" src="die1.png" width="48" height="48"> <button onclick="rolldice()">roll dice</button> <p id="result"></p> </body> <script> function rolldice(){ var diece1 = document.getelementbyid("die1"); var diece2 = document.getelementbyid("die2"); var result = document.getelementbyid("result"); var d1 = math.floor(math.random() * 6) +1; var d2 = math.floor(math.random() * 6) +1; var total = d1 + d2; var num = 0; var interval = setinterval(function(){ num +=1; var num1 = math.flo

excel - Where does the .xlsx file creates when creating using axlsx gem in ruby -

where .xlsx file creates when creating using axlsx gem in ruby. this example taken axslx homepage : axlsx::package.new |p| p.workbook.add_worksheet(:name => "pie chart") |sheet| sheet.add_row ["simple pie chart"] %w(first second third).each { |label| sheet.add_row [label, rand(24)+1] } sheet.add_chart(axlsx::pie3dchart, :start_at => [0,5], :end_at => [10, 20], :title => "example 3: pie chart") |chart| chart.add_series :data => sheet["b2:b4"], :labels => sheet["a2:a4"], :colors => ['ff0000', '00ff00', '0000ff'] end end p.serialize('simple.xlsx') end do file created serialize() call. filename specifiy there relative working directory. can find dir.pwd

about oracle SQL query need to skip the repeated value in one column -

i have data in table this: custid custname 10 tony 10 jony 10 hony 20 bot 20 guly 20 easter i need output below: custid custname 10 tony jony hony 20 bot guly easter try following. with src (select 10 custid, 'tony' custname dual union select 10, 'jony' dual union select 10, 'hony' dual union select 20, 'bot' dual union select 20, 'guly' dual union select 20, 'easter' dual) select case when rnum = 1 custid end custid, custname (select row_number() over(partition custid order custid) rnum, src. custid, src. custname src) here i've used row_number() analytic function

qt - Microsoft FTP Service 451 The parameter is incorrect -

i'm trying write ftp client. have 2 ftp servers. first server standard ftp server microsoft. second server written in organization work. program second server works well. program first server receives error: "451 parameter incorrect". can wrong? use qt 4.8.4, windows 7. ... switch(cod) { case 220: user=sett.value("userftp",qstring("anonymous")).tostring(); logmessage(codec1->tounicode("Авторизация пользователя ")+user); buf = qbytearray::fromrawdata("user ",5) + "\n"; sock->write(buf); logmessage(buf); break; ... i have found bug. used ascii. had use latin 1.

python - Flask quickstart on openshift how to setup on localhost -

i new python , flask thing. have done installed flask on openshift server using options available in backend while creating new application. now when git cloned application on local machine unable run directly. using netbeans ide , when try run application netbeans, gives me error: 'no module named flask' does have idea deploying flask openshift on local machine?

regex - Replace special characters in a string with their UTF-8 encoded character java? -

i want convert special characters utf-8 equivalent character. example given string: abcds23#$_ss , should converted abcds23353695ss . the following how did above conversion: utf-8 in hexadecimal # 23 , in decimal 35. utf-8 in hexadecimal $ 24 , in decimal 36. utf-8 in hexadecimal _ 5f , in decimal 95. i know have string.replaceall(string regex, string replacement) method. want replace specific character specific utf-8 equivalent. how do same in java? i don't know how define "special characters", function should give idea: public static string convert(string str) { stringbuilder buf = new stringbuilder(); (int index = 0; index < str.length(); index++) { char ch = str.charat(index); if (character.isletterordigit(ch)) buf.append(ch); else buf.append(str.codepointat(index)); } return buf.tostring(); } @test public void test() { assert.assertequals("abcds23353695ss"

php - Event though my Braintree transaction is successful, there's no redirect to success page in Codeigniter -

i'm struggling piece of code more week. implemented braintree, using php sdk, in codeigniter app , have issue: the user selects product wants, enters shipping method credit card info; the credit card processed on braintree servers , returns success or error flag; if successful order added in database , confirmation email sent both merchant , customer finally, user redirected success page or error page if transaction failed. everything works expected in sandbox mode when go production mode, redirect fails, page redirected order confirmation, though cc charged , both emails sent. here controller: function order_confirmation() { require_once('application/libraries/braintree/lib/braintree.php'); braintree_configuration::environment('production'); braintree_configuration::merchantid('my_merchant_id'); braintree_configuration::publickey('my_public_key'); braintree_configuration::privatekey('my_private_key');

scala - Filtering inside for-comprehension with futures -

i doing this: (for { data <- future(getdata) updated = makechanges(data) if updated != data _ <- future(saveupdates(updated)) _ <- future(recordtransaction) } yield ()).recover { case e: nosuchelementexception => () } when filter not satisfied, skips remaining 2 steps (good!) throwing exception (not good), have catch , handle @ end. using exceptions flow control not feel elegant me though, wondering if there better way this, aside obvious - wrapping remaining lines if statement: _ <- if(updated != data) future(saveupdates(updated)) else future.successful(()) _ <- if(updated != data) ... i don't think can avoid exception flow control using comprehension in way, use nested expression instead of filter , handle condition manually giving scala return type needs in case condition not satisfied: for { data <- future(data) updated = makechanges(data) res = { if (updated != data) future.successful(()) else {

android - ViewPager swipe issue when back press -

here trying move next screen @ view pager last position..and moving .but when try swipe last position ,it moves next screen.i need move next screeen when view pager @ last position. @override public void onpagescrollstatechanged(int state) { //viewpager swipe lastpagechange = false; int lastidx = viewpager.getadapter().getcount() - 1; curitem = viewpager.getcurrentitem(); if (curitem==lastidx && state==1 && lastpagechange==false ) { lastpagechange = true; intent main=new intent(top3.this,skipactivity.class); startactivity(main); finish(); } else { lastpagechange = false; } } this answer viewpager when seen last position swipe again forward go next activity. viewpager.onpagechangelistener pagerlistener = new viewpager.onpagechangelistener() { boolean lastpagechange = false; @override public void onpagescrolled(int position, float positionoffset, int position

Why does function modify array[0] but not string in Java? -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 74 answers code public class foo { public static void main(string[] args) { //declaring , initializing string variable 'str' value "outside" string str = "main"; //declaring , initializing array 'array' values string [] array = {"main"}; //printing values of str , array[0] system.out.println("str : " + str + " , array[0] : " + array[0]); //calling function foo() foo(str, array); //printing values after calling function foo() system.out.println("str : " + str + " , array[0] : " + array[0]); } static void foo(string str, string[] array){ str = "foo"; array[0] = "foo";

mysql - Join on matching records and create combinations when no match -

i trying create new table using 2 others. want create record combinations of records while merging 'value' column. want column tells me value this.: a: day month random1 random2 value1 01 jan aa xx 12 24 mar bb yy 34 13 feb cc zz 7 b: day month value2 03 jan 16 24 mar 2 i trying join them on day , month, want create row combinations if there no row match. i want table follows: c: day month random1 random2 value type 01 jan aa xx 12 value1 24 mar bb yy 34 value1 13 feb cc zz 7 value1 03 jan aa xx 16 value2 03 jan aa yy 16 value2 03 jan aa zz 16 value2 03 jan bb xx 16 value2 03 jan bb yy 16 value2

java - Alarm manager not working properly -

i sending msg using alarm manager, alarm not working.if time 18hrs , set alarm 8 hrs sends msg right @ time. here code. public class time_picker extends appcompatactivity { timepicker time_picker; string tag="pritesh"; static alarmmanager[] alarmmanager=new alarmmanager[5]; static pendingintent[] pendingintent = new pendingintent[5]; edittext message; edittext phone; intent myintent; // alarmmanager alarmmanager; //pendingintent pendingintent; public static string phone; public static string message; public int i; array ob=new array(); static arraylist<pendingintent> pendingarray=new arraylist<>(5); public void setalarm(view view) { // alarmmanager alarmmanager[]=new alarmmanager[5]; // if(prevention.timer==0) { phone = phone.gettext().tostring(); message = message.gettext().tostring(); phone.settext("");

algorithm - How to get the (x,y) coordinates given a index when x < y? -

in past i've used loops of following kind (haskell example): upperboundtotuples :: int -> [(int, int)] upperboundtotuples n = [(x,y) | x <- [0..n], y <- [x+1..n]] the above code produces tuples of range (0,1)..(n,n) x < y. i wondering if there efficient way of getting (x,y) indices given single index? possible applications include optimization problems on gpu loops not allowed , each thread gets index. also if possible 2d case, such algorithm generalized multiple dimensions? you're asking bijection [0, n(n+1)/2) pairs (x, y) 0 <= x < y <= n. here's 1 simple way define (in pseudocode, should trivial convert haskell): x0, y0 = / (n + 1), % (n + 1) if x0 < y0 result = (x0, y0) else result = (n - 1 - x0, n - y0) here's visualisation of function n=6. map laid out in table rows of length n+1=7, first row representing value of function i=0 6, next i=7 13 , on. if closely , carefully, can see things above leading diagonal m

c++ - Converting given quantities to different system of base units -

i'm trying use boost-unit 1 of projects. in project several quantities velocity, accelaration, angular velocity represented si-system base units. (m/s, m/s^2, rad/s^2) the user uses gui interface plot these quantities. let's angular velocity. gui should allow user dynamically change base units, has options: lengths: m, cm, mm time: s, ms, min, h angle: rad, deg in order use boost-unit project need generic function converting quantity 5*m*s^-2*rad 5*1000/m_pi*180*mm*s^2*deg . but i'm lost might best approach write function. i think has like: template<typename h1, typename h2, typename u, typename v> quantity<v> convert(const quantity<u>& quantity); where h1 , h2 of type homogeneous_system , can build make_system .

deployment - Deploying C# application that uses Crystal Reports -

i'm developing .net 2.0 c# program vs2005 prints crystal reports document. program deployed @ client computer take raw rpt file , print, no design required. i use following code: reportdocument crrpt = new reportdocument(); crrpt.load(pathtorptfile); crrpt.printoptions.printername = settings.print_printer; crrpt.printoptions.paperorientation = paperorientation.portrait; crrpt.printtoprinter(1, false, 0, 0); on machine full cr xi r2 developer designer installed, managed send job prints printer. what steps deploy or create installer program can install , run on client computer? if possible @ minimal without need install full cr. also, client need license read , print? appreciate guide or link this. many in advance. i had kind of problem while using crystal reports , there few things should aware. you don't have install crystal in client's computer. mut installed in server running. what facing cr , server compatibility. also dou

java - JDBC connecting to MySQL on Amazon ec2 -

i'm little new @ that, after starting ec2 instance, , installing mysql instance through rds, manage connect through mysql workbench using ssh (.pem file). my problem can't seem have right, when i'm trying connect jdbc, how authentication suppose done? here code, hope can give me hint on how proceed: public void create_table(){ connection c = null; statement stmt = null; try { class.forname("com.mysql.jdbc.driver"); c = drivermanager.getconnection ("jdbc:mysql://127.0.0.1:3306/test","root", "password"); // c = drivermanager.getconnection ("jdbc:mysql://mydatabase.us-east-1.rds.amazonaws.com:3306/test","user="+"root"+"password=root", ""); system.out.println("opened database successfully"); stmt = c.createstatement(); string sql = "create table users " + "(id int primary ke

javascript - Plugin for tagcloud with tool tip -

can please suggest plugin tagcloud tool tip using java script,jquery thanks in advance midhun m s you find many options here : https://www.sitepoint.com/10-jquery-tagging-tag-clouds/

express - Problems calling Facebook with Angular $resource -

if use simple button href="users/facebook" in login form, facebook callback works fine. i want change service function calls "users/facebook" not working. have: login.html <a href="" ng-click="facebooklogin()" class="btn btn-primary"><span class="fa fa-facebook"></span> controllers.js $scope.facebooklogin = function() { console.log('facebooklogin called'); authfactory.facebooklogin(); }; services.js authfac.facebooklogin = function() { console.log('in services/facebooklogin'); $resource(baseurl + "users/facebook").get(function(){ }); }; routes/users.js //not working router.get('/facebook', passport.authenticate('facebook'), function(req, res){ console.log('facebook called'); }); according console $resource call " https://localhost:3443/users/facebook " works ok r

android - Java boolean return if statement -

this question has answer here: ternary operators java 6 answers can please explain, in simple english, logic behind statement? return mcontainsloadingrow ? (getcontentdatasize() + 1) : getcontentdatasize(); assuming mcontainsloadingrow boolean, if mcontainsloadingrow true , then return getcontentdatasize() + 1 . if not, return getcontentdatasize() . is correct way @ this? this complete expression know as ternary operator in java . code statement mcontainsloadingrow ? (getcontentdatasize() + 1) : getcontentdatasize(); || || || //boolean expression //return if true //return if false here in code mcontainsloadingrow boolean variable contains either true or false . can change mcontainsloadingrow boolean expression (a>b or b==a or b <= etc.) ? (question mark) :

c# - How to get files from a directory created between two dates using DateTimePickers -

i want files created between 2 dates directory. dates selected 2 datetimepickers. example (user selectable): datetimerpicker1 = "15/09/2015"; datetimerpicker2 = "05/10/2015"; i put var var datainicio = datainicial.value; var datafim = datafinal.value; string entradadediretorio = @"c:\\"; directoryinfo diretoriodeentrada = new directoryinfo(entradadediretorio); if (datainicio != datafim) { foreach (var arquivos in diretoriodeentrada.getfiles().where(f => f.creationtime >= datainicio && f.creationtime <= datafim)) { // call function } } else { foreach (var arquivos in diretoriodeentrada.getfiles().where(f => f.creationtime == datainicio && f.creationtime == datafim)) { // call function } }

python - Removing QLineEdit proxy widget from QGraphicsScene on returnPressed -

what have qlineedit appear in qgraphicsview when qgraphicstextitem added scene. line edit being used set text of qgraphicsitem when double-clicked , needs removed when return key pressed. i'm having trouble getting qlineedit deleted. i've tried deleting when return key pressed still not removed. here code reproduce behaviour: class text(qgraphicstextitem): def __init__(self, text, position=qpointf(0,0), parent=none, scene=none): super().__init__(text, parent=parent, scene=scene) self.parent = parent self.setflag(qgraphicsitem.itemisselectable, true) self.height = self.document().size().height() self.width = self.document().size().width() self.text_center = qpointf(-self.width/2, -self.height/2) if parent: self.parent_center = self.parent.boundingrect().center() self.scene = self.parent.scene self.setpos(text_center) else: self.setflag(qgraphicsitem.it

Using a variable name after the where clause in mysql and php -

i'm trying write php string create sql statement uses variable field name after clause. problem doesn't use variable name, i'm not php not sure if it's string concatenation or else... appreciated! i'm using php 5.5 mysql, mysqli isn't available current host. echo $sql_subject; $sqlstring2 = "select * tablename ". $sql_subject . " = '$set'"; however keeps outputting: s select * tablename '' = '1' i know $sql_subject has value because it's printing above sql output... i'd say: select * tablename s = '1' thanks

php - 'Unexpected T_VARIABLE' (presumed related to HEREDOC) -

this question has answer here: is possible define class property value dynamically in php? 2 answers i have following piece of php, giving me a: parse error: syntax error, unexpected '$author' (t_variable) in /var/www/html/blog/index.php on line 77 <?php class post { //define placeholders public $title = 'post title'; public $timestamp = 'timestamp'; public $author = 'author'; public $author_url = '/user/'. $author; $post_boilerplate = <<<eof <div class="blog-post"> <h2 class="blog-post-title"> $this->title </h2> <p class="blog-post-meta">$this->timestamp <a href="$this->author_url">$this->author</a></p> <p>blah, blah, blah...</p> </div><!-- /.blog-post --&

ios - Changes on Background NSManagedObjectContext not visible on Main, using NSFetchedResultsController -

this bizarre issue, , thought understood core data. i use background context has no parent. hooked right persistent store coordinator. update objects on background context save it. listen contextdidsavenotification , merge changes main thread context. updated objects not faults on main thread used populate table view cells. expect changes merge. not. without getting details of data models, suffices object has property " downloadstate ". once parsing work done on background thread, downloadstatevalue (an enum) gets set "3", corresponds 'completed'. i subscribe contentwillsave notification inspect what's going on. @ end of parsing work: 2016-06-13 10:19:21.055 myapp[29162:52855206] going save background context. updated:{( <qluserpinnedcourse: 0x7fe195403c10> (entity: qluserpinnedcourse; id: 0xd0000000002c0002 <x-coredata://95821adc-8a1f-4dac-b20c-edd8f8f413ea/qluserpinnedcourse/p11> ; data: { course = "0xd00000000

javascript - VML non-zero winding -

Image
i trying draw complex polygons html canvas. have decide on either "even-odd" or "non-zero" winding rule. browsers apply non-zero winding rule default. in ie11+ , other major browsers winding rule can changed even-odd. i want consistent on older browsers (supporting ie8+). since there doesn't seem way change winding rule in ie9 , ie10, asking if there way change winding ie8. i using excanvas.js ie8. excanvas.js uses vml shapes simulate shapes on canvas , applies even-odd rule default. there way change winding vml shapes non-zero rule? a fiddle play with. var canvas = document.getelementbyid("canvas"); var context = canvas.getcontext("2d"); context.beginpath(); context.moveto(111, 108), context.lineto(112, 141), context.lineto(155, 143), context.lineto(140, 171), context.lineto(113, 170), context.lineto(92, 168), context.lineto(80, 142), context.lineto(79, 117), context.lineto(82, 86), context.lineto(103, 75), context.lin

python: How does subprocess.check_output create it's calls? -

i'm trying read duration of video files using mediainfo. shell command works mediainfo --inform="video;%duration/string3%" file and produces output like 00:00:33.600 but when try run in python line subprocess.check_output(['mediainfo', '--inform="video;%duration/string3%"', file]) the whole --inform thing ignored , full mediainfo output instead. is there way see command constructed subprocess see what's wrong? or can tell what's wrong? try: subprocess.check_output(['mediainfo', '--inform=video;%duration/string3%', file]) the " in python string passed on mediainfo , can't parse them , ignore option. these kind of problems caused shell commands requiring/swallowing various special characters. quotes such " removed bash due shell magic. in contrast, python not require them magic, , replicate them way used them. why use them if wouldn't need them? (well, d'uh, because

android - LocationServices.FusedLocationApi.getLastLocation(googleApiClient) is always null on emulator -

i don't know whats wrong emulator. can't take locatioan command locationservices.fusedlocationapi.getlastlocation(googleapiclient) in emulator supported gps , google play service nothing works taking current locaion. location = null. need help. here code : private void configuregoogleapiclient() { locationrequest = locationrequest.create(); locationrequest.setpriority(locationrequest.priority_high_accuracy); locationrequest.setinterval(constant.interval); locationrequest.setfastestinterval(constant.fastinterval); googleapiclient = new googleapiclient.builder(this) .addapi(locationservices.api) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .build(); if (googleapiclient != null) { googleapiclient.connect(); } } @override protected void onstart() { super.onstart(); if (googleapiclient != n

php - Config codeigniter on remote server (404 not found) -

i'm starting implement php application on remote server using codeigniter , netbeans. don't understand why still have (404 not found) if did configuration. connection server ok, can upload files. in $config['base_url'], tried adress of server, path index.html, nothing... no results. don't know problem , file must change, if can me please find solution. thank's lot yous answers! it kinda hard troubleshoot question without seeing configuration. first double-check $config['base_url'] mentioned, set whatever site name/address is. example, if running locally on port 8888, this $config['base_url'] = 'http://localhost:8888/'; so if site wwww.example.com be $config['base_url'] = 'http://www.example.com/'; also double-check .htaccess file re-write access if want remove 'index.php' url. web server using site?

java - gradle / intellij - shared test resource(s) -

i have gradle based project 8 subprojects. each of these has test code relies on folder number of .csv files content. i'd rather not copy folder test path of each subproject. is there way tell gradle files in common location? how intellij? tried indicating files 'test resource' haven't figured out how each sub-module find them (without resorting '../..' style notation) i did providing path common files folder on sourcesets in build.gradle file: sourcesets { test { resources { srcdirs = ["src/test/resources", "src/main/resources/db"] } } not sure if that's clean way that, me it's better copypasting same files on multiple locations.

Not able to clear palette settings for Gedit terminal plugin in dconf-editor (Ubuntu) -

Image
i trying change color of embedded terminal plugin in gedit (3.18) on ubuntu virtual machine. solutions have found online suggest clearing palette settings in dconf-editor so, mine not letting me that. can please help? it's supposed this , mine looks , giving me error message when try clear palette :( you can set value via command line issuing command below. gsettings set org.gnome.gedit.plugins.terminal.use-theme-colors false note: may need root privilege it. if so, prefix command sudo . edit: notice dot before use-theme-colors . gsettings set org.gnome.gedit.plugins.terminal use-theme-colors false edit: to change palette color, can try command: gsettings set org.gnome.gedit.plugins.terminal palette "put array of pallete colors here" for example: gsettings set org.gnome.gedit.plugins.terminal palette "['#2e2e34343636', '#cccc00000000', '#4e4e9a9a0606', '#c4c4a0a00000', '#34346565a4a4', '#757

XML/XSD validation for a Word doc -

i have document updated , consists of text , tables. tables have 2 rows, 1 ranges of numbers , second single number. i check if number in row 2 within range given in row 1. using xmls , xsds. original thought create xsd word doc, xml word doc (save file .xml) , run both files through vaidator. however, having trouble writing xsd. lot of sources online generate xsd , xml , use xsd validate xml. problem if this, i'm not seeing ranges specified in xsd. looks doc formatting specifications. know if there tools task or need generate xsd manually. ultimate goal automate process such given doc, have xsd , can generate xml, can change values in xml , see if in valid range according xsd(which should check ranges). stuck on how can automate process (or if there way automate it) edit: how 1 can restrictions ranges in schema - http://www.w3schools.com/xml/schema_facets.asp preface : ken white right when comments should improve existing question rather re-ask without substantia

Python's multiprocessing returns more results than tasks where given -

i'm trying use multiprocessing simulation run, evaluate different input values @ same time. therefore, googled lot in last weeks , got not pretty (somehow) works. problem now, returns more output have given tasks , don't understand why. sometimes each simulation run returns 1 value expected in example below expect result of e.g. simulation run 5 [23]. differs, simulation run produces more output expected. when increase number of periods e.g. 2, generate 4 output values cannot figure out why is. could please give me hint how change that? cannot find answer , i'm getting quite frustrated :( suggestions on how improve code appreciated i'm quite new python , love far :) this simplified code use: import numpy np multiprocessing import process, queue import multiprocessing itertools import repeat class simulation(process): nr = 1 mean = 5 stddev = 3 periods = 10 result = [] def generate_value(self): generatedvalue = max(int(roun

web scraping - python urllib.request - headers that are likely to work -

working on little script fetch info websites. i'm having trouble http errors. req = urllib.request.request(lnk['href'], headers={'user-agent': 'mozilla/5.0', 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'}) page = urllib.request.urlopen(req) when triest fetch, example, http://www.guru99.com/node-js-tutorial.html long series of errors, ending 406 unacceptable: traceback (most recent call last): file "get_links.py", line 45, in <module> page = urllib.request.urlopen(req) file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/urllib/request.py", line 162, in urlopen return opener.open(url, data, timeout) file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/urllib/request.py", line 471, in open response = meth(req, response) file "/library/frameworks/python.framework/versions/3.5/lib/python3.5/urllib/request.py&q

c# - How much WCF efficient to get real time data? -

suppose have thousand of hardware device(about 20,000) send data in real time. have capture data , send data database , show information in application.for thinking develop wcf service poll devices , data devices , store in database. so question "is wcf efficient or should follow approach " i thinking develop wcf service poll devices a wcf service cannot "poll". consumer can poll, can call service on , on again, there no polling pattern built wcf client channel. polling behavior need programmed. so question "is wcf efficient or should follow approach " what suspect want devices call service , pass data, asking can wcf service handle high volume of calls? , answer yes. however, in order best scalability should expose per-call service, , on nettcpbinding (basically sockets), uses optimised encoding , therefore higher performance. this available consumer running wcf client stack. if wcf not available on devices next best o

jersey - How to handle exceptions with Swagger? -

Image
i building test apis using swagger (1.5) , jax-rs jersey (1.13) , m trying implement exception handling. example have following code when receiving results db (elasticsearch) @post @path("/category") @apioperation(value="returns products") @produces({ "application/json" }) public response getpostcategories( @apiparam(value="keyphrase, required=true) @queryparam("keyphrase") string keyphrase, @apiparam(value="category) @queryparam("category") string category, @context securitycontext securitycontext) throws webapplicationexception { searchrequest searchrequest = new searchrequest(); searchrequest.setkeyphrase(keyphrase); searchrequest.setcategory(category); searchcategoryquery categoryquery = new searchcategoryquery(); string searchresponse = null; try { searchresponse = categoryquery.searchcategory(searchrequest); } catch (weba

weblogic - Oracle ADF DataSource for RAC environment -

i have environment of oracle database 11gr2 single instance on linux, weblogic 10.3.5 on windows. have running adf application single instance database. connection between database , application configured using generic datasource "myappds". on other side have configured new rac database environment same application. connection between rac database , application configured using gridlink datasource. confusion jdbc/myappds. should same or different rac. should developer have create new connection string rac database.? kindly help we recommend using jdbc thin driver oracle rac. of our customers using jdbc thin driver. active grid link correct datasource use wls. sample rac url shown below. use scan better manageability purposes. jdbc:oracle:thin:@(description = (connect_timeout= 90) (retry_count=20)(retry_delay=3) (address_list = (load_balance=on) (address = (protocol = tcp)(host=primary-scan)(port=1521))) (address_list = (load_balance=on) ( address