Techletter #75 | June 1, 2024
How do you work with paths in nodejs?
In a node application, you can get the current working directory and current file name using __dirname
and __filename
globals.
const path = require('node:path');
console.log(path.parse(__dirname));
console.log(path.parse(__filename));
The file outputs will be as follows. (Right now I am using a Windows laptop, so the output will differ in a macOS system).
{
root: 'C:\\',
dir: 'C:\\Users\\prajwal\\Documents\\workspace',
base: 'node-examples',
ext: '',
name: 'node-examples'
}
{
root: 'C:\\',
dir: 'C:\\Users\\prajwal\\Documents\\workspace\\node-examples',
base: 'app.js',
ext: '.js',
name: 'app'
}
Link to the complete documentation: https://nodejs.org/api/path.html
What do you mean by a POSIX system?
A POSIX system is a term referring to an operating system that adheres to the standards set by POSIX, which stands for Portable Operating System Interface. These standards are designed to ensure compatibility between different operating systems, particularly Unix-like systems, by defining a common set of system and user-level interfaces, APIs, command-line shells, and utility interfaces.
Every week, I publish a newsletter sharing insights and lessons learned in the field of software engineering. If you haven’t subscribed yet, subscribe & joining our community of engineers! Feel free to share this with your colleagues or friends who are passionate about the field of software engineering.
What is the difference between an application load balancer & network load balancer?
Application Load Balancer(ALB):
Application load balancer operates at Layer 7 of the OSI model, the application layer. It inspects the details of each incoming HTTP request, allowing it to make routing decisions based on content in the request header. It is ideal for container-based and microservices applications.
Network Load Balancer(NLB):
The network load balancer operates at Layer 4, the transport layer. It routes connections based on IP protocol data and does not inspect the content of the request. NLB focuses more on forwarding requests without examining them in detail, providing faster responses for TCP and UDP traffic.
What is the difference between developer productivity and developer experience?
Developer productivity is more focused on the speed and efficiency of implementing changes to a codebase, the impact of these changes, and the satisfaction of developers with their tools and workflows.
It involves metrics like speed of development, impact of changes, and developer satisfaction with the tools and processes they use.
Developer experience (DevEx) refers to the overall technology, processes, and culture that shape the software development environment in an organization.
It emphasizes how well the engineering culture encourages quality work and how easy it is for developers to accomplish tasks, focusing on the satisfaction, empowerment, and efficiency of developers
Machine learning section
What is a vector database?
A vector database is a kind of database that is designed to store, index, and retrieve data points with multiple dimensions, which are commonly referred to as vectors.
Machines canβt read text or look at images like humans. They need input to be transformed or encoded into numbers. Vectors and matrices represent inputs like text and images as numbers so that we can train and deploy our models.
Link to the article
Archives:
- Compression Middleware β³, Package Managers π¦, Django π§π»βπ», ML π€
- Shrortest Distnace π°, clean code π¨π»βπ», TCP π§, ML π€
- Distributed Systems π», getters & setters π οΈ, constructors π·, | | βοΈ ??
- Cognitive load π§ , Health for SE π§π»ββοΈ, child process π€ VS worker threads π·ββοΈ