always

correlation function always NA

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to find the correlations with this function but I just get NA for each input: corr <- function(directory, threshold = 0) { filenames <- list.files(directory, pattern="*.csv", full.names=TRUE) csv <- lapply(filenames, read.csv) correlations <- c() c(correlations, lapply(csv, function(x){ cor(x$nitrate,x$sulfate) print(cor(x$nitrate,x$sulfate)) })) correlations } If I change the function to print the nitrate and sulfate it does in fact have values, if I just pass in x to the cor function it complains about non-numeric values. Why

Eloquent count() always returns 1

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following query: Item::select(['items.id', 'inventory.quantity']) ->leftJoin('inventory', 'items.id', '=', 'inventory.item_id') ->groupBy('items.id') ->count(); The count() method always returns 1 despite there being 20 rows to the results that are returned. Why might this be? Here is the raw query from DB::getQueryLog() : select count(*) as aggregate from `items` left join `inventory` ON `items`.`id` = `inventory`.`item_id` group by `items`.`id` 回答1: Yes, count returns only 1 row, always. You would probably want: Item::select([

Dividing two numbers always equals zero?

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my Xna game, I am trying to have my playfield scale to the screen that it is running on. To do this, I use proportions to find the percent that the real window is scaled relative to my playfield. To do this, I divide the real width by the virtual width: float _percent = _realViewport.Width / this._viewport.Width; I always get 0, though, in the _percent variable. I set up a debug stop point at that line in my code, and analyzed the variables. this._viewport.Width equals 640, and _realViewport.Width equals 1280. So, using my calculator, 640

Kubernetes: --image-pull-policy always does not work

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Kubernetes deployment which uses image: test:latest (not real image name but it's the latest tag). This image is on docker hub. I have just pushed a new version of test:latest to dockerhub. I was expecting a new deployment of my pod in Kubernetes but nothing happends. I've created my deployment like this: kubectl run sample-app --image=`test:latest` --namespace=sample-app --image-pull-policy Always Why isn't there a new deployment triggered after the push of a new image? 回答1: Kubernetes is not watching for a new version of the image

NSWindow restorable not always working

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have checked the restorable option on my NSWindow When I move my application and change its size and close/reopen my application it sets the window size and position to the last size and position but this doesn't happen on every computer where i test it. it only happens to a few computers they don't have special settings regarding the resume. Does anybody have any experience with this? 回答1: But this doesn't happen on every computer where I test it. It only happens to a few computers. They don't have special settings regarding the resume.

URL is always nil in Swift 3

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a struct that I am using to call out to the iTunes API. But when ever I run it myURL variable is never getting set, it's always nil . Not sure what I am doing wrong: let myDefaultSession = URLSession(configuration: .default) var myURL: URL? var myDataTask: URLSessionTask? struct APIManager { func getJSON(strURL: String) { myURL = URL(string: strURL) var dictReturn: Dictionary<String, Any> = [:] //cancel data task if it is running myDataTask?.cancel() print(myURL!) //<----Always nil } } Here's the string: "https://itunes.apple.com

Rails4 jbuilder always return status code 200, even if I put other status code

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I built a json view to return json in one of ajax call in rails4 app. I have used the idea suggested here https://stackoverflow.com/a/12832116/1560470 But I always keep getting status code as 200, even if I enforce other status code. My jbuilder view in view/managers/create.json.jbuilder looks as follows: if @manager.errors.messages.any? envelope(json, :unprocessable_entity, @manager.errors.messages) do json.success false end else envelope(json, :created) do json.success true end end My application helper lloks as follows: module

Number of parameters must be always be even : opennlp

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been trying to use the command Line interface to train my model like this: opennlp TokenNameFinderTrainer -model en-ner-pincode.bin -iterations 500 \ -lang en -data en-ner-pincode.train -encoding UTF-8 the console output is: Number of parameters must be always be even Usage: opennlp TokenNameFinderTrainer[.evalita|.ad|.conll03|.bionlp2004|.conll02|.muc6|.ontonotes|.brat] [-factory factoryName] [-resources resourcesDir] [-type modelType] [-featuregen featuregenFile] [-nameTypes types] [-sequenceCodec codec] [-params paramsFile] -lang

Do ASP.NET Requests always BeginRequest and EndRequest on the same thread?

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Does BeginRequest and EndRequest for an ASP.NET HttpApplication always occur on the exact same thread for a given HTTP request from a client? The reason I ask is that I am seeing some very strange behavior where a ThreadStatic variable is not null inside of an Init method for an IHttpModule. I set this ThreadStatic variable to a value on BeginRequest and null it on EndRequest. However, my IHttpModule Init method should be called outside of the BeginRequest/EndRequest period, so the only way I can think of that this ThreadStatic variable

d3.scale.category20b always returning first color

匿名 (未验证) 提交于 2019-12-03 02:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to use d3.scale.category.20b() to generate a color scale, problem is whatever number of the list I ask for, it always returns first element of the list. var color = d3.scale.category20b(); console.log(color(X)); OR console.log(d3.scale.category20b()(X); No matter what X is, it always logs #393b79 which is the first elements, according to the d3 API 回答1: This can happen because categorical scales in d3 append to the domain as new data comes in. If every enter() creates a new categorical scale, the domain of the categorical scale remains