teleren/devto huggingface dataset:
Google Bard vs OpenAI ChatGPT
Tags: productivity, news, ai, machinelearning
Published: 2023-02-19 15:11:42

O CEO do Google, Sundar Pichai, apresentou hoje o Bard: a resposta da gigante tecnológica ao ChatGPT da OpenAI em uma disputa de titãs do setor de inteligência artificial. A disputa entre o ChatGPT e o Bard é um assunto de grande interesse no mundo da inteligência artificial. Ambos são modelos de linguagem avançados, criados por empresas líderes em tecnologia, e buscam fornecer soluções conversacionais para ajudar os usuários a acessar e compreender informações de forma rápida e eficiente.

O ChatGPT é um modelo de linguagem treinado pela OpenAI, que tem como objetivo responder às perguntas dos usuários de forma objetiva e precisa. Ele é capaz de responder a uma ampla gama de perguntas e tópicos, desde assuntos cotidianos até questões técnicas mais complexas. Além disso, o ChatGPT é altamente escalável e pode ser usado em diferentes aplicações, incluindo chatbots, assistentes virtuais e sistemas de busca.

Por outro lado, o Bard é um serviço de inteligência artificial conversacional, criado pela Google, que combina o conhecimento do mundo com a potência de seus modelos de linguagem avançados. Ele é alimentado pelo Language Model for Dialogue Applications (LaMDA), que permite ao Bard fornecer respostas frescas e de alta qualidade, baseadas em informações da web. A plataforma ainda não foi aberta ao público, mas já esta causando grande expectativa no mercado.

É importante lembrar que ambos os modelos ainda estão em fase experimental e ainda há muito a ser feito antes que eles possam ser usados ​​de forma ampla. A Google está trabalhando para melhorar a qualidade e a velocidade do Bard, enquanto a OpenAI está constantemente aprimorando o desempenho do ChatGPT.

Em resumo, o Bard é a última adição à crescente lista de produtos de inteligência artificial da Google, e marca o início de uma disputa emocionante entre gigantes do setor. Com sua combinação única de dados e algoritmos avançados, o Bard tem o potencial de revolucionar a maneira como as pessoas interagem com a tecnologia de inteligência artificial, mas ainda vamos ter que esperar um pouco mais para saber o que realmente vem por ai.
SQL101:INTRODUCTION TO SQL FOR DATA ANALYSIS
Tags: sql, datascience
Published: 2023-02-19 14:57:01


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdjc7zbq0nqjc1fkbmqv.png)
SQL stands for *Structured Query Language*. It is a language used in programming and used to access and manipulate data in databases. SQL was developed in 1970s, but over time it has become one of the most used query language
***Why SQL?***
The reason why SQL has become one of the most common language in programming and accessing data in databases are as follows;
1.SQL is standard and has been well documented. Therefore, people can easily learn the language.
2.SQL can as well analyze data of any size, be it small or large stacks of data, SQL can easily analyze them.
3.The language is also simple and non-procedural.
 
Some of the basic commands in SQL are as follows
*SELECT* this command extract data from a database.

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


*DELETE* this command delete data from a database

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


*UPDATE* this command update data in a database

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


*INSERT INTO* this command insert new data into a database

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


*ALTER* this command is used to modify a table.

***SQL SYNTAX***
Syntax is the structure of statement in computer language. Since SQL is a computer language, the are specify sets of rules that are followed when writing it. They include:
1.SQL keywords can either be written in uppercase or lowercase, it is not case sensitive.
2.SQL statement can be written in a single line or multiple lines.

SQL can be used to access and manipulate data in all relational databases which include;

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


-MySQL
-Oracle
-PostgreSQL
-MSSQL .etc 

Therefore, SQL is a language that one should know in order to be successful as a data analyst, data scientist and even data engineer and many other careers.
AWS Part 14 -- CloudTrail で操作ログを残す
Tags: aws, cloudtrail, kms
Published: 2023-02-19 14:51:05


## why

リカバリーのために、AWS リソースへの操作履歴を見れるようにしたいから。

---

## CloudTrail とは？

AWS リソースを変更した時に記録をするサービス。

https://docs.aws.amazon.com/ja_jp/awscloudtrail/latest/userguide/cloudtrail-user-guide.html

公式によると、

- ユーザー ( 人間がログインして動かす )
- ロール ( ECS タスクや LAMBDA 関数の実行 )
- AWS のサービス ( よくわからない )

でによって実行されたアクションが記録できると書いてある。

アクションとは EC2 インスタンスなどのリソースの作成や変更などと解釈した。

---

## 実際に作成する

CloudTrail のページから Create Trail ボタンを押す。

最初の 1 つは詳細設定が省かれるので、削除して新しく作る。

下記の設定で作る。

- 名前: all-history
- 保存場所: 新しい S3 バケツ
- バケツ名: all-history-by-cloudtrail
- KMS キーエイリアス: all-history-kms
- ログファイルバリデーション: true
  - 重複するログを隠してくれると予想。
- SNS 通知: false
  - ログが流れるたびに Slack や Twitter に post できると予想
- CloudWatch ログ: false
  - CloudTrail で見れれば十分と考えたため。

次に下記の、記録するイベント詳細を決められる。

- イベントタイプ
  - 管理イベント: true
  - データイベント: false
  - 異常なイベント: false
- 管理イベント
  - API アクティビティ: Read and Write
  - KMS イベントを除外: false
  - RDS API イベントを除外: false
 
AWS リソースの管理ログだけ残したかった。
Read までつけるとログが多すぎるかもしれない。
検証のためにつけた。

これで Create Trail する。

---

### KMS キーエイリアスとは？

https://qiita.com/mksamba/items/a7e902c6d5a12f2a36dc#:~:text=%E4%BD%9C%E6%88%90%E3%81%95%E3%82%8C%E3%82%8B%E3%80%82-,%E3%82%A8%E3%82%A4%E3%83%AA%E3%82%A2%E3%82%B9,-(%E5%90%8D%E5%89%8D)%20%E3%82%92%20%E3%80%8Cmksamba

KMS キー名のとこらしい。

---

### KMS キーとは？

CloudTrail の作成ではそんなに意識しなくて良さそう。

https://dev.classmethod.jp/articles/10minutes-kms/

KMS キーとはデータを暗号化する AWS 用の鍵。

マスターキーとデータキーがある。

マスターキーは

1. データキーを暗号化できる
2. ローカルに DL できない

1. 実際のデータを暗号化できる。
2. ローカルに DL できる。ローカルで使う。

実際の運用は

1. マスターキーA でデータキーA を作る
2. データキーA で実際のデータA を暗号化する。
3. 暗号化されたデータキーA と、暗号化されたデータA が手に入る。
4. データキーA を削除する
5. マスターキーでA 暗号化されたデータキーA を復号する
6. データキーA で復号化されたデータA が手に入る。

このように使えると解釈した。

https://qiita.com/mksamba/items/a7e902c6d5a12f2a36dc#53-%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E6%9A%97%E5%8F%B7%E5%8C%96

実際にはこのような操作になるらしい。

---

## 検証してみる

KMS キーの作成ログはあるのを確認した

EC2 の作成、削除を実際にしてみた。

すると

* TeminateInstanses
* RunInstances

これらのイベントが観測できた。
リンクを辿ると、削除されたインスタンスに飛べた。

---

## まとめ

AWS でリソースの作業ログを残すには CloudTrail を作成する。
設定としては管理イベントの Read Write があれば十分。

以上。

---

## 今後やりたいこと

- SNS 通知。Slack
- 異常検知。( 検証が難しそう )
- KMS キーの本格的な運用
Docker Compose For Joomla
Tags: docker, joomla, containers, containerapps
Published: 2023-02-19 14:37:58

#Joomla

![joomla](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhixqd785o1acrpv2r6p.jpg)

### Configure docker-compose.yml

```
version: '3.5'

services:
  joomla:
    image: joomla
    container_name: joomlaweb
    restart: unless-stopped
    links:
      - joomlamysql
    ports:
      - 80:80
    environment:
      JOOMLA_DB_HOST: joomlamysql
      JOOMLA_DB_NAME: joomladb
      JOOMLA_DB_USER: joomlauser
      JOOMLA_DB_PASSWORD: 147258369
    
    networks:
      - joomla

  joomlamysql:
    image: mysql:latest
    container_name: joomlamysql
    volumes:
        - ./mysql/mysql_data:/var/lib/mysql
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: RO0tP@sswd
      MYSQL_DATABASE: joomladb
      MYSQL_USER: joomlauser
      MYSQL_PASSWORD: 147258369

    networks:
      - joomla

networks:
  joomla:
    name: joomla-network
    driver: bridge

```

---

1.Run the command below :

```
docker-compose up -d
```

2.Direct your browser to http://localhost

Note that port 80 must be open and not in use
Dico
Tags: webdev, api, nextjs
Published: 2023-02-19 14:26:35

## 1. What is Dico?

First of all, you there you have Dico's [repo](https://github.com/All-Khwarizmi/Dico) and [site](https://dico-ochre.vercel.app).

Then, as you might have guessed Dico is a simple French-Spanish dictionary. 

Dico allows you to look-up one word at the time in either directions thanks to [PONS Online Dictionary API](https://fr.pons.com/p/dictionnaire-en-ligne/developers/api), for which you will need an API key but their free tier is plenty enough for playing around.

For this project I've used :

- [Typescript](https://www.typescriptlang.org) for the safety reasons 
- [Next.js](https://nextjs.org) for both front-end and back-end
- a postgresql database hosted on [Railway.app](https://railway.app)
- [Prisma](https://www.prisma.io) as ORM 
- [Tailwindcss](https://tailwindcss.com) for the styling


## 2. Dico's purpose

As a Spanish teacher my biggest challenge is to make students do their homework. Then the second one is to make them not to write everything in French on an online translator, but rather use it wisely when they need it most.

However, what I've learned so far is that although they're supposedly digital natives, they don't know how to use such tool efficiently. It's like having a car but don't  knowing how to drive properly.

So I've implemented Dico in a course where they could look-up a certain amount of words to accomplish a series of tasks. The less the use it the more points they get. It forces them to try to guess or realise they might not need this word specifically for the understanding of the document. 

## 3. Big Theta of Dico

Since I'm a "free-tier developer" I promptly realised that even though it's not likely that my students use Dico enough to reach the API usage limit (1000 words), it might happen. 

Furthermore, I also realised that Dico's algorithm cost could be exponential if each student look for any given word. Not performant at all. 

## 4. Big O of Dico 

The solution I found is somewhat based on linguistics and a cost-sharing strategy. 

I know for a fact that we as speakers tend to use less and less vocabulary nowadays. So I thought that if I could store each word the first time it's been searched it would make the algorithm cost linear instead of exponential. It would make exceeding API limit less likely since we use to have around 25000 (on average) words of vocabulary. Finally, it might improve searching performance. Once a word has been searched and stored on a database, it can be accessed quicker than requesting it to the API.
 
## 5. Conclusion

All in all Dico is a dictionary web app that despite its simplicity could have been really expensive if I would not have come with an optimization of some sort. It's kind a taste of my own medicine that I had to work around this limitation by avoiding requesting too much the dictionary API.
Nuxt and WPGraphQL
Tags: webdev, nuxt, javascript, vue
Published: 2023-02-19 14:26:12

I'm at a loss. I have tried for days going in circle and I feel like I am going crazy. I should explain I am mainly a designer that lives in Figma and I have been trying to get an understanding of Vue and Nuxt and thought of updating my portfolio, so please excuse me if I should like I have no idea :P

I'm trying to pull in the contents of a WordPress headless CMS into a Nuxt3 site. I can get all of the content to show via `{{ data }}` but I just can't seem to show simple things like the site title or a list of the five latest posts.

`https://test.cms.sulei.dev/graphql` is the test GQL endpoint and seems ok from what I have tested.

I have tried various ways to pull in the data:
- nuxt-graphql-client
- nuxt-apollo
- usefetch

This is an example of the index page where I have tried to just show the Site Title from WP 

```
<template>
  <div id="front-page" class="prose">
    <h1 class="bg-gray">Nuxt3 ❤️ GraphQL</h1>
    <p>{{ getHeader.siteTitle }}</p>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import useQuery from "@nuxtjs/apollo";
import gql from "graphql-tag";

const siteTitle = ref("");
const siteTitleQuery = gql`
  query siteTitle {
    getHeader {
      siteTitle
    }
  }
`;

const { data } = await useAsyncQuery(siteTitleQuery);
</script>
```

Literally **ANY** guidance or a point in the right direction would be super helpful - Thank you 🤗

Sul
How to Set up a different Database For Testing your Laravel Application
Tags: laravel, php, webdev, testing
Published: 2023-02-19 14:20:24

As developers, we often need to test our applications to ensure that they are functioning properly and free of bugs. However, it is a good practice to set aside a database environment dedicated to testing the application.
Some might be wondering, "why would one need a different database for testing"? Well, the default behaviour of tests in Laravel ensures that your database is "Refreshed" each time you perform a test. This means that the data in database is wiped off each time you run a php artisan test command. But this can be frustrating even while in a development environment because there are some times you would need some data retained in the development database; maybe for also doing manual test or getting a personal feel of what you are building, or whatever the case may be. To stop this behaviour, we have to set up a database dedicated to testing the application.
In this article, I will guide you through the step-by-step process, so you can test your code without affecting your development or production data.

**Prerequisites**
This article assumes that you already have a Laravel application installed and performed your migrations and that the testing is working fine.
Also, we are going to be using sqlite database for the purpose of this tutorial

---

**Create a .env.testing file**
First of all, create a .env.testing file in the root directory and copy the contents of your `.env` file into it

![.env.testing file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6lnljh51g4cya3pbs0a.png)
**Modify the Database configuration**
Next, modify your `DB_CONNECTION` variable to use `sqlite` driver for connections and set the `DB_DATABASE` to any name you like and append `.sqlite` to the end. Example in the screenshot below

![modified .env.testing file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68yyts9fh0xhiwhfpcse.png)
Leave the `DB_PORT` as is, it doesn't really matter

**Run Migrations for the testing database**
Next, let's run our database migrations for the new testing database we created. Running your migrations for testing is quite different from the normal way we know. If you run your migrations using the `php artisan migrate` command, your migrations will be run using your `.env` settings which is not what we want.
Use the command `php artisan migrate --env=testing` to run your migrations. This will make sure that your tables will be migrated to the `sqlite` database we created specifically for testing.
To test that it worked, run your tests again and your development/production database will still be intact.
If you made it to this point, thank you for your time, and I hope you found it helpful. If you have any suggestions or questions kindly use the comments. Peace!
Why do open source projects not accept contributions?
Tags: opensource, management, organizations
Published: 2023-02-19 13:59:16

---
title: Why do open source projects not accept contributions?
published: true
description: 
tags: opensource, management, organizations
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0w8wsr6l1byei4bqckm5.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-02-19 13:43 +0000
---
_To stop you from getting disappointed right away: I do not have the answers! I have questions!_

I just watched some documentaries about the creation of [Vue](https://youtu.be/OrxmtDw4pVI) and [React](https://youtu.be/8pDqJVdNa44). Those two are flourishing open source projects with lots of contributors and seem to have done something right.

During recent years as a developer, I have come across a couple of open source projects that gladly allow anyone to reuse the code. They also receive (plenty of) pull requests, but they are very reluctant to accept contributions. Among those projects were some one-person free-time repositories, some were hosted by small companies.

I wondered why this was the case - and simply asked. The projects did never rejected the idea in general, but the main argument that I heard against accepting contributions was that contributions might lack quality and reviewing and testing would be more effort than creating everything from scratch. Some projects also mentioned the fear of reputation loss if not catching security related issues or similar.

I can understand these concerns. But it [clearly works elsewhere](https://www.linuxfoundation.org/resources/open-source-guides/participating-in-open-source-communities). So, I wonder what all the possible obstacles and countermeasures could be. Maybe someone is interested in thinking here with me.

## Potential reasons to remain closed for contributions
Some problems I thought of are:
- lack of trust into others
- tendency to want to control every aspect
- lack of communication with the community
- lack of resources for dealing with pull requests
- lack of automated improvement (e.g. automated linting)
- lack of automated reviewing (e.g. automated static code analysis reports)
- lack of automated testing (e.g. automated unit tests)
- lack of proper documentation to help contributors to make high quality contributions
- unclear benefits of accepting contributions
- potential copyright issues if contributors reuse code that they should not

That list could probably be expanded ...

Solving all these items would certainly help, but the solution may not be obvious, the items certainly are intertwined, one item may be more important than another, and there will not be one right approach for every project. I assume that in some cases it might not even make sense.

## Care to share?
Now, I wonder if someone could add potential obstacles that I missed or if someone here has gone through the same thought process, or even been involved in tackling and resolving things in an open source project. Do you mind sharing your experiences and ideas?
একজন ডেভেলপারের প্রথম কোন জিনিসটা সবথেকে বেশি প্রয়োজন?
Published: 2023-02-19 13:52:16

একজন ডেভেলপারের প্রথম কোন জিনিসটা সবথেকে বেশি প্রয়োজন? অবশ্যই একটি ভালো কনফিগারেশনের পিসি অথবা ল্যাপটপ।

একজন ফুলস্ট্যাক ডেভেলপারের জন্য পিসি কনফিগারেশন ঠিক কেমন হওয়া উচিত?

অন্যান্য ডেভেলপমেন্টের মধ্যে ওয়েব ডেভেলপমেন্ট-ই সম্ভবত এমন একটি ফিল্ড যেখানে হেভি-কনফিগারেশন বা লাইট-কনফিগারেশন পিসি তেমন চোখে পড়ার মতো কোন পার্থক্য তৈরি করেনা। তবুও যদি আপনার বাজেট ভালো থাকে তাহলে অবশ্যই ফিউচার-প্রূফ পিসি কেনা ভালো হবে কারন পিসি, ল্যাপটপে invest করা কোনোভাবেই ব্যাকফায়ার করবে না। তাই বার বার পিসি কেনার চেয়ে একেবারে একটি ভালো মানের পিসিতে ইনভেস্ট করাই বেস্ট ডিসিশন।

Core i3 দিয়ে শুরু করতে পারেন, তবে জেনারেশনটা আপডেট রাখার চেষ্টা করবেন। শুরুতে ওয়েব ডেভেলপমেন্টের জন্য নিম্নমানের কম্পিউটার ইউজ করতে তেমন কোনো প্রবলেম হয়তো হবে না। কিন্তু আপনি যখন MERN, PHP, Laravel, MEAN, Django এর মত বড় বড় টুলস এবং সফটওয়্যার রান করতে যাবেন তখন আপনার সমস্যা হতে পারে। সবচেয়ে ভাল হয় আপনি যদি Core i5 জেনারেশনের একটি ল্যাপটপ অথবা পিসি নিতে পারেন।

MERN ব্যবহারে কনফিগারেশনের কথা বলতে গেলে বলতে হয়, Core i3 6th gen অথবা Ryzen 3 প্রসেসর, 2.4GHz clockspeed, 8GB RAM, এবং 256GB SSD কে স্টার্টিং পয়েন্ট ধরে নিয়ে একটি পিসি অথবা ল্যাপটপ কিনে নিতে পারেন।

অন্যদিকে PHP, Laravel বা Django ব্যবহার করতে আপনার অবশ্যই হায়ার কনফিগারেশনের পিসি বা ল্যাপটপ প্রয়োজন হবে। যেমন 8GB RAM এ আপনি এই ফ্রেমওয়ার্ক গুলো রান করতে পারবেন কিন্তু সামনে গিয়ে বড় কোনো এ্যাপ বা ওয়েব নিয়ে কাজ করতে গেলে সিস্টেম ল্যাগ করতে পারে। তাই PHP, Laravel এর জন্য 16GB RAM এর পিসি ভালো কাজ করবে।
Vitest
Tags: testing
Published: 2023-02-19 13:46:02

---
title: Vitest
published: true
date: 2023-02-19 13:44:40 UTC
tags: testing
canonical_url: https://blog.nicm42.co.uk/vitest
---

I started using Vite because it's so fast and does everything I need it to. So it seemed logical to give Vitest a go.

I tried using it with React, and React Testing Library. Although the set up was a little different, everything else was the same. Even the way you write tests is the same as using Jest and React Testing Library.

And on top of that, it's fast. Jest would count up the number of seconds you were waiting. If the test failed it would be a longer wait. And it would always be at least 100 seconds, which is a long time to sit around and learn that you'd made a typo.

Vitest, on the other hand, takes about 2 seconds at most. It's not instant, but in comparison to Jest, it feels like it is. Much as I was a convert to Vite, because it's fast, I'm not a convert to Vitest, because it's fast.
Robotics Operating System (ROS) 2 for Space
Published: 2023-02-19 12:56:41

- ROS 2 is the important version Open Robotics Company which has special features which uses OOPS concept so the code is ready to use in Production Robots
- ROS 2 become Programming Language In-dependant and now ROS 2 program can written in CPP and Python with OOPS Concept so the Modules will be much more stable for Production use
- Based on ROS 2 Open Robotics in Association with many Space Agencies like NASA is developing ROS Space which supports special standards for Space use by NASA
My New Development Project
Tags: webdev, beginners, javascript, react
Published: 2023-02-19 12:56:11


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

I Made This Logo Myself And I Create A lot Other Graphic Designs If You Ever Need Any.

```
``
```
SQL for data analysis
Published: 2023-02-19 12:55:20

## SQL FOR DATA ANALYSIS

Sql is a very crucial tool for use in data career. It is one of the most popular and used database. Just like how one needs a spoon to eat then similar one needs sql for data. In this tutorial we wull cover on some of the crucial aspects of SQL. We will explain how to use SQL for data visualization and analysis. We will explain how to use different queries for different functions. 
 
 ### Prerequisites
 - What is SQL
 - Installation Instructions
 - Getting Started
 - Using SQL for data analysis and analysis

 ### 

SQL is a structured query language used for communicating with the database. It is considered the most standard query language for use in relation database management systems(RDMS). In a relational database data is stored in tabular format. Tabular format means in form of rows and columns hence a table. The two table and rows represents variant data attributes and also relationship which links between several data values. 

### SQL tools

-