currently I am using below code to get the differences between two html code snippet to highlight the differences. &lt;?php    function get_decorated_diff($old, $new){    $from_start = strspn($old ^ $new, &quot;\0&quot;);            $from_end = strspn(strrev($old) ^ strrev($new), &quot;\0&quot;);     $old_end = strlen($old) - $from_end;    $new_end = strlen($new) - $from_end;     $start = substr($new, 0, $from_start);    $end = substr($new, $new_end);    $new_diff = substr($new, $from_start, $new_end - $from_start);      $old_diff = substr($old, $from_start, $old_end - $from_start);     $new = &quot;$start&lt;ins style='background-color:#ccffcc'&gt;$new_diff&lt;/ins&gt;$end&quot;;    $old = &quot;$start&lt;del style='background-color:#ffcccc'&gt;$old_diff&lt;/del&gt;$end&quot;;     return array(&quot;old&quot;=&gt;$old, &quot;new&quot;=&gt;$new); }  $string_old = &quot;&lt;p&gt;This is fox&lt;/p&gt;&lt;p&gt;Here I am rabbit&lt;/p&gt;&lt;p&gt;Cheeta&lt;/p&gt;&quot;; $string_new = &quot;&lt;p&gt;This is fox&lt;/p&gt;&lt;p&gt;Here I am rabbit&lt;/p&gt;&lt;p&gt;goat&lt;/p&gt;&lt;p&gt;Gorilla&lt;/p&gt;&quot;; $diff = get_decorated_diff($string_old, $string_new); echo &quot;&lt;table border=1&gt;        &lt;tr align=center&gt;           &lt;td&gt;old data&lt;/td&gt;           &lt;td&gt;new data&lt;/td&gt;        &lt;/tr&gt;         &lt;tr&gt;           &lt;td&gt;&quot;.$diff['old'].&quot;&lt;/td&gt;           &lt;td&gt;&quot;.$diff['new'].&quot;&lt;/td&gt;        &lt;/tr&gt;     &lt;/table&gt;&quot;;  ?&gt;  I am Getting the below output:  But I want the output to highlight the All new added text in the new data, currently its highlighting the first matched difference.
What is the easiest way to highlight the difference between two strings in PHP?  I'm thinking along the lines of the Stack Overflow edit history page, where new text is in green and removed text is in red. If there are any pre-written functions or classes available, that would be ideal.
Should I test private methods or only public ones? Adapt V-brakes bicycle to disk brakes I've been thinking in changing my v-brakes to disc brakes. Now that my rear v-brake can't brake anymore I think that it is time change it. I've already seen . My frame is prepared for disc and, as I don't want to change my brake lever, I'll go with mechanical brakes (does  look ok?);  The only problem is the rear wheel hub that has not the six holes for the disk. Is it ok if I just change the rear wheel hub and keep the front one? Induction Proof that $x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+\ldots+xy^{n-2}+y^{n-1})$ If an email message contains an email address in the body, Gmail automatically converts it into a mailto: link, which is helpful.  And many times each day I've enjoyed being able to right-click a mailto: link in an email (within Gmail) and then click "Copy email address" in the context menu.  Then I can paste that email address into a program (such as when I want to search a database).  However, within the past month or so, I've noticed that I can't right-click and click "Copy email address" without Gmail then popping open a "New Message" panel and changing my current URL to have ?compose=new at the end.  I wonder if it's related to .  How can I disable it?  I'm tried of having to click the "Discard draft" trash can button so many times throughout the day. Use of substitution into the integral $\int_0^2 \frac{\arctan x}{x^2+2x+2}dx$ This question: got some attention, but I didn't understand anything of it. Now I looked at the solution of the book and there is given the hint to use the change of variable $$x=\frac{1-t}{1+2t}$$ Could you please explain how one could think of such substitution? Is there some intuition behind this? Also after I used the substitution I got: $$\int_{-1/5}^1\frac{3\arctan\left(\frac{1-t}{1+2t}\right)}{5t^2+8t+5}dt$$ How can I finish this using the hint from the book? I am trying to help a friend who is very concerned that she has just lost all of the data on her 32GB SanDisk microSD card.  I told her I would post this and see if anyone could offer help.  Here are the details:   The SanDisk microSD card is less than two years old.  Probably only about a year old.  The store will take it back, but that doesn't really help.  She wants her data. She used the card in her Samsung Galaxy S4 smartphone for over a month.  The phone was never exposed to water or temperature extremes. Today, her phone suddenly said something like "Your SD card is blank or an unsupported format". Her phone was then unable to read the SanDisk microSD card at all.   Here's what she has tried:   Rebooting her phone.  Had no effect. Taking out the SanDisk microSD card and putting it inside a full-size SD card adapter, and inserting it into a Windows 7 SP1 computer.  The computer did not recognize its presence at all. Putting the SanDisk microSD card into a USB 2.0 external card reader and inserting the card reader into a USB port on a Windows 7 SP1 computer.  The computer recognized the card reader and installed drivers for it.  The card reader shows up as 'Removable Disk' in Windows Explorer.  Clicking on 'Removable Disk' in Windows Explorer results in the error "Insert disk: Please insert a disk into the Removable Disk". After trying #3, tried opening the 'Removable Disk' in FreeCommander.  Doing so results in the error "The device is not ready".   She does not have access to a linux box, but does have access to her Android phone.  What can she do to recover the data on her 32GB SanDisk microSD card? Question: Let $E$ be a normed space. Let $G$ be a closed subspace of $E$ and let $F$ be a finite dimensional subspace of $E$. Show that $F+G$ is a subspace of $E$ and is closed.  I'm having trouble in showing $F+G$ to be closed. I know that $F$ is itself closed and complete, as it is a finite dimensional subspace of a normed space, and that if $F$ were compact that $G+F$ would be closed. I also know that the closed unit ball of any finite dimensional normed space is compact.  I tried two methods. One was to take a convergent sequence $(x_n)_{n \in \mathbb N}$ in $G+F$. Then we can write $x_n = f_n + g_n$ where $f_n$ and $g_n$ are sequences in $F$ and $G$ respectively, and I attempted to find a way to force the individual components $f_n$ and $g_n$ inside the unit ball which would enable me to say that they had convergent subsequences. I couldn't see how to do this, however.   The other thought was to try and show that $F$ is compact, but I don't see a way to do this as I can't imagine it to be simply true without some other conditions on $F$.  Are one of these methods the right way to go? Or should I go another direction? I would appreciate any help I can get, although I would prefer not to be presented with a full proof so that I can do some work for myself. Thanks! Horn and spindle tori If $[G' : G'']\leq p^2$, then $G'$ is abelian. Can a multi-core processor run multiple processes at the same time? I understand that a multi-core processor can run multiple threads of the same process at the same time using its different cores. Can it also run multiple processes at the same time(each core running a different process)? Recovering data from a phone stuck in restore mode I have an iphone 4 that is stuck in restore mode after trying to update to ios 6 wirelessly.  Unfortunately, I do not have a recent itunes backup of this phone.  Is there any way to recover my photos from this device before I try to restore it?  Will restoring it wipe all the data on the phone? Log of mounted/unmounted devices in Unix Should I use the datetime or timestamp data type in MySQL? permission reporting on sudoers I'm looking for a good, consistent and easy way to do a report of sudoers permissions for every user and group on the system. For users, I want the report to include permissions granted via group membership. Heisenberg Uncertainty Principle scientific proof states that:    $$\sigma(x)\sigma(  p_x )\ge \frac {\hbar}{2}.$$  What is the scientific proof of this principle? Convert NSDate to NSString How do I convert, NSDate to NSString so that only the year in @"yyyy" format is output to the string? Complex towers: $i^{i^{i^{...}}}$ I want to start a modal operator by clicking a button in a panel in the properties region. It should then stop when I click somewhere in the 3D viewport. I want to execute some code when I start and finish the operator (see the code below). I tried modifiyng the modal operator template with an execute method to start the modal operator. But the now the context.space_data.type is always &quot;PROPERTIES&quot; because that's where the panel is located, I guess. Is this a bad way of doing what I want? class MY_OPERATOR_OT_click_on_3dview(bpy.types.Operator):          bl_idname = &quot;mesh.click_on_3dview&quot;     bl_label = &quot;Click on 3D&quot;      def modal(self, context, event):                  if context.space_data.type != 'VIEW_3D':             return {'PASS_THROUGH'}                  if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:             # allow navigation             return {'PASS_THROUGH'}         elif event.type == 'LEFTMOUSE':             # DO ALL THE POST-SELECT STUFF             return {'FINISHED'}         elif event.type in {'RIGHTMOUSE', 'ESC'}:             return {'CANCELLED'}          return {'RUNNING_MODAL'}      def execute(self, context):         # DO ALL THE SETUP STUFF           context.window_manager.modal_handler_add(self)              return {'RUNNING_MODAL'}            def cancel(self, context):         print(&quot;CANCEL???&quot;) I am reading through Folland's Real Analysis: Modern Techniques and Their Applications, and they have the following proposition and proof:     Proposition: If $\{f_{j}\}$ is a sequence of $\bar{\mathbb{R}}$- valued measurable functions on $(X, \mathcal{M})$, then the functions:      $$g_{1}(x)=\sup_{j} f_{j}(x)$$ $$g_{2}(x)=\inf_{j} f_{j}(x)$$ are   measurable.       Proof:      We have       $$g_{1}^{-1}((a,\infty])= \bigcup_{j=1}^{\infty}  f_{j}^{-1}((a,\infty])$$ $$g_{2}^{-1}([-\infty,a))=  \bigcup_{j=1}^{\infty} f_{j}^{-1}([-\infty,a))$$      Where the result follows from the fact that $g_{1}^{-1}((a,\infty])\in  \mathcal{M}$ for all $a \in \mathbb{R} \iff g$ is measurable, and   $g_{2}^{-1}([-\infty,a))\in \mathcal{M}$ for all $a \in \mathbb{R}  \iff g$ is measurable.   I understand the last part of the proof, but how do we know $g_{1}^{-1}((a,\infty])= \bigcup_{j=1}^{\infty}f_{j}^{-1}((a,\infty])$ and $g_{2}^{-1}([-\infty,a))=\bigcup_{j=1}^{\infty} f_{j}^{-1}([-\infty,a))$? I would appreciate any help with this. Question concerning linear combinations of vectors and linear independence in Linear Algebra.