reactjs – Why do I need to hit enter in Web address bar with React Routes?

Working on a simple ReactJS/TypeScript project. My react routes rarley work unless I go to the address bar and hit enter on them, some times removing the query string.

https://www.dropbox.com/s/b7vx43eg8lk09d4/RouteBug.mov?dl=0

Thanks in Advance.

My Router component

 return (
    <>
      <Router history={browserHistory}>
        <Header />
        <Switch>
          <Redirect exact from="/" to={ROUTE_PATHS.LANDING} />
          <AppRoute path={ROUTE_PATHS.LANDING} component={PublicLanding} />
          <AppRoute path={ROUTE_PATHS.REGISTER} component={Register} />
          <AppRoute protected path={ROUTE_PATHS.DASHBOARD} component={Dashboard} />
          <AppRoute protected path={ROUTE_PATHS.FORMS} component={Forms} />
        </Switch>
        <Footer />
      </Router>
    </>
  );

And my AppRoute component:

const AppRoute: React.FC<IAppRouteProps> = ({
  protected: isPrivateRoute,
  component: Component,
  path,
  ...rest
}) => {
  const { keycloak } = useKeycloak();

  return (
    <Route
      {...rest}
      render={(props) =>
        !isPrivateRoute || (isPrivateRoute && keycloak.authenticated) ? (
          <Component {...props} />
        ) : (
          <Redirect from={path} to={ROUTE_PATHS.LANDING} />
        )
      }
    />
  );
};

❕NEWS – According To Google Trend Data, Cryptocurrency Searches Hit A New High | Proxies-free

Ever since Elon Musk criticize energy consumption of Bitcoin , the price has been falling drastically and this has made lots of people to search the word “Crypto Currency” Available data shows that the search by US residents on “Should I sell my bitcoin” in creased by 400%. It really not funny.

dnd 5e – Is there any magic item that increases Hit Points?

Ioun Stone of Fortitude (very rare) DMG p 176 increases your Con score by 2, so would give you 1 extra hp per level.

Manual of Bodily Health (very rare) DMG p 180 increases your Con score by 2, so would give you 1 extra hp per level.

Belt of Dwarvenkind (very rare) DMG p 155 increases your Con score by 2, so would give you 1 extra hp per level.

Amulet of Health (rare) DMG p 150 sets your Con score to 19. As you have 15 that would be 2 extra hp per level.

Gloves of Soul catching (legendary) Candlekeep Mysteries p 169 sets your Con score to 20. As you have 15, that would be 3 extra hp per level.

Do note that items that set your Con score to a flat value do not stack with other items that increase your con score.


There are also 5 items in the DMG that allow you to cast Wish and you could wish for an increase in constitution score. Namely: Luck Blade, Ring of Three Wishes, (Eye of Vecna + Hand of Vecna), Deck of Many Things (risky), Efreety Bottle (risky)

Why I think Wish would work: I know at least of one official campaign where a riddle has an ability score increase as a possible reward and wish as a less likely one. So the ability score increase is seen as the less powerful of the rewards. To me that is at least an indication that wish could grant an ability score increase.
Specifically here:

ToA area 70, 1d4+1 int increase on a 91-99, wish on a 100


Berserkers Axe (rare) DMG p 155 gives you a flat 1 hp per level. But it does come with a downside.


Some items also allow you to cast a spell that can grant you temp hp. But that would not be a permanent increase of health.

memory access – How does changing cache size and/or block size affect the hit rate of the for loops in the following code?

I am working on practice problems to study for an upcoming exam. I am given the following piece of code:

#define LEAP 4
#define SIZE 64
int foo(SIZE);
// Assume foo has been initialized to contain values.
// Assume the cache starts empty at this point.
for (int i = 0; i < SIZE; i += LEAP) { // Loop 1
  foo(i) = foo(i) + i * (i + 2);
}
for (int j = 1; j < SIZE; j += (LEAP * 2)) { // Loop 2
  foo(j) = foo(j) + j * 5;
}

I have a direct-mapped cache containing 128 bytes with a cache block size of 32 bytes. The cache uses LRU replacement and write-allocate and write-back policies. I also need to assume i and j are stored in registers, the array foo starts at address 0x0, and the cache starts out empty. I already determined the hit rate for both Loop 1 and Loop 2, however, I am exploring more into this problem than what is asked as an exercise.

Assuming that all factors remain the same as shown in the original code, how would changing cache size (say from 128 bytes to 256 bytes) affect the hit rate of both loops? Similarly, how would changing the block size (say from 32 bytes to 16 bytes) affect the hit rate of both loops?

My initial assumption would be that if we increased the cache size, then that would increase the hit rate of both loop 1 and loop 2 because it would reduce misses. For decreasing block size, then the hit rate would increase for both loop 1 and loop 2 because if block size was increased, then there would be a decreased number of entries in the cache and it will take more time to fetch block size from memory.

Is my logic incorrect? If so, can someone explain what would happen in terms of the hit rate in both loops by implementing the changes I am suggesting. I am still a little unsure of what I claim would be true. Any feedback or suggestion in helping me answer this conceptual question would be greatly appreciated.

magento2.3.2 – graphql product query huge perfomance hit when filtering with multiple attributes

I have used the below GRAPHQL query to get the product list.

{
  products(filter: {category_id: {eq: "77"},color:{in:("5437","5438","5449")}, price:{from:"100", to:"200"},paint_usability:{in:("5554")},paint_quantity:{in:("5553","5546")}, approval:{in:("2", "4")}}, pageSize: 10, sort: {name: DESC}) {
}

but It will take time to get the product data. I have enabled SQL log and I find one query to load the time

INSERT INTO `search_tmp_60a797f2ed7ce8_60598401` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT  `search_index`.`entity_id`, (((0) + (0) + (0) + (0) + (0) + (0) + (0)) * 1) AS `score` FROM `catalog_product_index_eav` AS `search_index`
 INNER JOIN `cataloginventory_stock_status` AS `stock_index` ON stock_index.product_id = search_index.entity_id AND `stock_index`.`website_id` = 0 AND `stock_index`.`stock_id` = 1
 INNER JOIN `catalog_product_index_eav` AS `color_filter` ON `search_index`.`entity_id` = `color_filter`.`entity_id` AND `color_filter`.`attribute_id` = 93 AND `color_filter`.`store_id` = 1
 INNER JOIN `catalog_product_index_eav` AS `approval_filter` ON `search_index`.`entity_id` = `approval_filter`.`entity_id` AND `approval_filter`.`attribute_id` = 165 AND `approval_filter`.`store_id` = 1
 INNER JOIN `catalog_product_index_eav` AS `paint_quantity_filter` ON `search_index`.`entity_id` = `paint_quantity_filter`.`entity_id` AND `paint_quantity_filter`.`attribute_id` = 197 AND `paint_quantity_filter`.`store_id` = 1
 INNER JOIN `catalog_product_index_eav` AS `paint_usability_filter` ON `search_index`.`entity_id` = `paint_usability_filter`.`entity_id` AND `paint_usability_filter`.`attribute_id` = 198 AND `paint_usability_filter`.`store_id` = 1
 INNER JOIN `cataloginventory_stock_status` AS `color_filter_stock_index` ON color_filter_stock_index.product_id = color_filter.source_id AND `color_filter_stock_index`.`website_id` = 0 AND `color_filter_stock_index`.`stock_id` = 1
 INNER JOIN `cataloginventory_stock_status` AS `approval_filter_stock_index` ON approval_filter_stock_index.product_id = approval_filter.source_id AND `approval_filter_stock_index`.`website_id` = 0 AND `approval_filter_stock_index`.`stock_id` = 1
 INNER JOIN `cataloginventory_stock_status` AS `paint_quantity_filter_stock_index` ON paint_quantity_filter_stock_index.product_id = paint_quantity_filter.source_id AND `paint_quantity_filter_stock_index`.`website_id` = 0 AND `paint_quantity_filter_stock_index`.`stock_id` = 1
 INNER JOIN `cataloginventory_stock_status` AS `paint_usability_filter_stock_index` ON paint_usability_filter_stock_index.product_id = paint_usability_filter.source_id AND `paint_usability_filter_stock_index`.`website_id` = 0 AND `paint_usability_filter_stock_index`.`stock_id` = 1
 INNER JOIN `catalog_product_index_eav` AS `visibility_filter` ON search_index.entity_id = visibility_filter.entity_id AND `visibility_filter`.`attribute_id` = 99 AND `visibility_filter`.`value` in ('2', '4') AND `visibility_filter`.`store_id` = '1'
 INNER JOIN `catalog_category_product_index_store1` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '1'
 INNER JOIN `catalog_product_index_price` AS `price_index` ON search_index.entity_id = price_index.entity_id AND price_index.website_id = '1' WHERE (search_index.store_id = '1') AND (category_ids_index.category_id in ('77')) AND (`price_index`.`min_price` >= '100' AND `price_index`.`min_price` <= '200' AND `price_index`.`customer_group_id` = 0) AND (color_filter.value  IN ('5437','5438','5449')) AND (approval_filter.value  IN ('2','4')) AND (paint_quantity_filter.value  IN ('5553','5546')) AND (paint_usability_filter.value  IN ('5554'))) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC, `entity_id` DESC
 LIMIT 9223372036854775807

any solution on this?

dnd 5e – Can a Maurezhi raise an undead hit by a cleric’s Destroy Undead?

Yes, it probably can, but it will depend on the DM’s ruling

In normal English usage, when we say something is destroyed, that usually means it has suffered quite extreme damage, beyond any effective repair; and if we were to use it to describe the body of what had been a living creature, it would strongly suggest that beyond simply being killed the body had suffered quite catastrophic damage. However, it does not suggest that the body has evaporated into thin air or is otherwise completely removed from consideration – there are still remains to inspect.

To “destroy” or be “destroyed” is never given any special definition by the rules of the game, so we rely on the context it is used in and the normal English meaning to understand what is meant when something is destroyed. However, it seems most likely to me that “destroyed” is used in this case to be equivalent to being “killed” – and the word choice is simply because sometimes the writers think it does not make sense to say that an undead creature is “killed”, because they’re not strictly alive. There are a few examples of this kind of use of “destroyed” throughout the published texts.

The description of a certain artifact from Curse of Strahd mentions “destroying” Strahd, as opposed to killing him:

The Sunsword’s special purpose is to destroy Strahd, (…)

The Bonecounter from Sleeping Dragon’s Wake uses the language:

Whenever this weapon is used to destroy an undead creature (…)

Neither of these items has any special property that would more thoroughly obliterate an undead creature beyond their normal ability to hit things.

The description of the Grave Cleric, as well, states:

Followers of these deities seek to put wandering spirits to rest, destroy the undead, and ease the suffering of the dying.

In full context, I don’t think there’s any reason to believe that the “destruction” that would be caused to a ghoul by a Cleric’s ability to Destroy Undead is intended to be more thorough than the “destruction” that would be caused by thwacking one a few times with the Bonecounter. It’s simply that the undead are described as “destroyed”, rather than “killed”.

There is a fair argument that the game rules are unclear about this, and it is certainly the case that many DMs would describe the Cleric’s power to destroy undead as vaporising the unfortunate creatures or turning them to ash or dust; in those circumstances, it does seem unreasonable that a Maurezhi could eyeball a pile of ghoul ash and cause it to spontaneously pop back up into a healthy ghoul again. However, it’s also a valid interpretation of the Cleric’s ability that an affected undead creature simply loses their animating force and falls down dead without the physical body being any worse for wear.

Ultimately, the rules are not explicit about the results, so it’s the DM’s call whether or not a “destroyed” undead creature is a valid target for the Maurezhi; but I at least would rule that it is, and normal amounts of destruction are within the Maurezhi’s power to reverse (unlike, say, a ghoul that was disintegrated).

spells – Critical hit with Acid Splash: how much damage?

Normal +1 persistent

Acid Splash involves an attack roll but is not a Strike and does not benefit from automatic double damage.

If you critically succeed at a Strike, your attack deals double damage. Other attacks, such as spell attack rolls and some uses of the Athletics skill, describe the specific effects that occur when their outcomes are critical successes.

Acid Splash specifies

If you hit, you deal 1d6 acid damage plus 1 splash acid damage. On a critical success, the target also takes 1 persistent acid damage.

The persistent is in addition to its normal damage, not any other bonus.

dnd 5e – In DnD 5e, how you nerf the circle of the moon archdruid ability to prevent infinite hit points as a DM?

So I know a lot of people argue that infinite wild shape “isn’t that overpowered” but I still think gaining upwards of 200 hit points per turn is a bit broken, especially compared to other level 20 abilities like the ranger, who just get to add a wisdom bonus. How would one go about nerfing it so they still are strong, but not un-killable?

dnd 5e – Are there any feats that increase hit points?

I agree that the Tough feat is the most effective at raising an individual PC’s Hit Point maximum (PHB, p.170). It is the equivalent of a +4 to Constitution, without the benefit to saving throws and other game mechanics such as holding breath.

There are other feats that provide +1 to Constitution:

  • Aberrant Dragonmark, ERLW p.52
  • Durable, PHB p.166
  • Dwarven Fortitude, for dwarves XGE, p.74
  • Infernal Constitution, for tieflings XGE, p.75

Thera are also feats that provide you with an option of choosing +1 Constitution:

  • Chef, TCE p.79
  • Crusher, TCE p.79
  • Dragon Fear, for dragonborn XGE p.74
  • Dragon Hide, for dragonborn XGE p.74
  • Orcish Fury, for half-orcs XGE p.75
  • Resilient, PHB p.168
  • Second Chance, for halflings XGE p.75
  • Skill Expert, TCE p.80
  • Tavern Brawler, PHB p.170

It’s also worth pointing out that the feat that can potentially increase the most amount of Hit Points for the greatest number of characters in a party of six is: Inspiring Leader (PHB, p.167)!

A 20th level character with the Tough feat will have an additional +40 hit points.

A 20th level character using Insipiring Leader on a party of six with a Charisma score of 20 (+5), would provide: 25 HPs to each character; so 150 temporary HPs for a party of six.

The characters can benefit from this feat after a short or a long rest. So potentially, in most campaigns where players choose to have 1 long-rest and 2 short-rests. This would mean that each PC could get +75 HPs over a day’s time, and it would be wopping 450 HPs in total if all six party members benefit.

You do need to consider where you pool your ability points though as at lower levels to get the most out of Inspiring Leader the character that uses it needs to have a high Charisma score. This is not always a bad option though as it will have good synergy with the Intimidation skill which if you are proficient in can prevent you from even having to fight in the first place. If you are lucky, you might be able to talk a player with a high Cha score in your group into taking this feat.

Lastly, I think it’s important to note that, because you are a Fighter, it may be worth considering a combination of increasing your maximum or temporary pool of HPs as well as working on getting a high Armour Class. The AC may save your bacon more than a large pool of HPs because the creatures might not even be able to hit you. If you are subject to lots of critical hits it may be worth considering Adamantine Armour as well as this will turn a critical hit into a normal hit (DMG, p.150).