teleren/devto huggingface dataset:
Next.js Vs React.Js: What you need to know
Tags: javascript, webdev, react, nextjs
Published: 2024-06-28 09:39:13

React and NextJS are tools becoming more popular this days, with a lot of similarities, and people often ask what are the diffences between this two and which one should i use?

Before we can talk about the differences between this two we need to first understand what exactly they are.

## React
React is a frontend library for building user interfaces with JavaScript and JSX. React works based on components, which are JavaScript functions that return JSX.
React also makes use of the Virtual DOM, which uses state management  and only  re-renders components that changes instead of the whole DOM.
React also provides us with hooks, such as useState and more which are used to basically to control state changes and side effects.

## NextJS
Next.js on the other hand isn't a library, but a React framework, NextJS uses React but only as a framework of React. Next.js offer's a lot of additional features to React such as server side rendering, static optimization e.t.c. 
Next.js also allows you to build a complete full stack project with it's API routes

## Major Differences
### React

- React is a JavaScript Library

- In React all JavaScript Code is loaded by the browser

- React is developed by Meta

- You can only build frontend user interfaces with React

### Next.js

- Next.js is a React framework

- Next.js supports server side rendering, meaning not all JavaScript code is loaded by the browser

- Next.js is developed by Vercel

- Next.js allows you to build a complete full stack, thanks to it's API routes

## Conclusion
Use React if you want to build a simple web interface, that has a continous life state changing.
But for Larger applications requiring complex backends, use Next.js to offer server side rendering and all in one full stack capabilities.

_Note: For tech internship's you can visit [hng.tech/internship](https://hng.tech/internship) or Jobs at [hng.tech/hire](https://hng.tech/hire)_
C# IEnumerables
Published: 2024-06-28 02:54:53

## Key Points:

### What is IEnumerable?

- `IEnumerable` is an interface in C# that allows you to iterate over a collection of items.
- It is found in the `System.Collections` namespace for non-generic collections and `System.Collections.Generic` namespace for generic collections.

### Methods and Properties

- The primary method in `IEnumerable` is `GetEnumerator()`, which returns an `IEnumerator`.
- `IEnumerator` provides the necessary methods (`MoveNext()`, `Reset()`) and property (`Current`) to iterate over a collection.

### Common Usage

- `IEnumerable` is commonly used with `foreach` loops to traverse collections such as arrays, lists, and other data structures.
- It provides a standard way to iterate over any collection that implements the interface.

### Examples of Methods

- **`OfType<TResult>(IEnumerable)`**: Filters the elements of an `IEnumerable` based on a specified type.
- **`Concat<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)`**: Concatenates two sequences.
- **`GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)`**: Groups the elements of a sequence according to a specified key selector function.
Operadores em Java
Tags: java
Published: 2024-06-28 02:47:59


**Tipos de Operadores**

**Aritméticos:**
- Realizam operações matemáticas básicas.

**Bitwise:** Operam sobre bits.
**Relacionais:** Comparam valores.
**Lógicos:** Realizam operações lógicas.

**Operadores Aritméticos**

**Operadores Básicos:**
+ Adição
- Subtração
* Multiplicação
/ Divisão
% Módulo (resto da divisão)

**Operadores Unários:**
+ Mais unário
- Menos unário

**Operadores de Incremento e Decremento:**
++ Incremento (adição de 1)
-- Decremento (subtração de 1)

**Comportamento dos Operadores Aritméticos**
- Operam em tipos numéricos e em char.

**Divisão de Inteiros:** Trunca o resto.

**Exemplo:** 10 / 3 resulta em 3.
**Operador Módulo:** Gera o resto da divisão.
**Exemplo:** 10 % 3 resulta em 1.

- Pode ser aplicado a tipos inteiros e de ponto flutuante.

```
class ModDemo {
    public static void main(String args[]) {
        int iresult = 10 / 3;
        int irem = 10 % 3;
        double dresult = 10.0 / 3.0;
        double drem = 10.0 % 3.0;
        System.out.println("Result and remainder of 10 / 3: " + iresult + " " + irem);
        System.out.println("Result and remainder of 10.0 / 3.0: " + dresult + " " + drem);
    }
}

```

**Saída:**
Result and remainder of 10 / 3: 3 1
Result and remainder of 10.0 / 3.0: 3.3333333333333335 1.0

**Incremento e Decremento**
Incremento (++): Adiciona 1 ao operando.

Exemplo: x = x + 1; é equivalente a x++;
Decremento (--): Subtrai 1 do operando.

Exemplo: x = x - 1; é equivalente a x--;

**Formas Prefixadas e Posfixadas:**

Prefixada: Incrementa/Decrementa antes de usar o valor na expressão.
Exemplo: ++x
Posfixada: Usa o valor na expressão antes de incrementar/decrementar.
Exemplo: x++

```
int x = 10;
int y = ++x; // y será 11, x será 11

```

**Resumo dos Pontos-Chave**
Java possui operadores para operações matemáticas, lógicas, relacionais e bitwise.
Operadores aritméticos incluem +, -, *, /, %, ++, --.
Operador % pode ser aplicado a inteiros e tipos de ponto flutuante.
Incremento (++) e decremento (--) têm formas prefixadas e posfixadas que afetam a ordem da operação.
É importante entender o comportamento dos operadores para evitar erros de lógica em expressões complexas.
virtual address for gst registration
Published: 2024-06-28 07:11:32

A virtual office in Jaipur with “Virtual States GST” will make your business stand out. We have reliable virtual office plans, that suit your business environment. We provide the best help solution for today’s fast-moving, versatile business environment. Our proficient experts will you to open your office without taking extra time and start working on the same day

Virtual State GST is stand up to the task, offering the Best Virtual Office Address in Jaipur. We also provide virtual office services in all 28 states of India, along with union territories.

These offices are registered in professional business complexes that give your business an ethical view. This address can be used as a mailing and billing address in Jaipur.

In addition, Virtual State GST offers additional services including professional receptionists and mail delivery for the company at an additional cost. If you look forward to getting a virtual office address for GST registration, we are at Virtual State GST delighted to welcome you and we wish you a great deal and cooperation.
With the spread of the Internet, the online e-commerce business has developed into a billion dollar industry in India, gradually covering every business sector that we can think of. From specialty products to branded and seasonal products, you'll find virtual storefronts everywhere online. This will bring the business world very close, creating growth and opportunities in the form of the online Internet as online Internet technology and its speed increase. The online e-commerce business in Jaipur grows day by day.

As online e-commerce companies/businesses nowadays run without a traditional physical store, virtual office addresses/services also provide the same facilities as physical office space but do not include the actual office suite. However, the cost reduction and savings are very high, and it is beneficial to use virtual offices to expand and grow your online e-commerce business.
(https://virtualstategst.com/virtual-office-in-jaipur.php)
SQL Course: One-to-one Relationships and Inner Joins.
Tags: sql
Published: 2024-07-01 17:28:37

In this chapter, we will set up a user and a profile table and create a one-to-one relationship between them. 

A user can create a `user` with a username and password and then create a `profile` with a profile image and bio. A user can only have one profile and a profile can only be related to one user. That is why it is called a one-to-one relationship.

If you use `Replit`, create the template for `SQLite` and you are good to go. 

## Prerequisites with links

Press the links to read more about the topic;

* [Create a table ](https://www.w3schools.com/sql/sql_create_table.asp)
* [Primary Keys](https://www.w3schools.com/sql/sql_primarykey.asp)
* [Foreign Keys](https://www.w3schools.com/sql/sql_foreignkey.asp)
* [Autoincrement](https://www.w3schools.com/sql/sql_autoincrement.asp)
* [Data types](https://www.w3schools.com/sql/sql_datatypes.asp)
* [Inner join](https://www.w3schools.com/sql/sql_join_inner.asp)
* [Contraints](https://www.w3schools.com/sql/sql_constraints.asp)
* [Aliases](https://www.w3schools.com/sql/sql_alias.asp)

## Create the tables.

Leave out the primary and foreign keys in the profile table for now. We use the constraint `CHECK` to make sure the password has a length of more than 5 characters.

```
CREATE TABLE Users 
(
  ID INTEGER PRIMARY KEY AUTOINCREMENT,
  Username VARCHAR(255) UNIQUE NOT NULL,
  Password VARCHAR(255) NOT NULL,
  CHECK (LENGTH(Password) > 5)
);

CREATE TABLE Profiles 
(
  Img VARCHAR(1),
  Bio TEXT
);
```

## Establish the one-to-one relationship.

To make sure a user only can create one profile, we can use the `user’s primary key` as the profile’s primary and foreign key. This way the profile is dependent on the user.

```
CREATE TABLE Profiles
(
  UserID INTEGER NOT NULL PRIMARY KEY,
  Img VARCHAR(1),
  Bio TEXT,
  FOREIGN KEY (UserID) REFERENCES Users(ID)
);
```
 
## Insert data to the user and profile.

```
INSERT INTO Users (Username, Password) VALUES 
  ('Ben', 'secret'),
  ('Jim', 'secret'),
  ('Luk', 'secret');

INSERT INTO Profiles (UserID, Img, BIO) VALUES
  (1, '😎', 'I am a cool guy'),
  (2, '🥳', 'I love party'),
  (3, '🤠', 'I am a cowboy');
```

# Query user and profile information using inner join. 

* We use Aliases to give the temporary names `u` for Users and `p` for Profiles.
* Use SELECT to choose what fields you want selected from the database.
* Join the Profiles with the Users where the ID's match.

```
SELECT u.Username, p.Img, p.Bio
FROM Profiles p
JOIN Users u ON p.UserID = u.ID;
```
Result:
Ben|😎|I am a cool guy
Jim|🥳|I love party
Luk|🤠|I am a cowboy
RouterInput in Angular v16
Tags: webdev, angular, javascript
Published: 2024-07-02 06:52:41

## **Introduction:**
Angular v16 has recently been released, bringing along a range of new features aimed at enhancing the developer experience. One of these exciting features is RouterInput, which allows developers to retrieve route information through inputs. In this blog post, we will explore how RouterInput can be utilized and discuss its benefits.

## **What is RouterInput?**
RouterInput is a new API introduced in Angular v16 that enables developers to listen to route parameters through input bindings in their components. This means that when a route parameter changes, the component is notified through an observable stream, allowing for dynamic updates.

## **Getting Started with RouterInput:**
To start using RouterInput, you need to **update your route provider in the main.ts** file. This can be done by importing the necessary modules and adding the "withComponentInputBinding()" method to your route provider configuration. **Here's an example**:

```
import { provideRouter, withComponentInputBinding } from '@angular/router';

bootstrapApplication(AppComponent, {
  providers: [
    provideRouter(appRoutes, withComponentInputBinding())
  ]
});
```

Once the route provider is updated, you can start utilizing RouterInput in your components. Simply add the "@Input()" decorator to the properties that you want to bind to route parameters. Here's an example:

```
`@Input() testId!: string;
@Input() permission!: string;
@Input() user!: string;`
```

With these input bindings, your component will be notified whenever the corresponding route parameters change.

## **Additional Notes on RouterInput:**
1. Router Inputs are only accessible within the routed component. If you need to access these parameters within a child component, you can either pass the input through input binding between the parent and child components or use other methods mentioned earlier.
2. If you prefer a more descriptive decorator name for RouterInput, you can remap it in its definition using the "import {Input as RouterInput} from '@angular/core'" statement. This allows you to use the new decorator name in your component.

## **Conclusion:**
RouterInput is a valuable addition to Angular v16, providing developers with a convenient way to retrieve and react to route parameters through input bindings. By incorporating RouterInput into your Angular projects, you can enhance the flexibility and responsiveness of your components. So, go ahead and explore this new feature to further improve your Angular development experience.

Happy coding!
Streamlining Tariff Classification for Seamless Customs Declarations
Tags: ai, productivity, learning, software
Published: 2024-07-02 08:30:23

As developers, efficiency is key. Here’s how accurate Ai in tariff classification can simplify your customs processes and boost your international trade operations.

## Why Tariff Classification Matters

The [Harmonised System (HS)](https://www.icustoms.ai/blogs/hs-code/) is used globally by over 200 countries, covering more than 98% of trade merchandise. It offers several benefits:

Faster customs processing
Reduced trade barriers
Improved trade data accuracy
Accurate classification ensures smooth operations and minimizes delays.

## Key Benefits of Accurate Tariff Classification

Customs Duties: Accurate tariffs mean lower costs.
Regulatory Compliance: Stay compliant and avoid penalties.
Trade Agreements: Benefit from trade deals and reduce expenses.
Importance of Commodity Codes

In the UK, HMRC requires precise descriptions for arriving goods. Correct commodity codes ensure:

Seamless customs clearance
Accurate tax and duty payments
No delays or rejections
Challenges Importers Face

**Paperwork Overload:** Dealing with endless documents and regulations.
**Time Management:** Meeting strict declaration deadlines.
**Finding the Right Codes:** Incorrect codes lead to rejections.
**Manual Data Entry Errors:** Mistakes due to lack of expertise.
**Country-Specific Issues:** Navigating different trading policies.
Overcoming Software Hesitation

Some traders hesitate to use customs software, but tools like iCDS leverage AI to find accurate HS codes and streamline the declaration process.

## How iCustoms Helps

iCustoms simplifies tariff classification and more:

EU-wide declaration services
Shipment tracking for customs brokers
Duty claim tools for VAT calculations
Automates documentation for easy declarations

## In Summary

Accurate tariff classification is crucial for global trade, impacting taxes and customs clearance. Get it right to avoid problems and save money.
Dive into our full guide to simplify your[ global trade with accurate tariff classification](https://www.icustoms.ai/blogs/tariff-classification-for-customs-declaration/).
1. Series introduction
Tags: neovim, vim
Published: 2024-07-03 09:34:44

In this series I will explain principles of vim and neovim, and it is complementary to another series where I rebuild my configuration from scratch.

When I reach a new vim concept, in my configuration that I think could benefit need explaining in depth, I will add an article to this series about that concept.

Note on terminology: whenever I write "vim", the information is valid for both vim and neovim. When a topic is specific to neovim, I will write "neovim".

## This series is not a replacement for the tutor

This is not meant to teach you _editing_ in vim/neovim, as this is about explaining concepts that become relevant when configuring and customising neovim to your liking.

If you are new to vim and neovim, and want to lear, both have a tutorial that teaches basic editing, navigation, _motions_, (see `:help motion`).

Vim's tutorial can be launched directly from the command line (this is how I originally learned vim)

```sh
> vimtutor
```

Neovim's tutorial can be launched from neovim itself, launch neovim, and type `:Tutor` and press enter. It's basically the same with minor changes, and some fancy additions.
The Differences Between EntityFramework .Add and .AddAsync
Tags: csharp, softwaredevelopment, entityframework
Published: 2024-07-03 15:25:01

### Introduction
Entity Framework is a popular Object-Relational Mapper (ORM) for .NET, which allow us to better interact with a database using .NET objects. One of the fundamental operations we are using all of us that interact with databases is adding new entities. In this article I will try to explain the two methods that we have in our disposal for entities creation `Add` and `AddAsync`. We will explore their usage, differences and best practices for when to use each other.
### What is `DbSet<TEntity>.Add`?
The DbSet<TEntity>.Add method is a synchronous method used to add a new entity to the context, which is then tracked by EF Core. When SaveChanges is called, EF Core generates the necessary SQL statements to insert the new entity into the database.
Lets see a usage example of `Add` method
```csharp
public Task AddNewEntityAsync(Entity entity, CancellationToken ct)
{
    using (var context = new ApplicationDbContext())
    {
        context.Entities.Add(entity);
        await context.SaveChangesAsync(ct);
    }
}

```
How the above example works,
- The `Add` method attaches the entity to the context with an `Added` state
- When `SaveChangesAsync` is called the context creates an `INSERT` SQL command to add the entity to the database asynchronously

### What is `DbSet<TEntity>.AddAsync`?

The `AddAsync` method is the asynchronous counterpart of the Add method. It is used to add a new entity to the context asynchronously. A usage example of `AddAsync` is given bellow

```csharp
public async Task AddAsync(Entity entity)
{
    using (var context = new ApplicationDbContext())
    {
        await context.Entities.AddAsync(entity);
        await context.SaveChangesAsync();
    }
}
```
How it works
The `AddAsync` method attaches the entity to the context with an `Added` state asynchronously
- When `SaveChangesAsync` is called, the context creates an `INSERT` SQL command to add the entity to the database asynchronously

### Key Differences Between `Add` and `AddAsync`

Now the first question that pops in our minds is ok, so I will use `Add` when I am in a synchronous context and `AddAsync` when I am in asynchronous.
This is just one aspect; the other is how `Add` and `AddAsync` interact with the database.
As [Microsoft](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.addasync?view=efcore-8.0) explains

> This method is async only to allow special value generators, such as the one used by 'Microsoft.EntityFrameworkCore.Metadata.SqlServerValueGenerationStrategy.SequenceHiLo', to access the database asynchronously. For all other cases the non async method should be used.

That simple means that event though `Add` and `AddAsync` are doing the same thing, `AddAsync` comes with a little overhead and that is an extra interaction with the database, something that is avoided with the use of `Add`

If you found my article useful, feel free to share it. Also, leave a comment if something is not clear enough.
Which language would you want to see take over the world?
Tags: discuss, languages, programming
Published: 2018-10-09 06:36:05

---
title: Which language would you want to see take over the world?
published: true
description: 
tags: discuss, languages, programming
cover_image: https://images.unsplash.com/photo-1459478309853-2c33a60058e7?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=ba9893452f120b4af8ffe3b3f9475e7f&auto=format&fit=crop&w=750&q=80
---

Let's imagine for a second that we live in a world where all programming languages are equally suited for any task. Performance, memory footprint, compile time, executable/runtime size and compatibility, and similar factors are entirely irrelevant. Valid criteria could be personal taste, perceived elegance and beauty of the language, simplicity, easiness to use, and so forth.

If any programming language could fulfill equally well the requirements for any application/system and run anywhere, which language would you like to see everything written in?

My personal choice would be **Lisp**. I think Lisp is beautifully simple, there are very few syntactical constructs, it's easy to extend with macros and very suitable for functional programming.
How do you DEV.to?
Tags: discuss
Published: 2018-12-26 04:14:36

---
title: How do you DEV.to?
published: true
description: I am new to the community and curious how others are using it.
tags: discuss
---

![Blogging](https://thepracticaldev.s3.amazonaws.com/i/67pc6rmcwp1s3yentubn.jpg)

I recently joined the DEV.to community and I am curious how each of you are using the platform. I'm guessing my story is similar to most of yours so this is a good place to talk about it.

I am a Software Developer with nearly 20 years of experience and I have been blogging for a long time. I find myself blogging less and less on my own platform these days and creating more videos. This is a little bit sad for me because I love to write, outside of coding it's one of my favorite things. 

I have only posted a single article here and already love it. I have had so many comments and feedback and it just seems like a great place to connect with developers like myself. 

![Code](https://thepracticaldev.s3.amazonaws.com/i/imi6vg61bhukgtmgr3e9.jpeg)

So my question is this: For those of you who have personal websites and a blog, what is your strategy for posting new content. Are you posting here and on your blog? I heard Ben on the Indie Hackers Podcast talking about the problems with Medium. My biggest issue with Medium and other platforms is that you don't own your content. 

When I post content on my blog I am not only trying to help people but I am trying to build my name. I'm looking to build my mailing list and when I do ask for money for paid content I hope my subscribers will know it's coming from a good place.

Should I post all of my content on both or do you determine that some content should go on the personal blog and maybe use this platform to test out some content first? I'm curious to know how all of you are using the platform.
Install and Update Solidity(solc) in Mac
Tags: solidity, ethereum, solc
Published: 2018-12-26 06:16:03

---
title: Install and Update Solidity(solc) in Mac
published: true
description: 
tags: solidity,ethereum,solc
---

You can install and update solc:

```bash
brew update
brew upgrade
brew tap ethereum/ethereum
brew install solidity
brew link --overwrite solidity
```

# Errors

If you got the error below, you have to update xcode.

```bash
==> Installing solidity from ethereum/ethereum
Error: Your Xcode (9.0) is too outdated.
Please update to Xcode 10.1 (or delete it).
Xcode can be updated from the App Store.
```