I create an interface as follow :   // The OnClickListener interface : public interface OnClickListener{      void onClick();   }   And a I create a Person Class :  // Class Person : public class Person {     String name;      OnClickListener onClicklisner;      Person(String name)      {            this.name = name;          this.onClickListener = new OnClickListener()          {                  @Override             public void onClick() {                  //I want to access to this.name attribute, but it doesn't work :                 System.out.println(this.name);             }         };     } }   In the onClick() method above, I want to access to this.name attribute, but it doesn't work.  How I can access that ?  Thank you very much.
In the following snippet:  public class a {     public void otherMethod(){}     public void doStuff(String str, InnerClass b){}     public void method(a){         doStuff("asd",             new InnerClass(){                 public void innerMethod(){                     otherMethod();                 }             }         );     } }   Is there a keyword to refer to the outer class from the inner class?  Basically what I want to do is outer.otherMethod(), or something of the like, but can't seem to find anything.
I recently got a lenovo Y40 laptop and after i installed ubuntu 14.04 (also in the live usb) Wireless doesn't work. It says that it is disabled by hardware switch, however the hardware switch doesnt work (its intention is to put on airplane mode but does nothing when pressed in ubuntu) wireless works in windows and the BIOS has it enabled. I tried resetting the BIOS but it still doesn't work. Here are some command outputs  lspci:  03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10) 04:00.0 Network controller: Intel Corporation Wireless 3160 (rev 93)   rfkill list all:   0: ideapad_wlan: Wireless LAN     Soft blocked: no     Hard blocked: yes 1: ideapad_bluetooth: Bluetooth     Soft blocked: no     Hard blocked: yes 2: hci0: Bluetooth     Soft blocked: no     Hard blocked: no 3: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no   lswh:     *-network         description: Ethernet interface         product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller         vendor: Realtek Semiconductor Co., Ltd.         physical id: 0         bus info: pci@0000:03:00.0         logical name: eth0         version: 10         serial: f8:a9:63:31:2e:b6         size: 1Gbit/s         capacity: 1Gbit/s         width: 64 bits         clock: 33MHz         capabilities: bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation         configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168g-3_0.0.1 04/23/13 ip=192.168.1.4 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s         resources: irq:64 ioport:4000(size=256) memory:c0604000-c0604fff memory:c0600000-c0603fff *-pci:3      description: PCI bridge      product: Lynx Point-LP PCI Express Root Port 4      vendor: Intel Corporation      physical id: 1c.3      bus info: pci@0000:00:1c.3      version: e4      width: 32 bits      clock: 33MHz      capabilities: pci normal_decode bus_master cap_list      configuration: driver=pcieport      resources: irq:59 memory:c0500000-c05fffff    *-network DISABLED         description: Wireless interface         product: Wireless 3160         vendor: Intel Corporation         physical id: 0         bus info: pci@0000:04:00.0         logical name: wlan0         version: 93         serial: a0:88:69:90:0a:38         width: 64 bits         clock: 33MHz         capabilities: bus_master cap_list ethernet physical wireless         configuration: broadcast=yes driver=iwlwifi driverversion=3.13.0-32-generic firmware=22.24.8.0 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn         resources: irq:66 memory:c0500000-c0501fff The new search function allows quoted queries that include punctuation, and this is fantastic, most of the time. However, the search considers the punctuation as part of the word itself, so searches for "a test" will not show results containing a test,, a test., or a test?. The reverse is also true.  Is this the intended behavior ? &lt;--(space added so that behavior will show in results.)  It seems that the logical way to do fix this (while maintaining character search) is for queries with punctuation to match results with punctuation, while queries without punctuation to match either with and without.    Example:  vs     A more practical example is described in Arjan's answer below. 4 fast cores or 6 slower ones? I have the option of 3.33 ghz 4 core processor, a 2.66ghz 6 core or a 2.93 ghz 6 core. I know that the middle one will be slower than the last, you don't have to tell me that. What I would like to know is what would work better? 4 fast cores or 6 slower ones? I know that if you do the math the last one is the best but how many cores can Blender use?  I would also like to know what would be the best for blender internal renderer and cycles (if there's any difference.) The easiest way to explain this question is with a thought experiment:  Consider God, the ultimate of everything, who is wholly omnipotent (all-powerful) and omniscient (all-knowing). Let's just say, hypothetically, that he wanted  (this is a totally random example I just happened to be reading about; I could have just as easily said He wanted Bob to score a free-throw in basketball 3 times in a row tomorrow, or Sally to knit a blue sweater on Sunday, November 4th, 2012).  But anyways, one way He could do this (get X group of people to save a man from a burning car) is: At the beginning of time, God could instantly plan out the future and set in motion a massive chain of events, from the creation of light and stars, the creation of Earth and the creatures, mankind, then civilization with all the conflicts and progress and glory that comes with it, such that one day, a few people would come from out of nowhere—complete strangers to each other—and save this man (also a stranger) from under a burning car. God need not intervene at all this whole time, He merely "ignited" the chain of events from day 1 and watched it unfold exactly as He planned. Let's call this Universe A.  He could also, being all-powerful, just freeze time for a bit and skip a few steps, creating the world and universe instantly, with all the civilizations and animals and things in place, putting all the strangers there together next to a car which is already on fire and the man trapped under it. Then press play, and presto, you have the exact same scenario, without billions of years of buildup. Let's refer to this as Universe B.  God is obviously capable of doing both. My question thus is whether there is an  (really any difference at all) between Universe A and Universe B. Personally, I don't think this kind of power is outside of God's capability; he should, after all, have no problem with creating identical universes which match up exactly once they reach "biker under the car" moment where He unfroze time in Universe B. At that moment, Universe A and Universe B are exactly the same, right? Or is there somethinge special about Universe A, with all it's buildup, that separates it intrinsically from Universe B? In other words, is it outside of God's ability to make them exactly equivalent? "Congratulation" vs. "congratulations" Is it coherent to extend $\mathbb{R}$ with a reciprocal of $0$? I'm sure this is an obvious question, but I'm having trouble finding the right words to type into Google.  I know that the definition of a ring allows that the additive identity not have a multiplicative inverse, but is this a requirement?  Specifically, is something like $\mathbb{R}\!\left[\frac{1}{0}\right]$ such that $\frac{1}{0} \cdot 0 = 1$ a ring, or does some contradiction arise from allowing the additive identity to have a multiplicative inverse? My understanding is that heat is essentially atomic vibrations. If there are almost no atoms, how can there be residual heat?  Also, as I understand in space there is no heat transfer via convection and it is mainly through EM radiation. In this case, why is it that if i were to go into space with no suit and just an airtight helmet through which I could breathe, I would still freeze to death very quickly? I am trying to run a function from  in ArcMap 10.1; Sink evaluation. But before it can finish it returns an error message, that, frankly, I don't understand at all.  It goes System.runtime.interopservices.comexception (0x80004005): error hresult e_fail .  Can anyone help me solve this? I have tried all I can think of. Run the function from the toolbox instead of dropdown menus, shorten paths, restart ArcMap, reinstall AHT, open new map documents, restart my computer, wait till next day and see if it automagically have fixed itself...   After searching this forum I found a , although it's got no answers. Now I'm all out of ideas, can anyone please help me?!    I'm using ArcMap 10.1 SP1 basic license and Windows 7.    I think I have narrowed it down a bit, still not clear what's wrong though. Sink evaluation uses a series of functions in Arcmap, of which one is Zonal statistics as table. That's the one it gets stuck on. The input raster somehow does not exist, path unknown. I guess this is some intermediary raster.       After consulting the Arc Hydro team, I got the advice not to use grids stored in a gdb (which I didn't). I have also tried to change target locations, thanks to @G.Oxsen. Unfortunately neither of those solved the issue. According to the Arc Hydro team, GPL0 that I asked about earlier is an in-memory grid, so probably no problem there.   I am currently pursuing that it is related to the installation of SP1. Anyone out there using AHT with SP1 and got Sink evaluation working?    Uninstalling SP1 did not change anything, unfortunately. Still working on this, but with less intensity. Seems like I'll have to find workarounds...    By reducing the number of sinks in need of processing I managed to get Sink evaluation running. Having the files not stored in a gdb seem to help as well, as mentioned earlier, and using integer grids.  Changing the "Maximum number of unique values to render" in ArcMap Options (Customize menu), tab Raster --> Raster dataset is another tip that I got (from the Arc Hydro Team). Restarting ArcMap after running every one or two functions also helps keeping things stable. Returning a const reference to an object instead of a copy In GMAIL you can list all your boss-tell-off and wife-cuss-out emails by clicking Drafts    I'd like to see my started-but-never-finished responses, possibly between x Answers and y Votes in /&lt;&lt;user&gt;&gt;/Stats/? Often in fantasies involving magic casting spells requires a certain physical or mental toll on the caster. I don't recall any mention of spells being physically or mentally taxing in the Harry Potter universe.  Does this mean they can cast an unlimited number of spells in a given day without any negative effect to themselves? The new profile shouldn't mistakenly imply that you can earn the Informed badge on a meta site Best WPF open source projects I have programmed with WPF for more than a year. When I started there weren't so many examples and guidelines to follow, now the situation is much more better.  I would like to ask you some help in listing the best WPF (open) source code examples or projects that you suggest to study in order to learn more about project structure, best practices, etc.  Thank you, Marco Cardinality of Borel sigma algebra It seems it's well known that if a sigma algebra is generated by countably many sets, then the cardinality of it is either finite or $c$ (the cardinality of continuum). But it seems hard to prove it, and actually hard to find a proof of it. Can anyone help me out? Why was Snape called the Half-Blood Prince? My question comes from what I learned in the movies, considering I have not yet been able to read the books. I would just like to know why Severus Snape called himself the Half-Blood Prince? Did many people call him that or did he just think that it was a cool nickname? This question might be answered in the books so feel free to quote from it. How does one prove that every finite group is isomorphic to a subgroup of an alternating group? After starting Ubuntu, I see the following lines. Should I be worried?  /dev/sda6: recovering journal /dev/sda6: clean, 355773/1835008 files, 470404803/7335680 blocks Changing top, bottom, left & right margins on the fly I’m trying to find a way of being able to modify all of the margins of a page whenever I want to and as many times as I want to on a single page in order to be able to put text very easily where I want on a page.   I have thought of using the geometry package and using   \newgeometry{left=6.75cm, right=1cm, top=1cm, bottom=1cm}  %…  \restoregeometry   but unfortunately this only works for whole pages, so I can only change the margins once per page (and then they are valid for the whole page without having the possibility of changing them again).   I found the following script on the internet which enables users to change margins on the fly, just as I want to. The code below works fine and enables me to change the left and right margins of my page as many times as I want to, but unfortunately, it doesn’t give me the option of changing the top and bottom margins.  % placed before \begin{document}  \newenvironment{changemargin}[2]{% \begin{list}{}{% \setlength{\leftmargin}{#1}% \setlength{\rightmargin}{#2}% }% \item[]} {\end{list}}  % And then inside the document, whenever I want to use % the command to change the margins on the current page  \begin{changemargin}{1.9875cm}{-3.7625cm} % this means the left margin increases by 1.9875cm compared % to the default left margin (4.7625cm) (so left margin=6.75cm here) % and the right margin decreases by 3.7625cm (so right margin=1cm)  % ... (text or pictures in new environment)  \end{changemargin}   For this reason, I tried to adapt the code above and came up with the code below:  % placed before \begin{document} \newenvironment{changemargin}[3]{% \begin{list}{}{% \setlength{\leftmargin}{#1}% \setlength{\rightmargin}{#2}% \setlength{\topmargin}{#3}% }% \item[]} {\end{list}}  % And then to use the command: \begin{changemargin}{1.9875cm}{-3.7625cm}{1cm} % ... \end{changemargin}   It compiles and still changes the left and right margins but the top margin remains unchanged. (I haven’t yet tried to change the bottom margin).  Can anyone help me get this code to work completely, and enable me to modify the left, right, top and bottom margins of a page? Thanks. CSV text files loading error / crash in QGIS 2.18.8 I got a problem when I try to load tab-separated text files in the "Create a layer from the delimited text file" tab (that one with de comma symbol). After normally selecting the X and Y fields and clicking OK, the reference coordinate system (SRC) selector screen appears, then the program closes by itself. I had uploaded more than a hundred of this type of file by the same procedure in the previous version of QGIS (2.14 Essen) and have no problem, but since I updated to version 2.18.8 (Las Palmas) I can not load any files or .CSV type.   Do anyone knows what's happening? Am I doing anything wrong? Network interface name changes after update to 15.10 - udev changes I updated a virtual machine running Ubuntu server 15.04 to the just released new stable 15.10.  There were no apparent problems, but after reboot the machine lost its network connection. lspci showed the correct card and lsmod proved that the driver had been loaded.  Hints about editing or removing /etc/udev/rules.d/70-persistent-net.rules did not succeed (still no network, no new file), the famous /lib/udev/write_net_rules did not even exist.  I don't have much clue regarding udev and systemd, so it took me some time to find in /sys/class/net that the network interface name changed. It became ens32, which was renamed from eth0. After I changed /etc/network/interfaces network communication was enabled again.  But - why does this happen at all? And if it happens, shouldn't the interfaces file be updated automatically?  Now that I deleted the virtual network card and created another one, eth0 becomes eno16777728, which is not so, uhm, nice.  Should this behaviour (at least that of the upgrade procedure) be reported as a bug?  Furthermore, is /etc/udev/rules.d/70-persistent-net.rules obsolete now? And (although only partly related) what about /etc/udev/rules.d/70-persistent-cd.rules?)  Edit - additional question (after accepted answer) The dependency of /etc/network/interfaces from the actual interface name bothered me. I tried a new installation of *ubuntu in another virtual machine. To my surprise, /etc/network/interfaces contained a reference to the loopback device only. However, with my original VM this change prevented the network to come up. So what else do I need to change?  Edit Well, from another test I found that a new Ubuntu Server has the network interface card in /etc/network/interfaces, while XUbuntu has not. Maybe it is using network-manager or something else.