linux sudo list permitted commands

Question: Given that /etc/sudoers and /etc/sudoers.d/ are not readable by regular users, is there a way that I, as a normal user, can find out what sudo permissions I have?
Answer: Use sudo -l to get your access rights. The output might look like this:
#> sudo -l
Matching Defaults entries for myuser on myhost:
    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, !fqdn,
    use_pty

User myuser may run the following commands on myhost:
    (root) NOPASSWD: /usr/bin/systemctl restart docker
    (root) NOPASSWD: /usr/bin/systemctl restart docker.service

If you do not have access rights, it asks for password and writes a message:
#> sudo -l
[sudo] password for myuser:
Sorry, user myuser may not run sudo on myhost.

Answer: Run sudo -l.
Depending on how sudo is configured on your system, it might request your password first, but it will display all sudo configuration options that apply to your account, and then all the permitted command definitions applicable to you.
Answer: Create a script to traverse $PATH, looking for executables, and run it with sudo to look at the sudo environment. Also remember that one can use an absolute path: sudo /media/walt/newsys/install.
Something like:
#!/bin/bash
find $( echo "$PATH" | tr ':' ' ') -type f -executable -print | \
    sort

Run this both with sudo and without.
Comment: This won't help if (as is quite likely in the OP's case) the script you've just written isn't one of the scripts that `sudo` is set up to allow you to run.
Comment: `sudo` can restrict not just which commands you can run, but which command-line options you can use.

linux sudo list permitted commands


texstudio preference change not saved

Question: As of lately I've become quite annoyed with Texstudio. The reason for this is that the bibliography (F11) is no longer working for me. As it turns out, somehow this hotkey is also assigned to the view/fullscreen mode action, which apparently means that F11 now does neither. I fixed this by removing the hotkey entry for 'fullscreen', but the issue returns every time I restart Texstudio. Apparently this setting isn't being saved. Oddly enough, my user-defined commands are being saved. Does anyone know what's going on?
Comment: Which version/OS of TeXstudio are you using ?
Comment: Maybe you should check the permissions on your texstudio.ini. Under Kubuntu it would be located in ~/.config/. Maybe it got accidentially write protected.
Comment: Apologies for the delayed reply. I am using Windows 7 professional, unfortunately I can't check the Texstudio version right now as I am not at home, will add it later!
Answer: This is a bug related to OS-dependent shortcut settings. Will be fixed in the next release.
As a workaround, you may assign any other shortcut to 'fullscreen', e.g. 'Ctrl+Alt+Shift+F11'.
Comment: Works like a charm, thank you! It no longer resets when TeXstudio is restarted either.

texstudio preference change not saved


How is energy dissipated if force exists in action and reaction pairs?

Question: If force exists in action-reaction pairs, then how is energy not always conserved?
To illustrate, I would like to give the example of an inelastic collision in an isolated system. All forces acting on the objects colliding are internal, and the KE of the COM remains constant. Now, when the objects collide, while one object exerts a given force, the other object also exerts an equal and opposite reaction force. If we think of kinetic energy as work done by a force acting on that object, how is mechanical energy ever dissipated in such a case?
Answer: This is because the total energy of a mechanical system is a sum of contributions,
$$
E=\sum_{i}\frac{1}{2}m_{i}\boldsymbol{v}_{i}^{2}+U_{\textrm{internal}}+U_{\textrm{external}}
$$
Your system may be isolated,
$$
\sum_{i}U_{\textrm{external}}\left(\boldsymbol{x}_{i}\right)=0
$$
But still, your internal potential energy is a sum,
$$
\sum_{\textrm{pairs}}U_{ij}\left(\boldsymbol{x}_{i}-\boldsymbol{x}_{j}\right)
$$
("Pairs" is an important word here.)
So that, even though, as you correctly say,
$$
-\frac{\partial U_{ij}}{\partial\boldsymbol{x}_{i}}=\boldsymbol{F}_{ij}=-\boldsymbol{F}_{ji}=\frac{\partial U_{ij}}{\partial\boldsymbol{x}_{j}}
$$
If you have microscopic re-arrangements of the particles making up your system, you have a change in the internal potential energy, because of these re-arrangements. Some molecules may get closer together, others may slip apart, etc. So there is a change in this complicated function which depends on re-arrangements in position between the pairs. This is because the relative positions in the internal configuration change, even if nothing else changes. If your system dissipates energy as radiation, etc., it is even clearer that that can happen, but even in the simplest naive case, it is bound to happen.
I hope that was helpful.
Answer: If a  collision is not elastic, one or both objects are deformed during the collision.  The force causing the deformation is greater than the force of the rebound. Work is put into the object which does come back out, and its temperature goes up.
Answer:
If force exists in action-reaction pairs, then how is energy not always conserved?

I assume by this that you actually mean, how is mechanical energy not always conserved. Locally energy is always conserved, but it can be transformed from mechanical energy to other forms.
I believe that your confusion comes from the idea that since internal forces always come in equal and opposite pairs that the mechanical work done by one should always be equal and opposite to the mechanical work done by the other. This neglects the fact that the rate of work is $P=\vec F \cdot \vec v$.
Even though the $\vec F$ has an equal and opposite counterpart, their respective $\vec v$ may differ. In particular, in continuum mechanics the stress power density is given by $\mathbf T \cdot \mathbf D$ where $\mathbf T$ is the Cauchy stress tensor and $\mathbf D$ is the rate of deformation tensor.
The rate of deformation is the key to understanding your question. The rate of deformation is essentially* the difference in velocity for neighboring parts of the material. The forces are equal and opposite, and if the velocity is the same then there is no mechanical work and no deformation. On the other hand, if the material is deforming then the velocities are not the same and so the mechanical work is not equal and mechanical energy is lost.

I would like to give the example of an inelastic collision in an isolated system.

So in an inelastic collision there is deformation of the colliding bodies. At some point the front stops while the rear continues moving forward. This difference in velocity is what drives the loss of mechanical energy despite all of the internal forces being equal and opposite.
See https://csml.berkeley.edu/Notes/ME185.pdf#page150

More specifically $\mathbf D=(\mathbf L+\mathbf L^T)/2$ where $\mathbf L= \nabla \vec v$
Answer: Besides the other nice answers, there is a mathematical way of understanding why conservation of mechanical energy doesn't follow from the fact the forces come in pairs.
Forces come in pairs means that: $$\mathbf F_{12} + \mathbf F_{21} = \frac{d\mathbf p_2}{dt} + \frac{d\mathbf p_1}{dt} = \frac{d(\mathbf p_2+\mathbf p_1)}{dt} = 0$$
So, for any collision: $\mathbf p_1 + \mathbf p_2 = \mathbf p_1' + \mathbf p_2'$.
But $E_k = \frac{1}{2}mv^2 = \frac{p^2}{2m}$. Supposing equal masses to simplify, what we can say from the momentum conservation that $(\mathbf p_1 + \mathbf p_2)^2 = (\mathbf p_1' + \mathbf p_2')^2 \implies (p_1^2 + 2\mathbf {p_1.p_2}+ p_2^2) = (p_1'^2 + 2\mathbf {p_1'.p_2'} + p_2'^2)$
For the kinetic energy be conserved the dot products must be equal: $\mathbf {p_1.p_2} = \mathbf {p_1'.p_2'}$, which is an additional requirement, not assured by momentum conservation.


Is it normal to have a bad feeling after asking questions?

Question: I am a postdoc in math who defended his Ph.D. a year ago. I have 4 papers where three of them were written by me(only author). From time to time, when I don't understand some part of a paper, I send an email to the author and ask them about it.  I have been told since I was a student that I should not be ashamed to ask questions, but sometimes I have a bad feeling after asking questions that why I asked questions or I was so stupid that I didn't think about it. I have always tried to think a lot of my questions before I asked them, but I still have this feeling when I was pointed out the answer.
Comment: Out of curiosity: did you have a bad feeling after asking this particular question?
Comment: Not sure what the question is, feel free to edit my title if necessary (but please keep it in the form of a question, i.e., with a question mark).
Comment: Everyone has questions occasionally. If you think one of your questions was "stupid" after someone points out an answer, that might be a sign that you realise that you can figure out the answer to similar questions by yourself in future (which doesn't mean the question was actually "stupid", it just means you should try to learn from it). Or maybe your brain is just lying to you because hindsight is 20/20 (among other reasons). The subconscious generally gives useful signals to you, but it can also give oversimplified or simply incorrect signals.
Comment: @gota : No, I didn't as nobody knows me
Answer: It sounds like you may be experiencing impostor syndrome. It's the feeling that you don't really deserve your accomplishments and that you could at any moment be exposed. Most people will experience it sometime in their lives but high-achieving individuals are especially predisposed by their inclination to compare themselves unfavorably to even more high-achieving people.
You've achieved a PhD and you're published.  Think of how many kids you knew in high school that have achieved that.  It's possible you're the only one. You should feel great but you don't because you compare yourself to other researchers you assume are better.  Still, there's every possibility that when they see your questions, it may race through their minds to wonder if you've discovered their papers weren't that good after all.  The impostor syndrome can happen to anyone but high-achieving people are especially susceptible.
If this continues to bother you and your access to healthcare allows, you might ask your primary care provider for a referral for some counseling or perhaps a support group.  Good luck on this but I suspect you're doing great and having trouble giving yourself credit for having earned your achievements.
Answer: While asking questions should never be discouraged, there are good questions and there are bad questions.
For your case in particular, reading a paper and not understanding part of it, there is a due diligence involved in trying to find the answer on your own, or asking for help from a more appropriate person, than to just write off a note and ask the author.
Your first pass should be to go to the papers cited by the paper you're having trouble with, and see if that clears things up.  Next, it might be wise to ask local colleagues, peers you have an established working relationship with, or your postdoc mentor, before asking the author.  Indeed, the exercise will almost invariably result in a better formulated question for the author by the time you get around to asking it.
Other times, your experience may tell you that there is no person you can go to other than the author to get your answer -- then, by all means, go to the author.
If this is a frequent issue for you, I suggest forming a journal club that meets periodically to discuss agreed-upon papers might be a valuable thing for you to organize.  It might help you develop some more insight for how you approach papers.  These can be valuable forums for everyone from advanced undergrads to expert emeriti.  It would be very appropriate for a post doc to try to form such a group.
Comment: @Adam -- your area is math, and you're in a math department.  One of the goals of a Journal Club is to force participants to read somewhat broader than their very specific area.  Every once in a while, you'll be taking a paper directly in your area, but many will be peripheral to a certain extent.
Comment: I like the last suggestion. It helps build a circle of collaboration. But asking an author can lead to this as well. I would lean _a bit_ more toward asking, I think. Insight in math can be elusive.
Comment: @Kimball  "Journal Club" is a pretty common usage: https://en.wikipedia.org/wiki/Journal_club
Comment: Thank you very much for the last suggestion which sounds good, but I don't know how I can find such people as nobody works in my area at the department.
Comment: @ScottSeidman Ah, I see. Thanks for your valuable suggestion.
Comment: +1 for suggesting a journal club. Often it is helpful to hear from the other people who read the paper, it just might so happen that they understood the particular detail you did not, or have some helpful background info, or they came up with a good question about a detail you missed, or ... Although it might be hard for math, because from what I hear people there tend to read fewer papers than in e.g. CS as it is much more work to understand them.
Comment: I would suggest alternative name for a "journal club"---it's not a club that makes or reads journals, but rather articles in journals.  In my experience, these are usually called reading groups or reading seminars, and they might go through books or papers.
Comment: @ScottSeidman Oh, I guess we just never used that term in my circles.
Answer: As author, I'm usually happy to be asked questions about my work. So I do encourage it, and people who do it shouldn't feel bad. Generally I feel that I'd be fine with more people asking me something than actually do. It gives me a good feeling that somebody reads my work and really tries to work through it, and occasionally people point out mistakes (or a question leads to my finding a mistake), so that I can also learn from this.
However people need to understand that my time is limited. Very occasionally people have overdone it, and asked things where I felt that (a) questions were asked that reveal that basic understanding of the field is missing that would be required before reading specialist papers, or (b) people think that because I wrote something about a method that they use, I would give them detailed support applying it in their specific application, or (c) people read only the first 5 pages and ask something that is explained later, or (d) people start with a good question and when I answer they start to think they can ask me all kinds of stuff that is only loosely related to the paper.
I think that's a fairly exhaustive list of questions I'm not so keen on.
I should also say that both answers by Nicole Hamilton and Scott Seidman are really good and show you two very different ways of thinking about the issue that both make sense and complement each other. Many people are too ashamed about asking questions and tend to feel bad about it when they really shouldn't. On the other hand it is worthwhile to make good efforts to clarify things for yourself or with people with whom you talk more regularly before asking the author.
Answer: Others have made the point that you shouldn't feel bad. I would like to add that if you do feel bad, you can use those bad feelings to increase your empathy with your students (assuming that your position involves teaching). Once you have a Ph.D., it is easy to fall under the curse of knowledge and forget what it is like to not know something which you suspect might be basic. To combat this, it is a healthy thing to be regularly confronted with evidence of your own continued ignorance of areas outside of your domain of expertise (or even within that domain).
Answer: I find that asking a good question sometimes helps to actually understand what you are asking.
I have this a lot on SE (especially SO) where I am building my question with the explanation of what I understood and what I did not. Often I would end mid-question with an epiphany (I actually can answer the question myself), or realize that my question does not make sense, or realize that I do not even know what I want to ask.
So yes, ask the question, but make sure to elaborate on what you understand and what not, in details.
Answer: Yes it's normal and I'll explain your (flawed) logic for feeling bad, because it is likely the same as my (flawed) logic.
When I ask a question, my question is either:

Stupid, or
Not stupid

If it is stupid (and my inner imposter says this is likely), then I have just made a fool of myself and displayed my stupidity to "everyone". I will feel bad about that.
But if it is not stupid, then maybe I have made a fool of the authors. I have found a flaw in their work and they will feel bad. A major social faux pas. I will feel bad about that (even if it ultimately results in better science).
So to save time, and in the knowledge that I will inevitably feel bad in the future, I start to feel bad as soon as I've asked the question. From that logic, all questions are bad.
BUT
If I consider myself as the answerer rather than the questioner...
If the question is a basic question, then maybe I didn't communicate my ideas effectively. This asker should not feel bad because they've helped me communicate better, or they've given me an opportunity to talk about my research. If I have time, I'll respond and provide them with some resources and add their question to my mental "Ways my research might be misunderstood" list so that I can communicate better in future.
If the question is not basic, they've given me something to think about. Maybe it's a flaw I'm already aware of, maybe not. If it's an in-person question, I don't think there's anything wrong with saying "I didn't think of that". If it's an email, I might think about it for a while and respond or act on it if I have time.
If I don't have time, I will likely do nothing. But I'd like the asker to trust me to make that decision and forgive me if I don't respond. I don't want them to feel bad about asking the question.
The question means that someone has read my output and thought about it long enough to ask (and hopefully try to answer) a question. The worse reception is a large round of indifference - even controversy brings acknowledgement. Ergo, questions are good.
Answer: A simple reason you may feel bad is because Academia is both collaborative and competitive. Working with others is encouraged, but it's also about "pecking order" and "survival of the fittest". And the further you go, the stronger the competition. The stakes (and the dynamics of the relationships) are not the same for a student and a post-doc. In fact an established academic may be happier to answer the same question from a student (potentially, a future recruit for their research lab) than from a post-doc (potentially, a competitor for their next research grant).
Bearing that in mind... By asking a question, you're making yourself vulnerable to criticism. You are highlighting your weaknesses. It is however an opportunity to learn. What you need to balance here is your thirst for knowledge (good!), and your (perceived) social standing within your community (important, but can conflict with the former).
Every question you ask is an opportunity to learn, but also a source of fear (not just a "childish" fear of looking foolish, but the very rational fear that negative perceptions from your peers may affect your career in the future). You have to learn to manage that fear. It's part of "growing up" as an academic. By becoming a post-doc, you are entering new territory. It's quite normal to feel cautious. However, I do find that keeping a youthful enthusiasm about asking questions can be a good long-term survival strategy. Seeming "harmless" is not necessarily a bad thing. It's actually a good filter for forming future collaborations. You don't want to work with people who sneer at "stupid questions".
Answer: Yes, it is normal. Many people have this problem; the assumed logic is that by asking a question you demonstrate that you are lacking knowledge or the mental resources to come to your own conclusions. Together with the fact that the whole point of being in academia (and maybe to a lesser part businesses) is to build a lot of knowledge, one might feel that one is inferiour for asking questions.
Also, some people with less than optimal social skills then may turn this around and mention your question specifically in a way which throws salt into the wound.  Some people with less insight may actually think that you're a lesser person for it.
All of this is true from a psychological standpoint, and still, objectively, being able to ask question is almost always a great ability. Obviously, first, you may get an answer and learn something much quicker than figuring it out yourself. Secondly, there are things that you simply cannot know without asking (for example, about predilections or opinions of other people). Third, asking questions and actually thinking about the answers is great for general conversations - it avoids those kinds of discussions where everybody is just spewing facts and trying to "win".
As to how to do it... of course you can spend time on wording your question right - this may be worthwhile in an asynchronous setting, i.e. when asking by mail. Try to ask in a way which makes it easy for the other person to understand what you actually mean. Avoid too much verbosity or vagueness. If you have multiple questions, either separate them clearly, maybe through bullet points, or ask them serially (after you get the answer).
When asking questions in a social setting, i.e. in a meeting or discussion, just do it. There often is no time to think long and hard, and overthinking can lead to weird things being said. If it is a group setting, and you think the question is interesting for others, ask in front of the group; if instead you think there's really nobody else who could possibly be interested in it, maybe try to catch the other person later.
As to the bad feeling - at least for me, it still crops up occasionally, when I ask a particularly "stupid" question in front of a particularly important (to me) person, but I have a lot of practice meanwhile, so the feeling now goes away very quickly. I recommend to practice this skill - both the asking, and then being able to live with it.
Answer: Something that one of my lecturers at university first said, to a class that I was taking, has always stuck in my mind, and that was:

If you are thinking about asking a question about something that you don't quite understand, don't feel shy about sticking your hand up and asking because you can be sure that at least someone else is wondering the exact same thing!

This has stood me in good stead and by always remembering that, I have never hesitated in asking for clarification of an issue.
Conversely, from the point of view of the lecturer, this feedback also indicates that (at least part of) the audience is actually engaged in the discourse and are not just dumbly letting it waft over them.
Answer: There are already many great answers, and I would just add that in my opinion and experience low self-esteem leads easily to this type of problem. If you frequently end up self-criticizing yourself and your actions (even the good ones) also in other parts of life, then low self-esteem could be also affecting you. There may be no quick fix, but over long term things can get better. In the meantime if this would be truly the cause of your "problem", then acknowledging it can already help a bit.


How tokens in Crowdfunding gain their value?

Question: From my understanding, if the crowdfunding is successful, all of the gathered ether is sent into the ICO wallet, meaning the contract is left without any ether. Doesn't that mean the token becomes worthless, since people can't exchange it back to ether since the contract can't give any ether.
Answer: People will expect that someone else will buy their tokens. The idea is that the token value will go up because the team will use the money you have given to build something of value, therefore, people who want to use the services will need to purchase the tokens  (hopefully at a higher price). The main idea is that you are taking a risk by investing in an idea. If the idea is successful you will be rewarded for your vision.
All that said, what you imply is what I would like to see. A ready to use service based on a token that is fully backed up.
Answer: As I have conducted an ICO, the token value is increased based on demand and supply. If your idea behind the ICO is solid, then people will chase for your token and gradually the price of your token gets lifted.the value of the token will get depleted,if none of your token holders use it.So create a reason in your ICO,so that people will get attracted to your token.If it helps you,please upvote.


Pressures That Can Affect The Ratio of Each Sex Born in a Humanoid Race/Human Sub-Species

Question: What kind of evolutionary and/or environmental pressures could seriously alter/affect the sex ratio of human sub-species and/or humanoids? For instance, what kind of pressures would lead to male births becoming more common than female births even generations later, or female births more common than male births by a significant margin?
Comment: Male births *actually are* more common than female births -- currently about 106 to 100 in western countries, absent any artificial manipulation. Historically, rates as high as 115 to 100 have been recorded. This is a *very* significant margin -- it would allow a country, for example, to employ 6% of its males in the army (that's a *large* army) without creating a mass of unmarried women.
Comment: I was asking about factors that could shift things even further. I knew that male births were slightly more common in humans, I was asking what could shift things so that, say female births were almost twice as common, or about 150 male births to 100 female ones, stuff like that.
Comment: How is this different from (your) question that Bashful Beluga listed as a duplicate? I don't see a difference.
Answer: There is some evidence to indicate that China's one child policy has already led to such a scenario. The rationale is that Chinese people still carry the tradition that the next generation looks after the previous one, and that if you can only have one child, then have a boy because boys will be better able to care for their parents later in life.
This did not lead to biological biases per se, but rather to higher infant mortality rates among female babies. That said, the impact is the same; a much higher number of males by proportion to females of a certain age.
If you have social pressures such as this that make a culture 'prefer' a specific gender, then prospective mothers will find other ways to make sure that they have a better chance of conceiving such a gender.
There are many herbal remedies already available that are believed to assist with gender selection; pH levels in the uterus are supposed to have an impact, and of course rhythm method can improve your odds if you want to conceive a specific gender (I won't go into the science or beliefs behind any of these as they are out of scope of the question).
Ultimately, while it's possible things as simple as diet could have a material impact on birth genders, the first pressure is likely to be social in nature and such pressure, combined with human ingenuity, will lead to a material outcome as has already been demonstrated in places like China.


How much would it cost to execute a 51% attack?

Question: I know that it's commonly said that they're not really in the realm of possibility right now, but how much would it really cost to execute a 51% attack on the network?  And are there any organizations out there who might have a goal in mind for which such an attack would be worth it?
Comment: I have created a new question (https://bitcoin.stackexchange.com/questions/75684/is-possible-to-destroy-the-bitcoin-for-just-500k-51-attack) based on renting the hash power from https://www.crypto51.app/
Answer: Adding to David's quote of $65,415 per hour here's a quick analysis of non-EC2 attacks (i.e. buy and run ALL the hardware to sustain a 51% attack)
Since power efficiency will be HUGE for this scale of an operation, let's use the most power efficient card we can find. This lovely pastebin doc tells us that is the Radeon 5850 at 1.595 MH/W.
At present you need 12.42 TH/s to pull off a 51% attack, which would require 51,585 of these cards. Assuming we put four cards to a rig it also requires 12,897 computers to run them all. Assuming the PCs take a scant 200 watts, each rig requires 804 watts of power, 10,365,735 watts in all. Assuming a fairly high efficiency cooling system, we can bump that up to about 14,619,916 watts. Before anyone claims that this alone is impossible, keep in mind it's about 0.7% of the peak output of Hoover Dam. Speaking of Hoover Dam, I'm going to use my local energy rate of 11.28 cents per kW/h (I live in Vegas) to find that it would cost $39,579.04 to run and cool these rigs for a single day.
Since these cards cost $192 at the cheapest outlet I could locate, we'd spend $9,904,320 on cards and at if we spent a scant $500 on each rig's other hardware they'd cost us $6,448,120 as well for a total hardware cost of $16,352,440. If we amortize that cost over a year of operation before the parts die or become too obsolete to pull off our attacks any more, we can estimate $44,770.54 per day in hardware costs.
Total cost in amortized hardware and electricity to run a 51% attack for one day on the bitcoin network: $84,349.58 - but also recall that our total startup costs were 16.35 million dollars, and all that would buy you is the ability to double-spend for a time, so no it wouldn't really be worth it.
Comment: A related point is: why bother mounting such an attack? If you were indeed successful and started building your own block chain, then confidence in Bitcoin would plummet and investors would sell out their positions (assuming their positions could be sold out). The price would drop through the floor and the value of your exploit would be reduced to nothing.
Comment: As far as I can tell the only rational reason is to attempt to destroy Bitcoin.
Comment: I think you could get system power, exclusive of the GPUs, down to 80 watts. Also, FPGAs have a better hash/watt, but the initial cost is *much* higher so the overall numbers will likely be worse.
Comment: Impressive numbers. I think it's also important to include the costs of storing these computers somewhere. They'll need to be racked in a datacenter. The monthly cost of a rack is pretty much never below $700/month, and you'll need a huge number of racks for 12,897 computers - particularly if they're the type that can accommodate four full size PCI cards.
Comment: With the 2014 US NIP budget of ~$50B/year, or ~$137M/day, this would take around 0.06% of the US intelligence budget to pull off.
Answer: I think this question primarily relates to the integrity of BTC, and withstanding a government mounted attack against it (from what I understand, any currency which could undermine the value of our US dollar is a threat to national security).
Take into account another factor or two. DDoS attacks have taken place against several smaller mining pools, which effectively discount any mining they perform. If the largest pooled mining efforts were hit with denial of service attacks for long enough, the difficulty and network strength would drop. Then the network would become particularly vulnerable.
It is my belief that the BitCoin client should be coded to disallow connecting to nodes which overpower the last known status of the network. Along with distributing the blockchain, the client should also broadcast a list of possible problem nodes, and possibly some statistics of the state of the network if the client were offline.
Comment: I don't really think what you propose is a good solution to the problem. A better solution, I think, would be a distributed mining pool, something like [this](https://docs.google.com/document/d/1ciKH3M8WYS49ywz08beXtvpCm2wVGdzU7waKwcn_uaU/edit?hl=en_US&authkey=CJTqyOMF&pli=1).
Answer: It should be pointed out that David Perry's answer is an upper bound on the attack price, and I'm fairly sure you could do better than that. For reference, his key numbers were $40k/day and $16M upfront.

While you mine you earn bitcoins. The bitcoins you mine you can sell for USD at an exchange. How much will you get back? Well with half the global hashrate you will mine half the coins, which currently means 3600 per day. At the price of $5/BTC that's $18,000 per day recouped.
Lets assume you invest in (more or less) the most efficient hardware. Therefore, if you are losing money mining then most others will be losing money too. Question: Why would people be mining if they were losing money? Answer: they wouldn't, they would switch off their rigs, at least temporarily. There is already hard evidence that people switch off their rigs when it ceases to become profitable. This would increase your bitcoin mining rate substantially. Simple economics would indicate that enough people would switch off their rigs that the mining cost per Thash would equal mining revenue per Thash. It's an equilibrium point. There will be friction, but you should expect to recoup almost all your electricity costs in mining revenues.
Based on 2. above, you don't have to add capacity equal to the current global hashrate, you have to add capacity equal to half the global hashrate. This is because if done slowly, every extra Thash/s you add, someone else will switch off a Thash/s to maintain parity between mining costs and mining revenue.

Based on 2 and 3 above, the total cost would be $8M upfront with little or no running costs. And this is assuming no resale value on the hardware.
Comment: Some people are running a loss, and some people have quit. Mining is currently breakeven with the more efficient rigs.

I did research, and I didn't criticize, I qualified.
Comment: People *ARE* running at a loss right now and have in the past. They mine because they believe not because it's profitable. There have been times when the only folks making money are those with free electricity or FPGAs and yet the network hashrate has not dropped that much. Research before you criticize the work of others please.
Answer: If miners are egoistic and can mine other coins with the same hardware an attack would be much cheaper.
You haven't to buy the mining power you need for the attack you can just lease it. Costs for leasing are just a little bit more than miners can earn with their hardware in the time of the attack. So today leasing costs for one hour of bitcoin mining power is when you trust the calculations of digiconomist.net about 1 million $.
During the attack you also earn for mining a little bit less than the leasing costs. So large costs only come to you, I've the currency goes down during you attack.
In worst case scenario - currency goes down directly - you have thrown away the leasing costs of 1 million $ per hour, in best case scenario - nobody notices your attack during you do it - you have the win of double spending and mining during the attack minus leasing costs.
If the value of the double spended transaction is great enough there's a positive profit expected! You can only prevent this if you don't trust large transactions. But this makes the currency maybe inefficient as you see in the discussion here.
Answer: This depends of the network hash rate. Let us assume that the hashrate will decrease to 1 TH/s. That time everyone who has switched off 1 TH/s miner will be able to perform 51% attack only for the cost of electricity.
See also: https://en.wikipedia.org/wiki/The_Bottle_Imp#Bottle_Imp_paradox


Error with the wifi and the network manager in the Deepin launcher

Question: I have a very strange error, it turns out that my Wi-Fi interface is not being managed by the Wi-Fi icon of my launcher in Deepin 15.5. It does not show me other Wi-Fi networks nearby, however the command iwlist wlp3s0 scan shows me several wifi, so the interface is up. It responds well to the use of ifconfig wlp3s0 up or down, however if I give it down it does not reflect it in the launcher of the wifi. It's as if my launcher was managing another interface through the network manager. It is uncomfortable because I have to connect to wpa_supplicant, it is clear that the device works. When I turn it off by the launcher in ifconfig -a it's still up. service networkin status return active(exited). Please help.
Answer: I fixes the problem. In my NetworkManager config file, I replaced the line:
[keyfile]
unmanaged-devices=interface-name:ap0;interface-name:wlp3s0;

by:
[keyfile]
unmanaged-devices=interface-name:ap0;

I used a script to create the Wi-Fi configuration, I think that this was the cause of the modification in my NetworkManager.conf.


Hash algorithm used in Lucene Indexing

Question: Any idea which hash algorithm is used while Indexing each word in lucene
Answer: Lucene doesn't use hashing to lookup terms, they are stored lexicographically in a file called Term Dictionary. Another file, called the Term Info Index is loaded into memory in order to provide random access to the Term Dictionary (which is basically a skip list).
More information on Lucene website.
Currently, the Term Info Index stores the position of every indexdivisor-th (indexdivisor=128 typically) in memory, meaning you can lookup a term by performing one binary search on the Term Info Index (in memory), and at most 128 entry scans on the Term Dictionary (on disk).

http://lucene.472066.n3.nabble.com/Understanding-lucene-indexes-and-disk-I-O-td714698.html

There is an optimisation, currently available in trunk, for this Term Info Index, which uses a prefix trie in order to perform lookups and performs much better for terms dictionary-intensive queries.

https://issues.apache.org/jira/browse/LUCENE-3030

Hash algorithm used in Lucene Indexing


Is it safe to use bleach around the yard?

Question: I would like to prepare an old deck for staining.  Scrubbing with a bleach solution seems a popular technique.  Will the bleach solution harm nearby plants?  What about if I use soap instead?
Comment: This is more about how plants survive bleach than the process of bleaching the deck, so we're migrating over to G&L.
Answer: Yes bleach will harm or kill some plants - most plants it is just the leaves.  I use a bleach/weed killer combo on poison ivy and it basically clears out everything in its path.  If your plants get bleach on them the very best case scenario is you will notice spotting.
Soap is perfectly fine around plants.  Maybe there are some very sensitive plants that may have a small small effect on - that is more of a gardening question though.  Unless you are dumping gallons of soap on your plants they will be fine - might smell different though.
Answer: I use bleach to kill any algae or fungi on the floor of balcony. After using bleach, it becomes perfect at least for a couple of years. So imagine how it can kill anything.
You have to think that Chlorine is the primary disinfectant for the house, the pool and all kinds of disease. The unic one for fungal diseases. It kills any organic cell.
<code>"It has the highest electron affinity and the third highest electronegativity
 of all the elements; for this reason, chlorine is a strong oxidizing agent."
</code>
I agree with soap, but you have to use Marseille soap or by the way a natural one (home made).
Otherwise, normal soaps contain caustic soda, which also kills the plants.


Indesign data merge not working with special characters

Question: Data merge is not importing certain characters correctly. Namely greek letters (Ψ, Ω, etc). I've tried different fonts and still no dice.
Answer: Found the solution here. The trick was changing the encoding on the .csv to UTF-16
Comment: Great, it works with changing the encoding to UTF-16 with Sublime text editor by File > Save with encoding. After that I selected ASCI as import in Indesign, or is as UNICODE better?
Answer: I was able to successfully load Japanese characters by:

save the data file as .csv in excel
take that excel doc and uploading it to google sheets (to remove all the junk excel puts in their .csv)
Redownload the file from google sheets. locate the file and (on windows) right click the file and hit "edit".
This opened the file in Notepad, hit "save as" and change the encoding to "Unicode"
load the new text file in Data Merge

I hope this helps anyone who may be googling around looking for a solution!
Comment: Excel doesn't put any 'junk' in CSV files. It offers very little choice (read: none at all) by way of encoding and delimiter character, and it tends to quote columns that don't need quoting, but none of that is 'junk'. Uploading to Google Sheets is completely unnecessary, just open the file in a proper editor – don't use Notepad, use something like Notepad++ or VSCode which give you actual control over the output and support CSV as a format, rather than just as plain text – and save with the appropriate settings.
Answer: If you save the Excel file as a Unicode file, you get what is essentially a tab delimited file. Take the file into Notepad or your favourite text editor and do a search and replace for the tabs and any extra spaces to each side and replace them with commas. You might need to do this two or three times to get the commas everywhere they need to go. Then save as "All Files ." and change the extension to CSV. Bada bing! The full Unicode set of characters will be preserved.
Answer: I had the same issue. UTF-8 encoding gave garbled text when there were non-ascii characters, and indd couldn't handle UTF-16.
I opened the CSV in VSCode, and resaved it with Western (Windows 1252) encoding.
It's not perfect: Hagåtña comes in OK, but Kandahār fails.
I'm using InDesign 17.0.1 x64.


Physical interpretation of curl of curl of Electric field vector

Question: What is the physical interpretation of curl of curl of an E-field vector?
I know that this gives the expression for an EM wave using the Maxwell equations but, I want to understand what exactly curl of curl signifies?
Comment: Are you interested in what physical quantity is represented (like electric or magnetic field or flux density), or how to intuitively understand the $\nabla \times \nabla \times$ operator (like how the second derivative of a 1D scalar function relates to the curvature)?
Comment: Yes, I want to understand what does two times curl means? Why curl of a curl?
Answer: Curl actually signifies the rotation of a field(twice the angular frequency in fact).Curl of a curl according to me will signify how fast the curl is itself rotating.(I know it sounds weird).to get the EM wave equation ,we actually put the $\rho$ and J to be zero and use a mathematical trick to get to the equation.
Comment: Thanx Rishabh. I know the analytical way to get the wave equation, but still, I'm not convinced with the answer, maybe I'm not getting it.  Could you please try to explain the curl of curl by taking any example?
Comment: https://en.wikipedia.org/wiki/Curl_(mathematics).I am sure that you have already visited this page.In the velocity example given here,you can see that the curl is fixed because the field is rotating uniformly at every point.if the field is something  more complicated like  $(x^2+y^2)\div 2  z\hat$ which is just a velocity field pointing in the z direction whose magnitude is increasing in proportion to distance^2,then it's curl will be same as the one given in the example here and its curl of curl will be fixed.you can see a point kept in the field will show a very complicated path .


How to mount handrail to drywall over concrete

Question: Any help how to hang the railing back up on the stairway.  It is townhouse wall with drywall and concrete behind it.
Comment: There are a number of hollow-wall and concrete anchors available. What type of hardware do you have?
Answer: You can drill holes into the concrete with bits made for concrete. Depending on how dense the concrete is you can sometimes do this with a regular drill. (This takes some patience, it's not like drilling into wood. Don't push too hard or you'll break the bit. Just have patience) If the concrete is too dense, a hammer drill may be necessary. And yes they have concrete anchors. They also have special screws made for concrete that don't require anchors.
Another idea would be to put a railing on the other side. Not a hand rail. A railing that attaches to the floor instead of the wall.
Answer: i am assuming that the situation you are describing is drywall on furring strips on concrete (so there is a 3/4" or so gap between the drywall and the concrete).  if its drywall directly on concrete, see the first answer.  if its the latter than see below.
the issue is always with a railing the loading of the railing on the brackets causes crushing of the drywall and eventual destruction of the gypsum.  if its over a stud, this is not too bad and repairable, but if over a void, then eventually the bracket punches a hole.  a good tip for this is to mark out your bracket locations and then trace the actual bracket mounting flanges.  in the center of the flange (not where the screws will go) drill a 1/2" hole in the drywall.  mix up some unsanded tile grout into a firm but still fluid mixture an inject into the hole with a sausage gun (or a ziploc bag with a corner cut out of it in a pinch).  squeeze a large amount into the hole (500ml) and leave to cure for a day.  this will leave a solid cementious plug in behind the exact spot where the railing brackets will mount.  then anchor your brackets as described in the above answer.  now your brackets wont break through the drywall over time, and the flange of the railing bracket covers up the hole entirely so you dont see the injection port.


Is there a way to clear your wand of spells you've used?

Question: I know you can see the last spell someone cast (from memory, this was in the Goblet of Fire), but is there a spell that can, for lack of a better phrase, clear your wands' history?
Comment: I assume you're worried that your parents/significant other will look at your wand history and find something icky.
Comment: *"Why have you been casting Engorgio! over and over again, honey?"*
Comment: Remember young wizards and witches, always use the Chromium Incognitum modus spell!
Comment: Just cast another spell.. or a few of them in case there is some depth to the "memory".
Comment: *Dehistorio*? *Controlis Altdel*?
Comment: I think the only sure fire way to erase your wand's history is to completely destroy your wand. But this seems to be a bit excessive just to hide @Valorum's repeated use of Engorgio...
Answer: There are no "Clear browser" spells shown in the Potter books, films or other literature. You do have some other options though, if you're worried about something finding out what you've been up to.

Security by buffer overflow.
We know from Goblet of Fire that it's possible to get a wand to regurgitate the wand's spells in reverse chronological order. What we don't see is the wand continue to regurgitate spells past a certain point.
By casting innoccuous spells (such as 'lumos') several dozen times, you may push the spell/s you wish to hide beyond the wand's ability to "remember" them. This obviously assumes that the wand doesn't just regurgitate all of them regardless of age.
Security by labour-intensivity
The spells seem to "erupt" from the wand at a rate of around one every 10-20 seconds, far slower than you can cast them. By casting thousands of quick spells over the course of several days, you could hide the spell you want to hide in a mass of other spells or simply make the process too labour-intensive for your opponent to bother with. After they've sat through a few hours of lumos, lumos, lumos, lumos, lumos they've probably given up, assuming you've found a way to stop the spell from working correctly.
Security through lack of interest
Priori Incantato seems a pretty rare and powerful spell and Priori Incantatem doubly so. If you avoid doing anything exciting with your life, it's unlikely you'll ever be put into a position where one of these rare powerful witches or wizards takes sufficient interest in you to actually cast this spell.
Security by "snap"
Broken wands can't be repaired except through the application of the most powerful magic. Snapping your wand in half would seem an excellent way of preventing the memory from being read, especially if you have a small supply of spare wands lying around.
Comment: If there are spells that throw fireballs, would it be dangerous to have  the wand regurgitate them?  If forget if this process recasts the spells or just reveals the spells cast.
Comment: @user3294068 - It doesn't regurgitate the spell, just an "echo" of it. Apparently with sufficient finesse you can even work out what they were cast on and why.
Comment: Broken wands are shown to be able to work, albeit unreliably.
Comment: @PastychomperthanksMonica - Not fully snapped, I don't think
Answer: Priori Incantato seems to regurgitate spells in reverse order they were cast. If you use it twice then the most recent and second most recent spell shows up, but as far as I know there's no way to go back to check those two spells. Therefore, if you use it on your wand right after you cast a spell you wish to hide there's no way to find out it was you who cast the Dark Mark.
Comment: Can you offer an example of this happening?
Comment: Lord Voldemort's spell kept echoing in reverse order they were cast at the graveyard.


How spin lock is implemented in Linux?

Question: I'm thinking about how the feature "prevent from context switch" is achieved in Linux for a spinlock. A big picture / pseudocode is acceptable since I just what to know the logic behind it.
Answer: Spinlock is not a Linux feature, it is a very simple CPU feature, at least on most CPUs.
Spinlock doesn't prevent from context switching. Disabling context switching would also disable multitasking, which is unwanted on Linux in most cases.
However, spinlocks are protected from context switching. The essence of the spinlock is that a lock attempt happens in a single CPU command. No context switching can break a process inside a CPU command, only after that.
Implementation is not OS-specific, it is CPU-specific: it requires a mnemonic which can exchange the content of a register and a memory address, atomically. On x86, it can happen by xchg.
Comment: @ptr_user7813604 Yes. Spinlock only garantees that no inconsistent state will happen, it doesn't matter, when context switches will break the execution. However, it can only try to lock a lock. There is no "wait until the lock will free" primitive in spinlock, it is its largest disadvantage.
Comment: I found that all my confusion is from my misused "prevent from" context switching, which made me thought that it would never give CPU to another process... . Thanks for helps!
Comment: From your "a lock attempt happens in a single CPU command" so can I say that context switch will finally happen [when return to userspace](https://unix.stackexchange.com/a/84789/324192) after the timer ISR, no matter a process hold the spinlock or not?
Comment: Thanks for your perfect explanation! I may be busy tomorrow so I think this is the last important thing to say today: Happy new year:)!

How spin lock is implemented in Linux?


Finding replacement PNP transistors

Question: Hello and I apologise if my first question is rather basic as I am new to electronics. I have started to repair vintage amplifiers and have found transistors that I need to replace are no longer available. I suspect in most cases modern equivalent transistors may have a better specification but what I need to find out please is the critical characteristics I must match or exceed in equivalent trs? I assume values for Pc, Vcb, Vce and Veb are critical but what about Ic, Tj, Ft, Cc and Hfe? Thank you for your help. Tim
Comment: How vintage? 1950s and early 1960s, you'll be looking for germanium transistors which are quite different and considerably harder to find.
Comment: *the critical characteristics I must match or exceed in equivalents* That depends on **the circuit** so basically how the transistors are used. A "better" specification isn't always "better". Suppose a circuit relies on a certain transistor to have a very low \$\beta\$, then a more modern transistor with a higher \$\beta\$ isn't what is needed.
Comment: You might like to give us the part number so that everybody can make replacement suggestions. Vintage me often used 2N3055 and MJ2955. I forgot the specs. So I need to google and read the datasheet to refresh my memory. I only remember that hFE is important, and also "matched characteristics pair" is important. https://www.onsemi.com/pub/Collateral/2N3055-D.PDF. Cheers.
Comment: The amplifiers are all 1970-1990 Bang & Olufsen only. The transistor I urgently need to find is a suitable equivalent to a Motorola MPS H54 PNP transistor.
Comment: Tim, the only remarkable specs for MPS H54 is its high voltage (80V), and its low noise figure at low impedances. Don't forget the case style - this one is standard TO-92 through-hole mounting. You may find similar transistors, but only surface-mount.
Answer: It's not that easy. Which characteristics of a transistor are important isn't an universal thing – it depends on what the transistor is used for.
So, you'll need to analyze what configuration the transistor is used for, and what the critical characteristic is. For example, when desiging a feedback amplifier, a high-as-possible amplification and a low-as-possible base-collector voltage might be desirable, but that doesn't help you if the external circuitry that you're stuck with is optimized for something else. And it doesn't help at all because not every transistor is used as that – often, limited gain is factored into the design e.g. to ensure stability.
Answer: For quality amplifiers, the ability to reject power supply hum and spikes is important for musicality.
After reading thru the book by Doug Self on Audio Power Amplifier Design, I realized the Vearly was important.
If you operate the transistor at 10 amps and 50 volts, with a Vearly of 100 volts, the straight_line model of the Early Effect becomes (100 + 50)/10 or a simple 15 ohm resistor connected (in the model) from VDD to the output load.
Thus with 8 ohm load and 15 ohm resistor, the attenuation of VDD hum and trash is 8/(8 + 15) = not very good attenuation.
We, of course, depend on the large open_loop gain of the negative feedback to  push down on energy (hum, trash) not related to the music.

Finding replacement PNP transistors


New job - not sure how to handle communication overload

Question: It's my first week at my first job out of college. I started Monday and didn't have any type of training at all. I've already been assigned to a bunch of ongoing projects and I'm getting several hundred emails a day. There's also so many meeting invites that I have to turn down most of them because I'm already scheduled for another project meeting. My Microsoft Teams is also receiving direct and group messages about every 10 seconds. IT policy is that we cannot close Outlook or Teams or mute our computers, so I've been keeping headphones plugged in to quiet the noise. People are emailing me to ask me a question about the status of something, then following up 5 minutes later when I haven't replied yet, then messaging me to ask if I saw their email, then calling me on Teams. It's so overwhelming. I'm not sure what to do, I literally cannot keep up with all of the communication much less get any work done. What can I do here?
Comment: @toomuchhappening, Indeed, you get a lot of emails and messages per day. Are the people, who email and message you, your team lead or mentors, and do they only want to see if you are stuck so that they can help you out ? Do you try to talk to your manager about this ?
Comment: Do you have coworkers to talk to?
Comment: You can set your status in Teams to Away.  You can also individually turn down the sound to specific applications.  *You are just going to have to get used to working in an environment where other people are reliant on you finishing your work.*
Answer: Talk to your lead or your manager.
Your manager or the lead developer should be in a position to help you get more into a flow and rhythm of communicating if you need to, and they'll be available to set expectations and guidelines on what you need to and what you don't need to respond to.
One of the things you don't mention is if the emails are going directly to you or if they're going to several others as a part of a distribution list or a CC chain.  If they're not going directly to you, it's probably safe to ignore those.
As for the direct pings on Teams, you're going to want to figure out the best way to get notified about things. Some channels you have to keep an eye on at all times so it makes sense to have all messages notify you.  Others, it makes sense to be notified only when you're mentioned.  There's settings available in Teams to help with that.
Answer:
I'm not sure what to do, I literally cannot keep up with all of the
communication much less get any work done. What can I do here?

Ask your manager what's expected of you at this stage of your employment.

Ask your manager to prioritize your tasks.

Ask your manager how you should handle the communication.
Answer: If I had to hypothesize on this, I would say that most of this is "somebody else's problem".  The reason I say that is because a lot of corporate communication goes through mailing lists; your team probably has a mailing list, and  all communication goes through the mailing list, and you're on the mailing list so you get all that communication in your inbox.
This is how corporate email culture commonly works: If there is a direct recipient (a single human) fora message, that person's email is usually in the "to" line of the email, usually at the start of that line.  If there  are other parties  who may be interested in adding feedback, those are usually additional "to"s or "CC"s.  If there are a lot of  recipients and/or the  recipients  don't  need to know who  each other are, then  "BCC" is used.
This makes  it very easy: Read the subject line of each email  and  maybe the first couple sentences; enough to  understand what the email is about.  If you or your project are called out specifically in the email, then reply to the part that pertains to you.  If you are the only recipient of the email (there are no  other "To", "CC", or "BCC"s  aside from your direct personal
email), then reply to it.   In all  other cases (likely the vast majority of
cases), ignore it.
It's likely the  sender is  just putting out a blast email to your whole  team to get "someone" to reply; if you have nothing useful to say, then let someone who has something more useful to say respond.  The sender is not asking for every member of your team to individually give a status report on  whatever they need status of, so you don't  need  to  handle it.
If people  are targeting you  directly and being annoying, you may need to have a chat with them to tell  them to  back  off.  Not aggressively, of course, because it's a workplace, but if someone is  asking you to  do a task and then 10 seconds later  asking if it's done yet, you may want to reply to them and just say something like "hey, that task takes more than 10 seconds to do, just chill, I'll let you know when it's ready, I'm  on  it, I promise".  Some people are overeager in this  way and need to be told to chill sometimes.
Comment: If your email client offers the option, create rules to sort incoming mail into folders : (1) those directly addressed to you. (2) messages cc'ed to you. (3) mailing lists.
Answer: Short answer: Prioritize
You've already noticed you can't do it all. Most people can't, so most of us get into a rhythm of responding to emails and messages that satisfies most people most of the time. Feel free to reorder these, this is just kind of a general starting point based on my experience.
Priority 1: keeping your manager satisfied. Your manager needs to know what you're working on and where you're at. If your manager asks you a question about these things, answer as quickly as possible.
Priority 2: projects you're directly working on or responsible for. Various stakeholders are going to need updates, even if the update is just "my priority is something else right now but I'll try to get it done by XX date." Help set expectations by giving realistic timelines and statuses, and let people (your manager, other stakeholders) know as early as possible if you're going to miss a deadline.
Priority 3: professional development stuff. In many professions, you need to network and make contacts, attend training classes and social-but-professional events. These are important but not urgent; put them on your calendar and then forget about them.
Anything else probably isn't that important (unless I'm forgetting something) and can wait.
There are various guides out there about "how to manage your inbox" but the advice I got that I still follow is basically "half of your email is garbage and can be deleted, 1/3 of it can be taken care of pretty much anytime, which only leaves 1/6 that needs dealt with NOW." Set aside time to do "real work" but you can expect to spend a lot of time responding to messages - as you've noticed, some of these will pile up if you ignore them for too long. Using a status of "busy" can help set expectations that you may not respond right away. You can also have people contact your manager instead of you directly, but this works best when your manager knows what you're working on and helps prioritize your project work.
The other advice I'd give is to turn off notifications for anything that's not crucial, like Teams channels you're not technically part of and don't need to know every little thing that happens. Browse these periodically so you can keep up with things if it's important to your role. Make some mail rules that auto-deletes some stuff or routes it to a de-prioritize folder. Someone that's in your same role may be able to help advise with rules they've learned over time.
Like anything else, this is a skill that can be learned over time with practice.


Can I drive several LEDs using a Li-Ion charging chip

Question: I have several IR LEDs (1.2-1.8v) and I would like to run them in a semi protected environment. I can run them off of an 18650 3.7v battery with the diodes in series however if a fault occurs in just 1 of them it will easily burn out the others. I have a TP4056 chip for charging Li-ion batteries I would like to use. It varies voltage based on the charge of the battery its connected to. If it is used to drive LEDs and one faults would it in theory drop the output accordingly therein saving the other diodes?
Answer: Maybe, but probably not well if it works at all.
A constant current drive is exactly what you want here, and yes, if one diode in a series string fails short the constant current driver will adjust to maintain that current even with a much lower forward voltage.
However, battery charging is not as simple as providing a constant current into the cell, there are voltage and time thresholds that have to be observed as well.  The TP4056's datasheet (at least the versions I've seen) do not describe its behavior in tremendous detail, but what it does show is that its behavior changes depending on if the battery voltage is <2.9V, < 4.2V, or >4.2V.  Only in that middle range does the TP4056 provide the programmed constant current.  The charger may not even begin charging if it does not detect a connected battery, this is a quite common and reasonable limitation, although I don't know if the TP4056 has this behavior.  It might take some tricks to get it to even turn your LEDs on at all.
Finally, Since the TP4056 is an incredibly common part I would not be surprised if many different manufacturers make equivalents, and these may have subtly (or drastically) different behaviors, especially when used outside of their intended purpose, so even if you can get it to work with one particular chip there's no guarantee that the next ones you buy will work as well (if at all).
On the whole there are much better options, from a basic constant current source made from a single transistor and resistor to a full-blown buck-boost converter and everywhere in between.  There are even LED driver ICs that are designed for battery supplies and have useful features built in.  All of these will likely be better, on the whole, than using the TP4056.
Comment: Thank you! and yeah a buck converter would be ideal but with the state of everything right now im probably out of luck for a while. The TP4056 chips i have are indeed horrible knockoffs but they do appear to provide a constant current at anything lower than 4.2v. I have used them to take the place of several AAA batteries in some devices.


Cannot connect to local sql server while connected to a vpn and split tunnel is enabled

Question: I'm trying to connect to my local sql server while vpn is connected but it throws an error saying 'The target principal name is incorrect.  Cannot generate SSPI context. (.Net SqlClient Data Provider)'.  Split tunneling is enabled but it does not resolve the issue.  If I disconnect from the vpn I can connect to the local sql server just fine. However, when split tunneling is enabled I can no longer remote desktop onto my vms on the vpn.  What's the issue and how can I fix it?
Answer:
Check if you have overlapping ip address space on either side of the
tunnel.
Check name resolution.
Try connecting with an ip instead of a name.
Try using a "test connection" (UDL file)
Consider putting the name in your hosts file.  On windows it should be C:\windows\system32\drivers\etc\hosts
regarding UDL files:  https://support.microsoft.com/en-us/topic/how-to-test-connections-to-sql-server-using-an-universal-data-link-file-udl-911075ba-c7fb-51b4-a847-26ceab92d3e9
Comment: Thank you.  There's no overlap of ip address space.  Trying with an ip address does not work.  Adding to hosts file does not work and testing with udl does not work.  How could I check name resolution? I can however ping the ip address of the sqlserver successfully.
Comment: To check name resolution you could simply ping the server by name.
There are other ways depending on the name resolution mechanisms active in your environment.
If you are using DNS for name resolution, `nslookup` would be the tool to use.
If you are relying on PNRP or NetBIOS, `ping` should work for basic troubleshooting.


What is an example of a transformation on a posterior distribution such that the MAP estimate will be non-invariant?

Question: Suppose that we have a posterior distribution $p(\theta\mid y)$ and we wish to define a transformation on $\theta$ such that $\phi = f(\theta)$. I know that generally such transformations will not affect the MLE as it is on the data space, but will result in non-invariance on the Maximum A Posteriori (MAP) estimate as it is a function of the parameter space. I am wondering if there is an example to illustrate this? Thanks.
Answer: Finding the MAP means solving the program
$$\hat\theta^\text{MAP}=\arg\max_\theta p(\theta|x)=\arg\max_\theta p(\theta)\mathfrak{f}(x|\theta)$$Assuming the transform $\phi=f(\theta)$ is bijective with inverse $\theta(\phi)$ and differentiable, the posterior distribution of $\phi$ is
$$q(\phi|x)\propto\mathfrak{f}(x|\theta(\phi))p(\theta(\phi))\times\left|\dfrac{\text{d}\theta(\phi)}{\text{d}\phi}\right|$$by the Jacobian formula. Hence, if the Jacobian$$\left|\dfrac{\text{d}\theta(\phi)}{\text{d}\phi}\right|$$is not constant in $\phi$, there is no reason for
$$\hat\phi^\text{MAP}=\arg\max_\phi q(\phi|x)$$to satisfy
$$\hat\phi^\text{MAP}=f(\hat\theta^\text{MAP})$$For instance, if $\theta$ is a real parameter and $$f(\theta)=1\big/1+\exp\{-\theta\}$$ then $$\theta(\phi)=\log\{\phi/[1-\phi]\}$$and the Jacobian is$$\left|\dfrac{\text{d}\theta(\phi)}{\text{d}\phi}\right|=1\big/\phi[1-\phi]$$Due to its explosive behaviour at $0$ and $1$, the posterior distribution in $\phi$ will likely have a MAP more extreme than $f(\hat\theta^\text{MAP})$
To borrow an example from my book, The Bayesian Choice, the MAP associated with$$p(\theta)\propto\exp\{-|\theta|\}\qquad\mathfrak{f}(x|\theta)\propto[1+(x-\theta)^2]^{-1}$$is always$$\hat\theta^\text{MAP}=\arg\max_\theta p(\theta|x)=0$$notwithstanding the value of the (single) observation $x$. Now, if we switch to the logistic reparameterisation $f(\theta)=1\big/1+\exp\{-\theta\}$ then the MAP estimator in $\phi$ maximises
$$-\left|\ln\dfrac{\phi}{1-\phi}\right|-\ln\left[1+\left(x-\ln\frac{\phi}{1-\phi}\right)^2\right]-\ln{\phi}(1-\phi)$$which is not systematically maximised at $\phi_0=1/2$, as shown by the following graph where $x$ ranges from $0.5$ to $2.5$ (and the maxima $\hat\phi^\text{MAP}$ drift rightwards):

[Note: I have written a few blog entries on MAP estimators and their "dangers", in connection with this issue. The first difficulty being the dependence on the dominating measure.]
Answer: Here is a little specific illustration for Xi'an's general result.
Consider the classical beta-binomial model, for which the posterior $\theta|y$ is beta distributed with, say, parameters $\alpha$ and $\beta$.
Then, by properties of the beta distribution, the MAP (mode of the beta distribution) is
$$
\hat\theta^\text{MAP}=\frac{\alpha-1}{\alpha+\beta-2}
$$
If we consider the odds $\phi=\theta/(1-\theta)$, we find (see next link, item related distributions) that their posterior follows a beta prime distribution, which has mode
$$
\hat\phi^\text{MAP}=\frac{\alpha-1}{\beta+1}
$$
Now,
$$
f(\hat\theta^\text{MAP})=\frac{\frac{\alpha-1}{\alpha+\beta-2}}{1-\frac{\alpha-1}{\alpha+\beta-2}}=\frac{\alpha-1}{\beta-1}\neq\frac{\alpha-1}{\beta+1}=\hat\phi^\text{MAP}
$$
EDIT:
This lack of invariance does not seem to be restricted to the MAP. Consider the posterior mean, another prominent Bayesian estimator. In the present example, the posterior mean for $\theta$ is
$$\hat\theta^\text{mean}=\frac{\alpha}{\alpha+\beta}$$
with
$$
f(\hat\theta^\text{mean})=\frac{\alpha}{\beta}
$$
which is not equal to the mean of the beta prime distribution,
$$
\frac{\alpha}{\beta-1}
$$


What do I do when the keyboard is frozen on my lock screen and I can't get in?

Question: I have an Android Galaxy J7 V and I don't use the key board to put in my password, I just have to swipe a certain way on the dots which I can't see to get into my phone.Since the keyboard is frozen I don't know what to do.
Comment: Restart your phone
Answer: What do you call that protection feature. Password but you use swipe to unlock or a feature similar to LG's 'Knock On'
Comment: I don't have a protection feature on my phone where you can just swipe, you have to swipe to enter the combination on the dots if that's what you mean.Since the keyboard is frozen in place, I cant see the combination lock, but thank you for the help.
Answer: If you could manage to get another input application you could surely manage to switch to it in order to get that obscuring keyboard in the lockscreen. Alternatively if the phone has a custom recovery installed, you can delete that keyboard from /system/app/SamsungKeyboard by using TWRP file manager so as to unlock the phone first before you look for another Keyboard app. Consequently, using a third risky way, you can move the app /system/priv-app/SystemUI/SystemUI.apk to sdcard using TWRP and boot the phone. It will show no Lockscreen install alternative keyboard app and return that app back to where it was. This will allow you to have a non freezing app and gain access to the swipe to unlock. If incase you don't have TWRP and root, it sounds to me like you have to reset the phone by powering it on using this key combo. Power, Volume Up + Home Button and reset the phone from there. But never forget that Android 6 Marshmallow and above has Factory Reset Protection. If you don't remember the Primary Google Email logged in to the device, never try resetting from recovery since it will request them upon powering on again.


What refractive index should be used while calculating the focal length of lens using lensmaker's formula?

Question: Suppose a lens is half dipped in liquid. Then should the refractive index of liquid with respect to air should be taken.
Or should refractive index of glass wih respect to liquid be taken. Or perhaps something else.
Comment: Take a look at Fresnel's formulas.
Comment: By "half dipped", do you mean that the axis of the lens is parallel to the surface of the liquid, or perpendicular to the surface of the liquid?
Comment: Axis is perp to liquid layer.
Answer: In this case, there is no single focal length. There are front and rear focal lengths, as well as the effective focal length. You can calculate refractive powers first:
$\Phi_1 = \frac{n_\text{lens} - n_1}{R_1}$
$\Phi_2 = \frac{n_2 - n_\text{lens}}{R_2}$
$\Phi = \Phi_1 + \Phi_2$
Then front and rear focal lengths:
$f_F = \frac{n_1}{\Phi}$
$f_R = \frac{n_2}{\Phi}$
In this situation, the thin lens equation is:
$\frac{n_1}{f_F} = \frac{n_1}{s_1} + \frac{n_2}{s_2} = \frac{n_2}{f_R}$
Effective focal length can be used as a single number representing both front and rear ones:
$f_E = \frac{1}{\Phi}$
$\frac{n_1}{f_F} = \frac{n_2}{f_R} = \frac{1}{f_E}$
All expressions taken from the free chapter of Physics of Digital Photography by Andy Rowlands.
Comment: Note: all of this assumes thin lens. The quoted book deals with thick lens as well.


Why can't I tame my ocelot?

Question: I'm trying to make a cat house for my zoo on Minecraft. I have some untamed ocelots and I also want a few tamed ocelots. Fish only puts them in breeding mode.
Answer: In order for an ocelot to become tamed, you must feed it while it is walking toward you. Don't force the cat. Stay still, don't make sudden movements while it's walking towards you, or else it'll get scared and run off.
Answer: From the "Ocelot" page on the wiki:

Taming
An ocelot can be tamed by attracting it to the player with an uncooked fish of any kind, then fed the fish, which can turn it into one of three breeds of Cat that will then follow the player. Taming an ocelot is likely to take more than one fish.
[...]
Breeding
When tamed cats are fed raw fish, they will immediately enter "breed-mode"

Ocelots will only enter breeding mode if they have been tamed. This means you have already tamed your cats!
By looking at your cat you can see if they have been tamed. If they look like this they have not been tamed:

When you tame a cat, they will turn into one of three breeds of cat, and look like this:

You can also check if they have been tamed by right clicking on your cat, they will sit down if they have been tamed.
If you want to know how to tame an Ocelot I recommend you read this article.  It explains it really well and I guarantee it will help you.
Comment: No help whatsover
Comment: Right-click with raw fish in your hand on an approaching ocelot until it emits hearts.
Comment: That made no sense to me but ok..
Comment: I have edited my answer to hopefully make it easier to understand.
Comment: Yes but HOW do you tame it?

Why can't I tame my ocelot?


Kiwifruit - slow drying

Question: Last year, I accidentally slow dried some yellow kiwifruit in my refrigerator. I had simply forgotten about them. It must have been at least four months before I realized. When I pulled them out, still in their plastic container, they were in no way rotted, moldy or even soft. They seemed to have slowly dehydrated and reminded me of giant raisins. Let me tell you, they were AMAZING. The flavors were so intense! Does anyone know of a system or actual method for this? I want to do try this as a regular thing, but I also do not want to waste kiwifruit...and to have my hopes and dreams dashed upon the rocks because it did not work again.
Answer: I think you were just lucky in that they didn't go moldy or rot in your refrigerator.  So, if you want more control, it would be a simple matter of peeling, slicing and dehydrating.  You can do this in an oven set on it's lowest temperature, or more reliably by using a food dehydrator. You can certainly experiment with whole fruit or larger chunks, but I think slices are the way to go for ease of use and storage.
Answer: I can give you no more advice than with any dried-fruit process.

make sure the fruits do not touch
make sure the fruits have appropriate airflow
check periodically for any damaged or mouldy ones and discard as appropriate.

You should be able to achieve the first two points with an egg carton.
But if you want fast and reliable results and don't mind getting slices a dehydrator is probably your best bet.

Kiwifruit - slow drying


Is the expectation value always an eigenvalue?

Question: Must the expectation value of an observable always be equal to an eigenvalue of the corresponding operator?
I already know that 0 is not an eigenvalue, but are there any other examples?
Answer: I would actually expect this to be rare, and only generically true when the state of the system corresponds to an eigenstate.  This simply because, for a state $\psi = \sum a_{n}\lvert\phi_{n}\rangle$ with eigenvalues $V_{n}$, you would have $\langle V\rangle = \sum V_{n}\lvert a_{n}\rvert^{2}$, which is not constrained to be equal to one of the $V_{n}$.  It's easy to check this for a two state system with the two values of $V_{n}$ different.
Comment: Right, for a classical experiment to get the basic idea, consider the expected number of eyes when throwing a die, namely $\frac{7}{2}$.
Comment: or, hey, even the average value $\frac{1}{2}$ of a coin coss where heads is labeled 1 and tails is labeled 0
Answer: A specific quantum mechanical example to show the contrary is spin-$\frac{1}{2}$ systems.  If you are in an eigenstate of the $S_{z}$ operator, the expectation value of $S_{x}$ is $0$, but it has eigenvalues $\frac{1}{2} \hbar$ and $-\frac{1}{2} \hbar$.
Answer: For the eigenstate the expectation value was the eigenvalue.
For an operator with a continuous spectrum, the range of the expectation value could align with the range of the eigenvalue.
However, there's also case where the expectation value not contained in the range of the eigenvalue.
Consider an operator $H$ with the integer eigenvalue $i$ of $|i\rangle$.
Setting $a=\frac{1}{\pi}$ and $r=(1-\frac{1}{\pi})$, where $|\psi\rangle =\sum_{i=0}^\infty \sqrt{a r^i} |i\rangle$. The states was normalized, but the expectation value $\langle \psi|H|\psi\rangle=\frac{1}{1-r}=\pi$, which was an irrational number.
This was an supplemental answer to pat's and Jerry Schirmer's.
Answer: No. Expectation valve is the mean value of the observable for a given state. The state your system assumes is a superposition (linear combination) of the eigenstates. Say, for example: you have a infinite potential well of width a, the then the energy/momentum eigenstates are: $\Phi_n=\sqrt{\frac{2}{a}}sin(\frac{n\pi x}{a}).e^{-iE_n t/\hbar}$. You can create any other state of the system(at $t=0$) using the linear combination of these eigenfunctions (Hint: Fourier half sine series). Say, your system is in state $\Psi$, then:
\begin{equation}
\Psi=\sum_{n=1}^{m}c_n \Phi_n \quad ...(a)
\end{equation}
$\quad \quad$ (read about Fourier's trick to find $c_n$)
$\quad$ where $c_n$ is some complex number such that $|c_n|^2$ gives the probability of the system being in the state $\Phi_n$ when the measurement is made. When you make a measurement on $\Psi$ (say, energy for example), You will get $one$ of the values $E_n$(energy eigenvalues) corresponding to the eigenstate $\Phi_n$ in $(a)$, and the probability of getting $E_n$ is $|c_n|^2$. Clearly all $|c_n|^2$s in $(a)$ should add up to give $1$. Clearly the average value of $E$(the expectation value): \begin{equation}\langle E \rangle=\sum_{n=1}^{m}|c_n|^2 E_n \quad ...(b) \end{equation} The inherent randomness of Quantum Mechanics is that you can know the values$(E_1,E_2,E_3...E_m)$ the system will give when the measurement is made, you can know the probability of getting $E_n$ when the measurement is made, but you cannot say with absolute certainty that you will get a particular $E_n$ before making the measurement.
Finally to answer your question, looking at $(b)$ you can tell that the expectation value is not always equal to the eigenvalue(it may be, perhaps by pure chance the summation can still add up to give one of the $E_n$), But if $\Psi=\Phi_n$ itself(compare this to $(b)$ and see how $|c|^2 =1$) then no matter how many measurements you make you'll always get $E_n$, so $\langle E \rangle=E_n$.


Auto adjustment of table size automatically in ATLAS from QGIS

Question: I would like to know if anyone knows any way to configure my ATLAS to automatically resize the attribute table if, for example, one field is having a long attribute than usual. I know in the layout of ArcGIS is possible but i am not finding the way in QGIS.
Comment: Maybe you want to take a look at the properties of the table and play around with the width for each column. I believe by default it is automatic, so it will adjust to the values it finds, but you can manually set each one to a set value. See the Main Properties section on this docs page: https://docs.qgis.org/3.4/en/docs/user_manual/print_composer/composer_items/composer_attribute_table.html
Comment: I was already playing around and testing it a lot without any success, I dont find any funcionality that automatically resize my table, and by default it doesnt do it as well.
Answer: Unfortunately there isn't a setting to set the width of the cell based on the length of the text, so instead I'd suggest a couple of options:
First - under the 'Position and Size' properties, set the reference point to the right-hand position - this way, if text does force the table to become wider, it won't bleed off the page:

Second - set the 'Oversized Text' option to 'wrap text', that way it will limit how much the table will widen if text is too big.


SharePoint Search Usage Logs

Question: The out-of-the-box SharePoint usage logs are a great way to get insights on what are most frequently searched terms, queries returning no results, etc. Is there a way I can get these stats by users too. I mean, what has each user tried to search when and whether s/he got the results or not? If not OOTB, does any third party tool assists in getting these stats?
Answer: you can't do that ootb (without developing on the server)
SharePoint doesn't expose this data.
you can check CardioLog - great tool but require deep understanding...
if they search from a single page you can put a script that saves every query to a different DB.

SharePoint Search Usage Logs


Ripped plastic Canadian currency/bills

Question: Can a ripped Canadian Plastic Bill with 60% portion of the bill remaining containing both serial #s still get full value?
Answer: You can read about the procedure for requesting reimbursement for mutilated Canadian currency, the Bank of Canada's Bank Note Redemption Service.  However, they do not seem to give any specifics about how they determine whether a bank note is eligible for reimbursement or not, so it may be a case-by-case decision.

Mutilated bank notes
Mutilated bank notes show signs of excessive damage from fire or water, missing pieces, or other forms of deterioration.

These bank notes are likely too damaged or brittle to be used for payment, so you can send them to us for redemption. We will examine them to determine the value of your claim.

But it seems like you might as well try it - you just have to fill out a brief form and mail it in with the banknote.  If the Bank of Canada won't reimburse it, presumably nobody else would either.
Answer: Yeah just (if it's ripped in half) tape it back together and go to your bank of choice and ask them to replace, it they will do it as long as it's more than 3/5 fine
Comment: [citation needed]

Ripped plastic Canadian currency/bills


Forgot Mac password, don't have apple keyboard

Question: I have forgotten my Apple Mac password. I have searched for multiple key codes to change the password but i haven't figured out how they work on a non-apple keyboard. I use a logitech (K120) keyboard.
Comment: What exactly have you tried to do (which doesn't seem to work with a non-apple keyboard)?
Comment: Do you have a firmware password enabled? If not, there is a way to change the password. Please also edit your question to mention your OS and model.
Comment: I would try booting with combinations of the (alt/option/windows/control/shift) and "r" keys until you hit the correct one. Note that keys on the left and right of the space bar might behave differently even if they are labeled the same.
Answer: See this link from Microsoft on how to use a Windows keyboard on a Mac. It is very useful for this exact issue and helps me a lot at times. To boot into recovery with a Windows keyboard you will need to hold down Ctrl and R at the start chime.


Density Functional Perturbation Theory

Question: What is the difference between density functional perturbation theory (DFPT) and many-body perturbation theory (MBPT)? Also, please help me understand why approximations like PBEsol are considered as DFPT, whereas GW approximations as MBPT.
Comment: Why did you tag wien2k, QE and VASP?
Comment: Apologies. I thought a community with these tags would answer the question.
Comment: I figured that was the case! I guess it confused at least one person.
Answer: Density functional perturbation theory is a way to calculate the response of a system to some perturbation. For example, you can use DFPT to calculate the response due to small displacements of atoms (this is done in phonon calculations), or to electric or magnetic fields. These are DFT based methods, and they use a DFT ground state and have an exchange-correlation functional. PBEsol is one such functional, and you can do a DFPT calculation using the PBEsol functional, or many others.
Many body perturbation theory is a method which tries to solve for certain properties of an interacting electron system. For example, one can calculate the total energy, or the electron addition/removal spectrum. It typically involves coming up with approximation for the single particle Green's function of the system, from which many other properties can be calculated. In most implantations, one does a DFT or Hartree-Fock calculation first, and then does MBPT based on the ground state wave functions. For example, in the GW approximation (perhaps one of the most commonly used MBPT methods), one often doesn't do a self-consistent calculation, so that the results of the calculation depend on the DFT ground state. GW calculations based on PBE, LDA, or hybrid functional wave functions can (and often do) give different results. GW is a MBPT method since it's a Green's function based approach to solve the interacting electron problem.
Perhaps a source of confusion in your question is that DFPT can calculate some of the same things as MBPT. For example, you can calculate the dielectric matrix with both of them. Reading the VASP wiki might give you a sense for what sorts of physical processes are included in DFPT approaches vs MBPT approaches.
Answer: To amend AGS's answer, in density functional perturbation theory one looks at how small perturbations to the system affect properties such as dipole moments, excitation energies, etc.
Many-body perturbation theory (MBPT) is a wholly different animal. There, the idea is to treat interelectronic interactions as the perturbation, since we are only able to easily solve systems non-interacting electrons to high accuracy. An example of MBPT is Møller-Plesset perturbation theory, usually used in the second-order (MP2), which gives you an estimate for the electron correlation energy based on a self-consistent field Hartree-Fock calculation.
However, the issue in MBPT is that interelectronic interactions are not weak, even though one typically makes this assumption in the derivation of perturbation theories. For instance, the Møller-Plesset perturbation series truncated at $n$th order (MP$n$) often diverges when one goes to $n \to \infty$, see e.g.  J. Chem. Phys. 112, 9736 (2000)

Density Functional Perturbation Theory


MariaDB Fails to log in error log

Question: I am using MariaDB Version 5.5.56
The database was restarted 2 days ago but I am not seeing any log entries in the error log except an error importing from a dmp file. The data seems complete and all processes and transactions are occuring correclt just no error logging. Is there a way to turn this on? I have tried "flush error logs" command but still no log entries.
Answer: You can execute this to see where the error log file is supposed to be written:
show global variables like 'log_error';

This can (sometimes) show a relative path, relative to the datadir.
From the documentation:

The error log is active by default. The log-error=filename option determines where the output will be written. If no file name is specified, the log will be written to host-name.err. If no absolute path is specified, the file will be written to the data directory (determined by the value of the datadir system variable).
On Unix systems, if the --log-error option is not used, the errors are written to stderr (usually, the command line).
On Windows, if the --console option is specified, and --log-error is not used, the errors are written to the console. If --log-error is present, --console is ignored.

Additionally, for warning messages, the log_warnings variable need to be > 0. There are different warning levels, and the higher the value of log_warnings, the more kinds of warning messages are logged. For details, see the documentation for the log_warnings variable.
To see you current setting, run:
show global variables like 'log_warnings';

MariaDB Fails to log in error log


Install packages in CentOS from DVD without connection to internet

Question: I have a CentOS 6.4 system with no connection to internet. I have the installer DVD though. How can I install a package, say gcc, using this DVD alone?
Answer: Let us assume the ISO is already burnt into a DVD, or the ISO is present as a file on your file system. First, we need to mount it. The preferred mount point to mount it is /media/CentOS, because yum is configured to look for repositories from this location by default while installing packages from DVD. The steps below describe how to mount the ISO (whether present as a file or burnt into DVD) and install packages from the ISO.

If you have the ISO burnt into a DVD, insert the DVD into the CentOS system. If the ISO is not burnt into a DVD, but present as a separate file on the file system, then skip the next two steps and go directly to step 4 in this list.
Check if the DVD has been mounted automatically. To do this execute the following command:
mount | grep CentOS

If this command returns an output, it means the DVD has been mounted. For example, the following example output shows that the DVD has been mounted to /media/CentOS_6.4_Final automatically.
/dev/sr0 on /media/CentOS_6.4_Final type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,iocharset=utf8,mode=0400,dmode=0500)

If the CD has been mounted automatically, then ignore this step. Otherwise, mount it manually.
mkdir /media/CentOS
mount -t iso9660 /dev/sr0 /media/CentOS

If the ISO is present on the file system, mount it to /media/CentOS using the mount command with -o loop option.
mount -o loop CentOS-6.4-x86_64-bin-DVD1.iso /media/CentOS/

Execute: cat /etc/yum.repos.d/CentOS-Media.repo and read the information provided as comments in this file. See the repo name within square brackets. It is c6-media by default. Also, see the locations specified for baseurl property. These URLs point to local directories /media/CentOS, /media/cdrom and /media/cdrecorder/ by default.
If the DVD is mounted to a mount point specified in the baseurl property, then ignore this step. Otherwise, create a symbolic link at a location specified in the baseurl property with the mount point as its target. An example follows.
ln -s /media/CentOS_6.4_Final /media/CentOS

In the shell, execute the yum command while disabling all repos except the repo specified in /etc/yum.repos.d/CentOS-Media.repo:
yum --disablerepo=\* --enablerepo=c6-media install gcc

Answer: Installing CentOS packages from CentOS DVD iso on VirtualBox
Insert CentOS DVD image in VM:
Devices->Optical drives->CentOS-8.5.2111-x86_64-dvd1.iso

DVD will be visible at following location:
/run/media/user/CentOS-8-5-2111-x86_64-dvd/

Login as root:
su root

Create Directory /media/CentOS
mkdir /media/CentOS

Run following commands to mount package repositories under /media/CentOS:
$> ln -s /run/media/user/CentOS-8-5-2111-x86_64-dvd/BaseOS/ /media/CentOS
$> ln -s /run/media/user/CentOS-8-5-2111-x86_64-dvd/AppStream /media/CentOS

$> ls /media/CentOS/
AppStream BaseOS

Check status of repositories using command:
$> yum repolist all

Enable our media repos:
$> yum config-manager --enable=media-appstream
$> yum config-manager --enable=media-baseos

Disable all other repos:
$> yum config-manager --disable=[repoid]

Run following command and you will see all available packages:
$> yum list

Install package using command:
$> yum install <package-name>


Does the fact that a treaty or legal text have differing translations preclude its enforceability?

Question: Sometimes a legal text (a statute, or a treaty, for example) has inconsistent translations in two or more languages. Does this preclude its enforceability?
Answer: No. The fact that there are discordant translations of a legal text does not prevent its enforceability.
canada
In Canada, there are two relevant doctrines. One for statutory interpretation of French and English statutes, and one for interpretation of treaties with Indigenous peoples.
In R. v. Daoust, 2004 SCC 6, the Supreme Court laid out the principles of interpreting statutes that have French and English translation when there is discordance between the two. It did not hold that such a statute is unenforceable. Instead, it provided an approach to determining what the common meaning is.
Where a treaty with Indigenous peoples is at issue, a key interpretive principle is:

any ambiguities or doubtful expressions in the wording of the treaty or document must be resolved in favour of the Indians
R. v. Badger, [1996] 1 S.C.R. 771 at para. 41
Comment: Counterexampe: Ethiopia and Italy...he Ethiopian text said may use Italy to negotiate with European powers,  ihr italian text said must use italy.
Comment: https://www.britannica.com/event/Treaty-of-Wichale - Art. XVII differed in such a way that there effectively **was** no treaty in the first place: Italy used the Italian text of the Treaty to try and claim that Ethiopia was their protectorate, especially towards other European countries, and Ethiopia tried to negotiate with them believing their Amharic test, which only said that they had the *right* to use Italy, not the duty. The resulting denunciation of the treaty by Ethiopia led to the First Italo-Ethiopian War - the versions could not stand next to one another and both be binding.


Learn more in depth vs basics with someone else

Question: If a learned person has the choice of learning something by themselves that they never learned before and going in depth into it, vs learning with someone who otherwise wouldn't learn but you'd be learning something basic that you already know, what would our rabbis suggest to do? Focus in yourself and grow your knowledge, or learn with the other person, even if it'll be low level, and thus imbue some Torah into his life?
Comment: Truth is, though, that you may be astonished how much you yourself learn by having to explain "low-level" topics to a beginner, if you do it honestly. Torah at every level contains worlds.
Comment: Is this a general question of how much chesed to do? If we love another Jew, we should want to help them grow. But no one expects someone to do chesed all the time and never take care of himself. Do both.
Comment: @MichoelR I think a good place to find opinions about that might be the "machloket" between R' Weinberg and R' Weinbach of Aish and Ohr Somayach respectively. I believe the latter believed 10% of our time should be for chesed/outreach
Answer: R Moshe Feinstein has a teshuva (EH 4:24:4, right side of here, about mid-page) where he writes that a talmid chacham should spend a portion of his time teaching others, even if it means giving up some of his own learning. He writes this is for sure 10% of this time, possibly up to 20%.
R Moshe finds a proof in the gemara (Eruvin 54b) where R Perida taught one of his student 400 times the same lesson, and mentions this was for sure in the time he was giving others.
See also this broader essay on the topic from 1973 which I scanned for MY.
Comment: Thank you! Gonna leave this open for a bit more to see if anyone else has some insights but if not I'll mark this
Comment: Don't understand the proof about R' Preida. Maybe that was his job?
Comment: @MichoelR R Perida was a Tanna in Eretz Yisrael. The gemara (Megila 27b) writes about him "On the third occasion, Rabbi Perida was once asked by his disciples: In the merit of which virtue were you blessed with longevity? He said to them: In all my days, no person ever arrived before me to the study hall, as I was always the first to arrive." Think of him as a *gadol hador*, his job was not to teach beginners 400x the same thing. Imagine asking R Eliashiv or R Schachter to teach you 400x something .... the fact he did testifies (writes R Moshe) to the need to spend time helping others