teleren/devto huggingface dataset:
Navigating the Future of Tech: Should Software Engineers Focus on AI or Blockchain in 2023?
Tags: ai, blockchain, web3
Published: 2023-01-26 03:38:16

As technology continues to evolve at a rapid pace, software engineers are faced with the decision of which emerging field to focus on in order to stay ahead of the curve. Two technologies that have gained significant traction in recent years are blockchain and AI. Both offer unique opportunities and challenges, and choosing which one to focus on in 2023 will depend on a variety of factors.

Blockchain technology is best known for its use in the creation of digital currencies like Bitcoin, but it has the potential to be used in a wide range of applications beyond just finance. Blockchain technology is essentially a decentralized, digital ledger that can be used to record transactions across a network of computers. It is secure, transparent, and tamper-proof, making it well-suited for use in industries such as finance, supply chain management, and voting systems.

AI, on the other hand, is a set of technologies that allow machines to learn and make decisions based on data. It encompasses a wide range of techniques, including machine learning, natural language processing, and computer vision. AI is being used in a wide range of applications such as self-driving cars, personal assistants, and medical diagnosis.

So, which one should software engineers focus on in 2023? The answer is not clear cut, as it depends on the engineer's interest, expertise and the industry they are working in.

If an engineer is interested in finance, supply chain management, or voting systems, then blockchain technology may be the best choice. Blockchain technology is still in its early stages and there is a lot of room for innovation and growth in this space. Companies such as ChainGuardian, ConsenSys, and BlockFi are building blockchain-based solutions in these areas and are worth keeping an eye on.

On the other hand, if an engineer is interested in areas such as self-driving cars, personal assistants, or medical diagnosis, then AI may be the better choice. AI is being used in these areas to great effect and is expected to continue to be a major growth area in the coming years. Companies such as Google, Microsoft, and NVIDIA are investing heavily in AI and are worth keeping an eye on.

Both blockchain and AI are promising technologies with a lot of potential. Software engineers should focus on the technology that aligns with their interests and expertise, as well as the industry they are working in. Keep an eye on the companies that are building solutions in these areas, as they are likely to be at the forefront of innovation and growth in the coming years.
Dynamically required fields in Joi
Tags: javascript, validation
Published: 2023-01-26 01:12:47

## Introduction

[Joi](https://joi.dev/) is a popular JavaScript validation library. Its fluent and compact interface makes it easy to describe large, complex, validation schemas. Here's a small example:

```js
import Joi from 'joi';

const schema = Joi.object({
  user: Joi.string().required(),
  pass: Joi.string().required(),
  address: Joi.object({
    street: Joi.string(),
    number: Joi.number(),
  }),
});

const result1 = schema.validate({ user: 'joe', pass: '123' });
// { value: { user: 'joe', pass: '123' } }

const result2 = schema.validate({ user: 'joe', pass: false });
// { error: ValidationError('"user" is required') }
```

## The Problem

Joi has support for conditionally changing parts of the schema based on (for example) the value or presence of some of the other object fields using [the when method](https://joi.dev/api/?v=17.7.0#anywhencondition-options).

The following example requires `pass` only when `user` is present in the object:

```js
const schema = Joi.object({
  user: Joi.string(),
  pass: Joi.string().when('user', {
    is: Joi.exist(), then: Joi.required()
  }),
});

const result1 = schema.validate({});
// { value: {} }

const result2 = schema.validate({ user: 'joe' });
// { error: ValidationError('"pass" is required') }
```

But what if you want to change some field validation rules based on a condition external to the validated data? You could duplicate the schema and only change whatever is different in each case.

In this example, fields such as `pass` and `address.street` are only required when validating the payload of version 2 of our API (because they were optional in version 1):

```js
if (apiVersion === 2) {
  schema = Joi.object({
    user: Joi.string().required(),
    pass: Joi.string().required(),
    address: Joi.object({
      street: Joi.string().required(),
      number: Joi.number(),
    }).required(),
  });
} else {
  schema = Joi.object({
    user: Joi.string().required(),
    pass: Joi.string(),
    address: Joi.object({
      street: Joi.string(),
      number: Joi.number(),
    }),
  });
};
```

This works for small schemas, but it can get wild when working with huge objects wit differences scattered along several nested fields.

## The Solution

I was almost giving up when I found [the fork method](https://joi.dev/api/?v=17.7.0#anywhencondition-options). It creates a modified schema by running a custom callback over the schema fields you specify.

The following example is just like the previous one, but uses the `fork` method to modify the schema:

```js
schema = Joi.object({
  user: Joi.string().required(),
  pass: Joi.string(),
  address: Joi.object({
    street: Joi.string(),
    number: Joi.number(),
  }),
});

if (apiVersion === 2) {
  const makeRequired = (x) => x.required();

  schema = schema.fork(
    ['pass', 'address', 'address.street'],
    makeRequired
  );
}
```

I'm no specialist in Joi, but hope that this helps you. Drop a comment if you know a different way to handle this use case!
Missing pennies
Tags: perl, python, theweeklychallenge
Published: 2023-01-26 03:00:24

## Weekly Challenge 201

[Challenge](https://theweeklychallenge.org/blog/perl-weekly-challenge-201/), [My solution](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-201/sgreen)

## Task 1: Missing Numbers

### Task

You are given an array of unique numbers.

Write a script to find out all missing numbers in the range `0..$n` where `$n` is the array size.

### My solution

This is a one liner in Python, giving the list `n`, the solution I provided is:

```python
missing = [i for i in range(len(n)+1) if i not in n]
```

Breaking it down into parts:
* `range(len(n)+1)` is the range from 0 to the length of the array (inclusive).
* this is called in a `for` loop, with each iteration given the value `i`.
* the `if i not in n` part of the clause will only return numbers NOT in the original array `n`.
* the `i` after the opening bracket will return that value.

For the Perl code, I took a different approach given that it does not support `for ... if` or the `in` keyword. The first thing I do is convert `@n` an array, to `%n` a hash with the map function. Then I run this code:

```perl
@missing = grep { !exists( $n{$_} ) } ( 0 .. $#n + 1 );
```

Like with the Python code `( 0 .. $#n + 1 )` is the range from 0 to to the length of the array (inclusive). The grep function iterates through the list, setting `$_` as the current value. The `exists` function checks to see if that value exists in a hash.

### Examples

```bash
$ ./ch-1.py 0 1 3
2

$ ./ch-1.py 0 1
2
```

## Task 2: Penny Piles

### Task

You are given an integer, `$n > 0`.

Write a script to determine the number of ways of putting $n pennies in a row of piles of ascending heights from left to right.

### My solution

[Pennies](https://en.wikipedia.org/wiki/New_Zealand_pound#Coins) were removed from circulation in New Zealand (my birth country) in 1967, well before I was born. Even [1¢](https://en.wikipedia.org/wiki/New_Zealand_one-cent_coin) coins were removed when I was a kid.

Let me start off by acknowledging that the answer for the most efficient solution is probably already in [OEIS](https://oeis.org/). In previous tasks I've occasionally looked at producing the most efficient solution. Not today.

This time I'm solving the solution as it is described, and with yet another recursive function. The good thing is we don't care about what the combinations are, just how many there are.

For this solution my recursive function is called `pile`, and takes two inputs, the `remain`ing pennies, and the `minimum` number I can take. The first call to the function in the input number, and a minimum of 1 penny.

For each call, I loop from the minimum value to the remaining pennies. If the two values are the same, we have found a solution. If there are coins left over, I call the `pile` function again, with the remaining coins and the coins I took (i.e. the new minimum). The return of each call is the number of solutions found.

### Examples

```bash
$ ./ch-2.py 5
7

$ ./ch-2.py 50
204226
```
6 differences you must know when choosing between SRE Vs DevOps
Tags: devops, sre, developers
Published: 2023-01-26 02:38:00

SRE (Site Reliability Engineering) and DevOps are popular buzzwords in the tech industry.

They are both approaches to improving the reliability and performance of software systems.

SRE is a discipline that ensures software systems are highly available, scalable and efficient.

DevOps, on the other hand, is a culture and set of practices that aims to bring development and operations teams together to improve collaboration, communication and automate the software delivery process.

Here are 6 differences you must know when choosing between SRE Vs DevOps: 

Here are 6 differences you must know when choosing between SRE Vs DevOps

## Difference 1

SRE is a set of practices & metrics. Vs DevOps is a mindset of culture & collaboration.

## Difference 2

SRE is tool-agnostic & approach centric. Vs DevOps focuses on tools & pipelines.

## Difference 3

SRE solves for operational & reliability problems. Vs DevOps solves for development pipeline problems.

## Difference 4

SRE focuses on development focused. Vs DevOps is Ops Focused.

## Difference 5

SRE automates redundancy. Vs DevOps automates deployment.

## Difference 6

Metrics for SRE are - Error Budgets, SLOs, SLIs & SLAs. Vs Metrics for DevOps are - Deployment Frequency, Failure Rate.


![SRE Vs DevOps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29c8119c00nfqyskhbv7.png)

Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to learn more in DevOps and Backend space, [follow me](https://dev.to/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).
osdc-2023-assignment1
Tags: git, osdc
Published: 2023-01-09 20:34:41

---
series: osdc
---

I just started OSDC 2023 course with @szabgab [OSDC](https://osdc.code-maven.com/) and here is my first assignment:

This is [my github](https://github.com/anatlavitzkovitz)

This is [my Gitlab](https://gitlab.com/anat.lavitz)

I chose baby yoda as my profile picture because me and my family like watching Star Wars movies together, and I like the idea of a small guy who is more than meets the eye.. 

![baby yoda](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTb_tmtV62f83rVbel-_Eu4tSFH-WlLCxgeGg&usqp=CAU)

__A little about me__

-I am a bioinformatician and I love biology.

-I program mainly in R, Python and Shell.

-Here are some packages I use:

- [Biopython]  
(https://github.com/biopython/biopython)

- [Fittetra] 
(https://rdocumentation.org/packages/fitTetra/versions/1.0)

- [CrispRVariants](https://github.com/markrobinsonuzh/CrispRVariants)

- [dplyr]
(https://github.com/tidyverse/dplyr)

- [ggplot2]
(https://ggplot2.tidyverse.org/)

- [stringr]
(https://stringr.tidyverse.org/)

-What do I want to accomplish in this course?
First to learn and enjoy. Than to gain practical knowledge that will improve my daily work.

-Which open source projects would you like to contribute to?
Maybe one of the above I mentioned, still need to think about it.

__Time investment:__

1.5 hour for: open gitLab account, define participants json, create dev account, update linkedin url, send pull request, update github and dev profile picture. 
1 hour for: write the blog, fixing pull requests issues.
1 hour for: find github for corporations and universities, update the blog.

__a note about a pull request:__
[pull request]
(https://github.com/Code-Maven/osdc-2023-01-public/pull/25)
As my gitlab user name was not corrected in the json file, there was a special test just for me in the test_json.py file. after updating the username in the json file I had also to update the match regex that finds the username to also include a dot, as my user name 'anat.lavitz' contains a dot.


__What are friends for?__
Here is a link to my team mate Shuly and her post:
[blog1](https://dev.to/shulyavraham/osdc-course-with-gabor-4hfi)

[blog2](https://dev.to/shulyavraham/github-insights-from-osdc-szabgab-63o)

__updating the corporations repos with 3 sequencing companies:__
[Illumina]
(https://github.com/Illumina)
[nanopore]
(https://github.com/nanoporetech)
[Pacbio]
(https://github.com/PacificBiosciences)
This is the pull request:
[pull request](https://github.com/szabgab/open-source-by-corporations/pull/6)

and the non-profit repo with the Broad institute git:
[Broad Institute](https://github.com/broadinstitute)
This is the pull request:
[pull request](https://github.com/szabgab/open-source-by-higher-education/pull/4)
I am Noob yet I am a Software Developer.
Tags: tips
Published: 2023-01-26 02:15:59

That's great! Being a "noob" or new to certain areas of software development is a normal and natural part of the learning process for any software developer. Even experienced developers continue to learn and improve their skills throughout their careers.

As a software developer, you will likely work with multiple programming languages and technologies throughout your career, and it's important to be comfortable with the idea of constantly learning and adapting.

It's great that you are taking the initiative to learn and improve your skills as a software developer. With hard work and dedication, you can become proficient in the areas you are interested in and continue to grow as a developer.

Don't hesitate to ask question or seek help when you encounter a problem or a concept that you don't understand. There are a lot of resources available, such as online tutorials, documentation, and forums, to help you learn and improve your skills.
How to Deal with Compromised access in AWS
Tags: cloud, security, programming, serverless
Published: 2023-01-26 01:50:15

Today, I would like to share an interesting situation happened in my personal AWS account and this should be a good learning too..

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w89e96yzcn4zu141ooet.png)
This can be most common use case but we should be very careful.

I had only one root account and one user account under my AWS and Root account has an MFA and regular user account does not have any MFA.

I use my regular user account to perform the programmatic access as it is personal account I have it as an administrator privilege's.(Not a good practice) learn to be specific on providing least privilege's access. I generally use AWS config to setup my machine to connect with any AWS services. And I am playing around to see how to solve if they are compromised to an attacker. 

If for any reason this config is hacked as they are in my local machine then my entire AWS account is exposed as they can read/write/access any personal information data, If this is an organization account.
So I used set-token temporarily using **AWS sts get-session token**. 
By this way we can only provide the access to AWS account for limited amount of time and once they expire we need to login to access the AWS Account. Now I Imagined if these temporary credentials are compromised how to protect AWS Account.

I see we have an option to Disable or Delete a user but if this is an Account specific user and has access to production then the production system is down, if we Disable or Delete the user account. Also found that if we disable the account the temporary credentials are able to still access the AWS Services untill the token is expired. So In this case we should be aware of what the policy is assigned to that user account.(Never grant permissions which are not required).
So In this case I updated the policy under the Administrator to "**DENY**" all the access and then found that account is protected. 

So I want to narrate this story which I did as an exercise, so that If you see this issue in Real time do not Delete/Disable User in Rush to protect from the Incident. Please do watch watch the roles and use Cloud-Trial to analyze what kind of changes were made.
Why I Use Pocketbase (and Why You Should Too)
Published: 2023-01-26 01:46:19

As a developer, I'm always looking for ways to streamline my workflow and increase my productivity. One tool that has been a game-changer for me is Pocketbase.

Pocketbase is a lightweight, open-source, and easy-to-use database management tool. It's perfect for small projects, local development, and prototyping. It has a simple and intuitive interface that makes it easy to manage and query your data.

One of the things I love most about Pocketbase is that it doesn't require any setup or configuration. You simply run the command `./pocketbase serve` in your terminal and it opens up a browser-based interface where you can create and manage your databases.

Another great feature of Pocketbase is its support for multiple data types, including text, numbers, and booleans.

One of the most important things for me as a developer is data security, and Pocketbase takes that seriously. It encrypts all data stored in the database and has a built-in password protection feature.

Overall, Pocketbase is a fantastic tool for developers who need a simple and easy-to-use database management tool. I highly recommend giving it a try.

{% embed https://github.com/pocketbase/pocketbase %}

Let me know in the comments below what you think about Pocketbase and if it has helped you in your development process.
JSConf Chile , la guía del viajero : Barrio Italia
Tags: chile, offtopic
Published: 2023-01-26 00:55:38

**Hola viajero , bienvenido a la Jsconf Chile , si tienes un tiempo libre y no sabes que visitar te invitamos a seguir esta pequeña guía de viaje que hicimos con nuestros compañeros para poder guiarte un poco y puedas disfrutar tu viaje en Santiago.**

Un panorama imperdible en la Región Metropolitana es visitar el **Barrio Italia** y dejarse encantar por sus multiculturales influencias en sus galerías, emprendimientos y gastronomía.

**Como llegar?**

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

**Parque Bustamante (Linea 5):** Saliendo de estación a menos de 5 Minutos.
**Metro Irarrázaval (Linea 5 y 3):**Saliendo de estación a menos de 5 Minutos.

**¿Qué puedo hacer en Barrio Italia?**
Si vienes del extranjero  y quieres conocer nuestros sabores típicos chilenos, entonces debes llegar a la esquina de Avenida Italia con Santa Isabel para visitar a **La Tranquera,** en donde puedes degustar los platos típicos de nuestro país como empanadas, alfajores y empolvados entre otras cosas.


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

Es tanta la magia de este barrio que puede trasladarte a otros países. Ejemplo de ello es **Kantu Food** (Avenida Italia 1371), inspirado en la cocina vietnamita y tailandesa; o **Mariachi Loco** (Girardi 1365), que trae todo el sabor desde México para deleitarte con tacos, margaritas, tequilas y mucho más.

**Algo para beber?**
La vida nocturna de este barrio es bastante atractiva , como recomendación personal es ir al  **Bar de René** (Santa Isabel 0369), especial para aquellos que les gusta el rock y quieren oír a músicos chilenos , conocido por servir sus frías cervezas.


**No todo es comida**

A lo largo del Barrio Italia, podrán encontrar una mezcla de tiendas de diseño y decoración, anticuarios, talleres, boutiques de ropa y calzado, galerías de arte, lindos cafés y pequeños restaurantes.
Muchas casas antiguas ahora son pequeños centros comerciales , cada una tan diferente a la otra , presentando una especie de lugar místico .
También hay muchos recorridos que son dentro de galpones .

**Calle Caupolicán**
En esta calle vas a encontrar muebles  -entre Condell y Salvador-, aquí se encontraran con locales de anticuarios y restauradores de muebles, que además de sus talleres llenos de objetos, exponen su trabajo en las veredas.

**Casa Museo Eduardo Frei Montalva**
En el Barrio Italia también se encuentra la casa del ex Presidente Eduardo Frei Montalva (Hindenburg 683), hoy convertida en un museo de su obra como estadista y su vida privada.


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

En este barrio vas a encontrar mucho arte siendo parte de un barrio bien movido principalmente por extranjeros , hay mucho que recorrer y muchas heladerías que probar.
Your preferred framework for simple web apps?
Tags: webdev, javascript, beginners, discuss
Published: 2023-01-26 00:50:37

Hey all! Hope this is an appropriate use-case for this space.

I'm starting work on a project for a web development company (a pretty small web app, just needs nice drag-and-drops), and they've asked me to field some opinions from those in the know before locking in a framework (or none) to go with.

We've been looking at SvelteKit, which seems interesting. Do you have a preferred framework to use for smaller projects, when you get to pick? If so, why's that your favorite?
Getting started with Web Development
Tags: webdev, javascript, beginners, html
Published: 2023-01-26 00:40:32

Web development is a field that is constantly changing and evolving, but there are a few basic steps that can help you get started.

The first step is to learn the basics of **HTML, CSS**, and **JavaScript**. These three languages form the foundation of web development and are used to create the structure, design, and functionality of a website. There are many resources available to help you learn these languages, including online tutorials, videos, and books.

Next, it is important to familiarize yourself with web development tools such as text editors, browser developer tools, and version control software. These tools will help you write and manage your code more efficiently.

Once you have a solid understanding of the basics, you can start experimenting with more advanced technologies such as responsive design, CSS preprocessors, and JavaScript libraries and frameworks.

Another great way to get started with web development is to build your own website. This will give you hands-on experience with the technologies you have learned and will help you understand how the different parts of a website fit together.

Finally, stay up to date with the latest trends and developments in web development by following blogs and forums, and participating in online communities. The web development field is constantly changing, and it is important to stay current in order to stay competitive.

In summary, learning the basics of HTML, CSS, and JavaScript, becoming familiar with web development tools, experimenting with more advanced technologies, building your own website, and staying current with the latest trends and developments are the best ways to get started with web development.