Does exploration movement rate in Basic D&D (B/X) include trap/secret-door detection?

In the Basic Rulebook for D&D, on page B19, it states that characters can move 120′ in a dungeon per turn (10 minutes). Later it states that this movement assumes players are mapping carefully, searching, and trying to be quiet.

What is meant by ‘searching’? Are characters automatically getting a detect trap and detect secret door roll (every 10′ or per trap/door) as part of this movement rate? It seems unclear what searching exactly means in this context.

Can shadow arrow be used as a wand of enemy detection?

Magic exists which can divine the intentions of other creatures toward me.

"Wand of Enemy Detection"

While holding it, you can use an action and expend 1 charge to speak its Command Word. For the next minute, you know the direction of the nearest creature Hostile to you within 60 feet, but not its distance from you. The wand can sense the presence of Hostile creatures that are ethereal, Invisible, disguised, or hidden, as well as those in plain sight.

Arcane Archer: Shadow Arrow (emphasis mine)

You weave illusion magic into your arrow, causing it to occlude your foe’s vision with shadows. The creature hit by the arrow takes an extra 2d6 psychic damage, and it must succeed on a Wisdom saving throw or be unable to see anything farther than 5 feet away until the start of your next turn.

Abilities and Effects do what they say they do. There is no fluff in descriptions. As written, it appears that if I hit a creature with my Shadow Arrow, it does regular arrow damage plus 2d6 psychic damage. In addition, if the creature hit is my foe, it must make a Wisdom save or have its vision occluded.

Suppose I want to determine if an NPC of uncertain loyalty is my foe or not. I hit him with Shadow Arrows. If his vision becomes occluded, he must be my foe. If not, he is either not my foe or he has made his save.

  1. Does the Shadow Arrow really know who is my foe, similar to a wand of enemy detection, or does it assume that anyone I would shoot at must be my foe?

  2. If the latter, could an NPC that was trying to gain my trust volunteer to receive my arrow? Would that affect the result if they were being truthful? Deceptive?

  3. If my DM has me roll critical fails as attacks on allies when I fire into a melee, can I be confident that my shadow arrow will not be able to occlude the vision of anyone friendly to me?

Related: What is the definition of hostile?

What is the difference between "hostile" and "enemy"?

What is considered an enemy for an Orc's Aggressive trait?

Is there a limit on the “detection range” of Glyph of Warding’s trigger?

The conventional usage of a glyph of warding spell, exemplified by the “explosive runes” variant, is something like a magical land mine: step on or near it and it explodes, dealing damage in a small radius around the glyph itself. However, if one stores a spell with a long range and uses an appropriate trigger condition, it seems that the spell glyph form of glyph of warding could be used more like a single-shot turret. Consider these examples:

  • One could create a spell glyph containing a fireball spell (range 150 ft) with a trigger of “when a small or larger creature approaches within 150 feet” and place the glyph in the center of a room 300 feet across to effectively ward the entire room with a single glyph.

  • Going even further, one could imagine using a spell glyph as a magical alarm system, storing a loud spell (e.g. thunderwave or shatter) with a trigger of “when a drow approaches within 1 mile”. Such a glyph could act as an early warning system covering an entire castle or dungeon. (For bonus points, exploit the fact that the stored spell will be aimed in the direction of the triggering creature by placing bells of different pitches in the cardinal directions around the glyph, then determine the direction of approach based on which bell(s) ring the loudest.)

Either of both of these examples seems like they could be outside the intended power level for this 3rd level spell, but as far as I can tell, the spell’s text doesn’t explicitly rule out either example. In fact, I’ve intentionally phrased the above triggers to conform to the specific examples of “typical triggers” in the description (highlighted in bold):

You decide what triggers the glyph when you cast the spell. For glyphs inscribed on a surface, the most typical triggers include touching or standing on the glyph, removing another object covering the glyph, approaching within a certain distance of the glyph, or manipulating the object on which the glyph is inscribed. […]

You can further refine the trigger so the spell activates only under certain circumstances or according to physical characteristics (such as height or weight), creature kind (for example, the ward could be set to affect aberrations or drow), or alignment.

The lack of any apparent range limit is especially notable given that some spells with similar triggering mechanics do given an explicit range limit. For example, magic mouth requires the triggering circumstance to be observable within 30 feet:

The triggering circumstance can be as general or as detailed as you like, though it must be based on visual or audible conditions that occur within 30 feet of the object.

So, what, if anything, limits the “detection range” of the trigger for glyph of warding? Do either of the above examples work, or is there some part of the spell’s text, or some applicable rule, that prevents the glyph from detecting the triggering condition at that range? Is this entirely up to the DM’s discretion?

Source of RegEx examples of Secret Detection patterns in repositories?

Where can I find RegEx that can pattern match common secret strings?

I have a product that scans repos and commits and in case a developer tries to commit a secret (i.e. passwords, keys). It scans for roughly 30 patterns by default which seems insufficient given thousands of repos in over seventy languages. I can expand that scanning with RegEx. However, I don’t know every common secret there is.

Is there a framework, list, or tool that can provide RegEx or patterns for likely secrets?

Where can I get comprehensive lists of secret types?

Or am I doomed to writing a metric ton of RegEx then being held responsible for when something is missed?

Collision Detection without Coordinates in Tilemaps in Pygame

So if I wan’t to make a collision detection with rectangles, than I can just do this as I have the coordinates of the rectangle:

rcx = 200 rcy = 200 rcw = 200 rch = 100 plx = 500 ply = 450 plw = 50 plh = 50 rectcolor = (100, 150, 200)  testobj = pygame.draw.rect(win, rectcolor, (rcx, rcy, rcw, rch)) player = pygame.draw.rect(win, (150, 200, 100), (plx, ply, plw, plh))     if plx <= rcx + rcw and plx + plw >= rcx and ply <= rcy + rch and ply + plh >= rcy:     rectcolor = (50, 100, 50) else:     rectcolor = (100, 150, 200) 

Ok, good! I made a collision detection with rectangles because I know the coordinates of the rectangles. (I don’t think this is the most efficient way but it works) Anyways I am programming a Bomberman game, right now I don’t have any sprites but I use rectangles for it. This is my code:

import pygame  pygame.init()  WinWidth = 800 WinHeight = 608 p1x = 32 p1y = 32 vel = 1 clock = pygame.time.Clock()  win = pygame.display.set_mode((WinWidth, WinHeight))  def player():     pygame.draw.rect(win, (0, 200, 200), (p1x, p1y, 32, 32))  class invi:     def __init__(self, x, y):         self.x = x         self.y = y         pygame.draw.rect(win, (0, 255, 200), (x, y, 32, 32))   class Wall:     def __init__(self, x, y):         self.x = x         self.y = y         pygame.draw.rect(win, (50, 50, 50), (x, y, 32, 32))   class Breakable:     def __init__(self, x, y):         self.x = x         self.y = y         pygame.draw.rect(win, (200, 150, 100), (x, y, 32, 32))   game_map1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],              [0, 10, 10, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 10, 10, 0],              [0, 10, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 10, 0],              [0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0],              [0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0],              [0, 2, 2, 2, 2, 10, 10, 2, 2, 10, 2, 2, 10, 10, 2, 2, 2, 2, 0],              [0, 2, 0, 2, 0, 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 2, 0, 2, 0],              [0, 2, 2, 2, 2, 2, 0, 2, 2, 10, 2, 2, 0, 2, 2, 2, 2, 2, 0],              [0, 2, 0, 2, 0, 2, 0, 2, 10, 10, 10, 2, 0, 2, 0, 2, 0, 2, 0],              [0, 0, 0, 2, 2, 10, 10, 10, 10, 10, 10, 10, 10, 10, 2, 2, 0, 0, 0],              [0, 2, 0, 2, 0, 2, 0, 2, 10, 10, 10, 2, 0, 2, 0, 2, 0, 2, 0],              [0, 2, 2, 2, 2, 2, 0, 2, 2, 10, 2, 2, 0, 2, 2, 2, 2, 2, 0],              [0, 2, 0, 2, 0, 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 2, 0, 2, 0],              [0, 2, 2, 2, 2, 10, 10, 2, 2, 10, 2, 2, 10, 10, 2, 2, 2, 2, 0],              [0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0],              [0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0],              [0, 10, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 2, 0, 10, 0],              [0, 10, 10, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 10, 10, 0],              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]  run = True while run:      pygame.init()      clock.tick(100)     win.fill((0, 255, 200))     y = 0     for layer in game_map1:         x = 0         for tile in layer:             if tile == 0:                 Wall(x * 32, y * 32)             if tile == 10:                 invi(x * 32, y * 32)             if tile == 2:                 Breakable(x * 32, y * 32)             x += 1         y += 1      player()      for event in pygame.event.get():         if event.type == pygame.QUIT:             pygame.quit()             run = False     if event.type == pygame.KEYDOWN:         if event.key == pygame.K_d:             p1x += vel         elif event.key == pygame.K_a:             p1x -= vel      pygame.display.update() 

sooo… I watched a tutorial and even tried to make a collision detection on my own. But I just can’t do it. I don’t have coordinates for the rectangles in the tilemap and there are very much rectangles in the tilemap, too. How could you make a collision detection with a tilemap with no coordinates and many rectangles? And yeah, the game doesn’t have much stuff going un ’til now… oh and I deleted the parts where I tried to make a collision detection as they all were bad, didn’t work, took up much of the place and just made the whole code more confusing.

Btw if this is not a good question to ask in this StackExchange Q&A Website, sorry, im new to this Website. But I would still be happy to get an answer on this question! 🙂

Cycle detection with Mathematica

Suppose we have a recurrent process. And we know for sure that it is cyclical. That it has a period.

How do I find this period using Wolfram Mathematica?

An example process is provided here.

I am using code like this:

iteratedStates[init_]: = NestWhileList[process[#]&, init, Unequal, All];  period[init_]: = With[{data = iteratedStates[init]},     First@Differences@Flatten@Position[data, Last@data]     ]; 

It is not effective. I tried to implement various algorithms but their implementations were even slower ((

UPD. Yes, there is FindTransientRepeat
But here what we have:

data = ContinuedFraction[(Sqrt[12] + 2)/7, 10004]; Timing[Length@Last@FindTransientRepeat[data, 2]] {0.0624004, 6} Timing[First@Differences@Flatten@Position[data, Last@data]] {0.0156001, 6} 

I need store all data. So NestWhileList is needed. And it seems that my implementation is good enough

A pretrained model for mathematical equations characters detection

I am working on a project to convert equations to LaTeX code. After segmenting out the characters, I got stuck on the detection part and was looking for some pre-trained model that could detect characters of the equation for later conversion to LaTeX. Is there any such pre-trained model available on the internet that could be used in Python to identify characters. If not then can somebody share some source to find a dataset to train such kind of model in Keras? I was able to find one on GitHub but It doesn’t detect symbols accurately.