teleren/devto huggingface dataset:
Javascript Basics Part 2
Tags: javascript, codenewbie, basics, tutorial
Published: 2022-04-24 07:26:45

One of the most important building block of any application is a variable. Beginners usually get confused between variables and their values. 

```
var studentName = "Arya";

```
Here the var studentName is the variable and Arya is the value that is assigned to that variable.

One of the great tips that I received during my bootcamp classes was that think of a variable as labeled boxes with something placed inside of them. So, declaring a var without value is like having an empty box labeled without anything inside of it. But we know what exactly should we be filling inside the box. The contents of this box could be replaced with another contents. 

Always keep a clear mental separation between the concept of variables and their values. Variables are not values themselves, they help us hold or contain the values. 

In typical variable naming convention we don't use any special characters but we use something called as camel cased.Camel Case refers to the internal capital letters, which resemble the humps on a camel's back. For example, happinessProject, computerScience, and WordPress are all examples of CamelCase.

Another best practice is to declare the variable in the beginning of the application. This helps the application and ourselves to have an idea of what we are going to use, and what we are planning to modify. Declaring a variable as I said before just gives us an empty container, it doesn't have any meaning since there is no values assigned to the variable. If we redeclare the same variable name twice, it just means we have thrown the first one in trash or that it is of zero importance now since we have redeclared it to a different value. 

We are declaring the variable because that makes it possible for us to reuse them throughout our application.
How to Install WPForms Pro plugin on WordPress
Published: 2022-04-20 14:02:29


**Downloading the WPForms Plugin**

To get started, first log in to your WPForms account. Once you’ve logged in, click on the Downloads tab.
This will show you a page with all of your available licenses. To download the plugin, click on the Download WPForms button next to one of your licenses. This will save a zipped file of the WPForms plugin to your computer.
For now, you don’t have to download any of the addons, since you’ll be able to easily install and activate addons from inside your WordPress dashboard later.

**Installing WPForms on Your Site**

Once you’ve downloaded your zip file, go ahead and navigate to the site where you’d like to install WPForms. Then, inside the admin dashboard, go to Plugins » Add New and click the Upload Plugin button.
From here, you’ll see the option to upload the plugin. Click on the Choose File button and select the WPForms zip file you just downloaded.
After your file is uploaded, click on the Install Now button.
This will begin the installation process for you. Once the plugin is installed, click on the Activate Plugin button to activate WPForms on your site.
After activating the plugin, be sure to verify your WPForms license key to receive automatic updates and plugin support. Adding your license key will also allow you to easily install and activate WPForms addons from inside your WordPress dashboard.

That’s it! You can now begin using the WPForms plugin on your WordPress site.

Next, would you like guidance on how to create your first form? Be sure to check out our tutorial on how to create your first form in WPForms for more details.

**Reference Blog**
[How to Install WPForms Pro plugin on WordPress](https://www.gomahamaya.com/install-wpforms-pro-plugin-wordpress/)
The Science of Efficient Learning - Techniques (course by Andrei Neagoie)
Tags: writing, productivity
Published: 2022-04-24 07:21:31

These are some techniques to help you become more efficient and productive in your learning.

- **_Pomodoro Technique_**: The idea is to set a timer to work and take breaks. For example, after 25mins of working, you would take a 5 min break. It ensures that you're taking a brain break, which prevents you from overworking yourself.

---
- **_Chunk the subject:_** When encountering a challenging topic, it's best to break it down into smaller pieces to easily digest. Divide and conquer are key when learning challenging topics.

---
- **_Create roadmaps:_** Create a roadmap for yourself of what you're trying to learn. Follow this roadmap to achieve your goal. 

---
- **_Interleaving:_** Don't be afraid to look for different ways of learning a topic. You shouldn't learn from just one person but many, as it's good to consider other perspectives. 

---
- **_Einstellung:_** Some people will start to develop a fixed mindset, where they feel imperial and not willing to take suggestions and advice from others. But, this is not good. Be sure to always have an open mind to suggestions and feedback no matter where your at within your career. 

---

- **_Importance of community:_** It's important to be apart of a community where you can learn and grow with others on the same path. Getting instant feedback from a positive community improves and grows your knowledge. 

---

- **_System v.s. Goals:_** Systems are like having habits you do each day, for example, planning to code for 20 mins each day to improve. Compared to goals, which are tasks with a completion date. In some cases, goal setting can led to procrastination. In that case, creating a system would be best suited. As you'll maintain consistency and gradually improve little by little. 

---

- **_The power of senses:_** Be sure to setup your working environment to your liking, as it makes a big difference to how productive you can become. For example, working in a cafe or by the fire, etc. Aside from environmental impact. It also helps to take visual notes, have diagrams and/or roadmaps to easily grasp difficult concepts.

---

- **_Stakes and Rewards:_** This idea is about self discipline. When you've accomplished a task, you reward yourself on a job well done (reward of your chosen). However, when you failed to meet a deadline, there has to be some sort of consequence(stake). For example, you have to pay a family member $20 for every deadline you don't meet. This idea decreases procrastination when you put something important on the line.

P.s. You don't necessarily have to practice all these techniques listed, you can just pick a few that interest you.
 
I hope some of these techniques helps you guys out in becoming more productive in your learning. Enjoy!
Why we moved from 32-bit to 64-bit processors?
Tags: computerscience, cpu, processor
Published: 2022-04-24 07:20:24

When I had just entered college, I got my first laptop almost 7-8 years back. Surprisingly, it said 64-bit instead of 32-bit, which I had seen till then on the computers everywhere. Why did it say 64-bit? Almost all the computers gradually moved from 32-bit to 64-bit processors in the late 2000s and early 2010s. What exactly did change with this?

Let's start with how processors exactly work. Processors are a collection of billions of transistors placed on a silicon wafer. These transistors combine to build logic gates and even sophisticated computational logic. There are two main parts to CPU- **control unit** (CU); and **arithmetic and logical unit** (ALU). CU is like an orchestrator at the opera (orchestrating the execution of programs), and ALU is like vocalists and instrumentalists at the opera (carries out arithmetic and logical computations). To carry out any computation, the processor needs some data. 

We already know there are two kinds of memories in our computers- **primary memory** (also called RAM or just 'memory') and **secondary memory** (also called storage). RAM holds data and programs that processors require for executing active programs, whereas the storage persists everything else that is not being actively used. Now, RAM has the entire Microsoft Excel program and required data, but all of it is not being processed simultaneously; the instructions currently being processed are stored in **registers**, a tiny memory unit embedded within the processor. Technically, registers are the smallest data holding elements.

When a computer or processor is marked as 32-bit or 64-bit, it is being talked about the size of registers in the processor. There are several kinds of registers; not going deeper into these, but some hold the address of data in memory, some hold instructions, and so on. In RAM, memory is typically marked by addresses from 0 - X (a 4GB ram has 2^32 bytes and requires 32 bits to store the address on a location, whereas an 8GB ram has 2^33 bytes so on). 

A 32-bit register won't ever be able to access any location in RAM beyond 4GB because it cannot store its address. This is a constraint if we want to use 8 or 16GB RAM. This is primarily why manufacturers decided to move to a 64-bit register that adds support for the address of 64-bit, i.e., allows 2^64 bytes in RAM (~16-17 exabytes; FYI, 1 exabyte is roughly 1 billion GBs). Today, with a 64-bit register, we are using at max 42-48 bits of these 64 in computers.

Along with allowing more memory, this also allowed us to have 64-bit instructions. Since instructions are a part of the operating system, they also need to support 64-bit instructions, so almost all operating systems were rebuilt for a new generation of processors. You can run both 32-bit and 64-bit OS on a 64-bit processor but only run 32-bit OS on a 32-bit processor.

That's all for today. I hope this was a tiny bit helpful.
Javascript Basics Part 1
Tags: javascript, beginners, codenewbie, tutorial
Published: 2022-04-24 06:57:23

JavaScript is a widely used scripting language that adds functionality and interactivity to a webpage. HTML is the basic skeleton of a webpage and it allows the users to create and generate various sections, add paragraphs and links. CSS helps in styling the webpage. All the user interactions are managed by Javascript. 

> Where does the Javascript block of code goes in an HTML document? There are 2 ways to do this. 

Inline JS means the code is written inside the HTML document while external JS file means we have an external document connected to our HTML. In Inline JS we have the code inside the opening and closing script tag where  external Javascript has the script attribute where we give a source reference to an external Javascript file.

```
<script>
console.log("This is an inline Javascript code block");
</script>
```

```
<script src="script.js"></script>
```
We typically put the Javascript file at the end of the html document and inside the body. Traditionally script is something that we put at the bottom of the page. 
## First Reference of a Javascript function

```
console.log ();
```
Here we are are naming our console to interact with the Javascript console. Log function is used to send a message. 

semicolons are optional in Javascript, but it is always a good practice to have them because they indicate the end of statement.
Hourglass Problem
Tags: hackerrank, beginners, java
Published: 2022-04-24 06:42:22

This problem is based on a challenge on hackerrank. It is a bit tricky beginner level problem.

**The problem is to find the maximum of all the hourglass shaped number sums in a given 2d integer array**

A 6 x 6 array (2d) is given.

```
1 1 1 0 0 0
0 1 0 0 0 0
1 1 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
```

And if you notice, there is hourglass shaped numbers.
The first one is below.

```
1 1 1
  1
1 1 1
```

The sum of this hourglass is (1 + 1 + 1) + (1) + (1 + 1 + 1) = 7 
7 being the largest.

So now to the problem. You are given the below 2d array.

```
-9 -9 -9  1 1 1 
 0 -9  0  4 3 2
-9 -9 -9  1 2 3
 0  0  8  6 6 0
 0  0  0 -2 0 0
 0  0  1  2 4 0
```
You need to find the maximum sum of hourglass looking numbers.


![Some hourglasses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ek48yntcryompzv3lyn.png)

In this I have circled some hourglass looking numbers.

Sum of Red hourglass is 
(-9 + -9 + -9) + (-9) + (-9 + -9 + -9) = -63

![Sum of Red hourglass](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri6vixflnx42kplsfzht.png)

And the rest of hourglass sums are like below

```
-63, -34, -9, 12, 
-10,   0, 28, 23, 
-27, -11, -2, 10, 
  9,  17, 25, 18
```

The maximum hourglass is below. It's sum is 28

![Sum of maximum](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngwiidhy9c9rjkq6mimo.png)

**So How do we calculate the maximum of the hourglass looking numbers ?**

You should follow these steps.

1. Loop through each index of the array.
2. Find the hourglass sum of the each regional hourglass.
3. If the current sum is higher than the previous, maximum = current.
4. Print the maximum.

Starting from the first row first column is the index (0, 0). It contains the hourglass below.

```
-9 -9 -9
   -9
-9 -9 -9
```

So you need to find the sum of this hourglass using another nested loop.

Then the second hourglass is in the index of (0, 1). It contains the hourglass below.

```
-9 -9  1
-9  0  4
-9 -9  1
```
Sum is calculated in this second one too.

If the second is higher than the first you can assign the maximum as the second sum. This is repeated until the end.

But we should not need to go until the last element since at (0, 4) index and indexes after that we can't make a hourglass shaped numbers.

And also for the row-wise it is invalid to go for (4, 0) index since hourglasses not shaped in thereafter.

Find the source code using below link

https://github.com/lizardkingLK/hourglass_problem
How to stay motivated on your side projects? 🤔🤷‍♂️
Tags: discuss, productivity, watercooler, programming
Published: 2022-04-24 06:14:27

We all have so many half-baked projects that we don't want to go back to. Still, we have unicorn ideas that we can't wait to start. In turning that unicorns to donkeys we all become developers.

But how do you stay motivated in creating those donkeys? Well here are some of my opinions and learnings.

## Whether half-baked or full, learn the skills of baking

> Side projects are for learning at your own pace.

Most of my programming experience comes from my side projects. I learnt multiprocessing and process queues in python when I thought about gifting my friend a mosaic image. Even though it was a bummer, later it helped me at my workplace. Similarly, I touched on so many things (unfinished) just to learn something new.

What makes learning at workplace different from side projects is working at your own pace. And personally I feel more confident about my knowledge when I learn it in my own way. Most of you might agree on this one, so if you like learning at your own pace, **start a new side project around what you want to learn**.

## Do something today that your future self will thank you for

No matter how small your side project is, sometimes it helps you or someone else at the right time. Whether it's 10 lines automation script, or 1000 lines of code, when time comes, you appreciate yourself. This may not always happen, but keeping your projects code accessible will help you in solving the problems that you already solved once.

![stackoverflow meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qbd93pr8y16lmqerv1lv.jpeg)

So while starting a new project, just make sure you keep the code accessible. May be push it to a private repository, or make a new secret gist.

## Keep the ideas coming

> Ideas are so powerful, they start small and when given enough thoughts and time, they can solve real world problems.

All side projects starts with some idea. Whether it's useful or not, unique or copied, dumb or smart, but there will always be some idea that you try to implement. Many times one idea lead to another, whether its small improvements or your unique signature, it helps you in exploring many things. With time and exploration, you'll understand if an idea is worth spending your time. Every idea you understand, will help you with some new ideas and solutions. Remember, at the end of the day, it's your ideas that solves the problem and not the number of languages/libraries/frameworks you know.

So, keep pushing your brain to process more ideas, and to generate more ideas.

These are just my opinions on what I learned through many of my side projects. Comment down below your experience and learnings :).

Happy coding!
Vue clearInterval
Published: 2022-04-24 05:27:19

why，in “created”，use “setInterval”，but can't use “clearInterval” to stop it
like this

```
created() {
    this.timer = setInterval(() => {
        this.getResult()
    }, 1000);
}
```
```
this.total = Number(res.data.total)
this.num = Number(res.data.num)
if (this.num >= this.total) {
    this.clearInterval(this.timer)
}
```
Happy 40th Birthday to the ZX Spectrum 48K!
Tags: retro, discuss, development, programming
Published: 2022-04-24 05:21:52

Without this little rubber keyed wonder, I would not be the programmer I am today...
![ZX Spectrum 48K desk setup](https://cdnb.artstation.com/p/assets/images/images/007/580/737/large/gloria-ocete-khasdkjhak.jpg?1507113331)

Who else got their start as a developer with this classic machine?
React 18 Full Stack app, Free
Tags: react, firebase, styledcomponents
Published: 2022-04-24 05:10:51

Learn how to make a react js full stack app in 18 steps
Its free: https://worldclasscode.web.app/github
Step 1: Introducing the Course “React JS, Full Stack”.
Step 2: Create React App
Step 3: Visual Studio Code (run an app first time)
Step 4: Yarn, NPM (Starting and Stopping your code)
Step 5: Use State Hook
Step 6: Javascript (Commands)
Step 7: CSS (Flexbox, Position, and Styled Components)
Step 8: CSS (Responsive design, Mobile first)
Step 9: React Router
Step 10: Use Context Hook
Step 11: Use Effect Hook
Step 12: Modals
Step 13: Persistent state (Handling browser refresh)
Step 14: Firebase Authentication
Step 15: Firebase Firestore (database)
Step 16: Complete e-commerce app (Bringing it all together)
Step 17: Firebase Hosting
Step 18: Wrap up
Do validate your HTML
Tags: html, webdev, performance
Published: 2022-04-24 05:04:35

I'd been pulling my hair out trying to get a perfect score in Chrome's Lighthouse audit. I had only a few tiny icons, not many deeply nested elements, no blocking javascript, I had used preload tags to avoid request chains, and the page sure seemed fast to me. There was no reason I should be capped at 95 for performance. But the audit would always tell me 900ms was being spent on "Unattributable." Gee, very helpful!

A post I happened to read here on DEV linked the [W3 Validator](https://validator.w3.org/) so I thought what the heck, let's see if anything is wrong, and ran my site through it. Sure enough I had a few mismatched tags. And wouldn't you know it, fixing that made the problem go away and showed me those beautiful fireworks.

Most browsers will silently fix mismatched tags, so you won't notice any errors on the site or console and it will even be corrected in the source code. But I suppose this makes the renderer waste some time re-parsing the DOM -- not enough for me to notice on my notebook, but substantial on Lighthouse's simulated slow device.
Day 15: I forgot
Tags: productivity
Published: 2022-04-24 04:43:45

Hi
yesterday I completely forgot about writing. usually I always remind myself to write before sleep but yesterday was a special one. I took the whole day for rest and I didn't do anything code related> i learned something from one of my teammates that we are not wasting time when we take rest because we need to rest to actually be more productively therefore we are instead saving time. but I couldn't help it in the evening I got started on my second article about `setting up Eslint prettier and Husky` which I plan to release today or tomorrow
I also noticed that I'm losing track of days yesterday Was say but I wrote 13 twice I don't know if it means that I'm getting used to this or that I don't care much anymore but either way I'm not gonna quit anytime soon 

signing off....
DESIGNING A WEB API USING DATABASE FIRST APPROACH
Tags: webapi, net6
Published: 2022-04-24 04:36:03

In this video, I show you how to implement a Web API using database first approach.

The following technologies are used: Web API, Visual Studio 2022, EntityFrameworkCore, C#, Swagger, .NET6 and Microsoft SQL SERVER

Source code can be pulled from https://github.com/benjaminsqlserver/DesiginingWebAPIDatabaseFirst
{% embed https://youtu.be/EROpDwbpGLA %}
How to Fix SPF Softfail Domain Does Not Designate IP as Permitted Sender
Tags: spf, softfail
Published: 2022-04-24 04:10:26

![How to Fix SPF Softfail Domain Does Not Designate IP as Permitted Sender](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho46le8yqy6uq5mzf26x.png)
When analyzing email headers for unauthenticated emails in mailbox service providers like Gmail, you can run into error messages that look like below from time to time:

```text
Received-SPF: softfail (google.com: domain of transitioning account@domain.com does not designate some IP address as permitted sender)
```

Such an _SPF softfail domain does not designate IP as permitted sender_ error message indicates that the email sender's IP address was not included in the SPF record on the sender domain, hence SPF failed.

When this happens, and if DKIM also fails, it will ultimately cause DMARC to fail, which negatively impacts email deliverability. Therefore, the domain administrator should take measures to fix it.

#### How to fix SPF softfail domain does not designate IP as permitted sender

Fortunately, this issue is relatively straightforward to fix. Simply add your sending IP address(es) to the SPF record on your email domain and this error message will disappear.

For example, if you are sending a message as bob@acmecorp.com from a host with the IP address 12.34.56.78, you need to add that IP address with the ip4 mechanism to the SPF record on acmecorp.com, so that the record looks like:

```text
v=spf1 ip4:12.34.56.78 -all
```

This way, all outbound emails sent on behalf of acmecorp.com (including bob@acmecorp.com) from the host will pass SPF authentication.

If you need to add multiple IP addresses, you can use multiple ip4 mechanisms:

```text
v=spf1 ip4:12.34.56.78 ip4:78.56.34.12 -all
```

If you are using an external email delivery service like Mailgun, you can use the include mechanism to "include" all of their hosts in your SPF record:

```text
v=spf1 include:mailgun.org -all
```

This way, emails sent from any Mailgun hosts on behalf of acmecorp.com will pass SPF authentication.

You can also use other mechanisms available in SPF such as a, mx, etc., to define your IP address list. For more information, refer to: [How to Set Up Sender Policy Framework (SPF): the Complete Guide](https://dmarcly.com/blog/how-to-set-up-sender-policy-framework-spf-the-complete-guide).

#### Indirect mailflows

SPF can break in an indirect mailflow where forwarding occurs, as the intermediate server's IP address is different than the originating server's, and the former might not be designated as a permitted sender.

The good news is that, unlike SPF, DKIM results survive forwarding provided that email subject and content are not altered. Therefore, setting up DKIM as well is recommended to improve email authentication success rates.

Original post: [How to Fix SPF Softfail Domain Does Not Designate IP as Permitted Sender](https://dmarcly.com/blog/how-to-fix-spf-softfail-domain-does-not-designate-ip-as-permitted-sender
)
MRCNN TF==2.7.0
Tags: opensource, python, machinelearning, deeplearning
Published: 2022-04-24 03:42:01

Hello AI learners,
check out my own development of Mask-RCNN supporting Tensorflow2.7.0 and Keras2.8.0.
This is an edit of [MRCNN](https://github.com/matterport/Mask_RCNN) which supports Tensoflow1.0, only.

[My Development](https://github.com/Kamlesh364/Mask-RCNN-TF2.7.0-keras2.8.0)

The development is tested for the application of Instance Segmentation in Medical Imaging,  for both "training" and "inference" modes.