As we known, there'is a command called "force index" within mysql database. So this can force mysql to use an index whether optimizer like or not. And my confusion is that how to do the same thing on postgresql? Any reply will be appreciated.
How do I force Postgres to use an index when it would otherwise insist on doing a sequential scan?
How to kill a dragon in Skyrim? Anyone got any tips on how to beat down a Dragon solo? I've managed to get it down to 3/4 health, but keep running out of potions and getting owned.  I tend to whittle it down with bow from cover, then hit it with akimbo Lightning Strike which is awesome btw. Then poison and some sword.  I can't see a way to achieve this without having about 1000 points of stamina to run away from it when it does a swooping breath attack which seems to track you no matter what way you go.  Any advice please? This is for fighting them out in the open, "wild dragons" if you will. Can anyone identify this 90s teen-fantasy series, gems in backbone, big magic, evil king? Let $A$ be a $n\times n$ matrix with entries $a_{ij}=i+j $ . Calculate rank of $A$.  My work : I noticed that A is symmetric . Hence all of its eigen vectors are real .. That is all i have got .   Your help will be highly appreciated .Thank you . When does a reaction happen if the trigger is movement? Highlight elements in the matrix Showing that $G/(H\cap K)\cong (G/H)\times (G/K)$ Suppose that $H$ and $K$ are normal subgroups of a group $G$ such that $HK=G$. I need to show that  $G/(H\cap K)\cong (G/H)\times (G/K)$.  So from the second isomorphism theorem we have that:  $HK/H\cong H/(H\cap K)$ which gives that $G/H\cong H/(H\cap K)$  $HK/K\cong K/(H\cap K)$ which gives that $G/K\cong K/(H\cap K)$  So we must now show that:  $H/(H\cap K)\times K/(H\cap K)\cong G/(H\cap K)$  So consider the map $\theta:H/(H\cap K)\times K/(H\cap K)\rightarrow G/(H\cap K)$ such that $\theta(h(H\cap K)\times k(H\cap K))=hk(H\cap K)$  Now this is a homomorphism and is surjective. To check injectiviy we see that if:  $\theta(h_1(H\cap K)\times k_1(H\cap K))=\theta(h_2(H\cap K)\times k_2(H\cap K))$ then we have that:  $(h_1k_1(H\cap K))=(h_2k_2(H\cap K))$ so that $(h_1k_1)(h_2k_2)^{-1}(H\cap K)=(H\cap K)$ which gives that $h_1k_1(H\cap K)=h_2k_2(H\cap K)$ So we are done.  Is the above correct?  Thanks for any help Since the new top bar has been rolled out - a number of different people, established and new users alike, have asked questions on where a specific link has disappeared to with the new top bar design. Where has the link to &lt;X&gt; gone? I have seen some hypotheses that the recent series corporate actions and statements are a sign of SO/SE being in the process of being, or about to be, sold. Arguments cited include the corp statements being made in paywalled areas and addressed to an audience that seems very distinct from the community, the choice of CEO, the push for a 'service sector' flavour of tensely smiling hospitality, and surely some more I can't recall in a coherent form.   Just how plausible and implausible, and how founded or unfounded, is such a hypothesis? Is it, as far as people more knowledgeable either about business in general or about the specific case of SE/SO, strategically consistent or even outright connected with the corp's behaviour (and a likely cause thereof)? MySQL strip non-numeric characters to compare I'm looking to find records in a table that match a specific number that the user enters.  So, the user may enter 12345, but this could be 123zz4-5 in the database. I imagine something like this would work, if PHP functions worked in MySQL. SELECT * FROM foo WHERE preg_replace(&quot;/[^0-9]/&quot;,&quot;&quot;,bar) = '12345'  What's the equivalent function or way to do this with just MySQL? Speed is not important. Why there isn't any integer solutions in non-zero integers for $z^3 = 3(x^3 +y^3+2xyz)$? Consider the following Diophantine equation  $$z^3 = 3(x^3 +y^3+2xyz)$$  Is there any elementary proof for the non-solubility in non-zero integers for this  Diophantine equation, where the absolute value of $x, y$ and $z$ are pairwise coprime integers?  I have proved the impossibility of solution of this Diophantine equation in non-zero integers, but that took quite a few pages and I consider this too long. I hope for a much more elementary and shorter proof for this puzzle.  Hint: It should be noted that is also true for the non-availability of the similar form (replacing coefficient 3 by 1) as the following:   $$z^3=x^3+y^3+2xyz,$$ but this case is very simple to prove, where $x, y\;\&amp;\; z$ are nonzero integers. Using Custom Labels in a Class I have the below If statements using some hard coded strings and I want to make them use as custom labels. I have created custom labels with the same String names as given below. So how can I make these statements to use the Custom Labels I created ?  if(monitoringFrequency == 'daily'){             return dateValue.addDays(1);         }else if(monitoringFrequency == 'weekly'){             return dateValue.addDays(7);         }else if(monitoringFrequency == 'monthly'){             return dateValue.addMonths(1); T-SQL stored procedure that accepts multiple Id values Is there a graceful way to handle passing a list of ids as a parameter to a stored procedure?   For instance, I want departments 1, 2, 5, 7, 20 returned by my stored procedure. In the past, I have passed in a comma delimited list of ids, like the below code, but feel really dirty doing it.   SQL Server 2005 is my only applicable limitation I think.  create procedure getDepartments   @DepartmentIds varchar(max) as   declare @Sql varchar(max)        select @Sql = 'select [Name] from Department where DepartmentId in (' + @DepartmentIds + ')'   exec(@Sql) What is the proper way to change the DNS IP? Currently, if you access a deleted question you will get a short message informing you that the question has been deleted. However, if you click on a direct link to a deleted answer or comment (which you can get via notifications), nothing is displayed.  This is naturally quite confusing as you will get the message about a new answer or comment via notifications, click on the link and simply see nothing.  Therefore, I propose to display some sort of message to the user, informing her/him that the answer or question has been deleted. Note that this is different from always showing a deleted answer/comment, as I specifically request it in case you access the specific URL.  One example for a comment would be:   One example for a deleted answer is:   This question is related to ,  but requests a feature to circumvent the problem altogether. How to make the measuring grid larger? When starting the blender, there is always a cube on the floor. The floor is actually a grid. My question is how to make this grid bigger so that we can measure big stuff? I just saw a user named: .yahoo.co.jpaqwsykcj3aulh3h1k0cy6nzs3isj  Could new users be named according to their user-number, or something other than "Unknown"? Perhaps User1234567 instead? It would be less awkward to address them in answers and comments.   Additionally, I often times have to check profiles to make sure users aren't abusing the system, since I find many of the same questions from "unknown (google)" from time to time. That, or I'll mistakenly think I've helped the user on a similar issue in the past, and assume the user has knowledge that he or she does not have. Unwanted behaviour from dict.fromkeys Colors in Photoshop CS6/CC look different than in browser? How resilient is Ubuntu to repeated "power-off" shutdowns? My company is considering the use of Ubuntu as an OS for use on a hardware device.     It would be installed on compact flash drive - apparently this is not standard flash drive but a specific type of memory that is supposed to "cope" with immediate power shutdown (I am not sure how this is achieved but they are supposedly a "high end" card).    The units that would be run using Ubuntu are the type of units that will not be gracefully shutdown - the power cable would be removed and that is that.     Can anybody give me some advice on the potential problems that can occur? Is Ubuntu a good system that can deal with this kind of power outage and reboot successfully on next startup?     I realise that nothing is unbreakable, but is it a commonly used OS for an embedded setup? Is it asking for trouble to use Ubuntu in this kind of environment? Structuring game narrative. Handling NPC, Quest, General Dialogue. Is Json/XML the right way to go? Or any other solutions? Hello guys I'm try to make some games that have more to it than just simple high score scrolling shooters etc.  I'm trying to design my own systm of handling narrative. I want to be able to place NPC's in the game world, with scripts attached to them. Some of the NPC's would just have n random greetings. Others will be mission givers and will offer you a quest of sorts. (The quest could be go speak to Bob in the pub, or it might be bring me the Holy Grail and Crown Jewels, or something in between).  I've wracked my brain for a long while over this but sadly keep slipping back to the only way I know how, which is to manually code all the strings that people can say and have a horrible web of if statements and other such insanity to give me a rudimental dialogue system. Its not good enough even with just a few characters, but if I had dozens/hundreds of characters it would be even worse.  I've read lots about it already but I'm still very confused when I start trying on my own project. I've read that Json/XML might be the way to go and that I can add custom markups in the Json text to call methods in my code, but I dont even know if this is right and if so how I can do it.  The back of my brain is screaming at me that there is a simpler way to do it, but I've sat here for a very long time without managing to think of ideas.  Here is a diagram I drew which pretty much shows the flow of how I want my NPC to behave. If anyone can see this and then tell me how they might do something like this that would be fantastic!! (note: if Json is the correct advise, please give me a exact example of how exactly to format the Json in order to check the bools I mention in my flowchart - thanks!):    note: The circles denote an output from the data as Text for the dialogue system. The bools will need to be checked against by the data file to see which output to give (hope that makes sense and is possible)