Posts

php - How can I assert two possible values for a key in an array using Phpunit? -

this question has answer here: is there way in phpunit possibly assert 2 values key in array? 1 answer $array = [a => '1', b => '2'] for example, want check if either 1 or 3. thought using work. $this->assertthat( $this->assertcontains('1',$array), $this->logicalor( $this->assertcontains('3',$array) )); pass assertions arguments logicalor $this->assertthat($array, $this->logicalor( $this->assertcontains('3',$array), $this->assertcontains('1',$array) ));

c# - Apparent ODBC recordset size limit -

platform windows 10. i doing stress testing on 32 bit app using components purport intelligent caching large data sets built around adodb operations. have 64 bit postgresql v9.6 server installed using default user inputs, , i'm using psqlodbc 32 bit odbc driver offered installed during server install, , referencing driver through standard odbc connection set through 32 bit odbc control panel applet. i loaded database table 5 million records testing. worked expected, know odbc connection , write new rows part of api working correctly. the table has bigint primary key (bigserial actually) , text field contains key value formatted out take space. rows can seen , browsed in pgadmin4 app installs server. in app, open recordset query: select * mytable; this takes 20 sec server process , control returned app ui. expected recordset count of 5000000. instead, recordset 84796 records in it. can please explain might going on here, , how work around it, if possible? thanks. ...

python - Problems establishing connection with DB -

platform: linux. i beginner of mongodb , pymongo. after installing pymongo, here simple test tried on ipython: import pymongo client = pymongo.mongoclient(); # tried specify local host , port number db = client['mydb'] collections = db['temptables'] collections.insert({'a':'1'}) at point, chokes. , in end, spits out "error 111: connection refused" error. so, tried invoking mongodb straight terminal , still got error below [look @ far end]. so, searched bit , tried: removing lock ( sudo rm /var/lib/mongodb/mongod.lock ). turns out there no lock in first place. sudo mongod --repair i saw suggestion comment out host , port number config file. tried too, didn't work. none of above worked. this error see when try invoke mongodb command line. 017-08-17t15:25:30.265-0700 w network [thread1] failed connect 127.0.0.1:27017, in(checking socket error after poll), reason: connection refused 2017-08-17t15:25:30.265-0700 e ...

html - ASP Razor Web Pages - Form Submit is Moving My Data -

Image
when submit login email (aka username), want keep in login form. when submit register email (aka username), want keep in register form. what happening is: when submit login form, writes email (aka username) register form. please see image happening. @{ page.title = "login"; var username = ""; var password = ""; var errormessage = ""; var confirmpassword = ""; var regmsg = ""; var conftoken = ""; var emailbody = ""; var minpass = 2; var maxpass = 5; if (!ispost) { if (websecurity.isauthenticated) {errormessage = string.format("you logged in. (username: {0})", websecurity.currentusername);} } if(websecurity.isauthenticated){ errormessage = string.format("you logged in. (username: {0})", websecurity.currentusername); } if(ispost){ // login form if (request.form["loginsub...

google apps script - How can I put the formula only in the last 20 rows of this range? -

i want code works in last 20 rows of sheet. sets formula in of blanks cells of column want code in 20 last rows. function setformulainblankcells() { //----------------- colonna --------------- // formula solo su celle vuote "area" var sheet=spreadsheetapp.getactivesheet(); var lastrow=sheet.getmaxrows(); var lastcolumn=sheet.getmaxcolumns(); var range=sheet.getrange(1, 1, lastrow, 1); var data=range.getvalues(); for(var i=0;i<data.length;i++) { if(!data[i][0]) { var e1=sheet.getrange(i+1,5).geta1notation(); var i1=sheet.getrange(i+1,9).geta1notation(); var formula='=iferror(if(' + e1 + '="";"";if(' + i1 + '="";"ru";"st")))' sheet.getrange(i+1,1).setformula(formula); } } } i guess meant in last 20 rows of sheet function setformulainblankcells() { var sheet=spreadsheetapp.getactivesheet(); var lastrow=sheet.getmaxrows(); var ra...

How to learn spatial temporal guassian proces? -

i want simulation spatial temporal gaussian process. currently, know how learn spatial gaussian process. code using gpml matlab code. need specify mean, cov, , liklihood function. however, when comes spatial temporal gaussian process, don't know how specify mean , covariance functions learning; how incorporate time factor mean , covariance functions. btw, can tell me how generate spatial temporal data simulation. lot

R - Issues with double precision while writing to an excel file -

i have multiple columns in data frame called 'export', of numeric double precision. class(export) [1] "grouped_df" "tbl_df" "tbl" "data.frame" when write down table using following code, excel file has values such 13.0000000000001, 11, 3.9968e-14 write.xlsx(as.data.frame(export), file="test.xlsx", sheetname="test", row.names=false) i'm trying columns show pure integer value , columns show 1 decimal. i did try define of columns integer. export$col1<-0l but, doesn't seem work. assume it's because process column later on using group_by , summarize functions of dplyr package seems turning these columns double again. my question how 1 column write integer , other columns number 1 decimal? thank you!