Posts

Showing posts from January, 2014

android - How to get words in bold in textview -

i'm making app, multiple tabs, , in of them, i'm able put in bold letters. ones use '\n' enter. in other tabs, need use '<br />' enter, cause tabs involve hyperlinks. hyperlinks, '\n' won't work anymore. so in tabs '\n', use <b> in bold. others, doesn't work. anyone know how fix this? i'll add strings.xml code, use code mentioned above. <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">rodekruis</string> <string name="hello_world">hello world!</string> <string name="action_settings">settings</string> <string name="title_activity_main"></string> <string name="title_activity_nieuws"><b>nieuws</b>&lt;br /&gt;&lt;br /&gt;volg de ontwikkelingen in en om het rode kruis ziekenhuis op onze website, hier een inte...

gradle - SpringBoot - @Value is not working during JUnit Test for custom spring config location -

@value not working during junit test when application.yml in location. fooservicetest @runwith(springjunit4classrunner.class) @contextconfiguration(classes = { appconfig.class }) public class fooservicetest { emailservice in other module public class emailservice { @value("${aws.credentials.accesskey}") private string accesskey; application.yml aws: credentials: accesskey: xxxxxxxx secretkey: zxxxxxxxxx but got: could not resolve placeholder 'aws.credentials.accesskey' in string value "${aws.credentials.accesskey}" even added -dspring_config_location=/home/foo/other/location/config/ standard spring boot locations if want spring-boot's application.properties loaded, should launch unit test spring boot (using @springapplicationconfiguration ): @runwith(springjunit4classrunner.class) @springapplicationconfiguration(classes = { appconfig.class }) public class fooservicetest { @test pub...

angularjs - How to check current date and system date are same? -

i using code: <md-datepicker ng-model="reviewdate" md-placeholder="review date*" md-min-date="currdate" md-max-date="maxdate" ng-focus="createalpctrl.errors.review_date = ''"> $scope.currdate = new date(); $scope.maxdate = new date( $scope.currdate.getfullyear(), $scope.currdate.getmonth() + 3, $scope.currdate.getdate()); it giving correct values when local system date correct. when changing local system date other date showing wrong date current date. how can overcome this? i retrieved server date server side code , using server date, set min , max date. server code : meteor.methods({ currentdate: function() { let currdate = new date(); return currdate } }) client code : meteor.call('currentdate', function(error, result) { if (error) { console.log(error); } else { console.log(result); $scope.currdate = res...

python - How to install package via pip requirements.txt from VCS into current directory? -

for example, have project foo dependency bar (that in private git repo) , want install bar foo directory via pip requirements.txt . we can manually install bar console command: pip install --target=. git+ssh://git.repo/some_pkg.git#egg=somepackage but how install bar current directory requirements.txt ? the best way clone repository, or donwload requirements.txt file, , run pip install -r requirements.txt install modules dependencies.

app store - Give access to the AppStore in a WiFi HotSpot -

one of our hotel clients provide free wifi guests hot spot, however, there available few url access them freely (such facebook or website of hotel) , if need more access should log in. we have developed app hotel , 1 of features if open app gives complete access hotel wifi, can navigate page want. therefore, necessary guests can download app through appstore without being logged in hotel wifi, guest can download app , access immediately. we have trace of url calls appstore search , downloading app , have set hot spot allow access url, however, appstore tells have no connection. what url should need enable in our hot spot appstore work properly? these routes have enabled: search.itunes.apple.com play.itunes.apple.com init.itunes.apple.com su.itunes.apple.com itunes.apple.com se.itunes.apple.com p59-buy.itunes.apple.com pd-st.itunes.apple.com xp.apple.com sp.itunes.apple.com thank help. apple appstore co...

esb - API Gateway - Transformation and Asynchronous Messaging -

does api gateway handle aspects of transformation of request/responses for/from multiple apis or ideally handle aspect @ all? how fit in landscape asynchronous messaging used instead of synchronous rest call? any insights appreciated.

c# - Splitting a string in the format domain\alias -

this question has answer here: how split string multiple values? 5 answers i have user input variable containing string in format: "domain\alias" , need split in 2 different strings: domain , alias. i heard somewhere conversion of strings literals don't understand how me here. write var x = @"doamin\alias".split('\\') it give array whith contents x[0] = "doamin" x[1] = "alias" if want user if domain isn't specified: var user = x.length == 2 ? x[1] : x[0]; var domain = x.length == 2 ? x[0] : null;

Does Java JIT compiler remove method's call without side effects? -

i have simple method check if input string valid xpath private boolean isxpath(string value) { boolean isxpath = true; try { xpath xpath = xpathfactory.newinstance().newxpath(); xpath.compile(value); } catch (xpathexpressionexception e) { isxpath = false; } return isxpath; } can sure jit compiler won't remove code inside try block, because of has no side effects? or has (possible exception)? dead code eliminatino not side-effects, using result of computation. since method returns isxpath , cannot derived without executing try block, impossible jit compiler eliminate it.

r - error with interpSpline function -

i have list of data frames, xyz, , in every data frame there 2 numeric vectors (x , y). want apply interpspline function package splines x , y, when : lapply(xyz, function (x){ x%>% interpspline(x,y) }) i following error: error in data.frame(x = as.numeric(obj1), y = as.numeric(obj2)) : (list) object cannot coerced type 'double' it doesn't work because interpspline doesn't take data frame first argument. xyz <- list(data.frame(x=rnorm(10),y=rnorm(10)), data.frame(x=rnorm(10),y=rnorm(10))) library(splines) sf <- function(d) with(d,interpspline(x,y))) s <- lapply(xyz,sf) you use interpspline(d$x,d$y) . might possible enough contortions interpspline work pipes, hardly seems worth trouble ...

ruby on rails - Could performance issues imerge when using ActionCable in Production? -

i'm planning have rails app has content rich interactive page many users connect to. development has went , small time testing on dev servers went without hitch either. problems started when started alpha testing selected groups of people. sever grind halt suddenly. nginx stop because of queue being full. @ lose while, after looking around, came conclusion live actioncable eating memory.this gets bad when user reloads page multiple times subscribes actioncable, causing additional process become active, stopping server, being cured nginx reboot. i run 2core 1gb memory ssd run vps server alpha testing, perhaps @ tops 20 concurrent users.should running performance problems such load? or should tuning code or redis, passenger fix this? i know hard definitive things without more specifics, ballpark estimate done information? 20 concurrent users plus multiple tabs per user still less 100 concurrent websocket connections, not lot. first thing i'd leaks - when re...

delphi 10 seattle - I want to deploy a file for an Android app to the Documents/MyApp folder using Embarcadero -

i want deploy xml file android application. want able move after startup of file done folder want process file first time start app. want deploy file folder under documents folder named after app: /documents/myapp/load/ , after finishing processing move /documents/myapp/done/. i using delphi 10. i can not figure out need put in remote path in deployment manager. "assets" places file in /android/data/com.test.myapp/ folder , read-only can not move away. i think have tried accept correct value...

c++ - How to properly hash a pair of pointers? -

this question has answer here: unordered_map::find key std::pair of pointers custom hash crashes in vs2012 1 answer i have std::unordered_map keys of type std::pair<t*, t*> (i.e., pair of pointers). the code base has following hash functor defined: struct pair_hash { template<typename t> std::size_t operator()(std::pair<t, t> const &p) { return (std::hash<t>()(p.first) + 0x9e3779b9) ^ (std::hash<t>()(p.second) + 0x9e3779b9); } }; and used as: std::unordered_map<std::pair<t*, t*>, u, pair_hash> mydictionary; where u arbitrary object. now hash functor displayed above must have issues because in vc++ gives me out of bounds crash in std::unordered_map::find . q: could hash functor problematic or behaviour attributed vc++ itself? is there "proper/more proper" way hash pair of pointers? ...

jquery - Write variable into name attribute of the anchor selector -

how write variable value of name attribute of anchor selector? $("a[name=$hash]").addclass('open'); if write code in php page can write following $("a[name=<?php echo $hash; ?>]").addclass('open');

vb.net - Adding MouseOver event to htmlDocument causes a System.NullReferenceException -

i have form webbrowser object named "mybrowser". when open webpage in browser, id of element mouse hovering on , show in textbox named "txtproperties". i have tried achieve using following code: public class buildbrowser dim myhtmldocument htmldocument private sub btnbrowsesubmit_click(sender object, e eventargs) handles btnbrowsesubmit.click mybrowser.navigate(txtaddress.text) end sub private sub document_mouseover(sender object, e htmlelementeventargs) txtproperties.text = trycast(sender, htmldocument).getelementfrompoint(e.clientmouseposition).getattribute("id") end sub private sub buildbrowser_load(sender object, e eventargs) handles mybase.load myhtmldocument = mybrowser.document addhandler myhtmldocument.mouseover, addressof document_mouseover end sub end class running causes exception, when code gets addhandler myhtmldocument.mouseover, addressof document_mouseover saying "null reference exception unhandled"...

BigQuery not allow Subselect in select clause -

i have sample 2 table: table point_status: rank_point status 9 excellent 5 3 bad 0 fail table student_point: student point student 8 student b 9 student c 5 student d 4 how create query on bigquery status of student (with point >= rank_point) ? note:- bigquery not allow subselect in select clause. note: bigquery not allow subselect in select clause. it does support standard sql - see enabling standard sql with point_status ( select 9 rank_point, 'excellent' status union select 5 rank_point, 'good' status union select 3 rank_point, 'bad' status union select 0 rank_point, 'fail' status ), student_point ( select 'student a' student, 8 point union select 'student b' student, 9 point union select 'student c' student, 5 point union select 'student d' student, 4 point ) select student, point, (select status point_status rank_p...

php - Error when injecting doctrine and custom service -

i have problem dependencies injections in symfony3: this services.yml some_service: class: stagingbundle\service\someservice arguments: ['@doctrine'] arguments: ['@test.other_service'] this constructor of someservice.php public function __construct($doctrine, someservice $someservice) { $this->doctrine=$doctrine; $this->someservice=$someservice; } when running console command following error: [symfony\component\debug\exception\contexterrorexception] catchable fatal error: argument 2 passed stagingbundle\service\someservice::__construct() must instance of stagingbundle\service\otherservice, none given, called in /var/www/projects/myapp/var/cache/dev/appdevdebugprojectcontainer.php on line 1141 , defined why happen , how can solve it? "arguments" array , can there once, should this some_service: class: stagingbundle\service\someservice arguments: ['@doctrine', '@test.other_service'] ...

php - Symfony2 one form for many entities Many To One relation -

i need form issue. have main entity - user: class user { private $id; private $name; private $surname; private $description; private $photo; /** * @orm\onetomany(targetentity="adress", mappedby="user", cascade={"persist", "remove"}) */ private $adresses; /** * @orm\manytomany(targetentity="groups", inversedby="users") * @orm\jointable(name="users_groups") */ private $groups; i have get, set, __construct etc... then address entity: class adress { private $id; private $city; private $street; private $number; /** * @orm\manytoone(targetentity="user", inversedby="adresses", cascade={"persist", "remove"}) * @orm\joincolumn(name="user_id", referencedcolumnname="id") */ private $user; and form adress: class adresstype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ...

Cannot resolve NPM module which seems to have installed successfully -

i have installed few modules doing npm install --save ng2-redux redux redux-actions redux-promise . if npm list | grep "redux" get: ├── ng2-redux@3.0.5 ├─┬ redux@3.5.2 ├─┬ redux-actions@0.12.0 ├─┬ redux-promise@0.5.3 and in package.json can find them well: "dependencies": { ... "ng2-redux": "3.0.5", "redux": "3.5.2", "redux-actions": "0.12.0", "redux-promise": "0.5.3", ... } the problem while ng2-redux , redux both work fine: import { applymiddleware } 'redux'; import { ngredux, select } 'ng2-redux'; redux-actions , redux-promise both throw cannot resolve file 'redux-actions'/'redux-promise' when trying import them, appears both in ide (webstorm 11.0.4) , in webpack: import { createaction } 'redux-actions'; import promisemiddleware 'redux-promise'; the errors says: error in ../src/.../app.component...

openstack - How to get token ID in keystoneclient v3 -

i got token id in kystoneclient v2 command: token = keystone.auth_ref['token']['id'] but when move kystoneclient v3, please kindly let me know how can token id. try same above command. error. in keystone client v3, authentication response returns token id in header rather in response body, named "x-subject-token". you can see changes here: https://developer.openstack.org/api-ref/identity/v3/index.html?expanded=list-endpoints-detail,create-credential-detail,validate-and-show-information-for-token-detail,password-authentication-with-unscoped-authorization-detail i had tried token perl this: my $res = $agent->post( $self->{auth_url} . "/auth/tokens", content_type => 'application/json', content => to_json($authkeystone) ); $headerdata = $res->{_headers}; $tokenid = $headerdata->{'x-subject-token'}; it works!

Python guessing game hints and points systems -

i'm writing first python game , trying incorporate 2 elements i'm unsure how write it. 1: idea game generate random 3 digit number inbuilt random module (ie. 123) , user have 23 tries guess correct numbers. initiate asking user input 3 digits between 0-9. want create hint system user knows if on right track. see example in link below (i can't embed images apparently). click see example input/output hints a "w" indicates of characters in guess wrong. one or more "x"s indicates have correct character, in incorrect position one or more "r"s indicates have correct character in right position to kind of hint need create 3 separate numbers , combine them form target number or still able following code: target = random.randint(111, 999) i've started writing function takes in variables guess (this user has entered) , target (the generated number): def get_hint(guess, target): this far have gotten it. laughable, know. literal...

maven - java.lang.NoSuchFieldError: INSTANCE in bitpay SDK -

i want implement this code public void testgetexchangerate() throws exception { eckey key = keyutils.createeckey(); string clientname = "server 1"; bitpay bitpay = new bitpay(key, clientname); if (!bitpay.clientisauthorized(bitpay.facade_merchant)) { // merchant facade authorization code string pairingcode = bitpay.requestclientauthorization( bitpay.facade_merchant); // signal device operator client needs // paired merchant account. system.out.print("info: pair client merchant account using pairing code: " + pairingcode); throw new bitpayexception("error:client not authorized merchant facade"); } } i included these dependencies: <dependency> <groupid>com.github.bitpay</groupid> <artifactid>java-bitpay-client</artifactid> <version>v2.0.4</version> </dependency> <dependency> <groupid>org...

Button press & release actions (php) -

i want create button press & release actions, so, example, when press it, shows text , when release it hides text. can help? have tried: <form action="forwardon.php" method="get"> <input type="submit" value="forward"> </form> this creates button redirects page running desired action: cant create press & release actions this.. and cant find way how this.. or not possible php? well, yes. it's not possible php, need use javascript that. every button has events: onmousedown , onmouseup . can see list of events here basically, need create functions, fired in javascript while pressing/releasing. this <html> <-- html here --> </html> <script> document.getelementbyid('id-of-your-button') .addeventlistener('mousedown', function() { //change text need here pure javascript }); </script> the same goes onmouseup ...

Algolia WordPress Plugin Wont Process Index Cueue -

in reference following existing question. wordpress plugin : can't process indexing queue unable participate in comments due having new account , less 50 reputation. i having problem getting algolia wordpress plugin process index. running latest version of wp , downwloaded wp plugin algolia today. when run wp_debug , wp_debug_log in wp-config file following output on wp end page. has_cap called argument deprecated since version 2.0.0! usage of user levels plugins , themes deprecated. use roles , capabilities instead. in /var/www/html/dealer/wp-includes/functions.php on line 3890 line 3890 in wp-includes/functions.php references code generated error. trigger_error( sprintf( __('%1$s called argument <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) ); this appears unrelated issue. i should point out dev test server running locally on our internal network. i'm starting wonder if that's causing issue. in...

c# - Linq GroupBy and Sum for MVVM from stored procedure -

i have looked on other posts cant find need context. program works when don't try , add in groupby sum using linq. pulling data stored procedure using mvvm . model public class relationshipexperience { [key, column(order = 1)] public double earned { get; set; } [key, column(order = 2)] public double incloss { get; set; } [key, column(order = 3)] public double expenses { get; set; } [key, column(order = 4)] public double balance { get; set; } [key, column(order = 5)] public string uwyear { get; set; } public int programid { get; set; } public int inprogramchain { get; set; } } my current, working method public ilist<relationshipexperience> sp_getrelationshipexperience(int programid) { return _catcontext.sp_getrelationshipexperience(programid).tolist(); } i want sum of columns using (earned, incloss,expenses,balance) , groupby uwyear. here attempt public ilist<relationshipexperience> sp_getrelati...

objective c - Issue retrieving data from firebase database ios -

at moment have app using firebase database store users: name school subject within 3 separate textfields. right i've managed allow user enter details within these 3 text fields , hit button labeled update, sends data firebase console. this means user can enter details, hit update , see them while logged in. logout , login again textfields blank, despite fact firebase has info stored on server. i've been playing around day trying work no avail. here have firebase reference , auth: self.rootref = [[firdatabase database] reference]; self.user = [firauth auth].currentuser; and update button code sends users info firebase database: - (ibaction)didtapeditprofile:(id)sender { if (![_textfieldone.text isequal: @""]) { nsstring *item = _textfieldone.text; [[[[_rootref child:@"users"] child:_user.uid] child:@"name"] setvalue:item]; } if (![_textfieldtwo.text isequal: @""]) { nsstring *item...

python - What is the encoding of the body of Gmail message? How to decode it? -

i using python api gmail. querying messages , retrieving them correctly, body of messages looks total nonsense, when mime type it's said text/plain or text/html . i have been searching on api docs, keep saying it's string, when must encoding... thought base64 encoding, trying decode python base64 gives me typeerror: incorrect padding , either it's not base64 or i'm decoding badly. i'd love provide example, since i'm handling sensitive information i'll have obfuscate bit... { "payload": { "mimetype": "multipart/mixed", "filename": "", "headers": [ ... ], "body": { "size": 0 }, "parts": [ { "mimetype": "multipart/alternative", "filename": "", "headers": [ { "name": "content-type", "value": "multipart/alternative; boundary=...

php - How to represent "to be approved" elements in database -

i have model has attribute called type type of user 's bag (substitute entities confidentiality). users can have multiple bag s (one many) bags have 1 type type has fields name , description a bag 's type can either be: chosen predetermined set of values; or i preload these in database specified user if user application approved, custom type added predetermined set. basically new type 's existence depends on user 's approval status. i want ask ideal way represent relationship of these 3 objects. here strategy: bag has id of user bag has id of type populate type table predetermined values, , return view user chose from the set of rules above ready-to-go if type s predetermined. the challenge when there to approved values. to handle new type s, all custom type s will still added type table type table have approved , date_approved field if predetermined, values 1 , current database upload/default time res...

excel - related to article Get a subrange that has all the cells of a range except of a range of -

hi want create subrange excludes rows range lets 2nd , 3rd row. have seen answers on site of how can realize that, set rng = range("b5:h20") set subrng=rng.offset(1).resize(rng.rows.count-1) or set subrng = intersect(rng.offset(1), rng) but because beginner not know script goes above , underneath commands can compatible vba , make related worksheet.so have on that. thank much hide cells not want include if attempting reverse-union. use range.specialcells method visible cells. dim long, arr variant, r range, rng range arr = array(2, 3) = lbound(arr) ubound(arr) range("b5:h20").rows(arr(a)).entirerow.hidden = true next set rng = range("b5:h20").specialcells(xlcelltypevisible) range("b5:h20").entirerow.hidden = false debug.print rng.address(0,0)

sublimetext3 - How to change the Sublime Text 3 StatusBar message in a command or macro (no plugin)? -

addressing sublime text 3 users here. i wrote couple of macros enable spell-check , load specific dictionary, swap between french , english , wanted simple shortcut (instead of browsing menu or 2 successive commands in command pallet). my macros work expected ( french-spellcheck.sublime-macro , english-spellcheck.sublime-macro ). display message in status bar, instance "switched french" or "switched english" (for time, let 5 sec). i looked everywhere know , tried time, apparently there no way in command (that added @ end of macro), set_status internal st3's python api command (from window package) available plugins... does 1 has idea of how display message sublimetext3 statusbar in command/macro , not plugin? thanks! there no built in command invokes api methods doing (at least not documented one), there's no way go without plugin of sort. that said, in order want, following need save file named e.g. set_status.py in packages/use...

node.js - Mongoose get value from embedded document -

Image
i have scheme this var wfworkitemdocument = new schema({ id: { type: string, required: true, unique: true, default: uuid.v1 }, description: { type: string }, period: [{ id: { type: string, default: uuid.v1 }, start: { type: date, default: date.now } due: { type: number, integer: true }, new: { type: number, integer: true }, }], i want period's due value used method like workitem.findone({ id: idupdate }, function(err, workitem) { if (err) { console.log("invlaid id"); //return res.send(404, { error: 'invalid id' }); } if (workitem) { console.log("id"); console.log(workitem.period.due); } else { //res.send(404, new error('workitem not found')); } }); but doesn't work how can due value?? this result console.l...

r - For each row of dataframe check if duplicate values exist -

i have dataframe contains following values: url response.code count www.site.com/page1 200 4 www.site.com/page1 301 1 www.site.com/page2 200 5 www.site.com/page3 301 4 www.site.com/page4 200 4 www.site.com/page4 403 1 for each unique value of url want know if multiple values of response.code exist. if 1 combination url/response.code exist url consistent. desired output data frame this: url consistent www.site.com/page1 false www.site.com/page2 true www.site.com/page3 true www.site.com/page4 false i loop each of unique url's , check number of different values in response.code, doesn't r way solve this. any suggestions on best way solve this? i'm new r & checked multiple questions on duplicates here didn't seem find solution particular issue. you can use base r aggregate aggregate(response.code~url, df, len...

c++ - OpenGL draw circle with Mouse Move -

i trying use function mousemove(int x, int y) draw circle centered @ mouse click , drag across screen. circles drawn on moving mouse spray paint. far, have void mousemove(int x, int y) { glbegin(gl_polygon); (int = 0; <= 360; i++) { float theta = (2 * 3.14 * i) / 360; glvertex2f((size/2 + x) * cos(theta), (size/2 + y) * sin(theta)); } glend(); glutpostredisplay(); } but when using this, draws large circles aren't centered around mouse. how alter make program draw circles centered @ mouse? to describe project, creating painting program changes shapes, colors, sizes, , rotations of drawing done in mousemove. now, size int set 32. when user selects shape using 'b' key in keyboard function, he/she can switch shapes drawn around mouse user clicks , drags mouse around. spray paint. other shapes work shaped around mouse except circle shape spray. this answer assumes things viewport , projection matri...

ios - How to make image weight and height fill screen in Swift Xcode? -

Image
i found code make slide in swift, cant find, h ow make image fill whole screen. help? here screenshot of slider, , see anchors placed on show you, whole screen. and here code of it; import uikit class onboardingcontroller: uiviewcontroller, uiscrollviewdelegate { let backgroundcolor = uicolor(red: 241.0/255.0, green: 196.0/255.0, blue: 15.0/255.0, alpha: 1.0) let slides = [ [ "image": "book4page1.png"], [ "image": "book4page2.png"], [ "image": "book4page3.png"], ] let screen: cgrect = uiscreen.mainscreen().bounds var scroll: uiscrollview? var dots: uipagecontrol? override func viewdidload() { super.viewdidload() view.backgroundcolor = backgroundcolor scroll = uiscrollview(frame: cgrect(x: 0.0, y: 0.0, width: screen.width, height: screen.height * 0.9)) scroll?.showshorizontalscrollindicator = false scroll?.showsverticalscrol...

concurrency - limit concurrent sessions to Apache tomcat web application -

i using web application based on apache tomcat how can limit concurrent connections application in order prevent more specific number of users access. i not programmer if there way without code perfect thanks to limit number of simultaneous connections , modify <connector> configuration in conf/server.xml : <connector ... maxconnections="10" /> you can set value anything. doesn't limit number of users can "use" system @ given time. if using http sessions track "logged-in users", can limit number of simultaneous sessions modifying application's meta-inf/context.xml file include: <manager ... maxactivesessions="10" /> you can set want. https://tomcat.apache.org/tomcat-8.0-doc/config/http.html#standard_implementation https://tomcat.apache.org/tomcat-8.0-doc/config/manager.html

Android compilation time with jack is extremely slow -

i upgraded java 8 , computer subsequently using jack compile android builds. since i've switched, building app on device taking enormous amount of time; between 3-5 minutes. changed server timeout value in .jack file 1800 seconds , still seems server timeout set 60 seconds. has had similar problem? here .jack file looks like: server_timeout=1800 edit: upgraded computer mid 2010 mac desktop computer late 2015 model. although jack still not compiling i'd like, has improved immensely. used take around 5 minutes compile each time, takes little on minute compile. facing similar problem, perhaps may give insight in solving problem. i facing same problem, , since want use java8 decided use retrolambda instead of jack compiler didn't slow down build jack compiler does.

AngularJS - How to execute function in controller only once in the context of Routing -

i'm using routing feature of angularjs. furthermore want on controller templates. in controller angularjscontroller have init function, should executed @ first time controller gets executed , when explicitly call function. don't wan't init function executed each time routing loads template. how can achieve desired behaviour? var app = angular.module("angularjsapplication", ["ngroute"]); app.config(function($routeprovider) { $routeprovider .when("/overview", { templateurl : "overview.html", controller : "angularjscontroller" .when("/settings", { templateurl : "settings.html", controller : "angularjscontroller" ... }); app.controller("angularjscontroller", function ($scope, $location, $http) { $scope.init = function() { //do stuff }; } create service things should executed once. services ...

javascript - How to handle X-CSRF-Token for jQuery POST in UI5? -

i want use jquery post method call xsjs service modifications in database.my xsaccess file prevents xsrf, need handle in controller method. below controller code- var obj= {}; obj.name= "john"; obj.age= "abc@xyz.com"; obj.loc= "minnesota"; jquery.ajax({ url: "servicetest.xsjs", type: "get", data: json.stringify(obj), beforesend: function(xhr) { xhr.setrequestheader("x-csrf-token", "fetch"); }, success: function(responsetoken, textstatus, xmlhttprequest) { var token = xmlhttprequest.getresponseheader('x-csrf-token'); console.log("token = " +token); jquery.ajax({ url: "servicetest.xsjs", type: "post", data: json.stringify(obj), ...

Renaming files in Python: No such file or directory -

if try rename files in directory, reason error. think problem may have not inserted directory in proper format ? additional info: python 2 & linux machine oserror: [errno 2] no such file or directory though prints directories content fine. doing wrong? import os in os.listdir("/home/fanna/videos/strange"): #print str(i) os.rename(i, i[:-17]) os.rename() expecting full path file want rename. os.listdir returns filenames in directory. try this import os basedir = "/home/fanna/videos/strange/" in os.listdir( basedir ): os.rename( basedir + i, basedir + i[:-17] )

ruby - Rails 4 Search Engine: Multiple Params -

i'm new rails , @ moment coding first app. created search usernames of users, since i've added tagging system (using 'acts_as_taggable_on' gem), want implement in search functionality. i've tried several times now, got argument error (either 0 1 or 2 1). that how target user objects tag params: # find users of specified tags: user.tagged_with(["awesome", "cool"], :any => true, :wild => true) user model acts_as_ordered_taggable # search def self.search(search) if search where(["username ?", "%#{search}%"]) else end end # search tags def self.searchtags(searchtags) if searchtags tagged_with(["#{searchtags}"], :any => true, :wild => true) else none end end users controller def index @users = user.search(params[:search]) @tagged_users = user.searchtags(params[:searchtags] end user index view = form_tag users_path, :method => 'get' = text_f...

database - Automatic recovery of the failed postgresql master node is not working with pgpool II -

i new postgresql , pgpool ii setup. have configured postgresql ha/load balancing using pgpool , repmgr. the setup consist of 3 nodes , verison of application , os mentioned below: **pgpool node** => 192.168.0.4, **postgresql nodes** => 192.168.0.6, 192.168.0.7 **os version** => centos 6.8 (on 3 nodes) **pgpool ii version** => pgpool-ii version 3.5.0 (ekieboshi). **postgresql version** => postgresql 9.4.8 **repmgr version** => repmgr 3.1.3 (postgresql 9.4.8) i have followed link setup. when bring down master node, failover happens , slave node takes on new master node. after failover, have recover failed node manually , sync new master node. i want automate recovery process. the pgpool.conf file on pgpool node contains parameter recovery_1st_stage_command . have searched sources online , found paramater "recovery_1st_stage_command" should set in configuration file pgpool.conf on pgpool node. i have set parameter recove...

android - Bluemix App Builder - Location is mandatory in a map screen -

i'm trying develop app app builder of bluemix i next error we have following problems generation of application: location mandatory in map screen 'name of screen' how can add location? also want know if app builder can me use geolocation the standalone mobile app builder service deprecated , it’s features integrated bluemix mobile dashboard. able find feature you're looking in "project settings" after creating new mobile project, you'll need add google api key. check out blog post new mobile dashboard more info.

html - How to add a value in the y-axis at the bottom of a bar chart-css -

Image
i'm using exercise code work: codepen i want add $0 @ bottom of bar chart in y-axis. i/e instead of starting $10,0000 want start $0. there way in css? html y-axis: <div id="ticks"> <div class="tick" style="height: 59px;"><p>$50,000</p></div> <div class="tick" style="height: 59px;"><p>$40,000</p></div> <div class="tick" style="height: 59px;"><p>$30,000</p></div> <div class="tick" style="height: 59px;"><p>$20,000</p></div> <div class="tick" style="height: 59px;"><p>$10,000</p></div> </div> thanks! add .tick $0 value, , assign border top instead of bottom. then, give #ticks bottom border. css #ticks .tick { border-top: 1px solid #c4c4c4; */ change top /* } #ticks { border-bottom: 1px solid #c4c4c4; */ add bottom bor...

java - Spring rest controller exception handling -

how configure single rest controller handle exceptions different api calls returning different object types? @requestmapping(method = requestmethod.get) public responseentity<foo> method1() @requestmapping(method = requestmethod.get) public responseentity<bar> method2() let's both method1() , method2() throws instance of myexception, need handle them differently following way: @exceptionhandler(myexception.class) @responsebody public responseentity<foo> handlefoo(exception ex) { //return foo error description foo f = new foo(); f.seterror(ex.getmessage()); //set f response entity return new responseentity<>(); } @exceptionhandler(myexception.class) @responsebody public responseentity<bar> handlebar(exception ex) { //return bar error description bar b = new bar(); b.seterror(ex.getmessage()); //set b response entity return new responseentity<>(); } when method1() throws instance of myexcept...

sql - Repeated rows in 'connect by prior' clause in oracle -

i trying understand 'connect prior' clause in oracle. have created below table : create table emp_mgr ( mgr varchar2(10), emp varchar2(10) ) below data of table mgr emp null f f f b f c b x b y now, when run below query select mgr,emp emp_mgr connect prior emp = mgr start mgr null below output of above query: mgr emp null f f f b b x b y f c i understand output completely. problem when execute same query without 'start with' clause getting below output : mgr emp f f b b x b y f c b x b y null f f f b b x b y f c please explain why output repeated. why getting rows when not using start clause

How to post value by javascript/ajax after added elements by dynamicly -

i had success added elements dynamicly javascript using in form new lines. the question how can post values new added lines? added lines successed: var form = '<tr id="package_' + data.custom +'">'; form += '<td><input type="text" class="form-control" name="donate[package_name]" id="package_name_'+ data.custom +'" value="" /> </td>'; form += '<td>'; form += '<select name="settings[currency]" id="currency_'+ data.custom +'" >'; form += '<option value="eur" selected="selected">eur</option> '; form += '<option value="usd">usd</option>'; form += '</select>'; for...

How to call Tensorflow in Azure ML -

i've far seen people using tensorflow in azure using in link . using advantage of ubuntu in windows tensorflow can run on windows pc well.here link . during conversation windows azure engineer hai ning came out "azure ml paas vms use windows os; tensorflow not supported on windows of now." hence there no direct way of running tensorflow in azure ml. there work around figured out allows running tensorflow in azure ml. quick update you. of tensorflow r0.12 there native tensorflow package windows. have running on windows 10 laptop. see blog post google more information.

android - What is the "Galaxy Specials" category for? -

i trying publish apps on samsung seller office . however, first error left category field blank. category available "galaxy specials". when select it, drop down box list of subcategories. don't use of listed features in app. appear samsung apis. want publish same app have on google play in order reach more customers. so question galaxy specials category for? right related samsung-specific apis? if so, do since don't want select of these features?

java - How to change the height of a button and a map when a bottomSheet expands and collapses -

i have app contains button , map , bottom sheet . button set @ top of bottom sheet , when bottom sheet expands hides button. want when bottom sheet expands height of button , map changes same value bottom sheet changed with. (i know value button , map should translated dont know how implement , value 110 dp) collapsed bottom sheet expanded bottom sheet java code controlbutton = (button) findviewbyid(r.id.controlbutton); bottomsheet = findviewbyid(r.id.bottom_sheet); bottomsheetbehavior = bottomsheetbehavior.from(bottomsheet); bottomsheetbehavior.setpeekheight((int) getapplicationcontext().getresources().getdimension(r.dimen.card_view_height)); bottomsheetbehavior.setstate(bottomsheetbehavior.state_collapsed); bottomsheet.setvisibility(view.invisible); card_view_height value need button height change with