I have this API which I can't change:  public interface A&lt;T&gt; {   void onClick(T widget); } public interface B&lt;T&gt; {   void use(A&lt;T&gt; a); }  public interface C {   B&lt;?&gt; apply(); }   I have an instance c of a C object, and I need to call apply(), and then call use() on the result and provide an Anonymous Inner Type. Here is what I tried:  B&lt;Object&gt; b = (B&lt;Object&gt;) c.apply(); b.use(new A&lt;Object&gt;() {    onClick(Object o) {    }  });   This works, however it produces a unchecked warning. Is it possible to avoid it?  Thanks
Eclipse is giving me a warning of the following form:     Type safety: Unchecked cast from Object to HashMap   This is from a call to an API that I have no control over which returns Object:  HashMap&lt;String, String&gt; getItems(javax.servlet.http.HttpSession session) {   HashMap&lt;String, String&gt; theHash = (HashMap&lt;String, String&gt;)session.getAttribute("attributeKey");   return theHash; }   I'd like to avoid Eclipse warnings, if possible, since theoretically they indicate at least a potential code problem.  I haven't found a good way to eliminate this one yet, though.  I can extract the single line involved out to a method by itself and add @SuppressWarnings("unchecked") to that method, thus limiting the impact of having a block of code where I ignore warnings.  Any better options?  I don't want to turn these warnings off in Eclipse.  Before I came to the code, it was simpler, but still provoked warnings:  HashMap getItems(javax.servlet.http.HttpSession session) {   HashMap theHash = (HashMap)session.getAttribute("attributeKey");   return theHash; }   Problem was elsewhere when you tried to use the hash you'd get warnings:  HashMap items = getItems(session); items.put("this", "that");  Type safety: The method put(Object, Object) belongs to the raw type HashMap.  References to generic type HashMap&lt;K,V&gt; should be parameterized.
This is a reformulation of a deleted question:  If  $a_1 &gt; 0$ and $a_2 &gt; 0$ and $2a_{n+2} \le a_{n+1}+a_n$,  show that  $\lim \sup a_n \le \frac23 a_2 + \frac13 a_1$.  My proof involves showing that $a_{n+2} \le u_{n} a_{n+1} + (1-u_n)a_n $ where $u_n \to \frac23$, and I wondered if there is a simpler proof.  I will post my proof in a couple of days if no one does. How can I make a time delay in Python? Can I clear an area of my prison for everyone BUT max security prisoners? Should smilies be turned into images in questions and answers? A lot of mention has been made of the seriousness of Stack Overflow (and presumably Server Fault). Would it be a good idea to turn  :-) into actual images as per  in questions and answers? I just added a PPA repository for the development version of the GIMP, but I get this error:  $ apt-get update &amp;&amp; apt-get upgrade ... The following packages have been kept back:   gimp gimp-data libgegl-0.0-0 libgimp2.0   Why and how can I solve it so that I can use the latest version instead of the one I have now? Creating polygon from hole in QGIS? Upgrading straight handlebars to drop handlebars How to copy file path to clipboard? Is there a way to copy the currently selected filename, including the path, to the clipboard? Ideally this would be through the right-click menu.  Some degree of flexibility would be useful, like the ability to copy just the filename, path+filename, filename minus extension, etc. This isn't essential, though, as long as it can copy the path+filename.  The solution must be compatible with Windows XP, Windows Vista and Windows 7. I am Haitian, and traveling with a Haitian passport. I have to go to London with a work permit (tier 2 visa) on the 29th of July but I have 2 hour transit in Dublin.  Do I need a transit visa? Can I get it at the airport?  I also have a valid US visa. Given any uncountable subset $S$ of the unit interval. Then $S$ clearly has an accumulation point and indeed uncountably many (which might also be a nice exercise). So my question is: Is there an accumulation point, that again lies in $S$? Ubuntu 18.04 - Dell XPS13 9370 no longer suspends on lid close This was working perfectly on 17.10 but after upgrading to 18.04 yesterday, when the lid is closed the screen turns off but doesn't suspend properly.  I travel around a lot and immediately noticed the heat (and battery draining) when taking it out of the travel case.  I've tried uncommenting these lines in /etc/systemd/logind.conf  HandleLidSwitch=suspend HandleLidSwitchDocked=suspend   and restarted but didn't make any difference. javac command not found I am trying to compile a java program I found on the internet and it says that I must check if javac is installed. I installed the JDK a long time ago so it should be working but I get command not found error:    how can this be resolved? I understand that in a lot of big-lab fields it is common for the principal investigator to append their name to a paper even if they did not write the paper, design the experiment, or collect data since they spend energy securing funding, and managing the whole lab. What about for small labs?  What are the requirements for a supervisor to be included as an author on a paper, as opposed to just appearing in the acknowledgements? If you are working on your own projects independently of your supervisor, but using funding provided by your supervisor (how does this change when the funding provides resources versus just your salary), are you suppose to add them as authors or just acknowledge the source of funding? I have come across both the phrases - 'on the internet' and 'over the internet.'   I'm pretty sure that both are correct but then which to use when?  Please note, I'm well aware of all over the Internet which I'm not concerned about. Im trying to run the following code as a powershell script,but I cant get it to work. 1st,the following works with one -Include item but I cant seem to get it to work with multiple ones. 2nd, the -Exclude perimeter doesn't seem to work. I still get files from the C:\Windows and C:\Program Files directorys .  $Include = "*.zip","*.rar","*.tar","*.7zip" $exclude = "C:\Windows","C:\Program Files" Get-ChildItem "C:\" -Include $Include -Exclude $Exclude -Recurse -Force -ErrorAction silentlycontinue | Select-Object -ExpandProperty FullName   Note: The purpose of this script is to find all compressed files on the system. I know this is probably really simple but I just cant seem to get it to work. XMLHttpRequest Origin null is not allowed Access-Control-Allow-Origin for file:/// to file:/// (Serverless) Homomorphism between free groups Let $F_a$ be the group which is freely generated by $a$ elements. How to show that there is a homomorphism from $F_a$ onto $F_b$ if and only if $b\le a$?  I was thinking one possibility is if $F_a$ generated freely by $\{x_1, \dots , x_a\}$ and $F_b$ generated freely by $\{y_1, \dots , y_b\}$ then consider map which says $\phi(x_i)=y_i$ for $1\le i \le b$ and $y_1$ otherwise. I do not know if this works or even how to proceed. How to show this fact? My players have been scheming with rapid entry tactics for the megadungeon I've recently started running. Unfortunately, the monsters are aware of the adventurers, and this has lead to a weird question of priority. Given the following situation (which I'm pretty sure is going to happen next session in some form or another) what happens?     Alice the adventurer readies an action; if her teammate Carlos opens   the door, she's going to throw the alchemists fire through the door,   which should do enough damage to kill any goblins hiding there.      Meanwhile, on the other side of the door, Bob the goblin is lying in   wait. He readies an action; if the door opens, he's going to hit the   switch to open the trapdoor in the next room, which should drop any    pesky adventurers into a pit with spikes at the bottom.      Carlos opens the door.   I know what happens when , but what happens when multiple readied actions get triggered at the same time? My guess would be an opposed reflex save or initiative check of some kind to see who goes first, but that's entirely just intuition speaking. The rulebook doesn't seem to speak to the issue. Citing a range of papers using numeric keys as in \cite{a, b, c} -> [1-3] How can I cite a range of papers, the output is a range of numbers, instead of a list of numbers? In other words, when I type  ... some dummy text here is due to me \cite{me1, me2, me3, me4} ...   I want the output to be     ... some dummy text here is due to me [3-6] ...   instead of     ... some dummy text here is due to me [3.4.5.6] ...   (I use LaTeX, and am currently using the amsart class and whatever it includes. But I am open to other suggestions.) I know in TNG that all computer interfaces are now touch-screen, and that got me thinking: when was the first reference to touch-screen computer interfaces in Sci-Fi made?