A = np.array([[1,2,3],
[2,3,4],
[3,4,5],
[4,5,6],
[5,6,7],
[6,7,8],
[7,8,9],
[8,9,10]])
v = np.array([1,1,1])
# Compute the length (norm) of the distance between the vectors
distance = np.linalg.norm(A - v, axis = 1)
print(distance)
[ 2.23606798 3.74165739 5.38516481 7.07106781 8.77496439 10.48808848
12.20655562 13.92838828]
Когда Вы создаете новое XmlTextReader
обеспечение a string
, это заблокирует файл с блокировкой записи (но не блокировкой чтения); однако, если Вы предоставляете ему a Stream
, это зависело бы от самого потока.
FileStream stream = new FileStream(@"myfile.xml", FileMode.Open,
FileAccess.Read, FileShare.ReadWrite);
XmlTextReader reader = new XmlTextReader(stream);
Можно теперь читать, не имея блокировки.