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
Fetcher interface: | |
fetchAnimals(prefix: string, callback: function): void | |
fetchArticles(prefix: string, callback: function): void | |
fetchFruits(prefix: string, callback: function): void | |
Note: there are many more fetchers | |
Callback interface: | |
callback(results: string[]): void | |
*/ | |
fetchAnimals('g', (results) => console.log(results)); |
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
/* | |
* HW 2 - Recursion | |
*/ | |
'use strict'; | |
/* | |
* Problem: Powerset | |
* | |
* Prompt: Given a set S, return the powerset P(S), which is |
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
Item | Price (AF) | Price ($) | units | total | |
---|---|---|---|---|---|
Flour | 2.140 | 30.01 | 2 | 60.02 | |
Macaroni | 450 | 6.31 | 1 | 6.31 | |
Oil | 390 | 5.47 | 2 | 10.94 | |
Rice | 2.250 | 31.56 | 1 | 31.56 | |
Cash to buy Eidy clothes | 4.000 | 56.10 | 1 | 56.10 | |
Total | 164.93 |
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
USERS | SAML JIT | SCIM | |
---|---|---|---|
Create | YES | YES | |
Update | YES | YES | |
Read | NO | YES | |
Deactivate | NO | YES | |
Password Sync | NO | YES |
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
//array of two objects [{name, time}, {name, time}, {name, time}] | |
//# pageViews=> how many times a page is viewed | |
//# of users => have many different users have used the web | |
//# sessions => how many have viewed the page with half an hour time break in between | |
function main(){ | |
//example array | |
var pageView = [{'name':'Sara', 'time': 1}, {'name': 'John', 'time':2},{'name':'Sara', 'time': 1}, {'name': 'Hadis', 'time':2},{'name':'Sara', 'time': 1}, {'name': 'Hadis', 'time':33}] | |
// var pageView = [{name: 'sara', 'time': 1}] |
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
//array of two objects [{name, time}, {name, time}, {name, time}] | |
//# pageViews=> how many times a page is viewed | |
//# of users => have many different users have used the web | |
//# sessions => how many have viewed the page with half an hour time break in between | |
function main(){ | |
//example array | |
//var pageView = [{'name':'Sara', 'time': 1}, {'name': 'John', 'time':2},{'name':'Sara', 'time': 1}, {'name': 'Hadis', 'time':2},{'name':'Sara', 'time': 1}, {'name': 'Hadis', 'time':33}] | |
var pageView = [{name: 'sara', 'time': 1}] |
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
/* | |
Install mysql -> https://dev.mysql.com/doc/mysql-osx-excerpt/5.5/en/osx-installation-pkg.html | |
run the server | |
log in with 'root' user | |
log in with mysql -u root -p; | |
create a super user like (https://dev.mysql.com/doc/refman/5.5/en/adding-users.html) | |
in another termilal log in with the user info. 'sara' | |
mysql -u sara -p; | |
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
var messageBus = { | |
subscrib: function(str, callback) { | |
// make a key in the parent object | |
if (!this[str]) { | |
this[str] = []; | |
this[str].push(callback) | |
} else { | |
this[str].push(callback) | |
} |
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
/** | |
* @param {number[]} nums | |
* @return {number[]} | |
*/ | |
var productExceptSelf = function(nums) { | |
//i: array | |
let output = [] | |
//need to handle division by 0 [1, 0] => [0, 1] | |
// need to handle division by -number [9,0,-2] => [0,-18,0] | |
// |
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 CashAmount{ | |
constructor(amount) { | |
this.amount = amount; | |
this.pennies = this.amount * 100; | |
} | |
addDoubleAmount (newAdd) { | |
this.amount += newAdd; | |
this.pennies += newAdd*100; | |
} |
NewerOlder