Posts

Showing posts from March, 2010

jsf - When change any input value and submit again no new data displayed to display that it need refresh -

i have primefaces index page: <p:layoutunit position...> <h:form> <p:outputlabel for="txt" value="enter 6 digits"> <p:inputmask id="txt" value="#{bean.txt}" mask="999-999"> <p:inputlabel for="date1" value="choose date:"> <p:calendar id="date1" value="#{bean.date1}"> <p:commandbutton value="submit" actionlistener="#{bean.submit}"/> </h:form> </p:layoutunit> <p:layoutunit position ...> <h:form> <p:datatable var="data" value="#{bean.result}"> <p:column headertext="result"> #{data} </p:column> </p:datatable> </h:form> </p:layoutunit> //class bean.java //the bean sessionscopped private string txt;//setter , getter private date date1; private list<string> result; public list<string> getlist() {return result;} public void submit() {

pentaho - Incorrect page break in Report-designer -

Image
i have report designed pentaho report-designer i'm having many problems having page break in pdf format. this actual structure schema: the first sub-report tittle. , decided put rest of sub-reports inside band use avoid-page-break . have set style attributes in band: avoid-page-break:false layout: block height: 0.0 and sub-reports have avoid-page-break:false , height: 0.0 , too. my problem if text of sub-report doesn't fit in actual page, changes text next one, instead of continuing in same page , change other @ middle of text. thank help.

sql - The SUM of an aggregate COUNT function -

i want create query calculate percentage sales of overall policies in database. policies split under 2 separate headings ul nl the code want should display product name number of policies sold policies sold per product percentage of overall number of policies sold. i have made few attempts @ scripting code (please see below) cannot them run correctly. syntax 1: select b.product_name, b.policies_sold, 100.00*(b.policies_sold/sum(b.policies_sold)) as'perc_sales' ( select a.product_name, count(a.product_name) 'policies_sold' (select product_name [atlantis\jjudge]. [all_policies_201706_nl] union select product_name [atlantis\jjudge]. [all_policies_201706_ul])a group product_name)b ; syntax 2: select a.product_name, a.[policies sold], 100.00*(a.[policies sold]/sum(a.[policies sold])) (select product_name, count(*) 'policies sold'from [atlantis\jjudge].[all_policies_201706_nl] group product_name union sele

c++ - Audio plugins. Mapping MIDI to audio files -

i reasonably experienced programmer pretty inexperienced c++ , brand new creating plugins. thus far have looked http://martinfinke.de/blog/tags/making_audio_plugins.html seems incredibly dated, i'm hitting whole load of compilation issues , don't know legacy sdks mean had exact same set author using. i have looked juce there isn't vast amount of resources out there can find. what trying create plugin, vst (will @ compatibility other vendors later) maps midi input audio file partner, sound engineer, has created. have enough samples randomising , various velocities i highly recommend working way through juce tutorials or watching through juce videos the audio programmer on youtube started on juce. whilst first tutorials not produce audio plugins, components used within them crucial 'building blocks' creating full plugin. when you're happy creating basic gui elements , how audio can played/ synthesised within both audio app , audio plug-in p

python 3.x - ValueError: setting an array element with a sequence in keras using nltk ngram -

from keras.utils import np_utils keras.models import sequential keras.layers import dense keras.layers.recurrent import simplernn sklearn.feature_extraction.text import hashingvectorizer sklearn.feature_extraction.text import countvectorizer sklearn.preprocessing import labelencoder import numpy np text = open('eng.train').read().split() words = [] tags_1 = [] tags_2 = [] in range(len(text)): if % 4 == 0: words.append(text[i]) if % 4 == 1: tags_1.append(text[i]) if % 4 == 3: tags_2.append(text[i]) hashing_vectorizer = hashingvectorizer(decode_error = 'ignore', n_features = 2 **15) x_v = hashing_vectorizer.fit_transform(words) label_encoder = labelencoder() y1 = label_encoder.fit_transform(tags_1) y2 = label_encoder.fit_transform(tags_2) y1 = np_utils.to_categorical(y1) y2 = np_utils.to_categorical(y2) import nltk trigram_x = list(nltk.trigrams(x_v)) #trigram_x = list(trigram_x) print(len(trigram_x)) x = numpy.array(trigram_x)

java - Android: How to send http request via service every 5 seconds -

i want request json data webservices after every 5 seconds. don't want show user i'm doing stuff in service. there no error in code not showing output in log expected. here code: protected void onhandleintent(intent intent) { final string driverid = intent.getstringextra("driverid"); new handler().postdelayed(new runnable() { public void run() { httphandler sh = new httphandler(); // making request url , getting respose string jsonstr = sh.makeservicecall(url + "?cno=" + driverid + "&lat=0&lon=79"); log.e("servicesclass", "response url: " + jsonstr); if (jsonstr != null) { string temp = jsonstr; string finals = temp.replace("<string xmlns=\"http://tempuri.org/\">", ""); log.e(tag, "response url @ service class: " + jsonstr); } e

Why adding multiple 'nan' in python dictionary giving multiple entries? -

example problem: import numpy np dc = dict() dc[np.float('nan')] = 100 dc[np.float('nan')] = 200 it creating multiple entries nan like dc.keys() produce {nan: 100, nan: 200} should create {nan: 200} . the short answer question (of why adding nan keys python dict create multiple entries), because floating-point nan values unordered , i.e. nan value not equal to, greater than, or less anything, including itself. behavior defined in ieee 754 standard floating point arithmetic. explanation why given ieee 754 committee member in answer . for longer, python-specific, answer, let's first have @ how item insertion , key comparison work in cpython dictionaries. when d[key] = val , pydict_setitem() dictionary d called, in turn calls (internal) insertdict() , either update existing dictionary item, or insert new item (maybe resizing hash table consequentially). the first step on insert lookup key in hash table of dictionary keys. general-p

Ionic 3 firebase display data error -

currently able post data firebase, can't data , display in ionic 3 app. shoes.ts file: import { component } '@angular/core'; import { navcontroller, navparams } 'ionic-angular'; import { angularfiredatabase } "angularfire2/database"; import { firebaselistobservable } 'angularfire2/database'; @component({ selector: 'page-shoes', templateurl: 'shoes.html', }) export class shoespage { shoppingitems: firebaselistobservable<any[]>; newitem = ''; getshoppingitems() { return this.afdb.list('/shoppingitems/'); } constructor(public navctrl: navcontroller, public navparams: navparams, public afdb: angularfiredatabase){ this.additem("awesomestuff"); this.getshoppingitems(); alert(this.shoppingitems); } ionviewdidload() { console.log('ionviewdidload shoespage'); } additem(name) { this.afdb.list('/shoppingitems/').push(name); } removeite

c++ - How to link two LLVM bitcode modules? -

i have simple llvm pass renames every function defined within current translation unit (i.e: source file in question, after preprocessing steps have taken place - see here ). pass follows: #include <vector> #include <iostream> #include <fstream> #include <string> #include <sstream> #include "llvm/pass.h" #include "llvm/ir/function.h" #include "llvm/support/raw_ostream.h" #include "llvm/adt/stlextras.h" #include "llvm/adt/smallstring.h" #include "llvm/ir/derivedtypes.h" #include "llvm/ir/module.h" #include "llvm/ir/type.h" #include "llvm/ir/typefinder.h" #include "llvm/transforms/ipo.h" #include "llvm/ir/argument.h" #include "llvm/ir/globalvalue.h" using namespace llvm; namespace { struct functionrename : public modulepass { static char id; // pass identification functionrename() : modulepass(id) {} bool runonmodul

elasticsearch - Custom date format for only 1 index -

i want define custom date format 1 index. actually, have @timestamp field in index in following format, `25/jul/2017:12:41:18 +0530` and elasticsearch has stored string instead of datetime. my other indices in elasticsearch have @timestamp field in correct format i.e, 2017-07-25t15:46:37+05:30 . so, want declare custom format 1 index, other indices should not affected. can ? if yes, please help. you apply custom date format in mapping of specific index ( https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-date-format.html ): i start this: "format": "dd/mmm/yyyy:hh:mm:ss z"

asp.net core mvc - Visual Studio Scaffolded controller actions -

when using "add scaffold" create new "api controller actions, using entity framework" on asp .net core 1.1 web api, generates following: // get: api/users [httpget] public ienumerable<user> getusers() { try { return _context.users; } catch (exception ex) { _logger.logerror(loggingevents.general_exception, ex, ex.message); } } // get: api/users/5 [httpget("{id}")] public async task<iactionresult> getuser([fromroute] int? id) { if (!modelstate.isvalid) { return badrequest(modelstate); } var user = await _context.users.singleordefaultasync(m => m.userid == id); if (user == null) { return notfound(); } return ok(user); } // put: api/users/5 [httpput("{id}")] public async task<iactionresult> putuser([fromroute]

javascript - AngularJS : How to make my Controller variable available on all page context? -

i work angularjs. in 1 of view controller, initialize 1 of variable recipesdata. here controller : (function() { 'use strict'; angular .module('myapp') .controller('cookcontroller', cookcontroller); cookcontroller.$inject = ['$document','$scope','$rootscope','$window']; function cookcontroller ($document,$scope,$rootscope,$window) { var vm = this; var recipesdata = load(); var viewer, ui, building; $scope.load = function () { var data; // create data // .......... return data; }; }; })(); i want make variable recipesdata global. have external script expects variable initialized. <script src="https://myexternal/lib/js/script.js"></script> how make global or make available script imported on head ? variable initialized controller. thanks you can using roots

mysql - Querying SQL using Php and outputting geojson for a GeoPolygon -

output geojson geo polygon in php stored in mysql database i have tried many things including geophp plugin https://geophp.net/geos.html no success far, tried using st_asgeojson no use $sql = "select st_asgeojson(st_geomfromtext('coordinates')) buildings id = 1"; https://dev.mysql.com/doc/refman/5.7/en/spatial-geojson-functions.html i trying achieve output similar "shape":{"type":"polygon","coordinates":[[[53.294974,-6.426631],[53.294847,-6.426419],[53.294289,-6.426888],[53.294326,-6.427194],[53.294974,-6.426631]]]} this insert statement - insert `mrp_buildings` ( `buildingid`, `companyid`, `name`, `nooffloors`, `coordinates`, `city`, `country`, `address`, `phone`, `email`) values ( '1', '1', 'my sample building', '4', polyfromtext('polygon((33.294974 -2.426631, 53.294847 -6.426419, 73.294289 -6.426888, 13.294326 -6.427194, 43.294974 -6.426631, 33.

ios - iOS10 UILabel use NSLineBreakByCharWrapping has half character ,how to fix it? -

Image
this uilabel show half character!!! this uilabel attribute!!! the linebreaking working if label have chance break line. "lines" set 1, there no chance. set lines 0 (auto) or @ least 2 , work.

typescript - Angular 2 : form, when book option, start and end date are not needed -

html: <md-select placeholder="type" required [(ngmodel)]="request.type" (ngmodelchange)="valuedateneeded()"> <md-option *ngfor="let type of requesttypes" [value]="type.value"> {{type.name}} </md-option> </md-select> i want value of option chosen. link valuedateneeded() can set true or false depending on value , can show or not show div. you need use [(ngmodel)] example component.ts public variablestore: any; component.html <select [(ngmodel)]="variablestore"> <option value="1">1</option> </select the value inside variablestore

rxjs - Angular 2 : merge several http calls into one -

i have service used upload pictures. upload picture, return this.http.post(/* ... */) and subscription can subscribe in component. when want upload several pictures, have for (let p of pics) { this.http.post(/* ... */); } my problem return results of all calls instead of 1 call. possible ? edit here service addpictures(files: file[], folder: string): observable<parse.object[]> { let haserror = false; (let file of files) { let [type, ext] = file.type.split('/'); if (type.tolowercase() !== 'image' || !environment.imgexts.includes(ext.tolowercase())) { haserror = true; } } if (haserror) { return observable.throw('invalid extension detected'); } let observables: observable<parse.object>[] = []; (let file of files) { // size let img = new image(); img.onload = () => { // create parse document let parseimg = { url: '', type: file.type, width: img.width, height: img.height }; /

web scraping - Using an API for web scrapping -

for summer project, trying extract particular information website. upon doing research, came across concept of 'api' perform this. beginner, understand api can used communicate website in question. the website want scrape information not provide own api. came across great tool called wrap api . tool builds api on top of website. question once have api, how data website? perhaps not understand whole concept of api project. end result want build ui such user can query data he/she requires website. sorry wordy question. novice @ this, , love learn more. highly appreciated. i think if want scraping (i mean data html page) can without api or implement api call , return data: that's api concept know (so little things), ask , api returns ting , status code. code (javascript), it's function: var uni_e = function scrape_events_uni() { //passo l'url da prendere var url = 'http://webmagazine.unitn.it/calendario/ateneo/week'; //invio una richiesta

php - Paypal IPN always returning INVALID response -

i trying use paypal ipn functionality core php code had earlier codeigniter, getting invalid response. file_get_contents('php://input') giving me: mc_gross=0.10&protection_eligibility=ineligible&payer_id=9bdrp2hmjuemq&tax=0.00&payment_date=03%3a42%3a59+jul+25%2c+2017+pdt&payment_status=completed&charset=utf-8&first_name=name&mc_fee=0.10¬ify_version=3.8&custom=admin&payer_status=verified&business=email&quantity=1&payer_email=payer&verify_sign=afcwxv21c7fd0v3byyyrcpssrl31asrrua67d5tur8-3cwnzhuuvbyid&txn_id=36t014537e793324n&payment_type=instant&payer_business_name=test+store&last_name=singh&receiver_email=receiver&payment_fee=0.10&receiver_id=g92pv2rjm9jbg&txn_type=web_accept&item_name=manual+emw+payment&mc_currency=usd&item_number=manual+emw+payment&residence_country=gb&test_ipn=1&handling_amount=0.00&transaction_subject=&payment_gross=0.10&shipp

javascript - AcceptedFileType in php-dropzone does'nt work -

Image
i have changed accepted file type in form-dropzone.min.js , dropzone.in.js files, image/* , application/pdf(also tried .jpeg, .png, .jpg etc), still types of files accepted. looking @ validating file type similar

Enable JMX thorough HADOOP Job api -

i want connect map , reduce tasks through jmx. how pass them jvm start-up flags -dcom.sun.management.jmxremote.port=9010 ..to map , reduce tasks? if run below command, add properties mapper/reducer task jvm. -d mapreduce.map.java.opts="-dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.port=9010 -dcom.sun.management.jmxremote.local.only=true-dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.ssl=false" -d mapreduce.reduce.java.opts="<same map>"

Adding framework class along with source code in Android -

i found github project based on reflection using 1 of directory in android framework. have added sample image below. can tell me how possible? image in link https://i.stack.imgur.com/hsssb.png

VBA Access: No value given for one or more required parameters -

i know, there lots of answers out there problem should trivial, did not find right one. here problem: open record set following select statement: select twinecellar.produktnavn, twinecellar.land, twinecellar.produkttype, twinecellar.Ã¥r, twinecellar.antall, twinecellar.poeng, twinecellar.picture, twinecellar.kr, twinecellar.poengsum, twinecellar.sum twinecellar (((twinecellar.land)=forms!fmainview!list13) , ((twinecellar.produkttype)=forms!fmainview!list15)) order twinecellar.poeng; in immidiate window see list 13 contains "france" , list 15 contains "red" when create new query statement, it's working, however, on rst.open gsstrquery error. gsstrquery contains select string. here code: dim conn adodb.connection dim rst adodb.recordset set conn = currentproject.connection set rst = new adodb.recordset rst.cursortype = adopendynamic rst.activeconnection = conn rst.open gsstrquery anybody out there idea issue? when build sql stri

php - Array merge with same key's dont' overwrite -

so have following 2 arrays, keys 2016 , 2017 array(2) { [2016]=> array(11) { ["id"]=> string(1) "0" [0]=> string(1) "0" ["user_id"]=> string(1) "0" ["entry_id"]=> int(0) ["user_name"]=> string(0) "" [3]=> string(0) "" ["action"]=> string(11) "banner view" [4]=> string(11) "banner view" ["entry_details"]=> string(0) "" ["created"]=> string(4) "2016" ["total"]=> int(0) } [2017]=> array(11) { ["id"]=> string(1) "0" [0]=> string(1) "0" ["user_id"]=> string(1) "0" ["entry_id"]=> int(0) ["user_name"]=> string(0) "" [3]=> string(0) "&qu

c++ - Windows Errorcode : 298 for Bounded buffer solution in vc++ -

i have encountered bounded buffer problem in project, solving this, im using 2 semaphores full , empty. write operation waits empty semaphore signal , signals full semaphore after finishing write. read operation waits full semaphore signal , signals empty semaphore after read. since im using blocking calls read , write, each read , write happens in sequence. i'm implementing in vc++ in windows, im facing windows errorcode:298 while signalling empty semaphore says many posts made semaphore. what possible causes error 'too may posts made semaphore' ? list item semaphore creation: string semname = m_mqname; semname.append(semaphore_full_name_suffix); cout<<"\n <messagequeue<dtype, size>::createmsgqsemaphores ()> semaphore name = "<<semname<<endl; m_mqfullsemaphore = createsemaphore( null, // default security attributes 0, // initial count size,

ios - UIScrollView contentOffset animates to another point -

good day, i'm facing wired behavior in uiscrollview here. i'm implementing custom circular uiscrollview , in point i've set origin of scroll view point scrollview.setcontentoffset(cgpoint(x: 0, y: 0), animated: false) after change content offset using animation specific point scrollview.setcontentoffset(cgpoint(x: point, y: 0), animated: true) the problem although point correct (ex. 400) scrollview jumps point code following should print 10 if point = 10 prints other values. scrollview.setcontentoffset(cgpoint(x: point, y: 0), animated: true) dispatchqueue.main.asyncafter(deadline: .now() + 1, execute: { print("current x: \(self.tabsscrollview.contentoffset.x)")}) although made sure no other animation in progress. i found suggesting uiview.animate(withduration: 0.5, animations: { self.scrollview.contentoffset.x = point }) and surprisingly did work, no

CSS is loaded but not applied via webpack -

i'm setting webpack extract .css , .scss files 1 large file done using extract-text-webpack-plugin . can see file correctly compiled , included html (created html-webpack-plugin ). reason css not applied actual page. entry entry: { app: [ 'react-fastclick', './js/index.js', ], styles: './styles/global.scss' } rules rules: [ { test: /\.scss$/, use: extracttextplugin.extract({ fallback: 'style-loader', use: [ { loader: 'css-loader', options: { modules: true, localidentname: '[hash:base64:5]', minimize: true, sourcemap: true }, }, { loader: 'sass-loader', options: { outputstyle: &#

php - Microsoft SQL Server with Laravel 5 -

i've pushed laravel application ubuntu 16.04 vps - company using sql server record management - , cannot laravel connect database authentication or else. i'm getting errors laravel cannot find drivers connect. i've searched in many places. there's no tutorial shows start finish, they're using different packages , it's overwhelming. has here connected laravel application (running on ubuntu) sql server? i have managed using below configuration (on windows): in .env file db_connection=sqlsrv db_host=hots db_port=1433 db_database=dbname db_username=user db_password=password database.php 'default' => env('db_connection', 'sqlsrv'), and in connections 'sqlsrv' => [ 'driver' => 'sqlsrv', 'host' => env('db_host', ''), 'port' => env('db_port', '1433'), // note port 'database'

SQL Server 2012 query is not executing on test server -

Image
i'm not able execute simple sql query. when i'm using unlock keyword, record open, keyword won't work if want truncate table. please provide suggestion how solve problem. my query shown here: identify query/process blocking current query processing. there many ways identify blocking. here 1 of way. select * master.sys.sysprocesses column blocked (session id) blocking spid column. to see blocking query run dbcc inputbuffer(<blocked session id>) you can take appropriate action based on value of column waittype, open_tran, , status .

How to find employee by ID in LINQ -

how find employee id , group 2 max , min time in id=1 , date="2017-05-01" same row using linq. list<bllcls> obj = new list<bllcls>(); obj.add(new bllcls { id =1 , date = convert.todatetime("2017-05-01"),time="08:00:00" }); obj.add(new bllcls { id =1 , date = convert.todatetime("2017-05-01"),time="19:00:00" }); obj.add(new bllcls { id =2 , date = convert.todatetime("2017-05-01"),time="08:00:00" }); obj.add(new bllcls { id =2 , date = convert.todatetime("2017-05-01"),time="19:00:00" }); from (id=1) how to? i need in format row 1 = id , date , min time , max time col = 1 , 2017-05-01, 08:00:00 , 19:00:00 row 2 = id , date , min time , max time col = 2 ,2017-05-01, 08:00:00 , 19:00:00 groupby friend: var query = obj.groupby(x => x.id) .select(grp => new { id = grp.key, mindate = grp.min(x => x.d

JUnit Mockito returning LinkedList instead of ArrayList -

i have been tasked figure out why junit test failing. have found instead of returning arraylist (like getdeligationsforloggedinuser supposed return, returns linkedlist "userlist". @suppresswarnings("unchecked") @test public void test_getdelegationsforloggedinuser() { string userid="abcd"; list<string> expecteduserlist= new arraylist<string>(); expecteduserlist.add("efghi"); expecteduserlist.add("jklmn"); expecteduserlist.add("opqrs"); when(namedparameterjdbctemplate.queryforobject(anystring(),anymap(), any(rowmapper.class))).thenreturn(expecteduserlist); list<string> userlist= workflowprocessdaoimpl.getdelegationsforloggedinuser(userid); verify(namedparameterjdbctemplate, times(1)).query(sqlcaptor.capture(), namedparametermap.capture(), rowmappercaptor.capture()); assertthat(userlist, is(expecteduserlist)); assertthat(sqlcaptor.getvalue(), is(sqlconstantssysc

javascript - uncaught referenceerror: is not defined onclick AspNet MVC -

in project need call "save items" function, when click button nothing happens .. , following error: "uncaught referenceerror: savedata not defined      @ htmlanchorelement.onclick (create: 82) " have idea might causing error? the function: function salvarpedido() { var data = $("#data").val(); var valor = $("#valor").val(); var descricao = $("#descricao").val(); var token = $('input[name="__requestverificationtoken"]').val(); var tokenadr = $('form[action="/pedido/create"] input[name="__requestverificationtoken"]').val(); var headers = {}; var headersadr = {}; headers["__requestverificationtoken"] = token; headersadr["__requestverificationtoken"] = tokenadr; var url = "/pedido/create"; $.ajax({ url: url , type: "post" , datatype: "json" , headers: headersadr , data: { id: 0, data: data, valor: valor, descrica

elasticsearch nested aggregate based on attribute and get custom value based on a formula in every bucket -

i have dataset of event actions: {"person" : "person1", "event" : "e1", "action" : "like"} {"person" : "person2", "event" : "e1", "action" : "dislike"} {"person" : "person1", "event" : "e1", "action" : "share"} {"person" : "person1", "event" : "e1", "action" : "rating"} {"person" : "person1", "event" : "e2", "action" : "rating"} can aggregate based on event , on bucket, based on weighted metrics on actions single custom value bucket? i have done nested aggregation: { "size": 0, "aggs": { "all_events": { "terms": { "field": "event.keyword" }, "aggs": { "overall_

linux - execute command in bash script until output exceeds certain value -

i use command parses video files frames , returning timecode, when found. @ moment, have execute command, wait, until values printed stdout reach desired position , abort execution using ctrl + c . as have watch process , abort execution in right moment information need, thought, automate degree creating bash script. i not certain, if can done in bash, don't know, how abort execution in connection values writes stdout. the output of command looks like 0.040000 5.040000 10.040000 15.040000 18.060000 (...) i tried until [[ "$timecode" -gt 30 ]]; timecode=$(mycommand) sleep 0.1 done echo "result: $timecode" or while [[ "$timecode" -le 30 ]]; timecode=$(mycommand) sleep 0.1 done echo "result: $timecode" which both seem result in command being executed until finishes , afterwards rest of loop being processed. want evaluate output while command executes , break execution depending on output. additional information

freemarker - Sort by nested field value in FTL liferay -

my structure created in liferay shown below: { "availablelanguageids": [ "en_us" ], "defaultlanguageid": "en_us", "fields": [ { "label": { "en_us": "image" }, "predefinedvalue": { "en_us": "" }, "style": { "en_us": "" }, "tip": { "en_us": "upload image displayed in small banner" }, "datatype": "image", "fieldnamespace": "ddm", "indextype": "keyword", "localizable": true, "name": "smallimage", "readonly": false, "repeatable": true,

javascript - Get right context(this) in callback -

i try call function in callback , class context(this). when calling callback function, doesn't have context. this undefined. tried few things bind(self) didn't work out. export class appcomponent { connect(call,callb){ var self=this var xhttp = new xmlhttprequest(); xhttp.responsetype=responsetype xhttp.open("get", "http://localhost:3000/"+call, true); xhttp.onreadystatechange = function(){ if (xhttp.readystate == 4 && xhttp.status == 200) { callb(xhttp.response).bind(self); } }; xhttp.send(null) } buildxml(response){ console.log(this) //prints undefined, should print appcomponent or } this.connect("somecall",this.buildxml) } you need bind() function context, invoke it. callb.bind(self)(xhttp.response); instead of c

events - How to send OnActivityResult To a specific page in xamarin forms -

i using custom button renderer google sign in in xamarin forms page working fine signin resultin mainactivity want send data mainactivity , appdelegate particular page in xamarin forms. protected override void onactivityresult(int requestcode, result resultcode, intent data) { base.onactivityresult(requestcode, resultcode, data); if (requestcode == 9001) { utilities.configuration.updateconfigvalue(utilities.constants.loggedinflag,string.empty); googlesigninresult result = android.gms.auth.api.auth.googlesigninapi.getsigninresultfromintent(data); if (result.issuccess) { googlesigninaccount acct = result.signinaccount; var token = acct.idtoken; //i wan send 'accnt' page in xamarin forms } else { //signin failure send response page in xama

jquery - Why am I getting a use strict error and what does it mean? -

when run code, keep getting "use strict" error. how fix it. $('.responsive-nav').click(function(){ $(this).toggleclass('active-hamburger'); //error appears here $('nav').toggleclass('active-nav'); });

jquery - Uncaught ReferenceError: .parent() or closest() -

within loop, multiple divs 1 below appears. <div id="author-id-3" class="follow-me"> <div class="author-follow"> <a id="3" class="meta-badge"><span class="icon-close"></span> follow</a> </div> </div> i use ajax update data within db. jquery('.author-follow').on('click', '.meta-badge', function(e) { e.preventdefault(); var user_id = $('.author-follow a.meta-badge').attr('id'); $.ajax( { ... beforesend: function() { $('.follow-me .author-follow').fadeout( 'fast' ); $( '<div class="icon-loading"></div>' ).hide().appendto('.follow-me').fadein( 'slow' ); }, success: function( data ) { $('.fo

java - Javafx limiting drag within window -

i making app has draggable background, work correctly, can drag, have noticed that, can drag past window , scene re-structure , allow me drag far want in given direction, here snippet show mean normal before dragging after dragging far bottom right noticed scene has allowed imageview go far mouse takes it, how can limit stay within window? here code this.imgadvertising.setonmousepressed(e -> { dragdelta.x = this.imgadvertising.getlayoutx() - e.getscenex(); dragdelta.y = this.imgadvertising.getlayouty() - e.getsceney(); }); this.imgadvertising.setonmousedragged(e -> { double x = e.getscenex() + dragdelta.x; double y = e.getsceney() + dragdelta.y; this.imgadvertising.setlayoutx(e.getscenex() + dragdelta.x); this.imgadvertising.setlayouty(e.getsceney() + dragdelta.y); });

json - Get request not the same decoded -

hi i'm new @ perl have few experience in other language. made simple code json file internet here telegram bot, when display got no probleme when decoded dedcode_json dont have @ same output :/// here output of server : received reply: {"ok":true,"result":{"id":0000,"first_name":"[maga]"}} and output of decoded anwser : $var1 = { 'ok' => bless( do{\(my $o = 1)}, 'json::pp::boolean' ), 'result' => { 'id' => 0000, 'username' => 'maga_bot', 'first_name' => '[maga]' } }; how can 'result' part of decoded json ? here code : #!/usr/bin/perl use warnings; use lwp::useragent; use data::dumper; use json; $ua = lwp::useragent->new; $destination = "http://api.telegram.org/bot<token>/getme"; $req = http::request->new(get =&

spring - Stomp java client with wss protocol -

i have spring java client , want establish stomp connection java server. far good. when trying use wss , fails. javax.websocket.deploymentexception: http request initiate websocket connection failed @ org.apache.tomcat.websocket.wswebsocketcontainer.connecttoserver(wswebsocketcontainer.java:395) ~[tomcat-embed-websocket-8.5.15.jar:8.5.15] @ org.springframework.web.socket.client.standard.standardwebsocketclient$1.call(standardwebsocketclient.java:150) ~[spring-websocket-4.3.9.release.jar:4.3.9.release] @ org.springframework.web.socket.client.standard.standardwebsocketclient$1.call(standardwebsocketclient.java:147) ~[spring-websocket-4.3.9.release.jar:4.3.9.release] @ java.util.concurrent.futuretask.run(futuretask.java:266) ~[na:1.8.0_121] @ java.lang.thread.run(thread.java:745) [na:1.8.0_121] caused by: java.util.concurrent.executionexception: javax.net.ssl.sslhandshakeexception: general sslengine problem is there way tell stomp client accept ssl connection?

Angular 2 with vanilla Javascript - Pass data into input from HTML -

i'm trying write component using angular 2 vanilla javascript, want use component on regular html page, , want able pass data component customize it. this have far: index.html <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <!-- i'm using component here --> <process-code id="processid" name="processname"></process-code> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script> <script src="node_modules/reflect-metadata/reflect.js"></script> <script src="node_modules/rxjs/bundles/rx.umd.js"></script> <script src="node_modules/@angular/core/core.umd.js"></script> <script src="node_modules/@angular/