How can I test whether a string only contains characters in a given set?
Validate that string contains only allowed characters in Ruby
Split string into sentences using regex PHP Session data not being saved I have one of those "I swear I didn't touch the server" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages or page refreshes. I know a new session is being created correctly because I can set a session variable (e.g. $_SESSION['foo'] = "foo" and print it back out on the same page just fine. But when I try to use that same variable on another page it is not set! Is there any php functions or information I can use on my hosts server to see what is going on?  Here is an example script that does not work on my hosts' server as of right now:  &lt;?php session_start(); if(isset($_SESSION['views']))     $_SESSION['views'] = $_SESSION['views']+ 1; else     $_SESSION['views'] = 1;  echo "views = ". $_SESSION['views']; echo '&lt;p&gt;&lt;a href="page1.php"&gt;Refresh&lt;/a&gt;&lt;/p&gt;'; ?&gt;   The 'views' variable never gets incremented after doing a page refresh. I'm thinking this is a  problem on their side, but I wanted to make sure I'm not a complete idiot first.  Here is the phpinfo() for my hosts' server (PHP Version 4.4.7): equivalent date from GNU to solaris Compound possessives and yours How do I determine the size of my array in C?   That is, the number of elements the array can hold? In the Harry Potter universe, wizards and witches have managed to keep Muggles unaware of their existence, across the planet and over many centuries. Up to the timeframe that the novels take place in (the 1990s), I can see how this can be achieved through a combination of discretion and magic, with discretion being the preferred method on occasion (e.g., you don't need magic to slip into Platform 9 3/4 unnoticed, you just need to check that nobody is looking).   Our current world of 2016, however, its a very different place. The UK is (in)famously heavily camera-monitored (). Even more poignantly, a very large (and growing) segment of the population carries an internet-enabled HD camera with them at all times and are willing to use it at a moment's notice (, but it is comedy in part because a more realistic version could happen). It looks like, the moment something magical happens in public, a video of it would be on Youtube/Facebook/Twitter and within minutes.   How does the Ministry of Magic deal with this development? Do they need to create a dedicated corps to monitor social media services and alter records as necessary? $3^{n+1}$ divides $2^{3^n}+1$ Describe all positive integers,n such that $3^{n+1}$divides $2^{3^n}+1$. I am little confused about what the question asks-if it asks me to find all such positive integers, or if it asks me to prove that for every positive integer n,$3^{n+1}$ divides $2^{3^n}+1$. Kindly clarify this doubt and if it's the former part, please verify my solution-n=1. I don't know if it's the right place to ask but can somebody advise me for buying a ram memory for my computer.  I have a Dell Vostro 200 with 1GB of RAM and 667MHz. (2 x 512MB)  I want to buy raise the amount of RAM but I'm confused whether to buy 1 x 2GB or 2 x 1GB  I know it's the same for the available amount of memory but is ther a difference maybe in the clock speed so that 2 x 667MHz will be better than 1 x 667MHz. or maybe accessing one single memory slot will be faster and better than accessing two slots.  Please anyone helps. You can also contact me to customize your template, or create a new unique one.   Do I need to put a comma between the new and unique adjectives in this sentence?  In my native language (if I am not mistaken) we don't put a comma if the adjectives are of a different type. Not sure about English though, and if it's the case here anyway. Any help would be appreciated! Why should I put a ~ before \ref or \cite? My question is in the title of this post, but extends to other referencing commands like \eqref, \citep, \citet (and the like) as well. If the Universe is expanding, how is that galaxies run into each other? As the title says. If everything is moving outward, thrown by the Big Bang, how could two Galaxies end up with velocity vectors that run them into each other? What's the application extension? (aka .exe, .app, etc.) I'm new to Ubuntu. What's the application extension for development reasons? I know Windows is mainly .exe and Mac is .dmg or .app. Does Linux have an unique one? While there be any issue applying for a new passport before stamping? Is the topological product $\Pi \{G_\alpha: \alpha < \kappa\} $ a topological group? Expected Value of Normal CDF I am trying to calculate the expected value of a Normal CDF, but I have gotten stuck. I want to find the expected value of $\Phi( \frac{a-bX}{c} )$ where $X$ is distributed as $\mathcal{N}(0,1)$ and $\Phi$ is the standard normal CDF.  I know I can transform $\frac{a-bX}{c}$ to be a normal random variable $\mathcal{N}\left(\frac{a}{c},\frac{b^2}{c^2}\right)$ where $\frac{b^2}{c^2}$ is the variance of the normal random variable. I'm not sure if this helps though.  I think that the expected value of a CDF is $0.5$ but since $\Phi$ is the CDF of a standard normal CDF and $\frac{a-bX}{c}$ is not standard normal I do not think the expected value should be 0.5. I tried integrating the CDF, but I do not believe I did it correctly.  When $a = -2.3338$, $b = 0.32164$, $c = 0.94686$, I believe the correct answer is approximately $0.009803$. I found this through simulation.  I would appreciate any help or suggestions. How to pass an argument to event handler in tkinter? Alien invasion movie, giant robot aliens with long legs capturing people So I saw this movie about 10 years ago, when I was about 5 years old. Since I was really young, my memory of it isn't really that great.   I think it may have been an alien invasion movie, but the only scene I remember is that there were these giant robot-alien things:   I think they had several long legs. They had a big glass dome on top of them They would grab civilians and drop them in their glass dome.   That's all I remember. If you could please help me out, that would be great.   Again, I was about 5 years old when I watched it, so my memory of it isn't that great, but I hope you know what I'm talking about. Thanks so much :) Do I need a bus/train/plane ticket out of Thailand in order to get a Visa-on-Arrival? How does long to int cast work in Java? halt, poweroff, shutdown, reboot don't require root? For some reason, I can run halt, poweroff, shutdown, and reboot as a regular user without root. How can I fix this? Is it something to do with user groups, or is it a seting somewhere?