Posts

typescript - Unable to set img src from cordova file in Ionic -

i'm using cordova-plugin-file-transfer , cordova-plugin-file download user avatars , display them locally in app. i'm fetching images , storing them in file.datadirectory according to: https://ionicframework.com/docs/native/file-transfer/ . when check file in directory says exists...however when try set absolute path of file <img> tag see nothing. i'm pulling in path dynamically when hardcode it...nothing. code saving, loading avatars: saveavatar() { var downloadurl = this.user.avatar + "?type=small&sz=75"; console.log("downloading avatar from: " + downloadurl); console.log("storing file to: " + this.file.datadirectory + this.user.id + '/avatar.jpg'); this.filetransfer.download(downloadurl, this.file.datadirectory + this.user.id + '/avatar.jpg') .then((entry) => { console.log('~~~~~ download complete: ' + entry.tourl()); }, (error) => { console.log(...

dplyr - making custom bins in dataframe inside function in R -

i create bins variable numbers per category name inside function. having difficulties related using category name provided parameter inside function. in dplyr approach, each observation gets bin in new column. pass colgroup parameter inside mutate instead of writing name of column directly, , establish bin lower , upper limits each group (colgroup) in pseudocode. maybe data.table approach better. set.seed(10) b<-(rnorm(10, sd=1,mean=10)) y<-runif(3) pr<-y/sum(y) names<-unlist(lapply(mapply(rep, letters[1:3], 1:3), function (x) paste0(x, collapse = "") ) ) x <- sample(names, 10, replace=true, prob=pr) df<-data.frame(name=x,numbers=b) df #working without bin limits per category (not desired) #and using "numbers" in cut (not desired) binfunction1 <- function(df, colgroup1, varcount,binsize) { new<-df %>% group_by_(colgroup1) %>% mutate(bin = cut(numbers, breaks <- c(seq(7, 15, = binsize)), # limits colgroup not imp...

What happens when declaring an additional index on the primary key in Oracle SQL? -

i have multi-part question: my journey began when trying figure out if can have descending/ascending primary keys in oracle sql. there doesn't seem syntax along lines of create table mytab (id int primary key desc); or create table mytab (id int, constraint pk primary key(id desc)); later learned oracle implicitly creates index primary key enforce constraints. figured create index it, , make index descending. create index myind on mytab (id desc); this worked, when did query see indices existed got this: > select index_name user_indexes table_name = 'mytab'; index_name ------------------------------ sys_c0011939 myind i see implicitly created index there own index... tried see if rid of implicitly created index creating index primary key during table create: create table mytab (id int primary key using index (create index myind on mytab (id asc))); this worked: > select index_name user_indexes table_name = 'mytab'; index_name ----...

javascript - dynamically adding markers to google map - angular2 -

so have 2 components, first of them form use adding latitude , longitude service markers. main component map want add markers. first problem initialize map , data in ngoninit() can't dynamically add new data because component doesn't reload , oninit don't run again. second problem don't know how add new markers when initialize map in ngoninit. that main component: export class appcomponent implements oninit { parties: party[] = []; party_location: location[] = []; constructor(private partyservice: partyservice) { } ngoninit() { map = new google.maps.map(document.getelementbyid('map'), { center: { lat: -25.363, lng: 131.044 }, scrollwheel: true, zoom: 16 }); this.parties = this.partyservice.getdata(); //get data (let item of this.parties) { //try add markers let marker = new google.maps.marker({ map: map, position: { lat: item.lan1, lng: item.lan2 }, title: item.title }); } if (navi...

arduino - How often can a Center 'notify' a Peripheral in BLE -

i have rc car built using arduino, bluetooth usb dongle, , ps3 controller. car has several functions (lights, sounds) along driving around. i want replace bluetooth dongle , ps3 controller ble module (i have hm-10) , want use web bluetooth. controller virtual 1 served secure website. my question is: setup possible current version of web bluetooth? and: how can center (my computer/website) notify peripheral (the rc car) start/stop/turn/play sound/etc... ? in general, limitations (if any...i'm sure there or wouldn't posting this) run setup vs simple bluetooth dongle/ps3 controller. i hate general being new tech, other comments/insights/pitfalls welcome! yes, possible. examples: rc car dev board web bluetooth sphero controlled web bluetooth you keep dual shock 3 optional input device using gamepad api . regarding notification frequency, neither chrome nor web bluetooth api impose artificial limitation on ble activity @ level. however, that's no...

wxwidgets - Assert in call to wxDataViewListCtrl::EditItem in a second wxDataViewListCtrl -

i'm getting following assert when wxdataviewlistctrl::edititem called second time. ../../src/wxwidgets/src/gtk/dataview.cpp(221): assert "gtk_tree_selection_get_select_function(m_selection) == func" failed in checkcurrentselectionfunc(): selection function has changed unexpectedly, review code! see code @ https://pastebin.com/tetk5c7s to reproduce: choose menu, show dialog. in dialog choose add , close. again choose menu, show dialog , in dialog choose add. ubuntu 17.04 x64, tested master, wx_3_0_branch , wx_3_0_3_branch configured --enable-debug --enable-unicode --disable-universal default config gtk2-unicode-3.0 edit: after further testing found assert occurs in call edititem in second wxdataviewlistctrl. this bug in wxwidgets, reporting it. fixed in both master , 3.0 branch , work in 3.0.4 , 3.1.1 when they're released.

iframe - Primefaces - Dialog framework, auto resize not working -

primefaces 6.0 - dialog framework my dialog has p:calendar component , when user clicks put date, calendar open , doesn't fit inside of dialog iframe , vertical scroll appears. if resize dialog, iframe don't resize. if open dialog options.put("contentheight", "100%"); the resize works, initial height of dialog comes wrong, components hidden. want initial height continue auto. any help?