teleren/devto huggingface dataset:
How to smash that interview
Tags: interview, webdev, programming
Published: 2023-03-03 14:37:52

Ask questions, lots of them.

It's the end of a rather nice interview and the MD of *YourPerfectJobProbably.com* says do you have any questions? You panic.

![Ask questions, lots of them](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v703f707c3fja3y0pfdw.jpeg)

There are always questions, so I'll chuck out some.

* Why are you hiring now? (Growth/Expansion/Last developer decided they wanted to be an astronaut)
* What projects are you working on
* What does your tech / deployment stack look like?
* What is your typical developer day (70% writing code, 10% meetings, 20% code review)
* What are the working hours?
* What's the biggest challenge to the business
* Do you have any Technical Debt? How much of that is a priority?
* Do you think I would be a good fit for the team?

The best comedians out there have a tool in their arsenal, it's a callback. If you're paying attention at the beginning of a show and that sly quip comes back again later in the performance and you notice it. That's for you, because you've been paying attention. You win an ice cream.

> It wouldn't spoil the line of a tight fitting cagoule or poncho - Harry Hill

Always, always, show that you've been paying attention. Not because you're playing a game but because you have been.

Oh and never ever ask.

* How many days holiday are there
* How much are you going to offer me

Oh and if they ask you what you want to be doing in 5 years time

> I love code, I live and breathe it, you can't eat it that would be silly and given the choice of writing code and sitting in meetings for 60% of my life I'd choose code every time. In fact talking to you is taking away from my coding time. I definitely don't want your job, your job is your job.

Definitely don't say

> I will be doing your job (while you are unemployed and living under a bridge because I am so brilliant. I love code so much that I want to not be doing it in 5 years).
Building with Next.js - part 3
Tags: react, nextjs
Published: 2023-03-03 14:30:12

So far, I simply created a Next.js app by running
```
npx create-next-app@latest nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/master/basics/learn-starter"
```

Following the docs, you quickly understand that, initially, most of the code you want to touch is in `pages/index.js` or inside the `pages` folder.

## Pages Folder And Navigation

In Next.js, a page is a React Component exported from a file in the pages folder. 
This is quite important to understand because each page is associated with a route. For example, let's assume we have two files like follows:
- pages/about.js that exports a React component called About
- pages/contacts.js that exports a React component called Contacts

By default, Next.js will create two routes `/about` and `/contacts` where the About and Contacts components will be accessible.

### Adding Pages
Following what we said above, I created the following components:

```
// pages/about.js
export default function About() {
  return <div>About</div>
}
```

```
// pages/contacts.js
export default function Contacts() {
  return <div>Contacs</div>
}
```
And that's it! If you navigate to `http://localhost:3000/about` you will see a white page with the About text in the top-left corner. This is almost magic!!


![Next.js About page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpqv3w8rjnqr7pb4z3pz.png)

 

### User Navigation
The next step is to create a simple navigation bar so users can visit other pages without changing the URL manually.

In Next.js, we need to use the `<Link>` component instead of the plain `<a>` tag. However, the most important attributes are the same.

So, if I want to have a basic navigation menu, I might try the following code in index.js

```
<div>
  <Link href="/">Home</Link>
  <Link href="/about">About</Link>
  <Link href="/contacts">Contacts</Link>
</div>
```
By adding a bit of style, we get to:

![Next.js Home page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fwhdzgmcbn1u43ivsoo.png)

One of the main benefits of using the `<Link>` component for client-side navigation is that the browser won't refresh the whole page, unlike using `<a>`.

Finally, as reported in the docs, _if you need to link to an external page outside the Next.js app, just use an `<a>` tag_.

### Under The Hood
There are two things worth mentioning: 
- **Code Splitting**: Next.js does code splitting automatically, which means it only loads the code that is requested. As a consequence, the landing page is loaded quickly even if your app has many other pages.
- **Prefetching**: In production (when your app is deployed and available to users) Next.js automatically prefetches the code for the linked page in the background. In the example above, both About and Contacts get loaded in the background when you open the Home page (e.g. index.js in this case).

{% embed https://dev.to/this-is-learning/building-with-nextjs-part-4-2b08 %}
Improve the speed of your AWS lambda API (NodeJS) with these two easy techniques.
Tags: javascript, programming, productivity, aws
Published: 2023-03-03 14:21:34

Being inquiring is fine, but striving for improvement is better. I have been using AWS Serverless services (Lambda, DynamoDB) with NodeJS as the runtime . I’ve often wondered how to reduce latency while developing APIs that integrate with AWS services.

While adhering to best practises with minimal imports and other requirements is essential, there are two simple measures you can do to further enhance the speed of your Serverless application.

---

## callbackWaitsForEmptyEventLoop = false

Our lambda API accepts (event, context, callback) as an argument when it is defined. NodeJS leverages an event loop, and if you use a callback to deliver a response, it delays sending the output until the event loop is empty.

If this property (callbackWaitsForEmptyEventLoop) is set to false, the callback will immediately return the response, and any outstanding events will run on next invocation.

```
context.callbackWaitsForEmptyEventLoop = false;
```

![callbackWaits](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mjj28sl2d7yvkyyuyvyi.png)

---

## AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1

A lambda implementation will nearly always include integration with AWS services. When interacting with AWS services using the aws-sdk, a fresh TCP/IP connection is always established. This increases latency, which may potentially be longer than the time needed to query DynamoDB:-).

So, AWS offers a “Connection Reuse” method. Simply changing the environment variable AWS_NODEJS_CONNECTION_REUSE_ENABLED to 1 will enable this.


![awsConnectionReuse](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqoexug62vwm790jjvnw.png)

Another approach is to add **keepAlive** value to the options while configuring the AWS client.


![awsKeepAlive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nio9v6mv9mgh377tec86.png)

Note: This parameter is enabled by default if you’re using the AWS SDK version 3.

---

Check out my [YouTube channel](https://youtube.com/@durgadaskamath) for videos on serverless computing.

Follow me for more of interesting articles. Happy Learning #AWSCommunity #AWSCommunityBuilder
I made an SFML snake game with a few options, scores and basic audio effects (first game)
Published: 2023-03-03 14:15:42

Hello everybody,

Wanted to share with you my first ever game made with SFML 2.5.1 and C++20. It is a very basic snake game with menu state, game state, options state (in which you can customize the game a bit) and basic scores (top 3 only). Since SFML doesn't have any built-in widget for buttons or textboxes I created them by myself; they probably are not perfect at all, but are customizable and stable for my purposes (I just needed something functional and easy at the same time).

I know that probably there will be mistakes, bugs (even if I tried to fix all the possible ones) and other imperfections, so please keep in mind that this is my first game and in general one of my first GUI app.

Feel free to send me hints or advices on how to improve it and if you want open also issues or PRs.

If you like it you can also leave a star on github of course!

Repository link: https://github.com/JustWhit3/snake-game
Fix Flaky Rails System Tests caused by slow scrolling or animations
Tags: rails, ruby, webdev
Published: 2023-03-03 13:40:31

Flakiness on browser-based system tests (integration tests) in Ruby on Rails may have a lot of different reasons. One is scrolling, which may be slowed down by browser setup (smooth scrolling), JavaScript callbacks which result in some kind of events like for animations, etc.

Such problems are not Ruby on Rails related and even not a programming language. They are mostly not related to a single browser like Google Chrome, Chromium, and Firefox only. They are also not browser driver specific like Selenium or Cuprite. Let’s dive in and check, how to analyze them, and figure out and try fix such problems.

Read the full article here at qameta.com: [Fix Flaky Rails System Tests caused by slow scrolling or animations](https://qameta.com/posts/fix-flaky-rails-system-tests-caused-by-slow-scrolling-or-animations/)
Let's demystify swoole : tables
Tags: php, swoole, webdev, tutorial
Published: 2023-03-03 13:39:07

## Introduction

Swoole provide a table system based on memory.

These tables are stored in memory with very high speed access and accessible to every thread and processes.

## Creating your first table

To create table, use Swoole\Table object :
```php
$members = new Swoole\Table(500);
```

The parameter represent max entries managed by table. Adjust the size to avoid using too much memory.

We will now declare fields :
```php
$members->column('firstname', Swoole\Table::TYPE_STRING);
$members->column('lastname', Swoole\Table::TYPE_STRING);
```

And create the table :
```php
$members->create();
```

## Insert/update data

We can now use the table.

Use *set* method to persist records :
```php
foreach ([
    ['firstname' => 'john', 'lastname' => 'doe'],
    ['firstname' => 'paul', 'lastname' => 'carbon']
] as $key => $record) {
    $members->set($key, $record);
}
```

And same for update :
```php
$members->set(0, ['firstname' => 'john the second', 'lastname' => 'doe']);
```

## Getting data

You can access data from key :
```php
$key = 0;
$member = $members->get($key);
```

And if you need only one field :
```php
$key = 0;
$field = 'firstname';
$firstname = $members->get($key, $field);
```

You can also iterate all records with foreach :
```php
foreach ($members as $key => $record) {
    echo 'member #' . $key . ' : ' . $record['firstname'] . ' ' . $record['lastname'];
}
```

## Delete a record

To remove a record, use :
```php
$key = 0;
$members->del($key);
```

## Other posts on swoole

- [hello world](https://dev.to/sebk69/demystify-swoole-hello-world-26ln)
- [coroutines](https://dev.to/sebk69/lets-demystify-swoole-coroutines-285o)
Tiny Chat App UI
Tags: javascript, react, tailwindcss, typescript
Published: 2023-03-03 13:30:24

Table Of Contents
        * 🚀[INTRO](#intro)
        * 🏁[SOLUTION](#solution)
        * 🙏[THANK YOU](#thank-you)


## 🚀 Intro <a name="intro"></a>

Hey all, today I give you the tiny chat app UI that you can extend and use to create a good-looking and simple chat application.

All of the code is in the CodeSandbox don't hesitate to examine and use this code. Ask questions if you have any!

We'll use:
- React (TypeScript)
- [Tailwindcss](https://tailwindcss.com/)
- [heroicons](https://www.npmjs.com/package/@heroicons/react)
- [Flowbite](https://flowbite.com/)

## 🏁 Solution <a name="solution"></a>

{% codesandbox react-typescript-tailwind-chat-ui-fs3x3w %}

## 🙏 THANK YOU FOR READING!<a name="thank-you"></a>

Hope this helps you in your future work. Cheers! 🍻
AWS Certifications Resource Recommendations
Tags: aws
Published: 2023-03-03 13:25:18

I just got 5 AWS certifications & wanted to share the resources I used in case it helps others



**Cloud Practioner**

**Resources**
acloud.guru
Tips

I would study for the solutions architect associate first, then just knock out the cloud practitioner the next day. It's 80% the same material.

Associate Exams - Architect, Developer, Sys Ops

SysOps Admin
Focus on cloudwatch, & metrics related to the common services (dynamodb, ec2, rds, etc)
Resources

**acloud.guru
**

**Tips**

Do all the cloud.guru labs, quizzes and exam builder till you average 85%+

**Devops Professional**

Resources
acloud.guru
For this specific exam acloud.guru was good for a summary of the exam related services.

[Exam Dumps Free](https://examdumpsfree.com/) - AWS DevOps Professional Practice Tests
20% of the exam, I had seen before in practice test questions

Tips
Know CloudFormation, OpsWorks, Beanstalk like the back of your hand

Take the sysOp admin associate before, it had a lot of metric related topics (cloudwatch) that were like 30% of the exam

Solutions Architect Professional

Resources
TBD
Resolvendo problemas no HackerRank: A caixa mágica
Tags: javascript, beginners, programming
Published: 2023-03-03 13:15:09

Olá, seja bem vindo a mais uma etapa do Resolvendo problemas no Hacker-Rank,nessa sessão iremos resolver uma série de arrays chamados Magic Squares, com proporção 3x3. Nosso objetivo é retornar o valor mínimo das várias possibilidades. Vejamos agora o problema.

**Forming a Magic Square -**

Nos é passado um array que está salvos em `_s_` e devemos converter ele para o array seguinte mostrando sua diferença absoluta. Esse problema lembra um pouco a lógica de SUDOKU, pois ele tem valores em diagonais e em linhas iguais. Mas o importante para nós é criar uma forma pegar o primeiro array 3x3 e os seguintes passados, e fazer a diferença entre eles. Vejamos um exemplo ele é:

5 3 4
1 5 8
6 4 2

O valor de `_s_` vai mudar de acordo com o problema, mas sua regra sempre indica que ele deve ser comparado e subtraído pelo outro array passado.

- int: o custo total mínimo de converter o quadrado de entrada em um quadrado mágico

- Cada uma das linhas contém três inteiros de linha separados por espaços s [i].

Vejamos a resolução:

```
function formingMagicSquare(s) {
    // Write your code here
  let magicSquare = [
    [[8, 1, 6], [3, 5, 7], [4, 9, 2]],
    [[6, 1, 8], [7, 5, 3], [2, 9, 4]],
    [[4, 9, 2], [3, 5, 7], [8, 1, 6]],
    [[2, 9, 4], [7, 5, 3], [6, 1, 8]], 
    [[8, 3, 4], [1, 5, 9], [6, 7, 2]], 
    [[4, 3, 8], [9, 5, 1], [2, 7, 6]], 
    [[6, 7, 2], [1, 5, 9], [8, 3, 4]], 
    [[2, 7, 6], [9, 5, 1], [4, 3, 8]]
    ];
    
  let maxValue = Number.MAX_VALUE;
    for(let index = 0; index < magicSquare.length; index ++){
  let min = 0;
    for(let line = 0; line < s.length; line++){
    for(let column = 0; column < s.length; column++){
      min += Math.abs(s[line][column] - magicSquare[index][line][column]);
      }
    }
  maxValue = Math.min(maxValue, min);
  }
  return maxValue;
}
```


Uma explicação rápida a respeito desse código é que pegamos todas as possibilidades possíveis da caixa mágica e a disponibilizamos na variável `magicSquare`. 

Logo após, criamos uma variável `maxValue` que irá guardar um número máximo. E começamos um laço `for` para um index que se for menor que o comprimento de `magicSquare`, adicionar 1. E também criamos uma variável `min`que vale 0

Também criamos uma repetição `for`agora pegando a posição das linhas dentro dos arrays onde se `s`que é o parâmetro que guarda o array 3x3 que queremos for maior que `line`adiciona mais um. O mesmo é feito na repetição criando a column.

Feita a criação do column, chamamos `min` e adicionamos a lógica onde pegaremos o valor absoluto da subtração de `s`com array[line] e array [column] - magicSquare que pegará o array[index],[line] e [column]. A variável `maxValue é chamado e pegamos o valor mínimo de `maxValue e da variável `min`.

Finalizando nós retornamos MaxValue. Trazendo o resultado:

```
4 9 2
3 5 7
8 1 5

//input de resultado abaixo:
 1
```
Com isso finalizamos mais uma sessão da série: _Resolvendo problemas no HackerRank:_. Até a próxima
Hasura Cloud: Building Scalable and Secure GraphQL APIs Made Easy
Tags: hasura, graphql, cloud
Published: 2023-03-03 13:03:18

[Hasura Cloud](https://hasura.io/cloud/) is a fully managed GraphQL API platform that simplifies and streamlines the process of building, deploying, and managing GraphQL APIs. It enables developers to build scalable and secure GraphQL APIs with minimal effort, allowing them to focus on developing their applications rather than managing their infrastructure. In this blog post, we'll explore the features and benefits of Hasura Cloud, and how it can help businesses and developers.

## Easy Set-Up and Deployment
One of the main benefits of Hasura Cloud is that it makes setting up and deploying GraphQL APIs easy and fast. It offers a range of deployment options, including Docker containers, Kubernetes, and Heroku. Additionally, Hasura Cloud provides a range of templates and examples that can help developers get started quickly.

## Real-Time GraphQL Subscriptions
Hasura Cloud provides real-time GraphQL subscriptions, which enable developers to build real-time applications that can respond to events as they happen. This feature is particularly useful for building chat applications, stock market apps, or any other application that requires real-time updates.

## Automated Security and Scaling
Hasura Cloud provides automated security and scaling features, which ensure that your APIs are secure and scalable. Its security features include rate limiting, role-based access control, and end-to-end encryption. Its scaling features include automatic load balancing, auto-scaling, and horizontal scaling.

## Collaboration and Team Management
Hasura Cloud enables collaboration and team management, which allows multiple developers to work on a project simultaneously. Its collaboration features include shared databases, version control, and team management tools. Additionally, Hasura Cloud integrates with popular development tools such as GitHub and GitLab.

## Advanced Analytics and Monitoring
Hasura Cloud provides advanced analytics and monitoring features, which enable developers to monitor and optimize the performance of their APIs. Its monitoring features include error tracking, latency tracking, and request tracking. Additionally, Hasura Cloud provides a range of analytics features, including usage tracking, API performance monitoring, and user behavior analytics.

## Final Thoughts
Hasura Cloud is a powerful and flexible platform that simplifies the process of building, deploying, and managing GraphQL APIs. Its easy set-up and deployment, real-time subscriptions, automated security and scaling, collaboration and team management, and advanced analytics and monitoring features make it an excellent choice for businesses and developers who are looking to build scalable and secure GraphQL APIs. If you're looking to simplify the process of building and managing GraphQL APIs, Hasura Cloud is definitely worth considering.
Data science and AI in finance
Tags: datascience, ai, finance
Published: 2023-03-03 13:02:59

Wanna become a data scientist within 3 months, and get a guaranteed job? Then you need to [check this out](https://beyond-machine.com/webinar) !

Data and finance
The use of data science and artificial intelligence (AI) in finance is likely to continue to grow in the future. These technologies have the potential to transform many aspects of the financial industry, including risk management, trading, and fraud detection.

One area where data science and AI are already being widely used is in risk management. Financial institutions use [machine learning](https://thedatascientist.com/machine-learning-vs-ai/) algorithms to analyze large amounts of data and identify patterns that may indicate potential risks. This can help them to make more informed decisions about which investments to make and how to allocate their capital.

**Trending**
[What Skills Do I Need to become a Data Scientist?](https://thedatascientist.com/machine-learning-vs-ai/)


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

AI is also being used to improve trading. Some financial firms are using machine learning algorithms to analyze market data and identify trading opportunities. These [algorithms can help traders make more informed decisions](https://i0.wp.com/thedatascientist.com/wp-content/uploads/2022/12/Ai-in-finance.jpeg) about when to buy and sell securities, potentially leading to more profitable trades.

Fraud detection is another area where data science and AI are being used in finance. Machine learning algorithms can analyze large amounts of data to identify patterns and anomalies that may indicate fraudulent activity. This can help financial institutions to prevent fraud and protect their customers.

## AI in finance
Overall, the use of data science and AI in finance is likely to continue to grow in the future, as these technologies become more advanced and more widely adopted. They have the potential to greatly improve the efficiency and effectiveness of many financial processes, and to help financial institutions make more informed decisions.

<iframe width="678" height="422" src="https://www.youtube.com/embed/nBIaBBVG6mo" title="Data science and AI in finance" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

Do you want to apply AI and data science in your industry?
Data science and AI have countless applications. If you want to apply them in your industry, make sure to check out Tesseract Academy‘s services , and also check out Tesseract’s take in AI applications in finance.

Also, feel free to get in touch if you want to talk about topics such as data science or blockchain.

Wanna become a data scientist within 3 months, and get a guaranteed job? Then you need to [check this out](https://beyond-machine.com/webinar) !

This Blog originally published on [https://thedatascientist.com/data-science-ai-finance/](https://thedatascientist.com/blog/)