Access modifiers in C#

Access modifiers in C#:

public, protected, internal, and private.

Public access means accessible by any code.

Protected access enables access for all derived classes.

Internal access enables access from any code in the same assembly.

Private access is limited to code in the same class.

Happy Coding πŸ™‚

Replace multiple space with single space – SQL Server

Replace multiple space with single space – SQL Server

DECLARE @Temp TABLE (OriginalString VARCHAR(8000))

INSERT INTO @Temp (OriginalString)
SELECT ‘ Hello. This is Hello World. ‘

SELECT REPLACE(REPLACE(REPLACE(LTRIM(RTRIM(OriginalString)), ‘ ‘, ‘ ‘ + CHAR(7)), CHAR(7) + ‘ ‘, ”), CHAR(7), ”) AS [result]
FROM @Temp
WHERE CHARINDEX(‘ ‘, OriginalString) > 0

Happy Coding πŸ™‚

The 10 Most Common Mistakes JavaScript Developers Make

Today, JavaScript is at the core of virtually all modern web applications. The past several years in particular have witnessed the proliferation of a wide array of powerful JavaScript-based libraries and frameworks for single page application development, graphics and animation, and even server-side JavaScript platforms.

JavaScript has truly become ubiquitous in the world of web app development and is therefore an increasingly important skill to master.

Mistake #1: Incorrect references to this

Mistake #2: Thinking there is block-level scope

Mistake #3: Creating memory leaks

Mistake #4: Confusion about equality

Mistake #5: Inefficient DOM manipulation

Mistake #6: Incorrect use of function definitions inside for loops

Mistake #7: Failure to properly leverage prototypal inheritance

Mistake #8: Creating incorrect references to instance methods

Mistake #9: Providing a string as the first argument to setTimeout or setInterval

Mistake #10: Failure to use β€œstrict mode”

Read more…

Happy Scripting πŸ™‚