Posts

android - Firebase Cloud messaging no sound/vibration -

i'm using firebase send notifications app(ios , android). i'm not keen on using data fields send notifications because ios didreceiveremotenotification doesn't called when user has force quit app. i've tried setting "sound" sorts of things including default , null i'm not getting sounds/vibrations on either devices. thanks. there minor issue. placing sound in root of json payload. while, had inside notification object. firebase should have number of example payloads in documentation.

reactjs - Angular2 shared observable -

doing experimentation angular2 , curious how solve situation service exposes shared observable. 1 component responsible getting data , responsible displaying data. here code: the common httpservice responsible getting data import { injectable } '@angular/core'; import { http, response } '@angular/http'; import { observable } 'rxjs/observable'; import { subject } 'rxjs/subject'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; @injectable() export class service { subject = new subject<string[]>; observable$ = this.subject.asobservable(); constructor(private http: http) {} observable: observable<string[]>; get(link: string): observable<string[]> { this.observable$ = this.http.get('myapi.com') .map((res: response) => this.subject.next(res.json()) .catch(this.handleerror); return this.observable$; } /** * handle http...

jsf 2 - How to customize database unique constraint error message in JSF -

i have name uni constraint, , when user registers duplicate name, throws exception: caused by: java.sql.sqlintegrityconstraintviolationexception: duplicate entry 'john' key 'uk_t622yodh32su1s2wseebkimwp' in jsf view page, exception caught exception handler displayed user: duplicate entry 'john' key 'uk_t622yodh32su1s2wseebkimwp' code: public void register (student student) { ... catch (exception e) { string errormessage = getrooterrormessage(e); facesmessage m = new facesmessage(facesmessage.severity_error, errormessage, "registration unsuccessful"); facescontext.addmessage(null, m); } } private string getrooterrormessage(exception e) { string errormessage = "registration failed."; if (e == null) { return errormessage; } throwable t = e; while (t != null) { errormessage = t.getlocalizedmessage(); ...

css - Button to match height of field? -

i trying buttons same height field... must missing obvious @ moment because heights different on each browser: jsfiddle input { font-size:16px; padding:8px; display:inline-block; border:1px solid #ccc; box-shadow:inset 0 1px 3px #ddd; border-radius:0px; vertical-align:middle; box-sizing:border-box; line-height:20px; } button { font-size:16px; display:inline-block; background:#ffffff; border: 1px solid #ccc; cursor:pointer; color:#b2b2b2; font-weight:700; padding:8px; line-height:20px; vertical-align:middle; box-sizing:border-box; } <button>-</button><input type="text"/><button>+</button> just set height both button , input: height: 40px; https://jsfiddle.net/v6plqbfz/1/

Swift - what should the default values of properties be in the parent class? -

not sure if worded question correctly, here's issue: have base class , subclass, , base class should never instantiated on own (in other languages abstract). know abstract classes aren't thing in swift. have computed read-only properties change return in each subclass; more or less customized constants. firstly, overridden computed properties best way handle kind of thing? secondly, if these variables need initialized, i.e. can't nil, should initialized in parent class? there way otherwise indicate parent class shouldn't initialized on own? you should use protocol instead of base class in case. common implementation can done in protocol extensions , won't need provide default values constants - specify required get methods in protocol.

ssh - ansible - "sudo: a password is required\r\n" -

quick question i have setup ubuntu server user named test. copy authorized_keys it, can ssh no problem. if $ ansible -m ping ubu1 , no problem response <i><p>ubu1 | success => { <br>"changed": false, <br>"ping": "pong" <br>}</i> what dont this, if do $ ansible-playbook -vvvv playbooks/htopinstall.yml fatal: [ubu1]: failed! => {"changed": false, "failed": true, "invocation": {"module_name": "setup"}, "module_stderr": "openssh_7.2p2 ubuntu-4ubuntu2.1, openssl 1.0.2g-fips 1 mar 2016\r\ndebug1: reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: applying options *\r\ndebug1: auto-mux: trying existing master\r\ndebug2: fd 3 setting o_nonblock\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux...

JAX RS - Embedded Jetty and Swagger not getting json -

with below code able call api with: http://localhost:8080/test/myapi/squareroot?input=2 and output { "action":"square root", "input":2.0,"output":1.4142135623730951 } but when try call http://localhost:8080/test/swagger.json i getting 404 error. please me understand error. package com.krish.som.controller; import io.swagger.annotations.api; import io.swagger.annotations.apioperation; import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; import javax.ws.rs.queryparam; import javax.ws.rs.core.mediatype; @path("myapi") @api(value = "/squareroot", description = "web services browse squareroot") public class calculator { @get @path("squareroot") @apioperation(value = "return 1 entity", notes = "returns 1 entity @ random", response = result.class) @produces(value = mediatype.application_json) public result squareroot(@q...