mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-03-16 20:01:43 +08:00
Compare commits
17 Commits
questions/
...
feat/visit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab2327d539 | ||
|
|
63c3850f0e | ||
|
|
e2f7abe69a | ||
|
|
780402afd6 | ||
|
|
2b74f70ef9 | ||
|
|
1eab06f1f5 | ||
|
|
d2b7704370 | ||
|
|
a5d5f63677 | ||
|
|
dfc7821a44 | ||
|
|
1cee0b36dc | ||
|
|
0d1f916535 | ||
|
|
ce0f2a4ee4 | ||
|
|
bf89b013d1 | ||
|
|
5bcb3e282d | ||
|
|
747652c0f3 | ||
|
|
ed0e376d46 | ||
|
|
ef3e4fc3f3 |
36
package.json
36
package.json
@@ -22,38 +22,38 @@
|
||||
"test:e2e": "playwright test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/react": "^3.0.8",
|
||||
"@astrojs/sitemap": "^3.0.3",
|
||||
"@astrojs/tailwind": "^5.0.4",
|
||||
"@astrojs/react": "^3.0.9",
|
||||
"@astrojs/sitemap": "^3.0.5",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@fingerprintjs/fingerprintjs": "^4.2.1",
|
||||
"@nanostores/react": "^0.7.1",
|
||||
"@types/react": "^18.2.45",
|
||||
"@types/react": "^18.2.48",
|
||||
"@types/react-dom": "^18.2.18",
|
||||
"astro": "^4.0.7",
|
||||
"astro-compress": "^2.2.3",
|
||||
"clsx": "^2.0.0",
|
||||
"astro": "^4.2.1",
|
||||
"astro-compress": "^2.2.8",
|
||||
"clsx": "^2.1.0",
|
||||
"dracula-prism": "^2.1.13",
|
||||
"jose": "^5.1.3",
|
||||
"jose": "^5.2.0",
|
||||
"js-cookie": "^3.0.5",
|
||||
"lucide-react": "^0.300.0",
|
||||
"nanoid": "^5.0.4",
|
||||
"nanostores": "^0.9.5",
|
||||
"node-html-parser": "^6.1.11",
|
||||
"node-html-parser": "^6.1.12",
|
||||
"npm-check-updates": "^16.14.12",
|
||||
"prismjs": "^1.29.0",
|
||||
"react": "^18.2.0",
|
||||
"react-confetti": "^6.1.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"reactflow": "^11.10.1",
|
||||
"reactflow": "^11.10.2",
|
||||
"rehype-external-links": "^3.0.0",
|
||||
"roadmap-renderer": "^1.0.6",
|
||||
"slugify": "^1.6.6",
|
||||
"tailwind-merge": "^2.2.0",
|
||||
"tailwindcss": "^3.4.0",
|
||||
"zustand": "^4.4.7"
|
||||
"tailwind-merge": "^2.2.1",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"zustand": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.40.1",
|
||||
"@playwright/test": "^1.41.1",
|
||||
"@tailwindcss/typography": "^0.5.10",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/prismjs": "^1.26.3",
|
||||
@@ -61,9 +61,9 @@
|
||||
"gh-pages": "^6.1.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"markdown-it": "^14.0.0",
|
||||
"openai": "^4.24.1",
|
||||
"prettier": "^3.1.1",
|
||||
"prettier-plugin-astro": "^0.12.2",
|
||||
"prettier-plugin-tailwindcss": "^0.5.9"
|
||||
"openai": "^4.25.0",
|
||||
"prettier": "^3.2.4",
|
||||
"prettier-plugin-astro": "^0.12.3",
|
||||
"prettier-plugin-tailwindcss": "^0.5.11"
|
||||
}
|
||||
}
|
||||
|
||||
2399
pnpm-lock.yaml
generated
2399
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
BIN
public/authors/fernando.jpeg
Normal file
BIN
public/authors/fernando.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
public/images/partners/spring-tile.png
Normal file
BIN
public/images/partners/spring-tile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
@@ -101,22 +101,10 @@ export function CustomRoadmap(props: CustomRoadmapProps) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
|
||||
async function trackVisit() {
|
||||
if (!isLoggedIn() || isEmbed) {
|
||||
return;
|
||||
}
|
||||
|
||||
await httpPost(`${import.meta.env.PUBLIC_API_URL}/v1-visit`, {
|
||||
resourceId: id,
|
||||
resourceType: 'roadmap',
|
||||
});
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getRoadmap().finally(() => {
|
||||
hideRoadmapLoader();
|
||||
});
|
||||
trackVisit().then();
|
||||
}, []);
|
||||
|
||||
if (isLoading) {
|
||||
|
||||
@@ -117,19 +117,6 @@ export class Renderer {
|
||||
});
|
||||
}
|
||||
|
||||
trackVisit() {
|
||||
if (!isLoggedIn()) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.setTimeout(() => {
|
||||
httpPost(`${import.meta.env.PUBLIC_API_URL}/v1-visit`, {
|
||||
resourceId: this.resourceId,
|
||||
resourceType: this.resourceType,
|
||||
}).then(() => null);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
onDOMLoaded() {
|
||||
if (!this.prepareConfig()) {
|
||||
return;
|
||||
@@ -138,8 +125,6 @@ export class Renderer {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const roadmapType = urlParams.get('r');
|
||||
|
||||
this.trackVisit();
|
||||
|
||||
if (roadmapType) {
|
||||
this.switchRoadmap(`/${roadmapType}.json`);
|
||||
} else {
|
||||
|
||||
@@ -121,7 +121,7 @@ export function HeroRoadmaps(props: ProgressListProps) {
|
||||
<div className="grid grid-cols-1 gap-2 sm:grid-cols-2 md:grid-cols-3">
|
||||
{progress.map((resource) => (
|
||||
<HeroRoadmap
|
||||
key={resource.resourceId}
|
||||
key={`${resource.resourceType}-${resource.resourceId}`}
|
||||
resourceId={resource.resourceId}
|
||||
resourceType={resource.resourceType}
|
||||
resourceTitle={resource.resourceTitle}
|
||||
|
||||
25
src/components/PageVisit/PageVisit.tsx
Normal file
25
src/components/PageVisit/PageVisit.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useEffect } from 'react';
|
||||
import { isLoggedIn } from '../../lib/jwt';
|
||||
import { httpPost } from '../../lib/http';
|
||||
import type { ResourceType } from '../../lib/resource-progress';
|
||||
|
||||
type PageVisitProps = {
|
||||
resourceId?: string;
|
||||
resourceType?: ResourceType;
|
||||
};
|
||||
|
||||
export function PageVisit(props: PageVisitProps) {
|
||||
const { resourceId, resourceType } = props;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoggedIn()) {
|
||||
return;
|
||||
}
|
||||
|
||||
httpPost(`${import.meta.env.PUBLIC_API_URL}/v1-visit`, {
|
||||
...(resourceType && { resourceType, resourceId }),
|
||||
}).finally(() => {});
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -41,7 +41,7 @@
|
||||
- [GPU accelerated JavaScript](https://gpu.rocks/#/)
|
||||
- [Introducing Partytown 🎉: Run Third-Party Scripts From a Web Worker](https://dev.to/adamdbradley/introducing-partytown-run-third-party-scripts-from-a-web-worker-2cnp)
|
||||
- [Astro: Astro is a fresh but familiar approach to building websites. Astro combines decades of proven performance best practices with the DX improvements of the component-oriented era. Use your favorite JavaScript framework and automatically ship the bare-minimum amount of JavaScript—by default.](https://docs.astro.build/getting-started/)
|
||||
- [Minimising Layout and Layout thrashing for 60 FPS](https://www.charistheo.io/blog/2021/09/dom-reflow-and-layout-thrashing/)
|
||||
- [Minimising Layout and Layout thrashing for 60 FPS](https://www.harrytheo.com/blog/2021/09/dom-reflow-and-layout-thrashing/)
|
||||
- [Does shadow DOM improve style performance?](https://nolanlawson.com/2021/08/15/does-shadow-dom-improve-style-performance/)
|
||||
- [Debugging memory leaks - HTTP 203](https://www.youtube.com/watch?v=YDU_3WdfkxA)
|
||||
- [Explore JavaScript Dependencies With Lighthouse Treemap](https://sia.codes/posts/lighthouse-treemap/)
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
title: 'The 5 Best Backend Development Languages to Master (2024)'
|
||||
description: 'Discover the best backend development languages to master in 2024.'
|
||||
author:
|
||||
name: 'Kamran Ahmed'
|
||||
url: 'https://twitter.com/kamrify'
|
||||
imageUrl: '/authors/kamranahmedse.jpeg'
|
||||
name: 'Fernando Doglio'
|
||||
url: 'https://twitter.com/deleteman123'
|
||||
imageUrl: '/authors/fernando.jpeg'
|
||||
excludedBySlug: '/backend/languages'
|
||||
seo:
|
||||
title: 'The 5 Best Backend Development Languages to Master (2024)'
|
||||
|
||||
@@ -4,7 +4,7 @@ briefTitle: 'JavaScript'
|
||||
briefDescription: 'Test, rate and improve your JavaScript knowledge with these questions.'
|
||||
title: 'JavaScript Questions'
|
||||
description: 'Test, rate and improve your JavaScript knowledge with these questions.'
|
||||
isNew: true
|
||||
isNew: false
|
||||
seo:
|
||||
title: 'JavaScript Questions'
|
||||
description: 'Curated list of JavaScript questions to test, rate and improve your knowledge. Questions are based on real world experience and knowledge.'
|
||||
|
||||
17
src/data/question-groups/nodejs/content/commonjs-vs-esm.md
Normal file
17
src/data/question-groups/nodejs/content/commonjs-vs-esm.md
Normal file
@@ -0,0 +1,17 @@
|
||||
CommonJS and ES Modules are two different module systems in JavaScript. CommonJS is the module system used in Node.js, while ES Modules are the module system used in browsers and TypeScript.
|
||||
|
||||
## CommonJS
|
||||
|
||||
```js
|
||||
const fs = require('fs');
|
||||
```
|
||||
|
||||
CommonJS modules are loaded synchronously. This means that the module is loaded and evaluated before the code using the module is executed. It uses `require()` to load modules and `module.exports` to export modules.
|
||||
|
||||
## ES Modules
|
||||
|
||||
```js
|
||||
import fs from 'fs';
|
||||
```
|
||||
|
||||
ES Modules are loaded asynchronously. This means that the module is loaded and evaluated when the module is used. It uses `import` to load modules and `export` to export modules.
|
||||
66
src/data/question-groups/nodejs/content/error-handling.md
Normal file
66
src/data/question-groups/nodejs/content/error-handling.md
Normal file
@@ -0,0 +1,66 @@
|
||||
There are four fundamental strategies to report errors in Node.js:
|
||||
|
||||
## `try...catch` blocks
|
||||
|
||||
`try...catch` blocks are the most basic way to handle errors in JavaScript. They are synchronous and can only be used to handle errors in synchronous code. They are not suitable for asynchronous code, such as callbacks and promises.
|
||||
|
||||
```js
|
||||
import fs from 'node:fs';
|
||||
|
||||
try {
|
||||
const data = fs.readFileSync('file.md', 'utf-8');
|
||||
console.log(data);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
```
|
||||
|
||||
## Callbacks
|
||||
|
||||
Callbacks are the most common way to handle errors in asynchronous code. They are passed as the last argument to a function and are called when the function completes or fails.
|
||||
|
||||
```js
|
||||
import fs from 'node:fs';
|
||||
|
||||
fs.readFile('file.md', 'utf-8', (err, data) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(data);
|
||||
});
|
||||
```
|
||||
|
||||
## Promises
|
||||
|
||||
Promises are a more modern way to handle errors in asynchronous code. They are returned by functions and can be chained together. They are resolved when the function completes and rejected when it fails.
|
||||
|
||||
```js
|
||||
import fs from 'node:fs/promises';
|
||||
|
||||
fs.readFile('file.md', 'utf-8')
|
||||
.then((data) => {
|
||||
console.log(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
```
|
||||
|
||||
## Event emitters
|
||||
|
||||
Event emitters are a more advanced way to handle errors in asynchronous code. They are returned by functions and emit an `error` event when they fail. They are resolved when the function completes and rejected when it fails.
|
||||
|
||||
```js
|
||||
import fs from 'node:fs';
|
||||
|
||||
const reader = fs.createReadStream('file.md', 'utf-8');
|
||||
reader.on('data', (data) => {
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
reader.on('error', (err) => {
|
||||
console.error(err);
|
||||
});
|
||||
```
|
||||
18
src/data/question-groups/nodejs/content/exit-codes.md
Normal file
18
src/data/question-groups/nodejs/content/exit-codes.md
Normal file
@@ -0,0 +1,18 @@
|
||||
The following exit codes are used in Node.js:
|
||||
|
||||
- `0`: Success
|
||||
- `1`: Uncaught Fatal Exception
|
||||
- `2`: Unused
|
||||
- `3`: Internal JavaScript Parse Error
|
||||
- `4`: Internal JavaScript Evaluation Failure
|
||||
- `5`: Fatal Error
|
||||
- `6`: Non-function Internal Exception Handler
|
||||
- `7`: Internal Exception Handler Run-Time Failure
|
||||
- `8`: Unused
|
||||
- `9`: Invalid Argument
|
||||
- `10`: Internal JavaScript Run-Time Failure
|
||||
- `12`: Invalid Debug Argument
|
||||
- `13`: Uncaught Exception
|
||||
- `14`: Unhandled Promise Rejection
|
||||
- `15`: Fatal Exception
|
||||
- `16`: Signal Exits
|
||||
@@ -0,0 +1,18 @@
|
||||
In order to take user input from the command line, you can use the `readline` module. It provides an interface for reading data from a Readable stream (such as `process.stdin`) one line at a time.
|
||||
|
||||
```js
|
||||
import readline from 'node:readline';
|
||||
import { stdin as input, stdout as output } from 'node:process';
|
||||
|
||||
const rl = readline.createInterface({ input, output });
|
||||
|
||||
rl.question('What do you think of Node.js? ', (answer) => {
|
||||
console.log(`Thank you for your valuable feedback: ${answer}`);
|
||||
rl.close();
|
||||
});
|
||||
|
||||
rl.on('close', () => {
|
||||
console.log('\nBYE BYE !!!');
|
||||
process.exit(0);
|
||||
});
|
||||
```
|
||||
25
src/data/question-groups/nodejs/content/order-priority.md
Normal file
25
src/data/question-groups/nodejs/content/order-priority.md
Normal file
@@ -0,0 +1,25 @@
|
||||
Order priorities of `process.nextTick`, `Promise`, `setTimeout` and `setImmediate` are as follows:
|
||||
|
||||
1. `process.nextTick`: Highest priority, executed immediately after the current event loop cycle, before any other I/O events or timers.
|
||||
2. `Promise`: Executed in the microtask queue, after the current event loop cycle, but before the next one.
|
||||
3. `setTimeout`: Executed in the timer queue, after the current event loop cycle, with a minimum delay specified in milliseconds.
|
||||
4. `setImmediate`: Executed in the check queue, but its order may vary based on the system and load. It generally runs in the next iteration of the event loop after I/O events.
|
||||
|
||||
```js
|
||||
console.log('start');
|
||||
Promise.resolve().then(() => console.log('Promise'));
|
||||
setTimeout(() => console.log('setTimeout'), 0);
|
||||
process.nextTick(() => console.log('process.nextTick'));
|
||||
setImmediate(() => console.log('setImmediate'));
|
||||
console.log('end');
|
||||
|
||||
// Output:
|
||||
// start
|
||||
// end
|
||||
// process.nextTick
|
||||
// Promise
|
||||
// setTimeout
|
||||
// setImmediate
|
||||
```
|
||||
|
||||
In summary, the order of execution is generally `process.nextTick` > `Promise` > `setTimeout` > `setImmediate`. However, keep in mind that the behavior may vary in specific situations, and the order might be influenced by factors such as system load and other concurrent operations.
|
||||
15
src/data/question-groups/nodejs/content/process-argv.md
Normal file
15
src/data/question-groups/nodejs/content/process-argv.md
Normal file
@@ -0,0 +1,15 @@
|
||||
`process.argv` is an array containing the command-line arguments passed when the Node.js process was launched. The first element is the path to the Node.js executable, the second element is the path to the JavaScript file being executed, and the remaining elements are the command-line arguments.
|
||||
|
||||
```js
|
||||
node index.js hello world
|
||||
```
|
||||
|
||||
```js
|
||||
console.log(process.argv);
|
||||
// [
|
||||
// '/usr/local/bin/node', -> path to the Node.js executable
|
||||
// '/Users/username/projects/nodejs/index.js', -> path to the JavaScript file being executed
|
||||
// 'hello', -> command-line argument
|
||||
// 'world' -> command-line argument
|
||||
// ]
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
`process.cwd()` returns the current working directory of the Node.js process, while `__dirname` returns the directory name of the current module.
|
||||
|
||||
```js
|
||||
console.log(process.cwd());
|
||||
// /Users/username/projects/nodejs
|
||||
|
||||
console.log(__dirname);
|
||||
// /Users/username/projects/nodejs/src
|
||||
```
|
||||
14
src/data/question-groups/nodejs/content/web-server.md
Normal file
14
src/data/question-groups/nodejs/content/web-server.md
Normal file
@@ -0,0 +1,14 @@
|
||||
To create a minimal `Hello, World!` HTTP server in Node.js, you can use the `http` module. It provides an HTTP server, and the createServer() method sets up a server instance with a callback function to handle incoming requests
|
||||
|
||||
```js
|
||||
import http from 'node:http';
|
||||
|
||||
const server = http.createServer((req, res) => {
|
||||
res.writeHead(200, { 'Content-Type': 'text/plain' });
|
||||
res.end('Hello World\n');
|
||||
});
|
||||
|
||||
server.listen(3000, () => {
|
||||
console.log('Server running at http://localhost:3000/');
|
||||
});
|
||||
```
|
||||
227
src/data/question-groups/nodejs/nodejs.md
Normal file
227
src/data/question-groups/nodejs/nodejs.md
Normal file
@@ -0,0 +1,227 @@
|
||||
---
|
||||
order: 1
|
||||
briefTitle: 'Node.js'
|
||||
briefDescription: 'Test, rate and improve your Node.js knowledge with these questions.'
|
||||
title: 'Node.js Questions'
|
||||
description: 'Test, rate and improve your Node.js knowledge with these questions.'
|
||||
isNew: true
|
||||
seo:
|
||||
title: 'Node.js Questions'
|
||||
description: 'Curated list of Node.js questions to test, rate and improve your knowledge. Questions are based on real world experience and knowledge.'
|
||||
keywords:
|
||||
- 'node.js quiz'
|
||||
- 'node.js questions'
|
||||
- 'node.js interview questions'
|
||||
- 'node.js interview'
|
||||
- 'node.js test'
|
||||
sitemap:
|
||||
priority: 1
|
||||
changefreq: 'monthly'
|
||||
questions:
|
||||
- question: What is Node.js?
|
||||
answer: Node.js is an open-source and cross-platform JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is REPL in Node.js?
|
||||
answer: |
|
||||
REPL stands for Read-Eval-Print-Loop. It is an interactive shell that allows you to execute JavaScript code and view the output immediately. It is useful for testing small snippets of code and experimenting with the Node.js API.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is the difference between Node.js and JavaScript?
|
||||
answer: Node.js is a runtime environment for JavaScript. JavaScript is a programming language used to create web applications. Node.js is a runtime environment that can execute JavaScript code outside of a web browser.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is Event Loop in Node.js?
|
||||
answer: |
|
||||
The event loop is a single-threaded loop responsible for handling all asynchronous tasks in Node.js. It continuously checks for events and executes associated callback functions, allowing Node.js to handle asynchronous tasks efficiently. Its non-blocking I/O model ensures that it can process multiple operations simultaneously without waiting for one to complete before moving on to the next, contributing to its scalability and performance. [Watch this video](https://www.youtube.com/watch?v=8aGhZQkoFbQ) to learn more about the topic.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is the difference between Node.js and AJAX?
|
||||
answer: |
|
||||
Node.js is a server-side runtime for JavaScript, while AJAX is a client-side technique for asynchronous communication with the server.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What are modules in Node.js?
|
||||
answer: |
|
||||
Modules are reusable blocks of code that can be imported into other files. They are used to encapsulate related code into a single unit of code that can be used in other parts of the program. It allow us to split our code into multiple files and reuse it across multiple files. Some built-in modules include `fs`, `http`, `path`, `url`, `util`, etc.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: Difference between CommonJS and ESM?
|
||||
answer: commonjs-vs-esm.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is the `global` object in Node.js?
|
||||
answer: |
|
||||
The `global` object is a global namespace object that contains all global variables, functions, and objects. It is similar to the `window` object in the browser. It can be accessed from anywhere in the program without importing it.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is the difference between `process.nextTick()` and `setImmediate()`?
|
||||
answer: |
|
||||
`process.nextTick()` and `setImmediate()` are both used to schedule a callback function to be executed in the next iteration of the event loop. The difference is that `process.nextTick()` executes the callback at the end of the current iteration of the event loop, while `setImmediate()` executes the callback at the beginning of the next iteration of the event loop.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is `setInterval()`?
|
||||
answer: |
|
||||
`setInterval()` is a global function that helps you execute a function repeatedly at a fixed delay. It returns an interval ID that uniquely identifies the interval, which can be used to cancel the interval using the `clearInterval()` function.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is `setTimeout()`?
|
||||
answer: |
|
||||
`setTimeout()` is a global function that helps you execute a function after a specified delay. It returns a timeout ID that uniquely identifies the timeout, which can be used to cancel the timeout using the `clearTimeout()` function.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What are Event Emitters in Node.js?
|
||||
answer: |
|
||||
Event Emitters is a class that can be used to emit named events and register listeners for those events. It is used to handle asynchronous events in Node.js.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is `npm`?
|
||||
answer: |
|
||||
`npm` is a package manager for Node.js. It is used to install, update, and remove packages from the Node.js ecosystem. It is also used to manage dependencies for Node.js projects.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is the full form of `npm`?
|
||||
answer: |
|
||||
`npm` stands for Node Package Manager.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is `npx`?
|
||||
answer: |
|
||||
`npx` is a tool that allows you to run Node.js packages without installing them. It is used to execute Node.js packages that are not installed globally.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is `process.cwd()`?
|
||||
answer: |
|
||||
`process.cwd()` returns the current working directory of the Node.js process. It is similar to `pwd` in Unix.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is the difference between `process.cwd()` and `__dirname`?
|
||||
answer: process-cwd-vs-dirname.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is `__filename`?
|
||||
answer: |
|
||||
`__filename` is a global variable that contains the absolute path of the current file.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is `process.argv`?
|
||||
answer: process-argv.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is the purpose of `fs` module?
|
||||
answer: |
|
||||
The File System (fs) module is used to perform file operations such as reading, writing, and deleting files. All file system operations have synchronous and asynchronous forms.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What is the purpose of `path` module?
|
||||
answer: |
|
||||
The Path module is used to perform operations on file and directory paths. It provides methods for resolving and normalizing paths, joining paths, and extracting file and directory names.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: How to read a file in Node.js?
|
||||
answer: |
|
||||
The `fs.readFile()` method is used to read the contents of a file asynchronously. It takes the path of the file to be read and a callback function as arguments. The callback function is called with two arguments, `err` and `data`. If an error occurs while reading the file, the `err` argument will contain the error object. Otherwise, the `data` argument will contain the contents of the file.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: How to load environment variables from a `.env` file in Node.js?
|
||||
answer: |
|
||||
The `dotenv` package is used to load environment variables from a `.env` file into `process.env`. It is used to store sensitive information such as API keys, database credentials, etc. in a `.env` file instead of hardcoding them in the source code.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: How to access environment variables in Node.js?
|
||||
answer: |
|
||||
Environment variables can be accessed using the `process.env` object. It is an object that contains all the environment variables defined in the current process.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: How to take user input from the command line in Node.js?
|
||||
answer: input-from-command-line.md
|
||||
topics:
|
||||
- 'CLI'
|
||||
- 'Beginner'
|
||||
- question: How to create a web server in Node.js?
|
||||
answer: web-server.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Beginner'
|
||||
- question: What are streams in Node.js?
|
||||
answer: |
|
||||
Streams are objects that allow you to read data from a source or write data to a destination in a continuous manner. They are used to handle large amounts of data efficiently.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Advanced'
|
||||
- question: What is difference between `fork` and `spawn` methods of `child_process` module?
|
||||
answer: |
|
||||
The `fork` method is used when you want to run another JavaScript file in a separate worker. It's like having a friend with a specific task. You can communicate with them via messages and they can send messages back to you. The `spawn` method is used when you want to run a command in a separate process. It's like asking someone to do a specific. You can communicate with them via stdin/stdout/stderr, but it's more like giving orders and getting results.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Advanced'
|
||||
- question: What is the `os` module?
|
||||
answer: |
|
||||
The `os` module provides methods for interacting with the operating system. It can be used to get information about the operating system, such as the hostname, platform, architecture, etc.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: Can you access the DOM in Node.js?
|
||||
answer: |
|
||||
No, you cannot access the DOM in Node.js because it does not have a DOM. It is a server-side runtime for JavaScript, so it does not have access to the browser's DOM.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is Clustering in Node.js?
|
||||
answer: |
|
||||
Clustering is a technique used to distribute the load across multiple processes. It is used to improve the performance and scalability of Node.js applications.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Advanced'
|
||||
- question: How can memory leaks happen in Node.js?
|
||||
answer: |
|
||||
Memory leaks happen when a program allocates memory but does not release it when it is no longer needed. This can happen due to bugs in the program or due to the way the program is designed. In Node.js, memory leaks can happen due to the use of closures, circular references, and global variables.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is the order priority of `process.nextTick`, `Promise`, `setTimeout`, and `setImmediate`?
|
||||
answer: order-priority.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: What is `process.exit()`?
|
||||
answer: |
|
||||
`process.exit()` is a method that can be used to exit the current process. It takes an optional exit code as an argument. If no exit code is specified, it defaults to 0.
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: Different exit codes in Node.js?
|
||||
answer: exit-codes.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
- question: How Node.js handle errors?
|
||||
answer: error-handling.md
|
||||
topics:
|
||||
- 'Core'
|
||||
- 'Intermediate'
|
||||
---
|
||||
@@ -4,7 +4,7 @@ briefTitle: 'React'
|
||||
briefDescription: 'Test, rate and improve your React knowledge with these questions.'
|
||||
title: 'React Questions'
|
||||
description: 'Test, rate and improve your React knowledge with these questions.'
|
||||
isNew: true
|
||||
isNew: false
|
||||
seo:
|
||||
title: 'React Questions'
|
||||
description: 'Curated list of React questions to test, rate and improve your knowledge. Questions are based on real world experience and knowledge.'
|
||||
|
||||
@@ -6,7 +6,7 @@ briefDescription: 'Step by step guide to becoming an Android Developer in 2024'
|
||||
title: 'Android Developer'
|
||||
description: 'Step by step guide to becoming an Android developer in 2024'
|
||||
hasTopics: true
|
||||
isNew: true
|
||||
isNew: false
|
||||
dimensions:
|
||||
width: 968
|
||||
height: 2197.76
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
# What is and how to use Gradle?
|
||||
|
||||
**Using Gradle**: Gradle is a powerful build system used in Android development that allows you to define your project and dependencies, and distinguish between different build types and flavors. Gradle uses a domain-specific language (DSL) which gives developers almost complete control over the build process. When you trigger a build in Android Studio, Gradle is the tool working behind the scenes to compile and package your app. It looks at the dependencies you declared in your build.gradle files and creates a build script accordingly. Using Gradle in android development requires continuous editing of the build.gradle files to manage app dependencies, build variants, signing configurations and other essential aspects related to building your app.
|
||||
**Using Gradle**: Gradle is a powerful build system used in Android development that allows you to define your project and dependencies, and distinguish between different build types and flavors. Gradle uses a domain-specific language (DSL) which gives developers almost complete control over the build process. When you trigger a build in Android Studio, Gradle is the tool working behind the scenes to compile and package your app. It looks at the dependencies you declared in your build.gradle files and create a build script accordingly. Using Gradle in Android development requires continuous editing of the build.gradle files to manage app dependencies, build variants, signing configurations, and other essential aspects related to building your app.
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Introduction to Gradle for Complete Beginners - 25minutes](https://youtu.be/-dtcEMLNmn0?si=NuIP-3wNpUrxfTxA)
|
||||
- [Gradle Course for Beginners - 55minutes](https://www.youtube.com/watch?v=R6Z-Sxb837I)
|
||||
|
||||
|
||||
3214
src/data/roadmaps/backend/backend-beginner.json
Normal file
3214
src/data/roadmaps/backend/backend-beginner.json
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ tnsBannerLink: 'https://thenewstack.io?utm_source=roadmap.sh&utm_medium=Referral
|
||||
question:
|
||||
title: 'What is Backend Development?'
|
||||
description: |
|
||||
Backend web development is the part of web development that deals with the server-side of a web application. This includes creating and managing the server-side logic, connecting the application to a database, creating server-side APIs, handling user authentication and authorization, and processing and responding to user requests. It often involves the use of programming languages such as Python, Java, Ruby, PHP, JavaScript (Node.js), and .NET languages.
|
||||
Backend web development is the part of web development that deals with the server-side of a web application. This includes creating and managing the server-side logic, connecting the application to a database, creating server-side APIs, handling user authentication and authorization, and processing and responding to user requests. It often involves the use of [backend development languages](https://roadmap.sh/backend/languages) such as Python, Java, Ruby, PHP, JavaScript (Node.js), and .NET languages.
|
||||
|
||||
## What does a Backend Developer do?
|
||||
A backend developer is responsible for the development of server-side components of a web application i.e. working with databases, handling requests, creating server-side APIs that can be consumed by frontend developers to retrieve and manipulate data, ensuring the scalability of the systems i.e. making sure that the backend can handle a high volume of traffic and is performant, integrating external services like payment gateways, message queues, cloud services, etc.
|
||||
|
||||
@@ -7,7 +7,6 @@ Visit the following resources to learn more:
|
||||
- [Visit Dedicated Go Roadmap](/golang)
|
||||
- [A Tour of Go – Go Basics](https://go.dev/tour/welcome/1)
|
||||
- [Go Reference Documentation](https://go.dev/doc/)
|
||||
- [Learn Go | Boot.dev](https://boot.dev/learn/learn-golang)
|
||||
- [Go by Example - annotated example programs](https://gobyexample.com/)
|
||||
- [Learn Go | Codecademy](https://www.codecademy.com/learn/learn-go)
|
||||
- [W3Schools Go Tutorial ](https://www.w3schools.com/go/)
|
||||
|
||||
@@ -8,4 +8,3 @@ Visit the following resources to learn more:
|
||||
- [What is Cryptography](https://www.synopsys.com/glossary/what-is-cryptography.html)
|
||||
- [Asymmetric Encryption - Simply explained](https://youtu.be/AQDCe585Lnc)
|
||||
- [What is Cryptography?](https://www.youtube.com/watch?v=6_Cxj5WKpIw)
|
||||
- [Learn Cryptography](https://www.youtube.com/watch?v=trHox1bN5es)
|
||||
|
||||
@@ -7,7 +7,6 @@ Visit the following resources to learn more:
|
||||
- [Visit Dedicated Go Roadmap](/golang)
|
||||
- [A Tour of Go – Go Basics](https://go.dev/tour/welcome/1)
|
||||
- [Go Reference Documentation](https://go.dev/doc/)
|
||||
- [Learn Go | Boot.dev](https://boot.dev/learn/learn-golang)
|
||||
- [Go by Example - annotated example programs](https://gobyexample.com/)
|
||||
- [Learn Go | Codecademy](https://www.codecademy.com/learn/learn-go)
|
||||
- [W3Schools Go Tutorial ](https://www.w3schools.com/go/)
|
||||
|
||||
@@ -8,7 +8,6 @@ Visit the following resources to learn more:
|
||||
- [A Tour of Go – Go Basics](https://go.dev/tour/welcome/1)
|
||||
- [Go Reference Documentation](https://go.dev/doc/)
|
||||
- [Go by Example - annotated example programs](https://gobyexample.com/)
|
||||
- [Learn Go | Boot.dev](https://boot.dev/learn/learn-golang)
|
||||
- [Learn Go | Codecademy](https://www.codecademy.com/learn/learn-go)
|
||||
- [W3Schools Go Tutorial ](https://www.w3schools.com/go/)
|
||||
- [Making a RESTful JSON API in Go](https://thenewstack.io/make-a-restful-json-api-go/)
|
||||
|
||||
@@ -6,7 +6,7 @@ briefTitle: 'C++'
|
||||
briefDescription: 'Step by step guide to becoming a C++ Developer in 2024'
|
||||
title: 'C++ Developer Roadmap'
|
||||
description: 'Step by step guide to becoming a C++ developer in 2024'
|
||||
isNew: true
|
||||
isNew: false
|
||||
hasTopics: true
|
||||
dimensions:
|
||||
width: 1000
|
||||
|
||||
@@ -13,4 +13,4 @@ Visit the following resources to learn more:
|
||||
- [Node.js Tutorial for Beginners](https://www.youtube.com/watch?v=TlB_eWDSMt4)
|
||||
- [W3Schools – Node.js Tutorial](https://www.w3schools.com/nodejs/)
|
||||
- [What is NPM?](https://www.w3schools.com/nodejs/nodejs_npm.asp)
|
||||
- [Official Documentation](https://nodejs.dev/en/learn/)
|
||||
- [Official Documentation](https://nodejs.org/en/learn/getting-started/introduction-to-nodejs)
|
||||
|
||||
@@ -7,7 +7,6 @@ Visit the following resources to learn more:
|
||||
- [Visit Dedicated Go Roadmap](/golang)
|
||||
- [A Tour of Go – Go Basics](https://go.dev/tour/welcome/1)
|
||||
- [Go Reference Documentation](https://go.dev/doc/)
|
||||
- [Learn Go | Boot.dev](https://boot.dev/learn/learn-golang)
|
||||
- [Go by Example - annotated example programs](https://gobyexample.com/)
|
||||
- [Learn Go | Codecademy](https://www.codecademy.com/learn/learn-go)
|
||||
- [W3Schools Go Tutorial ](https://www.w3schools.com/go/)
|
||||
|
||||
@@ -7,4 +7,4 @@ Visit the following resources to learn more:
|
||||
- [Esbuild Official Website](https://esbuild.github.io/)
|
||||
- [Esbuild Documentation](https://esbuild.github.io/api/)
|
||||
- [Why are People Obsessed with esbuild?](https://www.youtube.com/watch?v=9XS_RA6zyyU)
|
||||
- [What Is ESBuild?](https://www.youtube.com/watch?v=zy8vu8cbwf0)
|
||||
- [What Is ESBuild?](https://www.youtube.com/watch?v=ZY8Vu8cbWF0)
|
||||
|
||||
@@ -5,6 +5,6 @@ Node.js is an open-source and cross-platform JavaScript runtime environment. It
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Official Website](https://nodejs.org/en/about/)
|
||||
- [Learn Node.js Official Website](https://nodejs.dev/en/learn/)
|
||||
- [Learn Node.js Official Website](https://nodejs.org/en/learn/getting-started/introduction-to-nodejs)
|
||||
- [Node.JS Introduction](https://www.w3schools.com/nodejs/nodejs_intro.asp)
|
||||
- [Node.js and Express.js Full Course](https://www.youtube.com/watch?v=Oe421EPjeBE)
|
||||
@@ -6,6 +6,6 @@ Visit the following resources to learn more:
|
||||
|
||||
- [Official Website](https://nodejs.org/en/about/)
|
||||
- [Node.JS Introduction](https://www.w3schools.com/nodejs/nodejs_intro.asp)
|
||||
- [Official Website](https://nodejs.dev/en/learn/)
|
||||
- [Official Website](https://nodejs.org/en/learn/getting-started/introduction-to-nodejs)
|
||||
- [What is Node.js?](https://www.youtube.com/watch?v=uVwtVBpw7RQ)
|
||||
- [How Node.js Works?](https://www.youtube.com/watch?v=jOupHNvDIq8)
|
||||
|
||||
@@ -5,6 +5,6 @@ Node.js is a cross-platform runtime, perfect for a wide range of use cases. Its
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Pros of Node.js](https://www.freecodecamp.org/news/what-are-the-advantages-of-node-js/)
|
||||
- [Learn Node.js](https://nodejs.dev/en/learn/)
|
||||
- [Learn Node.js](https://nodejs.org/en/learn/getting-started/introduction-to-nodejs)
|
||||
- [Why Choose Node.js?](https://medium.com/selleo/why-choose-node-js-b0091ad6c3fc)
|
||||
- [5 Reasons to Choose Node.js](https://www.bitovi.com/blog/5-reasons-to-choose-nodejs)
|
||||
|
||||
@@ -8,4 +8,5 @@ Visit the following resources to learn more:
|
||||
- [JavaScript Visualized: Event Loop](https://dev.to/lydiahallie/javascript-visualized-event-loop-3dif)
|
||||
- [The Node.js Event Loop](https://www.coursera.org/lecture/secure-full-stack-mean-developer/the-node-js-event-loop-j5fbT)
|
||||
- [The Complete Node js: The Node js Event Loop](https://www.youtube.com/watch?v=6YgsqXlUoTM)
|
||||
- [The NodeJS Event loop](https://nodejs.dev/en/learn/the-nodejs-event-loop/)
|
||||
- [The NodeJS Event loop](https://nodejs.org/en/guides/event-loop-timers-and-nexttick)
|
||||
- [Don't Block the Event Loop](https://nodejs.org/en/guides/dont-block-the-event-loop)
|
||||
|
||||
@@ -4,5 +4,5 @@ In Node.js, an event can be described simply as a string with a corresponding ca
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [What are Event Emitters?](https://nodejs.dev/en/learn/the-nodejs-event-emitter/)
|
||||
- [What are Event Emitters?](https://nodejs.org/en/learn/asynchronous-work/the-nodejs-event-emitter)
|
||||
- [Using Event Emitters in Node.js](https://www.digitalocean.com/community/tutorials/using-event-emitters-in-node-js)
|
||||
|
||||
@@ -5,4 +5,4 @@ Node.js, being an asynchronous platform, doesn't wait around for things like fil
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [What are callbacks?](https://developer.mozilla.org/en-US/docs/Glossary/Callback_function)
|
||||
- [Asynchronicity in Programming Languages](https://nodejs.dev/en/learn/javascript-asynchronous-programming-and-callbacks/)
|
||||
- [Asynchronicity in Programming Languages](https://nodejs.org/en/learn/asynchronous-work/javascript-asynchronous-programming-and-callbacks)
|
||||
|
||||
@@ -5,4 +5,4 @@ The `setImmediate` function delays the execution of a function to be called afte
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Understanding setImmediate](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate)
|
||||
- [Understanding setImmediate](https://nodejs.dev/en/learn/understanding-setimmediate/)
|
||||
- [Understanding setImmediate](https://nodejs.org/en/learn/asynchronous-work/understanding-setimmediate)
|
||||
|
||||
@@ -4,6 +4,6 @@ Every time the event loop takes a full trip, we call it a tick. When we pass a f
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Understanding Process.NextTick()](https://nodejs.dev/en/learn/understanding-processnexttick/)
|
||||
- [Understanding Process.NextTick()](https://nodejs.org/en/learn/asynchronous-work/understanding-processnexttick)
|
||||
- [The Node.js process.nextTick()](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/)
|
||||
- [The process.nextTick Function](https://www.youtube.com/watch?v=-niA5XOlCWI)
|
||||
|
||||
@@ -5,5 +5,5 @@ The `path` module provides utilities for working with file and directory paths.
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Official Website](https://nodejs.org/api/path.html)
|
||||
- [Official Website](https://nodejs.dev/en/learn/nodejs-file-paths/)
|
||||
- [Official Website](https://nodejs.org/en/learn/manipulating-files/nodejs-file-paths)
|
||||
- [Path Module in Node.js](https://youtu.be/j95Lwxvi9JY)
|
||||
|
||||
@@ -6,4 +6,4 @@ Visit the following resources to learn more:
|
||||
|
||||
- [How To Create a Web Server in Node.js with the HTTP Module](https://www.digitalocean.com/community/tutorials/how-to-create-a-web-server-in-node-js-with-the-http-module)
|
||||
- [Node.js Http Module](https://www.geeksforgeeks.org/node-js-http-module/)
|
||||
- [The Node.js Http Module](https://nodejs.dev/en/learn/the-nodejs-http-module/)
|
||||
- [The Node.js Http Module](https://nodejs.org/docs/latest/api/http.html)
|
||||
|
||||
@@ -5,5 +5,7 @@ A binary search tree, also called an ordered or sorted binary tree, is a rooted
|
||||
Visit the following resources to learn more:
|
||||
|
||||
- [Tree Data Structure | Illustrated Data Structures](https://www.youtube.com/watch?v=S2W3SXGPVyU)
|
||||
- [How to Implement Binary Search Tree in Python](https://www.section.io/engineering-education/implementing-binary-search-tree-using-python/)
|
||||
- [Writing a Binary Search Tree in Python With Examples](https://blog.boot.dev/computer-science/binary-search-tree-in-python/)
|
||||
- [How to Implement Binary Search Tree in Python](https://web.archive.org/web/20230601181553/https://www.section.io/engineering-education/implementing-binary-search-tree-using-python/)
|
||||
- [Binary Search Tree in Python](https://www.pythonforbeginners.com/data-structures/binary-search-tree-in-python)
|
||||
- [Problem Set](https://www.geeksforgeeks.org/binary-search-tree-data-structure/?ref=gcse)
|
||||
|
||||
@@ -7,7 +7,6 @@ Visit the following resources to learn more:
|
||||
- [Visit Dedicated Go Roadmap](/golang)
|
||||
- [A Tour of Go – Go Basics](https://go.dev/tour/welcome/1)
|
||||
- [Go Reference Documentation](https://go.dev/doc/)
|
||||
- [Learn Go | Boot.dev](https://boot.dev/learn/learn-golang)
|
||||
- [Go by Example - annotated example programs](https://gobyexample.com/)
|
||||
- [Learn Go | Codecademy](https://www.codecademy.com/learn/learn-go)
|
||||
- [W3Schools Go Tutorial ](https://www.w3schools.com/go/)
|
||||
|
||||
@@ -14,10 +14,10 @@ For example, consider the following `ORDER` table:
|
||||
|
||||
```
|
||||
| OrderID | Company | Quantity |
|
||||
|-------------|-----------|----------|
|
||||
| 1 | A | 30 |
|
||||
| 2 | B | 15 |
|
||||
| 3 | A | 20 |
|
||||
|------------|---------|----------|
|
||||
| 1 | A | 30 |
|
||||
| 2 | B | 15 |
|
||||
| 3 | A | 20 |
|
||||
```
|
||||
|
||||
If you want to find the total quantity, you can use `SUM()`:
|
||||
@@ -30,8 +30,8 @@ Output will be:
|
||||
|
||||
```
|
||||
| TotalQuantity |
|
||||
|----------------|
|
||||
| 65 |
|
||||
|---------------|
|
||||
| 65 |
|
||||
```
|
||||
|
||||
**Note:** The `SUM()` function skips NULL values.
|
||||
@@ -55,4 +55,4 @@ This will give us the sum of `Quantity` for each `Company` in the `Order` table.
|
||||
| B | 15 |
|
||||
```
|
||||
|
||||
Notably, in all databases, including MySQL, PostgreSQL, and SQLite, the `SUM()` function operates the same way.
|
||||
Notably, in all databases, including MySQL, PostgreSQL, and SQLite, the `SUM()` function operates the same way.
|
||||
|
||||
@@ -27,5 +27,5 @@ To enhance user decision-making experience, consider the following principles:
|
||||
|
||||
Understanding human decision making and incorporating these principles into UX design will enable designers to create more intuitive, enjoyable, and efficient user experiences.
|
||||
|
||||
- [Types of Cognitive Bias](https://www.youtube.com/watch?v=wewgbir_riw)
|
||||
- [Types of Cognitive Bias](https://www.youtube.com/watch?v=wEwGBIr_RIw)
|
||||
- [List of Cognitive Biases](https://thedecisionlab.com/biases)
|
||||
@@ -11,6 +11,8 @@ import { Toaster } from '../components/Toast';
|
||||
import { PageSponsor } from '../components/PageSponsor';
|
||||
import { siteConfig } from '../lib/config';
|
||||
import '../styles/global.css';
|
||||
import { PageVisit } from '../components/PageVisit/PageVisit';
|
||||
import type { ResourceType } from '../lib/resource-progress';
|
||||
|
||||
export interface Props {
|
||||
title: string;
|
||||
@@ -25,6 +27,8 @@ export interface Props {
|
||||
initialLoadingMessage?: string;
|
||||
permalink?: string;
|
||||
jsonLd?: Record<string, unknown>[];
|
||||
resourceId?: string;
|
||||
resourceType?: ResourceType;
|
||||
}
|
||||
|
||||
const {
|
||||
@@ -39,6 +43,8 @@ const {
|
||||
jsonLd = [],
|
||||
redirectUrl = '',
|
||||
initialLoadingMessage = '',
|
||||
resourceId,
|
||||
resourceType,
|
||||
} = Astro.props;
|
||||
|
||||
// Remove trailing slashes to consider the page as canonical
|
||||
@@ -55,7 +61,7 @@ const gaPageIdentifier = Astro.url.pathname
|
||||
.replace(/\//g, ':');
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<meta charset='UTF-8' />
|
||||
@@ -171,5 +177,10 @@ const gaPageIdentifier = Astro.url.pathname
|
||||
<slot name='after-footer' />
|
||||
|
||||
<Analytics />
|
||||
<PageVisit
|
||||
resourceId={resourceId}
|
||||
resourceType={resourceType}
|
||||
client:load
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -67,6 +67,8 @@ if (roadmapFAQs.length) {
|
||||
keywords={roadmapData.seo.keywords}
|
||||
noIndex={roadmapData.isUpcoming}
|
||||
jsonLd={jsonLdSchema}
|
||||
resourceId={roadmapId}
|
||||
resourceType='roadmap'
|
||||
>
|
||||
<!-- Preload the font being used in the renderer -->
|
||||
<link
|
||||
|
||||
@@ -49,7 +49,7 @@ if (bestPracticeData.schema) {
|
||||
datePublished: bestPracticeSchema.datePublished,
|
||||
dateModified: bestPracticeSchema.dateModified,
|
||||
imageUrl: bestPracticeSchema.imageUrl,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
---
|
||||
@@ -62,6 +62,8 @@ if (bestPracticeData.schema) {
|
||||
keywords={bestPracticeData.seo.keywords}
|
||||
noIndex={bestPracticeData.isUpcoming}
|
||||
jsonLd={jsonLdSchema}
|
||||
resourceId={bestPracticeId}
|
||||
resourceType='best-practice'
|
||||
>
|
||||
<!-- Preload the font being used in the renderer -->
|
||||
<link
|
||||
|
||||
Reference in New Issue
Block a user