用 Fleck 实现 websocket 通信
<html lang="en">
<head>
<meta charset="utf-8">
<title>rfid</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/components-rounded.css" rel="stylesheet" id="style_components" type="text/css">
<link href="css/layout.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="echarts.min.js"></script>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
<script type="text/javascript">
</script>
</head>
<body class="page-container-bg-solid page-boxed" style="overflow-x:hidden;">
<div class="page-container">
<div class="page-content-wrapper">
<div class="page-content">
<div class="container">
<div class="page-content-inner">
<div class="row" style="background-color:lightblue;">
<div class="caption font-blue-dark" style="font-size:16px;">
<span class="caption-subject bold uppercase" style="margin-left:5px;">综合概况</span>
</div>
</div>
<div class="row" style="padding:5px;background-color:lightblue;">
<div class="col-md-6 col-sm-6" style="width:25%;">
<div class="portlet light ">
<div class="portlet-title">
<div class="caption font_blue">
<span class="caption-md"></span>
<span class="caption-desc">按部门(%)</span>
</div>
<div class="actions">
</div>
</div>
<div class="portlet-body">
<div id="dashboard_amchart_4" class="CSSAnimationChart">
<div class="amcharts-main-div">
<div class="amcharts-chart-div">
<div id="div1" onclick="sendMessage('10');" style="height:300px;margin-top:-20px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6" style="width:25%;">
<div class="portlet light ">
<div class="portlet-title">
<div class="caption font_blue">
<span class="caption-md"></span>
<span class="caption-desc">按类别(%)</span>
</div>
<div class="actions">
</div>
</div>
<div class="portlet-body">
<div id="dashboard_amchart_4" class="CSSAnimationChart">
<div class="amcharts-main-div">
<div class="amcharts-chart-div">
<div id="div2" onclick="sendMessage('11');" style="height:300px;margin-top:-20px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="padding:5px;background-color:lightgray;">
<div class="row" style="margin-left:-15px;margin-right:-15px;">
<div class="portlet light" style="background-color:#556422;height:290px;margin-left:15px;margin-right:15px;">
<div class="col-md-6" style="width:400px;">
<table id="tableData" class="table table-bordered table-hover">
<thead>
<tr style="background-color:#31753c;">
<td>楼层</td>
<td>
<img src="../监控数.png" />
<label>监控数</label>
</td>
<td>
<img src="../丢失数.png" />
<label>缺失数</label>
</td>
</tr>
</thead>
<tbody>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</tbody>
</table>
</div>
<div style="float:right;">
<img id="imgbg" style="width:800px;height:290px;" src="../bgpart0.png" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
//echart params
var echartDiv1 = echarts.init(document.getElementById('div1'));
var echartDiv2 = echarts.init(document.getElementById('div2')); //websocket
var ws = new WebSocket('ws://localhost:7181/');
//连接上服务端后触发
ws.onopen = function () { console.log('Connection to server opened'); }
//收到服务端发来的消息后触发
ws.onmessage = function (evt) {
var data = JSON.parse(evt.data); echartDiv1.setOption(data.chartOption1);
echartDiv2.setOption(data.chartOption2); //位置实时统计数据
var realTimeMonitorData = data.realTimeMonitors;
var len = realTimeMonitorData.length;
for (var i = 0; i < len; i++) {
var flooNo = realTimeMonitorData[i].FloorNo;
var floorNo1 = flooNo + 400;
var floorNo2 = flooNo + 500;
var trStr = "";
trStr += "<td onclick=\"sendMessage('" + floorNo1 + "'); \"> " + flooNo + " </td>";
trStr += "<td onclick=\"sendMessage('" + floorNo2 + "1'); \">" + realTimeMonitorData[i].MonitorSum + "</td>";
trStr += "<td onclick=\"sendMessage('" + floorNo2 + "2'); \">" + realTimeMonitorData[i].LossSum + "</td>"; //注意:tr绑定的事件不能失效
$(".table-hover > tbody > tr").eq(i).html(trStr);
} }
//当服务端关闭后触发
ws.onclose = function () { console.log("Connection closed"); } //发送消息给服务器端
function sendMessage(msg) {
if (ws.readyState == WebSocket.OPEN) {
ws.send(msg);
}
}
//断开与服务器端的连接
function disConnect() {
ws.close();
} //page navigate
$(".table-hover > tbody > tr").mouseover(function () {
var idx = $(this).index();
$("#imgbg").attr("src", "../bgpart" + (10 - idx) + ".png");
});
$(".table-hover").mouseleave(function () {
$("#imgbg").attr("src", "../bgpart0.png");
});
</script>
</body>
</html>
using DevExpress.XtraBars.Ribbon;
using Fleck;
using IMS.DBHelper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows.Forms;
using WHC.Framework.Commons;
using RfidPositioning.Common;
using IMS.BaseFramework;
using System.Threading; namespace IMS.WfmClient
{
public partial class WebMonitor : RibbonForm
{
static System.Timers.Timer _refreshDataTimer = new System.Timers.Timer();
static List<IWebSocketConnection> _connections = new List<IWebSocketConnection>();
DataPackage _dataPackage = new DataPackage();
WebSocketServer _wsServer = new WebSocketServer("ws://0.0.0.0:7181"); public WebMonitor()
{
InitializeComponent(); //启动线程开始从数据库获取页面所需的数据
Thread th = new Thread(GetDataForChart);
th.IsBackground = true;
th.Start(); //设置监控界面对应的网页
string appPath = AppDomain.CurrentDomain.BaseDirectory;
string chartsPath = "file:///" + appPath + "Resources/eCharts/sample.html";
webBrowser1.Navigate(new Uri(chartsPath)); //启动webSocket侦听服务
_wsServer.Start(item =>
{
//与客户端建立连接后触发
item.OnOpen = () =>
{
_connections.Add(item); //首次建立连接后立刻发送一次数据,之后由定时器来刷新数据
string jsonData = _dataPackage.ToJson();
_connections.ToList().ForEach(s => s.Send(jsonData));
}; //收到客户端发来的消息后触发
item.OnMessage = message =>
{
int msg = ;
int.TryParse(message, out msg); ClientMessageHandler(msg);
}; //客户端关闭连接后触发
item.OnClose = () =>
{
_connections.Remove(item);
};
});
} private void FrmIndex_Load(object sender, EventArgs e)
{
// 启动定时器
_refreshDataTimer.Enabled = true;
_refreshDataTimer.Interval = * * ;
_refreshDataTimer.Elapsed += new System.Timers.ElapsedEventHandler(timersTimer_Elapsed);
_refreshDataTimer.Start();
} private void timersTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
GetDataForChart(); string jsonData = _dataPackage.ToJson();
_connections.ToList().ForEach(s => s.Send(jsonData));
} private void ClientMessageHandler(int msg)
{
if (msg >= )
{
SysConfig.FloorNumber = (msg % ).ToString();
this.Invoke(new Action(() =>
{
ChildWinManagement.LoadMdiForm(SysConfig.mainform, typeof(frmTracePlayback));
}));
}
else if (msg >= )
{
SysConfig.FloorNumber = (msg / % ).ToString();
if (msg % == )
{
SysConfig.WarningType = "正常";
}
if (msg % == )
{
SysConfig.WarningType = "缺失报警";
}
this.Invoke(new Action(() =>
{
ChildWinManagement.LoadMdiForm(SysConfig.mainform, typeof(AssetWatchDetail));
}));
}
else
{
StaticsTypeEnum type = (StaticsTypeEnum)msg; int typeScale = ;
int typeChecks = ;
int typePosition = ;
int typeInstrument = ;
getStaticsType(out typeScale, out typeChecks, out typePosition, out typeInstrument); switch (msg)
{
case :
case :
SysConfig.ReportByAssetsType = msg == ? false : true;
NavigateToForm(typePosition, typeof(FrmAssetsValueReport));
break;
case :
case :
SysConfig.ReportByAssetsType = msg == ? false : true;
NavigateToForm(typePosition, typeof(FrmInventoryReport));
break;
case :
webBrowser1.Refresh();
break;
case :
this.Invoke(new Action(() =>
{
Form form = new SetStaticsType();
form.Owner = this;
form.StartPosition = FormStartPosition.CenterScreen;
form.ShowDialog();
}));
break;
default:
break;
}
}
} private void getStaticsType(out int typeScale, out int typeChecks, out int typePosition, out int typeInstrument)
{
typeScale = ;
typeChecks = ;
typePosition = ;
typeInstrument = ; //查询默认选择的统计方式(从数据库获取已设置过的数据)
string strsql = "select * from HT_MonitorStaticsType;";
DataSet ds = SQLHelper.Query(SQLHelper._connstr, strsql);
if (ds != null && ds.Tables != null && ds.Tables.Count > && ds.Tables[].Rows.Count > )
{
typeScale = Convert.ToInt32(ds.Tables[].Rows[]["Monitor"].ToString());
typeChecks = Convert.ToInt32(ds.Tables[].Rows[]["Checks"].ToString());
typePosition = Convert.ToInt32(ds.Tables[].Rows[]["Position"].ToString());
typeInstrument = Convert.ToInt32(ds.Tables[].Rows[]["Instrument"].ToString());
}
} private void NavigateToForm(int type, Type formType)
{
if (type == ) //按月
{
SysConfig.ReportStartDate = DateTime.Now.ToString("yyyyMM") + "";
SysConfig.ReportEndDate = DateTime.Now.AddMonths().ToString("yyyyMM") + "";
}
else
{
SysConfig.ReportStartDate = DateTime.Now.AddYears(-).ToString("yyyyMMdd");
SysConfig.ReportEndDate = DateTime.Now.ToString("yyyyMMdd");
} this.Invoke(new Action(() =>
{
ChildWinManagement.LoadMdiForm(SysConfig.mainform, formType);
}));
} #region 图表数据 class RealTimeMonitor
{
public string FloorNo { get; set; }
public string MonitorSum { get; set; }
public string LossSum { get; set; }
public string PositionSum { get; set; }
public string LowSum { get; set; }
} class ChartAssetWatch
{
public string Name { get; set; }
public string Value { get; set; }
public string StaticsType { get; set; }
} class ChartCheck
{
public string Name { get; set; }
public string Value { get; set; }
public string DataType { get; set; }
public string StaticsType { get; set; }
} class ChartPosition
{
public string Name { get; set; }
public string Value { get; set; }
public string DataType { get; set; }
public string StaticsType { get; set; }
} class ChartInstrument
{
public string Name { get; set; }
public string Value { get; set; }
public string StaticsType { get; set; }
} class DataPackage
{
public ChartOptionForAssetWatch chartOption1 { get; set; }
public ChartOptionForAssetWatch chartOption2 { get; set; }
public ChartOption chartOption3 { get; set; }
public ChartOption chartOption4 { get; set; }public List<RealTimeMonitor> realTimeMonitors { get; set; }
} void GetDataForChart()
{
int typeScale = ;
int typeChecks = ;
int typePosition = ;
int typeInstrument = ;
getStaticsType(out typeScale, out typeChecks, out typePosition, out typeInstrument); _dataPackage.chartOption1 = getChartDataAssetWatch("HT_ChartAssetWatchDept", typeScale);
_dataPackage.chartOption2 = getChartDataAssetWatch("HT_ChartAssetWatchType", typeScale); _dataPackage.chartOption3 = getChartDataCheck("HT_ChartCheckDept", typeChecks);
_dataPackage.chartOption4 = getChartDataCheck("HT_ChartCheckType", typeChecks); List<RealTimeMonitor> realTimeMonitors = getRealTimeMonitorData();
_dataPackage.realTimeMonitors = realTimeMonitors;
} ChartOptionForAssetWatch getChartDataAssetWatch(string tableName, int staticsType)
{
ChartOptionForAssetWatch chartOption = new ChartOptionForAssetWatch();
try
{
string sqlStr = @"SELECT [Name],[Value],[StaticsType] FROM XXX.[dbo].[" + tableName + "] WHERE StaticsType = " + staticsType + " order by Name desc;";
DataSet ds = SQLHelper.Query(SQLHelper._connstr, sqlStr); List<ChartAssetWatch> chartData = ds.Tables[].ConvertToModel<ChartAssetWatch>(); //截取长度超出5的字符串
chartData.ForEach(item =>
{
if (item.Name.Length > )
{
item.Name = item.Name.Substring(, ) + "..";
}
}); //合并数量少的分组
List<ChartAssetWatch> chartDataNew = new List<ChartAssetWatch>();
chartDataNew.AddRange(chartData.OrderByDescending(p => p.Value).Take()); //取前5条数据
chartDataNew.ForEach(p => { chartData.Remove(p); });
chartDataNew.Add(new ChartAssetWatch { Name = "其他", Value = chartData.Sum(p => Convert.ToDecimal(p.Value)).ToString() }); chartOption.tooltip = new tooltip();
chartOption.tooltip.trigger = "item";
chartOption.tooltip.formatter = "{a} <br/>{b}: {c} ({d}%)";
chartOption.legend = new legend();
chartOption.legend.type = "scroll";
chartOption.legend.orient = "vertical";
chartOption.legend.left = "";
chartOption.legend.top = "";
chartOption.legend.data = chartDataNew.Select(p => p.Name).ToArray();
chartOption.series = new SeriesForAssetWatch[];
SeriesForAssetWatch series = new SeriesForAssetWatch();
series.name = "";
series.type = "pie";
series.radius = new string[] { "60%", "30%" };
series.center = new string[] { "55%", "55%" };
series.avoidLabelOverlap = "false";
series.label = new label();
series.label.normal = new normal();
series.label.normal.show = false;
series.label.normal.position = "center";
series.label.emphasis = new emphasis();
series.label.emphasis.show = "true";
series.label.emphasis.textStyle = new textStyle();
series.label.emphasis.textStyle.fontSize = "";
series.labelLine = new labelLine();
series.labelLine.normal = new normal();
series.labelLine.normal.show = false;
List<DataNew> d = new List<DataNew>();
chartDataNew.ForEach(p => { d.Add(new DataNew { name = p.Name, value = p.Value }); });
series.data = d.ToArray();
chartOption.series = new SeriesForAssetWatch[];
chartOption.series[] = series; return chartOption;
}
catch { return null; }
} ChartOption getChartDataCheck(string tableName, int staticsType)
{
ChartOption chartOption = new ChartOption();
try
{
string sqlStr = @"SELECT [Name],[Value],[DataType],[StaticsType] FROM [Lonix_Fas_1].[dbo].[" + tableName + "] WHERE StaticsType = " + staticsType + " order by Name desc;";
DataSet ds = SQLHelper.Query(SQLHelper._connstr, sqlStr); List<ChartCheck> chartData = ds.Tables[].ConvertToModel<ChartCheck>(); //截取长度超出5的字符串
chartData.ForEach(item =>
{
if (item.Name.Length > )
{
item.Name = item.Name.Substring(, ) + "..";
}
}); //合并数量少的分组
List<ChartCheck> chartInstrumentsNew1 = new List<ChartCheck>();
chartInstrumentsNew1.AddRange(chartData.Where(p => p.DataType == "").OrderByDescending(p => p.Value).Take()); //取前5条数据
chartInstrumentsNew1.ForEach(p => { chartData.Remove(p); });
chartInstrumentsNew1.Add(new ChartCheck { Name = "其他", Value = chartData.Where(p => p.DataType == "").Sum(p => Convert.ToDecimal(p.Value)).ToString() }); List<ChartCheck> chartInstrumentsNew2 = new List<ChartCheck>();
chartInstrumentsNew2.AddRange(chartData.Where(p => p.DataType == "").OrderByDescending(p => p.Value).Take()); //取前5条数据
chartInstrumentsNew2.ForEach(p => { chartData.Remove(p); });
chartInstrumentsNew2.Add(new ChartCheck { Name = "其他", Value = chartData.Where(p => p.DataType == "").Sum(p => Convert.ToDecimal(p.Value)).ToString() }); chartOption.tooltip = new tooltip();
chartOption.tooltip.trigger = "axis";
chartOption.tooltip.axisPointer = new axisPointer();
chartOption.tooltip.axisPointer.type = "shadow"; chartOption.legend = new legend();
chartOption.legend.orient = "horizontal";
chartOption.legend.data = new string[] { "盘亏数", "已盘数" }; chartOption.grid = new grid();
chartOption.grid.top = "";
chartOption.grid.left = "3%";
chartOption.grid.right = "6%";
chartOption.grid.bottom = "";
chartOption.grid.containLabel = true; chartOption.xAxis = new Axis();
chartOption.xAxis.type = "value";
chartOption.xAxis.axisLabel = new axisLabel();
chartOption.xAxis.axisLabel.interval = "";
chartOption.xAxis.axisLabel.rotate = ""; chartOption.yAxis = new Axis();
chartOption.yAxis.type = "category";
chartOption.yAxis.data = chartInstrumentsNew1.Select(p => p.Name).ToArray();
chartOption.yAxis.axisLabel = new axisLabel();
chartOption.yAxis.axisLabel.interval = "";
chartOption.yAxis.axisLabel.rotate = ""; chartOption.series = new Series[];
Series s1 = new Series();
s1.name = "盘亏数";
s1.type = "bar";
s1.stack = "总量";
s1.label = new label();
s1.label.normal = new normal();
s1.label.normal.show = true;
s1.label.normal.position = "insideRight";
s1.data = chartInstrumentsNew1.Select(p => p.Value).ToArray();
chartOption.series[] = s1;
Series s2 = new Series();
s2.name = "已盘数";
s2.type = "bar";
s2.stack = "总量";
s2.label = new label();
s2.label.normal = new normal();
s2.label.normal.show = true;
s2.label.normal.position = "insideRight";
s2.data = chartInstrumentsNew2.Select(p => p.Value).ToArray();
chartOption.series[] = s2; return chartOption;
}
catch { return null; }
} List<RealTimeMonitor> getRealTimeMonitorData()
{
string sqlStr = @"select [FloorNo],[MonitorSum],[LossSum],[PositionSum],[LowSum] from XXX.[dbo].[HT_RealTimeMonitor] order by FloorNo desc;";
DataSet ds = SQLHelper.Query(SQLHelper._connstr, sqlStr);
return ds.Tables[].ConvertToModel<RealTimeMonitor>();
} #endregion
}
}
namespace IMS.WfmClient
{
public class ChartOption
{
public tooltip tooltip { get; set; }
public legend legend { get; set; }
public grid grid { get; set; }
public Axis xAxis { get; set; }
public Axis yAxis { get; set; }
public Series[] series { get; set; }
} public class ChartOptionForAssetWatch
{
public tooltip tooltip { get; set; }
public legend legend { get; set; }
public grid grid { get; set; }
public Axis xAxis { get; set; }
public Axis yAxis { get; set; }
public SeriesForAssetWatch[] series { get; set; }
} public class tooltip
{
public string trigger { get; set; }
public string formatter { get; set; }
public axisPointer axisPointer { get; set; }
}
public class axisPointer
{
public string type { get; set; }
}
public class legend
{
public string type { get; set; }
public string orient { get; set; }
public string left { get; set; }
public string top { get; set; }
public string[] data { get; set; }
}
public class grid
{
public string top { get; set; }
public string left { get; set; }
public string right { get; set; }
public string bottom { get; set; }
public bool containLabel { get; set; }
}
public class Axis
{
public string type { get; set; }
public axisLabel axisLabel { get; set; }
public string[] data { get; set; }
}
public class axisLabel
{
public string interval { get; set; }
public string rotate { get; set; }
}
public class Series
{
public string name { get; set; }
public string type { get; set; }
public string center { get; set; }
public string avoidLabelOverlap { get; set; }
public string stack { get; set; }
public label label { get; set; }
public string[] data { get; set; }
}
public class SeriesForAssetWatch
{
public string name { get; set; }
public string type { get; set; }
public string[] radius { get; set; }
public string[] center { get; set; }
public string avoidLabelOverlap { get; set; }
public string stack { get; set; }
public label label { get; set; }
public labelLine labelLine { get; set; }
public DataNew[] data { get; set; }
}
public class DataNew
{
public string value { get; set; }
public string name { get; set; }
}
public class label
{
public normal normal { get; set; }
public emphasis emphasis { get; set; }
}
public class normal
{
public bool show { get; set; }
public string position { get; set; }
}
public class emphasis
{
public string show { get; set; }
public textStyle textStyle { get; set; }
}
public class textStyle
{
public string fontSize { get; set; }
}
public class labelLine
{
public normal normal { get; set; }
}
}
用 Fleck 实现 websocket 通信的更多相关文章
- C#工作总结(一):Fleck的WebSocket使用
一.引子(Foreword) 最近公司里面要做窗体和网页交互的功能.网上找了一下资料,这里做一个简单的扩充和整理,部分内容可能是摘自其他博客,这里会注明出处和原文地址供大家和自己日后查阅. 二.基础知 ...
- webSocket通信
针对webSocket通信总结: 1.webSocket通信原理图: 2.webSocket通信实例 参考地址1:https://www.cnblogs.com/cjm123/p/9674506.ht ...
- C#(SuperWebSocket)与websocket通信
原文:C#(SuperWebSocket)与websocket通信 客户端代码 点击可以查看一些关于websocket的介绍 <!DOCTYPE html> <html> &l ...
- js判断是否安装某个android app,没有安装下载该应用(websocket通信,监听窗口失去焦点事件)
现在经常有写场景需要提示用户下载app, 但是如果用户已经安装,我们希望是直接打开app. 实际上,js是没有判断app是否已经安装的方法的,我们只能曲线救国. 首先,我们需要有call起app的sc ...
- Springboot集成WebSocket通信全部代码,即扣即用。
websocket通信主要来自两个类以及一个测试的html页面. MyHandler 和 WebSocketH5Config,下面全部代码 MyHandler类全部代码: package com.un ...
- 【Java Web开发学习】Spring MVC整合WebSocket通信
Spring MVC整合WebSocket通信 目录 ========================================================================= ...
- websocket通信1009错误,
问题说明: springboot继承 WebSocketConfigurer实现websocket通信服务,服务器端报错,"The decoded text message was too ...
- Python3+WebSockets实现WebSocket通信
一.说明 1.1 背景说明 前段时间同事说云平台通信使用了个websocket的东西,今天抽空来看一下具体是怎么个通信过程. 从形式上看,websocket是一个应用层协议,socket是数据链路层. ...
- 把酒言欢话聊天,基于Vue3.0+Tornado6.1+Redis发布订阅(pubsub)模式打造异步非阻塞(aioredis)实时(websocket)通信聊天系统
原文转载自「刘悦的技术博客」https://v3u.cn/a_id_202 "表达欲"是人类成长史上的强大"源动力",恩格斯早就直截了当地指出,处在蒙昧时代即低 ...
随机推荐
- STM32唯一身份识别ID(器件电子签名)的读取以及芯片Flash大小读取
每个STM32有一个独立的ID,这个ID可以用来: 产品唯一的身份标识的作用: ● 用来作为序列号(例如USB字符序列号或者其他的终端应用): ● 用来作为密码,在编写闪存时,将此唯一 ...
- HDU 6044 Limited Permutation 读入挂+组合数学
Limited Permutation Problem Description As to a permutation p1,p2,⋯,pn from 1 to n, it is uncomplica ...
- 报错:out of memory java heap space
PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决 ...
- Xamarin.Android 记事本(一)
导读 1.视图及数据库的创建 2.listview数据绑定 3.listview的点击事件 正文 如何创建一个listview,大家可以看这里,基本流程操作是一模一样的,我就不多说了,然后就是新建一个 ...
- sqlldr的用法
在 Oracle 数据库中,我们通常在不同数据库的表间记录进行复制或迁移时会用以下几种方法: 1. A 表的记录导出为一条条分号隔开的 insert 语句,然后执行插入到 B 表中2. 建立数据库间的 ...
- mysql数据库引擎InnoDB和MyISAM的区别
InnoDB支持行级锁和表级锁(默认行级锁),支持事务,外部键等:大量的insert和update更快等.只有通过索引条件检索数据,InnoDB 才使用行级锁,否则,InnoDB 将使用表锁. MyI ...
- js中的关系操作符
1.关于“小于(<)” a.关于数值的判断就是跟正常的比较一样: b.var result = “23” <"3" ; //true 这两个是字符串,会比较他们的编码 ...
- HDU3081 Marriage Match II —— 传递闭包 + 二分图最大匹配 or 传递闭包 + 二分 + 最大流
题目链接:https://vjudge.net/problem/HDU-3081 Marriage Match II Time Limit: 2000/1000 MS (Java/Others) ...
- jconsole工具检测堆内存变化的使用
jconsole将Java写的程序检测. 从Java 5开始 引入了 JConsole.JConsole 是一个内置 Java 性能分析器,可以从命令行或在 GUI shell 中运行.您可以轻松地使 ...
- poj 1195 Mobile phones 解题报告
题目链接:http://poj.org/problem?id=1195 题目意思:有一部 mobie phone 基站,它的面积被分成一个个小正方形(1 * 1 的大小),所有的小正方形的面积构成了一 ...