teleren/devto huggingface dataset:
Truthy And Falsy Value In JavaScript.
Tags: javascript, programming, tutorial, react
Published: 2023-03-02 05:34:31

There are two most important terms to understand when you execute some code based on an "if else" statement. Truthy and Falsy value.
Truthy value: Data types that return true by default are called truthy.
False value: Data types that return false by default are called falsy

- All values are truthy except these values 
- +0 or -0
- BigInt zero (0n)
- Empty String ("")
- null, undefined, and NaN

For example below this code we are performing a Linear search. But when I apply a condition for "value not found" I have a complexity for array index 0. Because it's a falsy value if I use the findIndex variable value as an 'if' condition. I solved this in my way. But there have several ways to solve this.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/23f4inlj38bdmn3ppy41.png)
Challenge #7: 🎁 SVG NFT 🎫 Building Cohort Challenge
Tags: web3, blockchain, solidity, javascript
Published: 2023-03-02 04:57:56

## Tasks to be done

Build a SVG NFT of your own!

## My Review

This is a very cool challenge since you get to learn about SVG NFTs. SVG NFTs are great since all the data related to the NFT is stored on the blockchain ⛓️ itself and there is no need of IPFS but its equally a bit costly since the data is being stored on the blockchain. This triggers a thought that maybe even normal images can be stored on blockchain itself, maybe in byte strings 🤔 but will probably end up being too costly! 💸  

You can checkout my own implementation of SVG NFTs, Pinocchio Loogies a collection of 10 special edition loogies where with every mint the length of the nose shrinks by 10%. Feel free to mint some if there are any left 💪

## Important links

- [Speed Run Ethereum](https://github.com/scaffold-eth/scaffold-eth-examples/tree/loogies-svg-nft)
- [Deployed contract](https://polygonscan.com/address/0xd3628c08de1a2788c232732bb06de8dbdae1a3e7)
- [Deployed webapp for minting](https://pinocchio-loogies.onrender.com)
- [Opensea collection](https://opensea.io/collection/pinocchio-loogies)
- [Project source code](https://github.com/kevinjoshi46b/speedrunethereum/tree/master/challenge-7-svg-nft)
9 Days of OpenAI
Tags: ai, github, opensource
Published: 2023-03-02 04:35:14

For 30 days, I plan to test open-source Ai projects on GitHub and learn how to build a project myself. These posts will be short and focus on understanding what things you can create with Ai and what needs to be prepared. 

_image was generated using [midjourney](https://www.midjourney.com/app/jobs/68b476bb-78b3-4c1d-ae63-1a980ab0e7f2/)_

I have been collecting a list of 30 projects created by developers like you and me to test out and look closely at the code. To name a few on my list:

- [Extrapolate](https://extrapolate.app/)
- [Paint by Text](https://paintbytext.chat/)
- [Twitter Bio](https://www.twitterbio.com/)

_Find more AI projects using [OpenSauced](https://insights.opensauced.pizza/ai/repositories/filter/recent)_

Oh and OpenAi is in the title, but this series will also focus on other Ai tools. 

I plan update this post with links to all future posts, so if you want to bookmark this post for later, please do.

Day 1: [AI generated git commit messages](https://dev.to/bdougieyo/ai-generated-git-commit-messages-4j7g)
Day 2: [AI powered search with OpenAI embeddings](https://dev.to/bdougieyo/ai-powered-search-with-openai-embeddings-2990)
Day 3: [AI generated room designs](https://dev.to/bdougieyo/ai-generated-room-designs-3dpm)
Day 4: [AI powered code debugging extensions
](https://dev.to/bdougieyo/ai-powered-code-debugging-extensions-k0g)
Day 5: [AI powered photo aging](https://dev.to/bdougieyo/ai-powered-age-transformation-h94)
Day 6: [AI generated Twitter bios](https://dev.to/bdougieyo/ai-generated-twitter-bio-2lcn)
Day 7: [AI powered movie recommendations](https://dev.to/bdougieyo/ai-powered-movie-recommendations-4h8m)
Day 8: [AI powered census data](https://dev.to/bdougieyo/ai-powered-census-data-2d87)
Day 9: [Build your own ChatGPT starter kit](https://dev.to/bdougieyo/build-your-own-chatgpt-starter-kit-41gm)


Finally, comment links to yours and other projects I should look at. Bonus points if they are open sourced and viewable on GitHub. I aim to get enough exposure to integrate Ai into my projects and live stream.

Stay saucy.
How to build a Twitter sentiment analysis data pipeline?
Tags: twitter, sentiment, datapipeline, sentimentanalysis
Published: 2023-03-02 04:24:35

Despite reports of [application crashes and buffering streams](https://www.simform.com/blog/fifa-world-cup-2022/), the FIFA World Cup 2022 was a tremendous triumph, generating $7.5 billion for FIFA. Let's examine its twitter data and gauge the general public's sentiments regarding specific news events, such as "Argentina winning the FIFA World Cup."

The underlying foundation of our social media analytics pipeline is composed of diverse platforms and relies heavily on the cloud infrastructure provided by Amazon Web Services (AWS). The objective is to assess the general public's feelings regarding recent news events. The system processes data through three successive stages to derive meaningful insights from newly published tweets:

- Initial data ingestion
- Analysis phase
- Data visualization phase

##Data Ingestion

The process of Data Ingestion involves the use of a Java application that connects to the Twitter Streaming API via the Twitter4j library to gather real-time tweets. The application communicates with a MySQL relational database through the JDBC library and stores tweets in the database immediately after publication. The application runs on an AWS Linux EC2 instance, continually ingesting tweets, including those with relevant keywords for sentiment analysis, apart from those containing the phrase "Argentina wins the FIFA World Cup."

##Data Analysis

Data Analysis is carried out using the AWS CloudWatch service, which triggers a serverless Lambda function at regular intervals to filter and analyze English tweets for the positive, negative, neutral, and mixed sentiment. The Lambda function reads unprocessed tweets from the MySQL database and conducts [sentiment analysis](https://www.simform.com/blog/how-to-build-a-real-time-social-media-sentiment-analysis-data-pipeline/), keyword extraction using AWS Comprehend, and location matching using the Python geo-text package.

##Data Visualization

Data Visualization is achieved using AWS QuickSight, which creates a dashboard presenting data visualization analytics about the breakdown of tweet sentiments, most prevalent terms, and user regions. It updates data continually, providing users with a real-time experience. 

The data pipeline for streaming Twitter data comprises the following processes.

- Extract tweets that include particular keywords using the Twitter API and put these tweets into the Kinesis firehose deployed on AWS EC2.
- Create an S3 bucket for storing processed data.
- Set up an Amazon Redshift cluster.
- Configure AWS Glue to continuously ingest data from Kinesis.
- Connect Tableau to Amazon Redshift as a data source and see the graphical representation of data.

Social media data analysis is just one of the many use cases of data engineering pipelines. Billion-dollar companies like Netflix and Samsung have deployed data pipelines to achieve their goals.
Document Plugin for Vue Application
Tags: vue
Published: 2023-03-02 04:01:04

Hi All,
Looking for feedback from the community. We are building an application for document management using Vue framework and looking for free plugin that we can use to open the documents saved on the application. The documents can be of the following types:
Word
Excel
PDF
JPEG
PNG
Image
Video
others.....
Any feedback/suggestion will be greatly appreciated.
AJ
So, I want to make an IDE like replit. How? 🤔
Tags: webdev, beginners
Published: 2023-03-02 03:33:16

**I want to make an IDE like replit**
Now, you may think this is impossible, but with good planning, it shouldn't be. First, I'll make it a frontend IDE, and then extend it to a fullstack IDE if possible. Any tips/suggestion?
443. Leetcode Solution in cpp
Tags: cpp
Published: 2023-03-02 03:30:30

===============================================================
#description:
Given an array of characters chars, compress it using the following algorithm:

Begin with an empty string s. For each group of consecutive repeating characters in chars:

If the group's length is 1, append the character to s.
Otherwise, append the character followed by the group's length.
The compressed string s should not be returned separately, but instead, be stored in the input character array chars. Note that group lengths that are 10 or longer will be split into multiple characters in chars.

After you are done modifying the input array, return the new length of the array.

You must write an algorithm that uses only constant extra space.

 

Example 1:

Input: chars = ["a","a","b","b","c","c","c"]
Output: Return 6, and the first 6 characters of the input array should be: ["a","2","b","2","c","3"]
Explanation: The groups are "aa", "bb", and "ccc". This compresses to "a2b2c3".
Example 2:

Input: chars = ["a"]
Output: Return 1, and the first character of the input array should be: ["a"]
Explanation: The only group is "a", which remains uncompressed since it's a single character.
Example 3:

Input: chars = ["a","b","b","b","b","b","b","b","b","b","b","b","b"]
Output: Return 4, and the first 4 characters of the input array should be: ["a","b","1","2"].
Explanation: The groups are "a" and "bbbbbbbbbbbb". This compresses to "ab12".
 

Constraints:

1 <= chars.length <= 2000
chars[i] is a lowercase English letter, uppercase English letter, digit, or symbol.
============================================================
#solution:
```cpp
class Solution {
 public:
  int compress(vector<char>& chars) {
    int ans = 0;

    for (int i = 0; i < chars.size();) {
      const char letter = chars[i];
      int count = 0;
      while (i < chars.size() && chars[i] == letter) {
        ++count;
        ++i;
      }
      chars[ans++] = letter;
      if (count > 1)
        for (const char c : to_string(count))
          chars[ans++] = c;
    }

    return ans;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/string-compression/
latest Shimla news in Hindi
Tags: shimla, news, hindi, himachal
Published: 2023-03-02 03:09:24

We bring you the [latest Shimla news in Hindi](https://www.myhimachalnews.com/category/latest-himachal-news/shimla-news/), [शिमला की ताज़ा ख़बर](https://www.myhimachalnews.com/category/latest-himachal-news/shimla-news/), Latest शिमला न्यूज़, [latest shimla news](https://www.myhimachalnews.com/category/latest-himachal-news/shimla-news/), [शिमला न्यूज़](https://www.myhimachalnews.com/category/latest-himachal-news/shimla-news/). As a popular multi-platform, we ensure to deliver excellence and credibility while publishing the [latest breaking Shimla news in Hindi](https://www.myhimachalnews.com/category/latest-himachal-news/shimla-news/). Our online website publishes the latest editions of the most popular international brands.

Our multi-news portal provides exclusive, accurate, and speedy content and is devoid of all kinds of frills. We bring you news that will have an impact on various segments of society. With an enviable portfolio, we attract the attention of news readers throughout Shimla.
Latest Kangra breaking news in Hindi
Tags: news, kangra, himachal, shimla
Published: 2023-03-02 03:05:27

We have become the readers' number-one choice for delivering the [latest Kangra breaking news](https://www.myhimachalnews.com/category/latest-himachal-news/kangra-news/). We are focused on publishing premium-quality videos, content, and ground-breaking stories. You do not need to worry about the credibility and authenticity of the [latest Kangra breaking news in Hindi](https://www.myhimachalnews.com/category/latest-himachal-news/kangra-news/) as you read our [Kangra news](https://www.myhimachalnews.com/category/latest-himachal-news/kangra-news/) from our news portal. Every month, our site receives over 150 million video views.
Today Himachal News In Hindi
Tags: himachal, news, kangra
Published: 2023-03-02 03:02:45

We are focused on publishing [Today Himachal News Live in Hindi](https://www.myhimachalnews.com/) on our news website [MyHimachalNews.com](https://www.myhimachalnews.com/). As you go through our newspaper daily, you will be able to enjoy premium quality content, ground stories, and videos.  It is possible to find credible news as long as you check out the website regularly. He has several million worldwide visitors. You can read the Latest Breaking Himachal Pradesh News in Hindi on Apple and Android devices every day, making it easy for potential readers to stay up to date on the latest news.

https://www.myhimachalnews.com/
Daily UX Writing Challenge Day 2
Tags: ux, uxwritin, beginners
Published: 2023-03-02 02:18:45

[Day 1](https://dev.to/fuwa/daily-ux-writing-challenge-day-1-50la)

![Challenge: Write a promotional screen for an app that lets a user choose teams, sends game reminders, real-time score updates and highlight videos.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t174h8gu7p048ixtw44n.png)

The challenge this time was on a topic I had no interest in and knew very little about. However, e-sports is something I do know about so I based the promo text on that. I would of loved to have an app that notified me of every VCT game with updates on the scores and highlights!

I used to have League of Legends and Valorant championship games in the background at work while creating desserts.
5 APIs Every Front-end Developer Should Know.
Tags: webdev, productivity, api, frontend
Published: 2023-03-02 02:00:55

As a developer, there are many instances where you’ll need to use an API. From building a simple portfolio project or a prototype to building robust real-time applications.

APIs saves us the hustle of reimplementing a logic by simply providing an interface to help with the functionalities we wish to have in our application. 

Here are five APIs that I love and I think you should try them out.

###1. JSON Placeholder API.

The JSON placeholder API is a RESTFUL API for fake content. It’s a go-to API if you need to make a quick prototype for a blog or website. From this API, you can get data for posts, comments, users etc.

**Features of the API:**

- Endpoints to make CRUD operations.
- Free to use.
- No keys are required.

Learn more about it on their [website](https://jsonplaceholder.typicode.com/).

###2. Fakestore API.

Like JSON placeholder it provides fake content but is more tailored for e-commerce prototypes.  You can fetch product data, reviews, and more from their restful endpoints.

**Features of the API:**

- REST endpoints to make CRUD operations.
- Free to use.
- No keys are required.

Learn more about the API on their [website](https://fakestoreapi.com/).

###3. Auth0.
Auth0 is a platform for user authentication and authorization. It provides an easy interface to implement authentication methods like multifactor authentication, social logins, and even authorization to backend services.

**Some features of the API:**

- Provides customizable login screens
- Free plan of up to 7000 active users
- Provides analytics.

Learn more about the API on their [website](https://auth0.com/).

###4. Stripe API.

The stripe API helps a developer implement stripe's payment platform in his application. The API provides a more robust and secure way to handle payments in applications.

 **Features of the API:**

- REST endpoints to make CRUD operations.
- Provides webhook endpoint.
- Requires key for authentication.

Learn more about it on their[website](https://stripe.com/docs/api).

###5. Counter API.

The counter API provides an interface to implement a counter into our application. The counter API can be used to keep track of numbers on your application. For example, the number of times a button has been clicked.

**Features of the API:**

- Completely free to use.
- No rate limits.
- Requires key.

Learn more about it on their [website](https://countapi.xyz/).

**Conclusion.**
Although this post is limited to a few APIs there are a ton of other APIs out there to help you build any robust app you have ever dreamed of.

If you find this article helpful please react to this post and share your thought about these APIs, you can even comment below some of the APIs you know and I’d love to try them out.
Why and How to Use Unattended-Upgrades on a Ubuntu server?
Tags: ubuntu, automation
Published: 2023-03-02 01:51:02

> SysAdmins already have enough on their plate without having to manually update their systems every day!

## Why Use Unattended-Upgrades?

Keeping software up-to-date is crucial for security reasons, as updates often include patches for vulnerabilities. However, it can be time-consuming and inconvenient to manually update packages regularly. This is where Unattended-Upgrades comes in.

Unattended-Upgrades is a package for Ubuntu that allows automatic installation of security updates. This means that critical updates are installed without user intervention, reducing the risk of security breaches and keeping your system secure.

## How to Install and Configure Unattended-Upgrades

1. Install the Unattended-Upgrades package by running the following command:

    ```
    sudo apt-get install unattended-upgrades
    ```

2. Edit the configuration file `/etc/apt/apt.conf.d/50unattended-upgrades` to enable automatic security updates. Uncomment the following line:

    ```
    //Unattended-Upgrade::Allowed-Origins {
    //        "${distro_id}:${distro_codename}-security";
    //  //      "${distro_id}:${distro_codename}-updates";
    //};
    ```

    So it looks like this:

    ```
    Unattended-Upgrade::Allowed-Origins {
            "${distro_id}:${distro_codename}-security";
            "${distro_id}:${distro_codename}-updates";
    };
    ```

    This tells Unattended-Upgrades to automatically install updates from the security repository and the main repository.

3. Enable automatic updates by editing the configuration file `/etc/apt/apt.conf.d/20auto-upgrades`. Uncomment the following lines:

    ```
    APT::Periodic::Update-Package-Lists "1";
    APT::Periodic::Unattended-Upgrade "1";
    ```

    This tells the system to update the package lists and install security updates automatically.

4. Configure email notifications (optional). By default, Unattended-Upgrades sends an email to root whenever an update is installed. To configure email notifications, edit the configuration file `/etc/apt/apt.conf.d/50unattended-upgrades` and add the following lines:

    ```
    Unattended-Upgrade::Mail "youremail@example.com";
    Unattended-Upgrade::MailOnlyOnError "true";
    ```

    Replace `youremail@example.com` with your email address.

5. Restart the Unattended-Upgrades service to apply the changes:

    ```
    sudo systemctl restart unattended-upgrades
    ```

That's it! Your Ubuntu system is now configured to automatically install security updates. You can rest easy knowing that your system is up-to-date and secure.
New beginnings
Tags: javascript, webdev, programming, react
Published: 2023-03-02 01:20:15

Hello my name is Felix, first and foremost thanks for taking time off your day to read my post. Starting march, I am going on a once in a lifetime coding bootcamp journey with UNC. I'm going to be diving deep into HTML, CSS, JS and the MERN stack. I'm excited to be part of this community and world. I hope whoever reads this have a blessed and exciting day!

https://github.com/FelixW01
⚖️ Legal Compliance for Web Apps: Considerations
Tags: javascript, webdev, react, internationalization
Published: 2023-03-02 00:30:00

<img src="https://media.giphy.com/media/l2JdUj4H5c93Uih3O/giphy.gif">

Legal compliance for web apps can differ from country to country, and failure to comply with regulations can result in hefty fines, lawsuits, and reputational damage. The following are some legal requirements that web apps must consider to ensure compliance:

1. **Privacy laws** 🔒- App must follow data protection laws that govern the collection, storage, and processing of personal data. This includes providing clear privacy policies and obtaining user consent for data collection and use.
2. **Intellectual property laws** 💡- App must ensure that they are not infringing on any trademarks, copyrights, or patents.
3. **Accessibility laws** ♿️- App must comply with accessibility laws that ensure people with disabilities can use and access the app. you can use libraries like `react-aria` or `react-axe` to ensure that components are properly labeled and provide keyboard navigation options. Additionally, you can ensure adequate the color contrast.
4. **Consumer protection laws** 👨‍👩‍👧‍👦- App must comply with consumer protection laws that regulate fair trade practices, pricing transparency, and refund policies. You can use libraries like `axios` to make secure API calls and `react-cookie` to manage cookies and obtain user consent for non-essential cookies.
5. **E-commerce laws**  💳- App that engage in e-commerce must comply with regulations around online transactions, such as data security and payment processing.

An example of legal compliance for a web app can be seen in the General Data Protection Regulation (GDPR) in the European Union (EU). The GDPR is a comprehensive data protection law that came into effect in May 2018. It regulates the collection, storage, and processing of personal data for all EU citizens and applies to all companies operating within the EU, as well as those outside the EU that offer goods or services to EU citizens.

## To comply with the GDPR, web apps must:

1. Obtain user consent for data collection and use.🙋‍♀️
2. Provide a clear privacy policy that explains how user data is collected, processed, and stored.📄
3. Allow users to access, modify, or delete their personal data.🔍
4. Implement data security measures to protect user data.🔒
5. Notify users of data breaches within 72 hours of discovery.🚨

> Failure to comply with the GDPR can result in fines of up to 4% of a company's global annual revenue or €20 💸 million, whichever is greater.

In conclusion, legal compliance for web apps is crucial to protect your business from legal risks and ensure that you're adhering to regulations around the globe. By understanding the legal requirements in different countries and regions, you can ensure that your web app is compliant and avoid any legal pitfalls.🚀