I recently learned about the concept of parameter sniffing and I am having a confusion about a specific scenario where I am not able to understand the behavior of SQL Server. Anybody who can help me to understand will be great:  SCENARIO:  For instance we have a below stored procedure:  create procedure GetEmployeeDetails  @a int as  BEGIN     IF @a = 1     BEGIN     select * from HumanResources.employee where BusinessEntityID = @a     END     IF @a = 2     BEGIN     select * from HumanResources.employee     END END   And when I execute a stored procedure like below, will parameter sniffing should happen? I already tried it is not happening but I am amazed that why it is not happening. should the exact code be running for different parameters for parameter sniffing to happen? Is it a pre-requisite?  DBCC FREEPROCCACHE; exec GetEmployeeDetails @a = 1 exec GetEmployeeDetails @a = 2   Any inputs are appreciated. Thanks.
SQL Server 2012 and 2016 Standard:  If I put if-else logic in a stored procedure to execute one of two branches of code, depending on the value of a parameter, does the engine cache the latest version?  And if on the following execution, the value of the parameter changes, will it re-compile and re-cache the stored procedure, since a different branch of the code must be executed? (This query is quite expensive to compile.)
Unable to preserve ownership in a copy but able with a move? Changes to "close as duplicate" (part deux) How do I fix this "E: Type '*' is not known on line * in source list ..." update error? Every once in a while I see users having issues to update due to errors like this:  E:Type 'ain' is not known on line 1 in source list /etc/apt/sources.list.d/some-ppa.list'   with varying types/line numbers/source list files (often after removing a PPA).  How can such an error be fixed? What is the function of this circuit? Just wondering if someone can give me an explanation for this capacitor layout - what is it's function? The chip to the right is an ADC.  Circled in blue.    I'm guessing it is well known but i don't know how to search for it. How do you remove the axis multiplier? A chart with data in the range of 200,000 and small difference between max and min values, will be assigned a 10^5 multiplier to the entire axis. This results in the ticks becoming meaningless, since all become 2.   Example:-  \begin{tikzpicture} \begin{axis}   \addplot coordinates {   (100,200001)   (200,200003)   (300,200005)   };     \end{axis} \end{tikzpicture}   When this is plotted the y-axis has 5 ticks, all of which are 2. The y-axis has a multiplier of 10^5. This has effectively removed all information from the graph.  I may use the below to set the explicit value of the tick values but this does not implement change in the display "style" of the axis ticks.  ytick = {200000, 200005, 200010}   I have also tried increasing the precision of the tick label to 5. However this only results in the graph showing labels such as 2.00000, 2.00005, 2.00010 with a 10^5 axis multiplier.  yticklabel style={precision = 5,}   My question is "How do I remove/change this 10^5 multiplier, such that the y-axis ticks are displayed in the form 200000, 200005, 200010. Numbering side-by-side equations or inline equations Python does not find packages installed without Anaconda I'm trying to install kivy for python 3 using apt-get:      sudo apt-get install python3-kivy   And it is installed in      /usr/lib/python3/dist-packages   But, when I tried to load it in python, I get a ModuleNotFoundError      Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49)      [GCC 7.2.0] on linux     Type "help", "copyright", "credits" or "license" for more information.     &gt;&gt;&gt; import kivy     Traceback (most recent call last):       File "&lt;stdin&gt;", line 1, in &lt;module&gt;     ModuleNotFoundError: No module named 'kivy'   When I check the system path from python, I only get packages in Anaconda:      &gt;&gt;&gt; import sys     &gt;&gt;&gt; print('\n'.join(sys.path))      /home/santiago/anaconda3/lib/python36.zip     /home/santiago/anaconda3/lib/python3.6     /home/santiago/anaconda3/lib/python3.6/lib-dynload     /home/santiago/anaconda3/lib/python3.6/site-packages     /home/santiago/anaconda3/lib/python3.6/site-packages/torchvision-0.2.0-py3.6.egg   Is there any way to include the '/usr/lib/python3' path to Anaconda?  Thanks. I've seen lots of examples of making an entire regular expression case-insensitive.  What I'm wondering about is having just part of the expression be case-insensitive.  For example, let's say I have a string like this:  fooFOOfOoFoOBARBARbarbarbAr   What if I want to match all occurrences of "foo" regardless of case but I only want to match the upper-case "BAR"s?  The ideal solution would be something that works across regex flavors but I'm interested in hearing language-specific ones as well (Thanks )  Edit  The link Espo provided was very helpful.  There's a good example in there about turning modifiers on and off within the expression.  For my contrived example, I can do something like this:  (?i)foo*(?-i)|BAR   which makes the match case-insensitive for just the foo portion of the match.  That seemed to work in most regex implementations except Javascript, Python, and a few others (as Espo mentioned).    The big ones that I was wondering about (Perl, PHP, .NET) all support inline mode changes. Closing Reject Suggested Edit dialogue freezes review process If you go to review a suggested edit and close the Reject dialogue box, the button at the top-right will continue to say "Rejecting...". You will not be able to continue with the review process.  I have refreshed the page, and tried clearing my cache. If I refresh the page, I can continue reviewing the edit.  I'm using Chrome Version 31.0.1650.57 m. If a thin metal plate is placed between two charges $+q$ and $+q$, will this cause a change in the electrostatic force acting on one charge due to another? What is the concept behind this? What will happen if the metal plate is thick? Setting or modifying a (system wide) environment variable in cmd.exe I am looking for a convenient way to add and/or modify and/or delete an environment variable from the command line. Particularly, I find myself at times in situations when I have to add a few variables in cmd.exe.  I'd be grateful if someone showed me a non-GUI way to modify (that is: to add a new directory to) the %PATH% variable.  The change should be be permanent, not just for duration of the cmd session. Strange Bittorrent Log On My Server Why and how is sound produced when two objects hit each other? When two objects collide and undergo a partially inelastic collision (so every one we experience in every-day life), they rebound to a certain degree, but kinetic energy is not conserved. Thus, the energy of motion must be converted to another type of energy. Thus, when two object collide, the most common forms of energy that kinetic energy is converted to are sound energy and thermal energy.   Some collisions are louder than others just because they cause a bigger local variation of pressure (which then propagates through air until finally gets heard). So, why some objects, even if the velocity before and after the collision seems to be the same, are louder than others? I mean, how do the different material properties enter in the phenomenon?  How and why, by means of solid and fluid mechanics or with an heuristical microscopical reasoning, can this process be explained? "find: missing argument to `-exec'" when using "-exec rm -f {}\" get_post_gallery with Gutenberg I have a site where I created a page that takes the gallery images from a post and puts them into a slider.   I used the following code:  // gets the gallery info $gallery = get_post_gallery( $post-&gt;ID, false ); // makes an array of image ids $ids = explode ( ",", $gallery['ids'] );   Then I inserted the images using wp_get_attachment_image().   Unfortunately, with WP 5.0 and Gutenberg, get_post_gallery no longer works with newly added content. It seems that get_post_gallery used a shortcode that no longer works with Gutenberg.   I am still getting up to speed on Gutenberg and the block system. Until I understand that all better, I was wondering if anyone has any advice on how to get the image ids from a gallery in Gutenberg? I'm trying to measure the execution time of a process that I call via the command line (i.e., I want to find out how long it takes to for the process to finish). Is there any command that I can add to the command calling the process that will achieve this? What bizarrities lurk within the decimal expansion of an irrational number? i.e. can we write  $\pi = 3.14159\dots X\dots$  where $X$ consists of (say) $10^{100}$ consecutive zeroes?  [Originally asked on reddit without response :-( ] In the Stack Overflow podcast #36 (), this opinion was expressed: Once you understand how easy it is to set up a state machine, you’ll never try to use a regular expression inappropriately ever again. I've done a bunch of searching.  I've found some academic papers and other complicated examples, but I'd like to find a simple example that would help me understand this process.  I use a lot of regular expressions, and I'd like to make sure I never use one &quot;inappropriately&quot; ever again. My OpenID provider is shutting down; how do I change my Stack Exchange login? MSBuild exec task with for I am trying to run the following commands as part of an MSBuild script:  for /R . %f in (*.targets) do copy /Y "%f" "C:\Program Files (x86)\MSBuild\Microso ft\VisualStudio\TeamBuild"   The commands is implemented in an exec the following way:  &lt;Exec WorkingDirectory="$(SolutionRoot)" Command="for /R . %f in (*.targets) do copy /Y &amp;quot;%f&amp;quot; &amp;quot;$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild&amp;quot;" /&gt;   The command works fine from console, but when trying to run it from MSBuild I get the error:   Task "Exec"   Command:   for /R . %f in (*.targets) do copy /Y "%f" "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild"   f" "C:\Program was unexpected at this time. C:\Users\rd-build\AppData\Local\Temp\OH Test2\Continuous.BuildTargets\BuildType\TFSBuild.proj(98,5): error MSB3073: The command "for /R . %f in (*.targets) do copy /Y "%f" "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild"" exited with code 255. Done executing task "Exec" -- FAILED.   Any suggestions?