Wednesday, 4 June 2014

LINQ - Standard Operators - Filtering Operators

LINQ - Filtering Operators

The two filtering operators in LINQ are the Where and OfType operators. An example follows.

 ArrayList list = new ArrayList { "Sheraz", new object(), "London", new object() };  
             var query = from name in list.OfType<string>()  
                                     where name == "Sheraz"  
                                     select name;  

Above query returns only "Sheraz" and narrows down the search to strings only.

The Where operator generally translates to a WHERE clause when working with a relational database and has an associated keyword in C# as shown in the code above. The OfType operator can be used to coax a non-generic collection (like an ArrayList) into a LINQ query. Since ArrayList  does not implement IEnumerable, the OfType operator is the only LINQ operator we can apply to the list.OfType is also useful if you are working with an inheritance hierarchy and only want to select objects of a specific subtype from a collection. This includes scenarios where LINQ to SQL or the Entity Framework are used to model inheritance in the database. Both operators are deferred.

Thursday, 26 February 2009

American Standard Code Information Interchange (ASCII)

ASCII, Hexadecimal, Characters and their Names

ASCII 

Hex 

Char 

Name 

0 

00 

NUL 

Null 

1 

01 

STX 

Start of Header

2 

02 

SOT 

Start of Text

3 

03 

ETX 

End of Text

4 

04 

EOT 

End of Transmission

5 

05 

ENQ 

Enquiry

6 

06 

ACK 

Acknowledge

7 

07 

BEL 

Bell

8 

08 

BS 

BackSpace

9 

09 

HT 

Horizontal Tabulation

10 

0A 

LF 

Line Feed

11 

0B 

VT 

Vertical Tabulation

12 

0C 

FF 

Form Feed

13 

0D 

CR 

Carriage Return

14 

0E 

SO 

Shift Out

15 

0F 

SI 

Shift In

16 

10 

DLE 

Data Link Escape

17 

11 

DC1 

Device Control 1 (XON)

18 

12 

DC2 

Device Control 2

19 

13 

DC3 

Device Control 3 (XOFF)

20 

14 

DC4 

Device Control 4

21 

15 

NAK 

Negative acknowledge

22 

16 

SYN 

Synchronous Idle

23 

17 

ETB

End of Transmission Block

24 

18 

CAN 

Cancel

25 

19 

EM 

End of Medium

26 

1A 

SUB 

Substitute

27 

1B 

ESC 

Escape

28 

1C 

FS 

File Separator

29 

1D 

GS 

Group Separator

30 

1E 

RS 

Record Separator

31 

1F 

US 

Unit Separator

32 

20 

[Space] 

Space

33 

21 

! 

Exclamation mark

34 

22 

" 

Quotes 

35 

23 

# 

Hash 

36 

24 

$ 

Dollar 

37 

25 

% 

Percent 

38 

26 

& 

Ampersand 

39 

27 

' 

Apostrophe 

40 

28 

( 

Open bracket 

41 

29 

) 

Close bracket 

42 

2A 

* 

Asterisk 

43 

2B 

+ 

Plus 

44 

2C 

, 

Comma 

45 

2D 

- 

Dash 

46 

2E 

. 

Full stop 

47 

2F 

/ 

Slash 

48 

30 

0 

Zero 

49 

31 

1 

One 

50 

32 

2 

Two 

51 

33 

3 

Three 

52 

34 

4 

Four 

53 

35 

5 

Five 

54 

36 

6 

Six 

55 

37 

7 

Seven 

56 

38 

8 

Eight 

57 

39 

9 

Nine 

58 

3A 

: 

Colon 

59 

3B 

; 

Semi-colon 

60 

3C 

< 

Less than 

61 

3D 

= 

Equals 

62 

3E 

> 

Greater than 

63 

3F 

? 

Question mark 

64 

40 

@ 

At

65 

41 

A 

Uppercase A 

66 

42 

B 

Uppercase B 

67 

43 

C 

Uppercase C 

68 

44 

D 

Uppercase D 

69 

45 

E 

Uppercase E 

70 

46 

F 

Uppercase F 

71 

47 

G 

Uppercase G 

72 

48 

H 

Uppercase H 

73 

49 

I 

Uppercase I 

74 

4A 

J 

Uppercase J 

75 

4B 

K 

Uppercase K 

76 

4C 

L 

Uppercase L 

77

4D 

M 

Uppercase M 

78 

4E 

N 

Uppercase N 

79 

4F 

O 

Uppercase O 

80 

50 

P 

Uppercase P 

81 

51 

Q 

Uppercase Q 

82 

52 

R 

Uppercase R 

83 

53 

S 

Uppercase S 

84 

54 

T 

Uppercase T 

85 

55 

U 

Uppercase U 

86 

56 

V 

Uppercase V 

87 

57 

W 

Uppercase W 

88 

58 

X 

Uppercase X 

89 

59

Y 

Uppercase Y 

90 

5A 

Z 

Uppercase Z 

91 

5B 

[ 

Open square bracket 

92 

5C 

\ 

Backslash 

93 

5D 

] 

Close square bracket 

94 

5E 

^ 

Caret / hat 

95 

5F 

_ 

Underscore 

96 

60 

` 

Grave accent 

97 

61 

a 

Lowercase a 

98 

62 

b 

Lowercase b 

99 

63 

c 

Lowercase c 

100 

64 

d 

Lowercase d

101 

65 

e 

Lowercase e 

102 

66 

f 

Lowercase f 

103 

67 

g 

Lowercase g 

104 

68 

h 

Lowercase h 

105 

69 

i 

Lowercase i 

106 

6A 

j 

Lowercase j 

107 

6B 

k 

Lowercase k 

108 

6C 

l 

Lowercase l 

109 

6D 

m 

Lowercase m 

110 

6E 

n 

Lowercase n 

111 

6F 

o 

Lowercase o 

112 

70 

p 

Lowercase p 

113 

71 

q 

Lowercase q 

114 

72 

r 

Lowercase r 

115 

73 

s 

Lowercase s 

116 

74 

t 

Lowercase t 

117 

75 

u 

Lowercase u 

118 

76 

v 

Lowercase v 

119 

77 

w 

Lowercase w 

120 

78 

x 

Lowercase x 

121 

79 

y 

Lowercase y 

122 

7A 

z 

Lowercase z 

123 

7B 

{ 

Open brace 

124 

7C 

| 

Pipe 

125 

7D 

} 

Close brace 

126 

7E 

~ 

Tilde 

127 

7F 

DEL 

Delete