SQL Server – Finding a User Name in Instance Objects

If it's in the text of a proc / function, you can use the simple and free third-party plugin from redgate: SQL Search, there are also ways to do it with TSQL. See the answer to the question about stackexchange for searching procedures.

However, it is very likely that your proc will look for the value in a table that stores it, so it does not need to be hard-coded.
If you want to perform a simultaneous search in several columns, this link can be useful:
String search in different tables

architecture – Where should I place units and objects in a game based on the ECS in combat?

So I'm working on a game in which teams of various units would explore, fight, trade and build on a map of the world. The fight would be more or less automated and would take place in the overseas world. Basically, something like Mount & Blade but without the real-time fight of hack and slash.
enter the description of the image here

I'm using an ECS architecture, and even in the MVP steps, I'm confused: should every unit be an entity of the major entity pool, with an identifier pointing to the group it belongs to? Or should they be in an array of units in the squad entity?

When they start having objects, should every dagger and every startup be part of a gigantic pool of entities or exist only in units and inventories?

Acting skills and enchantments, buffs … a buff "+ 10% damage" floats among the houses and squads, knives and forests of the entity pool, or will it be part of an array of buffs?

I use Javascript with a homemade ECS, for quick and shareable iterations, as well as for learning.

database design – Reasons against having "concrete" values ​​in one's own table with only one ID column and the value itself, and composing larger objects ID

Here is a follow-up question on How to insert values ​​into a highly standardized database without excessive verification of duplicates?

The present situation:
We have a "massive" object that contains about 30 columns of detail (although it can be slightly improved, it is unfortunately largely tied, and can not be separated semantically). Each column simply contains an integer, an identification key.
We now have 30 additional tables, each with only 2 columns: "id" and "value", where ID is an automatically generated key and where value is the actual concrete value.

Whenever we want to retrieve the data from our large objects, we need to perform 30 joins from these "value" tables on the main table.

The reasons given are "a lot of data will be duplicated over the next 2-3 years" (it would be a stroke of luck if a value is used more than three times, and at most 20 times IMHO, but this point ) and any future changes to these values ​​would then be much easier. Also save storage space (which might be true, but for perhaps at most 200,000 records over 2 years, nothing that should be remarkable).

Now, I know intuitively some reasons why this design is bad. But I am still a novice myself and would like to know the good detailed reasons that I could actually present to change my mind and, perhaps, learn something new by myself.

Friendly reminder that the database commands we are talking about here are usually very basic insertion, selection and update methods (and very rarely joins). No one in our department has enough SQL experience (or would like to learn other than me) to go over these commands, and almost all the logic is executed on the server side after getting the data from the database .

dnd 5th – Can magical objects in the magic sense be detected in a holding bag?

Detecting magic will only detect the holding bag.

Detect Magic says:

you feel the presence of magic within 30 feet of you.

therefore all that is magic must be at this distance.

The bag of the outfit says:

If the bag is overloaded, pierced or torn, it will tear and tear.
destroyed and its contents are scattered in the astral plane.

which would seem to indicate that the space within it is itself part of the astral plane.

Since the astral plane is more than 30 feet away, nothing can be detected by Detect Magic.

Certainly, if the bag is within 10 meters of you, the content of DM may be that its content is also, and can be detected. However, even if it was, you might not know it as long as the content stays in the bag, because of the following Detect Magic text

If you feel the magic that way, you can use your action to see a weak
will have around everything visible creature or object

because, no doubt, as the bag itself would have an aura, you could not see the aura of anything in it, that its content is on the same plane (it would be extremely difficult to see a glimmer or an aura, a glow or an aura).

Your group has a viable option though:

If the bag is returned, its contents spread, unscathed,
but the bag must be replaced before it can be reused.

So, if you want them to use Detect Magic on the items they contain, you can ask them to flip the bag.

dnd 5th – Should we simply grant Wishes objects of similar potency to Wish's listed effects?

The Wish spell allows you to do one of three things:

(1) The basic use of this spell is to duplicate any other spell level 8 or lower.

(…)

(2) You can also create one of the following effects of your choice.

  • You create an item of up to 25,000 gp that is not a magic item. The object can not exceed 300 feet in any size and it appears in an unoccupied space visible on the ground.

(…)

(3) You may be able to achieve something that goes beyond the examples above. Express your wish to the SM as precisely as possible. The SM has a lot of room to decide what happens in such a case. The bigger the wish, the more likely something will go wrong. This spell can simply fail, the effect you desire may only be partially achieved or you may suffer unforeseen consequences due to the wording of the wish.

The difference between No. 2 and No. 3 is that the examples provided by No. 2 are entirely reliable: they will not fail / will not succeed in part / will be only monkey's leg, which could happen to a wish n ° 3.

So: how can a wish for something that is not among the examples 2, but that the DM thinks to have a similar or less power, be judged here? For example, the wish to constantly summon five (normal) horses. Not one of the examples, but clearly not a more powerful effect than the ones they provide. Would it be granted automatically (that is, as examples # 2) or unreliable at 100% (that is, it falls in # 3) ?

It looks like it depends exactly on what "goes beyond the scope of the examples above".

checkout – Magento 2.3: How to create a custom block with all objects added to the basket?

I use the theme of Porto. In addition to the available minicart sidebar, I'd like to create a custom block on the right with a sticky cart, so that customers can see what they've added and what they want to remove from their basket (without clicking on the minicart icon in the header). Similar to this: enter the description of the image here

I've tried using the recommended solution here: Magento 2 get cart elements in block class
I do not know why it does not work. I enclose the code below.

1) BDK / Mycartblock / Block / ShoppingCart.php

_checkoutSession = $checkoutSession;;
        parent::__construct($context, $data);
    }

    /**
     * Get quote object associated with cart. By default it is current customer session quote
     *
     * @return MagentoQuoteModelQuote
     */
    public function getQuoteData()
    {
        $this->_checkoutSession->getQuote();
        if (!$this->hasData('quote')) {
            $this->setData('quote', $this->_checkoutSession->getQuote());
        }
        return $this->_getData('quote');
    }
}

2) BDK / Mycartblock / etc / module.xml



    
    

3) BDK / Mycartblock / view / frontend / layout / default.xml

                                                     
 

        
           
            
        
    

4) BDK / Mycartblock / view / frontend / templates / my-template.phtml

getQuoteData();

foreach($quote->getAllVisibleItems() as $_item) {
    echo 'ID: '.$_item->getProductId().'
'; echo 'Name: '.$_item->getName().'
'; echo 'Sku: '.$_item->getSku().'
'; echo 'Quantity: '.$_item->getQty().'
'; echo 'Price: '.$_item->getPrice().'
'; echo 'Product Type: '.$_item->getProductType().'
'; echo 'Discount: '.$_item->getDiscountAmount();echo "
"; echo "
"; } ?>

The pls help to find the solution. Thank you all in advance!

What happens to characters and / or objects inside something that is banned?

What happens to other characters or objects inside the one banned?

  • Are they banished with that?
  • Do they stay behind and fall to the ground?
  • Is there a difference between what happens to characters and objects?

c # – Why are not my isometric objects where I think they are located?

I create an isometric RPG using Tiled and Monogamous. My goal is to have a relatively elaborate terrain and movement, my vision of the Earth world very much like that of the venerable Megaman Battle Network franchise. As such, by world must be in 3D and simply drawn on an isometric map assembled from tiles.

The Monogame.Extended system for drawing tiled maps does so mainly on its own, although I have chosen to draw one layer at a time and make all the necessary sprites between the drawing calls of the layer. Layers do not use the SpriteBatch I've configured to draw moving sprites and just take a translation. I managed to become decently adept at navigating in practical places.

Wikipedia says that for a good isometric scene, you want to rotate 45 degrees around Z and around 32 degrees around what in my system corresponds to X. In my case, the resulting transformation does not appear to match the X's. image of the map; I therefore use an angle of about 52 degrees around X, which matches quite well. However, although the map itself can be perfectly aligned with the collision system and I am able to walk perfectly on the edges, the objects on the map seem strangely placed. This may be due in part to my incorrect management of the Z index (rising world), but it seems more than that. When I align the image so that it aligns with it rather than the edges of the map, their size seems subtly incorrect. I have found that if my rotation X is negative, the (distant) objects seem slightly smaller than the way they are drawn. I could be misunderstanding, though.

I think it may just be a camera problem. Maybe the default camera is not spelled or otherwise. I do not really know how to solve this problem if that's the case, and if not, I'm puzzled by what's going on.

java – Model objects that behave in different ways to be stored in a collection?

Suppose I have a Player class with a Inventory:

public abstract class Player {

    private final List gameObjects;

    public Player(){
        this.gameObjects = new ArrayList();
    }

    public add(GameObject item);
    public drop()
}

I also have two items, night vision goggles and a tablet, with the following behaviors:

NVP:

Tablet:

  • switch on switch off
  • change the system date
  • schedule the backup
  • Change the user name

For basic use, I could have the following interface and implementation:

GameObject:

public interface GameObject {

    boolean prepare();
    boolean utilize();
    boolean cleanup();
}

Night vision goggles:

public final class NightVisionGoggles implements GameObject {

    // constructor left out

    @override
    public boolean prepare(){
        System.out.println("Turning on Night Vision")
    }

    @override
    public boolean utilize(){
        System.out.println("Looking around in the dark")
    }

    @override
    public boolean cleanup(){
        System.out.println("Taking off Night Vision")
    }
}

Tablet:

public final class DataPad implements GameObject {

    // constructor left out

    @override
    public boolean prepare(){
        System.out.println("Turning on Datapad")
    }

    @override
    public boolean utilize(){
        System.out.println("Browsing data")
    }

    @override
    public boolean cleanup(){
        System.out.println("Shutting down for the night")
    }
}

The missing properties are NVG zoom (0, 50, 100), tablet backup, system time and user name. Both are properties but obviously of different types.

Because both are the parameters of each object, I could restructure my interface like this:

public interface GameObject {

    boolean prepare();
    boolean utilize();
    boolean cleanup();

    boolean tryChange(String name, String value);
    boolean tryChange(String name, int value);
    boolean tryChange(String name, DataTime value);

    Map getSettings();
    Map getSettings();
}

This would mean that the objects would require at least 2 Maps. NVGs may return false for the tryChange(String name, DataTime value) method
and return an empty collection in the Map getSettings() method. The tablet can use the 3 because a number of parameters are either string, int
or LocalDateTime.

It does not seem fair to me that NVG is aware of the LocalDateime.

As the title indicates, without violating LSP and SRP How would you structure the interface and classes so that I can have the required behavior and store it in a collection?

All this assumes that the inventory of a player is only a collection. In real world games, I do not know how it is modeled or stored, but I do not want to avoid the problem.

Mathematics – How to find the rotation and position of the offset between two objects in 3D

I have two objects in 3 dimensions, one of them (Child) is attached to the other (Parent) using the offset between them (XYZ – position and rotation).
Using the Vector3 library, how can I find this Child compensations from Parent?

other explanation: let's say we have the parent at the position X:0 Y:0 Z:0 with rotations RX:0 RY:0 RZ:0, and there is a child attached to it with the shift X:10 Y:10 Z:10, RX:90 RY:45 RZ:90 (That's what I want to know). Supposedly, I had the parent with a different position and rotation, how can I get the gap between it and the child (which in this case it should be X:10 Y:10 Z:10, RX:90 RY:45 RZ:90) (in another word, I want it Child position and rotation as Parent is the center of the map)

I've tried simple maths and other methods on the Internet, but without success because I'm bad enough to calculate rotations (as vector3 libraries are pretty identical, so all languages ​​should fit).