Posts

Showing posts from March, 2015

python - Pandas: Trouble Updating Rows Conditionally -

i have following dataframe: >>>df rtt requests asn 1000 4000 100 2000 50 nan 3000 18000 300 my goal divide rtt requests in place if requests not nan , otherwise leave rtt untouched. i've tried various things , either second row gets set nan so: >>>df rtt requests asn 1000 40 100 2000 nan nan 3000 60 300 or dataframe isn't updated @ all desired final output >>>df rtt requests asn 1000 40 100 2000 50 nan 3000 60 300 use fillna in [1889]: df['rtt'] = df['rtt'].div(df['requests']).fillna(df['rtt']) in [1890]: df out[1890]: rtt requests asn 1000 40.0 100.0 2000 50.0 nan 3000 60.0 300.0 or, / instead of div in [1895]: (df['rtt'] / df['requests']).fillna(df['rtt']) out[1895]: asn 1000 40.0 2000 50.0 3000 60.0 dtype: float64 or, combine_first in [1897]: df['rtt'].div(df[

php - responsive image to my project not fit the div -

have problem in project wich item image not fit thumbnail "; "; ``"; echo "$ " . $item['itemprice'] . ""; echo ""; echo ""; echo "" . $item['itemname'] . ""; echo "" . $item['itemdescription'] . " "; echo "" . $item['itemdate'] . ""; echo "" . $item['username'] . ""; echo '' . $item["catname"] . ''; echo ""; echo ""; echo ""; echo ""; } ?> > css /* start time last */ .item-box:hover { background-color: lightgray; } .item-box img { display: block; min-width: 225px; min-height: 225px; max-width: 225px; max-height: 225px; } .img-item img { min-width: 180px; min-height: 180px; max-width: 180px;

excel - Using a file location in a VLOOKUP issue -

i got code answer on here , better way doing because can select pulling file from. seems can't file name correct in vlookup? error 1004 right after vlookup. maybe there else wrong. copied code replaced needed need pair of eyes. in advance. dim x string dim lnewbracketlocation long x = application.getopenfilename( _ filefilter:="excel files (*.xls*),*.xls*", _ title:="choose previous quarter's file", multiselect:=false) msgbox "you selected " & x 'find last instance in string of path separator "\" lnewbracketlocation = instrrev(x, application.pathseparator) 'edit string suit vlookup formula - insert "[" x = left$(x, lnewbracketlocation) & "[" & right$(x, len(x) - lnewbracketlocation) range("v2").select activecell.formular1c1 = "=vlookup($e2,'" & x & "]file_2017072732'!$b$5:$ap$9486,18,false)" ' error 1004 selection.autofill destinatio

python 2.7 - Flatten 3 level MultiIndex Pandas dataframe -

i have following pandas df: window 5 15 30 45 feature col0 col1 col2 col0 col1 col2 col0 col1 col2 col0 col1 col2 metric mean std mean std mean std mean std mean std mean std mean std mean std mean std mean std mean std mean std 0 nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan

wordpress - Gravity Forms - Conditional Result -

i have gf 3 products @ set price. however, if user purchases more one, there's $50 discount on each additional item. ex: product 1 = $500 user buys 2 items, $500 + $450 (total = $950). there way native (or plugin) conditional logic? the way know how natively create product field adds "base" fee. in case, fee $50. product price $450 time. use conditional logic "show" base fee when 1 item ordered , "hide" base fee when more 1 item ordered.

javascript - How to force my Chrome browser to accept .requestFullscreen()? -

i writing application myself in need go fullscreen automatically via javascript (today simulate press of f11, works, not always). i use .requestfullscreen() (via screenfull.js ) failed execute 'requestfullscreen' on 'element': api can initiated user gesture. this understandable (for security / spam / usability reasons) , mentioned on numerous pages. now, since application running on chrome browser, have ability allow request in browser. is possible setting chrome? you can use kiosk mode: on windows: "c:\program files (x86)\google\chrome\application\chrome.exe" --chrome --fullscreen --kiosk http://10.20.30.40/page/ on linux chrome --chrome --fullscreen --kiosk http://10.20.30.40/page/

.net - Autocad C# delete layout viewports -

can me create c# code delete viewport in layouts. i've tried code delete viewport, compiles no problem, doesn't delete viewport, not sure doing wrong here. thanks public class class1 { [commandmethod("haha")] public static void createmodelviewports() { document doc = application.documentmanager.mdiactivedocument; database db = doc.database; using (transaction trans = db.transactionmanager.starttransaction()) { var viewporttable = (viewporttable)trans.getobject(db.viewporttableid, openmode.forwrite); foreach (objectid id in viewporttable) { var viewport = (viewporttablerecord)trans.getobject(id, openmode.forread); // delete active viewport viewport.upgradeopen(); viewport.erase(); } trans.commit(); } } } you erasing viewporttablerecord not viewport.

rest - in Karate DSL, a '?' in the Given path variable is being converted to a '%' in the request message, how do I resolve this? -

in karate dsl , have following scenario: feature: test background: * url baseurl scenario: test given path 'servicerequests/tasks?view=short&page=1&size=25 with get method status 200 i getting response of 404 because karate converting path variable below. notice 'tasks?' string becomes 'tasks%'. why happening , can resolve it? get http://ver-01-shared-services-service-request-service.ver.cloud.ds.gehc.net/servicerequest/v1/servicerequests/tasks **%**3fview=short&page=1&size=25 use proper way set parameters: given path 'servicerequests', 'tasks' , param view = 'short' , param page = 1 , size = 25 when method status 200

Webpack Plugin: exclude from recompile -

when writing webpack plugin, exclude recompilation during dev server watch recompilations if it's watched fileset not change. to specific, contributing webpack-webfont plugin. plugin has known issue fires during compilation, generating output files (fonts, .scss files). these files watched, , webpack forces recompile. recompile goes beginning, generating new files, , kicking off recompile... infinitely. what best practice/pattern in webpack disallow recompile or exclude plugin compilation loop when file set hasn't changed?

jquery - Get checked checkbox Value and send it to php variable for query -

this code table , checkboxes, i'm trying checked box values, , put theme select query. don't have idea, how that. can 1 me? i'm new programming, don't punch me please ;) idea of script -> user choose row want edit checking checkboxes, script must read values of checkboxes, , in modal popup window show entries. <?php while($row = mysqli_fetch_array($result)) { echo ' <tr> <td>'.$row["employeeid"].'</td> <td>'.$row["employeefirstnamelocal"].'</td> <td>'.$row["employeelastnamelocal"].'</td> <td>'.$r

Python 3: "NameError: name 'function' is not defined" -

running def foo(bar: function): bar() foo(lambda: print("greetings lambda.")) with python 3.6.2 yields traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'function' not defined however, removing type annotation works expected. pycharm additionally gives warning 'function' object not callable on line bar() . edit: stated in comment of pieters’ answer, question raised, because def myfunction(): pass print(myfunction.__class__) outputs <class 'function'> . there no name function defined in python, no. annotations still python expressions , must reference valid names. you can instead use type hinting bar callable ; use typing.callable : from typing import callable def foo(bar: callable[[], any]): bar() this defines callable type takes no arguments , return value can (we don't care).

grails - How to use datasoure in ng2-ya-table? -

in documentation of ng2-ya-table datasource function written in way : public datasource: = (request: any): observable<any> => { return this.service.getusers(request); } and used : <ng2-ya-table [options]="options" [columns]="columns" [datasource]="datasource" [paging]="paging"> </ng2-ya-table> i don't want use function in way because have static data = [ { name: 'patricia', email: 'julianne.oconner@kory.org', username: 'yes', }, { name: 'chelsey dietrich', email: 'lucio_hettinger@annie.ca', username: 'no', } ] is possible or obliged render observable type? tried lot using static data in vain public datasource: = { return this.data ; } why function not working?

Swagger support for documenting workflow -

can swagger used document endpoints in specific order different default, example steps in workflow? the use case provide runnable documentation shows each step in happy path of workflow. users take response step 1 , use in request step 2, etc. or choose run specific step in middle of workflow. nice if custom text shown each step document workflow route. this might supported adding annotation specify order in document endpoints example. ideally built in feature, though 3rd party or open source approach may work well. none of commercial tools fit use case ( https://swagger.io/commercial-tools/ ), though don't know them , it's possible of test support leveraged.

javascript - Bokeh Database Plotting and Updating -

i creating plot display range of product based on specific attributes. modeled design of graph off of bokeh's "movies" example. can run plot navigating source folder , executing "bokeh serve --show shafts" andaconda prompt . my issue need save html file can distribute multiple people without accompanying database. if attempt save html file "output_file("slider.html", title="slider.py example")" from either movies example or code , run plot html file sliders not update graph. believe issue when run file "bokeh serve --show shafts" andaconda prompt running on server , able access python code continuously. alternatively, when run html complies code jason format , can no longer access python code. around bokeh added small javascript sections continue update off server. bokeh gives multiple example of how don't grasp being updated in javascript update graph. i'm not extremely familiar js makes little dif

python - Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT -

i'm attempting run convolutional neural network on data-set of images have. each image numpy array dimensions 300, 300, 1. i'm using date versions of tensorflow , keras. x_train has dimensions 195850, 300, 300, 1. x_test has dimensions 48850, 300, 300, 1. y_train vector of 195850 elements, turned 1 hot vector using to_categorical function. here code : from keras.models import sequential keras.layers import lstm, maxpooling2d, convolution2d keras.layers import activation, dropout, flatten, dense keras import applications, backend k keras.utils.np_utils import to_categorical import pickle import numpy np import tensorflow tf k.set_image_dim_ordering('tf') nb_train_samples = 195850 nb_validation_samples = 48850 x_train = pickle.load(open(r'c:\users\...\documents\github\asl_data\x_train.pkl', 'rb')) #x_train = np.moveaxis(np.array(x_train), 0, -1) y_train = pickle.load(open(r'c:\users\...\documents\github\asl_data\y_train.pkl', 'rb'

How to iterate javascript object properties in the order they were written -

i identified bug in code hope solve minimal refactoring effort. bug occurs in chrome , opera browsers. problem: var obj = {23:"aa",12:"bb"}; //iterating through obj's properties for(i in obj) document.write("key: "+i +" "+"value: "+obj[i]); output in ff,ie key: 23 value: aa key: 12 value: bb output in opera , chrome (wrong) key: 12 value bb key: 23 value aa i attempted make inverse ordered object this var obj1={"aa":23,"bb":12}; for(i in obj1) document.write("key: "+obj[i] +" "+"value: "+i); however output same. there way browser same behaviour small changes? no. javascript object properties have no inherent order. total luck order for...in loop operates. if want order you'll have use array instead: var map= [[23, 'aa'], [12, 'bb']]; (var i= 0; i<map.length; i++) document.write('key '+map[i][0]+', value: '

Howto make an HTML box with shadow and pressable -

i make html widget one: https://jsfiddle.net/api/mdn/ .simple { box-shadow: 5px 5px 5px rgba(0,0,0,0.7); } but pressable flattens 1 second , redirects different url. edit: i tried following: button { width: 150px; font-size: 1.1rem; line-height: 2; border-radius: 10px; border: none; background-image: linear-gradient(to bottom right, #777, #ddd); box-shadow: 5px 5px 5px rgba(0,0,0,0.7); } button:focus, button:hover { background-image: linear-gradient(to bottom right, #888, #eee); } button:active { box-shadow: inset 2px 2px 1px black, inset 2px 3px 5px rgba(0,0,0,0.3), inset -2px -3px 5px rgba(255,255,255,0.5); } <button>press me!</button> https://jsfiddle.net/z7a0v8uv/ but don't know how translate content of button make it's being pressed down. i found answer here: https://www.w3schools.com/howto/howto_css_animate_buttons.asp i looking for: translatex(...) translatey(...) as can see i

authentication - Stocktwits token retrieval error 8-{"response":{"status":400},"error":"invalid_grant","error_description":"code doesn't exist or has expired" -

i trying stocktwits token use api methods. have client id , secret using have generated code using browser. after copying code in browser response trying token last step getting below response. i have tried refresh code still same message using new code. https://api.stocktwits.com/api/2/oauth/authorize?client_id=12349f389e24c447&response_type=code&redirect_uri=http://www.example.com&scope=read,watch_lists,publish_messages,publish_watch_lists,direct_messages,follow_users,follow_stocks httppost request token: https://api.stocktwits.com/api/2/oauth/token?client_id=3e6a9f389e24c447&client_secret=####edfc136317cecd0c2a6ad9d907babba#####&code=#####e645642d50b2f2d2e529b47fc4315b5000c&grant_type=authorization_code&redirect_uri=http://www.example.com response stocktwits token retrieval error 8-{"response":{"status":400},"error":"invalid_grant","error_description":"code doesn't exist or has e

flex - error 102: Invalide namespace error:http://ns.adobe.com/air/application/2.0 -

Image
i'm trying create signed air package old code of desktop adobe air app. it runs on flex sdk 3.5.1 , adobe air. i'm clear of errors , when try export release build, past certificate addition section , error saying " error 102: invalide namespace error: http://ns.adobe.com/air/application/2.0 . i see picking appname-app.xml . have adobe air installed version 26. tell me missing? you have download , compile against 3.5.1 sdk includes adobe air 2 sdk or change namespace in app.xml match air sdk using now.

javascript - jQuery DataTables button trigger after load results in an infinite loop -

i have datatable can have columns filtered based on user checks. i want user able export see on datatable. have data-column attribute on each checkbox lets me know column should shown or hidden based on whether or not checked. i have initialized table this: var table = $('.my-table').datatable({ pagelength:25, fixedheader: true, sscrollx: true, dom: '<"html5buttons"b>ltfgitp', buttons: [ {extend: 'copy'}, {extend: 'csv', title: 'testing', exportoptions: { columns: get_columns_to_export(), rows: { selected: true } }, 'customize': function(doc){ console.log("==csv doc=="); console.log(doc); } }, {extend: 'excel', title: 'testing

python - SynapsePay & Django conflicting instances of User issue -

my name omar. working on django project using synapsepay api monetary transactions. getting issue have 2 instances of same object(user). django uses 'user' object when new users created within django application. synapse uses 'user' objects when new user created within api. when try use synapse api, starting conflicting uses of same variable. in import statements, when imported user synapse api, saved instance of user synapseuser , using interact application. there parts of api not controllable me use 'user' object within api , grabbing wrong object or trying grab key doesnt exist in key being passed. here code have , error trying get... the following code grab forms content , test bank authroization api.. here link api github samples.md file here views.py file: import os synapse_pay_rest import client synapse_pay_rest import user synapseuser synapse_pay_rest.models.nodes import achusnode def linkbanklogin(request, form): currentuser = log

I can not download PDF files from links generated from a javascript function with python 3.6.0 + selenium 3.4.3 -

the url is: site by using selenium firefox 47.0.2 binary , python 3.6.0, page click on “pesquisar” button , in next page fill in form tha date range (format d/m/y) , click again on new “pesquisar” button, list of pdf documents , want download them. when print page_source, can see links generated, don’t understand why selenium can’t locate links. the simplified code follows: from selenium import webdriver selenium.webdriver.support.ui import select selenium.webdriver.firefox.firefox_binary import firefoxbinary selenium.webdriver.support.ui import webdriverwait selenium.webdriver.support import expected_conditions ec selenium.webdriver.common.by import datetime import datetime, date, timedelta calendar import monthrange import time driver = webdriver.firefox(firefox_profile=profile, firefox_binary=binary, capabilities=capabilities) driver.maximize_window() wait = webdriverwait(driver, 10) months = range(1, 13) limits = monthrange(2017, 8) #num_docs = limites[1]-limites[0

An invisible count when reproducing audios in Android Studio -

i'm using several audio files in app. when click button, can hear 1 of them. however, after hearing 7 of them, can't hear anymore. can it? there code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_principal); btn1 = (button) findviewbyid(r.id.button); mp1= mediaplayer.create(principal.this, r.raw.a); btn1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { mp1.release(); mp1= mediaplayer.create(principal.this, r.raw.a); mp1.start(); } }); it's same each audio. bug or doing wrong?

python - Iterating through a Dataframe to get values based on another Dataframe -

lets have following dataframes: dataframe 1 cfop vendas 0 5101 venda 1 6101 venda 2 6107 venda 3 6118 venda 4 6109 venda dataframe 2 name cfop vendas 0 john 5101 10,00 1 lea 7008 20,00 2 anthony 6107 15,00 3 frank 7000 17,00 4 tom 6109 21,00 i want make third dataframe if row 1 of dataframe 1 mathces row 2 dataframe 2. so, final answer should be: name cfop vendas 0 john 5101 10,00 2 anthony 6107 15,00 4 tom 6109 21,00 i stuck, code know wrong: vendas_somente = [] row in df_entrada: if df_entrada['cfo'] in df_venda['cfop']: vendas_somente.append(row) vendas_somente(10) tks you can create inner merge in[38]: d1[['cfop']].merge(d2,how='inner',on='cfop') out[38]: cfop name vendas 0 5101 john 10,00 1 6107 anthony 15,00 2 6109 tom 21,00

html - Angular i18n localization of label containing interpolation -

in template have bunch of cards, each has name , button. button title should contain name. simplified: <md-card> <md-card-header> <md-card-title>{{name}}</md-card-title> </md-card-header> <md-card-footer> <button title="actions {{name}}" i18-title="show actions cards|button tooltip" </button> </div> </md-card-footer> my understanding, interpolation part {{name}} lost after localization run. how tackle case?

javascript - Looking for an AngularJS carousel -

Image
i'm looking angularjs carousel module can mimic visual format of picture: i tried using https://mihnsen.github.io/ui-carousel/ got errors: https://github.com/mihnsen/ui-carousel/issues/35 i need works in angularjs , visually mimics picture. suggestions? have tried this one? seems he's using bootstrap , css it. //cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js it shows scope variables uses carousel configured. it's not same, it's closer found. if it's not want, can little css changes picture (:

playframework - Declaring non-default JNDI connection for JPA access in Play for Scala -

the following snippet works in play scala: class mydao @inject() (jpaapi: jpaapi) { @transactional def somemethod = { jpaapi.withtransaction { // .... in application.conf defined db.default.jndiname=defaultds , jpa.default=defaultpersistenceunit . now, need define jndi connection db.another.jndiname=anotherds jpa.another=anotherpersistenceunit . where persistence.xml is: <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" version="2.1"> <persistence-unit name="defaultpersistenceunit" transaction-type="resource_local"> <provider>org.hibernate.jpa.hibernatepersistenceprovider</provider> <non-jta-data-source>defaultds</non-

python - Using PyDictionary to check if a word exists -

very new pydictionary library, , have had trouble finding proper documentation it. so, i've come here ask: a) know how check if word (in english) exists, using pydictionary? b) know of more full documentation pydictionary?

android - com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.String -

i student studying android self. first question. please me. 09-12 01:35:35.723 2355-2355/com.example.jan.sanhakproject e/androidruntime: fatal exception: main process: com.example.jan.sanhakproject, pid: 2355 com.google.firebase.database.databaseexception: can't convert object of type java.lang.string type com.example.jan.sanhakproject.chat @ com.google.android.gms.internal.zzbqi.zze(unknown source) @ com.google.android.gms.internal.zzbqi.zzb(unknown source) @ com.google.android.gms.internal.zzbqi.zza(unknown source)

networking - Active queue management and duplicate acks -

this basic question not 100% sure. if aqm implemented tcp , packet dropped transmitter's buffer, wouldn't lead receiving duplicate acks? packet dropped somewhere in middle , receiver wouldn't receive packets in order of sequence number. if so, mean aqm tcp time-out congestion?

c# - Is it possible to compile a single file with .net core? -

in old .net used able run csc compiler compile single cs file or several files. .net core have dotnet build insist of having proper project file. there stand alone command line compiler, allow compile source code files without having project (and listing referenced dependencies on same command line)? on linux when have old csc , new .net core installed these timings: [root@li1742-80 test]# time dotnet build microsoft (r) build engine version 15.3.409.57025 .net core copyright (c) microsoft corporation. rights reserved. test -> /root/test/bin/debug/netcoreapp2.0/test.dll build succeeded. 0 warning(s) 0 error(s) time elapsed 00:00:03.94 real 0m7.027s user 0m5.714s sys 0m0.838s [root@li1742-80 test]# time csc program.cs microsoft (r) visual c# compiler version 2.3.0.61801 (3722bb71) copyright (c) microsoft corporation. rights reserved. real 0m0.613s user 0m0.522s sys 0m0.071s [root@li1742-80 test]# note 7 seconds .net core versus several

mongodb - c# query reference data in array -

i got array in document referencing documents different collection. below sample: { _id: 'someid', ... docs: [ { $ref: 'invoice', $id: 'invid1' }, { $ref: 'deliveryorder', $id: 'doid1' }, ... ] } is there way me query return full set of document referencing to? below sample of preferred output: { _id: 'someid', ... docs: [ { _id: 'invid1', customer: 'somecustomerid', ... }, { _id: 'doid1', address: 'someaddress', ... } ] }

c# - How to create PDF Report with data from code in list form, not directly from database with Microsoft Report Viewer -

Image
i using microsoft.report.viewer generate pdf in asp .net web api application. far when report data directly database, there no problem. problem is, when try create report subreport within , subreport data got code in list form, didn't expected result. create report subreport tutorial . when generate pdf, message . here code : my web api generate pdf : [route("generatepdffordailyprogram")] [httpget] [allowanonymous] public async task<ihttpactionresult> generatepdffordailyprogram(int id) { string guid = guid.newguid().tostring(); string filename = string.concat("booking_no" + convert.tostring(id) + "_" + guid.toupper() + ".pdf"); string filepath = httpcontext.current.server.mappath("~/content/temp/" + filename); string name = request.requesturi.getleftpart(uripartial.authority) + system.configuration.configurationmanager.connectionstrings[system.configuration.configurationma

Webpack css-loader configuration -

Image
how configure webpack config resolve fonts inside node_modules/admin-lte/dist/fonts/source-sans-pro? if execute npm run build , file-loader places fonts inside dist/files folder series of error occurs, saying can't resolve font aliases made. project directory admin-lte node_module directory webpack config var path = require('path') var webpack = require('webpack') var inproduction = (process.env.node_env === 'production'); var indevelopment = (process.env.node_env === 'development'); var glob = require('glob'); var extracttextplugin = require('extract-text-webpack-plugin'); var extractless = new extracttextplugin('stylesheets/style-less.css'); var extractcss = new extracttextplugin('stylesheets/style-css.css'); module.exports = { entry: './src/main.js', output: { path: path.resolve(__dirname, './dist'), publicpath: './dist/', filename: 'build.js' }, mo

ssh - 2 computers one git issue -

i have issue bitbucket in way if use computer work in order ssh on server , git pull perfect, if home computer, same server, : repository access denied. deployment key not associated requested repository. fatal: not read remote repository. please make sure have correct access rights , repository exists. this super strange , don't know in case. openssh_7.2p2 ubuntu-4ubuntu2.1, openssl 1.0.2g 1 mar 2016 debug1: reading configuration data /home/ubuntu/.ssh/config debug1: /home/ubuntu/.ssh/config line 1: applying options bitbucket.org debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: applying options * debug1: connecting bitbucket.org [104.192.143.1] port 22. debug1: connection established. debug1: identity file /home/ubuntu/.ssh/bitbucket type 1 debug1: key_load_public: no such file or directory debug1: identity file /home/ubuntu/.ssh/bitbucket-cert type -1 debug1: enabling compatibility mode protocol 2.0 debug1: loca

PHP Laravel- Paypal payment for services(not items) using API call without(skipping) login screen -

i have used paypal express checkout shopping carts , custom laravel projects. but time want integrate paypal in api project developed in php(laravel) collects payments services(item renting). since there many options paypal i'm bit confused. this client's requirement: api project receives payment request mobile app(when user hand on rented item , click button approve payment request receives on mobile app). when api code received above payment request user's mobile app, api code should able call paypal , process payment(transfer payable amount user/payer account payee account). items rented registered users , api code have access user info. therefore api code need process payment without prompting paypal login screen(requiring users enter paypal credentials again). in nut shell, mobile app registered user should billed clicking above payment approve button. i know storing paypal credentials in api project's database not option. is possible/allowed paypal

amazon s3 - Failed to connect to s3-ap-northeast-1.amazonaws.com port 443: Timed out -

i installed vagrant , add vagrant using below command. vagrant box add sl68-mynavi-wts https://s3-ap-northeast-1.amazonaws.com/ccvagrant/sl68-mynavi-wts.box this message show. an error occurred while downloading remote file. error message, if any, reproduced below. please fix error , try again. failed connect s3-ap-northeast-1.amazonaws.com port 443: timed out i using on server base network. not directly router. why happen?

json - res.render - passing parameters dynamically -

i'm trying figure out how render dynamically depending on number of parameters in object. let's create json example var json = [ { "param_1":11, "param_2":22 }, { "param_1":33, "param_2":44 } ] and here how pass parameters if var json static: res.render("template.hbs", { item_0_param_1: json[0].param_1 item_0_param_2: json[0].param_2, item_1_param_1: json[1].param_1 item_1_param_2: json[1].param_2 } the question have - how can pass parameters variable 'json' if not static? thinking doing loop inside render, didn't know how return assigned parameters. appreciate help. thanks!

azure - How to Get Service Fabric Project Settings.xml Values -

i have 5 service fabric stateless services. have these service fabric settings.xml values in class library based on section name of each file. going create common class take sectionname parameter , have configuration values. you can use starting point: internal sealed class yourservice: statelessservice { public yourservice(statelessservicecontext context) : base(context) { var configurationpackage = context.codepackageactivationcontext.getconfigurationpackageobject("config"); var sectionparams = configurationpackage.settings.sections["sectionname"].parameters; // can iterate through these parameters (e.g. count , access index) //sectionparams.count; //sectionparams[0].name; //sectionparams[0].value; i not sure if there way library find servicecontext of other services. please aware not services might deployed same nodes. might affect configuration availability. you might need create

select - jQuery - dblclicking on span changing it to input text when blur confirm popsup when clicking ok it marks while mouse moving -

i have searched stackoverflow mine somehow different. have confirm inside. $(document).on('blur', '#to_edit', function() { yes = confirm('r u sure?'); if(yes) $(this).parent().html(edited_value); else $(this).parent().html(main_value); } when confirm popsup , when user clicks on ok mouseup triggered when focusing-out (blur) element hasn't finished yet , marking texts in page while moving mouse.

php - How to split evenly and oddly a string to form an array of even and odd results OK Like -

i have php string formed images , corresponding prices ok like $mystring = "ddb94-b_mgr3043.jpg,3800,83acc-b_mgr3059.jpg,4100"; i know if do: $myarray = explode(',', $mystring); print_r($myarray); i : array ( [0] => ddb94-b_mgr3043.jpg [1] => 3800 [2] => 83acc-b_mgr3059.jpg [3] => 4100 ) but how split string can have associative array of form? array ( "ddb94-b_mgr3043.jpg" => "3800" "83acc-b_mgr3059.jpg" => "4100" ) easier way below:- <?php $mystring = "ddb94-b_mgr3043.jpg,3800,83acc-b_mgr3059.jpg,4100"; $chunks = array_chunk(explode(',', $mystring), 2); //chunk array 2-2 combination $final_array = array(); foreach($chunks $chunk){ //iterate on array $final_array[trim($chunk[0])] = trim($chunk[1]);//make key value pair } print_r($final_array); //print final array output:- https://eval.in/859757