teleren/devto huggingface dataset:
Best EV Stocks in India - EV Penny Stocks India
Tags: evstocks, evshares, bestevshares
Published: 2023-11-22 17:07:23

When assessing [Best EV stocks](https://aliceblueonline.com/best-ev-stocks-in-india/), consider established companies with a strong market presence, a history of innovation, and positive financial indicators. Key players in the Indian EV sector include Tata Motors Limited, Mahindra & Mahindra Limited, and Hero MotoCorp Limited. However, their current rankings and performance metrics may have changed.

Always conduct thorough research and consider your investment goals and risk tolerance before making any investment decisions. The electric vehicle sector is dynamic, and market conditions can change rapidly.
Union & intersection types in TS
Published: 2023-11-22 16:57:40

In TypeScript, union types and intersection types are ways to combine multiple types to create new types with specific characteristics.
Union Types (|):

A union type allows a variable to have one of several types. It is represented using the | symbol.

```js
// Union type
type MyType = string | number;

let value: MyType;
value = "Hello"; // Valid
value = 42;      // Valid
// value = true; // Error: Type 'boolean' is not assignable to type 'string | number'.

```

Intersection Types (&):

An intersection type combines multiple types into one, allowing an object to have all properties from each type. It is represented using the & symbol.

```js
// Intersection type
type Point2D = { x: number; y: number };
type Point3D = { z: number };

type Point = Point2D & Point3D;

const point: Point = { x: 1, y: 2, z: 3 };

```

Union Types vs. Intersection Types:

    Union Types:
        Represents a value that can be one of several types.
        Uses the | symbol.
        The value can be of any type in the union.

    Intersection Types:
        Represents a value that has all properties of multiple types.
        Uses the & symbol.
        The value must have all the properties of all types in the intersection.

Example of Using Both:

```js
type A = { foo: number };
type B = { bar: string };

// Union type
type UnionType = A | B;
let unionValue: UnionType;

unionValue = { foo: 42 };  // Valid
unionValue = { bar: "hello" };  // Valid
// unionValue = { foo: 42, bar: "hello" };  // Error: Object literal may only specify known properties, and 'bar' does not exist in type 'A'.

// Intersection type
type IntersectionType = A & B;
let intersectionValue: IntersectionType;

intersectionValue = { foo: 42, bar: "hello" };  // Valid
// intersectionValue = { foo: 42 };  // Error: Property 'bar' is missing in type '{ foo: number; }' but required in type 'B'.


```
Correct exception names in Javascript
Tags: javascript
Published: 2023-11-22 16:56:04

If you have your own exception hierarchy in the app you probably noticed your perfectly named exceptions show like this in the console or [Sentry](https://sentry.io/): `Error: something happened and I don't like it`. The `Error` prefix is the name of the exception. I would expect something like this `MalformedData: I like different data more. Got: "bad data"`.

The trick is to set a `name` attribute of the `Error`. People do it in every exception in constructor like this.

```ts
export class AppException extends Error {}

export class ResourceNotFound extends AppException {
  constructor(
    public resource: string,
    public id: unknown,
  ) {
    super(`The resource '${resource}' with id ${id} is not found.`);
    this.name = 'ResourceNotFound';
  }
}

export class MalformedData extends AppException {
  constructor(data: unknown) {
    super(`I like different data more. Got: ${JSON.stringify(data)}`);
    this.name = 'MalformedData';
  }
}
```

It is very repetitive and you can forget to do it easily. Also, if you don't need a special constructor for your exception it adds some boiler plate. It can be shortened by setting the name directly:


```ts
export class ResourceNotFound extends AppException {
  override readonly name = 'ResourceNotFound';
}
```

But the ultimate solution for me is to set it once in the top-level exception and let it be derived automatically. Setting it to `readonly` prevents people overwriting it too.

```ts
export class AppException extends Error {
  override readonly name = this.constructor.name;
}
```
NFT ID Generation on the XRP Ledger: fixNFTokenRemint Amendment
Tags: xrp, blockchain, xrpl
Published: 2023-11-22 16:55:30

The ‘[fixNFTokenRemint](https://xrpl.org/known-amendments.html#fixnftokenremint)’ amendment is a protocol change designed to enhance the integrity of [NFTs (Non-Fungible Tokens)](https://xrpl.org/non-fungible-tokens.html) on the XRP Ledger. While it may not appear to be a significant change, it addresses a critical issue—avoiding situations where the same NFT is minted multiple times with the same sequence number, which could lead to collision scenarios.

This amendment currently has support from a supermajority of validators and could become enabled as soon as 2023-11-27 (UTC).

For developers working with NFTs on the XRP Ledger, this proposed amendment is important. It’s all about changing how NFT IDs are calculated, and it’s worth delving deeper into what this means for your work.

###Impact on NFT Sequence Numbers###
The core of the **fixNFTokenRemint** amendment changes how NFT sequence numbers are constructed. If you currently generate NFT IDs manually during the minting process, instead of fetching them from the ledger, it’s time to make some code adjustments.

When the amendment becomes enabled, NFT IDs will be created using a new "FirstNFTSequence" field of accounts, based on the account's sequence number when it first mints an NFT, instead of NFT's sequence number always starting from 1. This prevents an NFT from having the same sequence number as a previously-minted NFT if the issuer's account were deleted and re-created.

So, what actions should you take as a developer to adapt to this amendment?

###Updating Your Code###
To get ready for the fixNFTokenRemind amendment, you need to get NFTokenID values in a way that uses the FirstNFTSequence field if it exists. However, not all XRPL NFT projects will be affected. You can rest easy if your project falls under any of these conditions:

You are already using the [‘getNFTokenID’ function](https://js.xrpl.org/functions/getNFTokenID.html) of the xrpl.js library, or the equivalent function in the xrpl-py or xrpl4j libraries.
Your project reads the nftoken_id field from transaction metadata.
You calculate the NFTokenID by comparing the difference between the NFTokenPage object in the metadata. 

If your project aligns with any of these categories, you won’t need to make any code changes. 

###Take Action Now###
Being proactive is important. The ‘fixNFTokenRemint’ amendment is currently in the active voting phase, and could be enabled as early as November 27th (UTC). This could potentially impact your project and its users. To ensure a seamless transition, you should double-check your code and make any necessary adjustments before that time.
Kamal Acharya Biography
Published: 2023-11-22 16:44:35


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c0puvbm3eoj0751hmdg8.jpg)
Kamal Acharya is a Nepalese Author, Researcher and Programmer at Tribhuvan University. He has passed master of science and information technology from Tribhuvan University. He like to do a social work as well as help for those people who are helpless.

Hey there! I'm Kamal Acharya, a passionate individual who wears multiple hats throughout the day. I'm an accomplished author, a curious researcher, a tech-savvy programmer, and a dedicated professor at the esteemed Tribhuvan University.

I hold a Master's degree in Science and Information Technology from the very same university that I now proudly serve. Learning never stops, and I thrive on exploring new knowledge and sharing my wisdom with enthusiastic minds.

But that's not all! Beyond academia, my heart lies in making a difference. I am actively involved in various social causes, aiming to lend a helping hand to those in need. Together, let's bring positivity and support to the lives of the less fortunate.

I'm glad you stumbled upon my profile! If you're interested in all things literature, research, programming, or simply looking to connect with someone with a passion for social work, hit that follow button and let's embark on this incredible journey together!

Connect with me on LinkedIn for more exciting updates and meaningful discussions. Let's make the world a better place, one step at a time!
Wednesday Links - Edition 2023-11-22 🦃
Tags: java, jvm, spring, microservices
Published: 2023-11-22 16:43:34

Spring Framework 6.1 goes GA (1 min)🎉
https://spring.io/blog/2023/11/16/spring-framework-6-1-goes-ga

Patterns For The Design Of Microservices – Part 3 (5 min)🐾
https://foojay.io/today/patterns-for-the-design-of-microservices-part-3/

Custom JFR Events: A Short Introduction (2 min)🍱
https://mostlynerdless.de/blog/2023/11/20/custom-jfr-events-a-short-introduction/
HOW TO CREATE A WEB SERVER AND INSTALL SERVER ROLE ON A WINDOW VIRTUAL MACHINE
Tags: azure, cloudcomputing, programming, learning
Published: 2023-11-22 16:43:34

## STEPS
Once you are connected to your machine using remote desktop protocol(rdp) file and you are now on the desktop page, you can test your virtual machine for web server by copying the the public ip address and running it on a browser. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssqmszjvxyf6o2m4gr0i.png)
This will fail because web server has not been installed.
The following steps will install web server on your virtual machine
- Click on windows logo
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20ssh6dqw8dwhxs7xsta.png)
- search for powershell and run it as administrator by right clicking on it and selecting run as administrator
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxj4ebpxr0ycnznba94t.png)
- Once the powershell pane opens type in the following code:Install-WindowsFeature Web-Server.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ev18x56sog1shfscnag6.png)
Note that it is case sensitive.

- Start installation will be displayed
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7m17limcjuf4321m07cw.png)
- After Installation, you will see this
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iiaclsnbkf9h5hfaxr34.png)
- You can now test it again by copying the public ip address and searching it on a browser
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/717obwvfu2l7lxaiz1hb.png)
- This time around, windows server will be displayed showing Internet Information Service
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gn6knhu010xfnexkppyu.png)
HOW TO INSTALL NGINX WEB SERVER ON LINUX VIRTUAL MACHINE
Tags: linux, azure, programming, beginners
Published: 2023-11-22 16:43:15

## Introduction
NGINX is a popular open-source web server known for its high performance, reliability, and scalability. Initially released in 2004, it has since gained widespread adoption and is commonly used as a web server, reverse proxy server, load balancer, and HTTP cache.

## Installing Nginx web server
After creating linux virtual machine, you can install Nginx web server using the following steps:
1. Find out what IP address your Linux virtual machine is publicly known as using the code:
az vm list-ip-addresses --name MyVM --output table.
The name of the virtual machine created virtual machine is MyVM
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5d98rd39phikbnns5xyj.png)
2. After obtaining the Public IP address from the previous step, establish an SSH connection to MyVM using the code 
ssh azureuser@ip-address

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gbah8b2ze8kytuvmz5f2.png)
3.To install the nginx web server, enter the following command after logging into the virtual machine. It will take a few moments to finish the command.
sudo apt-get -y update && sudo apt-get -y install nginx
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrj7toyhwmli0qvyk4eq.png)
4. quit the secure shell using the code 
exit
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd2h6p4toebiyabtjpw9.png)

## How to get default webpage
1. To access the default page from your Linux web server using curl in Azure Cloud Shell, use the following command, changing <PublicIPAddress> to the public IP you previously discovered. Another option is to try opening a new tab in your browser and accessing the public IP address.
curl -m 80 <PublicIPAddress>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98d25r8ai5h3zecxdtgo.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fzb8334yzvqvnm4000i.png)
The reason this command fails is that the network security group that protects the virtual machine's network connectivity does not allow the Linux virtual machine to expose port 80 (http). By using the Azure CLI command vm open-port, we can resolve the issue.
2. To open port 80 in Cloud Shell, enter the following command:
 az vm open-port \
 --port 80 \
 --resource-group MyResourceGroup \  
 --name MyVM

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rr9ijxrrjdg3w7auqh6m.png)
3. Use the curl command once again.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hncmdva556auwisjc5ov.png)
This time, the following data should be returned. The page is also visible in a browser by searching the ip address in a browser.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6l2qovrwehair17l0op.png)
HOW TO CREATE A VIRTUAL MACHINE WITH AZURE CLI
Tags: cli, cloudcomputing, azure, beginners
Published: 2023-11-22 16:42:46

## What is Azure CLI?
Microsoft's cross-platform command-line tool for controlling Azure resources is called Azure CLI. It is accessible via the Azure Cloud Shell browser or on macOS, Linux, and Windows.

You may use the Azure CLI to manage Azure resources from scripts or the command line, including virtual machines and storage. Now let's use Azure Virtual Machines to create virtual machine.

## How to create a Linux VM with the Azure CLI
- Log into your Azure account
- once logged in click CloudShell

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4cjsc5jafqbjy64fhve.png)

- Change the terminal to bash if it is on PowerShell

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vspurvq2c42z4c1e6454.png)
- Create a Resource Group by using the code: 
az group create --name MyResourceGroup --location eastus

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho89j13hnh2bixuhr5fs.png)
This will create a resource group labelled as MyResourceGroup where your Virtual Machine will be located. Replace MyResourceGroup with your desired resource group name and eastus with your preferred Azure region.

- Create the Virtual Machine the following code:
az vm create \ 
--resource-group MyResourceGroup \
--name MyVM \
--admin-username azureuser \
--image Ubuntu2204 \
--generate-ssh-keys \
--verbose
NOTE:
--resource-group: Specify the resource group you created in the previous step
--name: Choose a name for your VM (e.g., MyVM).
--image: Specify the OS image for the VM. In this example, we use Ubuntu 22.04.
--admin-username: Set the admin username for SSH access.
--ssh-key-value: Provide the path to your public SSH key for authentication.

- Monitor VM Creation: The Azure CLI will provide feedback on the VM creation process, including its status. Once the VM is created, you'll see information about the VM, including its public IP address.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzmutpakl9eb62dftp64.png)
- Access the Virtual Machine.


## How to connect to the created VM using SSH
With the Secure Shell (ssh) tool, we can easily verify that the Linux virtual machine (VM) is operational by using its public IP address. Recall that we need to specify that because we set our admin name to azureuser. Use the public IP address that comes from the instance that is currently executing.
ssh azureuser@public-ip
Replace azureuser with your username and public-ip with the VM's public IP address.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2sd8fqpgmrg53dl30g5t.png)
The virtual machine system information will also be displayed

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ye2ox9owx0ta05rdapvn.png)
You can also confirm the Virtual Machine by logging into Azure portal and searching for the resource group the VM is located.
The Importance of Testing in Software Development
Tags: webdev, testing, unittest, programming
Published: 2023-11-22 16:03:38

### Introduction

Testing is a cornerstone of modern software development, playing a crucial role in ensuring the quality and reliability of software products. Beyond its technical aspects, testing embodies a philosophy that impacts the approach to software development. This article explores why testing is so popular in the industry and why it is often said that good developers are, first and foremost, good testers.

### The Rising Popularity of Testing

Testing has become increasingly important in the software industry for several reasons:

1. **Complexity of Modern Software**: As software systems become more complex, the likelihood of bugs increases. Testing helps manage this complexity by systematically identifying and addressing issues.
2. **User Expectations**: Today’s users expect high-quality, bug-free software experiences. Testing is critical in meeting these expectations and maintaining user trust.
3. **Economic Factors**: The cost of fixing bugs post-release is significantly higher than addressing them during development. Effective testing reduces these costs.

### Good Developers as Good Testers

The adage that good developers are also good testers stems from several key insights:

1. **Understanding of the Codebase**: Good developers have a deep understanding of the software they are building. This knowledge is invaluable in creating effective test cases.
2. **Attention to Detail**: Testing requires meticulous attention to detail—a quality shared by excellent developers.
3. **Problem-Solving Skills**: Testing often involves not just identifying bugs, but also understanding their root cause. Good developers excel at this analytical and problem-solving aspect.
4. **Quality Focus**: A developer who tests effectively is inherently more focused on the quality and usability of the software, aligning with the primary goals of software development.
### The Philosophy Behind Testing

Testing in software development is not just a technical task; it’s a mindset. This philosophy includes:

1. **Proactive Problem Solving**: Anticipating and solving problems before they impact the end-user.
2. **Continuous Improvement**: Regular testing leads to continuous feedback and improvement in the software.
3. **Risk Mitigation**: Identifying potential risks and addressing them early in the development cycle.
4. **User-Centric Approach**: Focusing on delivering a product that meets or exceeds user expectations.

### Conclusion

Testing is much more than a phase in the development process—it is a fundamental aspect of a good developer’s mindset. It encompasses a proactive approach to problem-solving, continuous improvement, and risk mitigation. By embracing the philosophy of testing, developers not only enhance their technical skills but also contribute significantly to the creation of high-quality, user-centric software products. This philosophy underpins why testing is central to the software industry and why the best developers are often those who excel in testing.
Tech Lead job opportunity!
Published: 2023-11-22 16:13:08

We are committed to creating 𝗵𝗶𝗴𝗵-𝗽𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 𝗮𝗻𝗱 𝘁𝗮𝗶𝗹𝗼𝗿𝗲𝗱 𝘀𝗼𝗹𝘂𝘁𝗶𝗼𝗻𝘀 for the most complex challenges.
And 𝘄𝗲'𝗿𝗲 𝗹𝗼𝗼𝗸𝗶𝗻𝗴 𝗳𝗼𝗿 𝗮 𝘁𝗲𝗰𝗵𝗻𝗼𝗹𝗼𝗴𝘆 𝗲𝗻𝘁𝗵𝘂𝘀𝗶𝗮𝘀𝘁 𝘁𝗼 𝗷𝗼𝗶𝗻 𝗼𝘂𝗿 𝘁𝗲𝗮𝗺 𝗮𝘀 𝗮 𝗧𝗲𝗰𝗵 𝗟𝗲𝗮𝗱! 😉 If you're passionate about cloud, Python, and team leadership, keep reading because this might be the perfect opportunity for you! 👇
 
As a Tech Lead, your key responsibilities will include:
 
- Technical leadership and team supervision
- Collaborating on software and cloud project architecture and implementation
- Proficiency in AWS, Python, CI/CD, Containerization, and IaC tools
- Ensuring projects are delivered on time and to quality standards
 
If you're looking to be part of a team that's passionate about technology and innovation, send your resume or get in touch with us to learn more about this exciting opportunity! 👉 https://lnkd.in/d-9_p-Gd
 
#lifeatcocus #TechLead #AWS #Python #Innovation #JobOpportunity #itjob
Should I get an M3 iMac, an M1 iMac, an M2 Mac Mini, or something else?
Tags: discuss, apple, workstations, watercooler
Published: 2023-11-22 16:09:34

It's time for me to get a new desktop and I could use a hand choosing the right one! I recently got a [beautiful blue 5th generation iPad Air](https://www.apple.com/shop/buy-ipad/ipad-air/64gb-blue-wifi) and I love it. Apple has been calling my name ever since, so that's the direction I'm currently headed.

My plan for whatever Mac I purchase is to primarily use it for music production. My DAW of choice is [Ableton Live](https://www.ableton.com/en/) and I'm hoping to upgrade to version 12 soon. I also have a [Behringer XR18 mixer](https://www.behringer.com/product.html?modelCode=P0BI8) and aim to use it as an audio interface with my new computer. I'm not really sure how much of a [VST guy](https://en.wikipedia.org/wiki/Virtual_Studio_Technology) I am... I've yet to use many, but I hear that these can be somewhat heavy on your resources. In any case, I'd like to have the option to use some VSTs when the time comes. I'd also like to be able to smoothly send MIDI signals from my computer so that I can send sequences to my synths, trigger loops or samples, and sync all the clocks across my different devices.

The iMac is alluring to me because it's an all-in-one machine with a really cool design aesthetic. While the M3 is super tempting (my FOMO alarm 🚨 is sounding off), I'm actually leaning toward the M1 because I think it should be powerful enough to do all I need, it'll save me a good bit of money, and the design is essentially identical.

Meanwhile, I could get more bang for my buck from a Mac Mini — it has more reasonable ports and better specs than the the iMac — but I'd need to get a good display; I already have an extra keyboard and mouse, though I'm not in love with them. And, while the Mac Mini is nice and compact, the design just isn't as exciting to me. I'm also not so sure that I need the extra horsepower. I'm not doing video editing... _yet_.

Any suggestions or things to keep in mind as I make this decision? Thoughts on RAM? I'm curious if 8GB will do me or if I should go for 16GB... Anybody own one of these machines and wanna share their experience? Have y'all seen any good Black Friday deals that I should be aware of? Thoughts on buying a computer second-hand? Any PC fans wanna try to knock some sense into me? 🤜😅

Appreciate y'all's help!
Paracetamol.js💊| #219: Explica este código JavaScript
Tags: javascript, web3, spanish, beginners
Published: 2023-11-22 15:54:16

## **<center>Explica este código JavaScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark></center>

```js
const str1 = 'Saturday night plans';
console.log(str1.startsWith('Sat'));
```

- A. `false`
- B. `true`
- C. `-1`
- D. `0`

---

Respuesta en el primer comentario.