mean

What does if [ $? -eq 0 ] mean for shell scripts?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There is this line in a shell script i have seen: grep -e ERROR ${LOG_DIR_PATH}/${LOG_NAME} > /dev/null if [ $? -eq 0 ] 回答1: It's checking the return value ( $? ) of grep . In this case it's comparing it to 0 (success). Usually when you see something like this (checking the return value of grep) it's checking to see whether the particular string was detected. Although the redirect to /dev/null isn't necessary, the same thing can be accomplished using -q . 回答2: $? is the exit status of the most recently-executed command; by convention, 0

What does \\u003C mean?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm looking at twitter's javascript file, and I see this in the templates hash: Browse Interests {{ /i}}\u003C/ a\u 003E \n \u 003C / li\u 003E \n {{# logged_in }} \n What do those codes represent? 回答1: It's a unicode character. In this case \u003C and \u003E mean : U+003C < Less-than sign U+003E > Greater-than sign See a list here 回答2: That is a unicode character code that, when parsed by JavaScript as a string, is converted into its corresponding character (JavaScript automatically converts any occurrences of \uXXXX into the

What does new self(); mean in PHP?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've never seen code like this: public static function getInstance() { if ( ! isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; } Is it the same as new className() ? EDIT If the class is inheritant,which class does it point to? 回答1: self points to the class in which it is written. So, if your getInstance method is in a class name MyClass , the following line : self::$_instance = new self(); Will do the same as : self::$_instance = new MyClass(); Edit : a couple more informations, after the comments. If you

Computing image integral

匿名 (未验证) 提交于 2019-12-03 02:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do one find the mean, std dev, and gradient from image integral? Given an image such as follows: As shown in the figure above, to find the sum of the highlighted parts, sum = C+A-B-D . So we have sum = 22 . How can I proceed next in order to find: Mean Std dev Gradient 回答1: C+A-B-D gives you the sum of the gray levels in the zone delimited by A,B,C,D, so, to get the mean you just need to dived it by the area of the zone: mean = (C+A-B-D)/4 To get the dev, you must compute the sum of square area table (using cv::integral you can pass a

What does it mean for a Service to be of type NodePort, and have both port and targetPort specified?

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am becoming more familiar with Kubernetes by the day, but am still at a basic level. I am also not a networking guy. I am staring at the following snippet of a Service definition, and I can't form the right picture in my mind of what is being declared: spec: type: NodePort ports: - port: 27018 targetPort: 27017 protocol: TCP Referencing the ServicePort documentation , which reads in part: nodePort The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually integer assigned by the system. If specified,

SAS--tabulate!

自古美人都是妖i 提交于 2019-12-03 02:46:04
proc tabulate data=clinic.stress2; var resthr maxhr ; table mean*(maxhr resthr); run; proc tabulate data=clinic.stress2; var resthr maxhr ; table mean*(maxhr resthr); run; proc tabulate data=clinic.admit; class sex; var height weight; table sex,(height weight)*mean; run; proc tabulate data=clinic.admit; var height weight; class sex; table sex,(height weight)*mean; run; proc tabulate data=clinic.data; var height weight; class sex actlevel; table height; table sex, height; table sex,actlevel, weight height; /*一个comma增加一个维度*/ table sex actlevel ,height; run; proc tabulate data=clinic.data; var

SAS--tabulate

依然范特西╮ 提交于 2019-12-03 02:45:53
proc tabulate data=clinic.stress2; var resthr maxhr ; table mean*(maxhr resthr); run; proc tabulate data=clinic.stress2; var resthr maxhr ; table mean*(maxhr resthr); run; proc tabulate data=clinic.admit; class sex; var height weight; table sex,(height weight)*mean; run; proc tabulate data=clinic.admit; var height weight; class sex; table sex,(height weight)*mean; run; proc tabulate data=clinic.data; var height weight; class sex actlevel; table height; table sex, height; table sex,actlevel, weight height; /*一个comma增加一个维度*/ table sex actlevel ,height; run; proc tabulate data=clinic.data; var

MEAN stack: angular routing vs express routing [closed]

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've started using angular in my express generated projects and i'm loving it. Recently I implemented angular routing into one of my test projects and I'm wondering what the advantages and disadvantages are to using angular routing over pure express/node routing (e.g. are there technical issues with this way, or maybe SEO, or is it totally unnecessary). FYI on my setup: I have express rendering the main index template as well as routing all request (a catch all) to the main index template and then I'm using angular to route to partial

Apply function on a subset of columns (.SDcols) whilst applying a different function on another column (within groups)

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is very similar to a question applying a common function to multiple columns of a data.table uning .SDcols answered thoroughly here . The difference is that I would like to simultaneously apply a different function on another column which is not part of the .SD subset. I post a simple example below to show my attempt to solve the problem: dt = data.table(grp = sample(letters[1:3],100, replace = TRUE), v1 = rnorm(100), v2 = rnorm(100), v3 = rnorm(100)) sd.cols = c("v2", "v3") dt.out = dt[, list(v1 = sum(v1), lapply(.SD,mean)), by = grp,

What does git push -u mean?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have two different versions of git. In the 1.6.2 version, git push does not have the -u option. It only appears in the 1.7.x version. From the docs, the -u is related to the variable branch.<name>.merge in git config . This variable is described below: Defines, together with branch.<name>.remote, the upstream branch for the given branch. It tells git fetch/git pull which branch to merge. What is an upstream branch ? 回答1: "Upstream" would refer to the main repo that other people will be pulling from, e.g. your GitHub repo. The -u option