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 axios = require('axios'); | |
async function catFacts() { | |
try { | |
const response = await axios({ | |
method: "get", | |
status: 200, | |
url: "https://cat-fact.herokuapp.com/facts/random?animal_type=cat&amount=3" | |
}); | |
let extracts = response.data; |
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
Step 1: Identifying Entities: | |
Staff | |
Admin | |
Leave | |
Step 2: Identifying Attributes and Define Attributes Data types: | |
Staff: staff_id(int), first_name(string), last_name(string), email(string), organization(string), designation(string), |
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 ora = require('ora'); | |
const getWeather = require('../utils/weather'); | |
const getLocation = require('../utils/location'); | |
module.exports = async (args) => { | |
const spinner = ora().start(); | |
try{ | |
const location = args.location || args.l || await getLocation(); | |
const weather = await getWeather(location); |
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
function HashTable() { | |
this.table = new Array(); | |
this.dupList = []; | |
} | |
HashTable.prototype.hashMethod = function(input){ | |
let strInput = input.toString(); | |
const encoder = 27; | |
let hashCode = 0; |
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
// A hash table data structure helps to quickly find/compute data by using keys that are mapped to array | |
// positions by hash functions. values are stored and referenced by memory locations | |
// A hash table data structure is fast because its time complexity is O(1) | |
// (it only tranverse through an array once for each instance of an operation ) | |
// I'm not sure but i think in JavaScript, addressing an array using string indexing makes | |
// the array a hash table data structure | |
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
select id, host_id, host_name, room_type from levelUp.listings where room_type = 'Private room' order By host_name ASC; |