Posts

Featured post

r - Unable to save files from shinyapps.io to app directory on local machine -

i have shiny app gathers data facebook , displays in tables . there option save data in csv files , place in app directory.when run locally works when deploy app shinyapps.io account , use cannot see csv files being saved in app directory. not errors or warnings when using app. reason behaviour , how can resolve it? want app save files in app directory can access next time , display data without having need gather data again facebook.my app can read files directory not write files it. appreciated. regards, abhinav bais

sql - Neither percentile_cont nor percentile_disc are calculating the desired 75th percentile in PostgreSQL 9.6.3 -

working percentile functions, not getting desired output. "incorrect", functions working intended, , not understanding them properly. these numbers working with: n = 32 160000 202800 240000 250000 265000 280000 285000 300000 300000 300000 300000 300000 309000 325000 350000 358625 364999.92 393750 400000 420000 425000 450000 450000 463500 475000 475000 505808 525000 550000 567300 665000 900000 my understanding of percentile_cont aggregate 2 numbers if count in add them , divide two. understanding of percentile_disc select lowest number if count even. this understanding of calculating percentile using 50th (median) example: if number of numbers (n) odd, pick number in middle; if number even, average 2 numbers in middle. in case, there 32 numbers, median = (358625 + 364999.92) / 2 = 361812.46 . percentile_cont returns correct value since averages 2 values; percentile_disc returns incorrect value since picks lowest of two. regarding other percentiles, 10th ex

Python - KeyError in Pandas DataFrame -

when import dataset: dataset = pd.read_csv('lyrics.csv', delimiter = '\t', quoting = 2) it prints so: lyrics,classification 0 should have known better girl yo... 1 can shake apple off apple tree\nshak... 2 it's been hard day's night\nand i've been wo... 3 michelle, ma belle\nthese words go to... 4 can't buy me love, love\ncan't buy me love\ni'... 5 love you\ncause tell me things want to... 6 dig pygmy charles hawtrey , deaf ... 7 song robin sings,\nthrough years of endl... 8 love me tender, love me sweet,\nnever let me g... 9 well, it's 1 money,\ntwo sho... 10 words let know\nstill could... and if print (dataset.columns) , get: index([u'lyrics,classification'], dtype='object') but if try prints lyrics, so: for in range(0, len(dataset)): lyrics=dataset['lyrics'][i] print lyrics i following error: keyerror: 'lyrics' w

html - PHP Error - All Files or Directories created are 0 -

i coding registration script , wanted create folder inside folder called "users". somehow, folder created in root path (where php script located) , files, supposed written inside folder in file called 0. here's code: if (!isset($_post["method"])){ die("error"); } if (!isset($_post["usernamefld"])){ die("error"); } if (!isset($_post["passwordfld"])){ die("error"); } if ($_post["method"] == "register"){ if (!isset($_post["emailfld"])){ die("error"); } if(is_dir("./users/"+$_post["usernamefld"])){ die("taken"); } mkdir("/users/"+$_post["usernamefld"]); echo "test&

javascript - Creating a path from a PNG in fabricjs -

i have png image transparent area. i have photo. i using fabricjs i need create new image cropped transparent area of png. i understand can use clipto(path) function create new image. however, problem creating path in first place. how can create path transparent area of png? thanks in advance. as strange may seem, wasn't able find correct duplicate this... you don't need calculate path bitmap. canvasrenderingcontext2d api offers compositing , blending options , allow work directly bitmaps. fabricjs offers option: http://fabricjs.com/docs/fabric.object.html#globalcompositeoperation var c = new fabric.canvas('c', { imagesmoothingenabled: false }); fabric.image.fromurl( 'https://dl.dropboxusercontent.com/s/4e90e48s5vtmfbd/aaa.png', function(image1) { fabric.image.fromurl( 'https://upload.wikimedia.org/wikipedia/commons/5/55/john_william_waterhouse_a_mermaid.jpg', function(image2) { // 1 clipped

MySQL Select and LEFT JOIN multiple with AS statement -

i'm encountered couple errors contains multiple with statement. (for example, abc_table, def_table, qrs_table ones populated, containing similar column names have different metrics within each table. ) with abc as( select region,temporature,id abc_table) , def as( select region,temporature,id def_table) , xyz as(select region,temporature,id abc left join def on def.region=abc.region ) /*this 1 uses value previous with*/ select region,temporature,id,region_id qrs_table qrs /*this key table*/ left join xyz on xyz.id = qrs.id region_id=3 would appreciate thoughts/input thank you!

javascript - console.log always printing same thing when code is different in Angular 1 app -

i trying complete angular 1.5 tutorial youtube series: angular 1.5 tutorial . angular 1 because work still uses , need become better it. the problem follows: created blog-list.component.js , blog-list.module.js file along app.module.js file. writing console.log() message in component file says console.log("hello sir"); , had console.log("hello"); . whenever try change console.log message console logs hello, not updated console message. not sure have done wrong, can't seem able find mistake. perhaps might able see it? here file contents: blog-list.component.js: 'use strict'; angular.module('bloglist'). controller('bloglistcontroller', function() { console.log("hello sir"); }); blog-list.module.js: 'use strict'; angular.module('bloglist', []); app.module.js: 'use strict'; angular.module('try', ['bloglist']); index.html file: <!doctype html> <html ng