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
1. Needs button to stop loading data as the wait can get too long. | |
2. Map panning for every points can get disorientating, only pan the map once when user select an area, otherwise, keep it still | |
3. Marker size for percentage change too big for 5-10 years range, change marker's absolute size for those years to be smaller | |
4. The wait can be too long; this is a hard problem to solve as api limitation cannot be overcomed unless it is paid. Consider preloading some essential data and store it in database for future use. | |
5. More data range; again, api limitation prevents wider range of data, but maybe combining Qunadl data with a different data source can expand the potential |
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
Echo Endpoint Drill: | |
https://swamp-peace.glitch.me | |
with query: | |
https://swamp-peace.glitch.me/echo/foo?cats=dogs | |
Mad lib generator Drill: | |
https://decisive-bridge.glitch.me | |
with query: | |
https://decisive-bridge.glitch.me?adjective1=red&adjective2=spikey&adjective3=effective&adverb=rapidly&name=Joe&noun=bungee%20cord&place=Kansas |
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
Please see the attached photo. I accidentally skipped this step when I was designing the app, and already made the prototype for the app. |
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
Idea: | |
An app where user can compare house prices in different regions across United States. | |
Users may use this information to quickly see where they might decide to move to, or to buy real estate for investment. | |
Mechanism: | |
Using an API from Quandl, house prices are fetched and dynamically displayed on a map from Google Map API. | |
The user may choose to display the data for the whole country or for a specific state. | |
If the user chooses to see the house prices for a specific state, an array of house prices for the neighborhoods in the state will be fetched and displayed | |
User may also select the price changes in percentage, the time frame (1 year, 3 year, 5 year, and 10 years), in addition to the state |
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
https://jsbin.com/mexiwul/edit?html,js,output | |
https://jsbin.com/gorefag/edit?html,js,output | |
https://jsbin.com/purunav/edit?html,css,js,output |
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
What is scope? | |
Ans: Scope refers to the level of code block in a code file. It usually is used to differentiate the global scope and local scope; | |
The global scope refers to the whole code file, while the local scopr refers to the code block within individual functions. | |
Why are global variables avoided? | |
Ans: Global variables are usually avoided to prevent unexpected mutations of global variables that can happen unintentionally in large projects. | |
Explain javascript 'strict mode' | |
Ans: Javascript strict mode prevents potenrially dangerous actions such as the creation of variables without the 'var' declaration. |
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
function getTokens(rawString) { | |
// NB: `.filter(Boolean)` removes any falsy items from an array | |
return rawString.toLowerCase().split(/[ ,!.";:-]+/).filter(Boolean).sort(); | |
} | |
function mostFrequentWord(text) { | |
// get words that have been sorted with spaces and non-alphabet characters removed | |
var words = getTokens(text); | |
var wordFrequencies = {}; | |
// add word in words and initialize count starting from 1 to each word not in the wordFrequencies object. If the word already exists in object, then simply add to the count. |
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
https://jsbin.com/gaqonu/edit?html,js,console | |
https://jsbin.com/godemok/edit?html,js,output | |
https://jsbin.com/fatitu/edit?html,js,output | |
https://jsbin.com/huzeca/edit?html,js,console | |
https://jsbin.com/vidirec/edit?html,js,console |
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
https://jsbin.com/quxome/edit?html,js,console | |
https://jsbin.com/yaqegov/edit?html,js,console | |
https://jsbin.com/sisanuq/edit?html,js,console | |
https://jsbin.com/furolep/edit?html,js,console |
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
https://jsbin.com/qutevo/edit?html,js,console,output | |
https://jsbin.com/lokebay/edit?html,js,console,output | |
https://jsbin.com/caxivis/edit?html,js,console,output |