Better Install .NET Core Hosting Bundle
MyBlog
2022년 6월 5일 일요일
2019년 3월 13일 수요일
Difference between Dictionary and Hashtable
Dictionary
- Dictionary is generic type Dictionary<TKey,TValue>
- Dictionary class is a strong type < TKey,TValue > Hence, you must specify the data types for key and value.
- There is no need of boxing/unboxing.
- When you try to access non existing key dictionary, it gives runtime error.
- Dictionary maintains an order of the stored values.
- There is no need of boxing/unboxing, so it is faster than Hashtable.
Hashtable
- Hashtable is non-generic type.
- Hashtable is a weakly typed data structure, so you can add keys and values of any object type.
- Values need to have boxing/unboxing.
- When you try to access non existing key Hashtable, it gives null values.
- Hashtable never maintains an order of the stored values.
- Hashtable needs boxing/unboxing, so it is slower than Dictionary.
2018년 10월 9일 화요일
2018년 9월 27일 목요일
Difference with f10 and f11 in Visual Studio Debug
F10 ("step over") does not descend any further into the call stack. It moves to the next line of the current function.
F11 ("step into") drills down into the function being called.
void function1()
{
function2();
function3();
}
If you hit a breakpoint on
function2()
, F10 will advance to the line function3()
. F11 will advance to the first line inside function2
.2018년 7월 5일 목요일
트랜잭션 로그/NGRAM 함수
트랜잭션로그 정리
SELECT [name],
[recovery_model_desc] FROM sys.databases WHERE [name] = DB_NAME()
ALTER DATABASE SyncAddress SET RECOVERY SIMPLE
(SELECT 논리적파일이름 = [Name] FROM sys.database_files WHERE type = 1)
DBCC SHRINKFILE('SyncAddress_log', 500000)
ALTER DATABASE SyncAddress SET RECOVERY FULL
NGRAM
USE [SyncAddress]
GO
/****** Object: UserDefinedFunction [dbo].[FN_PARSE] Script Date: 2018-07-06 오후 2:05:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
ALTER FUNCTION [dbo].[FN_PARSE]
(
-- Add the parameters for the function here
@STR NVARCHAR(4000)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
-- Declare the return variable here
DECLARE @RETVAL NVARCHAR(MAX) = ''
DECLARE @MODSTR NVARCHAR(4000) = REPLACE(@STR, ' ', '')
-- Add the T-SQL statements to compute the return value here
DECLARE @GRAM INT = 1
DECLARE @POS INT = 1
WHILE(@GRAM <= LEN(@MODSTR))
BEGIN
IF @GRAM > 5 BREAK
WHILE(@POS + @GRAM <= LEN(@MODSTR))
BEGIN
SET @RETVAL += SUBSTRING(@MODSTR, @POS, @GRAM) + ' '
SET @POS = @POS + 1
END
SET @POS = 1
SET @GRAM = @GRAM + 1
END
-- Return the result of the function
RETURN @RETVAL
END
2018년 3월 26일 월요일
SET NOCOUNT ON
SET NOCOUNT ON 이 빠져있거나 SET NOCOUNT OFF로 설정이 되어 있으면
프로시저는 항상 자신의 마지막 로직에 의해서 SELECT, UPDATE, INSERT, DELETE된 행의
갯수를 리턴하게 된다. 그 수를 받아서 'nn개의 행이 적용되었습니다.'라는 메세지를
뿌려주게 된다.
제아무리 RecordSet을 반환한다 할 지라도 실제로는 RecordSet이 넘어오지 않는 것이다.
2017년 12월 27일 수요일
11.1 How to use special characters in XML?
Because XML syntax uses some characters for tags and attributes it is not possible to directly use those characters inside XML tags or attribute values. To include special characters inside XML files you must use the numeric character reference instead of that character. The numeric character reference must be UTF-8 because the supported encoding for XML files is defined in the prolog as encoding="UTF-8" and should not be changed. The numeric character reference uses the format: &#nn; decimal form &#xhh; hexadecimal form
|
이 글은 Evernote에서 작성되었습니다. Evernote는 하나의 업무 공간입니다. Evernote를 다운로드하세요. |
피드 구독하기:
글 (Atom)