Any idea how to redirect from old domain  to new one using htaccess:  domain.example/A/B/some-file-bb-cc  to  new-domain.example/A/B/some-file-bb-cc
I need to (permanent) redirect all of the following:   www.example.com www.example.com/folder sub.example.com sub.example.com/folder   Basically, all URLs that are reachable without being intended to: www.new-example.com, I want to do this within Apache and using the mod_rewrite module via the .htaccess file.
Rotating a table so that at least two name cards are correct Different font color for question status => closed <= When I stared at  () and I even thought [question refined] as offical status of the post.    &lt;somebody  it now, So, I've edited this question to get same effect>  How about official status [closed] as   different font color or  different font size or put the text [closed] outside the question link   Or   put a special tag as suggested in the    to clarify from those? I am currently using Ubuntu 12.04 because the latest upgrade 14.04 is not working in my system. I need to install the latest Adobe Flash Player 17 plugin, but it only allows me to install up to version 11.02, so media files cannot be opened. It says that Adobe Flash Player 17 is not compatible with my system. I'm curious why PCBs have one square pad in row for 0.1" headers. What is purpose of putting one square pad? What it indicates? Can you push more amps through square pad than round? Remove Reviewer and Steward badges Badges should encourage good behaviour. But what when a badge encourages more bad behaviour than good?  We hear it all the time - robo reviewers, badge-hunters. The review system fights with that users that only want badges and not want to help.  There are many suggestions how to find such robo-reviewers or how to make it difficult to robo-review. But why not cut them off at the source? Don't make them want to review for badges at all.  Remove the Reviewer and Steward badges! The Custodian Bronze badge should suffice to bring a user to the review system. And we really only want users doing reviews who want to help and not doing it for the badges. select all rows with a minimum value How to count the number of occurrences of an element in a List I have an ArrayList, a Collection class of Java, as follows:  ArrayList&lt;String&gt; animals = new ArrayList&lt;String&gt;(); animals.add("bat"); animals.add("owl"); animals.add("bat"); animals.add("bat");   As you can see, the animals ArrayList consists of 3 bat elements and one owl element. I was wondering if there is any API in the Collection framework that returns the number of bat occurrences or if there is another way to determine the number of occurrences.  I found that Google's Collection Multiset does have an API that returns the total number of occurrences of an element. But that is compatible only with JDK 1.5. Our product is currently in JDK 1.6, so I cannot use it. `test` and `[` - different binaries, any difference? I noticed while answering another question that test and [ are different binaries, but the [ manpage pulls up test's. Besides the requirement for an ending ], is there any difference?  If not, why are they separate binaries instead of being symlinked? (They are also bash builtins, and bash doesn't show a difference either.) What is the proper way to extend the Fibonacci numbers to negative numbers? I have a feeling this question is a duplicate, but it's not coming up in "Questions that may already have your answer."  We all know very well that $F(0) = 0$, $F(1) = 1$ and $F(n) = F(n - 2) + F(n - 1)$ for all $n &gt; 1$.  I'm wondering about $n &lt; 0$. My first thought was $F(-n) = -F(n)$, which is appealing from a multiplicative point of view, as it seems to preserve certain identities, like $F(n)^2 = F(n - 1) F(n + 1) - (-1)^n$.  But it doesn't quite make sense from an additive point of view, it doesn't seem to work both "forwards" and "backwards." For example, it would give us $F(-1) + F(0) = -1 \neq F(1)$.  How do we extend $F(n)$ to negative $n$ so as to maintain both the related identities and the basic defining identity? Are those stars moving past the window when the ship is at warp? When the enterprise (ENT) is moving at warp we see numerous stars flying past in the windows:    However, according to , at warp 5 (the maximum speed of the 1st enterprise) it would take 7.4 days to get from the Sun to Alpha Centari, our nearest star(s) approximately 4 light years away. So to have stars whizzing past every few seconds would imply that the stars are very close together.  Is this an inaccurate depiction of star movement at warp, or is there some explanation like the warp bubble creates a lensing effect?  Now I realise the classic answer is "suspend your disbelief, it's a tv show", but the animators have at least thought about the star movement as they have added in a bit of red shift and blue shift which you can see in the image. I am looking for a novel that I'd love to re-read it with my wife (my 13-year old self must be proud of me I guess). Key Plot points The plot was about humanity finding an alien station on an orbit of Earth. (I'm not sure if it wasn't Moon itself). On this station there were thousands of ships ready to travel so there rose a company that paid people to get on those ships and explore the galaxy. The problem was humans didn't understand how to steer those ships so they had to rely on preset targets. Of course there was no telling where particular ship was to go and fair amount of them never returned. Chronology and other relevant information I read it as an early teenager back in early 2000s. It was Polish translation of a foreign (possibly English) story. I think (not sure) that the book wasn't new at the time. It was just one of those books you dig out in a library and take to see if it's good. I don't recall cover either and even if I did it'd be of the Polish version. Additional information could be that the narration was led along the psychoanalytics of the main protagonists where he relives his memories from inside the station and his journeys. So I've been trying to figure out how to prove the following.     Let $(a_n)$ be a sequence of positive numbers such that $\sum\limits_{n=1}^\infty a_n =\infty$, and define $s_n=\sum\limits_{i=1}^n a_i$. Then $\sum\limits_{n=1}^\infty\frac{a_n}{s_n} =\infty$ as well.   I can prove it by comparing it to $\int_1^\infty \frac{1}{x} \, dx $ if the sequence $a_n$ is bounded by some $M$, but that's as far as I've been able to get. number of vertices in a self-complemntary graph Problem: Prove that the number of vertices of a self-complementary graph must be congruent to 0 or 1 modulo 4. I think my starting point would be that P4 and C5 are self-complementary and proceed by induction by adding P4s. I established the first step in a previous problem, but I need help on the induction step. i.e. proving that adjoining P4 will indeed yield a self-complementary graph. Same e-mail user, different address? I was wondering why using foo.bar@gmail.com works but not foo.bar@outlook.com.  In Gmail, foo.bar@gmail.com and foobar@gmail.com (and any combination of periods in the username) is equivalent.  Is this a hidden feature in Gmail? Adding meta values to permalink I have publications and I want to simply add year and month to the permalink. Currently the year and month of publication is added to the post as a meta value. I've set up publications as a custom post type and created taxonomy for the specific title of the publication. I would like the permalink to be:  publications/publication-title/year-published/month-published/name-of-post  I simply want to add the meta values for the publication year and month to the permalink.   So far, I've been able to pull the year and month published and add it to the url but unfortunately I keep getting a 404 when I try to access posts. I think I'm taking a wrong turn with one of my steps below ...  Any help would be appreciated.  These are the steps I did in the following order:   Since I was adding publication-year and publication-month to the url, I was reading that I had to make WordPress aware of these custom querystring variables. I added the following functions to register these custom variables:  function pubyear_register_rewrite_tag() {       add_rewrite_tag( '%pubyear%', '([0-9]{4})');   }    add_action( 'init', 'pubyear_register_rewrite_tag');  function pubmonth_register_rewrite_tag() {      add_rewrite_tag( '%pubmonth%', '([0-9]{2}');   }    add_action( 'init', 'pubmonth_register_rewrite_tag');    2) Added the year and month to the permalink structure:  add_filter('post_type_link', 'pub_term_permalink', 10, 4);  function pub_term_permalink($permalink, $post, $leavename, $sample) {     if ( false !== strpos( $permalink, '%publication-title%/%pubyear%/%pubmonth%' ) ) {       //get the publication-title      $publicationtype = get_the_terms( $post-&gt;ID, 'publication-type' );       //get the year of the publication      $pubyear = date('Y', get_post_meta($post-&gt;ID, 'pub_date', true));       //get the month of the publication      $pubmonth = date('m', get_post_meta($post-&gt;ID, 'pub_date', true));       $rewritecode = array(          '%publication-type%',          '%pubyear%',          '%pubmonth%',          $leavename? '' : '%postname%',      );       $rewritereplace = array(          array_pop($publicationtype)-&gt;slug,          $pubyear,          $pubmonth,          $post-&gt;post_name      );       $permalink = str_replace($rewritecode, $rewritereplace, $permalink);       }     return $permalink; }   3) Add rewrite rules:  function pub_add_rewrite_rules() {       add_rewrite_rule(  '^([^/]*)/([0-9]{4})/([0-9]{2})/([^/]+)?', 'publications/index.php?pagename=$matches[3]', 'top' );   }    add_action( 'init', 'pub_add_rewrite_rules' );   4) Made sure the custom post type is registered and includes this rewrite array:  'rewrite' =&gt; array     (             'slug' =&gt; 'publications/%publication-type%/%pubyear%/%pubmonth%',     'with_front' =&gt; false          ), Best approach to Windows Forms rolling log output in TextBox Show sub reasons in close review queue Currently close vote review queue shows the top level close reason in the header, but some close reasons, for instance, off topic have very different sub reasons. For instance, "demonstrate minimal understanding" is different from "This question belongs on a different site in the stack exchange network".  It would be nice if sub close reasons were also shown. Kill the [bugs] tag? First of all, I swear this is not homework, it's a question I was asked in an interview. I think I made a mess of it (though I did realise the solution requires recursion). Here is the question:  Implement the count() method which returns the number of nodes in a tree. If a node doesn't have either a left or right child, the relevant getXXChild() method will return null  class Tree {    Tree getRightChild() {     // Assume this is already implemented   }    Tree getLeftChild() {     // Assume this is already implemented   }    int count() {     // Implement me   } }   My reason for asking the question is simply curious to see the correct solution, and thereby measure how bad mine was.  Cheers, Tony Let $G$ be a matrix Lie group and let $H$ be a Lie subgroup of $G$. My understanding is that all $g \in G$ are matrices, since $G$ is a subgroup of the general linear group. Then aren’t all elements $h \in H$ matrices, since $h \in G$?  From what I can gather $H$ is a matrix Lie group if $H$ is a closed subset of $G$. But if $H$ is not a closed subset of $G$, why is it not a matrix Lie group? Is the reasoning in the first paragraph wrong?