This subject already has questions and answers, none with conclusive results. If this is not possible, then can someone determine the best workaround? Some of the answers say that this is possible with Java 8, but my IDE (eclipse) is still showing errors even though it is set to compiler compliance 1.8. If someone can get it to work on their system, let me know and I'll fix the problems with my system.  Problem: I need to create an interface with both static and non-static methods. An example of this:  // I need to create an interface with both static and non-static methods. public interface TestInterface {      // No problem     int objectMethod();      // static is an illegal modifier in an interface     static int classMethod(); }  // TestClass is one of many classes that will implement the interface. public class TestClass implements TestInterface {      // static and non-static variables are no problem     private int objectVal;     public static int classVal;      // this method has no problem     public int objectMethod() {         return objectVal;     }      // this one has problems because it implements a method that has problems     public static int classMethod() {         return classVal;     } }   And I need a class that will use classes that implement the interface  // a class that will use classes that implement from the interface // what is the syntax for this? my IDE doesnt like the implements keyword public class TestGeneric &lt;T implements TestInterface&gt; {      // stored instances of the class     private T t;      public void foo() {         System.out.printf("t's value is: %d\n", t.objectMethod());         System.out.printf("T's value is: %d\n", T.classMethod());     } }   The only problems in the above code are with the static methods. The only workaround I can think of is to not declare any methods as static, but use them in the way most similar to static use.
EDIT: As of Java 8, static methods are now allowed in interfaces.  Here's the example:  public interface IXMLizable&lt;T&gt; {   static T newInstanceFromXML(Element e);   Element toXMLElement(); }   Of course this won't work.  But why not?  One of the possible issues would be, what happens when you call:  IXMLizable.newInstanceFromXML(e);   In this case, I think it should just call an empty method (i.e. {}).  All subclasses would be forced to implement the static method, so they'd all be fine when calling the static method.  So why isn't this possible?  EDIT: I guess I'm looking for answer that's deeper than "because that's the way Java is".   Is there a particular technological reason why static methods can't be overwritten? That is, why did the designers of Java decide to make instance methods overrideable but not static methods?  EDIT: The problem with my design is I'm trying to use interfaces to enforce a coding convention.  That is, the goal of the interface is twofold:   I want the IXMLizable interface to allow me to convert classes that implement it to XML elements (using polymorphism, works fine). If someone wants to make a new instance of a class that implements the IXMLizable interface, they will always know that there will be a newInstanceFromXML(Element e) static constructor.   Is there any other way to ensure this, other than just putting a comment in the interface?
Check the uniform convergence of series of functions Check that given series converges uniformly for $x\in(-\pi,\pi)$ or not  1) $\sum_{n=1}^{\infty} (\frac{x}{n})^n$  2) $\sum_{n=1}^{\infty}\frac{1}{((x+\pi)n)^2}$  first series is power series so I find the radius of convergence that comes $R=e$ which is inside the given set so I am not able to give the final conclusion. after this I were thinking to apply $M_n$ test , but I am not able to find $M_n$. Please help to solve this problem. What is the sum of $$\sum_{n=0}^{\infty}\frac{1}{2^n(n+1)}$$    I've spent an insane amount of time on this problem. I checked on Wolfram and it gives $ln(4)$, which I assume you get from $2\ln(2)$.   I know that the integral of $\frac{1}{n+1}$ is $\ln(n+1)$. What am I missing?  Thank you! Solve $\int_0^{+\infty} \Big(\frac{\sin t}{t}\Big)^2 \ dt$ Falsely accused witch befriends transforming dragon she was to be sacrificed to Story is in a medievalish setting and starts with a woman who has been falsely accused of being a witch being taken by 2 men to be sacrificed to a dragon.  She ends up befriending the (male) dragon, who is able to transform into various forms, including human, and can speak only the language of whatever form he is in. e.g. can speak English in human form, but can't in dragon form.  He needs to return to his dragon form every day at sunrise or he dies.  Contact with iron or steel causes him pain and prevents him from transforming.  Near the end of the book, he's been put in handcuffs by one of the two men from the start and the woman has to get the assistance of the other one (village blacksmith?) to remove them before sunrise, which they manage to do just in time.  I think I read it maybe 10 years ago.    I also remember it was a very short book, probably only about 100 pages. Why is 'ping' unable to resolve a name when 'nslookup' works fine? On my Windows XP workstation, I can find the machine I want to connect to in DNS with nslookup:  nslookup wolfman Server: dns.company.com Address: 192.168.1.38  Name: wolfman.company.com Address: 192.168.1.178   But, when I try to connect to that machine, I get an error telling me that the machine can't be found (i.e., can't be looked up in DNS):  C:\&gt; ping wolfman Ping request could not find host wolfman. Please check the name and try again.   I am able to connect if I use the IP address directly:  C:\&gt; ping 192.168.1.178  Pinging 192.168.1.178 with 32 bytes of data:  Reply from 192.168.1.178: bytes=32 time=41ms TTL=126 Reply from 192.168.1.178: bytes=32 time=41ms TTL=126 Reply from 192.168.1.178: bytes=32 time=44ms TTL=126 Reply from 192.168.1.178: bytes=32 time=38ms TTL=126   I could work around this by adding an entry to my hosts file, but I would rather find out why this is happening.  The problem is transient, most of the day I can connect to the machine just fine.  How is this possible?  ETA: I left this out for brevity, but it was asked for:  C:\&gt; ping wolfman.company.com Ping request could not find host wolfman.company.com. Please check the name and try again.   ETA: Other applications get the same results.  I only tried ping to simplify.  telnet can't connect, Cygwin apps print a "unknown host wolfman" message.  Update: Using wireshark, I found that my workstation is not attempting a DNS lookup.  It's just reporting the "could not find host" error message. When exactly does tmpwatch clear out files I place in /tmp? Is there any way (such as a command or environmental variable) to determine what window manager is the one actively running in the current session? Finder: keep sort-by per-directory Some directories make sense to be sorted by date modified, while others make more sense to be kept sorted alphabetically.   How can I make it so that finder will apply a specified sort by selection on a per-directory basis?   If no such feature exists (In which case I hope somebody at APPL is paying attention), I suppose using/remapping the keyboard shortcuts (Defaults being Cmd+Ctrl+5 for Modified and Cmd+Ctrl+1 for Alphabetical by Name) is the next best thing. Non academic career options for PhD in Math I am thinking of getting my M.S. in Computer Science. I chose C.S. because I enjoy programming and because its a solid choice, career wise.  Low unemployment, good pay, all that jazz.  But my real passions has always been math and lately I have been thinking about swapping and going for my graduate degree in Math. If I went the math route I would probably go full PhD (since I don't think there is much you can do with just a Masters in math).  But as much as I love math, I can't see myself being a math teacher. I would want to work in research or industry, applying math to solve real world problems.    What kind of non-academic jobs are there for someone with a PhD in math (or what is the best resource to see what jobs are out there)? What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally? I am considering buying my first DSLR.  How do I know whether I need a 18-200 lens, 17-85, or 18-55? Or something else? So I wish to create and object and set it's shading to 'smooth' using python. It seems simple enough but after trying every method I could find on the internet none of them worked for me. Here's a short example script where the object needs to have smooth shading:  import bpy from mathutils import Vector  verts = [(0,0,0),(0,5,0),(0.25,5,0),(0.25,0,0),(0,0,5),(0,5,5),(0.25,5,5),(0.25,0,5)] faces = [(0,1,2,3), (4,5,6,7), (0,4,5,1), (1,5,6,2), (2,6,7,3), (3,7,4,0)]  grat1mesh = bpy.data.meshes.new("grat1") grat1obj = bpy.data.objects.new("grat1", grat1mesh) grat1obj.location = (5, -5, 0) bpy.context.scene.objects.link(grat1obj) grat1mesh.from_pydata(verts,[],faces) grat1mesh.update(calc_edges=True)  grat2obj = grat1obj.copy() grat2obj.data = grat1mesh.copy() bpy.context.scene.objects.link(grat2obj) grat2obj.location += Vector((-0.125, 1.25, 1.25)) grat2obj.scale = (2, 0.5, 0.5)  bm = grat1obj.modifiers.new("Chop", 'BOOLEAN') bm.object = grat2obj bm.operation = 'DIFFERENCE' bpy.context.scene.objects.active = grat1obj bpy.ops.object.modifier_apply(modifier=bm.name) bpy.context.scene.objects.unlink(grat2obj)   I found this online and tried to place it at the end of the script:  smoothings = [] smoothings.append(face.use_smooth) me_ob.faces.foreach_set("use_smooth", smoothings)   However this just returned an error on the second line, perhaps as it was from an older website. Obviously using a simple bpy.ops.object.shade_smooth() didn't work and I'm kind of stumped as of what to do here! How exactly does lighting affect combat? I understand that there are different types of lighting (dim, bright, complete darkness), but I haven't been able to find anywhere in the DMH or PHB that specifically describes how these different types of light sources affect combat.   What impact does complete darkness have on players being able to see the locations of the monsters in the room? What impact does complete darkness have on combat rolls against monsters? Could anyone point me to a book/page that contains some more detailed information on this?   Thanks! How do I get powdered mammoth tusk? Am I missing something? I can find plenty of tusks, but I just don't know if I can make them into powder myself or do I have to find them for sale? How to generate Bernoulli random variables with common correlation $\rho$? save as a video as .mp4 Adventurer enters an other-dimensional realm where he repeatedly dies unexpectedly and wakes up in reality Why does DMM show AC and DC current when source is a battery? (How to calculate power in this case?) The circuit is an altered Joule Thief of my design that is driven by an AA or AAA battery. I’m observing the current at the battery anode with my DMM in series. (Extech EX330) This circuit is extremely efficient (In relation to other Joule Thief I've build.) and does some weird stuff - like, it needs a pushbutton sometimes.    Measurements: It is drawing 9.21 mA DC and 6.48 mA AC in series with the battery. It shows 1.364 VDC and 0.010 VAC in parallel with the battery. Output on the LED is 2.572 VDC and 0.011 VAC with no measurable frequency. (with my DMM at least) All measurements are taken with the same configuration and voltage.    But how is it drawing AC and DC and how do I calculate power consumption? --> Could it be because the emitter pin of the NPN is directly connected to ground? --> Or is the circuit just "switching on and off"?     Download schematic:  (I tried to simulate the circuit in LTspice. Thanks for making me aware of this amazing program, Sredni Vashtar!)     What the pushbutton is used for: The pushbutton is used to "kickstart" the oscillation when it wont start by itself. For example: I have to manually "oscillate" using this button to start the circuit if the capacitor is too big and battery voltage is low. Pushing the button releases the energy in the transformer into the capacitor. If it reaches LED forward voltage the circuit keeps oscillating on it's own. It does work without manual intervention when then capacitor in parallel with the LED is not too big, like &lt;5000 µF, and it's a fresh battery.    . Thank you for your answers! I'm learning so much! :D Which punctuation is correct in this case (colon, semicolon, or period)? How to format a USB drive? Possible Duplicate:             How to format a pen drive in Ubuntu? I have this pen drive which I made bootable using some other system (OS). But I need to format it from my Ubuntu 12.04. Please guide me.