I'm trying to figure out a way to locate multi-line strings embedded in a binary file. The code I've got will identify non-multi-line versions of the pattern, but not the multi-line versions.  I've tried this with with re.findall():  import re a = open('file', 'rb') b = a.read() c = re.findall(b'[&lt;]{2}.*?[&gt;]{2}', b, re.MULTILINE)   And with re.search():  import re a = open('file', 'rb') b = a.read() c = re.search(b'[&lt;]{2}.*?[&gt;]{2}', b, re.MULTILINE) c.group()   In each case, the code will return non-multi-line substrings, but not those where a \n character appears in the string.  Any ideas?
For example, this regex  (.*)&lt;FooBar&gt;   will match:  abcde&lt;FooBar&gt;   But how do I get it to match across multiple lines?  abcde fghij&lt;FooBar&gt;
Gaming with Virtualbox, has it worked for you? Currently I am using Windows 8. I have a virtual box with Ubuntu set up for development. Aside from that I sometimes just want to relax and enjoy a game (Battlefield 3, Skyrim, Saints Row: The Third, etc) after hours of research and development.   I want to have my main machine with linux, and install windows on a virtual box.   What I want to know, from those who have tried or seen it:   How is the performance? I've never been clear on this but, even if I install the correct drivers on the windows box, will it matter? At least on this part, I'm just curious how it offload. Which drivers will matter the most.  Mouse and Keyboard integration, I'll be honest, sometimes the mouse integration in Virtual Box is a bit frustrating, mouse cursor disappears, etc.    I'm not sure if this is the right place to ask. I'm merely trying to come back to linux, yet I'm a PC gamer so I can't throw away Steam. I'm aware of the linux client, but most of those games won't work.   If there's a right place to ask this whether StackExchange sites or any other site let me know.   Cheers and I hope those in the same position find a middle ground. (c) Let $\mathcal{L}^*\subseteq\mathcal{L}^{\text{FOPC}}$ be a first order language of predicate calculus consisting of three unary function symbols $f,g,h$.  (i) Write down an $\mathcal{L}^*$-sentence $\phi$ such if $\mathcal{A}$ is an $\mathcal{L}^*$-structure with $\mathcal{A}\vDash\phi$ then the restriction of $h_\mathcal{A}$ to the range of $f_\mathcal{A}$ gives a one-to-one function onto the range of $g_\mathcal{A}$.  (ii) Write down an $\mathcal{L}^*$-sentence $\psi$ such that if $\mathcal{A}$ is an $\mathcal{L}^*$-structure with $\mathcal{A}\vDash\psi$ and the domain $A$ of $\mathcal{A}$ is finite then the cardinality $|A|$ is a square.    Part (i) is easy enough, but I'm having trouble with part (ii). I assume that you can use part (i). My initial idea was to use $h$ to ensure $|Range(f_A)| =|Range(g_A)|$ but I'm not sure where to go from there. Thanks. What to do with an Ubuntu disk image that appears as a WinRAR file? I've never used Ubuntu before. Just heard from some friends. "IT'S GREAT!!!", they used to say. So i decided to try it. I downloaded WUBI, and ran it but 'twas takin' too much time. So I decided to download the .ISO Image file separately. It couldn't download more after 150 mB, and got interrupted (and cancelled) itself. I just went to , and further went to , and searched for my question. After having found a related one, which told     "try the torrent way"   So I downloaded it through the torrent. And after that when I opened the .rar file, there wasn't any .ISO image file; just some folders with names like .disc, boot, ISOLINUX, etc. I searched for the .ISO file but nothin' there: ANYONE HELP ME, PLEASE!!! or this will drive me into never thinkin' about Ubuntu again. Crop a big picture into several small size pictures Is there a a way with GIMP editor to crop a big picture into several small equal sized pictures? So when all those small pictures connected in order would make a big picture. Let $S=\{\frac{m}{2^n}| n\in\mathbb{N}, m\in\mathbb{Z}\}$, is  $S$ a dense set on $\mathbb{R}$? How do we know that entanglement allows measurement to instantly change the other particle's state? I have never found experimental evidence that measuring one entangled particle causes the state of the other entangled particle to change, rather than just being revealed.  Using the spin up spin down example we know that one of the particles will be spin up and the other spin down, so when we measure one and find it is spin up we know the other is spin down. Is there any situation after creation that the particle with spin up will change to spin down? Let $(\Omega, \mathcal F,P)$ be a probability spaces and $H$ be a Hilbert space. By a random operator $A$ from $H$ to $H$ we mean a linear continuous mapping from $H$ into the Frechet space $L_0^H (\Omega, \mathcal F,P)$ of all $H$-valued random variables. My question is: How Can we define $|A|$ and the adjoint $A^*$? How to save a copy of a multiplayer world in the new 0.7+ menus? How do you save a joined game after the 0.7.1 update? The menus have all changed since 0.6.x and I can't find the option to save a copy of a joined world anymore. (My friend has got a diamond house on survival and I want to save it but it doesn't let me!) Peltier Unit Not Working Double vs. BigDecimal? Registering a domain name with a trademark in it Is Switching the Neutral OK? What’s the worst that can happen if i put a switch in the neutral instead of the phase?   I just found out that 3 light bulbs sockets in my home  are connected this way, it first came to my mind to fix it but then I recalled the flow of current from positive to negative is just a convention since the electrons are charged negatively and they actually flow from N to L so i cant really find an solid excuse to mess with the wiring for the next 2 hrs SQLite parameter substitution problem Using SQLite3 with Python 2.5, I'm trying to iterate through a list and pull the weight of an item from the database based on the item's name.  I tried using the "?" parameter substitution suggested to prevent SQL injections but it doesn't work. For example, when I use:  for item in self.inventory_names:     self.cursor.execute("SELECT weight FROM Equipment WHERE name = ?", item)     self.cursor.close()   I get the error:     sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 8 supplied.   I believe this is somehow caused by the initial creation of the database; the module I made that actually creates the DB does have 8 bindings.  cursor.execute("""CREATE TABLE Equipment      (id INTEGER PRIMARY KEY,      name TEXT,     price INTEGER,      weight REAL,      info TEXT,      ammo_cap INTEGER,      availability_west TEXT,     availability_east TEXT)""")   However, when I use the less-secure "%s" substitution for each item name, it works just fine. Like so:  for item in self.inventory_names:     self.cursor.execute("SELECT weight FROM Equipment WHERE name = '%s'" % item)     self.cursor.close()   I can't figure out why it thinks I have 8 bindins when I'm only calling one. How can I fix it? Full Wi-fi/ethernet signal but no internet How to perform entity validation on code level? I have an entity that has a field attached to it and the values that user types into the field has to be globally(website) unique(compared to other entities).  I have added validation to the entity form but what if I create this entity programmatically? How can I prevent the entity to be saved into the storage?  I've noticed there is a validate method in ContentEntityBase, though not in ConfigEntityBase. Is this the place for it? If so, I could use some examples. How do I disable the guest session in Ubuntu 11.10 or higher? I don't want people to be able to use my computer without using a password to log in! Do potion effects affect the ender dragon? I am at the ender dragon and have tons of Potions of instant damage. I never got into range, but do the effects even do anything? Minimum value of $\left(a+\frac{1}{b}\right)^2+\left(b+\frac{1}{c}\right)^2+\left(c+\frac{1}{a}\right)^2$ Given $a,b,c \in \mathbb{R^+}$ such that $a+b+c=12$   Find Minimum value of $$S=\left(a+\frac{1}{b}\right)^2+\left(b+\frac{1}{c}\right)^2+\left(c+\frac{1}{a}\right)^2$$  My Try: By Cauchy Schwarz Inequality we have  $$\left(a+\frac{1}{b}\right)+\left(b+\frac{1}{c}\right)+\left(c+\frac{1}{a}\right)\le \sqrt{3}\sqrt{S}$$  $\implies$  $$\sqrt{3S} \ge 12+\frac{1}{a}+\frac{1}{b}+\frac{1}{c}$$  Now by $AM \ge HM $ inequality we have  $$\frac{a+b+c}{3} \ge \frac{3}{\frac{1}{a}+\frac{1}{b}+\frac{1}{c}}$$ $\implies$  $$\frac{1}{a}+\frac{1}{b}+\frac{1}{c} \ge \frac{3}{4}$$  hence  $$\sqrt{3S} \ge 12+\frac{3}{4}=\frac{51}{4}$$  hence  $$3S \ge \frac{2601}{16}$$  so $$S \ge \frac{867}{16}$$  is this approach correct and any better approach please share. This is inspired by some discussions in .  In the Harry Potter universe, how are Dementors born?  Or are they artificially created by some magical means? How do I store phone numbers in PostgreSQL?