自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(66)
  • 收藏
  • 关注

转载 CLR 垃圾回收知识梳理

转载于:https://www.cnblogs.com/c-supreme/p/10230577.html

2019-01-06 21:57:00 160

转载 .ef core 多对对关系的关联方法

最近在用.net core 重构博客,在使用ef core连表查询时,遇到了一些问题。记录一下。关系:一个博客可以有多个标签,一个标签可以属于多个博客,博客和标签之间存在多对多的关系下面是实体代码(为突出重点 省略部分属性)BlogEntitynamespace Blog.Service.Entities{ public class BlogEntity...

2018-11-13 23:09:00 306

转载 HttpGet请求传递数组(集合)

在HttpGet请求是传递数组(集合)的方法:1.使用Ajax方法传递eg:ajax.({ url:/test, data:["1","2"], type:"get" });2.通过url直接传递的方式这种方式我是通过第一种Ajax方法传递时,用Fiddler抓包发现的转码后为:items[]=SaleNumLi...

2018-11-08 13:10:00 3922

转载 使用wkhtmltopdf工具生成pdf

背景:将前台页面转换成pdf文档保存到服务器最开始计划使用canvas2pdf在前端进行生成。但是canva2pdf转换的pdf有严重的失真问题,然后决定使用wkhtmltopdf工具进行生成。思路:服务器准备好模板(html页面),前台将数据传回后台,将数据把模板中的占位符替换掉,然后生成临时html页面,再使用wkhtmltopdf工具将html页面转换成pdf这...

2018-11-02 10:19:00 264

转载 C#使用Process启动exe程序,不弹出控制台窗口的方法

背景:使用wkhtmltopdf工具将html转换成pdf时,这个工具在进行转换时会弹出命令行窗口显示转换过程,但是在项目运行时弹出服务器突然弹出控制台窗口会很奇怪,尤其是当转换多个时。解决这个问题修改之前的代码       ProcessStartInfo startInfo = new ProcessStartInfo(wtHtmlToPdfEXEPath, ...

2018-11-02 10:06:00 4897

转载 【搬运】表变量与临时表的优缺点

表变量: DECLARE @tb table(id int identity(1,1), name varchar(100))INSERT @tb SELECT id, name FROM mytable WHERE name like ‘zhang%’临时表: SELECT name, address...

2018-10-11 18:19:00 105

转载 Ajax异步请求返回文件流(eg:导出文件时,直接将导出数据用文件流的形式返回客户端供客户下载)...

在异步请求中要返回文件流,不能使用JQuery,因为$.ajax,$.post 不支持返回二进制文件流的类型,可以看到下图,dataType只支持xml,json,script,html这几种格式,没有blob类型。所以只能选择使用原生Ajax XMLReques对象进行处理前端代码function output() { var branchCo...

2018-10-10 12:08:00 374

转载 使用EntityFramework调用存储过程并获取存储过程返回的结果集

【实习】刚入职,公司要求完成两个任务,任务要求使用存储过程和事务,其中一个问题要获取存储过程的查询结果集。经过多方查找和自己的实践,终于找到了方法。这里记录一下。看到的这篇文章中给出的例子是查询单个表的所有数据,但是我的要求是多表查询并获取其中的几个字段。而且我是使用POCO(POCO是指Plain Old Class Object,也就是最基本的CLRClass),还是和示例有诸多...

2018-09-25 12:11:00 566

转载 LeetCode Array Easy 485. Max Consecutive Ones

DescriptionGiven a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three ...

2018-09-18 21:53:00 137

转载 LeetCode Array Easy 448. Find All Numbers Disappeared in an Array

DescriptionGiven an array of integers where 1 ≤ a[i] ≤n(n= size of array), some elements appear twice and others appear once.Find all the elements of [1,n] inclusive that do not appear...

2018-09-16 14:02:00 83

转载 使用jquery.validate组件进行前端数据验证并实现异步提交前验证检查

学习如鹏网掌上组的项目开发,使用到了前端验证,视频里使用的ValidateForm验证框架,但是我使用的Hui的框架中使用的是jquery.validate验证框架所以自行学习jquery.validate的使用 但是遇到了一个问题,就是我没有使用submit按钮进行提交,而是在button的点击事件中执行异步提交,这里就有一个问题就是要在提交之前先验证数据正确性再进行提交最终查...

2018-09-13 13:35:00 148

转载 LeetCode Linked List Easy 83. Remove Duplicates from Sorted List

DescriptionGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1-&gt...

2018-09-08 20:56:00 78

转载 LeetCode Linked List Easy 21. Merge Two Sorted Lists

DescriptionMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1-...

2018-09-08 20:45:00 69

转载 解决echarts内存泄露的问题

今天老师让我把一个项目接过来,还有个定时局部刷新的需求没做完。当时想的很简单,直接用ajax再去请求一次,直接把整个页面换掉。但是在执行的时候出现了一些问题。项目中使用了echarts用来显示图表,但是在每次重新请求并把页面替换时, 每次请求之后浏览器占用的内存都会增加。在多次请求之后,浏览器就会因为内存占用过多卡顿,无法响应。后来猜想可能是echarts占用的内存没有及时回...

2018-09-08 17:37:00 2055

转载 配置进程外Session 同时解决一个奇怪的BUG 因为SQLserver 服务器名不是默认的.或者localhost而引发的一系列问题...

用公司的电脑学习如鹏网的视频,开发一个项目,用到了进程外session,因为公司电脑SQLServer 是2008 服务器名称是. 然后参考这篇文章进行设置进程外session 很顺利 完成了设置。近期把项目放到了自己的电脑上。在运行的是出现了一系列的问题。先说一下两台机器的环境公司电脑: VS2017 + SQLServer2008自己电脑:VS2015 + SQLS...

2018-09-06 22:38:00 127

转载 LeetCode Array Easy 414. Third Maximum Number

DescriptionGiven anon-emptyarray of integers, return thethirdmaximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Exampl...

2018-09-06 19:39:00 67

转载 LeetCode Linked List Medium 2. Add Two Numbers

DescriptionYou are given twonon-emptylinked lists representing two non-negative integers. The digits are stored inreverse orderand each of their nodes contain a single digit. Add the...

2018-09-05 11:18:00 86

转载 LeetCode Array Easy 283. Move Zeroes

DescriptionGiven an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.Example:Input: [0,1,0,3,12]Output: [1...

2018-09-04 15:08:00 88

转载 LeetCode Array Easy 268. Missing Number

DescriptionGiven an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.Example 1:Input: [3,0,1]Output: 2Example 2:...

2018-09-04 14:10:00 88

转载 LeetCode Array Easy 219. Contains Duplicate II

---恢复内容开始---DescriptionGiven an array of integers and an integerk, find out whether there are two distinct indicesiandjin the array such thatnums[i] = nums[j]and theabsolutedif...

2018-09-04 11:02:00 72

转载 LeetCode Array Easy 217. Contains Duplicate

DescriptionGiven an array of integers, find if the array contains any duplicates.Your function should return true if any value appears at least twice in the array, and it should return fals...

2018-09-04 10:53:00 80

转载 LeetCode Array Easy 189. Rotate Array

---恢复内容开始---DescriptionGiven an array, rotate the array to the right byksteps, wherekis non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanati...

2018-09-04 10:28:00 83

转载 LeetCode Array Easy169. Majority Element

DescriptionGiven an array of sizen, find the majority element. The majority element is the element that appearsmore than⌊ n/2 ⌋times.You may assume that the array is non-empty and...

2018-08-31 10:56:00 80

转载 LeetCode Array Medium 11. Container With Most Water

DescriptionGivennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of lineiis at ...

2018-08-30 14:57:00 80

转载 LeetCode Array Easy 167. Two Sum II - Input array is sorted

DescriptionGiven an array of integers that is alreadysorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return ind...

2018-08-30 14:27:00 98

转载 LeetCode Array Easy 122. Best Time to Buy and Sell Stock II

DescriptionSay you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete as many transactions as y...

2018-08-29 09:49:00 71

转载 LeetCode Array Easy121. Best Time to Buy and Sell Stock

DescriptionSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (i.e., buy one and sell one ...

2018-08-27 10:28:00 58

转载 LeetCode Array Easy 119. Pascal's Triangle II

DescriptionGiven a non-negativeindexkwherek≤33, return thekthindex row of the Pascal's triangle.Note that the row index starts from0.In Pascal's triangle, each number is the sum ...

2018-08-24 17:20:00 66

转载 LeetCode Array Easy 118. Pascal's Triangle

DescriptionGiven a non-negative integernumRows, generate the firstnumRowsof Pascal's triangle.In Pascal's triangle, each number is the sum of the two numbers directly above it.Exampl...

2018-08-23 16:50:00 95

转载 LeetCode Array Easy 88. Merge Sorted Array

DescriptionGiven two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:The number of elements initialized innums1andnums2aremandnrespectivel...

2018-08-23 15:01:00 86

转载 ASP.NET MVC 学习笔记之 MVC + EF中的EO DTO ViewModel

EO: Entity Object 就是EF中的实体类, 对EO的操作会对数据库产生影响。DTO: Data Transfer Object 数据传输对象。用于在各层之间传递数据的普通类,DTO有哪些属性取决于其他层要什么数据。DTO一般是个“扁平类”,也就是没有关联属性,都是普通类型属性,再说的直白一些,DTO的类内没有其他的类的作为DTO类的成员变量或属性。在一些复杂的项目中...

2018-08-22 17:18:00 142

转载 ASP.NET MVC 学习笔记之面向切面编程与过滤器

AOP(面向切面)是一种架构思想,用于把公共的逻辑放到一个单独的地方,这样就不用每个地方都写重复的代码了。比如程序中发生异常,不用每个地方都try…catch只要在Golbal的Application_Error中统一进行异常处理。不用每个Action中都检查当前用户是否有执行权限。ASP.NETMVC中提供了一个机制,每个Action执行之前我们都会执行我们的代码...

2018-08-22 14:52:00 110

转载 ASP.NET MVC 学习笔记之TempData、HttpContext和HttpContextBase杂谈

TempData本质上是Session但是有一点不同的是,TempData被赋值之后,一旦被Action访问一次之后,马上就会清空。System.Web.HttpContext和System.Web.HttpContextBaseHttpContext和HttpContextBase、HttpRequest与HttpRequestB...

2018-08-22 14:49:00 190

转载 ASP.NET MVC 学习笔记之View 和Redriect的区别

首先先说一下Redriect和RedirectToAction两个没什么区别,都是向浏览器发送302 Found相应,再有浏览器向对应的url进行请求只是参数的意义不同而已再说Redirect和View的区别Redirect是让浏览器重定向到新的地址,而returnView是让服务器把制定的cshtml...

2018-08-22 14:47:00 102

转载 SQLServer存储过程学习记录

简单来说,存储过程就是一条或者多条sql语句的集合,可视为批处理文件,但是其作用不仅限于批处理。一、存储过程的概述SQLServer中的存储过程是使用T_SQL编写的代码段。它的目的在于能够方便的从系统表中查询信息,或者完成与更新数据库表相关的管理任务和其他的系统管理任务.T_SQL语句是SQLServer数据库与应用程序之间的编程接口。在很多情况下,一些代码会被开发者重复编...

2018-08-15 16:39:00 70

转载 LeetCode Array Easy 66. Plus One

DescriptionGiven anon-emptyarray of digitsrepresenting a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the li...

2018-07-25 20:36:00 109

转载 排序算法---希尔排序

  对于大规模的乱序数组进行插入排序,速度会很慢,因为他们只交换相邻的元素。因此元素只能一点点的从数组的一端移动到数组的另一端。  希尔排序就是为了加快速度简单的改进了插入排序,交换不相邻的元素以对数组的局部进行排序,并最终用插入排序将局部有序的数组将局部有序的数组排序希尔排序  希尔排序的思想是使数组中任意间隔为h的元素都是有序的。这样的数组被称为h有序数组。换句话说,一个...

2018-07-25 16:21:00 135

转载 排序算法---插入排序

  前面写了选择排序的原理和实现。现在来写一下插入排序的实现插入排序的原理和实现  通常人们在整理桥牌的方法是一张一张的来,将每张牌插入到其他已经有序的牌中的适当位置。在计算机当中,为了给要插入的元素(新的牌)腾出的空间,我们需要将其余所有的元素在插入之前都向右移动一位。这种算法叫做插入排序。  与选择排序一样,当前索引的左边的所有元素都是有序的。但是它们的最终位置还不是确定...

2018-07-24 23:48:00 70

转载 排序算法---选择排序

最近开始重新学习算法,看了橙书(算法第四版)看到了第二章,关于排序。接下来我会陆续记录我在学习过程中学到的算法和和算法实现进入正题选择排序的思想和实现首先找到数组中的最小的元素然后和数组的第一个元素进行交换(如果第一个就是最小的,那么就和它自己交换),然后找到下一个最小的元素和数组的第二个元素进行交换。继续这种方法,直到整个数组排序完成。时间复杂度:对于有N个元...

2018-07-24 16:45:00 59

转载 图片放大镜 类淘宝--实现一个页面多张图片都可以进行放大

这两天从同学那里接手了一个可视化的项目 只剩下少量问题未解决。其中,甲方要求实现一个图片放大镜的功能,同学一开始已经做了。但是后期甲方提出放大镜放的比例有问题,要修改。现在落在我手里了修改一下吧。按照惯例,先搜索引擎一波。找到一篇文章,链接如下http://www.cnblogs.com/liu-wang/p/6125314.html#anchor1。本文章修改了引用文章中的代码...

2018-07-23 15:34:00 234

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除