teleren/devto huggingface dataset:
Stack Overflow Bans Answers from ChatGPT
Tags: chatgpt, gpt3, openai, news
Published: 2022-12-05 17:02:44

ChatGPT has been taking the world by storm this past week. I've experimented with using it for everything from re-wording and simplifying long blog posts to crafting shorter mastodon posts (follow me at [indieweb.social/@thomasreggi](https://indieweb.social/@thomasreggi)). It's been a great help in making my text more coherent and easy to understand. I've also, like many programmers, used it to generate code snippets and even answer some coding questions.

Next, I tried using ChatGPT on stack overflow, pasting some of my questions directly into the chat to see if it could provide any useful answers. While it did provide some correct answers, it also produced some incorrect or non-functioning code, which wasn't immediately apparent until I tried running it.

As an example, I asked ChatGPT the question "[Node path relative same directory missing './' prefix](https://stackoverflow.com/questions/74538224/node-path-relative-same-directory-missing-prefix)" and while I was checking the output, I received a similar answer from a user on stack overflow. The summary and code snippet of the answers are different, but the answers themselves are the same.

Could this all be just a coincidence? It's hard to say for sure. There has been a lot of talk about using software to detect generated text, but we may not be there yet. Today, StackOverflow announced that it will be banning answers generated by ChatGPT: [Temporary policy: ChatGPT is banned](https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned).

According to StackOverflow, the main issue with ChatGPT is that although its answers have a high rate of being incorrect, they often appear to be correct and are very easy to produce. This makes it difficult for users to determine which answers are reliable and which are not.

Here are the two answers side by side:

My ChatGPT answer:

![My ChatGPT answer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5eu5rp8e3z0h05ot6rzh.png)

The user-contributed answer:

![The user-contributed answer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/06i7tvo7xc9wzz0di2yd.png)

The post has since been deleted, and the user has been banned. I'm curious if this is because they had started to spam more and more of these incorrect answers throughout the site.

What do you think about ChatGPT? Has it helped you learn anything new, such as fears, dreams, hopes, or goals? Comment below!
Snipe-IT + Perl
Tags: perl, snipeit
Published: 2022-12-05 16:57:41

I have a new module that is a work in progress, added to as needed. It's on github so you can add more api calls to it and submit a pull request to me. Its co-developed by me and my co-worker.

[https://metacpan.org/pod/WWW::SnipeIT](https://metacpan.org/pod/WWW::SnipeIT)

### What is [Snipe-IT](https://snipeitapp.com/)?

Snipe-IT is an open source asset management, to enable IT departments to track who has which laptop, when it was purchased, which software licenses and accessories are available, and so on. It can be self-hosted making it a great option for system administrators.

### Purpose

We needed a way to interact with Snipe-IT from Perl for a Koha Plugin he is making.

At first, I set it up to use Moo for the object class but then with Perl Devs working towards Corinna with Object::Pad, I moved it to Object::Pad, the migration was super easy, but I am not using a ton of its features.

### How to use

Firstly, you need a access token and the url to the Snipe-IT instance, if its https that would be preferred. This example its http.

```perl
use WWW::SnipeIT;
 
my $snipeIT = SnipeIT->new( endpoint => 'http://<mysnipeip>/api/v1/', accessToken => 'mylongapikey');
```

Here is a basic example of pulling information on a asset tag.

[https://snipe-it.readme.io/reference/api-overview](https://snipe-it.readme.io/reference/api-overview)

When creating this i tried to follow their structure with $snipe->{'<subject>'} to make it easy to follow their guide.

```perl
my $snipe = $snipeIT->snipe();
my $result = $snipe->{'hardware'}->getHardwareIDByAssetTag(123);
say $result;
```
And more examples on how to use it.

```perl
my $updateBody = '{"name":"Fruit Computer","notes":"Apple Computer"}';
my $searchBody = '{"name":"name","element":"text","field_values":"3Com"}';
my $assetTag = 123;
my $hardwareID = 321;
my $user = "Scott";
my $fieldName = "";
my $fieldValue = "3Com";
my $assetName = "3Com";
my $searchString = "ChromeBook";
my $categoryID = 3;
my $serialNumber = "abc1234";
 
warn Dumper($snipe->{'hardware'}->getHardwareIDByAssetTag($assetTag));
warn Dumper($snipe->{'hardware'}->getHardwareByAssetTag($assetTag));
warn Dumper($snipe->{'hardware'}->getAssetTagByHardwareID($hardwareID));
warn Dumper($snipe->{'hardware'}->updateAssetByHardwareID($hardwareID, $updateBody));
warn Dumper($snipe->{'hardware'}->updateAssetByAssetTag($assetTag, $updateBody));
warn Dumper($snipe->{'hardware'}->getHardwareByCustomField($fieldName, $user));
warn Dumper($snipe->{'hardware'}->getHardwareBySerialNumber($serialNumber));
 
 
warn Dumper($snipe->{'hardware'}->getHistoryByHardwareID($hardwareID));
warn Dumper($snipe->{'hardware'}->getHistoryByAssetTag($assetTag));
warn Dumper($snipe->{'hardware'}->searchHardware($searchString));
 
warn Dumper($snipe->{'hardware'}->getHardwareByCategory($categoryID));
```
Its not fully featured but its a good start.
Boots on!!
Tags: javascript, css
Published: 2022-12-05 16:47:57

Tomorrow I start a new journey on a boot camp as a front end developer. I am really excited but know that this is going to be one hell of a journey.


I am going to post my experiences as I go along but would like to know if anyone else has taken this route and what their opinion is or if they have any advice.

Did you find work easily, what kept you going?
How to Setup a Complete Discord.JS Template Through the Command Line
Tags: discord, node, typescript, javascript
Published: 2022-12-05 16:40:44

Setting up a complete boilerplate for a Discord bot can often take a lot of time. From initial files for registering commands, handling commands/events, and templates for the various Discord interaction types, preparing the environment can easily take up to an hour!

I set off to create a command line interface for setting up a fully functional and ready to go Discord Bot which does the job for you in just a couple of minutes.

## spawn-discord-bot

`spawn-discord-bot` is an NPM package for spawning a Discord bot. The template includes all the required files, along with handlers for the various Discord API components. Each command type contains an example file to help you get started.

The end result will be a directory as such:

![Bot directory result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83f8e6ezcsknzsnf7ryn.png)

### Getting Started

Open up your command line and navigate to the directory you wish to create your bot in.

Run the following command to begin:

```ssh
npx spawn-discord-bot
```

You may be asked to download the package first. Enter **Y** to do so.

Next, you will be asked to name your bot's folder. Insert a folder name, or hit enter to apply the default (my-discord-bot).


![Terminal output example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2oz3quy89e1vqj77hk11.png)

You now need to pick the language of your Discord bot. Use the arrow keys and ENTER to pick. 

![Terminal output example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rx79zrj3685s3lixbnfe.png)

Your bot template will then download, it will only take a few seconds.

### Configuring Your Bot

Next you will need to setup your bot's credentials and example commands.

Follow the steps provided by the command line to begin

![Terminal output example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0gwwu11l9yc5m1kkxhx2.png)

`npm i` will install the required dependencies for the template.

`npm run configure` will start the configure script which is what you will use to set your client's **token, id, and guild id**. Make sure you have these on hand and ready.

![Terminal output example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwb2rpdscm6si3qjnkdv.png)

*Make note of the pasting hint*

### Registering Commands

Before we can turn on the bot, we must register the example commands. If you do not wish to use example commands, delete the example files and move on to the final step.

Run the following command to register:

```ssh
npm run commands
```

Commands will register globally by default. Use the `local` option to only register locally:

```ssh
npm run commands local
```

### Logging In

Lastly, to turn your bot on:

```ssh
npm start
```

`YOUR_BOT_NAME has logged in!` will appear in the terminal.

And that is it! You now have a fully set Discord.JS client ready to go.
Why is your website slow? Common causes and how to fix them
Tags: webdev, javascript, jamstack, serverless
Published: 2022-12-05 16:34:33

"Why is my website so slow?" That is one of the questions you don't want to ask yourself ever! Do you know that your website loses more than 10% of visitors with every second of loading time? 🤯

Why is a website's loading speed important?
- It is essential to realize that a slow website can lead to users losing patience and leaving.
- Besides losing a significant amount of audience, a slow website can build a wrong impression about your brand.
- The reduced loading speed will affect your rankings.

As you can page speed has a huge impact on conversions, so before you launch your site live, you need to get some knowledge to power your site.

Which metrics to follow for better website performance?
Knowing what metrics to pay attention to before measuring your website speed is crucial to having a fast website. The following are some of them:

- TTFB (Time to First Byte) measures the amount of time it takes for a user's device to receive its first byte from the server.
- Page load time: This is the amount of time it takes for the entire page to load.
- Round Trip Time (RTT) is the time it takes for data to travel from one place to another.
- Page size: This metric measures how large your page is.

Why is your website running slow
- You are not using CDN
- You didn't think about caching problems
- You have unoptimized images
- You have a lot of flash content
- You have a lot of ADS
- Too many RTTs
- Hosting service issue
- You are not using SSG!
- You are not using Headless CMS.
- Want to see solutions? ➡️https://thebcms.com/blog/why-is-your-website-slow-and-how-to-fix
Luos surpasses 400+ stars on GitHub! 🎉
Tags: opensource, github, microservices, luos
Published: 2022-12-05 16:33:15

We are excited to announce that we’ve reached over 400 stars on GitHub last week! 

⭐️ Star the Luos repository [here](https://github.com/Luos-io/luos_engine)

We are an open-source start-up, this means we grow through your support and contribution. 

The Luos team wants to thank everyone for your support on the Luos repository!
BOPIS (Buy Online Pickup In Store) APIs now Available in Open Beta
Tags: buyonlinepickupinsto, ecommerce, bigcommercedeveloper, bopis
Published: 2023-01-03 17:03:08

---
title: BOPIS (Buy Online Pickup In Store) APIs now Available in Open Beta
published: true
date: 2022-12-05 16:25:57 UTC
tags: buyonlinepickupinsto,ecommerce,bigcommercedeveloper,bopis
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/1024/0*TmWsLiUA_L8vRHSR)

### BOPIS is available!

An exciting new feature of our multi-location inventory functionality is here! Buy online pick up in store (BOPIS — [check out the documentation here!](https://bigcommerce.stoplight.io/docs/api-beta-buy-online-pick-up-in-store/api-docs/overview)), also known as Click & Collect outside the United States, is now available in open beta via our APIs. This update enables merchant developers, tech partners, and agencies to create custom experiences around picking up items at their retail locations.

### What exactly is an open beta?

BigCommerce open betas include production use ready functionality, which is subject to change based on the feedback from beta participants. Open betas are a great way to try out the latest functionality and have your voice heard by giving feedback to the BigCommerce team. Participants opt in to open betas, and everyone is eligible!

### What’s included in the release?

We’ve released 2 new APIs, including the Pickup Methods API and Inventory API, and updated a handful of existing APIs. Together, this means that merchants who have multiple retail locations will have the tools to create custom BOPIS/Click & Collect experiences that are tailored to their buyers’ preferences.

### I’m interested! What are my next steps?

To opt in, locate and click on _Settings_ in the Control Panel menu, located on the left-hand side. Once you’ve done so, select _Inventory_ in your BigCommerce Control Panel, as seen below.

![](https://cdn-images-1.medium.com/max/1024/0*M-fW95hIa59M6RHN)

After selecting “Settings”, select “Inventory”

A banner with an option to _Try it now_ should be on the top of the page_._ If you want to enable the BOPIS APIs, select that! This banner also provides you with more information about the BOPIS APIs, what is coming soon, and a link to relevant documentation ([_also found here_](https://bigcommerce.stoplight.io/docs/api-beta-buy-online-pick-up-in-store/api-docs/overview)).

![](https://cdn-images-1.medium.com/max/1024/0*90w-gKKuFyFE4tJv)
_BOPIS APIs opt-in banner_

To enable BOPIS APIs, click _Try it now_! Once you click that, you’ll see the banner pictured below outlining what is available in the beta as well as providing supplemental documentation about the API at the top of your screen.

![](https://cdn-images-1.medium.com/max/1024/0*b2VWW5KBFgWoFP7m)
_BOPIS APIs early access mode trial success_

**And that’s it!** You now have BOPIS enabled on your store. To learn more about our APIs, please check out our[BOPIS APIs documentation](https://bigcommerce.stoplight.io/docs/api-beta-buy-online-pick-up-in-store/api-docs/overview).

_If you still have questions, comment on this article or_[_tweet at us_](https://twitter.com/BigCommerceDevs)_!_

* * *
Gems in Ruby
Tags: ruby, webdev, rails, beginners
Published: 2022-12-05 16:20:48


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fq2wu7h7grurbjkv8tzd.png)Gems in Ruby are, in my opinion at least, one of the coolest features about Ruby. Ruby gems generally have a specific purpose such as faking data or something more general like testing/debugging your code. To start you'd have to install bundler by doing: 

```
install bundler
```
Then the way you'd import a gem is by simply running:
```
gem install (your ruby gem)
```
The final step is to install the gem by running:
```
bundle install
```

A way to find gems is by looking through the official website: https://rubygems.org/. The coolest part about gems has to be the fact that if you're thinking of doing something tedious or complex to some degree then someone has probably already made it into a gem. A personal favorite gem of mine has to be the faker gem. I alluded to it earlier, it's a gem that fakes data. It can give you different things ranging from fake characters from lord of the rings to fake street names and addresses. The syntax for this gem is:
```
Faker::Name.name

Faker::Address.street_address

Faker::Movies::LordOfTheRings.character
```
The text after the colon specifies what kind of information you want and then the dot notation says what you want from that broad range of information. It's pretty expansive and can be used to mainly fake data for a personal project. 

Another super popular gem is the Pry gem. This gem can be used in tandem with another gem known as the rake gem. Simply put, both gems are used for testing out your code and managing it easier. You enter the rake console by running:
```
rake console
```
This puts you in a pry session, which is used to run code in specific blocks. There are of course rules you have to follow, but once you get the hang of them it becomes a very powerful tool when you're testing your code. Ruby gems are my favorite aspect of ruby for this exact reason, there's just an endless amount of possibilities whether it be something wacky or something invaluable.
Vanilla JavaScript vs React (JSX)
Published: 2022-12-05 16:20:09


As a software engineer student, learning "Vanilla" JavaScript was more challenging to me than learning React (JSX). Through Vanilla JS, it was harder to build proper architecture, so code would not quickly break; and to deal with DOM updates, and searches. The reason why is because "vanilla" JavaScript does not have third-party libraries like (React) full of tools to make our lives easier, as the general structure is dictated by framework and developer just have to follow good practice.

The UI (User interface) needs to be updated frequently and manually with Vanilla JS. React JS offers a fantastic feature as it has a virtual DOM, unlike Vanilla which breaks down the UI into smaller and reusable components. React (JSX) outperforms Vanilla JS regarding UI/UX (User interface/ User experience) performance because developers don't need to enter the DOM. It happens automatically.

Due to applications getting more complex and dynamic, Facebook created React library to assist speeding the development process up. "It was first deployed on Facebook's News Feed in 2011 and later on Instagram in 2012. It was open-sourced at JSConf US in May 2013. React Native, which enables native Android, iOS, and UWP development with React, was announced at Facebook's React Conf in February 2015 and open-sourced in March 2015". Which means that, the code is designed to be publicly accessible to anyone so they can see, modify, and distribute the code as they see fit. Open source software is developed in a decentralized and collaborative way, relying on peer review and community production.

React, also referred as (JSX - JavaScript XML); is an extension to the JavaScript language syntax. The combination of HTML and JS, allows us to write HTML-like code in our JS files.


See below an example of the difference between "vanilla" JS and React JSX syntax. 

Vanilla JS being imperative which describes the actions a program should take, each step of the way and how a program should go about doing those actions

React JSX being declarative which describes what a program should accomplish or its end result, and leaves the determination of how to get to the end result up to the program


![Vanilla JS vs React JSX](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fv3ksbr6chcd3h2xxyke.png)





![Vanilla JS vs React JSX](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0wvstivngrhq4iv7xy2.png)



Here are some examples of the most influential software engineer languages and what they are being used for:
( https://bootcamp.berkeley.edu/blog/most-in-demand-programming-languages/ )



In conclusion, React JSX was particularly easier to learn in comparison to Vanilla JS due to its powerful library tools. However, every new language takes time and consistency to be mastered and that is the final goal.


Resources: https://en.wikipedia.org/wiki/React_(JavaScript_library)#:~:text=It%20was%20first%20deployed%20on,open%2Dsourced%20in%20March%202015.

https://bootcamp.berkeley.edu/blog/most-in-demand-programming-languages/
Find Minimum in Rotated Sorted Array
Tags: javascript, leetcode
Published: 2022-12-05 16:17:34

[Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)

```js
/**
 * @param {number[]} nums
 * @return {number}
 */
var findMin = function(n) {
     let min = n[0];
    let l = 0;
    let r = n.length - 1;
    
    while (l <= r) {
        let m = Math.floor((l+r) / 2);
        if (n[m] < min) min = n[m]
        
        if (n[m] >= n[r]){
            l = m + 1;
        }else {
            r = m - 1;
        }
    }
    
    return min
};

```
What I learned today
Tags: programming, cloud, tutorial, devops
Published: 2022-12-04 08:23:26

Today we can discuss about IP address and I can also tell you about IPv4 and IPv6:
Everyone who are living in this world has it’s own unique identity. The unique identity maybe his/her home address or maybe his/her ID card number. But can you ever think what is your identity on the internet??? So, don’t worry today i can answer this question in more simple words.

## IP Address:

IP address stands for Internet Protocol Address. It can provide your identity on the internet. 

It’s also enable the devices to communicate with each other on IP Based Networks like internet. The example of IP address is (231.23.764.123). 

The working process of this technology is very simple. When any device is connected to the internet. A unique numerical identity is assigned to it. When two devices wanted to share the information. 

The data are firstly converted into packets and then transferred to the destination device containing IP address of both devices.

## Version Of IP ADDRESS:
There are two versions of IP address which are introduced now a days. The first one is IPv4 and the second one is IPv6.

IPv4: IPv4 stands for Internet Protocol Version 4. It is a technology that allows the devices to communicate with each other. IPv4 is popular now a days and many devices are used this type of technology. The IPv4 address size is 32 bit. The example of IPv4 is (192.149.0.24).

IPv6: IPv6 stands for Internet Protocol Version 6. It is more advanced then IPv4 but it’s working is same like IPv4. It’s enable more devices to communicate with each other. The IPv6 address size is 128 bit. The example of IPv6 is (3FFE:F200:0234::48).
## how to check ip address 
**Windows 11**
For Wi-Fi connection
Select Start > Settings > Network & internet > Wi-Fi and then select the Wi-Fi network you're connected to.
Under Properties, look for your IP address listed next to IPv4 address.

For Ethernet connection
Select Start > Settings > Network & internet > Ethernet.
Under Properties, look for your IP address listed next to IPv4 address.
[This pos](https://support.microsoft.com/en-us/windows/find-your-ip-address-in-windows-f21a9bbc-c582-55cd-35e0-73431160a1b9)t explains more.

**Linux**
You can determine the IP address or addresses of your Linux system by using the hostname , ifconfig , or ip commands. This post explains more about [how to check ip address in Linux](https://www.howtouselinux.com/post/check-ip-address-in-linux).

**MacOS Terminal**
Open the Terminal. You’ll likely find it in the Utilities subfolder of the Applications folder.

For Ethernet connections, enter the command ipconfig getifaddr en1. For Wi-Fi connections, enter the command ipconfig getifaddr en0.

The Terminal app can quickly show you your local IP address and your public IP address at the command prompt with one simple entry.

To get your public IP address from the Mac Terminal, enter the command curl ifconfig.me.