Posts

javascript - IDBKeyRange.only() returns only first matching record -

i querying database table follows: function getallrecords(letter) { var trans = db.transaction(["observablestates"],"readonly").objectstore("observablestates").index('letterindex'); //get matching records var request = trans.opencursor(idbkeyrange.only([letter])); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { count+=1; cursor.continue(); console.log(cursor); } } request.onerror = function(event) { console.log('error loading data table'); } //delete of returned records } i have 2 records having value of letter first record returned. cursor.continue() not seem work in case. any appreciated. thanks that should work, , can't reproduce problem. it's possible you're hitting browser bug (which browser testing in?) or there'...

split dataframe column including list of lists on multiple rows into pandas -

i have dataframe df: import pandas pd df = pd.dataframe([ [[[3,0.5, 0.4, 0.7, 5],[2, 0.5, 1, 0.8, 2],[1, 0.5, 1, 1, 2]], 'b'], [[[1, 0.5, 0.6, 0.01, 1],[2, 0.5, 0.3, 0.2, 3],[1, 0.8, 1.0, 0.04, 3]], 'd']], index = ['row1', 'row2'], columns=['col1', 'col2']) i split col1, including list of lists, on multiple lines follows: col1 col2 row1 [3,0.5, 0.4, 0.7, 5] b row1 [2, 0.5, 1, 0.8, 2] b row1 [1, 0.5, 1, 1, 2] b row2 [1, 0.5, 0.6, 0.01, 1] d row2 [2, 0.5, 0.3, 0.2, 3] d row2 [1, 0.8, 1.0, 0.04, 3] d and next split col1 in 2 columns, retaining second , third elements new_col1 new_col2 col2 row1 0.5 0.4 b row1 0.5 1 b row1 0.5 1 b row2 0.5 0.6 d row2 0.5 0.3 d row2 0.8 1.0 d how can done make using pandas? for first step there may not bett...

html - iPhone (Safari) anchor tags don't work as intended -

i'm having trouble specific browser/device need serve website. essentially, have anchor tags display hidden element when clicked. works intended on (firefox/chrome/ie on pc, android ff/chrome/browser) except ios. when clicking "view bio" link, text should transition in , displayed. when doing on ios grey box hovers on element (so assume knows there there), not show hidden element. after doing research can see there may issue way ios deals "onclick" or effect. have tried implement few different things (mainly java-based) though haven't worked. may not need do, implementation purely html/css based, i've tried i've come across. of fixes involved don't involve hidden elements, , more simple "scroll point" implementations. it's same thing. as far can tell, there sort of bug or dislike of anchor tags ios, articles/existing pages have read. may not applicable, according users ios not serve "onclick" or "click"...

r - Creating a sensible line chart to compare the average with the actual -

Image
i have following dataset i want create line chart comparing historical average vs 2016 monthly highway fatalities . want use ggplot graphing. i had more 1 attempt still receive errors (error: not find function "ggplot2") ggplot(homework_8_data, aes(x = months)) + geom_(aes(y = ave_since_2002), colour="blue") + geom_line(aes(y = x2016), colour = "grey") + ylab(label="average , actual highway fatalities") + xlab(label="months") i need me understand error did , correct me. thanks you have install ggplot2 : install.packages("ggplot2") and load : library(ggplot2)

Order a vector in c -

#include <stdio.h> #include <conio.h> #include <string.h> void change(int *v[]) { int tmp; (int = 0; < 10; i++) { (int j = + 1; j< 10; j++) if (*v[i] > *v[j]) { tmp = *v[i]; *v[i] = *v[j]; *v[j] = tmp; } } } void main() { int v[10]; (int = 0; < 10; i++) { printf("enter value v[%d]: \n", i); scanf("%d", &v[i]); } printf("the vector is: \n"); (int = 0; < 10; i++) printf("value on position %d %d \n", i, v[i]); change(&v[]); // think here problem printf("\n\n after function call, vector is: \n"); (int = 0; < 10; i++) printf("value on position %d %d \n", i, v[i]); getch(); } i need ordonate vector don't know how pass value of vector function. can me solve , explain me , make me understand, important. thank guys ! the function must declared like void change(int v[...

java - Unable to inject AutoWired Enviroment when using Spring Boot 1.4 testing annotations -

i running integration tests on spring boot application using cucumber , in step definitions, code had been bootstrapping spring boot app using this: @runwith(springjunit4classrunner.class) @contextconfiguration(classes = application.class, loader = springapplicationcontextloader.class) @webappconfiguration @integrationtest @slf4j public class creditcardstepdefs { .... } now, i'm trying refactor code make use of simplified annotations in spring boot 1.4 , same piece of code looks now: @runwith(springrunner.class) @springboottest(webenvironment = webenvironment.defined_port) @slf4j public class creditcardstepdefs { ... } however, i'm facing problems in picking environment variables in particular piece of code: @autowired private environment env; @before("@run, @post") public void setup() { this.host = env.getproperty("test.url") + env.getproperty("server.contextpath"); this.results = new hashmap<>(); this.paramke...

asp.net core - External Cookie is not destroyed -

in asp.net core app, i'm using social media authentication. after user data social media provider, try destroy "external" cookie provider can create new "internal" cookie user. when check see if user registered or not. for reason though external cookie not getting destroyed. if there's problem , unregistered user aborts process , comes app, seems right through if he's registered user because app accepting external cookie. any idea why external cookie not destroyed? use following line destroy external cookie. await httpcontext.authentication.signoutasync(cookieauthenticationdefaults.authenticationscheme);