[内容简介]

上一篇介绍了要显示K线图所需要的数据结构,及要动态显示K线图,需要动态读取数据文件必需的几个功能函数.本篇介绍要显示蜡烛图所用到的窗口界面设计及对应类定义.下面分述如下:

[窗口界面] 见下图

上图中对应各周期功能按钮和标签进行相应拖放操作就是了, 不再多述 .倒是图表区为一个Nplot控件,命名:myPlot.

[窗口类定义]

  1. 界面部分自动生成的代码文件:

///<ctp1.Designer.cs>

///K线图窗口界面代码此代码由VS自动生成。

//------------------------------------------------------------------------------

namespace Ctp

{

partialclassFormCtpThread

{

///<summary>

/// Required designer variable.

///</summary>

private System.ComponentModel.IContainer components = null;

///<summary>

/// Clean up any resources being used.

///</summary>

///<param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

protectedoverridevoid Dispose(bool disposing)

{

if (disposing && (components != null))

{

components.Dispose();

}

base.Dispose(disposing);

}

#region Windows Form Designer generated code

///<summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///</summary>

privatevoid InitializeComponent()

{

this.menuStrip1 = new System.Windows.Forms.MenuStrip();

this.M5 = new System.Windows.Forms.Button();

this.myPlot = new NPlot.Windows.PlotSurface2D();

this.M1 = new System.Windows.Forms.Button();

this.M15 = new System.Windows.Forms.Button();

this.M30 = new System.Windows.Forms.Button();

this.H1 = new System.Windows.Forms.Button();

this.D1 = new System.Windows.Forms.Button();

this.W1 = new System.Windows.Forms.Button();

this.Mn1 = new System.Windows.Forms.Button();

this.label_symbol = new System.Windows.Forms.Label();

this.label1 = new System.Windows.Forms.Label();

this.textBox1 = new System.Windows.Forms.TextBox();

this.enlarge = new System.Windows.Forms.Button();

this.shrink = new System.Windows.Forms.Button();

this.labelTime = new System.Windows.Forms.Label();

this.button3 = new System.Windows.Forms.Button();

this.buttonRoll = new System.Windows.Forms.Button();

this.textBox2 = new System.Windows.Forms.TextBox();

this.buttonMove = new System.Windows.Forms.Button();

this.SuspendLayout();

//

// menuStrip1

//

this.menuStrip1.Location = new System.Drawing.Point(0, 0);

this.menuStrip1.Name = "menuStrip1";

this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;

this.menuStrip1.Size = new System.Drawing.Size(1049, 24);

this.menuStrip1.TabIndex = 1;

this.menuStrip1.Text = "menuStrip1";

//

// M5

//

this.M5.AutoSize = true;

this.M5.CausesValidation = false;

this.M5.Location = new System.Drawing.Point(337, 0);

this.M5.Name = "M5";

this.M5.Size = new System.Drawing.Size(39, 24);

this.M5.TabIndex = 2;

this.M5.TabStop = false;

this.M5.Text = "5分";

this.M5.UseVisualStyleBackColor = true;

this.M5.Click += new System.EventHandler(this.M5_Click);

//

// myPlot

//

this.myPlot.AutoScaleAutoGeneratedAxes = false;

this.myPlot.AutoScaleTitle = false;

this.myPlot.BackColor = System.Drawing.Color.White;

this.myPlot.DateTimeToolTip = true;

this.myPlot.Dock = System.Windows.Forms.DockStyle.Fill;

this.myPlot.ForeColor = System.Drawing.Color.White;

this.myPlot.Legend = null;

this.myPlot.LegendZOrder = -1;

this.myPlot.Location = new System.Drawing.Point(0, 24);

this.myPlot.Name = "myPlot";

this.myPlot.RightMenu = null;

this.myPlot.ShowCoordinates = true;

this.myPlot.Size = new System.Drawing.Size(1049, 414);

this.myPlot.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;

this.myPlot.TabIndex = 1;

this.myPlot.Text = "myPlotSurface2D1";

this.myPlot.Title = "";

this.myPlot.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);

this.myPlot.XAxis1 = null;

this.myPlot.XAxis2 = null;

this.myPlot.YAxis1 = null;

this.myPlot.YAxis2 = null;

//

// M1

//

this.M1.AutoSize = true;

this.M1.CausesValidation = false;

this.M1.Location = new System.Drawing.Point(301, 0);

this.M1.Name = "M1";

this.M1.Size = new System.Drawing.Size(39, 24);

this.M1.TabIndex = 4;

this.M1.TabStop = false;

this.M1.Text = "1分";

this.M1.UseVisualStyleBackColor = true;

this.M1.Click += new System.EventHandler(this.M1_Click);

//

// M15

//

this.M15.AutoSize = true;

this.M15.CausesValidation = false;

this.M15.Location = new System.Drawing.Point(373, 0);

this.M15.Name = "M15";

this.M15.Size = new System.Drawing.Size(39, 24);

this.M15.TabIndex = 6;

this.M15.TabStop = false;

this.M15.Text = "15分";

this.M15.UseVisualStyleBackColor = true;

this.M15.Click += new System.EventHandler(this.M15_Click);

//

// M30

//

this.M30.AutoSize = true;

this.M30.CausesValidation = false;

this.M30.Location = new System.Drawing.Point(410, 0);

this.M30.Name = "M30";

this.M30.Size = new System.Drawing.Size(39, 24);

this.M30.TabIndex = 5;

this.M30.TabStop = false;

this.M30.Text = "30分";

this.M30.UseVisualStyleBackColor = true;

this.M30.Click += new System.EventHandler(this.M30_Click);

//

// H1

//

this.H1.AutoSize = true;

this.H1.CausesValidation = false;

this.H1.Location = new System.Drawing.Point(448, 0);

this.H1.Name = "H1";

this.H1.Size = new System.Drawing.Size(39, 24);

this.H1.TabIndex = 8;

this.H1.TabStop = false;

this.H1.Text = "1时";

this.H1.UseVisualStyleBackColor = true;

this.H1.Click += new System.EventHandler(this.H1_Click);

//

// D1

//

this.D1.AutoSize = true;

this.D1.CausesValidation = false;

this.D1.Location = new System.Drawing.Point(486, 0);

this.D1.Name = "D1";

this.D1.Size = new System.Drawing.Size(39, 24);

this.D1.TabIndex = 7;

this.D1.TabStop = false;

this.D1.Text = "1日";

this.D1.UseVisualStyleBackColor = true;

this.D1.Click += new System.EventHandler(this.D1_Click);

//

// W1

//

this.W1.AutoSize = true;

this.W1.CausesValidation = false;

this.W1.Location = new System.Drawing.Point(524, 0);

this.W1.Name = "W1";

this.W1.Size = new System.Drawing.Size(39, 24);

this.W1.TabIndex = 9;

this.W1.TabStop = false;

this.W1.Text = "1周";

this.W1.UseVisualStyleBackColor = true;

this.W1.Click += new System.EventHandler(this.W1_Click);

//

// Mn1

//

this.Mn1.AutoSize = true;

this.Mn1.CausesValidation = false;

this.Mn1.Location = new System.Drawing.Point(561, 0);

this.Mn1.Name = "Mn1";

this.Mn1.Size = new System.Drawing.Size(39, 24);

this.Mn1.TabIndex = 10;

this.Mn1.TabStop = false;

this.Mn1.Text = "1月";

this.Mn1.UseVisualStyleBackColor = true;

this.Mn1.Click += new System.EventHandler(this.Mn1_Click);

//

// label_symbol

//

this.label_symbol.AutoSize = true;

this.label_symbol.Location = new System.Drawing.Point(60, 6);

this.label_symbol.Name = "label_symbol";

this.label_symbol.Size = new System.Drawing.Size(41, 12);

this.label_symbol.TabIndex = 11;

this.label_symbol.Text = "label1";

//

// label1

//

this.label1.AutoSize = true;

this.label1.Location = new System.Drawing.Point(5, 6);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(29, 12);

this.label1.TabIndex = 12;

this.label1.Text = "商品";

//

// textBox1

//

this.textBox1.Location = new System.Drawing.Point(742, 2);

this.textBox1.Name = "textBox1";

this.textBox1.Size = new System.Drawing.Size(104, 21);

this.textBox1.TabIndex = 13;

//

// enlarge

//

this.enlarge.FlatStyle = System.Windows.Forms.FlatStyle.System;

this.enlarge.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

this.enlarge.Location = new System.Drawing.Point(601, 0);

this.enlarge.Name = "enlarge";

this.enlarge.Size = new System.Drawing.Size(24, 23);

this.enlarge.TabIndex = 14;

this.enlarge.TabStop = false;

this.enlarge.Text = "+";

this.enlarge.UseVisualStyleBackColor = true;

this.enlarge.Click += new System.EventHandler(this.enlarge_Click);

//

// shrink

//

this.shrink.FlatStyle = System.Windows.Forms.FlatStyle.System;

this.shrink.Font = new System.Drawing.Font("Arial", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

this.shrink.Location = new System.Drawing.Point(625, 0);

this.shrink.Name = "shrink";

this.shrink.Size = new System.Drawing.Size(24, 23);

this.shrink.TabIndex = 15;

this.shrink.TabStop = false;

this.shrink.Text = "-";

this.shrink.UseVisualStyleBackColor = true;

this.shrink.Click += new System.EventHandler(this.shrink_Click);

//

// labelTime

//

this.labelTime.AutoSize = true;

this.labelTime.Location = new System.Drawing.Point(182, 6);

this.labelTime.Name = "labelTime";

this.labelTime.Size = new System.Drawing.Size(41, 12);

this.labelTime.TabIndex = 16;

this.labelTime.Text = "label2";

//

// button3

//

this.button3.Location = new System.Drawing.Point(974, 0);

this.button3.Name = "button3";

this.button3.Size = new System.Drawing.Size(75, 23);

this.button3.TabIndex = 17;

this.button3.Text = "button3";

this.button3.UseVisualStyleBackColor = true;

this.button3.Click += new System.EventHandler(this.button3_Click);

//

// buttonRoll

//

this.buttonRoll.FlatStyle = System.Windows.Forms.FlatStyle.System;

this.buttonRoll.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

this.buttonRoll.Location = new System.Drawing.Point(689, 0);

this.buttonRoll.Name = "buttonRoll";

this.buttonRoll.Size = new System.Drawing.Size(38, 23);

this.buttonRoll.TabIndex = 19;

this.buttonRoll.TabStop = false;

this.buttonRoll.Text = "滚动";

this.buttonRoll.UseVisualStyleBackColor = true;

this.buttonRoll.Click += new System.EventHandler(this.buttonRoll_Click);

//

// textBox2

//

this.textBox2.Location = new System.Drawing.Point(862, 2);

this.textBox2.Name = "textBox2";

this.textBox2.Size = new System.Drawing.Size(100, 21);

this.textBox2.TabIndex = 20;

this.textBox2.Visible = false;

//

// buttonMove

//

this.buttonMove.Location = new System.Drawing.Point(651, 0);

this.buttonMove.Name = "buttonMove";

this.buttonMove.Size = new System.Drawing.Size(37, 23);

this.buttonMove.TabIndex = 21;

this.buttonMove.Text = "平移";

this.buttonMove.UseVisualStyleBackColor = true;

this.buttonMove.Click += new System.EventHandler(this.buttonMove_Click);

//

// FormCtpThread

//

this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

this.ClientSize = new System.Drawing.Size(1049, 438);

this.Controls.Add(this.buttonMove);

this.Controls.Add(this.textBox2);

this.Controls.Add(this.buttonRoll);

this.Controls.Add(this.button3);

this.Controls.Add(this.labelTime);

this.Controls.Add(this.shrink);

this.Controls.Add(this.enlarge);

this.Controls.Add(this.textBox1);

this.Controls.Add(this.label1);

this.Controls.Add(this.label_symbol);

this.Controls.Add(this.Mn1);

this.Controls.Add(this.W1);

this.Controls.Add(this.H1);

this.Controls.Add(this.D1);

this.Controls.Add(this.M15);

this.Controls.Add(this.M30);

this.Controls.Add(this.M1);

this.Controls.Add(this.myPlot);

this.Controls.Add(this.M5);

this.Controls.Add(this.menuStrip1);

this.KeyPreview = true;

this.Name = "FormCtpThread";

this.Text = "FormCtpThread";

this.Load += new System.EventHandler(this.FormCtp_Load);

this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormCtp_KeyDown);

this.ResumeLayout(false);

this.PerformLayout();

}

#endregion

private System.Windows.Forms.MenuStrip menuStrip1;

private System.Windows.Forms.Button M5;

private NPlot.Windows.PlotSurface2D myPlot;

private System.Windows.Forms.Button M1;

private System.Windows.Forms.Button M15;

private System.Windows.Forms.Button M30;

private System.Windows.Forms.Button H1;

private System.Windows.Forms.Button D1;

private System.Windows.Forms.Button W1;

private System.Windows.Forms.Button Mn1;

private System.Windows.Forms.Label label_symbol;

private System.Windows.Forms.Label label1;

private System.Windows.Forms.TextBox textBox1;

private System.Windows.Forms.Button enlarge;

private System.Windows.Forms.Button shrink;

private System.Windows.Forms.Label labelTime;

private System.Windows.Forms.Button button3;

private System.Windows.Forms.Button buttonRoll;

private System.Windows.Forms.TextBox textBox2;

private System.Windows.Forms.Button buttonMove;

//private NPlot.Windows.PlotSurface2D myplot;

}

}

  1. 蜡烛图表类的显示部分代码:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Text;

using System.IO;

using System.Data;

using System.Drawing;

using System.Globalization;

using System.Drawing.Drawing2D;

using System.Linq;

using System.Collections;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Runtime.Remoting;

using StockAnalyse;

using INIRead;

using NPlot;

using System.Runtime.InteropServices;

using System.Threading;

/////////////////////////////////////////////////////////////////////////

///20160806        觉海QQ:806935610创建该文件

///@brief 蜡烛图显示类的定义文件: ///@ctp.cs

///类定义名称:class FormCtpThread

///20160806

///此版本已经可以自动更新价格,但不能滚动K线

///已经实现K价格图表自动更新

/////////////////////////////////////////////////////////////////////////

namespace Ctp

{

publicpartialclassFormCtpThread : Form

{

//使用多线程计时器

private System.Timers.Timer timer = new System.Timers.Timer(1000);

///<summary>

/// /////////////////////////////成员

///</summary>

publicList<QuotesInfo> DataSymbol { get; set; }

publicList<StockInfo> DataStock { get; set; }

publicList<StockInfo> DataStockReverse { get; set; }

String period;

StockAnalyse.TimeFrame timeFrame = StockAnalyse.TimeFrame.D1;

String stockName;

double xMin, xMax, yMin, yMax;

int xInitShowBars = 300;

int xShowBars = 300;//k线最大数

CandlePlot cp = newCandlePlot();

string pathCtp { get; set; }

string file { get; set; }

public FormCtpThread()

{

InitializeComponent();

//MessageBox.Show("PK");

}

public FormCtpThread(string _file)

{

InitializeComponent();

file = _file;

//this.label_symbol.Text = file;

//MessageBox.Show("PK");

}

privatevoid FormCtp_Load(object sender, EventArgs e)

{

OpenChartFile(file);

this.MouseWheel += newMouseEventHandler(FormCtp_MouseWheel);

timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);

timer.Enabled = true;

timer.AutoReset = true; //是否不断重复定时器操作

}

void FormCtp_MouseWheel(object sender, MouseEventArgs e)

{

if (e.Delta > 0)

{

// this.Text = "正在向上滚动滑轮";用于放大K线蜡烛图;

ChangeSize(1);

}

elseif (e.Delta < 0)

{

// this.Text = "正在向下滚动滑轮"用于缩小K蜡烛图;

ChangeSize(-1);

}

}

void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)

{

//用于实现K线图表自动读取文件数据,并定时刷新显示

labelTime.Text = DateTime.Now.ToString();//调用内容,并用lable1显示出来。。。

OpenChartFileLastBar(file);

if (!isMove)

KMove(ref xBegin, ref xEnd, ref xShowBars, 0);

}

}

上面的窗口类定义文件,包含了本程序的主要代码,加入定时器用于实现K线图表自动读取文件数据,并定时刷新显示,时间为1000ms

以下为K线图自动更新代码:

void ReFreshMe(refint xBegin, refint xEnd, refint xShowBars, int opMode)

{

int xDisLen = xBegin - xEnd;

textBox1.Text = xDisLen.ToString();

int n, m;

if (opMode > 0)

{

n = xBegin - xEnd; //(int)(xShowBars) / 1;

//MessageBox.Show(n.ToString());

m = n / 2;

m = Math.Max(2, m);

xBegin = xDisLen = Math.Min(m, DataStock.Count - 1);

xEnd = 0;// Math.Max(xEnd - m, 0);

}

elseif (opMode < 0)

{

n = xBegin - xEnd;

m = n * 2;

xBegin = xDisLen = Math.Min(m, DataStock.Count - 1);

xEnd = 0;// Math.Max(xEnd - m, 0);

}

else//首次加载

{

n = xInitShowBars;

xBegin = xDisLen = Math.Min(n, DataStock.Count - 1);

xEnd = 0;// Math.Max(xEnd - m, 0);

}

//判定要显示的数据数量

List<Double> DataOpen = newList<Double>();

List<Double> DataHigh = newList<Double>();

List<Double> DataLow = newList<Double>();

List<Double> DataClose = newList<Double>();

List<DateTime> DataTime = newList<DateTime>();

List<int> Time = newList<int>();

for (int i = xBegin - 1; i >= xEnd; i--)

{

DataHigh.Add(DataStock[i].high);

DataLow.Add(DataStock[i].low);

DataClose.Add(DataStock[i].close);

DataOpen.Add(DataStock[i].open);

DataTime.Add(DataStock[i].date);

//Time.Add(i);

}

//写横坐标轴数据

for (int i = 00; i < xDisLen + 5; i++) Time.Add(i);

cp.OpenData = DataOpen.ToArray();

cp.CloseData = DataClose.ToArray();

cp.HighData = DataHigh.ToArray();

cp.LowData = DataLow.ToArray();

cp.AbscissaData = Time.ToArray();

PlotCandle(cp, DataTime, timeFrame);

}

下面为蜡烛K线图形缩放代码和K线图绘制代码:

///放大缩小

privatevoid ChangeSize(int opMode)

{

ReFreshMe(ref xBegin, ref xEnd, ref xShowBars, opMode);

}

/////////K线图绘制//////////

publicvoid PlotCandle(CandlePlot cp, List<DateTime> dates, StockAnalyse.TimeFrame timeframe)

{

try

{

myPlot.Clear();

// --- Grid Code ---

Grid mygrid = newGrid();

mygrid.HorizontalGridType = Grid.GridType.Fine;

mygrid.VerticalGridType = Grid.GridType.Fine;

myPlot.Add(mygrid);

cp.BullishColor = Color.Red;

//cp.Color = Color.Black;

cp.Centered = false;

cp.BearishColor = Color.Green;

cp.Style = CandlePlot.Styles.Filled;

this.myPlot.Add(cp);

//////这里需要先添加图形后设置坐标轴

/////字符坐标轴加入后会隐藏原来的x坐标轴

LabelAxis la1 = newLabelAxis(this.myPlot.XAxis1);

for (int i = 00; i < dates.Count; i++)

{

switch (timeframe)

{

case StockAnalyse.TimeFrame.M1:

if (Math.IEEERemainder(i, 30) == 0)

la1.AddLabel(dates[i].ToShortTimeString() + @" " + dates[i].ToShortDateString(), i);

break;

case StockAnalyse.TimeFrame.M5:

if (Math.IEEERemainder(i, 12) == 0)

la1.AddLabel(dates[i].ToShortTimeString() + @" " + dates[i].ToShortDateString(), i + 00);

break;

default:

if (Math.IEEERemainder(i, 5) == 0)

la1.AddLabel(dates[i].ToShortTimeString() + @" " + dates[i].ToShortDateString(), i + 00);

break;

}

}

//la1.Label = "时间";

la1.TickTextFont = newFont("Courier New", 8);

la1.TicksBetweenText = false;

this.myPlot.XAxis1 = la1;

度。

//myPlot.XAxis1.TicksLabelAngle = 45;

myPlot.Refresh();

}

catch (Exception e)

{

//Console.WriteLine("{0} Exception caught.", e);

//MessageBox.Show(e.ToString());

}

}

C#下如何用NPlot绘制期货股票K线图(3):设计要显示的股票价格图表窗口并定义相应类的成员及函数的更多相关文章

  1. C#下如何用NPlot绘制期货股票K线图(2):读取数据文件让K线图自动更新

    [内容介绍]上一篇介绍了K线图的基本绘制方法,但很不完善,本篇增加了它直接读取数据的功能,这对于金融市场的数据量大且又需要动态刷新功能的实现很重要. [实现方法] 1.需要一个数据文件,这里用的是直接 ...

  2. C#下如何用NPlot绘制期货股票K线图(1)?

    [简介] 作为一名专业程序化交易者,编程是一个程序员的基本功,本文是作者在做的一个期货CTP项目中有关K线绘图的一部分,偿试类MT4中图表 设计而写,在编写绘图时,查阅了相关资料,感觉还是用NPlot ...

  3. 利用JFreeChart绘制股票K线图完整解决方案

    http://blog.sina.com.cn/s/blog_4ad042e50100q7d9.html 利用JFreeChart绘制股票K线图完整解决方案 (2011-04-30 13:27:17) ...

  4. WPF中使用amCharts绘制股票K线图

    原文:WPF中使用amCharts绘制股票K线图 本想自己用GDI绘图, 通过数据直接绘制一张蜡柱图, 但觉得这样子的功能比较少, 所以到网上搜索一些能画出K线图的控件. 发现DynamicDataD ...

  5. PHP使用HighChart生成股票K线图详解

    本人qq群也有许多的技术文档,希望可以为你提供一些帮助(非技术的勿加). QQ群:   281442983 (点击链接加入群:http://jq.qq.com/?_wv=1027&k=29Lo ...

  6. 股票K线图-JfreeChart版

    http://blog.csdn.net/ami121/article/details/3953272 股票K线图-JfreeChart版 标签: jfreechartpropertiesapplet ...

  7. python pandas 画图、显示中文、股票K线图

    目录: 1.pandas官方画图链接 2.标记图中数据点 3.画图显示中文 4.画股票K线图 5.matplotlib基本用法 6.format输出 6.format输出例子 eps_range=[0 ...

  8. IOS 股票K线图、分时图

    IOS 股票K线图.分时图,网上开源项目很少,质量也是参差不齐:偶尔搜索到看似有希望的文章,点进去,还是个标题党:深受毒害.经过一段时间的探索,终于在开源基础上完成了自己的股票K线图.分时图: 先放出 ...

  9. 基于Echarts的股票K线图展示

    发布时间:2018-10-31   技术:javascript+html5+canvas   概述 基于echarts的股票K线图展示,只需引用单个插件,通过简单配置,导入数据,即可实现炫酷复杂的K线 ...

随机推荐

  1. 从打车软件你能想到多少?盈利模式?商机?大数据?移动互联网蛋糕?生活方式改变withApp?

    物联网.云服务.大数据.. 淘宝.12306.卡通...一个产品改变一次生活方式. 打车app,无疑是改变生活方式的又一个产品.从打车软件,你能看到什么? 个人认为,打车软件值得各种投资方斥资,最重要 ...

  2. 计蒜客 取数游戏(dp)

    有如下一个双人游戏:N个正整数的序列放在一个游戏平台上,两人轮流从序列的两端取数,每次有数字被一个玩家取走后,这个数字被从序列中去掉并累加到取走该数的玩家的得分中,当数取尽时,游戏结束.以最终得分多者 ...

  3. Shell的那些事儿

    日常工作中,哪种语言对你的帮助最大?我觉得非Shell莫属.最早接触Shell应该是在大学的时候,如做Linux文件系统裁减会用到一些命令,如find, tar, xargs, cp等等,并把它们通过 ...

  4. storm出现的背景

     storm出现的背景 互联网从诞生的第一时间起,对世界的最大改变就是让信息能够实时交互,从而大大加速了各个环节的效率.正因为大家有对信息实时响应.实时交互的需求,所以软件行业除了个人操作系统之外,数 ...

  5. Laravle Introduction

    Where To Start Learning a new framework can be daunting, but it's also exciting. To smooth your tran ...

  6. Properties操作

    import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream; ...

  7. html的框架

  8. struts2设置<s:select>默认选中项的方法

    struts2的select标签中,常用的有以下几个属性:(1)struts2中的select 标签中,必须设置的属性只有一个,即是list.(2)select标签的list中必须有值,不然会报错.如 ...

  9. 【转】Spring websocket 使用

    http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html https://spr ...

  10. 标准I/O库之每次一行I/O

    下面两个函数提供每次输入一行的功能. #include <stdio.h> char *fgets( char *restrict buf, int n, FILE *restrict f ...