I can replace a string by a string using sed, but how can I replace a string with a number? My code is:  while read x  do echo $x  sed 's/xx/$x/g' xy.in &gt; x1 cat &gt; x1 &gt;&gt; x2.dat done &lt; xyz.dat   I want to replace string xx in xy.in with the number that I read from file xyz.dat. But Instead of the number, I am getting blank spaces in x2.dat.
I tried the following code to replace QQ with ZZ, but it doesn't do what I want:  var1=QQ sed -i 's/$var1/ZZ/g' $file   However, this code does what I want:  sed -i 's/QQ/ZZ/g' $file   How do I use variables in sed?
Why is Apache executing .php.html files as PHP? I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains &lt;?xml...&gt; tags at the beginning of file. The problem is, Apache has somehow decided to run it through the PHP interpreter, even though ".php" appears in the middle of the filename, and not at the end. This, in turn, triggers a PHP error, because it sees "&lt;?" as the command to start executing PHP code, and immediately gets confused by the "xml..." which follows it.  How do I configure Apache to ONLY execute .php files and not .php.html files? The string "php.html" does not appear explicitly anywhere in my Apache config files. There is a line "AddHandler php5-script .php", but I don't see how that would also include ".php.html" files. Using subcaption package but subfigures end up stacked rather than side by side Linux genisoimage Batch No Wifi, HP Pavillion 15 Ubuntu 14.04 How does RNA transcription determine which half of the DNA to use? I feel that I might have a complete misunderstanding here. If DNA has two strands, how does the machinery of RNA transcription determine which one to transcribe? Pagination broken when merging search results with additional WP_Query On the search results page (search.php) I would like to perform an additional WP_Query to keep a specific order of search result types e.g. search results from authors should always be shown before the other results -  The first few pages should hold the author results, the other results should be shown on all the following pages only (not mixed on each page).  global $wp_query; //holds the results of the initial search query  $authorposts = $wp_query-&gt;posts;     $query = new WP_Query( 'year=2012&amp;monthnum=12&amp;day=12' ); $otherposts = $query-&gt;posts;  $wp_query-&gt;posts = array_merge( $authorposts, $otherposts  ); $wp_query-&gt;post_count = count( $wp_query-&gt;posts );  if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;   //show results loop...   The problems appear with the behaviour of pagination - while the $authorposts seem to paginate correctly i.e. correct page numbers for author posts and pagination works as only those where existent. But the $otherposts on the other hand are shown at the bottom of each page, right under the author posts. And they are the same on every page! Also the page count reflects the count of the first query only.  I have also tried to merge with the plus operator:  $wp_query-&gt;posts = $authorposts + $otherposts;   but in this scenario the $otherposts don't show up at all and the page count stays the same (page count for author posts).  All the examples with similar goals using two separate queries I've seen looked quite the same -  So I'm wondering if the my way of extending the original search query results with that additional WP_Query is sufficient or if I'm missing some $wp_query fields to be populated (correctly)? What's the correct way doing this?  Update: It should be noted that I'm using the WP-PageNavi plugin to paginate but this should not be relevant in the first place as the first page is already rendered wrong. And it's also initialized with the query object: wp_pagenavi( array( 'query' =&gt; $wp_query )); How to combine complex powers? Linear functional on a Banach space is discontinuous then its nullspace is dense. Straighten Vertices Along a Line On a line, I need to line up the bottom vertex points in relation to a top reference vertex point. How could I reset the X Y and Z coordinates of these vertex points to essentially line them up all through use of the vector of the reference point vertex.  I do not have access to Mesh -> Transform -> Scale on Axis for aligning vertices along a line. How do I enforce a password complexity policy? I quite often add a question as a favourite when there is something of interest to me in it or its answers. Looking back through my favourites, I cannot remember why I added some of them as a favourite.  What I'd like to be able to do is to add a note/comment when I add a favourite as a reminder as to why I've added it. This will show on my favourites page, but nowhere else - and possibly to no one else.  In addition, it would be good to be able to favourite an answer to a question, thereby adding a favourite to both the question and a particular answer with something of note in it. This would only show as a single favourite, but when clicking its link would go to the favourited answer.  Possible? Or is there another way of doing this? I've already got too many favourites to remember why I added a lot of them. Too many requests? I went to stackexchange.com and clicked on SO.  After a few minutes I got a message saying "We have detected too many requests from this IP.  If this is an error contact us."  That was the second SE page I tried to visit.  Second only to SE.com  I moved to another machine and it's working now.  The first machine usually works, I don't know if a got assigned a blacklisted IP or what.  Anyone know what's going on?  EDIT: I would really rather not post my IP on the web, but if a diamond or dev asks I'll email it.  EDIT 2: I looked at badp's dupe suggestion and can verify that I have no scripts frequently calling SO. Do the search engines take the number of 404 errors returned by a site into account when calculating the site rank? For example I have 8,000 404 errors and I am thinking that that's affecting my SEO in a negative way.  However, I read  about 404 errors which suggests that they are not always a negative quality indicator.   So I am confused...are high numbers of 404 errors harmful to a site or not? For which values does the Matrix system have a unique solution, infinitely many solutions and no solution? Given the system:  $$\begin{align}  &amp; x+3y-3z=4 \\   &amp; y+2z=a \\  &amp; 2x+5y+(a^2-9)z=9 \end{align}$$  For which values of a (if any) does the system have a unique solution, infinitely many solutions, and no solution?    So I am getting that it has: infinitely many solutions at: (-1)    No solution at (1)    Unique solution at (-1,1)    AM I RIGHT?? Next badge select dialog broken The "Select your next badge" dialog box is not displaying correctly. It looks like this:    Freehand circles, as requested:    It seems to be an issue with box-sizing, because when it's content-box, it looks fine. I think the width and height rules for .popup-badges .all-badge-progress .badge-progress should be increased a little, for example:  .popup-badges .all-badge-progress .badge-progress {   width: 214px;   height: 96px; }   Tested on the latest Chrome and Firefox on Linux Mint. Have iOS apps. Can I use them on my Mac Mini? I bought many iOS Apps on various iPads and iPod touchs. This Wednesday I will have my first Mac, a Mac Mini, so my question is: Will I be able to download these Apps without any charge, if they are available on Mac Store?  I ask this because I have been watching some videos and have seen GarageBand on the Mac but I don't know if it's the same App. I know that the App Store and Mac Store are different, but, like some Apps on AppStore have a plus symbol on their icons corners saying these Apps can be run on iPad, iPod touch and iPhone I wonder whether there will be some Apps for both iOS and the Mac.  Also, I don't know if GarageBand was released on Mac before iOS devices. Other types of vector multiplication. As far as I've seen, there are only two types of vector multiplication defined, dot product/inner product which is defined in a vector space of any dimension, even infinite, and cross product, which is only defined in three dimensions. Are there more definitions of vector products? With the announcement of the detection of gravitational waves, questions about the implications proliferate.  Some relate to the possible existence of gravitons.  The analogous relationship between gravitons/gravitational waves and photons/electromagnetic waves is frequently mentioned.  The detection of individual photons required experiments of very low intensity light, yet their existence was inferred (prior to their actual detection) by Planck and Einstein (among others) using the properties of experimental black body radiation and the photo-electric effect.  If the prospects for detection of gravitons requires similar study of very low intensity gravitational waves, then those prospects are very dim indeed. My question: are there similar indirect "experimental" methods for inferring the existence of gravitons? Auto Increment Problem in Mysql If we multiply 2 number and take the mod with prime this is equivalent to first taking mod with the prime of individual number and then multiplying the result and again taking mod.  $$ ab\bmod p = ((a\bmod p)(b\bmod p))\bmod p$$  does there exist any proof for this?  Does it work for composite moduli too? Then I can use the Chinese remainder Theorem to calculate the result does there any other way apart from Chinese remainder Theorem to solve the problem?