Whaty could be the cause of postgres functions losing or swapping values from a CTE?

I have a number of functions which are generally in this shape:

RETURN QUERY with cte1 as (    select a, b, c, d, e    from [some_table]    where [some_condition] ), cte2 as (     select x, y, z     from [big_table]     where [bunch_of_conditions] ) select foo.x, foo.y, bar.a, bar.b, bar.c, bar.d from cte2 foo join cte1 bar on foo.z = bar.a 

I have seen occasions where the values of bar.b and bar.d are swapped, and on others no values are returned – upon investigation, because bar.a contains only nulls.

In all cases, when I take the code out of the functions, it always runs correctly. In each case where it goes wrong, there is nothing I can point to which causes the glitch, and usually it goes away for no obvious reason. This is all running in pgAdmin under Windows 10, and the behaviour persists through stopping pgAdmin, and/or rebooting the PC.

The db where this happens is running on AWS, and I don’t have access to stop/restart that server.

It suggests to me that the problem is happening at the AWS and/or postgres server end, but that may or may not be correct.

Possibly also relevant, we have also seen cases where queries run exceptionally slowly (45 minutes instead of less that one second, being one example today).

In each case of the swap or the slowdown, it eventually returns to normal behaviour without any obvious intervention from me. I’m still experiencing the null value which should be populated.

Has anyone seen behaviour like this? Any ideas what could be causing it, or how to remedy it?

Upgrading my website to be multilanguage with subdirectories, Without losing my good google ranking

I have a Belgium regular HTML website where you can rent my jazzband for events, For years my website was in dutch only, but I would like to also have the french speaking belgium citizens as new costumers. (Belgium has north dutch speakers and south french speakers) My ranking on google is really good, so I do not want to lose my position when adding the french language on it.(note: I always will have and want mostly dutch visitors)

My website is now still www.myexamplesite.be (all my extra pages are in my rootfolder)

For my upgrade I did copy all my pages and translated them, and used the *hreflang="nl-BE" and "fr-BE"*stuff on all my pages linking both languages on each page. All my pages are organised in a subdirectory, all dutch pages in /nl/.. and french pages in /fr/.. On each page there is a menubutton to swith language (it links to the html in the right directory).

for the moment I have this:

root/index.html  --> www.myexamplesite.be (a dutch written homepage with all my links leading to the /nl directory. root/nl/index.html --> www.myexamplesite.be/nl/index.html this is a copy of my 'root/index.html' root/fr/index.html --> www.myexamplesite.be/fr/index.html this is the french translated homepage 

Is this the best option? (thinking about my ranking), will google automatically lead the french speakers to my /fr/index? and the dutch to nl/index or root/index ? Or should consider ‘language redirect with htaccess’ on my root/index.html? Or…other options?

Does the Necromancy Wizard’s lvl 10 feature, Inured to Undeath, prevent losing maximum hit points as a result of losing attunement to a magic item?

Inured To Undeath (bolding mine):

Beginning at 10th level, you have resistance to necrotic damage, and your hit point maximum can’t be reduced. You have spent so much time dealing with undead and the forces that animate them that you have become inured to some of their worst effects.

How does this feature interact with items that temporarily or conditionally improve your maximum HP, either through increasing the character’s CON score or by directly influencing maximum HP?

A similar question was posed with regards to the Aid spell, which had some interesting discussion.

Does the Aid spell permanently increase HP for Necromancy wizards with the Inured to Undeath feature?

But I’m specifically curious on how the feature interacts with Amulet of Health, Belt of Dwarvenkind, and other features that modify the CON score of the user.

Amulet of Health:

Your Constitution score is 19 while you wear this amulet. It has no effect on you if your Constitution score is already 19 or higher without it.

If a lvl 10 Necromancer with a CON modifier of 2 attuned to the Amulet of Health, then later in their adventuring career unattuned to the item, would their maximum HP stay at the level of the Amulet or return to its unaltered state?

Does losing Dex to AC also apply to CMD?

Relevant rules:


…Any penalties to a creature’s AC also apply to its CMD. A flat-footed creature does not add its Dexterity bonus to its CMD…


…The creature cannot see. It takes a –2 penalty to Armor Class, loses its Dexterity bonus to AC (if any)…


Penalties are numerical values that are subtracted from a check or statistical score. Penalties do not have a type and most penalties stack with one another…


…Invisible creatures are visually undetectable. An invisible creature gains a +2 bonus on attack rolls against sighted opponents, and ignores its opponents’ Dexterity bonuses to AC (if any) …


…Bonuses are numerical values that are added to checks and statistical scores. Most bonuses have a type, and as a general rule, bonuses of the same type are not cumulative (do not “stack”)—only the greater bonus granted applies…

The question is: Does losing your Dex bonus to AC mean you lose your Dex modifier which is factored into the CMD?

And as a side question:
Does losing your Dex bonus to AC mean you lose all dodge bonuses (not only the one from the Dodge feat, which explicitly states that you lose the benefits of that feat if you lose your Dex bonus to AC)?

My GM has the opinion that blinded creatures do not lose their Dex-bonus on CMD, because it is no penalty. He said:

…If it would apply in this case why are there multiple special rules which explicitly address the case where you lose your Dodge bonus to AC and in addition something applies which should be the normal rule in your interpretation.

For instance flat footed which explicitly mentions Dex bonus to CMD and the Dodge Feet which explicitly mentions that you lose the benefits from the Feat (1 Dodge bonus) when you lose Dex to AC.

Not the way I see it, penalties are clearly described as penalties in all descriptions ( –2 penalty to Armor Class), in addition the removal of a bonus is not a penalty in my opinion, it means a recalculation (without the called bonus)…

Is my GM right?

If a PC becomes stunned on their turn, do they lose the rest of their actions without losing any stunned value?

Page 622 of the Core Rulebook defines the Stunned condition:

You’ve become senseless. You can’t act while stunned. Stunned usually includes a value, possibly over multiple turns, from being stunned. Each time you regain actions (such as at the start of your turn), reduce the number you regain by your stunned value, then reduce your stunned value by the number of actions you lost. …

I’ve created a creature that can stun a PC as a result of the PC attacking it with a melee weapon. This means that the PC could be stunned mid-turn.

Now, rules as written, the above paragraph reads like this:

  1. You can’t act when stunned.
  2. Stunned value "ticks down" each time you regain actions.
  3. Therefore, if you are stunned during your turn, "you can’t act," so you simply lose your remaining actions. Then, at the start of your turn when you regain actions, Stunned ticks down and you may be able to act again on that turn if Stunned reduced to zero.

So, if a PC takes their first action and become Stunned 1, they will actually lose a total of three actions: the remaining two actions on their current turn, then one action when they regain actions next turn.

Is this the correct interpretation? Or should Stunned start ticking down immediately, so that in the above example, the PC would lose their second action on that turn, go down to Stunned 0, and then be able to take their third action?

Four 301-redirects from ‘www.myproject.com’ to ‘shop.myproject.com’ (am I losing my Google PageRank?)

Some years ago, I started my website with the main domain ‘www.myproject.com’. However, the project ended up being a store under ‘shop.myproject.com’.

I obtained hundreds of links to ‘http://www.myproject.com’, and today (after two years) I found that the redirection is not well-constructed, because there are four 301-redirects from ‘http://www.myproject.com’ to ‘https://shop.myproject.com’.

I have two questions:

  1. Should I fix urgently this issue of "too many 301-redirects" in order not to loose my Google PageRank?
  2. Is there any quick Rewrite Rule for Apache 301-redirect from ‘http://www.myproject.com’ to ‘https://shop.myproject.com’?

Object completely losing orientation using Lerp

So, I am making a 2d board game with unity. Basically, two characters are moving on the board when clicking a spot on the board. Since it’s a static one frame 2d game, I put all of my game objects children of the canvas. All the positions seems to be aligned, in the canvas itself everything is in place, also when I am debugging I notice that both of the positions, the local position and the target position are correct, so when I’m not using lerp and just setting the character position to the target position, it works perfect.

Lerp/Smooth damp are working perfect outside the canvas I think it’s something related to the update function, as it’s updating false positions, but that’s all I can guess… This is the Update function of the Player class:

        private void FixedUpdate() {     if (moveTowards == true)     {         velocity = Vector3.zero;         this.transform.position = Vector3.SmoothDamp(this.transform.localPosition, targetSpotPosition, ref velocity, .08f);     }      if (this.transform.position == targetSpotPosition)     {         moveTowards = false;     } } 

moveTowards set to true when clicking a spot.

    public void movePlayerTo(Spots moveHere) {     moveTowards = true;     moveHere.transform.position = Camera.main.ScreenToWorldPoint(moveHere.transform.position);     targetSpotPosition = moveHere.transform.position;     //targetSpotPosition = Camera.main.ScreenToWorldPoint(targetSpotPosition); } 

moveHere is the spot’s position, there’s no problem there.

I set my canvas to camera space render mode, and of course scale with screen size. Before putting everything in the canvas, it worked perfectley.

HELP PLEASE. Thanks in advance,


Shark Clan losing Honor due intimidation

Reading Rank 2 of the Jirozame Bushi Eyes Of the Predator

In the wild many animals are paralyzed when faced with a clearly superior predator, and the Shark bring this attitude to the fight, purging all emotion from their mind to establish superiority. Before initiative is rolled (or before the Assessment roll in a iaijutsu duel) you can make an Intimidation/Awareness roll, contested by your opponent’s Honor/Willpower. If successful, you can add +5 to your Initiative roll, or to your Focus roll in a iaijutsu duel.

Using Intimidation makes your character to lose honor. Does using this rank still make me lose Honor?

Can the message from Acererak be translated into French without losing its hints?

I plan on running the Tomb of Horrors from the Tales of the Yawning Portal book, and I would like to play it in French, as we all are native French-speakers at the table.

In this dungeon, the players will get the following message from Acererak (spoilers ahead):

Are there hints in this message which only work in English? Is it possible to translate this message into French without losing any hints?