Proof verification: lower semi continuous at x implies that the lim inf of every convergent sequence is bigger than f(x)

Question: Show that f is lower semi-continuous at x if, and only if,
$$
\liminf f(x_n) \geq f(x).
$$
for any sequence $(x_n)$ converging to $x$.

Proof (only if)*:
Assume that $f$ is lower semi-continuous at $x$. Let $(x_n)$ be an arbitrary sequence converging to $x$. Fix  an arbitrary $\varepsilon > 0$. Since $(x_n)$ converges to $x$, $\exists N \in \mathbb{N}$ s.t.  $\forall n\geq\mathbb{N}, \ \  |x_n - x| < \delta$
We have that by lower semi-continuity, this implies that (for every $n$ bigger than $N$) $f(x_n) - f(x) > -\varepsilon$. Then it is the case that
$$
\liminf f(x_n) - f(x) > -\varepsilon.
$$
Since we can take $\varepsilon$ to be as small as we want, we have that
$$
\liminf f(x_n) \geq f(x).
$$
Since if we assume by contradiction that $f(x) >$ lim inf $f(x_n)$, we get the existence of an $\varepsilon$ and an $\delta$ such that lim inf $f(x_n) - f(x) < -\varepsilon$.

Does this proof hold?
If not, which are the mistakes and the alternatives?
Thank you
*Proof of if comes by contradiction without much worries.
Answer: Your argument looks fine to me.
Now, after you established that $\liminf_nf(x_n)\geq f(x)$, you keep going with "since  if we assume by contradiction..." I don't see how that contributes anything to the proof.


Verbs in Use Case name "Create User"

Question: I'm struggling on how to name classes for use cases. Because I know that is "bad" to use verbs in classes names(Uncle Bob) but at the same time names of use case classes should explain what they do(Clean Architecture). So if I have an use case "create user" Is it ok to name it " Class CreateUserUseCase" or how should I name it?
Comment: It sounds like it's too early in your language learning to be thinking about Uncle Bob's principles.  I suggest you work with JavaScript for awhile, build some small programs, build some slightly larger programs and get comfortable with the language first.  At that point, you *might* study Uncle Bob's principles as *suggestions.*
Comment: "CreateUser" is not a class name; it is a *method name.*  Classes and Use Cases are not at all the same thing; they're not even similar.
Comment: To follow up on Robert Harvey's comments - I guess it would help if, instead of thinking of UncleBob's use cases/interactors as being mapped 1-to-1 to the fine grained usage scenarios like "create user", think of them rather as classes that you end up with if you try your best to keep separate the code with usage scenarios that *aren't closely related to each other* (e.g. don't make one big class that has functions for everything your application can do). Doing that is IMO more likely to get you closer to Clean Arch., compared to what you're doing now.
Answer: I would not tack "use case" or "interactor" on to the name. A name should not be cluttered with clues about where it goes or what kind of thing it is. It should just say what it is. It should leave me unsurprised by what I find inside. It should not dictate what the outside world around it is like.
If you have a class whose only job is to be the interactor in the user creation use case then a good name might be UserCreator or UserCreation.
BTW. The Use Case or UC classes you see in Uncle Bobs interactor layer in some of his videos (he's called them other things) are not the names you'd use in a real project. Pick a name that means something in your code base.

Verbs in Use Case name "Create User"


Samsung icemaker not producing ice

Question: Just purchased a Samsung refrigerator and the icemaker is not producing ice after 24 hours. The water line works perfect but the refrigerator does not produce ice.
Comment: What model refrigerator is it?
Answer: Most have a wire bar that sits above the ice tray. As the ice cubes fill the tray, the bar is raised and eventually raises high enough to shut off the icemaker.  The bar must be DOWN for ice to be produced.

Or, there's a control somewhere that needs to be selected.  Probably in the refrigerator (not freezer) compartment.  Knowing the model would help.

Samsung icemaker not producing ice


Office PIA and .NET framework version compatibility

Question: I use Office Primary Interop Assemblies (PIA) for Microsoft Office 2003 and 2007. On the download page of PIA, it is mentioned that .NET framework 1.1 is required.
I want to know if the requirement of version 1.1 - is it minimum version that is required? Or is it strict requirement.
In other words, if I have .NET version 2.0 or 3 or 3.5 and don't have 1.1 installed then, will the PIAs work fine or do PIAs require 1.1 version irrespective of what higher version you have?
Answer: Office PIA's work with framework version 2.0 and higher.


Is this a correct installation for a doorbell transformer

Question:
Transformer originally installed by builder 20 years ago behind the chime box. I'm installing a 16v 30va transformer for a Eufy video doorbell. Can I just replace the transformer as is or do I need a different installation? This is a tap in between a ceiling light and a light switch.  Not much wire to work with. Thanks for any help.
Answer: The transformer is in a box so it's not horrible but normally a doorbell transformer is mounted outside the box , the 120v connections made inside and the low voltage connections made outside the box.
In this case both high and low voltage are in the same compartment , that would not fly in my jurisdiction with out a non conductive shield (plastic insulator dividing the hv / lv. Unless the MFG instructions directed it done that way.
Answer: That's not allowed by Code.
Mounting a transformer in an enclosed plastic box will not allow for necessary heat dissipation.
That's why doorbell transformers are always mounted on the exterior of a wall (for full air-flow) and/or on a METAL junction box with the low-voltage terminals fully exposed.... the metal acts as a heat-sink to help dissipate heat.


What is the meaning of "dry up and blow away" in these sentences?

Question:
"The Canadian flag's supposed to be a symbol of power... it's a leaf!
Yeah, don't mess with us or we'll dry up and blow away!"-Jeremy Hotz
Suppose that truth had simply dried up and blown away in the blasting wind of nuclear anxiety, cultural relativism,and psychological self-reflexiveness?
If Immermann ever dies or leaves, the settlement will dry up and blow away without the  trading post to keep it going.
Comment: it's a metaphor- picture what happens to a leaf that falls from a tree. What happens to it after it falls? It dries up, becomes brittle and light, and eventually gets blown away by the wind.
Comment: What else can leaves that have been separated from their tree do?
Comment: As Jim explains, it is a obvious metaphor (I guess it's not even "an idiom" since it's more or less literal, err, in a metaphoric sense) ... it means nothing more than "turns to dust" or "gets old" or "fades away".
Comment: "Why don't you just dry up and blow away" is an old (50 years at least) childish insult.  It means "go away and don't bother me", but the image evoked is of, eg, a green plant drying up in the summer's heat and eventually breaking apart and blowing away.
Comment: The message is, "How can something that can only dry up and blow away be a symbol of power?"
Answer: "Dry up and blow away" is a phrase that is meant to evoke the passage of time affecting something until it's entirely gone. The drying up portion of the image is meant to illustrate a loss of vitality, as living things shrivel and dry up when they reach the end of their lives. So a slightly different formulation of the phrase, "it looks like it could just dry up and blow away" describes something that is so weak, that it is on the brink of death.
In the first case, Jeremy Hotz is making a joke about the Canadian use of a leaf as a symbol. He implies that Canada is proclaiming that it is as weak as a leaf without a tree, something that is very likely to dry up and blow away. What he's saying is that the Canadian flag, and therefore Canada, doesn't project a frightening image.
The second case is saying that in the environment described, the truth suffered so much that it might as well have disappeared entirely. The simile at play is asking you to imagine the truth as a physical thing left out in a desert, a harsh sun of bad ideas grilling it until it is reduced to dust that blows away.
In the third case, Immermann is implied to be the lifeblood of the settlement. Without it, the settlement is expected to be incapable of surviving, again bringing us to the mental image of something drying up and blowing away.
Comment: An exceptionally complete and excellent answer!
Comment: Hi Soud.   It's worth noting that many - almost any - phrase can be "re-used" in a slang sense, in certain ways.  You wanted to know the general, real, normal meaning of the phrase, indeed **as in the three sentences given**, you now know it.  It's confusing and dangerous to latch on to subtle, slang meanings - when you start out not having a clue what the phrase means.  There are dozens of phrases (meaning basically "old") that are used by teenagers in that way. Hope it helps.
Answer: I don't know the quote of Jeremy Hotz. Looks like the gag of a comedian. The first part (meant as a symbol of power) is taken out of thin air. Flags often show something that is characteristic of the country and Canada is rich in forests. So the symbol of a leaf is not a symbol of power, but simply saying something about the nature of the country. The second part is just a comedian's gag.
Answer: My take on this from the way this was used in the 1950's is if someone is "all wet" (totally wrong) they should "dry up and blow away."
Answer: Dry up and blow away are phrasal verbs in English. These are verb constructions characteristic of English, and which are essential to understanding (especially casual) English and to sounding like a fluent, relaxed speaker. They consist of an ordinary verb, just as you would find in any language and as can be used on its own, plus one or more verb particles, which are almost always re-used adverbs or prepositions that originally mean something else.
Phrasal verbs in English have their own logic, and often mean very different and surprising things from what the bare verb part of the phrasal verb means. For example, "get" means something like take, accept, receive, or suffer; but "get on up" means rise or assume a standing position, with the "on" providing an additional nuance of familiarity and ease. "Get on up and dance!"
In this case, though, the verb particles are only adding to the basic meaning of the verbs, and not drastically changing them.
To dry means to lose or expel water. To dry up means to lose or expel water to a point of completion, which is a common application of "up" when used as a verb particle. To grow up, for example, means to achieve adulthood. So dry up means become completely dry.
To blow away means to be carried out by wind. Exactly where it goes? This doesn't say. It only says that it went further from the speaker.
Incidentally, the word "away" actually changes the normal valence of the verb "blow." This verb expresses wind-like motion, but by itself, it describes wind on its own, or wind causing movement to something else. "The wind blew away the leaves" is a sentence; but we could also say "the leaves blew away", which doesn't mention the wind, and reverses the perspective, even though the two sentences mean the same thing.
We'll dry up and blow away means that us, the leaves, will in the end expire of moisture and disappear.
Such is not only the fate of Canadians.


unable to click on button

Question: am creating login application for both orientation,
First loginController works fine for both orientation, but next view i.e. updateController creates problem.
I created two views for updateController as LandscapeView and PortraitView.
In IB i link 'PortraitView' to File's Owner 'view', so that it's work fine but when my orientation is changed to 'LandscapeView' then it's loaded fine but can't click buttons on it.
Why does it happens?
Answer: Your IBAction methods you invoke with clicking a button most likely is connected with the Interface Builder in one view but not in the other

unable to click on button


What does it mean 'to have fame in' or 'to be famed in' God?

Question: Source: Historia Anglorum [...], by Henry of Huntingdon, edited by Diana E. Greenway

[p 496, online English translation:]  Tell me, I pray, what gain has it been to us to have been great or famous? [1.] We had no fame at all, except in God. [2.] For if we are famed now in Him, we shall still be famed in your time, as lords of heaven and earth, worthy of praise with our Lord God, by the thousands of thousands who are in the heavens.

Google Books's concealment of pages prevents my discovery of the translation's date, but the above use of  fame seems olden; so I referenced Etymonline and OED:

famed (adj.) [=] "much talked about," 1530s, past participle adjective from fame "spread abroad, report" (v.), c. 1300, from Old French famer, from fame "reputation, renown" (see fame (n.))

How can you have fame IN God?
Also, how can you be famed (ie: to be reported) IN God?

From my (troglodytic) Latin translation below, I am guessing that Henry is being ironic: Henry admits that aristocrats' fame (like his) has illuminated nothing, except what is in God. The irony is that an omniscient God needs no illumination. So their fame has illuminated nothing.

[p 496, Original Latin:] Dicite, precor, quid nobis profuerit, si magni uel clari fuerimus?
   [3.] Nichil prorsus nisi in Deo claruerimus.
  [4.] Si enim nunc in eo claremus, et uestro tempore
  clarescemus, cum Domino nostro domini celi et terre, milibus milium qui in celis sunt collaudabiles.

My troglodytic Latin translation: 3. Nothing certainly if not in God we have clarified.

If because now in there we clarify, and your time we will clarify, with master our of the master sky and earth, by the thousands of thousands who in the sky are laudible.

PS: Another such use can be found on p 290 of The Philosophical Works: In Five Volumes, Volume 4, by  Henry St. John Bolingbroke (1678-1751).
Comment: This is very old/archaic English. It would not make sense to use "fame" as a verb in modern writings.
Answer: Their fame, as with all their achievements, are humbly attributed to God; that is, it is only by his grace that they are able to achieve "fame". The credit does not accrue to, nor reside "in" their own efforts, but "in" God's grace expressed through their actions.  The apostle Paul often wrote in this manner.
Anything deeper than this would be a question for the Religion SE.


Link to Existing View from another view

Question: Im trying to create a view that should have a field which links to a pre-existing view (And Permissioned appropriately). Ive looked into various modules and field options but cannot find it (Newbie to Drupal!).
Basically, I have a view(called, Recipe_Filter) where I have some filters for selecting recipes based on various conditions. I have another view where I show recipes for a particular user and also want to create an "Edit" link that points to Recipe_filter. The problem is that I dont want normal users to see the "Edit" link and only certain roles to be able to view this.
I tried suggestions like the one in this but if I do as in that link, I see a "Edit" link and clicking on it shows a "You are not authorized  to access this page" text. I would like to disable the Edit Link if the user doesnt have access.
Are there modules that will allow a link to an existing view and permission it (like how the standard "Edit to content" or "View to content" works). Any help or pointers would help a lot.
Answer: I was able to solve it using Views PHP Using some custom PHP to show the "link" only if the user has permission. Not sure if thats the most elegant way.
I would like to know if there is a better approach to solving this. Thanks!

Link to Existing View from another view


Analytical derivative of nuclear-electron attraction integrals over gaussian functions

Question: I'm currently writing a program which evaluates the first derivatives of molecular integrals (over gaussian basis sets) with respect to the cartesian coordinates of the nucleus. I'm somewhat stuck with the derivative of the nuclear-electron attraction integral, i.e.:
$$
\frac{\partial V_{\mu\nu}}{\partial X_A}=\frac{\partial }{\partial X_A} \left\langle \mu| \hat V |\nu\right\rangle $$
where $\mu$ and $\nu$ are Gaussian-Type Orbitals (GTOs) and $\hat V $ is the operator:
$$
\hat V = -\sum_A \frac{Z_A}{|r-R_A|}
$$
As was previously discussed on this forum, the upper derivative can be expressed as a sum of derivatives applying the chain rule:
$$
\frac{\partial }{\partial X_A} \left\langle \mu| \hat V |\nu\right\rangle=\left\langle\frac{\partial \mu}{\partial X_A}|\hat V|\nu\right\rangle+\left\langle \mu|\frac{\partial \hat V}{\partial X_A}|\nu\right\rangle+\left\langle \mu|\hat V|\frac{\partial \nu}{\partial X_A}\right\rangle$$
The first and latter terms are relatively easy to evaluate, since the derivative of a Gaussian-Type Orbital with respect to one of the coordinates of the point where it's centered is a sum of GTOs with higher and lower angular momentum. The evaluation of the middle term doesn't seem so obvious. According to Szabo & Ostlund (pg. 442), the derivative of the $\hat V$ operator is:
$$
\frac{\partial \hat V}{\partial X_A}=-Z_A\sum_i \frac{X_i-X_A}{r_{iA}^3}
$$
where $\mu$ and $\nu$ are Gaussian-Type Orbitals (GTOs)
So we are dealing with a new type of molecular integral:
$$
\left\langle \mu\left|-Z_A\sum_i \frac{X_i-X_A}{r_{iA}^3}\right|\nu\right\rangle
$$ After searching for some time, I couldn't find any reference which discuss this topic. Could you provide some insight on the evaluation of this particular integral? Thanks in advance.
Comment: +1 bur have you considered using automatic derivatives, or the analytic derivatives code from open source packages?
Answer: Like two-electron integrals, the nuclear attraction integrals are evaluated using the Laplace transform
$$ \frac 1 {r_{12}} = \frac {2} {\sqrt{\pi}} \int_{0}^{\infty} {\rm d}t e^{-t^2r_{12}^2} $$
It would seem that using this transform also makes the derivative integrals easy to evaluate.
Comment: Nit pick about "are evaluated" - there are other methods, you can use a Fourier transform for instance which makes particular sense for the Nuclear Attraction integrals as it is a convolution between the charge distribution due to the basis function overlap and the potential due to the atomic point charge.
Comment: @IanBush sure but that's not how it's done in McMurchie-Davidson, Obara-Saika, or the Rys quadrature algorithms that all rely on the above expansion. Of course it doesn't matter at the end how you come to the solution, the point being that one doesn't even try to compute the integral for the original definition but instead makes a transformation...
Answer: The original Obara-Saika paper contains formulae for this in the "Electric field and electric field gradient Integrals" section of the appendix towards the end of the paper
Comment: Why the downvote? When I have time and energy I hope to enter the complicated MathsJax here, but what else can I do to improve this?
Answer: The direct computation of the derivative of the nuclear-electron attraction operator can be simply avoided.
Remember that in the McMurchie-Davidson algorithm, the Coulomb integral is reduced to a form, which requires contraction of the E and R tensors.
To get the derivative to an atom center, it just needs to change the index of the R tensor (see Molecular electronic-structure theory (T. Helgaker, P.Jorgensen, J.Olsen), chapter 9.9.3, p.376).
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


When will the blockchain be pruned?

Question: AT what stage will the blockchain be pruned? With more update of bitcoins the blockchain will start growing exponentially making downloading thereof impractical.
Answer: This is on the to-do list for the developers.  One proposal is to remove transactions that have been completely spent if they are fairly deep in the block chain (that is, there is minimal chance that a block chain reorganization could occur which would affect the transaction)

When will the blockchain be pruned?


Test size with small dataset with class imbalance

Question: what would a good split train/test be, having a class imbalance problem in the dataset and a small number of observations (<5000 obs)? Would it make sense to consider k-fold cross validation (e.g. 5)?
Answer: If training is not too expensive, cross validation with as much folds as possible (even leave-one-out) is better. Because, let's say you have only 1% of the minority class, i.e. ~50 samples in your case, a single train/test split (like 80/20) might mean only 10 minority samples, which could increase the variance of your evaluation metrics.
Comment: Practically, 90:10 in 5K samples is not too bad, and k=5 fold seems well enough. Note that this always depends on the specific data. As I mentioned, more folds is typically better but for each problem you get diminishing returns after some k. Oversampling is fine unless you apply it to test set.
Comment: It's just out of experience. I'm afraid I can't provide you with a formula to achieve "ok"ness :) Together with the complexity of the problem, it heavily depends on the algorithm used as well. With 5K samples, and a large deep neural net, it wouldn't probably be ok, too. But, with a decently complex algorithm, a 90:10 imbalance means 500 minority samples and 400 of them will be in your training set, which could be representative enough for some sets of problems to some extent, e.g. iris dataset. You should try and find out the sweet spot of your data, but as a starting point, it feels ok.
Comment: Thank you so much for your answer, gunes. What about considering a k-fold = 5 instead of 10? The imbalance ratio is 90:10. I was considering 80/20 with oversampling techniques on training set
Comment: thanks a lot, gunes. One more question: in case of 90:10, would it be ok to consider a train/test split of 80/20 or it would be too much?
Comment: It seems ok in case of 5K samples
Comment: thanks. Can you explain me how to understand if it is ok? I am asking because probably I would have said 70/30. For example, if it was between 3000 and 4000, would it be still ok?


Error ORA-01034: Oracle not available

Question: I have an old Novell server which runs DocsOpen.
I know very little about this system, basically we had a disk fault which halted the system.
The server was rebooted and came up, I had to manually mount the DATA volume and then reboot again.  All seems to be working but nobody can get in to DocsOpen, getting the error ORA-01034: Oracle not available.
Answer: Apparently Oracle is not running. Did the server survive reboots in the past? The reason I ask is that the commands to load Oracle may appear in AUTOEXEC.NCF, which is executed automatically each time the server is restarted, or may be entered from the server console manually each time after the restart.
This file is located in SYS:\SYSTEM, you can view it from a workstation connected to the server, provided you have enough rights to do so, or you can run EDIT from the server console and navigate from its file selection menus to the file.
To exit EDIT.NLM, press Esc
Comment: I have already found the command in the autoexec.ncf and I commented it out so I can run it manually.
When it was starting in the autoexec.ncf it started the manager and then stopped (or just dissapeared) - didn't look like there was any errors.
Comment: Try to repair the DATA volume. Depending on the version of NetWare you're using and the filesystem on the DATA volume, you'll either need to dismount the volume first with DISMOUNT command, run VREPAIR and follow the menus, or use NSS /POOLVERIFY command and select the volume from the list. Either way, you'll need to mount the volume with MOUNT command after repairing it. You probably can determine what way to use by running VOLUMES command and checking the file system type of the volume in the last column titled Flags. If it shows NSS, select the second way. Good luck :-)

Error ORA-01034: Oracle not available


How do I convert bitcoins into Brazilian currency?

Question: I have a Bitcoin wallet for a mobile device. How can I convert bitcoins into Brazilian currency?
Comment: @Geremia no idea how to vote but I'm voting on that too!
Answer: To find an exchange in Brasil you can try buybitcoinworldwide.com. There are many exchanges, the site does not list all of them.
Most exchanges that let you buy bitcoins also let you sell (for a fee of course).
Answer: You can calculate that in mind easily!!
1 BTC equals $10,000. $10,000 equals 45346523136 BR.


Good books about the history of computer science and its pioneers?

Question: I have read a book 'Men of Mathematics' by Eric Temple Bell, which includes the development of mathematics through ages and the biography of famous mathematicians . I am looking for such an history oriented book about computer science and the computer scientists. Can anyone suggeste me any such books and I am unable to find any proper book through google. Thank you
Answer: Disclaimer: I haven't read that book.
I don't think it's quite the book you're after, but Herman Goldstine's The Computer from Pascal to Von Neumann might be a good start. It's specifically about computing machinery rather than computer science, but talks about many of the main players such as Charles Babbage, George Boole, Herman Hollerith, Vannevar Bush, etc.
It stops the story around EDVAC, which is just at the point where software started getting interesting.
Comment: Thank you very much for the book @Pseudonym.


How can I tell if an RF transmitter is transmitting?

Question: In my project, I use a use an RF transmitter and receiver.
One of the RF components seemed to fail because the connection between my Arduinos no longer works. I cannot determine whether the RF receiver or transmitter works.
I want to see if my RF transmitter gives an output, but I do not own an oscilloscope to view it's waves.
I've seen this answer, but it only shows if the Arduino is sending data to the RF transmitter. Is there any alternative way to check if the RF transmitter works or not?
Comment: This thing detects approximately 1 mS bursts of 2.4 GHz from a nRF2401 type transceiver.
Comment: You should be able to make a small loop antenna ("sniffer") with a UHF diode and capacitor. Connect this to a voltmeter on DC and hold the loop close the rf transmitter. You should see a hundred milli volts when/if it is transmitting.
Answer: Build a simple detector with some diodes:

simulate this circuit – Schematic created using CircuitLab
If you just want to know if there is some signal, and aren't concerned with accurately measuring its strength, or demodulating it, you can throw this together with just about any components and it will work. Ideally the diodes have a low forward voltage, so they are Schottky diodes, like 1N60, or 1N5711, or a germanium diode. If you don't have any of those, probably an ordinary 1N4148 works too. Use whatever you have.
The capacitor is also not terribly critical. A cheap ceramic disk capacitor will work fine; whatever value you have.
The antenna is just a piece of wire. Connect the ground to something else, like your Arduino's ground, or the case, or another piece of wire. Not especially critical.
The hardest part is probably the ammeter. This needs to be a very sensitive meter -- on the order of microamps. Ideally, an analog meter, since it will be easier to see the changes in signal strength. A digital meter will work also, if it has a low enough range. It will just be harder to read.
Test the circuit by putting the antenna near a source of noise, like a computer monitor, or a motor, or your wireless access point, or your laptop's WiFi antenna, or any other radio transmitter you have that you know works.
Then, put it near your RF transmitter. Try transmitting something. If the ammeter moves, it's transmitting something.
Comment: @zeldarulez either. It doesn't even have to be connected to anything, really. You could just make it another wire, and then you have a [dipole antenna](http://www.antenna-theory.com/antennas/dipole.php).
Comment: Thanks for your answer! Just to clarify, is the ground connected to earth or my circuit?


Lévy and Lévy Prokhorov metric

Question: I was reading "On choosing and bounding probability metrics" (https://www.math.hmc.edu/~su/papers.dir/metrics.pdf)
and encountered the Lévy distance,defined by
$
d_L(\mu,\nu):=\inf\lbrace{}\varepsilon>0\,:\, \mu((-\infty,x-\varepsilon])\leq\nu((-\infty,x])\leq\mu((-\infty,x+\varepsilon]), \forall x\in\mathbb{R}\rbrace
$
as a special case (on $\mathbb{R}$) of the Lévy-Prokhorov distance, defined by
$
d_P(\mu,\nu):=\inf\lbrace\varepsilon>0\,:\,\mu(B)\leq\nu(B^{\varepsilon})+\varepsilon,\forall \text{ measurable }B\subset\mathcal{X}\rbrace
$
In the transcript it said that $d_P$ metrized weak convergence. It is clear that $d_L\leq{}d_P.$
Additionally it mentioned that $d_L$ metrizes weak convergence too, which I don't quite understand since it is only bounded from above by Lévy-Prokhorov. For it to metrize weak convergence it should have to be equivalent to $d_P$, which I don't believe it is. Or maybe I'm mistaken. Can anyone explain?
Thanks a lot.
Answer: I think you may be confusing «topologically equivalent» and «uniformly equivalent», which is an easy thing to do since both notions coincide for norms.
Convergence in the Lévy metric is equivalent to convergence of the cumulative distribution functions at all continuity points of the limit, which is the usual definition of convergence in distribution in the real line, i.e. weak convergence.

Lévy and Lévy Prokhorov metric


Why am I protecting files when I use my back focus button?

Question: I just learned how to use my back focus button on my Nikon D5100.   I have been accidently causing about ten percent of my photofiles to be protected.  I cannot delete them in camera.  I do not know how I am doing this.  I must be pushing the wrong button or something.  What mistake am I making?
Comment: Just a note, if you want to be sure to erase all images, you can format the memory card from within the camera. deletes everything from the card including protected images
Answer: I have a D3200, but I suspect they work the same with this. That button does double duty, both as back-button focus (in shooting mode) and as image protection (in reviewing mode). When the camera displays the image you just took, it goes into reviewing mode, so pressing the lock button will protect the image instead of focusing. Two possible solutions:

Disable Image review. The setting is in different places on different cameras;  according to KenRockwell.com (about halfway down the page, with the explanation of the Play button), this is under MENU > PLAY > Image review on the D5100. With image review disabled, you'll stay in shooting mode, so the button will focus instead of protecting the image you just took.
Push the shutter release down halfway before focusing. This will turn off the image review and go back to shooting mode.

I personally prefer (and use) the first method, since it allows me to shoot faster and (potentially) saves battery life (since the LCD doesn't come on with every shot). Either one should work, though.
Comment: Not directly relevant to the question, but on the D3200 the Image review setting is at MENU > PLAYBACK MENU > Image reveiew.


Plea bargaining in the UK

Question: It's been mentioned many times on this site that 90% of criminal cases in the U.S. never go to trial, and instead end up with a plea bargain (or guilty plea).  Does the same statistic generally hold true for the UK?  If not, what are the reasons?
Comment: I strongly suspect that a very large percentage of criminal cases in the UK end with a guilty plea as part of a plea agreement, but I have not seen actual figures.
Answer: There is no direct equivalent to the American-style plea bargain, but there are some similar procedures:

Basis of Plea

A defendant can offer a written guilty plea to a lesser offence with the same (or closely similar) facts as the offence charged, which has to be accepted by the court to take affect. The prosecutor must consult with and seek the views of all victims, and if the plea is accepted it must not be misleading or untrue. The Attorney General's Guidance provides more information on the process and the detailed requirements (which are too long to repoduce here).

Assisting Offenders

The Serious Organised Crime and Police Act 2005 offer the option for a "minor-player" defendant to assist the prosecution and/or police by providing information to secure convictions of the principle offenders in return for immunity from prosecution (section 71), a restricted use undertaking (a version of immunity) (section 72) or a reduced sentence (section 73).
Immunity requires full and frank disclosure of all previous offending (referred to as "cleansing"), but for whatever reason the defendant does not "cleanse" they may still be eligible for a lesser sentence. Either way the assistance - either as evidence at trial or as intelligence given in confidence - should be substantial and verifiable to be eligible.
Statistics
There is, as far as I can, no publicly available detailed statistics on these procedures,  presumably the reason is that vast majority of the former cases go unreported and, despite some being public, there is a real risk of retribution to the informant in the latter.
Comment: Seems to be about 70% (in Crown Court) that don't go to trial. https://www.gov.uk/government/statistics/criminal-court-statistics-quarterly-april-to-june-2021/criminal-court-statistics-quarterly-april-to-june-2021#guilty-plea-rates
Comment: Indeed, it's hard to find the number of plea bargains separately but IMHO having some figures to compare with the "90% of criminal cases in the U.S. never go to trial" statement would better address the quantitative part of the question than none.
Comment: @richardb Yep, but that's the total of guilty pleas, not those with an accepted basis (aka a"plea bargain") which is presumably lower.
Comment: The fact that the offenses are in Crown Court makes the numbers more credible and  comparable. People may unconditionally plea guilty to minor offenses that are actually genuinely disputed simply to avoid the hassle. This kind of behavior when facing a conviction for a serious offense in Crown Court while a defendant is represented by appointed or retained counsel and years in prison could be at stake seems far less likely.

Plea bargaining in the UK


Get local href value from anchor (a) tag

Question: I have an anchor tag that has a local href value, and a JavaScript function that uses the href value but directs it to a slightly different place than it would normally go.  The tag looks like

and a JavaScript function that looks like
baseURL = 'http://www.someotherdomain.com/';
function follow(item) {
    location.href = baseURL + item.href;
}

I would expect that item.href would just return a short string of "sec/IF00.html", but instead it returns the full href, "http://www.thecurrentdomain.com/sec/IF00.html".  Is there a way that I can pull out just the short href as put in the anchor  tag?  Or do I lose that by natural HTML behavior?
I suppose I could use a string manipulation to do this, but it gets tricky because my local page may actually be "http://www.thecurrentdomain.com/somedir/somepath/sec/IF00.html", and my href field may or may not have a subdirectory in it (for ex href="page.html" vs. href="sub/page.html"), so I cannot always just remove every thing before the last slash.
You may wonder why I am requesting this, and it is because it will just make the page a lot cleaner.  If it is not possible to get just the short href (as put in the anchor  tag), then I could probably just insert an extra field into the tag, like link="sec/IF00.html", but again, that would be a little messier.
Answer: The below code gets the full path, where the anchor points:
document.getElementById("aaa").href; // http://example.com/sec/IF00.html

while the one below gets the value of the href attribute:
document.getElementById("aaa").getAttribute("href"); // sec/IF00.html

Answer: document.getElementById("link").getAttribute("href");
If you have more than one  tag, for example:

You can do it like this: document.getElementById("link")[0].getAttribute("href"); to access the first array of  tags, or depends on the condition you make.
Answer: This code works for me to get all links of the document
var links=document.getElementsByTagName('a'), hrefs = [];
for (var i = 0; i<links.length; i++)
{
    hrefs.push(links[i].href);
}

Answer: In my case I had a href with a # and target.href was returning me the complete url. Target.hash did the work for me.
$(".test a").on('click', function(e) {
    console.log(e.target.href); // logs https://www.test.com/#test
    console.log(e.target.hash); // logs #test
  });

Answer: The href property sets or returns the value of the href attribute of a link.
  var hello = domains[i].getElementsByTagName('a')[0].getAttribute('href');
    var url="https://www.google.com/";
    console.log( url+hello);

Answer: this worked for me
document.getElementsByTagName('a')[0].getAttribute('href');

Answer: document.getElementById("aaa").href; //for example: http://example.com/sec/IF00.html

Comment: The OP already tried that, and it doesn't give him the desired results.


How can I "reclaim" the MX control of domain where former employee configured Gmail to handle mail?

Question: A former employee had configured Gmail to handle their work email (an address that is @ an alias—herein called "example.com"—for our primary domain). The employee left and is not cooperative. I tried to forward all email for that domain to another address, but get the message that "Forwarding rules conflict with other DNS records." When I use Terminal to get MX records for that domain (i.e., "$ host -t mx example.com"), the response is that "example.com mail is handled by 5 ALT1.ASPMX.L.GOOGLE.com" (and 4 other Google servers)
How can I "reclaim" the MX control for that domain?
Comment: I'm not sure how you tried to "forward" the emails.  It shouldn't be a DNS setting to do that, you'd have to do that on your mail server (in other words a setting in Google.)
Answer: First thing you need to do is find where DNS is hosted, this might be revealed by the nameservers e.g. ns1.hostingexample.com or ns1.domainseller.com  You say it is a .com so try https://lookup.icann.org/en
Once you have that, log into that place and you should have a DNS editor of some sort.  If it is a cPanel server, look for the zone editor.
In the DNS zone editor you should have access to the MX records.  If it were me, I would change the MX Record to mail.example.com and then make sure there is an A Record for mail.example.com pointing to the IP address of your mail server.
Answer: I assume you know where you want email to actually go. If not, figure that out first.
Every primary domain (domain.tld) is registered with one of the official registrars.  There are a number of them, depending on the tld (top level domain).  Among the information managed by the registrar are the "name servers" for the domain. These name servers are where the DNS information for the domain is managed.  Included in the DNS information is the MX records, which specify the mail servers handling email for the domain.
The easiest way to find this information out is to use MXToolbox, which is an awesome tool. Go there and enter the domain.  I will use StackExchange for reference.

It tells you the MX records.  StackExchange uses Google as well. You can then use their DNS Lookup tool to get what you need.

In this case, StackExchange uses Amazon Route 53 for DNS.  If you do the same thing for your domain, you should be able to see who provides your DNS. Whoever that is, you need to get access to their management console and update the MX records for your domain.
NOTE - if your domain email is being sent to Google, there is a Google Workspace console somewhere for your domain, and you may well be paying for the Workspace domain. You may want to figure out how to get access to that console.  Start with Google support to figure that out.


Updating game gta5

Question: Ok, so I got GTA V for my PS4 today. I put disc in it, and it said update available; so I went ahead and updated it. After it updated it said couldn't continue with application as something was corrupted. And to eject the disc and delete application so I did that. I inserted the disk back in it said update again. But I tried to play it without updating, But instead it was installing. After it had finished it said disc was damaged, etc. Which it wasn't as game was brand new. I tried to update again but I gave up. What am I doing wrong?
Comment: How much storage space is available on your PS4? And that sucks ;(
Comment: I am not sure I will check how much when it's finished updating yet again. Today it said in downloads to continue updating so I did n it updated file. Then it said installed after that had finished it said error has occurred
Answer: I had the same issue, but for pc. You might be able to go back to the store you bought it from, and say that is broken. And If they're generous they might give you a new one. (Make sure you have your receipt though!) If this doesn't work either contact Rockstar Support, Use the "Banana Disk Trick" or buy a new one. (Last one is a last effort, I recommend trying the other ones first, obviously!)
Comment: Also, you might be able to download it from the PS4 store, If it's in the Disk Tray.

Updating game gta5


What is the longest period of time which Riker commanded the Enterprise-D?

Question: Often we see Picard say to Riker: "You have the bridge Number 1", and I was wondering what the longest period of time that Riker was in command of the Enterprise-D for.  I don't count just when he was acting-Captain (as in Best of Both Worlds), but also when Riker is in command whilst Picard is on an away mission.
Answer: Probably the longest period we have evidence that Riker was in command of the Enterprise would have been Gambit at the start of season 7 - Picard was first on leave, and then "murdered", and then a few days later Data took command after Riker was kidnapped.
However, there isn't a definite stardate reference until the start of the episode where the Enterprise is already investigating the initial disappearance of Picard, so we can't say exactly for how long Riker had command.
Answer: In the alternate timeline in All Good Things Admiral Riker had command of the Enterprise D probably for about 5 years.  He mentioned they were going to decommission it 5 years ago, but his privilege as a admiral was to pick his ship.
Comment: Well, if we accept Abrams, then nothing counts since it is all an alternate timeline?  :p
Comment: Good point.  I'm considering the TNG timeline (ergo, the events of TNG occur).  All Good Things can't occur, because of the destruction of the Ent-D in Generations
Comment: +1| I'd forgotten about that, but as it's an alternate timeline, it doesn't count - sorry (I should have specified that)
Comment: @Zoredache The JJ-verse is the _alternate_, thank you very much. (+1, because the question was never updated to say that alternate timelines didn't count.)
Answer: If we're counting alternate timelines then we should certainly consider the gap between the invasion of Earth (by the Borg) and the events of TNG : Parallels. It seems that Riker has been in temporary command of the Enterprise for at least 3-5 years. Locutus (and his Borg chums) have overrun the Federation and it's unlikely that anyone's actually left to confirm his appointment to full captain.

If we're sticking with genuine timelines only (boo hiss) then it's almost certainly TNG: "Unification I & II" or TNG: "The Chase". In both episodes there's no specific stardates given but the Enterprise travels to multiple planetary locations under Riker's command which would strongly suggest that weeks (at least) may have passed.


Can I make a case for authorship if I spend two weeks running a series of repetitive experiments for my PI?

Question: I am a postbac working at a national lab. I have a project that is funded through an outside source, but my PI and postdoc informed me that they need me to spend the next two weeks completing a series of repetitive experiments they don't have the time to do for an alternative project. These experiments are required to satisfy the peer review criteria of the paper. Can I make a case for myself to attain authorship within the paper?
Comment: It depends a bit on the norms of your field, but no, running repetitive experiments is generally not considered an intellectual contribution to a paper, and therefore not sufficient for authorship. Also, two weeks is really a very small contribution in most fields.
Comment: What does the PI say about this?
Comment: How did the PI answer when you asked her?  (You *did* ask her, didn't you?)
Comment: "I tried to talk to her about it yesterday, and she avoided me."  Try again, and try harder.  It seems unlikely that your PI can actually avoid talking to you about this (given that you are doing work for her so must be in somewhat regular contact with her) if you are sufficiently determined.  "I don't want to ask for anything that's totally unethical" You shouldn't ask **for** authorship.  You should ask about the standards for authorship and whether they are or can be met in your case.  That is flawlessly ethical behavior.  Don't be shy: just do it.
Comment: What is a postbac?
Comment: She has not said anything to me.
Comment: I tried to talk to her about it yesterday, and she avoided me. I am going to ask her, but at the same time, it is just a bit awkward for me. I don't want to ask for anything that's totally unethical, and when I do ask her, I want to give her a proper answer to why.
Comment: I guess: "bac" = "bachelor's degree", so "postbac" someone with a bachelor's degree working in the lab.
Answer: The short answer:
It does not hurt to ask, and a good mentor or PI will explain the criteria for authorship and their reasoning for why you have/have not earned authorship.  It is a teachable moment.
The longer answer:
Different journals give different criteria for authorship, and this is usually explicitly stated in the guidelines for authors.  In your question you mention that the experiments need to be performed to satisfy peer review.  If the article has already been reviewed for a particular journal (and perhaps now it is in a revision stage) then you and your advisor know which guidelines to check for their description of authorship criteria.  That said, it is a common criteria to require intellectual contribution (rather than simply data). If that is the case, and if you are very interested in this work, you could offer to help edit the paper.  However, if the paper has already been submitted, it can be challenging to add an author (for some journals this requires all other co-authors to sign off on the new addition).  If the paper has not yet been submitted, and the target journal is undecided, you really should discuss this with your advisor (which you should do in any case).  Personally I have worked for months on projects where I was not a co-author on the write-up when I was paid to primarily collect data.
Comment: Great answer that brings up 2 key points: intellectual contribution and paid work.  In my experience authorship is usually extended to paid early-career technicians as a courtesy or mentoring opportunity.
Answer: In addition to the answer provided by user2860703, you may also need to consider the policies of your university. In germany, almost all universities follow the recommendations of the DFG (German research agency) (pdf, german). It explicitly excludes "honorary authorships", and states as one of the reasons that do not qualify you as an author (page 30 of the linked PDF) "purely technical assistance in data collection" ("lediglich technische Mitwirkung bei der Datenerhebung").
To qualify (as per these rules), you would need to make "significant contributions to the concept, development, analysis / interpretation and writing of the paper" ("Konzeption der Studien oder Experimente, zur Erarbeitung, Analyse und Interpretation der Daten und zur Formulierung des Manuskripts"). Disregarding this policy is academic misconduct and may, in the worst case, lead to your degree being revoked.
I have not heard of a case where a degree was revoked because they gave someone a honorary authorship, but be aware that these rules exist if you work in germany, and that your institution may have similar or additional rules for this. Enforcement of these policies probably varies across institutions and countries.
Answer: This is just my 2 cents, but I think far too many of the answers here reflect "ideal science" rather than what actually happens. You don't get authorship on a paper because you met all the requirements for authorship that the journal asks! haha, gosh, no way. Here are what I suspect are the most important factors that contribute to authorship ranking (in Biology):
1) Person Directly Responsible for the project.
Is it a PhD project (where a PhD student is directly responsible), or it's a project being supervised by a post-doc (who is directly responsible) but work is being carried out by others? The PDR has the most right to authorship, regardless of how much time at the bench they put in. When i was a BSc, I did months of work for a post-doc, and of course I wasn't an author on anything, because it was his project not mine.
2) Person who wrote significant portions of the paper.
This is surprisingly the second most important factor, after the PDR, because it's very difficult to justify being higher-up on the authors list of a paper that someone else physically wrote. Often the PDR is also the person who writes the paper, so this is rarely an issue, but when thats not the case it's important to bare this in mind. There's a person in my lab who wrote up a paper using the results from a PhD student who after graduating (but before publishing) left for a post-doc. The ex-PhD student being the PDR is number 1 on the paper, and the person who wrote it up is number 2. Myself, a PhD student who contributed a key experiment (and considerable time) to the project, was somewhere in the middle, because I obviously have no leg to stand on demanding authorship on something i didn't write.
3) External lab wild-card bonus.
The more your PI wants to collaborate with an external lab that did something on a paper, the more likely that external lab will be placed high on the authors list. This is particularly true if the external lab is a medical facility which provided sample material. I've seen people who have supplied biopsies being credited as 1st author over the PhD students who worked for 3+ years on the project because the PI needs to maintain a good relationship with that medical facility if they are to expect more samples in the future. More often than not though, these people end up as 2nd/3rd authors with everyone else apart from the PDR and PI wondering who the hell they are.
4) Results contributed.
This is different to work, because results are measured in figures, not hours. Basically, if one of your experiments determined the take-home message of the paper, you contributed a result. If your work added support to the take-home message, that may or may not be a result, depending on the PI. Statisticians/Bioinformaticians can get lucky or unlucky here, depending on how well their PI understands their job. If you run data through a standard analysis pipeline and the results end up looking interesting, and this may give the bioinformatician more authorship credibility to some PIs than the PhD student who had to optimise the protocol to get that data in the first place (even if that optimization took months/year), because the output of protocol optimisation is what we expected to work now works, whereas the running of data through a pipeline lead to a new research direction.
5) Work.
As you can see, work comes pretty low on the list - in fact it takes considerable work to even make it on a paper if you have not contributed results. If you are proving something the PDR knows is likely to be true, as is the scenario in the OP, the chances of authorship are essentially up to the benevolence of the PI/PDR.
Finally, I don't agree with the system we have, obviously, because i've been stung in just about every way imaginable by it - but that's just how it is. Authorship ordering is not a science, it's political, but having been in Academia for a while now i'm slowly coming to appreciate why the system works the way it does - there are often just too many diverse stakeholders in a paper to apply any system other than a political one. There is no authorship formula.
These days, now that i've nearly finished my PhD, i've noticed that this system benefits me more than it used to. I've contributed in small but important ways to numerous projects, and as a result my authorship average is getting higher for less work. No doubt, any system that benefits those who know it the best, is a system that is likely to remain until it gets overthrown by the angry masses.


How do I make Grails execute shell commands just before creating war file?

Question: Let's say I want to do git pull origin master just before preparing a war file.
Comment: You would have to write a batch/shell script to do all of it via CLI, if you are using Jenkins to work on repos.. then take a look at jenjir plugin
Answer: To do something before the war is packaged, use the "CreateWarStart" event, e.g. as described in this answer. To actually run the Git command, use can use Groovy's ability to execute commands as strings, e.g. 'git pull origin master'.execute() (see the docs here) or do it more programmatically with ProcessBuilder like you would in Java, and optionally wrapped in a shell script to abstract the details away from the web app code.


View default record type on all the objects on a particular profile

Question: Is there any way we can view the default record type for all the objects custom/standar for a particular profile rather than going on each object and checking its default record type  because there are more than 700 objects in our org and it will take forever to do this .
Any leads,workaround will be helpful
Thanks
Answer: You can go to
Setup -> Profile -> System Administrator (can be any profile; Click on this name)
Look under the Record Type Settings section, it will show all the available record type for the object and the default selection for the profile you are viewing.
Edit:

I just created 2 record types for Account to demonstrate what I meant. This is for System Administrator profile. If I have more record types for the other objects, it will show there and the default record type will have (default) labelled beside the record type name.
Comment: You don't have to open each object to see the default recordType. If you do the steps above, it will show you the default recordType of the object for the profile your are viewing. For example, let's say you have 2 recordTypes in Account object called Rt_A and Rt_B and assume Rt_B is the default recordType for System Administrator profile. Now if you, view the profile under Record Type Settings, under Account you can see something like; Account: Rt_A, Rt_B (default). I have edited my answer above to show what I mean in an image form :)
Comment: Hi Prem I am aware of this but is there any way we can see the default record type of all the objects for a particular profile rather than opening one object at a time because there are more than 700 objects .
Comment: Wohoo thanks a ton you saved me from spending lot of hours :)


Averaging filters

Question: If a signal undergoes repeated averaging (n times) with a filter (h) of size m. Is it possible to achieve the same averaging result with an averaging filter(H) of a larger size?
h = {1/m, 1/m... m times}
Comment: Related: http://dsp.stackexchange.com/questions/5966/equivalent-2d-mask-of-moving-average/5970#5970
Answer: I think you can only approximate the result made with filter of different size, but not to get exactly the same result.
Suppose you use box filter two times. This is same as convolving the box kernel with itself - that yields a "triangle" filter - and then using the "triangle" filter on the image just once.
Using box filter three times is the same as using quadratic filter one. The quadratic kernel is built by convolving a "triangle" with "box". These convolutions eventually lead to a Gaussian filter kernel.
If you perform filtering more times with smaller filter or less times with larger filter, the filter is therefore of different order, hence you can only approximate the result.
The approximation may be sufficient, but the accuracy can be proven by computing multiple convolutions of smaller and larger filters with themselves and then comparing the results.
You may be interested in approximating Gaussian blur with fast box filters - the formulas are given in SVG 1.1 Specs.
Answer: No, it is not possible to achieve the same result with a larger averaging filter.
Convolution is a linear process, so it obeys the law of associativity.  Thus if your signal is $s(t)$ and your filter is $f(t)$ (and we'll set $n$ to 3 just to make the display easier), then we could mathematically describe the filtering as follows-
$$
\begin{align}
a(t) &= ((s(t) * f(t)) * f(t)) * f(t) \\
&= s(t) * (f(t) * f(t) * f(t))
\end{align}
$$
In other words convolving the signal with an averaging filter multiple times is the same as convolving it once with the averaging filter convolved with itself.  So what does that look like?  See below.

As you can see, the filter does get wider, but it also changes form as you convolve it more times.  As Libor mentioned, as $n$ gets large it starts to approximate a gaussian filter according to the central limit theorem.
Answer: It depends on what you mean by the same results. If you're looking to get exactly the same numerical answer, you cannot generally do that. More precisely, filtering a signal with averaging filters of lengths $M$ and $N$ will always give you different results.
In many cases, practically speaking, it may not matter which filter you use if $M$ and $N$ are not much different. It also depends on the flexibility you have with the filters. If you're only constrained by the filter length, you can simply set the first $M$ coefficients to $\frac{1}{M}$, and the rest to zero. this will yield the same result as the original averager of length $M$.

Averaging filters


How do I add page numbers to a SharePoint list instead of having the Item numbers

Question: How do I add page numbers to a SharePoint list instead of having the Item numbers at the bottom of the page?
Comment: At the bottom of a full list SharePoint displays e.g 1-30 which refers to the items, i want this to be page numbers instead of item numbers @rafaelbonametti
Comment: Which page numbers? Can you elaborate a little deeper?
Comment: So what defines a pagenumber? You mean 1-30 should be page #1 and 31-60 page #2 ? What should happen van you change the number of items displayed on one page? The current UI never did pagenumbers because it has no clue how many pages there are. So you need to add code and do calculations. The mentioned XSLT is oldskool (and XSLT is a pain), modern approach is Client-Side-Rendering and using REST to get all the required info.. also more future proof for the SharePoint Framework.. But all requires some serious scripting.
Answer: You can try these two options:
1- You could use a Content Query WebPart with Pagination that Waldek put together first for SP2007 and later on for SP2010.
Adding paging numbers to the control list with paging template
2- You can download Waldek's code and extend his webpart with new functionality. You could also just extend the CQWP out of the box and build your own paging. I wrote an article some time ago explaining how you could extend the CQWP and create your own XSLT functions... for instance to create the paging...
Create your own xlst functions using c


CDN setup without nameserver AND cname manipulation

Question: Is it possible? Does somebody know, how is it technically possible to setup a CDN without nameserver and cname manipulation?
Comment: What do you mean "without nameserver and cname manipulation?"   Do you mean that you don't want to change NS or CNAME DNS entries?   Are you open to changing A records?   CDNs use DNS tricks to route traffic to the closest edge node, so there is no way to use them without allowing some sort of DNS changes.
Comment: i'm comfortable with both of `dns` and `cname`, no prob - just was asked by a client, is there a kind of such simple possibility to setup a CDN, like to input domain name, and the CDN provider does the rest...
Comment: Your website could resolve to one IP that is anycasted (so hopefully the closer endpoint would answer requests). Or it can resolve to different IPs because the authoritative nameservers would have some logic to reply differently based on the source, and with the help of the Client Subnet EDNS option. This means "magic" in the implementation but the content of the zone would be simple and no CNAMEs nor NS changes. So you will need to make your question clearer.
Answer: Not supported by all Registrars
If you want the ability to create additional sites or content delivery networks without having to edit any DNS entries then you can adopt a wildcard setup. Sadly not all registrars allow you to do this but a example of a wild card A record looks like this: *.cdn.
Virtual Host
This allows you to create sites, apps and content delivery networks by just editing the virtual host on your server, for example *.cdn.example.com becomes uniquestring.cdn.example.com, this is how Rackspace, Azure and Amazon issue CDN for their customers.
Amazon Route 53
If your current domain registrar does not allow wildcards then take a look at Amazon Route 53
Comment: Wildcards create more problems than solutions (and even more so with DNSSEC), specially in the hand of beginners, so when possible it is better to try not using them.
Comment: Doesn't make it a invalid solution...
Comment: I never said it is invalid. I said that wildcards in the hands of beginners are dangerous so it is not a recommended one, but it is one among others, yes...


How to quickly assess prospectiveness of a candidate based on his CV?

Question: I am working on a project for a dashboard and from UX perspective I would like a feature where HR managers could make a quick and rough estimate of a new candidate by giving him "marks" in certain fields like: Work experience, Knowledge of the field etc. so other users of the dashboard could later filter candidates in the table by average of all the marks. I would like to know if there are some universal metrics for quickly assessing how talented and worth hiring candidate is or any applicable ones, it doesn't have to necessary 100% precise, just a rough estimate of talent also it should be mostly things that can be found in CV as main part of users are sourcing specialist. I am looking for around 5-7 metrics. Any help appreciated!
Comment: I think the HR managers are much better suited to answer this question, since hiring people (or, at least, disqualifying people from the hiring process) is a huge part of their job.
Comment: You need to specify a position, and what skills you are looking for. Second, it is generally the interview where you can tell how skilled someone is, not the CV itself.
Comment: From a UX perspective I'd like an AI to do my job for me but that's unlikely to happen. Almost as unlikely is someone doing your job for you for free, which seems to be what you're asking for here. Even if algorithms like this existed they would be proprietary information.
Answer: You can't judge talent from a CV. You can barely even judge talent from talking with people for a few hours. That's what makes hiring people so hard.
Also, if a universal metric existed, it would be gamed to the max by anyone looking for a job. It's half the reason people list buzzwords and technologies they once completed a tutorial for on their CV, because they know electronic systems are looking for those words.
Also also, "work experience" and "knowledge of the field" cannot be meaningfully condensed to a number. They are not scalars.
Answer: Each dashboard would have to be constructed for each new position/opening. The people involved in running the team, screening the CV/resume/applications, and running the interviews would have to assign score ranges for each required and desired item they expect to see in the CV.  The users of the system would have to understand the criteria so they could filter the resumes accordingly.
They would have to know how to weigh the number of years using X technology VS years working a prestigious company Y vs a PHD at a place nobody has heard of.
The question would be how much time/effort would they put into the system before advertising the opening. My fear is that they would quickly use the defaults, or what was used for a similar position.
If I was assigned this task I would start by looking at the systems they already use to filter applications, ask the users if they work and then understand their strengths and shortfalls.
Answer: CVs and Resumes are merely ad campaigns supplied by job applicants, and are little gauge of anything other than how well an applicant can write one.
There are no algorithms you can apply to any metrics that are going to accurately judge the actual talent of an individual.  We've had people who looked great on paper, but were terrible, and people who looked iffy on paper who were great once they came in on the interview.
At best, you could set up metrics for an individual position ranking a person on qualifications of the job based on categories of hard requirements, soft requirements and "nice to have" items and weight them accordingly, and anyone over a certain threshold gets an interview.
Beyond that, it's all alchemy.


How can I decrease Autosave frequency?

Question: ATS saves automatically too much! There are too many saved files that I must delete individually. I don't know how to delete them concurrently.
Answer: No, there is no way to change the autosave frequency on either ATS or ETS2 as of 1.35.
I checked the game configuration, user/profile settings and internal game files, was unable to find anything.
Please note that some people say that the autosave frequency can be changed on def/editor_data.sii, but it has been confirmed by a SCS developer that this is has nothing to do with it:

The editor_data.sii file has nothing to do with interval of in-game autosaves which can not be changed.
Answer: Even now with 1.36, this option hasn't been added, and this is pretty annoying. Autosaves take some data spaces, and there are pretty easy to find.
Open the File Explorer and go to Documents\American Truck Simulator\profiles (or Documents\Euro Truck Simulator 2\profiles for ETS2). You would find a unique folder that represent your profile name in hexadecimal. Go inside and go into save folder.
Here you can find all your save folder, manual and auto saves. Before removing them, just move them all in another place and try to launch ATS → if the game works without any new issue, you can delete them all, and enjoy a free space done.
This Steam Community discussion is related.

How can I decrease Autosave frequency?


Evaluate an integral using importance sampling

Question: Estimate $\int^{1}_{0}e^{x} dx$ using importance sampling.
Should I use beta distribution as proposal distribution and uniform distribution as target ?
Comment: please add the `self-study` tag and explain why using one versus the other is an issue.
Answer: As the range of the integral is $(0,1)$, it is better to take an importance density restricted to $(0,1)$ like the Uniform $\mathcal U(0,1)$ or a Beta $\mathcal Be(a,b)$, rather than an importance function with a larger support like Exponential or Normal. Intuitively, including a random number of zeroes in the Monte Carlo average is both a waste of computer time and an unnecessary source of randomness! Here is a comparison of the four (for 10³ simulations, replicated 10² times):

that seems to put a black mark on the Beta. However, the choice of a Beta $\mathcal B(2,1)$ is quite poor as $$\frac{\exp(-x)}{x^{2-1}(1-x)^{1-1}}$$ has infinite variance. Using instead a Beta $\mathcal B(1/2,1)$ leads to much better performances:

As a final experiment, restricting the simulations of both Exponential and Normal variates to $(0,1)$ leads to an obvious improvement

with a zero variance in the case of the truncated Exponential importance function, since it uses the probability of being between $0$ and $1$, which is the value of the integral itself.
Answer: This integral is easy using direct monte carlo integration, however if you want to use importance sampling, you can choose the target distribution as $f(x)=e^x$, i.e. harder to sample than uniform. And $h(x)=\Pi(x)$, i.e. $1$ within $[0,1]$ and zero otherwise. Choose normal ($g(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2})$ or beta if you want, sample from it and take the mean, i.e.
$$I\approx \frac{1}{N}\sum_{x \sim g(x)} \frac{f(x)h(x)}{g(x)}$$


How would I go about moving /usr to a different partition

Question: I would like to move /usr to a different partition because I would like to not use that much space on my ssd in favor of my fairly empty hdd. I would also like to move another /snap since it eats up alot of space as well. I know I could just physically move it but would all the programs that use it automatically be updated to point towards the new directory? Will new applications still go to the moved /usr or would it create a new one on the SSD and use that again? On ver 5.0.
Answer: Moving the directory to a different partition won't work. The best solution would probably be to do this during the installation process.
You need to create 3 separate partitions, 1 on the SSD with / mountpoint and the other two on the hard drive with mount points /usr and /snap.
It is also a good practise to have /home directory on a separate partion, it helps a lot when reinstalling os or changing a linux distro. And it's also good to have a Swap partition.
I wouldn't recommend doing this on a running system.
For more info on this you can see
https://wiki.archlinux.org/index.php/partitioning#Partition_scheme


Basis with diameter tending $0$ separable metric space

Question: I'm reading a book of Ergodic Theory and in a proof of certain result I've found a fact I don't understand how to explain. The text assures that for any separable metric space there exists a countable basis of open sets $\{U_n\}$ whose diameters satisfy $\lim_{n\rightarrow \infty} \mbox{diam} (U_n)=0$. Any idea about how to assure this property for the diameters of the countable basis? Thanks.
Comment: There's an obvious way to do it if the metric space is $\sigma$-compact, or $\sigma$-totally bounded. Let $X=\bigcup_n X_n$ where each $X_n$ is totally bounded, and $X_1\subseteq X_2\subseteq\cdots.$  For each $n$ choose a finite cover of $X_n$ with open sets of diameter $\lt1/n$ and take the union. Don't see how to do it with just a separable metric space.
Answer: Let $\{x_n: n ∈ ω\}$ be a dense set. Let $U_{n, m} := B(x_n, \frac{1}{m})$, i.e. the open ball of radius $\frac{1}{m}$. Clearly, $\{U_{n, m}: n, m ∈ ω\}$ is a countable base. Moreover, $\{U_{n, m}: m ≥ n ∈ ω\}$ is also a countable base, and this one has diameters converging to $0$ since for every $k$ only sets $U_{n, m}$ with $n ≤ m ≤ k$ may have diameter $> \frac{2}{k}$.


How power meter works for residential buildings?

Question: If power is current times meter shouldn't the overall resistances and inductances and capacitances of my house appliances be known so the power meter could calculate the power. I look at my house as a closed circuit. some people say the amp meter measures the current that is used by the appliances but according to ohm's law I need to know the impedances to measure the current.The voltage is standard 120 rms volts.
Answer: The impedance is just the voltage phasor divided by the current phasor. If you measure both (as energy meters do) then the impedance could be known (it's a complex number in general). The impedance of a pure inductance or pure capacitance load will be imaginary (no real part).
However there is no need to calculate the impedance. The energy (what you pay for) is just the time integral of the instantaneous product of current and voltage. Since the meter measures both current and voltage, that is all that is needed.
In the case of old-school energy meters, it's done cleverly with a motor-like arrangement using eddy currents. Modern electronic energy meters do the calculations digitally after digitizing the current measurement (from a shunt, current transformer or Rogowski coil) and the voltage measurement (from a voltage divider or potential transformer).
Comment: That's one way of looking at it- but the units are a bit wonky. Power is measured in kW. You pay for kWh (energy), so the average power you used over a month (kW) multiplied by the number of hours in a month (720 in a 30-day month). If you got charged for 150kWh, you used an average of 208W, measured over the month.
Comment: Pfehany So after measuring the instantaneous power, how would they get rid of the reactive power and only charge us for the real part of the apparent power?
Comment: @MaryE The instantanous power **is** the real power- so it just needs to be integrated to get the total energy per billing period. If you don't measure instantaneous power- measure voltage and current separately and then multiply- then you get apparent power. It's even possible for the instantaneous power to work out negative after you integrate it- if power is being fed back into the grid. Obviously that can never happen with apparent power.
Comment: According to my book the instantanoues power of a sinusoid consist of both reactive and real power
Comment: @MaryE The reactive portion of the power is zero when integrated over an AC cycle (it draws energy from the source, then gives it back again). . Capacitors take power at the beginning of each half-cycle and return it at the end, inductors do the opposite.
Comment: so we are paying for the average power that is used each month?
Answer: The power meter measures voltage and current to the appliance. Those two values are multiplied by means of physic phenomena on rotating disc that is spinning with the rate of  u * i * cos(phi). If you measure both current and voltage, then the impedance doesn't to be known, because the meter indirectly "senses" the change of impedance.


On carbureted vehicles, are vacuum lines exposed to gasoline vapors?

Question: I'm restoring a 1985 Chevy G30 Van 5.7L, but these questions apply broadly to carbureted vehicles.
The vehicle is carbureted, and most controls for the emissions system and climate control system are vacuum operated. The vacuum source for all systems is underneath the carburetor, or half way above its throttle-body, or from the intake manifold, depending on which vacuum circuit.
It seems to me all these vacuum lines are exposed to gasoline vapors from these vacuum sources. Many of the lines are rotted after so many years, and I've replaced some of the smaller 5/32" (4mm) rubber vacuum lines with silicone. However, I know silicone has notoriously poor gasoline resistance. I am worried that the gasoline-rich vacuum will eventually eat the new silicone lines. I know, for example, that the larger 3/8" lines for the PCV need to be fuel-resistant (oil and burnt gasoline crankcase fumes)
My first question is: are vacuum lines in carbureted vehicles exposed to gasoline vapors generally? If so, is it enough vapors to eat through silicone? If it is only specific vacuum control circuits, how does one tell which lines should be fuel-resistant? Maybe just the vacuum lines closest to the carb / intake manifold?
Also, vacuum systems in general should not be vented anywhere to the open atmosphere correct? There are some stiff, thin 2mm nylon lines that go to nowhere (vented to open air) from the vacuum reservoir. I'm trying to find where they go, but I'm also wondering if there are ever lines like this to
slowly vent out the gasoline vapors from the vacuum circuit.
Here is a picture of my vacuum diagram for the emissions system.

I can't find a vacuum diagram for my climate control system, but I believe it is similar to this:
Answer:
Many of the lines are rotted after so many years

On a vehicle of that age, I replace every single rubber line without exception.  I use shrink tube or paint to replace any OEM color markings on the hoses or to correspond to diagrams.

I've replaced some of the smaller 5/32" (4mm) rubber vacuum lines with silicone.

No. Just No.
Do not "freestyle" or "crossover" one type of line for another based on experience you have in other crafts. There is only one correct type of line, and that is automotive vacuum hose.
The operating conditions of an automobile are extremely demanding. Quality automotive materials and components have evolved for 100 years for that demanding service.  If "reliability" plays any part in why you are replacing those lines, then use the correct materials.
I don't even stock the stuff. I just walk down to Autozone or O'Reilly and buy a few feet when I need it.  It's cheap, even there.
A Chevy truck/van is possibly the most supported vehicle in North America, certainly of that age. Most stuff is available except for a few smog parts.


Does DD have his own camo index?

Question: Just what it says on the TIN, does DD have his(her?) own camo index? If he does indeed have his own index, does his color affect it?
Answer: No, DD doesn't have his own camo index, not that he'd need one anyway.
The thing is, when enemies notice DD, they just shoo him away like they do with every other animal in the game. They do not go investigate the places DD was at, nor do they stop investigating the places you were seen at after shooing DD away, so him following you doesn't affect your stealth play that much.
And yes, DD is a boy, assuming we can take Ocelot's words for it.

One thing you might want to keep in mind:
If you're trying to listen in on an enemy conversation, it might be best to dismiss DD depending on the situation. DD isn't disciplined enough to wait someplace for too long (thanks for training him, Ocelot), and if your eavesdropping targets notice DD, they'll interrupt their conversation as they shoo him away and might not resume, forcing you to reload your checkpoint or even restart the entire mission.
Comment: Ocelot's a bloody liar, though, so maybe DD *is* a girl? Well, just this once I'll believe Ocelot... again.
Comment: Thanks! Now I can run around with the fox coloring and the eye-patch without worry! This is probably my favorite nod to the past(future) games in the series so far.
Comment: I've seen DD mark his territory before, which males tend to do more often. And uh, I wouldn't hold my breath for future games in the series. Unless you like pachinko and card games. Also, DD can be shot and critically wounded by enemies if you sic DD on them with "Keep 'em busy" or "Do it." Guards will shoot him on sight at that point if they notice, otherwise he will be ignored. You can also wound him yourself, if you're a terrible person. (I did this accidentally once when he sprinted towards me past a tank that I had loaded with C4 -- sounds like something a real dog would do)

Does DD have his own camo index?


Where should I create my Entity Framework context object in an MVC app?

Question: I would like to use the Session-per-request pattern, as is done frequently when using NHibernate in an ASP.NET environment.
My first thought was to put the code to create the context in the BeginRequest event handler in Global.asax, but I discovered that this event is firing not only for the initial request that actually does the work, but also for the subsequent requests for static files such as CSS and images.
I don't want to create a whole bunch of extra contexts when they're not needed, so is there a way I can just get my code to run on the initial request, and not the ones for the static files?
Answer:
Use constructor injection for anything which needs a context.
Use the DI framework of your choice and map the context.
Scope the context as request-scoped.
Answer: If you are running in IIS 7 with an integrated pipeline (the default), your ASP.NET module will see every request, even the requests for static content (see http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/),
If you still want to use an HTTP module to manage a session/content per request, I'd consider using Lazy to avoid instantiating the context when it is not needed.
If you use an action filter, you'll need to finish all the work early if you dispose the context during OnActionExecuted. Wait and dispose during OnResultExecuted if you want to defer query execution until the view renders, or use deferred / lazy loading of entities.
As Craig pointed out, the IoC containers can also manage the lifetime for you.
Answer: When I'm using a dependency injection framework I typically have a separate assembly with the domain model in it. That assembly also contains interfaces for repositories. The implementation of the repository contains the code that actually instantiates the EF ObjectContext.
If this is a really simple application though and you're not doing DI you could always instantiate the EF ObjectContext within the constructor of your controller. Have a look at the ASP.NET MVC sample applications at http://www.asp.net/mvc for good basic information on getting started. I think all three of the sample applications they have use EF now.
Answer: Are you using IIS 6 with wildcard mapping? CSS and Images shouldn't trigger BeginRequest.
Another popular way to do this is by overriding the OnActionExecuted and OnActionExecuting methods inside of a base Controller.
<code>    protected override void OnActionExecuting(ActionExecutingContext filterContext)
    {
        _context = new SomeEntities();
        base.OnActionExecuting(filterContext);
    }

    protected override void OnActionExecuted(ActionExecutedContext filterContext)
    {
        _context.Dispose();
        base.OnActionExecuted(filterContext);
    }
</code>
Comment: No, I'm using IIS7. Should BeginRequest be called for static files in that case?
Comment: Nope, they shouldn't even touch the pipeline.


Android-Reduce APK size, separate APKs for different architectures

Question: I am using native libraries in my Android application. Recently, I got a notification from Google to conform to the new requirement asking to provide support for 64bit architecture as well. My current architecture is armeabi-v7a and I have built my libraries for arm64-v8a and packaged them inside my APK under "libs" folder. Google Play is accepting my APK but packaging everything into one APK has almost doubled the size of my APK. I was just wondering if I build separate APKs for each architecture and publish them to Google Play will it work? I mean users with 64-bit devices get 64-bit APK and those with 32 bit get the other one?
Answer: Looks like you have to use app bundle
Answer: You can build one APK per ABI, but this is a complicated maintenance which in particular requires diligence when assigning versionCode to each APK. This is known as Multi APK and is now discouraged in favour of the Android App Bundle which is a single artifact bundling all the files and leaves Play responsible for the generation of the final APKs to users, which it does in a clever way, serving to each device only the files it needs.


Woocommerce disable shopping cart based on user roles

Question: Is there anyway to disable the shopping cart for guest users but have a quote only option and have the shopping cart function for wholesale users? Any help is greatly appreciated. Thank you.
Comment: You'll probably have to create a custom function and then replace the woocommerce_add_to_cart action with your function. If user is not logged in show the quote form, if they are logged in and have a specific role show the add to cart button
Comment: Thanks for the comment Anagio. I couldn't think of any out of the box solutions too.
Answer: The Catalog Visibility Options plugin sounds like it would do what you want.  It can disable the shopping features for "guests" and allow them for registered/logged in users.
Then if you want to add a Quote form you could use Gravity Forms + WooCommerce Gravity Forms Add-ons.  You might be able to use the "conditional logic" options in GF to get it to only display the quote option for non-logged in users (not 100% sure on that part though).
The Product Add-on's extension also gives you the ability to add a checkbox/textbox/radio buttons to a product, however I don't think the view options can be set on that for guest/registered users.


VNC and VPN working together problem

Question: Here is the situation.  I connect via VNC to a computer running UltraVNC server.  Then, I connect to a VPN on the UltraVNC server computer that I 've just connected to.  Once the VPN connection is established, the VNC connection to the UltraVNC server is lost, thus ending my VNC session.  How can I connect to a VPN from the UltraVNC server computer and not kill the VNC session?  All computer are running Windows 7.
Comment: A VPN connection generally forces all network traffic through the VPN. By connecting to a computer and then initiating a VPN at that computer, you're interrupting your initial connection. Is there any reason you cannot initiate the VPN connection from the initial host?
Answer: I think you need to untick the Use default gateway on remote network option on the VPN connection.

Edit the VPN connection properties.
Click on the Networking tab.
Click on Internet Protocol Version 4.

You may also need to disable Internet Protocol Version 6

Click the Advanced button.
Untick the Use default gateway on remote network option.
Press OK to apply the new settings.
Answer: You don't provide much detail around the Virtual Server you are trying to connect to, but I guess you connect via RDP from a client PC Machine M to a server S located on a network N and while connected to M, you setup a VPN connection to Network V. Is that correct?
If yes, the most likely reason why your connection to Server S drops is because your VPN client was configured to prevent Split Tunnel.
Under this sort of configuration the VPN client modifies the normal IP routes so that all traffic leaving the client PC must flow through the VPN tunnel (excluding of course the traffic required to establish the VPN tunnel itself).
As consequence, the session between Machine M and Server S is not routed via the tunnel to VPN Network V and from there redirected to Server S on Network N.
This will generally cause many issues due to one of the following:

The traffic routed to the VPN tunnel will suffer NAT before reaching to Network N and as consequence Server S will reject packets as Sequence numbers and other TCP session values on Machine M don't match those on Server S;
The router on Network V doen't know or intentionally block the traffic to Network N the connection will simply be dropped.

The good news is: This behaviour is configurable.
The bad news is: Usually the VPN admin restricts the user ability to change this setting on it client configuration.
Hope this helps

VNC and VPN working together problem


Capacitor bank for high powered appliance

Question: I have a vacuum cleaner which draws a little too much current only when it's starting up. This causes the trip switch in the home circuit to trip. Is it feasible to use a capacitor bank to provide this starting current so that the vacuum cleaner can continue to run on the normal AC power?
Comment: Have you considered lubricating it?
Comment: Capacitors are not going to be at all effective for an AC motor.
Comment: See my answer. For interest - where are you located?
Answer: WARNING
AC MAINS WILL KILL YOU WITHOUT QUESTION IF YOU LET IT.
DON'T LET IT!!!
THINK before you "do"
Draw out any circuits with switches shown open or closed.
Work out what will be connected where and why in each case.
Do not expose yourself to any situation that MIGHT kill or injure you worst case.
So:

This occurrence is unusual.
Is the circuit breaker correctly rated?
Is the circuit a low current one not suited to this load level?
Is the breaker faulty - some breakers that have seen long service suffer a decline in trip current - try another with the same rating? What happens.
The vacuum cleaner MAY be faulty.
What is its nameplate voltage and current?
What is the fuse or breaker current rating?
Then:

Capacitors will not work on AC
and
Energy content needed is large compared to what caps can provide even if you could convert the stored energy to AC.
A better method which will almost certainly do what you want is to provide a limiting series resistor - a large wattage light-bulb or a part of an old toaster or heater element.  You need enough resistance to limit the current but not enough to present the motor running up at all or in a reasonable time.
A vacuum cleaner usually uses a "series wound" motor and will tolerate series resistance and will run at lower speeds at lower voltages. A few modern vacuum cleaner motors are rated at 2 kW, but most will be not much over 1 kW at most and many are lower again - maybe 500W.
LIGHTBULB: A 100 W incandescent lightbulb will present more like a 1 kW load when cold and may make the difference. As it starts to heat the resistance rises and vacuum motor voltage will fall so a bulb will only be useful for a brief burst.
HEATING ELEMENT: You can easily trial an old heater or toaster or kettle element or elements or use the wire from ones which have open elements.
Place an element in series with the vacuum cleaner with a switch across the heater element which is open circuit to start and closed circuit to run. Several elements in parallel will provide a higher starting current. Wire stripped off a toaster or heater element "should" withstand mains current levels liable to be experienced in this application.
Answer: The energy available in a capacitor bank is only useful for supplying inrush current for DC circuits.
Three options

Look at your circuit breaker , there are three types B C D , B is
for lighting, C is general purpose, D is for motors (high inrush
current) so for example look for "C10" on the front of the breaker,
then replace it with a "D10" breaker for a high inrush, 10Amp
breaker. (Sometimes just replacing the breaker helps as older breakers are more prone to tripping.)
Add a soft start circuit could be a NTC thermistor, or
relay with capacitor or diode, or a triac type device.
Use it with a
speed control, and just wind up the speed.


What happened to Moria?

Question: In The Lord of The Rings: The Fellowship of The Ring, the Fellowship passes through the Mines of Moria, which is an evil infested wasteland. It is unknown to Gimli how this happened as he still thought it would be maintained by Dwarves. I've also heard somewhere else in LOTR of someone being referred to as a refuge of Moria. So my question is; how did Moria go from a Dwarven mine to an evil-filled hole? If it mentions this in the book I may have missed it.
Comment: It's not easy sharing an apartment with a Balrog
Comment: Though I've done it :-)
Comment: The appendices at the end of _Return of the King_ are your _mellon_.
Answer: The Dwarves of Moria dug too greedily and too deep and awakened Durin's Bane, a balrog. It drove them out of the mines and slew Durin.

What happened to Moria?