I have created an Availability Group with one primary and one secondary read only replica. The configuration is as below:    Now I connect to the listener using SSMS with parameter APPLICATIONINTENT=READONLY; but all read and write requests are sent to primary server as is shown in Profiler:    Is there any configuration mistake of me?
We have an Always On "cluster" that consists of 2 servers (there will be more), so one is PRIMARY and other(s) is(are) SECONDARY. The idea was to dedicate SECONDARY as a readonly replica, so it would be a somewhat search-server.  I do know how to set ConnectionString in the C# so it will use SECONDARY replica - just add ApplicationIntent=ReadOnly.  But I don't understand how to address the SECONDARY from stored procedure if I'm using distributed query. Is there a way to set some parameters to the query (like WITH statements or something), so query would use only replica and not the PRIMARY node?  The thing is, obviously from the start server1 is PRIMARY and server2 is SECONDARY, but when server1 fails then server2 is PRIMARY and server1 will be SECONDARY after it get fixed. So I cannot just use the static server2's name.  So far I've managed to get current replica's server name as a variable and use it in EXEC:  -- find first available replica DECLARE @replicaServer nvarchar(50)  SELECT TOP 1     @replicaServer = RCS.replica_server_name FROM     sys.availability_groups_cluster AS AGC     INNER JOIN sys.dm_hadr_availability_replica_cluster_states AS RCS           ON RCS.group_id = AGC.group_id     INNER JOIN sys.dm_hadr_availability_replica_states AS ARS           ON ARS.replica_id = RCS.replica_id     INNER JOIN sys.availability_group_listeners AS AGL           ON AGL.group_id = ARS.group_id WHERE ARS.role_desc = 'SECONDARY'       AND connected_state = 1  -- and query it DECLARE @cmd nvarchar(MAX) = 'SELECT * FROM [' + @replicaServer + '].[somebase].[someschema].[sometable]' EXEC (@cmd)   But that's a shame, I guess.
Underworld Connections: Tapping the Land for mana and ability? Keyboard key stuck or not being recognized; how to fix This is an attempt to write a canonical QA for this issue, as per the Meta post:   I expect it to be periodically edited with the goal of becoming a comprehensive information resource.  I have a MacBook Pro that has a key(Shift, Return,   Command, P, etc.) that doesn’t respond when pressed or is stuck in the down position.    It's possible that my favorite beverage was spilled (or some other liquid damage).  It's also possible that I have no idea what happened.  It was working yesterday and suddenly today it's no longer working.  Is there any way to bypass or remap the key?  Can I  have the system ignore it completely?  (This question can also apply to external USB keyboards or the Bluetooth keyboards) We're in the process of deploying a private openstack instance but don't have the Swift object storage service available yet. Can juju bootstrap launch a utility instance without swift? I see that the openstack configuration control-bucket is a container id. Suppose I have an Atwood machine, that is, two different masses connected with an inextensible, massless rope over a pulley. Assuming no friction between the rope and the pulley, the heavier mass will accelerate towards the ground, the lighter mass will accelerate towards the pulley, and the rope will accelerate towards the heavier mass. These three accelerations will be equal in magnitude. But this makes no sense to me. Force causes acceleration. But there is no force acting on the rope. And even if there was, the acceleration of the rope would be infinite because its mass is 0. So why does the rope accelerate? And how can the magnitude of this acceleration be finite? I would like to use  with a video.  With ffmpeg I can export some (.jpeg) images from a video. Can I convert a .jpeg into a valid .tiff or export directly .tiff images from the video with ffmpeg? I'm planning to use USB port for an application(from a device to a PC) but the distance between the device and the PC will be around 15m. The recommended maximum USB cable length is 5m.  How can I buffer the data without loosing any information, safely? Would a USB hub work? I cannot boot to the desktop because I filled the file system. How do I reclaim some space? My memory is completely full when I tried following the data recovery and copied the wrong file using command line tool Test Disk. As it was taking so long to copy, I turned it off and I realized I copied the wrong file. Now my laptop memory is now full and lead me to more problems.  I have had similar problems to :       Now my screen keeps blinking:   Can anybody help? Many thanks. Wish you all the best. Postfix SMTP banner show multiple hostnames Negative Mass and gravitation Do IE standalone-browser still exist (and run on Win 7?) Pivoting rows into columns dynamically in Oracle I have a database with millions of phone numbers with free-for-all formatting. Ie, the UI does not enforce any constraints and the users are typing in whatever they want.  What I'm looking for is a Java API that can make a best-effort to convert these into a consistent format. Ideally, the API would take the free text value and a country code and produce a valid international phone number or throw an exception.  For example, a phone number in the system might look like any of the following:  (555) 478-1123 555-478-1123     555.478.1123 5554781123   Given the country of US, the API would produce the value "+1 (555) 478-1123" for all these. The exact format does not matter, as long as it's consistent.  There are also numbers in the system without area codes, such as "478-1123". In that case, I would expect a NoAreaCodeException, or something similar.  There could also be data such as "abc", which should also throw exceptions.  Of course, there are countless variations of the examples I have posted, as well as the enormous complication of international phone numbers, which have quite complicated validation rules. This is why I would not consider rolling my own.  Has anyone seen such an API? Can anyone help me with this?     If 738 consecutive integers are added together, where the 178th number in the sequence is 4,256,815, what is the remainder when this sum is divided by 6? How to run adb and fastboot commands from Termux? I need a little hint in a proof on convergence of a sequence. The problem I have is: Suppose $(x_n)$ is a monotone decreasing sequence of real numbers such that $\sum x_n$ converges, prove that:  $$\lim_{n \to \infty} nx_n=0$$  My idea is: proving this fact aims to prove that given $\epsilon &gt;0$ there's some natural $n_0 \in \mathbb{N}$ such that if $n &gt;n_0$ we have $|nx_n|&lt;\epsilon$.  Now, I know that $\sum x_n$ converges, so that given $\epsilon'&gt;0$ there's some $k_0 \in \mathbb{N}$ such that if $k &gt; k_0$ we have:  $$\left|\sum_{i=1}^{k}x_i - S\right|&lt;\epsilon'$$  Where $S = \sum x_n$. Now, since $(x_n)$ is monotone decreasing we know that we must have $x_1 &gt; \cdots &gt; x_k$ so that the sum of all $x_i$ should be less or equal to $k x_k$. So I know that I have:  $$\left|\sum_{i=1}^{k}x_i - S\right|\leq\left|\sum_{i=1}^{k}x_i\right|+|S|\leq|kx_k|+|S|$$  I feel that the proof will come from this, however I'm stuck at this point. Can someone give just a little hint on how to proceed from here?  Thanks very much in advance for your help. Schrödingers MySQL table: exists, yet it does not Using right-hand Riemann sum to evaluate the limit of $ \frac{n}{n^2+1}+ \cdots+\frac{n}{n^2+n^2}$ I'm asked to prove that $$\lim_{n \to \infty}\left(\frac{n}{n^2+1}+\frac{n}{n^2+4}+\frac{n}{n^2+9}+\cdots+\frac{n}{n^2+n^2}\right)=\frac{\pi}{4}$$ This looks like it can be solved with Riemann sums, so I proceed:  \begin{align*} \lim_{n \to \infty}\left(\frac{n}{n^2+1}+\frac{n}{n^2+4}+\frac{n}{n^2+9}+\cdots+\frac{n}{n^2+n^2}\right)&amp;=\lim_{n \to \infty} \sum_{k=1}^{n}\frac{n}{n^2+k^2}\\ &amp;=\lim_{n \to \infty} \sum_{k=1}^{n}(\frac{1}{n})(\frac{n^2}{n^2+k^2})\\ &amp;=\lim_{n \to \infty} \sum_{k=1}^{n}(\frac{1}{n})(\frac{1}{1+(k/n)^2})\\ &amp;=\lim_{n \to \infty} \sum_{k=1}^{n}f(\frac{k}{n})(\frac{k-(k-1)}{n})\\ &amp;=\int_{0}^{1}\frac{1}{1+x^2}dx=\frac{\pi}{4} \end{align*}  where $f(x)=\frac{1}{1+x^2}$. Is this correct, are there any steps where I am not clear? It used to be that the new, super wide, touch friendly context menu style that Google introduced a few versions of Chrome ago could be turned off using the start up flag "--disable-new-menu-style".  As of Chrome 28, this is no longer the case, and as a desktop user it is very irritating to see menus that previously fit in the screen not to do so anymore — I don't think I can get used to it. Is there any way around it? If the flag is gone for good, can the style of the context menus be perhaps edited with custom css like the web inspector? Prove: The pre-image of an ideal is an ideal. Let $\phi : R \to S$ be a homomorphism. If $N$ is an ideal of $S$, then $\phi ^{-1} (N)$ is an ideal of $R$. Can prematurely powering down a computer cause bad sectors in a hard drive? Q1: Can forcibly powering off a PC without using the built-in shutdown/reboot functions, cause a HDD to accumulate bad sectors? Whether it be the result of BSODs, lockups, crashes, etc.   Q2: If so, are these bad sectors repairable? I know an OS typically relocate bad sectors to other areas of the drive, but once a drive accumulates too many it just dies.   I have read up and saw things about 'soft' and 'hard' bad sectors. One caused by software and the other being actual physical damage. The reason I am asking this is because I have had several HDDs die on me in the past year, far before their estimated lifespan, and one thing they all had in common was that I had forcibly powered off my PC a lot.