Would you use a proportion to solve this problem?

Question: A math class is working with similar figures. Mr. Kole told the class that the surface area of the cones are 180 and 320 square units, and the volume of the smaller cone is 151 cubic units. He challenged his class to find the volume of the bigger cone. What is the volume of the bigger cone?
I tried to use the proportion 320/180 = x/151 to solve the problem. But my answer did not match the correct answer, which is 358 cubic units.
How would you solve this problem?
Comment: Surface areas of similar figures are in proportion to the *squares* of corresponding lines; volumes are in proportion to the *cubes*.
Comment: Are cones open bases or closed?
Answer: Since the cones are similar the ratio of their areas is equal to the square of corresponding lines.  (For example, the height or the radius of the base.)  The ration of those lines is $$a=\sqrt{{320\over180}}=\frac43$$  The ratio of the volume is $a^3$ so the volume of the large cone is $$\left(\frac43\right)^3\cdot151$$
Answer: Well you could use the formulas for the are and volume of cones to figure everything out and I guess that will be enough to solve the problem. However the problem is much more simple than that.
The area scales as a square of the radius $A\propto r^2$ and the volume as the cube $V\propto r^3$. In particular $A^3\propto r^6,\, V^2\propto r^6$, then the quantity
$$
\frac{A^3}{V^2}
$$
is an invariant for similar cones (or any other figure for that mater). And we have
$$
\frac{320^3}{x^2} = \frac{180^3}{151^2}
$$
This should be alright, however I am getting $x=358$ which doesn't seem to be the answer you are getting. Could you please check the numbers?
Comment: Yes. Your answer 358 is right. I made a typo.
Comment: But why did you put $\frac{A^3}{V^2}$? Shouldn't it have been $\frac{A^2}{V^3}$?
Comment: Ah sorry, I went a little fast there. $A^3\propto r^6$ and $V^2\propto r^6$ then the ratio of this two quantities doesn't depend on the radius. $\frac{A^3}{V^2}\sim \frac{r^6}{r^6}\sim \text{constant}$. Look that @saulspatz answer is exactly the same argument.
Answer: No, surface area is not directly proportional to volume.
I would try to construct a cone with surface area $180$ and volume $151$ using the formulas for surface area and volume, in particular keeping track of the ratio between the cone's height and radius.
Then I would construct a cone with surface area $320$ and the same ratio between its height and radius. Finally, apply the volume formula to this larger cone.
Comment: All you need is the ratio of the areas.  The shape of the cone doesn't matter.
Comment: @saulspatz Really? Aren't there infinitely many cones with surface area $320$ but different volumes, depending on their heights and radii? And only one of these will be similar to the smaller cone?
Comment: I guess I assumed the cones being similar was relevant information.
Comment: It *is* relevant.  That why all you need is the ratio of the areas.
Comment: @saulspatz At the first glance I think the ratio alone is not sufficient.
Comment: @callculus We must be talking at cross purposes.  You need the volume of the small cone, and the ratio of the surface areas.  The surface areas themselves are irrelevant.
Comment: @saulspatz You said "All you need is the ratio of the areas", obviously both callculus and I took that as meaning "knowing the ratio alone is sufficient", which we refuted. I get what you mean now though.
Answer: Volumes are proportional to cube and areas to square of linear dimension in similitude.
$$ V = k_1 L^3,\, A = k_2 L^2,\, V = k_3 A^{\frac32} $$
Accordingly the larger Volume is
$$ V_2 = V_1 \big(\frac{320}{180}\big)^ {1.5} =151\times 64/ 27 \approx 357.926 $$
Answer: The similarity of two cones imply:
$$\frac{R_1}{R_2}=\frac{l_1}{l_2}=\frac{h_1}{h_2} \Rightarrow \frac{R_1}{R_2}=\frac{R_1+l_1}{R_2+l_2}$$
The areas of cones:
$$S_1=\pi R_1l_1+\pi R_1^2=180;\\
S_2=\pi R_2l_2+\pi R_2^2=320;\\
\frac{S_1}{S_2}=\frac{\pi R_1(l_1+R_1)}{\pi R_2(l_2+R_2)}=\left(\frac{R_1}{R_2}\right)^2=\frac{180}{320} \Rightarrow \left(\frac{R_1}{R_2}\right)^3=\left(\frac{180}{320}\right)^{3/2}$$
The volumes of cones:
$$V_1=\pi R_1^2h_1=151;\\
V_2=\pi R_2^2h_2;\\
\frac{V_1}{V_2}=\frac{\pi R_1^2h_1}{\pi R_2^2h_2}=\left(\frac{R_1}{R_2}\right)^3=\left(\frac{180}{320}\right)^{3/2}=\frac{151}{V_2} \Rightarrow V_2\approx 357.93.$$


Density of sum of truncated normal and normal distribution

Question: Suppose that $\varepsilon\sim N(0, \sigma_\varepsilon)$ and $\delta\sim N^+(0, \sigma_\delta)$. What is the density function for $X = \varepsilon - \delta$?
This proof apparently appeared in a Query by M.A. Weinstein in Technometrics 6 in 1964, which stated that the density of $X$ is given by
$$f_X(x) = \frac{2}{\sigma} \phi\left(\frac{x}{\sigma}\right) \left(1 - \Phi\left(\frac{x\lambda}{\sigma}\right)\right),$$
where $\sigma^2 = \sigma_\varepsilon^2 + \sigma_\delta^2$ and $\lambda = \sigma_\delta / \sigma_\varepsilon$ and $\phi$ and $\Phi$ are the standard normal density and distribution functions, respectively. However, that paper is very difficult to find online. What is the proof that the density of $X$ takes the above form?
Comment: $\delta$ is skew normal (with infinite skew parameter).  Hence $X$ is also skew normal, see https://stats.stackexchange.com/a/236734/77222,
Comment: @JarleTufto I agree with you, but am reluctant to close because there is nothing in the duplicate thread that explicitly shows this truncated Normal distribution is Skew normal.  If there were, that thread would contain a full and clear answer.
Comment: Why can't you apply the regular convolution formula for the density of a sum (or difference)?
Comment: $\epsilon$ and $\delta$ are independent? For truncated normal, $N^+$ means truncating at 0, so $0\le \delta \lt \infty$?
Comment: @Xi'an I have tried doing that but haven't been able to arrive at the above form. If you can show the steps, please include as an answer.
Comment: @user158565 Yes, that is correct, $\varepsilon$ and $\delta$ are independent and $\delta$ has support on $[0, \infty)$.
Comment: Possible duplicate of [Show that $Y_1+Y_2$ have distribution skew-normal](https://stats.stackexchange.com/questions/235730/show-that-y-1y-2-have-distribution-skew-normal)
Answer: The zero-truncated, zero-mean variable $\delta\sim N^+(0,\sigma^2)$ can be seen as a limiting case of a skew-normal variable since its pdf
$$
f_\delta(\delta)
 =\lim_{\alpha_\delta\rightarrow\infty}\frac2{\sigma_\delta}\phi(\frac\delta{\sigma_\delta})\Phi(\alpha_\delta\sigma_\delta\delta)
$$
(except at $\delta=0$ but this do not matter when $\delta$ is continuously distributed).
Its mgf is given by the same limit of the skew-normal mgf,
\begin{align}
M_\delta(t)
  &=\lim_{\alpha_\delta\rightarrow\infty}2 e^{\sigma_\delta^2 t^2/2}\Phi(\frac{\alpha_\delta}{\sqrt{1+\alpha_\delta^2}}\sigma_\delta t)
\\&= e^{t^2/2}\Phi(\sigma_\delta t).
\end{align}
The rest of the proof is as in the post I link to in the comments.  The mgf of $\varepsilon$ is $M_\varepsilon(t)=e^{\sigma_\epsilon^2 t^2}$ and, because of independence, the mgf of $X = \varepsilon-\delta$ is
\begin{align}
M_{\varepsilon-\delta}(t)
  &=Ee^{(\varepsilon-\delta)t}
\\&=Ee^{\varepsilon t}Ee^{-t\delta}
\\&=M_\varepsilon(t)M_\delta(-t)
\\&=2e^{(\sigma_\delta^2+\sigma_\varepsilon^2) t^2/2}\Phi(-\sigma_\delta t).
\end{align}
This equals the mgf of a skew-normal,
$$
2e^{\mu t+\sigma^2t^2/2}\Phi(\sigma\frac{\alpha}{\sqrt{1+\alpha^2}}t),
$$
with location parameter $\mu=0$, scale parameter $\sigma=\sqrt{\sigma_\delta^2+\sigma_\varepsilon^2}$ and shape parameter $\alpha$ satisfying
$$
-\sigma_\delta=\sqrt{\sigma_\delta^2+\sigma_\varepsilon^2}\frac{\alpha}{\sqrt{1+\alpha^2}}
$$
that is, $\alpha=-\sigma_\delta/\sigma_\varepsilon$.
Answer: Ultimately I needed to work through the algebra a bit more to arrive at the specified form. For posterity, the full proof is given below.
Proof
First consider the distribution function of $X$, which is given by
    $$F(x) = \Pr(X \leq x) = \Pr(\varepsilon - \delta \leq x)$$
$$= \int_{\varepsilon - \delta \leq x} f_\varepsilon(\varepsilon) f_\delta(\delta) d\delta d\varepsilon$$
$$= \int_{\delta\in\mathbb{R}^+} f_\delta(\delta) \int_{\varepsilon\in (-\infty, x + \delta]} f_\varepsilon(\varepsilon) d\varepsilon d\delta.$$
    Substituting in known density functions yields
    $$\int_0^\infty 2\phi(\delta | 0, \sigma_\delta) \int_{-\infty}^{x + \delta} \phi(\varepsilon | 0, \sigma_\varepsilon) d\varepsilon d\delta$$
$$= 2\int_0^\infty \phi(\delta | 0, \sigma_\delta) \Phi(x + \delta | 0, \sigma_\varepsilon) d\delta.$$
    The density of $X$ is then given by
    $$f(x) = \frac{dF}{dx} = 2\int_0^\infty \phi(\delta | 0, \sigma_\delta) \phi(x + \delta | 0, \sigma_\varepsilon) d\delta.$$
    Using Sage to perform this integration, the result is given by
    $$f(x) = -\frac{{\left(\operatorname{erf}\left(\frac{\sigma_{\delta} x}{2 \, \sqrt{\frac{1}{2} \, \sigma_{\delta}^{2} + \frac{1}{2} \, \sigma_{\varepsilon}^{2}} \sigma_{\varepsilon}}\right) e^{\left(\frac{\sigma_{\delta}^{2} x^{2}}{2 \, {\left(\sigma_{\delta}^{2} \sigma_{\varepsilon}^{2} + \sigma_{\varepsilon}^{4}\right)}}\right)} - e^{\left(\frac{\sigma_{\delta}^{2} x^{2}}{2 \, {\left(\sigma_{\delta}^{2} \sigma_{\varepsilon}^{2} + \sigma_{\varepsilon}^{4}\right)}}\right)}\right)} e^{\left(-\frac{x^{2}}{2 \, \sigma_{\varepsilon}^{2}}\right)}}{2 \, \sqrt{\pi} \sqrt{\frac{1}{2} \, \sigma_{\delta}^{2} + \frac{1}{2} \, \sigma_{\varepsilon}^{2}}}.$$
    Defining $\lambda = \sigma_\delta / \sigma_\varepsilon$ and $\sigma^2 = \sigma_\varepsilon^2 + \sigma_\delta^2$, the following can be simplified:
    $$\frac{\sigma_{\delta} x}{2 \, \sqrt{\frac{1}{2} \, \sigma_{\delta}^{2} + \frac{1}{2} \, \sigma_{\varepsilon}^{2}} \sigma_{\varepsilon}} = \frac{\lambda x}{\sigma\sqrt{2}} = \frac{x}{(\sigma / \lambda) \sqrt{2}},$$
$$\frac{\sigma_{\delta}^{2} x^{2}}{2 \, {\left(\sigma_{\delta}^{2} \sigma_{\varepsilon}^{2} + \sigma_{\varepsilon}^{4}\right)}} = \frac{\lambda^2 x^2}{2\sigma^2} = \frac{x^2}{2(\sigma / \lambda)^2}.$$
    Thus,
    $$f(x) = -\frac{\exp\left(\frac{x^2}{2(\sigma / \lambda)^2}\right)\left(\operatorname{erf}\left(\frac{x}{(\sigma / \lambda) \sqrt{2}}\right) - 1\right)\exp\left(-\frac{x^2}{2\sigma_\varepsilon^2}\right)}{\sigma\sqrt{2\pi}}$$
$$= -\frac{\left(\operatorname{erf}\left(\frac{x}{(\sigma / \lambda) \sqrt{2}}\right) - 1\right) \exp\left(-x^2\left(\frac{1}{2\sigma_\varepsilon^2} - \frac{1}{2(\sigma / \lambda)^2}\right)\right)}{\sigma\sqrt{2\pi}}.$$
    Now,
    $$\operatorname{erf}\left(\frac{x}{(\sigma / \lambda) \sqrt{2}}\right) - 1 = \left(1 + \operatorname{erf}\left(\frac{x}{(\sigma / \lambda) \sqrt{2}}\right)\right) - 2 = 2\left(\frac{1}{2}\left(1 + \operatorname{erf}\left(\frac{x}{(\sigma / \lambda) \sqrt{2}}\right)\right) - 1\right)$$
$$= 2\left(\Phi\left(\frac{x\lambda}{\sigma}\right) - 1\right) = -2\left(1 - \Phi\left(\frac{x\lambda}{\sigma}\right)\right).$$
    Also,
    $$\frac{1}{2\sigma_\varepsilon^2} - \frac{1}{2(\sigma / \lambda)^2} = \frac{1}{2\sigma_\varepsilon^2} - \frac{\sigma_\delta^2}{2\sigma_\varepsilon^2(\sigma_\delta^2 + \sigma_\varepsilon^2)} = \frac{\sigma_\delta^2 + \sigma_\varepsilon^2 - \sigma_\delta^2}{2\sigma_\varepsilon^2(\sigma_\delta^2 + \sigma_\varepsilon^2)} = \frac{\sigma_\varepsilon^2}{2\sigma_\varepsilon^2(\sigma_\delta^2 + \sigma_\varepsilon^2)} = \frac{1}{2\sigma^2}.$$
    So,
    $$f(x) = 2\left(1 - \Phi\left(\frac{x\lambda}{\sigma}\right)\right)\frac{\exp\left(-\frac{x^2}{2\sigma^2}\right)}{\sigma\sqrt{2\pi}} = 2\left(1 - \Phi\left(\frac{x\lambda}{\sigma}\right)\right) \phi(x | 0, \sigma) = \frac{2}{\sigma}\phi\left(\frac{x}{\sigma}\right) \left(1 - \Phi\left(\frac{x\lambda}{\sigma}\right)\right).$$


Why drop caches in Linux?

Question: In our servers we have a habit of dropping caches at midnight.
sync; echo 3 > /proc/sys/vm/drop_caches

When I run the code it seems to free up lots of RAM, but do I really need to do that. Isn't free RAM a waste?
Comment: Find the person who put this in and ask him why he did it. As you correctly guessed, there is no obvious good reason for it.
Comment: @ivcode Then you should find and fix the problem with that server rather than trying to avoid the conditions that cause it. If my car stalled every time I made a sharp right turn, avoiding sharp right turns is a lousy fix.
Comment: Debugging the kernel. That's about it. This doesn't actually free up any RAM; it drops caches, as the name suggests, and thus reduces performance.
Comment: Related http://thedailywtf.com/Articles/Modern-Memory-Management.aspx Strongly arguing it's a bad idea.
Comment: Related, and a useful description of the "problem": http://www.linuxatemyram.com/
Comment: It's probably "system guano". The person who put it there may not remember why it's there, or if it works, or why it works if it works. Maybe nobody knows why it's there. It remains because "if it works, don't break it". In systems with poor configuration control this crap accumulates. The long-term answer is to improve configuration/change/revision management for your systems.  A configuration management system like CFEngine, Chef or Puppet won't stop you from doing some stupid things, but you'll have to be _consistently_ stupid, which (we hope) is more likely to be caught and dealt with.
Comment: `sudo killall -r .*` also frees a lot of memory
Comment: That person is no longer employed. So I can't ask him. When I ask others, they said it is good practice to free up ram but I don't see the point. What are the cases that I should use above code anyway?
Comment: @EkriirkE to cut data losses only `sync` would be sufficient, dropping caches is a no-op for this purpose.
Comment: BTW we have a server on VMware that don't have lot of memory and we have a cronjob monitoring it's ram with `vmstat 2 3|tail -1|awk '{print $4}'` when the value reduces more than some amount it drops caches otherwise server will hang
Comment: @Max `sudo killall -s KILL -r .*` ;)
Comment: Thank you so much @David for your clear explanations. This made me taking the matter to the software developer rather than finding quick fixes
Comment: I can guess only that perhaps it was a measure to cut data losses, maybe because of frequent crashing/panics/power loss
Comment: perhaps the person who put that in is Patrick R: http://serverfault.com/questions/105606/deleting-linux-cached-ram
Answer: You are 100% correct. It is not a good practice to free up RAM. This is likely an example of cargo cult system administration.
Comment: +1 for mentioning Cargo Cult System Administration. Any sysadmin who doesn't know that term and what it means should be fired.
Comment: @Tonny: We would be left without sysadmin department then :(
Comment: Like most of humanity, I love terse brash assertions with lots of approval, but a cite or reasoning would earn my superego's +1.
Comment: Explain the cargo-cult administration, as well as the above, if you don't mind. Maybe in a follow-on edit? I'm still withholding my +1... :P
Comment: "its possible that though your application may not be using these RAM but Linux is caching aggressively into its memory and even though the application needs memory it wont free some of these cache but would rather start swapping." Not very specific.  In practice, memory management isn't perfect, and having a knob to turn when that imperfection shows up is a good thing.
Comment: Caching aggressively is a win.  Caching so aggressively that your application starts to swap...not so much.
Comment: @AaronHall For RAM to provide any benefit, it must be used. It's the RAM your system is *using* that is improving its performance.
Comment: @Tonny "I left that place after 3 months and I swore NEVER to do that again" sounds like cargo-cult employer selection to me :)
Comment: SUSE recommends this method to try to deal with memory pressure.  https://www.suse.com/communities/blog/sles-1112-os-tuning-optimisation-guide-part-1/
Comment: @PlasmaHH Unfortunately that is the situation most us find themselves in... The one thing worse than a sysadmin who doesn't know about CargoCult is an ICT manager who doesn't know AND is who runs his department like CargoCult. I worked for such a one once upon a time. I left that place after 3 months and I swore NEVER to do that again. (They went bankrupt 7 months later... Partly due to ICT mismanagement breaking their Sales system beyond repair.)
Comment: @qris Yes, maybe. In my defense: It was my first job out of university and I didn't know any better. I was just glad to have a job and initially it looked good. It was a very frustrating experience at the time, but in hindsight it was highly educational.
Comment: @DanPritts That's pretty depressing. Even more depressing, they don't explain what the "issue" is that they claim it deals with.
Comment: @DanPritts That's not an imperfection. That's a huge win. That way, if you do run into memory pressure, you don't have to write out pages then, you can just discard them.
Comment: The world is more dirty now, how does all of this sit in the hyper converged world where you have ballooning vms sat ontop of heavily cached file systems and block storage?
Comment: Try using ubuntu and see how nice it is for you ram cache to be at 20GB and have application hang because there is not enough free ram.
Comment: @DanPritts That's incorrect. The earlier you start swapping the better because earlier on, the extra I/O has no effect on performance because you aren't I/O limited. By the time you actually need to swap, you *are* I/O limited. So it's a huge win to have written stuff out already so you can discard it from RAM without having to write it out when I/O is precious.
Comment: Interesting point - having it written to swap but still "cached swap" is certainly reasonable.  That isn't what I meant, though.  An imbalance between application memory and disk cache is a bad thing, as you surely understand.
Answer: Yes, clearing cache will free RAM, but it causes the kernel to look for files on the disk rather than in the cache which can cause performance issues.
Normally the kernel will clear the cache when the available RAM is depleted. It frequently writes dirtied content to disk using pdflush.
Comment: +1 for explaining *why* it's a bad idea.
Comment: @ananthan - A post on `rsync` suggests dropping caches - https://unix.stackexchange.com/a/510800
Comment: @Motivated And it makes some sense if you do not trust your memory fully (i.e. non-ecc RAM may have a flipped bit in the cache segments), but not for speeding up things, but to minimize the chance that memory errors change your rsync results. On a server with ecc memory, the chances of that happening is so astronomically low that you should not bother.
Answer: The reason to drop caches like this is for benchmarking disk performance, and is the only reason it exists.
When running an I/O-intensive benchmark, you want to be sure that the various settings you try are all actually doing disk I/O, so Linux allows you to drop caches rather than do a full reboot.
To quote from the documentation:

This file is not a means to control the growth of the various kernel
  caches (inodes, dentries, pagecache, etc...)  These objects are
  automatically reclaimed by the kernel when memory is needed elsewhere
  on the system.
Use of this file can cause performance problems.  Since it discards
  cached objects, it may cost a significant amount of I/O and CPU to
  recreate the dropped objects, especially if they were under heavy use.
  Because of this, use outside of a testing or debugging environment is
  not recommended.
Comment: The obvious case is when you want to clear out RAM to allow the allocation of more (non-trnsparent) hugepages; another case is transparent hugepage garbage collection pause bugs (see my answer/comments elsewhere on this question).  But my comment was intended for the general case.  Sometimes the people who are operating the system know better than the people who designed/implemented it.  Often, not - that's what their comment is trying to protect against.  I'm just glad that the
Comment: "these objects are automatically reclaimed by the kernel when memory is needed" is the design goal but it might not always be the actual behavior.
Comment: Of course, depending on what you are trying to do, even a full reboot might not sufficiently clear the disk cache.
Comment: @DanPritts What precisely makes you think it's not so?
Answer: The basic idea here is probably not that bad (just very naive and misleading): There may be files being cached, that are very unlikely to be accessed in the near future, for example logfiles. These "eat up" ram, that will later have to be freed when necessary by the OS in one or another way.
Depending on your settings of swappiness, file access pattern, memory allocation pattern and many more unpredictable things, it may happen that when you don't free these caches, they will later be forced to be reused, which takes a little bit more time than allocating memory from the pool of unused memory. In the worst case the swappiness settings of linux will cause program memory to be swapped out, because linux thinks those files may be more likely to be used in the near future than the program memory.
In my environment, linux guesses quite often wrong, and at the start of most europe stock exchanges (around 0900 local time) servers will start doing things that they do only once per day, needing to swap in memory that was previously swapped out because writing logfiles, compressing them, copying them etc. was filling up cache to the point where things had to be swapped out.
But is dropping caches the solution to this problem? definetly not. What would be the solution here is to tell linux what it doesn't know: that these files will likely not be used anymore. This can be done by the writing application using things like posix_fadvise() or using a cmd line tool like vmtouch (which can also be used to look into things as well as cache files).
That way you can remove the data that is not needed anymore from the caches, and keep the stuff that should be cached, because when you drop all caches, a lot of stuff has to be reread from disk. And that at the worst possible moment: when it is needed; causing delays in your application that are noticeable and often unacceptable.
What you should have in place is a system that monitors your memory usage patterns (e.g. if something is swapping) and then analyze accordingly, and act accordingly. The solution might be to evict some big files at the end of the day using vtouch; it might also be to add more ram because the daily peak usage of the server is just that.
Comment: @ivcode If you don't need the output from `nohup` you should re-direct it to `/dev/null`.  It sounds like you had some very inexperienced sysadmins working on your systems at some point.  See http://stackoverflow.com/questions/10408816/how-to-use-unix-command-nohup-without-nohup-out for how to direct `nohup`'s output to `/dev/null`
Comment: All the apps on my server is running on nohup. Maybe nohup.out is being cached and eating up memory?
Comment: @ivcode: This could be a reason, check how big nohup.out is. Maybe use vmtouch to figure out how much of it is cached.
Comment: I have a cron job to `cat /dev/null > path/nohup.out` in every 15 minutes as nohup.out is growing rapidly. Maybe linux is caching nohup.out even if I'm clearing it
Comment: although nohup.out is cleared in 15 min intervals, if apps process got killed for some reason, nohup.out will be automatically backedup from another script. i tried vmtouch. it's a very good tool indeed
Comment: +1 for a more in-depth explanation.
Answer: I have seen drop caches to be useful when starting up a bunch of virtual machines. Or anything else that uses Huge Pages such as some database servers.
Huge Pages in Linux often need to defrag RAM in order to find 2MB of contiguous physical RAM to put into a page. Freeing all of the file cache makes this process very easy.
But I agree with most of the other answers in that there is not a generally good reason to drop the file cache every night.
Comment: Also, in HPC applications on high-memory nodes (1Tb), reading in a few large files results in a large amount of memory cached. Because many HPC applications perform malloc's of hundreds of GB, the system can stall for hours as migration processes move tiny chunks of fragmented memory fruitlessly across NUMA nodes once the system reaches the cached memory "border". Worse, nothing you can do in userland to free the caches except trick the system into allocating all the tiny 2MB blocks it can at once then releasing, letting hugepaged defrag and the apps run normally.
Comment: I upvoted for pointing out second order prejudice is responses to drop caches.
Comment: +1 The command to create large pages (`sysctl -w vm.nr_hugepages=...`) refuses to even work unless I first drop caches (Arch linux).
Answer: It is possible that this was instituted as a way to stabilize the system when there was no one with the skills or experience to actually find the problem.
Freeing resources
Dropping caches will essentially free up some resources, but this has a side effect of making the system actually work harder to do what it is trying to do.  If the system is swapping (trying to read and write from a disk swap partition faster than it is actually capable) then dropping caches periodically can ease the symptom, but does nothing to cure the cause.
What is eating up memory?
You should determine what is causing a lot of memory consumption that makes dropping caches seem to work.  This can be caused by any number of poorly configured or just plain wrongly utilized server processes.  For instance, on one server I witnessed memory utilization max out when a Magento website reached a certain number of visitors within a 15 minute interval.  This ended up being caused by Apache being configured to allow too many processes to run simultaneously.  Too many processes, using a lot of memory (Magento is a beast sometimes) = swapping.
Bottom Line
Don't just assume that it is something that is necessary.  Be proactive in finding out why it is there, have the guts to disable it if others suggest it is wrong, and observe the system - learn what the real problem is and fix it.
Answer: Linux/m68k actually has a kernel bug which causes kswapd to go crazy and eat up 100% CPU (50% if there's some other CPU-bound task, like a Debian binary package autobuilder – vulgo buildd – running already), which can (most of the time; not always) be mitigated by running this particular command every few hours.
That being said… your server is most likely not an m68k (Atari, Amiga, Classic Macintosh, VME, Q40/Q60, Sun3) system ;-)
In this case, the person who put in the lines either followed some questionable or, at best, outdated advice, or got the idea about how RAM should be used wrong (modern thinking indeed says "free RAM is RAM wasted" and suggests caching), or "discovered" that this "fixes"[sic!] another problem elsewhere (and was too lazy to search for a proper fix).
Comment: @Fernando I have a "drop caches" cronjob on the m68k box as well ☹
Comment: I'm experiencing a similar issue ( although it's x86_64 ) and the only solution at this moment is to drop caches http://serverfault.com/questions/740790/kswap-using-100-of-cpu-even-with-100gb-of-ram-available
Comment: "a kernel bug which causes kswapd to go crazy" - Which bug is this?
Comment: @Ben see [this thread](http://thread.gmane.org/gmane.linux.debian.ports.68k/12193/focus=12199) (this message and a couple of followups, one of which includes a guess where it could come from)
Answer: I can think of one plausible reason to do this in a nightly cron job.
On a large system, it may be useful to periodically drop caches so you can remove memory fragmentation.
The kernel transparent hugepage support does a periodic sweep of memory to coalesce small pages into hugepages. Under degenerate conditions this can result in system pauses of a minute or two (my experience with this was in RHEL6; hopefully it's improved). Dropping caches may let the hugepage sweeper have some room to work with.
You might argue that this is a good reason to disable transparent hugepages; OTOH you may believe that the overall performance improvement from transparent hugepages is worth having, and worth paying the price of losing your caches once a day.

I've thought of another reason you would want to do it, although not in a cron job.  Right before a virtualization system migrates a VM to new hardware would be a very good time for this.  Less memory contents to copy to the new host.  You'll eventually have to read from the storage, instead, of course, but I'd probably take that tradeoff.
I don't know if any of the virt software actually does this.
Comment: I have personal experience with the pauses with transparent hugepages.  RHEL6, Dell R810, 4CPUs, 64GB RAM.  Disabling transparent hugepages (there's a /proc file to do so) immediately fixed the pauses.  I didn't try the cache drop technique at the time; instead I reconfigured our java apps to use non-transparent hugepages, and left transparent hugepages disabled.    IIRC, we looked into the situation enough to realize that we weren't the only people affected, and that Red Hat knew about the issue.
Comment: Do you have any source for this? This sounds like something that should be fixed in the kernel if it's such an issue.
Comment: https://access.redhat.com/solutions/46111 describes it.  You can disable transparent hugepages to see if that is the problem in your case.
Comment: Hello Dan, I constat the same behaviour on my server. I work, with a huge amount of data, and there is drastic performance fall after 10+ computations of a same python program (x2-3 of the first computation time). If I take a look, memory cache size is huge, 100+GB. And If I flush this memory cache, and re-run my program, I get back my initial computation time. Do you have any document or info, to share about this phenomenon? Thank You.
Answer: One reason might be the site is running some kind of monitoring, that checks the amount of free ram and sends a warning to administrators when free ram drops below a certain percentage. If that monitoring tool is dumb enough not to include cache in the free ram calculation, it might send false warnings; regularily emptying the cache could suppress these warnings while still allowing the tool to notice when "real" ram gets low.
Of course, in this kind of situation, the real solution is to modify the monitoring tool to include cache in the free ram calculation; cleaning the cache is just a workaround, and a bad one as well, because the cache will refill quickly when processes access the disk.
So even if my assumption is true, the cache-cleaning is not something that makes sense, it's rather a workaround by someone who isn't competent enough to fix the primary problem.
Answer: Just to add my two cents: The system knows very well that these memory pages are caches, and will drop as much as needed when an application asks for memory.
A relevant setting is /proc/sys/vm/swappiness, which tells the kernel during new memory allocations to prefer to drop memory caches or to swap "idle" allocated memory pages.
Answer: The question is from 2014, but as the problem exists to this day on some hidden centos 6.8 backends, it may still be useful for  someone.
https://github.com/zfsonlinux/zfs/issues/1548
describes an issue with zfs. There, disk space isn't freed for deleted files because if nfs is used on top of zfs the file's inodes aren't dropped from the kernel's inode cache.
To quote from the bug thread,
behlendorf, Jan 6 2015 wrote:

The current speculation is that for some reason the NFS server is
  keeping a cached version of the file handle. Until the NFS server
  drops this file handle ZFS can't unlink this file. Some light testing
  has shown that dropping caches on the server will cause this reference
  to be dropped (like the NFS file handle) at which point the space is
  correctly freed. Memory pressure can also cause it to be dropped.

i.e. a nightly echo 3 > /proc/sys/vm/drop_caches is the easiest fix for that bug if you don't want to have a downtime for restructuring your zfs.
So maybe not cargo cult admining, but some pretty good debugging was the reason.
Answer: It's old, and refer to the most accepted answers/response for why not to do it, but there is one place that I've seen this as a requirement inside the guest : a hosting provider (name not mentioned) that provides very cheap VMs, but they appears to be heavily oversubscribing, and uses this to keep their systems "usable", ie. you don't have very fast IO all the time, and they clean the caches to not do things like a ballooning driver. This goes that mostly people don't use more than a fraction of the RAM allocated, thus by cleaning the caches (frequently) they keep the actual RAM usage in the guests and thus the host as low as possible. ie. more VMs less physicals, more income
Answer: This may make sense on NUMA (non uniform memory access) systems, where, typically, each CPU (socket) can access all the memory transparently but its own memory can be accessed faster than other socket's memory, in association with parallel HPC applications.
Many simple parallel applications tend to do file I/O from a single process, thus leaving on exit a big fraction of memory on a single NUMA node allocated to disk cache, while on the other NUMA node the memory may be mostly free. In these situations, since the cache reclaiming process in the Linux kernel, as far as I know, is still not NUMA-aware, processes running on the NUMA node which has memory allocated to cache are forced to allocate memory on the other NUMA node, as long as there is free RAM on the other node, thus killing the performances.
However, in an HPC system, it would be wiser to clean cache before starting a new user job, not at a specific time with cron.
For non parallel applications this problem is unlikely to arise.
Answer: When your page cache is quite large (a lot larger than your current swap usage), and swap in and swap out happens in turns, this is when you need to drop caches.
I have seen cases where memory usage increases in one of my MariaDB database servers running Ubuntu 16.04LTS, and Linux just chose to increase swap usage instead of removing unused page caches. Transparent hugepages already disabled in my system because TokuDB required it to be disabled.
Anyway maybe it is not a bug, but linux still doing this behaviour is quite puzzling to me. Various sources stated that Linux would remove page cache when application requested it :

https://www.linuxatemyram.com/
https://www.thomas-krenn.com/en/wiki/Linux_Page_Cache_Basics

But the reality is not that simple. The workaround is either :

Execute drop cache periodically
Execute drop cache when needed (monitor using vmstat 1 for swapping out activities)
Advise linux to remove certain files from cache (like apache log files) using utility such as dd or python-fadvise. See https://unix.stackexchange.com/questions/36907/drop-a-specific-file-from-the-linux-filesystem-cache

Example dd run :
dd if=/var/log/apache2/access_log.1 iflag=nocache count=0
Example python-fadvise :
pyadvise -d /var/log/apache2/access_log.1
Answer: When your page cache is quite large (a lot larger than your current swap usage), and swap in and swap out happens in turns, this is when you need to drop caches. I have seen cases where memory usage increases in one of my MariaDB database servers running Ubuntu 16.04LTS, and Linux just chose to increase swap usage instead of removing unused page caches.
Comment: Swap use is *not* bad. If it's unused stuff that belongs to sleeping processes, why not move it to swap?
Answer: I have a desktop machine with 16GB of RAM running on PAE kernel. After a an hour or two the disk performance degrades dramatically until I drop the caches so I simply put it into cron. I don't know if this is a problem with PAE kernel or with the cache implementation being so slow if there is plenty of memory.
Comment: This is a prime example of the "cargo cult" system administration: rather than locating and solving the problem, you are simply masking it.
Comment: Sometimes the expedient solution is the right one.  It might just be putting off resolving the real problem, or it might be as much solution as is required in the circumstances.  Even if it's bad practice, it's still not "cargo cult."  There's a demonstrated cause and effect: drop caches and disk performance improves.
Comment: Part of the original definition of CCSA was a tendency to mistake correlation for causation, and here we are. Masking a problem by addressing a correlated but not causal entity is suboptimal problem-solving, which is what the concept of CCSA is trying to warn against.

Why drop caches in Linux?


taxonomy manager

Question: I want to allow users to add taxonomy terms for a particular taxonomy.
I added a menu item to link to the taxonomy manager. The problem is -

I'm not able to restrict the user to add terms to only one taxonomy (based on his role).
Alternatively, I tried to hide "switch vocabulary" drop down by editing the theme css (not module css. I want the behavior to be same even after module updates). That didn't work either.

Any suggestions on -

how to give users access to add taxonomy terms. (or)
restrict access in taxonomy manager (or)

Thanks
Comment: are you linking these tax terms to nodes?
Comment: While creating nodes, yes. But not while creating the terms. Does that make sense ??
Comment: did you try my 2nd answer? (the module)
Comment: I did. The module didn't seem to work for me.
Answer: If you add a Term Reference field to your node with auto complete widget
When you type something that is not in the vocabulary, it will auto create/add it to your vocabulary as a new tax term when you hit save node.
Comment: Thank you. But I want to separate out adding terms/adding nodes. Any suggestions?
Answer: Vocabulary Permissions Per Role module.

You have set up some vocabularies (with some terms) like Color (Red,
  Green, Blue) and Shape (Toroid, Cube, Sphere). Maybe you even have a
  vocabulary that controls who can view a specific node (with terms)
  like Access control (Editors, Colleagues, World). Here comes trouble:
  your precious editors want to add more Colors, or reorder the terms of
  the Shape vocabulary (probably they want to see Sphere before Cube,
  who knows,) and you do NOT want to grant your editors the administer
  taxonomy permission, as it grants too much power (and that implies too
  much sharing of responsibility). Without this permission they were NOT
  able to do the mentioned tricks: adding terms to a vocabulary but not
  to another, reordering/editing terms of a vocabulary but not
  another's, etc.

Looks like this does exactly what you need.

taxonomy manager


Nets/Filters vs. Sequences in convergence in the product topology

Question: In this previous question it is asked how to prove, given a sequence $x_1,x_2, \ldots$ of points in a product space $\prod X_\alpha$, that the sequence converges to the point $x$ if and only if the sequence $\pi_\alpha (x_1), \pi_\alpha (x_2)\ldots$ converges to $\pi_\alpha (x)$ for each $\alpha$.

Question:
  Are we actually allowed to talk about a sequence of points in the product topology?

The point is that I think we can, if we assume that the topological spaces are – for example – metrizable. However, in the general case we should rather talk about nets or filters. Am I right?
Notice that this question arises because in Munkres it is proved by means of sequences, but in Willard by means of nets, which I think should be conceptually more appropriate.
Any feedback is most appreciated.
Thank you for your time.
Answer: A sequence $\{x_n\}$ converges to a point $x$ if, for each open set $U$ containing $x,$ we have $x_n\in U$ for all sufficiently large $n.$ This definition is topological; it makes sense in any topological space.
It is true that sequential convergence does not have the same significance in general topological spaces as it does in metric spaces. For example, in a topological space, you may not be able to get the closure of a set by taking all limits of convergent sequences in the sets. But this does not mean that sequential convergence is of no use at all in general topology, and it certainly does not mean that you aren't allowed to talk about sequences. (Especially if you happen to live in the United States, where he have something called the First Amendment.)
In your question, I don't know what is the "it" which Munkres proves by means of sequences and Willard proves by means of nets. A proof is a proof, and if you can prove something just using sequences, that seems preferable to a proof of the same thing using nets. But maybe you meant to say that Willard proves some statement about nets and Munkres only proved it for the special case of sequences?
Comment: Thanks a lot! I do see the point now (indeed I meant what you write in your very last statement, and now I see what I was missing).


Accessing the next row in datatable

Question: I am trying to access and change the value of the next row in a datatable using a for loop but I get the error:
System.IndexOutOfRangeException: There is no row at position 247.

I know that in the final loop, it wont find the next row. But Im checking it if it exists and then only modify the values, but it's not working.
Here is my code:
for (int i = 0; i < dt.Rows.Count; i++)
{
  DataRow _row = dt.Rows[i];
  if (_row[1].ToString() != "" && _row[0].ToString() != "")
  {
    int temp = i + 1;
    if (dt.Rows[temp].GetType() == typeof(DataRow))
    {
        dt.Rows[temp][0] = _row[0].ToString();
     }
   }
 }

Any help would be appreciated.
Thanks.
Comment: Why not just loop up until `Rows.Count - 1`, then you don't have to check if there's a next row, since there always will be.
Answer: This fails because there is no row to get, so it fails even before the call to GetType:
if (dt.Rows[temp].GetType() == typeof(DataRow))
//  ^^^^^^^^^^^^^  <-- throws an IndexOutOfRangeException here

Instead you can iterate to one less than the number of rows:
for (int i = 0; i < dt.Rows.Count - 1; i++)
{
    DataRow row = dt.Rows[i];
    DataRow nextRow = dt.Rows[i + 1];
    // ...
}

If you want to do something special for the last row, you can do that after the loop.

Accessing the next row in datatable


Analysis of the problem

Question:
Let $ M $ be the set of all functions $ f $ twice differentiable on $ [0,1] $ such that $ f (0) = f (1) = 0 $ and $ | f '' (x) | \leq 100 $. Find $ \max\limits_ {f \in M} \max\limits_ {x \in [0,1]} | f '(x) | $

I think that the condition of this problem is equivalent to the fact that we maximize the $\sup$ norm of the derivative f from this set. As a maximizing function, we can take a polynomial of the second degree with roots at $0$ and $1$
I got an answer of 50, if I said everything correctly and decided
I took it turns out a polynomial of the second degree, in which the roots are $0$ and $1$, then $P (x) = ax (x-1)$, $a> 0$. Now $| P "(x)| = 2, a  \leq 100$. Take as $a^* = 50$. With this $a^*$ the maximum of the second derivative of P will be achieved, that we and it is necessary. So the maximizing function is found. It's just $50x (x-1)$. The norm of the derivative is $50$
Comment: The title of this question gives no information about the problem. Please edit the title into something more helpful.
Answer: This is a nice puzzle at the calculus level.  Since nobody seems interested in helping here is my advice.
First of all your answer is perfect for half of the problem, but missing a key half.  You show that this maximum is at least as big as 50.  You don't prove that it cannot be any larger.
Here is a sketch that you can flesh out with appropriate computation.
Preliminaries.   If $f\in M$ first note that $f(0)=f(1)$ implies there is a number
$c$ so that  $f'(c)=0$.  Moreover, this also implies that
$$0 = f(1)-f(0) = \int_0^1 f'(t)\,dt  = \int_0^c f'(t)\,dt + \int_c^1 f'(t)\,dt $$
and hence
$$\int_0^c f'(t)\,dt = - \int_c^1 f'(t)\,dt \tag{1}.$$
Step 1.  Consider the case  $c=\frac12$.  The condition $|f''(x)|\leq 100$ and the mean-value theorem applied on $[0,\frac12]$ and on $[\frac12,1]$ shows that
$|f'(x)|\leq 50$ for all values of $x$ in $[0,1]$.
But your most excellent example $p(x)=50x(1-x)$ has $p'(x) = 100x -50$, $p''(x)=100$, $p'(0)=-50$, and $p'(1)=50$.
Thus the value $50$ is attained by at least one function.
Step 2.  Consider the case $c> \frac12$.  By the mean-value theorem as before we must have $|f'(x)|<50$ for all $x$ in $[c,1]$.
But if there is a value $x_0$ in $[0,c]$ with $f'(x_0)> 50$  it must be the case,
since $|f''(x)|\leq 100$,   that
$$ \int_0^c f'(x) > \left|\int_c^1 f'(x)\right|.$$
This contradicts (1) above.
Step 3.  The case $c< \frac12$ is simiilar.
Thus no value of $|f'(x)|$ larger than $50$ can  occur if $c\not=\frac12$. We have already checked that the value $50$ is the largest possible for the case $c=\frac12$  and is actually attained for the function $p(x)$ given.

Analysis of the problem


Find median in binary search tree

Question: Write the implementation of the function T ComputeMedian() const that computes the median value in the tree in O(n) time. Assume that the tree is a BST but is not necessarily balanced. Recall that the median of n numbers is defined as follows: If n is odd, the median is x such that the number of values smaller than x is equal to the number of values greater than x. If n is even, then one plus the number of values smaller than x is equal to the number of values greater than x. For example, given the numbers 8, 7, 2, 5, 9, the median is 7, because there are two values smaller than 7 and two values larger than 7. If we add number 3 to the set, the median becomes 5.
Here is the class of binary search tree node:
template <class T>
class BSTNode
{
public:
BSTNode(T& val, BSTNode* left, BSTNode* right);
~BSTNode();
T GetVal();
BSTNode* GetLeft();
BSTNode* GetRight();

private:
T val;
BSTNode* left;
BSTNode* right;
BSTNode* parent; //ONLY INSERT IS READY TO UPDATE THIS MEMBER DATA
int depth, height;
friend class BST<T>;
};

Binary search tree class:
template <class T>
class BST
{
public:
BST();
~BST();

bool Search(T& val);
bool Search(T& val, BSTNode<T>* node);
void Insert(T& val);
bool DeleteNode(T& val);

void BFT(void);
void PreorderDFT(void);
void PreorderDFT(BSTNode<T>* node);
void PostorderDFT(BSTNode<T>* node);
void InorderDFT(BSTNode<T>* node);
void ComputeNodeDepths(void);
void ComputeNodeHeights(void);
bool IsEmpty(void);
void Visit(BSTNode<T>* node);
void Clear(void);

private:
BSTNode<T> *root;
int depth;
int count;
BSTNode<T> *med; // I've added this member data.

void DelSingle(BSTNode<T>*& ptr);
void DelDoubleByCopying(BSTNode<T>* node);
void ComputeDepth(BSTNode<T>* node, BSTNode<T>* parent);
void ComputeHeight(BSTNode<T>* node);
void Clear(BSTNode<T>* node);

};

I know I should count the nodes of the tree first and then do an inorder traversal until I reach (n/2)th node and return it. I just have no clue how.
Comment: In the case of a list, you'd have to start pointers at both ends and work inwards to find the median.   But since your tree is not balanced, the worst case reduces to a linked list.  Therefor you cannot avoid doing exactly the same.  Start pointers at the min and max values, and alternately compute inorder-successor(min) and inorder-predecessor(max) until the are equal.
Comment: @BadZen I am not quite familiar with the "inorder-predecessor".. Could you please explain furthermore?
Comment: Next() and Prev() tree values.
Answer: As you mentioned, it is fairly easy to first find the number of nodes, doing any traversal:
findNumNodes(node):
   if node == null:
       return 0
   return findNumNodes(node.left) + findNumNodes(node.right) + 1

Then, with an inorder traversal that aborts when the node number is n/2:
// index is a global variable / class variable, or any other variable that is constant between all calls
index=0
findMedian(node):
   if node == null:
       return null
   cand = findMedian(node.left)
   if cand != null:
        return cand
   if index == n/2:
       return node
   index = index + 1
   return findMedian(node.right)

The idea is that in-order traversal processes nodes in BST in sorted manner. So, since the tree is a BST, the ith node you process, is the ith node in order, this is of course also true for i==n/2, and when you find it is the n/2th node, you return it.

As a side note, you can add functionality to BST to find ith element efficiently (O(h), where h is the tree's height), using order statistics trees.
Comment: thank you for the reply, but I already thought of this. My problem is that my function should look like this `T ComputeMedian() const` so as you can see, it has no parameters (I will edit my post now)
Is it possible to do it like this
    `template
     T BST::ComputeMedian() const
     {
        ComputeMedian(root);
      }`

And I implement `ComputeMedian(BSTNode* node)` just as you said? Will this still be a O(n)?
Comment: @NataliAyoub Yes, you are just wrapping it up with constant operations.
Comment: I just edited my post and added the code along with the errors, could you please check it and tell me what's wrong?
Comment: @NataliAyoub It is out of scope of the original question, you should roll back to previous version, and ask a new question - linking to this one and stating what you have done since, and what is the new problem you encounter.
Comment: @NataliAyoub The new question is as it sounds  - a new question. I removed the edits and got the question back to its original state. You should ask the new question, with how to handle the errors you have, in a new question.
Comment: oh lol excuse my ignorance, new here :P how do I roll back to the original post?

Find median in binary search tree


How to set the visibility rule for pane to not show up when any user is logged in?

Question: I have created three panes (as shown below) using Mini Panel module. as named below,
Login/Register  |   Username  |  Logout
This I want to keep at the top left of website. Now, how each pane is created

Login/Register: Created menu and added link named Login/Register and have given the path /user. So, it leads to login page.
Username: This I created using the Views, a block created of users and filter was given that the user is logged in. hence it will automatically show up only when the user is logged in.
Logout: This I created using menu, with name Logout and path user/logout, hence when it gets clicked the user gets logout and this pane disappears automatically.
When users are logged-in, only the Username and Logout pane should appear; hence, users can see their profile by clicking on their name, or they can log out. When users log out, this pane disappears.
When user are not logged-in, only the Login/Register pane should appear.

So, the Username and Logout pane works perfectly fine.
What SELECTION rule shall I give to the Login/Register pane, so it gets visible only to anonymous users?
Answer: While adding a Visibility rule to the pane, select User:Role and then select "anonymous". This way the pane will be shown only to anonymous (not logged in) users.
Comment: omg, how this simple thing did not clicked in my mind, even I was familiar with this logic...:) Sometime we start thinking too much and just over look very simple way of doing that. Anyway, Very thanks. Just I checked it is working.


Sealing Tiles and Cable routes in datacenter fire supression

Question: I've been given the task of moving a small datacenter (3 Racks) into a new building where a server room was built with water sprinklers.  The issue was raised and the contractor changed it to an FM200 system.  I'm not sure who hired these guys or what the outcome will be b/c they have turned to me to find out how to seal the cable routes going into the ceiling (seems like they should know this?).
Essentially we have a cable ladder going from the racks to the wall and all the cables are bundled into 2 x 3 or 4 inch bundles passing through a ceiling tile.
The contractors idea was to form a 'collar' to wrap around each bundle with pvc piping and fill it with foam... I've seen this with indoor/outdoor conduits, such as those that might lead back to a demark.
Is this a good idea?  It seems like any movement on the cables would cause gaps in the foam... or the foam might affect the cables' insulation... and it seems like itll be a huge pain to run cables in the future...
What is the right solution?  Thanks in advance!
Comment: Our cable contractors typically use a red fire-proof putty when running conduit into our data centers. It looks and feels like clay although I'm not sure what they call it as I rely on them for that sort of thing.
Comment: The technical term for that is a [firestop](http://en.wikipedia.org/wiki/Firestop).
Answer: Honestly, you won't be able to create a 100% air-tight room.  No point in trying to.  Most fire-suppression systems are deliberately designed with a certain amount of escaping air.  That being said... The guy selling DuPont products should be the one to consult on this.  You're the customer, not the service provider.
Comment: As TCW says, the FM200 people should come in and run a leak-test on the room (basically, they pressurise it, then watch how the overpressure degrades over 10-30 minutes).  They'll advise on how much more sealing is required, and if they're any good at all, they'll advise on how.  You can cause more trouble than not if you use eg non-flame retardant materials in order to pressure seal!
Comment: @MadHatter - Hah I read that as "As [Tasty Coma Wife](https://www.youtube.com/results?search_query=tasty+coma+wife&oq=tasty+coma+wife&aq=f&aqi=&aql=&gs_sm=e&gs_upl=34l34l0l107l1l1l0l0l0l0l0l0ll0l0) says..." - took me a moment to realise you meant TheCompWiz ;)
Answer: having gone through this exercise before you are in for lots of fun.  Even if they get it right by their standards, your local fire marshal may have a different opinion.  My recommendation is to try to reduce the number of cables going into that room, and then run the cables through the approved conduit.  You won't be running any more cables though that conduit when finished so its usually advisable to make this a 10g switch to 10g switch line rather than expecting to use the conduit.
Comment: +1 for "when it's built, it ain't changin'"


Ldap on Centos7: why my RootDN doesn't work?

Question: On a fresh centos7 ldap server
I use a ldif like this
replace: olcRootDN
olcRootDN: dc=Manager,dc=mydomo,dc=mydom
-
replace: olcAccess
olcAccess: {0}to *
  by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" write
  by dn.base="cn=Manager,dc=mydomo,dc=mydom" write by * none
-
add: olcRootPW
olcRootPW: {SSHA}xXXXXXXXXXXXXXXXXXXXXXXX

Of course hash is correct
The command go ok but if i try a simple ldap insert..
ldapadd -x -D "dc=Manager,dc=mydomo,dc=mydom" -w mycorrectpass -f init2.ldif

give me
ldap_bind: Invalid credentials (49)

Why?
ldap is correct running,i can insert only with ldapi and -Y external
the user ldap has correct perms on dirs.
Comment: "mycorrectpass" looks to be incorrect in the first place.
Comment: No,is correct,i have used for hash slappasswd -s mycorrectpass
Comment: Indeed, I have reproduced the problem with a fresh openldap installation. There is something odd going on.
Answer: Solution found, is possible to use the external auth wich use sasl
ldapmodify -Y EXTERNAL -H ldapi:/// -f init2.ldif


Dsquery group –name A* --> dsquery failed:'A*' is an unknown parameter

Question: From here:
http://ss64.com/nt/dsquery-group.html
Examples

Find all groups on the current domain with a name that starts with 'Admin'

C:\> dsquery group -name Admin*

Find all groups in the 'Groups' OU

C:\> dsquery group ou=Groups,ou=AcmeCo,dc=ss64,dc=com

When I try it I get the following error:
C:\>Dsquery group –name A*
dsquery failed:'A*' is an unknown parameter.
type dsquery /? for help.

What am I doing wrong?
Answer: Apparently there are two different types of hyphens and I used the wrong one on the "-name" parameter.
Why it said the wrong parameter is 'A*' remains a mystery, as does why "net group /domain SOME_GROUP_I_KNOW_EXISTS" fails also.


Building an acoustic guitar

Question: I am a student of upper bach who wants to make a acoustic guitar from scratch or with some very basic bases. I will need to do this in 2 and a half months. I could work in it 2 hours a day, 5 days a week. My school Design and Technology classrooms are pretty good. The guitar would be my personal project of 9th grade IB diploma.
Is building a guitar a viable project?  Any hints or clues to achieve this?
Comment: good luck. But that will be one guitar that may never get played. You really need a lot more time.
Comment: What do you mean by "a student of upper bach"?
Comment: I haven't built an acoustic (only a few electrics) but you might like to join, or at least look around, one of the serious forums like [Musical Instrument Makers Forum](http://www.mimf.com/phpbb/). With all the right tools already available, it **might** be possible in the time stated.
Comment: Have fun doing the frets, unless you make it fretless. Oh yeah and there is also the problem of the pressure the string stops put on a neck
Comment: Maybe if you bought a neck and measured the distances to the bridge very very very well
Comment: If you simply need to produce a functional acoustic, either a DIY kit or look around for a 3D printer model. The latter will almost certainly incorporate a metal truss bar to stiffen the fingerboard and hold it in place relative to the body.
Comment: An acoustic guitar will be almost impossible to produce in anything that vaguely resembles a playable instrument. An electric guitar may be a little more achievable, though - it's far less reliant on precision and has significantly fewer parts, allowing you to focus your time on the parts that matter. Still, I feel like it would be a stretch to make the neck strong enough
Comment: Many years ago when I was at school, one of other pupils (at the same age as a typical IB diploma student) built a playable violin "from scratch." He was studying woodworking as one of his specialist subjects, and he also played the violin. But it took him *two years*, not two months.
Answer: Building an acoustic guitar from scratch is one thing.  Building one that sounds even remotely decent and will hold up under string tension and changes in the environment, tune up properly with proper intonation and has a playable action is another.
Building an acoustic guitar from scratch requires many skills for the many different processes and steps involved in the project.  Each separate aspect of the building process requires skills beyond just basic use of hand and power tools.
You must be able to carve a neck out of a block of wood and the neck must be exactly the right length. The neck should be tapered, thinner at the headstock and wider at the body.  The radius of the fingerboard side of the neck must be precise and the radius on the back of the neck should be uniform.
Generally the headstock will be carved out of a different block of wood and then properly joined to the neck at a precise angle with a joint that will withstand string tension.  Once you have the headstock joined to the neck you will need to attach the fingerboard to the neck which is a thinner strip of wood.  To the fingerboard you will have to fashion frets out of the desired gauge fretwire and install them in the exact right position with the correct radius and at a uniform depth by first cutting fret slots in the fingerboard for each fret.
Just installing the frets is a job that generally requires some training and practice to be able to install the frets properly, level them properly, crown them precisely and dress the ends so they don't cut your fingers when you slide your fretting hand up and down the neck.
The tone wood for the sound board must not only be cut very thin but must be seamed together with no visible crack as it's actually two pieces of wood (often "book-matched").  The top must also be braced in such a manner as to allow the soundboard (top) to be responsive to vibrations, but also be structurally capable of holding up under string tension.
The sides must be curved to conform to the shape of the top and back. Once the body is assembled you will have to attach the neck at a very precise angle and in a manner that will hold up under string tension and playing conditions.
The saddle must be compensated to account for differences in intonation and the bridge must be firmly attached to the top in the exact right place with a glue that will hold up under varying temperatures and string tension.
Then there is the nut in which the string slots must be cut at a precise depth and thickness with the proper spacing and the tuning pegs and tuning gears.
The overall distance between the nut and the saddle (the scale) must be exact as must be the location of each fret or the guitar will never play in tune.
I have a friend who is a carpenter and woodworker as well as an excellent guitarist.  He builds electric guitars one after another from scratch.  He has all the power tools needed and radius gauges.  He has built dozens of very playable electric guitars modeled after many of the popular guitars such as Fender Strat, Gibson Les Paul, Gibson SG, Fender Telecaster, etc.  But he will not even attempt to build an acoustic guitar.
Before you attempt to build an acoustic guitar you might want to go to school to learn how first.  Here is a link to a school in the US that offers a 300 hour hands on training course conducted over a 6 week period that will teach you the basics of lutherie (guitar building). Atlanta Guitar Works
If you don't have 300 hours to spare to learn how to build an acoustic guitar from scratch you might be able to assemble and finish one from a kit if you have or can acquire all the necessary tools.  You won't need nearly as many tools as building from scratch because the kit will come with the top and back already cut and sanded and milled to the proper thickness.  The neck will already be cut and the sides are already pre-shaped.  But you will still need certain tools to put all the pieces together.
Even putting together an acoustic guitar from a kit will require a great deal of time and patience.  But this site Everything You Need To Know About DIY Guitar Kits will give you some really good information on assembling a guitar from a kit and will also provide insight into all the steps involved in building a guitar.  I would start with this site as it should give you enough insight into the entire process to help you decide the answer to your question.
If you do decide to try to build from scratch or assemble and finish a guitar from a kit, I wish you the best of luck.

Do It Yourself Guitar Kit.  The hardest parts (milling the top and back and joining the two halves together, cutting the neck and headstock and joining those together, shaping the sides, cutting the fingerboard and cutting the slots in the right location, cutting the braces etc.) are done for you.  You just have to put it all together and dress the frets and apply the final finish.
Comment: DIY kits are the most viable option. I didn't think of that.
Answer: Jigs, jigs, and more jigs. And I'm not talking dances. Seriously, the acquisition of tooling to make a good acoustic guitar is daunting. It won't be worthwhile for a production run of "1".
I am blessed to have a bespoke steel-string, and my builder even used a prepared neck. His art is in the sound box. The sound box used 000-18 (OM) forms for the glue up. Just look at these pictures of its construction. You will see many tools; there are countless other tools that are not shown.
My builder is a comfortably-retired hobbyist. He builds these as a labor of love, and as an exercise of his studies with Ervin Somogyi. He builds four or five instruments per year. Personally, I think that your schedule is very aggressive -- too aggressive without prior experience. I don't understand the requirements of a "9th grade IB diploma", however I would recommend that you reconsider your project.

Building an acoustic guitar


How to apply s3 lifecycle rule except one prefix/folder

Question: I have this rule apply to all the objects in s3 but how can I apply it to all object except one prefix app/
lifecycle_rule = [
    {
      id                                     = "log1"
      enabled                                = true
      abort_incomplete_multipart_upload_days = 7

      noncurrent_version_transition = [
        {
          days          = 30
          storage_class = "STANDARD_IA"
        },
        {
          days          = 60
          storage_class = "ONEZONE_IA"
        },
        {
          days          = 90
          storage_class = "GLACIER"
        },
      ]

      noncurrent_version_expiration = {
        days = 300
      }
    }
]

Basically, I want all objects to go to GLACIER after 90 days except app/
Answer: You have to create rules for all prefixes, except /app. There are no regular expressions, so you can't create rules of type "all prefixes which do not match /app".
Comment: Yeah. I read the documentation. It's really frustrating they didn't added this simple feature. Just to ignore 1 prefix. Now I have to add rule for 8 prefixes.


Configurar pré-fixo url da aplicação com Tomcat

Question: Desenvolvi uma aplicação em Vue, gerei a pasta dist para produção e consegui publica-lá usando o Tomcat. No caso joguei a pasta dist gerada na pasta /webapps/helloWorld.
Consigo acessar pelo link
http://localhost:8080/helloWorld

até ai tudo bem. O problema é que o
/helloWorld
só funciona para o primeiro acesso, ele não fica como pre-fixo do link. É tanto que após o primeiro acesso o link fica assim:
http://localhost:8080/login

Caso eu queira ir para tela de home era pra eu digitar
http://localhost:8080/helloWorld/home

Porém isso não funciona, só funciona assim:
http://localhost:8080/home

Como faço para deixar o /helloWorld/ como pré-fixo em todas as rotas?
Answer: Seria interessante você hospedar o seu código ou as configurações das suas rotas para a gente conseguir entender melhor o que pode estar acontecendo, mas isso provavelmente está acontecendo devido às rotas estarem fazendo parte do mesmo "nivel" de hierarquia, verifique se a rota "home" está sendo declarada dentro de um children da "helloworld". Ficaria algo semelhante a isso:
const router = new VueRouter({
  routes: [
    { path: '/helloworld', component: HelloWorld,
      children: [
        {
          path: 'home',
          component: Home
        }
      ]
    }
  ]
})

Exemplo oficial do Vue.js no CodePen:
https://jsfiddle.net/yyx990803/L7hscd8h/
Fonte:
https://router.vuejs.org/guide/essentials/nested-routes.html


Como fazer o select voltar para o estado inicial após o "deselect"?

Question: Como fazer para que, quando eu deselecionar um select option específico, ele voltar ao "estado inicial"?
Aqui está uma simulação do meu problema: https://jsfiddle.net/andrealbson/o1xs3m8x/
Answer: Veja se é isso que você quer:

<select class="selectpicker" id="funcao">
    <option title="Opção 1">Líder</option>
    <option title="Opção 2">Para Conhecimentor</option>
    <option title="Opção 3">Participante</option>
 </select>

Fonte
Comment: @Fraga, se você observar o meu exemplo, depois que eu seleciono o option com o value= "1", verá que ele desabilita essas opções nos outros selects, porém se caso o usuário desmarcar esse option, os selects (que tiveram suas option desabilitadas) não conseguem voltar ao "normal", ou seja, reabilitá-las. Entendeu? Eu precisaria que o select voltasse ao seu "estado inicial"...
Comment: E o "estado inicial" seria?
Comment: O "estado inicial" se refere à ele mostrar novamente o option que foi "ocultado" nos demais selects. Na simulação do problema que eu postei, quando é selecionado a opção "Líder", ele remove/oculta essa opção nos outros selects. Mas caso eu desmarque a opção "Líder", os outros selects permanecem com esse option ocultado...
observe o exemplo: https://jsfiddle.net/andrealbson/o1xs3m8x/
Answer: Se eu entendi, no seu caso você tem que percorrer todos os options e desmarcar um a um. Depois só marque o selecionado. Espero ter ajudado.
Comment: isso mesmo, mas não estou conseguindo fazer isso..


How to deal with gaps/NaNs in time series data when using Matlab for autocorrelation and neural networks?

Question: I have a time series of measurements (heights-one dimensional series). In the observation period, the measurement process went down for some time points. So the resulting data is a vector with NaNs where there were gaps in the data. Using MATLAB, this is causing me a problem when computing the autocorrelation (autocorr) and applying neural networks (nnstart).
How should these Gaps/NaNs be dealt with? Should I just remove these from the vector? Or replace their entry with an interpolated value? (if so how in MATLAB)
Answer: I would not touch the data at all. Use this for autocorrelation with NaNs:
http://www.mathworks.com/matlabcentral/fileexchange/43840-autocorrelation-and-partial-autocorrelation-with-nans/content/nanautocorr.m
"not touch the data" means not to remove any data or time-step or replace with 0 or the mean, it would compromise the information about the specific-time-lag linear dependence. I would also avoid simulating the values in the gaps, if you are interested in the "SAMPLE" autocorrelation, anyway even the best simulation technique will not add any more information about the autocorrelation, being based on the data themselves.
I partially recoded the matlab (link above) autocorrelation and partial autocorrelation functions to deal with NaNs: any data couples including NaNs is excluded from the computation. This is done for each lag. It worked for me. Any suggestion is well accepted.
Comment: Hello Momo, thanks for the comment. "not touch the data" means not to remove any data or time-step or replace with 0 or the mean, it would compromise the information about the specific-time-lag linear dependence. I partially recoded the matlab (link above) autocorrelation and partial autocorrelation functions to deal with NaNs: any data couples including NaNs is excluded from the computation. This is done for each lag. It worked for me. Any suggestion is well accepted.
Comment: Welcome @Fabio: Could you please give more explanation to what you mean with "not touch the data"? Do you mean not to remove anything? It would also help to introduce the content you linked to and explain why this helps the OP.
Answer: There are some algorithms which are immune to missing values, so the preferred solution is to look for them (for instance R's acf for autocorrelation).
In general, the way to go is to either just discard data with missing observations (might be very painful) or just to impute their values -- mean of neighbors might be enough for smooth series and small gaps, but there are is of course of plethora of other more powerful methods, using splines, random/most frequent values, imputation from models, etc.
Comment: The acf with missing value is calculated in the normal way, but missing values are 'skipped' in the sums (that is, acf formula for a given lag looks like a sum divided by a sum, in each of those sums the missing values can be skipped). This is not the same as removing the missing values from the original data. The problem with matlab is it doesn't skip NaN, and including that in the calculation turns everything into NaN.
Answer: Use Intervention Detection to impute the missing vales exploiting the useful ARIMA structure and any local time trends and/or level shifts.
Answer: there are 2 problems here.  the first is providing a meaningful numerical framework for your autocorrelation answer in matlab.  for this to happen, you need to stretch and/or patch the time-series-portion of your data vectors...this 'data integrity' component of the problem is the most fundamental.
secondly, you need to decide how to handle the 'value' component of your vector...this depends to a large extent to the particular application as to what's best to assume, (e.g., small, missing time-stamps and the corresponding NaNs or Nulls could be safely interpolated from it's neighbors...in larger gaps, setting the value to zero is probably safer...or impute as recommended above--obviously for this to be meaningful, the gaps again must be comparatively small.).


How to make a JFrame really fullscreen?

Question: In my Java application I try to make a JFrame really fullscreen by using this code:
public class MainFrame extends JFrame {

    private static final long serialVersionUID = 1L;

    public MainFrame() {
        super();
        this.setTitle();
        this.setUndecorated(true);

        this.setExtendedState(JFrame.MAXIMIZED_BOTH);

        this.setVisible(true);
        //this.pack();
    }
}

But on my Mac I can still see the Dock and the top toolbar of the OSX. So how can I create a JFrame that really consumes my whole screen?
EDIT
I have to add that I want to call that JFrame from a eclipse plugin.
Comment: possible duplicate of [How can I do full screen in Java on OSX](http://stackoverflow.com/questions/1155838/how-can-i-do-full-screen-in-java-on-osx)
Comment: Take a look at this: http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html
Comment: Thanks but the examples there do not work if it is a Eclipse plugin.
Comment: +1 for this.setExtendedState(JFrame.MAXIMIZED_BOTH);
Answer: I haven't tried it yet, but Java has fullscreen API, which should meet your needs:
http://docs.oracle.com/javase/tutorial/extra/fullscreen/index.html
Comment: Thanks, but this doesn't seem to work when I create the JFrame from a eclipse plugin.
Comment: [This answer](http://stackoverflow.com/a/11499100/1048186) to another question gives some example code needed to make this approach work.
Answer: I know the answer. Firstly, I have to admit that the following trick won't work if you are making video or movie player or animation player. OK here is what i found after many tries:
Let's say that you want to make a JFrame (called frame) fullscreen when you press a button (called fullscreenButton).Then do the following :
import java.awt.*;
import javax.swing.*;

public class FullscreenJFrame extends JFrame{

    private JPanel contentPane = new JPanel();
    private JButton fullscreenButton = new JButton("Fullscreen Mode");
    private boolean Am_I_In_FullScreen = false;
    private int PrevX,PrevY,PrevWidth,PrevHeight;

    public static void main(String[] args) {
         FullscreenJFrame frame = new FullscreenJFrame();
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setSize(600,500);
         frame.setVisible(true);
    }

    public FullscreenJFrame(){
        super("My FullscreenJFrame");

        setContentPane(contentPane);
        //From Here starts the trick

        FullScreenEffect effect = new FullScreenEffect();

        fullscreenButton.addActionListener(effect);

        contentPane.add(fullscreenButton);
        fullscreenButton.setVisible(true);

    }

    private class FullScreenEffect implements ActionListener{
        @Override
    public void actionPerformed(ActionEvent arg0) {
         // TODO Auto-generated method stub

             if(Am_I_In_FullScreen == false){

                      PrevX = getX();
          PrevY = getY();
          PrevWidth = getWidth();
          PrevHeight = getHeight();

          dispose(); //Destroys the whole JFrame but keeps organized every Component
                      //Needed if you want to use Undecorated JFrame
                      //dispose() is the reason that this trick doesn't work with videos
                      setUndecorated(true);

              setBounds(0,0,getToolkit().getScreenSize().width,getToolkit().getScreenSize().height);
            setVisible(true);
                            Am_I_In_FullScreen = true;
              }
               else{
                    setVisible(true);

                    setBounds(PrevX, PrevY, PrevWidth, PrevHeight);
                    dispose();
        setUndecorated(false);
        setVisible(true);
                    Am_I_In_FullScreen = false;
               }
    }
    }
}

I hope you enjoyed it
Comment: where do the magic numbers -10, -100, 30, and 110 come from (the amounts that setBounds is offset from the claimed screen size)?  Is this portable with those same values?  Will part of the window be off of the screen?
Comment: @g.rocket you are right those numbers just fit for my app.A parametric one is setBounds(0,0,getToolkit().getScreenSize().width,getToolkit().getScreenSize().height); not setBounds(-10,-100,getToolkit().getScreenSize().width+30,getToolkit().getScreenSize().height+110); i will edit it thx
Answer: An example:
import java.awt.FlowLayout;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class FullScreenJFrame extends JFrame{

    private GraphicsDevice vc;

    public FullScreenJFrame(){
     super();

     GraphicsEnvironment e = GraphicsEnvironment.getLocalGraphicsEnvironment();
     vc= e.getDefaultScreenDevice();

     JButton b = new JButton("exit");
     b.addActionListener(
             new ActionListener(){
                 public void actionPerformed(ActionEvent arg0) {
                     dispose();
                     System.exit(0);

                 }
             }
             );
     this.setLayout(new FlowLayout());
     this.add(b);
     setFullScreen(this);
 }

 public void setFullScreen(JFrame f){

     f.setUndecorated(true);
     f.setResizable(false);
     vc.setFullScreenWindow(f);

 }

 public static void main(String[] args){
     new FullScreenJFrame();
 }

}

Answer: private Dimension screenSize; /* class level vars */
private swidth , sheight;

/*In GUI creating method:put this code: */
screenSize = Toolkit.getDefaultToolkit().getScreenSize();
sheight = screenSize.height;
swidth = screenSize.width;
setBounds(0, 0, swidth, sheight-40);

NB: using swidth, sheight vars give you the liberty to further adjust.
Best way is to use int vars in place of - 40 e.g sheight/swidth - margin etc.
Here margin should come from parameter table. Getting full control of situation.
Direct usage also possible as: setBounds(0,0,screenSize.width, screenSize.height);
Answer: Use com.apple.eawt.FullScreenUtilities. And make sure to test that the system is running Mac OS.
public void enableFullscreen(Window window, boolean bool) {
    if (System.getProperty("os.name").startsWith("Mac OS")) {
        com.apple.eawt.FullScreenUtilities.setWindowCanFullScreen(window, bool);

    }

}

How to make a JFrame really fullscreen?


drop down banner ads needed

Question: Hi I need a drop down banner ads on a project I am working on. it's like a toggle effect but with the choice to close it or automatically closes after sometime and pushes it down.
it would be similar to http://www.dynamicdrive.com/dynamicindex17/dddropdownpanel.htm but by default should visible just don't know how to put the time duration to close it. By any chance can someone show me how to add it to the javascript
something like
<code>$(function(){
   $("#banner").slideDown(function()  {
       setTimeout(function() {
         $("#banner").slideUp();
       }, 30000);
   });
});
</code>
The javascript Im using is
<code><script type="text/javascript">

$(document).ready(function () {

    $('#toggle-view li').click(function () {

        var text = $(this).children('p');

        if (text.is(':hidden')) {
            text.slideDown('200');
            $(this).children('span').html('-');
        } else {
            text.slideUp('200');
            $(this).children('span').html('+');
        }

    });

    });
</code>
Comment: What doesn't work in the script above? It should work fine - the banner will slide up after 30 seconds..
Comment: sorry i just edited my post with the second script I just need to insert the 1st script on the scond script but for some reason it won't work
Answer: Your current code works fine
<code>$(function(){
   $("#banner").slideDown(function()  {
       setTimeout(function() {
         $("#banner").slideUp();
       }, 5000); //slide up after 5 seconds
   });
});
</code>
fiddle: http://jsfiddle.net/maniator/BgVtY/
Comment: Thanks need but is it possible to add this code to the second one I just posted doesnt seem to work
Comment: @cooldude, can you post both it and the html to a fiddle so i can try to fix it?
Comment: I can't seem to get it work on fiddle but it's working on my site http://j2sdesign.com/jsf/test.html other problem is when the image closed it flickers
Comment: ok got it working now sorry for that thanks for your help I just need to fix the image flickering when It close
Comment: sorry about that I was checking the image flickering didn't notice I didn't accept answer

drop down banner ads needed


Identify this Epiphone les paul model?

Question: I need some help to identify my guitar. It is an older Epiphnone les paul model, but I'm not sure what exact model it is. So if anyone knows it, please help me out.
Comment: That's an Epiphone Les Paul Standard Plain-Top, made in November 1995 in the Samick factory in Korea.
Comment: It's an epiphone les Paul. Are there sub models under that? Anyway you have the serial number, I would go to the epiphone web site and see if they have a serial number lookup tool.
Comment: @YourUncleBob that sounds like answer, post it as such and i will upvote.
Comment: @NeilMeyer I assume this question will be closed, because it's not really useful to anyone else. I was just demonstrating that the asker could have Googled the information in a few minutes, like I did. And I don't know much about Gibsons, so I can't turn it into a comprehensive "how to id any Gibson" answer.
Comment: Not a bad question... you got downvoted because you seemingly put no effort into research before posting here... I will +1 you, at least (tomorrow because I already used all my votes today)
Comment: i had one of thoe from same era; cherry tiger stripe. Very fine instrument
Comment: No. Just read the head stock (it's labeled with "model") and look up the serial number if you need more info.
Answer: Since you have a serial number, it's quite easy to identify this guitar... With that bit of info, you can simply google "[Insert your guitar maker here] serial number decoder."
I found the below decoder (among other Epiphone decoders) on this handy Gibson forum:

FYYMMRRRR
<code>F/FF = factory ID
Y/YY = year of manufacture
MM = month of manufacture
RRRR = ranking number
</code>
Example: 3021234 = Samick Korea / 1993 / February / unit 1234
Example: S3021234 = Samick Korea / 1993 / February / unit 1234
Example: S93021234 = Samick Korea / 1993 / February / unit 1234
Example: SI01021234 = Samick Indonesia / 2001 / February / unit 1234
Example: SI010212345 = Samick Indonesia / 2001 / February / unit 12345
Note: There may be no factory designator for some 1993 and earlier
  models. A single digit month of manufacture may occur for some 1997
  and earlier models. The ranking number may consist of any number of
  digits.

So, as Your Uncle Bob stated in the comments, this is an Epiphone Les Paul made in November by the Samick factory in Korea. But, it's the 128th guitar made in either 1985 or 1995... considering the note that "single digit month of manufacture may occur for some 1997 and earlier models," and that the Samick factory began manufacturing in 1984.
Comment: 2021. I was trying to identify another one with very similar characteristics. My problem with your conclusions is that standard Epi LP began in 1989 and are all set necks. So, this guitar was built in 1995 and is not a standard.
Comment: You guys only found the year and place it was made. I have been trying to find information about the actual model, and specifications. Those pages don't tell anything about the actual product line, which are the last 4 digits on my guitar
Answer: https://en.wikipedia.org/wiki/Epiphone_Les_Paul
 Standard with worn brown on top maybe and possibly maple on the back.

Identify this Epiphone les paul model?


service fabric local cluster setup error

Question: Following link below to set-up and run local cluster.
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-create-your-first-application-in-visual-studio
Currently when running the application, it errors out setting up local cluster.
Dev environment:
Windows 10,
Visual Studio 2017 trial,
Docker for Windows (Although not used)
PowerShell script execution has been enabled and visual studio was run as administrator.
Error message: The PowerShell script failed to execute. See the Output window for details.
Output Window:
1>------ Build started: Project: MyApplication, Configuration: Debug x64 ------
2>------ Deploy started: Project: MyApplication, Configuration: Debug x64 ------
2>Started executing script 'GetApplicationExistence'.
2>Finished executing script 'GetApplicationExistence'.
2>Time elapsed: 00:00:02.1304224
2>Started executing script 'Set-LocalClusterReady'.
2>powershell -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\DefaultLocalClusterSetup.psm1'; Set-LocalClusterReady -createOneNodeCluster $true"
2>--------------------------------------------
2>Local Service Fabric Cluster is not setup...
2>Please wait while we setup the Local Service Fabric Cluster. This may take few minutes...
2>Stop-Service : Cannot find any service with service name 'FabricHostSvc'.
2>At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:144 char:5
2>+ Stop-Service FabricHostSvc -WarningAction SilentlyContinue
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : ObjectNotFound: (FabricHostSvc:String) [Stop-Service], ServiceCommandException
2> + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.StopServiceCommand
2>
2>WARNING: System.Management.Automation.CommandNotFoundException: The term 'Remove-ServiceFabricNodeConfiguration' is not
2> recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
2>a path was included, verify that the path is correct and try again.
2>
2> at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception
2>exception)
2>
2> at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
2>
2> at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2>
2> at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2>WARNING: Remove-ServiceFabricNodeConfiguration throws exceptions
2>
2>Using Cluster Data Root: C:\SfDevCluster\Data
2>Using Cluster Log Root: C:\SfDevCluster\Log
2>
2>The generated json path is C:\Users[username]\AppData\Local\Temp\tmp5D74.tmp.json
2>Processing and validating cluster config.
2>Failed to open base key for machine ComputerFullName to check if machine is IOT Core.
2>Test-ServiceFabricClusterManifest : The term 'Test-ServiceFabricClusterManifest' is not recognized as the name of a
2>cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify
2>that the path is correct and try again.
2>At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:504 char:5
2>+ Test-ServiceFabricClusterManifest -ClusterManifestPath "$manifest ...
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : ObjectNotFound: (Test-ServiceFabricClusterManifest:String) [], CommandNotFoundException
2> + FullyQualifiedErrorId : CommandNotFoundException
2>
2>PrepareClusterManifest : Could not validate cluster manifest
2>'C:\Users[username]\AppData\Local\Temp\LAP000338-Server-ScaleMin.xml'
2>At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:530 char:21
2>+ ... ifestFile = PrepareClusterManifest $manifestFileTemplate $imageStoreC ...
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
2> + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PrepareClusterManifest
2>
2>ScriptHalted
2>At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:508 char:9
2>+ throw
2>+ ~~~~~
2> + CategoryInfo : OperationStopped: (:) [], RuntimeException
2> + FullyQualifiedErrorId : ScriptHalted
2>
2>Finished executing script 'Set-LocalClusterReady'.
2>Time elapsed: 00:00:10.9335415
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Comment: Have you restart the machine after the setup?
Comment: Thanks for trying to help.. yes restarted computer, reinstalled SDK, repeated enable powershell execution, etc.
Answer: To get to the point first, it was the installer issue.
When I was installing the Service Fabric SDK, something happened during the installation, let's say network error or installation was not complete however I somehow missed it, human error.
I am not sure how I missed it but the point is, I tried to uninstall and reinstall the SDK a few times just in case to make sure SDK was installed completely.  And the problem was, the initial incorrect installation done was lingering throughout this whole process because there were directories and files not completely removed by uninstallation, such as registry keys.
After I manually delete registry keys and directories and reinstalled the SDK and now everything seems fine.
To help anyone having similar issue, edited instruction below.
Original article of the instruction in (https://github.com/Azure/service-fabric-issues/issues/566)
1. Uninstall Microsoft Service Fabric SDK.
2. Uninstall Service Fabric tools using the Visual Studio Installer.
3. Delete folder: C:\Program Files\Microsoft Service Fabric
4. Delete folder from registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Fabric
5. Reboot PC
6. Download Microsoft Web PI (https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started) install the Microsoft Azure Service Fabric SDK. Btw. after I've deleted registry entries of SF, I've noticed that Web PI has finally installed three needed components (not only Azure Service Fabric SDK as it was for previous re-installations):
  Microsoft Visual C++ 2012 SP1 Redistributable Package (x64)
  Microsoft Azure Service Fabric Runtime - 6.3.162
  Microsoft Azure Service Fabric SDK - 3.2.162

7. Install Service Fabric tools using the Visual Studio Installer.
8. Create test project in Visual Studio 2017 and run it. Visual Studio created cluster automatically.

P.S. After following the steps and if you still can't install Azure Service Fabric Runtime, it could be remaining in "Add or Remove Programs" list, then delete registry key manually: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ServiceFabric  (or is it "Service Fabric" with space..?)
Comment: Thank you, you saved my day! I had the same issue: installing some of the prerequisites failed. And just simply reinstalling the Microsoft Service Fabric did not help, but completely removing it (from registry as well) did the trick.
Comment: Wasted 2 hours on this. Don`t know how much would wast without your answer. Thanks man :))
Answer: Uninstall Microsoft Service Fabric SDK and Service Fabric from Windows add/remove option.
Uninstall Service Fabric tools using the Visual Studio Installer (using the modify option to uncleck and apply updates). This will ensure Visual Studio generated files are removed.
Delete Service Fabric folder manually under: C:\Program Files
Folder name might be the SF or Microsoft Service Fabric or Service Fabric or another name depending on previous setup.
Delete folder from registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Fabric
Reboot PC
Download Service Fabric, SDK and Service Fabric Runtime. Download sources -
https://go.microsoft.com/fwlink/?linkid=839354
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-creation-for-windows-server
Open PowerShell as admin.
run "Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser"
Then
run ".\CreateServiceFabricCluster.ps1 -ClusterConfigFilePath .\ClusterConfig.Unsecure.DevCluster.json -AcceptEULA"
Install Service Fabric SDK
Install Service Fabric tools using the Visual Studio Installer (using modify option, check Service Fabric option and apply updates).
Rebuild solution. Make sure your C drive has enough free spaces and manifest file has corrected domain\username, password to publish.


Let $ A, B \in \mathbb {R}^{n \times n} $, the Lie bracket of $ A $ and $ B $ denoted by $ [A, B] $

Question: Let $ A, B \in \mathbb {R}^{n \times n} $, the Lie bracket of $ A $ and $ B $ denoted by $ [A, B] $ is defined as $ [A, B] = BA-AB$. If $\big[A,[A, B] \big] = \big[B, [A, B] \big] = 0$, provide that for all $ t\in\mathbb{R}$ it is fulfilled that ,
$$e^{tB}e^{tA} = e^{t(A + B)}e^{t^{2}/2[A, B]} $$
I am given by suggestion, consider that $ \phi (t) = e ^ {- t (A + B)} e ^ {tB} e ^ {tA} $ is solution of the matrix equation $ X '= t [A, B] X $
Comment: See https://math.stackexchange.com/questions/2992779/the-most-difficult-problem-of-differential-equations
Comment: The quantity $[A, B]$ is usually called the *Lie bracket* of $A$ and $B$.
Comment: Actually $[A,B]$ is usually defined as $AB-BA$.
Answer: So compute
$$
ϕ'(t)=e^{-t(A+B)}\Bigl[e^{tA}B+(A-(A+B))e^{tA}\Bigr]e^{tB}
=e^{-t(A+B)}\Bigl[e^{tA}B-Be^{tA}\Bigr]e^{tB}
$$
Now consider
$$
e^{tA}B-Be^{tA}=\sum_k\frac{t^k}{k!}(A^kB-BA^k)=\sum_k\frac{t^k}{k!}\,\sum_{m=0}^{k-1}A^m[A,B]A^{k-1-m}=[A,B]e^{tA}
$$
the last equality because of the assumption that $A$ and $[A,B]$ commute. So we got
$$
ϕ'(t)=e^{-t(A+B)}[A,B]e^{tA}e^{tB}
$$
and because also $B$ commutes with $[A,B]$, so does $(A+B)$ resulting in
$$
ϕ'(t)=[A,B]ϕ(t)
$$
as claimed. Now also observe $ϕ(0)=I$ so that $ϕ(t)=e^{t[A,B]}$.


How to prove the identity $\prod_{n=1}^{\infty} (1-q^{2n-1}) (1+q^{n}) =1 $ for $|q|<1$?

Question: Eulers product identity is as follows
\begin{align}
\prod_{n=1}^{\infty} (1-q^{2n-1}) (1+q^{n}) =1
\end{align}
How one can explicitly prove this identity?
Note here $q$ deonotes a complex number satisfying $|q|<1$
Comment: How do you compute an identity? Do you mean proving that it holds?
Comment: Rewrite it as:

$$\prod(1+x^n)=\prod\frac{1}{1-x^{2n-1}}$$

Then the left side coefficient of $x^N$ is the number of ways to partition $N$ into distinct positive integers, and the right is the number of ways to partition $N$ into odd not-necessarily distinct integers. This reduces it to a combinatorial question, at least.
Comment: what's $q$?....
Comment: @voldemort, q is just variable
Comment: @Wojowu, yes, it is known as Euler identity
Comment: @phy_math Not finding any evidence that this is called "Euler identity."
Comment: Is complex analysis a tool you can use?
Comment: @ThomasAndrews [Look here](http://mathworld.wolfram.com/EulerIdentity.html)
Comment: @Winther, Yes, I want to know how to prove(?) compute(?) this equation(identity) holds.
Comment: **1 minute**. $ $
Answer: We have \begin{align}\prod_{n = 1}^\infty (1 - q^{2n-1})(1 + q^n) &= \prod_{n = 1}^\infty \frac{(1 - q^{2n-1})(1 - q^{2n})}{1 - q^n}\\
&= \frac{\prod_{n = 1}^\infty (1 - q^{2n-1})(1 - q^{2n})}{\prod_{n = 1}^\infty (1 - q^n)}\\
&= \frac{\prod_{n = 1}^\infty (1 - q^{2n-1})(1 - q^{2n})}{\prod_{n = 1}^\infty (1 -q^{2n})(1 - q^{2n-1})}\\
&= 1\end{align}
Comment: Great! it helps me a lot
Comment: Very slick. Might even be easier to see by starting with $$\prod (1-q^n) = \prod (1-q^{2n-1})(1-q^{2n}),$$ which seems obvious, and then divide.
Comment: @Thomas thanks. I wanted to present a calculation that doesn't look like I'm working backwards. I did use that identity at the end though. As you know, it follows from breaking the product into even and odd $n$.
Answer: For $\lvert q\rvert < 1$, define
$$f(q) = \prod_{n=1}^\infty (1-q^{2n-1})(1+q^n).$$
The product is absolutely and locally uniformly convergent on the open unit disk, hence $f$ is holomorphic there, and the product can be reordered and regrouped as desired. It is clear that $f(0) = 1$, and by reordering and regrouping, we have
$$\begin{aligned}
f(q) &= \prod_{n=1}^\infty (1-q^{2n-1})(1+q^n)\\
&= \prod_{n=1}^\infty(1-q^{2n-1})(1+q^{2n-1})\cdot \prod_{n=1}^\infty (1+q^{2n})\\
&= \prod_{n=1}^\infty \bigl(1-(q^2)^{2n-1}\bigr)\bigl(1+(q^2)^n\bigr)\\
&= f(q^2).
\end{aligned}$$
Since for $0 < \lvert q \rvert < 1$ the set $\{ q^{2^k} : k \in \mathbb{N}\}$ has an accumulation point in the unit disk (namely $0$), it follows that $f$ is constant.
Answer: Another approach, similar to Daniel's, without an appeal to properties of holomorphic functions.
$$(1-q)(1+q)(1+q^2)\cdots (1+q^{2^n})\cdots = 1$$
since the partial product is $1-q^{2^{n+1}}$
.
Substituting $q^{2k-1}$, you get:
$$(1-q^{2k-1})(1+q^{2k-1})(1+q^{(2k-1)\cdot 2})\cdots\left(1+q^{(2k-1)\cdot 2^n}\right)\cdots = 1$$
So $$1=\prod_{k=1}^\infty \left((1-q^{2k-1})\prod_{n=0}^\infty \left(1+q^{(2k-1)2^n}\right)\right)$$
Now, ever positive integer $N$ can be written in exactly one way as $(2k-1)2^n$. So we can rearrange.


Is this statement (about the localization of a category) true?

Question: Say we are localizing a category $\mathcal{B}$ at the $P$-morphisms, where by $P$-morphism I mean a morphism having some property $P$.
Fix a category $\mathcal{C}$. Is it true that the category of functors from the resulting category of fractions of $\mathcal{B}$ to $\mathcal{C}$ is isomorphic to the category of functors from $\mathcal{B}$ to $\mathcal{C}$ that turn $P$-morphisms to isomorphisms?
Comment: That is the _definition_ of localisation. The category of fractions is just one way of explicitly constructing it.
Answer: As Zhen suggested: the definition of a localization of $\mathcal C$ at $S$ is that the functor categories $[\mathcal C[S^{-1}],\mathcal D]$ are isomorphic to the categories of functors $[\mathcal C,\mathcal D]$ sending $S$ to isomorphisms, via composition with the localization functor.
Comment: You can explicitly construct it, to the extent that the general localization construction is explicit, by localizaing at the multiplicative system generated by $S$, in the same way as happens in rings.
Comment: Oh, ok, thanks! So can I still speak about the ``localization of $\mathcal{C}$ at $S$'', even if the morphisms of $S$ do not satisfy the axioms of a multiplicative system (say, they don't compose)? If I understand what you are saying, we still get a category $\mathcal{C}[S^{-1}]$ but in the case I describe above we just don't know what it looks like - in other words, we can not explicitly construct it. Correct?