teleren/devto huggingface dataset:
Why is string considered as an object in JavaScript?
Tags: javascript, webdev, beginners, frontend
Published: 2023-09-01 17:12:37

**S**trings are objects in JavaScript because they are a collection of characters and objects can have properties and methods. Strings can have methods such as charAt(), indexOf(), and slice(). These methods allow you to manipulate the string, such as getting a character at a specific index, finding the index of a character, or slicing a section of the string.
In JavaScript, strings are not objects in the strictest sense. They are primitive values, which means that they are not objects themselves. However, JavaScript automatically wraps string primitives in String objects when you try to access their properties or methods. This means that you can use the same syntax to access the properties and methods of string primitives as you would for String objects.

There are a few reasons why JavaScript strings are objects. First, it allows you to use the same syntax to access the properties and methods of string primitives as you would for String objects. This makes it easier to learn and use JavaScript. Second, it allows you to add new properties and methods to strings. This can be useful for extending the functionality of strings. Finally, it allows you to use the prototype chain to inherit properties and methods from other objects. This can be useful for reusing code.
Validate Field Type Date with package &#39;validate&#39;
Tags: softwaredevelopment, r, validation
Published: 2023-09-01 17:02:58

Validate Field Type Date with package 'validate'
------------------------------------------------

As a software developer, you know how important it is to validate user input. One common input field that often requires validation is the date field. Users can be quite creative when it comes to entering dates, and it's your job to ensure that the dates entered are in the correct format. Luckily, there is a handy package called 'validate' that can help you with this task.

The 'validate' package is a powerful tool that allows you to easily validate various types of data, including dates. It provides a simple and intuitive API that makes it a breeze to validate date fields in your applications. Let's take a look at how you can use this package to validate a date field.

### Installation

Before we dive into the code, let's first install the 'validate' package. You can install it using npm by running the following command:

`npm install validate`

### Usage

Once you have installed the package, you can start using it in your code. Let's say you have a form with a date field that you want to validate. Here's how you can do it using the 'validate' package:

`const validate = require('validate'); const dateField = '2022-01-01'; if (validate.isDate(dateField)) { // The date is valid, proceed with further processing } else { // Oops! The date is not valid, show an error message }`

It's as simple as that! The 'isDate' function from the 'validate' package checks whether the provided value is a valid date. If it is, you can proceed with further processing. If not, you can show an error message to the user.

### Conclusion

Validating date fields in your applications doesn't have to be a daunting task. With the 'validate' package, you can easily ensure that the dates entered by users are in the correct format. So go ahead, give it a try and make your date validation process a breeze!

### References

*   [npm package: validate](https://www.npmjs.com/package/validate)
*   [Example.com](https://www.example.com)
DAY 90 - 338. Counting Bits
Tags: leetcode, algorithms, beginners, coding
Published: 2023-09-01 16:59:25

Hey Folks!. Welcome to day 90 of the 100DaysOfCode Challenge. We shall be covering Today's daily leetcode problem today.

---

## Question: 338. [Counting Bits](https://leetcode.com/problems/counting-bits/description/)

Given an integer n, return an array `ans` of length `n + 1` such that for each `i` (0 <= i <= n), `ans[i]` is the number of 1's in the binary representation of `i`.

### Example 1:

> **Input:** n = 2
> **Output:** [0,1,1]
> **Explanation:**
> 0 --> 0
> 1 --> 1
> 2 --> 10


### Example 2:

> **Input:** n = 5
> **Output:** [0,1,1,2,1,2]
> **Explanation:**
> 0 --> 0
> 1 --> 1
> 2 --> 10
> 3 --> 11
> 4 --> 100
> 5 --> 101


---

## Intuition and Approach:
- The problem at hand asks us to count the number of 1's in the binary representation of integers from 0 to n . It's something  that combines elements of DP and bitwise operations. The end result we want is an array which contains number of 1's for all integers from 0 to n.
- Okay we know what we want, but how do we get there.
- Let's look at individual things we can do, we know if we multiply something by 2 or shift it once we are shifting every bit by one and the incoming bit will be a 0.
- Hence if there was no set bit there means, the next number contains the same number of bits and if there was we can simply modulo the number with 2 and find it out.

- We got a relation: Number of set bits in a number is equal to number of bits set in it if it was halved + modulo(number%2).

Let's form a solution using this, but if we do this it will be highly inefficient. How about we use DP here and start from bottom answers we know that no of bits in 0 is 0 and no of bits in 1 is 1.

### Approach:

- First, I initialize a vector called res of size n+1 to store the count of set bits (1s) for numbers from 0 to n. Since there are no set bits in the binary representation of 0, I set res[0] to 0.
- Then, I use a loop to iterate from 1 to n. For each number i in this range, I calculate the count of set bits in its binary representation. I do this by taking advantage of the fact that the binary representation of i is formed by shifting the binary representation of i >> 1 one position to the right and adding i % 2 as the last bit. This effectively counts the number of set bits in i based on the count in the binary representation of i >> 1.
- Finally, I return the res vector, which contains the count of set bits for all numbers from 0 to n.

### Code:

```cpp

class Solution {
public:
    vector<int> countBits(int n) {
        vector<int> res(n+1);

        //dp
        res[0] = 0;

        for(int i = 1;  i <=n; ++i){
            res[i] = res[i >> 1] + i%2;
        }

        return res;
    }
};

```

---

## Complexity Analysis:

|Algorithm | Time Complexity |	Space Complexity|
|----------|-----------------|------------------|
|Bit Manipulation + DP	| O(N) |	O(N)|
Software Testing
Published: 2023-09-01 16:57:54

What is software testing? What we need to know about software testing? What is the relevance of software testing?

activities conducted with intention of finding defect in software and for the execution of software to identify defect from that software. We need to know the importance of software testing because without testing or examining the product if we deliver the product customer may not satisfy if he found defects in running the software. It will cause lots of loss to the organization.  so It needed to test the software before delivery. It gives the trust that we only deliver quality products are distributed to consumers, which in turn shows the customer satisfaction and trust from that.
Kernel Driver Exploits
Published: 2023-09-01 16:47:44

### Windows Kernel Mode Driver Development

One fundamental aspect of kernel exploit development is understanding the kernel mode driver's creation. Operating at such a low level requires precision, expertise, and a deep comprehension of the underlying Windows architecture. A comprehensive guide on [how to make a Windows kernel mode driver](https://guidedhacking.com/threads/how-to-make-a-windows-kernel-mode-driver-tutorial.15201/) can be a stepping stone for those diving into this realm. It offers in-depth discussions on the foundational elements and the intricacies involved in designing these drivers. Crafting such drivers with dexterity ensures that the exploit is executed efficiently without causing unintentional system destabilizations.
{% embed https://youtu.be/9h1FsOISwX0 %}

### Exploiting Vulnerable Kernel Drivers

Before one can effectively deploy an exploit, it's essential to identify potential vulnerabilities in the target system. Kernel drivers often come with their fair share of weaknesses. An informative post delving into [vulnerable kernel drivers for exploitation](https://guidedhacking.com/threads/vulnerable-kernel-drivers-for-exploitation.15979/) unveils a myriad of susceptible drivers, elucidating their inherent vulnerabilities. Such posts are invaluable as they not only spotlight the potential targets but also illustrate how certain vulnerabilities can be pragmatically leveraged.

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

### Manual Mapping of Kernel Drivers

An integral part of kernel exploitation is understanding how drivers are mapped. This manual mapping process involves intricate knowledge of driver structures, their interactions, and potential loopholes that can be exploited. The resource on [kdmapper to manually map kernel drivers](https://guidedhacking.com/resources/kdmapper-manually-map-kernel-drivers-cve-2015-229.305/) provides a deep dive into this methodology. It accentuates the concept with the context of a specific CVE, giving it a practical edge and providing exploit developers with a tangible example.

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

### Bypassing Kernel Anti-Cheat Mechanisms

While developing kernel exploits, one can't turn a blind eye to the defenses put up by software developers. Modern software, especially games and critical applications, come fortified with anti-cheat systems at the kernel level. An insightful article on [how to bypass kernel anti-cheat and develop drivers](https://guidedhacking.com/threads/how-to-bypass-kernel-anticheat-develop-drivers.11325/) sheds light on some advanced methodologies to evade these formidable defenses. Armed with such knowledge, one can navigate the complex landscape of kernel exploits with greater proficiency.
Devops
Tags: webdev, javascript, productivity, devops
Published: 2023-09-01 16:42:04

Diving into the world of #DevOps - where code meets infrastructure, and collaboration meets innovation. 🛠️👩‍💻 Let's automate, iterate, and accelerate together! #TechLife #AgileDevelopment #DigitalInnovation
![DevOps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m82ubp5sn98ipxz8iyre.png)
How can I be a good developer?
Tags: beginners, linux, gamedev, cpp
Published: 2023-09-01 16:30:06

I am a beginner programmer hoping to be a good programmer. I used to like the game when I was a child, and I have hoped I could develop a great game which can give happiness to the players even though I am not playing the game these days since I became very busy because of other work.
For over 1 year, I couldn't find the right way to start my study about the game development, but I've known that the good people are there in DEV since last week. I respect all of the developers in DEV because you are helping each other without any limitation but your true heart.
And now, I want to get help from you to be a good programmer just like you. Could you help me telling me a right way how can I study which materials to be a good game developer?
Thanks for reading my poor writing.
I wish you good luck in your business.
No#1 Web Development & Mobile App Development in Chennai | Hubsem Software Solutions Pvt Ltd
Tags: webdev, softwaredevelopment, marketing, chennai
Published: 2023-09-01 16:29:18

Elevate your digital presence with HUBSEM's No#1 Web Development & Mobile App Development in Chennai. We redefine excellence.For More Info Call Us:  +91 63858 51234 or [Visit Our Website](https://hubsem.com/)

#webdevelopmentinchennai  #webdevelopmentserviceschennai #professionalwebdesigncompanyinchennai  #mobileappdevelopmentcompanyinchennai  #mobileappdevelopmentinchennai
#bestmobileappdevelopmentcompanyinchennai
Best SEO Tools For YouTube in 2023: Tube Buddy vs. vidiQ
Published: 2023-09-01 15:53:33

Tube Buddy vs. vidiQ: In the fast-paced world of digital content creation, optimizing your YouTube videos for search engines is paramount to reaching a wider audience. Two popular tools, Tube Buddy and vidiQ, have emerged as essential companions for content creators looking to enhance their video SEO strategy. In this article, we’ll delve into the differences, features, and benefits of both tools, ultimately helping you make an informed decision about which one best suits your needs. 
If you want to read more about this topic click [here](https://techzpoint.com/tube-buddy-vs-vidiq-unleashing-the-power-of-youtube-seo-tools/)
Active iTop Screen Recorder V4.1 License Key [2023]
Published: 2023-09-01 15:38:41

The lightweight, simple-to-use screen recording software iTop Screen Recorder enables you to capture every important and priceless second of daily life and edit the captured movie to make it ideal. It’s a wonderful option for capturing 4K movies, video games, lectures, webinars, presentations, and many other types of content. See what makes iTop Screen Recorder unique by looking at the default settings, then start your fantastic recording experience right now!
For iTop Screen Recorder License Key Click [Here](https://techzpoint.com/itop-screen-recorder-v4-1-license-key-2023/)
Como usar Notion para Product owners / SCRUM Masters.
Tags: notion, agile, productivity, development
Published: 2023-09-01 15:35:11

A mi me gusta mucho como en Azure devops se administran los proyectos, por esa razón en este tutorial intento replicar la manera en como trabaja Azure devops.

Entre las cosas que me gustan están sugerencias de como cada tipo de "Product Backlog Item" debería de ser considerado en termínos de esfuerzo.


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

Podrían entenderse así:

- Backlogs levels
    - Portfolio Level: PO, SC, CEOs
        - **Epics**: Strategies or Goals.
            - 1 -  6 months
        - **Features**: These are deliveries where we get value
        - **Initiatives**: *Objectives, Incentives, Hypothesis, issue, Assumptions, Propositions*
            - 1 - 6 weeks
    - Requirement Level: Team members, people who produce the deliveries
        - **PBI**: User stories, Bugs
            - 2 Weeks (1 sprint)
        - **Tasks**
            - 1 day


Aqui les dejo el tutorial

{% embed https://www.youtube.com/watch?v=B92nzGX5nAo %}
How I improved my backup strategies using TrueNAS Scale
Tags: backup, automation, truenas
Published: 2023-09-01 15:08:08

---
title: How I improved my backup strategies using TrueNAS Scale
published: true
description: How I improved my backup strategies using TrueNAS Scale
tags: backup, automation, truenas
canonical_url: https://ariaieboy.ir/blog/15-how-i-improved-my-backup-strategies/
series: My Backup Strategy
---

In my previous blog post [How do I backup my websites, and why should I improve](https://ariaieboy.ir/blog/12-how-do-i-backup-my-websites/), I described how I backup my websites.

In that article, I mentioned some problems with my backup plans. Since then I deployed a local NAS in my home using TrueNAS and improved my backup plans.


### Redaundent storage using Raid-1
The first improvement is my Raid-1 configuration for backup storage.
This means that in the event of one of my drives failing, I can restore my backed-up files from the other disk.

### Object storage backup
One missing part of my backup process was the object storage.
Thanks to TrueNAS, I can easily backup my object storage files using TrueNAS Data Protection Cloud Sync Task.
It will sync my object storage files with my Local NAS.

### Gickup for git backup
Another service that I run is Gickup, which backup all my remote git repositories to my local NAS.

### One last thing: Backup health check
Right now, I backup multiple things like my Databases, Object Storage, and git repositories.
I need to check the integrity of the backup files.
How To Migrate Your Angular Application State Management From Observable To Signals
Tags: tutorial, angular, rxjs
Published: 2023-09-01 14:51:18

If you are an Angular developer, you might be familiar with the concept of Observable, which is a way of handling asynchronous data streams in your application. Observable allows you to subscribe to data changes and react accordingly, using operators like map, filter, switchMap, etc. Observable is a powerful tool for managing complex and dynamic data flows, but it also comes with some drawbacks, such as:

- You have to manually unsubscribe from the Observable when you are done with it, otherwise you might create memory leaks or unwanted side effects.
- You have to deal with error handling and retry logic in case the Observable fails or emits an error value.
- You have to use RxJS library, which adds some extra weight and complexity to your codebase.

<a href="https://festack.blogspot.com/2023/09/how-to-migrate-your-angular-application.html">Read more</a>
Will the whole MainWidget re-render or just the Wrapping widget which is using the state in flutter whenever setState is called?
Tags: flutter
Published: 2023-09-01 14:47:26

I am new to [Flutter](https://flutter.dev/) , i was going through flutter doc and a doubt came to me, how the re-render or re building of UI works in flutter?

`If i have two widgets under my Main Widget and i am using  a state in the 2nd widget, will the first widget also get re-rendered?` 🧐

```dart
class MainWidget extends StatefulWidget {
  @override
  _MainWidgetState createState() => _MainWidgetState();
}

class _MainWidgetState extends State<MainWidget> {
  int counter = 0;

  void incrementCounter() {
    setState(() {
      counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text('This is the second widget'),
        Text('Counter: $counter'),
        ElevatedButton(
          onPressed: () {
            incrementCounter();
          },
          child: Text('Increment Counter'),
        ),
      ],
    );
  }
}
```

Whenever the user Clicks the **Increment Counter** Button, the state will get updated, in response the UI should get re rendered.

`But the question is will the **whole MainWidget** is **re-rendered** or just the **Text Widget** which is using the counter state?`

## Answer:

When you call **setState**, it schedules a **rebuild** of the widget, and the build method is called again. However, this **does not** necessarily mean that the entire **MainWidget** and its **subtree** will be **rebuilt** from scratch every time setState is called.

Flutter is designed to be efficient, and it employs a process called **"reconciliation"** to update the widget tree efficiently.

1. When setState is called, Flutter marks the widget as dirty and schedules it for rebuilding.

2. The next time the Flutter framework performs a frame update (typically 60 times per second), it checks which widgets are marked as dirty and calls their build methods.

3. During the build process, Flutter compares the new widget tree with the previous one (the one from the previous frame) and identifies the differences (what needs to be added, updated, or removed).

4. Flutter updates only the parts of the widget tree that have changed. This means that only the widgets and elements affected by the state change get rebuilt, while unchanged parts of the widget tree are reused.

So after the setState only the Widget which is using the counter state in it will be rebuilt.

```dart
 @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Text('This is the second widget'), // re-render ❌
        Text('Counter: $counter'), //  re-render ✅
        ElevatedButton(
          onPressed: () {
            incrementCounter();
          },
          child: Text('Increment Counter'), //re-render ❌
        ),
      ],
    );
  }
```
Thanks for the reading. 😇
Nhà Cái Vwin
Published: 2023-09-01 14:25:23

Vwin trở thành tụ điểm cá cược được nhiều người Việt biết đến. Sân chơi này mang đến cho mọi người những dịch vụ giải trí hấp dẫn cùng các phần thưởng có giá trị. Không gian cá cược với kho game đa dạng sẽ khiến anh em có thể quên hết đường về.
#vwin #appvwin #linkvwin
Địa chỉ: 42 Tôn Thất Thiệp, Bến Nghé, Quận 1, Thành phố Hồ Chí Minh
SĐT: 0908682819
Mail liên hệ: contact@linkvwin.com
Website: https://linkvwin.com
https://www.facebook.com/linkvwin/
https://www.youtube.com/@linkvwinvn/about
https://twitter.com/linkvwinv
https://www.pinterest.com/linkvwincom/
https://www.linkedin.com/in/linkvwin/
https://linkvwin.tumblr.com/
https://vimeo.com/linkvwin
https://www.reddit.com/user/linkvwin
https://www.quora.com/profile/Linkvwin
https://social.msdn.microsoft.com/Profile/linkvwin
https://medium.com/@linkvwin/about
https://soundcloud.com/linkvwincom
Becoming a Freaking developer
Tags: programming, motivation, beginners
Published: 2023-09-01 14:12:22



## 1. Communication is a big part 📢
Think of **"programming"** and **"communicating"** as your **legs**. if you can't communicate well... well you're f**ked
- Learn soft skills
- Watch [Vinh Giang](https://www.youtube.com/@askvinh) he teaches communication.

---

## 2. For F*** sake don't compare yourself to other
Everyone has their own path, ways of learning, etc. The most important thing is you're making progress.


---


## 3. The more you F*** around the more you find out
Explore Things
- do you just use vscode? Try learning vim, sublime text
- do you just use react? Try vue, svelte etc
- do you just do webdev? Try game dev

If you have time to F*** around. do it. you will learn trivial things and this sometimes will change big stuff. 


![F around graph](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2j3f3s5h545qszqm39z.png)

---

## 4. Learn how things work

- Do you know how react manipulates the DOM behind the scene?
- Do you know how pointers work in CPP?
- Do you know how a programming language code is turned into 1's and 0's for the computer?

- Question everything! Be Curious!
- Don't Just **use** things, **learn how they work** and try implementing them if they are not so **ambitious** like creating your own compiler

[Be an Engineer, not a Frameworker](https://johndanielraines.medium.com/be-an-engineer-not-a-frameworker-c58fe28d0c88)
-- John Raines

---

## 5. Just Do It!
You: Aghh, can i really do this without watching tutorial?
Me: DO IT!.. Don't worry about making mistakes. **figure things out along the way!! GOOGLE IS YOUR FRIEND**

---

## 6. Dunning Kruger Effect
This thing is really common for us dev's goodness just accept it lol. Just search it or someone in the comment explain this stuff, I don't think I'm qualified.

![Dunning kruger Graph](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7t7w910af84g4gzr164o.png)

---

Thanks for reading!
I hope you learned some things lol, i don't expect you too and neither i expect some of you to agree on some things. i just tried blogging.