I am basically putting all my settings into my .bashrc and when I was using zsh it was all in my .zshrc.  The Rust installer just informed me that it has added the new installation to my PATH by modifying .profile.  When should things go into ~/.profile?  Is it only doing that because it doesn't know which shell I am using or should all somewhat general settings be in .profile?
I found the .bashrc file and I want to know the purpose/function of it. Also how and when is it used?
I can't get to the bottom of this error, because when the debugger is attached, it does not seem to occur.  Collection was modified; enumeration operation may not execute  Below is the code. This is a WCF server in a Windows service. The method NotifySubscribers() is called by the service whenever there is a data event (at random intervals, but not very often - about 800 times per day). When a Windows Forms client subscribes, the subscriber ID is added to the subscribers dictionary, and when the client unsubscribes, it is deleted from the dictionary. The error happens when (or after) a client unsubscribes. It appears that the next time the NotifySubscribers() method is called, the foreach() loop fails with the error in the subject line. The method writes the error into the application log as shown in the code below. When a debugger is attached and a client unsubscribes, the code executes fine. Do you see a problem with this code? Do I need to make the dictionary thread-safe? [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)] public class SubscriptionServer : ISubscriptionServer {     private static IDictionary&lt;Guid, Subscriber&gt; subscribers;      public SubscriptionServer()     {                     subscribers = new Dictionary&lt;Guid, Subscriber&gt;();     }      public void NotifySubscribers(DataRecord sr)     {         foreach(Subscriber s in subscribers.Values)         {             try             {                 s.Callback.SignalData(sr);             }             catch (Exception e)             {                 DCS.WriteToApplicationLog(e.Message,                    System.Diagnostics.EventLogEntryType.Error);                  UnsubscribeEvent(s.ClientId);             }         }     }          public Guid SubscribeEvent(string clientDescription)     {         Subscriber subscriber = new Subscriber();         subscriber.Callback = OperationContext.Current.                 GetCallbackChannel&lt;IDCSCallback&gt;();          subscribers.Add(subscriber.ClientId, subscriber);                  return subscriber.ClientId;     }      public void UnsubscribeEvent(Guid clientId)     {         try         {             subscribers.Remove(clientId);         }         catch(Exception e)         {             System.Diagnostics.Debug.WriteLine(&quot;Unsubscribe Error &quot; +                      e.Message);         }     } } Gollum had his life largely extended because he possessed the One Ring. He appeared to be an old, deformed, and twisted creature.  According to , he had the Ring for 478 years. His loss of the Ring and the events of The Lord of the Rings are separated by around 77 years.  Did the Ring continue to extend his life after he lost it? How can I fix apt error "W: Target Packages ... is configured multiple times"? Contraction of Kronecker delta = 4 This suggests, as a shortcut notation, the concept of lowering indices; from any vector we can construct a (0, 1) tensor defined by contraction with the metric: $$A_\nu ≡ g_{\mu\nu}A^\mu$$  so that the dot product becomes $$g_{\mu\nu}A^\mu B^\nu = A_\nu B^\nu$$  We also define the inverse metric $g^{\mu\nu}$ as the matrix inverse of the metric tensor: $$g^{\mu\nu}g_{\nu\rho} = δ^\mu_\rho$$  where $δ^\mu_\rho$ is the (spacetime) Kronecker delta. (Convince yourself that this expression really does correspond to matrix multiplication.) Then we have the ability to raise indices: $$A^\mu = g^{\mu\nu}A_\nu$$ Note that raising an index on the metric yields the Kronecker delta, so we have $$g^{\mu\nu}g_{\mu\nu} = δ^\mu_\mu = 4$$  I don't understand why $δ^\mu_\mu = 4$. Shouldn't it equal 1? Many of the UK visa refusals we see here share a common pattern and the prevailing reasons refer to V 4.2 (a) and (c).    I do understand that, while the applicants may describe very different individual circumstances, there's a consistent pattern and, broadly, fall into specific categories:    Credibility (lifestyle, lack of ties, visit history, lies &amp; omissions) Funding (insufficient funds, provenance of funds, funds parking) Sponsorship (family, friends, employer)   Question: What most commonly triggers a UK visa refusal where V 4.2 (a) and (c) are given as the grounds?  Secondarily: Given that there is a clear pattern, to what extent are these refusals predictable? Does sponsorship make a difference? Is there a set of personal circumstances, however abstract, where a refusal is all but guaranteed? For example, why do those we see here on TSE who sought entry for the PLAB or British Army appear to be refused with a common theme? Is there a uniform shortcoming or is it just discrimination?   PLAB: What is about applications for a visa, for the purpose of sitting the Professional and Linguistic Assessments Board (PLAB) exam, that seem to invite refusals. After all, the test is given so that international medical graduates can show that they qualify to practise medicine in the UK. The first part, PLAB 1, can be taken in centres outside of the UK. However, PLAB 2 can be taken only in the UK. Why can't you can't get a visa just to sit the exam, promising that you'll leave immediately after?    British Army: Since Commonwealth citizens are eligible to apply online to join, even those who don't reside in the UK, why is it so difficult to get a visa just to attend an interview to see whether you are suitable? Even with an invitation from the Army, such visa applications seem to be unsuccessful. Isn't a career in the British Army a valid reason?     Lastly:  After such a refusal, what approaches would increase the chance of a successful application? Is there any rule for differentiating between the endings "th" and "ht"? Some words end in th (length, width), and others end in ht (height, fight, tonight, caught).    I sometimes have difficulties in spelling such words because I don't know which ending to choose. Is there any rule or pattern (even localized) in choosing one or the other? Since I first learned English, I have been holding this understanding that "and", as a conj. but unlike "but",  can only connect two clauses, not two sentences ended with periods.  But recently, I have seen so many prints, either in entertainment or in academia, where "And" is popularly used in the beginning of a sentence. It seems like the author is trying to connect the sentence just right before and the sentence following "And" in some intended meaning which I don't quite get.  I was wondering if I have been wrong all the time, or if there is a new trend that I fail to understand and accept? How to understand such usage of "and" in rigorous English grammar? If I am right, why it is used differently from "but" in terms of what I mentioned at the beginning of this post? Why didn't the Hobbits get frostbite? This is a question that's been bothering me for the last couple of days:  How is it that the hobbits of the Fellowship were able to survive such cold temperatures throughout their travels without having any foot protection?   I know it's said that they have thick "leather like" soles, with ample amounts of hair for warmth but still, I don't understand how that could provide much more warmth than for instance a regular leather shoe. On top of this I know that multiple days (or even weeks) of their journey was spent crossing mountain ranges, which, near a summit would have a temperature far below freezing. This combined with the assumption that they only have the warmth of shoes on there feet would have presumably resulted in some level of frostbite. But to my knowledge there is no such mention of these problems in the novels or movies aside from the odd "It's cold".  Anyways, I'm just wondering if anyone has some form of explanation to this phenomenon or do hobbits just have really durable feet? Playing system sound without importing your own Truncated trivariate normal - conditional expectation $\forall x,y>0, x^x+y^y \geq x^y + y^x$ Prove that $\forall x,y&gt;0, x^x+y^y \geq x^y + y^x$   A friend of mine told me none of the teachers in my school have succeeded in proving this seemingly simple inequality (it was asked at an oral exam last year). I tried it myself, but I made no significant progress. Why don't my female dwellers give birth to children? I am playing Fallout Shelter on my IPad. There were some women who have already gave birth, but two female dwellers are carrying their babies for about 18(!) hours. I know that this process takes three hours, so this is not normal. What do I do? $\sqrt{7\sqrt{7\sqrt{7\sqrt{7\sqrt{7\cdots}}}}}$ approximation My cursor is moving by every selection by large increments!  Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.  How do I reset it to normal? example:  a_list = [1, 2, 3] a_list.len() # doesn't work len(a_list) # works   Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.  Plus I keep trying the wrong solution since it appears as the logical one to me Lecturer with anxiety. How to survive in academia? I've been a long time member of academia.SE but I created this alt account because the question is a bit embarrassing. I finished my PhD 4 years ago and after a 2 year postdoc at a different university secured a contractual lecturership. During my PhD I never realised I had fear of public speaking, because I always felt secure presenting in front of my supervisor. Even at conferences, his presence in the audience was enough to keep me relaxed.  Fast forward to my postdoc, I was mostly working and publishing by myself. So, even if I had to present something it was to my coauthors, with which I am okay. But as a lecturer doing research part of my time, I am involved in projects and seminars where I am expected to present my latest work. Being on my own has brought out my inner anxiety, so much so that I choked during a presentation, had to drink water to calm my nerves and apologise for my breathlessness and slurred speech. That was the most embarrasing thing in my life. Please note that the anxiety is not the result of me not publishing or doing research. I have published more than most in my department. Knowing that hasn't helped with the anxiety though. I am constantly making excuses to get out of project presentations and seminar talks. Fortunately, the anxiety is less intense in teaching and I am able to manage.   How do I survive as an academic? Now even conference presentations seem daunting. I can publish exclusively in journals, but how do I get out of giving project and departmental presentations? How can I politely refuse to present without revealing my situation? Or better yet, how do I fix the whole thing? That one bad presentation has really messed me up. Prove: If $a$ and $b$ are odd integers, then $8\mid (a^2-b^2)$  So far I have: $$8\mid \left((2n+1)^2-(2m+1)^2\right)\Longleftrightarrow 8\mid \left(4n^2+4n+1-4m^2-4m-1\right) $$ Is this right so far? Where do I go from here? Step by step explanation please! How do I sudo a command in a script without being asked for a password? How to calculate the number of days you can stay in Taiwan on a tourist visa? Tourist visas to Taiwan have an associated "maximum stay" of 30 days. For those visas, how are the days counted? Does the stay begin on the partial day that the traveler arrives or the first full day spent in the country? Does it end on the last full day spent in the country, or the actual day the traveler departs? Exclude lstinputlisting I want to save paper when I print my LaTeX file. That's why I want to hide all my code, inserted wtih lstinputlisting{}  I already know how to exclude tables and images or math but the lstinputlisting{} is a problem.   Hope someone can help me  \usepackage{comment} \excludecomment{figure} \let\endfigure\relax \excludecomment{table} \let\endtable\relax \excludecomment{align*} \let\endalign\relax \excludecomment{lstlisting} \let\endlstlisting\relax   edit: added lstlisting