teleren/devto huggingface dataset:
Pobody is Nerfect and ChatGPT is no exception
Tags: chatgpt, ai, errors
Published: 2023-01-25 02:30:21

---
title: Pobody is Nerfect and ChatGPT is no exception
published: true
description: ChatGPT is a powerful language model that is revolutionizing various industries with its ability to generate human-like text. However, as with any technology, there are bound to be mistakes.
tags: chatgpt, AI, error
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjxgc7hmibkx61oqwp3s.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-01-25 02:15 +0000
---

In the span of only a few weeks we saw the emergence of many new integrations options for the newly spawned AI service. From Discord to IDE's, we have seen a multitude of options enabling automated experiences that go to a whole new level of engagement with its users. 

ChatGPT, or Generative Pre-trained Transformer 3, is already revolutionising industries even in its emergence infancy. However, as with any technology, there are bound to be mistakes. So, what do we do when ChatGPT gets things wrong?

First and foremost, it is important to understand that ChatGPT is a machine learning model and, as such, it is not perfect. It is not a human and does not have the same level of understanding or ability to process information as a human does. Therefore, it is important to approach any output from ChatGPT with a critical eye and not assume that it is always correct.

One way to address errors in ChatGPT's output is through fine-tuning. Fine-tuning involves training the model on a specific dataset or task, which can help improve its performance. For example, if ChatGPT is being used in a customer service chatbot and is consistently misunderstanding a certain type of question, fine-tuning the model on a dataset of similar questions can help improve its understanding.

The most important way to address errors in ChatGPT's output is through human oversight. This can be as simple as having a human review and approve any output from the model before it is sent to a customer or user. This can help catch any errors or inconsistencies that the model may have generated. Additionally, feedback from human users can be used to improve the model over time and or to refine the service that it is utlized within. 

Of cour it is important to note that ChatGPT's errors can be related to the data that it has been trained on. Like any AI model, ChatGPT's performance is only as good as the data it has been trained on. This means that if the data used to train the model is biased or contains errors, the model's output will also be biased or contain errors. To avoid this, it is important to use a diverse and high-quality dataset when training the model.

AI applications like ChatGPT, are powerful tools that have immense potential, but it is not without its mistakes especially in its pursuit to appear human. Addressing errors in ChatGPT's output requires a combination of fine-tuning and building in human oversight, especially for critical tasks.
[SOLVED] Vendor Bill Line Missing When Select Product in Odoo
Tags: debug, odoo
Published: 2023-01-25 02:26:19

I found an issue that I encountered while working with Odoo, it is the missing Vendor Bill Line when a product is selected. You can watch from this image how the issue is:

[Watch: Vendor Bill Line Disappears](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtduuwzhzneciepcqytk.gif)


As you can see, the vendor bill line disappears when I choose a product on it. It's strange and I don't have clue what happened. But when I try to create a vendor bill line without selecting a product, it works.

Then I've suspecting there was a problem with the product configuration. The first thing to check is the accounting-related settings on that product.

![Odoo Product Accounting Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgk0tnd3wam1dry3avvv.png)

It shows no configuration set in this product. It brings me to check the accounting-related configuration of its product category.

![Odoo Product Category Accounting Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/akisnxwnngcf9bdiy6cd.png)

Nothing looks weird from this product category configuration.

> ## I was getting more and more frustrated because I couldn't find the root cause of the problem.

Then, I started the debugging process until I found that the generated journal items when a product is added had the same chart of account type, which was "Payable".

The chart of account names were correct, but the type was suspicious. Normally, when creating a vendor bill, the simple set of journal items would look like this:

> **Expense [Db]
> Account Payable [Cr]**

Or, if a stock input account is configured in the product category, it would look like this:

> **Stock Interim (Received) [Db]
> Account Payable [Cr]**

Based on my findings, I rechecked the type of account that was configured in the product category. The result was that I found the "Stock Interim (Received)" account had the type "Payable".

![Chart of Account Stock Interim](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tonqpcfjszfgicgynznm.png)

This was the root cause of the problem. The solution was to change the type of this account to the correct type. If it intended to be "Stock Interim" account, by default in Odoo it will have type "Current Assets".

Finally, the problem was solved. I was able to create a vendor bill successfully. If you ever come across a similar problem, please check your chart of account configuration. It could be that you have a chart of account with the wrong type.
Help with React Router 😫
Tags: javascript, programming, react, webdev
Published: 2023-01-25 01:28:03

**  Update: as of 1/25 I fixed the issue!!!! I had to add the 'basename' attribute to BrowserRouter:**

```
 <BrowserRouter basename="/shopping_cart">
....
<BrowserRouter/>
```

## Here's the [live site](https://taepal467.github.io/shopping_cart/)

*************************************************************

I am currently working on The Odin Projects "Shopping Cart" Assignment. Right now I am stuck on the Router section. 

When I'm opening the project in VS code and using **npm start** to launch the application, this is how my screen looks: 
![When first opening the web application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r06s7smnd7kyuepm269e.png) and this is my terminal after entering **npm start** 
![starting the application](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xeosu1j5f91oxpuhjjhq.png)

For me to access the home page, I need to edit the url like so:
![After manually removing 'shopping cart' from the URL](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sthkhd81n743myyvjm6c.png)

I'm trying to figure out what I did wrong but still don't understand what's going on. Here's my [github repository](https://github.com/taepal467/shopping_cart/tree/main). Any help is greatly appreciated. Thank you!
Weekly Challenge 201
Tags: perl
Published: 2023-01-25 01:19:58

[Challenge 201](https://theweeklychallenge.org/blog/perl-weekly-challenge-201/)

## Task One
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.

## Task Two
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. i.e. _List all distinct partitions of n._
[My solutions on github](https://github.com/manwar/perlweeklychallenge-club/tree/master/challenge-201/zapwai)
## Solution to Task One
At first I thought there was a typo because there are always going to be _some_ missing numbers. Taking advantage of smart match:

```
use v5.30.0;
no warnings "experimental";
my @array = (0,1,3);
my @list;
say "Input: (" . join(",",@array).")";
print "Output: ";
for (0..scalar @array) {
    push @list, $_ unless ($_ ~~ @array);
}
say join(",", @list);
```

I figured this was ripe for a one-liner:
`print for grep {!($_ ~~ @ARGV)} (0 .. @ARGV)`
## Solution to Task Two
This took a lot of debugging. More smart match action. I chose to start with the largest partition of n (1 + 1 + ... + 1 = n) and started adding each pair of terms, including it in our  collection if it was an ascending sequence. This was my third attempt: I initially started from the bottom (starting with n and subtracting to create (1, n-1) and (2, n-2) etc.); then I considered generating all possible partitions and filtering the ascending ones.

```
use v5.30.0;
no warnings "experimental";
my $n = $ARGV[0] || 5;
say "Input: \$n = $n";
print "Output: " ;
my @set = (join(" ",(1) x $n));
my $i=-1;
do {
    $i++;
    rout($set[$i]);
    @set = grep { defined($_) } @set;    
} until (length $set[$i] <= 3);
my $length = @set;
do {
    rout($set[$i]);
    $i++;
} while ($i < $length);
push @set, $n;
say scalar @set;
say foreach @set;
sub rout {
    my $s = shift;
    my @a = split(" ", $s);
    return "no" if (@a <= 2);
    if ($a[$#a] != 1) {
	for (1 .. @a - 2) {
	    my $str = chonk($_, @a);
	    push @set, $str unless ($str ~~ @set);
	}
    }
    my $str = chonk(0, @a);
    push @set, $str unless ($str ~~ @set);
}
sub chonk {			#add two elems, given offset.
    my ($offset, @a) = @_;
    my $num = $a[$#a - $offset] + $a[$#a - $offset - 1];
    splice @a, $#a - $offset - 1, 2, $num;
    my $bad_cnt;
    for (1.. $#a) {
	$bad_cnt++ if ($a[$_ - 1] > $a[$_]);
    }
    return if ($bad_cnt);
    return join(" ",@a);
}
```
Fixing oversights: Changing a migrated column
Published: 2023-01-25 00:37:46

The link below contains some important information on how to go back and change a column in your database after you have already migrated it.

https://blog.arkency.com/how-to-add-a-default-value-to-an-existing-column-in-a-rails-migration/

The central issue here is that once you migrate, how do you update the database?  Let's say I have already `rails db:migrate`(d) my `Users` column, but then I realize I need to go back and add some default values.
The link above provides the methods that allow this, just do a `rails generate migration` in the command line and then use the code in the link above to change the migration method!
Attr Accessor
Published: 2023-01-25 00:35:00

attr_accessor :color
- Creates a set of 'set' and 'get' methods for 'color'

attr_reader :color
- Creates a 'get' method for 'color'

attr_writer :color
- Creates a 'set' method for 'color'

def initialize(color)
 @color = color
end
- initializes a variable that cannot be changed later when creating an instance of an object
download waec timetable 2023
Published: 2023-01-25 00:23:40

[https://multischolar.com/waec-timetable/](https://multischolar.com/waec-timetable/#utm_source=backlinks&utm_medium=search&utm_campaign=darry+ring+us&utm_content=Michelle)
https://plaza.rakuten.co.jp/chenlee/diary/202301240001/
https://www.provenexpert.com/waec-b/
https://www.producthunt.com/@waecb2
https://www.divephotoguide.com/user/waecb/
https://www.diggerslist.com/waecb/about
https://wakelet.com/@downloadwaectimetable2023805
https://vocal.media/authors/waecb
https://www.lifeofpix.com/photographers/waecb/
https://seedandspark.com/user/waecb
https://rosalind.info/users/waecb/
http://phillipsservices.net/UserProfile/tabid/43/userId/195648/Default.aspx
https://app.roll20.net/users/11548717/waecb
http://uid.me/waecb
https://speakerdeck.com/waecb
https://social.msdn.microsoft.com/Profile/waecb
https://www.iheart.com/podcast/269-download-waec-timetable-20-107771902/
https://active.popsugar.com/@waecb/profile
https://unsplash.com/@waecb/likes
https://camp-fire.jp/profile/waecb
https://plazapublica.cdmx.gob.mx/profiles/waecb/activity
https://www.metal-archives.com/users/waecb
https://artmight.com/user/profile/937915
https://storium.com/user/waecb
https://trabajo.merca20.com/author/waecb/
https://telegra.ph/download-waec-timetable-2023-01-24
https://www.intensedebate.com/people/waecb
https://www.mifare.net/support/forum/users/waecb/
https://pinshape.com/users/2560704-waecb
http://foxsheets.com/UserProfile/tabid/57/userId/118891/Default.aspx
https://www.kompasiana.com/waecb
https://www.credly.com/users/download-waec-timetable-2023/badges
https://www.myminifactory.com/users/waecb
https://www.speedrun.com/user/waecb
https://www.sqlservercentral.com/forums/user/waecb
https://www.longisland.com/profile/waecb
http://flightgear.jpn.org/userinfo.php?uid=32111
https://leanin.org/circles/waecb
https://guides.co/a/download-waec-time/
https://myanimelist.net/profile/waecb
https://mootools.net/forge/profile/waecb2
Local Kubernetes Playground Made Easy
Tags: kubernetes, docker
Published: 2023-01-20 14:38:16

Hey there! Are you looking to play around with Kubernetes but don't want to go through the hassle of setting up a cluster on the cloud? Well, you're in luck! In this blog post, I'm going to show you how to set up a local environment for experimenting with Docker and Kubernetes using [k3d](https://k3d.io/). We'll make sure you have all the necessary tools installed, and then I'll walk you through the process of creating a cluster and experimenting with it. So grab a cup of coffee (or tea) and let's dive in!

## Background

If you are a developer and want to learn how to deploy applications to a cluster, getting a cluster up an running can be a daunting task in it's own rights. There are many ways to do it: spinning up local virtual machines and configuring from scratch or using tools like [minikube](https://minikube.sigs.k8s.io/docs), etc. You may not care for the pain of setting up and configuring a cluster, and if that is you, then the quickest way that I have found is using [k3d](https://k3d.io/).

## Pre-requisites

For this tutorial, you'll need to have Docker, kubectl, and k3d installed. 
**If you are on a Mac and have [brew](https://brew.sh/) installed, you can simply run the install command(s) for anything missing:** 

```sh
brew install docker 
brew install kubernetes-cli 
brew install k3d
```

Otherwise, see the respective docs for install instructions:

- [Docker](https://www.docker.com/products/docker-desktop).
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- [k3d](https://github.com/rancher/k3d)

## Create a Cluster

Here is the best part! [k3d](https://k3d.io/) is a wrapper around [k3s](https://github.com/k3s-io/k3s) and can set up your entire cluster using Docker in no time. It should be noted that this is not intended for production, but it is intended for tinkerers, learning, and exam prep. Here's an example command and then we will break it down:

```sh
k3d cluster create my-cluster --agents 3
```

This sets up a new cluster with one server for the control plan and 3 worker nodes. After a short period, you should be able to run `kubectl get node` and them: one server (control-plane/master) as well as 3 worker nodes, e.g.:

```sh
❯ kubectl get node                         
NAME                      STATUS   ROLES                  AGE    VERSION
k3d-my-cluster-agent-0    Ready    <none>                 108s   v1.24.6+k3s1
k3d-my-cluster-server-0   Ready    control-plane,master   116s   v1.24.6+k3s1
k3d-my-cluster-agent-2    Ready    <none>                 112s   v1.24.6+k3s1
k3d-my-cluster-agent-1    Ready    <none>                 112s   v1.24.6+k3s1
```

If you want to blow it away, simply run `k3d cluster delete my-cluster`. 

At this point, you have a functioning Kubernetes cluster that you can spin up or delete in seconds, running locally with no external dependencies!

## Conclusion

While there are many ways to spin up a Kubernetes cluster, [k3d](https://k3d.io/) is by far one of the simplest.
5 Top Tips for Junior Software Engineers / Developers in Securing Your First Role
Tags: beginners, juniordeveloper, career, codenewbie
Published: 2023-01-24 23:06:20

This post is dedicated to all those making that difficult career transition into software development:

**1. 🤾‍♀️ Take action** — Continue applying and creating projects to add to your GitHub profile. Your GitHub profile is like the new CV, but a good CV is still really important. A lot of the time I find juniors overthinking, procrastinating or not feeling good enough to apply to perfectly suitable roles. Apply anyway! Action will help you breakthrough some of those mental barriers and imposter syndrome.

**2. 📚 Experience over education** — I’ve seen several occasions where people make the mistake of thinking they need to keep taking courses and earning certifications to get a job as a junior developer. It’s true you need to be able to demonstrate a certain standard in interviews, but generally interviewers value projects over certificates, experience over education. So that extra project on your GitHub is far more valuable than the next cert — and if it’s a project done to a top industry standard, then it’s worth its weight in gold!

**3. 🗣 Communicate well** — I’d like to break a myth here, it’s not all about coding in the tech world! Nobody wants to work with a person with an attitude problem, no matter how good at programming they may be. Personality fit is a major criteria in hiring. So in all your interactions with recruiters and potential employers, communicate well. It will take you at least 50% of the way to getting a job in software.

**4. 👩‍💻 Learn your fundamentals** — As a starting point it’s fine to learn a framework like React or Express.js, but it’s also easy to hide behind it like a crutch. The deeper your knowledge of the underlying language goes, the more you’ll impress your interviewers. Set some time aside to go deeper.

**5. ✅ Stay general but it’s okay to specialise** — Often until you join the world of work for real, you may not have a strong preference for the type of work you want to do long-term: front-end, backend, databases or infrastructure/DevOps. If however, you already have a strong preference then lean into it, learn all about it and advertise it! (Just don’t forget to mention you’re going for a Junior position in that more niche field)

**💰 Bonus tip: Be flexible but know your boundaries** — getting your first role will be a challenge, but after that it tends to get easier. So try to be as flexible as possible with location and salary requirements as there’s a large range out there. Of course it’s fine to have some minimum requirements which you won’t budge on 😜 But always prioritise where you’ll learn more and have a supportive culture of buddies / seniors you can reach out to.

**+ Follow** me for more tips :)
Anotación @Transient
Tags: java, spring, jpa, spanish
Published: 2023-01-24 23:00:00

Mediante la anotación `@Transient` (o transitorio en español) podemos crear atributos en clases de tipo entidad (anotadas con `@Entity`) **que no van a persistir en la base de datos**. Igualmente, los atributos anotados con `@Transient` no se mapean con ninguna columna de la entidad.

Gracias a esta funcionalidad, podemos crear comportamientos como el siguiente:

```java
@Entity
class User {
    
	@Id
    private Long id;
    
    @Column(name = "name")
    private String name;
        
    @Column(name = "group")
    private UserGroup group;
        
    @Column(name = "type")
    private UserType type;
        
    @Transient
    private PermissionLevel permissionLevel; // <- Este atributo NO se almacenará en la base de datos
    
    public int setPermissionLevel(...) {
		//
    }
       
}
```

Podemos ver que el atributo `PermissionLevel` no se almacenará en la base de datos, ya que puede que queramos actualizar su valor en tiempo de ejecución, utilizando en primer lugar unos valores o criterios, y según el usuario interactúa con la aplicación que estos valores cambien.
How to do a thread dump on a pod running a Java app ?
Tags: kubernetes
Published: 2023-01-24 22:46:59

If your Java app is struggling with busy threads pilling up, there's nothing better to have a look at the state of those threads and see what was their last action before they hung.

Here is a simple TODO to achieve that if your app is running inside a Kubernetes pod (we will assume that this one only run 1 container).

Open your terminal and tail the logs of your pod :

```
kubectl get po |grep "YOUR_APP"
kubectl logs -f POD_NAME
```

Open a new tab of your terminal, and launch the thread dump :

```
# connect to your pod's container
kubectl exec -it POD_NAME -- sh
# find the PID of your Java process (it should be 1)
ps aux
# force a thread dump to stdout (do not worry : this will not kill the application)
kill -3 YOUR_PID
```

Go back in your first tab and analyse the results.

For example it allowed me one time to quickly find out that I had a key locked in my Redis instance. What else did you discover through them ? Please share your experiences in the comments.

Take care and have a great day !
Oh no, not stackOverflow?!
Tags: beginners
Published: 2023-01-24 22:40:19

Photo by <a href="https://unsplash.com/@dre0316?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Andre Hunter</a> on <a href="https://unsplash.com/photos/vm2cwMEiUFA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
  

Today I hit an obstacle and asked my first question on [stackoverflow](https://stackoverflow.com/questions/75226379/margin-does-nothing-while-inside-body-tag/75226563#75226563). Before posting, I tried everything I could think of. Then, I spent a half hour on google. Then, I composed a question for the site and read through its 10+ suggested links that might be related to my problem. 

As a last resort, I hit "submit" for my question. Within minutes two different people posted suggestions. Their advice didn't work, but **DID** lead me to **solving my own problem**. 

I **updated** my question to inform future struggling coders of why my problem occurred and **how to fix it**. 

My [question](https://stackoverflow.com/questions/75226379/margin-does-nothing-while-inside-body-tag/75226563#75226563) has received 3 downvotes. It's going to get **buried**, and the next person who has my problem will have to **repeat** this whole **cycle**. 

I tried to be a good citizen today; this is kind of **demoralizing**. I hope someone makes a site like this, but for people who **don't** already **know everything**.
SPVM improved Exchange API at v0.9684. Welcome to this easy world of type conversion!
Tags: perl, spvm, beginners, programming
Published: 2023-01-24 22:36:30

<a href="https://metacpan.org/pod/SPVM">SPVM</a> improved Exchange API at <a href="https://github.com/yuki-kimoto/SPVM/blob/master/Changes">v0.9684</a>.

What is the <a href="https://metacpan.org/pod/SPVM::ExchangeAPI">Exchange API</a>? It is a method for converting Perl data structures and SPVM data structures to each other.

SPVM is a statically typed language. Have you ever thought about the difficulties in passing an array of strings to a statically typed language?

Sounds easy? Please try it, this difficulty will be harder than you think. Strings are not just numbers. It must be dynamically allocated in memory. And when it comes to arrays, you need to allocate memory for the array, allocate memory for multiple strings, and assign them to the array. And finally, multiple strings must be deallocated and the array must be freed.

How many lines does this take? What happens if we repeat this over and over? More mistakes. More copy and paste. Your brain will get bored with the same thing over and over again.

```
# SPVM
class MyClass {
  static method foo ($strings : string[]) { ... }
}

# Perl
SPVM::MyClass->foo(["aaa", "bbb", "ccc"]);
```

So you do not have to think about anything. Just pass the Perl string array reference as is.

This is just one example, but there are many automatic type conversions and methods that support conversions.

This is just one example, but there are many automatic type conversions and methods available in the <a href="https://metacpan.org/pod/SPVM::ExchangeAPI">Exchange API</a> to support conversions.

Why don't you take a step into the world of SPVM's easy type conversion? The ease of type conversion will change the value of interactions between statically and dynamically typed languages.