I have the following function which pulls in a Javascript block via AJAX from a URI and executes it:  function loadViewViaAjax(url, callbackOnSuccess) {     Ext.Ajax.request({         url: url,         success: function(objServerResponse) {             var responseText = objServerResponse.responseText;             var scripts, scriptsFinder=/&lt;script[^&gt;]*&gt;([\s\S]+)&lt;\/script&gt;/gi;             while(scripts=scriptsFinder.exec(responseText)) {                 eval.call(window,scripts[1]);             }             if(typeof callbackOnSuccess != 'undefined') {                 callbackOnSuccess.call();             }         }     }); }   For example, it pulls in this text, and executes eveything between the SCRIPT tags:  &lt;script type="text/javascript"&gt;     clearExtjsComponent(targetRegion);     var start_info_panel = new Ext.Panel({         padding: 10,         style: "margin: 10px",         width: 300,         html: '&lt;h1&gt;Html Item 1&lt;/h1&gt;'     });     replaceComponentContent(targetRegion, start_info_panel); &lt;/script&gt;   How can I change the loadViewViaAjax function so that it executes everything between multiple script tags?, e.g.:  &lt;script type="text/javascript"&gt;     clearExtjsComponent(targetRegion);     var start_info_panel = new Ext.Panel({         padding: 10,         style: "margin: 10px",         width: 300,         html: '&lt;h1&gt;Html Item 1&lt;/h1&gt;'     });     replaceComponentContent(targetRegion, start_info_panel); &lt;/script&gt; &lt;script type="text/javascript"&gt;     clearExtjsComponent(targetRegion_help);     var help_panel = new Ext.Panel({         padding: 10,         style: "margin: 10px",         width: 300,         html: '&lt;p&gt;This is the help text.&lt;/p&gt;'     });     replaceComponentContent(targetRegion_help, help_panel); &lt;/script&gt;
I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?
BGE everything white in playmode When I press P to play everything shows up white in the BGE. Shading is set to GLSL, and the objects are UV mapped and textured. It seems that vertex paint is overriding the material for the object even though it is unchecked in the material options.   Shading is set to GLSL   Objects have a texture applied How to resolve conflicting distributions in apt-get When doing an apt-get update/upgrade I see that warning  W: Conflicting distribution: https://downloads.plex.tv/repo/deb public InRelease (expected public but got )   I was upgrading to Ubuntu Zesty 17.04 before and do not know how to fix the above. Already have seen ? but there are no suggested fixes for that.  Maybe one of you can give some hints? Thanks! In Dummit and Foote, Exercise 15.18 (p. 727 3rd edition) one is asked to prove that for a commutative ring with unity $R$, and $f$ a non-nilpotent element of $R$, that the localization $R_f$ is isomorphic to $R[x]/(xf - 1)$.  I have done this, using the strategy outlined in the problem, using the universal property of $R_f$ proved in Theorem 36. The problem I have is this:  If $R_f \cong R[x]/(xf - 1)$ and $\phi:R[x] \to R_f$ is a surjective homomorphism, it stands to reason that $\text{ker}(\phi)$ should be $(xf - 1)$. I cannot show this directly. The surjective homomorphism I have in mind is, for:  $p(x) = a_0 + a_1x + \cdots + a_mx^m$  $\phi(p) = \dfrac{a_0}{1} + \dfrac{a_1}{f} + \cdots + \dfrac{a_m}{f^m}$  It is clear to me that $\phi$ annihilates $(xf - 1)$, so that ideal is contained in the kernel. What I cannot show is the other containment, or equivalently:  If $\phi(g) = 0_{R_f}$ then $g(x) \in (xf - 1)$. The trouble I am running into is that $R$ might be a "bad" ring, containing a lot of zero-divisors, $f$ might even be a zero-divisor (being non-nilpotent is a considerably weaker property), so the usual polynomial tricks of the division algorithm or using the irreducibility of $xf - 1$ aren't much use, here.  I feel I am missing something obvious....what is it? biblatex: \parencite in note field prints spurious ; with authoryear-icomp style Do we have different badges in different SE sites I have 3 fields ( Exposed filter ) 1 Country 2 State 3 City  When a respective Country is selected in the 1st field, I want the second filter ( Dropdown or autocompete ) to display states of the country selected in the 1st field &amp; when this is done based on the state selection , I want the 3rd field to show only the cities belonging to the state selected in the second field.  How can this be done ? any help ? I'm granted a one-entry Schengen visa and now I can't go. Will having an unused visa in my travel passport have any consequences like future visas refusal? Do I need to do anything special? How did Rutherford conclude that most of the mass (as well as the positive charge) was concentrated in the nucleus? Geiger and Marsden's experiment led Rutherford to believe that the positive charge and most of the mass of the atom was concentrated in a small region. I understand what led him to conclude the way the positive charge is positioned in the atom. But how did he conclude that most of the mass was in a small region (the nucleus)?  How did the distribution of the mass matter after all? Given that the electric force is greater than the gravitational force by many magnitudes, the force between the positice charge and the electrons was predominantly electric.   So how did Rutherford conclude that most of the mass is in the nucleus? From the  on the dual of a norm:  $X$ and $Y$ are normed spaces, and we associate with each $f\in L(X,Y)$ (the space of bounded linear operators from $X$ to $Y$) the number $$\|f\| = \sup\{|f(x)|:x\in X, \|x\| \leq 1\}.$$  At some point in the proof that $L(X,Y)$ is bounded, it seems like they use the inequality $$\|fx\| \leq \|f\|\cdot\|x\|,$$ where $\|x\|\leq 1$.  I can't see why this should holds.   $\|f|\|$ is the supremum of what $|f(x)|$ can be, given that $\|x\|\leq 1$. So, given that $\|x\| \leq 1$, $|fx|$ should be bounded by $\|f\|$. But why should it be bounded by $\|f\|\cdot\|x\|$? How to bind RadioButtons to an enum? I've got an enum like this:  public enum MyLovelyEnum {     FirstSelection,     TheOtherSelection,     YetAnotherOne };   I got a property in my DataContext:  public MyLovelyEnum VeryLovelyEnum { get; set; }   And I got three RadioButtons in my WPF client.  &lt;RadioButton Margin="3"&gt;First Selection&lt;/RadioButton&gt; &lt;RadioButton Margin="3"&gt;The Other Selection&lt;/RadioButton&gt; &lt;RadioButton Margin="3"&gt;Yet Another one&lt;/RadioButton&gt;   Now how do I bind the RadioButtons to the property for a proper two-way binding? We all know very well how to make an angle of 15 and 45 degree and its multiple using compass. Can anybody tell me how to make an angle of 10 degree and its multiple using compass? My Windows 7 has suddenly stopped displaying Unicode symbols For some strange reason, my computer suddenly doesn't show certain unicode characters anymore! I have no idea what happened.  Affected applications include Windows Explorer (should be Japanese characters), Google Chrome (should be a heart), and Winamp (should be stars):      Russian, German etc. characters are displayed normally. Chrome also displays Japanese script on websites, but not in the GUI. How can I fix it?     TL;DR: A workaround is to put a shortcut with a Unicode name on the desktop so that explorer.exe is the first process to display a Unicode string after booting.     Update: I have tried to use System Restore to fix it. I needed to go back in time quite a while because the most recent restore points didn't solve it so I used one from the middle of November. After that restore, Unicode symbols were displayed again. Then I updated my system with Windows Update again because those were removed during the restore. After that, the error occurred again! I then did a restore to a point before my new updates, but the error persists, and the old restore point (which I used before) is gone and there are currently no other snapshots of the system. Any suggestions on what to do now?  Update 2: I could find a workaround:      Control Panel → Region and Language → Administration → Change Language for Unicode-incompatible programs to Japanese (Japan).    All mentioned programs display their symbols correctly again. However, I don't consider this a fix because these programs are not usually Unicode-incompatible, and it also leads to some (non-serious) artifacts in some programs. I still welcome an answer that tells me what went wrong here and how to fix the issue.  Update 3: I think I have isolated the particular Windows Update which causes the error. It is . I have installed all other updates except this one, and the error did not occur again.  Update 4: The true origin of this problem was Chrome, see accepted answer. Workaround: put shortcut with Unicode name on desktop so that explorer.exe is the first process to display a Unicode string after booting. How do I time a method's execution in Java? How do I get a method's execution time?   Is there a Timer utility class for things like timing how long a task takes, etc?     Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want. I understand that if a particle approaches a finite potential barrier of height $V_0$ with energy $E &lt; V_0$, there is still a finite probability of finding the particle on the other side of the barrier due to quantum tunneling.  My question is, since the wavefunction is nonzero inside the barrier region, is it possible to actually make a position measurement and locate a particle inside the barrier?  I mean, if we can say that "there is a nonzero probability that the particle is inside the barrier", surely this would suggest we can do so?  If not, why not? Am I understanding the whole wavefunction/probability distribution thing right? Using getline(cin, s) after cin Bind a key for multiple units to use the same spell Is there a way for me to bind a key that will allow multiple units in my control group to all use the same spell at once?  For example, if I have 3 centaurs as chen, and I have them all selected. Can I press one key to make them all warstomp at the same time?   Or if I have 3 familiars as Visage. When I have all three selected, is there a button I can press to have them all stun at the same time? Suppose I have a python object x and a string s, how do I set the attribute s on x? So:  &gt;&gt;&gt; x = SomeObject() &gt;&gt;&gt; attr = 'myAttr' &gt;&gt;&gt; # magic goes here &gt;&gt;&gt; x.myAttr 'magic'   What's the magic? The goal of this, incidentally, is to cache calls to x.__getattr__(). propositional calculus problem, how to prove this right or wrong? $A$$\rightarrow$$(B$ $\vee$ $C$ ) , $B$ $\rightarrow$ $C$ $\vDash$ $A$ $\rightarrow$ $D$  I think it's wrong but I have no idea how to prove. The generic off-topic flag reason has different wording in the Android app I am working on a Drupal mulsite project (using single database) and using Google Analytics module for this.  I have follow the below steps for GA configuration:   Created a domain name example1.com and a sub-domain name example2.com. Create an account on GA and create property for both of this domain name in GA account. Both property give me two different Tracking ID (same as below screenshot).      Into the configuration setting of GA from drupal admin section I have added Web Property ID of example1.com and into domain setting added both the domain name example1.com and example2.com into the section of List of top-level domains (a same as attached screenshot).      Now this configuration is only working for emample1.com, not for example2.com. So can anyone please tell me how can I use Web Property ID of domain exmaple2.php to get the result?