The pattern [aeiou][^vr]e(?=[^r]) works fine when testing at RegexPlanet.com, but when I use the same pattern with re.match in Python I get no matches.  import re pattern = r'[aeiou][^vr]e(?=[^r])' list = ['pale.', 'taste', 'kite'] for word in list:     if re.match(pattern, word):         print(word)   Expected Result:  pale. kite.
What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.
I have a small question regarding using sudo with output redirect &gt;. To enable IP forwrding, someone can use the command:  echo 1 &gt; /proc/sys/net/ipv4/ip_forward   Executing this command will give permission denied as it requires root privileges. However, executing the same command with sudo gives also permission denied error! It seems that output redirect &gt; does not inherit the permissions of the preceding command echo. Is this right?  As a workaround I do:  echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward   Is this the best way to do it? Am I missing something?  Please, note that this is an example and it applies to all commands that use output redirect. I'd like to setup a WCF service to send emails. The System.Net.MailMessage doesn't seem to be serializable, and cannot be passed in a [DataContract]  The error I receive is      Type 'System.Net.Mail.MailAddress'   cannot be serialized. Consider marking   it with the DataContractAttribute   Any suggestions? Mann-Whitney U test and K-S test with unequal sample sizes Busy Device on Umount I often experience a problem to umount a directory:  umount /mnt/dir umount: /mnt/dir: device is busy   There are many reasons why the device is busy. Sometimes there are processes running which have open locks on it, sometimes there are other directories mounted on top of /mnt/dir.  My question:  What are the steps to check why a directory couldn't be unmounted.  I know there are many reasons, but it's ok if you explain a specific solution.  [EDIT]  [X]  running processes on mounted volumes.   [X] another volume is mounted on top of a volume we want to unmount   [_] NFS locks the volume we want to unmount Substr(). Add characters for each n digits Is it possible to test apex that relies on field history tracking? I have some code that relies on field history tracking by querying the History for a custom object. This works fine, but it appears that the history records aren't created during the test so none of my tests will pass. Can I board if my flight arrives 1.5 hours before my UK visa becomes valid? My visa to UK is valid starting from June 25 but my flight to LGW is June 24 10:30 PM (edit: this is landing time not departure based on VCE-LGW flight times presented by easyjet.com). I still have 1.5 hours until my visa becomes valid. I prefer not to change my flight because I don't want to pay extra charges.   Will the EasyJet airlines going to allow me on board? I will be coming from Venice. How long does it take from landing to Immigration in London Gatwick? Can I stay longer in the airport before I pass through Immigration? Can I still see my luggage in the conveyor belt after 1.5 hours? How much time before they take away my luggage from the belt? Recovering broken or deleted NTFS partitions What is the difference between these two:     Suzuki was nearly close to go out of business just after the World War period.   Vs.     Suzuki was nearly close to going out of business just after the World War period.(from a video)   When talking about the past, do these two sentences different from each other? Like, if you use verbing(going) with infinitive(to) in the past, does it mean that there is another event happening? Or none. Is the Dungeon Magazine 4e Adventure List spreadsheet still available? used to go to a spreadsheet with all the 4E adventures published in Dungeon Magazine (and possibly some others, IIRC) during that edition's duration. I remember it listed out each adventure by name, start/end level, adventure path, and maybe even a little summary blurb.  However, the spreadsheet behind that link seems to have disappeared into the digital ether, and I can't find a copy of it in my own google drive (implying I never made a copy of it).  Does anyone happen to have a copy of that spreadsheet that they could share, and/or other resources that would let me sort through the many adventures from 4E Dungeon Magazine? Show that $(L^{p},\|\|_{p})$ is a Banach space. Show that $(L^{p},\|\|_{p})$ is a Banach space.  My approach: I prove the statement for $(L^{1},\|\|_{1})$, of the following way, first all, is easy show that $\|\|_{1}$ is a norm. So,  $(L^{1},\|\|_{1})$ is vector space. To show that is a Banach space, note that  Prop. 1: Let $(f_{n})_{n\in\mathbb{N}}\subset\mathcal{L}^{1}$ (where $\mathcal{L}^{1}=\mathcal{L}^{1}(X,\tau,\mu)$ is the space of all integrals function), such that $\sum_{i}{\|f_{n}\|}_{1}&lt;\infty$, then the sequences $\left(\sum_{n=1}^{N}{f_{n}}\right)_{n\in\mathbb{N}}$ converges almost everywhere to the integral function, that we called $\sum_{n\in\mathbb{N}}{f_{n}}$. Furthermore $$\sum_{n\in\mathbb{N}}{\int{f_{n}d\mu}}=\int{\sum_{n\in\mathbb{N}}{f_{n}d\mu}}\quad\lim_{N\to\infty}{\|\sum_{n=1}^{N}{f_{n}}-\sum_{n\in\mathbb{N}}{f_{n}}\|_{1}}=0$$ Prop. 2: Let $(E,\|\|)$ a normed vector space. Then $E$  is a Banach space if and only if for all $(e_{k})_{k\in\mathbb{N}}\subset E$ such that $\sum_{k\in\mathbb{N}}{\|e_{k}\|}&lt;\infty$, $\left(\sum_{k=1}^{n}{e_{k}}\right)_{n\in\mathbb{N}}$ converges in $E$  We take the proposition 2. Let $(f_{n})_{n\in\mathbb{N}}\subset L^{1}$ such that $\sum_{n}{\|\hat{f}_{n}\|_{1}}&lt;\infty$. Let $f_{n}\in\hat{f}_{n}$, then $\|f_{n}\|_{1}=\|\hat{f}_{n}\|_{1}$ and then $\sum_{n}{\|f_{n}\|_{1}}&lt;\infty$, by prop. 1, there exist $F\in\mathcal{L}^{1}$ such that $\|\sum_{n=1}^{N}{f_{n}-F\|_{1}}\to 0$, and then $\|\sum_{n=1}^{N}{\hat{f}_{n}-F\|_{1}}\to 0$. Finally note that $\hat{F}\in L^{1}$ is a Banach space. This was my answer for  $L^{1}$ space, but how I prove the general statement for $L^{p}$ (I want to do a similar response). Edit: I'm stuck in the problem, any idea or hint is appreciated.Thanks!! How do I get list of all tables in a database using TSQL? Why is a home fiber connection asymmetric? I recently switched from an ADSL to a fiber connection and was surprised to see that the bandwidth is asymmetric (1 Gbps down / 250 Mbps up).  While this is understandable in ADSL, I do not understand why fiber at home is asymmetric as well? It is not a limitation of the technology (I have symmetric fiber at the office, and always had) Random weighted choice Consider the class below that represents a Broker:  public class Broker {     public string Name = string.Empty;     public int Weight = 0;      public Broker(string n, int w)     {         this.Name = n;         this.Weight = w;     } }   I'd like to randomly select a Broker from an array, taking into account their weights.  What do you think of the code below?  class Program     {         private static Random _rnd = new Random();          public static Broker GetBroker(List&lt;Broker&gt; brokers, int totalWeight)         {             // totalWeight is the sum of all brokers' weight              int randomNumber = _rnd.Next(0, totalWeight);              Broker selectedBroker = null;             foreach (Broker broker in brokers)             {                 if (randomNumber &lt;= broker.Weight)                 {                     selectedBroker = broker;                     break;                 }                  randomNumber = randomNumber - broker.Weight;             }              return selectedBroker;         }           static void Main(string[] args)         {             List&lt;Broker&gt; brokers = new List&lt;Broker&gt;();             brokers.Add(new Broker("A", 10));             brokers.Add(new Broker("B", 20));             brokers.Add(new Broker("C", 20));             brokers.Add(new Broker("D", 10));              // total the weigth             int totalWeight = 0;             foreach (Broker broker in brokers)             {                 totalWeight += broker.Weight;             }              while (true)             {                 Dictionary&lt;string, int&gt; result = new Dictionary&lt;string, int&gt;();                  Broker selectedBroker = null;                  for (int i = 0; i &lt; 1000; i++)                 {                     selectedBroker = GetBroker(brokers, totalWeight);                     if (selectedBroker != null)                     {                         if (result.ContainsKey(selectedBroker.Name))                         {                             result[selectedBroker.Name] = result[selectedBroker.Name] + 1;                         }                         else                         {                             result.Add(selectedBroker.Name, 1);                         }                     }                 }                   Console.WriteLine("A\t\t" + result["A"]);                 Console.WriteLine("B\t\t" + result["B"]);                 Console.WriteLine("C\t\t" + result["C"]);                 Console.WriteLine("D\t\t" + result["D"]);                  result.Clear();                 Console.WriteLine();                 Console.ReadLine();             }         }     }   I'm not so confident. When I run this, Broker A always gets more hits than Broker D, and they have the same weight.  Is there a more accurate algorithm?  Thanks! Which tube size to prefer if several options apply? I have 40-622 (a.k.a. 28x1.5") tires, and  offers  two different sizes of tubes - their models "17" and "19" - as applicable for that tire size.  Ok, either one would surely fit well. But apart from weight difference (150 vs. 220 grams), is there any reason to prefer one over another? Is it better to have as small &amp; light tube as possible? Or perhaps a bit larger and heavier one would be more durable, as it wouldn't be stretched as much? Err on which side? What's the starting wealth for higher levels? The PHB only gives starting wealth for Level 1 PCs. Based on my experience in other games, specifically Pathfinder, I would expect to get more at higher levels. Where can I find an appropriate table or calculation? Solving 4 Quadratic Simultaneous Equations Consider the equations:   $$\begin{cases} ab+c+d=3\\ bc+d+a=5\\ cd+a+b=2\\ da+c+b=6 \end{cases}$$   Where $a,b,c,d \in \mathbb{R}$. How can we find $a,b,c,d$?   The furthest I've got is by adding the first two equations and the last two equations together to get: $ab+bc+c+d+d+a=(b+1)(a+c)+2d=8$ and $(d+1)(a+c)+2b=8$ We can rearrange these (assuming $b,d \neq -1$) to get $$\frac{8-2d}{b+1}=\frac{8-2b}{d+1} \implies -d^{2}+3d+4=-b^{2}+3b+4$$ Which leads us further to $$b^{2}-d^{2}-3(b-d)=0 \implies (b-d)(b+d-3)=0$$ Now since $b=d$ gives us an absurdity (equations 1 and 4 reduce to 3=6), we must have $b+d=3$. This is as far as I can get unfortunately, since trying the same approach with the other pairs doesn't work in the same way.  Help would be much appreciated; the problem is from the BMO1 2004 paper. How do I programmatically log in a user with a POST request? Is it easy to enter the UK multiple times on the same Business Visitor Visa? I got a business visitor visa, sponsored by a company, for a 4-5 day visit. The visa was provided for a period of 6 months, with multiple entry possible.   First, what should I carry with me when entering the UK (at LHR)? Will they just take a look at my visa and let me in, or will I have an interview or something? (I haven't seen indication that I should carry documents or anything with me, but I thought I'd ask).  Second, if I want to re-enter the UK in a month or two (not for a business purpose), can I do that on the same visa, since it's multiple entry? Or is the second entry different than the first (i.e. if the first doesn't have an interview, they'll have an interview on the second entry?) How do you create a simple, custom rule using the jQuery Validate plugin (using ) that doesn't use a regex?  For example, what function would create a rule that validates only if at least one of a group of checkboxes is checked?