Posts

apache - Lost message when stoping and restarting Embedded ActiveMQ -

hi trying write test-case implementing fail on support activemq. here code val brokera = createbroker("a") brokera.start val failoverurl = s"failover:(vm://brokera?create=false)" + s"?randomize=false&maxreconnectattempts=-1&reconnectsupported=true" val cfactory = new activemqconnectionfactory(failoverurl) val qconnection = getqueueconnection val session = createqueuesession(qconnection) private def totalreadmessagescount(queuereceiver: queuereceiver) = { val messages = iterator.continually(option(queuereceiver.receive(2000))).takewhile(_.isdefined).flatten.toseq messages.size } private def getreceiver = { val queueconnection = getqueueconnection queueconnection.start() val queuesession = queueconnection.createqueuesession(false, session.auto_acknowledge) val queuereceiver = createqueuereceiver(queuesession, brokera.getbrokername) queuereceiver } def getqueueconnection =cfactory.createqueueconnection("admin", "") de...

LeaveOneOut Cross Validation in scikit learn -

does know how can remove error below? nameerror traceback (most recent call last) <ipython-input-31-d3625a93ead4> in <module>() 11 loo = leaveoneout(num_of_examples) 12 train_index, test_index in loo: ---> 13 print("%s %s" % (train, test)) 14 nameerror: name 'train' not defined and code causing error below: from sklearn import datasets import numpy np sklearn.preprocessing import standardscaler iris = datasets.load_iris() x = iris.data[:, [2, 3]] y = iris.target x, y sklearn.cross_validation import train_test_split x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=0) sc = standardscaler() sc.fit(x_train) x_train_std = sc.transform(x_train) x_test_std = sc.transform(x_test) num_of_examples = len(x_train_std) this getting error: from sklearn.cross_validation import leaveoneout loo = leaveoneout(num_of_examples) train_index, test_index in loo: print...

javascript - Can't resolve all parameters for MapsPage:(?,NavController,LaunchNavigator,.......) in Angular 2 -

so using angular2 ionic2 mobile application. application compiling , running until added new module application have navigation in google maps. using phonegap-launch-navigator so. class importing modules maps class , structure of class looks this; import { launchnavigator, launchnavigatoroptions} 'ionic-native'; import { component, ngzone } "@angular/core"; import { navcontroller, platform, navparams } 'ionic-angular'; import {googlemap, googlemapsevent, googlemapslatlng, googlemapsmarkeroptions, cameraposition } 'ionic-native'; import { observable } 'rxjs/observable'; import 'rxjs/add/operator/map'; import { geolocation } 'ionic-native'; import { injectable,forwardref,inject } "@angular/core"; @component({ selector: 'maps-page', templateurl: 'maps.html', }) export class mapspage { private map: googlemap; destination:string; start:string; constructor(public launchnavigatoroptions:...

amazon web services - AWS RDS server timed out -

i followed steps given on create ec2 instance , install web server . i tried run samplepage.php code there server @ my-endpoint.amazon.com taking long respond , can't understand why.

ubuntu - Device or resource busy - Docker -

when doing apt-get -y upgrade on new ubuntu 14.04 machine ubuntu:latest (xenial) image, raised error: setting makedev (2.3.1-93ubuntu2~ubuntu16.04.1) ... mv: cannot move 'console-' 'console': device or resource busy makedev console c 5 1 root tty 0600: failed i've fresh install of docker on fresh ubuntu 14.04, using these command: sudo apt-get remove docker docker-engine sudo apt-get update sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual wget -qo- https://get.docker.com/ | sudo sh su - $user # logout , login docker hello-world runs fine: $ docker run hello-world unable find image 'hello-world:latest' locally latest: pulling library/hello-world 78445dd45222: pull complete digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7 status: downloaded newer image hello-world:latest hello docker! message shows installation appears working correctly. generate message, docker took following ste...

preg match - Thursday 6th of April 2017 to date via pregmatch php -

still learning php, know general programing having hard time convert following string date date format follows thursday 6th of april 2017 hi, still learning php, know general programing having hard time convert following string date thursday 6th of april 2017. can explode using space separator , remove letters date , month can array have think pregmatch should able solve have not been able figure out right combination. apreciated.. i can explode using space separator , remove letters date , month can array convert number month have seen examples pregmatch , should able solve have not been able figure out right combination. appreciated. try this, might helpful you. $date = "thursday 6th of april 2017"; $date = str_replace("of ", "", $date); $d = date_create_from_format('l js f y', $date); echo date_format($d, "y-m-d"); //2017-04-06

How to accept values as doubles in a textbox in ASPX C# Website? -

the following code allows enter integers, instead of integers, need give option user enter double (0.00). suggestions or modification? if (_txstaticpressureupdate.trim() == "") { txsystemmessage.text = "field 'static pressure' empty. please enter valid value."; txsystemmessage.forecolor = system.drawing.color.red; return; } //check record info entered consists of numbers / no special characters or letters (int j = 0; j < _txstaticpressureupdate.length; j++) { if (!char.iscontrol(_txstaticpressureupdate[j])) { txsystemmessage.text = "field 'static pressure' has invalid value."; txsystemmessage.forecolor = system.drawing.color.red; return; } else { staticpressure = double.parse(txstaticpressureupdate.text.trim()); } } i working on aspx/c# website. many of options available winforms. sitll...