entropy

Reading entropy_avail file appears to consume entropy [closed]

北慕城南 提交于 2019-12-06 21:47:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . The question have been asked in here http://www.gossamer-threads.com/lists/linux/kernel/1210167 but I don't see an answer. AFAIK /proc/sys/kernel/random/entropy_avail should return the size of available entropy but should not consume it. At least I don't see any reason for that. However, I have been noticing the

CentOS7下Tomcat启动慢的原因及解决方案

淺唱寂寞╮ 提交于 2019-12-06 17:36:29
CentOS7下Tomcat启动慢的原因及解决方案 现象   在一次CentOS 7系统中安装Tomcat,启动过程很慢,需要几分钟,经过查看日志,发现耗时在这里:是session引起的随机数问题导致的。Tocmat的Session ID是通过SHA1算法计算得到的,计算Session ID的时候必须有一个密钥。为了提高安全性Tomcat在启动的时候回通过随机生成一个密钥。 20-Jul-2017 02:54:56.797 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /application/apache-tomcat-8.0.27/webapps/manager 20-Jul-2017 02:54:56.848 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /application/apache-tomcat-8.0.27/webapps/manager has finished in

What is the meaning of “isolated symbol probabilities of English”

感情迁移 提交于 2019-12-06 10:13:20
In a note I found this phrase: Using isolated symbol probabilities of English language, you can find out the entropy of the language. What is actually meant by "isolated symbol probabilities"? This is related to the entropy of an information source. It would be helpful to know where the note came from and what the context is, but even without that I am quite sure this simply means that they use the frequency of individual symbols (e.g. characters) as the basis for entropy, rather than for example the joint probability (of character sequences ), or the conditional probability (of one particular

Incremental entropy computation

与世无争的帅哥 提交于 2019-12-06 09:26:43
Let std::vector<int> counts be a vector of positive integers and let N:=counts[0]+...+counts[counts.length()-1] be the the sum of vector components. Setting pi:=counts[i]/N , I compute the entropy using the classic formula H=p0*log2(p0)+...+pn*log2(pn) . The counts vector is changing --- counts are incremented --- and every 200 changes I recompute the entropy. After a quick google and stackoverflow search I couldn't find any method for incremental entropy computation. So the question: Is there an incremental method, like the ones for variance , for entropy computation? EDIT: Motivation for

Shuffling array based on seed to get always the same result?

你离开我真会死。 提交于 2019-12-06 02:07:13
I need to shuffle an array based on a seed number so I can get the same shuffle if I need it. For example: 1. print_r( shuffleIt( $array, 2 ) ); 2. print_r( shuffleIt( $array, 6 ) ); 3. print_r( shuffleIt( $array, 2 ) ); and 3. would show the same shuffled array but different than 2. I found this function googling: function entropy( $array, $sort_seed ) { mt_srand( $sort_seed ); $order = array_map( create_function( '$val', 'return mt_rand( );' ), range( 1, count( $array ) ) ); array_multisort( $order, $array ); return $array; } It works fine on my pc with php-cli, I always get the same array

How to use GnuPG inside Docker containers, as it is missing entropy?

纵饮孤独 提交于 2019-12-05 17:59:57
问题 I need to dockerize an apt repository. The packages in it need to be signed, which is currently done by aptly publish snapshot -distribution="stable" -gpg-key="<key id>" my-snapshot Before that a key needs to be created using gpg --gen-key . But this way the private key will be crated inside the docker image, which doesn't seem to be a good practice. Besides, id doesn't even work; running gpg --gen-key --batch <gpg.in gets stuck: Not enough random bytes available. Please do some other work to

entropy estimation using histogram of normal data vs direct formula (matlab)

孤街浪徒 提交于 2019-12-05 17:20:21
Let's assume we have drawn n=10000 samples of the standard normal distribution. Now I want to calculate its entropy using histograms to calculate the probabilities. 1) calculate probabilities (for example using matlab) [p,x] = hist(samples,binnumbers); area = (x(2)-x(1))*sum(p); p = p/area; (binnumbers is determined due to some rule) 2) estimate entropy H = -sum(p.*log2(p)) which gives 58.6488 Now when i use the direct formula to calculate the entropy of normal data H = 0.5*log2(2*pi*exp(1)) = 2.0471 What do i do wrong when using the histograms + entropy formula? Thank you very much for any

How is the gradient and hessian of logarithmic loss computed in the custom objective function example script in xgboost's github repository?

北慕城南 提交于 2019-12-05 07:53:45
I would like to understand how the gradient and hessian of the logloss function are computed in an xgboost sample script . I've simplified the function to take numpy arrays, and generated y_hat and y_true which are a sample of the values used in the script. Here is a simplified example: import numpy as np def loglikelihoodloss(y_hat, y_true): prob = 1.0 / (1.0 + np.exp(-y_hat)) grad = prob - y_true hess = prob * (1.0 - prob) return grad, hess y_hat = np.array([1.80087972, -1.82414818, -1.82414818, 1.80087972, -2.08465433, -1.82414818, -1.82414818, 1.80087972, -1.82414818, -1.82414818]) y_true

CFHTTP: first request fast, following slow

自闭症网瘾萝莉.ら 提交于 2019-12-05 04:41:25
I'm having a lot of trouble with CF10's CFHTTP at the moment. First, my test script: <CFSET results = arraynew(1) /> <CFLOOP from="1" to="10" index="idx"> <CFSET timer_start = getTickCount() /> <CFHTTP url="https://www.google.de" method="get" result="test" /> <CFSET arrayappend(results, (getTickCount()-timer_start)/1000 & " s") /> </CFLOOP> <CFDUMP var="#results#" /> 10 CFHTTP calls in a row, the time they take gets pushed to an array; that's all. Results of our CF9 server: Results of our CF10 server: Results of our CF10 server with 5 sec delay between CFHTTP calls: I already read on the forum

Reading entropy_avail file appears to consume entropy [closed]

丶灬走出姿态 提交于 2019-12-05 02:16:22
The question have been asked in here http://www.gossamer-threads.com/lists/linux/kernel/1210167 but I don't see an answer. AFAIK /proc/sys/kernel/random/entropy_avail should return the size of available entropy but should not consume it. At least I don't see any reason for that. However, I have been noticing the same thing as OP for at least a year and now I executed in quick succession % cat /proc/sys/kernel/random/entropy_avail 3918 % cat /proc/sys/kernel/random/entropy_avail 3447 % cat /proc/sys/kernel/random/entropy_avail 2878 % cat /proc/sys/kernel/random/entropy_avail 2377 % cat /proc