以前我使用过这个查看器脚本,用于正确加载dwg
<script src="https://autodeskviewer.com/viewers/2.5/viewer3D.min.js"></script>
现在我按照本教程设置初始查看器:
https://developer.autodesk.com/en/docs/viewer/v2/tutorials/basic-viewer/
现在我的文件都没有加载到查看器上.Viewer只显示动画加载器,无法加载文件.当我改变观众时:
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
至:
<script src="https://autodeskviewer.com/viewers/2.5/viewer3D.min.js"></script>
该文件在该查看器中加载.
他们不是关于如何使用Markup API的例子.任何人都可以提供一个例子.
如果这是一个幼稚的问题,请原谅我,我的测试代码是这样的:
import torch
from torch.nn.modules.distance import PairwiseDistance
list_1 = [[1., 1.,],[1., 1.]]
list_2 = [[1., 1.,],[2., 1.]]
mtrxA=torch.tensor(list_1)
mtrxB=torch.tensor(list_2)
print "A-B distance :",PairwiseDistance(2).forward(mtrxA, mtrxB)
print "A 'self' distance:",PairwiseDistance(2).forward(mtrxA, mtrxA)
print "B 'self' distance:",PairwiseDistance(2).forward(mtrxB, mtrxB)
Run Code Online (Sandbox Code Playgroud)
结果:
A-B distance : tensor([1.4142e-06, 1.0000e+00])
A 'self' distance: tensor([1.4142e-06, 1.4142e-06])
B 'self' distance: tensor([1.4142e-06, 1.4142e-06])
Run Code Online (Sandbox Code Playgroud)
问题是:
pytorch 如何计算成对距离?是计算行向量距离吗?
为什么“自我”距离不是 0?
更新
将 list_1 和 list_2 更改为以下内容后:
list_1 = [[1., 1.,1.,],[1., 1.,1.,]]
list_2 = [[1., 1.,1.,],[2., 1.,1.,]]
Run Code Online (Sandbox Code Playgroud)
结果变成:
A-B distance : tensor([1.7321e-06, 1.0000e+00])
A 'self' distance: …Run Code Online (Sandbox Code Playgroud) 我有一个Profile.php包含Profile_Control.php和profile_control包含的文件Profile_Model.php.在这里,每件事情都很好.
我有另一个脚本命名,Upload.php从哪个数据上传.这个Upload.php还包括Profile_Control.php并且如你所知Profile_Control包含Profile_Model.php.现在我不知道它为什么会出现这样的错误.当Profile.php加载它工作正常但是当我上传数据时它说
Warning: include(../Model/Profile_Model.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\php\gagster\Control\Profile_Control.php on line 4
Run Code Online (Sandbox Code Playgroud)
在Upload.php中:
include_once("../../Control/Profile_Control.php");
Run Code Online (Sandbox Code Playgroud)
在Profile.php中:
include_once("../Control/Profile_Control.php");
Run Code Online (Sandbox Code Playgroud)
在Profile_Control.php中:
include_once("../Model/Profile_Model.php");
Run Code Online (Sandbox Code Playgroud)
文件结构:
+-Control/
| |
| +---- Profile_Control.php
|
+-Model/
| |
| +---- Profile_Model.php
|
+-Other/
|
+-- Upload/
|
+---- Upload.php
Run Code Online (Sandbox Code Playgroud) 我试图在控制器中获取客户端IP地址.它工作,但有时我得到这个错误:
The underlying connection was closed: An unexpected error occurred on a receive
String IP = "";
using (WebResponse response = request.GetResponse())
{
using (StreamReader stream = new StreamReader(response.GetResponseStream()))
{
IP = stream.ReadToEnd();
}
}
int first = IP.IndexOf("Address: ") + 9;
int last = IP.LastIndexOf("</body>");
IP = IP.Substring(first, last - first);
Run Code Online (Sandbox Code Playgroud)
获取客户端IP地址有什么不同的方法吗?
HTML:
<div class="container">
<ul>
<li class="item" id="id_1">
<h2>header</h2>
<div class="c_image">
<img/>
</div>
</li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
图像上的Click事件必须触发相关h2上的单击事件.html会自动呈现.
JS:
$(".container .item .c_image img").each(function(){
$(this).click(function(){
//console.log($(this).parent("li.item"));
$(this).closest("h2")[0].click();
});
});
Run Code Online (Sandbox Code Playgroud)
什么是最好的解决方案是这种情况,我尝试最接近,但它不会触发h2点击事件.
这很好用:
$('#id_1 .c_image img').click(function(){
$('li#id_1 h2')[0].click();
});
Run Code Online (Sandbox Code Playgroud) 我使用svg元素生成了模糊的图像.我希望它能覆盖整个屏幕的宽度和高度.
现在为了更好地理解我在下面提供两个小提琴,最后我想要实现的结果:
小提琴1 -图像模糊,但不覆盖整个屏幕
小提琴2 -图像不模糊,但它覆盖整个屏幕
结果我想:图像应该模糊(如Fiddle1),它也应该覆盖整个屏幕(如Fiddle2)
HTML代码模糊第一小提琴中的图像:
<svg class="blur" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%">
<filter id="filter">
<feGaussianBlur stdDeviation="5"/>
</filter>
<image xlink:href="https://saudiwoman.files.wordpress.com/2010/02/crowded-restaurant.jpg" filter="url(#filter)"></image>
</svg>
Run Code Online (Sandbox Code Playgroud)
要再次清楚,我希望图像像fiddle2一样覆盖整个屏幕并且也要模糊.
这段代码在IE中不起作用,我需要使用它,因为我必须制作一条沿着地图上某个点的箭头。
div {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
right: 0px;
background: red;
clip-path: url(#cliparrow);
-webkit-clip-path: polygon(777px 285px, 0px 303px, 777px 315px);
}
svg {
width: 0;
height: 0;
float: left;
position: absolute;
}
Run Code Online (Sandbox Code Playgroud)
<div></div>
<svg height="0" width="0">
<defs>
<clipPath id="cliparrow">
<polygon points="777,285 0,303 777,315" ></polygon>
</clipPath>
</defs>
</svg>
Run Code Online (Sandbox Code Playgroud)
有什么建议么?谢谢。
我正在尝试链接到内部页面锚点并强制刷新页面。
但是,这不会强制刷新:
<a href="/#example">example link</a>
Run Code Online (Sandbox Code Playgroud)
链接到同一页面中的锚点并强制刷新的最佳方法是什么?
此外,我希望刷新是 GET 请求,即使该页面最后是使用 POST 请求呈现的。
我想阻止用户通过鼠标滚轮滚动。在 Firefox 中它可以工作,但在 Chrome 中不行。Chrome 必须更改哪些内容?
$(window).on('wheel', function(e) {
e.preventDefault(); // Prevent user scroll during page jump
})
Run Code Online (Sandbox Code Playgroud)