Checking validity of email in django/python
How to validate an email address using a regular expression?
I was trying to understand the internal structure of AES (Advanced Encryption Standard)  The Standard order of steps within a round:   Substitute Bytes Shift Rows Mix Columns Add Round Key   Substitute Bytes, Shift Rows &amp; Mix Columns satisfies the two most important properties required for a secure cipher i.e confusion and diffusion   Substitute Bytes provides Confusion i.e. that each binary digit (bit) of the ciphertext should depend on several parts of the key.  Shift Rows along with Mix Column provides Diffusion i.e. if we change a single bit of the plaintext, then (statistically) half of the bits in the ciphertext should change  Changing the order of Step 1 and Step 2 won't have any effect. But to what extent can we change the order of other steps? Does it weakens the security of AES, and if so, how? First, my apologies if this has already been asked/answered.  I wasn't able to find this question via search.  My question comes from Rudin's "Principles of Mathematical Analysis," or "Baby Rudin," Ch 1, Example 1.1 on p. 2.  In the second version of the proof, showing that sets A and B do not have greatest or lowest elements respectively, he presents a seemingly arbitrary assignment of a number $q$ that satisfies equations (3) and (4), plus other conditions needed to show that $q$ is the right number for the proof.  As an exercise, I tried to derive his choice of $q$ so that I may learn more about the problem.  If we write equations (3) as $q = p - (p^2 - 2)x$, we can write (4) as   $$ q^2 - 2 = (p^2 - 2)[1 - 2px + (p^2 - 2)x^2]. $$  Here, we need a rational $x &gt; 0$, chosen such that the expression in $[...]$ is positive.  Using the quadratic formula and the sign of $(p^2 - 2)$, it can be shown that we need   $$ x \in \left(0, \frac{1}{p + \sqrt{2}}\right) \mbox{ for } p \in A, $$  or, for $p \in B$, $x &lt; 1/\left(p + \sqrt{2}\right)$ or $x &gt; 1/\left(p - \sqrt{2}\right)$.  Notice that there are MANY solutions to these equations! The easiest to see, perhaps, is letting $x = 1/(p + n)$ for $n \geq 2$.  Notice that Rudin chooses $n = 2$ for his answer, but it checks out easily for other $n$.  The Question:  Why does Rudin choose $x = 1/(p + 2)$ specifically?  Is it just to make the expressions work out clearly algebraically?  Why doesn't he comment on his particular choice or the nature of the set of solutions that will work for the proof?  Is there a simpler derivation for the number $q$ that I am missing? Copy files and directory tree for filesize in specified range I would like to make a small script copying files from different directories example /pp/01 /pp/02/ etc... to another destination with the same directory design. But only those files within the directory with a size larger than 88MB but smaller than 93MB...   I would use a for loop and the find function. Are there more efficient ways? And how can I implement the find function exactly. Get referenced node fields in twig In Drupal 8, I have a content type, that has an "entity_reference" field and I wish to access the referenced node's fields in twig template. the kint() output for the field is:   In this list I can't find the referenced node's field values. How can I (if at all possible) load the node or node fields/values in twig?  Best,  Alari What does "+6 to hit, Hit: 13 (2d8 + 4)" mean in a creature's stat block? My friends and I are very new to D&amp;D, played like 3 times. In a monster's stats next to weapon damage it says stuff like "+11 to hit" and "Hit: 5 (1d8+1)". For the premade characters it just says things like "+4, 2d6 + 2 slashing", though. Why are there two "hit" numbers for monsters? Which do I use for the d20 roll to hit against a target's AC?  I mean for example like in the Ogre entry in the "" article on monsters. Prove that if the identity is written as the product of $r$ transpositions, then $r$ is an even number Theorem. If the identity is written as the product of $r$ transpositions, $id=τ_1τ_2\dots τ_r$, then $r$ is an even number. Proof. We will employ induction on $r$. A transposition cannot be the identity; hence, $r &gt; 1$. If $r = 2$, then we are done. Suppose that $r &gt; 2$. In this case the product of the last two transpositions, $τ_{r−1}τ_r$, must be one of the following cases: $(ab)(ab) = id\\ (bc)(ab) = (ac)(bc)\\ (cd)(ab) = (ab)(cd)\\ (ac)(ab) = (ab)(bc),$ where $a$, $b$, $c$, and $d$ are distinct. The first equation simply says that a transposition is its own inverse. If this case occurs, delete $τ_{r−1} τ_r$ from the product to obtain $id=τ_1τ_2···τ_{r−3}τ_{r−2}$. By induction $r − 2$ is even; hence, $r$ must be even. In each of the other three cases, we can replace $τ_{r−1} τ_r$ with the right-hand side of the corresponding equation to obtain a new product of $r$ transpositions for the identity. In this new product the last occurrence of $a$ will be in the next-to-the-last transposition. We can continue this process with $τ_{r−2} τ_{r−1}$ to obtain either a product of $r − 2$ transpositions or a new product of $r$ transpositions where the last occurrence of $a$ is in $τ_{r−2}$. If the identity is the product of $r − 2$ transpositions, then again we are done, by our induction hypothesis; otherwise, we will repeat the procedure with $τ_{r−3}τ_{r−2}$. At some point either we will have two adjacent, identical transpositions canceling each other out or $a$ will be shuffled so that it will appear only in the first transposition. However, the latter case cannot occur, because the identity would not fix $a$ in this instance. Therefore, the identity permutation must be the product of $r − 2$ transpositions and, again by our induction hypothesis, we are done. Question: That is the proof written in the book, but unfortunately after more than $10$ times reading I don't understand the last two paragraph (i.e., from &quot;In each of the other three cases&quot;). Is there another simpler proof or could someone please clarify what is going on? Thank you. 1970s or 80s kids book: girl's life taken over by a robot doppelganger version of herself I read this book between 1980-82 but it could have been written earlier.  It's about a girl who is dissatisfied with her life, as her parents have her on a diet and she wants to be able to eat what she wants. Someone offers her a solution: to come live in this large building where she can eat all the chocolate eclairs and other junkfood she wants, while a robot doppelganger android version of herself will take her place at home and at school.  The girl agrees, but finds that after week of eating mainly eclairs, she is sick and wants to eat a decent meal. But she is not allowed to eat anything else and has found herself to be a prisoner, so she sets out to get rid of the android and get her life back.   I don't recall the ending but it seemed the 'people' behind it all might have been aliens and the building might have been a kind of ship that then disappears. Analyzing $\biggl\lfloor{\frac{x}{5}}\bigg\rfloor=\bigg\lfloor{\frac{x}{7}}\bigg\rfloor$ How many non negative integral values of $x$ satisfy the equation :$$\biggl\lfloor{\dfrac{x}{5}}\bigg\rfloor=\bigg\lfloor{\dfrac{x}{7}}\bigg\rfloor$$.   My try:  Writing few numbers and putting in the required equation.  $\underbrace{0,1,2,3,4}_{\implies 0=0},\underbrace{5,6}_{\displaystyle\times},\underbrace{7,8,9}_{\implies 1=1},\underbrace{10,11,12,13}_{\displaystyle\times} ,\underbrace{14}_{\implies 2=2},\underbrace{15,16,17,18,19,20}_{\text{LHS gives 3 but RHS gives 2}},\underbrace{21,22,23,24}_{\text{LHS gives 4 but RHS gives 3}}$.  The point which I wish to make here is that after $14$ we'll get $5's$ multiple before than $7's$, hence $\forall x \geq 15 \implies \biggl\lfloor{\dfrac{x}{5}}\bigg\rfloor&gt;\bigg\lfloor{\dfrac{x}{7}}\bigg\rfloor$  Hence the only solution are: $\{0,1,2,3,4,7,8,9,14\}$. Does these make sense?  I need to know other solutions that don't incorporate such analyzing, means using some properties and framing it to solve above. If $n = p_1^{a_1} ... p_r^{a_r}$ the set of nilpotents of $\mathbb{Z}_n$ is $(p_1 p_2 ... p_{r-1} p_r)\Bbb Z_n$ How do I delete all Folders with a specific name (e.g. 128Kbps_Songs) without deleting its files  For example if I have directory "MP3_SONGS" with subdirectories "A", "B", "C" and each subdirectory has MANY directory Contains Film Name "FILM_NAME1", "FILM_NAME2", "FILM_NAME3" in it, In That Each Film NAme I have specific Folder NAme (128Kbps_Songs) in this "128Kbps_Songs" Folder I have That Film mp3 Songs Files  how can I remove the Folder "128Kbps_Songs", in Each Film_Name directory and Have to get these mp3 songs in that FILM_NAME..   ( Have to Delete 128Kbps_Songs Folder in all FILM_NAME without deleting the mp3 Songs in it, have to get the mp3 in FILM_NAME Directory..  MP3_SONGS (Parent Directory) ------ A , B, C  A (Sub Directory1) ------ FILM_NAME1 , FILM_NAME2 B (Sub Directory2) ------ FILM_NAME3 , FILM_NAME4 c (Sub Directory3) ------ FILM_NAME5 , FILM_NAME6  FILM_NAME1 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME1 (MP3 Files) FILM_NAME2 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME2 (MP3 Files)  FILM_NAME3 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME3 (MP3 Files) FILM_NAME4 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME4 (MP3 Files)  FILM_NAME5 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME5 (MP3 Files) FILM_NAME6 (Directory) ---- 128Kbps_Songs (Directory) ------ FILM_NAME6 (MP3 Files)  Need Files in: FILM_NAME1 (Directory)  ------ FILM_NAME1 (MP3 Files) FILM_NAME2 (Directory)  ------ FILM_NAME2 (MP3 Files)  FILM_NAME3 (Directory)  ------ FILM_NAME3 (MP3 Files) FILM_NAME4 (Directory)  ------ FILM_NAME4 (MP3 Files)  FILM_NAME5 (Directory)  ------ FILM_NAME5 (MP3 Files) FILM_NAME6 (Directory)  ------ FILM_NAME6 (MP3 Files) What is the distinction between a professional and amateur photographer? How to create Unity indicators? I'm interested in Unity indicators and wonder if there is any tutorial on how to program them. I can use the sources of the existing ones as last resort, but I'd prefer a more friendly approach because my programming skills are quite limited. What element saved Iron Man from his blood poisoning? I just watched Iron Man 1&amp;2 the other day. I'm new to the entire story. In IM2 we learn that his blood is being poisoned and that he has tried every combination of every existing element as a cure - unsuccessfully. Then he deducts &quot;the key&quot; from the Expo park's plans which saves him. What is that key? What element had he not tried? I realize that the movie story has to be simplified, compared to the original story, so there are probably story elements that I have completely missed because they're only in the original works. We also saw that in LOTR. Argument list too long for ls I get the following error when trying to ls *.txt | wc -l a directory that contains many files:  -bash: /bin/ls: Argument list too long   Does the threshold of this "Argument list" dependent on distro or computer's spec?  Usually, I'd pipe the result of such big result to some other commands (wc -l for example), so I'm not concerned with limits of the terminal. Browsing through a copy of Counterexamples in Analysis (Gelbaum  &amp; Olmsted), I'm quite enjoying the typeface used for 'script' letters (see links to examples below); visually it's somewhere between what I'd now call calligraphic and fraktur, and semantically it's used where now we'd use mathcal, mathfrak or mathbb.  I was therefore procrastinatiously looking for a LaTeX-usable font to include these characters, but couldn't seem to find any. I'm certain they're not unique to this text or publisher, so figured my lack of success was probably more to do with searching with the wrong keywords. If anyone has any ideas I'd be grateful. The English alphabet has a common pronunciation. For example, the letter b is pronounced like the word bee, the letter c like the word see, and the letter i like the word aye.  Is there a formal spelling for the letter names? Quoting in ssh $host $FOO and ssh $host "sudo su user -c $FOO" type constructs I often end up issuing complex commands over ssh; these commands involve piping to awk or perl one-lines, and as a result contain single quotes and $'s.  I have neither been able to figure out a hard and fast rule to do the quoting properly, nor found a good reference for it.  For instance, consider the following:  # what I'd run locally: CMD='pgrep -fl java | grep -i datanode | awk '{print $1}' # this works with ssh $host "$CMD": CMD='pgrep -fl java | grep -i datanode | awk '"'"'{print $1}'"'"   (Note the extra quotes in the awk statement.)  But how do I get this to work with, e.g. ssh $host "sudo su user -c '$CMD'"?  Is there a general recipe for managing quotes in such scenarios?.. How does this wiring work? I have a Trane XV90 and XL 14i. The wiring looks a little strange as in the picture bellow.                    _____________                   |           |   BK W2  W1   R  G  Y  B/C  YLO O     |___||   |__|  ||   |          |   |     ||   |_____>|----------|         |   |     ||_________>|other wire|         |   |     |           ------------         V   V     V     ---------------     |thermostat   |     ---------------  The R and G are jumpered together and the G wire is connected on the board  but is actually not connecting to the thermostat on the other end. So people told me that means the furnace fan is always on! (In my diagram above, I switched the location of Y and B/C to make diagram easier to draw. You can refer to the photo added below to see the details) My questions are the following  is the jumper between O and Y doing anything? I don't think I have heat pump I need to install Honeywell wifi thermostat and I am thinking of doing either one of the following:   remove jumper between R and G, and use G to connect B/C and then to thermostat C and put jumper between G and Y  leave jumper between R and G, and use G to connect B/C and then to thermostat C and put jumper between G and Y  remove jumper between R and G, connect G on control board to thermostat G, and finally have the spare wire to connect B/C and then thermostat C  leave jumper between R and G, does not connect G to thermostat,  and just use a spare wire to connect B/C on board to thermostat C   Can anyone comment on those plans? Thanks a lot! Word for a person who knows two or three languages A polyglot is a person who is fluent in many languages, but what do we call a person who is fluent in only two or three languages?  Is bi-glot a proper term for this?  I don't think the words bilingual / trilingual fit the bill, because I am looking for a -glot word. What's going on here? I've installed the  on Ubuntu 17.10. Everything was cool, and as I was trying to hone and tweak the look of my desktop, at some point the shortcuts bar (dock?) on the left is duplicated.  (Click image to enlarge) The default, which normally disappears with Dash to Dock, is there underneath the one that usually shows up when I install Dash to Dock. Why? I've tried to go through the options for Dash to Dock, the GNOME Tweak Tool, and the regular Ubuntu settings, but I can't figure it out.