I have this NSString:  &lt;title&gt;My Friends Website&lt;/title&gt;   How do I pull out My Friends Website into it's own NSString on iOS with Objective-C?
There are a couple of different ways to remove HTML tags from an NSString in Cocoa.   is to render the string into an NSAttributedString and then grab the rendered text.   is to use NSXMLDocument's -objectByApplyingXSLTString method to apply an XSLT transform that does it.  Unfortunately, the iPhone doesn't support NSAttributedString or NSXMLDocument. There are too many edge cases and malformed HTML documents for me to feel comfortable using regex or NSScanner. Does anyone have a solution to this?  One suggestion has been to simply look for opening and closing tag characters, this method won't work except for very trivial cases.   For example these cases (from the Perl Cookbook chapter on the same subject) would break this method:  &lt;IMG SRC = "foo.gif" ALT = "A &gt; B"&gt;  &lt;!-- &lt;A comment&gt; --&gt;  &lt;script&gt;if (a&lt;b &amp;&amp; a&gt;c)&lt;/script&gt;  &lt;![INCLUDE CDATA [ &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ]]&gt;
How do I make windows save their position on screen after re-attaching a display? When I attach a second monitor to my MacBook, I drag many windows onto it.  When I detach the monitor, all the windows move back onto my MacBook's display.  How can I make it so that when I re-attach the monitor, all the windows automatically move back to their position on the second monitor again?  I use my personal MacBook at work where I have the extra monitor.  But this means I need to detach and re-attach the monitor every day.  I have many windows I leave open from the previous day's work, so this is a real pain.  I know about an app called , which is almost exactly what I want.  But I need something that works on OS X 10.5. How to search for list of papers citing both papers A and B? For given papers A and B, I would like to search for all papers that cite both A and B. I guess one can generalize to papers {A,B,C,...} and find all papers that cite all of them.   A quick Google Scholar and Web of Science search revealed nothing. Google Scholar has a "cite=..." thing in the URL, which I messed with a bit to no avail. Unable to play MP3 or MP4 files in Rhythmbox or Movie Player I am unable to play any MP3 or MP4 files. When I try to open any MP3 or MP4 file, both show an error, a Python 2.7 plug-in is required. PrintWriter and PrintStream never throw IOExceptions Some days ago I realized that  (as well as ) never throw an IOException when writing, flushing or closing.  Instead it sets an internal flag (trouble=true) when an error occurs. It's not possible to get the exact exception, but only if there was some exception ().  My question is: why would one want to have such behavior? Isn't that bad API design? Separate Network Traffic on Two Network Interfaces I would like to visit Iran as a tourist but I'd also like to visit the USA some time after. I know the relations between the two countries are bad.   Is it likely that I'm not allowed to enter the USA after having been to Iran?   If it matters, I've never been to either of those countries. I'm a Swiss citizen, an atheist from a Christian background. How do I build a SOQL query for records in a list of IDs? Can some one correct my soql? I need to export records in data loader like:  WHERE Id IN ('123123123','123123fsdf')   But this following query does not work for me:  SELECT Id, Syndication_Documents__c FROM ContentVersion  WHERE Syndication_Documents__c in : 'a4fa0000000KzbV','a4fa0000000KzbW' Why there isn't any integer solutions in non-zero integers for $z^3 = 3(x^3 +y^3+2xyz)$? Consider the following Diophantine equation  $$z^3 = 3(x^3 +y^3+2xyz)$$  Is there any elementary proof for the non-solubility in non-zero integers for this  Diophantine equation, where the absolute value of $x, y$ and $z$ are pairwise coprime integers?  I have proved the impossibility of solution of this Diophantine equation in non-zero integers, but that took quite a few pages and I consider this too long. I hope for a much more elementary and shorter proof for this puzzle.  Hint: It should be noted that is also true for the non-availability of the similar form (replacing coefficient 3 by 1) as the following:   $$z^3=x^3+y^3+2xyz,$$ but this case is very simple to prove, where $x, y\;\&amp;\; z$ are nonzero integers. White regions in DensityPlot — is this a bug with ColorFunctionScaling? Complex number question on proving an inequality. If $|z_1|=1,|z_2|=1$, how can one prove $|1+z_1|+|1+z_2|+|1+z_1z_2|\ge2$ What is the significance of allowing nilpotents in scheme theory? Is Cursed Child canon to the original story? From what I am hearing the stage-play called The Cursed Child is based on the characters from the Harry Potter series. It is set 19 years from the end of Deathly Hallows (i.e. When Harry's children are starting their time at Hogwarts).   I have also seen the J.K. Rowling has had at least some involvement and been on the set and a part of rehearsals, etc.   My question is has there been a statement given relating to the canon of the stage play to original series? If so, would any conflicting information be considered a retcon?  Related:  - but not dupe because this asking about in-universe information. I installed Ubuntu 13.04 on my Vista 64 bit machine and I thought it was going to uninstall Vista but it didn't, now I have both systems.  How do I get rid of Vista? How to convert strings into integers in Python? I have a tuple of tuples from a MySQL query like this:  T1 = (('13', '17', '18', '21', '32'),       ('07', '11', '13', '14', '28'),       ('01', '05', '06', '08', '15', '16'))   I'd like to convert all the string elements into integers and put them back into a list of lists:  T2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]]   I tried to achieve it with eval but didn't get any decent result yet. Homotopy invariance for cohomology I have tried to read Hatcher's  book. He proved  Theorem 2.10: If two maps $f,g :X \to Y$ are homotopic, then they induce the same homomorphism $f_* = g_*:H_n(X) \to H_n(Y)$.  One can immediately obtain following corollaries using the dual version of prism operator described in Theorem 2.10 and some facts:  Corollary 1: If $f,g :X \to Y$ are homotopic, then $f_* = g_*:\tilde H_n(X) \to \tilde H_n(Y)$ for $n&gt;0$.  Corollary 2: If $f,g :(X,A) \to (Y,B)$ are homotopic, then $f_* = g_*:H_n(X,A) \to H_n(Y,B)$.  Corollary 3: If $f,g :X \to Y$ are homotopic, then $f^* = g^*: H^n(X) \to H^n(Y)$.  Corollary 4: If $f,g :X \to Y$ are homotopic, then $f^* = g^*:\tilde H^n(X) \to \tilde H^n(Y)$ for $n&gt;0$.  Corollary 5: If $f,g :(X,A) \to (Y,B)$ are homotopic, then $f^* = g^*:H^n(X,A) \to H^n(Y,B)$.  I wonder that how can we prove the following statements:  Corollary 6: If $f,g :X \to Y$ are homotopic, then $f_* = g_*:\tilde H_0(X) \to \tilde H_0(Y)$.  Corollary 7: If $f,g :X \to Y$ are homotopic, then $f_* = g_*:\tilde H^0(X) \to \tilde H^0(Y)$.  An attempt for Corollary 7 is  Proof of Corollary 7: By Universal Coefficient Theorem, we have $$\tilde H^0(X;G) \approx Hom(\tilde H_0(X),G).$$  Hence the result follows from the dualization of the proof Corollary 6.  Any help will be appreciated. Is there a proof that $\pi$ is an irrational number? Most math texts claim that $\pi$ is an irrational number. However, I'm having a little bit of trouble understanding that.  Since nobody has calculated all of the digits of $\pi$, how can we know that either:   one of the digits repeats (as in $\frac{10}{3}$) the number eventually terminates     Note: Please be very descriptive in your answers... I don't have anything beyond high school math. The list has several empty strings in it for me right now: Chrome unity shortcut acting up Whenever I click on my chrome shortcut I get a new window (as expected) but I also get a new Unity entry with a different icon (one from an iconset I had been using before upgrading to 14.04 - don't really remember the name). The new unity entry does not seem to originate from a correct .desktop entry because all the submenus are missing from it (New incognito window, New Window etc.) and it has a permanent tag '(1) Facebook' no matter the window title (see attached picture).  I have uninstalled and reinstalled chrome in hope that it would help which it did until restart but now I get the same behaviour.  Note that I haven't altered any .desktop files regarding chrome and I can only find one file:  /usr/share/applications/google-chrome.desktop which seems to be correct (with submenus etc.) When should we use proximity rule in "either/or", and "neither/nor"? According to this , if at least one of the nouns involved is plural then it should take the plural form of the verb. Otherwise, it should take the singular form of the verb. But in the last part it says not all grammars agree to those rules thus proximity rule applies. However, it doesn't explain when to apply the proximity rule and when not to use the former rules. Can we get rid of the threshold of 15 chars for comments? I understand that there is an upper limit. But why do you have to type at least 15 characters to post a comment? It is easy to work around it anyway (like adding dots or other useless things).