Posts

Showing posts from June, 2013

Test angular 4 app with a global variable -

i have angular app using global variable set external .js library within ngoninit(). building , running works without issue. when running test (with karma) error "myglobal not defined". i tried defining variable before describe(), this: var myglobal = { }; describe('appcomponent', () => { that doesn't change anything. how supposed define variable ? to solve you'll need access window object using windowref component import {windowref} './windowref'; and in class constructor(private winref: windowref) { console.log('window object', winref.nativewindow['yourglobalvar']); //or winref.nativewindow.yourglobalvar } source here

reactjs - cannot read property history because it's undefined but it is -

i getting error cannot read property history defined it. this used work when had in main.jsx in client folder stops working. the app file in imports folder. import { router, route, switch, redirect } "react-router-dom"; import createbrowserhistory "history/createbrowserhistory"; const history = createbrowserhistory(); // app component - represents whole app export class app extends component { constructor(props) { super(props); } render() { return ( <div classname="container"> <router history={history}> <switch> <route path="/" exact component={home} /> <route path="/dashboard" render={() => this.props.currentuser ? <dashboard /> : <nopermission />} /> <route path="/test" component={test} /> <route component={notfound} /

sql - Use datediff() result in dsum() function -

i have following table start , end dates: dataid ts endts 1744 7/27/17 1:57:34 pm 7/27/2017 1:57:38 pm 1743 7/27/17 1:57:31 pm 7/27/2017 1:57:34 pm 1742 7/27/17 1:57:23 pm 7/27/2017 1:57:31 pm 1741 7/27/17 1:57:16 pm 7/27/2017 1:57:23 pm 1740 7/27/17 1:57:04 pm 7/27/2017 1:57:16 pm 1739 7/27/17 1:56:57 pm 7/27/2017 1:57:04 pm 1738 7/27/17 1:56:38 pm 7/27/2017 1:56:57 pm i date/time interval (in seconds) , calculate running total. here have far: select [dataid] [dataid] datediff("s", [ts],[endts]) [durationsec] dsum("[durationsec]","[hx32]","[dataid] <=" & [dataid]) [add] [hx32]; i think datediff() funtion possibly causing formatting problems. "[durationsec]" nulls result, [durationsec] following results: durationsec add 4 6896 3 5169 8 13776 7 12047 12

How to autoload a class in ruby -

i have module follows -path of class myclass lib/a/b/myclass.rb module a; module b class myclass puts 'inside myclass' end end end; now want autoload above class file in root directory. file name : dostuff def main autoload a::b:myclass,'a/b/myclass.rb' #path correct , getting error here c = a::b:myclass.new end main am getting error: uninitialized constant a::b::myclass (nameerror) if use require follows , delete autoload code works fins. require 'a/b/myclass' you're asking of auto-loader. can deal 1 level @ time. means need expressing each module or class in separate file: # a.rb module autoload(:b, 'a/b') end # a/b.rb module a::b autoload(:myclass, 'a/b/my_class') end # a/b/my_class.rb class a::b::myclass end then can auto-load a: autoload(:a, 'a') a::b::myclass.new it's highly unconventional have main function in ruby. put code @ top level in context called main .

Programmatic (API calls) User Authentication using Azure AD B2C instead of login.microsoftoneline.com form -

new azure ad... please don't harsh if off target. :-) technology stack - latest angular 2 c# middle tier , latest .net framework. ideally, want use azure ad b2c store user credentials , authentication - want our 'own' forms on our site login forms capture , logging - pass credentials through api (rest?) call (using ms graph sdk?) azure ad b2c , check call return authorization content message. couple of reasons - control of application flow, logging , "flickering of url" (i.e. going our site url login.microsoft... url , our sites url). is doable without doing hack? thank in advance , patience! you looking " resource owner password credentials ". this not supported azure ad b2c, can give user feedback b2c team want through azure feedback forum: add support resource owner password credentials flow in azure ad b2c , headless authentication in microsoft authentication library you should see updates @ location if , when implement fea

Javascript Promise Function Style -

suppose have function return promise based on input value need calculated first. seems there 2 ways this. example 1: function foo(val) { var newval = val + 100; var anotherval = newval % 12; var returnval = anotherval * 3; return new promise(function(resolve, reject) { settimeout(function() { resolve(returnval); }, 1000); }); } foo(10).then(function(val) { console.log(val); }); example 2: function foo(val) { return new promise(function(resolve, reject) { var newval = val + 100; var anotherval = newval % 12; var returnval = anotherval * 3; settimeout(function() { resolve(returnval); }, 1000); }); } foo(10).then(function(val) { console.log(val); }); the first example keeps of setup outside of promise function. , second moves of logic inside of function. on surface these seem equivalent in pretty every scenario. wondering if had insight whether 1 of these b

python - Unable to create an appropriate CSS selector -

the problem python's css selectors. i can't write selector in right way select item "last". tried with: div.pager a:[text*='last'] elements within item lies: <div class="pager"><a href="/search/1080p/" class="current">1</a> <a href="/search/1080p/t-23/">23</a> <a href="/search/1080p/t-255/">last</a> </div> it possible , answer is: div.pager a:contains("last") and, here selector used within python script: import requests lxml import html main_link = "https://www.yify-torrent.org/search/1080p/" base_link = "https://www.yify-torrent.org" def get_links(item_link): response = requests.get(item_link).text tree = html.fromstring(response) next_page = tree.cssselect('div.pager a:contains("next")')[0].attrib["href"] last_page = tree.cssselect('div.pager a:contains(&qu

windows services - Asp.Net Web API with a message bus/queue -

i experimenting implementing micro service architecture on rest service developing. rest service communicate third party soap service , component creating perform additional business rules validation. plan split application 3 distinct components: web api clients send requests, windows service call third party soap service , windows service perform business rules validation. planning on using combination of actor model (akka.net) along message bus (nservicebus or rabbitmq + mass transit). from understand, messaging meant fire , forget commands, cannot used web api project clients expecting response call api , not sure how await receiving message bus/queue in client request web api there need away web api listen event bus in request. my question is, correct in understanding of how messaging queues operate? and, have use akka.net based micro service accept calls web api , return response api? technically can use request-response, see example here . however, approach shou

python 3.x - Degree Of array -

we have given array a=[1,2,3,4,1,2,1,1,1,2,2] have find duplicate element array , separate array [1,1,1,1,1] , [2,2,2,2] , print largest length of array here largest length 5 [1,1,1,1,1].here try use itertools not work out. input a=[1,2,3,1,1,1,1,2,2,2] o/p should 5. import itertools my_list = [1,2,2,2,1,1,2,2,2,3,4] num1=[] a, b in itertools.combinations(my_list,2): if == b: num1.append(b) print(num1) max_ele=max(num1) print(max_ele) print(num1.count(max_ele)) from collections import counter n = [1,2,2,2,1,1,2,2,2,3,4] c = counter(n) count = max(c.values()) print(count)

Receiving Post Requests from an external source using the Bottle framework Python -

i beginning use python bottle library basic web apps. wondering if there way receive http post requests server running on same lan. for example if have server running server.py: app = bottle() @app.route('/hello') def stranger_hello(): return('hello, stranger') @app.post('/hello') def hello(name): return('hello, ', name) run(app, host = '192.168.1.14', port = 8888) and have client script running on (or same) device on same lan client.py: requests.post('http://192.168.1.14:8888', 'steve') is possible have page @ 192.168.1.14:8888/hello 'hello, stranger' default, receive request posted client.py , change 'hello, steve' ? believe there's way using socket framework's recv() function, possible using bottle?

google cloud platform - Dataflow pipline "lost contact with the service" -

i'm running trouble apache beam pipline on google cloud dataflow. the pipeline simple: reading json gcs, extracting text nested fields, writing gcs. it works fine when testing smaller subset of input files when run on full data set, following error (after running fine through around 260m items). somehow "worker lost contact service" (8662a188e74dae87): workflow failed. causes: (95e9c3f710c71bc2): s04:readfromtextwithfilename/read+flatmap(extract_text_from_raw)+removelinebreaks+formattext+writetext/write/writeimpl/writebundles/do+writetext/write/writeimpl/pair+writetext/write/writeimpl/windowinto(windowintofn)+writetext/write/writeimpl/groupbykey/reify+writetext/write/writeimpl/groupbykey/write failed., (da6389e4b594e34b): work item attempted 4 times without success. each time worker lost contact service. work item attempted on: extract-tags-150110997000-07261602-0a01-harness-jzcn, extract-tags-150110997000-07261602-0a01-harness-828c, extract-tags-1501

c# - date format in MS access insert is incorrect -

i have problem date format. my computer's regional setting "mm-dd-yyyy". i have c# application. , want user enter date in "dd/mm/yyyy" format only. when user enter 30/10/2010 (means 30th oct 2010) , access not changing anything. ok. but, if user enters 05/10/2010 (means 05th oct 2010) on lost focus of date text box, automatically changes 10/05/2010. should remain 05/10/2010. can tell me solution? plz note, don't want change regional setting. you have parse input using forced format obtain correct datetime value. then format neutral string expression concatenate sql statement: string textdate = "05/10/2017"; iformatprovider provider = system.globalization.cultureinfo.invariantculture; datetime date = datetime.parseexact(textdate, "dd/mm/yyyy",provider); string sql = "... #" + date.tostring("yyyy'/'mm'/'dd") + "# ..."; will return: date: 2017-10-05 00:00:00 sql

regex to match one and only one digit -

i need match single digit, 1 through 9. example, 3 should match 34 should not. i have tried: \d \d{1} [1-9] [1-9]{1} [1-9]? they match 3 , 34. using regex because part of larger expression in using alternation. the problem of examples, of course, match digit, don't keep matching multiple digits next each other. in following example: some text 3 , 34 , b5 , 64b? this regex will match lone 3 . uses word boundaries, handy feature. \b[1-9]\b it gets more complicated if want match single digits inside words, 5 in example, didn't specify if you'd want that, i'll leave out now.

Vue $el is undefined when testing with Mocha/Chai under meteor -

i'm starting our unit test environment our project, may have picked combo doesn't work in couple scenarios. our project runs under meteor, code ui written in vue , coffeescript. test environment we're trying work mocha & chai. when run test suite, command looks this: meteor test --once --driver-package=dispatch:mocha from examples around internet, following code should work : const vueobject = vue.extend(myvuecomponent); const vueinstance = new vueobject().$mount(); chai.assert.ok(vueinstance.$el.textcontent); from point, ask $el sorts of questions test, $el undefined. tried waiting using vue.nexttick() , it's still undefined. in examples i've found, talk using webpack, heard meteor doesn't using webpack. does have suggestions? did pick hard combination work with? tl;dr: make sure running tests in browser. if doesn't work try manually adding element when creating vue app. i facing same issue jest. initially, thought had cre

haskell - Defining function signature in GHCi -

defining function signature in haskell's interpreter ghci doesn't work. copying example this page : prelude> square :: int -> int <interactive>:60:1: error: • no instance (show (int -> int)) arising use of ‘print’ (maybe haven't applied function enough arguments?) • in stmt of interactive ghci command: print prelude> square x = x * x how can declare function signature , give function definition in haskell interactively? also: why can't evaluate function , see type (e.g. prelude> square ) once has been defined? you can define function signature in ghc interactive shell. problem need define functions in single command . you can use semicolon ( ; ) split between 2 parts: prelude> square :: int -> int; square x = x * x note same holds function multiple clauses . if write: prelude> is_empty [] = true prelude> is_empty (_:_) = false you have overwritten previous is_empty function second stateme

Preloading many HTML5 videos at the same time - "waiting for available socket" -

i have grid of videos users able play. along lines of list of youtube videos embedded following: <video data-bind="attr: {src: mediapath}" preload="metadata"></video> at point, start see following chrome: waiting available socket... i believe due issues outlined here: chrome hangs after amount of data transfered - waiting available socket however i'm not sure solution is, given user may seeing 10s or 100s of "previews" scroll through media. one thing thinking load preload='none' initially, , change videos on preload='metadata' few @ time until metadata has been loaded, wanted ask community before embarking on such smelly endeavor. as ux - videos in small thumbnails, around 30 of "above fold" @ given time. as offbeatmammal says usual approach type of video grid or list load poster images rather videos , load video when user clicks or hovers. you can have separate preview video on

jquery - Two different modals checking with one function -

i looking have multiple modals on site follows: the first modal have general information them login/register , need display if user anonymous (not logged in) or not have active subscription (even if they're logged in). have flag/check this. the other modals house youtube videos... when user clicks on play buttons in grid, call 1 function check flag speaking of. if flag true, appropriate modal popup particular video. if flag false, login/register modal popup. how can go doing , can please help? thank in advance! try thing this. said if flag true trigger second function it's pretty simple need use if else statement. $(document).ready(function(){ $("#btn").on("click",function(){ //your first module code goes here. alert('i first.'); secondmodule(); }); }); function secondmodule(){ //your second module code goes here. alert('i second'); } <script src="https://ajax.google

java - How Spring Boot redirect http to https with HTTP 301? -

in spring boot project,i add https support,when curl -i http://127.0.0.1:80 ,i got http/1.1 302 ,how can redirect http 301. config,in code has comment maybe useful. can me?very thankful! @configuration public class webconfig { @bean public embeddedservletcontainerfactory servletcontainerfactory() { tomcatembeddedservletcontainerfactory factory = new tomcatembeddedservletcontainerfactory() { @override protected void postprocesscontext(context context) { securityconstraint securityconstraint = new securityconstraint(); securityconstraint.setuserconstraint("confidential"); securitycollection collection = new securitycollection(); collection.addpattern("/*"); securityconstraint.addcollection(collection); context.addconstraint(securityconstraint);

drop down menu - Get other values in datasource of a dropdownlist in asp.net -

i have connected stored procedure dropdownlist the stored procedure has 3 values repid, repname, , repref the dropdownlist has 2 values datatextfield , datavaluefield i connected datatextfield repname , datavaluefield repid i want repref too how can that here code conn.open(); sqlcommand cmd = new sqlcommand("mysp", conn); sqldataadapter da = new sqldataadapter(cmd); cmd.commandtype = commandtype.storedprocedure; da.fill(dt); if (dt.rows.count > 0) { ddlreps.datasource = dt; ddlreps.datatextfield = "repname"; ddlreps.datavaluefield = "repid"; ddlreps.databind(); } if user selected report called "cities" has id = 16 how can repref there? use linq , add add new property on anonymous type way want format it:

matlab - unknown white lines when saving pie chart as pdf -

Image
when save pie chart pdf, pdf has unknown white lines. simplify question, modify code generic form following. clc; h=pie(1); %set pie chart color black h(1).facecolor = 'k'; the reason choose use black color white lines contrast black background. please see attached pdf figure. i find similar thread having same issue @ link: weird artifacts when saving pie chart pdf . no solution provided @ point. my system configuration: macos sierra version 10.12. matlab r2016b. any input welcome. thank you. i found adding one of these, after call pie , such, took care of problem: set(gcf,'renderermode','manual'); set(gcf,'renderer','opengl'); set(gcf,'renderer','opengl','renderermode','manual'); it strange because if try get(gcf,'renderer') show opengl (at least on machine), interpreted painters algorithm until render mode switch manual. happens automatically if set renderer opengl, o

node.js - Generate Key for signing within nodejs -

i have seems rather simple problem, never had deal cryptography in nodejs before. want implement system generates new keypair every 4 months, used signing , verifying generated result. current code: 'use strict'; const fs = require('fs'); const crypto = require('crypto'); const algorithm = 'rsa-sha512'; const sign = crypto.createsign(algorithm); const verify = crypto.createverify(algorithm); const base64 = 'base64'; const keydir = './keys/'; const validator = {}; validator.check = function(dataarray, signature, date){ verify.update(buffer.from(dataarray)); return verify.verify(getpublickey(date), signature); }; validator.sign = function(dice){ sign.update(buffer.from(dice)); return sign.sign(getprivatekey(), base64);//error happens here }; validator.getpublickey = function(date){ date = todateobject(date); for(current of getfilesdescending()){ if(filenametodate(current).getmilliseconds() <= date.getmilliseco

drop down menu - Loosing Attributes in DropDownList asp.net -

i set attributes dropdownlist the problem when try read them in button click null !! i not sure of postback or not see code below why , how fix it? this code protected void ddlreps_databound(object sender, eventargs e) { foreach (system.data.datarow row in dt.rows) { ddlreps.items.findbyvalue(row["reportid"].tostring()).attributes.add("reportpath", row["reportpath"].tostring()); ddlreps.items.findbyvalue(row["reportid"].tostring()).attributes.add("reportserver", row["reportserver"].tostring()); } string attribvalue1 = ddlreps.selecteditem.attributes["reportpath"]; //when check here can see valu } protected void btnviewreport_click(object sender, eventargs e) { string attribvalue2 = ddlreps.selecteditem.attributes["reportpath"]; //here null :( } also here page load code protected void page_

c# - When generating a video from images and adding audio the video isn't playable -

so have bunch of images in folder, following structure: image-0.png image-1.png image-2.png sometimes folder can have 1 image saved as: image-0.png my code generate video , add audio // create file using (wavefilereader wf = new wavefilereader(audio)) { // files oldvideo = "old.avi"; newvideo = "video.avi"; audio = "sound.wav"; // time of audio , divide images time = wf.totaltime.totalseconds; mimtime = time / imagescount; ffmpegpath = "ffmpeg.exe"; ffmpegparams = " -r 1/" + mimtime + " -i " + imagesfolder + "image-%d.png -t " + time + " -y -vf scale=1280:-2 " + oldvideo; ffmaudioparams = " -i " + oldvideo + " -i " + audio + " -c copy -shortest " + newvideo; } using (process ffmpeg = new process()) { //generate video ffmpegstartinfo = new processstartinfo(); ffmpegstartinfo.filename = ffmpegpath; ffmpegst

ios - Xamarin: Apple Rejection : We were unable to review your app as it crashed on launch -

we have tested on adhoc build , testflight internal testing don't replicate crash experience apple review. using: xcode 8.3.3 visual studio 7.0.1 xamarin studio 6.3 latest updates xamarin.ios , xamarin forms any idea logs or bug on xamarin? apple rejection: 1 performance: app completeness guideline 2.1 - performance - app completeness > unable review app crashed on launch. have attached detailed crash logs troubleshoot issue. next steps to resolve issue, please revise app , test on device ensure launch without crashing. crash logs sent itunes rejection {"app_name":"guardiansappios","timestamp":"2017-07-27 07:09:54.08 -0700","app_version":"1.3.13","slice_uuid":"{uuid}","adam_id":1214197075,"build_version":"1.147","bundleid":"com.guardiansaps.app","share_with_app_devs":false,"is_first_pa

javascript - Read and return a Firebase Database entry that can also be used to update -

i'm trying retrieve record database , use returned update record. when push record database, returns object can use update it. /* works */ var result = firebase.database().ref('b').push({ name: 'levi' }); result.update({name: 'leeeevi'}); is there way can retrieve record using id, returns object can used update record? following: var response = firebase.database().ref('/b/' + id).once('value'); response.update({name: 'levi'}); i user able read database using id of entry. them able make changes record in database. push() returns new data path reference through can access unique key/id generated. can use same set data it. to unique key // unique key generated push() var pushid = pushref.key; var responseref = firebase.database().ref('/b/' + pushid); responseref.update({name: 'levi'});

How to vertically align form-group label and text to middle in bootstrap? -

Image
<div class="form-group"> <label class="col-sm-2 control-label" style="vertical-align:middle">处理状态</label> <div class="col-sm-10 form-control-static">{{text.status[complaint.status]}} <button type="button" class="btn btn-sm btn-primary" ng-click="update()" style="margin-left:10px">处理完成</button> </div> </div> you can see text doesn't align correctly in middle because when there button, changes height of element on right, , left element doesn't align middle parent element.

python - Splitting lists within a 2d list -

say have 2d list called sentences . sentences = [['hello'],['my'],['name']]. is there anyway split these lists every character separate indexes, like: sentences = [['h','e','l','l','o'],['m','y'],['n','a','m','e'] for example: sentences.txt = hello name the code i've written: sentence = open('sentences.txt', 'r') sentence_list = [] new_sentence_list = [] line in sentence: line = line.rstrip('\n') sentence_list.append(line) line in sentence_list: line = [line] new_sentence_list.append(line) this result in new_sentence_list be: [['hello'],['my'], ['name']]. when be: [['h','e','l','l','o'],['m','y'],['n','a','m','e'] you need use list(line) achieve this: so, code becomes below, ori

html - Setting up customer payment options with Braintree's Javascript SDK? -

i'm attempting go through braintree's javascript sdk documentation, it's bit sparse. what minimum html have write in order enable customer setup credit card use braintree payments? how braintree javascript sdk process html or setup html , process it? does braintree javascript sdk first have grab values server before can setup customer , have have values hardcoded before can grab values? i know have setup server side of this, i'm trying figure out client side javascript first. full disclosure: work @ braintree. if have further questions, feel free contact support . i'd happy help! what minimum html have write in order enable customer setup credit card use braintree payments? the minimum amount of html you'd have write collect/store/transact customer payment information using braintree's drop-in integration. can check out this link basic drop-in example. how braintree javascript sdk process html or setup html , proce

r - Filtering multiple csv files while importing into data frame -

i have large number of csv files want read r. column headings in csvs same. want import rows each file data frame variable within given range (above min threshold & below max threshold), e.g. v1 v2 v3 1 x q 2 2 c w 4 3 v e 5 4 b r 7 filtering v3 (v3>2 & v3<7) should results in: v1 v2 v3 1 c w 4 2 v e 5 so fare import data csvs 1 data frame , filtering: #read data files filenames <- list.files(path = workdir) mergedfiles <- do.call("rbind", sapply(filenames, read.csv, simplify = false)) fileid <- row.names(mergedfiles) fileid <- gsub(".csv.*", "", fileid) #combining data file ids combfiles=cbind(fileid, mergedfiles) #filtering data according criteria resultfile <- combfiles[combfiles$v3 > min & combfiles$v3 < max, ] i rather apply filter while importing each single csv file data frame. assume loop best way of doing it, not sure how. appreciate sug

c# - windows form design Ruined when connect to excel -

when connect excel file code (exactly when _conn.open();) _conn = new oledbconnection(_connectionstrting); _conn.open(); datatable dt = _conn.getoledbschematable(oledbschemaguid.tables, null); string[] sheetnames = new string[dt.rows.count]; int = 0; foreach (datarow row in dt.rows) { sheetnames[i] = row["table_name"].tostring(); combobox2.items.add(sheetnames[i]); i++; } _conn.close(); my windows form design(in c#) gets problems resolution changes , element size getting smaller before , place of elements changes in run time .i use other way connect excel(using excel library) , don't have problem.but curious problem.can 1 told me why happen? this bug has haunted many developers! a user posted example on youtube here: https://www.youtube.com/watch?v=zd

angularjs - How to get value from router request? -

i have created angular app. in app, want add search. this, have textbox , button. textbox name name="search" i have method in api. router.get('/allactivities', (req, res) => { activity.find({ name: req.body.search }, (err, activities) => { if(err) { res.json({success: false, message: err}); } else { if(!activities) { res.json({success: false, message: 'no recent activities found'}); } else { res.json({success: true, activities: activities}); } } }) }); this request. in this, i'm trying text box value angular front end activity.find({ name: req.body.search }, (err, activities) => this mongodb but i'm not getting output. matter here i'm not getting value "req.body.search" used text box value. can tell me how this? if put activity.find({ name: 'roshini' }, (err, activities) => like this

java - How to declare a class that contains a field with generic type in Kotlin? -

in kotlin have data class. data class apiresponse<out t>(val status: string, val code: int, val message: string, val data: t?) i want declare class include this: class apierror(message: string, response: apiresponse) : exception(message) {} but kotlin giving error: 1 type argument expected class apiresponse defined in com.mypackagename in java can this: class apierror extends exception { apiresponse response; public apierror(string message, apiresponse response) { super(message); this.response = response; } } how can convert code kotlin? what have in java raw type . in section on star-projections , kotlin documentation says: note: star-projections java's raw types, safe. they describe use-case: sometimes want know nothing type argument, still want use in safe way. safe way here define such projection of generic type, every concrete instantiation of generic type subtype of projection. your apierror clas

What is Spring MVC Based on Reactor? -

i have been reading can spring , reactor , realize reactor supposed included in upcoming spring framework 5 (anyone using in production btw?) my interest use in spring mvc, since not part of framework, how can reactor used in spring mvc? appears online examples use reactor in spring while waiting framework 5, use reactor-bus. is spring mvc + reactor in current state adding reactor-bus mvc app ? a @ github shows reactor-bus seems in legacy mode ? what current way give reactive capabilities existing spring mvc ? spring 5 , webflux give benefit, because framework using reactive programming , non-blocking, opportunities end-to-end asynchronicity if db async-capable (think cassandra, redis, mongodb, couchbase, along reactive spring data kay). that said, library reactor can have benefits if app not reactive. example, if have service layer lot of orchestration needed. if these services represent tasks asynchronous types (ideally flux / mono / publisher , future ), ca

javascript - Cursor does not blink on autofocus -

browser: chrome > 57 issue: cursor not blink on focus'd text box ( left/right click nothing make cursor start blinking ) steps: happens when proceed "your connection not private" , aka- unsafe page. only happens when warning page ( self-signed-cert page ) , proceed clicking on proceed < ip/domain > ( unsafe ) - issue not happen next time refresh ( warning page not come anymore ) what have tried, tried html way, autofocus="autofocus" on input-textbox javascript way, $(id).focus(). tried setting focus after timeout well. none of above methods work ( 1st time i'm accessing page - after warning page ). focus set/working , blinking isn't working. fyi: chrome updated security changes version 58 , onwards ( details 1 , 2 ). not sure if/why these changes affecting way cursor blinks, have checked in chrome 56/57 , blinking working. ex, not want link unsafe websites demo this. problem i'm facing private software installa

swift - Casting an SKSpriteNode in an SKReferenceNode -

i've build scene1 in xcode's scene editor. , i've referenced scene has animation scene1. now, i'm trying cast-out skspritenode inside skreferencenode. name of skspritenode i'm trying cast, on scene references is: "sc01eyelid". any suggestions might wrong here? thank in advance. import spritekit import gameplaykit class scene1: skscene { var misha: skreferencenode = skreferencenode() var eyelidforscene1:skspritenode = skspritenode() override func didmove(to view: skview) { castmishaforscene1() castouteyelid() } //casting out misha func castmishaforscene1() { if let somespritenode:skreferencenode = self.childnode(withname: "misharefnode") as? skreferencenode { misha = somespritenode print("casted\(misha)") } else { print("could not cast\(misha)") } } //casting out eyelid func castouteyelid() { if let somespritenode:skspritenode = misha.childnode(

java - SpringBoot rabbit connection timeout issue -

my spring boot application throws connection timeout error, , never able connect. other interesting problem see is, never picking connection timeout property defined in spring app properties. org.springframework.amqp.amqptimeoutexception: java.util.concurrent.timeoutexception @ org.springframework.amqp.rabbit.support.rabbitexceptiontranslator.convertrabbitaccessexception(rabbitexceptiontranslator.java:74) ~[spring-rabbit-1.6.7.release.jar:na] @ org.springframework.amqp.rabbit.connection.abstractconnectionfactory.createbareconnection(abstractconnectionfactory.java:309) ~[spring-rabbit-1.6.7.release.jar:na] @ org.springframework.amqp.rabbit.connection.cachingconnectionfactory.createconnection(cachingconnectionfactory.java:577) ~[spring-rabbit-1.6.7.release.jar:na] @ org.springframework.amqp.rabbit.core.rabbittemplate.doexecute(rabbittemplate.java:1431) ~[spring-rabbit-1.6.7.release.jar:na] @ org.springframework.amqp.rabbit.core.rabbittemplate.execute(rabbittem

ios - Xcode processing symbol files multiple times for same device -

if haven't installed our app phone in week or two, xcode processes symbol files again. far know, xcode should need once per device. what can prevent happening? it wouldn't bother me if quick, takes 10-15 minutes. usually, want test app, give feedback frontend devs, , move on. xcode version: 8.3.3 ios version: 10.3.3 fyi, reason delay between builds of time use unity cloud build provides ipa . however, during faster iteration periods, cloud build slow. try use cable or usb port - other usb port fixed me or "rebooting iphone" or clean project option + product -> clean build folder remove folder library/developer/xcode/deriveddata/modulecache find project folder in library/developer/xcode/deriveddata/ , remove restart xcode

oracle11g - Oracle stored proc call is not working from spring boot version 1.4.x onward -

after upgraded spring boot 1.3.x 1.4.x or 1.5.x oracle stored proc call failing error: pls-00306: wrong number or types of arguments same code works 1.3.x version. have dependency ojdbc6 11.2.0.3. there change or library have include make work ?

javascript - Rails fine-uploader select folder from selectbox -

i try select folders select box , send request fine uploader params. send null. codes below //haml codes - path = "#{rails.root}/public/templates/custom/" - folders = dir["#{path}*"] %select#selected_path.form-control{name: 'folder'} %option{disabled: "disabled", selected: "selected"} select - folders.each |folder| %option{value: "#{rails.root + folder}"} - if file.directory? folder = folder for js code $('#fine-uploader-gallery').fineuploader({ template: 'qq-template-gallery', request: { endpoint: '/admin/files/upload', params: { authenticity_token: "<%= form_authenticity_token %>", // gecici path eklendi selected_path: $('#selected_path').change(function() { alert($('#selected_path option:selected').val()); $('#selected_path option

How to delete an object from a map which contains a vector as value in C++ -

i have map contains of vector of type messages. std::map<std::string, std::vector<message>> storage; class message has 3 member variables. class message { private: std::string msg; std::string msg_type; int priority; } now trying delete object has priority(say 3) map. using following function it. doesn't work. void deletebymessagepriority(int priority) { if (checkpriorityofmessage(priority)) { (std::map<std::string, std::vector<message>>::iterator = storage.begin(); != storage.end(); it++) { std::vector<message> listofmsgs = it->second; (std::vector<message>::iterator vec_it = listofmsgs.begin(); vec_it != listofmsgs.end(); vec_it++) //for(int index = 0;index < listofmsgs.size();index++) { if (vec_it->getpriority() == priority) { listofmsgs.pop_back(); } }

report - Delphi ReportBuilder onclose issue -

i working delphi xe6 reportbuilder version 15.05 build 275. tppreport, tdatasource , tpppipeline components used connection. once report displayed , when try close it, screen gets hanged , have close exe task manager. there around 350k entries in table using locate function retrieve few data. report displayed selected data.

excel - Copy Common Columns to separate sheet -

i tried below code copy entire column 1 page other page. i've common header june scattered in sheet, want copy columns, header name "june" in separate sheet 1 after other. eg if col a, c,l,m has column header june, on next sheet these should copied a,b,c,d. sheets("sheet1").select june = worksheetfunction.match("description", rows("1:1"), 0) sheets("sheet1").columns(june).copy destination:=sheets("sheet2").range("a1") following might help: option explicit sub demo() dim srcsht worksheet, destsht worksheet dim headerrng range, cel range, copyrng range dim lastcol long, col long set srcsht = thisworkbook.sheets("sheet1") 'sheet1 set destsht = thisworkbook.sheets("sheet2") 'sheet2 lastcol = srcsht.cells(1, srcsht.columns.count).end(xltoleft).column 'last column of sheet1 srcsht each cel in .range(.cells(1, 1)

javascript - Making horizontal scrollbar always visible even if bottom is out of view -

Image
i start question snippet showing trying accomplish. .wrapper { overflow: hidden; display: flex; } .sidebar { min-width: 200px; background: #333; color: #fff; } .container { flex: 1; overflow-x: scroll; } .long { width: 2000px; } .header { background: #666; } <div class="wrapper"> <div class="sidebar"> sidebar </div> <div class="container"> <div class="header long"> header </div> <div class="content"> <div class="long"> long </div> long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<br/>long text<