## linear transformations – Range of a function defined by a matrix

I am studying vector calculus, and I encountered a question, which I find the solution to this question somewhat colliding with my knowledge of linear algebra.
The question is this.

Consider the function $$f:R^2rightarrow R^3$$ given by $$f(x)=Ax$$, where A=$$begin{bmatrix} 2 & -1 \ 5 & 0 \ -6 &3 end{bmatrix}$$ and the vector $$x$$ in $$R^2$$ is written as the 2×1 column matrix x=$$begin{bmatrix} x_1 \ x_2 end{bmatrix}$$
Describe the range of f.

From what I learned in my linear algebra course, f is a linear transformation with a standard matrix as A, and therefore the range of A is a span of the column vectors of A. So I thought that since the column vectors are linearly independent, the range is a plane in $$R^3$$ spanned by two vectors (2, 5, -6) and (-1, 0, 3).
However, the solution manual had a different answer, it said that $$f(x)=(2x_1-x_2, 5x_1, -6x_1+3x_2)$$
and since $$f_3(x_1, x_2)=-6x_1+3x_2=-3(2x_1-x_2)=-3f_1(x_1, x_2)$$
The range of f would be all of $$y=(y_1, y_2, y_3)$$ in $$R^3$$ such that $$y_3=-3y_1$$.

## tensors – How is Grad defined for array particularly in non-Cartesian coordinates?

This question can be viewed as a follow-up of

What is the definition of Curl in Mathematica?

First argument of `Grad` can be an array, but what definition does Mathematica use for gradient of an array? Document of `Grad` is rather brief on this topic. The following seems to be the only related paragraph in Details section:

In $$text{Grad}[f,{x_1,…,x_n},chart]$$, if $$f$$
is an array, it must have dimensions $${n,…,n}$$. The components
of $$f$$ are interpreted as being in the orthonormal basis associated with
$$chart$$.

In Properties & Relations section the following hint is included:

The gradient of an array equals the gradient of its components only in Cartesian coordinates.

And I can’t find anything more in the document.

After reading some material about tensor, I guess it’s something related to covariant derivative, but I fail to go further.

## Can the interval defined in the fundamental theorem of calculus be \$[-infty,infty]\$?

With regards to the fundamental theorem of calculus, the statement defines a continuous function $$f$$ inside a closed interval $$(a,b)$$. Most examples I can find online uses finite numbers for $$a$$ and $$b$$. However, start at the bottom of page 12 of this problem set, the solution involves using the theorem where the one of the limits is $$infty$$ or $$-infty$$. Is this valid because $$(-infty,infty)$$ is considered both open and closed per this answer?

## real analysis – Convergence of a sequence defined by a piecewise recurrence relation.

Test for convergence of the sequence $$langle u_nrangle,$$ where $$u_1=7$$ and
$$u_n=begin{cases}5u_{n-1}+1,&text{ if }u_{n-1}text{ is odd}\\ frac{u_{n-1}}2,&text{ if }u_{n-1}text{ is even}end{cases}$$ for all natural numbers $$nge2.$$

This is a piecewise defined sequence. If it was defined by a single case then I could have tried to express $$u_n$$ in terms of the base value $$u_1$$ and then I would apply the limit test. But since there are two cases so it has become difficult for me to draw a conclusion. How to approach this problem? Please give me some hints. Thanks in advance.

## regex – Is the “.sha256” file format formally defined somewhere? How should it be parsed?

I see a bunch of FOSS projects which have “.sha256” files. They look something like this:

``````dsdfdfdsffdfsdfdsfdsfdsfdsfdsfds23r2ewrefdefdsfdsgfdsgffgfkgdfgg     *meow.exe
Asdfdfdsffdfsdfdsfdsfdsfdsfdsfds23r2ewrefdefdsfdsgfdsgffgfkgdfg3     cool_stuff.exe
dsdfdfdsfDdfsdfdsfdsfdsfdsfdsfds23r2ewrefdefdsfdsgfdsgffg3kgdfgg     even_more_stuff.exe
``````

I currently get these out with:

``````#^((A-Za-z0-9){64})s+(S+)\$#um
``````

That will match `dsdfdfdsffdfsdfdsfdsfdsfdsfdsfds23r2ewrefdefdsfdsgfdsgffgfkgdfgg` and `*meow.exe`, etc. Filenames that mysteriously begin with an asterisk (I’ve countless times tried to look this up without getting any wise as to what this means) are stripped off their beginning `*`.

Is there anything more to it than that? What happens if the filenames have spaces in them instead of underscores? Then my regexp breaks down. Can they be quoted? If so, is Linux (single quotes) or Windows-style (double quotes) quoting used?

This seemingly simple file format actually has countless questions associated with it, but I don’t see it defined anywhere. Nor have I ever so far encountered filenames which use spaces or quotes of any kind. But they do use asterisks, which apparently can also appear in the end of the filename…

How should this madness be parsed to not break one day?

## Where are Windows Key shortcuts defined? Specifically for Snipping Tool

On Windows Server 2016, the Snipping Tool comes up in capture mode when I invoke Windows + Shift + S. In Windows 10, I can mimic this behavior by running “snippingtool.exe /clip” but this does not work in Windows Server 2016.

I’d like to figure out what Windows is doing when the Windows + Shift + S keystroke is used because I want to enter this same capture mode directly from a Powershell script.

I’d think this is somewhere visible in the Registry as I recall it being so in old version of Windows CE but I cannot find the equivalent in Windows Server.

Where is this information stored?

## Do we have an option to change/override the drupalsettings variable which is defined by some other module through our custom module?

Do we have an option to change/override the drupalsettings variable which is defined by some other module through our custom module ?

Here: by `drupalsettings`, I am asking about the Drupal behaviors variable.

## t sql – User-defined function returns first character only although RETURN VARCHAR(10) is defined?

Everyone,

I cannot figure out what is missing in the below user-defined function:

``````CREATE OR ALTER FUNCTION ufn_GetSalaryLevel(@Salary money)
RETURNS VARCHAR(10)
AS
BEGIN
IF (@Salary < 30000) RETURN 'Low';
ELSE IF (@Salary <= 50000) RETURN 'Average';
ELSE RETURN 'High';
RETURN '';
END;

SELECT dbo.ufn_GetSalaryLevel(100440)
``````

The output is including only the first character of the ‘Low’/’Average’/’High’ return values:

``````-----------------------------------------------------------------------
H

(1 row affected)
``````

Why is MS SQL Server Management Studio not taking the VARCHAR(10) into account?

## linear algebra – Is “T : R → R defined by T(x) = 1” an isomorphism?

In my textbook, I have come across the following linear transformation:

T : R → R defined by T(x) = 1

I am confused as to whether this transformation is an isomorphism or not. If all x in T(x) yield the same value, would this function not be one-to-one and thus not be an isomorphism?

## python – NameError: name ‘PlayerIG’ is not defined

I have just started learning Python and decided to get extra practice and followed an youtube tutorial on how to create an adventure text-based game. Because the video was old, I made a few changes for Python 3.8 and added a few extra options for better navigation.

The current issue I’m running is `NameError: name 'PlayerIG' is not defined`. In the tutorial, the programmer made that variable global.
That didn’t work, so I passed as a parameter and it was working fine until a few other errors started to occur: EAttack was getting the same error `(NameError: name not defined)`, but I made it global and that seemed to work until it didn’t.
I tried to pass PlayerIG into all functions that used it, but that didn’t solve the problem either.
PlayerIG is essential for the fighting system, please help me understand why it is not being recognized anymore.

Another issue is that in @property, the variable attack is not updating self.base_attack inside the Player class why is that happening if I used return?
I have shared all the code bellow.
This is the tutorial I was following //
This is the original code shared by the owner of the tutorial

``````import sys
import os
import random
import pickle

weapons = {"Great Sword":40}

class Player:
os.system('clear')
def __init__(self, name):
self.name = name
self. maxhealth = 100
self.health = self.maxhealth
self.base_attack = 10
self.gold = 0
self.pots = 0
self.weap = ("Rusty Sword")
self.curweap = ("Rusty Sword")

@property
def attack(self, base_attack):
attack = self.base_attack
if self.curweap == {"Rusty Sword"}:
attack += 5

elif self.curweap == {"Great Sword"}:
attack += 15

return attack

class Goblin:
os.system('clear')
def __init__(self, name):
self.name = name
self. maxhealth = 50
self.health = self.maxhealth
self.attack = 5
self.goldgain = 10
self.pots = 1
GoblinIG = Goblin("Goblin")

class Zombie:
os.system('clear')
def __init__(self, name):
self.name = name
self. maxhealth = 70
self.health = self.maxhealth
self.attack = 7
self.goldgain = 15
self.pots = 2
ZombieIG = Zombie("Zombie")

def main():
os.system('clear')
print("Welcome to my game!n")
print("1.) Start")
print("3.) Exit")

option = input("--> ")
if option == "1":
start()
elif option == "2":
if os.path.exists("savefile") == True:
os.system('clear')
with open('savefile', 'rb') as f:
option = input("--> ")
start1(PlayerIG)
else:
print("You have no save file for this game.")
option = input("--> ")
main()
elif option == "3":
sys.exit()
else:
main()

def start():
os.system('clear')
option = input("--> ")
PlayerIG = Player(option)
start1(PlayerIG)

def start1(PlayerIG):
os.system('clear')
print("Name: %s" % PlayerIG.name)
print("Attack: %i" % PlayerIG.base_attack)
print("Current Weapons: %s" % PlayerIG.curweap)
print("Health: %i/%i" % (PlayerIG.health, PlayerIG.maxhealth))
print("Gold: %i" % PlayerIG.gold)
print("Pots: %i" % PlayerIG.pots)
print("1.) Fight")
print("2.) Store")
print("3.) Inventory")
print("4.) Save")
print("5.) Exit")
option = input("--> ")
if option == "1":
prefight()
elif option == "2":
store()
elif option == "3":
inventory()
elif option == "4":
os.system('clear')
with open('savefile', 'wb') as f:
pickle.dump(PlayerIG, f)
print("nGame has been saved!n")
option = input(' ')
start1(PlayerIG)
elif option == "5":
sys.exit()
else:
start1(PlayerIG)

def inventory():
os.system('clear')
print("What do you want to do?")
print("1.) Equip Weapon")
print("2.) Drink a potion")
print("b.) Go back")
option = input(">>> ")
if option == "1":
equip()
elif option == "2":
drinkpot()
elif option == 'b':
start1(PlayerIG)

def equip():
os.system('clear')
print("What do you want to equip?")
for weapon in PlayerIG.weap:
print(weapon)
print("(b) to go back")
option = input(">>> ")
if option == PlayerIG.curweap:
print("You already have that weapon equipped")
option = input("--> ")
equip()
elif option == "b":
inventory()
elif option in PlayerIG.weap:
PlayerIG.curweap = option
print ("You have equipped %s." % option)
option = input("--> ")
equip()
else:
print("You don't have %s in your inventory" % option)
start1(PlayerIG)

def prefight():
os.system('clear')
global enemy
enemynum = random.randint(1, 2)
if enemynum == 1:
enemy = GoblinIG
else:
enemy = ZombieIG
fight(PlayerIG)

def fight(PlayerIG):
os.system('clear')
print("%s        VS        %s" % (PlayerIG.name, enemy.name))
print("%s's Health: %d/%d  %s's Health: %i/%i" % (PlayerIG.name, PlayerIG.health, PlayerIG.maxhealth, enemy.name, enemy.health, enemy.maxhealth))
print("Potions %i" % PlayerIG.pots)
print("1.) Attack")
print("2.) Drink potion")
print("3.) Run")
option = input("--> ")
if option == "1":
attack()
elif option == "2":
drinkpot()
elif option == "3":
run()
else:
fight(PlayerIG)

def attack():
os.system('clear')
PAttack = random.uniform(PlayerIG.base_attack / 2, PlayerIG.base_attack)
global EAttack
EAttack = random.uniform(enemy.attack / 2, enemy.attack)
if PAttack == PlayerIG.base_attack / 2:
print("You miss!")
else:
enemy.health -= PAttack
print("You deal %i damage!" % PAttack)
option = input("--> Press Enter.")
if enemy.health <= 0:
win()
os.system('clear')
if EAttack == enemy.attack/2:
print("Enemy missed.")
else:
PlayerIG.health -= EAttack
print("The enemy deals %i damage!" % EAttack)
option = input("--> Press Enter. ")
if PlayerIG.health <= 0:
else:
fight(PlayerIG)

def drinkpot():
os.system('clear')
if PlayerIG.pots == 0:
print("You don't have any potion!")
fight(PlayerIG)
else:
PlayerIG.health += 50
if PlayerIG.health > PlayerIG.maxhealth:
PlayerIG.health = PlayerIG.maxhealth
PlayerIG.pots -= 1
print("You drank a potion!")
print("1.) Go to fight")
option = input("--> ")
if option == "1":
fight(PlayerIG)
elif option == "2":
start1(PlayerIG)

def run ():
os.system('clear')
runnum = random.randint(1, 3)
if runnum == 1:
print("You have successfully ran away!")
option = input("--> ")
start1(PlayerIG)
else:
print("You failed to get away!")
option = input("--> ")
os.system('clear')
if EAttack == enemy.attack/2:
print("Enemy missed.")
else:
PlayerIG.health -= EAttack
print("The enemy deals %i damage!" % EAttack)
option = input("--> ")
if PlayerIG.health <= 0:
else:
fight(PlayerIG)

def win():
os.system('clear')
enemy.health = enemy.maxhealth
PlayerIG.gold += enemy.goldgain
PlayerIG.pots += enemy.pots
print("You have defeated the %s!" % enemy.name)
print("You gained %i gold!" % enemy.goldgain)
print("You gained %i potion!" % enemy.pots)
option = input("--> ")
start1(PlayerIG)

os.system('clear')
print("You have died!")
os.system('clear')
start1(PlayerIG)

def store():
os.system('clear')
print("Welcome to the shop!")
print("nWhat would you like to buy?n")
print("1.) Great Sword")
print("back")
print(" ")
option = input("--> ")

if option in weapons:
if PlayerIG.gold >= weapons(option):
os.system('clear')
PlayerIG.gold -= weapons(option)
PlayerIG.weap.append(option)
print("You have bought %s" % option)
option = input("-->  ")
store()

else:
os.system('clear')
print("You don't have enough gold")
option = input("--> ")
store()

elif option == "back":
start1(PlayerIG)

else:
os.system('clear')
print("That item does not exist")
option = input("--> ")
store()

main()
``````