hyf-homework's People
hyf-homework's Issues
Homework Feedback - Node Week 2
Warmup Exercise
Please do not upload node_modules to your GitHub repo.
hyf-homework/nodejs/week2/warmup/index.js
Line 14 in 79b78a4
You were supposed to use req.params
to implement this route.
Meal Sharing Website
Incomplete Requirements for Week 2
Most of the work here is for the requirements identified for Week 1's homework. For this week's work, you have only tried to implement the requirements for /meals
and /meals/{id}
routes.
The following routes are not implemented:
/reservations/{id}
/reviews
/reviews/{id}
Also, none of the logic you have implemented for the various query params on /meals
route is reachable. Can you figure out what the problem is?
Unnecessary fs
module in package.json
The fs
module that you use in your homework in
file system
module in Node
which does not need to be installed as a separate package in your package.json
. You can read more about the fs
module in Node documentation here: https://nodejs.org/api/fs.html
The package with the same name that you have installed here
is an empty placeholder package. You can safely remove it from your homework using npm uninstall fs
.
Inconsistencies in files in data directory
In the meals.json
file, the price of the first item is of the type number
but all other prices are string
values. Also, except for the first item, the createdAt
property for all objects displays a SyntaxError
instead of a useful value.
In the reservations.json
file, all the email strings have spaces which would render them invalid.
Although these are not causing any problems in your homework, it's good to review the data that you use.
Implementation of Route /meal
The requirements for this route (for Week 1) were to Respond with the json for a random meal. If the meal has a reservation that matches its id, then add the email of that reservation to the json
.
Although there's nothing wrong per se with the way you have implemented it, perhaps there's a more compact way to presenting this data. In case of meals for which multiple reservations are available, when one of them is selected as a random meal, the result in the browser looks like multiple meal objects are being sent, even though it's the same meal in each object and the only different property is the reservation email. Instead of creating multiple meal objects for each matching reservation, if all the matching reservations or the associated emails are stored as an array in a separate property on the meal object, it would probably be easier for the user to interpret the data. An example of this implementation would be something like this:
{
"id": 10,
"title": "kabab",
"maxNumberOfGuests": 19,
"description": "Amet ut voluptate ex consectetur proident. Magna proident eiusmod laborum do cupidatat dolor quis in quis in mollit esse officia. Qui aliqua pariatur laborum laborum non ut amet est eiusmod pariatur nulla ipsum dolore sint. Aliquip ullamco do mollit exercitation deserunt aliquip excepteur exercitation anim ex anim elit proident. Exercitation aliquip consectetur eiusmod ipsum id est dolore eu commodo occaecat ad excepteur id.",
"createdAt": "<SyntaxError: Unexpected identifier>",
"price": "100.67",
"mealReservations": [
{
"name": "Barry Whitaker",
"email": "barry [email protected]",
"mealId": 10
},
{
"name": "Cooke Hancock",
"email": "cooke [email protected]",
"mealId": 10
},
{
"name": "Everett Christensen",
"email": "everett [email protected]",
"mealId": 10
},
{
"name": "Lowe Albert",
"email": "lowe [email protected]",
"mealId": 10
}
]
}
Conclusion
Please implement the missing routes and debug the other problems highlighted above. If you need help with anything, please ask in the Slack channel for your class or let me know directly.
Homework Feedback JS2 Week 3
Seems like you understand the concepts well but really need to practice more since there's some small mistakes which you need to iron out.
Are you sure stringShow
handles the click event correctly?
Firstly, you don't need to check which function is being passed, you can just call it as you have access to it as the argument. Secondly, doing an equality check on a function is not a good idea, as it's a complex object. Look here, for example: https://stackoverflow.com/a/32061834
Have you run this? Does it all work fine?
Good job with keeping the formatting, particularly closures well in the whole file.
Homework feedback Database Week 1
Most of your queries are correct, here are a few tips and corrections:
-- Find all the task that are marked as done
We can use Alias for table names to avoid typing long names repeatedly.
select t.title, s.name from task t inner join status s on t.status_id = s.id where s.name ='Done';
-- Get the names of all statuses, sorted by the status with most tasks first
We also need to sort in Descending order.
select status.name, count(task.status_id) from task inner join status on task.status_id = status.id group by status.name order by count(task.status_id) desc;
hyf-homework/databases/week1/firstWeek.sql
Lines 20 to 21 in 306e8b6
Homework Feedback - React Week 2
Your homework does not meet the requirements specified here:
https://github.com/HackYourFuture-CPH/React/blob/master/week2/homework.md
Also, can you please explain why your homework for the week is copied from here?
https://github.com/iamshaunjp/react-redux-complete-playlist/tree/lesson-24/todoapp/src
Did you find it difficult to complete it on your own or you could not make time for it to do it on your own? The reason I am asking these questions is because we genuinely want to help you learn all this. But to do that effectively, we need to know which areas you need help with. If you borrow code from other places without really understanding what you are doing and without letting us know, we wouldn't really know how to help you.
Please use these homework exercises as opportunities to develop your problem-solving skills, which you will have to regularly demonstrate once you start working in the industry. Copying code from online tutorials that does not even meet the requirements defeats the purpose of homework.
I would like you to redo this homework by writing code on your own. If you do not have the time to work on the weekly homework or you find it challenging in any way, please let me know so we can figure out a way forward.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.