I noticed some behavior I found weird while editing a co-workers stored procedure:       create procedure weird_behavior (@switch bit)      as      if (@switch = 0)     begin         select *         into #tables         from sys.tables st         where left(st.name, 1) in ('a','b','c')     end      else if (@switch = 1)     begin         select *          into #tables         from sys.tables st         where left(st.name, 1) in ('d','e','f')     end      select * from #tables      --drop procedure weird_behavior   you get the error:     There is already an object named '#tables' in the database.   This seems odd to me, since only one of the select * into will ever run. I'm forced to rewrite it like so:      create procedure weird_behavior (@switch bit)      as      if (@switch = 0)     begin         select *         into #tables         from sys.tables st         where left(st.name, 1) in ('a','b','c')     end      else if (@switch = 1)     begin         select *          into #tables01         from sys.tables st         where left(st.name, 1) in ('d','e','f')     end      select * from #tables      --drop procedure weird_behavior   This would cause headaches because sometimes the output is in #tables, and sometimes it is in #tables01.  Question: why won't SQL Server let me write this code?
I'm attempting to do this in a procedure:  DECLARE @a bit = 1; BEGIN     SELECT * INTO #aTemp FROM OPENROWSET( ... );      IF @a = 0     BEGIN         SELECT ... INTO #bTemp FROM #aTemp;     END     ELSE     BEGIN         SELECT ... INTO #bTemp FROM #aTemp;     END END   I get the error:  Msg 2714, Level 16, State 1, Line 10 There is already an object named '#bTemp' in the database.   Why is this happening and is there a work around?  Update  I've attempted to add a DROP statement as suggested , but it still does not work:  DECLARE @a bit = 1; BEGIN     SELECT * INTO #aTemp FROM OPENROWSET( ... );      IF @a = 0     BEGIN         IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL         BEGIN             DROP TABLE #bTemp;         END          SELECT ... INTO #bTemp FROM #aTemp;     END     ELSE     BEGIN         IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL         BEGIN             DROP TABLE #bTemp;         END          SELECT ... INTO #bTemp FROM #aTemp;     END END
Is is possible to skip the confirmation step while adding a repository? When I add a repository by running  sudo add-apt-repository ppa:ubuntu-x-swat/x-updates   It outputs this dialog:  Updated versions of X.org drivers, libraries, etc. for Ubuntu.  This PPA is for stable upstream releases of X.org components.  If you're looking for something even more bleeding-edge, please see the xorg-edgers PPA.  While Ubuntu does not "officially/formally" support these packages, if you discover problems when installing these debs please feel free to report bugs to launchpad.  However, please make sure to clearly state that you are running packages from this PPA so we know the fixes need to come here.  If you are upgrading from one release to another with this PPA activated, please install the ppa-purge package and use it to downgrade everything in here beforehand. sudo ppa-purge ppa:ubuntu-x-swat/x-updates will do it.  [Directions for packaging drivers can be seen at https://wiki.ubuntu.com/X/DriverBuilding]  More info: https://launchpad.net/~ubuntu-x-swat/+archive/x-updates Press [ENTER] to continue or ctrl-c to cancel adding it   I want to skip the confirmation step  Press [ENTER] to continue or ctrl-c to cancel adding it   How can I automatically confirm the addition of a PPA? Which side of wave-particle duality to choose in a given situation How does one know whether, in treating a certain problem, one should consider particles as waves or as point-like objects? Are there certain guidelines regarding this? Find Nearby Accounts migration to Google Maps API v3 we have been using the Find Nearby Accounts app from appexchange for a while now. The app uses the Google Maps API vs 2 which is now deprecated and hence has rendered the app ineffective. I have tried migrating the Google maps API version for the app from v2 to v3 by generating a v3 API key. The URL for my salesforce instance was included in the creation of the Client ID under API Access. After all these steps, I still get the error "Problem with Address. I know the address is right.   Has anyone been able to get this working? Thanks. Force Messages to use SMS for specific contact rather than iMessage? Essentially, I would like to set my phone so that all my outgoing messages to a specific friend, with whom I currently text back and forth over iMessage, are sent out over SMS, never iMessage. Additionally, I would like to block any incoming iMessage texts of his and (hopefully) they'll fail and be resent via SMS.  Let me restate that: I would like to force SMS for both parties, going both ways, for a specific individual contact.   Is this possible? Blocking any usage of iMessage between myself and this other individual, so they must either send and receive any texts to or from me via SMS (or the texts fail/never arrive). Combinatorial Proof for Binomial Identity: $\sum_{k = 0}^n \binom{k}{p} = \binom{n+1}{p+1}$ I am studying combinatorics and I came across the identity $$\sum\limits_{k=0}^n \binom kp =\binom {n+1}{p+1}.$$ I have read the algebraic proof and it does not appeal to me. Is there an elegant counting trick we can use to arrive at this identity? Is the Playstation 4 backwards-compatible? Does the PS4 have backwards compatibility of some form? The majority of forums/sites suggest not, or posters are adamant it doesn't yet. Others imply that some form of backwards compatibility will include a cloud service and PS3 titles? I've even heard on some forums that PS4 does actually play PS3 games but those posts seem to be a minority compared to those that say it's not... Sufficient Identification for Intra Schengen flights If one takes a direct flight from one Schengen member state to another, what's the minimum sufficient ID that needs to be provided to board the flight? Use mathematical induction to prove that any integer $n\ge2$ is either a prime or a product of primes. Use  strong mathematical induction to prove that any integer $n\ge2$ is either a prime or a product of primes.    I know the steps of weak mathematical induction... Basis step: $p(n)$ for $n=1$ or any arbitrary $n_0$ ... show that it is true Inductive hypothesis: $p(n)$ for $n=k$ ... Assume that it is true for $n=k$ Inductive step: $P(n)$ for $n=k+1$ ... Show that this is true for $n=k+1$ How many triples $(x,y,n)$ are there such that $x^n - y^n = 2^{100}$ Bound on integral implies bound on function I don't know how to prove this example. Let $y(t):\mathbb{R}^+\to \mathbb{R}$ be a nonincreasing function. Assume that there is a constant $A&gt;0$ such that \begin{equation} \int_{s}^{+\infty}y(t)dt \leq Ay(s), \quad 0\leq s&lt;+\infty \end{equation} Then $y(t)\leq y(0)e^{1-\frac{t}{A}}$, for all $t&gt;0$. I got my Galaxy S4 today (i337M), it's wayyy better than my old SII hehe.  I immediately removed the stock Bell firmware and put the latest snapshot available from CyanogenMod.  I'm wondering if it's possible to convert apps like S Planner, S Note, S Health to CyanogenMod.  Current stock android version available for i337M is 4.2.2. Latest Android version for CM is 4.4.  If I install CM 4.2, can I import/install the APKs and then upgrade to 4.4?  Hope you'll be able to help me :) How can a single Curve Interpolation Mode set to Constant? I'm trying to make a systemd timer that runs every 15 minutes. Right now I have:     timer-fifteen.timer:  [Unit] Description=15min timer  [Timer] OnBootSec=0min OnCalendar=*:*:0,15,30,45 Unit=timer-fifteen.target  [Install] WantedBy=basic.target    timer-fifteen.target:  [Unit] Description=15min Timer Target StopWhenUnneeded=yes    This runs over and over again without stopping. Does it need to be *:0,15,30,45:* instead? How can I make this work? Is there a possibility of using REST Assured library for testing SOAP webservices? I have a bunch of Test Suites in SOAP UI and I need to check if there is possibility of using REST Assured. Can anyone suggest if this is possible? Many thanks for any comments. Extend x axis on graph? I'd like to extend my x axis a little longer. Is it possible to do that?  \centering     \begin{tikzpicture}[scale=1.5]      \begin{axis}[         xlabel=Reynolds Number,ylabel=Coefficient Discharge]     \addplot [color=blue,mark=*] coordinates {         (6485.41491,0.408143397)         (7927.942858,0.407370795)         (8663.115504,0.38550864)         (9219.462371,0.366953133)         (9537.374867,0.346531912)         (10491.11235,0.330115983)         (11087.19828,0.312041115)         (12219.76155,0.313951177)     };         \addlegendentry{1/4}     \addplot [color=red,mark=triangle] coordinates {         (6556.945221,   0.412644978)         (7868.334265,   0.404307857)         (8663.115504,   0.38550864)         (9187.671122,   0.365687778)         (9120.114717,   0.331371141)         (10443.42548,   0.328615455)         (11683.28421,   0.328817519)         (12875.45607,   0.330797337)     };         \addlegendentry{1/2 Lift}     \addplot [color=black,mark=*] coordinates {         (6843.066467,   0.430651305)         (8297.516134,   0.426361012)         (9203.566747,   0.40955872)         (8615.42863,    0.342911376)         (9298.940495,   0.337868614)         (10824.92047,   0.340619673)         (11683.28421,   0.328817519)         (12899.29951,   0.331409925)     };         \addlegendentry{3/4 Lift}     \addplot [color=yellow,mark=*] coordinates {         (6854.988186,   0.431401568)         (8398.850742,   0.431568008)         (9267.149246,   0.412388141)         (8567.741755,   0.341013343)         (9346.62737 ,   0.339601273)         (10753.39016,   0.338368882)         (11897.87515,   0.334857025)         (13030.43841,   0.334779157)     };         \addlegendentry{Full Lift}     \end{axis}% \end{tikzpicture}% Photoelectric effect intensity I understand the PE effect quite well but I'm failing to understand one thing. Intensity is the amount of energy per second incident to a given area.   So can you can increase the intensity by either increasing the electrical energy or making the area smaller? By increasing the electrical energy, what exactly is happening?  I assume that by increasing intensity you are increasing the number of photons incident to an area of the metal thus increasing the rate of photoelectric emission. But why doesn't increasing intensity via more electrical power lead to greater energy of the electrons, if by increasing intensity you are increasing the energy of the incident waves?  I understand the results but I'm trying to understand why the intensity works the way it is thanks Square roots of integers and cyclotomic fields For every $ N \in \mathbb Z$ there exists an integer $n$ such that $ \sqrt N \in \mathbb Q(\zeta_n)$.   I am struggling where to start this question, please suggest me few hints. Proof that for $a,b,c\in \mathbb{R}$, hold that $\left |\sqrt {a^2+b^2}-\sqrt {a^2+c^2}  \right |\leq \left |b-c  \right |$. Give me a clue, I don't have any idea to work with that inequality. Ubuntu 16.04 slow boot (apt-daily.service) My boot is horribly slow, and I don't know why.  $ systemd-analyze  Startup finished in 10.975s (kernel) + 49.732s (userspace) = 1min 708ms $ systemd-analyze blame           34.971s apt-daily.service          20.590s snapd.refresh.service          17.113s grub-common.service          16.033s apport.service          16.027s networking.service          15.894s ondemand.service          15.860s irqbalance.service          15.655s speech-dispatcher.service          11.695s ModemManager.service           9.772s accounts-daemon.service           8.626s NetworkManager-wait-online.service           8.058s systemd-logind.service           8.053s bluetooth.service           7.944s gpu-manager.service           7.896s alsa-restore.service           7.892s pppd-dns.service           7.882s rsyslog.service           7.860s avahi-daemon.service           7.844s dev-sda1.device           7.842s systemd-user-sessions.service           7.648s lightdm.service           7.610s teamviewerd.service           6.445s apparmor.service   Also, during boot-up, I see a message that says something like:  device descriptor read/all, error -62 ata1 softreset failed (device not ready) #most of the times error loading journal #(sometimes) Test WP failed, assume Write Enabled Asking for cache data failed     #most of the times Assuming drive cache: write through   apt-daily.service slows the boot the most. Any idea on how to tackle that?  I have Ubuntu MATE 16.04. Is it possible to schedule my laptop to mute and unmute at a specific time? I always used to wake up to my favorite radio station on my alarm clock. However, I have moved and can no longer get that radio station over the air. To solve this problem, I would like to stream the station on my laptop, but have it muted overnight, then set it to unmute at a specific time in the morning, so that it will act as an alarm clock. Is there a way to schedule my laptop (Windows 7 64-bit) to unmute at a specific time?