teleren/devto huggingface dataset:
Day 3: ROC curves
Tags: machinelearning, python, 100daysofcode, roc
Published: 2021-01-19 00:19:41

Happy Monday! Today is all about ROCs
![spinning rock](https://thumbs.gfycat.com/BriskThriftyCockerspaniel.webp)
Okay not that kind of rock. Instead, as I found out, it's a way to evaluate how well logistic regression works (and maybe other types of models, I'm not 100%).
So first you start by making a confusion matrix. This takes all of the true positives, false positives, true negatives and false negative and gives you their values. Sounds confusing I know so I guess they got the right name for the matrix.
The next step is to take these four new things and calculate other factors such as precision and accuracy. These give you an idea of how many true positives and false negatives you're getting, respectively. The confusion matrix also produced a value called F score, this is something I've come across before but not really understood so I'll try and brush up on that in the future.
Anyway, from these we can produce a receiver operating characteristic (ROC) curve which allows us to see these things more quickly in a graph. Here's an example of a ROC curve I found on Google:
![A ROC curve, it's kind of hard to explain in words](https://3qeqpr26caki16dnhd19sv6by6v-wpengine.netdna-ssl.com/wp-content/uploads/2018/08/ROC-Curve-Plot-for-a-No-Skill-Classifier-and-a-Logistic-Regression-Model.png)

So the diagonal line is how good your model would be if it just classified between two things at random, it would be right about half the time. The orange curve shows how good your model is. Basically, the closer it is to the top left the better your model is. With a graph like this, you can plot a ROC curve for multiple models and compare how they do. So if you're say comparing KNN and logistical regression you can visually see how well they perform in a specific task and choose the one that's right for you. Neat huh?

I'm trying a new thing today where I post some of the code I learnt so you can try and learn these new things with me. What do you think? Would you like to see more of this or would you prefer I keep it more of a diary?

# The Code
![Spinning earth in code form, like literally ones and zeroes changing to make it look like that. It's a good metaphor for code right?](https://thumbs.gfycat.com/SoggyFearfulCoelacanth.webp)

How to make a confusion matrix:
`From sklearn.metrics import confusion_matrix
Print(confusion_matrix(y_test, y_pred))`

How to make and plot a ROC curve:
`From sklearn.metrics import roc_curve
Y_pred_prob = logreg.predict_proba(X_test)[:,1]
Fpr, tpr, thresholds = roc_curve(y_test, y_pred_prob)
Plt.plot([0,1], [0,1], ‘k—‘)
Plt.plot(fpr, tpr, label=’Logistic Regression’)
Plt.xlabel(‘False Positive Rate’)
Plt.ylabel(‘True Positive Rate’)
Plt.title(‘Logistic Regression ROC Curve’)
Plt.show()`
Enclave Phaser Template updated to Phaser 3.50
Tags: gamedev, javascript, html, phaser
Published: 2021-01-19 14:21:07

---
title: Enclave Phaser Template updated to Phaser 3.50
published: true
date: 2021-01-19 00:00:00 UTC
tags: gamedev, JavaScript, HTML5, Phaser
canonical_url: https://enclavegames.com/blog/ept-updated-phaser-3-50/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/mf0ijfp8ov00vtl5zdb5.jpg
---

Since the [latest Phaser release](https://phaser.io/news/2020/12/phaser-350-released) was the biggest one ever (not counting the major versions), I decided to give the [Enclave Phaser Template](https://enclavegames.github.io/Enclave-Phaser-Template/) an update as well.

> New renderer, isometric tilemaps, layers, post processing effects, and lots, lots more! After 13 beta releases, over 200 resolved issues, thousands of lines of new code and the culmination of over 6 months incredibly hard work, Phaser 3.50 is finally here.

It’s an impressive amount of work - that’s why the unusual increase in the version number from 3.24.1, which was released back in July 2020. Half a year later, the next release is 3.50. Make sure to [check the lenghty blog post](https://phaser.io/news/2020/12/phaser-350-released) to learn about all the details of the new features.

![Enclave Games - Phaser 3.50](https://dev-to-uploads.s3.amazonaws.com/i/l7p8hjfabs8w46q6n8c1.jpg)

Our [Enclave Phaser Template](https://github.com/EnclaveGames/Enclave-Phaser-Template/) is rather simple, so the upgrade was quick and easy. The previous [jump from 2.6.2 to 3](https://end3r.com/blog/2019/07/enclave-phaser-template-updated-to-phaser-3/) needed some coding, but this time it was literally just replacing the minified version of Phaser, as everything else worked perfectly fine. Still, if you plan on using brand new functionalities - now you can.

After some quick fixes, the current release is 3.52 (January 14th), and **EPT** will be updated along the way with further ones. [Rich](https://twitter.com/photonstorm), the author of Phaser, can now focus on developing **Phaser 4** - which I can’t wait to play with, make my own **Nano** version, and build a few small casual games in the process. I hope this will happen sooner than later.
Create an S3 Lifecycle Policy with PowerShell
Published: 2021-01-23 18:11:18

---
title: Create an S3 Lifecycle Policy with PowerShell
published: true
date: 2021-01-19 00:00:00 UTC
tags: 
canonical_url: https://www.sheldonhull.com/blog/create-an-s3-lifecycle-policy-with-powershell/
---

First, I’m a big believer in doing infrastructure as code.

Using the AWS SDK with any library is great, but for things like S3 I’d highly recommend you use a Terraform module such as [Cloudposse terraform-aws-s3-bucket module](https://registry.terraform.io/modules/cloudposse/s3-bucket/aws/latest). Everything Cloudposse produces has great quality, flexibility with naming conventions, and more.

Now that this disclaimer is out of the way, I’ve run into scenarios where you can have a bucket with a large amount of data such as databases which would be good to do some cleanup on before you migrate to newly managed backups.

In my case, I’ve run into 50TB of old backups due to tooling issues that prevented cleanup from being successful. The backup tooling stored a sqlite database in one subdirectory and in another directory the actual backups.

I preferred at this point to only perform the lifecycle cleanup on the backup files, while leaving the sqlite file alone. (side note: i always feel strange typing sqlite, like I’m skipping an l 😁).

Here’s an example of how to do this from the AWS PowerShell docs.

I modified this example to support providing multiple key prefixes. What wasn’t quite clear when I did this the need to create the entire lifecycle policy collection as a single object and pass this to the command.

If you try to run a loop and create one lifecycle policy for each `Write-S3LifecycleConfiguration` command, it only kept what last ran. Instead, ensure you create the entire object as shown in the example, and then you’ll be able to have multiple lifecycle policies get attached to your bucket.

Good luck!

{% gist https://gist.github.com/sheldonhull/ad168faccb06cd0387bcebfdf99da3d6 %} #tech #development #aws #powershell #devops
Quick and dirty ipmitool tutorial
Published: 2021-05-04 15:21:46

---
title: Quick and dirty ipmitool tutorial
published: true
date: 2021-01-19 00:00:00 UTC
tags: 
canonical_url: https://foursixnine.io/blog/2021/01/19/Quick-and-dirty-ipmitool-tutorial.html
---

# Because I always forget

## To reboot a SUPERMICRO server:

Just remember that the default user/password might still be ADMIN/ADMIN :)

ipmitool -I lanplus -H $HOST -U USER -P PASSWORD power cycle

## To connect to the serial console

ipmitool -I lanplus -H $HOST -U USER -P PASSWORD sol activate
Discord community for Open Source founders
Tags: opensource, contributorswanted, discuss, github
Published: 2021-01-18 23:23:55

Hey, Dev community!

A lot of open source developers are looking for contributors to help their projects grow & succeed. I know that because I was one of them, an owner of a repository with 5500+ stars on a Github, but that was a long path. I've met other open source developers with their young projects that are focused on solving your problems.

That's what our mission is - to help young projects receive feedback, find contributors & get mentorship. 

If you feel like you have something to share, or just want to become a part of our community to follow recent updates - welcome! Join us: https://discord.gg/nh33HqubJM

Now we have a growing community of 300+ open source founders & technical experts, would love to see you with us
If you've tried Linux and opted against using it, tell us why for the chance to be featured on our podcast!
Tags: discuss, podcast
Published: 2021-01-18 23:12:55

---
title: If you've tried Linux and opted against using it, tell us why for the chance to be featured on our podcast!
published: true
tags: discuss, podcast
---

The [DevDiscuss Podcast](https://dev.to/devdiscuss) is coming back for a new season soon! As you might recall, we like to feature the actual _voices_ from our community!

We'd love to know your responses to the following question for an episode we have in the works:

> ### **“If you've tried Linux and opted against using it, why is that?”** 
 
You can answer the question above by:

- Calling our Google Voice at +1 (929)500-1513 and leave a message 📞

- Sending a voice memo to pod@dev.to 🎙

- OR, leaving a comment here 🗣

Your answer might be included in the episode 😉 

_Please send in your thoughts by Wednesday, January 27th at Midnight, ET (9 PM PT, 5 AM UTC)_

---

**P.S. _Catch up on past episodes of DevDiscuss [here](https://dev.to/devdiscuss)_**
How would you structure an application like the Bible app "YouVersion" or an eReader?
Tags: database, javascript, books
Published: 2021-01-18 22:55:35

I have been pondering on my mind a lot lately about how to build a reader application. Specifically, how to build the data structure.

Have any of you built a reader app before, or bible application?

Do you know of open source projects that show how a database should be set up for this kind of project?

Are eReaders built on open source tech?
Test Slow or Failed Network Requests
Tags: webdev, testing
Published: 2021-01-18 22:49:39

When things work as expected, it’s a sigh of relief! What’s the experience going to look like if things aren’t working as expected? Being able to test scenarios like that can help you develop a better user experience. Let’s learn how to set up and test slow or failed network requests.

## Slow Network Request

It can be tough to replicate a slow network request, but thankfully there are Developer Tools that browsers provide to help with this. If you’re using Google Chrome, you can open the Developer Tools by right clicking anywhere on the page and choosing **Inspect**. Select the **Network** tab and change the **Throttling** option from Online to Slow 3G.

![Network Speed](https://dev-to-uploads.s3.amazonaws.com/i/0ebwiqm9oz6ns7jk0hxw.png)

Refresh the page and it will reload but much slower than before! This can be helpful when testing an [Angular Splash Screen](https://nightwolf.dev/angular-splash-screen/) for example.

## Failed Network Request

Purposely breaking an api request just to test is probably a bad idea. Again, Developer Tools to the rescue! If you’re using Google Chrome, you can open the Developer Tools by right clicking anywhere on the page and choosing **Inspect**. Select the **Network** tab.

There are various types of network requests. By default, your browser may be showing you All. You can narrow down which requests you’d like to see (Javascript, CSS, Images, etc). For example, if you’re only interested in ajax requests, select **XHR**.

![Network Requests](https://dev-to-uploads.s3.amazonaws.com/i/tqo1ol4nds9a4oqqukk3.png)

I’d like to test the code that displays a Reload button if there’s an issue with fetching the Pokemon Types in my [Pokemon](https://nightwolf.dev/pokemon/) application. The types are loaded when the application loads. So let’s refresh the application to make sure we see that specific network request.

To mimic a failed network request, we can block the request from actually working. Right click on the network request and select **Block Request URL**.

![Block Request URL](https://dev-to-uploads.s3.amazonaws.com/i/q4ht48k4xl9pq1d67qfe.png)

Now that the network request is blocked, refresh the application again.

![Blocked Network Request](https://dev-to-uploads.s3.amazonaws.com/i/j7ykc9l9ev50t037zwqk.png)

There should have been a select field displaying a list of Pokemon Types. Instead, the Reload Types button is appearing! The code for displaying that button works if the request fails! Now let’s make sure the button works if the request is eventually successful.

Right click on the blocked network request and select **Unblock**. Clicking on the button now displays the select field with the list of Pokemon Types!

Take advantage of these helpful Developer Tools options when developing your applications!

---
#### Visit our website at [https://nightwolf.dev](https://nightwolf.dev) and follow us on [Facebook](https://www.facebook.com/NightWolfDevelopment) and [Twitter](https://twitter.com/nightwolfdev)!
---
Wordpress POST Request
Tags: help, wordpress, javascript, question
Published: 2021-01-18 22:38:58

At the moment I'm using [Wordpress](https://wordpress.org/) as a Headless CMS with the frontend using [Nuxt.js](https://nuxtjs.org/). Most of the time I use Wordpress to **write** the data and Nuxt to **fetch** it into the client with the REST API of Wordpress (WP).

I'm currently working on a new blog. I made a *coming soon* page where users can subscribe to get notified when the blog is live. With the WP plugin `JSON Basic Authentication`, I succeed to make a POST request to the WP backend with Postman:
![Postman example](https://dev-to-uploads.s3.amazonaws.com/i/o8sb38iqmk5hjyiib488.PNG)

However by implenting and trying the POST Request into the Nuxt frontend, the browser gives the error `Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR`. See image below:
```js
submitSubscriber(email) {
        var clientId = "....";
        var clientSecret = "....";

        var authorizationBasic = window.btoa(clientId + ':' + clientSecret);

        var myHeaders = new Headers();
        myHeaders.append("Authorization", "Basic " + authorizationBasic);
        myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
        myHeaders.append("Cookie", "wordpress_test_cookie=WP+Cookie+check");

        var urlencoded = new URLSearchParams();
        urlencoded.append("fields[email]", "randomemail@hotmail.com");

        var requestOptions = {
          method: 'POST',
          headers: myHeaders,
          body: urlencoded,
          redirect: 'follow'
        };

        fetch("https://domainname.nl/wordpress/wp-json/wp/v2/subscribers", requestOptions)
          .then(response => response.text())
          .then(result => console.log(result))
          .catch(error => console.log('error', error));
}
```

I tried using different forms of the request (like with axios) and also changed the `.htaccess` file of the Worpdress site to allow all origins (just for testing), but even that didn't work:
```
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
```

Hopefully someone can help me and maybe explain where it goes wrong. Thanks in advance
Pair Programming Nedir ? Faydaları Nelerdir ?
Tags: pairprogramming, programming
Published: 2021-01-18 22:06:03

__Pair programming__ 2 yazılımcının bir proje veya problem üzerinde çalışmasıdır. İkili programlama da denilebilir.

__Agile__(çevik yazılım geliştirme) yöntemlerindendir.


2 yazılımcı bilgisayar başına oturur ikiside aynı anda yazamayacağı için biri Observer(gözlemci) diğeri ise Driver(sürücü) rollerine geçer.

__Sürücü__, projeyi geliştiren veya probleme çözüm arayan kişi.

__Gözlemci__ ise  problem çözümünü inceleyen,  feedback'ler veren ve sürücüyü yönlendiren kişidir.

# __Eşleşmeler__
Bu ikili çalışmada 3 farklı eşleşme olabilir

| | |
| ------------- |:-------------:|
| Uzman      | Uzman | 
| Acemi      | Uzman      |  
| Acemi | Acemi      |  


Bunları incelediğimizde :

__Uzman - Uzman__ : Çok iyi sonuçlar alınır. Kötü yanı ise, deneyim yüksek seviyede olduğu için, eğer ortada bir problem varsa çözümlere genelde deneyim ile ulaşırlar ve bu yeni fikirler açısından olumsuz bir durumdur.


__Acemi - Uzman__ : Bu ikili en fazla verim alınan modeldir. Uzman geliştiricinin acemiye akıl hocalığı yapması ve gelişimine destek vermesi açısından önemlidir. Acemi geliştiricinin öğrenmeye açık olması ve sorgulayıcılığı ile yeni fikirler ortaya çıkacaktır. Çırak usta ilişkisi ile aceminin gelişimi gözlemlenebilecektir.


__Acemi - Acemi__ : Bir acemi geliştiricinin akıl hocası yoksa eğer. Tek başına çalışmaktansa 2 aceminin beraber çalışması, farklı bakış açısından faydalı olur.




# __Pair Programming Faydaları__

* Disiplin artırır.
* Kodun kalitesi artar.
* Ortak kod sahipliği oluşur, birinin yazdığından diğerinin de haberi vardır ve bunun üzerine aynı bilgi ile tartışabilirler.
* Moral ve motivasyonu yüksek tutar. Bir işte iki kişinin çalışması kodu yazan kişiyi motive eder.


__Şirketler bunu kullanıyor mu?__

Şirketlerin çoğu pair programmingi uygulamıyor, bunu maaliyetli buluyor bir işe iki kişi verildiği için.

Ancak burada maaliyetten çok bir kazanç var, ortaya çıkan iş daha kaliteli ve ileriye dönük oluyor.

Ekip ve takım olarak çalışan start up veya kurumsal firmalar mutlaka bu konuya önem veriyor.


Pair Programming için yanyana olma zorunluluğu yoktur.
Driver roldeki kişi ekranını Gözlemci kişiye paylaşarak ta eşli programlama yapılabilir.

Yine pair programminge çok benzeyen diğer eşli programlama türü olan __Mob Programming__ (Çoklu programlama) ise ekipler tarafından kullanılır, burada 1 kişi sürücü ve ekibin geri kalanı gözlemci olur.
Best Admin solutions for Node.js apps.
Tags: admin, programming
Published: 2021-01-18 21:49:19

---
title: Best Admin solutions for Node.js apps.
published: true
description: Taking a look at the best third party admin solutions for your Node.js projects in 2021.
tags: admin, programming, 
cover_image: https://i.imgur.com/mE8hMP8.png
---

Have you ever wasted time on building a custom admin?

There are a lot of out the box solutions can speed things up for you. Some worth looking at are:

* Forest Admin
* Retool
* React Admin

Forest Admin will generate an admin for you in under 5 minutes. It's not great if you need a lot of customisation although it can be customised to what you need most of the time.

Retool is great too. You can write any database queries you need to grab data direct and display it in Retool components.

The last tool is React Admin. Here you actually write frontend code but many of the components and frontend logic has been written for you.

Special mention to Airtable which can be used with care in specific cases. Be careful not to duplicate a lot of information from your real database. If things get out of sync it can be annoying to know what's accurate. I'd recommend not duplicating any data.

Final note: any third part service will help you get going quickly. But if you need a lot of customisation it may be worth to build your admin from scratch. Note that most of these solutions are for internal use, and not for client facing admin views.

Lastly, if you do choose to use a third party admin tool you can always build custom tools alongside it. You're not stuck with any specific tool, and can even use many of them in conjunction. There's no reason Retool and Forest Admin can't run side by side and you use whichever is easier for you at that moment.

Want to learn more? Here's the full video:
{% youtube a4vXsrM67Rs %}

Link:
[https://youtu.be/a4vXsrM67Rs](https://youtu.be/a4vXsrM67Rs)
I wrote a free book on React.js and just made it available on GitHub
Tags: tutorial, javascript, webdev, beginners
Published: 2021-01-18 21:45:31

---
title: I wrote a free book on React.js and just made it available on GitHub
published: true
description: A free book on React, now available as a GitHub repo.
tags: tutorial, javascript, webdev, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/8bhvr7zjf5iugt72ddwo.jpg
---

TLDR; I just made my free React book available as a GH repo. You want to learn React and you're a beginner? Then this is a good place to start.

Hey friends..

As long as I can remember, I've always wanted to help people. I guess there's no surprise I now after 15 years in the biz is working in DevRel getting to do just that.  

## Free React book

- **Available on my blog**. So my free React book that you can read online is here 
   > https://softchris.github.io/books/react/

- **Now on GitHub**. But, I thought why not make it available on GitHub. 

   Some people might like to read it on GitHub. Or maybe read it offline, just fork it or git clone. Please help make it better and raise a PR if you see something.
 
   > https://github.com/softchris/react-book

So, whatever you do, I'd really appreciate if you spread the word and point people to GH, hope it helps you all.



## What does it contain 

pretty much anything you need to know to be a React dev:

- Basics, components, input/output, conditional rendering etc.
- Redux, store, actions, reducers, sagas
- Routing, params, lazy loading etc.
- Testing, Jest
- Advanced concepts such as Context API, Hooks and more

## Update

I'm supporting Docsify and would really welcome translations.
Next JS Starter Boilerplate with TypeScript and Tailwind CSS ⚡️
Tags: nextjs, tailwindcss, react, showdev
Published: 2021-01-18 21:34:18

---
title: Next JS Starter Boilerplate with TypeScript and Tailwind CSS ⚡️
published: true
description: Starter for Next.js, TypeScript and Tailwind CSS. Production-ready with SEO-friendly for quickly starting a new project in React.
tags: nextjs, tailwind, react, showdev
cover_image: https://creativedesignsguru.com/demo/Nextjs-Boilerplate/assets/images/nextjs-starter-banner.png
---

A starter and boilerplate for building modern application for React developer. You can use for building marketing website, landing pages, or dashboard. Built on top of NextJS 10+ and TypeScript styled with Tailwind 2.0.

You can find a [NextJS blog starter boilerplate demo](https://creativedesignsguru.com/demo/Nextjs-Boilerplate/)

If you are interested you can find the GitHub repo at this location: https://github.com/ixartz/Next-js-Boilerplate

Here is the features:

- 💅 Styled with Tailwind CSS

- ✏️ Linter with Eslint and Prettier

- 🎉 Type checking with Typescript

- ✅ Easy deploy on Netlify

- ⚙️ Bundler Analyzer

- 🤖 SEO friendly

- 🚀 Production-ready

{% github https://github.com/ixartz/Next-js-Boilerplate %}
What's Here for Ruby Array RDoc
Tags: ruby, documentation, array
Published: 2021-01-18 21:26:34

---
title: What's Here for Ruby Array RDoc
published: true
description: 
tags: ruby, documentation, array
---
I have put in a What's Here for Ruby Array doc.  It's merged, but not yet released.  You can view it here:  
https://docs.ruby-lang.org/en/master/Array.html#class-Array-label-What-27s+Here
Jan 18: DEV Daily Discovery
Tags: discuss, bestofdev
Published: 2021-01-18 21:26:22

Please make a comment to this thread with a DEV post that you think deserves to be read more broadly. If it's your own post that's fine.

It could be recent, or it could be classic.

And then read through the thread and ❤️ posts where you like. I'm hoping that the wisdom of the crowds can help unearth some great content every day.

Use the post's link liquid tag to display it fully, i.e.:

```liquid
{% link https://dev.to/devteam/for-empowering-community-2k6h %}
```

And feel free to add why you want to want to give it more love.

Don't worry about whether you've picked the best post, let the readers decide if it should rise to the top.