I have a string that is a date, like this @"dd/mm/yyyy" and I want to split this string in 3 small strings with day, month and year. I've succeeded on doing it with the day using this code:  self.dayLabel.text = [string substringToIndex:2];   but how do I get the middle values, like the month?
What is the best way to tokenize/split a NSString in Objective-C?
Number reference headline I try to number the header of my references. I succeeded to add the number to the table of contents, but I can't get it to work for the header.  To add the number to the toc I used:  \addcontentsline{toc}{section} \protect\numberline{\thesection}References}   If I try the same for \refname, I get 5References without space.   \renewcommand{\refname}{\protect\numberline{\thesection References}}   When I put the references title outside the curly brackets, it's shown in a new line. What am I missing here? The full bibliography call looks like this:  \renewcommand{\refname}{\protect\numberline{\thesection References}} \addtocounter{section}{1} \cleardoublepage \phantomsection \addcontentsline{toc}{section}{\protect\numberline{\thesection}References} \bibliographystyle{apacite} \bibliography{bachelor}   EDIT 1:  As @TeXnician stated, a tilde would solve the problem. It is not very elegant, though, as I have to use approximatly three of them to get the same space as in the other headlines.   \renewcommand{\refname}{\protect\numberline{\thesection~~~References}}   EDIT 2: @Werner suggested a shorter solution, but it throws multiple errors, when I try to integrate it into my .tex file. Here's a short reproducable example which replicates the errors.  \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage[margin=1.1in]{geometry} \usepackage{listings} \usepackage{apacite} \usepackage{natbib}  \begin{filecontents}{mybib.bib}  @Article{draxler2010sample,     author    = {Draxler, Clemens},     title     = {Sample size determination for Rasch model tests},     journal   = {Psychometrika},     year      = {2010},     volume    = {75},     number    = {4},     pages     = {708--724},     publisher = {Springer}, }  \end{filecontents}   \begin{document}  \tableofcontents      \section{First Chapter}  \citep{draxler2010sample}  \let\oldsection\section% Store \section in \oldsection \renewcommand{\section}[2]{\oldsection{#2}}% Update \section to gobble * \bibliography{mybib} \bibliographystyle{apacite}  \appendix  \section{R Code}  \subsection{Greedings Function}  \begin{lstlisting}     print("Hello World") \end{lstlisting}  \end{document} Are the LIGO observations proof of a black hole merger, and what happened to the black holes? Recent reports claim that the gravitational waves detected by LIGO match up with the signal expected from two black holes merging as predicted by general relativity.  Additionally, the masses of both black holes were estimated. Questions:  How certain are we that the detected of gravitational waves are necessarily from two black holes merging?  Since supermassive black holes are typically at the center of a host galaxy, what happened to the galaxies that contained the two merging black holes?  For example, did their host galaxies merge?    Edit After reading the answers, I understand that the signals detected by LIGO are proof of the validity of gravitational wave generational artifacts as predicted by general relativity.  When additionally gravitational waves, caused by the merger of the supermassive black holes (those which ARE indeed located in the centers of the merging galaxies) will be detected, since mergers of galaxies could be observed by the methods independent of gravitational waves such as registering the fact of the quasar appearance (). Additional questions:  Could someone offer me the historical ASTRONOMY precedent when the second degree of inference (from the mathematical model, being associated with the theory of Physics) was accepted as the discovery of the astronomical object?  Could someone give a reference to trustable scientific publication, with the subject of study being discussion of requirements satisfying claim of astronomical discovery of an astronomical object?  Have independent scientific sources (outside of members of the LIGO team) analyzed methodology and results of the LIGO signal detection, and published their conclusions with regards of what was actually discovered? How to sum $\sum_{x=0}^{N-1} \cos{\left( \frac{2\pi x}{N} \right)}^{2}$? I've tried solving it, but I'm not familiar with these kind of progressions and I couldn't get to a result. Also, I've found that the result is just $N/2$, but I don't get why would that be the answer, as it doesn't work for $N=1$ or $N=2$. Appreciate your help :) I'm playing Minecraft on Xbox 360 and I can't find the . I have tried every trick I can think of, including the xray glitch, and recreating the world in Creative mode to dig out the entire stronghold and the surrounding areas. I have found nothing and I am totally lost on where it could be.  The seed is 1833758535681455132 Multinomial logistic regression analysis or binary logistic regression Is $\frac{1}{\sqrt{2}}$ a fraction or not?   I just came across a Grade 8 student's class work where the teacher has given the above as an example to differentiate fractions from rational numbers. I think this is wrong fundamentally, as $\sqrt2$ is irrational while all fractions would be rational. Please advise. Thanks! Interpretation of Shapiro-Wilk test I'm pretty new to statistics and I need your help. I have a small sample, as follows:    H4U   0.269   0.357   0.2   0.221   0.275   0.277   0.253   0.127   0.246   I ran the Shapiro-Wilk test using R:    shapiro.test(precisionH4U$H4U)   and I got the following result:   W = 0.9502, p-value = 0.6921   Now, if I assume the significance level at 0.05 than the p-value is larger then alpha (0.6921 > 0.05) and I cannot reject the null hypothesis about the normal distribution, but does it allow me to say that the sample has a normal distribution?  Thanks! During the First Wizarding War, why didn't Dumbledore just hunt Voldemort down, as he had done with Grindelwald?  By 'hunting down', I mean finding, defeating and imprisoning him, exactly as in Gridelwald's case, and not, say killing him, something which Dumbledore would not do, as the answers to a previous question (as to him not hunting down Death Eaters) show.  Dumbledore knew that Voldemort had delved into the Dark Arts deeper than anyone else in history and hence "had powers he will never have". But he must have also known well that he could have defeated Voldemort at a direct confrontation, given that he had defeated Grindelwald earlier even against the Elder Wand, and now had that same wand at his disposal. He is seen confident about this throughout the series.  At the Battle of the Department of Mysteries, he did not go beyond outweighing Voldemort and forcing him to flee, probably because, by then, he had reasons to suspect that there was more to Voldemort's survival than his physical body, and thus, destroying that body which had Harry's blood without permanently disposing him off would not have been wise.  But why did he not do that at the First Wizarding War? Is it just that they could not track him down, or did he suspect even then that Voldemort had more sinister things about his soul? is there any canon confirmation of the latter suspicion? Most of the time one or the other feels better, but every so often, "which" vs. "what" trips me up.   So, what's the exact difference and when should you use one or the other? How is unattended-upgrades started and how can I modify its schedule? I'm wondering who starts unattended-upgrades in my debian-jessie:   my man page   DESCRIPTION    This program can download and install security  upgrades  automatically    and  unattended,  taking care to only install packages from the config‐    ured APT source, and checking for dpkg prompts about configuration file    changes. All output is logged to /var/log/unattended-upgrades.log.    This  script  is  the backend for the APT::Periodic::Unattended-Upgrade    option and designed to be run from cron (e.g. via /etc/cron.daily/apt).  But my crontab doesn't show anything by crontab command:  @stefano:/etc/cron.daily$ crontab -l no crontab for stefano # crontab -l no crontab for root  But my unattended-upgrade work fine!(my unattended-upgrades log file) :  2017-02-05 12:42:42,835 INFO Initial blacklisted packages:  2017-02-05 12:42:42,866 INFO Initial whitelisted packages:  2017-02-05 12:42:42,868 INFO Starting unattended upgrades script 2017-02-05 12:42:42,870 INFO Allowed origins are: ['o=Debian,n=jessie', 'o=Debian,n=jessie-updates', 'o=Debian,n=jessie-backports', 'origin=Debian,codename=jessie,label=Debian-Security'] 2017-02-05 12:43:15,848 INFO No packages found that can be upgraded unattended   Where do I have to check/modify if I want to change my schedule? How get the :hover css style of an anchor with jQuery? How can i get the :hover in css stylesheet on the fly with jquery?  stupid example:   a.foo {     color: red;     font-size: 11px; }  a.foo:hover {     color: blue;     font-size: 12px;  }   how to retrieve that color and font-size before that mouse will go over the anchor? Error when updating texlive 2015 When I want to update packages of texlive 2015 I get this error? what is the problem?  tlmgr update --list  The locale codeset (cp720) isn't one that perl can decode, stopped at   C:\texlive \2015\tlpkg\tlperl\lib/Encode/Locale.pm line 123. Compilation  failed in require at C:\texlive\2015\tlpkg\tlperl\lib/LWP/UserAgent. pm  line 1001. An example of a group such that $G \cong G \times G$ I was trying to find an example such that $G \cong G \times G$, but I am not getting anywhere. Obviously no finite group satisfies it. What is such group? What causes atoms to have their specific colors? I asked about it on  and they told me to post it here.  Probably need to add the :active to the :hover meta class or something like that.  Example:      Hammer Time The Earth in all of its varieties has wide ranging climates. At the top level it has tropical, dry, temperate, continental, and polar climates. And yet often the planets depicted in science fiction are often single climate planets.    The forest moon of Endor The desert planet of Dune The desert planet of Tatooine The desert planet of Vulcan The outer planets in Firefly all appeared to be mostly desert (supiciously like Calfornia desert).  The inner planets in Firefly were all temperate or tropical.  The icy Breen homeworld The icy Andorian homeworld The icy Frost Giant planet   I'm not suggesting there are no Earth-like planets in science fiction, but it feels like it is less common than it should be. Considering the only planet we have as an example is our own, it seems like planets should be just as varied in the cosmos. Find the product $\prod_{n=1}^{\infty} (1+x^{2n-1}) $ How long are the life phases of a dragon? When a divination wizard character uses their Portent ability:     Starting at 2nd level when you choose this school, glimpses of the   future begin to press in on your awareness. When you finish a long   rest, roll two d20s and record the numbers rolled. You can replace any   attack roll, saving throw, or ability check made by you or a creature   that you can see with one of these foretelling rolls. You must choose   to do so before the roll, and you can replace a roll in this way only   once per turn.   ... to replace a roll, can a player with the Lucky Feat:     Whenever you make an attack roll. an ability check, or a saving throw,   you can spend one luck point to roll an additional d20. You can choose   to spend one of your luck points after you roll the die, but before   the outcome is determined. You choose which of the d20s is used for   the attack roll, ability check, or saving throw.      You can also spend one luck point when an attack roll is made against   you. Roll a d20, and then choose whether the attack uses the attackers   roll or yours.      If more than one creature spends a luck point to influence the outcome   of a roll, the points cancel each other out; no additional dice are   rolled.   ... use the Luck Roll to replace the result? Or does the Portent trump all rolls and simply give you the final outcome?  This question spun off from  on .  Some relevant points:  .  Mike Mearls tends to believe that luck can triumph in some cases, but admits this is , and further seems to conflate the question with .  I would suggest reading the linked discussion before formulating an answer. There's some good thought there. Is there a built-in checksum utility on Windows 7? Is there a built-in checksum/hash utility on Windows 7?