template&lt;typename T&gt; void Merge_Sort(vector&lt;T&gt;::iterator begin, vector&lt;T&gt;::iterator end) {  size_t length = end - begin; if (1 &gt;= length) return;  size_t mid = length/2;  Merge_Sort(begin, begin + mid); Merge_Sort(begin + mid, end); inplace_merge(begin, begin + mid, end); }   I am trying to template-ize the function but getting the error that I am missing the typename prior to vector::iterator. Could anybody have an idea about making this function template?  To sum, I am trying to make iterator parameter as template.
In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template &lt;typename T, typename Tail&gt; // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template&lt;typename U&gt; struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion&lt;U&gt; dummy;      };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; }; template &lt;typename T&gt; // For the last node Tn. struct UnionNode&lt;T, void&gt; {     // ...     template&lt;typename U&gt; struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; };   The problem I have is in the typedef Tail::inUnion&lt;U&gt; dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion&lt;U&gt; names a type and not a function?
Strange character when using listings package I'm seeing an odd character like a very flat U, where there should be a space, with the listings package. See example below. Does anyone have any idea why this is happening, or how to get rid or work around it?  \documentclass{standalone} \usepackage{underscore} \usepackage{listings} \usepackage[usenames,dvipsnames, rgb, svgnames, x11names]{xcolor} % Text layout \topmargin 0.0cm \oddsidemargin 0.5cm \evensidemargin 0.5cm \textwidth 16cm \textheight 21cm  \lstnewenvironment{cmd}[1][]{%   \lstset{language=sh, backgroundcolor=\color{LightSteelBlue1}, #1}} {}  \begin{document} \begin{cmd}[caption=Configuration file section including filters] [affy6] [...]     [[hapmap]]     phenofiles = "data/Hapmap6.0/Pheno/hapmappheno_909.csv",     genofile = "/data/snppy/Hapmap6.0/Geno/birdseed-v2.calls.txt"     anno_filter = "chromosome = 5"     idlink_filter = "studyid = 'CEU'"     some_other_stuff = "foo = bar" \end{cmd} \end{document} Short story where the Earth has been kept inside a force field for millennia Working in a group blender project Me and my team are new to blender, we are now planning for a small project. What I want to ask here are some questions regarding the team work:   We use git for version control in web projects, Is there any special version control for blender project. Creating object of each file and integrating in the project is one way we saw to complete the project. But is there any good way to work in the group?   Please tell us from your experience what might be the best way to work together in a group blender project. When starring a message from the star board, it's not reflected in the main chat window If you click to star a post on the side (in the starred list), it changes color but not the star by the main chat area (it does add one to the number, but it doesn't change the color). Then when you click the star on the main chat area, it changes color to yellow but lowers the number by one  After clicking in sidebar:     After clicking in the main chat: Multiplication in Permutation Groups Written in Cyclic Notation I didn't find any good explanation how to perform multiplication on permutation group written in cyclic notation. For example, if $$   a=(1\,3\,5\,2),\quad b=(2\,5\,6),\quad c=(1\,6\,3\,4), $$  then why does $ab=(1\,3\,5\,6)$ and $ac=(1\,6\,5\,2)(3\,4)$? Sum of First $n$ Squares Equals $\frac{n(n+1)(2n+1)}{6}$ siunitx tabular numbers with separated uncertainty I would like to format the space reserved for a number shown in a table with separated uncertainty. It seems that when I use the table-format option the brackets around the mantissa disappear. This is illustrated in the example below:  \documentclass{article}     \usepackage{siunitx}  \begin{document}     \begin{table}   \begin{tabular}{                   S[separate-uncertainty = true]                   S[table-format=1.1(1)e1,                   separate-uncertainty = true]                   }     {Header} &amp; {Header}\\     1.0(2)e2 &amp; 1.0(2)e2\\   \end{tabular} \end{table}     \end{document}     I have also tried to use the bracket-numbers and multi-part-units = brackets without solving this issue. Is there any workaround to center the number and keep the brackets like in the first column of the example? Can I use the valid Schengen visa in old passport? Find $a$ such that $(x+a)(x+1991)+1=(x+b)(x+c)$ with $a,b,c\in\Bbb Z$ Find all integer values of $a$ such that the quadratic expression $(x+a)(x+1991)+1$ can be factored as a product $(x+b)(x+c)$ where b and c are integers.   I tried to do it by comparing the two expressions but I can't proceed. Solution of equation $\frac{x\cdot 2014^{\frac{1}{x}}+\frac{1}{x}\cdot 2014^x}{2} = 2014$ Solution of equation $\displaystyle \frac{x\cdot 2014^{\frac{1}{x}}+\frac{1}{x}\cdot 2014^x}{2} = 2014$   $\bf{My\; Try::}$ Clearly Here $x&gt;0$, Now Using $\bf{A.M\geq G.M}$  So Here $\displaystyle x\cdot 2014^{\frac{1}{x}}&gt;0$ and $\displaystyle \frac{1}{x}\cdot 2014^x&gt;0$ .  So $\displaystyle \left(\frac{x\cdot 2014^{\frac{1}{x}}+\frac{1}{x}\cdot 2014^x}{2}\right)\geq \left(x\cdot 2014^{\frac{1}{x}}\cdot \frac{1}{x}\cdot 2014^x\right)^{\frac{1}{2}} = \sqrt{2014^{\left(x+\frac{1}{x}\right)}} = 2014$   And equality Hold , When $\displaystyle x = \frac{1}{x}\Rightarrow x= 1$  Can we solve it  without Using $\bf{A.M\geq G.M}$  If Yes, Then please explain me.  Thanks Getting nauseated from air travel, but it's not motion sickness... what to do? Can I use Siri with these apps? Could YouTube, Todoist, myEmail (fill in name app your looking for) be controlled/used with Siri?  Could a third party iOS app be controlled by Siri? I've got two arrays of the same size.  I'd like to merge the two so the values of one are the key indexes of the new array, and the values of the new array are the values of the other.  Right now I'm just looping through the arrays and creating the new array manually, but I have a feeling there is a much more elegant way to go about this.  I don't see any array functions for this purpose, but maybe I missed something?  Is there a simple way to this along these lines?  $mapped_array = mapkeys($array_with_keys, $array_with_values); How to get domain name from URL Recent feature changes to Stack Exchange This is an unofficial list/changelog of new features and various changes to Stack Overflow and the Stack Exchange network.  It is maintained by the community, while a Stack Exchange employee changes the accepted answer to ensure that the latest changes remain on top (given default user settings).  To see the list in reverse chronological order (latest entry on top), .  For those adding new features here: please post only feature changes that affect the whole network and have some global impact. i.e. bug fixes don't belong here, nor do mobile app updates. iPhone 5S, LTE does not work Using getopts to process long and short command line options I wish to have long and short forms of command line options invoked using my shell script.  I know that getopts can be used, but like in Perl, I have not been able to do the same with shell.  Any ideas on how this can be done, so that I can use options like:  ./shell.sh --copyfile abc.pl /tmp/ ./shell.sh -c abc.pl /tmp/   In the above, both the commands mean the same thing to my shell, but using getopts, I have not been able to implement these? Is there any way to get real-time compilation for LaTeX? I would really love to have a software or tool which provided real time compilation of my LaTeX document (to be able to see the final pdf or dvi document as I type the latex code), especially for when I am drawing pictures using tikZ. So far, I know of two things, but none of them work for me. They are:   : This is only for tikZ, which would be perfect for me, but unfortunately as far as I know it only works with Ubuntu and Debian, and I use Mac OS X (so I have never actually tried it, though I did dig a lot to see whether I would be able to install on my mac and from what I see it is really what I want - I am even considering installing Ubuntu just to use it!). : This is a minor mode for Emacs. It was extremely hard to get it to work on the mac (see my quest ), and it is not all that fast. The speed is not all that big of a deal for me, but the fact that it does not work with tikZ pictures is (the nodes all collapse in one point so that the words are all one on the top of the other).   So my question is: is there a software ideally like KtikZ or another type of editor which provides real-time compilation and that I can use on my mac? I guess if you know of a Windows/Linux option I would also like to know, and the same for a way to set up a script to get the document compiled every 5 seconds or so (I am sure I have seen this written somewhere, but I don't know whether I can do it with a mac or whether it is editor/pdf viewer dependent), but what I really want is a software/tool which would work with a mac.  To be clear, I am not after something like LyX, that is, I am not after a WYSIWYG-type thing, but rather something where I can type real LaTeX and see my code, but have at the same time another window showing me the pdf (or dvi) file compiled. Submitting a form by pressing enter without a submit button Well I am trying to submit a form by pressing enter but not displaying a submit button. I don't want to get into JavaScript if possible since I want everything to work on all browsers (the only JS way I know is with events).  Right now the form looks like this:  &lt;form name="loginBox" target="#here" method="post"&gt;     &lt;input name="username" type="text" /&gt;&lt;br /&gt;     &lt;input name="password" type="password" /&gt;     &lt;input type="submit" style="height: 0px; width: 0px; border: none; padding: 0px;" hidefocus="true" /&gt; &lt;/form&gt;   Which works pretty well. The submit button works when the user presses enter, and the button doesn't show in Firefox, IE, Safari, Opera and Chrome. However, I still don't like the solution since it is hard to know whether it will work on all platforms with all browsers.  Can anyone suggest a better method? Or is this about as good as it gets? Calculating distance of sites to riverways using ArcGIS Desktop? How do you calculate the distance of about 10 sites scattered across a region to bodies of water (rivers and lakes) using ArcGIS 10.1?  I have the lat/lon coordinates of the 10 sites as a point feature class and I have downloaded the Surface Water Area (polygon shapefile) for the study  area from the UK Ordnance Survey webpage.  I want to determine the easiest route-ways that are available in the study area by taking into account slope and proximity to rivers. I understand that I can achieve this by running a cost path analysis if I have a dem raster, slope raster and distance rasters to rivers and valley floors. But I am not sure how to create distance rasters to rivers and valley floors using Spatial analyst tools.