Posts

Showing posts from March, 2010

javascript - can't push object into array -

Image
this question has answer here: how return response asynchronous call? 21 answers i'm missing basic. i'm grabbing data api , trying push array of json objects. api works fine , i'm getting data, not seem pushed array. can't seem console log of data parameters. here jquery code: var jsonarr =[] var jsondata = {} $.get(apigetlist,function(r) { $(r).each(function(i) { $.get(api_checklist_start + r[i].id +api_checklist_end ,function(s){ $(s[0].checkitems).each(function(k){ jsondata = {"item": [k], "task": r[i].name, "name": s[0].checkitems[k].name, "state": s[0].checkitems[k].state } jsonarr.push(jsondata) }) }) })

javascript - JSHint reports undefined global despite `globals` setting -

jshint reporting undefined variables despite globals setting. here minimal example: file.js: // jshint esversion: 6, node: true // globals intl 'use strict'; let percent = new intl.numberformat("en-us", { style: "percent" }).format; running jshint file.js index2.js: line 5, col 19, 'intl' not defined. 1 error any idea wrong configuration? note there no .jshintrc , configuration jshint comments @ beginning of file.js . to honest, never saw use of simple single-line comment // configure jshint/globals. try with multi-line comment style, /* globals my_lib: false */ per defined in: http://jshint.com/docs/

Python Selenium - How do you click on every row element for column of web table? -

this may 2 part question forgive me if isn't written: i'm trying webdriver go nba team stats page: http://stats.nba.com/teams/traditional/#!?sort=w_pct&dir=-1 table image reference and click linked fgm numbers in table. should open new tab in background. far i'm lost how should approaching this. i'm thinking: i need way count rows then need tell webdriver loop/click through elements in fgm column row count i'm sure can data beautifulsoup i'm trying practice selenium , working tables/links can vary in length. leads appreciated. thanks! python example: from selenium import webdriver selenium.webdriver import actionchains web_driver = webdriver.firefox() web_driver.get("http://stats.nba.com/teams/traditional/#!?sort=w_pct&dir=-1") actions = actionchains(driver) team_links = webdriver.find_elements_by_xpath("//body//td[contains(@class, 'first')]/a") link in team_links: actions.key_down(keys.con

ruby on rails - Parallax.js images render locally but not in production on Heroku -

disambiguation: there 2 popular plugins called "parallax.js". i'm referring this one. in development , parallaxed , non-parallaxed images work in erb template. in production (on heroku), non-parallaxed images rendering. suspect problem rails asset pipeline, recommended fixes haven't worked (see below). the parallax.js docs suggest following usage: <div class="parallax-window" data-parallax="scroll" data-image-src="/path/to/image.jpg"></div> but in order use asset pipeline, i've changed to: <div class="parallax-window" data-parallax="scroll" data-image-src="<%= image_url('image_file.jpeg') %>"></div> (in addition image_url , i've tried image_tag , image_path .) as mentioned, works fine on local machine. but in production, chrome browser console logs errors missing images: failed load resource: server responded status of 404 (not found) so

r - dplyr group_by and iterative loop calculation -

i trying perform iterative calculation on grouped data depend on 2 previous elements within group. toy example: set.seed(100) df = data.table(id = c(rep("a_index1",9)), year = c(2001:2005, 2001:2004), price = c(na, na, 10, na, na, 15, na, 13, na), index = sample(seq(1, 3, = 0.5), size = 9, replace = true)) id year price index r> df 1: a_index1 2001 na 1.5 2: a_index1 2002 na 1.5 3: a_index1 2003 10 2.0 4: a_index1 2004 na 1.0 5: a_index1 2005 na 2.0 6: a_index1 2006 15 2.0 7: a_index1 2007 na 3.0 8: a_index1 2008 13 1.5 9: a_index1 2009 na 2.0 the objective fill missing prices using last available price , index adjust. have loop performs these calculations, trying vectorize using dplyr . my logic defined in below loop: df$price_adj = df$price (i in 2:nrow(df)) { if (is.na(df$price[i])) { df$price_adj[i] = round(df$price_adj[i-1] * df$index[i] / df$index[i-1], 2) } }

flask - python importlib no module named -

i using flask , have following structure <root> manage_server.py cas <directory> --- __init__.py --- routes.py --- models.py --- templates <directory> --- static <directory> --- formmodules <directory> ------ __init__.py ------ baseformmodule.py ------ interview.py in routes.py, i'm trying create instance of interview class in interview module, so my_module = "interview" module = importlib.import_module('formmodules."+my_module) i error here says importerror: no module named formmodules.interview some info init files: /cas/formmodules/__init__.py empty /cas/__init__.py initialize flask app. let me know if helpful know contents of of these files. this 1 of classical relative vs absolute import problems. formmodules exists relative cas , import_module absolute import (as from __future__ import absolute_imports ). since formmodules cannot found via sys.path , import fails. one way fix use relative im

csv - How can I indicate the entry id in the Logstash script? -

i have following mapping in elasticsearch: put /myindex { "mappings": { "regions": { "_all": { "enabled": false }, "properties": { "regionid": {"type": "keyword"}, "seasons": { "properties": { "season-type": { "type": "keyword" }, "period": { "properties": { "start-day": { "type": "integer" }, "start-month": { "type": "integer" }, "end-day": { "type": "integer" }, "end-month": { "type": "integer" } } } } }, "autonomous_com

php - Typeahead and Laravel not returning any results -

i trying setup typeahead.js, use autosuggestion feature on laravel app. unfortunately, returns no results, each time. i return data beforehand take advantage of local storage, there no querying db in instance. route: route::get('/', function () { return view('welcome', ['treatments' => treatment::orderby('treatment') ->pluck('treatment', 'id')]); }); welcome view: const treatments = new bloodhound({ datumtokenizer: bloodhound.tokenizers.whitespace, querytokenizer: bloodhound.tokenizers.whitespace, local: '{{$treatments}}' }); $('#bloodhound').typeahead({ hint: true, highlight: true, minlength: 1 }, { name: 'treatments', source: treatments, templates: { empty: [ '<div class="list-group search-results-dropdown"><div class="list-group-item">nothing found.</div></d

GitHub readme markdown to include bullet points inside of table -

i trying put bullet points inside of github text box readme. i know how them separately. example create gray textbox can do: ``` item1 item2 ``` to create bullet points can do: * item1 * item2 however if try , place bullet points inside of table, literal syntax bullet points shows up, rather bullet points. have tried escaping bullet point characters. how bullet points inside of table? the github flavored markdown spec plainly states: block-level elements cannot inserted in table. of course, lists block-level elements, , therefore cannot inserted in table. generally way around such restrictions in markdown use raw html. however, raw html list html block , block-level element , not allowed in table. therefore, need use raw html entire table.

c - Signed to unsigned with subtraction -

i've decided make leap , read through bunch of computer science books better equip myself future. at moment i'm reading through converting signed unsigned decimals. understand majority if (hopefully becomes easier eventually), struggling following (in 32-bit): -2147483647-1u < -2147483647 according book, evaluates true. there's bit i'm still struggling cant see why evaluates this. with understanding, know both converted unsigned values in calculation due first number being cast unsigned. first number therefore -2147483648 after subtraction , converted unsigned, or unsigned conversion happen prior subtraction? sorry lengthy post, trying head around understanding this. thanks! the first number therefore -2147483648 after subtraction , converted unsigned, or unsigned conversion happen prior subtraction? the latter true. according c11 standard "6.3.1.8 usual arithmetic conversions" : ...otherwise, if operand has unsigned

type conversion - Method error when using DifferentialEquations.jl Julia package -

i'm trying solve ode45 differential equation differentialequation.jl package i'm getting method error. using differentialequations m = 400; m = 35; c = 3e3; c = 300; k = 50e3; k = 200e3; = 0.05; l = 0.5; vh = 13.9 mm = [m 0; 0 m] # mass matrix cc = [c -c; -c c+c] # damping matrix kk = [k -k; -k k+k] # stiffness matrix w(t) = a*sin(2*pi*vh*t/l) wd(t) = a*2*pi*vh*t/l*cos(2*pi*vh*t/l) # dw/dt n = 2 # number of (original) equations mi = mm^(-1) aa = [zeros(n,n) eye(n); -mi*kk -mi*cc] f(t) = [0; c*wd(t)+k*w(t)] # force vector g(t,y) = aa*y+[zeros(n,1); mi*f(t)] y0 = zeros(4) # initial conditions tspan = (0.0, 0.5) # time span prob = odeproblem(g, y0, tspan) # defining problem solve(prob) the code gives error says: methoderror: cannot convert object of type array{float64,2} object of type array{float64,1} may have arisen call constructor array{float64,1}(...), since type constructors fall convert methods. i not might doing wrong, althoug

java - Why during autoboxing final long to Byte compilation error happens, but final int to Byte is ok? -

there no error during auto-boxing of constants int , short types byte , constant long type has error. why? final int = 3; byte b = i; // no error final short s = 3; byte b = s; // no error final long l = 3; byte b = l; // error from jls sec 5.2, "assignment contexts" (emphasis mine): in addition, if expression constant expression (§15.28) of type byte, short, char, or int : a narrowing primitive conversion may used if type of variable byte, short, or char, , value of constant expression representable in type of variable. a narrowing primitive conversion followed boxing conversion may used if type of variable is: byte , value of constant expression representable in type byte. ... it's not allowed long s spec. note second bullet point here says happens irrespective of boxing: assigning constant long expression byte variable fail: // both compiler errors. byte primitive = 0l; byte wrapped = 0l;

c# - Can I return a TransparentProxy from a WCF service method? -

i've set wcf windows service assemblies hot-swappable method described in this answer . 1 of service methods sensitive performance , typically returns large, complex object graph marshaled outer app domain value. i'm encountering issue overhead of marshaling adding on time in order of seconds tens of seconds, unacceptable consumers of service. working off assumption payload can't reduced in size, there way can improve performance of without sacrificing hot deployability of service? as 1 possibility, started considering whether possible marshal object graph reference instead , have wcf return - doing serialization on side of inner app domain , avoid need double serialization, unable work (i greeted cryptic socket timeout errors). approach possible? example code give idea of mean: [datacontract] public class complexobject { // stuff } public class marshalbyreflistofcomplexobject : marshalbyrefobject, ilist<complexobject> { private readonly list<

laravel - Intervention Image source not readable on update -

i have searched, , did not find answer problem. well, using intervention laravel 5.5 upload photos. when create new recipe(in case), working , photos being uploaded succefully. this code initial upload: $front_image = $request->file('front_image'); $frontimagename = md5(time()) . '.' . $front_image ->getclientoriginalextension(); $locationfi = public_path('photos/front/' . $frontimagename); image::make($front_image) ->resize(454,340) ->insert(public_path('photos/logo.png'),'bottom-right') ->save($locationfi); $recipe->front = $frontimagename; all standard stuff. when try edit recipe, image source not readable . code re upload: $front_image = $request->file('front_image'); $frontimagename = md5(time()).'.'.$front_image ->getclientoriginalextension(); $location = public_path('photos/front/'.$frontimag

ffmpeg - Can you set initial buffer for Clappr Player? -

we using clappr player live stream hls. we trying make video start playing quicker. anyone know if there way set initial buffer size of clappr player? i want set lower seep video starting... thanks. clappr uses hls.js . should able pass hlsjsconfig object in player's configuration. can find fine-tuning options here . that being said need tweak hls encoding too.

mysql - PHP Follow Unfollow Tracking -

so i'm looking track followed , unfollowed users. so here i've got button post the id's of stuff , user: <form action='/follow_test.php' method='post'> <input style='display:none;' name='stuffid' type='text' value='".$cover['stuffid']."'> <input style='display:none;' name='userid' type='text' value='".$userid."'> <input type='submit' name='follow' value='follow'> </form> follow_test.php if(isset($_post['follow'])) { $comicid_ = trim($_post['stuffid']); $userid_ = trim($_post['userid']); try { $conn = new pdo("mysql:host=$host;dbname=$db_name", $username, $password); $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); $ac = $conn->prepare( "insert following(stuffid,userid)

c# - Seeding database with admin user--but he can't log in -

i creating mvc application , want seed database single admin user, have ability create other users. i'm doing follows: applicationuser admin = new applicationuser { username = "whatever", email = "whatever@mailinator.com", emailconfirmed = true }; string pwd = "password"; var chkuser = await _usermanager.createasync(admin, pwd); if (chkuser.succeeded) { await _usermanager.addtoroleasync(admin, constants.roles.administrator); } this creates user in database, expected. when try login user, fail. screenshot of failure this puzzling me, because use exact same code when users register through gui, there working fine. // post: /account/register [httppost] [allowanonymous] [validateantiforgerytoken] public async task<iactionresult> register(registerviewmodel model, string returnurl = null) { viewdata["returnurl"] = returnurl; if (modelstate.isvalid) {

c# - Unity Navigation NavMeshAgent -

so worked fine before updating unity, after updated keep getting 2 error unityengine.ai.navmeshagent.resume()' obsolete: `set isstopped false instead' unityengine.ai.navmeshagent.stop()' obsolete: `set isstopped true instead' this code public class navigation : interaction { public float relaxdistance = 5; private navmeshagent agent; private vector3 target = vector3.zero; private bool selected = false; private bool isactive = false; public override void deselect() { selected = false; } public override void select() { selected = true; } public void sendtotarget() { agent.setdestination(target); agent.resume(); isactive = true; } void start() { agent = getcomponent<navmeshagent>(); } // update called once per frame void update() { if (selected && input.getmousebuttondown(1)) { var temptarget = rtsmanager.current.screenpointtomapposition(input.mouseposition); if (temptarget.hasvalue)

api - CEX order book market update -

i trying use cex.io api construct live order book, struggling understanding message api. i subscribing following json: { "e": "order-book-subscribe", "data": { "pair": [ "btc", "usd" ], "subscribe": false, "depth": -1 }, "oid": "1435927928274_3_order-book-subscribe" } the first message snapshot of order book, 1 ok. but next, messages "just" updates, same 1 : { 'e': 'md_update', 'data': { 'id': 92276361, 'pair': 'btc:usd', 'time': 1505337293621, 'bids': [], 'asks': [ [4078.1692, 0.0] ] } } how update snapshot first received u

Windows 10 Docker Sitespeed.io error: "$(pwd)" includes invalid characters for a local volume name -

i new docker may simple fix. i trying instance of sitespeed.io , running following docs on windows 10 machine has default install of docker - not using windows containers, c shared.. install steps: https://www.sitespeed.io/documentation/sitespeed.io/installation/#windows-1 step 1 works fine. c:\users\vicky> docker pull sitespeedio/sitespeed.io step 2 not. c:\users\vicky> docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox this results in error looking with. specifically: c:\windows\system32>docker run --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io https://www.sitespeed.io -b firefox docker: error response daemon: create $(pwd): "$(pwd)" includes invalid characters local volume name, "[a-za-z0-9][a-za-z0-9_.-]" allowed. if intended pass host directory, use absolute path. see 'docker run --help'. so running command per suggestion tarun: https://

c++ - Why QString::toInt() receives a pointer and not a reference? -

qstring has few methods such toint(), tolong(), etc. these methods receive pointer bool determines if conversion successful shown here: int qstring::toint(bool * ok = 0, int base = 10) const my question is: why 'ok' pointer , not reference? i know implemented using either, don't see advantage of using pointer on reference. i know implemented using either, don't see advantage of using pointer on reference. you use reference default value int qstring::toint(bool& ok = some_bool_guaranteed_by_the_library, int base = 10) const; the downside of library has provide some_bool_guaranteed_by_the_library globally available bool object. sounds designers of library did not see enough benefits provide such object.

Laravel update pivot table (many to many relationship) -

i have tables named users, questions, answers , answer_user. can data tables using $user->answers method couldn't figure out how update or insert if not exists. (answer_user table) user table: $table->increments('id'); $table->string('email', 255)->unique(); $table->string('password', 255); questions table: $table->increments('id'); $table->string('title', 255); answers table: $table->increments('id'); $table->string('text'); $table->integer('question_id')->unsigned(); $table->foreign('question_id') ->references('id') ->on('questions') ->ondelete('cascade'); answer_user table $table->increments('id'); $table->integer('user_id')->unsigned(); $table->integer('question_id')->unsigned(); $table->integer('answer_id')->unsigned(); $table->foreign('u

r - How to append dataframes based on overlapping date values? -

i'm trying combine 2 large data frames containing temperature data several data loggers. data loggers , column names same in each data frame. 1 data frame contains values more recent other data frame. the data looks this: date.time date temp1 temp2 2011-08-22 19:00 2011-08-22 11.265 5.562 2011-08-22 20:00 2011-08-22 11.254 6.541 2011-08-22 22:00 2011-08-22 12.256 5.456 2011-08-22 23:00 2011-08-22 13.568 15.265 date.time<-c("2011-08-22 19:00", "2011-08-22 20:00", "2011-08-22 22:00","2011-08-22 23:00") date<-c("2011-08-22","2011-08-22","2011-08-22","2011-08-22") temp1<-c(11.265,11.254,12.256,13.568) temp2<-c(5.562,6.541,5.456,15.265) df_old<-data.frame(date.time,date,temp1,temp2) and: date.time date temp1 temp2 temp3 2011-08-22 22:00 2011-08-22 12.256 5.456 24.598 2011-08-22 23:0

The same numbers keep showing up in c++ program. No idea why -

i wrote intention of finding vertex of 3 user entered point though repeats same numbers regardless of entered. not noticing wrong. thinking set formulas wrong. language c++ if changes anything. #include<iostream> using namespace std; //declare variables. int main() { float a,b,c; float vertex1; float vertex2; //allow user inputs. overall basic program. cout << "enter values a,b,c receive vertex of parabola"; cin>> a>>b>>c; //create vertex calculations. my calculations here though not sure formatted correctly. vertex1=-(b/(2*a)); vertex2=-b*b*2/(4 *a)+c; cout <<"x of v is" <<vertex1<<endl; cout<<"y of v is"<<vertex2<<endl; return 0; } like have said before things seem correct though nothing coming out. overall confusing. hoping fix simple. change -b*b*2/(4 *a)+c (b*b)/(4*a) - ((b*b)/(2*a)) + c how

java - Jpa understanding for interview -

what best description of jpa?, interview answer comprehensive yet detailed ? answer:: java persistence api java application programming interface specification describes management of relational database in java platform , divided 3 parts persistence entity ,persistence query language , object relation database metadata assuming you're going interview solid understanding of jpa, don't worry memorizing standard definition. interview questions way of gauging applicants level of familiarity given subject. want response both reflect understanding of subject matter, , importantly, tailored in concise manner context of question. if asked why jpa useful, not describe history of specification, or provide memorized definition- avoid being verbose in case indicates lack of confidence in answer, or @ worst lack of understanding. if question asked verbatim "what best description jpa?"- sounds want abstract, high-level response indicates understanding of specifi

javascript - How do I convert jQuery code in my React Component? -

i need update css, , naturally used jquery, i'm told not use jquery react. how properly. can add more code if needed. i'm toggling bottom border of div togglemarker () { if (this.state.previous && (this.state.current !== this.state.previous)) { $('#nav_' + this.state.previous).css("border-bottom", ''); } if (this.state.previous !== this.state.current) { $('#nav_' + this.state.current).css("border-bottom", this.color); } this.setstate({previous: this.state.current}); } you can manipulate components style inline , can give conditions according state variables. example render(){ return( <div style={{ borderbottom: ((this.state.previous && (this.state.current !== this.state.previous)) ? 'none' : 1) }}> // ... </div> ) }

linux - bash shell: syntax error near unexpected token `else' -

i'm following instructions on implementing script seemed clear me, upon running i'm told there error line 36. can't seem understand problem. line 36: syntax error near unexpected token `else' line 36: ` else' the code: if [ "$answer" = "y" ] #backup vms if answer yes num in 1 2 3 #determiant loop 3 arguments: 1, 2, , 3 echo "backing vm #$num" gzip < /var/lib/libvirt/images/centos$num.qcow2 > /root/centos$num.qcow2.backup.gz echo "vm #$num backup done" done elif [ "$answer = "n" ] read -p "which vm should backed up? '(1/2/3)': " numanswer until echo "$numanswer" | grep "^[123]$" >> /dev/null # match of single digit: 1, 2, or 3 read -p "invalid selection. select 1,2, or 3: " numanswer echo "backing vm #$numanswer" gzip < /var/lib/libvirt/ima

java - Encoding problems with Stanford NER. Which encoding should I use? -

i'm having hard time find right encoding portuguese result appear properly. used command tag small sample model: ps > java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.crfclassifier -loadclassifier ner-model.ser.gz -textfile tweets.txt as example, 1 of phrases follows: meus pais na época em que eram casados e minha mãe era viva !. em praia de copacabana - posto 5 . see special characters in example: "época" , "mãe", turn out in final result: meus/o pais/o na/o ├⌐poca/o em/o que/o eram/o casados/o e/o minha/o m├úe/o era/o viva/o !/o ./o em/o praia/b-location de/i-location copacabana/i-location -/o posto/b-location 5/i-location ./o época = ├⌐poca mãe = m├úe not result expected. it can happening when train model serious concern. tried use -encoding flag various options: utf-8 iso-8859-15 iso-8859-1 i have success utf-8 or iso-8859-1, time having same result 1 showed above. made sure file encoded utf-8, tried export fi

javascript - addEventListener() Not Working - can't figure out why -

wrote super basic script try out addeventlistener , it's not working ... why? here's code: <html> <head> <meta charset="utf-8" /> <title></title> <script> function validateme(){ document.getelementbyid("button1").addeventlistener("click",validateform); function validateform(){ alert("wheeeeee!"); } window.addeventlistener("load",validateme); } </script> </head> <body> <form name="" id="" action="" onsubmit="return validateme"> first name: <input type="input" name="first_name" id="first_name" /> <br /><br /> last name: <input type="input" name=&quo

Plot vector field expressed in polar coordinates with quiver in MATLAB -

Image
i want plot following vector field expressed in polar coordinates: e = r * r % (i using big r represent r^ hat). the field should figure p3.20 : the difficult part converting polar euclidean coordinates: [x,y] = meshgrid(-5:1:5,-5:1:5); r = sqrt(x.^2 + y.^2); % r in function of (x, y) theta = atan2(y, x); % theta in function of (x, y) u = r.*cos(theta); % x component of vector field v = r.*sin(theta); % y component of vector field quiver(x, y, u, v)

typescript - Ionic find contacts -

i trying search in ionic 2 application on phone number has +1 in front of it. import { component } '@angular/core'; import { ionicpage, navcontroller, navparams } 'ionic-angular'; import { callnumber } '@ionic-native/call-number'; import {contacts, contact, contactfield, contactaddress, contactname,contactfindoptions} '@ionic-native/contacts'; import {contactinterface} "../../models/interfaces/contactinterface"; /** * generated class contactmenupage page. * * see http://ionicframework.com/docs/components/#navigation more info * on ionic pages , navigation. */ @ionicpage() @component({ selector: 'page-contact-menu', templateurl: 'contact-menu.html', }) export class contactmenupage { contact : contactinterface; constructor(public navctrl: navcontroller, public navparams: navparams, private callnumber: callnumber, private contactctrl: contacts) { this.conta

java - Get input values from Spring Boot Thymeleaf -

i'm attempting retrieve value java class display error . there unexpected error (type=internal server error, status=500). exception evaluating springel expression: "staff.username" (register:22) this .html file <div class="form-group"> <label for="username" class="cols-sm-2 control-label">username</label><span class="bg-danger pull-right" th:if="${usernameexists}">username exists</span> <div class="cols-sm-10"> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-users fa" aria-hidden="true"></i></span> <input type="text" th:value = "${staff.username}" class="form-control" id="username" name="username" roleid="username" placeholder="enter usernam

Fix code request for 'Auto Fit Row Height Of Merged Cells' formula. VBA Excel -

the primary issue macro when text long, height of merged cells becomes large. the thread on source(listed below), not have satisfying solutions issue. the merged cell takes info several sources , includes 'char(10) spaces make difficult create single cell column auto-fitting. option explicit public sub autofitall() call autofitmergedcells(range("a1:b2")) call autofitmergedcells(range("c4:d6")) call autofitmergedcells(range("e1:e3")) end sub public sub autofitmergedcells(orange range) dim theight integer dim iptr integer dim oldwidth single dim oldzzwidth single dim newwidth single dim newheight single sheets("sheet4") oldwidth = 0 iptr = 1 orange.columns.count oldwidth = oldwidth + .cells(1, orange.column + iptr - 1).columnwidth next iptr oldwidth = .cells(1, orange.column).columnwidth + .cells(1, orange.column + 1).columnwidth orange.mergecells = false newwidth = len(.cells(oran

botframework - Can intercept a message in FormFlow before it reaches recognizers? -

we have bot collecting information , utilize formflow. using custom prompter can customize outgoing messages, there similar facility let intercept incoming messages before hit recognizers? specific use case based on user input, may want exist out of flow , redirect different dialog.

dictionary - Adding Billing Information for existing Map API account -

we using map api functionality given token. have reached our daily limit api calls , add billing information upgrade account. updating billing information change in our api token? token on live environment customers prepare in advance down time need in order update token change. thank you

node.js - Using Typescript with Nodejs - Can't find index.d.ts -

a friend recommended swap on typescript javascript, way deal problems having implementing promises in loops , conditionals (ts has async/await functionality). can never seem ts compiling properly. latest error got on vscode terminal (which different set of errors getting on console) was: error ts6053: file 'c:/stuff/node_modules/@types/node/index.d.ts' not found. so created directory structure , put index.d.ts in there , getting these errors: node_modules/@types/node/index.d.ts(6,25): error ts2307: cannot find module 'stream'. node_modules/@types/node/index.d.ts(14,32): error ts2304: cannot find name 'buffer'. node_modules/@types/node/index.d.ts(15,78): error ts2304: cannot find name 'buffer'. node_modules/@types/node/index.d.ts(23,39): error ts2304: cannot find name 'buffer'. it's not correct way solve problem doing: created directory structure , put index.d.ts in there the correct way installing @types/node npm

javascript - add array of object into array of object using forEach es6 -

i have set of colors array ["#c4b18f", "#100f5c"] and want add each cameras, cameras nested array, so [ { "id": 1, "date": "sat", "cameras": [ { "name": "east gate", "total_count": 233 }, { "name": "south gate", "total_count": 2599 } ] }, { "id": 2, "date": "sun", "cameras": [ { "name": "east gate", "total_count": 123342 }, { "name": "south gate", "total_count": 2333 } ] } ] i've tried got undefined const result = data.foreach(obj => ({ ...obj, cameras: obj.cameras.map((obj2, i) => ({ ...obj2, color: colors[i] })

xamarin.forms - Context action in Xamarin Forms ListView stops working -

i have created app in xamarin forms targeting ios. in 2 of listviews have created context actions using menuitems. problem: if swype open menuitem , press "back" button, of xamarin forms page (while menuitem open), context actions stops working. swype functionality not work of listviews. have close app context actions (swype) work again. i tested example project listview , has same problem listview sample project xamarin i use latest version of xamarin forms. you have refresh listview once again when click or again enter list view page. i had exact scenario in mine , how solved it.

android - dlopen failed: library "/data/app-lib/UnityPlayerActivity/libunity.so" not found -

i want put unity apk in android system,and put apk in /system/app ,and libmain.so libmono.so libunity.so in /system/lib.but report error : error: unable load library: /data/app-lib/projector_water/libunity.so [dlopen failed: library "/data/app-lib/projector_water/libunity.so" not found

python - indexing db content to elastic search -

hello working on django project backend database postgresql server. , have chosen elastic search search engine project. i have used elastic search-dsl-py create mapping between django models , elastic search doc type. , use django signals capture update , delete events. by way, haven't mapped fields django model elastic search. when user search he/she get's list of item homepage elastic search server. when user clicks item list. should query detail data of item, in elastic_search server or in postgres server if put details of every object in elastic server, going pain me as, there nested relation in django models. if don't put details in elastic search server, need query database, detail of item going slow compared elastic search query. which approach should go? index properties along nested relation in elastic search server , querying operation elastic search. or index necessary field in elastic search server, , detail view, q query database

multithreading - Running java in cmd more memory consuming then IDE -

i beginner java programming, , write program http request in every minute. and try build jar , run on cmd, because want run few java in same time. see it’s memory consuming higher run on ide. , program have lot of console output. and lot of people told me use multi thread finish work, research said multi thread when process loading switch other process load, multi thread real multi tasking? because in future maybe http request every 5 second , want real multi tasking function. thanks everyone, , sorry bad english . p.s. using intellij community version memory consumption: lange amounts of console output can influence memory usage. the command line , ide handle console output differently (e.g. buffer size). you should ask yourself: do need console output? furthermore it's possible ide uses different commandline paramater start jvm (e.g. heap size) multithreading: before use multiple threads should ask 1 question: does program benefit multithreading

write in a csv file in python and read it using the column name -

while have written code import csv open('persons.csv', 'w') csvfile: filewriter = csv.writer(csvfile, delimiter=',',quotechar='|') filewriter.writerow(['name', 'profession']) filewriter.writerow(['derek', 'software developer']) filewriter.writerow(['steve', 'software developer']) filewriter.writerow(['paul', 'manager']) and getting result as ['name', 'profession'] [] ['derek', 'software developer'] [] ['steve', 'software developer'] [] ['paul', 'manager'] [] it leaving line in between. how resolve ??? and 1 more thing want read data csv using column name i.e. import csv open('persons.csv') f: reader = csv.reader(f) name, profession in reader: print(name, profession) --when run code shows error.. name, profession in reader: valueerror: not

composer php - Fatal error: require(): Failed opening required '../PHPMailerAutoload.php' (include_path='.:/usr/local/php56/pear') -

first time using phpmailer, , can't seem passed require error .. installed composer did require phpmailer/phpmailer , tried changing paths .. still can't pass error message: fatal error: require(): failed opening required '../phpmailerautoload.php' (include_path='.:/usr/local/php56/pear') in /home/hiinfo53/public_html/grandbluehawaii.com/cgifile/contact_phpmailer.php on line 15 <?php /** * example shows how handle simple contact form. */ echo getcwd(); $msg = ''; //don't run unless we're handling form submission if (array_key_exists('email', $_post)) { date_default_timezone_set('etc/utc'); require '../phpmailerautoload.php'; //create new phpmailer instance $mail = new phpmailer; //tell phpmailer use smtp - requires local mail server //faster , safer using mail() $mail->issmtp(); $mail->host = 'usm1260.sgded.com'; $mail->port = 465; $mail-&g

multithreading - Python 2.7: streaming HTTP server supporting multiple connections on one port -

i looking standard python 2.7 package providing http server simultaneous streaming connections on same port number. hey moderators out there, please stop flagging question duplicate of questions want serve in non-streaming ways, one: multithreaded web server in python . no, don't want hack such threadingmixin merely collects response , returns unit. in other words, i'm looking standard way following example program -- without writing whole http server myself. import time, socket, threading sock = socket.socket (socket.af_inet, socket.sock_stream) host = socket.gethostname() port = 8000 sock.bind((host, port)) sock.listen(1) # own http server... oh man, bad style. http = "http/1.1 200 ok\ncontent-type: text/html; charset=utf-8\n\n" class listener(threading.thread): def __init__(self): threading.thread.__init__(self) self.daemon = true # stop python biting ctrl-c self.start() def run(self): conn, addr = sock.acc

What is the execute sequence of i++ in java -

what execute sequence of following code? if (hash[s.charat(right++)]-- >= 1) in understanding 1. hash[s.charat(right)] >= 1 2. hash[s.charat(right)]-- 3. right++; thank you!!!! execute sequence of if (hash[s.charat(right++)]-- >= 1) is: read value of hash (a) read value of s (b) read value of right (c) increment value of right call b.charat(c) (d) read value of a[d] (e) decrement value of a[d] read constant 1 (f) skip past if block if e < f . if hash , s , , right 3 local variables, bytecode of if statement is: 1: aload_1 2: aload_2 3: iload_3 4: iinc 3, 1 5: invokevirtual #21 // method java/lang/string.charat:(i)c 6: dup2 iaload 7: dup_x2 iconst_1 isub iastore 8: iconst_1 9: if_icmplt 99 update the effect same as-if had written: boolean cond = hash[s.charat(right)]; hash[s.charat(right)]--; right++; if (cond) { except values read once, , charat() call , inde

optimization - Constraining on a Minimum of Distinct Values with PuLP -

Image
i've been using pulp library side project (daily fantasy sports) optimize projected value of lineup based on series of constraints. i've implemented of them, 1 constraint players must come @ least 3 separate teams. this paper has implementation (page 18, 4.2), i've attached image: it seems somehow derive indicator variable each team that's 1 if given team has @ least 1 player in lineup, , constrains sum of indicators greater or equal 3. does know how implemented in pulp ? similar examples helpful. any assistance super appreciated! in case define binary variable t sets upper limit of x variables. in python don't name variables single letter have nothing else go on here how in pulp. assume variables lineups , players , players_by_team , teams set somewhere else x_index = [i,p in lineups p in players] t_index = [i,t in lineups t in teams] x = lpvariable.dicts("x", x_index, lowbound=0) t = lpvariable.dicts("t&quo

c++ - QDataStream operator << overloading for Abstract class -

i want overload << operator abstract class virtual operator, know how overload operator simple class , code below sample. class normalclass { public: int firstfield() const; void setfirstfield(int firstfield); int secondfield() const; void setsecondfield(int secondfield); private: int m_firstfield; int m_secondfield; }; qdatastream &operator<<(qdatastream &out, const normalclass &obj) { out << obj.firstfield(); out << obj.secondfield(); return out; } but lets have abstractbaseclass ,childclass below class abstractbaseclass { public: abstractbaseclass() {} int basefirstfield() const; void setbasefirstfield(int basefirstfield); int basesecondfield() const; void setbasesecondfield(int basesecondfield); private : int m_basefirstfield; int m_basesecondfield; }; class childclass : public abstractbaseclass {