Posts

Showing posts from January, 2013

class - How to compare two classes in vb.net? -

let's suppose have class this: class myclass(of template) 'some things here end class so far, good. however, things depending on template, like class myclass(of template) 'some things here public sub mymethod 'if template myotherclass ' things 'else ' other things 'end if end sub end class of course, give object , check whether typeof (obj) myotherclass , seems less intuitive me. there way compare 2 classes in vb.net? you compare type class myclass(of template) 'some things here public sub mymethod if gettype(template) gettype(myotherclass) things else other things end if end sub end class but seems bad thing do. point of oo have logic in it's respective class instead of doing this.

mysql - Difference between these sql queries -

i can't seem understand why these 2 queries return different results following task: "find names , grades of students have friends in same grade. return result sorted grade, name within each grade." tables here: https://lagunita.stanford.edu/c4x/db/sql/asset/socialdata.html the first query: select distinct h1.name, h1.grade highschooler h1, friend f, highschooler h2 h1.id = f.id1 , h2.id = f.id2 , h1.grade = h2.grade order h1.grade, h1.name the second query: select name, grade highschooler id not in ( select id1 highschooler h1, friend, highschooler h2 h1.id = friend.id1 , friend.id2 = h2.id , h1.grade <> h2.grade) order grade, name; the second 1 returns expected result, not first one. if cares clarify, thanks. the first query applies 3 filter in query simultaneously data in tables , returns entries matching filters. second query firstly subquery returns rows matching subquery condition , ids not there returned, includes ids h1.id =...

xslt 2.0 - How to implement saxon OutputURIResolver in Java? -

i new java. have similar scenario [ catch output stream of xsl result-document not understanding pass href , base parameter.. my xslt (result-document) follows: <xsl:template match="/" mode="create-text-file"> <xsl:param name="book-name" tunnel="yes"/> <xsl:result-document href="{$book-name}.xml" doctype-public=" test" doctype-system="test.dtd"> <xsl:apply-templates/> </xsl:result-document> </xsl:template> another: <xsl:result-document href="{$book-name}.opf" doctype-public="" doctype-system="" indent="yes"> <xsl:apply-templates mode="#current"/> </xsl:result-document> parameter book-name getting : <xsl:template match="d...

javascript - pause youtube video and show div with a form -

i have youtube video on website: <div id="video"> <iframe width="560" height="315" src="https://www.youtube.com/embed/some_video" frameborder="0" allowfullscreen></iframe> </div> after fixed time, want pause , ask user question overlaying form on video: <h1>how video far? </h1> <div id="question"> <form> <input type="radio" name="question" value="poor" checked>poor<br> <input type="radio" name="question" value="good">good<br> <input type="submit" value="submit"> </form> </div> what javascript code pause video after fixed period of time , css displaying form nicely? want mimic way lectures on coursera.org once looked like. tyr this: html: <div id="video"> ...

sorting - It is possible to sort by "valid" percentage in my data? -

Image
using tableau, have arranged data in 100.00% stacked bar: i want sort data descending (largest smallest) valid component type (green) - possbile? update (26th july 2017) merawalaid's answer worked; followed steps, adjusted code match specific project, , resulted in this: as can see, sorted, not quite should (for example, fourth , sixth rows featured high in chart. is there might wrong have missed here? i able this: you can download workbook here. advised though, feel there simpler way out there this. what did create 2 calculated fields. 'validcomponentcount': if ([component type]='valid component') 1 else 0 end '% of valid': {fixed [rootname] : sum([validcount])/count([number of records])} then sorted 'rootname' column based on descending value of 2nd calculated field (% of valid).

swift - Editor placeholder in source file -

following arkit tutorial https://www.youtube.com/watch?v=r8u8rgdmop4 but getting editor placeholder in source file error in following code (2nd line). has there been change in swift cause this? override func viewwillappear(_ animated: bool) { super.viewwillappear(animated) let configuration = arworldtrackingsessionconfiguration() sceneview.session.run(configuration) addobject() } there placeholder in file, meaning you'll see grey or blue block, that'll value, indicating need replace placeholder of value. the gray blocks in image placeholders. it possible xcode being idiotic, try cleaning project, run again.

java - Mylyn WikiText Extras won’t install in eclipse Oxygen, says Mylyn WikiText 3.0.6 is installed -

vogella suggests installing mylyn wikitext extras editing asciidoc. on (just installed) eclipse oxygen java ee, refuses install. according instructions , selected mylyn wikitext extras mylyn docs eclipse repository. eclipse says: cannot complete install because of conflicting dependency. software being installed: mylyn wikitext extras 3.0.14.201707112336 (org.eclipse.mylyn.wikitext.extras_feature.feature.group 3.0.14.201707112336) software installed: mylyn wikitext 3.0.6.201703111926 (org.eclipse.mylyn.wikitext_feature.feature.group 3.0.6.201703111926) 1 of following can installed @ once: mylyn wikitext tasks ui 3.0.6.201703111926 (org.eclipse.mylyn.wikitext.tasks.ui 3.0.6.201703111926) mylyn wikitext tasks ui 3.0.14.201707112336 (org.eclipse.mylyn.wikitext.tasks.ui 3.0.14.201707112336) cannot satisfy dependency: from: mylyn wikitext extras 3.0.14.201707112336 (org.eclipse.mylyn.wikitext.extras_feature.feature.group 3.0.14.201707112336) to: org.eclipse....

javascript - Inserting and removing data from a child node wtih push () -

background in web app, each player object in database. when user selects player, instead of whole object being sent user's "selection" node under "user" parent node, player id inserted instead ease of reference. code i trying create web app such insert player id specific child node using push (). code : //add player if not added if(!selected || selected[player.position<2) { ref3.push(player.id); } which results in following in database: fantasyapp: { players: { player 1: { goals: 0, assists: 0, id: 1 }, player 2: { goals: 1, assists: 3 id:2 } ... }, users: { user1: { selections: { fkajsdfjadfaj: 1 jfuueiuhfnalp: 2 } } ... } } my issue my issue how delete user selected player database when user changes mind selection. below code h...

hadoop - Oozie pyspark job -

i have simple workflow. <workflow-app name="testsparkjob" xmlns="uri:oozie:workflow:0.5"> <start to="testjob"/> <action name="testjob"> <spark xmlns="uri:oozie:spark-action:0.1"> <job-tracker>${jobtracker}</job-tracker> <name-node>${namenode}</name-node> <configuration> <property> <name>mapred.compress.map.output</name> <value>true</value> </property> </configuration> <master>local[*]</master> <name>spark example</name> <jar>mapping.py</jar> <spark-opts>--executor-memory 1g --num-executors 3 --executor-cores 1 </spark-opts> <arg>argument1</arg> <arg>argument2</arg> </spark> <ok to="end"/> ...

typescript - Handling animations multiple objects in Angular 2+ -

working on angular app working quite lot of modals in wizard style configuration. i'm using angular-cli make project. here how i'm setting animations: animations:[ trigger('right-center-left',[ state('right', style({ transform: 'translatex(100%)' })), state('center', style({ transform: 'translatex(0)', })), state('left', style({ transform: 'translatex(-100%)', })), transition('right => center', animate('300ms ease-in')), transition('center => left', animate('300ms ease-in')), ]), ], i have 5 divs have class of .modal transitioning through. there button calls nextmodal() , calls prevmodal() . i'm trying when nextmodal() called, current modal slides away, , next 1 slides in. reverse true of prevmodal() function on controller. i've tested using type of call inside template: ...

xmlhttprequest - Javascript variable doesn't maintain its value outside of inner function -

this question has answer here: how return response asynchronous call? 21 answers why variable unaltered after modify inside of function? - asynchronous code reference 6 answers i'm trying write function iterate through api's database using xmlhttprequest ()'s. once response value , add ' info ' div in html, want append value line . however, when console.log(line) , prints out nothing, had instantiated in function before loop. here's code: var line = ''; document.getelementbyid('info').innerhtml = ''; var xhr = []; (i = 1; < 11; i++){ (function (i){ xhr[i] = new xmlhttprequest(); url = "http://pokeapi.co/api/v2/item-category/" + i; xhr[i].open("get", url, true); xhr[i].on...

ios - Record video with custom camera UI but prevent save -

i'm using avcapturefileoutputrecordingdelegate - didfinishrecordingtooutputfileat inside custom camera ui, don't want pass method because video been saved when finish recording. legacy reasons can't save video locally, take in static instance , delete local. how can ? avfoundation framework has following output capture session. avcapturemoviefileoutput - record , output movie file avcapturevideodataoutput - process frames video being captures avcaptureaudiodataouput - process audio data being captures avcapturestillimageoutput - capture still image output since don't want save recorded video file. other best option using avcapturevideodataoutput , each frame on continuous recording video , create video image buffer. make note not have audio output in case. again can add avcaptureaudiodataouput , embed audio separately on our recorded video. workaround not work higher frame rates. best suggestion save video temp folder , delete later.

c# - How do I get a Unique Identifier for a Raspberry PI within Windows 10 IoT Core (Creators Update) -

i tried method (found on https://stackoverflow.com/a/31803247/2427812 ) on windows 10 iot core [version 10.0.15063] (raspberry pi 3) hardwareid result of getid() changes every time device restarts. have idea why should happen? private static string getid() { if (windows.foundation.metadata.apiinformation.istypepresent("windows.system.profile.hardwareidentification")) { var token = hardwareidentification.getpackagespecifictoken(null); var hardwareid = token.id; var datareader = windows.storage.streams.datareader.frombuffer(hardwareid); byte[] bytes = new byte[hardwareid.length]; datareader.readbytes(bytes); return bitconverter.tostring(bytes).replace("-", ""); } throw new exception("no api device id present!"); }

css let text first expand height then width -

is there way text stretches container first in height , if reached max-height proceeds in horizontal direction , expands width? html, body { width: 100%; height: 100%; margin: 0px; padding: 0px; font-family: 'segoe ui', tahoma, geneva, verdana, sans-serif; } .block { border: 1px solid grey; border-radius: 4px; padding: 10px; margin: 12px; max-height: 200px; min-width: 200px; display: inline-block; max-width: 40%; } <div id="container"> <div class="block">lorem ipsum dolor sit amet, consectetur adipisicing elit. itaque alias optio, fugiat porro quo molestiae illo laborum ipsam consequuntur? repudiandae facere pariatur veniam repellat, aliquid dolorum repellendus eum laborum natus.</div> <div class="block">lorem ipsum dolor sit amet, consectetur adipisicing elit. itaque alias optio, fugiat porro quo molestiae illo laborum ipsam consequuntur? repudiandae facere par...

vue.js - Non-scoped styling in components applied only once when switching routes -

Image
vue.js documentation scoped css mentions that you can include both scoped , non-scoped styles in same component i built example application vue-router , used 2 single file components instead of string templates of example - rendering expected. i tried apply both scoped , non-scoped styles in components. in first 1 have <style scoped> div { color: white; background-color: blue; } </style> <style> body { background-color: green; } </style> and second one <style scoped> div { color: white; background-color: red; } </style> <style> body { background-color: yellow; } </style> the idea have whole body background switch when choosing specific route. the scoped styles ok - change depending on route. the non-scoped ones not (screenshots chrome dev tools): on initial application load (non routed yet) background white (which ok - default 1 , there no route / ). when choosing route, style bod...

python - How can I run two docker machines in Jenkins to simulate ssh server and ssh client? -

i'm testing pipeline in ssh client talks many servers gather data them. test software spinning docker machine simulate ssh server. want automate testing in jenkins. how can spin docker ssh servers in jenkins don't act agents rather wait agent contact them ssh request? here's current jenkins pipeline below. dockerfile creates machine runs python script need create docker ssh server talk to. pipeline { agent { dockerfile true } stages { stage('checkout') { steps { checkout([$class: 'gitscm', branches: [[name: '*/master']], dogeneratesubmoduleconfigurations: false, extensions: [], submodulecfg: [], userremoteconfigs: [[credentialsid: 'somecredentials', url: 'a git repo']]]) } } stage('run tests') { steps { sh "python ./rsyncunittests.py" } } } post { failure { sendema...

What is licensing version of automation anywhere -

sorry if not relevant forum. idea license cost estimation of rpa tool automation anywhere. x usd per robot aa(automation anywhere)studio developers building automation solutions.aa runtime responsible executing deployment packages on user machines.coming licensing both studio , runtime carries licensing costs.

c# - How to remove or overwrite where clause in existing IQueryable -

assuming following prefiltered iqueryable: var query = items.where(i => i.propertyname == "some property"); coming third party library, possible either remove clause completely, or replace with: .where(i => i.propertyname == null || i.propertyname == "some property") i've seen mentions of being able rewrite iqueryable on fly. approach have downsides? how go doing it? there better way? update i've managed cobble using expressionvisitor suggested ivan: public class whereremovevisitor : expressionvisitor { protected override expression visitmethodcall(methodcallexpression node) { if (node.method.name == "where" && node.method.declaringtype == typeof(queryable)) return node.arguments[0]; else return base.visitmethodcall(node); } } and: public static class iqueryableextensions { public static iqueryable<t> removewhere<t>(this iqueryable<t> expre...

javascript - React add new props to cloned element with spread operator -

i have container so: const reactcontainer = ({ children, ...rest }) => react.cloneelement(children, rest); now, want add new props - count , flag - cloned elements: so tried this: const reactcontainer = ({ children, ...rest }) => { const count = 0; const flag = false; return react.cloneelement(children, {count, flag}, rest); }; but doesn't work , i've tried other variations. how can add these new props cloned elements keeping spread operator simplicity? please try this: const reactcontainer = ({ children, ...rest }) => { const count = 0; const flag = false; return react.cloneelement(children, {...rest, count, flag}); }; please note in above example ...rest used in component function definition acts rest parameters syntax while in cloneelement acts spread syntax .

javascript - Setting up and inserting data in PouchDb on Ionic 2 -

hi guys im new ionic 2, but know js/ts , fun stuff already. want use pouchdb in ionic app here home.ts file: import { component } '@angular/core'; import * pouchdb 'pouchdb'; import cordovasqliteplugin 'pouchdb-adapter-cordova-sqlite'; @component({ selector: 'page-home', templateurl: 'home.html' }) export class homepage { } pouchdb.plugin(cordovasqliteplugin); var db = new pouchdb('test', { adapter: 'cordova-sqlite' }); function setdata(data) { var todo = { title: data, completed: false }; db.post(todo, function callback(err, result) { if (!err) { console.log('successfully posted todo!'); } }); } function getdata() { console.log(db.alldocs); } here first problem var db = new pouchdb.... is no fuction when put in on startup function error because "setdata" function doesnt know "db" is. how can fix that? , importing stuff right? next question hav...

wpf - How to call docker run from c# application -

i've got wpf application whilst processing file needs use docker process. docker container built on box, after processing file wpf application user has start command prompt , type in docker run --it --rm -v folderdedirect process parameters_including_filepath to further processing. i want include in wpf application. presumably use system.diagnostics.process cmd.exe ? looked @ docker.dotnet couldn't life of me work out how it's supposed run local container.

python - How to implement a QPushbutton to emit pyqt signal and call another class? -

i'm trying learn basic usage of emitting/receiving signals , i'm running trouble. i wanted start basic created mainwindow , put qpushbutton called "plot". when button pushed takes arguments (self, xdata, ydata) , runs method initiateplot class mainwindow(qmainwindow) self.plotbtn = qpushbutton("plot") self.plotbtn.clicked.connect(partial(self.initiateplot, xdata, ydata)) def initiateplot(self,x,y): plotsignal = pyqtsignal(list, list) self.plotsignal.emit(x, y) afterwards tried connect plotter class, "process finished exit code 1" believe error coming particular line of code in below class. self.plotsignal.connect(self.plotdata) code plotter class class createfig(figurecanvas): def __init__(self): #super().__init__(figure(tight_layout=true)) self.figure = plt.figure() self.axes = self.figure.add_subplot(111) self.name = "" # xdata = [1,2,3,4,5] # ydata = [12,4,56,78...

PHP Regex to extract parameters within double square brackets (Modx Tags) -

i'm trying write regex extract value of particular parameter array of content in modx database. format of tags is: [[!video? &path=`_path_to_video` &width=`123` &height=`123` &someotherparm=`bar`]] i trying content of &path parameter using regex: preg_match_all('/\[\[path=`(.*?)`\]\]/', $content, $tags, preg_pattern_order) ; but without luck - returns empty arrays when dump $tags variable. something wrong regex? your pattern doesn't match tag format: preg_match_all('/&path=`([^`]+)`/', $content, $tags, preg_pattern_order); match &path= backtick, then match not backtick until backtick , capture it if need match existence of [[ , closing ]] then: preg_match_all('/\[\[.*&path=`([^`]+)`.*\]\]/', $content, $tags, preg_pattern_order);

javascript - Can't spot my syntax error in React Native? -

Image
i'm trying create table in dynamodb thing is, why getting error says i'm missing , in code. i've tried placing next @ end of .createtable() method , @ end of .init() method doesn't work. here's .js file: // partition key = "user_id" // table name = "user_choice" import react, { component } 'react'; import { connect } 'react-redux'; import { scrollview, text, view, button } 'react-native'; import { logout } '../redux/actions/auth'; import dropdownmenu 'react-native-dropdown-menu'; import icon './icon'; import {dynamodb} 'react-native-dynamodb'; let dynamodb = dynamodb.init({ credentials: { accesskeyid: 'something', secretkey: 'something' } // region: 'us-east-1' - default, optional // version: '20120810' - default, optional }) dynamodb.createtable(params, function(err, data) { console.error("unable crea...

Redis Strategy for Collections Management -

we have situation have object, "affiliate" cache in redis. when calls getaffiliatebyid, first check redis, if available, gets served, else call db made, entry added redis , served. changes affiliate invalidate cache entry. works charm. now imagine call 'listaffiliates' allows 1 skip/take records , in addition has parameters 'include archived' or 'include disabled' affiliates. in addition this, may want include "search term" in call list affiliates matching criteria provided. what best strategy use redis this? here options have evaluated @ our end: build key like: affiliates:skip:{skip}:take:{take}:searchterm:{term}:includearchived:{includearchived}:includedisabled:{includedisabled} , store entire result set key. when makes query using same search criteria again, serve redis. to invalidate, each time "any" affiliate updated, wipe out keys. challenge have wipe out keys start 'affiliates:skip'. know, script call b...

ios - Access list of Podcasts and Episodes (MLMediaSourceType?) on device -

is there way list of podcasts , episodes on ios device? looking in api documentation , seems mlmediasourcetype need. or within mlmedialibrary class. i want way display simple list of podcasts , episodes downloaded locally on ios device within app. thanks in advance!

I got ReferenceError: Firebase is not defined during push the data into Firebase DB in AngularJS? -

how fix error ? //here our controller code var app = angular.module("myapp", ["firebase"]); app.controller("myctrl", function($scope, $firebase, $firebaseobject) { $scope.submitdata = function() { var name = $scope.user; var pass = $scope.password; var firebaseobj = new firebase("https://angulardemo-72e92.firebaseio.com/"); var fb = $firebase(firebaseobj); fb.$push({ name: name,password: pass}).then(function(ref) { console.log(ref); }, function(error) { console.log("error:", error); }); } }); <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <script src="firebase.js"></script> <script src="angularfire.min.js"></script> <script src="app.js"></script> <script> // initialize ...

rest - Is it always relevant to target RESTful design for a public web service/API? -

no doubt restful buzz word , seems cleaver design pattern in many cases. struggling apply own web apis (existing , upcoming) wonder if relevant (if forget fact in rfc's try respond ;)). first of i'm dealing dynamic data determined @ least 3 parameters, possibly 10. think instance web api performing sound effects , format conversion (equalize, echo, volume, speed, ...). need send credentials, undeterminated set of effect name , settings , sound equalize. the url effectmaker/echo/10pct/equalizer/20khz/-10pct/output-rate/192kbps/ some parameters in http header (response format instance) the sound in body. so, functions defined http methods + url root , parameters in body, url tail , header. not seems convenient, neither me nor developers discovering api. besides that, caching ability not make sens of users request unique. so, i'm asking if i'm wrong thinking should try integrate makes sens in rest "philosophy" (stateless, discoverable, ....

Acumatica SOAP API release payment status error -

i'm working on releasing acumatica payment via soap api documented on page 117 of i210 contract based web services guide here . have implemented code manual spec when release payment i'm getting error: tx error #3: document status invalid processing. @ px.objects.ar.arpaymententry.release when @ status of newly created payment, has status balanced believe should able released. there status payment needs in order released? my code: //creates order attach payment salesorder neworder = (salesorder)await client.putasync(ordertobecreated); var woopaymentref = "test"; //create payment order payment paymenttobecreated = new payment() { type = new stringvalue { value = "prepayment" }, status = new stringvalue { value = "open" }, paymentmethod = new stringvalue { value = store.acumaticapaymentmethod }, paymentamount = new decimalvalue { value = convert.todecimal(wooorder.order.total) }, customerid = neworder.custo...

excel - Comparing Cells in a variable number of Columns -

so i've been asked compare data in chart number of columns can variable, 20, i'm told change i'd leave dynamic possible. the goal make sure of cells in row contain exact same strings, or blank. if there 5 columns, 3 have data "good" , other 2 blank, fine. the chart start in upper left corner , have both header rows , row names. i thought compare each cell first cell in each row, can't seem figure out how compare variable cells. i pretty new using vba , entirely self taught, may on wrong track here. here's sample code, know i'll need couple of loops working, wanted part working first. sub row_checker() dim col_count integer dim integer range("a1").select range(selection, selection.end(xltoright)).select col_count = application.worksheetfunction.counta(selection) selection.end(xltoright).select activecell.offset(1, 1).range("a1").select = 2 col_count if ("b" ...

Error converting set statusbarPanel text from VB6 to VB.NET -

i have code in vb6 follows: stbstatusbar.panels("monitor").text = "monitor initializing" now i'm converting code vb.net follows: stbstatusbar.items.item("monitor").text = "monitor initializing" but doesn't set values. appreciated. although hard understand code 1 line, think forgot name statusbar panel in designer form in vb.net. check if panels name "server" exist. if not should name follows: stbstatusbar_panel.name = "server" and add panel in statusbar.

multithreading - How to run Rails multi-threaded in development? -

i working on multiple projects talk each other , i've run issue app a calls b ( request 1 , still running) b calls ( request 2 ) based on request 2 's result, b responds request 1 this requires me running multi-threaded rails in development mode. i know can set using puma or ... isn't there simpler way? i avoid changing in project (adding gems, config files..). something rails s --multi nice, can't webrick run multiple threads or spawn more processes? can perhaps install standalone gem need , run thin run . -p 3 ? you can configure app multi-threaded un-commenting following line production.rb: # config.threadsafe! if run rails_env=production bundle exec rails server you'll start in production mode multi-threading. you'll have cross puma bridge either way, though, if , when deploy production server.

python - Use sockets to connect and download webpage of hidden service -

socks.setdefaultproxy(socks.proxy_type_socks4, "127.0.0.1", 9150, true) socket = socks.socksocket() socket.connect(('onionlink.onion', 80)) message = 'get / http/1.0\r\n\r\n' socket.sendall(str.encode(message)) reply = socket.recv(4069) print (reply) this code works response empty... terminal prints this: b'' is there wrong? how can print source of hidden service? solved. needed add http:// message = 'get / http/1.0\r\n\r\n' so is: message = 'get http://onionlink.onion http/1.0\r\n\r\n'

python - Difference between a loaded module and an initialized module? -

in reference manual stated that: a complete python program executed in minimally initialized environment: built-in , standard modules available, none have been initialized, except sys (various system services), builtins (built-in functions, exceptions , none) , __main__ . i uncertain "initialized" supposed mean here. thought module initialized if loaded , present in sys.modules : this dictionary maps module names modules have been loaded. apparently, wrong because sys.modules contains many other modules: python -c "import sys; print(sys.modules.keys() - {'sys', 'builtins', '__main__'})" {'_stat', 'encodings.aliases', '_sitebuiltins', '_thread', 'io', '_weakrefset', 'genericpath', 'encodings.utf_8', 'codecs', 'os', '_weakref', '_codecs', '_frozen_importlib', '_io', '_frozen_importlib_external', '...

ios - Building a multiarch app with Xcode -

i trying called fat binary ios app. so, defined in xcode: architectures : standard (arm64 armv7) build active architecture : no valid architecures: arm64 armv7 and build process succeeded. output file app.ipa . but, have problem compability on 32 bit devices. so, investigate app.ipa : lipo -info app.ipa . actually, says is non-fat arm64 file. but why? after all, configured correctly. when create empty project , set conifg above works. how resolve it? if looking creating fat framework/library, adam's answer post: build fat static library (device + simulator) using xcode , sdk 4+ might you

After enabling Zuul proxy for the Spring boot app (We have set of miroservices), spring mvc interceptor doesnot work -

below application.java. has code invoke interceptor @enableeurekaclient @springbootapplication @enablezuulproxy public class application extends webmvcconfigureradapter { public static void main(string[] args) { springapplication.run(application.class, args); } @bean public tokenvalidateinterceptor tokenvalidateinterceptor() { tokenvalidateinterceptor localechangeinterceptor = new tokenvalidateinterceptor(); system.out.println("in web mvc intereptor, interceptor returned"); return localechangeinterceptor; } @override public void addinterceptors(interceptorregistry registry) { system.out.println("in web mvc intereptor"); // registry.addinterceptor(tokenvalidateinterceptor()).addpathpatterns("/"); registry.addinterceptor(tokenvalidateinterceptor()).addpathpatterns("/api/**"); // registry.addinterceptor(new // tokenvalidateinterceptor()).addp...

ios - Set time (Hours, minutes) on Date object -

i'm trying let user pick date calendar , set time want reminded on date. i date code: func handlecellselected(view: jtapplecell?, cellstate: cellstate){ guard let validcell = view as? calendarcell else {return} if validcell.isselected{ validcell.selectedview.ishidden = false if userpickeddate { self.formatter.dateformat = "yyyy mmmm dd, hh:mm" dateselected.text = formatter.string(from: cellstate.date) this produces output of selected date 00:00 in time. want user able change hours , minutes somehow, picker, later reminded on date , time. ideas on how change hours , minutes inside cellstate.date? you can set datepicker's date cellstate's date, , can allow datepicker select hours , minutes. resulting date datepicker selected time on date set to. can grab date , save you'd like.

webpack - Unexpected token when compiling ES6 to ES5, what's going on? -

i'm trying upgrade cljsjs package react-toolbox requires compiling whole project es6 es5. i'm getting error: hash: b375d2042d9b41b2ee59 version: webpack 2.7.0 time: 95ms asset size chunks chunk names react-toolbox.inc.js 27.7 kb 0 [emitted] main + 1 hidden modules error in ./packages/react-toolbox/src/components/index.js module parse failed: /users/pupeno/.boot/cache/tmp/users/pupeno/documents/code/clojure/packages/react-toolbox/ah7/x50qw4/react-toolbox-react-toolbox-2.0.0-beta.12/packages/react-toolbox/src/components/index.js unexpected token (24:7) may need appropriate loader handle file type. | export { default progressbar } './progress_bar'; | export * './radio'; | export ripple './ripple'; | export { default slider } './slider'; | export { default snackbar } './snackbar'; ripple seems offending token. ideas what's going on? the full file contains: import './utils/pol...

osx - Install certificate in login keychain with swift 3 on MacOS -

i have cocoa project, building macos app. won't distribute on apple store. what should use in swift 3 install certificate in login keychain, trusted, command ? security add-trusted-cert -k ~/library/keychains/login.keychain-db ca-cert.cer i have ca-cert.cer , ca-cert.pem created. i know authorization api , saw in apple documentation method https://developer.apple.com/documentation/security/1401659-secitemadd , doc https://developer.apple.com/documentation/security/certificate_key_and_trust_services/certificates/storing_a_certificate_in_the_keychain first create der version of pem openssl x509 -outform der -in ~/ca-cert.pem -out ~/ca-cert.der then following code install certificate in login keychain won't trusted. { let cerdata = nsdata(contentsoffile: homedirurl.path + "/ca-cert.der") let certificate: seccertificate? = seccertificatecreatewithdata(nil, cerdata as! cfdata) let addquery: [string: any] = [ksecclass string...

android - Changing Text Color of Specific PreferenceScreen in PreferenceFragment -

so have preferencefragment couple of preferences in there so: <preferencescreen xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android"> <preferencecategory android:title="menu" android:key="menu"> <preferencescreen android:title="pref1" android:key="pref1" /> <preferencescreen android:title="pref2" android:key="pref2" /> </preferencecategory> </preferencescreen> if want change color of "pref2" can red, how it? i've looked @ couple of different solutions. 1 of them create it's own layout. tried that: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent...

node.js - how to go to function directory in firebase cloud function in command prompt -

Image
this command prompt i have done using tutorial in tutorial ls -la is used. when use not working. this code image if want enter function directory can cd (change directory) cd functions .

docker - Sharing data-volume for shared maven repository -

i have multiple maven projects, of on dependend on other. projects being build in dedicated build-image , being build via jenkins. my plan have shared data volume contains maven repository folder, in dependecies should stored , own dependency should installed in. unfortunatly alread fails while building dependency. reference, jenkinsfile: node { stage ('initializing') { checkout scm } stage ('build artifact') { sh 'docker build -f="dockerfile" -t build-image .' sh 'docker create --name build-james-plugin-interface --volume m2-repo:/root/.m2 build-image' sh 'docker rm build-james-plugin-interface' } } and dockerfile of build-image: from qnerd/rpi-maven env build_home=/usr/local/james/ run mkdir -p $build_home workdir $build_home add pom.xml $build_home # add source add . $build_home # run maven verify entrypoint ["mvn","clean","install"] ...

sql server - Convert DATETIME to 8 digit INT in format YYYYMMDD SQL -

need join 2 tables. 1 table has 'datekey' column int in format yyyymmdd dimdate table, , other table has 'createdon' column datetime. casting datetime date because way group seems work correctly. keep getting error "operand type clash: date incompatible int" because of "on d.datekey = bbb.datekey" line.. suggestions on easy workaround? select distinct convert (date,convert(char(8),d.datekey )) date , isnull(bbb.reccount,0) dimaccount dimdate d left outer join( select cast(createdon date) datekey , count(*) reccount dimaccount group cast(createdon date) )bbb on d.datekey = bbb.datekey d.datekey '2017%' group d.datekey ,bbb.reccount having max(datediff(dd, convert(date, cast(d.datekey char(8)), 101), getdate())) > -1 order date desc something should started from dimdate dd join dimaccount da on cast(da.createdon date) = cast(cast(dd.datekey char(8)) date) dd.year = 2017 -- or can f...

python - ProgressBar Start at 1 Instead of 0 -

i have progress bar looks this: employees = ["1g8764897", "1j6734897", "1j5292897"] jobs = len(employees) print widgets = ['processed: ', counter(), ' of ', str(len(employees)), ' profiles (', timer(), ')'] pbar = progressbar(widgets=widgets) in pbar((i in employees)): time.sleep(.01) fetchdata(i) print "done" but when runs, finishes "2 out of 3 completed". 3 out of 3 completed, , start counting @ 1 instead of 0. cant figure out how life of me, appreciated.

material design - Android Wear 2.0 styled switches -

i'm making watch face android wear watch , in config activity want switch. switch looks usual android switch ( picture 1 ) want new switchs in android wear 2.0 ( picture 2 ). how did google them? the switch in picture 2 switchpreference (at least currently) supported in preferencefragment .

java - Spring boot http requests open threads that never close -

i trying performance testing of boot app prior releasing it, running test see memory usage, thread count etc. noticing make http requests endpoints of app (including actuate endpoints) see "xnio-2 task-n" threads created , never cleaned up. java version = "1.8.0_66" gradle version = 3.5 springbootversion = '1.5.4.release' server = undertow neither rest controller nor service open additional threads. have looked @ following: https://github.com/googlemaps/google-maps-services-java/issues/261 not using geoapi. name: xnio-2 task-46 state: waiting on java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobject@7155b807 total blocked: 0 total waited: 1 stack trace: sun.misc.unsafe.park(native method) java.util.concurrent.locks.locksupport.park(locksupport.java:175) java.util.concurrent.locks.abstractqueuedsynchronizer$conditionobject.await(abstractqueuedsynchronizer.java:2039) java.util.concurrent.linkedblockingqueue.take(linkedblock...

require - Import ReactJS Component in browser as a Script -

Image
i wrote component in reactjs renders tree unable import directly browser , keep getting error: uncaught error: module name "treecomponent" has not been loaded yet context: _. use require([]) http://requirejs.org/docs/errors.html#notloaded @ makeerror (require.js:5) @ object.o [as require] (require.js:5) @ requirejs (require.js:5) @ reactjs_returnreactjs.action:2192 babel preset react-app: "babel": { "presets": [ "react-app" ] }, entry point build index.js: export {default} './components/treecomponent'; can me find out wrong in build steps? if export react component in treecomponent.js way export default treecomponent({ }); or this exports.default = treecomponent; you need import way import { treecomponent } './components/treecomponent'; or can way too import treecomponent './components/treecomponent/treecomponent';

microsoft graph - "List ownedDevices" doesn't return all my devices -

i tried list owneddevices api using graph explorer , don't see devices own. see desktop when query https://graph.microsoft.com/v1.0/devices ?$filter=displayname eq 'mydesktopnamehere'. where user-device mapping defined? why list owneddevices result incomplete? there relationship between user joined/registered device , device via corresponding 'owner' attribute. there 1 case (the domain joined case) there no user owner, , because domain joined devices automatically register azure ad using own computer accounts (even in absence of user logged on). if interested, these ways device registered azure ad: domain joined devices registered azure ad: traditionally domain joined devices (to ad on-premises) automatically register azure ad. windows 10 computers registration happens in absence of user there no user owner these computers (the owner computer account on-prem). azure ad joined devices: when configure windows 10 device out-of-box-experience (oob...

android - How can I redraw an Anko frameLayout when my model changes? -

i have anko component create view code this: override fun createview(ui: ankocontext<t>) = with(ui) { framelayout { var imgview = imageview(r.drawable.ic_1).lparams { horizontalmargin = ... topmargin = ... width = ... height = ... } imgview.backgroundcolor = gamemodel.colour } } the background of imgview depends on colour in model. let's imagine update model elsewhere. how 'refresh' anko component ui reflect new gamemodel.colour ? i've never done android before seems 1 use either invalidate() or requestlayout() don't seem work.

Apps Script set ActiveUser and timestamp -

please setting active user in column n. script timestamp column m whenever cell in row updated. however, nothing updates in column n active user. function onedit() { var s = spreadsheetapp.getactivesheet(); if( s.getname() == "log" ) { //checks we're on correct sheet var r = s.getactivecell(); var user = session.getactiveuser().getemail(); if( r.getcolumn() != 13 ) { //checks column var row = r.getrow(); var time = new date(); time = utilities.formatdate(time, "gmt-07:00", "yyyy-mm-dd, hh:mm:ss"); spreadsheetapp.getactivesheet().getrange('m' + row.tostring()).setvalue(time); spreadsheetapp.getactivesheet().getrange("n" + row.tostring()).setvalue(user); } }; }; am using setvalue(user) incorrectly? your call setvalue() looks fine. may encountering authorization issue. can run same code outside of onedit() trigger? there restrictions on actions can performed inside of onedit trigger. see htt...

Google Calendar API in iOS and Cross Client Authorization -

we have ios app uses google oauth ask users permission google calendar using embedded browser. user logs in via app , grants permission calendar(s), oauth authorization's refresh token , calendar id's stored in encrypted database. using refresh token , calendar id's - calendar items displayed on separate web application (without having request clients credentials again). worked great until google authorization requests in embedded browsers blocked on april 20 year. until time used single oauth client id , used client id & secret in both ios , web app. however, after april 20th, had create separate ios client key. issue although within ios app able ask users calendar permissions using code: oidauthorizationrequest *request = [[oidauthorizationrequest alloc] initwithconfiguration:configuration clientid:googlecustomkey scopes:@[oidscopeopenid, oidscopeprofile, oid...

java - Getting list of tasks from Hadoop Job object -

using hadoop 2.7.3. i'm trying information on specific tasks freshly completed hadoop job. specifically, tasks failed, if any. tried both gettaskcompletionevents , gettaskreports - both of methods return empty list, regardless of job's exit status. causing this? alternately: there other way information failed tasks? is, if task attempt fails due exception, how exception?