I have the following code snippet:  Set&lt;Short&gt; map=new HashSet&lt;&gt;(); short i=1; map.add(i); map.remove(i-1)   It ignores removal because I-1 was automatically casted to integer. But, why there is no remove(V) method with generic? It's bad, I should see an exception or this method should be generic. Doesn't make any sense. Why was it designed this way?  The question is:  If we have Set, why don't we have method remove(E e) inside it? I found that it's because internally there is an array of Object. But why? If we have Set  of E generic type, why don't we have E[] as internal storage? For me it's absolutely doesn't make sense.  For example I expected:  class Set&lt;E&gt;{    private E[] values;     public void add(E e);     public void remove(E e);  }   But I got:  class Set&lt;E&gt;{    private Object[] values;     public void add(E e);     public void remove(Object e);  }   Why not to do this?  class Set&lt;E&gt;{    private E[] values;     public void add(E e);     public void remove(E e){        for(E v:values){          if(v.equals(e)){             //remove element          }       }     } }   ????
Why isn't  generic?    Seems like Collection&lt;E&gt; could have boolean remove(E o);   Then, when you accidentally try to remove (for example) Set&lt;String&gt; instead of each individual String from a Collection&lt;String&gt;, it would be a compile time error instead of a debugging problem later.
Test the convergence of the series For $a&gt;0$, test the convergence of the infinite series: $$\sum a^{\ln(n)}$$ Which test should be better to use here? I tried the D'Alembert's ratio test. $$\lim_{n\to \infty} {\frac{a^{\ln(n)}}{a^{\ln(n+1)}}}= \lim_{n\to \infty}a^{ln{\frac{n}{n+1}}}=a^0=1$$ So the test failed.  UPDATE: I observed that $${a^{\ln(n)}}=e^{{\ln(a)}{\ln(n)}}={n^{\ln(a)}}={{1\over n^{ln({1\over a})}} }$$Further by test of auxiliary series $$\sum \frac{1}{n^p}$$ we know that criterion for convergence is $p&gt;1$. Here $p=ln({1\over a})$.Hence the series will be convergent when $ln(a)&lt;-1$ i.e. when $0&lt;a&lt;1/e$, since $a&gt;0$ is already given.Finally this solved my question. How do I move to a new tab in gedit using the keyboard? If I have multiple tabs open, how do I move from one to another? (Ubuntu 11.10; gedit 3.2.1) Count and use the number of items in advance What does ` (backquote/backtick) mean in commands? I came across the following command:  sudo chown `id -u` /somedir   and I wonder: what is the meaning of the ` symbol. I noticed for instance that while the command above works well, the one below does not:  sudo chown 'id -u' /somedir Can I argue that:  \begin{align} \left(\int_a^b f(x) \,dx\right) \left(\int_c^d g(y) \,dy\right) &amp;= \int_a^b f(x) \int_c^d g(y) \,dy \,dx \\ &amp;= \int_a^b \int_c^d f(x) g(y) \,dy \,dx \end{align}  since the same would be true for a product of finite sums? Today 4/30/20 my seemingly worthless USO call option increased in value.   Specifically: USO1 $2.5 Call 5/8  On 4/29 it was valued at $.04 and stayed there.   4/30 I checked after hours and now it’s up to $.08? Which was wasn’t even the highest it went to today.  So who is buying this contract?  Who is allowed to buy this contract? Bc I’m only able to sell and from what I understood, nobody is able to buy it.   I have screenshots and will post if requested. Thank you If $A^2\succ B^2$, then necessarily $A\succ B$ I remember reading somewhere about the following properties of non-negative definite matrix. But I don't know how to prove it now.  Let $A$ and $B$ be two non-negative definite matrices. If $A^2\succ B^2$, then it necessarily follows that $A\succ B$, but $A\succ B$ doesn't necessarily leads to $A^2\succ B^2$.  How can you prove it? Thanks! How do you become a vampire/werewolf in Elder Scrolls Online The game is released for a few days now. I have heard that you can turn into thoses beasts. I have a few questions about that   How do you turn into werewolf/vampire ? On the chat people said they can bite others but who bite them first? How long does the effect last ? Are there any cons ? Maybe if your are a vampire you take damage from the sun like in older Elder Scrolls ? Appearing on the second page (under the section Digression: Size worries) of the following paper about the Yoneda Lemma:     It says that $a$ $priori$ $[\mathcal C^{op},Set](H_A,X))$ is a class. I don't understand why this is the case.  My understanding is that $a$ $priori$ each member of $[\mathcal C^{op},Set](H_A,X))$ is a class.  So it seems to me that $[\mathcal C^{op},Set](H_A,X))$ could be a collection of proper classes.  I've looked at this , but it hasn't helped me much.  Any help is appreciated -Thanks Quick way to remove solidify thickness I have made the mesh and added solidify modifier and applied. But later i thought to increase the thickness. So now i want to remove thickness so that i can added the solidify modifier again. I want to know is there any quick remove thicknes. When i select the edge then ctrl+ the selection goes downward not to single face. So i want to know a quick way to decrease thickness. Any suggestion or help. How to hide Authoring information,Revision information,Publishing options tabs in create/edit node for any content type I am trying to hide Authoring information, Revision information, Publishing options tabs in create/edit node for any content type. I tried different modules with no luck. Please give me suggestions how to achieve this. Thanks a lot Submitting form elements with the same name Collection was modified; enumeration operation may not execute 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);         }     } } I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great. Avoiding errors due to unexpanded asterisk In bash I often use for-loops such as the following  for file in *.type; do    sommecommand "$file";  done;   to perform an operation for all files matching *.type. If no file with this ending is found in the working directories the asterisk is not expanded and usually I will get an error message saying that somecommand didn't find the file. I can immediately think of several ways to avoid this error. But adding a conditional does not seem to be very elegant. Is there a short and clean way to achieve this? When do you use at the office? And when do you use in the office? What's the difference between the phrases? In my , I provided the following, problematic,  wording (especially bold italic), and I need help to better understand this issue so I can fix my answer:1          The thing is the books. (Reduced form of Sentence 2.a)         Fundamentally, Sentence 2.a (the so-called "correct" answer), is grammatically defective. Recall there is another grammatical rule: the subject and subject's complement should match in number.    A clarification is needed here. I am not suggesting here, in this EL&amp;U question, that there is any such singular grammatical rule as indicated in the quote above.  The quote continues as follows:     The reduced sentence makes the disagreement between the subject's and complement's plurality obvious. What is one to do? Language is linear and we know "The thing is X" is better than "The thing are X", so we go with the former, which is the subject-verb agreement rule. But what is "the books" then? It must be thought of as a collective noun, even if it doesn't look or feel like one. Forcing something to be a collective noun is related to the idea of notional agreement.   Others noted that grammatically defective is too strongly worded.  There is no such "grammatical rule" for subject/complement agreement.  Please help me understand/improve upon my line of thought here.  I'm stating that Sentence 2.1 presents a fundamental "conflict" or "error" (however one might define error) at some level (morphological, syntax, grammatical, semantic):     The thing is the books.  (Or, "The thing is the objects.")   Based on the "obvious" morphosyntactic plurality conflict, the above sentence feels so wrong that I think many native speakers would think it "simply" grammatically incorrect. However, @F.E. gives counter examples:     And here are some more grammatical examples, where the number of subject and predicative complement don't agree: "They were a problem to us all", "That so-called work of art is simply four pieces of driftwood glued together" (CGEL, page 254-5). As CGEL says: "What is required is semantic compatibility, not syntactic agreement . . .". There are more examples on page 512: "The only thing we need now is some new curtains", "The major asset of the team is its world-class opening bowlers", "Our neighbors are a nuisance", "This gadget is five different tools in one".   I think all the examples given above can be explained as notional agreement.    Question 1: If we explain this phenomena in terms of notional vs syntactic agreement, where does "grammatically correct/incorrect" fit in?  Question 2: Can a simple sentence such as "The thing is the objects." be grammatically incorrect while more complex sentences such as "The thing is four pieces of driftwood glued together." be grammatically correct?  (The answer, in my mind, must be no; this is my conundrum.)  Question 3: Would it be better to say that Sentence 2.a has a low level of (linguistic) ?   Question 4: How about a low level of  and that it's semantically difficult to be (linguistically) ?    Question 5: Do we simply draw a hard line and say "The thing is the objects." is 100% grammatically correct?  I didn't particularly like this option based on intuitive notions of "grammatically correct".    1. Please help me and be kind; I'm trying to improve my understanding. I'm looking for cool, objective advice on how to look at this.  I numbered my questions so they can be easily referenced, if desired.  My preference is the final answer would sufficiently answer all the questions, but of course that can be done explicitly or implicitly. How to prevent Windows from entering idle state? Mathematically-oriented Treatment of General Relativity In ubuntu 11.04 there was a workaround using gconf-editor and setting key /apps/gnome_settings_daemon/plugins/xrandr/active to false.  However there is no such key in gconf-manager using ubuntu 11.10 (gnome 3).