Posts

Showing posts from July, 2015

python - Pip Install Semantic Version with Metadata not upgrading -

i have 2 versions of python build: 16.1206.43542 17.0817.221945+f4cc396 the difference can see ending metadata. when run pip install package , version 16.1206.43542 installed , not latest. proper behavior? have thought pip have honored metadata, , installed later package? thoughts? ideas? welcomed. transparency, adding sha git build version.

mysql - SQL-Case When Issue -

i trying sort transaction dates aging policy. when lastdate has been in location greater aging days limit policy should show overage if not within referring current date. here current table: +---------+------+----------+-------------+ |lastdate | part | location | aging days | +---------+------+----------+-------------+ 12/1/2016 123 vvv 90 8/10/2017 444 rrr 10 8/01/2017 144 pr 21 7/15/2017 12 rrr 10 here query: select q.lastdate, r.part, r.location, a.agingpolicy 'aging days' opsintranexcel r (nolock) left inventoryaging (nolock) on r.location=a.location left join (select part,max(trandate) lastdate opsintran group part) q on r.part=q.part here column want added in: +---------+------+----------+------------+---------+ |lastdate | part | location | aging days | age | +---------+------+----------+------------+---------+ 12/1/2016 123 vvv 90 overage 8/10/2017 444

select - Where should I lock a model to prevent race conditions while validating it on a Django admin change page? -

the simplified case: models.py : class candidate(model): first_name = charfield(max_length=64) last_name = charfield(max_length=64) class ward(model): no = positiveintegerfield(unique=true) address = charfield(max_length=1024) population = positiveintegerfield() class votes(model): candidate = foreignkey(candidate, on_delete=cascade) ward = foreignkey(ward, on_delete=cascade) amount = positiveintegerfield() in each ward each candidate may receive votes.amount votes , winner of election candidate receives votes aggregated on wards . these votes editable in django admin: admin.py : class votesinline(stackedinline): model = votes @register(ward) class wardadmin(modeladmin): inlines = (votesinline,) now validation issues kick in. sum of votes.amount candidates must not exceed ward 's total ward.population . however, such validation meaningless unless ward remains locked duration of validation of related votes ! else race

android nougat recyclerview item animation -

i using recyclerview in app , each item having circle animation. first when load working when scroll or down few items not animating. this issue happening in android 7.1. same code working on below 7.1 versions share views.thanks

asp.net web api - Impersonation attribute for uploading a file in network- wep api -

we have apiimpersonate attribute impersonate shared network uploading files. in several of our projects working fine; , in project it's doing impersonation , see isauthenticated in debug mode windowsidentity true . the problem when use directory.createdirectory() directly in api controller there no issue, but when call asset service in file create directory gives me error " server can not perform request ". here code in question: public static windowsimpersonationcontext impersonate(string domain, string username, string password) { var token = intptr.zero; var tokenduplicate = intptr.zero; const int logon32logoninteractive = 2; const int logon32logonnewcredentials = 9; const int logon32providerdefault = 0; if (reverttoself()) { if (logonuser(username, domain, password, logon32logonnewcredentials, logon32providerdefault, ref token) != 0) { if (duplicatetoke

Firebase Auth incorrect Error after Google Signin -

if create test user using gmail email , password on firebase auth using signinwithemailandpassword . , on next visit sign in using google sign in same gmail email using signinwithpopup(provider) . on next visit try sign in same email using signinwithemailandpassword error code password incorrect shouldn't correct error code handles case email linked google provider can prompt user sign in google instead of trying input email , password. or trying reset password. if create email/password user , sign in google user, google account overwrite email/password account (assuming not verified). security reasons, can create unverified email/password account, possibly claiming user's email. firebase overwrites signin google account if want link google account email account, can first sign in user google , currentuser.updatepassword add password. next user can sign in google or email/password.

javascript - How to click on <a> tag using Curl -

how can click on tag , page content i'm using script aliexpress page content fetch comments $url = "some link"; $ch = curl_init(); curl_setopt( $ch, curlopt_useragent, "mozilla/5.0 (windows; u; windows nt 5.1; rv:1.7.3) gecko/20041001 firefox/0.10.1" ); curl_setopt( $ch, curlopt_url, $url ); curl_setopt( $ch, curlopt_followlocation, true ); curl_setopt( $ch, curlopt_encoding, "" ); curl_setopt( $ch, curlopt_returntransfer, true ); curl_setopt( $ch, curlopt_autoreferer, true ); curl_setopt( $ch, curlopt_ssl_verifypeer, false ); $content = curl_exec( $ch ); aliexpress feedback fetch comments using javascript after clinking on following tag <li data-trigger="feedback" data-role="trigger" class="ui-switchable-trigger"> <a href="javascript:;" data-spm-anchor-id="2114.10010108.0.0">feedback (27)</a> </li> can guide me if possible the page trying

html - Host Gator site not loading css file -

i registered doamin name host gator. uploaded index.html file , style.css file public_domain directory on host gator using ftp (filezilla). when go url dylan's portfolio can see site content in index.html file none of css rules apply. inspected page console , 404 error saying css file cannot found. have linked css file in index.html file using both relative , absolute paths , still cannot figure out. please :( your directory structure issue. place style.css in css folder within root_directory root_directory |-css |-style.css or edit html <link rel="stylesheet" href="style.css"> hope helps..

java - How to import a CSV file into a BigQuery table without any column names or schema? -

i'm writing java utility import few csv files gcs bigquery. can achieve bq load , wanted using dataflow job. i'm using dataflow's pipeline , pardo transformer (returns tablerow apply on bigqueryio) , have created stringtorowconverter() transformation. here actual problem starts - forced specify schema destination table although don't want create new table if doesn't exist - trying load data. not want manually set column name tablerow have 600 columns. public class stringtorowconverter extends dofn<string, tablerow> { private static logger logger = loggerfactory.getlogger(stringtorowconverter.class); public void processelement(processcontext c) { tablerow row = new tablerow(); row.set("do not know column name", c.element()); c.output(row); } } moreover, assumed table exists in bigquery dataset , don't need create it, , csv file contains columns in correct order. if there's no workaround scenario , column name

twitter bootstrap - Carousel and Slider Will NOT Display on HTTPS VS HTTP Website -

i'm using multi bootstrap theme displays on http version of website, bought security certificate , want urls display https://iqtests4kids.com not http://iqtests4kids.com . http://iqtests4kids.com displays when use https://iqtests4kids.com/ owl carousel , images not display , page looks there coding problem. i've spent hours searching answer have found none can help? douglas

What is happening when Matlab is starting a "parallel pool"? -

running parallel cpu processes in matlab starts command parpool() according documentation , function: [creates] special job on pool of workers, , [connects] matlab client parallel pool. this function takes bit of time execute, on order of 30 seconds. in other multi-cpu paradigms openmp, parallel execution seems totally transparent -- i've never noticed behavior analogous matlab (granted i'm not experienced parallel programming). so, happening between time parpool() called , when finishes executing? takes long? parallel computing toolbox enables run matlab code in parallel using several different paradigms (e.g. jobs , tasks, parfor , spmd , parfeval , batch processing), , run either locally (parallelised across cores in local machine) or remotely (parallelised across machines in cluster - either 1 own, or 1 in cloud). in of these cases, code run on matlab workers , copies of matlab without interactive desktop. if you're intending run on remo

c++ - Why does the following code work on online ide(gcc 7.2.0) but gives error on ubuntu? -

when run following code on ubuntu(gcc (ubuntu 5.4.0-6ubuntu1~16.04.4)): #include<iostream> #include<vector> #include<list> using namespace std; int main(){ vector <int> v; v.push_back(1); v.push_back(2); v.push_back(3); v.push_back(4); v.push_back(5); list<int> temp; for(auto i:v){ cout<<i<<" "; temp.push_back(i); } for(auto i:temp){ cout<<i<<" "; } } following errors: try.cpp: in function ‘int main()’: try.cpp:13:10: error: ‘i’ not name type for(auto i:v){ ^ try.cpp:17:1: error: expected ‘;’ before ‘for’ for(auto i:temp){ ^ try.cpp:17:1: error: expected primary-expression before ‘for’ try.cpp:17:1: error: expected ‘;’ before ‘for’ try.cpp:17:1: error: expected primary-expression before ‘for’ try.cpp:17:1: error: expected ‘)’ before ‘for’ try.cpp:17:10: error: ‘i’ not name type for(auto i:temp){ ^ try.cpp:20:1: error: expected ‘;’ before ‘}’ token } ^ try.cpp:20:1:

python - What's the format of keras' matrix multiplication -

all math i've seen behind propagating data 1 neural network layer next in calculating z looks like: z = θ t x+b but keras seems diverge standard. accepts input matrices in form of number of samples rows , number of features columns , get_weights() command returns matrices shapes satisfy equation z if following true: z = xθ+b given following example of network learning xor gate input dimensions 4x2 , output dimensions 4x1: from keras.models import sequential keras.layers import dense import numpy np x = np.array([[0,0], [1,0], [0,1], [1,1]]) y = np.array([0,1,1,0]) model = sequential() model.add(dense(10, input_dim=2, activation='sigmoid')) model.add(dense(10, activation='sigmoid')) model.add(dense(1, activation='sigmoid')) model.compile(loss='binary_crossentropy', optimizer='sgd', metrics=['accuracy']) model.fit(x, y, epochs=100000, batch_size=4, verbose=0) print model.

excel - If Cell in a range of values contains a type number print the corresponding header -

Image
if given range of values in row in excel. each cell of particular may have contents of type number or may blank. there function/combinations of functions (non-vba) in excel print corresponding header of type number cell (with comma). furthermore if cell not contain content of type number not print corresponding header , move on next cell. if it's last value in range, don't print comma @ end too. prefer somehow in 1 cell looks @ range of cells determines header print , ignore. i'm using excel 2013 i without vba. here example below: there simple way this, if first column number, or if live string starts comma if first column not number. =if(isnumber(f5);f4&if(isnumber(g5);","&g4;"")&if(isnumber(h5);","&h4;"")&if(isnumber(i5);","&i4;"")&if(isnumber(j5);","&j4;"")&if(isnumber(k5);","&k4;"")&if(isnumber(l5);&

Foreign key issue in mysql? -

lets employeeid acting primary key in 1 table in mysql database. how make employeeid act foreign key in table? i think simple question answered oneself . let's have 'employee' table making employeeid primary key storing, updating , , deleting data 'employee' table . in case want provide salary employee , want store salary information in database , in case need 'salary' table , employeeid work foreign key 'employee' table employeeid | employee_name| employee_birthdate| address 1 | john due | 1990-01-01 | dhaka 2 | rahim | 1990-02-06 | feni,bangladesh 'salary' table salaryid | employeeid(from 'employee' table | salary | date time 1 | 2 | $5000 | 2017-04-01 2 | 2 | $5000 | 2017-05-01 i hope understand . if still seems dozy , feel free ask me anyway

android - How to sum of arraylist elements containing model class? -

i have app contain arraylist , model class "cdeletednotifcationmodel". want sum elements in arraylist. code private arraylist<cdeletednotifcationmodel> cdeletednotifcationmodels = new arraylist<>(); int size = cdeletednotifcationmodels.size();

Angular 2 with eventemiiter doesnot work -

i using angular 2 develop ecommerce app. i tried event emitter because add product cart , display count value in cart icon. here home component. import { component, oninit,eventemitter,output } '@angular/core'; export class homecomponent implements oninit { badge; @output() change: eventemitter<any> = new eventemitter(); addtocart(deal, value) { this.badge=1; this.change.emit(this.badge); } } when click addtocart button.i emit badge value. here menubar component.ts import { component, oninit,input } '@angular/core'; export class menubarcomponent implements oninit { badge:any; change1(user) { this.badge=user; console.log("called",this.badge); } } here menubar.html <span (change)="change1($event)">{{badge}}</span> here home component.html. <div class="col-sm-4 col-md-3" *ngfor="let deals of deals; let = index;">

python - In what 8-bit character set is 0x9d meaningful? -

in 8-bit ascii-like character set english 0x9d meaningful? i'm cleaning old data files, , finding 0x9d in otherwise-ascii text. (no, it's not utf-8.) it's not valid in windows-1252. python "latin-1" codec translates unicode 0x9d, "operating system command" . makes little sense. in unicode box [009d]. (in python, can convert latin-1 without errors being raised, doesn't mean it's meaningful so.) examples, python-type escapes, messy database i'm cleaning combines text many sources: guitar pro, jamplay, redbana\\\'s audition,\x9d doppleganger\x99s lounge\x9d or heatwave interactive\x99s platinum life country,\\" example \\"i\\\'ve seen bull run in pamplona, spain\x9d.\\" netwise depot \\"one stop web shop\\"\x9d provides sustainable \\"green\\"\x9d living looking \\"do me\\"\x9d solution from context, i'd suspect ™ or ®. 8-bit code had those? here's wild hypo

makefile - How to pass a variable with spaces in its value as a single argument to a GNU make function? -

this makefile. mypath = /dir 1/file 1.txt test1: echo $(notdir $(mypath)) test2: echo $(notdir "$(mypath)") test3: echo todo my intention file 1.txt portion of path /dir 1/file 1.txt . yes, path spaces in it. i unable desired results. $ make test1 echo dir file 1.txt dir file 1.txt in above output, appears notdir provided 3 separate arguments: /dir , 1/file , 1.txt , result notdir parts returned: dir , file , 1.txt . the following not work @ all. $ make test2 echo dir file 1.txt" /bin/sh: 1: syntax error: unterminated quoted string makefile:7: recipe target 'test2' failed make: *** [test2] error 2 why complain "unterminated quoted string"? what right way solve problem. want output following. $ make test3 echo file 1.txt file 1.txt

AngularJs: How to save the rotated/flipped image from editor and upload it to server -

i new angularjs, using pm-image editor ( https://www.npmjs.com/package/pm-image-editor ) open image in new tab. i working on task save rotated/flipped image editor , upload server. using pm-image-editor, able flip/rotate image, don't know how & save image seeing in editor. if can point me in right direction, great! thanks!

ios - How to show alert view once in view controller in Swift 3? -

this question has answer here: how stuff in viewdidappear once? 8 answers i creating app when user enters page, alert view pops saying "click on button proceed". how can make alert view show once in view controller? help. override func viewdidappear(_ animated: bool) { super.viewdidappear(animated) let alertcontroller = uialertcontroller(title: "info", message: "click on button proceed", preferredstyle: uialertcontrollerstyle.alert) let mybacksign = uialertaction(title: "ok", style: uialertactionstyle.default, handler: nil) alertcontroller.addaction(mybacksign ) self.present(alertcontroller, animated: true, completion: nil) } viewwillappear , viewdidappear called every time view displayed. if want call method invoked once viewdidload. viewdidload called once when view loaded memory. use vie

javascript - Google Map not being displayed and browser console shows error "GUnload is not defined at onload" though I've mentioned it -

basically i'm trying show multiple places on google map using lat, lon getting fetched database. here code google map. <%@ page language="c#" autoeventwireup="true" codebehind="map.aspx.cs" inherits="googlemap.map" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="head1" runat="server"> <style> #map { height: 600px; width: 100%; } </style> <title>your data on google map </title> <link rel="icon" href="data:;base64,ivborwokggo=" /> </head> <body onload="initialize()" onunload="gunload()"> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key

python - HeyAthena Pip install swig Path environment location? -

i have been looking heyathena/swig environment path place swig.exe in install heyathena pip3 however, can't find location of @ wondering if else knew was??? error ----------------------------------------------------------------------------------------------------------------- failed building wheel pocketsphinx running setup.py clean pocketsphinx built gtts failed build pocketsphinx installing collected packages: urllib3, chardet, idna, requests, gtts-token, gtts, pocketsphinx, selenium, pyyaml, more-itertools, inflect, jaraco.itertools, xmltodict, wolframalpha, pyglet, heyathena running setup.py install pocketsphinx ... error complete output command c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\tornad~1\\appdata\\local\\temp\\pip-build-w6_kc9ch\\pocketsphinx\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec&#

json - Is it possible to get current time of any city using Single google API in NodeJS -

i'm using below mentioned 2 api calls geocode , timezone of particular city. https://maps.googleapis.com/maps/api/geocode/json?address= ' + address; https://maps.googleapis.com/maps/api/timezone/json?location= ' + loc + '&timestamp=' + timestamp + '&key=' + apikey ; in nodejs. but need use single api current time offset values of city instead of using 2 api calls. possible?

reactjs - Get the value from the JSON file using React Native -

i have json file in documentdirectorypath, json file looks { "name": { "en_en": "epic app dev self" }, "description": { "en_en": "" }, "type": "course", "id": "epicdevself", "value": { "version": "1.0.1", "series_prefix": "eds" }, "uid": "epicdevself/1.0.1", "children": [{ "name": { "en_en": "level 1" }, "description": { "en_en": "" }, "type": "level", "id": "level1", "value": { "cover": { "targetlanguage": "" } }, "uid": "epicdevself/1.0.1/level1

java - I need to execute the function only for n times and then stop -

in below code, want take picture execute n times , stop. i tried using loop error java.lang.illegalstateexception: session has been closed; further changes illegal . protected void onresume() { super.onresume(); log.e(tag, "onresume"); startbackgroundthread(); if (textureview.isavailable()) { opencamera(); } else { textureview.setsurfacetexturelistener(texturelistener); } final timer timer = new timer(); timer.schedule(new timertask() { public void run() { takepicture(); } }, 200, 15000); } you can use count of taken pictures , cancel timer like: protected void onresume() { super.onresume(); log.e(tag, "onresume"); startbackgroundthread(); if (textureview.isavailable()) { opencamera();

javascript - How to set icon after the last word of a text block? -

is possible set icon or whatever after last word of text block? i want set icon after last word "nibh." bigger grey dot. tried far ::after , different js functions either destroyed text content or dot under <div>/<p> , not inline sentence. .article-text:after { content: ''; display: inline-block; width: 15px; height: 15px; -moz-border-radius: 7.5px; -webkit-border-radius: 7.5px; border-radius: 7.5px; background-color: #dadada; margin: 0px 10px 0px 7px; } <div class="article-text"> <h3>lorum ipsum</h3> <p>praesent sapien massa, convallis pellentesque nec, egestas non nisi. donec sollicitudin molestie malesuada. vivamus magna justo, lacinia eget consectetur sed, convallis @ tellus. proin eget tortor risus. vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia </p> <p>curae; donec velit neque, auctor sit amet aliquam vel, ulla

.net - How to specify a callback from C# to C++/CLI -

i pass function pointer (or similar) callback function constructor of c# class, called c++/cli. c# class sub-module; c++ side main program. i'm getting errors reported visual studio 2017, , can't work out correct syntax use. (i'm c++ programmer, have close 0 experience cli , c#.) find plenty of examples on how set callbacks other way around, c# c++/cli find little information. can tell me correct syntax is, or show different approach achieve same goal if 1 fundamentally flawed? c# code (seems fine): namespace mynamespace { public class mycsharpclass { private action<string> m_logger; public mycsharpclass(action<string> logger) => m_logger = logger; public void logsomething() { m_logger("hello world!"); } } } c++/cli code (errors in second gcnew line system::action): #pragma once #pragma managed #include <vcclr.h> class ilbridge_mycsharpclass { public: ilbri

jquery - $("input:checkbox:not(:checked)") exact match of this in javascript -

i tried var checkedboxes = document.queryselectorall('input[type=checkbox].checked'); its working , need unchecked checkbox values $("input:checkbox:not(:checked)") like need in javascript please me you can use css :not() method along :checked selector document.queryselectorall('input[type=checkbox]:not(:checked)') console.log(document.queryselector('input[type=checkbox]:not(:checked)').value) <input type="checkbox" value="1"> also, note using class selector when prefixing .

html - Align Input text fields next to each other -

Image
i have following html layout: <div class="editor-page"> <div class="container page"> <div class="row"> <div class="col-md-10 offset-md-1 col-xs-12"> <list-errors [errors]="errors"></list-errors> <form [formgroup]="articleform"> <fieldset [disabled]="issubmitting"> <fieldset class="form-group"> organization name<input class="form-control" formcontrolname="orgname" type="text" placeholder="enter valid organization name*" /> </fieldset> <fieldset class="form-group"> description<input class="form-control" formcontrolname="orgdescription" type="text" place

ios - How to get data from the POST json -

i creating login page once user enters username password data send api , if entered data correct returns success . if result success, need user key of user returned serverin form : { "status_desc": "success", "status_code": 1, "email": "keshurai1024@gmail.com", "api_token": "mqbraok1zsdasdasd4j3m" } now need store api token. trying function not working - @ibaction func signinbtnpressed(_ sender: any) { let email : string! = self.usernamefield.text let password : string! = self.passwordfield.text var request = urlrequest(url: url(string: "\(url_base)\(auth)\(login)")!) request.httpmethod = "post" let poststring = "email=\(email!)&&password=\(password!)" request.httpbody = poststring.data(using: .utf8) let task = urlsession.shared.datatask(with: request) { data, response, error in guard let data = data, error == nil

ms access - Use data entry form and auto populate certain fields -

i have 2 tables, let's call them employees , customers . employees pretty basic: id | title | emp_name | building | email | phone customers not different: id | cust_name | address | phone | emp_title | emp_name i have form used data entry customers . 2 of fields employee_title , employee_name . employee_name combo box control source employee_name , row source select [employees].emp_name employees; . there after update event requerys employee_title . for employee_title control source =dlookup("title","employees","emp_name = '" & [employee_name] & "'") . this works fine form itself. after selecting employee's name dropdown, displays employee's title correctly. however, employee's title not inserted customers table (everything else inserted correctly). not familiar ms access, i'm 99% sure because control source dlookup , not reference table. so, how employee's title show on form ,

c# - How to get outer html text from gecko web browser? -

i need make web browser in c# using gecko xulrunner. now, need outer html gecko web browser. how can this? once create , initialize browser, can access document property , body in following way: var htmlstring = this.yourgeckobrowser.document.body.outerhtml; regards

c# - How to get IWpfTextView from command Visual Studio Extension 2017 -

i need show popup use textviewadornment, it's require iwpftextview. there old code that: private iwpftextview getwpftextview(ivstextview vtextview) { iwpftextview view = null; ivsuserdata userdata = vtextview ivsuserdata; if (null != userdata) { iwpftextviewhost viewhost; object holder; guid guidviewhost = defguidlist.guidiwpftextviewhost; userdata.getdata(ref guidviewhost, out holder); viewhost = (iwpftextviewhost)holder; view = viewhost.textview; } return view; } but when go visual studio 2017 extension defguidlist.guidiwpftextviewhost missing. cannot iwpftextview anymore. please me. thank everyone. after sergey vlasov answer found solution: private iwpftextview getwpfview() { var textmanager = (ivstextmanager)serviceprovider.getservice(typeof(svstextmanager)); var componentmodel = (icomponentmodel)this.serviceprovider.getservice(typeof(scomponentmodel)); var editor = componentmode

fiddler - Reissue Http Requests with C# and FiddlerCore2 -

i need reissue bunch on http request saved on fiddle .saz file. wrote c# console app , installed fiddlercore2 nuget, purpose of reading .saz file , re-issue saved requests. it turns out cant figure out how or if possible do! there not info fiddlercore on internet. does know if possible , me that? thank all

r - "Nested" barplots, with multiple levels of grouping -

Image
how can group bars in barplot third variable? i achieve in base r, without, example, ggplot2, in this related question . in another related question groups of groups labeled, not (visually) grouped – in example above –, making plot difficult read. sample data: groups = c("a", "b") choices = c("orange", "apple", "beer") supergroups = c("fruits", "non-fruits") dat <- data.frame( group = rep(groups, c(93, 94)), choice = factor(c( rep(choices, c(51, 30, 12)), rep(choices, c(47, 29, 18)) ), levels = choices ), supergroup = c( rep(supergroups, c(81, 12)), rep(supergroups, c(76, 18)) ) ) barplot(table(dat), beside = true) which returns error: error in barplot.default(table(dat), beside = true) : 'height' must vector or matrix

forms - Custom Validator Angular 2 -

i've written web api function takes username textfield , checks if username taken. know if username available or not, server returns y if available , n if not. to validate username, i'm using validatorfn in angular2 validate input. however, validator function not working. here validator function: interface validator<t extends formcontrol> { (c: t): { [error: string]: }; } function validateusername(c: string) : validatorfn { return (this.isavailable(c)=='y') ? null : { validateusername: { valid: false } }; } here isavailable function: private isavailable(username: string) { let usernameavailable; let url = 'url/api/auth/checkuser/' + username; let headers = new headers(); headers.append('user', sessionstorage.getitem('username')); headers.append('token', sessionstorage.getitem('token')); headers.append('accesstime', sessionstorage.getitem('accesstime')); let

canvas - Android custom width adjustable slider -

Image
i'm trying make custom slider, can dragged , width can changed. i made relative layout view that has frame layout 2 images (left , right) , text in middle. when frame layout dragged animate new position of view. have problem adjust width of view when left or right image dragged. tried changes layout parameter re-centers whole view , doesn't extend dragged side. xml layout <relativelayout android:id="@+id/test_layout" android:layout_width="match_parent" android:layout_height="40dp" android:background="@color/coloraccent" android:orientation="horizontal"> <framelayout android:id="@+id/frame" android:layout_width="80dp" android:layout_height="40dp" android:layout_centerinparent="true" android:layout_marginbottom="5dp" android:layout_margintop="5dp" android:animatelayoutch

Javascript: How do I refresh text values -

<script> function balancerefresher() { <b>balance: document.write(playerbalance) </b> } setinterval(balancerefresher, 1000); </script> obviously, isn't actual code, i'm trying refresh variable 'playerbalance' in text. have no idea other way in, complete beginner javascript. document.write, name suggests writes document, if want dynamically modify , element on display create placeholder , access element , modify, example, in document create placeholder: <div id="any_id"></div> then in javascript: let el = document.getelementbyid("any_id"); if ( el ) { if ( el.haschildnodes() ) { el.removechild(el.childnodes[0]); } el.appendchild(document.createtextnode("your text")); } https://www.w3schools.com/jsref/met_document_getelementbyid.asp

sql server - Difference between BCP versions. On example of exporting data -

i facing problem bcp (bulk-copy program) on mssql-server 13.0. here goes: i trying export data program file corrupted. exporting .zip file. works perfect on mssql-server 11.0 - same command can export zip file need export. command using export: bcp "select query" queryout "c:\export\myzip.zip" -t -s server_name tried use -v flag, didnt work. edit 1: after command used bcp shows me questions prefix, format , etc - using: 0 0 (space) n edit 2: starting bytes of exported file are: 37 7a bc af 27 1c looking here file signature, appears 7-zip file format. afaict file exported correctly. extension .7z though, not .zip . you can see here if search starting bytes 37 7a bc af 27 1c .

What are the expected performance characteristics of an Azure Function App in Consumption mode? -

what expected performance characteristics of azure function app in consumption mode? i going ask ... how can carry out realistic testing of azure function app? a person in team knocked perl script forked off , called our function app crudely simulate sort of load we're hoping cope with, e.g. starting 150,000 users, calling 10 time second the script running on beefy vm running on in google things started ok lower numbers, started getting timeouts we must doing "wrong", sort of assume function app's can cope sort of load ... but what? ... , can cope load in consumption plan mode? you can arr-affinity cookies , see if causing scaling problems. when performing load testing function noticed traffic going 1 instance, , turned out problem aar-affinity cookies. load client being directed same function instance every request, not scaling out meet demand. you can disable behavior see if better scaling behavior. https://blogs.msdn.microsoft.com/app

office365 - Paging through @odata.nextLink returns internal server error -

i accessing ms graph api beta read items in sharepoint site. my query looks this: https://graph.microsoft.com/beta/sites/mysite.com,some-id/lists/some-id/items?expand=fields&top=100 this returns results expected. results taking @odata.nextlink retrieve next page. first few pages works fine when retrieving 7th page internal server error: 500: { "error": { "code": "generalexception", "message": "an unspecified error has occurred.", "innererror": { "request-id": "0b5b4bcd-3e71-4e08-84ee-db3ad0f970e9", "date": "2017-08-18t08:24:03" } } the same error appears around same items if change page size. if set page size 900 error immediately. please advise. thanks, jakub

Can't run Realm with React not native -

created react app react-create-app. installed realm , included it. following error: module not found: can't resolve 'react-native' in ./node_modules/realm/lib/browser/index.js' it's true file requires react-native application isn't react native, it's react. installing react-native module anyway not solve this. i've tried use include realm in simple javascript file , run node (no react included). worked. cause fail in project? start script using?

assembly - How to manipulate array in emu8086 -

i creating simple game program in emu8086. using arrow keys able print asterisk in every direction want. problem there requirement if printed 5 asterisk tail of asterisk should remove body of asterisk remain 5 every print. from research, used array have no idea yet how manipulate in array, since don't know how track array's tail , position me able print space delete tail. like: 1. * 2. * 3. * 4. * 5. * after clicking direction should like.. in case it's down direction.. how combination of other directions? 1. 2.* 3.* 4.* 5.* 6.* here's printing code continue: mov ah, 2 ;print asterisk mov dl, "*" int 21h continue2: mov ch, 32 ;hide blinking cursor mov ah, 1 int 10h mov ah, 00h ;input direction int 16h cmp ah, je cmp ah, left je left cmp ah, down je down cmp ah, right je right you can use called "ring buffer" , if know maximum length of snake. the "arrays" in assembly continuous area of m

javascript - how to draw canvas chart using ajax response data? -

Image
this output of code see response has 2 keys day , amount. day , amount have values of array. when trying push these values in empty array, not running. chart empty. $(document).ready(function(){ $.ajax ({ type:'post', url:'data.php', success:function(response) { var result= json.parse(response); console.log(result); //var count = object.keys(result).length; //console.log(count); var dps =[]; for(var i=0; i<result.length;i++) { dps.push({"label":result.day[i], "y":result.amount[i]}); } console.log(dps); //insert chart-making function here var chart = new canvasjs.chart("chartcontainer", { zoomenabled:true, panenabled:true, animationenabled:true, title:{ text: "mychart mysql database" }, axisx:{ title: "timestamp" }, axisy:{ title: "mydatapoints", minimum: 0 }, data: [{ type: "spline", datapoints:

How to create a stacked bar graph in kibana? -

Image
i have data in json format in elasticsearch: { "features": [ { "feature": "a", "yes": 19, "no": 0, "maybe": 81 }, { "feature": "b", "yes": 0, "no": 0, "maybe": 100 }, { "feature": "c", "yes": 10, "no": 32, "maybe": 58 } ] } from this, possible obtain stacked chart follows?