我正在开发一个C#自定义OPC客户端,我开始在控制台应用程序中快速写入,一切都按照我的要求完美运行.
然后我决定制作一个Windows窗体应用程序以获得视觉体验.
Windows窗体应用程序只是停止工作,大约一分钟后停止从OPC服务器读取数据.控制台应用程序在哪里继续阅读和阅读.
在调试模式中我也找不到任何明显的东西.
我绝对抓着稻草在这里,希望有人可以解决一些问题.
每个应用程序都使用OPCFoundation提供的.dll文件.
这是控制台应用程序
static void Main(string[] args)
{
Opc.URL url = new Opc.URL("opcda://localhost/RSLinx OPC Server");
Opc.Da.Server server = null;
OpcCom.Factory fact = new OpcCom.Factory();
server = new Opc.Da.Server(fact, null);
server.Connect(url, new Opc.ConnectData(new System.Net.NetworkCredential()));
// Create a group
Opc.Da.Subscription group;
Opc.Da.SubscriptionState groupState = new Opc.Da.SubscriptionState();
groupState.Name = "Group";
groupState.Active = true;
group = (Opc.Da.Subscription)server.CreateSubscription(groupState);
// add items to the group.
Opc.Da.Item[] items = new Opc.Da.Item[6];
items[0] = new Opc.Da.Item();
items[0].ItemName = "[UX1]F20:9";
items[1] = new Opc.Da.Item();
items[1].ItemName …Run Code Online (Sandbox Code Playgroud) 如果有人能想到更好的标题,请不要犹豫,改变它.
我是jQuery的新手,并遇到了过滤元素的问题.
我正在使用更改功能data-通过属性过滤DIVS checkbox.
我的问题是,如果我过滤一个data属性(colour)然后我过滤另一个属性(brand),那么元素都是隐藏的.但是,如果我取消其中一个过滤器,即使它们仍然被另一个属性过滤,元素也会弹回.
无论如何我可以阻止这种情况发生吗?
这是代码.
<div data-brand="Nike" data-price="31" data-colour="Blue">Blue</div>
<div data-brand="Nike" data-price="31" data-colour="Red"> Red </div>
Colours:
Blue<input type="checkbox" id="BlueCB" checked>
Red<input type="checkbox" id="RedCB" checked>
Brand: Nike <input type="checkbox" id="NikeCB" checked>
<script>
var BlueSelector = $('#BlueCB');
BlueSelector.on("change", function(){
if($(this).is(":checked"))
{
var divs = $("div[data-colour=Blue]");
divs.css("display", "block");
} else
{
var divs = $("div[data-colour=Blue]");
divs.css("display", "none");
}
});
var RedSelector = $('#RedCB');
RedSelector.on("change", function(){
if($(this).is(":checked"))
{
var divs = $("div[data-colour=Red]");
divs.css("display", …Run Code Online (Sandbox Code Playgroud) 所以我整个上午都尝试安装composer,这样我就可以开始使用laravel框架了.
我在php 7.0上使用XAMPP运行Windows server r2标准64位
运行Composer-Setup.exe时,我收到以下消息..
无法下载" https://getcomposer.org/versions "文件:SSL操作失败,代码为1. OpenSSL错误消息:错误:14090086:SSL例程:ssl3_get_server_certificate:certificate verify failed无法启用加密无法打开流:手术失败
我在网上搜索过,在大多数情况下,我似乎遇到的问题是指定一个cacert.pem文件.
所以我按照说明从https://curl.haxx.se/ca/cacert.pem下载证书
我只是创建了一个.txt文件,从上面的链接中将内容复制到其中并重命名该文件,因此它是cacert.pem文件.
然后在php.ini中指定.pem文件
openssl.cafile = C:\ cacert.pem
重新启动apache然后重新运行安装程序.
在再次运行之后,我得到了与ssl操作失败的完全相同的错误,代码为1.
希望有人能看到我在这里做错了什么?
我从一个自定义生产数据库远程选择结果,其标准大约是C#应用程序的三分钟.
每次执行select命令时,我使用CPU的服务器PC都会上升到50%左右.但当然,负载应该在我连接的数据库上?
在检索数据进行读取之前,为什么C#应用程序会升级到50%?
一些背景
这是我正在使用的一些代码.
OdbcConnection remoteConn = new OdbcConnection(ConfigurationManager.ConnectionStrings["remoteConnectionString"].ToString());
remoteConn.Open();
OdbcCommand remoteCommand = new OdbcCommand();
remoteCommand.Connection = remoteConn;
using (remoteConn)
{
string localSql = "";
string remoteSql = "select * from tracking where last_update > 212316247440000000"; // Julian No = 2015-07-12 11:24:00
remoteCommand.CommandText = remoteSql;
OdbcDataReader remoteReader;
remoteReader = remoteCommand.ExecuteReader();
while (remoteReader.Read())
{
for (int i = 0; i < 68; i++)
{
localSql += ",'" + remoteReader[i].ToString() + "'";
}
}
}
Run Code Online (Sandbox Code Playgroud)
我对应用程序进行了性能和诊断测试,并得出了这个结果.
如果有的话,我可以如何减少CPU负载甚至完全消除它.它完全不同寻常,我不知道如何去做. …
我已经在Windows上使用XAMPP两年左右了,它已经完美运行,没有崩溃没有问题.(直到四个月前.)
大约四个月前,我们将服务器/系统升级到更快的规格.
这是旧的规范 -
Windows Edition:带Service Pack 1的Windows Server R2 2008 Standard
系统处理器:Intel(R)Xeon(R)CPU 5160 @ 3.0GHZ(2个处理器)(单核)
安装内存:7GB
系统类型:64位操作系统
升级规格
Windows Edition:带Service Pack 1的Windows Server R2 2008 Standard
系统:处理器:Intel(R)Xeon(R)CPU X5680 @ 3.33GHZ(2个处理器)(双核)
安装内存:8GB
系统类型:64位操作系统
就像我之前提到的那样,旧的规范从未出现任何问题,它从未在一年半的时间内崩溃或失败.
我们一旦升级就发生以下情况.
随机Apache崩溃,使网站无法使用,直到手动重新启动.当apache崩溃时,它会在访问phpMyAdmin时抛出错误,阻止你查询数据库.我甚至卸载了XAMPP并用PHP7安装了最新版本,这仍然没有解决问题.
这是一个例子
请注意.\ libraries\common.inc.php#253未定义的变量:_POST
回溯
.\ index.php#12:require_once(.\ libraries\common.inc.php).\ libraries\common.inc.php中的警告#253 array_merge():参数#2不是数组
回溯
.\ libraries\common.inc.php#253:array_merge(array,NULL,).\ index.php#12:require_once(.\ libraries\common.inc.php)注意.\ libraries\common.inc.php #443未定义的变量:_POST
回溯
.\ index.php#12:require_once(.\ libraries\common.inc.php)注意.\ libraries\common.inc.php#453未定义变量:_POST
回溯
.\ index.php#12:require_once(.\ libraries\common.inc.php)注意.\ libraries\cleanup.lib.php#26未定义的变量:_POST
回溯
.\ libraries\common.inc.php#514:PMA_removeRequestVars(array).\ index.php#12:require_once(.\ libraries\common.inc.php)注意.\ libraries\cleanup.lib.php#31未定义变量:_POST
回溯
.\ libraries\common.inc.php#514:PMA_removeRequestVars(array).\ index.php#12:require_once(.\ libraries\common.inc.php)
这可能发生在每天1-5次,并且没有生成日志以说明它发生的原因.我能找到的唯一方法是进入非常模糊的事件查看器.
下面是一个例子 -
错误应用程序名称:httpd.exe,版本:2.4.18.0,时间戳:0x5667f02e错误模块名称:php7ts.dll,版本:7.0.2.0,时间戳:0x568d8eb5异常代码:0xc0000005错误偏移量:0x0001ab54错误进程id:0x9bf4错误应用程序启动时间:0x01d18f1d3eed5f7e错误应用程序路径:C:\ xampp_\apache\bin\httpd.exe错误模块路径:C:\ xampp_\php\php7ts.dll报告ID:a2a226d0-fb64-11e5-b4cb-005056a97cdf
和 …
好的,我有一个PHP数组,如下所示
0
0
0
0
0
0
500 // Get index of this value which is 6
11000
100
110
221
1245
2141// Get index of this value which is 12
0
0
0
0
0
Run Code Online (Sandbox Code Playgroud)
是否有一个PHP函数可以获取第一个非零值索引和最后一个非零值索引?还是一种非常漂亮的方式呢?
我知道我可以通过一些IF陈述来做到这一点,但它会变得非常混乱.
我正在尝试找出将分布曲线/钟形曲线绘制到NVD3图表上的方法。我已经在网上搜索了很多东西,却发现实际上没有任何东西可用于我所拥有的东西。也许这实际上是不可能的,但是认为这值得一问,也很高兴与其他会寻找类似东西的人认识。
这是我需要我的图看起来的示例(在Google图片上找到)
从示例中可以看到,该线不需要第二条轴,因此不需要“条形图和折线图组合”。我知道您可以使用D3直接在画布上进行绘制,但是我对此还有些不足。
var json = [{ "values": [{"label":"450-456", "value":0, "color":"#D62728"},{"label":"456-462", "value":0, "color":"#D62728"},{"label":"462-468", "value":0, "color":"#D62728"},{"label":"468-474", "value":0, "color":"#D62728"},{"label":"474-480", "value":0, "color":"#D62728"},{"label":"480-486", "value":1, "color":"#D62728"},{"label":"486-492", "value":5, "color":"#D62728"},{"label":"492-498", "value":3, "color":"#D62728"},{"label":"498-504", "value":5, "color":"#D62728"},{"label":"504-510", "value":6, "color":"#D62728"},{"label":"510-516", "value":9, "color":"#D62728"},{"label":"516-522", "value":6, "color":"#D62728"},{"label":"522-528", "value":1, "color":"#D62728"},{"label":"528-534", "value":0, "color":"#D62728"},{"label":"534-540", "value":0, "color":"#D62728"},{"label":"540-546", "value":0, "color":"#D62728"},{"label":"546-552", "value":0, "color":"#D62728"},{"label":"552-558", "value":0, "color":"#D62728"},{"label":"558-564", "value":0, "color":"#D62728"},{"label":"564-570", "value":0, "color":"#D62728"}]}];
nv.addGraph(function() {
var chart = nv.models.discreteBarChart()
.x(function(d) {
return d.label
})
.y(function(d) {
return d.value
})
.staggerLabels(true)
.tooltips(true)
.showValues(true)
.transitionDuration(250)
;
chart.yAxis
.tickFormat(d3.format('.0f'))
chart.valueFormat(d3.format('d'));
// REMOVE DECIMAL …Run Code Online (Sandbox Code Playgroud)