我需要跟踪搜索结果中项目的出现次数(在Web应用程序中).即用户搜索某些内容并获得前20项 - 跟踪每个第20项的1次访问.在另一个页面上,用户可以看到项目的统计信息 - 在搜索结果中显示的次数.
我考虑将Google Analytics事件跟踪用于该任务.例如来自Javascript:
ga('send', 'event', {
eventCategory: 'item-category',
eventAction: 'search',
eventLabel: 'item-id',
});
Run Code Online (Sandbox Code Playgroud)
但遗憾的是,Google AnalyticsAPI允许每1个HTTP请求仅注册1个事件.这意味着每次搜索都会发送20多个HTTP请求.这对我们的要求非常无效.
我寻找解决方法:
是否可以为每个HTTP请求注册多个Google Analytics事件?
我在Windows 8.1上使用Firefox 26.0.简单的表格html + css布局在不同的缩放级别上呈现奇怪.
可以100%放大Firefox.IE和Chrome正确呈现文档.将html代码更改为常规表/ tr/td没有帮助.
这是Windows 8.1上的Firefox中的错误还是布局错误?
HTML代码
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="board">
<div class="row">
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
<div class="cell"></div>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
CSS代码
#board {
display: table;
border-collapse: collapse;
}
.row {
display: table-row;
}
.cell {
border: 1px solid;
display: table-cell;
height: 1em;
width: 1em;
}
Run Code Online (Sandbox Code Playgroud)
结果:
100%-2缩小:

100%-3缩小:

100%+1放大:

100%+ 3放大:

我尝试显示两个水平块.一个有图像和文字,第二个 - 只有文字.文本应垂直对齐.代码:http://jsfiddle.net/buDrY/
问题是第一个块中文本的Y坐标比第二个块中的文本Y大一个或两个像素.结果在Chrome,FF,IE中相同:

我的错误在哪里?
HTML:
<div id="text-with-image">
<img src="http://placehold.it/48x48" width="48" height="48" />First
</div>
<div id="text">
Second
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#text-with-image,
#text {
height: 48px;
vertical-align: middle;
display: table-cell;
border: solid;
text-decoration: underline;
}
img {
vertical-align: middle;
}
Run Code Online (Sandbox Code Playgroud) 我在Visual Studio中使用类库(可移植)项目模板来生成与.NET Core兼容的现代PCL.不幸的是,我无法使用NUnit和XUnit运行PCL的单元测试:
首先,我无法为单元测试项目创建类库(Package)或控制台应用程序(Package).VS 2015目前不允许从这些类型的项目中引用现代PCL:https://github.com/aspnet/Home/issues/1099 因此,我应该使用类库(Portable)项目进行单元测试项目.
这就是为什么我不能关注文章http://www.alteridem.net/2015/11/04/testing-net-core-using-nunit-3/(对于NUnit)和https://xunit.github.io/ docs/getting-started-dnx.html(适用于xUnit).这两篇文章都使用类库(Package)和控制台应用程序(包)项目.
我无法将'xunit'软件包安装到类库(Portable)项目中.它失败了,出现了这个错误:https://github.com/xunit/xunit/issues/587
我可以使用NUnit 3成功构建类库(可移植)项目.但是目前没有可以为.NET Core运行NUnit 3测试的测试运行器.不确定最新版本的Resharper是否支持 - 无论如何,Resharper不适合我.
看起来我需要等待现代PCL支持中的错误修复或.NET Core兼容的NUnit 3测试运行器.你能推荐一下解决方法吗?
css ×2
html ×2
.net-core ×1
firefox ×1
html-table ×1
nunit ×1
unit-testing ×1
web ×1
windows-8.1 ×1
xunit.net ×1