mathematics – Get the width and height (bounding box) change of an object on the screen after rotation

I am currently working on some tech art for a game and I hope my question is not too general for it to be posted in the game dev-exchange. Otherwise please let me know where I could post questions like this:

I would like to understand the math behind how the size of object’s bounding box on the screen change depending on their rotation. For example, if we take a 1 by 1 by 1 cube and just set it at the origin of the world, it would obviously have a width and height of 1 on the xy-plane (side view?).

But, what if I rotate the cube around an axis by 45 degrees? The width and height on the screen would increase, right? I am wondering by how much it would change and if there’s a general formula to calculate that. I’m sure there is, but my math skills are not very good and I’m not sure what exactly to google, so I was hoping someone would shine some light on this.

My end goal is to adjust the tiling of a texture in world space to stretch/shrink according to the object’s rotation to avoid seams. But, I am not sure how much I have to increase or decrease the tiling depending on how much and what axis I rotated the object on.

Change *default* refresh rate for monitors on Windows 7

I have multi-monitor setup and i’m trying to connect my TV as another monitor. TV doesn’t support 60 Hz refresh rate: when i’m enabling it in resolution&presentation screen it turns on, but there will be no picture on TV until i manually go into “additional settings” and lower refresh rate to 30 Hz for it.

Problem is – this setting resets whenever i change monitor configuration. Disable one of 2 monitors – refresh rate for TV resets to 60, no image. Add third monitor – 60 again. But worst part is – it also happens if i disable all other monitors – TV will reset to 60 and there will be no image.

I need to either:

  • force windows to set 30 Hz refresh rate as a default when new monitor is connected.
  • force windows to remember refresh rate for specific monitor.

Currently i’m fiddling with macro recorder to try to change refresh rate blindly, but that’s not exactly a great solution.

Unity – change API level

This question doesn’t demonstrate research effort. Searching Unity Android API Level will lead you to the documentation for Android Player Settings, including:

Minimum API Level Minimum Android version (API level) required to run the application.

Target API Level Target Android version (API level) against which to compile the application.

Here you’ll find a drop-down to select your target API level:

Screenshot of Unity project settings

rotation – How to change the geometry of the scene in Unity?

I’m trying to experiment with 3D spherical geometry in Unity, but it seems like Unity objects are inherently set in flat space. My first idea was to create a class inheriting from Transform that would override most of the methods, but I discovered that the transform member of a game object is read only so I cannot replace it with my custom class. I know this sort of thing is possible because the game Hyperbolica is being built in Unity using curved space. I have the math all figured out, I’m just not experienced with Unity. Anyone have other ideas for things I could try?

linear algebra – How to change the expression of the result of function `LinearSolve`

I want to solve the following linear equations:

$$left{begin{aligned}
x_{1}+3 x_{2}+x_{3} &=0 \
2 x_{1}+6 x_{2}+3 x_{3}-2 x_{4} &=0 \
-2 x_{1}-6 x_{2}-4 x_{4} &=0
end{aligned}right.$$

The form of the solution given in the textbook is as follows:

$$boldsymbol{X}=left(begin{array}{c}
x_{1} \
x_{2} \
x_{3} \
x_{4}
end{array}right)=left(begin{array}{rr}
-3 k_{1}-2 k_{2} \
k_{1} & 2 k_{2} \
k_{2}
end{array}right)=k_{1}left(begin{array}{r}
-3 \
1 \
0 \
0
end{array}right)+k_{2}left(begin{array}{r}
-2 \
0 \
2 \
1
end{array}right), quad k_{1}, k_{2} text { are arbitrary constants }$$

Solve({x1 + 3 x2 + x3 == 0, 
  2 x1 + 6 x2 + 3 x3 - 2 x4 == 0, -2 x1 - 6 x2 - 4 x4 == 0}, {x1, x2, 
  x3, x4})
LinearSolve({{1, 3, 1, 0}, {2, 6, 3, -2}, {-2, -6, 0, -4}}, {0, 0, 0})
NullSpace({{1, 3, 1, 0}, {2, 6, 3, -2}, {-2, -6, 0, -4}})

$$left{begin{aligned}
x_{1}+x_{2}-2 x_{3}-x_{4}=& 4 \
3 x_{1}-2 x_{2}-x_{3}+2 x_{4}=& 2 \
5 x_{2}+7 x_{3}+3 x_{4}=-2 \
2 x_{1}-3 x_{2}-5 x_{3}-x_{4}=& 4
end{aligned}right.$$

The form of the solution given in the textbook is as follows:

$$boldsymbol{X}=left(begin{array}{c}
x_{1} \
x_{2} \
x_{3} \
x_{4}
end{array}right)=left(begin{array}{r}
1 \
1 \
-1 \
0
end{array}right)+kleft(begin{array}{r}
-frac{2}{3} \
frac{1}{3} \
-frac{2}{3} \
1
end{array}right)=left(begin{array}{r}
1 \
1 \
-1 \
0
end{array}right)+k_{1}left(begin{array}{r}
-2 \
1 \
-2 \
3
end{array}right), quad k, k_{1} text { are arbitrary constants }$$

Solve({{1, 1, -2, -1}, {3, -2, -1, 2}, {0, 5, 7, 
     3}, {2, -3, -5, -1}}.{x1, x2, x3, x4} == {4, 2, -2, 4}, {x1, x2, 
  x3, x4})
LinearSolve({{1, 1, -2, -1}, {3, -2, -1, 2}, {0, 5, 7, 
   3}, {2, -3, -5, -1}}, {4, 2, -2, 4})
NullSpace({{1, 1, -2, -1}, {3, -2, -1, 2}, {0, 5, 7, 
   3}, {2, -3, -5, -1}})

But the solution form of the above code output is not the style of the textbook. How can we make the LinearSolve function output consistent with the result form of the textbook (arbitrary constant can be replaced by c)?

In addition, I have another problem. To prove that two linear equations have the same solution, we need the row vectors of their augmented matrices to be equivalent to each other.

For example, to prove that the linear equations represented by the following two matrices have the same system of solutions, I need to remove the meaningless zero row vector at the end:

RowReduce({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}})
RowReduce({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {2, 4, 6}})

I want to know what efficient way to get rid of the meaningless zero line vector at the end?

enter image description here

By the way, it’s inconvenient to customize the display size of the inserted images.

bootstrap 4 – Keep Getting Error When I Try To Change DatePicker Format In JQuery

I am using Bootstrap datepicker (MonthPicker) and want to change way it’s displayed on only the front end. I can successfully change the format at the backend, but I don’t want to do that as I want it to save in its original format.

To do this I did exactly as it says to do Here, but I keep getting the error

JQuery.Deferred exception: $(...).datepicker is not a function

My imports are

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>

(..main code block..)

<script type="text/javascript" src="{% static 'application/javascript.js' %}"></script>

There are quite a few posts on this same problem but I haven’t been able to get it working. As an example, this was marked as an answer on several posts

$.noConflict();
jQuery( document ).ready(function( $ ) {
    $('.datepicker').datepicker({
        format:"MMMM, YYYY"
    });
});

But I’ve had no luck with it. One of the most common things mentioned in the posts is script order. I am missing some of the scripts people mention so I added them

<script src="{% static 'node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js' %}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script>

to the bottom (before the main_code_block) but it didn’t help.

Thank you.

root access – Is it possible to change the userID of something like Fused Location Provider?

I have a bunch of apps bundled under userID on my stock rom, including Fused Location Provider. Since I’m using AFWall+ to block said userID to block said apps – it also breaks my location detection for Osmand.

Is there any way for me to change the userID it runs under? I have root available to me.

list manipulation – How can I use Part Assignment to change sublists into other sublists (without changing levels)?

Here’s a 5×5 grid. Using predefined starting points, I’d like to change some sublists into something else (e.g., the values for a color, “drawing an opaque box”).

list = 
{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}};

This seems simple enough, use the Part command to change all of the elements via:

Part({list}, startingrow;;endingrow, startingelement;;endingelement) = assignment;

(Now use the new list for whatever you like)

This works totally as expected if your list is just a bunch of integers.
Trying the one above…

list = 
{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}};
color1 = {0.529`, 0.808`, 0.922`};
row = 3;
start = 2;
Part(list, row - 1 ;; row + 1, start ;; start + 2) = color1;
list
(* Output:
{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, 0.529, 0.529, 0.529, {1, 1, 1}},
{{1, 1, 1}, 0.808, 0.808, 0.808, {1, 1, 1}},
{{1, 1, 1}, 0.922, 0.922, 0.922, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}}
*)

Not good! The Part function replaced the sublists with each element of the new sublist.
Putting the new sublist into a lower level almost works:

Part(list, row - 1 ;; row + 1, start ;; start + 2) = {color1};
list
(* Output:
{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {{0.529, 0.808, 0.922}}, {{0.529, 0.808, 0.922}}, {{0.529, 0.808, 0.922}}, {1, 1, 1}},
{{1, 1, 1}, {{0.529, 0.808, 0.922}}, {{0.529, 0.808, 0.922}}, {{0.529, 0.808, 0.922}}, {1, 1, 1}},
{{1, 1, 1}, {{0.529, 0.808, 0.922}}, {{0.529, 0.808, 0.922}}, {{0.529, 0.808, 0.922}}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}}
*)

But now all the new sublists are a level too far down. Both Flatten with 2 arguments and FlattenAt don’t appear to be able to rid specifically only these levels.

Is there a convenient way to get the desired output? (Shown Below)

{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}},
{{1, 1, 1}, {0.529, 0.808, 0.922}, {0.529, 0.808, 0.922}, {0.529, 0.808, 0.922}, {1, 1, 1}},
{{1, 1, 1}, {0.529, 0.808, 0.922}, {0.529, 0.808, 0.922}, {0.529, 0.808, 0.922}, {1, 1, 1}},
{{1, 1, 1}, {0.529, 0.808, 0.922}, {0.529, 0.808, 0.922}, {0.529, 0.808, 0.922}, {1, 1, 1}},
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}}

java – How do I change the value of a variable from another activity in android studio

I am creating a music app in android studio. I created a timer function and would like the music to stop playing when the timer finishes.

private void pauseMusic()
{
    player.pause();

    musicPosition = player.getCurrentPosition();

    btnPlayPause.setImageResource(R.drawable.play_btn);
}

Is it possible to call this function from my Timer activity ?

Or change the variable value from the code

  public void playOrPauseMusic(View view)
    {
        if (player == null)
            preparePlayer(); 

such as player = null from my Timer activity

sql server – Active Directory Name Change

Our Active directory will change the accounts name for example John Doe Jdoe@abcd.com to John.Doe@abcd.com.

My question is do I need to change all the SQL Logins individually or the person can login to SQL server management studio with their old names. What also happens if the login is an owner of a database or job.