(Java) Why does this constructor cause a null pointer exception?
What is a NullPointerException, and how do I fix it?
How to resolve a Java Rounding Double issue How to animate morphing a rectangular plane into a sphere Can I upload an entire folder using FTP? I need to upload a full folder using FTP.  Is there is any option for transferring a folder and all of its contents at once? Sharing Test code in Maven How do I open the Dahl chest in Sanctuary? I make use of the view: "taxonomy term". Is there an easy way to also show the children of a term, next to the nodes beloging to this term?  Example:  Cars - Volvo --- Family_cars --- Sports_cars - Honda --- Parts --- ... Trucks - ...   When you see the "cars" page I want to show all articles about cars (but not about Volvo, Honda, ...) AND I want to show the children (Volvo, Honda, ...) When you click one of these I want to show all the articles belonging with them, again with their children. shorter proof of generalized mediant inequality? I've just received my new SSD since the old one died. This Intel 320 SSD supports TRIM. For testing purposes, my dealer put Windows on it, but I want to get rid of this and install Kubuntu on it.  It does not have to be a "secure wipe", I just need the empty the disk in the most healthy way. I believe that dd if=/dev/zero of=/dev/sda just fills the blocks with zeroes and thereby taking another write (correct me if I'm wrong).  I've seen the answer , but it looks like it's suited for clearing empty blocks, not wiping the disk.  hdparm seems to be the program to do it, but I'm not sure if it clears the disk OR cleans empty blocks. From its manual page:     --trim-sector-ranges           For  Solid State Drives (SSDs).  EXCEPTIONALLY DANGEROUS. DO NOT           USE THIS OPTION!!  Tells the drive firmware to discard  unneeded           data  sectors,  destroying  any  data that may have been present           within them.  This makes those sectors available  for  immediate           use  by  the firmware's garbage collection mechanism, to improve           scheduling for wear-leveling of the flash  media.   This  option           expects  one  or  more  sector range pairs immediately after the           option: an LBA starting address, a colon, and  a  sector  count,           with no intervening spaces.  EXCEPTIONALLY DANGEROUS. DO NOT USE           THIS OPTION!!              E.g.  hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz   How can I make all blocks appear as empty using TRIM? What is the probability of a biased coin coming up heads given that a liar is claiming that the coin came up heads? A biased coin is tossed.   Probability of Head - $\frac{1}{8}$  Probability of Tail - $\frac{7}{8}$  A liar watches the coin toss. Probability of his lying is $\frac{3}{4}$ and telling the truth is $\frac{1}{4}$. He says that that the outcome is Head. What is the probability that the coin has truly turned Head?  My Attempt:  I used the formula: $$P(A \mid B) = \frac{P(A\cap B)}{P(B)}$$  $\ \ \ \ \ \ $P(it is head GIVEN liar said it's head) = P(it's head AND liar said it's head) / P(liar said it's head)  or, P(it is head GIVEN liar said it's head) = $\frac{ \frac{1}{8} \frac{1}{4} }{ \frac{7}{8}\frac{3}{4} + \frac{1}{8}\frac{1}{4} }$ [using a probability tree will be helpful here]  or, P(it is head GIVEN liar said it's head) = $\frac{1}{22}$  The Question: Is the method I used wrong in any way? Some others I have talked to are saying the answer will be $\frac{1}{4}$. Their reasoning is this: since the liar lies 3 times out of 4 and he said it is head, then the probability of it being head is 1/4. So who is right? What will be the answer? I have this really hard problem that I am working on and I just don't seem to get it. The question is: let $n$ be a positive integer; prove that there does not exist any integer $m$ such that $3n^2+3n+7=m^3$.  Please explain in detail otherwise I might not understand. I am also open for any methods that might help. Thank you. Please help. Why is there an "electric" potential drop across the resistor? An electric potential difference is created when two charges are separated. In a capacitor, there is a clear accumulation of opposite charges on the two separated plates, therefore work has to be done in moving an unit charge from one plate to another, against the electric field.   But, , a potential difference is created in a resistor due to the heat produced by the collision and increased lattice vibrations. So there is an energy loss across the resistor, yes, but how does this energy loss due to heat create an electric potential difference. In other words, do electrons accumulate on one or both sides of the resistor? If not, why should we do electric work in moving from one end of the resistor to another. If the difference in energy is not due to electric work, then that's not electric potential, is it? Prove that the equation $x^2-y^2 = 2002$ has no integer solution I recently upgraded to 12.04 from 11.10 and since upgrading have been unable to log in to my user profile. The upgrade went okay and I can login to a guest session fine but whenever I try to login to my profile, after entering my password, I just return to the login screen.  I've changed my password in Root (passwd &lt;username&gt;) and can log in to tty1 with no issues, it's just in GUI I'm having problems.  I'm using a HP dv7 laptop, 32-bit Ubuntu install, Intel® Core™2 Duo CPU P7350 @ 2.00GHz × 2, Nvidia graphics.  Any help would be appreciated. I have a polygon shape file that has many overlapping features. Each feature represents an area used by polar bears. So some of the polygons overlap and some don't, and there are separate clusters of overlapping areas.   I would like to get a measure of how much overlap there is in a particular area. But I have no clue how to do this. I'm pretty new to GIS and am still learning the ropes, it just seems I can't find an answer. Twisted serialport dataReceived() provides fragmented data This is the terminal message I keep getting when trying to update via: sudo apt-get update  $ sudo apt-get update [sudo] password for petros: Reading package lists... Done E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/   How can I solve it? Lagrange Multipler KKT condition I am looking at SVM, and reviewing Lagrange multiplier. Let's say with the constraint function $$g(x,y) = x^2 + y^2 -1 &gt; 0, $$ I am maximizing $$f(x,y) = x + y -1 .$$ Intuitively, since the constraint function does not provide a finite constrained region, there is no solution, and $f(x,y)$ can infinitely increase.  However, if I just plainly proceed with Lagrange multiplier calculation,  $$L(x,\lambda) = (x + y -1) +\lambda(x^2 + y^2 -1)$$ I get the solution: $$y,x = -\sqrt{2}/2, \lambda = 1/\sqrt{2}$$ And this still satisfies KKT conditions although the solution is wrong.  $$g(x) =&gt; 0 , \lambda =&gt;      0, \lambda g(x) = 0.$$  I expected that I would have some result that conflicted KKT conditions, but nothing was violated.   Does this mean that Lagrange multiplier under KKT conditions can produce a solution that cannot be solved, without giving any indication of intractability?  If functions are complicated, what's the systematic way to confirm that the optimization with inequality constraint functions is solvable using Lagrange multiplier? Wireless disabled by hardware switch Lenovo Y40 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 How to get product recommendations Is it possible to run two windows sessions from the same computer at the same time? A friend asked me if it is possible to have two screen/keyboards/mouse connected to one computer, and allowing two users to use the computer as if they where using two different computers (one sessions for each input/output)  Is it possible?