Posts

Showing posts from February, 2013

r - plotting data with a series of start end dates -

Image
how go plotting data series of start end date bands? i have dataframe looks like: start<-as.posixct(c("2017-07-13 01:40:00 mdt", "2017-07-21 06:00:00 mdt", "2017-07-21 14:00:00 mdt", "2017-07-24 11:00:00 mdt", "2017-07-24 12:00:00 mdt", "2017-07-25 05:00:00 mdt", "2017-07-25 17:00:00 mdt", "2017-07-26 12:00:00 mdt", "2017-07-30 12:00:00 mdt", "2017-07-31 04:00:00 mdt", "2017-07-31 15:00:00 mdt", "2017-08-03 18:30:00 mdt", "2017-08-03 23:30:00 mdt", "2017-08-09 05:00:00 mdt", "2017-08-09 20:00:00 mdt", "2017-08-14 09:00:00 mdt", "2017-08-16 05:00:00 mdt", "2017-08-16 07:00:00 mdt", "2017-08-16 19:00:00 mdt", "2017-08-17 18:00:00 mdt", "2017-08-20 05:00:00 mdt", "2017-08-23 06:00:00 mdt", "2017-08-23 14:00:00 mdt&quo

css - How to animate the icon of a jQuery Mobile collapsible heading? -

trying use standard icons of jquery mobile nice rotation animation when collapsible collapsed or expanded, i'm getting strange result, whole collapsible title in heading rotated. in ideal solution, use predefined jqm icon classes, without need add additional style purpose. example: icon-carat-u , icon-carat-d rotating 180 degrees animating when collapsible expanding , collapsing, respectively. moreover, try avoid use click event, because collapsible icon should animate when using in code collapsible("expand") or collapsible("collapse") . here code: .ui-icon-carat-d { transform: rotate(-180deg); transition: .3s; } .ui-icon-carat-u { transform: rotate(0deg); transition: .3s; } <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="stylesheet&quo

How to Run Different Product Flavors in Android Studio -

Image
i'm writing first android app, , i'm getting started product flavors. have ad-supported app in beta, , i'm writing paid version no ads. can compile both flavors, think. when open gradle window, see targets "compile adsdebugsources" , "compile premiumdebugsources." now, if double-click on either of those, build runs completion without error, can't figure out how run results. if click on green "run" arrow @ top of screen, can never run premium app. there's 1 entry, "app" results in apk being installed , run on attached device, , it's adsdebug version. guess need add new configuration, can't find documentation mentions word "flavor." i've tried adding configuration, don't understand questions mean. looked @ settings default app, don't seem mean much. how tell want premium version of app? or problem have nothing configurations? i've noticed when @ build/edit flavors 2 flavors

oop - Python: Access base class "Class variable" in derive class -

i trying access class variable base class in derived class , getting no attributeerror class parent(object): variable = 'foo' class child(parent): def do_something(self): local = self.variable i tried using parent.variable did not work either. getting same error attributeerror: 'child' object has no attribute 'child variable' how resolve this i'm not sure you're doing wrong. code below assumes have initialization method, however. class parent(object): variable = 'foo' class child(parent): def __init__(self): pass def do_something(self): local = self.variable print(local) c = child() c.do_something() output: foo

amazon web services - AWS IoT + SNS: Email not sending -

i'm following aws tutorial on how configure , test rules . thing i'm doing differently setting email rule (instead of sms). have setup , subscribed sns topic. i've created rule, , used aws iot mqtt client publish test topic matched rule. no email sent. how can troubleshoot this? the odd thing tried same tutorial 3 days ago , worked fine.

python - One-liner to remove duplicates, keep ordering of list -

this question has answer here: how remove duplicates list in whilst preserving order? 33 answers i have following list: ['herb', 'alec', 'herb', 'don'] i want remove duplicates while keeping order, : ['herb', 'alec', 'don'] here how verbosely: l_new = [] item in l_old: if item not in l_new: l_new.append(item) is there way in single line? you use ordereddict , suggest sticking for-loop. >>> collections import ordereddict >>> data = ['herb', 'alec', 'herb', 'don'] >>> list(ordereddict.fromkeys(data)) ['herb', 'alec', 'don'] just reiterate: seriously suggest sticking for-loop approach, , use set keep track of seen items: >>> data = ['herb', 'alec', 'herb', 'don'

Azure Automation Credentials using Azure Key Vault secrets -

is there way create azure automation credential asset links azure key vault secret? similar question certificate in azure automation. i want able store passwords , such in 1 place, key vault, when change don't have change in bunch of places. cannot find documentation indicates possible though. missing it? thank suggestions.... you can't link credential asset directly key vault, should possible write script connects key vault , updates appropriate automation credentials there. this either fired on schedule, webhook, or picking key vault events new event grid (presuming wired up)

cmd - Wix bundle runs a compiled BAT file at the end, that force shutdown -

this simplistic example of problem: i have simple bundle <chain> <exepackage sourcefile="c:\users\this\desktop\aaa\eee.exe"></exepackage> </chain> the eee.exe result of iexpress of 2 files eee.bat eee.txt iexpress runs cmd /c eee.bat eee.bat stuff finishes line shutdown -r -f -t 0 once result of wix, installer, run forces reboot rerun instller how can change behaviour of not rerun installer after reboot forcing restart in middle of installation not practice. comments post pointed out, interrupting own installer. instead, can use successful exit code (0) tell installer reboot. <chain> <exepackage sourcefile="c:\users\this\desktop\aaa\eee.exe"> <exitcode value="0" behavior="forcereboot"/> </exepackage> </chain> don't forget take shutdown line out of bat file.

jboss6.x - Ansible logrotate role issue -

so first post here, , i'm new ansible. here want: i want use logrotate on jboss server, have downloaded role here: https://github.com/nickhammond/ansible-logrotate ans installed on ansible server. i want file named jboss in /etc/logrotate.d directory contain following line : /opt/jboss/domain/log/*.log { daily dateext rotate 15 compress missingok ifempty copytruncate } /opt/jboss/domain/servers/slot*/log/*.log { daily dateext rotate 15 compress missingok ifempty copytruncate } this playbook run result want: roles: - role: logrotate logrotate_scripts: - name: jboss path: /opt/jboss/domain/log/*.log options: - daily - dateext - rotate 15 - compress - missingok - ifempty - copytruncate - name: jboss pat

SQL Server FOR JSON Path Nested Array -

we trying use json path in sql server 2016 forming nested array sql query. sql query: select a, b.name [child.name], b.date [child.date] table 1 join table 2 on table 1.id=table 2.id json path desired output: [{ a:"text", "child:"[ {"name":"value", "date":"value"}, {"name":"value", "date":"value"} ] }] however getting is: [{ a:"text", "child:" {"name":"value", "date":"value"} }, { a:"text", "child":{"name":"value", "date":"value"} }] how can use json path form nested child array. instead of join use nested query, e.g.: select a, child=(select b.name [child.name], b.date [child.date] table 2 table 2.id=table 1.id json path) table 1 json path (the query in question broken af query broken sho

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -

i building shipping system ecommerce site using doctrine. have appropriate shipping methods , prices based on product , region data in checkout. i using following code querybuilder: $shippingpricereccords = $this->em->createquerybuilder() ->select('price') ->from('ordershippingprice', 'price') ->innerjoin('ordershippingmethod', 'method', 'price.fkordershippingmethod = method.id') ->innerjoin('ordershippingmethodregionmapping', 'map', 'map.fkordershippingmethod = method.id') ->where('price.fkproducttype = :fkproducttype') ->andwhere('price.fkbrand = :fkbrand') ->andwhere('map.fkregion = :fkregion') ->setparameters([ 'fkproducttype' => $fkproducttype, 'fkbrand' => $fkbrand,

php - How can I set my wordpress post listing to show excerpt from the post content? -

i'm using wordpress 4.8.1 , have familiarity how wp works. have page lists posts , shows title , date posts in listing, user can click on post title go detail page showing posts content. question have how can modify php page displays posts ( ) under title post shows brief bit of posts content? i've read couple of similar questions on stackoverflow nothing seems have answer. i can see page displays posts appears page.php , template parts uses /frameworks/header/header-v1.php , /frameworks/template/blog/content-page.php none of attempts make edits of these pages show though. tried adding class thought line renders link article (the hyperlinked title) no luck. light can shed on this. use the_excerpt() function in template file display excerpt in posts loop.

asp.net mvc - How to update a table row, given the RowID and the Value to update. MVC C# Linq -

here code. paypal sends actionresult rowid item_number , transaction id pp_txn_id . simple want reference row in transaction table, tblpaypaltransactions , , update pp_txn_id see sent me after purchase in paypal. photo links sent downloadpicture.cshtml view. i can't figure syntax out update transaction table. else can do. stuck here trying finish project. //row in photos item_number, paypal paid transaction pp_txn_id public actionresult thankyou(string item_number, string pp_txn_id) { var photo = db.paypaltransactions.where(x => x.rowid == convert.toint32(item_number)); photo.pp_txn_id = pp_txn_id; db.submitchanges(); var thispaidphoto = (from p in db.photos p.photoid == convert.toint32(item_number) select p).firstordefault(); return view(thispaidphoto); } your current code have compilation errors because where method returns collection. photo variable collection type , not have pp_txn

multithreading - How to implement a Timer inside thread in Java -

i'm coding interviewer app in java , need implement new thread started interview. have, example 10 questions show , i'll iterating questions, when start "quiz" must start counting 20 minutes , need show resting time questions. note: it's terminal application. how may implement 20 minutes timer running in thread , how show countdown (or up) continuously?

ReactJS, import files within render() -

i need import files (pdfs in case, svgs later) <embed> element. iterating on list of props send me path pdf. when imported @ head of component, , injected works fine expected. however, need dynamically set these paths, , know cannot import inside render. using paths gives me no result. does not work: // pdf.src = './path/to/file.pdf' {project.projectpdfs.map((pdf, index) => <embed classname="pdf-viewer" src={pdf.src} width="100%" key={index} /> ) } works: import pdf './path/to/file.pdf'; {project.projectpdfs.map((pdf, index) => <embed classname="pdf-viewer" src={pdf} width="100%" key={index} /> ) } app bootstrapped create-react-app have url-loader, not sure else going on under hood. create-react-app using webpack build app. url of file changed after built. import pdf './path/to/file.pdf'; change file path hashed string , stored pdf . have no error in se

android - DataNucleus: which version runs on java 1.7? -

trying datanucleus 5.1.1 on android, got runtime error: caused by: java.lang.noclassdeffounderror: failed resolution of: ljava/time/localdate; @ org.datanucleus.classconstants.<clinit>(classconstants.java:72) ~[na:na] @ org.datanucleus.util.localiser.<clinit>(localiser.java:87) ~[na:na] @ org.datanucleus.util.localiser.registerbundle(localiser.java:100) ~[na:na] @ org.datanucleus.api.jpa.jpaentitymanagerfactory.<clinit>(jpaentitymanagerfactory.java:99) ~[na:na] @ org.datanucleus.api.jpa.persistenceproviderimpl.createentitymanagerfactory(persistenceproviderimpl.java:104) ~[na:0.0] @ javax.persistence.persistence.createentitymanagerfactory(persistence.java:79) ~[na:0.0] the class java.time.localedate available on java 1.8. android 7 (api 24) support java 8 except special cases, right? you don't seem have done research question. if go this page on website shows last version supports jre v1.7 datanucleus v4.x. because jre 1.7 end-of-life

javascript - MixItUp 3 animations isn't working -

i updated portfolio website , converted mixitup portfolio 2 3. however, animations acting weird. every time click on filter link, of portfolio projects fly on "portfolio" title while fading in. don't effects. can tell animation working when adjusted duration, however, don't know how fix rest make looks normal demo: https://www.kunkalabs.com/mixitup/ here's can see animations wrong: http://kikidesign.net/portfolio my javascript code is: <script> var containerel = document.queryselector('.mixitup-list'); var mixer = mixitup(containerel, { //mixitup 3 options, 'item' matches class in php animation: { duration: 800, nudge: false, reverseout: false, effects: "fade scale(0.41)" } }); </script> it's located in footer.php. i figured out problem. it's height. specific height of each portfolio piece 100% , thus, messed animations.

html - CSS not working on 000webhost -

i started simple website on 000webhost. uploaded following index.html file: <!doctype html> <html lang="en"> <head> <title>tabs</title> <meta charset="utf-8"> <meta name="description" content="bootstrap."> <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> </head> <body style="margin:20px auto"> <div class="container"> <div class="row header" style="text-align:center;color:green"> <ul class="nav na

php - sql error when seeding Specified key was too long for email -

hi started new project in laravel it's latest version 5.4, i'm getting error when seeding database single user , i'm getting error [illuminate\database\queryexception] sqlstate[42000]: syntax error or access violation: 1071 specified key t oo long; max key length 1000 bytes (sql: alter table users add unique users_email_unique ( email )) [pdoexception] sqlstate[42000]: syntax error or access violation: 1071 specified key t oo long; max key length 1000 bytes user::create([ 'name' => 'someone' 'email' => 'someone@outlook.com', 'password' => bcrypt('mypassword'), ]); <?php use illuminate\support\facades\schema; use illuminate\database\schema\blueprint; use illuminate\database\migrations\migration; class createuserstable extends migration { /** * run migrations. * * @return void */ public function up() { schema::create('users', functi

How do I dynamically run a React Native app inside another React Native app? -

can done besides basic integration of code? ideally, rn app should able dynamically download bundle of nested app server. should execute bundle inside kind of customized root in view. should have basic life cycle control on nested app. technically possible? you looking codepush . the root component of application have wrapped codepush's higher-order component: import codepush "react-native-code-push"; class myapp extends component { } myapp = codepush(myapp); then can release js bundle updates time cli: code-push release-react <appname> <platform>

tidyverse - Recursive map for tree-list structure in R -

i have tree structure lists in r (lists of lists of arbitrary depth). formed taking multidimensional array in r , using function array_tree purrr package. apply function tips of tree (e.g., recursive map) without having flatten structure. how can this? i realize at_depth , vec_depth functions looking for. at_depth(a, vec_depth(a))

perl - How to match part of postfix log with regex? -

i need match following part of postfix log using grep. aug 6 16:00:35 d1234567-002-e3 postfix/smtp[16032]: 3e60c7832 ^^^^^^^^^^ so far way i've been able using negative lookahead, that's not allowed in current implementation of grep (not using perl regex). i assumed along lines of... (not complete solution) .*:.*:.*: $ s="aug 6 16:00:35 d1234567-002-e3 postfix/smtp[16032]: 3e60c7832" for sed solution, $ sed -e 's/.*]: //' <<< "$s" for grep solution, $ grep -op ']: \k.*' <<< "$s" for awk solution, $ awk '{print $nf}' <<< "$s"

azureservicebus - What is the purpose of "EnableSubscriptionPartitioning" property in an Azure Service Bus Topic? -

when comes partitioning in azure service bus topic, there 2 properties: enablepartitioning , enablesubscriptionpartitioning . it clear me enablepartitioning property does. based on understanding of property, when property set true, topic in question partitioned across multiple message brokers. what not able find concrete information on enablesubscriptionpartitioning property. documentation looked @ describes property as: value indicates whether partitioning enabled or disabled. furthermore when create topic property set true (and enable partitioning property set false) topic created me 118784 mb in size ( maxsizeinmegabytes property). here's response xml when fetch topic's properties. <entry xml:base="https://namespace.servicebus.windows.net/$resources/topics?api-version=2016-07"> <id>https://namespace.servicebus.windows.net/gauravtesttopic?api-version=2016-07</id> <title type="text">gauravtesttopic</tit

javascript - Use Google Spreadsheet as data source for Chart.js -

is possible use google spreadsheet datasource when using chart.js ? i'd use chart.js create line chart multiple lines, , i'd user able view lines @ once or select ones display. seems simple chart.js, however, i'm wondering how make chart updatable client. the client has dataset in google spreadsheet update regularly, i'd have chart on website update along spreadsheet. would need export google spreadsheet json file? yes can. https://developers.google.com/sheets/api/v3/data can retrieve google spreadsheet data using api , present returned data in chart.js.

linux - Server sends TCP packets without receiving ACK from client -

i have ios chat app talking java xmpp chat server via tcp socket. server machine(machine 1) running redhat linux. moved chat server linux machine(machine 2) similar configuration except had more processors. way server works once receives particular data client(data1) sends 2 xml packets client(data2 , data3). looking @ packets in wireshark, see below consistent behavior in machine1. ios app java server syn --> <-- syn,ack ack --> tcp handshake ends here data1 --> <-- ack <-- data2 ack --> <-- data3 ack --> but in machine2 works below.(not of time) ios app java server syn --> <-- syn,ack ack --> tcp handshake ends here data1 --> <-- ack <-- data2 <-- data3 ack --> ack --> as seen above ack 2 packets sent @ once client. why

c# - Search functionality for an Asp.net gridview without using database -

i using gridview , bind data sharepoint list. i want know how use search functionality gridview don't have database. (and solutions see use database) is there other solution apart jquery plug-in datatables?? kindly help! :) i suggest search through sharepoint list, not gridview. using (spweb web = spcontext.current.web) { splist list = web.lists["list"]; string title = "line search"; splistitemcollection items = list.getitems(new spquery() { query = @"<where><eq><fieldref name='title' /><value type='text'>" + title + "</value></eq></where>" }); if (items.count > 0) { mygrid.datasource = items.getdatatable(); mygrid.databind(); } }

javascript - node fs (filestream) creating 2 files when uploading single file -

Image
i using following code allow people upload images server: app.post("/api/upload", function (req, res) { fs.readfile(req.files[0].path, function (err, data) { console.log('the data file..', data); if (err) { res.send(err).end(); } else { // ... var newpath = __dirname + "/uploads/" + req.headers["account_id"] + '_' + moment().format('mm_dd_yyyy_hh-mm-ss') + '_' + req.files[0].originalname; fs.writefile(newpath, data, function (err) { console.log('file written'); if (err) { res.send(err).end(); } else { res.send({ success: true, file: newpath, files: req.files }).end(); } //res.end({"success": true}) }); } }); }); the problem evey file gets uploaded getting arraybuffer version (i think) see image: how can prevent this, , of all, why happe

api - ReactJS - App Issues after Deployment -

i started first website reactjs. question 1 on localhost run backend on port=3001 , app on port=3000 . using react-scripts build created build frontend, looks "proxy": "http://localhost:3001" not taken under consideration when creating build. now after deployment on server api calls returning 404 never go port 3001. how can pass proxy build? question 2 on local machine run react-scripts start can directly access http://localhost:3000/login , on server have start http://example.com/ , use navigation login. how can better handle urls? thank you, vanessa

python - FTP OS.Walk goes into endless loop -

simply trying list files remote ftp folder contains 1 file ( /public_html/data/ ['testfile.txt'] ). os.walk returns same filename on , on in endless loop until don't manually interrupt. code is: import ftptool f a_host = f.ftphost.connect("someftpsite", user="user", password="pass") (dirname, subdirs, files) in a_host.walk("/public_html/data"): print (dirname, files) output looks this: /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/data/ ['testfile.txt'] /public_html/dat

excel - Calculate time elapsed between cells -

i'm looking way calculate time elapsed (passed) between 2 reoccurring events. excel sheet looks this. cell cell b cell c 1 14-aug-17 8:59:13 pm quota recovery 2 14-aug-17 8:56:12 pm quota violation 3 14-aug-17 6:00:12 quota recovery 4 14-aug-17 5:36:12 quota violation 5 14-aug-17 4:00:12 quota recovery 6 14-aug-17 3:51:12 quota violation something simple b1-b2 give me desired result 1 entry have close thousands cells need perform same calculation on. is possible automatically calculate , add time between each violation , recovery whole excel sheet give me total amount of time quota violated? =sumproduct(((a1:a6)+(b1:b6))*(c1:c6="quota recovery"))-sumproduct(((a1:a6)+(b1:b6))*(c1:c6="quota violation")) similar pnuts comment, using array function , bypassing helper cell. since array formula, make sure define range need.

Chat app - using Swift3, Alamofire, mySQL, php API -

Image
can me? swift newbie here. need develop chatting function in app.. use ‘chatto’ not understand library. db mysql , communicate using alamofire. have php api communicates mysql. includes user’s chat information. if ever used chatto or there better way create chat app? ( chatto link : https://github.com/badoo/chatto ) 1. if using chatto ( chatto essue : https://github.com/badoo/chatto/issues/349 ) didn't understant how using it.. i've followed chattoapp example, not understand how fakedatasource, fakemessagefactory, etc. work. i using swift3, alamofire , mysql. i did func tableview(_ tableview: uitableview, didselectrowat indexpath: indexpath) { self.performsegue(withidentifier: "chatsegue", sender: self) } so connect chatviewcontroller tableview. if select tablecell, view chatto interface. and.. can't printed text. didn't understand https://github.com/badoo/chatto/wiki/data-source . if have 3 array var username = [string?]() var mess

firebase - How to handle fcm data payload in ionic2 framework -

i have created android app using ionic2 framework , integrated firebase cloud messaging sdk works correct , notifications received while app in foreground. issue is, couldn't handle data payload while app in background. data cannot log data in browser console.

android - how to handle list of images(horizontal) inside cardview in recylerview? -

Image
i want create below design, because of have created dynamic image views , fetch image urls using glide lib. loading images slow holder.linearlayout.removeallviews(); for(int k = 0; k < getpiclist().size(); k++) { imageview imageview = new imageview(holder.linearlayout.getcontext()); linearlayout.layoutparams params = new linearlayout.layoutparams(90, 90); params.setmargins(0,0,10,0); imageview.setlayoutparams(params); getpic(holder.linearlayout, imageview, requestdata.getpiclist().get(k).getpic()); } private void getpic(final linearlayout linearlayout, final imageview imageview, string imageurl){ // log.d(tag,imageurl); if (imageurl != null) { // loading profile image glide.with(context).load(imageurl) // .crossfade() .dontanimate() .priority(priority.immediate) .signature(new stringsignature(string.valueof(system.currenttimemillis()))) // .placeholder() .e

scala - Spark: create a sessionId based on timestamp -

Image
i following transformation. given data frame records whether user logged. aim create sessionid each record based on timestamp , pre-defined value timeout = 20. a session period defined : [first record --> first record + timeout] for instance, original dataframe following: scala> val df = sc.parallelize(list( ("user1",0), ("user1",3), ("user1",15), ("user1",22), ("user1",28), ("user1",41), ("user1",45), ("user1",85), ("user1",90) )).todf("user_id","timestamp") df: org.apache.spark.sql.dataframe = [user_id: string, timestamp: int] +-------+---------+ |user_id|timestamp| +-------+---------+ |user1 |0 | |user1 |3 | |user1 |15 | |user1 |22 | |user1 |28 | |user1 |41 | |user1 |45 | |user1 |85 | |user1 |90 | +-------+---------+ the goal is: +-------+---------+----------+ |user_id|

python - Nopackages found: Package missing in current win-64 channels -

i'm trying install using anaconda. i came error saying there conflict in environment want create. unsatisfiableerror: following specifications found in conflict: - numpy 1.8.2 py27_0 - pandas 0.12.0 np17py27_1 -> numpy 1.7* i guess it's because numpy version pandas need (1.7) conflicts numpy version (1.8). so corrected environment 1.7 1.8 proceed installation. still problem occurs, replies nopackagesfounderror: package missing in current win-64 channels: - pandas 0.12.0 np18py27_1 how fix problem? glad have hand.

rest - Hockey Upload error: Invoke-RestMethod : The underlying connection was closed: Could not establish -

i trying upload appx hockey app using powershell script. when run powershell script getting below error: invoke-restmethod : underlying connection closed: not establish trust relationship ssl/tls secure channel. @ c:\prog\workwise-windows\uploadtohokeyscript\hockeyapp_hpworkwisetrayuploads cript.ps1:20 char:13 + $response = invoke-restmethod -method post -uri $create_url -header @ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : invalidoperation: (system.net.httpwebrequest:htt pwebrequest) [invoke-restmethod], webexception + fullyqualifiederrorid : webcmdletwebresponseexception,microsoft.powershe ll.commands.invokerestmethodcommand help appreciated.

php - SMTP Mail Trigger is not working in lumen -

i trying mail trigger using smtp credentials shows connection not established host email-smtp.us-east-1.amazonaws.com.php_network_getaddresses: getaddrinfo failed: name or service not known #0.

Getting Layout name of the Activity using Accessibility Service in Android -

i trying create app package name, activity name , activity layout name (xml)of other apps. purpose using accessibility service window_state_changed of foreground window. what have achieved? i able package name , activity name of other apps using accessibility service. what not able achieve! i have tried possible solutions layout name of activity, unfortunately failing each , every successive attempts. what have tried far: step 1: created accessibilityservice.xml under res/xml folder below <accessibility-service xmlns:tools="http://schemas.android.com/tools" android:accessibilityeventtypes="typewindowstatechanged" android:accessibilityfeedbacktype="feedbackgeneric" android:accessibilityflags="flagincludenotimportantviews" android:canretrievewindowcontent="true" xmlns:android="http://schemas.android.com/apk/res/android" tools:ignore="unusedattribute"/> step 2:

html - Using ng-switch with buttons -

i'm trying use ng-switch 2 buttons in order show html elements depending on button clicked. have not seen example that here's code far: <button name="withdraw" ng-click="type(name)">withdraw</button> <button name="enter" ng-click="type(name)">enter amount withdraw</button> <hr> <div ng-switch="type(name)"> <div ng-switch-when="withdraw"> //code </div> <div ng-switch-when="enter"> //code </div> </div> just try one: <button name="withdraw" ng-click="name = 'withdraw'">withdraw</button> <button name="enter" ng-click="name = 'enter'">enter amount withdraw</button> <hr> <div ng-switch="name"> <div ng-switch-when="withdraw"> code 1

android - Find the view under the user's finger -

i want write debugging tool info printed view tapped user. similiar stetho does. i plan approach this: make overlay view on top of layout hierarchy, same size screen the view catches touches , records screen coordinates take root view , recursively walk on view tree find views bounding box overlaps touch coordinate print info found views adb would approach?

java - Kafka Producer Request Timeout setting -

i set request time-out added request.timeout.ms parameter. bu when have broken instinctively broker connection there not timeout error occur? what missing in configuration? need modify server setting well? public void init() { logger.info("initializing kafkaproducer: topic name: {}", topic); system.out.println("initializing kafkaproducer: topic name: {}"); properties properties = new properties(); properties.put("bootstrap.servers", brokerlist); properties.put("key.serializer", "org.apache.kafka.common.serialization.stringserializer"); properties.put("value.serializer", "org.apache.kafka.common.serialization.stringserializer"); properties.put("acks", "1"); properties.put("retries", "3"); properties.put("linger.ms", 5); properties.put("block.on.buffer.ful

r - Automatically order x axis on ggplot2 histogram in a nicely way -

Image
i have dataset (but hundreds of samples): data <- structure(list(sample = c("c001", "c001", "c001", "c001", "c001", "c001", "c001", "c001", "c001", "c001", "c001", "c001", "c001", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c002", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c003", "c004", "c004", "c004", "c004", "

javascript - Styling ag-grid cell based on condition when cell value is changed -

i wanted apply css style cell, if oldvalue , newvalue different after cell edited. so, did below in oncellvaluechanged() handler, oncellvaluechanged: function(params) { if (params.oldvalue !== params.newvalue) { params.coldef.cellstyle = function(params) { return { backgroundcolor: 'green' }; } params.api.redrawrows(); } } but apply css change cells particular column when condition met. not sure how apply 'cellstyle' cell affected. update 1: changed below , started working , oncellvaluechanged: function(params) { console.log(params); var cellvalue = params.data[params.coldef.field]; if (params.oldvalue !== params.newvalue) { params.coldef.cellstyle = function(params) { if(params.value==cellvalue){ return { backgroundcolor: 'green' }; } } params.api.redrawrows(); } } the problem face cell styling (in case background becoming green) lost when edit o

javascript - Vuejs single file component (.vue) model update inside the <script> tag -

i'm new vuejs , i'm trying build simple single file component testing purpose. this component displays bool , button change bool value. listen "customevent" changes bool value <template> {{ mybool }} <button v-on:click="test">test</button> </template> <script> ipcrenderer.on('customevent', () => { console.log('event received'); this.mybool = !this.mybool; }); export default { data() { return { mybool: true, }; }, methods: { test: () => { console.log(mybool); mybool = !mybool; }, }, }; </script> the button works fine. when click on value changes. when receive event, 'event received' displayed in console bool doesn't change. is there way access components data code? thanks , regards, eric you can move ipcrenderer.on(...) vuejs's lifecycle hooks created . see: https://vuejs.

drupal - Slick Slider in Overlay -

i have 3 tile wide slick slider , want open full-screen overlay slider when clicking on tile. full-screen slider should 1 tile wide, , should start on slide clicked on. have configured small three-tile slider far using drupal 8 slick module. have no trouble using slick api in java-script if necessary. can give me pointer here, or has else done before? much.

angularjs - Angular dynamic form for array of strings -

i've got news multiple paragraphs in it. i'm trying add form control each paragraphs can update them individually. this how data looks like { "newsid": "42352", "title": "service available", "body": [ "lorem ipsum has more-or-less normal distribution of letters, opposed", "lorem ipsum has more-or-less normal distribution of letters, opposed", ], "id": 1 } my template looks <div class="form-group" > <md-input-container class="md-block"> <textarea mdinput type="text" rows="6" cols="" [ngmodel]="news?.getbody()" class="texta" name="body" placeholder="paragraph" #body [formcontrol]="updatenewsformgroup.controls['body']"></textarea> </md-input-container> </div> in component i've this.update

c# - Different types of treeview items to be binded in one single data template -

i have mvvm based usercontrol. model has 2 classes, 1 class has list of type class shown in model below. problem i have 2 define 2 different hierarchicaldatatemplates treeview binded model wrong . make 1 hierarchicaldatatemplate know property in viewmodel. in end, want treeview like: |familyname ||personname ||personname the code quite big, have taken pieces. if more info required please let me know: model public class family { private string m_name; public string nameoffamily { { return m_name; } set { m_name= value; } } public observablecollection<person> persons{ get; set ; } } public class person { private string m_name; public string nameofperson { { return m_name; } set { m_name= value; } } } in viewmodel received family respective persons e.g. viewmodel family fam = getfamilywithrespectivepersons; view <treeview name="mytreeview" grid.column="0" width="auto"