virtualization – Google cloud VPC alias range

I have created 2 vms with two Ethernet(nic 0 & nic1) , nic0 is default range and for nic1 i created vpc 192.168.1.0/24 and 192.168.2.0/24 for alias ip . now form vm1 nic1 primary ip is 192.168.1.10 & secondary ip is 192.168.2.10/29 i create one virtual router in that vm and gave ip 192.168.2.11/29 so i can ping that ip from vm and from that virtual router also i can ping 192.168.1.10 & 192.168.2.10 now i create 2nd vm config same as vm1 for vm-2 nic1 ip is 192.168.1.20 now i try to ping 192.168.1.10,192.168.2.10&192.168.2.11 from vm-2 and i can ping 192.168.1.10 , 192.168.2.10 but i can notenter image description here ping 192.168.2.11 which is virtual app ip inside the vm-1 i also check packet capture i found that from vm-2 to 192.168.2.11 traffic hit also vm-1’s eth1 send ping reply but it is not reaching to vm-2 eth1

dnd 5e – Do opportunity attacks have disadvantage if I use my action to Dodge and then move out of melee range?

Dodge:

Until the start of your next turn, any attack roll made against you has disadvantage if you can see the attacker, and you make Dexterity saving throws with advantage.

Opportunity attacks require attack rolls, so they would all have disadvantage, as long as the attackers were not invisible.

That being said, I would recommend using disengage instead of dodge:

If you take the Disengage action, your movement doesn’t provoke opportunity attacks for the rest of the turn.

Now, instead of disadvantage, your opponents can’t attack at all.

Dodge and disengage both use an action. So you could do either of those for your action and still dash with your bonus action. So disengage would likely be better than dodge, unless there’s a possibility of getting attacked from range by other enemies, then dodge might be helpful for imposing disadvantage on those ranged attacks, unless you remember this clever trick: ranged attacks have disadvantage against a prone target.

You disengage with your action, then bonus action dash and get 60 feet away from your melee attackers. Then, if there are no more melee attackers within 30-40 feet of you, drop prone, and all ranged attacks will have disadvantage. When your turn comes back around, stand up and double dash for 75 feet of movement.

javascript – Como aumentar o valor do STEP no input Range conforme rolo a barra

tudo bem com vocês?

Bom, eu tenho um input range parecido com esse abaixo, bem simples que eu uso junto de uma funçãozinha em JS pra imprimir na tela o valor.

<input type="range" name="valor" class="slider" id="inputRange" value="0" min="0" max="1000000" step="1000">
var inputRange = document.getElementById("inputRange");
var printValue = document.getElementById("printValue");

printValue.innerHTML = inputRange.value;

inputRange.oninput = function() {
  printValue.innerHTML = parseInt(this.value).toLocaleString('pt-BR', { style: 'currency', currency: 'BRL' });
}

// Disparar o evento manualmente
var event = new CustomEvent("input");
inputRange.dispatchEvent(event);

Usei esse valor como exemplo, de 0 à 1 milhão com um step de 1 mil.

Eu gostaria saber se tem alguma forma deu delimitar esse step conforme o valor for aumentando, por exemplo: de 0 à 10 mil o step continue em 1 mil. De 10 mil à 100 mil o step seja 10 mil. De 100 mil à 500 mil o step seja 50 mil. De 500 mil à 1 milhão o step seja 100 mil e por aí vai…

Agradeço desde já.

dnd 5e – What range is used to determine targets for the victim of a Spectator’s Confusion Ray

The Spectator has an Eye Ray option, Confusion Ray, that says:

[The target] uses its action to make a melee or ranged attack against a randomly determined creature within range.

Unlike the spell Confusion which limits the attack to melee attacks, the Spectator’s victim can be compelled to make a ranged attack.

When determining the random target are creatures that are outside of the weapon’s normal range but within the weapon’s long range included?

For a specific example a Rogue with a light crossbow is hit by the ray and fails their save. On their turn there are three allies within 80 ft, and the Spectator is 90 ft away. Is there a chance that the Rogue randomly targets the Spectator?

Recommended color range for background color

I am building an online menu for restaurants.

The default background color is a light gray (#f1f3f5). The default text color is black (#555555). Example

Many of the restaurants have asked to use a custom color for the background. At first I said no, because users are not designers and use colors awfully… but after many requests I am starting to investigate a solution.

The idea is to allow the user to pick any color. Then the color is adjusted within a range.

In particular we would like to keep a light background with dark text on it.

So the solution was to use HSL and force L to a minimum of 0.9.

It has a sufficient effect, but I am not 100% satisfied.

Is there any study about the acceptable color range for a full-screen background (saturation, luminance)?

Split date range (timestamp) into equal parts by Month- SQL Server

Experts,
Have a question regarding splitting a date range into equal parts by months including the time part

example – fromdate – 06/29/2020 09:00:00 and todate – 06/29/2021 09:00:00

Want to split this date range into twelve equal parts like below

06/29/2020 09:00:00 - 06/30/2020 12:59:59
07/01/2020 00:00:00 - 07/31/2020 12:59:59
.........
.......
06/01/2021 00:00:00 - 06/29/2021 09:00:00

I cant write recursive CTE as this is a sql synapse module I am running against..

With below query I am able to split the date part, but time part is not coming properly as above.. Please help me as this is a blocking my development

declare @FromTs DATETIME
declare @ToTs DATETIME
SET @FromTs = GetDate()
SET @ToTs = DATEADD(month, 12, @FromTs)

;WITH n(n) AS 
(
    SELECT ROW_NUMBER() OVER (ORDER BY (object_id))-1 FROM sys.all_columns
),
d(qi,qrt,qtt,n,f,t,md,bp,ep,rn) AS  
(
    SELECT 
    ,n.n, @FromTs, @ToTs, 
    DATEDIFF(MONTH, @FromTs, @ToTs),
    DATEADD(MONTH, n.n, DATEADD(DAY, 1-DAY( @FromTs),  @FromTs)),
    DATEADD(DAY, -1, DATEADD(MONTH, 1, DATEADD(MONTH, n.n, 
    DATEADD(DAY, 1-DAY( @FromTs),  @FromTs))))
    FROM n INNER JOIN <datetbl> AS d 
    ON @ToTs >= DATEADD(MONTH, n.n-1, @FromTs)
)
SELECT qi,qrt,qtt,
new_from_date = CASE n WHEN 0  THEN f ELSE bp END,
new_to_date   = CASE n WHEN md THEN t ELSE ep END,rn
FROM d WHERE md >= n

Split date range (timestamp) into equal parts by Month- SQL Server Synapse

Experts,
Have a question regarding splitting a date range into equal parts by months including the time part

example – fromdate – 06/29/2020 09:00:00 and todate – 06/29/2021 09:00:00

Want to split this date range into twelve equal parts like below

06/29/2020 09:00:00 - 06/30/2020 12:59:59
07/01/2020 00:00:00 - 07/31/2020 12:59:59
.........
.......
06/01/2021 00:00:00 - 06/29/2021 09:00:00

I cant write recursive CTE as this is a sql synapse module I am running against..

With below query I am able to split the date part, but time part is not coming properly as above.. Please help me as this is a blocking my development

declare @FromTs DATETIME
declare @ToTs DATETIME
SET @FromTs = GetDate()
SET @ToTs = DATEADD(month, 12, @FromTs)

;WITH n(n) AS 
(
    SELECT ROW_NUMBER() OVER (ORDER BY (object_id))-1 FROM sys.all_columns
),
d(qi,qrt,qtt,n,f,t,md,bp,ep,rn) AS  
(
    SELECT 
    ,n.n, @FromTs, @ToTs, 
    DATEDIFF(MONTH, @FromTs, @ToTs),
    DATEADD(MONTH, n.n, DATEADD(DAY, 1-DAY( @FromTs),  @FromTs)),
    DATEADD(DAY, -1, DATEADD(MONTH, 1, DATEADD(MONTH, n.n, 
    DATEADD(DAY, 1-DAY( @FromTs),  @FromTs))))
    FROM n INNER JOIN <datetbl> AS d 
    ON @ToTs >= DATEADD(MONTH, n.n-1, @FromTs)
)
SELECT qi,qrt,qtt,
new_from_date = CASE n WHEN 0  THEN f ELSE bp END,
new_to_date   = CASE n WHEN md THEN t ELSE ep END,rn
FROM d WHERE md >= n

java – How to clamp a mouse angle within a field of view range of the facing direction

In my top down shooter game, the player can face in any of the 8 compass directions using the keyboard.

Depending on the direction, the player will have a 90 degree field of view to turn based on the angle selected by the mouse position. Obviously the mouse can go anywhere so it has to be restricted within -45 and 45 of the angle faced.

The eight direction angles:

    135 90 45
180            0
   225 270 305

So if the player is facing to the left at 180, their range of view will be -45 and 45 of that ie 135 to 225. So it’s simply mouseAngle - facingAngle, which works fine, except if the player is facing around 0, 45 or 305 degrees where the mouse angle passes zero causing issues in calculation.

As it is I’m using this formula.

private void setAngleFOV() {
    if (facing == 0 || facing == 360)
        facing = mouseAngle < 360 && mouseAngle >= 180 ? 360 : 0;
    angleFOV = mouseAngle - facing;
    angleFOV = Math.max(Math.min(angleFOV, 45), -45);
}

It can either be 0 or 360 for either facing or mouseAngle, whichever works best but I haven’t found an ideal solution. The above formula works for facing right at angle 0, but not with diagonal angles 45 and 305.

It could maybe work with lots of if statements and such, but I feel there must be a better way?

statistics – Are odds even at head and tail for random range?

I’m not a math guru. So treat me like a layman and excuse my informal language, I’ll be as precise as I can be given my limited vocabulary.

I want to know whether or not the odds are even across an entire range of picks that, given a randomly selected sub range, any picked number will fall within that sub range.

More concretely, if I pick real numbers at random between 0 and 1 (floats), would all such numbers including those close to say the head and tail (0, 1 respectively) have the same odds of occurring within a randomly selected sub range of a particular size?

I suspect the answer is no, because if I picked a sub range size that was more than 50 percent of the real numbers, some numbers between zero and one would have a 100 percent chance of falling within that range every time while others would not. Would it work if I constrained the sub range size to less or equal to than fifty percent?

At the end of the day, I want to randomly and evenly select data points that are within a small proximity to each other and I happen to be working with floats that were randomly generated between 0 and 1.

Thanks, I hope my question isnt a disaster… even being pointed in the right direction for research would be helpful.