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
// Online C++ compiler to run C++ program online | |
#include <iostream> | |
char getGradeAlt(int mark) { | |
// mark < 100 && mark > 75 | |
if (mark >= 75) { | |
return 'A'; | |
} else if (mark >= 65) { | |
return 'B'; | |
} |
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
// Online C++ compiler to run C++ program online | |
#include <iostream> | |
float pi = 3.141; | |
// This should take circleRadius as a parameter and rutrn the area | |
float caculateArea(float r) { | |
// Area = Pi x Square(R) | |
float area = pi * r * r; | |
return area; | |
} |
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 fs = require('fs'); | |
const AWS = require('aws-sdk'); | |
// Enter copied or downloaded access id and secret here | |
const ID = ''; | |
const SECRET = ''; | |
// Enter the name of the bucket that you have created here | |
const BUCKET_NAME = 'test-bucket-1242tsr';; |
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
class Person { | |
private _age: number; | |
public set age(age) { | |
if (age < 0 || age > 200) { | |
throw new Error('Invalid arguement age'); | |
} | |
this._age = age; | |
} |
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
class Person { | |
private int age; | |
public int getAge() { | |
return this.age; | |
} | |
public void setAge(int age) { | |
if (age < 0 || age > 200) { | |
throw new IllegalArgumentException("Invalid age"); |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
const int MAXLENGTH = 100; // Max length of the string | |
int numOfStudents = 2; | |
int numberOfSubjects = 2; | |
// Calculate the sum, average of each subject |
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 dependencies | |
const express = require('express'); | |
const path = require('path'); | |
const http = require('http'); | |
const app = express(); | |
// Point static path to dist | |
app.use(express.static(path.join(__dirname, 'wg-angular'))); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> |
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
let route = () => { | |
let path = window.location.pathname.split('/'); | |
render(path); | |
} | |
let render = (path) => { | |
let rootPath = path[1]; | |
let template = templates[rootPath]; | |
document.getElementsByTagName('app-root')[0].innerHTML = template; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<app-root></app-root> |
NewerOlder