Posts

d3.js - How to make pandas python render with d3 and leaflet.js -

i'm newbie desperately trying develop workflow between pandas in python , d3 improve visualisation skills. can explain how access columns of data in d3? my effort is: http://jsbin.com/pizakerove/edit?html,output i've managed munge pandas dataframe to_json method orient="index" shape need. i'm trying add lat/long points leaflet.js map using d3 using mike bostock's tutorial - http://bost.ocks.org/mike/leaflet/ excuse weakness javascript. understand need use accessor function access columns of data, i'm lost how this. i can see how once can access fields of data might able lever d3 create map , separate bar chart. can explain i've got wrong or @ least provide simple pathway me head around d3? i managed fix using 'orient' parameter of 'records' instead of 'index'. i used block http://bl.ocks.org/d3noob/9267535 working map.

spatial - Problems is projecting LON/LAT data in R -

Image
i have dataframe contains pm10 concentration in air on seoul(capital city) in korea. please, take look. want plot semivariogram data set. lat/lon data here, in degree have project data. have projected data in way: library(rgdal) seoul3112 <- read.csv("seoul3112.csv", row.name=1) seoul3112 <- na.omit(seoul3112) coordinates(seoul3112) <- ~lon+lat proj4string(seoul3112) <- "+proj=longlat +datum=wgs84" seoul3112 after projecting got seoul311 below coordinates pm10 1 (126.976, 37.56464) 42 2 (127.005, 37.57203) 37 3 (127.0051, 37.54031) 46 4 (127.0957, 37.54464) 47 5 (127.0411, 37.54311) 46 q1: found after projecting, value of lon/lat show same value previous data frame. question whats actual function of proj4string(seoul311) = "+proj=longlat +datum=wgs84" command. here, lon/lat(degree) transferred km/m or that? i tried write code using rgdal package below: proj4string(seoul3112) <- "+proj=...

winsock - Sockets using GetQueuedCompletionStatus and ERROR_MORE_DATA -

i trying use getqueuedcompletionstatus winsocks, can't seem right. procedure follows: void foo() { ... socket sck = wsasocket(af_inet, sock_dgram, 0, null, 0, wsa_flag_overlapped); .... bind(sck,(struct sockaddr *)&addr,sizeof(struct sockaddr_in)); handle hport = createiocompletionport((handle)sck, null, 0, 0 ); overlapped poverlapped = {0,}; wsarecvfrom(sck,null,0,null,null,(struct sockaddr *)&laddr,&lsize,&poverlapped,0); bool breturn = getqueuedcompletionstatus( hport, &rbytes, (lpdword)&lpcontext, &poutoverlapped, infinite); ... } i send network data bound port external tool. getqueuedcompletionstatus returns false, , getlasterror() returns error_more_data, sounds correct, since hadn't provided buffer in wsarecvfrom. the question how can provide buffer data failed i/o operation? i tried issue wsarecvfrom original overlapped structu...

r - Covariance matrix not positive definite -

i'm trying solve portfolio optimization problem quadprog library, solve.qp function returns this: matrix d in quadratic function not positive definite! but, i'm defining dmat as: dmat <- cov(diff(as.matrix(na.locf(prices)))) how can turn dmat in positive definite matrix? thanks help. discovered cov.shrink function corpcor library, , i'm defining dmat as: cov.shrink(diff(as.matrix(na.locf(precos_mes)))) which works positive definite matrix.

google cloud bigtable - Is there an upper limit for the length of row keys? -

i want know whether there's maximum length row key values in google's bigtable. i'm aware documentation recommends hashing potential solution create keys of same length, in scenario can group related data better if include file path in key. in cloud bigtable: the maximum length row keys 4kib. the maximum length column qualifiers 16 kib. we've added official documentation here: https://cloud.google.com/bigtable/docs/schema-design

How to change project build target in Android Gradle project -

Image
i have project needs ported in gradle build, have done of work not able change target sdk build, since application heavily dependent on third party sdk. present in addons directory of sdk manager. here eclipse project structure project build target in eclipse is the gradle project structure build.gradle in app directory apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion "22.0.1" defaultconfig { applicationid "com.name.appname" minsdkversion 15 targetsdkversion 22 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) //compile 'com.android.support:appcompat-v7:22.2.1...

big o - Big o notation work -

i new in time complexity using big-o notation have 3 examples , tries figure out big(o) first example sum = 0; for(i=0; i<m/3; i++){ system.out.println(“*”); for(j=0; j<n; j++) for(k=0; k<10; k=k+2) sum++; } i think 1 o(mn), first loop works m/3 times, second loop works n times, third loops works 10 times o(mn) second example sum = 100; for(i=0; i<n; i++){ sum++; } for(j=10; j<n; j++) for(k=1; k<m; k*=2) sum++; big-o = o(log(m)), number of operations executed being n + ( (n - 10) * log(m) ) third example sum = 0; for(i=2; i<n; i++){ for(j=3; j<n; j+=2){ sum++; }} for(k=1; k<m; k*=2) sum++; here think big-o = log(m)n^2 ??? is correct??? here is: o(m/3 * n * 5) = o(mn * c) = o(mn) o(n + (n - 10) * log(m)) = o(n*log(m)) o((n-2)*(n-3)/2 + log(m)) = o(n 2 + log(m)) = o(n 2 ) next time, please, format code blocks defined braces clearer. in 3. o(n 2 + log(m)) → o(n 2 ) because f(x) = x 2...