teleren/devto huggingface dataset:
Find unused exports with this bash script
Tags: javascript, bloat, bash, gpt3
Published: 2023-04-08 11:13:13

Are you tired of manually tracking down unused exports in your project? So was I. With power of ChatGPT I, a total bash newbie, created a bash script for modern javascript projects that can help you.

**How to use**. First, [clone the gist](https://gist.github.com/muikku/9626b6e562967ffef24449a5c9017ac3). Then, make the script executable by running the command "chmod +x unusedExports.sh" in terminal. Next, navigate to the target directory and run the script using the command "./unusedExports.sh". The script will search your project for unused exports and create a report in a file named unusedExports.txt. **Script can be inaccurate with default exported modules, since they can be imported with different name!**

To exclude certain files or directories from the search, specify them in the EXCLUDE variable. While there is certainly room for improvement - for example, by making the code less repetitive and allowing for situational EXCLUDE arguments - this script is already a valuable tool for spring cleaning.
Erides Hub
Published: 2023-04-08 10:49:26

Erides Hub is a provider of electric transportation devices that offers a wide range of options to its customers. Whether you're looking for an electric skateboard, e-scooter, e-unicycle, or Onewheel, Erides Hub has got you covered.

These devices are not only fun to ride, but they're also environmentally friendly and can be a practical alternative to traditional transportation methods. With Erides Hub's selection of products, you can easily find the perfect electric transportation device that fits your needs and lifestyle.

In addition, [Erides Hub](https://erideshub.com/) is committed to providing exceptional customer service and support. They offer a warranty on their products and are always available to answer any questions or concerns you may have.

Overall, Erides Hub is a great option for anyone looking for a high-quality electric transportation device. Whether you're commuting to work or just cruising around town, their products are sure to provide an enjoyable and efficient ride.
How to set the document title in React?
Tags: react
Published: 2023-04-08 10:27:36

In this article, we will see different ways to add document title in React.

## Using index.html

You can edit the `index.html` file inside the public directory to set the document title.

![using index.html](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0xie94kcwin2o40zwia.png)

## Using the useEffect hook

The problem with updating the index.html directly is that we will not be able to have different titles for different pages.
So we can make use of the useEffect hook as shown below to have a unique title per page.

```jsx
import { useEffect } from "react"

function App() {
  useEffect(() => {
    document.title = "My new title"
  }, [])

  return <div className="App"></div>
}

export default App
```

## Using react-helmet library

While using `useEffect` will work fine, it involves many lines of code. It can get annoying to use it on many pages.
To solve this we can use libraries like [react-helmet](https://www.npmjs.com/package/react-helmet).

Install react-helmet using the following command:

```
npm i react-helmet
```

Now use it as shown below:

```jsx
import { Helmet } from "react-helmet"

function App() {
  return (
    <div className="App">
      <Helmet>
        <title>Title using helmet</title>
      </Helmet>
    </div>
  )
}

export default App
```

Here the code looks more natural and you can add whichever tag you will use inside the head tag (meta, script, etc) using react-helmet.
How to deploy React application to Firebase
Tags: react
Published: 2023-04-08 10:24:37

In this article, we will see how to create a firebase account and deploy a react application into firebase.

## Project setup

Create a react application using the following command:

```bash
npx create-react-app react-firebase-deploy
```

## Creating a firebase account

Navigate to https://console.firebase.google.com/ and click on **Create a project**.

![firebase create account 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hyuiu3tga65vrz6sr1ra.png)

Now you can choose either an existing project or create a new one and click **Next**:

![firebase create account 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tc1g3tekiedhg8u446c8.png)

Enable Google analytics if required and click on **Create**.

After a few minutes, firebase will be set up and you will be redirected to the dashboard page. Expand the **Build** tab on the left and click on **Hosting**.

![set up hosting 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f50kams1c2ldmr4001a.png)

Click on **Get Started**

![set up hosting 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7yilmurxgvbcg6qzbom.png)

Press **Next** in the following 2 steps and click on **Continue to console** in the last step.


![set up hosting 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xn3egxwct5xbvdi6bf8t.png)

![set up hosting 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fuvoao7dyslr52yyahvs.png)

![set up hosting 5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zguk86rwfugict657ksy.png)

## Installing firebase tools

Now on your machine, run the following command to install firebase tools globally:

```bash
npm install -g firebase-tools
```

Now login to your Google account by running:

```bash
firebase login
```

This command will open a page in the browser where you can authorize log in.

## Initializing firebase

Now inside your project, initialize firebase by running the following command:

```bash
firebase init
```

![firebase init](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzn49p70k60nh8zbxr9o.png)

Now choose the hosting option given above.

Now select **Use an existing project**.

![firebase init 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxzithausczrr0km0tbr.png)

From the listed project, select the one to which you need to deploy:

![firebase init 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/225m1j87iqq8b4ypab5f.png)

In the hosting step,

- Type `build` as the public directory.
- `Yes`, for single we app.
- `No`, for GitHub deploys.

![firebase init 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9z0e2chfynoovh1z8psq.png)

## Deploying to firebase

Now run the command `firebase deploy` inside your project.

![deploy to firebase](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/liii256pzwrg4c4whw9v.png)

Once the deployment is complete, it will print the URL of the deployed page.

Visit the page to validate the deployment.

![deployed site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c47h6qzex41y087o9igd.png)
Programing During Ramadan !
Tags: webdev, javascript, programming, devops
Published: 2023-04-08 10:08:21

 P
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/on1jkn224ev8vi1cv0wi.png)rogramming during Ramadan can be challenging but it's definitely possible with some planning and adjustments. Here are a few tips to help developers maintain their productivity during the holy month:

1. Adjust your Schedule
Ramadan brings a significant shift in daily routine. To optimize productivity while fasting, adjust your work schedule to the times when you feel most alert and energetic. This may mean taking a break during the day to catch up on sleep or moving work hours to after Iftar so that you can work during the night when you feel more energetic.

2. Prioritize your Work
During Ramadan, itâs crucial to prioritize your work and focus on completing the most important tasks of the day. Create a to-do list and try to get the essential tasks completed during the times when your energy levels are at their peak.

3. Take Breaks Often
It's essential to take breaks often during Ramadan to avoid burnout. Take a few moments to step away from your work and recharge your batteries by drinking water or snacking on fruit.

4. Plan Your Meals
Planning your meals is critical to maintain focus during the workday. Try to consume wholesome nutrient-dense foods during the pre-dawn meal (Suhur) and at Iftar to sustain you throughout the day.

5. Stay Engaged with Your Community
Ramadan is an important time for those who practice Islam to connect with their community. Though social distancing measures are still in place due to the pandemic, virtual meetings and meals can create an opportunity for you to stay connected with your colleagues and maintain team spirit.

In conclusion, fasting during Ramadan can be challenging, but it's still possible to be productive while observing this holy month. It's crucial to adjust your schedule, prioritize your workload, take regular breaks, plan your meals, and stay connected with your community. By implementing these tips, developers can maintain their productivity and stay focused during Ramadan.
Weekly Challenge 211
Tags: perl, python, theweeklychallenge
Published: 2023-04-08 10:08:18

[Challenge](https://theweeklychallenge.org/blog/perl-weekly-challenge-211/), [My solution](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-211/sgreen)

## Task 1: Toeplitz Matrix

### Task

You are given a matrix m x n.

Write a script to find out if the given matrix is Toeplitz Matrix.

A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same elements.

### My solution

The first observation I make is if the matrix is not square (has the same number of row and columns), then there are two 'paths' that need to be compared. If you look at the below two examples, one diagonal is represented by the `a` and a second by the letter `b`.

```
a b x x    a x
x a b x    x a
x x a b    b x
           x b
```

For the input, I take a JSON string, and make an assumption is that it will be a multi dimensional array of integers.

The first step is to calculate the top left of each path. We know that one will always be the first value in the first row, i.e. `matrix[0][0]`, and the `offset` list to this position.

If the matrix is not square, we know the second top left will either be in the first row (as per the example on the left), or the first column (as per the other example). I add this position to the `offset` list.

For each pair in the offset list, I work diagonal downwards comparing the value with the value at the original position. If at any time they don't match, I print 'false' and exit the function. If all the checks have passed, I print 'true'.

### Examples

```bash
$ ./ch-1.py '[ [4, 3, 2, 1], [5, 4, 3, 2], [6, 5, 4, 3]]'
true

$ ./ch-1.py '[ [1, 2, 3], [3, 2, 1]]'
false
```

## Task 2: Split Same Average

### Task

You are given an array of integers. Write a script to find out if the given can be split into two separate arrays whose average are the same.

### My solution

This is one of those tasks where some cleverer Team PWC members are going to have a more efficient solution than my one. I'm just going to brute force it.

For this task I have two loops. The outer loop is the number of values I want to compare. It starts at 1 and end at half the length of the array (rounding down there are an odd number of values). The inner array produces all combinations of that many items. If the average of that combination is same as the total average, print 'true' and exit.

Like with previous combination challenges, I've used the combination function from [itertools](https://docs.python.org/3/library/itertools.html#itertools.combinations) (Python) and [Algorithm::Combinatorics](https://metacpan.org/pod/Algorithm::Combinatorics#combinations(%5C@data,-$k)) (Perl).

I also have an edge case of a single value always returning 'true'. As half of the length of the array is less than 1, the loop doesn't have a chance to run.

### Examples

```bash
$ ./ch-2.py 1 2 3 4 5 6 7 8
true

$ ./ch-2.py 1 3
false
```
Introduction of Angular for Beginner
Tags: angular, javascript, web, programming
Published: 2023-04-08 10:03:29


Angular is an open-source JavaScript framework for building web applications. It uses TypeScript, a superset of JavaScript, to create scalable and robust applications. In this article, we will provide an introduction to Angular 14 and Typescript and provide example code to help you get started.

**What is Angular 14?**

Angular 14 is the latest version of the Angular framework. It is a complete rewrite of AngularJS, the original version of Angular. Angular 14 provides a set of powerful features that enable developers to create dynamic and responsive web applications.

**What is TypeScript ? **
TypeScript is a superset of JavaScript that provides optional static typing, class-based object-oriented programming, and other features not present in JavaScript. TypeScript compiles to plain JavaScript, so it can be used with any browser or JavaScript runtime.

**Example Code **

To get started with Angular 14 and TypeScript, you will need to have Node.js and Angular CLI installed on your machine. Once you have those installed, follow these steps:

Create a new Angular project:

`ng new my-app`

Navigate to the project directory:

`cd my-app`
Create a new component:

`ng generate component my-component `

Open the ** my-component.component.ts ** file in your code editor and add the following code:

```
import { Component } from '@angular/core';

@Component({
  selector: 'app-my-component',
  template: `
    <h1>Hello, {{ name }}!</h1>
  `,
})
export class MyComponent {
  name = 'Angular';
}
```

Open the **app.component.html** file in your code editor and add the following code:

`<app-my-component></app-my-component>`

Start the Angular development server:

`ng serve - o `

Open your browser and navigate to http://localhost:4200. You should see the text "Hello, Angular!" displayed on the screen.

Conclusion

Angular 14 and TypeScript provide powerful tools for building modern web applications. With Angular CLI, you can quickly generate new projects, components, and other Angular artifacts. TypeScript's static typing and class-based object-oriented programming make it easier to write maintainable and scalable code. We hope this introduction and example code will help you get started with Angular 14 and TypeScript.

any Question or query please comment.
Tips for Getting Quality Statistics Assignment Help Online
Tags: statisticsassignmenthelp, domystatisticsassignment, university, education
Published: 2023-04-08 07:34:08

As a statistics student, you are probably familiar with the pressure and stress that come with completing statistics assignments on time. Statistics assignments can be challenging, time-consuming, and require a lot of effort to complete. However, you don't have to struggle with your statistics assignments anymore. By seeking help from a reliable statistics assignment help website, you can get the assistance you need to complete your assignments on time and improve your grades.

If you are searching for "[do my statistics assignment](https://www.statisticsassignmenthelp.com/do-my-statistics-assignment)" online, here are some tips to help you get quality statistics assignment help:

Look for a reliable statistics assignment help website: It's essential to do your research and choose a reliable statistics assignment help website. Look for websites that have experienced and qualified statistics writers, positive reviews from previous clients, and a user-friendly website.

Check the website's pricing and payment options: Before you choose a statistics assignment help website, check their pricing and payment options. Look for websites that offer affordable prices, transparent pricing, and secure payment options.

Provide clear instructions: When you request help with your statistics assignment, provide clear instructions to the statistics tutor. Clearly state your assignment requirements, deadline, and any other relevant details that can help the tutor understand your needs.

Review the completed assignment: Once the statistics tutor completes your assignment, take the time to review it thoroughly. Check for accuracy, completeness, and whether it meets your requirements.

In conclusion, seeking help with your statistics assignment is a smart move that can help you improve your grades and reduce stress. By following the tips outlined above, you can get quality [statistics assignment help](https://www.statisticsassignmenthelp.com/) online and complete your assignments on time. Remember, the key to success is to choose a reliable statistics assignment help website and provide clear instructions to the statistics expert.
Retake your AWS exam for free (should you need it)
Tags: aws, cloud, exam
Published: 2023-04-08 08:47:30

Schedule your AWS Certification exam between March 15, 2023 and May 31, 2023. Apply the promo code during check-out. (Please note: the promo code will not discount the first exam price.)

More info: https://home.pearsonvue.com/Clients/Amazon-Web-Services/free-retake.aspx

Follow [my blog](https://lepczynski.it/en/) and [my YouTube channel](https://www.youtube.com/@WojciechLepczynski) to stay up to date.
This week’s newsletter is out! (08-04-2023) - World Continues To Say No
Tags: javascript, tech, webdev, discuss
Published: 2023-04-08 08:27:09

---
title: This week’s newsletter is out! (08-04-2023) - World Continues To Say No
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

World Continues To Say No

https://markjgsmith.substack.com/p/mark-smiths-newsletter-08-04-2023

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
Why readable code is important.
Tags: programming, devops
Published: 2023-04-08 08:14:42

## Readable Code is Crucial
The importance of readable code cannot be overstated. It directly impacts the speed at which you read, write, and think. Imagine trying to solve a jigsaw puzzle through a blurry lens. The task becomes more difficult, time-consuming, and frustrating.

## Make Code an Art-form 
Readability is an art in itself. Putting effort into making something look nice can be considered art, as it involves attention to detail and aesthetics. This opinion may be controversial, but it is one that experienced developers hold dear.

## Finding a Balance
It is a common mistake to prioritize performance over readability. However, the two are not mutually exclusive. A skilled developer can find a balance between the two, optimizing code for both readability and performance.

## Saturating Comments
While comments can be helpful, they should not be relied upon to make code readable. Instead, developers should put in the time and effort to make code as readable as possible without excessive commenting. Effective use of comments, when necessary, is a hallmark of a skilled developer.

## Relevancy Open Source
In open source projects, consistency is crucial. Linting standards exist for this very reason, as they ensure that the codebase is consistent and readable. Reading a book where each paragraph is written in a different font would be a jarring experience, and the same holds true for code.

## Scalable System Design
Readability is also critical for scalability. As a project increases in size and complexity, having a standard for code becomes even more important. This applies to collaboration as well, as everyone involved must speak the same language to ensure smooth communication.

---

In summary, readability is an essential aspect of coding that should never be overlooked. It is an art form that requires attention to detail and consistency, and it directly impacts both performance and scalability. By prioritizing readability, developers can create code that is not only functional but also enjoyable to read and work with.
Advanced Excel Formulas
Tags: course, certification, training
Published: 2023-04-08 08:07:16

Excel is a tool that every financial analyst uses more frequently than they might like to acknowledge. We have selected the most significant and complex **[Excel formulas](https://youtu.be/UxZR7pXOpOg)** that any top-tier financial analyst needs to be familiar with based on our extensive experience.
1. INDEX MATCH
2. IF combined with AND / OR
3. OFFSET combined with SUM or AVERAGE
4. CHOOSE
5. XNPV and XIRR
Joins in SQL ( Part 02 )
Tags: joins, sql, sqlquery, dataengineering
Published: 2023-04-08 08:01:34

A JOIN statement in SQL is used to combine data from two or more tables based on a common field. It can be used to retrieve data from one table that is related to data in another table. A JOIN statement typically consists of the names of two or more tables, followed by an ON clause that specifies the join conditions. The type of JOIN, such as INNER JOIN, LEFT JOIN, or RIGHT JOIN, also determines how the joined tables are related and what data is returned.
Pyautogui Country Guesser 🌏🤖
Tags: python, beginners, programming
Published: 2023-04-08 07:54:52

Are you trying to learn python? Or are you just struggling with some geography assignment about countries? Well this is the tutorial for you!


**1. Importing The Packages**
Before we start making this thing, Lets start with importing some packages! We of course need [Pyautogui](https://pyautogui.readthedocs.io/en/latest/) installed!

```bash
py -m pip install pyautogui
```

**2. Creating The Program**
Lets start with making a simple while loop to make a little interactive menu!

```py
import pyautogui

def main():
    while True:
        command = input("Enter a command: ")
        if command.lower() == "start":
            pass
        if command == "exit":
            print('Exiting...')
            break
        else:
            print("Invalid Command!")

main()
```

**3. Adding the data**
Lets add some country names into the script, Create a text file  with a cool name! For this tutorial, I named the text file `countries.txt`. Copy and paste the contents in this [Repository](https://github.com/ItsNotAlexy/WorldGuesser/blob/main/data/countries.txt) into your txt file!

**4. Getting all the data**

We can loop through the data inside of the file we created with the `open` function!

```py
def main():
    while True:
        command = input("Enter a command: ")
        if command.lower() == "start":
            time.sleep(1) #Give some time for the user to select the field for entering the country name
            print("Starting...")

            data = open("./countries.txt", "r") #Open the file

            for j in data: #Get everything inside of the txt file
                pyautogui.typewrite(j)
                pyautogui.press("enter") #Press Enter in the keyboard
            
            print("Done!") #Finished process!
        if command == "exit":
            print('Exiting...')
            break
        else:
            print("Invalid Command!")
```

**Congratulations!**
You created your own little automated Pyautogui program! Thanks for reading, Comments are opened for critics and suggestions!
關於throughput
Published: 2023-04-08 07:49:42

講processing性能有時要留意一樣野。

例子:
"10個女人"用10個月可以生產到10個BB。
throughput(吞吐量) = 平均每個月生產到1個BB
但係我地如果想生產一個BB，然後跟據吞吐量，我地俾一個月時間去生產一個BB，件事係唔work。
實際上單個BB，係需要用10個月生產出來。
吞吐量係包含埋平行處理能力。

-----------

當去了解blockchain性能,
除左講求throughput，有幾多transaction per second,
仲需要去了解，實際上單個transaction，幾耐出到個block (confirm = 1)?
實際上去到finalize (confirm = N), 又係要幾耐?

以eth為例,
throughput大約2x-5x trx/s。
佢大約12秒出一個block。
如果要12個confirm，就大約要2-3分鐘，先可以好大機會肯定個transaction係已經完全成功左。