Posts

Showing posts from August, 2015

python 3.x - behavior changes from shell to module: 'xlwings' has no attribute 'Book' -

on python 3.6.1 (v3.6.1:69c0db5, mar 21 2017, 18:41:36) [msc v.1900 64 bit (amd64)] on win32 xw. version '0.11.4' interesting behaviour: -> on console (shell), works perfectly: import xlwings xw wb = xw.book(r'c:\whateverpath\whateversheet.xlsx') -> then, module test.py same exact syntax gives: traceback (most recent call last): file "c:\whateverpath\test.py", line 2, in <module> import xlwings xw file "c:\whateverpath\test.py", line 12, in <module> wb = xw.book(r'c:\whateverpath\whateversheet.xlsx') attributeerror: module 'xlwings' has no attribute 'book' using pip: un-installed, re-installed xlwings, same results. (all python modules have been installed pip no problem except one) any lead due to?

configuration - NGINX client_max_body_size issue -

i have issue nginx client_max_body_size . getting issue 2017/09/11 13:21:02 [error] 6126#6126: *150091 client intended send large body: 1219514 bytes, client: 10.160.90.909, server: example.com, request: "post /api/sensors http/1.1", host: "example.com" . getting 413 nginx error. want know should add(insert) client_max_body_size , recommended mb suggest..? please find nginx.conf file below user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; # load dynamic modules. see /usr/share/doc/nginx/readme.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main;

python - CountVectorizer ignores Upper Case -

what reason why countvectorizer ignores word in upper case? cv = countvectorizer(stop_words=none,analyzer='word',token_pattern='.*',max_features=none) text = ['this','is','a','test','!'] fcv = cv.fit_transform(list) fcv = [cv.vocabulary_.get(t) t in text] print fcv returns [5, 3, 2, none, 1] this caused lowercase set true default in countvectorizer , add lowercase=false . cv = countvectorizer(stop_words=none, analyzer='word', token_pattern='.*', max_features=none, lowercase=false)

ios - RxCocoa - prevent multiple view controller pushes when there's lag -

as case both reactive , non-reactive ios projects alike, if have ui element (e.g. button or table view cell being selected) pushes view controller onto navigation stack, if there's lag reason (especially on older devices) repetitive taps can result in duplicate pushes , bad ux. normally disable element after first tap. for example: @ibaction func mybuttontap() { button.isenabled = false dotherestoftheaction() } i relatively new rxswift. trying figure out appropriate reactive way implement fix few bugs in app views pushed repetitively. some thoughts: could use debounce or throttle seems bandaid , won't fix every situation. i'm thinking best way dispose of subscription once expected event has occurred. let disposable = tableview.rx.itemselected .subscribe(onnext: { [weak self] indexpath in self?.performsegue(withidentifier: "mysegueidentifier", sender: self) }) ... func prepareforsegue() { mydisposable.dispose()

angularjs - ionic exit iframe fullscreen mode to the wrong page -

i wan't play vimeo videos in ionic app. have page display video. have iframe inside view contains player video. when click on iframe open video on fullscreen mode. when exit video should send me view contains iframe instead send me view totaly not related view. it's hierarchicaly far parent of view. here's code. <ion-pane ng-controller="howtovideodetailctrl howtovideodetail"> <ion-header-bar class="bar bar-header bar-positive"> <button ng-click="howtovideodetail.back()" class="button button-white button-clear"><i class="icon ion-ios-arrow-left"></i> </button> <h1 class="title">{{ video.title }}</h1> </ion-header-bar> <ion-content class="has-tabs background-stable" scroll="false"> <ion-scroll> <div ng-init="howtovideodetail.initvideo()"> </div> <iframe

c# - Handle touches not started on the UI -

i seek way handle touches not start on ui elements in unity engine. the purpose of rotating, panning , zooming in on "map" (it shall called on). if touch down event on of ui elements shall handled ui element instead of map. i think 1 such example google's maps android application. i have tried several solutions: mouse events - combines of touches single one input.touches - not know how find out if touch should handled ui element instead (i if possible not use "if"s check if touch on ui element might prove real performance issue) i seek way handle touches not start on ui elements in unity engine ...but if touch down event on of ui elements shall handled ui element instead of map. the ispointerovergameobject function used simplify this. if returns false, panning, rotation. if returns true mouse on ui element. better , easier use use boolean variable modifed every ui element. use onpointerclick detect events on ui(map). see this

javascript - Is there a more efficient way of adding and removing these CSS classes with jQuery? -

i have below script uses slidebars show , hide side menu. i need add , remove css class div tie things together. looking @ way adding , removing classes feel there's more efficient way? function slidebarsstatus() { var windowwidth = $(window).width(); breakpoint = 992; if ( windowwidth > breakpoint ) { controller.open( 'site-menu' ); $('.site-wrap').addclass('menu-active'); } else { controller.close( 'site-menu' ); $('.site-wrap').removeclass('menu-active'); $('.site-wrap').addclass('menu-inactive'); } } slidebarsstatus(); $(window).on( 'resize', slidebarsstatus ); store jquery object variable: var sitewrap = $('.site-wrap'); and chain methods variable: sitewrap.removeclass('menu-active').addclass('menu-inactive'); or, if possible, media queries in css: @media screen , (max-width: 991px) { .site-wrap {

javascript - Add color and Eraser to html5 canvas drawing -

am learning html5 canvas drawing in nodejs tutorial found online. everything works fine. want add colors , eraser 1 can choose colors , erase part of drawing respectively. for eraser, have tried add example found here http://jsfiddle.net/66z12xb0/ as per line of code <button type='button' id='eraser'>eraser</button> $("#eraser").click(function() { strokestyle = "#ffffff"; }); for adding colors, have tried $("#colors").click(function() { strokestyle = "black"; }); <div class="colors" id="colors"> <div class="color black"></div> <div class="color red"></div> <div class="color green"></div> <div class="color blue"></div> <div class="color yellow"></div> </div> <style> /** * fix user-agent */ *

javascript - How do I get my modal to pop up only after validation in form occurs? -

after html5 validation occurs , user clicks submit, trying modal pop thanking user submitting form. problem not sure how give true or false conditional 'required' attribute code can run after fields have been filled out. closest got following code: javascript if(document.getelementbyid('e-mailclient').required = true || (document.getelementbyid('comments').required = true)) { $(document).ready(function(){ $(".open").click(function(){ $(".pop-outer").fadein('slow'); }); $(".close").click(function(){ $(".pop-outer").fadeout('slow'); }); }); } html <form name="frm" method="post" action="serverside.php" id="my-form"> <input id="e-mailclient" placeholder="e-mail" autocomplete="on" name="email" required> <textarea id="comments

web services - Setting up angular2 typescript Headers giving 401 error -

i created http request following headers , options: let theheaders = new headers({ 'content-type': 'application/json' }); // ... set content type json theheaders.append('withcredentials','true'); theheaders.append("access-control-allow-credentials", "true"); theheaders.append('authorization', 'token token 1b05af30e860c0aeb9577312ced54ba6d84a59cd'); let theoptions = new requestoptions({ headers: theheaders }) // create request option return this._http.get(this.makeurl, theoptions) i got 401 error.

How do I find missing number sequences in Python through Gap Analysis? -

title 1 title 2 dktm 00001 dktm 00008 dktm 00009 dktm 00017 dktm 00029 dktm 00038 dktm 00050 dktm 00061 dktm 00062 dktm 00073 thanks continued read. dilemma have csv missing rows of data. there 2 columns, 1 starting row of numbers (like dktm00001) , ending row (dktm000008) stated columns repeat numbers, in cases, row of numbers end missing (stated above). want find row of missing numbers , output them screen. (i ask put them output file, want this, teach myself python.) an example of desired output: dktm 00018 dktm 00028 dktm 00039 dktm 00049 thank in advance! i'm relatively new python 3.6.2, thought exercise. guess bit off more can chew. utilized explanation basis( efficient way find missing elements in integer sequence ), downshift's method helped me desired output lot more. something may started. i'm not clear on content layout of csv file (or version of python using), using csv file

javascript - Pushing indents before and after main body in typescript? -

i'm using react , typescript, trying this: let indents: jsx.element[] = []; indents.push(<div>); (var = 0; < 10; i++) { indents.push(<div>testing</div>); } indents.push(</div>); when indents.push(); top error on loop. my aim create opening , closing tags @ top level add bunch of nested tags before closing top level tag. you need thing this: let indents: jsx.element[] = []; (var = 0; < 10; i++) { indents.push(<div>testing</div>); } return ( <div> {indents} </div> ); at return statement have create react element <div> have children indents .

c# - Multiple statements on a single line in the Immediate Window -

is possible have multiple statements on single line in visual studio immediate window c#? the following post suggests it's possible vb: https://stackoverflow.com/a/27554199/216440 however, when try in c# end of expression expected error. what i've tried is: var p0 = command.parameters[0];object v = p0.value; where command sqlcommand object. if split expressions onto separate lines each work. however, when they're on same line, above, end of expression expected error. this in visual studio 2013 update 5. no, far know, visual studio immediate window does not support multi-line statements c#.

c# - Unity Multiple navmesh agents . -

hello im working on rts game controll more 1 minion wen trie , add minion , command them both go point , @ each other http://imgur.com/a/uhwjg . code minions move : using system.collections; using system.collections.generic; using unityengine; using unityengine.ai; public class movetest : monobehaviour { navmeshagent navagent; // use initialization void start () { navagent = getcomponent<navmeshagent>(); } // update called once per frame void update () { move(); } void move() { raycasthit hit; ray ray = camera.main.screenpointtoray(input.mouseposition); if (input.getmousebuttondown(1)) { if (physics.raycast(ray, out hit, 1000)) { navagent.setdestination(hit.point); } } } } the agent go close can position. since you're telling both go same position, push in close can. might want increase stopping distanc

Pandas works in Python shell but not within Atom -

i kindly ask information please. windows 10 user.installed atom , python 3.5. running codes in atom using script package. have installed numpy, matplotlib, scipy , pandas separately (pip install xxx). did not install anaconda. while other libaries work fine, pandas giving me headache. appears pandas works in python shell not in atom or when call code written in atom using command prompt. 1) seems problem , how resolve it? 2) if decide avoid manual libraries installations, shall delete python , related libraries (numpy etc) installed? still able run python within atom. @ point, comfortable using atom. thanks

anaconda - jupyter notebook not running from command line anymore -

for reason not able open jupyter notebook command line anymore. i trying "fix" issue having not being able connect access databases python , created problem myself. on other computers , have been able open folder in command line , type "jupyter notebook" , jupyter instance open in folder in on command line. can no longer except path c:\users\myusername\anaconda3\scripts . i on setup: +windows 7 +anaconda3 64bit also, while trying figure out database connection issue, accidentally erased path environmental variable. have since replaced with: c:\users\myusername\appdata\local\continuum\anaconda3;c:\users\myusername\appdata\local\continuum\anaconda3\scripts;c:\users\myusername\appdata\local\continuum\anaconda3\library\bin i not sure go here.

asp.net - How to return the last value when retrying action multiple times? -

when using oracle or postgres repeatable read / serializable isolation levels, need ready retry transaction. our back-end services pretty state less, can rerun them same input parameters want. asp.net core seems returning result created when action executed first time , not last time. here example: [httppost] public async task<iactionresult> postitemasync([frombody]createitemmodel requestbody) { int itemid = await createitemservice.value.createitemasync(requestbody); return createdataction(nameof(getitemasync), new { id = itemid }, new itemcreatedmodel { id = itemid }); } itemid contains database id , different every time retry call, since sequences aren't reverted when transaction rolled back. when 2 transactions started in parallel, first gets itemid 1 , second gets 2 , second rolled due concurrency issues , rerun filter (this works far), new itemid second transaction 3 client still retrieves 2 . how can force asp.net core return last result of actio

java - Code not executing after true "if" statement -

i working on making bank account holds account information. each account gets 3 free withdrawals each month, $1 being charged every transaction after first 3 free. have conditional deals charging customers $3 every transaction after 3 free ones, isn't working right. public static double gettfee(int accountnumber) { if (transactioncount[accountnumber] >= 4) { return 1; } else { return 0; } the function returns 1 every account has 4 or more transactions, doesn't provide right balance in "tester" class. i.e. if account made 5 deposits of $1 each, should have $3 since last 2 being charged. tester class doesn't deduct $1 after 4th transaction, returning balance of $4 previous scenario. here tester class: system.out.println("please enter account number."); checkingaccount.setaccountnumber(scanner.nextint()); (int j = 0; j < size; j++) { if (bankaccount[j] == checkingaccount.getac

java - How do i draw the same moving Bitmap multiple times? -

i want able create multiple bitmaps same image resource (firered.png). have creates everytime x position goes under 300, when run programm stops , gives me following: i/art: starting blocking gc alloc i/art: waiting blocking gc alloc i/art: clamp target gc heap 387mb 384mb i/art: alloc concurrent mark sweep gc freed 0(0b) allocspace objects, 0(0b) los objects, 0% free, 383mb/384mb, paused 1.466ms total 1.212s i/art: forcing collection of softreferences 16b allocation i/art: starting blocking gc alloc i/art: waiting blocking gc alloc dont know whats wrong in code: class create firered package com.acimutstudios.deicide; import android.graphics.bitmap; import android.graphics.canvas; public class firered { private int id = 1; private bitmap firered; public firered(bitmap bmp){ firered = bmp; } public void drawfirered(canvas canvas, int x, int y){ canvas.drawbitmap(firered,x,y,null); } public void setid(int newid){ id = n

c# - How to suppress Note: decompress failed message in ChromeDriver console window? -

hi i'm using chromedriver 2.29.461591 for reason following message in console window, "note: decompress failed" repeated multiple times: starting chromedriver 2.29.461591 (62ebf098771772160f391d75e589dc567915b233) on port 60264 local connections allowed. note: decompress failed note: decompress failed note: decompress failed note: decompress failed note: decompress failed note: decompress failed note: decompress failed note: decompress failed it doesn't impact operation of i'm trying do. but, floods console window. i'd silence or resolve failure.

python - Run a loop off of a grouping of data in a pandas DataFrame -

i have large file of vendor records looking duplicates in. duplicate values may appear in either vendor name or vendor address. using dupandas package need break data smaller chunks in order not overwhelm computer's memory. because possible duplicate records must have same state, trying split vendor dataframe state field , run dupandas on each state. having difficulty, however, figuring out how write loop accomplish following: 1. take rows first state (e.g. ak) 2. run dupandas on , write result dataframe 3. move next state (e.g. ca) , repeat step 2. it seems should straight forward reason totally stumping me. here non-loop form works artificially created subset vendors in state of wa: import os os import rename,listdir import pandas pd pandas import read_fwf, dataframe, series import csv dupandas import dedupe #set directory loc1 = os.chdir('c:/') #find file , open vendor = pd.read_csv('vendor.txt', sep = '\t') #fix or coded zeros vendor.loc[ven

cordova - PhoneGap FileTransfer ProgressEvent Not Returning Values -

i'm building file transfer procedure hybrid/cordova app i'm creating. upload procedure works - when i'm getting stuck on creating process give feedback user on upload status (i'd give them x% uploaded...) type of notification box. here's function i'm using: function oncapturephoto(fileuri) { var win = function (r) { //misc procedures once upload completes retries = 0; getmyfeed(); clearcache(); } var fail = function (error) { //misc procedures if upload fails clearcache(); alert('ups. wrong happens!'); } //set upload options var options = new fileuploadoptions(); options.filekey = "file"; options.filename = fileuri.substr(fileuri.lastindexof('/') + 1); options.mimetype = "image/jpeg"; options.chunkedmode = true; options.headers = {connection: "close"}; options.params = { myuid:uid, myparty:party, mypin:pin }; var ft = new filetransfer();

javascript - regex returning un expected value -

this question has answer here: javascript regex not working 1 answer i expected new regexp('\b\w{1,7}\b', "i").test('bc4rg6') return true since want test of string "bc4rg6" alphanumeric , has 1 7 characters. browser giving false. how fix can test condition stated? thanks you need escape backslashes in string, because \b escape sequence turns backspace character. console.log(new regexp('\\b\\w{1,7}\\b', "i").test('bc4rg6')); but if regexp constant, don't need use new regexp , use regexp literal. console.log(/\b\w{1,7}\b/i.test('bc4rg6'))

javascript - Get value from select and clone form number of times -

i have select box , want user select value , after getting value forms added in page according selected value , if user selects "1" 1 form added , if user select "10" 10 forms. if nothing given or not selected no form display . seems problem in js , add forms add other more forms dont expect. <div class="form-group"> <label>number of travellers</label> <select class="form-control" id="travellersnumber"> <option value="0">select numbers of travellers</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option>

javascript - Ajax issue with posting to a node/express endpoint -

it's been bit since used jquery/ajax instead of axios connect endpoint, doing wrong here? var express = require('express'); var app = express() var bodyparser = require('body-parser'); var path = require('path'); var port = process.env.port || 3000; app.use(bodyparser.json()) app.use(bodyparser.urlencoded({extended: true})) app.use(function (req, res, next) { res.setheader('access-control-allow-origin', '*'); res.setheader('access-control-allow-methods', 'get, post, options, put, patch, delete'); res.setheader('access-control-allow-headers', 'x-requested-with,content-type'); res.setheader('access-control-allow-credentials', true); // pass next layer of middleware next(); }); app.get('/', function(req, res) { console.log(req.body); res.sendfile(path.join(__dirname, '../public/src', 

doctrine2 - Symfony Doctrine Hydrator - With custom hydrator I lose my ManyToOne relation -

Image
i extends objecthydrator benefit of hydration of manytoone relation , add field entity. here hydrator: statisticsdatahydrator.php namespace appbundle\hydrator\projectassignment; use appbundle\entity\projectassignment; use doctrine\orm\internal\hydration\objecthydrator; class statisticsdatahydrator extends objecthydrator { /** * {@inheritdoc} */ protected function hydraterowdata(array $data, array &$result) { $hydrated_result = array(); parent::hydraterowdata($data, $hydrated_result); /** @var projectassignment $project_assignment */ $project_assignment = $hydrated_result[0][0]; $result[] = $project_assignment; } } here config: config.yml doctrine: orm: hydrators: project_assignment_statisticsdata_hydrator: appbundle\hydrator\projectassignment\statisticsdatahydrator where don't use hydrator have no problem: /** * @

How can I convert this cURL command to a python script? -

curl -x post -h "content-type: application/x-www-form-urlencoded" -d 'client_id=535fb089-9ff3-47b6-9bfb-4f1264799865&scope=https%3a%2f%2fgraph.microsoft.com%2f.default&client_secret=qwgdyamab0yskul1qkv5bpx&grant_type=client_credentials' 'https://login.microsoftonline.com/common/oauth2/v2.0/token' here command. how sample script? sample script : import json import requests url = "https://login.microsoftonline.com/common/oauth2/v2.0/token" payload = { "client_id": "535fb089-9ff3-47b6-9bfb-4f1264799865", "client_secret": "qwgdyamab0yskul1qkv5bpx", "grant_type": "client_credentials", "scope": "https://graph.microsoft.com/.default" } headers = { "content-type": "application/x-www-form-urlencoded" } res = requests.post(url, headers=headers, data=json.dumps(payload)) print(res.text) if misunderstand questi

asp.net core - Getting error when trying to call API inside Web App through another Web App - Azure -

Image
i have 2 web apps, inside same app service. 1 back-end portion (with api on it, using .net core, ssl cert installed) , other 1 front-end (reactts, created using create-react-app ). when try call api method (an auth method) using front-end got message response: login failed: resource looking has been removed, had name changed, or temporarily unavailable. -404 error another fact is, if run ront-end solution locally, can use api (published on web app), normally. my api url set inside package.json file, proxy . my first thought cors problem, throws 404 error. any configuration can on azure, or need change in application allow front-end communicate api? if publish 2 web applications 1 azure web app, later 1 cover first one. cause first web application can't work. suggest create different azure web apps web applications. choose 1 azure web app plan azure web apps. not add costs except shared plan. if use shared app plan , don't want increase c

sql server 2008 - SQL Count Duplicates where field has same month -

i'm trying count of duplicates of col dp & col rn col edate has particular month. i have count single occurrences month can't work out how revise count how many duplicates exist particular month. select count(*) (select * (select dp, rn, edate, count(*)over(partition dp, rn) your_count etable) your_count = 1 , month(edate) = 08) x example (trying count duplicates of dp & rn month august) dp rn edate dp1 rp1 2017-08-09 <--yes dp2 rp1 2017-08-09 dp3 rp1 2017-08-09 <--yes dp1 rp2 2017-08-09 dp2 rp1 2017-07-09 dp1 rp1 2017-08-09 <--yes dp3 rp1 2017-08-09 <--yes result count = 2 based on clarifications original answer, here's revised answer (with original comment below) select dp, rn, month(edate), count(month(edate)) table1 not exists ( select * table1 t1 t1.dp = table1.dp , t1.rn = table1.rn , mon

Bind Angular inputs/outputs via data attributes -

is possible bind input , output properties using data attributes? i'm trying see if can use angular 2+ within number different environments html editor strips out unknown tags. so, <ng-test [intest]="test" (outtest)="test()">ng test</ng-test> becomes <p>ng test</p> after editor processes code. the same question apply *ngif , *ngfor etc. html editors strip away well. does know if possible? the editors ckeditor covered configuration allowed content (elements,attributes). https://docs.ckeditor.com/#!/guide/dev_advanced_content_filter

bash loop mysql output multiple to variables -

new programming , need little help. i need access mysql database , loop thru ‘ftpuser’ , ‘domain’ column give me output below echo 2>&1 " 3cmd put -r /home/$ftpuser/backups/ s3://bucket-backup/$domainname/" when run shell script below outputs ever user each domain 3cmd put -r /home/user1/backups/ s3://bucket-backup/domain1.com/ 3cmd put -r /home/user1/backups/ s3://bucket-backup/domain2.com 3cmd put -r /home/user1/backups/ s3://bucket-backup/domain3.com/ 3cmd put -r /home/user2/backups/ s3://bucket-backup/domain1.com/ 3cmd put -r /home/user2/backups/ s3://bucket-backup/domain2.com/ 3cmd put -r /home/user2/backups/ s3://bucket-backup/domain3.com/ and on the result im looking 3cmd put -r /home/user1/backups/ s3://bucket-backup/domain1.com/ 3cmd put -r /home/user2/backups/ s3://bucket-backup/domain2.com/ 3cmd put -r /home/user3/backups/ s3://bucket-backup/domain3.com/ 3cmd put -r /home/user4/backups/ s3://bucket-backup/domain4.com/ here code

Stuck on python list to json object to jquery data chart -

i'm having trouble populating data chart on website. here data looked before in query: var data2 = [ [gd(2012, 1, 1), 7], [gd(2012, 1, 2), 6], [gd(2012, 1, 3), 4], [gd(2012, 1, 4), 8], [gd(2012, 1, 5), 9], [gd(2012, 1, 6), 7], [gd(2012, 1, 7), 5], [gd(2012, 1, 8), 4], [gd(2012, 1, 9), 7], [gd(2012, 1, 10), 8], [gd(2012, 1, 11), 9], [gd(2012, 1, 12), 6], [gd(2012, 1, 13), 4], [gd(2012, 1, 14), 5], [gd(2012, 1, 15), 11], [gd(2012, 1, 16), 8], [gd(2012, 1, 17), 8], [gd(2012, 1, 18), 11], [gd(2012, 1, 19), 11], [gd(2012, 1, 20), 6], [gd(2012, 1, 21), 6], [gd(2012, 1, 22), 8], [gd(2012, 1, 23), 11], [gd(2012, 1, 24), 13], [gd(2012, 1, 25), 7], [gd(2012, 1, 26), 9], [gd(2012, 1, 27), 9], [gd(2012, 1, 28), 8], [gd(2012, 1, 29), 5], [gd(2012, 1, 30), 8], [gd(2012, 1, 31), 25] ]; in view have: return httpresponse(json.dumps({'data': data}), content_type="application

http - Connecting to my own golang sever from outside world -

so have code written in go : // firstserver - first server package main import ( "fmt" "log" "net/http" ) func main() { http.handlefunc("/", handler) err := http.listenandserve(":80", nil) if err != nil { log.fatal(err) } } // handler - handler function normal enter func handler(w http.responsewriter, r *http.request) { fmt.fprintln(w, "you're connected") } now, when go browser , type localhost:80 (or localhost ), page loads, , see message you're connected . wanted try connect other devices too. took other laptop. checked adapter address, 192.168.0.15 . when typed 192.168.0.15:80 on other laptop, worked again, cool! primarly trying simple server use on phone when @ college, check schedules, have notes, etc. took smartphone, disconnected wifi, switched smartphones internet , dumbly typed 192.168.0.15:80 again. knew wouldn't work, cuz it's not external ip. ,

powershell - Equivalent of .NET WebClient.uploadFile in Java -

we trying upload file horribly non-standard 'soap' web service using java. web service not soap, in fact file uploader takes xml files formatted soap envelopes. yes, know it's yuck. i've got following powershell code works in windows: $webclient = new-object system.net.webclient $webclient.headers.add('content-type','text/xml') $webclient.headers.add('accept','text/xml') $response = $webclient.uploadfile('https://uat.xxxxxx.com.au/soap/upload.aspx', 'c:\temp\soap.xml') [system.text.encoding]::ascii.getstring($response) but how do same in java? i've had @ apache httpclient , tried using multipartentitybuilder filebody part, endpoint keeps giving me soap fault stating "no http posted files found."

java - How to show a php image in imageview? -

i trying code , it's not working. how can download pic , show it. my java code private imageview iv; private bitmap bitmap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_showprofile); iv = (imageview) findviewbyid(r.id.virus); bitmap = getbitmapfromurl("http://getbloodbd.org/image.php?no=4"); iv.setimagebitmap(bitmap);} public bitmap getbitmapfromurl(string src) { try { url url = new url(src); httpurlconnection connection = (httpurlconnection) url .openconnection(); connection.setdoinput(true); connection.connect(); inputstream input = connection.getinputstream(); bitmap mybitmap = bitmapfactory.decodestream(input); return mybitmap; } catch (exception e) { // todo: handle exception e.printstacktrace(); return null; } } and xml code <scrollvie

reactjs - client/server authentiation: React client with C# web api -

i had app used mvc template, prescaffolded authentication (the 1 bootstrap). migrating project on web api , react client, still need same functionality. mvc authentication used sql server. want can same, unless better possible. how can implement authentication/authorization web api? guess can store password in react's state/props, , maybe pass http calls? you can generate token using web api , store on react front-end in local storage. , whenever http call put token in authorization header , match web api backend.

javascript - Why does Webpack build of React web app fail when project is built in a different folder? -

i have react project built using webpack. weird issue when run react app in original folder builds , runs without error. when copy files in folder, paste in new folder , try build same project fails. have tried changing folder name, changing config files reflect new folder name, fails in app.js , points error in render method. few points note: i havent hardcoded paths i have cleaned node modules , rebuilt project groundup including cleaning npm cache. the same project works in original folder without errors. the error follows: version: webpack 2.2.1 time: 1520ms asset size chunks chunk names app.js 219 kb 0 [emitted] main index.html 636 bytes [emitted] chunk {0} app.js (main) 208 kb [entry] [rendered] [1] (webpack)/buildin/global.js 509 bytes {0} [built] [32] ./src/app.js 783 bytes {0} [built] [failed] [1 error] [33] (webpack)-dev-server/client?http://0.0.0.0:8080

How to configure a dockerfile and docker-compose for Jenkins -

im absolutely new in docker , jenkins well. have question configuration of dockerfile , docker-compose.yml file. tried use easiest configuration able set-up these files correctly. building , pushing done correctly, jenkins application not running on localhost (127.0.0.1). if understand correctly, should default running on port 50000 (arg agent_port=50000 in jenkins "official" dockerfile). tried use 50000, 8080 , 80 well, nothing working. have advice, please? im using these files: https://github.com/fdolsky321/jenkins_docker the second question is, whats best way handle crashes of container. lets say, if container crashes, want recreate new container same settings. best way create new shell file "crash.sh" , provide there information, want create new container same settings? mentioned in here: https://blog.codeship.com/ensuring-containers-are-always-running-with-dockers-restart-policy/ thank advice. hyperv docker windows. in case, must sure p

java - Android SQLITE, unable to open database in Marshmallow only -

i built app. (the app can save favourite items using sqlite database ). tried running on android nougat , there no error. when tried running on android marshmallow, app won't open (force close) , when check error says unable open database. after that, tried running on android lollipop , there no error found. i trace error , found on marshmallow, database not created. (i used db debugger check db). add these user permissions: <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage" /> and nothing happened. else knows this?? **new edit syntax check if db created or not public dataheper(context context) { // todo auto-generated constructor stub this.mcontext = context; databasepath = "data/data/"+context.getpackagename()+"/databases/data.sqlite"; databasefile = new file(databasepath); if(

reactjs - Failed context type: The context `router.push` is marked as required in `withRouter(t)`, but its value is `undefined` -

modules react-router , react-router both have version 4.2.2 . following react routing . const history = synchistorywithstore(createbrowserhistory(), store); const headerwithrouter = withrouter(header); reactdom.render( <provider store = {store}> <router history = {history} > <section> <headerwithrouter/> <route = '/' = '/deals'/> <route exact path="/deals" component={deallist}/> <route path = "/deal" component={formdeal}/> <route path = "/admin" component={admin}/> <route path = "/mandate" component={mandate}/> <footer/> </section> </router> </provider> , document.getelementbyid('app')); the thing

configuration - I/O buffer get high during execution of expensive queries in SQL Server -

while execute expensive queries buffer gets full , pause other continuous running queries in queue (write block suspended). i make related configuration changes maxdop, cost threshold parallelism it’s high , slow execution. and there 1 of change related configuration processor affinity mask auto mode means both cpu in used due above condition not make changes can necessary.

vuejs2 - OnsenUI2 with VUE2 - how to move popover into page stack -

i'm using vue2 , onsenui2 in codepen . here excerpts html: <v-ons-button @click="push">push page 2</v-ons-button> <v-ons-button @click="showpopover($event, 'right')" style="align-self: flex-start">pop right</v-ons-button> and exerpts javascript: const page1 = { key: 'page1', template: '#page1', methods: { push(){ this.$emit('push-page', page2); } // tried putting showpopover here , using this.$parent... } }; new vue({ el: '#app', template: '#main', data() { return { popovervisible: false, popovertarget: null, popoverdirection: 'up', covertarget: false, pagestack: [page1] }; } }); the page change works - vue running ok, , there no problems html or javascript, taken the onsenui2 vue example page popover . looking @ chrome dev tools message (and 57 similar messages): property or method "popover

algorithm - Intuition for this statement: given a random hashed set, a sequence of k zero bits in the beginning indicate there is approximately 2^k elements -

i trying understand hyperloglog, , while doing have encountered statement need further explanation , intuition on. in 1 blog explaining hyperloglog, claim following given random hashed set, sequence of k 0 bits in element occur once in every 2^k elements, 2^k approximation of how large cardinality which assume implies 00000001 will occur 1 time every 2^7 elements. but statement confusing me, since isn't combination of 0 , 1 pattern k bit occur 1 time every 2^k element? what make consecutive 0s special?

actionscript 3 - How to exclude Library item from compiling if it is not present AS3 -

i have movieclip in library , loading dynamically through addchild method. the problem facing :-- i have main class runs several other classes , several fla's. main class calls sub class function in return calls code in frame of fla loads object library. this object not present in fla's , thats getting stuck, getting compile time error. tried checking through failed :( var classexist:boolean = isclassexists("ctrl_alarm"); function isclassexists(classname:string, domain:applicationdomain = null):boolean { var res:boolean; if(domain) { res = domain.hasdefinition(classname); } else { // res = getdefinitionbyname(classname); //or same res = applicationdomain.currentdomain.hasdefinition(classname); } trace(res); return res; } is there way can duplicate objects on stage in as3, or how can restrict object being compiled if not present in library? try following. if of swfs in same sandbox, might work: import flash.utils.get