This file contains hidden or 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
#include <iostream> | |
using namespace std; | |
class DateClass { | |
public: | |
int m_year; | |
int m_month; | |
int m_day; | |
This file contains hidden or 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
#include <iostream> | |
using namespace std; | |
struct DateStruct { | |
int year; | |
int month; | |
int day; | |
}; |
This file contains hidden or 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
class myFirst_class { | |
private: | |
// data members and member function declarations | |
public: | |
// data members and member function declarations | |
protected: | |
// data members and member function declarations | |
} |
This file contains hidden or 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
class car { | |
char name[10]; | |
ind id; | |
public: | |
void getDetails(){} | |
}; | |
int main(){ | |
car ferrari; // ferrari is an object |
This file contains hidden or 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(stats.isFile()) { | |
var mimeType = mimeTypes[path.extname(fileName).split(".").reverse()[0]]; | |
res.writeHead(200, {'Content-type': mimeType}); | |
var fileStream = fs.createReadStream(fileName); | |
fileStream.pipe(res); | |
} else if (stats.isDirectory()) { | |
res.writeHead(302, { | |
'Location': 'index.html' | |
}); |
This file contains hidden or 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 http = require('http'); | |
const url = require('url'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const mimeTypes = { | |
"html": "text/html", | |
"jpeg": "image/jpeg", | |
"jpg": "image/jpg", | |
"png": "image/png", |
This file contains hidden or 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 http = require('http'); | |
const url = require('url'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const mimeTypes = { | |
"html": "text/html", | |
"jpeg": "image/jpeg", | |
"jpg": "image/jpg", | |
"png": "image/png", |
This file contains hidden or 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 http = require('http'); | |
var hostname = '127.0.0.1'; | |
var port = 8080; | |
var server = http.createServer(function(req, res) { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello World\n'); | |
}); |