Applying movement to a Rigid Body Isometric in Unity 3D

Im making an isometric dungeon crawler. I initially used transform to get isometric movement and things worked well, but i couldnt use collision which meant it was unsuitable. So im now trying to use Rigidbody and im having some weird issues. First of all, this is the code i currently have

public class CharControllerRigid : MonoBehaviour{     [SerializeField]     private Rigidbody characterRigid;     private Vector3 inputVector;     void Start()     {         characterRigid = GetComponent<Rigidbody>();        }      void Update()     {         inputVector = new Vector3(Input.GetAxis("Horizontal") * 10f, characterRigid.velocity.y, Input.GetAxisRaw("Vertical"));         transform.LookAt(transform.position + new Vector3(inputVector.x, 0, inputVector.z));           }     private void FixedUpdate()     {         characterRigid.velocity = inputVector;     } } 

So i have two issues, how do i get the movement to work on an isometric plain? And secondly how do i get the movement to work in all directions? Current when i move left and right the movement is good, but up and down are really slow in comparison.

What does “a spellcaster level” mean applying to monsters?

There is “a spellcaster level” mentioned in the MM:

A monster with the Spellcasting class feature has a spellcaster level and spell slots

Does “a spellcaster level” means basically “a sorcerer level” or “a wizard level” or any particular class level from the PHB, with all its features and restrictions (like spellbooks)? In this case, how do we define the exact class?

Or does that mean something different applying to monsters, which are not based on player classes? In this case, what does it mean exactly?

A relevant question: Where are the NPC mages' spellbooks in the Lost Mine of Phandelver adventure?

What does “a spellcaster level” mean applying to monsters?

There is “a spellcaster level” mentioned in the MM:

A monster with the Spellcasting class feature has a spellcaster level and spell slots

Does “a spellcaster level” means basically “a sorcerer level” or “a wizard level” or any particular class level from the PHB, with all its features and restrictions (like spellbooks)? In this case, how do we define the exact class?

Or does that mean something different applying to monsters, which are not based on player classes? In this case, what does it mean exactly?

A relevant question: Where are the NPC mages' spellbooks in the Lost Mine of Phandelver adventure?

Applying a function on several columns od a dataset fails on Missing

Consider a dataset with missing values:

ds={<|"timestamp" ->  DateObject[{2000, 1, 1, 1, 0, 0}, "Instant", "Gregorian", 2.],  "BASCH" -> 108., "BONAP" -> Missing["Unrecognized", "n/d"],  "PA18" -> 65.,  "VERS" -> 47.|>, <|"timestamp" ->  DateObject[{2000, 1, 1, 2, 0, 0}, "Instant", "Gregorian", 2.],  "BASCH" -> 104., "BONAP" -> 60., "PA18" -> 77.,  "VERS" -> 42.|>, <|"timestamp" ->   DateObject[{2000, 1, 1, 3, 0, 0}, "Instant", "Gregorian", 2.],  "BASCH" -> 97., "BONAP" -> 58., "PA18" -> 73.,  "VERS" -> 34.|>, <|"timestamp" ->  DateObject[{2000, 1, 1, 4, 0, 0}, "Instant", "Gregorian", 2.],  "BASCH" -> 77., "BONAP" -> 52., "PA18" -> 57.,  "VERS" -> 29.|>, <|"timestamp" ->  DateObject[{2000, 1, 1, 5, 0, 0}, "Instant", "Gregorian", 2.],  "BASCH" -> 79., "BONAP" -> 52., "PA18" -> 64., "VERS" -> 28.|>} 

I can get the mean of a given key easily, even with missing values:

no2[Mean, "BONAP"] (*64.0017*) 

But if I try to apply Mean to 2 columns, the Missing values become a problem:

no2[Mean, {"BONAP", "PA18"}] 

This returns a dataset with missing values. I suspect that this is not the right syntax, since in the first case the result is numeric, while the second operation returns a dataset. How does one apply a function to several columns?

Edit:

This works:

no2[Mean, #] & /@ {"BASCH", "BONAP", "PA18", "VERS"} 

But is not what I’m looking for. I’m looking for a way to do it within the framework of the dataset.

Applying subproblem technique to permutations with grouping

I am trying to apply overlapping subproblems and dynamic programming to permutations.

Say, we have a set of $ n$ elements in a string. Each of these elements could be a $ 1$ or a $ 0$ .

Given some string, I am trying to count the number of valid permutations- where a valid arrangement is defined as an ordering with no $ 1$ that stands alone from other 1s.

Example input string: $ 0101$

Example of valid arrangements: $ 1100, 0011, 0110$

Not valid: $ 0101, 1010, 1001$

EXPECTED OUTPUT: $ 3$

For example:

Say our input string contains four 1s and two 0s.

I suppose my difficulty is coming with defining the sub-problem. I initially thought I could set up a string with only the $ 0$ elements with slots/bins in between. $ [ ] 0 [ ] 0 [] $ , and then continue to use combinatorics to compute the number of additional arrangements possible with each 1 added in.

The first 1: 0 possibilities, because it will never have a 1 to accompany it.

Adding the 2nd 1: 3 possibilities, because the pair can go in either of the 3 slots.

Adding the 3rd 1: 0 new possibilities, because it must go with the other 2 ones, wherever they are.

Adding the 4th 1: We have enough to make 2 groups of $ 1$ s now… here is where I start getting unsure. I’d think it would be an additional 3 possibilities. $ \binom{3}{1} + \binom{3}{2} = 6$ total

Would anyone have an idea if I’m on the wrong track, or if not, how to proceed? This approach doesn’t seem like it works for larger values. Thanks!

Why is sudoers NOPASSWD option applying the exception to ROOT instead of specified user?

/etc/sudoers:

# This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults        env_reset Defaults        mail_badpass Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root    ALL=(ALL:ALL) ALL  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d  h ALL=NOPASSWD: /usr/bin/brightlight -i 20 -f /sys/class/backlight/amdgpu_bl0 

But doing the command still gives me a permission error.

h@pop-os:~$   brightlight -i 20 -f /sys/class/backlight/amdgpu_bl0 brightlight: could not open "brightness" file: Permission denied 

Also

h@pop-os:~$   sudo -l Matching Defaults entries for h on pop-os:     env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin  User h may run the following commands on pop-os:     (ALL : ALL) ALL     (root) NOPASSWD: /usr/bin/brightlight -i 20 -f /sys/class/backlight/amdgpu_bl0 

Things I have tried:

  • Rebooting
  • Creating a file in /etc/sudoers.d/brightlight with last line of config above

EDIT: Fixed, you need to add sudo, and it won’t prompt you for a password

Does applying a longer duration Charm effect extend the duration of Philter of Love’s love effect?

The item “Philter of Love”(DMG, p. 184) hast the following description:

The next time you see a creature within 10 minutes after drinking this philter, you become charmed by that creature for 1 hour. If the creature is of a species and gender you are normally attracted to, you regard it as your true love while you are charmed.

If the creature who was the first to be seen by the creature drinking the potion charmed the drinker, would the drinker continue to regard them as their true love while they are charmed? There’s no distinction that you must be charmed “in this manner” or by the effects of the potion.

So, would charming a creature affected by the Philter of Love extend the potion’s love effects for the duration of the charm?

SharePoint Column Conditional Formatting – Applying CSS classes to a date field using a nested IF statement

Apologies, I am relatively new to SharePoint/JSON, So forgive me if I am not seeing the obvious. I would be INCREDIBLY grateful if someone would help.

I would like to apply conditional formatting to a date field using a nested IF statement.

IF the current field is blank, then set the CSS class to ‘blocked’. However, if the current field is populated, run a second IF: IF the current field is more than 1 year before today, then set the CSS class to ‘blocked’, however if the current field is within the last year, set the CSS class to ‘good’.

I have ran the following, without success. No formatting is applied whatsoever.

 {    "$  schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",  "elmType": "div",  "attributes": {  "class": "=if(toString(@currentField)=='', 'sp-field-severity--blocked', if([@currentField]+31104000000 < @now,'sp-field-severity--blocked', 'sp-field-severity--good'))"   },  "txtContent": "@currentField"  } 

HOWEVER, when I split the conditions into two, they work independently.

  1. =IF empty, blocked, good.
{   "$  schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",   "elmType": "div",   "attributes": {     "class": "=if(toString(@currentField)=='','sp-field-severity--blocked', 'sp-field-severity--good')"   },   "txtContent": "@currentField" } 
  1. =IF exceeds 1 year, blocked, good.
{   "$  schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",   "elmType": "div",   "attributes": {     "class": "=if(@currentField+31104000000 < @now, 'sp-field-severity--blocked', 'sp-field-severity--good')"   },   "txtContent": "@currentField" } 

My next step would be to add the corresponding CSS class icon into the field.

Data Structure for applying transformations upon universe of tuples

Problem

I want a data structure which describes a universe of tuples all of length $ n$ , $ U$ . In $ U$ we associate each $ tuple$ with a non-negative value, which we will denote as $ U.count(tuple)$ . If $ U.count(tuple)=0$ , then we consider $ tuple$ to not be in $ U$ . I want to be efficiently update these $ U$ with five operations, some of which involve two fixed constants $ maxVal$ and $ minVal$ . (to clarify, $ maxVal$ and $ minVal$ should not change throughout the process, and should a tuple in $ U$ should never have a value which exceeds $ maxVal$ )

1) append(U,c): yields an updated universe $ U’$ , $ c$ should be below $ maxVal$ . For each tuple $ t$ in $ U$ , make a copy $ t’$ , and append $ c$ to $ t’$ . For each $ t’$ , $ U’.count(t’) = U.count(t)$ .

2) add(U,c,i): yields an updated universe $ U’$ . For each tuple $ t$ in $ U$ , we create a copy $ t’$ , and add $ c$ to $ t'[i]$ . If $ t'[i]<maxVal$ , then then $ t’$ is in $ U’$ and $ U’.count(t’) = U.count(t)$ . Otherwise $ U’.count(t’)=0$ and for our purposes we no longer need to keep track of it, and can exclude it from $ U’$ .

3) merge(U,i,j): yields an updated universe $ U’$ . For each tuple $ t$ in $ U$ , we create a copy $ t’$ , we pop $ t'[j]$ , and add its value to $ t'[i]$ . In this case, there can be multiple tuples $ t$ which correspond to $ t’$ in $ U’$ , thus let us initially say $ U’.count(t’)=0$ and then add to this. Now, if $ t'[i] < maxVal$ , $ U’.count(t’) = U’.count(t’) + U.count(t)$ .

4) finish(U,i): yields an updated universe $ U’$ . For each tuple $ t$ in $ U$ , we make a copy $ t’$ and delete $ t'[i]$ . Again, for the same reasons as in 2, let us initially say $ U’.count(t’) = 0$ . If $ t[i] > minVal$ , then $ t’.count = t’.count + t.count$ . At the end, all $ t’$ with non-zero count are included in $ U’$ .

5) combine(U1,U2): yields an updated universe $ U’$ , $ U_1$ and $ U_2$ should have same length tuples. For each $ t$ in $ U_1 \cup U_2$ , $ U’.count(t) = U_1.count(t) + U_2.count(t)$

My thoughts so far (messy)

If we did this naively, and represented $ U$ as a list of the tuples with non-zero, this would be horribly inefficient. Let’s assume $ U.count(t) \neq 0$ for all $ t$ that don’t exceed $ maxVal$ . Then, with $ maxVal = 10$ , a universe for tuples of length $ 4$ , that’s 10,000 if statements for the add operation…

I think one optimization would to have a tree, where the first level has nodes for each value of $ t[0]$ , and the child of a node are the next element in the tuple. I’d imagine you’d do this by having a list of all your first level nodes. Each node itself, is represented as a tuple of its value, and a list of its valid children, or $ U.count(t)$ for leaves. With add at lower levels, you have much less updates to do, and by ordering children in a fixed way according to their value, and keeping childless nodes as placeholders, your only need to do the validity check once too. Furthermore, to make append efficient, instead of having the levels be consecutive indices, we could make the order arbitrary, describe the tree-level to tuple index conversion with another list. For stuff like combine I am less sure what’s a good way to do things, maybe it would be beneficial to actually sum the counts of shared tuples, but maybe there are a clever cheats or work arounds…

My explicit questions

1a) Is there an efficient data-structure which performs these operations?

1b) Otherwise, are there some general rules of thumb for data structure which are relevant for this problem or my proposed solution?

2) Same as above but for the case where combine is applied to a very large number of universes, instead of just 2.