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
var name='lanka' |
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
const express=require('express'); | |
const app= express(); | |
app.get('/',(req,res)=>{ | |
res.send('<h1>Welcome to Express</h1>')}); | |
const PORT=process.env.PORT||5000; | |
app.listen(PORT,()=>console.log(`server Started on port ${PORT}`)); |
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
GET /chat HTTP/1.1 | |
Host: example.com:8000 | |
Origin:client.chat.com | |
Upgrade: websocket | |
Connection: Upgrade | |
Sec-WebSocket-Key: DSFEW%$#^%%*DGHBD | |
Sec-WebSocket-Protocol: | |
Sec-WebSocket-Version: 13 | |
Sec-WebSocket-Extensions:deflate-stream |
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
HTTP/1.1 101 Switching Protocols | |
Upgrade: websocket | |
Connection: Upgrade | |
Sec-WebSocket-Accept: DSFEW%$#^%%*DGHBD | |
Sec-WebSocket-Protocol: | |
Sec-WebSocket-Extensions:deflate-stream |
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.Collections; | |
var myArrayList = new ArrayList(); |
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
// Add elements using .Add() Method | |
var myArrayList = new ArrayList(); | |
myArrayList.Add(123); | |
myArrayList.Add("Freelancingcult.com"); | |
myArrayList.Add(5.963); | |
// adding elements using object initializer syntax method | |
var myAraylist2 = new ArrayList() | |
{ | |
"Culure", 452, " ", true, 4.5, null |
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
var myArrList = new ArrayList(); | |
var myArrList2 = new ArrayList(){1, "Bill", " ", true, 4.5, null}; | |
int[] arr = { 150, 200, 300, 400 }; | |
Queue myQ = new Queue(); | |
myQ.Enqueue("Hello"); | |
myQ.Enqueue("World!"); | |
arlist1.AddRange(myArrList2); //adding arraylist in arraylist | |
arlist1.AddRange(arr); //adding array in arraylist | |
arlist1.AddRange(myQ); //adding Queue in arraylist |
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
var myarray = new ArrayList() | |
{ | |
1, | |
"Bill", | |
300, | |
4.5f | |
}; | |
//Access individual item using indexer | |
int firstElement = (int) myarray[0]; //returns 1 |
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
ArrayList arlist = new ArrayList() | |
{ | |
1, | |
"Bill", | |
300, | |
4.5F | |
}; | |
foreach (var item in arlist) | |
Console.Write(item + ", "); //output: 1, Bill, 300, 4.5, |
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
ArrayList arlist = new ArrayList() | |
{ | |
1, | |
"Bill", | |
300, | |
4.5f | |
}; | |
arlist.Insert(2, "Third Item"); |
OlderNewer