teleren/devto huggingface dataset:
Know how to increase PC speed after the Mcafee installed
Tags: computer, software
Published: 2021-06-25 06:26:55

McAfee's antivirus program includes lots of features and functions, yet this plethora of choices can lead to problems on some computers, especially elderly ones. McAfee offers the capacity to scan your computer and upgrade automatically, but these surgeries take up RAM and bandwidth, providing you less electricity to operate with. [Mcafee slows down computer](https://technicalsquad.net/does-mcafee-scanner-service-slowing-computer/) if it is not constructed to handle it if you've got an older machine, then it may not meet its system requirements.

##Scans by Default

McAfee scans your pc automatically, which prevents you from needing to stay on top of yourself. By default, McAfee scans after a week, however, it does not automatically wait until afterward if it sees you are active; it begins scanning schedule weekly, even when you're functioning. Scans utilize a good deal of your RAM and processor power, which may drastically slow down whatever you are attempting to do. To alleviate this problem, place the automated scans for some time when you are asleep or off, or disable it entirely (but do not forget to scan your pc sometimes ).

##Updates by Default

McAfee keeps a database of virus definitions to keep itself current with the most recent viruses and other dangers. To do so, it utilizes your link to download these definitions. Additionally, this is an automated feature, and while it does not use as much processor power, it is going to take up your bandwidth while it arranges the definitions. You can also observe some slowdowns since it supports the upgrades. The answer here is exactly the exact same as before. But if you decide to disable the upgrades, do yourself with greater frequency than scans since definition upgrades occur frequently.

###Total System Scans

Antivirus programs will frequently suggest running complete system scans overnight or while you are off. Complete scans consume so much processor power which it is an unbelievable hassle to attempt to do anything else at precisely the exact same time since McAfee needs to have a look at all of your documents and scan them to get any difficulties. But, you are able to enhance the rate of scans themselves from defragmenting your hard disk. When the documents are not fragmented, they are easier to scan and finish.

###Inadequate Hardware

Mature computers will fight more with McAfee and anti-virus software generally. McAfee asks one to have at least 512MB RAM for Windows XP and 2GB of RAM for Windows Vista and 7, in addition to 500MB of free space along with a 1GHz chip. For many systems, this is no problem, but also for computers that hardly match the specs, only having McAfee installed will slow down your computer even if it is not scanning or upgrading. In case you've got the funds and also know-how to boost your system, updating your RAM is one of the simpler methods of repairing this issue.
HTTP REQUEST AND RESPONSE HEADERS
Published: 2021-06-25 06:17:34

HTTP stands for "Hyper text transfer protocol". HTTP headers are the code that transfer data between a web server and client. HTTP headers are mainly intended for the communication between the server and client in both direction. 

**HTTP Request Headers**
The client sends the request to the server to fetch some data   or information. Basically, the client request is an HTTP Request, which communicates between the client and the server. Moreover, it is a simple text file formatted in either XML or JSON, which send the client binary data to the server.
 
  * Host request header defines the host and port number of the server to which request is sent.
  * User-Agent is a request header that allows to identify the operating system and Browser of web-server.
  * Connection controls the network connection.
  * Cache-control specifies browser caching policies.
  * The Proxy-Authorization request header field allows the client to identify itself or its user.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7yhanxcvjgbd6g5yfxv.png)

**HTTP Response Headers**
HTTP response header is a component of network  packet that is sent by a web server to a web browser or client machine in  response to an HTTP Request.

* HTTP response status codes that is sent to a client in the form of three- digit number after successfully completed. Responses are grouped in five classes:
    1. The range (100-199) is classed as Informational.
    2. The range (200-299) is classed as Successful.
    3. The range (300-399) is classed as Redirection.
    4. The range (400-499) is classed as Client error.
    5. The range (500-599) is classed as Server error.  

* A content-type header tells the client what the content type of the returned content actually is.

* Set-Cookie in which response header send cookie from server to the user. Cookies are mainly used for session management 

* The Content-Length indicates the size of the message body, in bytes sent to the user.

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqjeuq143gforv3j8w93.jpg)
Django, Null=True or Blank=True or both
Tags: python, devjournal, beginners, django
Published: 2021-06-25 06:00:22

When we add a database field to Django, we have several options for defining the modal field. They usually have default values that we can override according to our needs.

To use modal fields effectively, one must have a thorough understanding of their definitions.

<hr>

## Null

Every column in the database is defined to hold certain attributes. Sometimes we want to keep our columns optional, thus hold a NULL value, and we set these permissions as

```python
NewField = models.charField( max_length=10, null=True)
# This sets the NewField to be an optional field in DB

NewField = models.charField( max_length=10, null=False)
# This sets the NewField to be a mandatory field in DB
```
<hr>
## Blank

Every Django model field is also defined to hold certain attributes. Sometimes we want to keep our fields blank with no form value, and we set these permissions as:

```python
NewField = models.charField( max_length=10, blank=True)
# This sets the NewField to be allowed to stay blank

NewField = models.charField( max_length=10, blank=False)
# This sets the NewField to not be allowed to stay blank
```

<hr>

## Null and Blank

By now, it should be clear that **Null** affects the database table definition and **blank** affects model validation. There are four ways to use these attributes:

```python
# 1. Requires both
Name = models.charField( max_length=10, null=False, blank=False)

# 2. Requires DB value
Name = models.charField( max_length=10, null=False, blank=True)

# 3. Requires modal value
Name = models.charField( max_length=10, null=True, blank=False)

# 4. Requires none
Name = models.charField( max_length=10, null=True, blank=True)
```

Let's discuss each distinctively:

**1.) Null=False, Blank=False**
This is the default condition for modal fields. It means the value is required both in the DB and in models.

**2.) Null=False, Blank=True**
This is a condition where forms don't require a value, but the field does.

Let's take an example: If your model has a field whose value is being calculated from other models in the field. Then you would want to keep 'Black=True' to not accept values from the user, and 'Null=False' to enforce that a value is always provided.

**3.) Null=True, Black=False**
This is a condition where form requires a value, but DB doesn't. This is not a very commonly used configuration, I haven't seen one yet. (If you happen to know any, put them down in the comments.)

**4.) Null=True, Black=True**
This is a condition, where form doesn't require a value, and DB doesn't require a value either. This is pretty self explanatory since the former is reflected with the latter.

<hr>

You might now have a good idea of what these two attributes mean, and how they are to be used together.
You can read more about them [here](https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django)

> Have a good day. Happy Coding.
Create a React Calendar in 5 Minutes
Tags: react, calendar, webdev, javascript
Published: 2021-06-25 05:56:19

Learn how easily you can create and configure the Syncfusion [React Calendar](https://www.syncfusion.com/react-ui-components/react-calendar "React Calendar") using the create-react-app command. This video also explains how to configure a few of the control’s basic features like setting specific date range values, multidate selection, and navigation between different calendar views.

**Download the example from GitHub**:
http://bit.ly/2ZDoB2J

**Refer to the following documentation for the Syncfusion React Calendar**: 
http://bit.ly/2MasTf8

**Check out this online example of the React Calendar**: 
http://bit.ly/3bl5wId

{% youtube wgqX295fGkY %}
Microsoft 11- Hype created successfully//
Tags: discuss, microsoft, news
Published: 2021-06-25 05:51:49

As Microsoft came forward with announcement of features of the new Windows 11, it also talked about a policy change. It wants developers to bring Win32, Progressive Web App, or Universal Windows Platform apps to the Windows Store. And while there's a MS commerce engine, in a shot at Apple, Microsoft says that developers can use the own payment systems and keep 100% of earnings.

One important thing is, this doesn't apply to games. Which brings us back to square one with the Epic Games V Apple case- App? Game?

Why is this distinction existing?
QR Code Generator using Python
Tags: python, programming, beginners, opensource
Published: 2021-06-25 05:40:23

Ever wondered to yourself how easy it can be to create a QR code without a need of a website or third party software? 
Actually t's pretty much easier, thanks to python. With python we an make use of only <mark>**2 lines of code**</mark> to make this happen. 
We will be able to create QR Codes for URLs and even any text we wish to.

Have a doubt, let me show you below:

This is another article on the [Python Projects for Beginner Series](https://dev.to/larymak/series/12034) 💻, 
> Are you looking for an Open Source Project to contribute to: Check out this [REPO](https://github.com/larymak/Python-project-Scripts) and add your <mark>CONTRIBUTION</mark> and give it a Star⭐  

### Let's Get Started
### Steps To Create QR Code Generator.  
1. Make sure you have a code editor and python installed in your computer.(preferred IDE pycharm)
1. Open PyCharm, Click file->New Project. and specify the file or folder location for your work.
1. In your folder you just created, you will need to create a python file.
*Right Click on folder-> New-> Select python file. Give it a name with a name with a `py` extentension ex: `qr.py`*
1. Start Coding;  

First things first, we need to install a library to help us with this functionality: 
Open the terminal and paste in: 
`pip install qrcode` 
After the installation, in our file let write code: 
```python
import qrcode

image = qrcode.make("PAste in your URL")
image.save("name to save it") 
```
See the full video and Github to see how you can input your own text and not the URL links.
Full Code Link: [Here](https://github.com/larymak/Python-project-Scripts/tree/main/QrCodeGen) 

Check Out Video Tutorial:
[![QR Code Gen Using Python](http://i3.ytimg.com/vi/QemlQBeIxWI/maxresdefault.jpg)](https://www.youtube.com/watch?v=QemlQBeIxWI) 

If You have read this far I really appreciate, Help me to grow my community:

Check out my other Blogs too:  
- [What is Front-End Development? How to Become One](https://dev.to/larymak/what-is-front-end-how-to-become-a-front-end-developer-128g)
- [How To Create a Digital Clock Using Python](https://dev.to/larymak/create-a-digital-clock-using-python-beginner-python-project-11-5epi)

Connect With me at [Twitter](https://twitter.com/larymak1) | [Insta](https://www.instagram.com/nextgencoders/) | [YouTube](https://www.youtube.com/channel/UCrT1ARRZfLOuf6nc_97eXEg) | [LinkedIn](https://www.linkedin.com/in/hillary-nyakundi-3a64b11ab/)  | [GitHub](https://github.com/larymak)

Do share your valuable opinion, I appreciate your honest feedback!    

Enjoy Coding ❤
Center elements with Tailwind CSS
Tags: tailwindcss, css
Published: 2021-06-25 05:30:24

Nowadays, I choose Tailwind CSS as my goto CSS toolkit.
And today, I'll show you how to center elements with Tailwind CSS quickly.

We'll be looking at two methods of centering with Tailwind.
There isn't a clear wrong or right between these two methods, but generally, grid should be used for the high-level layout and flex for details.
For our demo, we'll use the same structure so you can see the difference better.

## 1 Grid center using Tailwind CSS

We'll start by using grid to center an element perfectly within a page.

```html
<div class="grid place-items-center h-screen">
  Centered using Tailwind Grid
</div>
```

Can you believe this is all we need?
Let's explore what's going on.

- `grid`: Gives the element a display: grid property
- `place-items-center`: Gives it the center value on the place-items property
- `h-screen`: Sets the 100vh (screen-height) as the height

This code will perfectly center the element on the page.

{% codepen https://codepen.io/rebelchris/pen/xxqeQRJ %}

> Looking for a [CSS Grid centered](https://daily-dev-tips.com/posts/css-grid-most-easy-center-vertical-and-horizontal/) version?

## 2 Flex center using Tailwind CSS

A second option is to use flex box to center the element.
The approach is pretty similar, but we have to specify the horizontal and vertical centering with flex box.

Let's see how that would look like:

```html
<div class="flex justify-center items-center h-screen">
  Centered using Tailwind Grid
</div>
```

As you can see, it looks similar to the grid option but with an extra variable.

- `flex`: Adds the display: flex property
- `justify-center`: Does the horizontal center
- `items-center`: Does the vertical center
- `h-screen`: Sets the 100vh (screen-height) as the height

This will result in the following:

{% codepen https://codepen.io/rebelchris/pen/WNpWYpG %}

> Looking for the [CSS Flex center article](https://daily-dev-tips.com/posts/css-flexbox-most-easy-center-vertical-and-horizontal/)?

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
🌎 What is a REST API ? 10 best practices when building a REST API
Tags: opensource, api, tutorial, rest
Published: 2021-06-25 05:06:00

An API, or application programming interface, is a set of rules that define how applications or devices can connect to and communicate with each other.

An API needs to meet the following rules to be called a RESTful / REST API.

* **Client-server**: A RESTful API follows the client-server model where the server serves data and clients connect to the server to consume data. You can use Hoppscotch as a client for your API server to build and understand how API is used in the real world.

* **Stateless**: A RESTful API should be stateless. Each request is treated as a standalone request. The server should not keep track of any internal state that might influence future requests.

* **Uniform interface**: All API requests for the same resource should look the same, no matter where the request comes from.

> The go-to Open-source tool for building an API would be [Hoppscotch](https://hoppscotch.io/) (previously known as Postwoman). It is crafted with Vue.js and a minimalistic design. You can save it as a PWA and use it whenever you want, like a desktop or a mobile app.

Read the [full article](https://aviyel.com/post/163/what-is-a-rest-api) where we talk about the 10 best practices to build a robust and secure REST API
Effective Java: Use Native Methods Judiciously
Tags: java, effective, native, architecture
Published: 2021-06-25 04:19:43

---
title: Effective Java: Use Native Methods Judiciously
published: true
description: A dive into chapter 66 of Effective Java
tags: java, effective, native, architecture
series: Effective Java Review
canonical_url: https://blog.scaledcode.com/blog/effective-java/use_native_judiciously/
---


Java provides the Java Native Interface (JNI) that allows Java programs to call into native methods written in native programming languages such as C, C++, or Rust. Historically this capability has been used for three different things:
1. The ability to call into platform-specific features such as registries.
1. Access to existing native code so that you don't need to re-implement it.
1. For writing performance-critical parts of your application.

As stated above it is valid to use native methods to access platform-specific functionality although that is seldom needed. Java over the years has done a good job of providing platform agnostic solutions to platform features such as the process apis in Java 9. 

While the Java ecosystem is massive and you can probably find some JVM library for about any purpose JNI can still be useful for calling into native libraries when they provide unique functionality. A library that I have been using a lot lately is Kafka Streams which uses JNI to call into RocksDB to use as a local data store. 

Finally, using native code for performance critical code is a dangerous game. Attempting this can often bring about the opposite effect along with all the other downsides detailed below. 

With all the reasons that one might choose to use native code in Java there are a number of serious downsides. Native languages are not safe and work outside of the garbage collector. This can lead to corrupted memory leaks, and all the other downsides that native programming brings along with it. When taking on native code we also take on all the platform-dependence that it brings along that we were allowed to ignore with using pure Java. If you are not careful a simple native method call can greatly decrease the stability, interoperability, and maintainability of your code. 

Given all of these considerations it is often best to steer clear of native methods if at all possible. If you cannot avoid the use of them be very careful with your code and make sure to thoroughly test the code for safety.
Missing Feature of Online meeting apps
Published: 2021-06-25 04:12:55

In discussion in the real world, sometimes we turn our head to the person that we want to talk to and raise our voice toward that person.

That is the feature missing in online meeting apps. Of course no matter if you turn your head and speak, the recipient will hear your voice as one of the patrons.

What we can do in apps is to give the feature called, let me name it "Talk to". You click the recipient window and click "Talk to", the recipient will get the voice with a louder voice from you.

Since there are quite a number of online meeting apps around the market, I'm not sure this feature has been implemented, but in commonly used applications, this is still a missing feature.
Link Your Charts and Grids in 20 Minutes with JetBrains + Syncfusion [Webinar]
Tags: charts, grids, jetbrains, syncfusion
Published: 2021-06-25 03:22:45

During this webinar, we'll show how to build an ASP.NET Core 5 application using Jetbrains Rider and [Syncfusion](https://www.syncfusion.com/ "Syncfusion"). In this app, we will load the [Syncfusion grid control](https://www.syncfusion.com/aspnet-core-ui-controls/grid "Syncfusion grid control") with data and then populate the [Syncfusion chart](https://www.syncfusion.com/aspnet-core-ui-controls/charts "Syncfusion chart") with the data selected in the grid.

JETBRAINS
-------------------- 
Learn more about Rider: https://bit.ly/3zXpBQs
Licensing: https://bit.ly/3dbSVca

ASP.NET CORE CHARTS 
-------------------- 
Product overview: https://bit.ly/3j9X6ZK
Examples: https://bit.ly/3xOkQ9L
Documentation: https://bit.ly/3jotS9R
Download free trial: https://bit.ly/3qpcD9D

{% youtube lXfq7EzEadM %}
Javascript的加法問題?
Tags: javascript
Published: 2021-06-25 03:03:59

各位大大大神安安:
最近在學Javascript,一般來說,要讓數字1加到9可以用
let result = 0;
for(n=1;n<=10;n++){
result += n;
}
console.log(result);

或者是

let i = 0;
let result = 0;
while(i<10){
i++;
result += i;
}
console.log(result);

都可以是55

那如果是要用min和max的話,也就是要從min加到max的話要怎麼使用?
Code Smell 82 - Tests Violating Encapsulation
Tags: codenewbie, webdev, tutorial, programming
Published: 2021-06-25 03:01:37

*Objects work fine and fulfill business objectives. But we need to test them. Let's break them.*

> TL;DR: Don't write methods with the only purpose of being used in your tests.

# Problems

- Encapsulation Violation.

- Bad interfaces

- Coupling

# Solutions

1. Don't break encapsulation.

2. Test must be in full control. 

3. If you cannot control your object, you are coupled. Decouple them!

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/06757fcedc4c442584f144c68b16d597)
```php
<?

class Hangman {
    private $wordToGuess;

    function __construct() {
        $this->wordToGuess = getRandomWord();
        //Test is not in control of this
    }

    public function getWordToGuess(): string {
        return $this->wordToGuess;
    }
}

class HangmanTest extends TestCase {
    function test01WordIsGuessed() {
        $hangmanGame = new Hangman();
        $this->assertEquals('tests', $hangmanGame->wordToGuess());
        //how can we make sure the word is guessed?
    }
}
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/c2d16cf8f0d533345ec74314c04863ea)
```php
<?

class Hangman {
    private $wordToGuess;

    function __construct(WordRandomizer $wordRandomizer) {
        $this->wordToGuess = $wordRandomizer->newRandomWord();
    }
}

class MockRandomizer implements WordRandomizer {
    function newRandomWord(){
        return 'tests';
    }
}

class HangmanTest extends TestCase {
    function test01WordIsGuessed() {
        $hangmanGame = new Hangman(new MockRandomizer());
        $this->assertFalse($hangmanGame->wordWasGuessed());
        $hangmanGame->play('t');
        $this->assertFalse($hangmanGame->wordWasGuessed());
        $hangmanGame->play('e');
        $this->assertFalse($hangmanGame->wordWasGuessed());
        $hangmanGame->play('s');
        $this->assertTrue($hangmanGame->wordWasGuessed());
        //We just test behavior
    }
}
```

# Detection

This is a design smell.

We can detect we need a method just for test.

# Tags

- Information Hiding

# Conclusion

White-box tests are fragile. They test implementation instead of behavior.

# Relations

{% post https://dev.to/mcsee/code-smell-52-fragile-tests-18o6 %}

{% post https://dev.to/mcsee/code-smell-28-setters-2hih %}

# More Info

- [Should I Test Private Methods](http://shoulditestprivatemethods.com/)

# Credits

This smell was inspired by @[Rodrigo](@rodrigomd)

{% twitter 1408032157629485056 %}

* * *

> Nothing makes a system more flexible than a suite of tests.

_Robert Martin_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}