teleren/devto huggingface dataset:
Creating internet gateway and public subnet and we will attach it to the VPC
Published: 2023-03-06 13:24:15

Before we can attach the internet gateway and public subnet  to the VPC ,  we need to create the VPC(VIRTUAL PRIVATE CLOUD ) modules.

Here is an example of a vpc modules,


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

this particular module will creates a Virtual Private Cloud (VPC) resource in AWS. The  "vpc_cidr_block" is the IP address range that the VPC will use, and "vpc_name" is a name that will be assigned to the VPC as a tag.  The "aws_vpc" resource block is where the VPC will  actually be created. 

next we need to create an internet gateway modules and here is an examples of an internet gateway modules,



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

This Terraform module creates an Internet Gateway  resource in AWS. In this module, the aws_internet_gateway resource is created, and it is associated with a VPC specified by the vpc_id attribute. 
Remember internet gateway allow communication between instances in your VPC and the internet, so to associate your internet gateway to your vpc , you always need the vpc_id in your internet gateway modules. Overall, this module creates an Internet Gateway  resource and associates it with a VPC, which is necessary for enabling internet access to resources in the VPC. 

Next we need to create a public subnet, we can also have a private   subnet which will be my next post with route tables but we are creating public subnet in this lecture and here is an example


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

Before explanation, what is subnet? A subnet, short for "subnetwork," is a portion of a larger network that has been divided into smaller, more manageable sections.  In this case, the subnet is created in a public VPC, which means that it has access to the internet via  an internet gateway. 

The aws_subnet resource is used to create the subnet. It requires the VPC ID (which is specified in a separate resource called aws_vpc.main), the CIDR block (which is specified in a variable called var.public_subnet_cidr_block), and the availability zone (which is specified in a variable called var.availability_zones[0]).  The tags block is used to assign a name to the subnet for easier identification.

Overall, this module is a simple way to create a public subnet in an AWS VPC, which can be useful for hosting public-facing resources like web servers or load balancers.
Suma Soft’s Exception Handling Services for OCR Projects.
Published: 2023-03-06 13:22:37

Suma Softs offers high quality OCR Data Extraction & Manual Exception Handling service that helps your business to meet their goals effectively. It’s the most important thing to improve your business growth, increase your revenue and make you more efficient. Our OCR Data Extraction process has evolved over the years, so now we offer great accuracy on standard forms as well as non-standard forms along with much economical solutions.
 
●With our cutting-edge software and tight security measures, you can trust your data is safe. Our platform has been used by hundreds of brokers and medical professionals 
●Our platform eliminates the need for a manual effort by electronically generating appraisal Reports, LE, CD, Tax forms, and other documents commonly used in the US Mortgage industry. Additionally, our platform also provides automated solutions for ADA Dental forms, NCPDP forms, and Statement of Pharmacy Services.

Contact us at sales@sumasoft.com or call +91-20-40130400 to unlock your growth potential with Suma Soft now!


Website:
https://www.sumasoft.com/business-services/exception-handling-services-for-ocr-projects/
AWS Codebuild - List all projects and output into a file.
Published: 2023-03-06 13:17:18

Hey there! So, I recently had to tackle the challenge of identifying all of our AWS CodeBuilds that were using soon-to-be-deprecated Linux images. Given the large number of builds in our project, manually sifting through each one would have taken forever.

To save time, I turned to the AWS CLI and crafted a command that would help me list out all of our CodeBuilds alongside their corresponding Linux images. This way, I could quickly identify the builds that needed updating.

Here's the command I used:

```bash
aws codebuild list-projects | jq '.projects[]' | xargs -I{} sh -c 'aws codebuild batch-get-projects --names "$1" | jq -r "\"\(.projects[].name) : \(.projects[].environment.image)\"" ' _ {} >> list.txt

```

It's a bit of a mouthful, but essentially what it does is use the list-projects command to fetch all CodeBuild projects, pipe them to jq to extract the project names, and then use xargs to pass each project name to the batch-get-projects command, which fetches the full project details including the Linux image. Finally, I used jq again to format the output as "project name : Linux image", and wrote the results to a file called list.txt.

Hope this helps you save some time too!
Introduction to Ensemble modelling
Tags: machinelearning, ensemble, xgboost, datascience
Published: 2023-03-06 13:11:54


**What is Ensembling?**

Ensembling is simply a way of aggregating predictions from different machine learning models with the hope of creating a much better model capable of generalizing well to new data.

Ensembling provides a sense of confidence in our predictions by leveraging the collective strength of multiple models. As living beings, we understand the concept of "unity in strength", the same principle also applies to machine learning models. By combining the strengths of individual models, ensembling can improve the accuracy and robustness of predictions.

![apes description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aprb0opy4mq2z6jtpugi.jpg)

---

Ensemble algorithms, such as random forest, XGBoost, CatBoost, and AdaBoost, utilize multiple weak learners to achieve impressive results. These weak learners are typically small decision trees with limited depth and features

---

### Types of Ensembles 

**Boostrapping aggregation** _(e.g random forest)_

This is also known as _bagging_, with this method , the model is trained on few "_boostrapped_" datasets  ,  bootstrapped datasets are basically  variants of the original training set but with repeated or missing samples. 


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

Multiple weak learners are trained on those bootstrapped datasets and a voting of corresponding predictions is carried out.

**Boosting**_(e.g catboost, xgboost)_

This also uses weak learners , but here the weak learners get better by correcting the errors of their preceding learners.
To visualize this , the data points are usually assigned equal weights , then a model is trained on those weights. The misclassified samples from the data are then assigned larger weights and then retrained, this done multiple times.


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

---

**Stacking**
In stacking, the predictions of several models are used as input to another model, called the meta-model. The meta-model is trained on the predictions of the base models to make the final prediction.

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

---

There are myraid of creative ways even outside of the popular methods in which one can ensemble two or more different models together. By combining models we tend to reduce their weaknesses and amplify their strengths.




Thanks for reading, Adios👋.
Hoisting in JavaScript
Published: 2023-03-06 13:11:48

JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code. Before execution, code is scanned for variable declaration, and for each variable, a new property is created in the variable environment object. The variable types in JavaScript have different ways in which they are hoisted. For instance, a variable declared with var is hoisted at the start of the function in which it is declared. When you try accessing the variable before its declaration, let's say for instance we console log the variable before declaration, a value of undefined is printed to the console. 

```
function food() {
    console.log(rice);
    const num = 2;
    if (num === 2) {
       var rice = "Rice";
    }
}
food()
```
From the above, value logged to the console will be undefined. Variable declared with var are function scoped, this means they can be accessed anywhere within the function they are defined.

Variable declared as let and const are block scoped, but they can only be accessed after they have been declared. The points within the block and above the declaration where they cannot be accessed is called the Temporal Dead Zone(TDZ). When you try accessing them within these zones, you will get an Uncaught ReferenceError: Cannot access the variable before initialization. This implies that they are not hoisted but rather can be accessed from the point of declaration to the end of their block.

```
function food() {
    const num = 2;
    if (num === 2) {
       console.log(rice);
       let rice = "Rice";
    }
}
food()
```
The output

```
Uncaught ReferenceError: Cannot access 'rice' before initialization
```
When rice variable is accessed above and outside the if block, the error will be 

```
Uncaught ReferenceError: rice is not defined
```

functions declarations are block scoped when using strict mode, but function scoped otherwise. They can be accessed above or below the point where they are declared with their initial value been the actual value of the function.
```
sum(2, 3);
function sum(a, b) {
    return a + b;
}
```
From the code above, the function was called before it was declared, the result returned will be 5.

with function expression, when a function is expressed with var keyword, and it is called before its declaration, it will return an Uncaught error. e.g.,

```
sum(2, 3);
var sum = function (a, b) {
    return a + b;
}
```
The display in the console will be:

```
Uncaught TypeError: sum is not a function
```
The reason being that since sum returns undefined when accessed before declaration, then sum(2, 3) is the same as writing undefined(2, 3) which leads to a TypeError. If you use let instead of var, you will get a ReferenceError.
```
sum(2, 3);
let sum = function (a, b) {
    return a + b;
}
```
The display in the console will be:

```
Uncaught ReferenceError: sum is not defined
```
The error the function expression returns depends on what variable type you used to assign to the function.
SQL Server conditional temp table definition
Tags: sqlserver
Published: 2023-03-06 13:09:46

When trying to insert into/create a temporary table in two different ways depending on the state of a variable using IF statements, you are going to run into trouble unless you know this trick.

WON'T WORK!
```sql
DECLARE @var INT
SET @var = 2

IF @var = 2
    SELECT *
    INTO #tmpTbl
    FROM sourceTable
    WHERE someVal = 1
ELSE    
    SELECT *
    INTO #tmpTbl
    FROM sourceTable
    WHERE someVal = 2

select * from #tmpTbl
```

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


Conditional logic in Sql Server can be annoying because the SQL parser doesn't parse through the logic and recognize you are not actually defining a temporary table twice.


Instead we have to do this hacky first line where the table gets defined but not populated.  Here the SELECT * into creates the table but the nonsensical 1=2 makes it so no lines are inserted.

```sql
select * into #tmpTbl FROM sourceTable WHERE 1 = 2  --defining table
DECLARE @var INT
SET @var = 2

IF @var = 2
    INSERT INTO #tmpTbl
    SELECT *
    FROM sourceTable
    WHERE someVal = 1
ELSE    
    INSERT INTO #tmpTbl
    SELECT *
    FROM sourceTable
    WHERE someVal = 2

select * from #tmpTbl
```
Now when we use INSERT INTO there is a created table with no rows that we can now use with our conditional inserts. 


The other approach is to use dynamic SQL which is given in this stack overflow answer.  In general I try to avoid dynamic sql if at all possible.

https://stackoverflow.com/questions/9573639/t-sql-insert-into-table-without-having-to-specify-every-column


Hope this helps!  I need to do a more thorough posting of all the nuances of stored procedures, conditional logic, functions, and dynamic sql.  If there is anything specifically confusing in that list this let me know and that may focus my blog efforts.
5 best AI's for writers and content creators
Tags: ai, webdev, tutorial, beginners
Published: 2023-03-06 13:08:25

Hi guys i was doing some digging recently and found something interesting i decided to share with you guys. With the recent boom in Artificial intelligence (AI) , there's been alot more options other than chatGpt ,which we can use to make our lives just a little bit easier .

Jasper.

Formerly known as Jarvis, Jasper is among the AI writing software tools leaders. Jasper acquired tools such as Headlime and Shortly AI writing software. Both tools remain standalone products at the writing of this article; however, both plan to integrate fully with it. Create your blogs, articles, book, scripts, and any other content. Choose a subject area and form, fill in the details, and Jasper will write the content for you. It’s not always good content, but it helps me get past my writer’s block. You guys should check it out.

 Sudowrite

Sudowrite is an AI writing tool that helps you generate content, rewrite existing content intoa new one,elaborate on something when you need more words, and brainstorm ideas. It’s one of the best ai content generator softwares and is user-friendly.

 Rytr

Rytr is a content writing platform that uses AI to write content for you. Rytr’s algorithms are trained on historical data, so they can produce unique and compelling articles with the right tone and style, while also being grammatically correct. Rytr’s AI writing assistant will have your article ready in less than an hour, without any need for human intervention. its current state, Rytr can produce text for a variety of topics and niches, including sports articles, business articles, reviews, blog posts, articles on technology, etc.Its actually great for beginners.

 WriteSonic

Writesonic is an AI authoring tool that can generate unique content based on your preferences and needs. The software also helps you by providing pre-written content, which you can use as an outline for your own writing.

It can also help content marketers push past writer’s block and reach their target audience. WriteSonic is the ultimate solution for writers who are struggling to come up with fresh content ideas.

**ChibiAI**

Chibi AI is an AI writing tool designed for writers who want to be able to focus on their writing, but have a little assistance when they get stuck. Chibi includes helpful tools that writers need such as rewriting, shortening, expanding, and changing the tone of the selected text. You’re able to select a “creativity mode” where the overall tone of the generated content changes. So that's all guys here the best five. They all have paid versions of you want to even get more into them . So let me know what you think , I'll try to get through all of them and crown the best . Have a nice week.
DotNET Training in Chennai
Tags: webdev
Published: 2023-03-06 12:59:08

[DotNET Training in Chennai](https://intellimindz.com/dot-net-training-in-chennai/) is designed to provide a comprehensive overview of the .NET framework and C# programming language. It covers the fundamentals of .NET development, such as the Visual Studio environment, data connections, C# language, and WinForms and WebForms projects. This course is ideal for those who are new to .NET development and want to gain a better understanding of the technology
I've done some hobby coding with a Quiz application (myquiz.app)
Published: 2023-03-06 12:46:45

---
title: I've done some hobby coding with a Quiz application (myquiz.app)
published: true
description: During my spare time, I love to have some hobby projects. In this case, I implemented a quiz application that we could use on Fridays at work when we always run a quiz at the end of the week.
tags:
cover_image: https://i.ytimg.com/vi/HKmpe_pwDs8/maxresdefault.jpg
---

{% youtube HKmpe_pwDs8 %}

During my spare time, I love to have some hobby projects. In this case, I implemented a quiz application that we could use on Fridays at work when we always run a quiz at the end of the week.
💡 ArticleCache - read past the paywall
Tags: startup, saas, browser, productivity
Published: 2023-03-06 12:02:36

Paywalls are everywhere. This newsletter has some!

One thing about the internet is that publishers often allow some traffic to view a link and read it's content, and paywall the content later (for example if the article is popular).

**💼 🧠 Build an extension that gets web surfers past paywalls**

The average person doesn't know what Reader Mode is (and they don't use Firefox).

**The opportunity here is to build a Chrome/Firefox add-on that activates on any site with a paywall and instantly gives people a way to travel to a version of the site without the paywall.**

[You won't be first to market](https://www.producthunt.com/products/bypass-paywalls/alternatives) (you don't want to be, anyway!), but the others that do it have not reached critical mass -- there's opportunity here.

This was [originally posted @ Unvalidated Ideas (Edition 45)](https://unvalidatedideas.com/editions/45)
How to get the current date time of other countries in JavaScript
Tags: javascript, beginners, programming, tutorial
Published: 2023-03-06 12:43:52

In our interconnected world, being aware of the date and time in other countries is crucial. Luckily, Javascript offers a simple solution for accessing this information. In this article, we'll demonstrate how to use Javascript to obtain the current date and time in other countries.

In this article, I will be using the USA as an example. So, let's get started!

### Step: 1 Create a new date object

The first step is to create a new Date Object. This new date object will represent the current date and time of your local timezone.

```javascript
const d = new Date();
```

### Step: 2 Get local time and offset

Next, we need to get the local time and offset of the current date and time in the local timezone.

#### What is the local time in Javascript?

The local time is the number of milliseconds since 1st January 1970 (UTC). The offset is the difference between the local time and UTC time.

```javascript
const localTime = d.getTime();
const localOffset = d.getTimezoneOffset() * 60000;
```

### Step 3: Calculate the UTC time

Now, we need to calculate the UTC time by adding the local time and the time offset.

```javascript
const utc = localTime + localOffset;
```

### Step: 4 Calculate the time for the country

Now, we can calculate the time for the country by adding the UTC time and the offset together.

```javascript
const offset = -5; // UTC of USA Eastern Time Zone is -05.00
const usa = utc + (3600000 * offset);
```

Note: Make sure to change the country offset as per your requirement.

### Step: 5 Get the current date and time for the USA

Finally, we can use the new Date() and toLocaleString() methods to get the current date and time for the USA in a human-readable format.

```javascript
const usaTimeNow = new Date(usa).toLocaleString();
```

Here's the complete code to get the current date and time of any country in Javascript:

```javascript
const d = new Date();
const localTime = d.getTime();
const localOffset = d.getTimezoneOffset() * 60000;
const utc = localTime + localOffset;
const offset = -5; // UTC of USA Eastern Time Zone is -05.00
const usa = utc + (3600000 * offset);
const usaTimeNow = new Date(usa).toLocaleString();
console.log(usaTimeNow);
```

### Conclusion

To sum up, you can easily obtain the date and time of any country by solely utilizing Javascript, without relying on external software or APIs.

I hope this article was helpful to you! Thank you for reading.

Cover Image Source: Unsplash
Running Your Node.js Backend on an AWS EC2 Machine: Making it Production-Ready
Published: 2023-03-06 12:21:07

# Running Your Node.js Express Backend on an EC2 Machine: Making it Production-Ready

If you're looking to run your Node.js Express backend on an EC2 machine, then there are a few key concepts that you should know to make it production-ready. In this post, we'll cover the most important concepts you need to know to make your backend reliable, scalable, and secure.

## Security

When running your Node.js Express backend on an EC2 instance, security should be your top priority. Here are a few best practices to follow:

- Use SSH key pairs for secure remote access
- Configure a firewall (Security Group) to restrict access to only the necessary ports
- Use SSL/TLS certificates to encrypt traffic
- Configure Identity and Access Management (IAM) roles to manage permissions for accessing AWS resources.

## Scalability

Scalability is crucial for any production-ready backend. To make sure your backend can handle a growing number of requests and users, you can use the following techniques:

- Use Elastic Load Balancing (ELB) to distribute incoming traffic to multiple EC2 instances running your Node.js Express app
- Use Auto Scaling to automatically add or remove instances based on demand.

## Monitoring

To ensure your backend is performing well, you should monitor key metrics such as CPU usage, memory usage, and network traffic. You can use AWS CloudWatch to collect and analyze these metrics and set up alerts for any abnormal behavior.

## High Availability

To minimize downtime in case of failures, you should design your backend for high availability. Here are some ways to achieve this:

- Use multiple Availability Zones (AZs) to host your EC2 instances
- Configure Elastic IP addresses to ensure that your instances have a consistent IP address even if they are stopped or restarted.

## Deployment / CICD

A well-defined and automated deployment process is crucial for making changes to your backend without causing downtime or introducing bugs. You can use tools such as AWS CodeDeploy  / Jenkins / github actions / gitlab ci to automate your deployment process.

## Logging

Proper logging is essential for debugging issues and investigating errors. You can use tools such as AWS CloudWatch Logs.

## Performance

Optimizing your backend for performance is critical to ensuring a smooth user experience. Here are a few ways to improve performance:

- Minimize database queries
- Optimize code
- Leverage caching solutions such as Redis or Memcached
- Use Amazon CloudFront to cache static assets and improve the performance of your application.

## Conclusion

By following these key concepts, you can ensure that your Node.js backend running on an EC2 machine is production-ready and can handle the demands of your users. Remember to prioritize security, scalability, monitoring, high availability, deployment, logging, and performance. With these key concepts in mind, you can be confident that your backend will be reliable, fast, and secure.