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 copyToClipboard = (text) =>{ | |
if (window.clipboardData && window.clipboardData.setData) { | |
// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. | |
return window.clipboardData.setData("Text", text); | |
} | |
else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; | |
textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in Microsoft Edge. |
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
--Drop every cancer table --Uncomment the below if you are sure the db tables exist | |
--DROP TABLE Instructor; | |
--DROP TABLE Subject_Area; | |
--DROP TABLE Courses; | |
--Create Instructor Table: | |
CREATE TABLE Instructor | |
( id number NOT NULL, | |
name varchar2(150) NOT 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
//-----------------------Closures ------------------------------// | |
function retirement(retirementAge) { | |
let a = " years until retirement"; | |
return function(yearsOfBirth) { | |
let age = 2019 - yearsOfBirth; | |
console.log(retirementAge - age + a); | |
}; | |
} |
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
//-----------------------Bind , Call , Apply ------------------------------// | |
//Example 1 | |
const john = { | |
name: "John", | |
age: 26, | |
job: "Teacher", | |
presentation: function(style, timeOfDay) { | |
if (style === "formal") { | |
console.log( |
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
enum Eol | |
{ | |
WINDOWS, | |
MAC, | |
LINUX | |
} | |
Reader r = new FileReader("file absolute path"); | |
int i = -1; | |
Eol eol = 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
``` PYTHON | |
#----------------Convert Binary to Decimal and check for validity---------------------- | |
def isBinary(s): | |
try: | |
return set(s) <= set('01') | |
except ValueError: | |
return False | |