This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//======better using IOC framework =========================== | |
//=======================================AssemblyInfo.cs================ | |
[assembly: PreApplicationStartMethod(typeof(MvcAppNB2.Booter.PreApplicationStartCode), "Start")] | |
//========================================booter.cs===================== | |
public class PreApplicationStartCode | |
{ | |
public static void Start() | |
{ | |
// Register our module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- just a demo | |
-- understand child and parent relationship in one table | |
-- Robert Sheldon http://www.simple-talk.com/sql/t-sql-programming/sql-server-cte-basics/ | |
USE test | |
GO | |
IF OBJECT_ID('Employees', 'U') IS NOT NULL | |
DROP TABLE dbo.Employees | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH xxxx(a,b,c) AS ( | |
SELECT 0,'a',GETDATE() | |
UNION ALL | |
SELECT 1,'b',GETDATE() | |
UNION ALL | |
SELECT 2,'c',GETDATE() | |
) | |
SELECT * FROM xxxx | |
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--don't touch %windir%/WinSxS just one code you can do "dism /online /cleanup-image /spsuperseded" | |
-- cut out some stuff from drive c: to other driver then use mklink repair link | |
-- can vssadmin delete shadows /for=c: /all | |
-- cclear can do much | |
-- total reduce 5G space haha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF OBJECT_ID('Number') IS NULL | |
BEGIN | |
CREATE TABLE Number ( | |
N INT CONSTRAINT Number_PK PRIMARY KEY CLUSTERED(N) | |
); | |
WITH | |
L0 AS(SELECT 1 AS C UNION ALL SELECT 1 AS O), -- 2 rows | |
L1 AS(SELECT 1 AS C FROM L0 AS A CROSS JOIN L0 AS B), -- 4 rows | |
L2 AS(SELECT 1 AS C FROM L1 AS A CROSS JOIN L1 AS B), -- 16 rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
play demo | |
http://www.microsoft.com/downloads/details.aspx?FamilyId=06616212-0356-46A0-8DA2-EEBC53A68034&displaylang=en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*/ | |
int Main () { | |
printf("=================",a,b,c,d); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
using Xunit; | |
using Xunit.Sdk; | |
namespace demo.staticevent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<configSections> | |
<section name="log4net" | |
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<log4net> | |
<appender name="LogFileAppender" type="log4net.Appender.FileAppender"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using System.Text; | |
using System.Threading; | |
using Xunit; | |
//detail see | |
//http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ea8b0fd5-a660-46f9-9dcb-d525cc22dcbd/ | |
//Check out ProcessStartInfo.CreateNoWindow | |
//http://www.codeproject.com/Articles/170017/Solving-Problems-of-Monitoring-Standard-Output-and | |
// |