Posts

git - Cannot connect to gitlab.com or github.com from openshift-jenkins -

i installed latest openshift origin, , created jenkins project provided templates, cannot seem ping git repos (gitlab.com or github.com) jenkins instance. jenkins instance has respective plugins installed , seems working fine otherwise. doing "oc rsh " pod, , pinging gitlab.com, timeouts, though i'm not sure if expected or not. i'm guessing i'm missing obvious, cannot figure out is.

python - How to get value of pixels which are at a certain angle from another pixel? -

i'm trying implement method have obtain values of pixels forms line @ angle through pixel (i, j) consider following code snippet sum = image.getpixel(((i - 7), (j + 2))) + image.getpixel(((i - 6), (j + 2))) + image.getpixel( ((i - 5), (j + 1))) + image.getpixel( ((i - 4), (j + 1))) + image.getpixel(((i - 3), (j + 1))) + image.getpixel(((i - 2), (j + 1))) + image.getpixel( ((i - 1), j)) + image.getpixel((i, j)) + image.getpixel(((i + 1), j)) + image.getpixel( ((i + 2), (j - 1))) + image.getpixel(((i + 3), (j - 1))) + image.getpixel(((i + 4), (j - 1))) + image.getpixel( ((i + 5), (j - 1))) + image.getpixel(((i + 6), (j - 2))) + image.getpixel(((i + 7), (j - 2))) avg_sum = sum / 15 now in above code know pixels relative i, j forms line @ angle 15 degrees. hence able values of pixels. now there easy way because code find sum of grey level of 15 pixels forms line @ 15 degree through i, j. want code flexible can find sum of line of length 15 pixels or 13 p...

model - Use of the auto.arima function with external regressors -

i new r , i´ve been having trouble following: i want possible combinations (up 3 independent variables in example) arimax model. suppose have thefollowing sample data: library(forecast) airpassengers_1<-ts(airpassengers, start = c(1949,1), frequency = 12, end =c(1960,12)) nottem_1<-ts(nottem, start = c(1949,1), frequency = 12, end = c(1960,12)) sunspots_1<-ts(sunspots, start = c(1949,1), frequency = 12, end = c(1960,12)) sunspot.month_1<-ts(sunspot.month, start = c(1949,1), frequency = 12, end = c(1960,12)) base<-cbind(airpassengers_1,nottem_1,sunspots_1,sunspot.month_1) i going use airpassengers_1 variable dependent variable , others independent variables. next create matrix possible combinations of explanatory variables going included in auto.arima formula (forecast package). cant_variables<-dim(base)[2]-1 cant_regresores<-3 x=c(1:cant_variables) if(cant_regresores==1){ v<-t(combn(x, 1)) v<-cbind(v,matrix(0,nrow(v),2)) h<...

r - resolve metaMDS error : "veg_distance" not available for .C() for package "vegan" -

i keep getting following error when trying run metamds() vegan package: my_mds <- vegan::metamds(df_species, distance="bray", k=2, trymax=1000, autotransform=true) error in .c("veg_distance", x = as.double(x), nr = n, nc = ncol(x), d = double(n * : "veg_distance" not available .c() package "vegan" i have tried: 1. searching online error - yields 0 results 2. reducing size of data frame 17 rows , 12 columns 3. clearing packages global environment eliminate potential package conflicts 4. specifying vegan::metamds nothing has worked. can provide solution error? example data here: structure(list(species_1 = c(68.75, 51.4583333333333, 67.1666666666667, 36.3333333333333, 37.1666666666667, 45, 34.25, 20.9583333333333, 41.75, 85.7272727272727, 63.5, 27.1666666666667, 59.5, 76.75, 50.1666666666667, 35.25, 42), species_2 = c(21.3333333333333, 26.2916666666667, 32.7083333333333, 36.6666666666667, 26.25, 24.7...

postgresql - ERROR: current transaction is aborted, commands ignored until end of transaction block --- export data from Aqua studio -

i trying export 1 table aquastudio csv file. table has approximately 4.4 million rows. when trying use export window function in aqua studio, facing following error: error: error: current transaction aborted, commands ignored until end of transaction block i not understanding problem is. read few articles regarding error , found happening due error in last postgresql command. did not use sql commands export , dont know how debug this. unable view log files. you shouldn't exporting millions of rows through jdbc/odbc connection, redshift. for redshift, please use unload command documented here . you'll have unload file s3 , download there. for postgres, use copy to documented here .

python - Data scraping basketball data using beautiful soup -

i want return names of these 3 players (in url).. current code returns name, team, , basketball association. there can specify in code return names? data scraping here : import requests bs4 import beautifulsoup def bball_spider(str): source_code = requests.get(str) plain_text = source_code.text soup = beautifulsoup(plain_text, "html.parser") # players elements in soup.find('table' , {'id' : 'stats'}).findall('a'): names = elements.string print(names) str = input("enter query result url ") bball_spider(str) you there, first let me mention since seems new python: shouldn't name variable str , because shadows built-in str class, that's modified in code shown below. important modification changed .findall('a') .findall('td',{'class':'left active'}) , inspecting element can see names of players in <td> tag class left active . changed iterating ...

javascript - access to elements of an array in js vs hashtable in c++ or c# performance? -

js uses hash table access elements of array. slower method of accessing array elements in c++ or c# languages? var arr=[]; arr[0]=23; arr[1]=12; arr['2tr5']=54; is algorithm accesses elements of array in js same hashtable in c++ or c#? how can speed access elements directly , why doesn't js use dense array fast access elements.