Loading images into an array
What is a NullPointerException, and how do I fix it?
Inspired by a StackOverflow question ().  Is there a DBMS that actually supports the = NULL syntax? When I do upgrade it gets stuck here:  user@plato:~# sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done The following packages will be upgraded:   bind9-host coreutils cpio curl dnsutils libbind9-90 libc-bin libc-dev-bin   libc6 libc6-dev libcgmanager0 libcurl3 libcurl3-gnutls libdns100   libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libisc95 libisccc90   libisccfg90 libjasper1 liblwres90 libplymouth2 libsepol1 libssl-dev   libssl-doc libssl1.0.0 linux-libc-dev mime-support multiarch-support ntp   ntpdate openssl plymouth plymouth-theme-ubuntu-text python3-distupgrade   ubuntu-release-upgrader-core unzip 39 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 16.0 MB of archives. After this operation, 12.3 kB of additional disk space will be used. Do you want to continue? [Y/n] y 0% [Connecting to us.archive.ubuntu.com (2001:67c:1562::15)] ░   When I do update it gets stuck here:  user@plato:~# apt-get update 0% [Connecting to us.archive.ubuntu.com (2001:67c:1562::14)] [Connecting to sec░   I'm able to ping us.archive.ubuntu.com just fine:  user@plato:~# ping us.archive.ubuntu.com PING us.archive.ubuntu.com (91.189.91.23) 56(84) bytes of data. 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=1 ttl=54 time=81.5 ms 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=2 ttl=54 time=81.5 ms 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=3 ttl=54 time=81.5 ms 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=4 ttl=54 time=81.4 ms ^C --- us.archive.ubuntu.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 81.425/81.528/81.582/0.355 ms   What can i do to fix this?    What I have tried so far.  I've tried following directions on this blog:   To force apt-get to use IPv4 exclusively   Create a file in /etc/apt/apt.conf.d/99force-ipv4 Add this line to newly created file Acquire::ForceIPv4 false; Apt-get will now use IPv4 exclusively I have notice some sites have the same form for login, register and forgotten password.  Below the form you have 3 buttons    i forgot my password register log me in   What are the pros and cons on using this approach and which version would you go for. I have a question concerning the time ordering operator. Let's suppose we have a time evolution generated by some Hamiltonian $H(t)$ given by $$ U(t)=T_\leftarrow\exp\left(-\mathrm{i}\int_0^t\mathrm{d}s\,H(s)\right)\tag{1}. $$ In Breuer and Petruccione, it's said that if the commutator of the Hamiltonian at some time $t$ with itself at some other time $t^\prime$ is a $c$-number function/ a complex function, i.e. $$\left[H(t),\,H(t^\prime)\right]=f(t,t'),$$ then the time evolution is given by $$ U(t)=\exp\left(-\frac{1}{2}\int_0^t\mathrm{d}s\int_0^t\mathrm{d}s^\prime\,\left[H(s),\,H(s^\prime)\right]\Theta(s-s^\prime)\right)$$ $$\times \exp\left(-\mathrm{i}\int_0^t\mathrm{ds}\,H(s)\right),\tag{2} $$ where $\Theta(s-s^\prime)$ is the Heaviside function. No proof or reference is given and I could not find any explanation anywhere, this is why I ask here. Any help would be very appreciated. In , someone suggested in a  that I should not cast the result of malloc. i.e., I should do this: int *sieve = malloc(sizeof(int) * length);  rather than: int *sieve = (int *) malloc(sizeof(int) * length);  Why would this be the case? How do I properly clean up Excel interop objects? One very convenient property of $\mathbb{R}$ as a ring is that there is an upper bound for the degree of irreducible polynomials in $\mathbb{R}[x]$, as      If $f\in\mathbb{R}[x]$ has degree larger than $2$, then $f$ is reducible.   However, the proof as I know depends highly on the fact that $\mathbb{C}$ is algebraically closed, and the very nice property: $z\in\mathbb{C}$ is in $\mathbb{R}$ if and only if $z=\bar{z}$.  This makes a generalization to other integral domains rather difficult. So the problem is      For what kind of integral domain $R$, we have a finite upper bound on the degree of irreducible elements in $R[x]$?   Some most familiar examples are ruled out: in $\mathbb{Z}[x]$, $\mathbb{Q}[x]$ and $\mathbb{F}_{p}[x]$, there is not such a bound. Unfortunately these exhaust all integral domains about which I have a working knowledge.  Another result might help is , which says if we can find a prime ideal $\mathfrak{p}$ in $R$ such that $\mathfrak{p}^2\neq\mathfrak{p}$, then by picking $a\in\mathfrak{p}^2\backslash\mathfrak{p}$ we have an irreducible $a+x^d$, where $d$ can be arbitrary, and hence the upper bound is not possible.  So we only need to focus on domains where $\mathfrak{p}^2=\mathfrak{p}$ for all prime ideals. This seems to be a quite strong restriction but I am not sure what to make of it.  Can someone give a hint?  Thanks! Are there other schools for witches and wizards in the rest of the world? In the books they only speak of 3 schools, but what about Asian or American people?  And even more, were they affected by the events happening in Europe? I am trying to test the impact of a sale initiative on store revenue. I have created 10 matched pairs of stores and then randomly distributed one store in each pair into a test or control group.  I then ran the sale for 21 days within the test group (keeping control constant) and measured relative lift in revenue compared to baseline.  My questions  1.) Should I be using a paired t-test based on the previous store matching  2.) Should I be measuring across each day of the test such as:          Control Test 1/1/2017    4   3 1/2/2017    3   4 1/3/2017    1   3 1/4/2017    2   3 1/5/2017    2   4 1/6/2017    1   7   Or measuring across my paired markets such as:                 Test Control Market Pair 1   10  5 Market Pair 2   8   3 Market Pair 3   5   1 Evaluating this integral $ \small\int \frac {x^2 dx} {(x\sin x+\cos x)^2} $ The question:      Compute$$ \int \frac {x^2 \, \operatorname{d}\!x} {(x\sin x+\cos x)^2} $$   Tried integration by parts. That didn't work.  How do I proceed? Finding Distribution function from probability density function Adding a citation after paper is accepted I am a junior researcher in mathematics. I worked simultaneously on proving Theorem A and Theorem B. They both generalize Theorem X in two different directions. Theorem X was proved several years ago (not by me). The proofs of Theorem A and Theorem B use very different techniques, and so I decided ahead of time to write one paper for each.  I finished proving Theorem A before I finished proving Theorem B. Then, I submitted Paper A to a journal (and the arXiv) proving Theorem A. Paper A includes a survey of related problems in the introduction. After a short while, I managed to prove Theorem B, and two months after the submission of Paper A, I submitted Paper B (to a different journal, and also to the arXiv). Now, six months after the submission of Paper A, it is accepted with requests for minor corrections. There is no response yet regarding Paper B.     In this situation, is it a reasonable/common to add one/two sentences to the survey in introduction of Paper A, explaining and citing the arXiv prepreint of Paper B, in addition to the minor corrections the referees asked for? (and letting the editor and referees know that I did that in my answer to their reports which comes along with the corrected manuscript).   Note that I am not asking if it is ok to cite a preprint. This is something I do, and so do other people, at least in math. My question is about making a change, after acceptance, which was not asked by the referees and the editor. I can't distinguish the difference in meaning between these  two sentences.   It really doesn't matter.  It doesn't  really matter.    It seems that there is a nuanced difference, but I cannot see what this is. How to remove symbolic link I was trying to create this symbolic link:  sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin   but I accidentally typed:  sudo ln -s /usr/share/php,yad,in /var/www/phpmyadmin   So now I want to correct it but it says symbolic link already exist. Is there a way to absolutely force a Log Out, Shut Down, or Restart with open tabs and unsaved documents? I could not find any relatively simple way to log out of a public use Mac quickly with many tabs open and unsaved document in the background without resorting to sudo shutdown -h now.  The reason I ask is that sometimes a user will have his/her account logged into the iMacs here at school and they would try to log off and then leave, thinking it has completed but the process is interrupted by Safari and Office apps, leaving their account, mounts, and websites still accessible to the next person who sits down.  Obviously a shortcut string would be nice instead of posting a note telling the person to type arcane things in a terminal. For example, just having them try to find Terminal.app is going to be a chore.  This doesn't seem to make sense because the user can just quit each app and click a few dialog boxes but unlike you and I to whom repeatedly pounding Command-Q while hitting the spacebar and D keys are probably second nature. What is a "year" in Westeros? How to adapt classicthesis layout to B5paper and Linux Libertine Question says it all: I am using classicthesis with XeTeX to typeset my PhD thesis. I want to use B5 paper size (176 × 250 mm) and the beautiful Linux Libertine font. I'm wondering how to    calculate the optimal page margins actually apply these settings to the document   Any help is greatly appreciated =)  EDIT: I should add that I need to generate two different PDF files from this:   a version with papersize A4 (210 × 297 mm), where the B5 layout is (approximately) centered, and crop marks are shown, to pass on to the printing company a version with papersize B5 for online distribution, having the same layout as the printed one.   I tried fiddling with using  and \areaset command, but to no avail. Etymology of Tor and Ext Functors The names of the derived functors $\operatorname{Tor}$ and $\operatorname{Ext}$ seem quite cryptic to me. Does anyone know what these abbreviations stand for? I would be glad if someone could tell me where these names come from. What is the meaning of the axes in t-SNE? I'm currently trying to wrap my head around the  math. Unfortunately, there is still one question I can't answer satisfactorily: What is the actual meaning of the axes in a t-SNE graph? If I were to give a presentation on this topic or include it in any publication: How would I label the axes appropriately?  P.S: I read  Reddit question but the answers given there (such as "it depends on interpretation and domain knowledge"), don't really help me to understand this. Which countries require a 24-hour transit visa in China? I'm transiting through China in Kunming, China.  I'm a South African national and do NOT fall under the 72-hour visa free program. However on [their official (travelchina) website][1] it says:     Nationals of most countries are eligible for the 24-hour direct   transit, while a visa is needed for the passengers transiting on   Afghanistan, Azerbaijan, Iran, Iraq, Kazakhstan, Kyrgyzstan, Malaysia,   Nigeria, Oman, Pakistan, Saudi Arabia, Sri Lanka, Thailand, Turkey,   United Arab Emirates and Yemen passports.   I'm sorry if I'm missing this, but the above is rather badly worded for me does "nationals of most countries" include ALL countries except those mentioned in the list shown?  Also again sorry if I'm missing this but again it is rather badly worded for me. I will fly via Thailand to China and then via China to Canada with an 8-hour layover in China. I see Thailand is mentioned on the list. I have a Thailand residency permit where I currently reside... Would that affect me at all?  Also, any idea if I can exit the airport in China and come back under the 24-hour visa exemption (should I be exempt)?  Many thanks.