Skip to content

Instantly share code, notes, and snippets.

View tdesire's full-sized avatar

Tarik Desire tdesire

  • Miami, FL
View GitHub Profile
import sys
if len(sys.argv) == 2:
try:
n = int(sys.argv[1])
print("Fizz buzz counting up to {}".format(n))
while count <= n:
if count % 15 == 0:
print('Fizzbuzz')
elif count % 3 == 0:
1. Get all:
db.restaurants.find();
2. Limit and sort:
db.restaurants.find({}).sort({name: 1}).limit(10);
3. Get by _id:
const searchId = db.restaurants.findOne({}, {_id: 1})._id;
db.restaurants.findOne({_id: searchId});
1. Get all restaurants:
\x
SELECT * FROM restaurants;
2. Get all Italian restaurants:
SELECT * FROM RESTAURANTS WHERE cuisine = 'Italian';
3. Get 10 Italian restaurants, subsets of fields:
SELECT id, name FROM restaurants WHERE cuisine = 'Italian' LIMIT 10;
I believe that both my individual personality and involvement in student organizations as an undergrad have allowed me to develop
strong communication skills, namely, being able to articulate ideas clearly and concisely, to listen actively, and reason
both rationably and reasonably. Given my introverted nature, I am very in-tune with how my words and the words of others may impact
one's feelings. I am confortable being more of a listener than an actor, but my academic, leadership, and work
experiences have taught me to be confident and conscientious when tasked to lead a conversation, provide constructive feedback, and resolve
conflicts.
This unit gave me some useful insight on how to better receive constructive feedback. At times I can be defensive and rebut critisms
made towards my work or personal practices, but I understand that all feedback is to my benefit, and that critisms should always be taken
with an open-mind and without the feeling of being personally attacked. I definitely plan on keeping the
\\(num) -- refers to the line number of the original code.\\
(6) Accepts text (a body of text) as an argument.
(7) Passes text to the getTokens function as an argument, which removes all punctuation marks (falsy characters)
from text and adds the filtered text to a new array.
This new array is then sorted (alphabetically by default) and set to the variable words.
(8) Sets variable wordFrequencies to an empty object. Each key in this object will correspond to a specific word in words, and each
key value represents the number of times that word has occured in the text.
(9-15) Iterates through the words array; if the word in words is not a key in wordFrequencies, then it is a new word, and is added
to wordFrequencies with a key value set to 1 (since it has occured once). If word in words is in wordFrequencies, then add 1
https://repl.it/@tdesire/Make-student-reports-drill
https://repl.it/@tdesire/Enroll-in-summer-school-drill
https://repl.it/@tdesire/find-by-id-drill
https://repl.it/@tdesire/validate-object-keys-drill
https://repl.it/@tdesire/Object-creator-drill
https://repl.it/@tdesire/Object-updater-drill
https://repl.it/@tdesire/Self-reference-drill
https://repl.it/@tdesire/Deleting-keys-drill
Variable scope defines where a variable can be accessed and modified within a body of code.
Scope typically falls into two categories: global scope and block scope.
A variable with global scope is one that has been declared outside the body (block) of a particular function. It is considered global
because it can be accessed and modified anywhere within the code, including within the body of a function.
In contrast, a variable with block scope is one that has been declared within a function's instruction block (delineated by {} brackets),
and can thus only be accessed and/or modified within that function's body.
It is considered programming best-practice to avoid the use of global variables because of their universal mutability. By that I mean,
it is possible for programmers to modify the value of a global variable from within a function's (local) instruction block.
This phenomenon, known as a side-effect, can have dire consequences when executed unintentionally, given that it can lead to
https://repl.it/@tdesire/min-and-max-without-sort-drill
https://repl.it/@tdesire/average-drill
https://repl.it/@tdesire/fizzbuzz-drill-js
https://repl.it/@tdesire/Array-copying-I-drill
https://repl.it/@tdesire/Array-copying-II-drill
https://repl.it/@tdesire/Squares-with-map-drill
https://repl.it/@tdesire/Sort-drill
https://repl.it/@tdesire/Filter-drill
https://repl.it/@tdesire/Find-drill