Posts

Showing posts from April, 2011

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...

node.js - Meteor picker server side router use express middleware -

i trying use express functions res.send('string') or res.json(json) in meteor rest api using picker server side router. in documentation, says : you can use existing connect , express middlewares without issues. how can use express funtions res.send , res.json ? when try use them, tells me not function. i have following main.js file server : import { meteor } 'meteor/meteor'; import { picker} 'meteor/meteorhacks:picker'; var bodyparser = meteor.npmrequire('body-parser'), methodoverride = meteor.npmrequire('method-override'), logger = meteor.npmrequire('morgan'); picker.middleware(bodyparser.json()); picker.middleware(bodyparser.urlencoded({extended:false})); picker.middleware(logger('dev')); picker.middleware(methodoverride('x-http-method')); // microsoft picker.middleware(methodoverride('x-http-method-override')); // google/gdata picker.middleware(methodoverride('x-metho...

android - startActivityForResult and setResult with RESULT_OK does not work -

i'm not sure if expected behavior, if following in oneactivity launch twoactivity : intent intent = new intent(this, twoactivity.class); startactivityforresult(intent, result_ok); and in twoactivity when pass oneactivity : intent resultintent = new intent(); resultintent.putextra(source, tag); setresult(result_ok, resultintent); finish(); with above code , after overriding onactivityresult in oneactivity nothing happens. onactivityresult doesn't seem called. if, however, change result_ok 0 , works. is expected? has else experienced that? check out docs definition of startactivityforresult method. says: requestcode int: if >= 0, code returned in onactivityresult() when activity exits. so request code should >= 0. if check value of result_ok response code, it's -1. it's important note request code isn't same result code. request code serves identify request result for, , result code tells if request successful or not. ...

node.js - React is not defined ReferenceError? I am using webpack and webpack-dev-server -

Image
this jsx : var react = require('react'); var reactdom = require('react-dom'); reactdom.render( <h1>hello world</h1>, document.getelementbyid('content') ) i build webpack build/bundle.js & import bundle.js index.html index.html: <!doctype html> <html> <head> ┊ <meta charset="utf-8"> ┊ <meta name="viewport" content="width=device-width"> ┊ <title></title> </head> <body> ┊ <div id="content"></div> ┊ <script src="./build/bundle.js" type="text/javascript" charset="utf-8"></script> </body> </html> but when ran webpack-dev-server , chrome console error: bundle.js:57 uncaught referenceerror: react not defined sure, have run npm install react how can fix it?(-_-)ゞ゛ you should add app.js not .jsx var react = require('react'...

javascript - jQuery target parent of hidden element on hover (or not) -

i'm trying add class (or css) a , parent of hidden ul , shows when grand-parent li hovered. can't change code directly result, need jquery. code goes this: html <nav class="main-menu"> <ul> <li> <a> <ul class="sub-menu"> css .main-menu .sub-menu {display: none;} .main-menu li:hover .sub-menu {display: block;} .hovered {color: red;} and here i'm trying jquery, doesn't work: jquery jquery(".nm-main-menu ul.sub-menu).hover(function(){ jquery(this).parent().addclass("hovered"); }); here in fiddle . maybe .hover() not way go... please help. jquery(".nm-main-menu ul.sub-menu").hover(function(){ jquery(this).parent().addclass("hovered"); }); you missed double quote inside selector. it's working. fiddle: https://jsfiddle.net/gyowv1dx/1/

php - how to increse upload file size into mysql -

$name=$_files['file']['name']; $temp=$_files['file']['tmp_name']; move_uploaded_file($temp,"upload1/".$name); $url="video/upload/$name"; mysql_query("insert video (name,url) values('$name','$url')"); you modified php.ini. post_max_size = 25m just change php.ini(xampp/php/php.ini) file, worked me. memory_limit = 1000m post_max_size = 750m upload_max_filesize = 750m max_execution_time = 5000 max_input_time = 5000 and, don't forget restart mysql module xampp control panel

javascript - Pre-fill new email with user location -

i want send email user. when user clicks link on email should open new email current location (latitude , longitude) in email. have not scripted on it. idea on how should proceed user location link in email helpful. if you're looking easyest way send email (no smtp or third party apis involved), consider using mailto: scheme.

eclipse - I am getting error "java.lang.NullPointerException" -

i using selenium webdriver testing web application. using marioette driver same havin firefox 48.0 since yusing same web page gets open not able put values in text box gives error " java.lang.nullpointerexception" have written code @beforetest public void setup() throws exception { system.setproperty("webdriver.gecko.driver", "d:\\ashwini\\geckodriver.exe"); driver= new marionettedriver(); driver.manage().timeouts().implicitlywait(30, timeunit.seconds); } @test public void testaddaccount() throws exception { driver.get("http://qa.luna.wexeurope.com/cpcardweb/login.htm?programme=cpycgb"); driver.findelement(by.id("username")).clear(); driver.findelement(by.id("username")).sendkeys("cp_admin"); } @aftertest public void teardown() { driver.quit(); } output is: 1472448949884 marionette info sendasync 374...

jquery - Select2 does not complete the model's value (returns null as property value) -

i use select2 id , name of 1 of properties in model. data source view bag. (it works correctly) i want set selected value default based on dropdown change. (it works correctly, too) but after form submit, value of property null (if select dropdown value clicking works well) in controller have: viewbag.defaultairport = defualtairport.value; // example: "1" and in view have: <select id="destination" name="destination" class="select2" style="width: 100%; padding: 3px;"> @foreach (var airport in (list<selectlistitem>) viewbag.airports) { <option value="@airport.value"> @airport.text </option> } </select> and in scripts: function setorgindistination(elementvalue) ...

Java application access to azure keyvault : steps to generate auth token via client certificate -

i have referred following guides setup ad certificate based application connect azure keyvault https://azure.microsoft.com/en-us/documentation/articles/key-vault-use-from-web-application/ http://www.rahulpnath.com/blog/authenticating-a-client-application-with-azure-key-vault/ http://kamranicus.com/blog/2016/02/24/azure-key-vault-config-encryption-azure/ we have java application running on linux platform , plan call azure keyvault rest api via certificate based authenticate. do have java based sample snippet generate token via certificate stream ie certificate saved string , passed on fly token generation api. examples in above links assume installed in store @yogeshorai, according description & previous threads, think sample code in java azure sdk blog want & simple way current scenario, not authenticate certificate access token.

How to explore audit workbench through fortify software security center? -

how explore fortify audit workbench software security centre? can auditing capabilities in ssc in audit workbench? static code analyzer (sca) command line program run on developer workstation or run on development or test build server. typically use sca scan code (via sourceanalyzer or sourceanalyzer.jar) , generate fortify project reports (fpr) file. can open fpr file audit workbench or upload ssc, can track trends, risk posture, etc. audit workbench (awb) installed on desktop sca; graphical application allows review scan results, add audit data, apply filters, , run simple reports. awb gives results of particular scan. in contrast, ssc provides history of applications , other applications using ssc (given appropriate access permissions). the ssc web-based repository of fpr files , tool managing our portfolio's application security. java war installed tomcat or favorite application server. reports on ssc better suited running centralized metrics. can report on res...

ios - Shadow Issue for UITableViewCell -

Image
i have custom uitableviewcell , wrote shadow code in layoutsubviews method: -(void)layoutsubviews { [super layoutsubviews]; self.layer.shadowcolor = [uicolor blackcolor].cgcolor; self.layer.shadowoffset = cgsizemake(0, 4.0); self.layer.shadowradius = 4.0; self.layer.shadowopacity = 1.0; } but when run it, instead of having shadow on edge, subviews on cell got shadows, screen shot below, not expecting. i tried self.contentview.layer there wasn't shadows @ all. so do have shadows on bottom edge of cell usual? don't want shadow subviews. update: i added subviews on cell [cell addsubview:xxx]; directly, not on contentview of cell. try one instead of setting shadow in layoutsubview set in cellforrowatindexpath cell.layer.shadowcolor = [uicolor blackcolor].cgcolor; cell.layer.shadowoffset = cgsizemake(0, 4.0); cell.layer.shadowradius = 4.0; cell.layer.shadowopacity = 1.0;

PHP ZipArchive addFile stopped working -

i have following code running quite time now: $thisdir = "$_server[document_root]/webroot/uploads/user_uploaded_files/"; if( !empty( $files ) ){ $destination = 'uploads/zip_files/meeting_' . $meetingid .'.zip'; $zip = new ziparchive(); $zip->open( $destination, ziparchive::create | ziparchive::overwrite ); //add uploaded files ( $file = filename.ext ) foreach( $files $file ){ if(file_exists( $thisdir . $file )){ $zip->addfile('/uploads/user_uploaded_files/' . $file, $file); } } however, had stopped working (not sure of previous, current version 7.0.9 ). foreach loop runs previously, file_exists returns true , no files being added archive. did experience too? or guidance appreciated. you should test if $zip->open worked : $res = $zip->open($destination, ziparchive::create | ziparchive::overwrite); if ($res) { foreach ($files $file) { ...

php - Facebook login - URL blocked -

i have option users sign via facebook. i'm using socialite package. works fine on local server, in production getting error says url blocked. know url needs assigned in facebook application, , i've entered (for example myapp.com/redirect). when click login button, in browser uri: uri=http%3a%2f%2flocalhost%3a8000% ... can change myapp.com ? i've set application production mode in config/app.php, , app_url http://myapp.com ... problem remains...

soap - How to add response code to response XML in Java web service using Eclipse IDE? -

i have made web service using eclipse ide. request xml being generated when use soapui test it. <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fil="http://files/"> <soapenv:header/> <soapenv:body> <fil:servicecall2> <!--optional:--> <arg0>71896</arg0> <!--optional:--> <arg1>test10</arg1> <!--optional:--> <arg2>pdf</arg2> </fil:servicecall2> </soapenv:body> </soapenv:envelope> this response xml on accessing service parameters <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <ns2:servicecall2response xmlns:ns2="http://files/"/> </s:body> </s:envelope> i want java code can add response code tags in response xml. ...

Oracle server encoding and file encoding -

i have oracle server dad defined plsqlnlslanguage danish_denmark.we8iso8859p1. i have javascript file loaded in browser. javascript file contains danish letters æøå . when js file saved utf8 danish letters misencoded. when save js file utf8-bom or ansi letters shown correctly. i not sure wrong. try set dad plsqlnlslanguage danish_denmark.utf8 or better plsqlnlslanguage danish_denmark.al32utf8 when save file ansi typically means "windows codepage 1252" on western windows, see column "ansi codepage" @ national language support (nls) api reference . cp1252 similar iso-8859-1, see iso 8859-1 vs. windows-1252 (it german wikipedia, table shows differences better english wikipedia). hence 100% correct setting have set plsqlnlslanguage danish_denmark.we8mswin1252 . now, why correct characters when save file utf8-bom , although there mismatch .we8iso8859p1 ? when browser opens file first reads bom 0xef,0xbb,0xbf , assumes file enco...

java - RESTEasy - Best practices to override service method to implement some generic logic across the different methods (like in servlet) -

ex: have common logic across different resources @path("/rest") public class adduser { @get @path("/adduser/{ext}/{userid}") @produces(mediatype.application_json) public string adduser(@pathparam("tenantid") string tenantid, @pathparam("userid") integer userid) { //i have common logic here } @path("/newrest") public class adduser1 { @get @path("/adduser/{ext}/{userid}") @produces(mediatype.application_json) public string adddifferentuser(@pathparam("tenantid") string tenantid, @pathparam("userid") integer userid) { //i have same common logic here } } which class can extend overwrite common logic bot rest services? overriding service method not recommended should override service ? take @ containerrequestfilter extension interface implemented container request filters. can handle common logic here.

java - Exception in thread "main" com.google.api.client.auth.oauth2.TokenResponseException: 401 Unauthorized -

i tried example given here. https://developers.google.com/sheets/quickstart/java its giving me exception - exception in thread "main" com.google.api.client.auth.oauth2.tokenresponseexception: 401 unauthorized @ com.google.api.client.auth.oauth2.tokenresponseexception.from(tokenresponseexception.java:105) @ com.google.api.client.auth.oauth2.tokenrequest.executeunparsed(tokenrequest.java:287) @ com.google.api.client.auth.oauth2.tokenrequest.execute(tokenrequest.java:307) @ com.google.api.client.auth.oauth2.credential.executerefreshtoken(credential.java:570) @ com.google.api.client.auth.oauth2.credential.refreshtoken(credential.java:489) @ com.google.api.client.auth.oauth2.credential.intercept(credential.java:217) @ com.google.api.client.http.httprequest.execute(httprequest.java:868) @ com.google.api.client.googleapis.services.abstractgoogleclientrequest.executeunparsed(abstractgoogleclientrequest.java:419) @ com.google.api.client.googleapis.services.abstractgoogleclie...

pyqt - How to change style in Qt5qt -

i writing qt5 application using pyqt. understand how change style of entire application. the old qt4 calls like app = qapplication(sys.argv) app.setstyle(qstylefactory.create('cleanlooks')) as suggested here nothing. are deprecated? https://blog.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/ thank you! may cleanlooks no longer available on system. qstylefactory.keys() can ask available styles on system. on ubuntu 16.04 , pyqt5 get: ['windows', 'gtk+', 'fusion'] edit: here find qstyleplugin containing 6 additional styles, have compile yourself edit: on ubuntu 16.04, python3.5 got working installing styleplugins qt5 , compile pyqt5 source against qt5: install qt 5.7 onlineinstaller in installationdirectory search qmake , in case /opt/qt/5.7/gcc_64/bin/qmake download qtstyleplugin arbitrary directory git clone https://code.qt.io/qt/qtstyleplugins.git , install it: cd qtstyleplugins /opt/qt...

sitecore8 - Sitecore 8 WFFM - Send Email on Save Actions Error -

Image
i added 1 web form(get our newsletter ) using component experience editor,subscribe button save actions using "send email message". screen 1: screen 2: in web config file <setting name="mailserver" value="smtp.gmail.com" /> <!-- mail server user if smtp server requires login, enter user name in setting --> <setting name="mailserverusername" value="info@xyz.com" /> <!-- mail server password if smtp server requires login, enter password in setting --> <setting name="mailserverpassword" value="xxxxx" /> <!-- mail server port if smtp server requires custom port number, enter value in setting. default value is: 25 --> <setting name="mailserverport" value="587" /> and added below code (or without ) of config file: <system.net> <mailsettings> <smtp deliverymethod="netwo...

ios - How to build this layout in Swift -

Image
i'm working on app has 1 page should image @ top , table underneath it. thing when scroll, want scroll, including image . best approach this: a scrollview image view , table view ? create kind of static cell in tableview image? does know examples? appreciated! best way use uitableviewcontroller. can implement cells , efficiency. drag , drop imageview on top of tableview in uitableviewcontroller. can place right between tableview , top want.

etl - How to use parameters using parameter file in Informatica Cloud? -

can 1 tell me how parameterization using file in informatica cloud? i've created parameter , assigned in filter , configured parameter file under userparameters folder.. while executing mapping configuration task.. i'm facing below error: te_7002 transformation stopped due fatal error in mapping. expression [salesamount=$$salesamt] contains following errors [<<pm parse error>> [=]: function cannot resolve operands of ambiguously mismatching types. ... salesamount=>>>>$$salesamt<<<<]. the content of parameter file is [global] $$salesamt=2500 pls let me know, correct way use parameter file in informatica cloud, if above 1 wrong. you not need global in informatica cloud par file.just mention parameter value in parameter file. $$salesamt=2500

ios - NSFetchedResultsController inserts the same cell into two sections only when controller is about to insert another section -

Image
this message.swift file: @objc(message) class message: nsmanagedobject { @nsmanaged var content: string @nsmanaged var createdat: nsdate @nsmanaged var identifier: int64 @nsmanaged var conversation: conversation @nsmanaged var sender: contributor var normalizedcreatedat: nsdate { return createdat.datewithdaymonthandyearcomponents()! } } this how setup frc: private func setupfetchedresultscontroller() { let context = nsmanagedobjectcontext.mr_defaultcontext() let fetchrequest = nsfetchrequest(entityname: "message") let createdatdescriptor = nssortdescriptor(key: "createdat", ascending: true) fetchrequest.predicate = nspredicate(format: "conversation.identifier = %lld", conversation.identifier) fetchrequest.sortdescriptors = [createdatdescriptor] fetchedresultscontroller = nsfetchedresultscontroller(fetchrequest: fetchrequest, managedobjectcontext: context, sectionnamekeypath: ...

select data based on a string criteria python -

i have large database in want select columns meet criteria: my data looks following: name b c target-01 5196 24 24 target-02 5950 150 150 target-03 5598 50 50 object-01 6558 44 -1 object-02 6190 60 60 i want select data name starts target . so selected df be: target-01 5196 24 24 target-02 5950 150 150 target-03 5598 50 50 i reading data using: data = pd.read_csv('catalog.txt', sep = '\s+', header = none, skiprows =1 ) how can select data want? use str.startswith , boolean indexing : print (df[df.name.str.startswith('target')]) name b c 0 target-01 5196 24 24 1 target-02 5950 150 150 2 target-03 5598 50 50 another solution str.contains : print (df[df.name.str.contains(r'^target')]) name b c 0 target-01 5196 24 24 1 target-02 5950 150 150 2 target-03 5598 50 50 last so...

database - Functional dependency vs one-to-many (or many-to-many ) relationships -

i understand what 1) fd (functional dependency) is --> b i.e value a1 in there corresponding unique value b1 in b. 2) , in one-to-many relationship, value a1 in there 1 or more corresponding values i.e. b1 or b1, b2, b3 etc in b. question on one-to-may part. q1) there other name relationship in normalization terminology. ( mvd can come in picture, can ignore while speaking 1 set of data unless rest considered null. ) q2) one-to-many relationship fd (or mvd - clarifying, otherwise ignore this) ?? might crazy ask this. there lot of relationship here between , b values of b still determined , come problem domain (which in other words ... functional world). ex -a student still determines courses want enroll. might still have freedom enroll 5 or 7 course cardinality . still student , student determines course ( , how many of them.) or in other words - one-to-many says "cardinality" relationship itself. call what? (can still called functional or thing else...

redis - RedisCache.putIfAbsent is not setting the TTL on the element -

i using rediscache.putifabsent operation of spring-data-redis-1.6.2.release.jar set element value atomically along ttl value. this how generate cache manager instance public cachemanager dsynccachemanager() { rediscachemanager rediscachemanager = new rediscachemanager( redistemplate() ); rediscachemanager.setdefaultexpiration(defaultexpiretimeseconds); return rediscachemanager; } this how call method cache.putifabsent( key, value ); however, when go , check ttl of given key in redis, value returned -1 , not expected ttl used.

stanford nlp - nlp - How do I identify if a part of sentence is an answer to Who, What, How or Why? -

i'm trying assign every word in sentence role: actor, predicate, who, what, where, when, how or why. for example, "the robot brought me orange juice" should tagged "the/ actor robot/ actor brought/ predicate me/ who an/ what orange/ what juice/ what ." i'm able detect actor, predicate, , when using semantic role labelling. i'm having problem who, what, how , why. is there tool in nlp identifies if phrase in sentence answer w-question? how tell if noun person or thing? i know there name entity recognition, identifies proper nouns. tells obama person, not teacher person. i think looker part-of-speech tagger. have added standford-nlp-tag give standford-pos-tagger link: http://nlp.stanford.edu/software/tagger.shtml for more details how tagging done take @ documentation. on basis on tags can answer questions who/whom/what etc.. in case: x brought y z -> article "an" determines x active/nominative, y passive/...

Using spring-boot Gradle plugin but getting spring boot version from dependency management -

i have gradle setup need hard code spring-boot version. possible dependency management instead? issue occurs in project module contains actual code. there need call : springboot { requiresunpack = ["com.example:util"] } in order need apply spring-boot plugin . plugin available need have dependency "org.springframework.boot:spring-boot-gradle-plugin:${springbootversion}" . , need specify springbootversion hard coded... this parent gradle file: buildscript { ext { springbootversion = '1.4.0.release' } repositories { mavencentral() jcenter() } dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:${springbootversion}" classpath 'io.spring.gradle:dependency-management-plugin:0.6.0.release' } } plugins { id "io.spring.dependency-management" version "0.6.0.release" } group 'test' repositories { mavencent...

javascript - how to use google sign-in in a website? -

i want add google sign-in in website, created google developer console client id , found official tutorial here https://developers.google.com/identity/sign-in/web/sign-in shows how done, did same way tutorial shows here nothing, mean button doesn't appears in browser when run code. here code: <!doctype html> <html lang="en"> <head> <title>login google account using javascript codexworld</title> <meta name="google-signin-client_id" content="921258372597-t5jrb0e9p4ivstp9mfi972lhcvfcuo59.apps.googleusercontent.com"> <script src="jquery.min.js"></script> <script src="https://apis.google.com/js/client:platform.js?onload=renderbutton" async defer></script> <style> .profile{ border: 3px solid #b7b7b7; padding: 10px; margin-top: 10px; width: 350px; background-color: #f7f7f7; height: 160px; } .profile p{margin: 0px 0px 10px 0px;} .head{margin-bottom: 10px;} .hea...

java - How to create composite primary key scenario in Gemfire region? -

i working on migration of mainframe java. have 1 table in db2. replicating table region in gemfire. while doing this, have composite primary key table. replicate table gemfire region. want make composite primary key region. want know that, there possibility create composite primary key in region? ideally, creating keys not change in value after key/value pair "put" region. gemfire/geode region glorified version of java.util.map (and hashmap precise). this means "composite" key should not based on property values in region value itself. way of example, imagine have value customer defined so... class customer { long accountnumber; gender gender; localdate birthdate; string firstname; string lastname; ... } it inadvisable create key so... class customerkey { localdate birthdate; string firstname; string lastname; } while person's birth date, first , last name enough uniquely identify someone, if of these individ...

Android : Recorded message as input in edittext -

i working on project want recorded audio message input in edittext whatsapp . please help. basically pressing audio icon in whatsapp showing recording audio part of view animation.where there 2 views 1 edittext , other audio capturing view. for audio capturing, have use mediarecorder class of andriod. here link how capture audio in android: https://developer.android.com/guide/topics/media/audio-capture.html hope give idea resolve problem.

phalcon - Missing 'className' parameter -

i working on old project change request , project developed in phalcon 1.2.6 verson. when trying execute application application returns error. after doing r&d found system did not find config key $di object. when trying print $di object it's printing key config. when trying access config key, unable access it. when system tries execute below code, throws exception. $di = \phalcon\di::getdefault(); print_r($di['config']); i getting below error. invalid service definition. missing 'classname' parameter #0 [internal function]: phalcon\di\service\builder->build(object(phalcon\di\factorydefault), array, null) #1 [internal function]: phalcon\di\service->resolve(null, object(phalcon\di\factorydefault)) #2 [internal function]: phalcon\di->get('config', null) #3 /var/www/sites/mfs_merged/apps/api/module.php(44): phalcon\di->offsetget('config') #4 [internal function]: appserver\api\module->registerservices(object(phalcon\di\...

angularjs - docker hub api giving No 'Access-Control-Allow-Origin' error -

i'm trying fetch list of official images docker hub using v2 api. if try curl or use postman, response correctly, when try fetch list using angularjs service, following error xmlhttprequest cannot load https://hub.docker.com/v2/repositories/library/?page=8&page_size=15 . no 'access-control-allow-origin' header present on requested resource. origin ' http://run.plnkr.co ' therefore not allowed access. can suggest solution this. how can enable cors this? cors enabled on server side, , not case. : 1) use proxy, instance ngnix, , make sure request made localhost/whatever redirected hub.docker.com . way can "cheat" cross-origin block 2) if need temporary , dirty solution more install chrome/safari plugins bypass cors security check

How to Install Mondrian? -

i trying install mondrian on os x el capitan. file downloaded official mondrian website .jar file whereas official document talks .war file. can guide me on how proceed? the .war project discontinued check following reference: http://rpbouman.blogspot.mx/2016/03/need-mondrian-war-checkout-xmondrian.html

NativeScript No provider for Http -

am following nativescript groceries typescript angular tutorial , got stuck in chapter 3 following errors. exception: error in ./appcomponent class appcomponent_host - inline template:0:0 original exception: no provider http! original stacktrace: error: di exception @ noprovidererror.baseexception [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/facade/exceptions.js:27:23) @ noprovidererror.abstractprovidererror [as constructor] (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_exceptions.js:43:16) @ new noprovidererror (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_exceptions.js:80:16) @ reflectiveinjector_._throwornull (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/src/di/reflective_injector.js:786:19) @ reflectiveinjector_._getbykeydefault (/data/data/org.nativescript.groceries/files/app/tns_modules/@angular/core/s...

scala - Understanding flatMap declaration in List -

i looked @ list.flatmap declaration , kind of surprised this. final override def flatmap[b, that](f: => gentraversableonce[b]) (implicit bf: canbuildfrom[list[a], b, that]): where object list defines: implicit def canbuildfrom[a]: canbuildfrom[coll, a, list[a]] = reusablecbf.asinstanceof[genericcanbuildfrom[a]] so, if invoke flatmap on list list , don't see point in that type if deduced list[b] (because of implicit ). so, if invoke flatmap on list[a] list[a] , don't see point in that type if deduced list[b] one thing you're missing flatmap isn't defined on list[+a] . inherited traversablelike , trait used of scalas collections. each of them can supply implicit canbuildfrom may overridden supply different resulting collection. if want little taste of can custom canbuildfrom : scala> :pa // entering paste mode (ctrl-d finish) import scala.collection.generic.canbuildfrom import scala.collection.immut...

wpf - C# Async window showing after all code was running -

i trying implement "loading window" wpf-application should shown when client wants send message server , should closed after responce received. use async methods, should not big problem, somehow window shows after response received , closes instantly (as expected). here code snippets public async task<communicationmessage> sendandreadmessagesync(string message, bool showloadingscreen = true) { // show loading screen if needed if (showloadingscreen == true) { await globals.messagecontroller.showloadingscreen(); // method second 1 } // send message server sendmessagesync(message); // receive response server communicationmessage response = readmessagesync(); // close loading screen if (showloadingscreen == true) { await globals.messagecontroller.closeloadingscreen(); } // return response return response; } public async task sho...

How do i create custom event in javascript with out using DOM -

i have 2 objects. objeca triggers event e , objectb has listen event triggered objecta (e) . objecta sends when property in changes @ run time. thanks in advance. you can use pubsub pattern var pubsub = {}; (function(myobject) { // storage topics can broadcast // or listened var topics = {}; // topic identifier var subuid = -1; // publish or broadcast events of interest // specific topic name , arguments // such data pass along myobject.publish = function(topic, args) { if (!topics[topic]) { return false; } var subscribers = topics[topic], len = subscribers ? subscribers.length : 0; while (len--) { subscribers[len].func(topic, args); } return this; }; // subscribe events of interest // specific topic name , // callback function, executed // when topic/event observed myobject.subscribe = function(topic, func) { if (!topics[topic]) { to...