For example i have this interface: public interface IceCream { double cost(); }  And class that implements IceCream: public class IceCreamDecorator implements IceCream{  private IceCream iceCream; public IceCreamDecorator(IceCream iceCream) {     this.iceCream = iceCream; // what is being tried to achieve in this constructor                                    }      @Override public double cost() {     return this.iceCream.cost(); // Why do we return value back to interface?  }   }  and finally this is class that extends IceCreamDecorator: public class VanillaIceCream extends IceCreamDecorator{  public VanillaIceCream(IceCream iceCream) {     super(iceCream); }  @Override public double cost() {      return 1.0 + super.cost();  }   }  Can someone please explain what the goal here? And what is going on behind the scene?
I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?
Density of states for arbitrary dispersion relation If I have a 3D dispersion relation   $E=E(k_x, k_y, k_z)$ I have an equation for the density of states, which is   $D(E)=\frac{1}{\nabla_k E}\int\frac{dS}{(2\pi)^3}$  1) I am confused about the integral. What am I integrating over, exactly? It must have units of the $k$ vector, so it's a k-space integral, but what is the surface that is relevant?  3) Where does that equation come from, how is it derived? I've noticed that if I downvote an answer, the record of the downvote is visible to me in my profile.  But when I view my profile from another browser that's not logged into Stack Overflow, I've noticed that I don't see the record of the downvote.  So I was wondering if the downvote record is visible only to me?  If so, is this done to protect downvoters from retaliation? Creating checkbox parameter in Python script tool for ArcGIS Desktop? I am working on creating an ArcGIS tool from a Python script I am writing.  I am wondering if it is possible to have a checkbox parameter.    I want to have a parameter where the user selects a feature class, then from the feature class the user will choose the field for the upper most layer in their model, then I want the user to be able to choose what layers they want the script to run on with a checkbox structure derived from the upper most layer field.    Is this possible with python, and ArcGIS Desktop? Mathematical Prerequisites for QFT my email limit is exceeded after sending 10-12 emails..what could be the problem..as i have seen the limit is 1000 emails/day.i am not able to find out what could be the problem..Can some give me some suggestions. As i also know we can send 10 emails in a single transaction.I am sending emails in a batch class.  I am calling this batch class on button click and filling emailList with emailsId's.                      String query='Select id from Lead';//No use of this query                     Batch_send_emails bse=new Batch_send_emails();                     bse.query=query;                                                         bse.resendEmails=emailList;                     database.executebatch(bse);           **Batch Class**           if(!resendEmails.isEmpty())           {               for(String s:resendEmails)                {                   emailsLeads.add(s);                }           }           Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();         mail.setToAddresses(emailsLeads);        // mail.setCcAddresses(ccAddresses);         String subject='GoToMeeting Invitation Details for '+subject;         String body='test';          mail.setHtmlBody(body);          mail.setSubject(subject);         Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });          } Weak solutions to the Neumann's problem (Evans PDE) default permissions for /var/www I was trying to open a file and write to it with PHP at /var/wwwfolder but it wasn't working so I did  sudo chmod 777 /var/www   now I want to set the permissions for /var/www to the default. what are the default permissions for /var/www? Internet through wireless hotspot, intranet through wired network - can I use both at the same time? I have been tring this for a while now, without success. I have read online this can be done, either by changing the default gateway (DG) or messing with the DG's metric  The short story is: I need to connect to my company's ERP system (port 80 for some web services and port 22 for sftp and bash) with using my notebook computer's LAN card - but I can't connect to the Internet on this network. So I have my mobile phone's 3g hotspot when I need to go online. But I want to use both at the same time without so much as opening another web browser process.  At the moment, I am using the ERP system regularly - and whenever I need to go online to check a mail or research something related to work, I need to unplug the network cable so the wifi can kick in... which is starting to become annoying especially if I am connected to the ERP system using FTP (Filezilla) or Shell (putty)  Can someone help me with the configurations?  Below are some of the details I can provide:  Wired network - office LAN - for connection to the ERP system: DHCP -    Yes IPv4      10.64.200.245 Subnet    255.255.240.0 DG        10.64.193.254 DHCP Serv 10.64.17.191 DNS       10.68.72.200           10.68.20.200 WINS      10.68.77.200           10.64.20.200   Below are the details for my WiFi internet connection - over my mobile hotspot  DHCP      Yes IPv4      192.168.43.39 &lt;- I'm guessing this changes every time I restart the wifi subnet    255.255.255.0 DG        192.168.43.1 DHCP      192.168.43.1 DNS       192.168.43.1   Finally, here is the tracert results (btw, I'm on Windows 7, 64bit and the remote system should be on Linux) - the target ERP ip address is 10.76.142.39  Tracing route to 10.76.142.39 over a maximum of ...    1    &lt;1 ms    &lt;1 ms    &lt;1 ms  10.64.193.253   2    &lt;1 ms    &lt;1 ms    &lt;1 ms  10.64.4.13   3    &lt;1 ms    &lt;1 ms    &lt;1 ms  10.76.23.124   4     1 ms    &lt;1 ms    &lt;1 ms  10.76.23.93   5     1 ms    &lt;1 ms    &lt;1 ms  2xx-xx-xx-9.adsl...   6     1 ms     1 ms     1 ms  2xx-xx-xx-9.adsl...   7     1 ms     1 ms     1 ms  2xx-xx-xx-10.adsl..   8     2 ms     1 ms     2 ms  10.76.135.125   9     1 ms     1 ms     1 ms  10.76.142.39   sorry, I had to mask out some details above... wasn't sure if they would have any confidentiality issues.  Any help is much appreciated. I want to add this iostat command to my .bashrc and create an alias for it: iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')  I'm adding this to my .bashrc: alias ios='iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')'  Unfortunately, it doesn't work. If I run the above iostat command in a terminal it works, but when I run the ios alias it no longer works. And yes, I restart my shell every time. Why was the Triwizard Cup used as the portkey? Accidentally moved directories under root If $\sin(a)\sin(b)\sin(c)+\cos(a)\cos(b)=1$ then find the value of $\sin(c)$ How is this command legal? "> file1 < file2 cat" Assuming file2 already exists, the command   &gt; file1 &lt; file2 cat   appears to be copying the content of file2 to file1.  But I cannot understand this structure.  I understand that "Nothing" is being directed to file1 (creating or erasing its content). Then the content of file2 is being directed to file1.  Why is cat after file2? How does it know to cat file2 if the operands are not in the correct order? Caption makes Table move in statsoc class Show that if terms of a series have ratio less than the ratio of convergent series, then the series converges We have two infinite series $\sum a_n $ and $\sum b_n$, such that $a_n &gt; 0,\ b_n &gt; 0$ and $a_{n + 1}/a_n \leq b_{n + 1}/b_n$ for all $n$. Show that if $\sum b_n$ converges, then $\sum a_n$ also converges.   Any hints on how to prove this? I can sort of picture why this must be true, but I'm not sure how to prove this rigorously. I'm not sure using the ratio test would help here.. I am writing a novel and fairly new to using LaTeX.  Please bare with me if this is a silly question.  I am working off of the novel demo LaTeX file using the TexWorks software.  I have inserted my words into the file.  When I run the LaTeX code, I get the error message saying "! LaTeX Error: File `novel.cls' not found."  Do I need to download this file from somewhere?  If so, where can I get it? I would like to know the physical meaning of the , if there is any? I've used it in thermodynamics and classical mechanics and it seemed only a change of coordinates? Another domain name pointing to my server IP? I was checking out my reverse-DNS entry of my domain the other day which is run from a dedicated server.   I noticed that another person/company had their domain pointing to my server? I have no idea who this company is or why they are pointing their domain at my server IP?  How can I go about stopping this or forcing them to change? Are the decimal places in a CSS width respected? Stars and pins are retained when chat messages are moved!