passing php variable to javascript I.ve this thing in php  $v = "test";   How do i pass this to javascript  I did like this    &lt;script&gt;   var t = &lt;?php echo $v; ?&gt;  &lt;/script&gt;   I'm passing that t to URL  But ii says undefined
Pass a PHP string to a JavaScript variable (and escape newlines) What is the easiest way to encode a PHP string for output to a JavaScript variable?  I have a PHP string which includes quotes and newlines.  I need the contents of this string to be put into a JavaScript variable.  Normally, I would just construct my JavaScript in a PHP file, à la:  &lt;script&gt;   var myvar = "&lt;?php echo $myVarValue;?&gt;"; &lt;/script&gt;   However, this doesn't work when $myVarValue contains quotes or newlines.
I know $[0,1]$ denotes the interval between 0 and 1 with the boundary. And $(0,1)$ denotes the interval between 0 and 1 without the boundary. Today, I encounter some expressions as $]0,1]$, $]-\infty,+\infty]$. What does $]0,1]$ mean? Thanks. Compare nullable types in Linq to Sql I have a Category entity which has a Nullable ParentId field. When the method below is executing and the categoryId is null, the result seems null however there are categories which has null ParentId value.  What is the problem in here, what am I missing?  public IEnumerable&lt;ICategory&gt; GetSubCategories(long? categoryId) {     var subCategories = this.Repository.Categories.Where(c =&gt; c.ParentId == categoryId)         .ToList().Cast&lt;ICategory&gt;();      return subCategories; }   By the way, when I change the condition to (c.ParentId == null),  result seems normal. Complex integral over a circle In an exercise, I'm supposed to assume that $|a| &lt; r &lt; |b|$ and prove that $\displaystyle\int_{\gamma} \frac{1}{(z - a)(z - b)} dz = \frac{2 \pi i}{a - b}$, where $\gamma$ is a circle of radius $r$ centered at the origin with positive orientation. So I had the idea to express this integral as $\frac{1}{a - b} \displaystyle\int_{\gamma} \frac{1}{z - a} - \frac{1}{z - b} dz$. Then I tried to evaluate each of these separately, but I don't really know what to do. I get $\displaystyle\int_{0}^{2 \pi} \frac{i r e^{it}}{r e^{it} - a} dt$ for the first term. How am I supposed to integrate this? I can't substitute $u = re^{it}$, can I? I need an appearing effect for text like the one (in javascript) here .  However I don't know how to insert js code into LaTeX (apart from using the AcroTeX Bundle) and that would also force me to use Acrobat Reader, so I'd like to implement a similar effect in Beamer. Is it possible?  (of course I would love to see alternative approaches to this) Is there a subtle difference between "somebody" and "someone", "anybody" and "anyone"? Twisted serialport dataReceived() provides fragmented data Probability mean is less than 5 given that poisson distribution states it is 6 Necessary condition for square integrable functions? I'm studying Quantum Mechanics and I came across this which I don't quite understand: For a vector space of functions $f(x)$ to be square integrable (i.e $\int{|f(x)|^2dx &lt; \infty)}$, the necessary condition is $\lim_{|x| \to \infty}f(x) \to 0$. Can someone help me understand why that must be the case? I sort of understand that it must not blow up at the infinities but can a (continuous or piece-wise continuous) function have a non-zero finite value at the infinities and still be square integrable? Prove $(1-a)(1-b)(1-c)(1-d)&gt;1-a-b-c-d$ and $ a,b,c,d$ are real and between 0 and 1.    I can do this with $$(1-a)(1-b)&gt;1-a-b  \\ 1-a-b+ab&gt;1-a-b  \\ ab&gt;0  $$  But with $c$ and $d$, this becomes much more difficult. Can someone nudge me in the right direction? Windows 7 shows red "X" on network icon, but I'm connected Embed .mov file via 'Add Media' not working I know since WP 3.6 we've been able to upload and embed various file formats and that the 'Add Media' button effectively implements the correct media embed shortcode for us.  I'm having a problem in WP4.0 using 'Add Media' to embed quicktime (.mov) files. The embed works fine for the other supported video MIME types but I'm not offered 'Embed Media Player' when I try adding a .mov file to a post.  See screen grabs/explanation:   See how .mov embed has reverted to a simple hyperlink (recorders) at   Does anyone have any suggestions as to why this is, or to a possible fix so I can embed .mov as easily as .mp4 - seems to be the preferred format of the client. For the moment we're having to manually add the [video] shortcode ourselves in the text editor.  How do I check that embed is supported/enabled for .mov? Edit - Original Title: Is there an alternative way to achieve border-collapse:collapse in CSS (in order to have a collapsed, rounded corner table)?  Since it turns out that simply getting the table's borders to collapse does not solve the root problem, I have updated the title to better reflect the discussion.  I am trying to make a table with rounded corners using the CSS3 border-radius property. The table styles I'm using look something like this:  table {     -moz-border-radius:10px;     -webkit-border-radius:10px;     border-radius:10px }   Here's the problem. I also want to set the border-collapse:collapse property, and when that is set border-radius no longer works. Is there a CSS-based way I can get the same effect as border-collapse:collapse without actually using it?  Edits:  I've made a simple page to demonstrate the problem  (Firefox/Safari only).  It seems that a large part of the problem is that setting the table to have rounded corners does not affect the corners of the corner td elements. If the table was all one color, this wouldn't be a problem since I could just make the top and bottom td corners rounded for the first and last row respectively. However, I am using different background colors for the table to differentiate the headings and for striping, so the inner td elements would show their rounded corners as well.  Summary of proposed solutions:  Surrounding the table with another element with round corners doesn't work because the table's square corners "bleed through."  Specifying border width to 0 doesn't collapse the table.  Bottom td corners still square after setting cellspacing to zero.  Using JavaScript instead- works by avoiding the problem.  Possible solutions:  The tables are generated in PHP, so I could just apply a different class to each of the outer th/tds and style each corner separately. I'd rather not do this, since it's not very elegant and a bit of a pain to apply to multiple tables, so please keep suggestions coming.  Possible solution 2 is to use JavaScript (jQuery, specifically) to style the corners. This solution also works, but still not quite what I'm looking for (I know I'm picky). I have two reservations:    this is a very lightweight site, and I'd like to keep JavaScript to the barest minimum  part of the appeal that using border-radius has for me is graceful degradation and progressive enhancement. By using border-radius for all rounded corners, I hope to have a consistently rounded site in CSS3-capable browsers and a consistently square site in others (I'm looking at you, IE).   I know that trying to do this with CSS3 today may seem needless, but I have my reasons. I would also like to point out that this problem is a result of the w3c specification, not poor CSS3 support, so any solution will still be relevant and useful when CSS3 has more widespread support. Holmby Hall is a landmark site in Los Angeles. The Wikipedia page doesn't use "the" before Holmby Hall, but has used the before The Fox Theatre. Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is &lt;= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)? Enlarge a partition without losing data with Windows 7 diskmgmt? I have a 320GB hard drive currently partitioned as below:     A long time ago, a computer expert formatted my hard drive like this because I wanted to install Ubuntu. I'm now ready to do this, but I'll never need so much free space (103.09GB). I want to enlarge the D:\ volume because it already has lots of data on it.  I know that when I open diskmgmt.msc, I could possibly enlarge the D:\ volume using some free space from the unformatted 103.09GB volume, because the program offers me the option to enlarge. However I'm afraid that I might lose data doing this.  Is it possible to enlarge the partition with this Windows 7 tool or am I better using GParted via "Try Ubuntu" on my Live CD? Would either of them cause data loss in this scenario? Decode JWT Token in Apex Identify geographic location to points I am quite new in QGIS and I really need your help.  I have a map of Kenya divided into 68 districts and I have coordinates of 30.000 schools. The points have one variable besides the latitude and longitude data called "distance to nearest school".   First I imported the map. Then I imported the spreedsheet and transformed it to a SHP file like the map. So now I have two SHP files.    The points have three variables: "Latitude", "Longitude" and "Distance to nearest school". I want to have a fourth variable called "District" and take the mean of the "Distance to nearest school" for each district. Is the latest version of Ubuntu 100% FREE Why does Python code use len() function instead of a length method? I know that python has a len() function that is used to determine the size of a string, but I was wondering why it's not a method of the string object.  Update  Ok, I realized I was embarrassingly mistaken. __len__() is actually a method of a string object. It just seems weird to see object oriented code in Python using the len function on string objects. Furthermore, it's also weird to see __len__ as the name instead of just len. Which is correct: I'll be moving next month or I'll be shifting next month?