I am new to programming and started with R since I need it in my Master's courses can someone help me understand the solution step by step.  awards &lt;- c("Won 1 Oscar.",   "Won 1 Oscar. Another 9 wins &amp; 24 nominations.",   "1 win and 2 nominations.",   "2 wins &amp; 3 nominations.",   "Nominated for 2 Golden Globes. 1 more win &amp; 2 nominations.",   "4 wins &amp; 1 nomination.")  sub(".*\\s([0-9]+)\\snomination.*$", "\\1", awards)   Solution: A vector of character strings containing:  Won 1 Oscar., 24, 2, 3, 2, 1
I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?
Why I think tension should be twice the force in a tug of war Build a basic Python iterator How would one create an iterative function (or iterator object) in python? How do i show that $w=z^2$ maps $|z-1|\leq 1$ onto the cardioid $R=2(1+\cos \theta)$? I installed vsFTPd for running an FTP server on  (Wheezy). I checked the vsFTPd version was 2.3.5, and I configured it like so:  listen=YES local_enable=YES write_enable=YES chroot_local_user=YES pasv_min_port=15000 pasv_max_port=15200 allow_writeable_chroot=YES   I followed these articles for solving this problem:       And many others on Google and forums, but my problem was not solved.  NOTE: I have solved this problem on  (Precise Pangolin), but that solution does not work on Debian 7.3.  I really mixed up on it?! How to open a web page from my application? Spinor dotted and undotted indices Clear item with custom name? I have multiple characters linked to a blender file, but i moved the original character files and now blender is sating they're missing.  Is it possible to get blender to find the missing blender files like it finds missing image files so that i can preserve the previously made animation?  On a side note is there a way to also view a list of all the missing files? The rules of Transfiguration: examples of making the inedible edible? Information from the official website of J.K.Rowling is generally considered canon. I remember at least one case when she 'changed her mind' after a particular rule has been  published on her website (what happens with a secret if a Secret Keeper dies). Nevertheless, the information from the website can generally be considered reliable.  A rather obscure piece of information is J.K.Rowling's Wizards' Ordinary Magic and Basic Aptitude Test () published on her website in 2007 and now accessible with a Time Turner.   In particular, we know that only one of the following options is correct (as the software allows you to choose only one option):     Which of the following is CORRECT?            a. Food can be conjured out of thin air.       b. Any object can be Transfigured into food.       c. Foodstuffs can be increased, Transfigured, summoned from a distance and magically cooked.       d. It is impossible to make the inedible, edible.   e. Food-related Charms are some of the simplest forms of magic.      W.O.M.B.A.T. Grade 3, 13 June 2007, question 8   The test appeared on J.K.Rowling's website before the release of Book 7, but we can almost safely assume that there was no time for J.K.Rowling to change her mind after compiling the test (though she must have submitted these questions weeks before they were eventually published).  As Hermione explained in Harry Potter and the Deathly Hallows:      Your mother can’t produce food out of thin air, no one can. Food is the first of the  to . It’s impossible to make good food out of nothing! You can Summon it if you know where it is, you can transform it, you can increase the quantity if you’ve already got some...   It means that the correct option is c, and therefore all other statements are false. So, apparently, you can make food out of something else, though not any object can be transfigured into food. Can you come up with any example of such transformation mentioned in the books? Java: Date from unix timestamp Convergence of $\sqrt{n}x_{n}$ where $x_{n+1} = \sin(x_{n})$ Consider the sequence defined as  $x_1 = 1$  $x_{n+1} = \sin x_n$  I think I was able to show that the sequence $\sqrt{n} x_{n}$ converges to $\sqrt{3}$ by a tedious elementary method which I wasn't too happy about.  (I think I did this by showing that $\sqrt{\frac{3}{n+1}} &lt; x_{n} &lt; \sqrt{\frac{3}{n}}$, don't remember exactly)  This looks like it should be a standard problem.   Does anyone know a simple (and preferably elementary) proof for the fact that the sequence $\sqrt{n}x_{n}$ converges to $\sqrt{3}$? In a map I'm making the player has to survive while locked in a maze. To stop them from breaking out, they will be in adventure mode. However, I still want them to be able to craft items and use them with specified blocks. I have tried several methods already but they all have a flaw.  One method is to have a scoreboard objective called item and giving certain item entities a specific score using something like:  /scoreboard players set @e[type=Item] item 1 {Item:{id:"minecraft:sapling"}}   Then it is possible to select these items with:  /entitydata @e[type=Item,score_item=1,score_item_min=1] {Item:{tag:{CanPlaceOn:["dirt"],HideFlags:24}}}   This works but it requires the item to be dropped, which isn't a problem for saplings, but for tools and other craftable items, it becomes a hassle.  To fix this, I'm currently clearing tools without damage and giving the player a slightly damaged tool in return:  /clear @a minecraft:stone_axe 0 1   /give @a minecraft:stone_axe 1 1 {CanDestroy:["log","log2","leaves","leaves2"],HideFlags:24}   This doesn't work for items without damage values (e.g. torches), but I don't mind these having to be dropped as there aren't too many of these. However, there is another problem. In the nether, the player will have access to an enchantment table and an anvil. This means they can repair enchanted tools, which will cause them to be cleared and replaced with unenchanted ones as soon as they go back to the overworld.  I also thought about using a stat.craftItem scoreboard objective and giving them the usable item if they craft it. However, this would result in the player having a duplicate of every item they crafted, as I think it is impossible to select an item without NBT-data in the /clear command.  Is there any way to make this work? And if not, would it be better to have the player drop all crafted items or have duplicates of them all? There is a problem with my logic and I cannot seem to point out where. There's a rocket ship travelling at close-to-c speed v without any acceleration (hypothetically), and there is an observer AA with a clock A on Earth, and there's another observer on the rocket BB with a clock B and these two clocks were initially in sync when the rocket was at rest with a FoR (frame of reference) attached to Earth. Now, this rocket's moving and AA tells us that B is running slower than A by a factor of$$ \gamma = 1 /(1-v^2/c^2)^{1/2} $$ $$ t_A/t_B = \gamma $$ where v is the relative 1d- velocity between the two i.e the earth and the rocket! That would mean the time elapsed on A is greater than that on B but this will happen only in the FoR of AA? So $t_B$ in this equation must be the time on B as observed by AA? Is this correct? What do the terms mean in the equations? If the symmetry holds and BB doesn't accelerate, then BB could say that $$ t_B/t_A = \gamma $$ right? where $t_B$ and $t_A$ are the times on B and A with respect to FoR of BB? But I was solving this problem and I took the earth FoR of A, but the prof took the rocket FoR of B? Like how will I know which FoR to solve the problem from? It'd greatly help if the terms in all the above equations were laid down neatly! DO we even need these FoRs?? Because in all the solved problems the prof is't specifying any and is using random ones! Please help!!!! This is the question where I messed up. The first rocket bound for Alpha Centauri leaves Earth at a velocity (3/5)c. To commemorate the ten year anniversary of the launch, the nations of Earth hold a grand celebration in which they shoot a powerful laser, shaped like a peace sign, toward the ship.  According to Earth clocks, how long after the launch (of the rocket) does the rocket crew first see the celebratory laser light?  This must be 25 years. My reasoning is: If v = 3c/5 10v + vt = ct where t is time taken by the light to reach the rocket from Earth as calculated from Earth.. and I solved that for t. and added 10 years to that because the time starts at the launch of the rocket!  According to clocks on the rocket, how long after the launch does the rocket crew first see the celebratory laser light?  This is 20 years. Here, I say: If it takes 25 years as observed by clocks on earth for the laser to reach the rocket, what should be the corresponding time as seen on a clock on the rocket? Using the formula: 25 = $\gamma$t where $\gamma$= 5/4 solved for t!  According to the rocket crew, how many years had elapsed on the rocket's clocks when the nations of Earth held the celebration? That is, based on the rocket crews' post-processing to determine when the events responsible for their observations took place, how many years have passed on the rocket's clocks when the nations of Earth hold the celebration?  For this, I did the following: 10 years on earth = T years on rocket ship where T must be lesser than 10 as observed from Earth FoR! Therefore, T= 4(10)/5 years = 8 years! But, prof says, 10 years on Earth = T years in rocket ship where T must be GREATER than 10 as observed from the rocket FoR??? Therefore, T = 10(5/4) years = 12.5 years!! What does this question actually want? Define a relation and find its equivalence classes. I am a new QGIS user and i have a challenge to convert legend from right to left reading in QGIS like ArcGIS. How can I restore configuration files? How can we run a command stored in a variable? Installing to SDCard by default I would like to know whether there is a way to tell Android to install applications on the micro SD card by default instead of having to download applications to internal memory first and then having to move them to the SD card manually.  Thanks Best way to merge mp4 files $p_1p_2...p_n +1$ is not square for $p_k = k$'th prime