<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 通信的更多相关文章

  1. C#工作总结(一):Fleck的WebSocket使用

    一.引子(Foreword) 最近公司里面要做窗体和网页交互的功能.网上找了一下资料,这里做一个简单的扩充和整理,部分内容可能是摘自其他博客,这里会注明出处和原文地址供大家和自己日后查阅. 二.基础知 ...

  2. webSocket通信

    针对webSocket通信总结: 1.webSocket通信原理图: 2.webSocket通信实例 参考地址1:https://www.cnblogs.com/cjm123/p/9674506.ht ...

  3. C#(SuperWebSocket)与websocket通信

    原文:C#(SuperWebSocket)与websocket通信 客户端代码 点击可以查看一些关于websocket的介绍 <!DOCTYPE html> <html> &l ...

  4. js判断是否安装某个android app,没有安装下载该应用(websocket通信,监听窗口失去焦点事件)

    现在经常有写场景需要提示用户下载app, 但是如果用户已经安装,我们希望是直接打开app. 实际上,js是没有判断app是否已经安装的方法的,我们只能曲线救国. 首先,我们需要有call起app的sc ...

  5. Springboot集成WebSocket通信全部代码,即扣即用。

    websocket通信主要来自两个类以及一个测试的html页面. MyHandler 和 WebSocketH5Config,下面全部代码 MyHandler类全部代码: package com.un ...

  6. 【Java Web开发学习】Spring MVC整合WebSocket通信

    Spring MVC整合WebSocket通信 目录 ========================================================================= ...

  7. websocket通信1009错误,

    问题说明: springboot继承 WebSocketConfigurer实现websocket通信服务,服务器端报错,"The decoded text message was too ...

  8. Python3+WebSockets实现WebSocket通信

    一.说明 1.1 背景说明 前段时间同事说云平台通信使用了个websocket的东西,今天抽空来看一下具体是怎么个通信过程. 从形式上看,websocket是一个应用层协议,socket是数据链路层. ...

  9. 把酒言欢话聊天,基于Vue3.0+Tornado6.1+Redis发布订阅(pubsub)模式打造异步非阻塞(aioredis)实时(websocket)通信聊天系统

    原文转载自「刘悦的技术博客」https://v3u.cn/a_id_202 "表达欲"是人类成长史上的强大"源动力",恩格斯早就直截了当地指出,处在蒙昧时代即低 ...

随机推荐

  1. object-c iOS 教程 git for mac

    本文转载至 http://blog.csdn.net/u011728347/article/details/10035191   http://rypress.com/tutorials/object ...

  2. querying rpm database

    Call dbMatch on a transaction set to create a match iterator. As with the C API, a match iterator al ...

  3. spark 33G表

    http://192.168.2.51:4041 http://hadoop1:8088/proxy/application_1512362707596_0006/executors/ Executo ...

  4. MySQL 权限生效

    用GRANT.REVOKE或SET PASSWORD对授权表施行的修改会立即被服务器注意到. 如果你手工地修改授权表(使用INSERT.UPDATE等等),你应该执行一个FLUSH PRIVILEGE ...

  5. DataSnap Mobile Client Tutorial

    One of my customers was having some difficulty following the DataSnap tutorial which can be found he ...

  6. Linux 进程等待队列【转】

    本文转载自:http://blog.csdn.net/dlutbrucezhang/article/details/9212067 Linux内核的等待队列是以双循环链表为基础数据结构,与进程调度机制 ...

  7. python读取一个英文文件,并记录每个单词出现的次数,降序输出

    对文中出现的句号,逗号和感叹号做了相应的处理 sorted排序函数用法: 按照value值降序排列: sorted(dict.items(),key=lambda k:k[1],reverse=Tru ...

  8. 通过xmanager连接Linux图形界面

    今天要在linux下安装数据库,用的是xmanager:之前自己也用过该工具在OUI下做过安装,还很顺利. 但是,今天连接后,运行命令,等了有5分钟,没有出现OUI界面. linux版本: [root ...

  9. codeforces 691F F. Couple Cover(组合计数)

    题目链接: F. Couple Cover time limit per test 3 seconds memory limit per test 512 megabytes input standa ...

  10. SPOJ:Lexicographically Smallest(并查集&排序)

    Taplu and Abhishar loved playing scrabble. One day they thought of inventing a new game using alphab ...