- 博客(22)
- 收藏
- 关注
原创 Docker- delete all images and containers from windows
use powershell:delete all images:docker rmi $(docker images -q)delete all containers:docker rm$(docker ps -a -q)
2019-05-05 14:24:51
449
转载 C# XmlMode convert to XElement and XElement convert to XmlNode
XmlMode convert to XElementprivate XElement GetXElement(XmlNode xmlNode) { XDocument xDoc = new XDocument(); using (XmlWriter xmlWrite = xDoc.CreateWriter()) ...
2019-04-10 10:01:44
386
原创 C# 不可变队列
using System.Threading.Tasks;using System.Net.Http;using System;using System.Linq;using System.Collections.Generic;using System.Threading.Tasks.Dataflow;using System.Collections.Immutable;name...
2019-04-02 17:12:19
220
原创 C# 不可变栈
需要引入Nuget包: Microsoft.Bcl.immutableusing System.Threading.Tasks;using System.Net.Http;using System;using System.Linq;using System.Collections.Generic;using System.Threading.Tasks.Dataflow;usin...
2019-04-02 17:07:48
219
原创 C# 数据流基础 - 创建自定义的数据流块
using System.Threading.Tasks;using System.Net.Http;using System;using System.Linq;using System.Collections.Generic;using System.Threading.Tasks.Dataflow;namespace task{ class Program...
2019-04-02 14:24:30
731
原创 C# 数据流基础 - 小例子
需要安装一个Nuget包: Microsoft.Tpl.Dataflowusing System.Threading.Tasks;using System.Net.Http;using System;using System.Linq;using System.Collections.Generic;using System.Threading.Tasks.Dataflow;...
2019-04-02 14:03:36
201
原创 C# 并行编程-小例子
using System.Threading.Tasks;using System.Net.Http;using System;using System.Linq;using System.Collections.Generic;namespace task{ class Program { static void Main...
2019-04-02 12:16:17
212
原创 C# 并发编程-任务完成时的处理
using System;using System.Threading.Tasks;using System.Windows.Forms;using System.Net.Http;using System.Collections.Generic;using System.Linq;namespace async_WhenAny{ public partial class ...
2019-04-02 11:39:29
215
原创 C# 并发编程 WhenAll()
using System;using System.Threading.Tasks;using System.Windows.Forms;using System.Net.Http;using System.Collections.Generic;using System.Linq;namespace async_WhenAny{ public partial class ...
2019-04-02 11:10:21
1061
原创 C#并发编程 whenAny()
using System;using System.Threading.Tasks;using System.Windows.Forms;using System.Net.Http;namespace async_WhenAny{ public partial class Form1 : Form { public Form1() {...
2019-04-02 10:46:45
761
原创 C# Socket 编程
Server端using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using...
2019-04-01 18:16:13
116
原创 C# 多线程编程 - 简介
线程是一个独立的运行单元,每个进程内部有多个线程,每个线程可以各自同时执行指令。每个线程有自己独立的栈,但是与进程内的其他线程共享内存。对某些程序来说,其中有一个线程是特殊的,例如用户界面程序有一个UI 线程,控制台程序有一个main 线程。每个.NET 程序都有一个线程池,线程池维护着一定数量的工作线程,这些线程等待着执行分配下来的任务。线程池可以随时监测线程的数量。配置线程池的参...
2019-04-01 17:35:51
158
原创 C# 响应式编程-简介
响应式编程基于“可观察的流”(observable stream)这一概念。你一旦申请了可观察流,就可以收到任意数量的数据项(OnNext),并且流在结束时会发出一个错误(OnError)或一个“流结束”的通知(OnCompleted)。有些可观察流是不会结束的。实际的接口就像这样:interface IObserver<in T>{void OnNext(T item);v...
2019-04-01 17:32:27
1252
原创 C# 并行编程 - 简介
如果程序中有大量的计算任务,并且这些任务能分割成几个互相独立的任务块,那就应该使用并行编程。并行编程可临时提高CPU 利用率,以提高吞吐量,若客户端系统中的CPU 经常处于空闲状态,这个方法就非常有用,但通常并不适合服务器系统。大多数服务器本身具有并行处理能力,例如ASP.NET 可并行地处理多个请求。某些情况下,在服务器系统中编写并行代码仍然有用(如果你知道并发用户数量会一直是少数)。但通常情...
2019-04-01 17:19:57
314
原创 C# 并发编程 - 基本概念
并发: 通俗理解就是可以同时做很多事。终端用户程序利用并发功能, 在输入数据库的同时响应用户输入。服务器应用利用并 发,在处理第一个请求的同时响应第二个请求。多线程: 并发的一种形式, 它采用多个线程来执行程序, 达到并发的效果。并行处理: 把正在执行的大量的任务分割成小块, 分配给多个同时运行的线程。 对应于现在的多核CPU, 在执行大量任务时,...
2019-04-01 16:51:02
373
原创 小明C#值类型与引用类型
值类型: bool, byte, char, decimal, double, enum, float, int, long, sbyte, short, struct, uint, ulong, ushort,引用类型: class, delegate, dynamic, interface, object, string, Array
2019-03-25 15:51:14
93
原创 小明C#之冒泡排序
冒泡排序(Bubble Sort):冒泡排序算法的原理如下: 比较相邻的元素。如果第一个比第二个大,就交换他们两个。 对每一对相邻元素做同样的工作,从开始第一对到结尾的最后一对。在这一点,最后的元素应该会是最大的数。 针对所有的元素重复以上的步骤,除了最后一个。 持续每次对越来越少的元素重复上面的步骤,直到没有任何一对数字需要比较。 以下是代码实现(升序...
2019-03-25 11:17:34
256
原创 C# Writing data to Excel
using System;using System.IO;using System.Xml;using System.Xml.Linq;using System.Collections.Generic;using System.Linq;using System.Text;using Newtonsoft.Json.Linq;using Microsoft.Office.Inter...
2019-02-23 20:29:07
290
原创 C# Add element to XElement
XElement xTotalTax = new XElement("totalTax"); XElement xInvoiceDiscountPercent = new XElement("invoiceDiscountPercent"); decimal dAmtIncVat = decimal.Parse(va...
2018-11-30 14:10:38
455
原创 C# lambda foreach
List<XmlNode> xmlItemListDictionary<string, int> itemQtyDic = new Dictionary<string, int>();xmlItemList.ForEach(x => { if (!string.IsNullOrEmpty(x[...
2018-11-22 15:56:11
5293
原创 C# use lambda to Group Array and select duplicated record
var serialArr = (from s in serialLotList where s["serialNo"] != null select s["serialNo"].InnerText).ToArray();var dupSeri = serialArr.GroupBy(x => x).Where(g => g.Count() > 1).FirstOrDefaul...
2018-11-22 15:50:08
136
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人