✨ Concurrency vs Parallelism
⚡️ Concurrency means that an application is making progress on more than one task - at the same time or at least seemingly at the same time.
⚡️ Parallel execution is when a computer has more than one CPU or CPU core, and makes progress on more than one task simultaneously.
⚡️ If multiple CPUs are running multiple threads, the process is Parallel Concurrent.
➖➖➖➖➖➖
📚 Article: [here]
🎬 YouTube Video: [here]
➖➖➖➖➖➖
#systemDesign #computerScience
🖥 Follow @devDastan for more content.
➖➖➖➖➖➖
➖➖➖➖➖➖
#systemDesign #computerScience
Please open Telegram to view this post
VIEW IN TELEGRAM
👍12❤8
This media is not supported in your browser
VIEW IN TELEGRAM
✨ Multiple Window 3D Scene Using Three.JS
💥 This project demonstrates a unique approach to creating and managing a 3D scene across multiple browser windows using Three.JS and localStorage.
➖➖➖➖➖➖
💻 GitHub Repository: [here]
➖➖➖➖➖➖
#threeJS #GitHub
🖥 Follow @devDastan for more content.
➖➖➖➖➖➖
➖➖➖➖➖➖
#threeJS #GitHub
Please open Telegram to view this post
VIEW IN TELEGRAM
❤8🤯8👍2
✨ Soft Skill Quote
💬 Onboarding yourself and reading the documentation can also give you a fresh perspective.
Just like the person in the air freshener commercial who can’t smell their own smelly apartment, the more you interact with a software system, the more biased you become.
A new perspective can make all the difference in identifying problems and solutions that others may miss.
➖➖➖➖➖➖
#softSkill #softwareEngineering
🖥 Follow @devDastan for more content.
Just like the person in the air freshener commercial who can’t smell their own smelly apartment, the more you interact with a software system, the more biased you become.
A new perspective can make all the difference in identifying problems and solutions that others may miss.
➖➖➖➖➖➖
#softSkill #softwareEngineering
Please open Telegram to view this post
VIEW IN TELEGRAM
❤12👍3
✨ Object.freeze vs Object.seal in JavaScript
❓ Object.seal prevents adding and/or removing properties from the sealed object and makes every existing property non-configurable.
❓ Object.freeze does Exactly what Object.seal do, plus It prevents modifying any existing properties.
❗️ There are Object.isFrozen() and Object.isSealed() methods to check if an object is frozen or sealed.
➖➖➖➖➖➖
📸 Image Credit: [here]
📖 Stack Overflow Answer: [here]
➖➖➖➖➖➖
#JavaScript #Programming
🖥 Follow @devDastan for more content.
➖➖➖➖➖➖
➖➖➖➖➖➖
#JavaScript #Programming
Please open Telegram to view this post
VIEW IN TELEGRAM
👍15❤9😎3🍌1
✨ JavaScript's Garbage Collection
ℹ️ The garbage collector in JavaScript is responsible for reclaiming memory occupied by objects that are no longer needed. This mechanism is done using mark-and-sweep algorithm.
ℹ️ The mark-and-sweep algorithm consists of two main phases:
1️⃣ Marking: Garbage collector marks reachable objects from the global object, ensuring none are left unmarked if reachable from a rooted object.
2️⃣ Sweeping: Garbage collector reclaims memory from unmarked objects, freeing it up for future use.
📕 Learn more about the JS's garbage collector's mechanism and best practices on the Medium I have written.
➖➖➖➖➖➖
📚 Article (Written by me!): [here]
➖➖➖➖➖➖
#JavaScript #Algorithm
🖥 Follow @devDastan for more content.
➖➖➖➖➖➖
➖➖➖➖➖➖
#JavaScript #Algorithm
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤7🤯1
➖➖➖➖➖➖
➖➖➖➖➖➖
#JavaScript #computerScience
Please open Telegram to view this post
VIEW IN TELEGRAM
👍13❤5
We will learn about the security concerns for each layer in the next post. Stay tuned!
➖➖➖➖➖➖
➖➖➖➖➖➖
#network
Please open Telegram to view this post
VIEW IN TELEGRAM
👍6❤5😎3🤯1
Physical Layer: Sniffing
Data Link Layer: Spoofing
Network Layer: Man-in-the-Middle (MITM)
Transport Layer: Reconnaissance
Session Layer: Hijacking
Presentation Layer: Phishing
Application Layer: Exploit
We will learn how we can prevent our website from some of these attacks in future posts!
➖➖➖➖➖➖
➖➖➖➖➖➖
#network #security
Please open Telegram to view this post
VIEW IN TELEGRAM
❤11👍4
const counter = new Signal.State(0);
// Read the value of Signal
console.log(counter.get()); // Output: 0
// Change the value of Signal
counter.set(1);
console.log(counter.get()); // Output: 1
ref in VueJS, understanding Signals should pose no challenge.➖➖➖➖➖➖
➖➖➖➖➖➖
#JavaScript #EcmaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤4🤯2
✨ Software Engineering Quote
💬 In software development, “perfect” is a verb, not an adjective. There is no perfect process. There is no perfect design. There are no perfect stories. You can, however, perfect your process, your design, and your stories.
🔣 Kent Beck
➖➖➖➖➖➖
#Agile #softwareEngineering
🖥 Follow @devDastan for more content.
➖➖➖➖➖➖
#Agile #softwareEngineering
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤7🤯2
function Car() {
this.make = 'Lamborghini';
return { make: 'Maserati' };
}
const myCar = new Car();
console.log(myCar.make);➖➖➖➖➖➖
#JavaScript #Quiz
Please open Telegram to view this post
VIEW IN TELEGRAM
🤯10👍9❤4
Promise.all and Promise.allSettled are two methods provided by JavaScript's Promise API, but they have different behaviors and use cases.Waits for all promises to resolve or rejects immediately if any promise rejects. Resolves with an array of resolved values.
Waits for all promises to settle (resolve or reject) and always resolves. Returns an array of objects representing the outcomes of the promises, including their status and value/reason.
➖➖➖➖➖➖
➖➖➖➖➖➖
#JavaScript
Please open Telegram to view this post
VIEW IN TELEGRAM
❤8👍3
➖➖➖➖➖➖
➖➖➖➖➖➖
#systemDesign #api
Please open Telegram to view this post
VIEW IN TELEGRAM
❤9👍5
Build complex string types using dynamic expressions within backticks.
type Endpoint = `/users/${number}`;
const validEndpoint: Endpoint = '/users/123';
// const invalidEndpoint: Endpoint = '/posts/456'; // Error: Type '"/posts/456"' is not assignable to type 'Endpoint'
representing API responses, URL patterns, or validation formats.
➖➖➖➖➖➖
#TypeScript
Please open Telegram to view this post
VIEW IN TELEGRAM
👍7❤3
num?const num = parseInt('7*6', 10);For example, in "78", only "7" is valid, so it parses it into the decimal 7, ignoring the "" and "8". Thus, num now equals 7.
➖➖➖➖➖➖
#JavaScript #Quiz
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8🤯5
import { useState } from 'react';
function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>Click me</button>
</div>
);
}import { useRef } from 'react';
function InputFocus() {
const inputRef = useRef(null);
function handleFocus() {
inputRef.current.focus();
}
return (
<div>
<input ref={inputRef} />
<button onClick={handleFocus}>Focus Input</button>
</div>
);
}- State is immutable
- Avoid reading/writing refs during rendering
- Both persist data and have different update behaviors
➖➖➖➖➖➖
➖➖➖➖➖➖
#JavaScript #ReactJS
Please open Telegram to view this post
VIEW IN TELEGRAM
👍11😎1
Utilize functions that take and return types, enabling powerful abstractions like generic type predicates and type builders.
type IsStringLiteral<T> = T extends string ? true : false;
function logIfString<T>(value: T): T extends string ? void : T {
if (IsStringLiteral<T>) {
console.log(value);
}
return value;
}
Creating dynamic component that have multiple states and behaviors.
➖➖➖➖➖➖
#TypeScript
Please open Telegram to view this post
VIEW IN TELEGRAM
👍6❤3
const user = {
email: "mail@hmouasvi.dev",
updateEmail: email => {
this.email = email;
}
}
user.updateEmail("new@hmousavi.dev")
console.log(user.email)mail@hmousavi.devnew@hmousavi.dev➖➖➖➖➖➖
#JavaScript #Quiz
Please open Telegram to view this post
VIEW IN TELEGRAM
👍9🤯5❤4
✨ Software Engineering Quote
💬 Programs must be written with the idea that they will be read by people, and only incidentally for machines to execute.
🔣 Harold Abelson
➖➖➖➖➖➖
#Agile #softwareEngineering
🖥 Follow @devDastan for more content.
➖➖➖➖➖➖
#Agile #softwareEngineering
Please open Telegram to view this post
VIEW IN TELEGRAM
❤9👍5
/* Child combinator: selects direct children of an element */
.parent > .child {
color: red;
}
.faq-item:nth-of-type(odd) .faq-question{
background-color: #fff; /* For odd items
*/
} .faq-item:first-of-type .faq-question {
border-top: 2px solid #007BFF;
}:first-letter, ::first-line):/* ::after used to display "+" symbol */
.faq-question::after {
content: '+';
color: #00ad8f;
font-size: 1.4em;
}
.faq-item[data-category^="important"] .faq-question {
color: #E91E63;
}➖➖➖➖➖➖
➖➖➖➖➖➖
#css
Please open Telegram to view this post
VIEW IN TELEGRAM
👍6🤯3❤2😎1
Shape types based on conditions, creating dynamic type hierarchies. For example, defining a type that’s an
object with specific properties depending on a provided string value.
type Config = {
type: 'basic' | 'advanced';
};
type BasicConfig = Config & { type: 'basic' };
type AdvancedConfig = Config & { type: 'advanced' };
function configure(config: Config): void {
if (config.type === 'basic') {
console.log('Applying basic configuration');
} else {
console.log('Applying advanced configuration');
}
}Useful for strategy patterns and implementing high-level business logic.
➖➖➖➖➖➖
#TypeScript
Please open Telegram to view this post
VIEW IN TELEGRAM
👍8❤5🤯2😎1