teleren/devto huggingface dataset:
Verify Your Smart Contract Code
Tags: solidity, verification, blockchain, hardhat
Published: 2023-06-13 15:02:13

**Overview**
Self-executing contracts, or "smart contracts," are kept on a blockchain. They are implemented on the blockchain network using coding languages like Solidity. Smart contracts are utilised in many blockchain applications, including decentralised finance (DeFi), non-fungible tokens (NFTs), and others, to automate different procedures and transactions.

**Why Verify a Smart Contract?**

- **Transparency:** Decentralisation and transparency are two of the most crucial elements of Web 3. The community gains more trust when you open-source your project's smart contracts, allowing anybody to review the code and make suggestions for changes.

- **Security:** After your smart contract has been certified, it will essentially have more eyes on it, and smart contract specialists can find any potential flaws. The disadvantage is that someone (a black hat) might discover the weakness first and use it to abuse your contract.

- **Innovation & acceptance:** Since other developers can fork your code, add features, and keep building on top of it, open-sourced code encourages more innovation and acceptance. thereby resulting in a development ecosystem that is more active and has a quick learning curve.

**Four Method to Verify Smart Contract**

- Remix IDE 
- Hardhat 
- Ether Scan 
- Brownie

**We Discuss the Hardhat Verification in this Blog**

Hardhat is a popular smart contract development framework, and it's fairly simple to verify your source code. Note that you'll need an `**Etherscan API Key**` to verify your source code.

You Need to install 
`npm install --save-dev @nomiclabs/hardhat-etherscan`
in your project 

Update your **hardhat.config.js** file to include the etherscan object and your Etherscan API key.

```
module.exports = {
  networks: {
    goerli: { ... }
  },
  etherscan: {
    apiKey: "YOUR_ETHERSCAN_API_KEY"
  }
};

```
Then, run the following command to verify your source code:

`npx hardhat verify --network goerli DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1"`

That's so simple isn't it ...

Happy Coding ....
Create beautiful Bar Chart using Chart.js and Tailwind CSS
Tags: webdev, chartjs, tailwindcss, ui
Published: 2023-06-13 15:01:58

```
<div class="container mx-auto px-4">
  <div class="card bg-white rounded-lg shadow-lg">
    <div class="card-header bg-gray-100 py-4 px-6">
      <h2 class="text-xl font-bold">Bar Chart</h2>
    </div>
    <div class="card-body">
      <canvas id="barChart"></canvas>
    </div>
  </div>
</div>

```

JavaScript (using Chart.js):

```
import Chart from 'chart.js';
const data = {
  labels: ['January', 'February', 'March', 'April', 'May', 'June'],
  datasets: [
    {
      label: 'Sales',
      data: [120, 200, 150, 300, 250, 180],
      backgroundColor: [
        'rgba(129, 212, 250, 0.8)',
        'rgba(129, 212, 250, 0.8)',
        'rgba(129, 212, 250, 0.8)',
        'rgba(129, 212, 250, 0.8)',
        'rgba(129, 212, 250, 0.8)',
        'rgba(129, 212, 250, 0.8)',
      ],
      borderColor: [
        'rgba(59, 130, 246, 1)',
        'rgba(59, 130, 246, 1)',
        'rgba(59, 130, 246, 1)',
        'rgba(59, 130, 246, 1)',
        'rgba(59, 130, 246, 1)',
        'rgba(59, 130, 246, 1)',
      ],
      borderWidth: 1,
    },
  ],
};

const options = {
  scales: {
    x: {
      display: false,
    },
    y: {
      display: false,
    },
  },
};

const ctx = document.getElementById('barChart').getContext('2d');
new Chart(ctx, {
  type: 'bar',
  data: data,
  options: options,
});

```

CSS (using Tailwind CSS):

```
.container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  width: 400px;
}

.card-header {
  border-bottom-width: 1px;
  border-color: rgba(0, 0, 0, 0.1);
}

.card-body {
  height: 300px;
}

canvas {
  width: 100% !important;
  height: 100% !important;
}

```
In the above example, we create a bar chart using Chart.js and customize the appearance using Tailwind CSS classes. 

The chart is displayed within a card component, and the x-axis and y-axis labels are removed by setting display: false in the chart options. 

The card component has a rounded border (rounded-lg) and a shadow (shadow-lg) applied. 

The bar chart uses a gradient background (bg-gradient) defined in the dataset's backgroundColor property.

Include this chart.js cdn inside head.
TIL you can re-order your commit history through rebase -i
Published: 2023-06-13 14:42:53

Suppose you have a commit history like this:

```bash
commit 5: Refactor code for better performance
commit 4: Add new feature: user authentication
commit 3: Fix typo in README file
commit 2: Update documentation with usage instructions
commit 1: Initial commit with project setup
```

And then you have a new commit "Another README for user authentication" that should go after commit 4 and before commit 5:

```bash
commit 6: Another README for user authentication
commit 5: Refactor code for better performance
commit 4: Add new feature: user authentication
commit 3: Fix typo in README file
commit 2: Update documentation with usage instructions
commit 1: Initial commit with project setup
```

Then using `git rebase -i HEAD~x` (where x represents the number of commits you want to include in the rebase) you can re-order the commit history with relative ease, like this:

```bash
git rebase -i HEAD~6
```

This opens up your editor as usual

```bash
pick 6: Another README for user authentication
pick 5: Refactor code for better performance
pick 4: Add new feature: user authentication
pick 3: Fix typo in README file
pick 2: Update documentation with usage instructions
pick 1: Initial commit with project setup
```

And moving the commit to where you want

```bash
pick 5: Refactor code for better performance
pick 6: Another README for user authentication
pick 4: Add new feature: user authentication
pick 3: Fix typo in README file
pick 2: Update documentation with usage instructions
pick 1: Initial commit with project setup
```

Save then close the editor and it's done. Confirm in your git log before pushing remotely

```bash
commit 6: Refactor code for better performance
commit 5: Another README for user authentication
commit 4: Add new feature: user authentication
commit 3: Fix typo in README file
commit 2: Update documentation with usage instructions
commit 1: Initial commit with project setup
```
Top 11 .NET Libraries Every Developer Should Know
Tags: webdev, programming, aspdotnet, javascript
Published: 2023-06-13 14:39:59

As of my knowledge cutoff in September 2021, here are 11 important .NET libraries that every developer should know:

1. Entity Framework (EF): EF is an object-relational mapping (ORM) framework that simplifies database access for .NET applications. It provides an easy way to interact with databases using object-oriented principles.

2. ASP.NET Core: ASP.NET Core is a cross-platform, high-performance framework for building modern web applications. It includes a rich set of libraries for building web APIs, MVC applications, and web pages.

3. Newtonsoft.Json: Newtonsoft.Json (also known as Json.NET) is a popular JSON framework for .NET. It provides powerful tools for serializing and deserializing JSON data, making it easy to work with JSON in .NET applications.

4. AutoMapper: AutoMapper is a library that simplifies object-object mapping in .NET applications. It helps eliminate repetitive mapping code by automatically mapping properties between objects.

5. NUnit: NUnit is a unit testing framework for .NET. It provides a simple and expressive syntax for writing unit tests and comes with a rich set of assertions for verifying the correctness of your code.

6. Moq: Moq is a mocking framework for .NET that helps with creating mock objects for unit testing. It allows you to easily isolate dependencies and simulate behavior in your tests.

7. Dapper: Dapper is a lightweight and fast micro-ORM (Object-Relational Mapping) for .NET. It provides a simple API for executing SQL queries and mapping query results to objects, making database access in .NET applications efficient and straightforward.

8. Serilog: Serilog is a flexible and extensible logging library for .NET. It supports structured logging and allows developers to customize log sinks, making it easier to collect and analyze application logs.

9. SignalR: SignalR is a real-time communication library for .NET. It enables bi-directional communication between clients and servers, making it easier to build applications with real-time features like chat, notifications, and live updates.

10. Polly: Polly is a resilience and transient-fault-handling library for .NET. It provides policies for handling common fault scenarios such as retries, circuit breaking, and timeouts, making your applications more resilient and robust.

11. AutoMapper: AutoMapper is a library that simplifies object-object mapping in .NET applications. It helps eliminate repetitive mapping code by automatically mapping properties between objects.

Please note that the software development landscape is constantly evolving, and there may be new libraries and frameworks available beyond my knowledge cutoff date. It's always a good idea to stay up to date with the latest tools and libraries in the .NET ecosystem.
Solving Adding another git repository inside another repository
Tags: opensource, git, github
Published: 2023-06-13 14:28:04


I recently came across the situation where we push the project and as soon as we run **git add .** command, we get the following warning:

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

And when we push this project, we find that a submodule has been pushed into the project repository. The outer git repository ignores the inner git repository and the inner git repository is called the module. 

I came across the solution for solving this: 
Step1: run command **ls -a** (In git bash terminal)
Step2: run command **rm -rf .git** (remove **.git**)
Step3: Again, run **git add .** and commit the changes. 

Related articles:
https://stackoverflow.com/questions/67962030/warning-adding-embedded-git-repository-when-adding-a-new-create-react-app-fol

https://gist.github.com/claraj/e5563befe6c2fb108ad0efb6de47f265
Monthly Amazon Location Service Updates - 2023.05
Tags: amazonlocationservice, amplifygeo, amplify, amazonlocationserviceupdates
Published: 2023-06-13 14:06:46

![img](https://day-journal.com/memo/images/logo/aws/location-service.png)

### Monthly Amazon Location Service Updates - 2023.05

<br>

This is a summary of the May updates for Amazon Location Service.

<br>

## 2023.05 Updates

[Political views added](https://docs.aws.amazon.com/location/latest/developerguide/map-concepts.html#political-views)
Political views of India have been added in the style of Esri and Open Data.

<br>

## Other Info

[Amazon Location Service Developer Guide](https://docs.aws.amazon.com/location/latest/developerguide)
Official Amazon Location Service Documentation.

[Amplify Geo Docs](https://docs.amplify.aws/lib/geo/getting-started/q/platform/js)
Official Amplify Geo Docs.

[Amazon Location Service Samples](https://github.com/aws-samples/amazon-location-samples)
Official Amazon Location Service samples.

[amazon-location-service-starter](https://github.com/dayjournal/amazon-location-service-starter)
Build environment to get started with Amazon Location Service.

[A Summary of How to Build Amplify Geo and Amazon Location Service](https://dev.to/aws-builders/a-summary-of-how-to-build-amplify-geo-and-amazon-location-service-5hal)
Summary of Amazon Location Service and Amplify Geo. (as of December 2021)  

[dev.to](https://dev.to/dayjournal)
Articles on Amazon Location Service.

[tags - Amazon Location Service](https://day-journal.com/memo/tags/Amazon-Location-Service)
[tags - Try](https://day-journal.com/memo/tags/Try)
Notes on Amazon Location Service. (Japanese)

<br>

## Related Articles

{% link https://dev.to/aws-heroes/monthly-amazon-location-service-updates-202304-4naj %}
📱 Ready to stand out from the competition and take your #business to the next level 🚀 ?
Tags: business, mobileapp, developers, hiring
Published: 2023-06-13 14:00:26

Find out how #mobileApp development can improve your business and let Devler.io match you with #vetted mobile App #developers from the **Devs Network**. 💪
[Go!](https://devler.io/hire-mobile-app-developers )
Why Pidgin 3 Skipped GTK 3
Tags: opensource, development, repost
Published: 2023-06-13 14:00:00

> This article was originally posted on [Patreon](https://www.patreon.com/posts/why-pidgin-3-gtk-80606116) and has been brought over here to get all of the [Pidgin](https://pidgin.im) Development/History posts into one single place.

Every once in a while people will ask when we're going to release a GTK3 version of Pidgin and they get very surprised when I say never! The simple reason for that is that we've already moved to GTK4.

When the Pidgin 3 branch was originally created eons ago, there wasn't a GTK3, so it was still all hand build GTK2 via C code. Somewhere around 2010 (I couldn't find an exact commit when this happened) we started porting the Pidgin 3 branch to GTK3, but it wasn't a clean port.

At the time not all distributions had GTK3 so we still needed to leave support for GTK2. As you may have guessed, this meant a lot of duplicated code was floating around and everything was still very GTK2 like. It wouldn't be until [December of 2015](https://keep.imfreedom.org/pidgin/pidgin/rev/07dcc28b6039) that we officially dropped GTK2 support from the Pidgin 3 branch.

So work continued migrating stuff to be more GTK3 like by using new widgets and more importantly using GtkBuilder ui files to build the interface. The primary reasoning for the ui files is that we're much more likely to find designers and user experience people that know GtkBuilder than ones that are fluent in C and know the GTK api.

In [February of 2022](https://keep.imfreedom.org/pidgin/pidgin/rev/31072565a926) we started the port to GTK4. This time we were doing a full port to GTK4 only and completely removing GTK3. This decision was made because we knew we still had a lot of development left to do and we didn't want to release a new major version of Pidgin on a maintenance only toolkit.

It took a little under seven months, but in [August of 2022](https://keep.imfreedom.org/pidgin/pidgin/rev/983b2a56b270) we merged the GTK4 branch into our development branch. Since then we've continued migrating more things to GtkBuilder as well as modernizing more of the user interface.

However we still have a bit of work to do as GTK 4.10 is deprecating GtkTreeView and GtkComboBox and there's a number of other things we need to handle in the user interface. But regardless we're in a much better spot now than if we had continued moving forward with GTK3.

I hope you're enjoying these posts! Remember they go live for patrons at 9AM CST on Mondays and go public at 12AM CST on Thursdays! If you'd like to support my work, you can join find a list of ways to do so [here](https://imfreedom.org/donate/#gary-kramlich).
JSON serialization benchmarks in JavaScript
Tags: javascript, json, typescript, codec
Published: 2023-06-13 13:50:54

When you pick a binary JSON serializer from NPM, make sure to check the benchmarks. As it stands, if you need to use CBOR or MessagePack, your best bet is to use `json-joy`, `msgpackr` or `cbor-x`. Maybe, if you really like the features of `@msgpack/msgpack`, you can use that, but it is not as fast as the other three. Pretty much all other NPM packages are significantly slower than the three mentioned above — if you just pick a random package from NPM, you will most likely get **an order of magnitude worse performance** than what built-in `JSON` global provides.

`json-joy` NPM package ships zero-dependency open source `json-pack` module, which is the fastest implementations of MessagePack, CBOR, and JSON codecs available for JavaScript. How fast is it?

[In this benchmarking blog post](https://jsonjoy.com/blog/json-codec-benchmarks) we take a look at serialization speeds of various NPM implementations of JSON-like codecs, such as MessagePack, CBOR, JSON, UBJSON, and Amazon Ion.
Cloud Firestore data management sucks!
Tags: firebase
Published: 2023-06-13 13:45:51

I recently closed my previous startup.

A failed attempt to build an AI assistant to measure engagement and sentiment. It failed not because the product was not amazing, it failed because we didn't find a way to acquire customers. It was a complex product, and we were using firebase to manage user authentication and store data.

This is when I realised that managing data in Firestore sucks. Don't get me wrong. Firestore is amazing for prototyping and getting a product to production fast. But when it comes to running migrations and manage the data stored, the interface is lacking. Sure, you can filter, add, remove and update fields, but it takes forever.

So I'm building [tworows](https://tworows.unicornplatform.page) to solve that problem.

Here's what I want.

A user-friendly table interface designed specifically to make data management in Firestore a breeze and save time to do more exciting things!

That's it. A simple product that solves one specific problem. 

From the business perspective, I want to offer extreme value for money. No one want's to click 3 times just to update a single field. My hope is to build a product that saves time and doesn't get in your way. Think "one click away to make a change". I am thinking of charging $1 a month / user.

Here's the basic plan:

Figure out the marketing channels that work.

Get 100 signups to the waiting list.

Engage with the users and find out if I'm up to something.

Build the MVP.

Launch the MVP. 

If you're as excited as I am and want to give early feedback, please sign up to the [waiting list](https://forms.gle/ByyHB1tQsgwj78Pt8), it will help me tremendously!

Thank you for reading.

Pavel
How can I handle user input and perform calculations in real-time within a calculator program developed with C and Python?
Published: 2023-06-13 13:40:04

To handle user input and perform real-time calculations within a calculator program developed with C and Python, you can follow these steps:

Display a Welcome Message: Start your calculator program by displaying a welcome message or a brief description of the calculator's functionality to [jumbolon sheet in pakistan](https://thermoinsulations.com/jumbolon-insulation-board-sheet-price-in-pakistan/)

Prompt for User Input: Use the appropriate function or method to prompt the user for input. In C, you can use scanf or fgets functions, while in Python, you can utilize the input function.

Read User Input: Read the user's input and store it in a variable for further processing. Ensure that you handle input validation to handle incorrect or invalid input gracefully.

Parse Input and Perform Calculations: Extract the necessary operands and the mathematical operation from the user's input. Use conditional statements or switch cases to identify the operation to be performed. Then, implement the corresponding calculation logic based on the selected operation.
What is DevOps
Tags: webdev, devops, beginners
Published: 2023-06-13 13:34:49

## What is a Devops? 
- DevOps integrates developers and operations teams in order to improve collaboration and productivity by automating infrastructure, automating workflows and continuously measuring application performance. 

## What it's focus on?

1. Especially Automation(automate code testing workflows, infrastructure and everything)

2. To split  Big software into small chunks; which are integrated, tested monitored and deployed usually in hours.  

3. It is more efficient compare to traditional way of writing large chunks of software over weeks or months to do testing. 
Moreover they will have an identical development and production environments based on the same configurations.

4. Writing small chunks of code will allow to increase frequency of deployments and improve the time to deploy new codes. 

5. It also enables them to adopt an iterative process to monitor, measure and improve the code and operations everyday.

6. It improve the ability to respond to market needs, or other things that impact software

7. This would implement to adopt a discipline of application performance monitoring and optimization in almost real-time.


## Traditional Way 

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

## Nowadays

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rljr958oermau5brskvi.png)
Exploring Laravel's Unique Rule: Enforcing Field Uniqueness in Validation
Tags: laravel, php, beginners, tutorial
Published: 2023-06-13 13:30:17

When building a web application, ensuring the uniqueness of certain fields like email and username is paramount. Laravel provides a clean and straightforward approach to implement this through the `unique` validation rule. This blog post aims to explore Laravel's `unique` rule, offering a step-by-step guide with code examples to effectively enforce field uniqueness in validation.

##Laravel's Unique Rule##
Laravel's unique validation rule is used to ensure that a specific field's value is unique in a given database table. The `unique` rule's basic structure is:
```
'email' => 'unique:users'
```
In this case, Laravel will ensure that the `email` field is unique within the `users` table.


##Applying Unique Rule##
Let's say we're building a registration form and want to ensure that a user's email address hasn't been registered before. Here's how you'd do it:
```
public function store(Request $request)
{
    $validatedData = $request->validate([
        'name' => 'required|max:255',
        'email' => 'required|email|unique:users',
        'password' => 'required|min:8',
    ]);

    // Proceed to store user data...
}
```


##Ignoring A Field For Unique Rule##
Sometimes, during update operations, you want to ignore the current record for the unique validation rule. For instance, when a user updates their profile, their email should remain `unique`, but the validation should ignore the user's current email address. Laravel allows you to do this using the `ignore` method:
```
use Illuminate\Validation\Rule;

Validator::make($data, [
    'email' => [
        'required',
        Rule::unique('users')->ignore($user->id),
    ],
]);
```
In this example, the unique `rule` will enforce that the `email` is unique, ignoring the current user's email.


##Customizing Column Name##
By default, Laravel assumes that the column's name in the database matches the field's name in the form. However, if the column's name is different, you can specify the column's name in the unique rule:
```
'email' => 'unique:users,email_address'
```
Here, Laravel will enforce that the `email` field's value is unique in the `email_address` column of the users table.


##Conclusion##
In essence, Laravel's `unique` validation rule provides a robust, intuitive way to ensure data uniqueness in your applications. By understanding and leveraging this rule effectively, you can enhance your web application's data integrity and user experience.

Remember, validation is a key aspect of web application development. The more effective your validation rules are, the more secure and user-friendly your application becomes. Happy coding with Laravel!

_Ready to become a Laravel Padawan?_

_🌟📚 Unlock the power of Laravel development with my ebook, “Laravel Padawan”_

_Level up your skills and build robust web applications. Get your copy now and embark on your coding journey! 💪🚀_

_https://rodolfovmartins.gumroad.com/l/laravel-padwan_