正如DotNetNuke文档中所建议的那样,从UNC共享中运行IIS Web应用程序有什么不好?(What's so bad about running an IIS web application from an UNC share, as suggested in DotNetNuke docs?)
过去我曾教过,从UNC份额运行Web应用程序是不明智的。 我记得的原因是安全,权利和授权的麻烦和性能。 但是,在DotNetNuke文档中,它说 :
DotNetNuke最初支持的Web服务器场配置涉及两个或更多前端Web服务器(“网站负责人”),其IIS网站根目录映射到远程文件服务器上的公共UNC共享。 UNC共享包含应用程序源代码以及各个站点的任何静态内容。
不知何故,这听起来像一个穷人的配置,我觉得打开一个潜在的潘多拉盒子。 遵循DotNetNuke Corp的建议是否明智?
I've been taught in the past that it is unwise to run a web application from an UNC share. Reasons I remember are security, rights and authorization trouble and performance. However, in the DotNetNuke documentation it says:
The web farm configuration that DotNetNuke initially supports involves two or more front end web servers ("web-heads") whose IIS website root directories are mapped to a common UNC share on a remote file server. The UNC share contains the application source code as well as any static content for the individual sites.
Somehow this sounds to me like a poor-mans configuration and I feel like opening a potential Pandora's box. Is it wise to follow DotNetNuke Corp's suggestion here?
原文:https://stackoverflow.com/questions/6695782
最满意答案
您发布的示例没有什么意义,并且它不允许任何合理的方式指定缺少的数据。 我在这里猜测,但你可能处理的唯一合理的事情似乎是这样的:
>>> lats = np.array([43.2, 43.2, 43.2, 45.5, 45.5, 45.5, 65.3, 65.3, 65.3]) >>> lons = np.array([5.5, 102.5, 116.2, 5.5, 102.5, 116.2, 5.5, 102.5, 116.2]) >>> vals = np.array([3, 4, 5, 6, 7, 7, 9, 1, 0])
如果
vals[j]
的值来自纬度纬度lats[j]
和经度lons[j]
,但数据可能会混乱,如下所示:>>> indices = np.arange(9) >>> np.random.shuffle(indices) >>> lats = lats[indices] >>> lons = lons[indices] >>> vals = vals[indices] >>> lats array([ 45.5, 43.2, 65.3, 45.5, 43.2, 65.3, 45.5, 65.3, 43.2]) >>> lons array([ 5.5, 116.2, 102.5, 116.2, 5.5, 116.2, 102.5, 5.5, 102.5]) >>> vals array([6, 5, 1, 7, 3, 0, 7, 9, 4])
你可以按如下方式将它排列成一个数组:
>>> lat_vals, lat_idx = np.unique(lats, return_inverse=True) >>> lon_vals, lon_idx = np.unique(lons, return_inverse=True) >>> vals_array = np.empty(lat_vals.shape + lon_vals.shape) >>> vals_array.fill(np.nan) # or whatever yor desired missing data flag is >>> vals_array[lat_idx, lon_idx] = vals >>> vals_array array([[ 3., 4., 5.], [ 6., 7., 7.], [ 9., 1., 0.]])
The example you have posted makes very little sense, and it doesn't allow any reasonable way to specify missing data. I am guessing here, but the only reasonable thing you may be dealing with seems to be something like this :
>>> lats = np.array([43.2, 43.2, 43.2, 45.5, 45.5, 45.5, 65.3, 65.3, 65.3]) >>> lons = np.array([5.5, 102.5, 116.2, 5.5, 102.5, 116.2, 5.5, 102.5, 116.2]) >>> vals = np.array([3, 4, 5, 6, 7, 7, 9, 1, 0])
Where the value in
vals[j]
comes from latitudelats[j]
and longitudelons[j]
, but the data may come scrambled, as in :>>> indices = np.arange(9) >>> np.random.shuffle(indices) >>> lats = lats[indices] >>> lons = lons[indices] >>> vals = vals[indices] >>> lats array([ 45.5, 43.2, 65.3, 45.5, 43.2, 65.3, 45.5, 65.3, 43.2]) >>> lons array([ 5.5, 116.2, 102.5, 116.2, 5.5, 116.2, 102.5, 5.5, 102.5]) >>> vals array([6, 5, 1, 7, 3, 0, 7, 9, 4])
You can get this arranged into an array as follows:
>>> lat_vals, lat_idx = np.unique(lats, return_inverse=True) >>> lon_vals, lon_idx = np.unique(lons, return_inverse=True) >>> vals_array = np.empty(lat_vals.shape + lon_vals.shape) >>> vals_array.fill(np.nan) # or whatever yor desired missing data flag is >>> vals_array[lat_idx, lon_idx] = vals >>> vals_array array([[ 3., 4., 5.], [ 6., 7., 7.], [ 9., 1., 0.]])
相关问答
更多-
您发布的示例没有什么意义,并且它不允许任何合理的方式指定缺少的数据。 我在这里猜测,但你可能处理的唯一合理的事情似乎是这样的: >>> lats = np.array([43.2, 43.2, 43.2, 45.5, 45.5, 45.5, 65.3, 65.3, 65.3]) >>> lons = np.array([5.5, 102.5, 116.2, 5.5, 102.5, 116.2, 5.5, 102.5, 116.2]) >>> vals = np.array([3, 4, 5, 6, 7, 7 ...
-
你想要vstack : In [45]: a = np.array([[1,2,3]]) In [46]: l = [4,5,6] In [47]: np.vstack([a,l]) Out[47]: array([[1, 2, 3], [4, 5, 6]]) 您可以堆叠多行,条件是数组必须沿除第一个轴以外的所有形状都具有相同的形状。 In [53]: np.vstack([a,[[4,5,6], [7,8,9]]]) Out[53]: array([[1, 2, 3], ...
-
你想reshape数组。 B = np.reshape(A, (-1, 2)) You want to reshape the array. B = np.reshape(A, (-1, 2))
-
我们可以计算线性指数 ,然后用np.add.at 累加到零初始化的输出数组中。 因此,以xpos和ypos作为数组,这里有一个实现 - m,n = xpos.max()+1, ypos.max()+1 out = np.zeros((m,n),dtype=int) np.add.at(out.ravel(), xpos*n+ypos, 1) 样品运行 - In [95]: # 1d arrays holding x and y indices ...: xpos = np.array([ ...
-
首先,由于混合数据格式,我认为你不能以矢量化的方式提取数组。 因此,您可以使用loop comprehension从每个列表元素中提取与数组对应的第一个元素作为2D数组。 所以,假设A是输入列表,我们会 - arr = np.vstack([a[0] for a in A]) 然后,只需使用NumPy's broadcasting feature以矢量化方式进行比较,因为它将沿所有行广播该比较,并使用np.all(axis=1)查看所有匹配的行。 最后,使用np.flatnonzero获取最终索引。 因此 ...
-
实现要遵循的技巧是,我们将在每个起始点放置1s ,并在零初始化的int数组上的每个端点放置-1s 。 接下来是实际的技巧,因为我们会累加它,给出仓(开始 - 停止对)边界所覆盖的位置的非零数字。 因此,最后一步是为最终输出寻找非零作为布尔数组。 因此,我们将有两个向量化解决方案,其实现如下所示 - def filled_array(start, end, length): out = np.zeros((length), dtype=int) np.add.at(out,start,1) ...
-
使用ndy中的1d数组从2d数组中选择多个元素(Selecting multiple elements from an 2d array using a 1d array in numpy)[2023-01-18]
可能是最简单的方法: result = z[z_idx].diagonal() 使用范围可能会更有效率: result = z[z_idx, np.arange(z_idx.size)] 更合适但相当的是np.indices : result = z[z_idx, np.indices(z_idx.shape)[0]] Probably the simplest method: result = z[z_idx].diagonal() Maybe a little more efficient wo ... -
*在numpy中进行逐元素乘法,例如将1d数组乘以另一个1d数组: In [52]: np.array([3,4,5]) * np.array([1,2,3]) Out[52]: array([ 3, 8, 15]) 当你将2d数组乘以1d数组时,对于2d数组的每一行都会发生同样的事情: In [53]: np.array([[3,4,5],[4,5,6]]) * np.array([1,2,3]) Out[53]: array([[ 3, 8, 15], [ 4, 10, 18]]) ...
-
简单地沿最后两个轴掩盖 - arr[:,mask] Simply mask along the last two axes - arr[:,mask]
-
我想不出你需要什么理由 [array([0, 1, 2, 3, 4]), array([5, 6, 7, 8, 9]), array([10, 11, 12, 13, 14])] 代替 array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]) 你可以简单地用aT获得 如果你确实需要一个列表,那么你可以使用list(aT) I can't think of any reason you would need [array([0, 1, ...