Posts

Showing posts from January, 2011

amazon s3 - Best way to generate a data file in a Gulp Image asset pipeline -

i building image pipeline using gulp , in process need generate data file key information image being uploaded. at moment, using gulp-responsive process images , gulp-s3-upload push them s3. for example, if image solar-eclipse.jpg , data file should be: file path: data/solar-eclipse.yml what best way gather data, , separately, best way push data new file? here our current gulpfile.js — https://github.com/gsa/digitalgov.gov/blob/media-pipeline/gulpfile.js date : 2017-08-21 13:52:15 -0400 uid : solar-eclipse width : 1200 height : 800 format : jpg wiki

Read raw request body in asp.net core MVC -

i need process raw request body in , mvc core controller has route parameters [httpput] [route("api/foo/{fooid}")] public async task put(string fooid) { reader.read(request.body).tolist(); await _store.add("tm", "test", data); } but seems model binder has consumed request stream time gets controller. if remove route parameters, can access request stream (since framework no longer process stream parameters). how can specify both route parameters , able access request body without having manually parse request uri etc.? i have tried decorating parameters [fromroute] had no effect. please note cannot bind request body object , have framework handle binding, expecting extremely large payload needs processed in chunks in custom manner. there no other controller, no custom middle-ware, filters, serialzier, etc. i not need process body several times, once storing stream in temp memory or file stream not options, want process request body d

Grid.mvc - column containing iCollection -

my model contain collection of object. (any relation). this.root_cause_categories = new hashset<root_cause_categories>(); i added column using custom rendering htmlhelper. columns.add(o => o.root_cause_categories).titled("category").sanitized(false).encoded(false).sortable(true).filterable(true).setfilterwidgettype("categoryfilterwidget") .rendervalueas(o => customrenderingcategorycolumn(o)).css("text-center"); but seems filter not work collection. error here in _grid.cshtml: @helper rendergridbody() { if (!model.itemstodisplay.any()) { method 'system.string toupper()' declared on type 'system.string' cannot called instance of type 'system.collections.generic.icollection`1[ncqiap.root_cause_categories]' for information, others columns filters load ajax single values (string or number) filtered. have try implemented mechanism allow gridmvc work property model of icollection. for ex

'Android' Interval from Fused Location API is not correct -

i want location information on interval set. but doesn't come have expected. below code. on activitya public void onconnected(@nullable bundle bundle) { $locationrequestinterval = 3000; if (activitycompat.checkselfpermission(this, android.manifest.permission.access_fine_location) != packagemanager.permission_granted) { } pendingintent pendingintent = pendingintent.getservice(this, 0, new intent(this, hardwarehandler.class), pendingintent.flag_update_current); locationrequest locationrequest = locationrequest.create(); locationrequest.setpriority(locationrequest.priority_high_accuracy).setinterval($locationrequestinterval); locationservices.fusedlocationapi.requestlocationupdates($googleapiclient, locationrequest, pendingintent); } on activityb protected void onhandleintent(intent _intent) { if (locationresult.hasresult(_intent)) { locationresult locationresult = locationresult.extractresult(_intent); t

java - jersey: how to configura jersey to return jsons only -

one api endpoint using following annotations: @consumes(mediatype.application_json) @produces(mediatype.application_json) when request content-type not application/json , server return status code 415 response content-type text/html;charset=utf-8 . how configuration jersey return json default content-type? thanks i have never tried asking can done use of interceptors you in particularly looking writerinterceptor writer interceptors used cases entity written "wire" on server means when writing out response entity , on client side when writing request entity request sent out server this means when ever client sending response writerinterceptor called. here have power modify (jsonify) response. wiki

spring boot - @EnableResourceServer ResourceServerConfiguration Unsatisfied dependency -

on pivotal cloud foundry spring services v1.4 if use cloud services dependencies version 1.5.0 release , spring cloud dependencies dalston sr3, spring boot 1.5.6 rest service following annotations @enableresourceserver @springbootapplication @enableautoconfiguration @enablecaching @enablediscoveryclient the services failed start following error 2017-08-21t16:00:28.784-07:00 [app/proc/web/0] [out] 2017-08-21 23:00:28.784 warn 14 --- [ main] ationconfigembeddedwebapplicationcontext : exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.security.oauth2.config.annotation.web.configuration.resourceserverconfiguration': unsatisfied dependency expressed through field 'tokenservices'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.boot.autoco

javascript - how to pop a dialog from a website meanwhile by refreshing this website,the dialog will NOT disappear? -

here detail of question: there ia website called a. pressing button on website a, dialog shows up.after 10 seconds,the dialog disappears. my question is:the website keeps refreshing every 3 seconds,so everytime press button,the dialog can shown less 3 seconds because dialog frame disappear after website refreshing itself. the website has keep refresh newest information,the time intercal can not changed,which 3 sec.but want keep dialog 10 seconds,long enough user see. the reason why didn't use ajax used python creat html when there new information.but after html created,the previous website can not discover such change of html.only refreshing time can browser load newest html.but i'll consider use ajax if there no other ways. also found other resourece code web of dialogs disappear after refreshing. can have idea share? appreciate help.thanks much! here code: <html> <head> <meta http-equiv="refresh" content="3"> <t

makefile - Error while trying to make a RabbitMQ C-master project -

i trying build own project, i.e., smart_parking using rabbitmq c-master. link c apis is: https://github.com/alanxz/rabbitmq-c i made folder name smart_parking in rabbitmq folder. wrote cmakelists.txt files , edited makefile.am follows: cmakelists.txt: # vim:set ts=2 sw=2 sts=2 et: include_directories(${librabbitmq_include_dirs}) if (win32) set(platform_dir win32) else (win32) set(platform_dir unix) endif (win32) set(common_srcs utils.h utils.c ${platform_dir}/platform_utils.c ) add_executable(client_1 client_1.c ${common_srcs}) target_link_libraries(client_1 ${rmq_library_target}) add_executable(client_2 client_2.c ${common_srcs}) target_link_libraries(client_2 ${rmq_library_target}) add_executable(client_3 client_3.c ${common_srcs}) target_link_libraries(client_3 ${rmq_library_target}) add_executable(client_4 client_4.c ${common_srcs}) target_link_libraries(client_4 ${rmq_library_target}) makefile.am: if smart_parking noinst_ltlibraries += s

mysql - BETWEEN and DATE_ADD is not working in my case -

i have sales in database going 9 days , query not returning why? select * `sales` date between current_date , (date_add(current_date, interval -10 day)) you have switch parameter. must lower to. select * `sales` date between (date_add(current_date, interval -10 day)) , current_date your current query return records greater or earlier 10 days ago, excluding range intended target. for more informations see documentation . if expr greater or equal min , expr less or equal max, between returns 1, otherwise returns 0. equivalent expression (min <= expr , expr <= max) if arguments of same type. otherwise type conversion takes place according rules described in section 12.2, “type conversion in expression evaluation”, applied 3 arguments. wiki

json - the best way to save data -

Image
my problem simple, short : 1- should create website people can enter informations ( lot of numbers), then, should generate final result based on informations.. ( here exemple of people should enter in website : my problem : there lot of data , numbers, , difficult , long put informations in databases, , exploit them 1 one, thought using json, i'm not sure yet. don't have lot of time,that's why don't want waste time testing don't know if it's right thing or not. have nice day everyone wiki

java - error404 accessing Restful web service using jersey framework and tomcat server -

am facing problem accessing restful web service via url: localhost:8080/primnumbers/generator/strategy i got error: http status 404 - /primnumbers/generator/strategy type status report message /primnumbers/generator/strategy description requested resource not available. am using tomcat7.0.81 server , jersey1.17 framework (i have included jersey jar file under web-inf/lib in project). here web.xml file: <?xml version="1.0" encoding="utf-8"?> <element> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>primnumbers</display-name> <servlet> <servlet-name>jersey restful application</

sql - Struggling to find the right WHERE clause -

i'm struggling sql query , need help. honest, i'm starting wonder if want achieve can done way did far maybe collective brains can come better solution mine , prove me took way @ beginning (or totally wrong , should start scratch). the dataset a row has 4 important fields: itemid , item , priority , group . fields contain valuable piece of information, 1 displayed in end. as i'm using sql server 2008, don't have access lag , lead function needed simulate them (or @ least, did because thought useful me i'm not sure anymore). obtain result, used code this article sqlscope provide lag , lead equivalent restrict set of row have same itemid . adds 7 new functional columns dataset: rn , rndiv2 , rnplus1div2 , previouspriority , nextpriority , previousgroup , nextgroup . itemid | item | priority | group | rn | rndiv2 | rnplus1div2 | previouspriority | nextpriority | previousgroup | nextgroup -------- | ------- | --

Is docker inspect -f '{{.Parent}}' a safe way to get the base image ID? -

i want automatically rebuild docker containers when base image changed. idea compare base image id of current tagged container id of base image in docker hub , run new build if differs. getting latest base image id seems quite straight forward: $ docker pull debian:latest >/dev/null 2&>1; docker images debian:latest -q sha256:a20fd0d59cf13f82535ccdda818d70b97ab043856e37a17029e32fc2252b8c56 docker inspect has entry called "parent" seems contain id of image used in from directive: $ docker inspect -f '{{.parent}}' dockertest-1 sha256:a20fd0d59cf13f82535ccdda818d70b97ab043856e37a17029e32fc2252b8c56 since can't find documentation wonder if should rely on data build build pipeline. the parent reference not point base image in from line of dockerfile, points next last layer in image. if build contains single layer can from line, adding second line dockerfile break scripts. if know tag of base image (this sort of meta information is

hibernate - How to do database design for entities which require an approval workflow for updates -

for example, have entity called bankaccount has following attributes: bank_account_id bank_name branch_name account_number account_type swift_code iban_code ifsc_code status (possible values - new, active, suspended, terminated) ... when account created done in "new" status. still not active in system. end user requests approval , background workflow triggers. upon final approval status flipped "active". there may subsequent updates attributes end users, including status change suspended or terminated. such changes visible / effected after workflow approval. hence need mechanism capture changes not persist them in same table immediately. q. how implement database design , application layer logic , can handle such interim states ? ( using hibernate persistence layer ) wiki

node.js - What is the correct way to make Validators with Mongoose -

i had userschema, first email, username , password fields own validators. wanted add more fields bio, location gender , birthday, own validators. const userschema=new schema({ email: { type: string, required: true, unique: true, lowercase: true, validate: emailvalidators}, username: { type: string, required: true, unique: true, lowercase: true, validate: usernamevalidators}, password: { type: string, required: true,validate: passwordvalidators}, bio: { type:string,required:false,default:null,validate:biovalidators}, location: {type:string,required:false, default:null}, gender: {type:string,required:false,default:null,validate:gendervalidators}, birthday: { type:date,required:false,default:null} }); now problem when want register, it's running every validators, of course error occured because in register page i'm not asking bio, location etc .. i tried adding required:false still not working , didn't find satisfying answer edit here&

python - Beautifulsoup iterating over multiple pages -

i try iterate on multiple pages problem code skip pages when i'm executing code. my code: from bs4 import beautifulsoup selenium import webdriver import requests, csv, re game_links = [] link_pages = [] base_url = "http://www.basket.fi/sarjat/ohjelma_tulokset/?season_id=93783&league_id=4#mbt:2-303$f&stage=177155:$p&0=" in range(1,10,1): link_pages.append(base_url+str(i)) link in link_pages: browser = webdriver.phantomjs() browser.get(link) table = beautifulsoup(browser.page_source, 'lxml') td in table.find_all("td",{"class":"first"}): li in td.find_all("a", {"game_id":re.compile("\d+")}): href=li.get("href") game_links.append(href) print(len(game_links)) result now: 20 40 60 80 100 120 140 140 160 my goal: 20 40 60 80 100 120 140 160 180 when try scrape pages separately works, when try iterate on pages skip

c# - Is there any way to call SelectedIndexChanged.BeginInvoke or similar method? -

i have list of items want set cookie on page_load(). it's long web form on top of sharepoint. don't want call each method each control's event, that's i'm doing right now. in other words, don't need know method called each control within page, need invoke it. *edit -- autopostback set true each control, , handle event in page load page.ispostback. read somewhere selectindexchanged event not fire pageload, that's why i've been investigating ugly work-arounds. current code: enter code here foreach (control c in gpc.getallcontrols(this.master.findcontrol("placeholdermain").controls)) { if (c == null) continue; if (c textbox) { textbox t = (textbox)c; if (cookie.values[c.id] != null) { t.text = cookie.values[c.id]; } }

docker - Chaincode for Developers Cli error terminal 3 -

i trying deploy chaincode using chain code developers tutorial " http://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html ". able complete steps till terminal 2 error in command "docker exec -it cli bash" terminal 3. output terminal 1: []received message register shim peer | 2017-08-22 23:29:26.025 utc [chaincode] handlemessage -> debu 1a9 []fabric side handling chaincodemessage of type: register in state created peer | 2017-08-22 23:29:26.025 utc [chaincode] beforeregisterevent -> debu 1aa received register in state created peer | 2017-08-22 23:29:26.025 utc [chaincode] registerhandler -> debu 1ab registered handler complete chaincode mycc:0 peer | 2017-08-22 23:29:26.025 utc [chaincode] beforeregisterevent -> debu 1ac got register chaincodeid = name:"mycc:0" , sending registered peer | 2017-08-22 23:29:26.025 utc [chaincode] notifyduringstartup -> debu 1ad nothing no

c++ - Why am i getting "LoaderLock" detection? -

i calling c++ dll (not code) c# code using p/invoked loadlibrary api. when run application, loaderlock error being detected. at first blame dllimport c# wrappers this, when try load other c++ dll, works fine. i've read articles online regarding loaderlock , seems #1 rule not funny inside dllmain. , when checked c++ dllmain calling apis in dll_process_attach , dll_process_detach. bool apientry dllmain( handle hmodule, dword ul_reason_for_call, lpvoid lpreserved ) { switch (ul_reason_for_call) { case dll_process_attach: startapi(); break; case dll_thread_attach: break; case dll_thread_detach: break; case dll_process_detach: exitapi(); break; } return true; } when checked startapi(), has big chunk of code , calls function creates proccess using createproccessa is real reason why im getting loaderlock error?

php - If that possible to pass parameter to curl in codeigniter? -

i have curl controller named curl_run_experiment, contained post_test function deal update user data. function like: function post_test(){ $url = "http://{$_server['http_host']}/{$pathname}/update"; $data = array( 'user_id'=>'', 'fullname'=>'testing', 'phone'=>'+6270707070707' ); //init $ch = curl_init(); //set opt curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer,1); curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $data); //exec $output = curl_exec($ch); //close curl_close($ch); echo $output; } my question can put parameter post_test function like: function post_test($user_id){ //something } so when access link example ( http://localhost/ {$pathname}/curl_run_experiment/post_test/123), curl function recognize '12

machine learning - Keras model.fit() - which training algorithm is used? -

using keras on top of theano create mlp train , use predict time series. independently of structure , depth of network cannot figure out (keras documentation, stackoverflow, searching net...) training algorithm (backpropagation,...) keras' model.fit() function using. within theano (used without keras before) define way parameters adjusted myself with self.train_step = theano.function(inputs=[u_in, t_in, lrate], outputs=[cost, y], on_unused_input='warn', updates=[(p, p - lrate * g) p, g in zip(self.parameters, self.gradients)], allow_input_downcast=true) not finding information causes fear missing essential , may totally stupid question. can me out here? lot in advance. look @ example here : ... model = sequential() model.add(conv2d(32, kernel_size=(3, 3), activation='relu', input_shape=input_shap

PHP Comparing integers gives strange results -

i have following code: $queueid = (int)$this->data["feedbackreview"]["queueid"]; echo $queueid . ' / ' . gettype($queueid); this gives: 24 / integer later in code similar this: ... <option value="24" <?php if ($queueid==24) {echo 'selected';} elseif ($feedback_action_queue==24) {echo 'selected';} else {};?>>tier 2 dm delivery team a</option> ... where $feedback_action_queue has been converted int - selected not being echo'd. why this? i've placed following before select tag, right before it: var_dump($queueid, $feedback_action_queue) this gives: int(24) int(0) i've echo'd $queueid text of select , has brought 24 <option value="24" <?php if ($queueid==24) {echo 'selected';} elseif ($feedback_action_queue==24) {echo 'selected';} else { echo 'here';};?>>tier 2 dm delivery team <?php echo $queueid;?></option>

python - Merging two dataframes on similar columns -

i have following 2 dataframes, snippets out of large dataset: df1: date key number 2000 1 50 2001 1 40 2000 2 600 2001 2 650 df2: key key2 1 2 b 3 c i want add key2 column df1 column matched on "key". result should following: date key number key2 2000 1 50 2001 1 40 2000 2 600 b 2001 2 650 b to this, using following command: result = pd.merge(df1, df2, how="left", on="key") however, adds key2 "c" dataset, not want added. want variable key2 appended df1 based on keys of df1. information in df2 not match on key in df1 should dropped. therefore, result dataframe should have 1 column more df1 , exact amount of rows. does know why merge "left" not work here, because if run code this, result dataframe has 1 column more - desired-, more rows df1, not want. you can use pd.series.replace : in [242]: df1['key

android - ProgressBar is not set visible before other operations by click button -

i work mediaplayer , want show progressbar before calling method mediaplayer.prepare() (it can take time). tried asynktast, thread, handler show progressbar after operations @ end of clickplaybutton method. wrong? thanks! progressbar declaration: <progressbar android:id="@+id/progressbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="invisible"/> clickplaybutton method public void clickplaybutton(view view) { thread t = new thread(new runnable() { public void run() { h.post(updateprogress); } }); t.start(); // progressbar.setvisibility(progressbar.visible); // new progresstask().execute(); mtimer = new timer(); mmytimertask = new mytimertask(); if(!mediaplayer.isplaying()){ btnplay.setimageresource(r.drawable.player_stop); try { mediaplayer.setdatasource(data_http); mediaplayer.pre

php - Add minimum characters to 'bad word' regex? -

i made regex captures 'bad words' , substitutes *** can return user in form if bad words found, simplified version can found here: https://regex101.com/r/aleb61/3 (?i)\b(bitch)\b i'd require min 25 characters in same regex instead of having run 2 separate passes on (e.g. 1) bad words 2) enough chars?) possible? need add above "less 25 characters" pipe. regex minimum {min,max} {1,15} min of 1 character, max of 15. i'd list of "bad words" @ least 1 must exist as far regex limit goes /^[word]{1,15}$/ - must 1 -> 15 "word" found check post out profanity filter using regular expression (list of 100 words) wiki

Not able to create Azure Scheduler with the existing storage account -

Image
i trying create azure scheduler action type - storage queue. when try select storage queue says "no storage accounts found in selected subscription , location" , whereas had created storage account uk region , confgiured queue. please tell kind of stroage of location need select while creating storage account scheduler. as far know, azure scheduler can post messages either classic or new (arm) azure storage account queue, azure portal lists classic storage accounts selector. besides, azure rest api provide way create new job , can specify new (arm) storage account queue in job definition. wiki

pandas - apply rolling custom function on a dataframe with multiple outputs -

i have following dataframe: mydf date b c 1973-01-01 0.002 -0.003 0.004 1973-02-01 0.003 -0.005 0.006 ... i have function takes dataframe, date field, type of covariance , returns average return, covariance matrix, , annualized covariance matrix def myfunc(mydf, dtfield, typecov): #does computations based on type either equal weighted or exponentially weighted ... ... return eret, cov, cova the call myfunc(mydf, 'date', 'e') i trying use rolling function in pandas in order this, using 250 window, not sure how this. it works when use loop minwindow = 250 for in range(minwindow, minwindow+5): temp = mydf[i-minwindow:i] eret, c, ca = myfunc(temp,dtfield, typecov) thanks wiki

javascript - How to make links after they are visited not have any styling rules -

Image
i using react , doing task where, when selected; new link gets styled accordingly. problem when click on new link supposed red , no styling should applied it. however, turns darker blue , left underlined until click somewhere else on page. something note here. if click somewhere else after have clicked link turn red without underline. want happen on first click however. these styles after link clicked: this how is: this how should be: here code: style: .zone-selected { text-decoration: none; color: red; } zone: const title = this.props.isselected ? <a href="#" classname="zone-selected"> {this.props.zone.name} </a> : <a href="#"> {this.props.zone.name} </a>; you can ignore other stuff. saying if conditional true apply styling if not no styling. not sure if best practice or "right way" got work post have in case else comes across

Multiple rsync commands with one password prompt -

in order sync 2 source directories (e.g. ~/src1 , ~/src2) 2 separate destinations (e.g. /tgt , /tgt/sub_tgt) in remote system using single rsync command, doing: rsync ~/src1 uid@host:/tgt; rsync ~/src2 uid@host:/tgt/sub_tgt for security reasons, password prompt necessary (do not want copy public key remote host) want avoid second password prompt. possible? if not willing go keyset, stuck situation. each call require authentication. i think work though, initiate ssh connection , execute commands after: https://unix.stackexchange.com/questions/50508/reusing-ssh-session-for-repeated-rsync-commands wiki

react native - Consecutive animations of component based on changing props -

i trying create snackbar-like status message component signature looks so: <statusmsg open={this.state.isopen} message={this.state.msg} onrequestclose={somefunc} /> when "open" set true, message should animate onto screen, stay there time period, animate off again. so, code below works fine, except in common use case: when calling component sets new message before old 1 has animated off screen. in case, code below replaces displayed message , uses same timer. ideally, when new message added, should cause old message animate off screen first, animate in new message. (i'd ensure if new message text same old.) i can't seem figure out how this. best guess statusmsg should factory creating animated views contain messages, have no idea how make work. specifically, how make prior messages close upon creation of new message. class statusmsg extends component { state = { exited: false, moveheightanimated: new animated.value(hidden_height) } timera

node.js - nodejs passport - use same routes in api but return different sets of data based on permissions -

not sure of clean way go his. let's have endpoint: get /api/books/ for user on webservice, return only user's resources. might little this: exports.getbooks = function(req, res) { // find books user bookmodel.find({ userid: req.user._id }, function(err, books) { if (err) res.send(err); res.json(books); }); }; the web service using api needs user logged in first. can achieve using basic passport strategy ensure authentication. let's have admin account needs see books ever recorded. what's more admin account , user accounts have different properties assigning boolean permissions not enough. using same endpoint: get /api/books i see no reason write endpoint achieve this. difference this: exports.getbooks = function(req, res) { // find books in database bookmodel.find({}, function(err, books) { if (err) res.send(err); res.json(books); }); }; however cannot come clean way achieve while using passport midd

onenote - Access publicly shared notebook via API -

i have mobile app use onenote 'back end' for, serving html pages of publicly shared notebook. scouring onenote api, can't find methods access notebook has been shared publicly without authorization. app used anonymous consumers, not owners of notebooks. if register application , client id, seems examples expect end user authenticate, end user in case anonymous, accessing notebooks have been shared office 365 users. headed in wrong direction this? unfortunately, onenote api not have functionality shared notebooks app permissions wiki

c# - change listbox position according to row bound -

i have grid view control 5 columns in windows app , list box. when type in 3rd cell, list box shown items. list box position below first row(third cell). want whenever new row bind grid view control, want list box shown below current cell .how can that? code: public partial class form1 : form { sqlconnection con = new sqlconnection(); string sqlquery = ""; bool text = false; public form1() { initializecomponent(); } control txtchanged; private void dgvpos_editingcontrolshowing_1(object sender, datagridvieweditingcontrolshowingeventargs e) { e.control.textchanged += new eventhandler(itemtxtbox_textchanged); txtchanged = e.control; txtchanged.textchanged += itemtxtbox_textchanged; } void itemtxtbox_textchanged(object sender, eventargs e) { if (text == false) { if (txtchanged.text !=

amazon web services - AWS API Gateway - import multiple Swagger 2.0 YAML files with external references -

i have bunch of swagger 2.0 yaml files describing moderately complex api. these files contain several external references looking like: $ref: 'subdir/other.yaml' is possible import api api gateway through either management console or (preferably) aws command line client? see @ console 1 can paste/upload single file, , me cli gives invalid swagger 2.0 input error top level swagger file (which import others). is such multi-file api definition supported in api gateway? wiki

query string - Quick Edit in SharePoint Task List is not working -

Image
i have sharepoint task list & using query string filter tasks belongs particular project. have parent task project name not assigned & subtasks have project name.i trying quick edit not able stop it. attached screenshot : wiki

Cannot use normal transform in velocity.js -

i wanna use 2d rotate not transform 3d rotatez in velocity.js but use transform: 'rotate(30deg)' not work, like $('#rotate').velocity({ // top: '1rem' // works // rotatez: 30 // works transform: 'rotate(30deg)' // not working }) so how do 2d rotate in velocity.js , relative issues on github wiki

javascript - require is not defined at lodash.js:1 -

i need use lodash process of data @ client side. lodash seems perfect, after installed via npm install lodash and included with <script type="text/javascript" src="node_modules/lodash/chain/lodash.js"></script> i'm getting error: uncaught referenceerror: require not defined @ lodash.js:1 i know browser side doesn't support module loading using require , how else supposed use lodash there? ps. it's _.find() need. wiki

python - Manipulate a part of variable while keeping the original intact -

what cleanest way manipulate / use / remove part of variable whilst keeping original variable intact. lets wanted value in following list corresponds highest numerical value so example: max([1, 2, '3a', '10b']) should evaluated as max([1, 2, 3, 10]) and value '10b' should returned extended approach using re.search() function: import re max_item = max([1, 2, '3abc', '10bc'], key=lambda n: int(re.search(r'\d+', str(n)).group(0))) print(max_item) the output: 10bc wiki

VS Code C# syntax highlighting bug -

using "visual studio code 1.15.1"; i've been using vscode on mac view c# code had written elsewhere, , reason, things aren't highlighted correctly. (0) await statements not highlighted correctly when used variable instead of method call or member accessor. await sometask; // highlighted if sometask variable of type await await something.sometask; // highlighted correctly await something.dosomething(); // highlighted correctly (1) using highlighted if function instead of keyword. using (var spoon = new disposablespoon()) { // ... } which didn't happen before. (2) c# 7 features aren't highlighted correctly, such out variables. if (map.trygetvalue(key, out tvalue val)) { // ... } i'm using default theme (dark+), , don't think have major, workspace-breaking plugins enabled (most themes or support other languages). did accidentally mess config or something, or bug? edit: (1) fixed when change language "c#" &qu

r - rgeos setdiff() providing unexpected result -

rgeos setdiff() problem i have been using setdiff() rgeos many years, i've found quirk in redoing work. want overlay transparent hole on akima generated image map. find need specify 1 of hole vertices larger polygon in hole cut. here example script: library(rgeos) changing 'maxy' 2.1 provides desired effect. why not 1.9? maxy <- 1.9 maxy <- 2.1 x1 <- c(1, 1, 2, 2, 1) y1 <- c(1, 2, 2, 1, 1) xy1 <- cbind(x1, y1) p1 <- as(xy1, "gpc.poly") plot(p1, main="p1") x2 <- c(1.1, 1.5, 1.9, 1.1) y2 <- c(1.1, maxy, 1.1, 1.1) # note: 'maxy' here! xy2 <- cbind(x2, y2) p2 <- as(xy2, "gpc.poly") plot(p2, main="p2") plot(setdiff(p1, p2), poly.args = list(col = "grey"), main="setdiff(p1, p2)", asp=1) if cannot fixed, there way accomplish same? thanks ahead of time. wiki

python - How to open Anaconda Spyder and Jupyter Notebook from different virtual environments -

Image
i installed latest version of anaconda 3. went ahead , created python 2.7 virtual environment. base environment anaconda python 3.0. went , activated 2.7 environment. wish use spyder , jupyter notebook in 2.7 environment. how go doing this? assistance or guidance appreciated thanks in advanced ok tried suggested. however, got error: wiki

jquery - Array passes through ajax but received as string in php -

the following jquery code: e_val = []; e_val = ['enroll','reject']; $.ajax({ url: 'myurl.php', type: 'post', datatype: 'text', data: { reason: 'insert', eval: e_val }, success: function (suc) { row.remove(); alert(suc); } }); myurl.php: $reason = $_post['reason']; $eval = array(); if($reason == "insert"){ $eval = $_post['eval']; echo $eval[1]; } and alert is: n that's because n @ index value 1 in e_val[0]. can know why array converted string in php page , i'm not able access array elements? in advance. you can use implode() implode() function returns string elements of array. <html> <head> <script src="https://ajax.googleapis.com/ajax/libs

c# - How to determine which domain a mobile client belongs to -

i have following set web application user x (browser) --> www.companyx.com/api/somemethod()--> database x user y (browser)--> www.companyy.com/api/somemethod()--> database y on web application, web config file contains baseuri so company x = www.companyx.com , y = www.companyy.com from can determine relevant base uri. now trying write xamarin android app this, when app downloaded user, best way, or how can go determine company user belongs to, , therefor determine , save baseuri local storage?. one of idea was, during logon screen, user enters email , password, , iterate though existing logon end points www.companyx.com/api/logon() www.companyy.com/api/logon() www.companyz.com/api/logon() which in turn potentially hit databases find email address , when finds it, know company user belongs , store base uri in local storage. but dont approach, wondering if there better way this? thanks in advance. wiki

javascript - Vimeo iframes for Toolset Post Archives -

essentially iframe vimeo embed link work individually, however, working on global editor displaying posts. using javascript seems answer, if knows way use simple <video></video> tag vimeo url let me know. here have [wpv-post-date] [types field='date'][/types] [types field='bible-passage'][/types] [types field='mp3'][/types] <div class="audio-player"><div id="play-btn"></div><div class="audio- wrapper" id="player-container" href="javascript:;"><audio id="player"><source src="[types field='mp3' output='raw'][/types]"> </audio></div></div><a class="x-btn black-button x-btn-global sermon- button sermon-audio" href="[types field='mp3' output='raw'][/types]" target="_blank">download</a> <iframe src="https://player.vimeo.com/video/229578292? t