自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(52)
  • 收藏
  • 关注

转载 转发 Learning Go — from zero to hero

原文:https://medium.freecodecamp.org/learning-go-from-zero-to-hero-d2a3223b3d86Learning Go — from zero toheroLet’s start with a small introduction to Go (or Golang). Go was designed by Google ...

2019-01-15 12:12:00 375

转载 Dapper 封装oracle底层访问数据库

如下代码,修改成只支持oracle:using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Reflection;using System.Text;using System.Collections.Concurrent;...

2017-12-09 17:32:00 515

转载 实现webservice过滤器,请求日志和权限等

过滤webservice的请求日志,做权限验证功能等。1.namespace WebApplication1{ public class SimpleWSInvokeMonitorExtension : SoapExtension { Stopwatch stopWatch = null; string sta...

2017-05-15 14:43:00 1568

转载 【转】 微软在.NET官网上线.NET 架构指南

原文地址:http://www.cnblogs.com/shanyou/p/6676357.html。微软在Visual Studio 2017 正式发布的时候也上线了一个参考应用https://github.com/dotnet/eShopOnContainers, 最近微软给这个参考应用写了完善的文档,放在.NET官网的.NET架构频道https://www.microsoft...

2017-04-07 09:11:00 106

转载 【转载】高并发的核心技术-幂等的实现方案

原文地址:http://blog.csdn.net/rdhj5566/article/details/50646599一、背景我们实际系统中有很多操作,是不管做多少次,都应该产生一样的效果或返回一样的结果。例如:1. 前端重复提交选中的数据,应该后台只产生对应这个数据的一个反应结果。2. 我们发起一笔付款请求,应该只扣用户账户一次钱,当遇到网络重发或系统bug重发,也应该只扣...

2017-04-06 10:29:00 52

转载 RabbitMQRPC 官方demo

public class RPCServer { public static void Test() { var factory = new ConnectionFactory() { HostName = "localhost" }; using(var conn = factory....

2016-04-08 10:39:00 85

转载 RabbitMQ 官方demo1

public class RabbitMqSend { public static void Test() { var factory = new ConnectionFactory() { HostName = "localhost" }; using(var conn = facto...

2016-04-06 15:11:00 62

转载 转 Singleton clr via c#3

/// <summary> /// 注意 只有在构造器没有副作用的时候才能使用这个技术 /// </summary> class Singleton { private static Singleton _value = null; private Singleton() { ...

2016-01-14 09:57:00 47

转载 转 c#性能优化秘密

原文:http://www.dotnetperls.com/optimizationGenerally, using the simplest features of the language provides the best performance. For example, using the for-loop and avoiding parameters and retur...

2016-01-13 10:37:00 166

转载 转 the best for wcf client

原文:http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue/573917#573917方便使用的一种方式:public static class MyServiceClientHelp { ...

2016-01-12 10:44:00 62

转载 转 MYSQL InnoDB Record, Gap, and Next-Key Locks

http://dev.mysql.com/doc/refman/5.0/en/innodb-record-level-locks.htmlInnoDB has several types of record-level locks including record locks, gap locks, and next-key locks. For information abo...

2015-12-16 22:48:00 130

转载 转 MYSQL SELECT ... FOR UPDATE and SELECT ... LOCK IN SHARE MODE Locking Reads

原文: http://dev.mysql.com/doc/refman/5.0/en/innodb-locking-reads.htmlIn some circumstances, a consistent (nonlocking) read is not convenient and a locking read is required instead. InnoDB suppor...

2015-12-16 22:09:00 136

转载 转 InnoDB索引

原文: http://blog.codinglabs.org/articles/theory-of-mysql-index.htmlInnoDB索引实现虽然InnoDB也使用B+Tree作为索引结构,但具体实现方式却与MyISAM截然不同。第一个重大区别是InnoDB的数据文件本身就是索引文件。从上文知道,MyISAM索引文件和数据文件是分离的,索引文件仅保存数据记录的地址。...

2015-11-16 15:01:00 62

转载 转 mysql Next-Key Locking

原文:http://dev.mysql.com/doc/refman/5.5/en/innodb-next-key-locking.html14.5.2.5Avoiding the Phantom Problem Using Next-Key LockingThe so-called phantom problem occurs within a transaction w...

2015-09-30 17:12:00 87

转载 转 InnoDB Error Handling

14.20.4InnoDB Error HandlingError handling in InnoDB is not always the same as specified in the SQL standard. According to the standard, any error during an SQL statement should cause rollba...

2015-09-14 22:14:00 60

转载 转摘: MySQL详解--锁

原文 http://blog.csdn.net/xifeijian/article/details/20313977InnoDB锁问题InnoDB与MyISAM的最大不同有两点:一是支持事务(TRANSACTION);二是采用了行级锁。行级锁与表级锁本来就有许多不同之处,另外,事务的引入也带来了一些新问题。下面我们先介绍一点背景知识,然后详细讨论InnoDB的锁问题。背景知识...

2015-09-11 09:05:00 77

转载 转 Using Async for File Access

原文:https://msdn.microsoft.com/en-us/library/jj155757.aspxusing System;using System.Collections.Generic;using System.Diagnostics;using System.IO;using System.Text;using System.Thread...

2015-09-04 00:32:00 70

转载 Json.NET Performance Tips

原文: http://www.newtonsoft.com/json/help/html/Performance.htmTo keep an application consistently fast, it is important to minimize the amount of time the .NET framework spends performing garbage...

2015-07-28 09:13:00 65

转载 asp.net MVC jsonp跨域获取数据

public class JsonpResult : JsonResult { object _data = null; public JsonpResult() { } public JsonpResult(object data) { this._data ...

2015-06-25 11:21:00 122

转载 EF Working with Transactions

原文:https://msdn.microsoft.com/en-us/data/dn456843.aspxPrior to EF6 Entity Framework insisted on opening the database connection itself (it threw an exception if it was passed a connection that ...

2015-06-25 09:03:00 73

转载 转老赵--不同泛型参数生成的具体类(无论是值类型还是引用类型),它们的静态字段是独立的...

老赵写的文章,原文:http://blog.zhaojie.me/2009/09/i-made-a-mistake-can-you-figure-it-out-answer.htmlpublic static class MyClass<T>{ public static readonly Guid Key = Guid.NewGuid();}...

2015-06-19 14:17:00 85

转载 RSA 加密

public static string RsaEncrypt(string publickey, string content) { RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); byte[] cipherbytes;...

2015-06-02 14:37:00 96

转载 转 ef中使用mysql步骤--Entity Framework 6 with MySql

原文:http://lvasquez.github.io/2014/11/18/EntityFramework-MySql/For the Entity Framework 6 support we need to have this requirementsMySQL Connector/Net 6.8.xMySQL Server 5.1 or aboveEntit...

2015-05-23 14:14:00 79

转载 转 What is Redis and what do I use it for?

原文: http://stackoverflow.com/questions/7888880/what-is-redis-and-what-do-i-use-it-forRedis = Remote Dictionary ServiceTL;DR: If you can map a use case to Redis and discover you aren't at ri...

2015-04-13 17:57:00 155

转载 线程同步笔记

在设计应用程序时,应该尽可能地避免进行线程同步。为此,要避免使用一些共享数据,比如静态字段。线程用new操作符构造一个对象时,new操作符会返回对新对象的一个引用。在这个时刻,只有构造对象的线程才有对它的引用;其他任何线程都不能访问那个对象。如果你能一直避免将这个引用传给可能同时使用对象的另外一个线程,就不必同步对该对象的访问。试着使用值类型,因为它们总是会被复制,所以每个线程操作的都是...

2015-04-13 16:17:00 76

转载 Concurrency in C# Cookbook 笔记

Pausing for a Period of TimeProblem:You need to (asynchronously) wait for a period of time. This can be useful when unittesting or implementing retry delays. This solution can also be useful for ...

2015-03-15 19:38:00 99

转载 mvc中使用Pagination,对其进行再封装

对其进行再次封装:(function($) { $["fn"]["easyPaging"] = function(o) { if (!o.pageSelect ||!$["fn"]["pagination"]) { return this; } ...

2015-02-23 21:20:00 98

转载 转 asp.net mvc 身份验证中返回绝对路径的ReturnUrl

原文:http://www.cnblogs.com/hyl8218/archive/2011/11/22/2259116.html从HttpUnauthorizedResult的源码可以看出,HttpUnauthorizedResult的执行很简单,就是设置当前的 HttpContext.Response的状态码为401,这样就回激活authentication module执行它...

2015-02-20 20:43:00 104

转载 转 js Infinite Scrolling Demo

原文:http://www.sitepoint.com/jquery-infinite-scrolling-demos/Infinite Scrolling Demo 5Usage – HTML<ul class="items"> <li>content</li> <li>content</li>...

2015-02-16 20:55:00 163

转载 转 Multiple outputs from T4 made easy t4生成多文件

原文:http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisitedUsageInitializationYou’ll need to get the code into your template – either copy the code in or reference it...

2015-02-16 18:26:00 87

转载 uploadify Cookie 验证登入上传问题

上传文件时必须验证是否已登入。当用FormsAuthentication做登入,使用FormsAuthentication.FormsCookieName进行验证是否已登入即可。<script type="text/javascript">var auth = "@(Request.Cookies[FormsAuthentication.FormsCookie...

2015-02-15 11:04:00 194

转载 asp.net mvc ViewData 和 ViewBag区别,TempData

ViewData 和 ViewBag都是页面级别的生命周期,TempData--Passing data between the current and next HTTP requestsTempData默认是实现方式--存在session中,所以结论很简单,能不用就不用。。要么负载时就麻烦了。Passing data between the current and next ...

2015-01-24 20:27:00 112

转载 mvc中AntiForgeryToken的实现方式--看Mvc源码

通过 AntiForgeryWorker的GetHtml()方法生成html --input hide元素--value=要验证的值,并生成cookie--用于保存需要验证的值。类中的AntiForgeryDataSerializer--用作序列化与反序列化验证的值。internal class AntiForgeryWorker { public Anti...

2015-01-24 19:17:00 147

转载 转 Configuring Relationships with the Fluent API

http://msdn.microsoft.com/zh-cn/data/jj591620Configuring a Required-to-Optional Relationship (One-to–Zero-or-One)The following example configures a one-to-zero-or-one relationship. The Office...

2015-01-09 14:43:00 80

转载 导出使用NPOI

调用: DataTable table = new DataTable(); #region 创建 datatable table.Columns.Add(new DataColumn("账号", typeof(string))); table.Columns.Add(new DataColumn("姓...

2014-08-13 17:31:00 48

转载 js 创建Table,每行3列的方式

table:<table style="width:100%" id="appDatas"></table>1.var tables = [];var len = data.length;var rowNum = 3;var sumRows = len % rowNum;var sumRowMod = len / ro...

2014-04-14 15:25:00 828

转载 多线程 笔记

public class ThreadTest { /* * 1.由于工作窃取(work-stealing)队列而发起了大量任务, * 那么Task提供了比ThreadPool.QueueUserWorkItem或者 * 一个委托的BeginInvoke更好的性能。 * 2.可...

2014-04-10 11:10:00 50

转载 WCF binding

How to choose the right WCF bindingConsider the following scenarios:• If you need to support clients over the Internet, consider using wsHttpBinding.• If you need to expose your WCF service ...

2014-04-10 11:06:00 86

转载 table 变量

table 变量的行为类似于局部变量,有明确定义的作用域。该作用域为声明该变量的函数、存储过程或批处理。在存储过程中使用 table 变量与使用临时表相比,减少了存储过程的重新编译量涉及表变量的事务只在表变量更新期间存在。这样就减少了表变量对锁定和记录资源的需求。另外,由于表变量作用域有限,并且不是持久数据库的一部分,因而不受事务回滚的影响。考虑使用表变量而不使用临时表。当需要在...

2014-04-10 11:04:00 321

转载 oracle 笔记

创建用户Create user 用户名 identified by 密码;(如果是数字则要加双引号”111111”,如果是字母就不用)授权给某个用户Grant connect,resource to 用户名;(只有用户有了connect 和 resource后才能操作其他表)授DBA 权限Grant dba to 用户名;本用户读取其他用户对象的权限:  select * from us...

2014-04-10 11:03:00 138

空空如也

空空如也

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

TA关注的人

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