前言


有段时间没有更新博文了,一直在忙工作很少有时间静下心来继续研究点东西,说来也惭愧,归咎原因最主要的还是因为懒惰。空想也是不管用的,有时候很多想法被扼杀到了摇篮里,还没开始做就放弃了,这是多数人会有的恶习,世界上最不缺少的就是空想家,而是实践者,有句俗话说的好不怕千招会,只怕一招绝,能踏踏实实做好一件事的人才是人生的赢家。另外在平时也有研究过很多有趣的技术,但往往是没有研究到最后,只是研究了如何使用它,然后想要写成文章就是很危险的事情,如果对某项技术研究的并不通透,这时候发表见解的话这样只会害人,不会帮助人,要知道一知半解最后害的会是自己。

一、架构浅析


上文是写给自己的因为发现自己最近有懒惰的恶习,所以做一下小小的检讨,好了言归正传。上文讨论了在分布式开发时会用的基本的技术,其中包括微软的WCF、Windows Service、Message Queue等,其中的Message Queue主要是讨论了微软的MQ,因为笔者现在是一名.net的程序猿,所以从最基本的微软MQ开始详细讨论了MQ的使用方法。在有了前几篇的技术基础之后就可以来看这篇文章了。
该篇文章将会使用前几篇文章讨论到的技术来搭一套小的框架,主要是实现Application(电脑或者移动端)和Web Service之间互相的通信,中间的消息中介服务使用上文讨论到的MQ来实现,具体的架构如下图所示:

关于上图的实现,本例中的Application只是使用了Computer端的WPF来做的一个小的应用,消息队列方是使用微软的Message Queue来开发,Server Service开发的是Windows Service,远程端的Web Service使用WCF来做的开发。具体开发的代码将会在下文中详细讨论。
         Note:这种架构下近端的实体、远程端的实体、WebService的实体以及数据契约的结构必须保持一致,这样在开发时可以避免写很多转换的中间代码。

二、架构代码

2.1 近端App

应用程序端做的是简单的WPF应用程序,模拟了近端应用程序在执行完成后发送的消息信息到消息队列中,本例中的消息队列存储的是xml格式的对象信息,所以在发送消息对象时需要首先指定消息队列中信息的存储方式,具体的模拟代码如下:

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net.Security;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Messaging;
  8. using System.Xml.Serialization;
  9. namespace MQSend
  10. {
  11. public class SendMQ
  12. {
  13. public void Send()
  14. {
  15. MessageQueue mq = null;
  16. if (!MessageQueue.Exists(".\\private$\\MSMQ"))
  17. {
  18. mq = MessageQueue.Create(".\\private$\\MSMQ");
  19. }
  20. else
  21. {
  22. mq = new MessageQueue(".\\private$\\MSMQ");
  23. }
  24. mq.Formatter = new XmlMessageFormatter(new Type[] { typeof(Student),typeof(Teacher) });
  25. for (int i = 0; i < 6; i++)
  26. {
  27. mq.Send(new Student(){Id =i,Age = "13",Name = "张三"+i.ToString(),
  28. Teachers = new List<Teacher>()
  29. {
  30. new Teacher() { Id = 2,
  31. Name = "李老师"+i.ToString() }
  32. }
  33. });
  34. }
  35. mq.Close();
  36. }
  37. }
  38. [Serializable]
  39. public class Student
  40. {
  41. public int Id { get; set; }
  42. public string Name { get; set; }
  43. public string Age { get; set; }
  44. public List<Teacher> Teachers { get; set; }
  45. }
  46. [Serializable]
  47. public class Teacher
  48. {
  49. public int Id { get; set; }
  50. public string Name { get; set; }
  51. public List<Student> Students { get; set; }
  52. }
  53. }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security;
using System.Text;
using System.Threading.Tasks;
using System.Messaging;
using System.Xml.Serialization; namespace MQSend
{
public class SendMQ
{
public void Send()
{
MessageQueue mq = null;
if (!MessageQueue.Exists(".\\private$\\MSMQ"))
{
mq = MessageQueue.Create(".\\private$\\MSMQ");
}
else
{
mq = new MessageQueue(".\\private$\\MSMQ");
}
mq.Formatter = new XmlMessageFormatter(new Type[] { typeof(Student),typeof(Teacher) }); for (int i = 0; i < 6; i++)
{
mq.Send(new Student(){Id =i,Age = "13",Name = "张三"+i.ToString(),
Teachers = new List<Teacher>()
{
new Teacher() { Id = 2,
Name = "李老师"+i.ToString() }
}
});
}
mq.Close();
}
} [Serializable]
public class Student
{
public int Id { get; set; }
public string Name { get; set; }
public string Age { get; set; }
public List<Teacher> Teachers { get; set; } }
[Serializable]
public class Teacher
{
public int Id { get; set; }
public string Name { get; set; }
public List<Student> Students { get; set; }
} }

Note:上面的代码实体对象Student和Teacher存在多对多的关系,这种关系在序列化时往往会出现循环引用的问题,因为序列化实际上是一种属性的遍历,会沿着对象一直向下循环序列化,所以在编程的时候一定要注意循环应用的

问题。

        Note:另外在引用属性集合时不要声明接口类型的集合,因为在发送消息队列进行序列化时不允许声明接口类型的集合,否则会发生类似于“XX是接口,因此无法将其序列化。”的问题。

        运行该应用程序后,消息会被发送到本机的消息队列中,具体的消息示意图如下:

2.2 远程端Server Service


远程端的Service本例开发的是Windows的服务,因为服务自开机之后可以时刻的在运行,也就是说可以时刻的获取消息队列中的消息,然后调用远程端的Web Service对消息进行处理。由于近端的消息发送的内容是xml序列化后的对象,所以在远程端server在操作消息对象时需要将对象首先反序列化为Service的实体对象(这里的实体对象是指Web Service的实体对象),然后对实体对象做所有的操作。



        另外在开发Service的时候最好中间可以记录Service的运行过程,也就是将Service的运行过程记录到日志文件中,因为Service在运行过程中很容易出现问题,在出现问题时将问题的内容记录到日志文件中,这样能够较快的找到并修复问题。



        每个Service都会有很多事件,其中使用最多的就是Service的开启事件OnStart和结束事件OnStop,该例中在这两个事件中分别添加了日志记录的功能,也就是在服务开启和关闭时都会将服务的运行状况写入日志。另外在该服务中添加了一个Timer控件,该控件的Interval时间设置为1000ms,这样可以实时的请求消息,然后对消息做操作,并保存日志信息。

         项目结构如下图所示,项目中添加了系统的WebService,并为该WebService添加了具体的代理类MQServiceClient以及工具类FileOperate。

Service的具体代码如下所示:

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Messaging;
  9. using System.ServiceModel;
  10. using System.ServiceProcess;
  11. using System.Text;
  12. using System.Threading;
  13. using System.Threading.Tasks;
  14. using DistributeService.MQService;
  15. namespace DistributeService
  16. {
  17. public partial class Service1 : ServiceBase
  18. {
  19. public Service1()
  20. {
  21. InitializeComponent();
  22. }
  23. private ServiceHost host;
  24. private FileOperate fileOperate
  25. {
  26. get
  27. {
  28. return FileOperate.GetFileOperate();
  29. }
  30. }
  31. protected override void OnStart(string[] args)
  32. {
  33. try
  34. {
  35. var str = "▌▌▌▌▌▌▌MQService start at " + DateTime.Now.ToString() + "▌▌▌▌▌▌▌\r\n";
  36. fileOperate.WriteText(str, fileOperate.FileS);
  37. }
  38. catch (Exception ex)
  39. {
  40. fileOperate.WriteText(ex.Message, fileOperate.FileS);
  41. throw;
  42. }
  43. }
  44. protected override void OnStop()
  45. {
  46. Thread.Sleep(30000);
  47. var str = "▌▌▌▌▌▌▌MQService stop at " + DateTime.Now.ToString() + "▌▌▌▌▌▌▌\r\n"; ;
  48. fileOperate.WriteText(str,fileOperate.FileS);
  49. if (this.host!=null)
  50. {
  51. this.host.Close();
  52. }
  53. }
  54. private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
  55. {
  56. MessageQueue mq = null;
  57. if (MessageQueue.Exists(".\\private$\\MSMQ"))
  58. {
  59. mq = new MessageQueue(".\\private$\\MSMQ");
  60. try
  61. {
  62. mq.Formatter = new XmlMessageFormatter(new Type[] {typeof (Student)});
  63. var me = mq.Receive();
  64. var stu = me.Body;
  65. fileOperate.WriteText(stu.ToString() + "\r\n", fileOperate.FileM);
  66. var client = new MQHandlerClient();//.GetMqHandlerService();
  67. client.Add((Student) stu);
  68. client.Close();
  69. }
  70. catch (Exception ex)
  71. {
  72. fileOperate.WriteText(ex.ToString() + "\r\n", fileOperate.FileM);
  73. throw;
  74. }
  75. finally
  76. {
  77. mq.Close();
  78. }
  79. }
  80. }
  81. }
  82. }
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Messaging;
using System.ServiceModel;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using DistributeService.MQService; namespace DistributeService
{
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
} private ServiceHost host;
private FileOperate fileOperate
{
get
{
return FileOperate.GetFileOperate();
}
} protected override void OnStart(string[] args)
{
try
{
var str = "▌▌▌▌▌▌▌MQService start at " + DateTime.Now.ToString() + "▌▌▌▌▌▌▌\r\n";
fileOperate.WriteText(str, fileOperate.FileS);
}
catch (Exception ex)
{
fileOperate.WriteText(ex.Message, fileOperate.FileS);
throw;
} } protected override void OnStop()
{
Thread.Sleep(30000);
var str = "▌▌▌▌▌▌▌MQService stop at " + DateTime.Now.ToString() + "▌▌▌▌▌▌▌\r\n"; ;
fileOperate.WriteText(str,fileOperate.FileS); if (this.host!=null)
{
this.host.Close();
}
} private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
MessageQueue mq = null;
if (MessageQueue.Exists(".\\private$\\MSMQ"))
{
mq = new MessageQueue(".\\private$\\MSMQ");
try
{
mq.Formatter = new XmlMessageFormatter(new Type[] {typeof (Student)});
var me = mq.Receive();
var stu = me.Body; fileOperate.WriteText(stu.ToString() + "\r\n", fileOperate.FileM); var client = new MQHandlerClient();//.GetMqHandlerService();
client.Add((Student) stu);
client.Close();
}
catch (Exception ex)
{
fileOperate.WriteText(ex.ToString() + "\r\n", fileOperate.FileM);
throw;
}
finally
{
mq.Close();
} } }
}
}

其中的WebSerivceClient的代码如下所示:

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Management.Instrumentation;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using DistributeService.MQService;
  8. namespace DistributeService
  9. {
  10. public class MQServiceClient
  11. {
  12. private static MQHandlerClient instance;
  13. private static object _object = new object();
  14. private MQServiceClient()
  15. {
  16. }
  17. public static MQHandlerClient GetMqHandlerService()
  18. {
  19. if (instance == null)
  20. {
  21. lock (_object)
  22. {
  23. if (instance==null)
  24. {
  25. instance=new MQHandlerClient();
  26. }
  27. }
  28. }
  29. return instance;
  30. }
  31. ~MQServiceClient()
  32. {
  33. if (instance!=null)
  34. {
  35. instance.Close();
  36. instance.Abort();
  37. }
  38. }
  39. }
  40. }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Instrumentation;
using System.Text;
using System.Threading.Tasks;
using DistributeService.MQService; namespace DistributeService
{
public class MQServiceClient
{
private static MQHandlerClient instance;
private static object _object = new object(); private MQServiceClient()
{
} public static MQHandlerClient GetMqHandlerService()
{
if (instance == null)
{
lock (_object)
{
if (instance==null)
{
instance=new MQHandlerClient();
}
}
} return instance;
} ~MQServiceClient()
{
if (instance!=null)
{
instance.Close();
instance.Abort();
}
}
}
}

Note:这里的代码主要是做的消息处理,但是往往会出现错误,所以要记录运行日志,推荐使用开源的log4net或者Nlog,但是本例中是自己将堆栈信息写入到文本文件当中,可以方便查看。

2.3 远程端Web Service

远程端Web Service公开了对消息的处理接口,主要是做的DB的增删改查的操作。该例的Web Service使用的是WCF来开发的,后台使用了EF 的Code First作为系统的ORM框架,并使用FluentAPI来搭建了系统的映射部分,系统对外公布了数据库的增删改查接口,具体的结构图如下所示:

整个远程端的Web Service为其它端提供了数据的操作,其中的WCF在部署到host后对外公开对数据库的CRUD操作接口,向下的DAL层封装了数据库的上下文(DbContext)以及数据库的表实体,DAL层实体对象到数据库的映射规则被封装到了Mapping层中,该层的映射使用的是FluentAPI来实现的,最终对数据库的操作是EF框架做的操作。接下来将会展示下几个主要层的代码。

2.3.1  WCF层增删改查

下面的代码是使用WCF来开发的Service,该Service在创建客户端对象时会同时创建数据库的一个上下文对象,最后将数据同步到Context中,由EF管理并同步到DB中。

  1. using System;
  2. using System.Collections.Generic;
  3. using DAL;
  4. using Entitys;
  5. namespace DistributeWCF
  6. {
  7. // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MQHandler" in code, svc and config file together.
  8. // NOTE: In order to launch WCF Test Client for testing this service, please select MQHandler.svc or MQHandler.svc.cs at the Solution Explorer and start debugging.
  9. public class MQHandler: IMQHandler
  10. {
  11. private TestContext context;
  12. public MQHandler()
  13. {
  14. this.context=new TestContext();
  15. }
  16. public bool Add(Student stu)
  17. {
  18. this.context.Students.Add(new Entitys.Student(){Name = stu.Name,Teachers = new List<Entitys.Teacher>()});
  19. this.context.SaveChanges();
  20. return true;
  21. }
  22. public bool Delete(int stuId)
  23. {
  24. var stu = this.context.Students.Find(new {stuId});
  25. this.context.Students.Remove(stu);
  26. this.context.SaveChanges();
  27. return true;
  28. }
  29. public bool Update(Student stu) { return true; }
  30. public List<Student> FindAll()
  31. {
  32. var lists = this.context.Students.SqlQuery("select * from student");
  33. var liststu = new List<Student>();
  34. foreach (var student in lists)
  35. {
  36. var stu = new Student();
  37. stu.StudentId = student.Id;
  38. stu.Name = student.Name;
  39. stu.Sex = student.Age;
  40. stu.Teachers = new List<Teacher>();
  41. foreach (var teacher in student.Teachers)
  42. {
  43. stu.Teachers.Add(new Teacher()
  44. {
  45. Id = teacher.Id,
  46. Name = teacher.Name,
  47. });
  48. }
  49. }
  50. return liststu;
  51. }
  52. }
  53. }
using System;
using System.Collections.Generic;
using DAL;
using Entitys; namespace DistributeWCF
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "MQHandler" in code, svc and config file together.
// NOTE: In order to launch WCF Test Client for testing this service, please select MQHandler.svc or MQHandler.svc.cs at the Solution Explorer and start debugging.
public class MQHandler: IMQHandler
{
private TestContext context;
public MQHandler()
{
this.context=new TestContext();
} public bool Add(Student stu)
{
this.context.Students.Add(new Entitys.Student(){Name = stu.Name,Teachers = new List<Entitys.Teacher>()});
this.context.SaveChanges();
return true;
} public bool Delete(int stuId)
{
var stu = this.context.Students.Find(new {stuId});
this.context.Students.Remove(stu);
this.context.SaveChanges();
return true;
} public bool Update(Student stu) { return true; } public List<Student> FindAll()
{
var lists = this.context.Students.SqlQuery("select * from student");
var liststu = new List<Student>();
foreach (var student in lists)
{
var stu = new Student();
stu.StudentId = student.Id;
stu.Name = student.Name;
stu.Sex = student.Age;
stu.Teachers = new List<Teacher>();
foreach (var teacher in student.Teachers)
{
stu.Teachers.Add(new Teacher()
{
Id = teacher.Id,
Name = teacher.Name,
});
}
}
return liststu;
}
} }

2.3.2 Fluent API的Mapping映射代码

该例使用的是Fluent API来做的映射,因为这种映射在修改时会非常的方便,并且在开发时控制对象关系编译的过程,所以使用此种方法映射功能,该种映射非常的简单,只要熟悉映射的规则就可以很容易操作。如下代码演示了该例中学生和老师的多对多关系之间的映射。

        对应的Teacher的Entity以及Mapping代码如下:

  1. using System.Data.Entity.ModelConfiguration;
  2. using Entitys;
  3. namespace Mapping
  4. {
  5. public class TeacherMapping:EntityTypeConfiguration<Teacher>
  6. {
  7. public TeacherMapping()
  8. {
  9. this.ToTable("Teacher");
  10. this.HasKey(x => x.Id);
  11. this.Property(x => x.Id).HasColumnName("Id");
  12. this.Property(x => x.Name);
  13. this.HasMany(x=>x.Students)
  14. .WithMany(x=>x.Teachers)
  15. .Map(x => x.ToTable("StuTeahcer").MapLeftKey("TeacherId")
  16. .MapRightKey("StudentId")
  17. );
  18. }
  19. }
  20. public class Teacher
  21. {
  22. public int Id { get; set; }
  23. public string Name { get; set; }
  24. public IList<Student> Students { get; set; }
  25. }
  26. }
using System.Data.Entity.ModelConfiguration;
using Entitys;
namespace Mapping
{
public class TeacherMapping:EntityTypeConfiguration<Teacher>
{
public TeacherMapping()
{
this.ToTable("Teacher");
this.HasKey(x => x.Id);
this.Property(x => x.Id).HasColumnName("Id");
this.Property(x => x.Name);
this.HasMany(x=>x.Students)
.WithMany(x=>x.Teachers)
.Map(x => x.ToTable("StuTeahcer").MapLeftKey("TeacherId")
.MapRightKey("StudentId")
);
}
} public class Teacher
{
public int Id { get; set; }
public string Name { get; set; }
public IList<Student> Students { get; set; }
} }

对应的Student的Entity以及Mapping代码如下:

  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. using Entitys;
  4. namespace Mapping
  5. {
  6. public class StudentMapping:EntityTypeConfiguration<Student>
  7. {
  8. public StudentMapping()
  9. {
  10. this.ToTable("Student");
  11. this.HasKey(x => x.Id);
  12. this.Property(x => x.Id)
  13. .HasColumnName("Id")
  14. .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
  15. .HasColumnType("int");
  16. this.Property(x => x.Name);
  17. this.Property(x => x.Age);
  18. }
  19. }
  20. public class Student
  21. {
  22. public int Id { get; set; }
  23. public string Name { get; set; }
  24. public string Age { get; set; }
  25. public IList<Teacher> Teachers { get; set; }
  26. }
  27. }
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Entitys;
namespace Mapping
{
public class StudentMapping:EntityTypeConfiguration<Student>
{
public StudentMapping()
{
this.ToTable("Student");
this.HasKey(x => x.Id);
this.Property(x => x.Id)
.HasColumnName("Id")
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
.HasColumnType("int");
this.Property(x => x.Name);
this.Property(x => x.Age);
}
} public class Student
{
public int Id { get; set; }
public string Name { get; set; }
public string Age { get; set; }
public IList<Teacher> Teachers { get; set; }
} }

Note:EF的实体到对象的映射有多种方式,最常用的是DataAnnotations数据注解以及Fluent API两种方式来编写映射。该例中的学生和老师属于多对多的关系,在使用Fluent API添加映射的时候只需要在对象的一端添加相互之间的多对多关系,因为此种关系要生成中间表所以要使用ToTable来指定中间表的表明,以及使用MapLeftKey和MapRightKey指定表的主键。

        上面的代码就是远程端的主要代码,在运行代码后会在数据库中添加对应的表结构,开发时很简单,生成的数据库的表结构如下图所示:

结语


因为本文只是提出了一种分布式开发的方法,这种方法需要在项目中接受考验才能评价架构的好坏,另外在开发时还需要做严格的管理,并统一编码规范和验收标准,还有很多需要注意的地方,本文提出的内容不一定全部正确,但是经过了笔者的测试,有什么问题还请留言一块探讨。

版权声明:本文为博主原创文章,未经博主允许不得转载。

WS+MQ+WCF+EF(Code First)的更多相关文章

  1. 优化EF Code First第一次请求速度

    由于EF Code First模式没有模型文件,所以很多一次请求的时候速度比较慢,EF需要将对应的数据库映射关系加载到内存里面,往后请求就比较快.可以通过在程序初始化的时候增加一段代码来优化EF第一次 ...

  2. EF Code First Migrations数据库迁移

    1.EF Code First创建数据库 新建控制台应用程序Portal,通过程序包管理器控制台添加EntityFramework. 在程序包管理器控制台中执行以下语句,安装EntityFramewo ...

  3. EF Code First学习系列

    EF Model First在实际工作中基本用不到,前段时间学了一下,大概的了解一下.现在开始学习Code First这种方式.这也是在实际工作中用到最多的方式. 下面先给出一些目录: 1.什么是Co ...

  4. EF和MVC系列文章导航:EF Code First、DbContext、MVC

    对于之前一直使用webForm服务器控件.手写ado.net操作数据库的同学,突然来了EF和MVC,好多新概念泉涌而出,的确犹如当头一棒不知所措.本系列文章可以帮助新手入门并熟练使用EF和MVC,有了 ...

  5. EF Code First 初体验

    Code First 顾名思义就是先代码,再由代码生成数据库的开发方式. 废话不多说,直接来一发看看:在VS2010里新建一个空白解决方案,再依次添加两个类库项目:Model.DataAccess和一 ...

  6. 【极力分享】[C#/.NET]Entity Framework(EF) Code First 多对多关系的实体增,删,改,查操作全程详细示例【转载自https://segmentfault.com/a/1190000004152660】

      [C#/.NET]Entity Framework(EF) Code First 多对多关系的实体增,删,改,查操作全程详细示例 本文我们来学习一下在Entity Framework中使用Cont ...

  7. EF Code First 主键对应多个外键

    这是一位朋友提出的疑问,EF 映射主键可以对应多个外键吗?如果外键设置级联删除会发生什么情况?下面做一个测试,示例实体代码: public class Blog { public Blog() { P ...

  8. 【记录】EF Code First 实体关联,如何添加、修改实体?

    在使用 EF Code First 的时候,我们经常会对项目中的 Entry 进行一对多.多对多的映射配置,这时候就会产生主实体和子实体的概念,我们在添加.修改他们的时候,有时候会产生一些问题,比如添 ...

  9. EF Code First 一对多、多对多关联,如何加载子集合?

    应用场景 先简单描述一下标题的意思:使用 EF Code First 映射配置 Entity 之间的关系,可能是一对多关系,也可能是多对多关系,那如何加载 Entity 下关联的 ICollectio ...

随机推荐

  1. el表达式无法获取springmvc的model封装好的数据之解决方法

    近日碰到奇怪的问题,应该挺好解决的,可是就是卡住我两天 下面我来描述一下问题 用的是springmvc,自然需要controller,假设我现在所有的配置都是对的. controller代码 @Req ...

  2. (转)LSTM NEURAL NETWORK FOR TIME SERIES PREDICTION

    LSTM NEURAL NETWORK FOR TIME SERIES PREDICTION Wed 21st Dec 2016   Neural Networks these days are th ...

  3. soanar,jenkins

    http://www.sonarqube.org/ https://blogs.msdn.microsoft.com/visualstudioalm/2016/02/18/sonarqube-scan ...

  4. there are no usable controls in this group

    今天遇到一个怪事, MFC的toolbox是灰的, 不能使用, 后来上网一查找到解决方案: 右键Toolbox, 点击"Choose Items", 重新启动VS2013, 这样t ...

  5. 为什么C#中ref和out 关键字 ?

    需求假设:现需要通过一个叫Swap的方法交换a,b两个变量的值.交换前a=1,b=2,断言:交换后a=2,b=1. 现编码如下: class Program   {       static void ...

  6. ReactJS入门指南

    ReactJS入门指南 本文旨在介绍ReactJS的基本知识,并一步步详细介绍React的基本概念和使用方法等,以及相应的Demo.本文在很大程度上参考了React官方文档和官方指南.如果你英语还不错 ...

  7. 真机测试-Please enter a different string错误解决

    错误原因是这个bundle ID已经被占用了,这是想到的是要重置测试证书,那么则需要去修改Bundle identifier,因为测试证书是以Bundle identifier为基准的,修改后运行,重 ...

  8. visual studio 调试时遇到 System.BadImageFormatException

    System.BadImageFormatException”类型的未经处理的异常在 未知模块. 中发生 其他信息: 未能加载文件或程序集“SendYourIP.exe”或它的某一个依赖项.生成此程序 ...

  9. Java使用poi操作cexel

    Java操作excel比较简单,但是时间长了就会忘记,因此基本的简单操作做个记录. 依赖poi的jar包,pom.xml配置如下: <project xmlns="http://mav ...

  10. C++ CTime COleTime的一些操作技巧

    strCString="2003-10-27 6:24:37"; //CString--->COleDateTime COleVariant vtime(strCString ...