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
//Deleting multiple elements. | |
//solution is to make duplicated vector. | |
#include <iostream> | |
#include <vector> | |
int main() { | |
std::vector<int> array; | |
std::vector<int> arr; | |
for (int i = 0; i < array.size(); i++) { |
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
// How to connect elements in every possible cases. | |
#include <iostream> | |
#include <vector> | |
int main() { | |
// n : number of elements in vector | |
int n; std::cin >> n; | |
std::vector<int> vec(n); | |
for (int i = 0; i < n; i++) { |
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
//C++ class example | |
#include <iostream> | |
#include <string> | |
class Box { | |
private: | |
int l; | |
int b; | |
long long int h; |
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 <iostream> | |
#include <string> | |
#include <vector> | |
long long int reg_factorial(int num) { | |
long long int res = 1; | |
for (int i = num; i > 0; i--) res *= i; | |
return res; | |
} | |
std::vector<long long int> spe_factorial(int num) { |
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
// EXAMINE THE DOCUMENT OBJECT // -- by Traversy Media | |
console.dir(document); | |
console.log(document.domain); | |
console.log(document.URL); | |
console.log(document.title); | |
//document.title = 123; | |
console.log(document.doctype); | |
console.log(document.head); | |
console.log(document.body); |
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
SELECT COUNT(DISTINCT(*)) FROM _somewhere_ | |
WHERE _something_ <= 12 AND _something2_ = '_word_' | |
WHERE _something_ BETWEEN 8 AND 9 | |
WHERE _something_ IN (0.99, 1.98, 1.99) | |
WHERE _something_ LIKE/ILIKE '_J%' | |
ORDER BY _something_ ASC, _something2_ DESC | |
LIMIT 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
// This file is used in youtube video "Traversy Media". | |
// visit "Traversy Media" down below | |
// https://www.youtube.com/watch?v=rRgD1yVwIvE&list=PLillGF-RfqbbnEGy3ROiLWk7JMCuSyQtX&index=9 | |
const companies= [ | |
{name: "Company One", category: "Finance", start: 1981, end: 2004}, | |
{name: "Company Two", category: "Retail", start: 1992, end: 2008}, | |
{name: "Company Three", category: "Auto", start: 1999, end: 2007}, | |
{name: "Company Four", category: "Retail", start: 1989, end: 2010}, |
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 val; | |
val = document; | |
// val = document.all; | |
// val = document.all[2]; | |
val = document.head; | |
val = document.body; | |
val = document.doctype; |
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
// Local & Session storage | |
// Only difference = local - data remains // Session - erased when browser closed(session ends) | |
// -------------------------------------------------------------------- | |
// set local storage item | |
localStorage.setItem('name', 'John'); | |
localStorage.setItem('age', '30'); | |
sessionStorage.setItem('name', 'Beth'); |
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
// Define UI variables | |
const form = document.querySelector('#task-form'); | |
const taskList = document.querySelector('.collection'); | |
const clearBtn = document.querySelector('.clear-tasks'); | |
const filter = document.querySelector('#filter'); | |
const taskInput = document.querySelector('#task'); | |
// Load all event listeners | |
loadEventListeners(); |
OlderNewer