i've a question about my code. this is my code  Map &lt;String, hewan&gt; hwn = new HashMap&lt;String,hewan&gt;();  for (int j = 1 ; j&lt;=bacaInginHewan; j++){       hewan hewan = new hewan();     String [] bacaJumlah =br.readLine().split(" ");     namaHewan=bacaJumlah[0];     ingin = Integer.parseInt(bacaJumlah[1]);     if (hwn.containsKey(namaHewan)){       if (hwn.get(namaHewan).jenisOperasi.equals("vivipar")){         int jumlahAwal = hwn.get(namaHewan).jumlah;         int batasAkhir = ingin + jumlahAwal ;         hewan.setIngin(batasAkhir);         hewan.recvivipar(jumlahAwal);         System.out.println("butuh "+hewan.getIterasiVivi()+" siklus untuk "+batasAkhir+" "+namaHewan);         hewan.setJumlah(batasAkhir);         hwn.put(namaHewan, hewan);       } else if (hwn.get(namaHewan).jenisOperasi.equals("ovipar")){          int jumlahAwal = hwn.get(namaHewan).jumlah;          int batasAkhir = ingin + jumlahAwal ;          hewan.setIngin(batasAkhir);          hewan.recOvipar(jumlahAwal);          System.out.println("butuh "+hewan.getIterasiVivi()+" siklus untuk "+batasAkhir+" "+namaHewan);          hewan.setJumlah(batasAkhir);          hwn.put(namaHewan, hewan);    }   My question is, why did it turn null pointer for second loop with same namaHewan in this if clause. thanks for the explanation  if (hwn.get(namaHewan).jenisOperasi.equals("vivipar"))
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I use \includegraphics command to insert image to the document. But how can I add a border around this image w/o any margin between border lines and image? It seems to be very easy, but I can't find it in the documentation. CaseComment and CaseHistory relatedlist in visualforce page I want to add CaseComment and CaseHistory related list to my visualforce page.   &lt;apex:relatedList list=" " /&gt;  What should be the value for List attribute in the code defined above. When I added   &lt;apex:relatedList list="CaseHistory" /&gt; 'Histories' is also not working   &lt;apex:relatedList list="CaseComment" /&gt; 'CaseComments' is also not working  I get errors saying they are not valid child relationship name for entity Case.  Please help me out on this issue. What is the role of NS records at the apex of a DNS domain? $ORIGIN example.com. ; not necessary, using this to self-document  $TTL 3600 @        IN     SOA   ns1.example.com. admin.example.com. (                       1970010100 7200 1800 1209600 300)  @        IN     NS   ns1.example.com. @        IN     NS   ns2.example.com.  @        IN     A    198.51.100.1 ns1      IN     A    198.51.100.2 ns2      IN     A    198.51.100.3  sub1     IN     NS   ns1.example.edu.  sub2     IN     NS   ns1.sub2 ns1.sub2 IN     A    203.0.113.1 ; inline glue record   The role of a NS record beneath the apex of a domain is well-understood; they exist to delegate authority for a subdomain to another nameserver. Examples of this above would include the NS records for sub1 and sub2. These allow the nameserver to hand out referrals for portions of the domain that it does not consider itself authoritative for.  The purpose of the NS records at the apex of a domain, ns1 and ns2 in this case, seem to be less understood by the internet at large. My understanding (which may not be holistic) is as follows:   They are not used by caching DNS servers in order to determine the authoritative servers for the domain. This is handled by , which is defined at the registrar level. The registrar never uses this information to generate the glue records. They  used to delegate authority for the entire domain to other nameservers. Trying to do so with software such as ISC BIND will not result in the "expected" referral behavior at all, as the nameserver will continue to consider itself authoritative for the zone. They are not used by the nameserver to determine whether it should return authoritative responses (AA flag set) or not; that behavior is defined by whether the software is told to be a master or a slave for the zone. Most nameserver software will quite happily serve apex NS records that disagree with the information contained by the upstream glue records, which will in turn cause well-known DNS validation websites to generate warnings for the domain.   With this being the case, what are we left with? Why are we defining this information if it doesn't appear to be consumed by caching DNS servers on the internet at large? Why does Bash's source not need the execution bit? Oxford Comma Conventions According to the Wikipedia page for the , "Use of the comma is consistent with conventional practice" and "Use of the comma is inconsistent with conventional practice." Did the Oxford Comma come before its omission, or was the Oxford Comma traditionally omitted?  It makes logical sense that every item in a list would be separated in the same way: by a comma. If the Oxford Comma is conventionally correct, when and why did people begin to omit it? Is the set of real matrices diagonalizable in $\mathcal M_n(C)$ dense in the set of all companion matrices? How can I set up password-less SSH login? Why isn't Higgs coupling considered a fifth fundamental force? proof that $f'$ is continuous at $a$ Let $f:I \rightarrow \mathbb{R}$ derivable in set I. if $\lim x_n = \lim y_n =a \in I$ with $x_n \neq y_n$ and $\lim \frac{f(y_n)-f(x_n)}{y_n - x_n} = f'(a)$ proof that $f'$ is continuous at $a$  my attempt $x_n \neq y_n$ so by MVT $\exists z_n \in I$ like $x_n \geq z_n \geq y_n$ with $\frac{f(y_n)-f(x_n)}{y_n - x_n}=f'(z_n)$ for each $x_n$ and  $y_n$ then $f'(a) = \lim\frac{f(y_n)-f(x_n)}{y_n - x_n}= \lim f'(z_n)$   Using $\lim x_n = \lim y_n = a$ and $x_n \geq z_n \geq y_n \Rightarrow z_n \rightarrow a$  if $ \lim_{x\rightarrow a} f'(x) \neq f'(a)$ then $\exists \epsilon &gt; 0$ such $\forall n\in \mathbb{N}$, $z_n \in [x_n,y_n]$ $0 &lt; |z_n - a| &lt; \frac{1}{n}$ and $|f'(z_n) - f'(a)| \geq \epsilon$. So $z_n \rightarrow a$ but will do not have $\lim f'(z_n) = f'(a)$  so $\lim f'(z_n) = f'(a) = \lim_{x\rightarrow a} f'(x)$ when $z_n \rightarrow a$  and thats implies $f'$ continuous at $a$  my question is, that's correct ? if not, can you help me? thanks How can I easily share links or text between my Android phone and my laptop? Can I run PC steam games on a Mac? I recently downloaded 'Blood Bowl' on Steam to my Mac, not realizing that it was not Mac-compatible. Is there any software or any way that will allow me to play it, as obviously I've already paid for it? Cheers. I was working on historical data looking for anomalous patterns that we would not expect to occur at random. I'd like to create a scheme to analyze data and markets to test for statistical significance and consistency over time.  Question : Are there some tools we could use to evaluate the nonrandomness of a database? What do we use usually to say that something is random or not (statistically)? Figure we work with change in some value over time. Union of two vector subspaces not a subspace? Sending the output from 'dd' to awk/sed/grep I'm trying to approximate the computer's write speed using dd:  dd if=/dev/urandom of=/dev/null bs=1K count=10000   which gives the following output  10000+0 records in 10000+0 records out 10240000 bytes (10 MB) copied, 0.746313 s, 13.7 MB/s   How can I get the '13.7 MB/s' into a bash variable? I've tried piping the output from dd to progs like awk, sed and grep to no avail.  Ultimately, I'm calling this via os.system(...) from within a python script. If anyone knows of a more direct way to get a similar result inside python I'd be interested in that also. I'm trying to predict how long a file copy will take, based on the file size.  Any help would be greatly appreciated. How do I capture the milky way? Can the milky way actually be photographed ? I know the image is manipulated, and is probably a composite, but how do you capture such contrast in the milky way? Is an equitorially mounted scope required? Any advice or pointers are welcome, thanks.  I'm heading out towards much less light polluted areas middle of next week and I want to try some nighttime sky captures with my 7D.  Additional info: I just found  on wikipedia that says: 54s, tripod mounted 5D, 16mm lens, f/2.8, ISO800. What else do I need to be aware of? My 7D is only an APS-C and the widest lens I have is 19mm. I'm thinking that might not be wide enough to capture an interesting shot? MWE:  \documentclass{minimal} \usepackage{commath, tikz} \begin{document} \begin{tikzpicture} \node {$:$}; \end{tikzpicture} \end{document}   When I compile this, pdfTeX enters an infinite loop. Why? FasterCsv doesn't show any result in my view in Ruby on Rails? Find: $$\lim\limits_{x \to 1} \left( {\frac{x}{{x - 1}} - \frac{1}{{\ln x}}} \right) $$  Without using L'Hospital or Taylor approximations  Thanks in advance Why does just splitting an Ethernet cable not work? I thought the Ethernet is logically a one-line communication bus (for argument's sake, I am excluding hubs). All machines attached on the bus hears the same signals and the machines themselves try to avoid collisions by randomly backing off.    If so, why would splitting one Ethernet line from my home router into two and connecting two computers not work? Why do I have to add a switch to it?  What the Internet said would not work.                                                             +----------+                                                +----------&gt;|computer 1|                                                |           +----------+     +------------------+       +---------------+     |4 port home router+------&gt;|simple splitter|     +------------------+       +---------------+                                                |           +----------+                                                +----------&gt;|computer 2|                                                            +----------+   What the Internet said I should do                                                             +----------+                                                +----------&gt;|computer 1|                                                |           +----------+     +------------------+       +---------------+     |4 port home router+------&gt;|    switch     |     +------------------+       +---------------+                                                |           +----------+                                                +----------&gt;|computer 2|                                                            +----------+   Is this because of the signal degradation (reduced electric current)?    Thank you for all the answers! The reason why I did not just use the two ports of my home router is...  The 4-port gigabit router is in my room, and I had put a computer in another room (also my room, though). Since a wired network is far more reliable and secure, I had bought a long Ethernet cable and and connected the computer to the router. Now I was thinking about adding another computer to that room. I could buy another long Ethernet cable, but then there will be two cables between the rooms. The one line already is a minor annoyance, so I thought if I could share the one line between the two computers in that room. A switch would work, but it requires power and is a little bit pricey. That is why I wondered why it would not work to simply split the physical Ethernet cable.  Apparently I do not completely understand how Ethernet and a switch work. I just have some bit of knowledge I heard in my college class. Why is $\mathbb{Z}[\sqrt{-n}], n\ge 3$ not a UFD?