teleren/devto huggingface dataset:
Interview Questions: Front-End Web Dev.
Tags: interview, frontend, webdev, javascript
Published: 2023-02-10 11:45:40

Hello Fellows.
I know its been a long time since we last interacted with an article, but believe me, good things take time 😉 (Just Kidding. I was busy with my exams). I will be posting a series of articles with interview prep questions for different developer roles.

Hope so you would like them.

## HTML
* What is Semantic HTML?
* Explain DOCTYPE in HTML.
* What is the difference between HTML & HTML5?
* What is the difference between local storage, session storage & cookies?

## CSS
* What is the latest version of CSS?
* Explain the new features in CSS3?
* Explain different types of selectors.
* Tell me the difference between inline, block and inline-block.
* What is z-index and why is it used?
* What is the difference between padding and margin?

# JavaScript
* What is the difference between let, const and var?
* What are the different types of data types in JavaScript?
* What is an Array? How to create an array in JavaScript?
* What is the difference between function and method?
* List out the different built-in methods of Object.

## React
* What is virtual DOM in React?
* What is the difference between stateful and stateless components in React?
* Can you explain the concept of higher-order components in React?
* How to handle events in React?
* Explain error boundaries in React.

If these questions helped you in your interview, don't forget to hit like and follow buttons below and donate to the Turkey-Syria earthquake [relief funds](https://www.rescue.org/article/how-help-after-syria-turkey-earthquake).

-__Ciao__
C++ da While
Published: 2023-02-10 11:42:04

```cpp
Bugun biz While mavzusini o'tik bu mavzu qogan mavzularga nisbatan boshqacha va qizqro mavzu.Bu mavzuda birhil kodlarni qayta qayta yozmasdan While dan foydalansa boladi:

#include <iostream>
using namespace std;
int main(){

int i = 1, x;
  int sum = 0;
  cin >> x;
  while(i <= x){
    sum += i;
    i++;
  }
cout << sum << endl;


  return 0;
}
mana While ga misol  
```
O que são funções puras?
Tags: javascript, testing, programming, braziliandevs
Published: 2023-02-10 11:35:19


  

Hoje vou explicar sobre um conceito muito interessante e bem útil para aqueles desenvolvedores que desejam criar códigos mais limpos e mais testáveis.


Para início de conversa, para uma função ser considerada pura ela deve seguir duas regras. Ser determinística e não causar nenhum efeito colateral.


## Livre de efeito colateral

O que significa uma função ser livre de efeito colateral? Vamos falar um pouco sobre o que é um efeito colateral e pegar um exemplo bem simples. Estou com dor de cabeça e tomo um remédio para curar essa dor de cabeça, porém eu sinto sono por conta do remédio e a minha dor de cabeça é curada. Nesse caso a função do remédio é cumprida que é curar a dor de cabeça e ele sempre vai fazer isso quando necessário, só que para isso acontecer ele deixa um efeito colateral que é o sono. Ou seja, algo aconteceu fora daquele escopo do objetivo de tomar remédio.
Agora vamos trazer isso para programação. Vamos considerar que temos uma função que soma dois números e retorna o resultado dessa soma. 

```javascript
const soma = (n1, n2) => n1 + n2;
```

Essa função é livre de efeitos colaterais, pois ela simplesmente soma dois números e retorna os seus resultados, porém se essa função fizesse a soma e salvasse esse valor em um banco de dados? Bom isso é um efeito colateral, ela fez a soma, porém afetou outra área do sistema.

Outro exemplo seria uma função que escreve algo em um arquivo ou até mesmo lê, ou escreve em um banco de dados, nesses casos são funções com efeitos colaterais. Pois, algo é afetado após a sua execução.

Esses são exemplos bem simples do que seriam uma função livre de efeitos colaterais. Agora cabe a você entender e analisar cada caso de suas funções.

## Determinística

Esse é um ponto mais simples. Uma função determinística é uma função a qual toda vez que eu passar a mesma entrada ela me torna o mesmo resultado. Vamos usar novamente aquela função de soma como exemplo:

```javascript
const soma = (n1, n2) => n1 + n2;
```

Considerando a função acima toda vez que chamarmos soma e passarmos 2 e 2 `soma(2,2)` o resultado sempre será `4`, independente do que aconteça ou em qual momento esteja o resultado sempre será 4. Logo é uma função determinística.

## É pura?

Explicado às duas regras uma função só será pura quando às duas regras forem cumpridas. Caso contrário não, não é uma função pura.


## O que isso muda na minha vida?

Bom sabendo o que são funções puras, agora você escrever mais funções assim testá-la de forma isolada e com maior assertividade, assim separando muito melhor as responsabilidades delas dentro do seu código. Fora o fato de consequentemente serem funções menores e mais fáceis de serem entendidas.



Se chegou até aqui, me segue la nas [redes vizinhas.] (https://bento.me/cmsdev)

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

_Referências_

[259 - O que é uma Função Pura? 🤔🤔🤔 | theWiseDev Functional by Otavio Lemos
](https://www.youtube.com/watch?v=_SgoKKhU03o)
Save HTML Form Data to a MySQL Database using PHP
Tags: javascript, sql, php, inputdata
Published: 2023-02-10 11:30:05

When We building websites we need to do different work related to our thoughts and requirements. In this small article I like to talk about saving html form data or user input data to a mysql database using php. 

Firstly you need to create and arrange your user data input web page by using html and css. Here I am using only two user inputs and a submit button to submit data.

Then open the form tag to connect  the new php file by pressing the Submit button like the code.

 ```<body>
<form action="process-exampleform.php"method="POST">

    <div class="firstname">
        <label>First_Name</label><br>
            <input type="text" id="Code" name="First_Name">
    </div>
    <div class="lastname">
        <label>Last_Name</label><br>
            <input type="text" id="Code" name="Last_Name">
    </div>
<button>Submit</button>
</form>
```
After that we need to create another php. File to process and transfer data to sql table. In this I create  process-exampleform.php file to explain this.

In php code you need to get inputs from the webpage by POST method.

```
<?php
    $First_Name=$_POST["First_Name"];
    $Last_Name=$_POST["Last_Name"];
  
    $host="localhost";
    $dbname="database name";
    $username="username";
    $password="";

    $conn=mysqli_connect($host,$username,$password,$dbname);
    if(mysqli_connect_errno()){
    die("Connection Error:".mysqli_connect_error());
}


        $sql="INSERT INTO Details(First_Name,Last_Name)
        VALUES(?,?)";

$stmt=mysqli_stmt_init($conn);
                                                           
if(! mysqli_stmt_prepare($stmt,$sql)){
    die(mysqli_error($conn));
}
                                                                      
mysqli_stmt_bind_param($stmt,"ss",
$First_Name,
$Last_Name,
);

mysqli_stmt_execute($stmt);
    echo"Record saved";
?>
```
Then you need to create another php. File to connect webpage and example php file.

```
<?php
//connection for the database to html
$con=mysqli_connect("localhost","user name","password","database");

if(!$con){
    die("Connection error");
}

?>
```
After all of that you need to create a database and need to create a sql table and submit data.

To know about creating a database and table read the next article .
Thank You!
Top 10 websites to find a remote developer job
Published: 2023-02-04 04:29:06

Remote programming jobs can be a great way to get started in your career without having to move too far away from family and friends. Whether you're looking for a new challenge or are just burned out on working in an office, these job boards can help you find the perfect fit.

These job sites are dedicated to listing remote programming jobs. The job boards offers 100% remote jobs or jobs that are okay with employees working remotely (some people can work in an office or virtual offices around the world).


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8eg5go6wtbmyoyltlhvs.jpg)

[CodingJobBoard.com](https://www.codingjobboard.com/) The site claims to be the best remote developer job board in the world. It lists remote programming jobs from major companies. There are many filters that can be set to search accordingly. The examples of the filters are as follows: 

- Full-time, part-time, contracts, and freelancing jobs
- Country based developer jobs along with remote programming jobs
- Filter based on computer programming languages such as Python, PHP, Javascript, Java, and more

You can also subscribe to and receive a weekly newsletter with new positions emailed to your inbox.

[WeWorkRemotely](https://weworkremotely.com/) It features remote programming jobs from companies like Amazon, Google, Basecamp and more.

[PowerToFly](https://powertofly.com/) It matches jobs with underrepresented candidates. There are many companies on this site in a variety of industries, plus the filters to help you find a remote job in a specific area of development.

[Remote OK](https://remoteok.io/) Highly popular option that features many hands-on management. It shows if the job ad is new and gaining serious attention in order to assist you decide where to apply first.

[Remote Co](https://remote.co/) The site provides resources for companies seeking to work remotely. There are online courses, webinars, career coaching, and more. You may have to play within the “IT” filter to search the best developer job opportunities.

[Remotive](https://remotive.com/) Remotive is a tech job board. You can subscribe and receive a daily newsletter.

[Dynamite Jobs](https://www.dynamitejobs.com/) Perhaps the biggest feature of this site is filters. Dynamite Jobs’ team ensures all positions are still open daily.

[Crunchboard](https://www.crunchboard.com/) Crunchboard is the official job board of TechCrunch, leveraging a specialized audience to guide you to get your job postings are answered.

[Dice](https://www.dice.com/) The site is specially for software development and IT fields. This developer job board allows you filter by salary, experience, and location.

[Remote Masters](https://remotemasters.dev/jobs) Filters are specific, with options to search by programming skill. Major companies are Scribd jobs, Github jobs, and CircleCI jobs.
ActionMailer Balancer: Keeping the Email Sending Equilibrium
Tags: rails
Published: 2023-02-10 11:26:27

Can your sending reputation and domain authority switch Email Service Providers (ESPs) together with you? Will the migration from the SMTP to the API affect your email deliverability? How to keep up with your usual sending volumes without a drop? How to mitigate sending risks and be able to deliver those VERY IMPORTANT emails to your customers’ inboxes no matter what?

Now, Mailtrap has developed the answer to all these questions for Ruby applications: the ActionMailer Balancer. 


## What is the ActionMailer Balancer?

Mailtrap ActionMailer Balancer is an ActionMailer extension that works, well, surprise, as a balancer! It allows proportionally distributing the email sending load between two different sending services and keeping the sending equilibrium in the percentage you need and set up for yourself. For example: 

SendGrid 70% / Mailtrap 30%. 

or 

Postmark 60% / Mailgun 40%.

The Balancer works with any valid ActionMailer delivery method, either built-in, or added from the library, like the one from Mailtrap.

## How ActionMailer Balancer works

After you install the Balancer to your application, and do some minor configurations, it will extend the sending method of ActionMailer. 

The uniqueness of the gem is that for both sending services (whichever you choose), ActionMailer Balancer decides what sending solution to use even before ActionMailer is called. 

Let’s say you use SendGrid as your major email sending solution, and then you decide to migrate to Mailtrap for any reason possible (legal, financial, server location etc). You can’t (actually you can, but better not do that by all means)  migrate just in one step since your emails sent with the new ESP, Mailtrap in this particular case, would be recognized as spam.  Thus, you need to move slowly, step by step, increasing the volume of emails you send from Mailtrap. This is where the ActionMailer Balancer gem comes into play.

For a step-by-step guide on **how to start using the ActionMailer Balancer** check out the [article](https://mailtrap.io/blog/actionmailer-balancer/). 

And for more detailed info on the boilerplate and use in development, check out the Mailtrap [ActionMailer Balancer Github page](https://github.com/railsware/actionmailer-balancer).
Earning Passive Income by Staking Coins (USDT etc) on Wirex X-Accounts
Tags: wirex, cryptos, passiveincome, money
Published: 2023-02-10 11:23:06

![image.png](https://cdn.steemitimages.com/DQmSQRhhDCM3fWxzrVrDCgEbHuxDun59YE4yHhNhS26M9PN/image.png)

We can stake Coins (USDT etc) on [Wirex X-Accounts](https://steemyy.com/out/wirex) and start earning [passive incomes](https://helloacm.com/introduction-to-passive-incomes/).

The interests are given out weekly. And you can choose to get interests as WXT coins so that there is 2% extra bonus.

For example, By staking [USDT](https://helloacm.com/how-to-get-balance-of-trx-or-usdt-usdd-trc-20-smart-contract-tokens-on-tron-blockchain/), you can get 7% APR to payout as USDT weekly or 9% APR to payout as WXT weekly.

When you withdraw, it needs 30 days:

> Your X-Account has arolling 30-dav redemptionperiod,meaning that once withdrawal is requestedyou will receive your assets plus accrued interest atthe end of 30 davs.


![image.png](https://cdn.steemitimages.com/DQmTSDyRRbHu5huzHB9NxQf1VjeXHj9yEqs4NrS3tueFMyQ/image.png)


![image.png](https://cdn.steemitimages.com/DQmbZhH3Lw6S5kFZscWVn1oJFgbLZvMDwsAHXTQdZbrYZiW/image.png)


## Apply [Wirex](https://steemyy.com/out/wirex) card and start earning passive income! Join today and earn $30 in NXUSD!

<hr/>

### [Steem](https://steemyy.com) to the Moon!
You can swap the STEEM/SBD to USDT (TRC-20) via [Steem2USDT](https://steemyy.com/steem2usdt.php)

### The Wirex is [FCA regulated](https://wirexapp.com/en-gb/legal/regulations).

![image.png](https://cdn.steemitimages.com/DQmcfSr8pkUwdqaF4MufFuwd4DR2oiLrxfCNeFob9vRyjMF/image.png)

[Blog Post](https://helloacm.com/earning-passive-income-by-staking-coins-usdt-etc-on-wirex-x-accounts/)

<a href="https://helloacm.com/passive-income-of-earning-up-to-12-apr-interests-on-cryptos/" title="Passive Income of Earning Up To 12% (APR) Interests on Cryptos">Stake & Earn</a> is one of the most popular DeFi products (Decentralized Finance). However, there is risks, so this is not a financial advice of any kind. And <strong>DYOR = Do Your Own Research</strong> before investing money on it. It is always to choose for products or companies that are FCA regulated.
Ecto: Create a case insensitive unique index
Tags: elixir, ecto
Published: 2023-02-10 11:15:11

Today I learned that [`Ecto.Migration`](https://hexdocs.pm/ecto_sql/Ecto.Migration.html) supports this out of the box 🥳

You probably know that you can easily create a unique index like this:

```elixir
create unique_index("products", [:name], name: :products_lower_name_index)
```

But did you also know that you can do this also in a case-insensitive way?
[According to the docs](https://hexdocs.pm/ecto_sql/Ecto.Migration.html#index/3) you can not only provide column names for a new unique index, but also a custom expression.

```elixir
# Create an index on a custom expression
create unique_index("products", ["(lower(name))"], name: :products_lower_name_index)
```
The Case Against Infura and Alchemy: The Hidden Dangers of Centralized Third-Party Services.
Tags: web3, security, database, blockchain
Published: 2023-02-10 11:09:28

## Hello, dear Blockchain Enthusiasts!

Today, we are going to talk about the dangers of using Infura and Alchemy when building your DApp.

As a decentralized application (dapp) builder, you’ve likely heard of Infura and Alchemy. They are popular tools for developers who need to connect to an Ethereum network. However, what you may not know is that Infura and Alchemy can be a double-edged sword.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/l4Ho0At2UD2d7WyD6/giphy.gif">

## Let’s dive into why these popular tools can be a problem for dapp builders:

### Centralization
Infura and Alchemy are centralized services that control the data flow between your dapp and the Ethereum network. This means that a single point of failure exists in your dapp’s architecture, making it vulnerable to security threats and data breaches.

### Data Leaks
When using Infura and Alchemy, sensitive data such as private keys and smart contract addresses are transmitted to a third-party server. This puts your dapp’s data at risk of being leaked or intercepted by malicious actors.

### Limited Functionality
Infura and Alchemy are not designed to be full-fledged Ethereum nodes, which means they may not provide the same level of functionality as a locally run node. This can limit your dapp’s capabilities and restrict your ability to scale.

and many more...

## So, what’s the solution?

It’s important to understand that Infura and Alchemy should only be used for specific purposes. Infura can be used for database purposes and Alchemy can be used for remote procedure calls (RPCs). However, it is advised against using Alchemy for RPCs and instead use the [Chainlist website](https://chainlist.org/) to get public RPCs for any mainnet or testnet.


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

Why Chainlist?

[Chainlist](https://chainlist.org/) is a decentralized Ethereum network explorer that provides public RPCs for any mainnet or testnet. Unlike Infura and Alchemy, Chainlist is not centralized, which means that your dapp data will not be transmitted to a third-party server. Additionally, Chainlist provides the same level of functionality as a locally run Ethereum node, making it a more secure and scalable solution.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/YS8c0Z7in21AM4A2AR/giphy.gif">

In conclusion, while Infura and Alchemy can be convenient tools for dapp builders, they also come with significant drawbacks. If you’re looking to build a secure and scalable dapp, it’s recommended that you use Infura only for database purposes and Chainlist for RPCs. By taking this approach, you’ll avoid the dangers of centralization, data leaks, and limited functionality, and build a dapp that is ready for the future.

Also, Kindly connect with me on [linkedin](https://www.linkedin.com/in/chidozieezeanekwe/) and follow me on  [Twitter](https://twitter.com/zenodavids), I follow back.

Happy coding!
A Chrome extension to improve your website performance
Tags: extension, performance, dom
Published: 2023-02-10 11:05:31

Hi 👋 
Recently we started to improve our website performance and beside that we worked on the Chrome extension to help reduce DOM size and improve website performance. You can find more details here to see how it works and some numbers about it: 

[Details about the Chrome-extension](https://medium.com/studocu-techblog/a-chrome-extension-to-help-reduce-your-dom-size-ace9c114c54)

Feel free to test it 😀
Notification alert when an object is deleted from S3 bucket
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-02-10 11:03:35

[41/100] #100DaysOfCloud Today, I created an S3 event notification to send a notification alert to my email when an object from the S3 bucket is deleted.

Sometimes our requirement is when anyone deletes any object in S3 bucket we should receive an alert. The Amazon S3 notification feature enables you to receive notifications(SNS/SQS/Lambda) when certain events happen in your bucket. The S3 events work at the object level, so if something happens to the object, in this case, maybe PUT, POST, COPY or DELETE then the event is generated and that event will be delivered to the target(SNS, SQS or LAMBDA).

In this I created an S3 event notification where if the object is deleted permenantely then it sends an email notification alert to my email through SNS.

You can try do it by yourself by following the steps from the link below: [GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/041/Readme.md)
Vox Pupuli PMC Elections, 2023
Published: 2023-02-10 11:00:32

As announced at CfgMgmtCamp this week, [Vox Pupuli](https://voxpupuli.org) is kicking off the "annual" PMC elections process. For an increasingly loose definition of the word, this is a yearly process to provide more people opportunities to get involved with the leadership and decision making.

Would you like to help set roadmap or help architect the module deprecation policy? Do you want to help organize events or run social media? Maybe you'd like to help curate the blog or source content from fresh writers.

Maybe you just want to get involved and help out with whatever is needed. Joining the PMC is your avenue to this involvement. 

Starting today, you may nominate yourself or someone else for the elections. Nominations are open until *March 22 2023 23:59 UTC* and then we'll all vote to select the 5 new members of the PMC. 

See the [elections page in the plumbing repository](https://github.com/voxpupuli/plumbing/blob/master/share/elections/2023-01.md) for nomination instructions.

@binford2k will be your elections officer this year. We hope to see your PR soon, and we've got a Vox hoodie for the first person to submit a nomination.
Can sanitizers find the two bugs I wrote in C++? - Fuzzing Weekly CW6
Tags: security, applicationsecurity, opensource, testing
Published: 2023-02-10 10:54:25

Can sanitizers find the two bugs I wrote in C++?
https://ahelwer.ca/post/2023-02-07-cpp-bugs-sanitized/

Fuzzing ATM/POS protocols like a Boss:
https://www.linkedin.com/pulse/fuzzing-atmpos-protocols-like-boss-karim-reda-fakhir/?published=t

How to build a unified workflow for functional and security testing using JUnit:
https://securitysenses.com/videos/how-build-unified-workflow-functional-and-security-testing-using-junit

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1xwes5cmo75rqu09l6xz.png)
How to set default connection ethernet Java in Andorid?
Tags: flutter, java, android, help
Published: 2023-02-10 10:46:08

My tablet has 2 network connections(UsbEtherhet and wifi) but I want to default connection Usb/Ethernet.

Android 10 and previous versions default connection is Usb/Ethernet but Android 11 default connection is wifi .How can set default can you help?
My tablet has 2 network connections(UsbEtherhet and wifi) but I want to default connection Usb/Ethernet.

I'm using flutter and kotlin for native (java is possible)