teleren/devto huggingface dataset:
Revealing module pattern is beautiful
Tags: javascript, programming, webdev
Published: 2021-08-28 06:02:59

Revealing module pattern is one of the sub pattern of the module pattern. Don't know how many people still use module pattern in javascript, and I have seen a fair amount of code which uses RMP. 

### So what is a module pattern anyway?
* The public members are exposed in the return function.
* The private members live in the closure.

``` javascript
function greet() {
  const name = "Natasha";
  return {
    function greetHello() {
      return `Hello ${name} ! Thanks for signing up!`;
    }
    function greetWelcome() {
      return `Hello ${name} ! Welcome back!`;
    }
  }
}
```

### How RMP is different from Module pattern?

* All the functions live in the closure.
* Only the functions that should be exposed are made public under return.
* The return functions will not have any function definitions. It will just reference the functions in the private.
``` javascript
(function greet() {
  const name = "Natasha"
  function greetHello() {
    return `Hello ${name} ! Thanks for signing up!`;
  }
  function greetWelcome() {
    return `Hello ${name} ! Welcome back!`;
  }
  return {
    hello: greetHello,
    welcome: greetWelcome
  }
})();
const hello = greet.hello(); //Hello Natasha ! Thanks for signing up!
const welcome = greet.welcome(); //Hello Natasha ! Welcome back!
```
* It gives a flexibility to reference the function name with our choice. Here greetHello is the function but it is exposed as hello. This helps in a lot of scenarios, let's say you are writing an API and the module would want a function name **saveDetailsToDB** for understanding the logic but not anyone who wants to use the API need that information, so you can just say ``` return {save: saveDetailsToDB}```.
* Removing the key pair from the return object would make the exposed function private. Whereas in module pattern you have to remove the function from return object.

I have been a big fan of this pattern and it is just an admiration post on how beautiful it is :P
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found
Published: 2021-08-28 08:58:36

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rh2sccxk28jeehekcsif.PNG)
i am installing flutter for the flutter development i run flutter doctor see an error that i need to authorize it when i am running that code for autorization i am seeing error that module not found please help
Code with Codespaces and deploy with Qovery
Tags: github, codespaces, qovery
Published: 2021-08-28 08:40:58

12 years ago, when I started to work as a Developer, I would not have bet that I will write software and manage infrastructure right from my browser one day. At the time, web IDE did not exist. And managing infrastructure from the browser was super early. Today, it is all possible, and the future looks bright!

I am proud to show how you can edit your code via GitHub Codespaces right from Qovery.

{% youtube 3KYa4dnY5ps %}

One question for you, do you use or plan to use Github Codespaces? 🤔
GFX Tool for PUBG - Game Launcher & Optimizer
Tags: pubg, android, bestapk4u, games
Published: 2021-08-28 08:34:17

GFX Tool is a free utility launcher for specific games where you can fully customize the game graphics to get beautiful pictures and smooth gameplay.

App features
• Change resolution
• Unlock HDR graphics and all FPS levels
• Fully control Anti-aliasing and shadows
• And much more other useful options

All game versions are supported.

How to use GFX Tool
• Close game if it’s currently running before starting GFX Tool
• Choose your version of your game
• Customize the graphics according to your desires and device capabilities.
• Once everything is set, click on Accept and Run Game

GFX Tool Official Website https://bestapk4u.com/gfx-tool

DISCLAIMER: This is an UNOFFICIAL application for specific games.This application is not associated in any way with other brands and developers.

If you feel that we have violated your intellectual property rights or any other agreement, please contact us by e-mail tsoml.v17@gmail.com, we will immediately take the necessary measures.
WhatsApp to add new Messaging Feature? 
Tags: whatsapp, update, apps, android
Published: 2021-08-28 08:28:36

WhatsApp to add new Messaging Feature?
According to news reports, WhatsApp has begun chipping away at another message include that will permit clients to send responses to messages.

As per WABetainfo, the texting stage’s move is a startling one, taking into account how WApp has been chipping away at presenting new elements in the course of recent months however has not done likewise for its informing capacities.  

New Feature
 

“You definitely realize what is a response: it’s generally an emoticon that you can put on a message to communicate feelings. Instagram, Twitter, iMessage as of now support message responses and today we can begin to find the advancement of their turn of events,” read a <a href="https://bestapk4u.com/">post</a>
 on WABetainfo.
Credit to Respective owner of the pic
Since the screen capture taken above is from a WApp beta for Android, WhatsApp will clearly carry out this element on WhatsApp for iOS and Web/Desktop also.
DEVELOPING HOTEL MANAGEMENT APP WITH RADZEN BLAZOR WEB ASSEMBLY (LESSON FIVE) CUSTOM SECURITY PART 1
Tags: blazor, webassembly, sqlserver, customsecurity
Published: 2021-08-28 08:07:00

In this video below, I begin to implement custom security for our RADZEN Web Assembly App by Creating tables to store our users, roles and users in roles.

How to implement many to many relationships via the use of junction tables is explained in this tutorial.

A junction table is a table which acts as an intermediary between two tables/

When implementing many to many relationships in a normalized database, we will have tables A, B, C. Let us say table B is the junction table. For table B to perform this function, a one to many relationship will exist between tables A and B and another one to many relationship will exist between tables C and B

{% youtube 9L6qs49uBqY %}
No More React Context Hell
Tags: react, context, provider, hell
Published: 2021-08-28 07:59:58

If you always wanted it to look like this

```javascript
  <Providers providers={[
    <FooContext.Provider value="foo" />,
    <BarContext.Provider value="bar" />,
    <BazContext.Provider value="baz" />,
  ]}>
    <App />
  </Providers>,
```

here is your Providers Component:

```javascript
const Providers = ({providers, children}) => {
  const renderProvider = (providers, children) => {
    const [provider, ...restProviders] = providers;
    
    if (provider) {
      return React.cloneElement(
        provider,
        null,
        renderProvider(restProviders, children)
      )
    }

    return children;
  }

  return renderProvider(providers, children)
}
```

Enjoy!

Like, share and etc
Ajax Filter Pagination In Laravel 
Tags: laravel, ajax, filter, search
Published: 2021-08-28 07:32:33

Hi Guys,

In this tutorial , I will explain how to create functionality to active and inactive status in laravel 7/6. I give you a full example of active and inactive status in laravel 7/6. we can implement change status using ajax with bootstrap toggle button in laravel 7/6. we will update user status active inactive with boolean data type with 0 and 1.

I almost require to create status change functionality in out laravel . it might be require for user status, product status, category status, etc. we have always two yes or no, enable or disabled, active and inactive etc. you can do it this toggle stuff using jquery ajax.

We will create a users listing page and give bootstrap toggle button using bootstrap-toggle js. so you can easily enable and disabled it. using bootstrap-toggle js change event we will write jquery ajax code and fire get or post request to change user statue field on database.

Here following the example of active and inactive status in laravel 7/6

https://www.codecheef.org/article/laravel-active-inactive-ajax-filter-example-with-pagination
Payment Methods on Freelancing Platforms
Published: 2021-08-28 06:03:58

Freelancing is due to the urge of earning online by using available resources. So, it’s necessary to know about the procedure of getting paid and how to transfer your money from your freelancing platform into your local bank account. When the client releases the payment after completion of a task, few freelancing platforms such Fiverr and Upwork hold the payment for some duration of approx one week. After that, it is made available for freelancers. While in Freelancer.com payment is immediately available to freelancers. Each freelancing platform gives you options of some payment methods by using which you can transfer your money into your local bank account. It can be an option of direct bank deposit or by using wire transfer or by using some e-wallets such as PayPal, Payoneer, money booker, skill, etc. There is a difference in operational methods for each payment transfer method. If you are on any freelancing platform, you must know which payment method is supported by your local bank account. Otherwise, you may lose a significant percentage of the amount from your earnings. In this article, we discuss different payment methods that are supported by freelancing platforms. With the help of that method, you can easily transfer your income to your bank account.

WHICH OPTIONS ARE AVAILABLE ON UPWORK?
In Upwork, you have the following options for payment methods

WIRE TRANSFER 
DIRECT BANK DEPOSIT
E-WALLETS
XOOM
PAYONEER
SKRILL
https://youtu.be/iSteOVVA_3w?t=56
Move Specific Array Item in JavaScript
Tags: javascript, webdev
Published: 2021-08-28 06:52:15

Sorting and rearranging ararys in JavaScript can be a bit tedious at times, to say the least.

Often, the [find() method](https://www.tutorialspoint.com/javascript-array-find-function) is not sufficient, let alone sufficiently performant.

Here's a function I've created for more surgical operations, which moves a single item at a specific index to another index:

```js
const moveItem = (array, to, from) => {
    const item = array[from];
    array.splice(from, 1);
    array.splice(to, 0, item);
    return array;
};
```

Each of the four lines in this function has a specific task:

1) Get a copy of the item that needs to be moved.

2) Remove the original item from the array.

3) Insert the copy at the desired index.

4) Return the resultant array.

Here's an example of it in action. Let's say we want to make `Green` go between `Red` and `Blue` in the following array:

```js
let colors = [`Red`, `Blue`, `Yellow`, `Green`];
```

We can pass the array to `moveItem`, along with the index of the item to move and the desired target index:

```js
// 1 is the target index we want to insert that item at
// 3 is the index of the item we want to move
colors = moveItem(colors, 1, 3);
```

As expected, `Green` is now between `Red` and `Blue`:

```js
console.log(colors);
// Returns [`Red`, `Green`, `Blue`, `Yellow`]
```

Pretty neat, right?

## Conclusion

I've found this approach especially useful when working with object arrays.

Hopefully you found it useful too!
Adding Web Api Controller to a Razor Page ASP.NET Core app
Tags: dotnet, webdev, beginners
Published: 2021-08-28 06:22:25

> This is part of a personal ASP.NET Core cookbook that i am working on.

Open an existing  asp.net core 5 razor pages app. 

Add Swashbuckle.AspNetCore via nugget. This will auto generate api docs, cool right?
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7w6i5t1738whugf53k9.png) 

Update Startup.cs to include controller and swagger services and middlewares.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1md9pcf00iefseqvuq3s.png)
  
At project root, add Controllers directory then open context menu under that folder by selecting the folder and right click.
On context menu, click add > controller

A new dialog window will open for scaffolding options.
Select API.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3es6unzq0t8zqv0kriob.png)
 
Run project then go to https://localhost:PORT/swagger
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6a34njimnnhaonvl8hwk.png)
 
There you have it, happy hacking.
windows hosts file do not support inline comments
Tags: windows, troubleshooting
Published: 2021-08-28 06:12:49

I put a line like this in hosts file of windows, but it does not take effect

```
10.0.90.29 e.exmaple.com # comments
```

but another line without `# comments` works perfectly, so I decided to move the inline comments to a line by itself, then problems solved
Looking for graphic designer/video creator
Tags: sideprojects, design, webdev
Published: 2021-08-28 06:11:31

Hey guys, I am looking for a Graphic designer/Video creator to collaborate with. I have a side project which is ready to launch and want to get a logo, social media banners & product video done. In exchange, I can offer a certain percentage of the earnings for a certain period of months if it works out well and can get it monetized. At the very least you can do it just for a side project experiment which will be yours too. 

You can check out more about my side projects at mehullakhanpal.netlify.app


DM if interested

Thanks

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for more.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack  
**[codedrops.tech](https://www.codedrops.tech/)**

---
**Projects**  
[File Ops](https://marketplace.visualstudio.com/items?itemName=mehullakhanpal.file-ops) - A VS Code extension to easily tag/alias files & quick switch between files
Docker Can Do That ! Part 1: Managing containers on remote machine
Tags: docker, devops, linux
Published: 2021-08-28 05:52:41

This is a series of short articles illustrating less known capabilities of docker.

Using this feature docker allows you to build, run, delete containers and pretty much everything else on a remote machine.

## Prerequisite: 

A remote instance having docker installed with SSH access.

## Steps:

### Adding local machine's public ssh key to remote machine's authorized keys. 

This is required so that the remote machine correctly verifies your ssh connection and doesn't allow random people to run docker containers on your machine. 

Generate a ssh key on your local machine using:
```bash
ssh-keygen
```
For simplicity don't provide any passphrase and save the key at default location (`~/.ssh/id_rsa`) 

Your public key would be at `~/.ssh/id_rsa.pub` and the private key at `~/.ssh/id_rsa` . NEVER SHARE YOUR PRIVATE KEY.

Now append the contents of `~/.ssh/id_rsa.pub`  at the remote machine's  `~/.ssh/authorized_keys` , separated by new line. 

If everything goes right, you should be able to access remote machine from local machine by simply doing:

```bash
ssh <remote_user>@<remote_ip>
```

## Running docker commands from local machine on remote machine

You can now run docker commands like this
```bash
docker -H ssh://<remote_user>@<remote_ip> run hello-world
```

The container would be built and ran on the remote machine.

### How it works

Docker is composed of 2 components. 
1. Docker daemon: This is responsible for actually building and running the containers.
2. Docker client: More commonly this the docker-cli, the command line tool is just one way of interacting with docker daemon. You can use programming languages to build containers too, which directly interact with the daemon.

So in our case we are using docker daemon of a remote machine and interacting with it from local machine. The local machine 
uses ssh to access the daemon.




Please share in the comment sections other less known features of docker. I would be glad to learn more about docker.
AWS Migration Series: DataSync Overview
Tags: aws, migration
Published: 2021-08-28 05:38:59

AWS DataSync is an online data transfer service that simplifies, automates, and accelerates moving data between on-premises storage systems and AWS storage services, and also between AWS storage services. DataSync can copy data between Network File System (NFS), Server Message Block (SMB) file servers, self-managed object storage, Amazon Simple Storage Service (Amazon S3) buckets, Amazon EFS file systems, and Amazon FSx for Windows File Server file systems.

###Data transfer between self-managed storage and AWS

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/to2pe7d7pe1t2puv3rxe.png)
 

###Data transfer between AWS storage services

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezsn5jvxv3u9ho5ry8c2.png)

####How DataSync works?

To understand the science behind DataSync, we need to understand few key components.
* **Agent** An agent is a VM that you own that is used to read or write data from self-managed storage systems. The agent can be deployed on VMware ESXi, KVM, Microsoft Hyper-V hypervisors, or it can be launched as an Amazon EC2 instance.

* **Location** Any source or destination location that is used in the data transfer (for example, Amazon S3, Amazon EFS, Amazon FSx for Windows File Server, NFS, SMB, or self-managed object storage).

* **Task** Consists of a source location and a destination location, and configuration that define how data is transferred.  Configuration settings can include options such as how to treat metadata, deleted files, and permission.

* **Task execution** An individual run of a task, which includes information such as start time, end time, bytes written, and status.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j9cqad0gifbcy4fvmg5n.png)

######Workflow

* In the *LAUNCHING* status, DataSync initializes the task execution.
* In the *PREPARING* status, DataSync examines the source and destination file systems to determine which files to sync.
* In the *TRANSFERRING* status, DataSync starts transferring files and metadata from the source file system to the destination. 
* In the *VERIFYING* status, DataSync verifies consistency between the source and destination file systems.


![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xt8ix10vq3ruw2dmixz.png)

_Source:_ [AWS Documentation](https://docs.aws.amazon.com/)
LetsGrowMore Web Development Internship Experience
Tags: html, css, javascript, react
Published: 2021-08-28 05:30:27

Hello everyone, I have successfully completed the web Development Internship at LetsGrowMore by completing the Task-1 and Task-2 assigned by them.

Task-1:Single-Page Website
Technologies used:HTML,CSS,javascript
Code Editor:Visual Studio Code

Task-1 Experience:

I have learnt HTML,CSS and javascript for designing this website. I have learnt so many new things about CSS and its purposes. This Internship helped me to know more about javascript. It was a great learning experience.

Task-2:Web Application Using Create-React-App
Technologies Used:HTML,React js,Javascript,CSS
Code Editor:CodeSandBox

Task-2 Experience:

I have learnt React JS to complete this Web Application. This is a simple web application to display the users of brand while clicking in the get users button. It was a great learing experience.

Conclusion:
I would like to thank Mr.Aman Kesarwani and LetsGrowMore for giving me this opportunity to work on the projects based on Web Development. Through this Internship I have learnt and gained a lot of practical knowledge in the field of Web Development.
To know more about LetsGrowMore Internships visit the site https://letsgrowmore.in/ and https://letsgrowmore.in/vip/
Learning Python- Intermediate course: Day 16, Summary of the week
Tags: learningpython, codenewbie, python, programming
Published: 2021-08-28 05:29:42

This week we completed the 'numeric and mathematical modules' by covering three modules, namely `Statistics` `decimal` and `fraction` 
### Summary of the week
- [Day 13, The Statistics Module](https://dev.to/aatmaj/learning-python-intermediate-course-day-13-the-statistics-module-2bb5) In this part, only a single sample program was given, which showed various statistical functions with comments explaining what they did. You will find a more detailed and comprehensive explaination at the [official documentation](You will find a more detailed and comprehensive explaination at the official documentation)

- [Day 14, Introduction to the Decimal module](https://dev.to/aatmaj/learning-python-intermediate-course-day-14-introduction-to-the-decimal-module-4ngc) The Decimal module is a way by which faster and accurate floating point arithmetic can be achieved. We can avoid Python errors like 0.1+0.2+0.3-0.7=-0.09999999999999987  by using this module. The decimal module is a very vast module, and only a small gist of it was given in this part. You might like to visit [this link](https://www.tutorialspoint.com/decimal-functions-in-python) for learning about more functions or check out the [official documentation](https://docs.python.org/3/library/decimal.html#)

- [Day 15, Complete guide to the fractions module](https://dev.to/aatmaj/learning-python-intermediate-course-day-15-complete-guide-to-the-fractions-module-4ki8) The fractions module is a inbuilt module in Python which is very useful when we have to deal with floating point numbers. The `fr.Fraction()` converts a floating number into a fraction object, making it easier to comprehend. In this part, many commented pieces of code examples were provided for getting a full grasp of the subject. Operating on fractions is just like operating on real numbers, and we can use the mathematical operators to calculate them in a very easy way.
We also looked at some useful methods in the module.

Note
Not all would require to get the most out of these modules, hence you may feel free to skip these parts. I have tried to give just a brief summary of the modules, especially the decimal module without diving too deep into the details. The documentation of the modules is also very precise and clear, hence rather than explaining facts in depth, I have tried to speeding things up. By covering only the important parts which are more likely to be used, the course aims to cover a gist of the modules in least time possible. 

Thank you ! That was all for this week 👍 Meet you next Tuesday 🤠
## Python GUI from next week🤩


🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
Follow me on GitHub for updates.......