teleren/devto huggingface dataset:
Project Elpis #2: *annoying genji voice* I need healing
Published: 2020-07-17 00:17:25

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/20sh3lx8ve4nz48vj5nw.png)

--------------

Hi guys! My name is Kevin, and this is my first post on Project Elpis. 

My tasks for this week are still WIPs cuz I have some other time-sensitive projects to work on rn, but I thought I'd write this up anyway since I have enough stuff to talk about at this point. 

I've been tackling the inventory and item usage system, and despite it being the same topic as the update I made to the Enchanted Forest (another game I've been working on), using Godot makes it a lot different. Sure, it's simpler than using JS with JQuery, but I'm also less accustomed to GDScript and Godot in general. It brings a new perspective to things, and although I miss the freedom in making everything from scratch, I can also see how Godot makes development waaay faster. Plus, looking back they kinda had me at built-in-collisions and animation trees. 

As of the moment, I have inventory slots up and running, as well as picking up items and using it to modify player stats (potions and crystals). For now I'm just dunking everything in a dictionary, but as the project grows on I'll put a json-reading system in place. 

I'm still debating whether I should implement a drag-and-drop sortable inventory system or just go with an immutable one, but honestly I'm lazy and an unsortable inventory system isn't THAT horrible. Like, a) I'm not entirely confident that I can create a pleasant user experience for drag & drop sorting, and b), I could always add a quick auto-sort system and try to keep the number of items down, which would probably be better game design anyway. 

Also, we're still working out the storyline for the game, but once we make a decent amount of progress on that we'll make an intro post about the project. 

Until next time, and thanks for reading. Byeeeee~
-Kevin
Tutorial Ride-Alongs
Tags: swift, architecture, ios
Published: 2020-07-17 00:14:02

To release myself from Tutorial Hell, I am working Swift and Vapor tutorials to learn about full stack iOS. The sad thing is that the app tutorial I like is for an old version of server-side Swift. My entire goal is to do cutting-edge stuff so migrating the tutorial app's structure is a whole new kind of project for me. In order for this not to become tutorials-squared, I need to share what I am working on here. I motivate myself hoping to reach out to other people and find out what they're interested in.
⚛️ useClickAway, react hook that reacts to clicks outside the element
Published: 2020-07-17 00:03:34

React hook `useClickAway()` that reacts to clicks outside the bound element, and calls the expression that is passed in when this event is detected.

Suppose you're working on a Modal component that renders a dialog box, and you wish to close the modal if the user clicks away this is the ideal scenario for useClickAway custom hook.

Github link: https://github.com/geobde/use-click-away
Npm Link: https://www.npmjs.com/package/use-click-away
Learning SwiftUI with NetNewsWire
Tags: swift, swiftui
Published: 2020-07-20 16:42:55

---
title: Learning SwiftUI with NetNewsWire
published: true
date: 2020-07-17 00:00:00 UTC
tags: swift,swiftui
canonical_url: https://blog.rizwan.dev/blog/learning-swiftui-with-netnewswire
---

After the release of SwiftUI 2.0 on WWDC 2020, I got excited and want to learn more about it. What is better than learning a new tech by building a real-world app? Here it goes my learnings…

## NetNewsWire

I got the chance to learn SwiftUI from an open-source project called [NetNewsWire](https://github.com/Ranchero-Software/NetNewsWire). It’s an RSS reader app for iOS, iPadOS and macOS. Build with UIKit/AppKit.

> Shameless plug:- It’s a cool app, you should check it out

After the WWDC, contributors to the project had a zoom call and decided to hope on the SwiftUI train. It’s not new for the team. They have already burnt the hand by investing some time last year when the SwiftUI 1.0 was released. For [various reasons](https://inessential.com/2019/10/21/swiftui_is_still_the_future) the team had to stop and rollback everything done on SwiftUI. Since there are lots of improvements on 2.0, we have decided to try it to build the existing multi-platform app with the all-new SwiftUI multiplatform.

The whole team is ramping up with the latest cool beta things and I learnt a ton by implementing some small set of features on the Settings screen for iOS/iPadOS. One of my goals, when I started learning, is to share what I have learnt via blog posts. So I’m gonna kick start a set of blog posts which explains specific new features from SwiftUI 2.0.

The whole NetNewsWire community is great and I like to thank [Brent Simmons](https://twitter.com/brentsimmons) for creating this project and making it open-source, [Maurice Parker](https://twitter.com/vincode_io),[Stuart](https://twitter.com/stuarticus) for helping me and correct my direction whenever I lost in track, and all other [contributors](https://github.com/Ranchero-Software/NetNewsWire/graphs/contributors) and users. If you would like to join, please check out our [slack](https://ranchero.com/netnewswire/slack) group. Everybody is welcome and encouraged to join.
React State Management using React hooks and Redux
Tags: react, redux, hooks
Published: 2020-09-02 10:11:23

---
title: React State Management using React hooks and Redux
published: true
date: 2020-07-17 00:00:00 UTC
tags: React,Redux,Hooks
canonical_url: https://www.loginradius.com/engineering/blog/react-state-management/
---

React components has a built-in state object. The state is encapsulated data where you store assets that is persistent between component renderings. The state is just a fancy term for a JavaScript data structure.

   
[Read On](https://www.loginradius.com/engineering/blog/react-state-management/)
How to Remove Docker Images Based on Names
Tags: docker
Published: 2021-02-22 12:13:35

---
title: How to Remove Docker Images Based on Names
published: true
date: 2020-07-17 00:00:00 UTC
tags: docker
canonical_url: https://tech.serhatteker.com/post/2020-07/docker-remove-images-based-on-names/
---
We are going to use **Docker**'s `rmi` command.

[Docker rmi] command removes (and un-tags) one or more images from the host. If an image has multiple tags, using this command with the tag as a parameter only removes the tag. If the tag is the only one for the image, both the image and the tag are removed.

```bash
$ docker rmi $(docker images <your_docker_image_name>)
```

Example:

```bash
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             1.32.0              dc3bacd8b5ea        16 hours ago        1.23MB

$ docker rmi busybox
untagged: busybox:1.32.0
```

### Multiple Tags

If you have different `tags` for same image name;

```bash
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             1.32.0              dc3bacd8b5ea        16 hours ago        1.23MB
busybox             latest              dc3bacd8b5ea        16 hours ago        1.23MB
busybox             1.31                1c35c4412082        5 months ago        1.22MB
```

You should use it with `-q` flag:

```bash
$ docker rmi $(docker images -q <your_docker_image_name>)
```

The `-q` flag returns only the matching images IDs which can be fed to `docker rmi`.

### Error

If you encounter an error like below you have to use it with `-f` (force) flag:

```
Error response from daemon: conflict: unable to delete dc3bacd8b5ea (must be forced) - image is referenced in multiple repositories
```

```bash
$ docker rmi -f $(docker images -q <your_docker_image_name>)
```


All done!




[Docker rmi]: https://docs.docker.com/engine/reference/commandline/rmi/
New Job New Tools
Tags: career, watercooler, productivity, discuss
Published: 2020-07-17 13:44:02

---
title: New Job New Tools
published: true
date: 2020-07-17 00:00:00 UTC
tags: career,watercooler,productivity,discuss
canonical_url: https://coreydmccarty.dev/posts/2020_07_13_new_job/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/8gak5w8k4kt4xawv11l8.png
---

I recently started a new job, and it's only the second that I've had in my dev career. With a fresh look into how different it can be between companies, I thought that I'd share a few thoughts. I'd also love to hear yours in the comments.

## Old Busted

I started off as a full time employee of a vendor company providing onsite/offshore model software development and support for a large logistics company. As such I never had much say in the tools that were being used. The company decided against allowing anyone to have admin rights on their local machine, and their 'official' take on IDE availability was that "Eclipse is the corporate standard and we will not consider making any alternatives available." Which was fun. This was even more fun when the vendors lost their desktop licenses for Microsoft Office when we moved to 365. It was also especially cumbersome to work from home when the vendors could not access the code repository or the test servers via VPN. Instead, you had to connect to vpn, then log in to a virtual server (after many failed attempts), and use whatever software was installed there to do your work. Overall, it seems like there was more concern with being secure than being productive.

## New Hottness

I can't adequately communicate the glee that I experienced in my first week of work. I was given the option to have full license of IntelliJ IDEA or Eclipse. I got GitKraken, desktop applications for Office, local admin on my machine, the full Atlassian tool stack [Jira, BitBucket, Confluence, Bamboo] that auto-magically works together, and an account with Pluralsight matched with a standing calendar block to study every week.

While it has been a bit weird transitioning jobs during the pandemic, I have had the greatest experience with getting help with things. Everyone that I've asked for help is willing to stop and assist as needed. The work tasks are well defined, small units of effort with recommendations for solution. All that was necessary was to apply the change as recommended and then test. As I've needed access to an system I've been able to quickly request it and have it granted within 24 hours.

## Conclusion

It's amazing how much different life can be in a new position/place. If you are in a tough spot, keep at it. Build your experience as you look for work, and eventually you will find a place that works well for you. Currently I can't imagine a reason that I'd leave my current role.

<a href="https://undraw.co/illustrations">Cover image by undraw.co</a>
Go errors.is cool
Tags: go, errors
Published: 2020-07-16 23:51:35

In 1.13 go introduced a new function on the errors package. `Is`. This lets you ask if the error you are holding is the same as a predefined defined error or the error wraps the predefined error.

```golang
var BadThingErr = errors.New("omg something happened")

type canReturnErr = func() error

err := canReturnErr()
if errors.Is(err, BadThingErr) {
  fmt.Println("that bad thing that can happen happened")
}
```

Ive been using Is since it was released but there is a small detail of the the documentation that I originally missed.

> An error is considered to match a target if it is equal to that target or if it implements a method Is(error) bool such that Is(target) returns true.

```golang
type myCoolErr struct{
  errCode int
}

func (m myCoolErr) Is(err error) bool {
  me, ok := err.(myCoolErr)
  if !ok {
    return false
  }
  return me.errCode == m.errCode
}
```

This lets an error control the implementation of errors.Is when comparing equality of the error object. Neat!

## How does this work?
```golang
if x, ok := err.(interface{ Is(error) bool }); ok && x.Is(target) {
  return true
}
```
https://github.com/golang/go/blob/43c6ada84c6ef47e3b61646d2f2e7f6b7264929d/src/errors/wrap.go#L39-L60

In the source code of the errors package there is a cool trick. This is asking if the err object complies with an anonymous interface if it does then the go compiler allows you to call the method on the anonymous interface!

I have seen casts and casts to interfaces but never casts to an interface defined in the cast expression.

This pattern seems most useful if your target interface is a single method and only used in one place. The risk is too high for the anonymous interface definitions to diverge if its used in multiple source locations. At that point I'd recommend defining a proper `type Xxx interface`
How to add GitHub Profile README (new feature)
Tags: github, tutorial, webdev, git
Published: 2020-07-16 23:28:14

_This post was originally published at [codepulse.blog](https://codepulse.blog/how-to-add-github-profile-readme-new-feature/?utm_source=devto) on July 17, 2020._

GitHub released a new feature few days ago: GitHub profile readme! You can now add a readme file to be displayed on your GitHub profile page.

_See also [If you use Git and VS Code – Read This!](https://codepulse.blog/if-you-use-git-and-vs-code-read-this/)_

This is a great way to tell more about yourself or for example advertise your blog or YouTube channel. The readme file supports markdown so you can do same things that you can with normal readme files in GitHub.

I uploaded a video to my YouTube channel where I show you how to add a readme file to your own GitHub profile. On the video I also go through couple of very cool and creative ways to use the readme file to boost your GitHub profile. You can watch the video below or clicking [here](https://www.youtube.com/watch?v=9sxWizm4--w).

{% youtube 9sxWizm4--w %}

If you rather read, here is a short summary on how to add the readme file to your profile (I still strongly recommend checking out [the video](https://www.youtube.com/watch?v=9sxWizm4--w) and I would very much appreciate if you also subscribed to [my YouTube channel](https://www.youtube.com/channel/UC34UXFLKqdW3cpk5CBu2Siw), so you stay up to date on more videos I upload).

The way it works is you need to create a new repository and name it the same as your GitHub username is. So for example my GitHub username is tumetus, so I need to create a repository with name tumetus.

![GitHub profile readme is hinted when creating the repository.](https://dev-to-uploads.s3.amazonaws.com/i/m6erakn4bxko3yqo4jpm.png)

When you create the repository, you see a notification that you are creating a special repository and that the README.md file of that repository will be shown in your profile.

The repository, as you might guess, has to also have a README.md file (which is the file that will be shown in your profile page). You can initialise this when you are creating your repository.

![You can initialise the GitHub profile readme file when creating the repo.](https://dev-to-uploads.s3.amazonaws.com/i/m084sta3ebyrw1wjhj8m.png)

Once you have your repository created, go check you profile page and you can see that the readme file is displayed on top of your pinned repositories.

What does your GitHub profile readme file look like? Comment your GitHub profile below!
Finding the Nth Digit Of 'Pi'
Tags: python, pi, chudnovskyalgorithm, geeksforgeeks
Published: 2020-07-16 23:03:16

There are multiple ways by which we can calculate the <b>n<sup>th</sup> digit of pi</b> by using <b>[Arctan formula](https://en.wikipedia.org/wiki/John_Machin) and [Bailey–Borwein–Plouffe formula](https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula)</b>.
[Chudnovsky Algorithm](https://en.wikipedia.org/wiki/Chudnovsky_algorithm) is a fast way of calculating the digits of pi and is similar to the arctan's formula.This formula is derived from the Ramanujan’s π formulae.
Here's the Formula :-<br>
![Chudnovsky's formula](https://dev-to-uploads.s3.amazonaws.com/i/vac4uxtpk32j74793z8f.png)

Simplifying further by solving the Fractional Power: <br>

![Step 1](https://dev-to-uploads.s3.amazonaws.com/i/79rv9f867gsh088bereh.png)
![Step 2](https://dev-to-uploads.s3.amazonaws.com/i/y8iknpu3t9oj23df7yif.png)

Dividing the series further into two parts <b>a</b> and <b>b</b> we get: <br>
![a](https://dev-to-uploads.s3.amazonaws.com/i/mrbl3u9rbwkwz59vff46.png)
similarly, <br>

![b](https://dev-to-uploads.s3.amazonaws.com/i/rt5ddmtd0s3pseoukmxa.png)

we get, <br>
![final](https://dev-to-uploads.s3.amazonaws.com/i/4yw2t620br5gvbuf9jv8.png)

we can calculate the next <b>a</b> term from the previous one, and the <b>b</b> terms from the <b>a</b> terms for simplifying the calculations.
![FC](https://dev-to-uploads.s3.amazonaws.com/i/i6603w3cy6k00rve0rrp.png)

<h2><underline>Implementing the formula using Python</underline></h2>

```
import math

def sqrt(n,m):
    m1=10**16
    m2=float((n*m1)//m)/m1
    b=(int(m1*math.sqrt(m2))*m)//m1
    n_m=n*m
    while True:
        a=b
        b=(b+n_m//b)//2
        if b==a:
            break
    return b

def power(n):
    if n==0:
        return 1
    r=power(n//2)
    if n%2==0:
        return r*r
    return r*r*10

def pi():
     m = power(100000)
     c = (640320**3)//24
     n = 1
     Ak = m
     Asum = m
     Bsum = 0
     while Ak != 0 :
          Ak *= -(6*n-5)*(2*n-1)*(6*n-1)
          Ak //= n*n*n*c
          Asum += Ak
          Bsum += n * Ak
          n = n + 1
          result = (426880*sqrt(10005*m,m)*m)//(13591409*Asum+545140134*Bsum)
          return result

stringPi = str(pi())
n = int(input())
print(stringPi[n-1])
```

<i>This was the solution for [GeeksForGeeks](https://practice.geeksforgeeks.org/problems/nth-digit-of-pie/0) Problem.</i>
Using SUBSTR and INSTR functions in ORACLE PLSQL
Tags: substring, plsql, sql, instr
Published: 2020-07-16 23:00:42

For reporting purpose there might be multiple occasions where there will be requirement to select only part of a string before or after a specified delimiter is present. And most challenging part is to get the values as it requires some additional effort to find the part of the string itself.

Here is a simple example to fetch a number field in an address string.
Any value after (# should be fetched as line2 along with the character (# and any value before the (# is line 1.

**PLSQL query is as below:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6pqrxl3iunr8o1vwjmq4.png)

**OUTPUT:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t0vc6qyw503kgd85pkgu.png)

Now same example should work and column2 should be null if the matching string is not present in the input string.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kml2knkvq5c1kelgo1w1.png)


**OUTPUT:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mi4qy15qdfhbsqel6kio.png)

**QUERY:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ruap0pvza5607cs6cvwm.png)

**OUTPUT:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cl8y7m27m2p0uydw3sa3.png)

**QUERY:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nz46sfdz9eynowetbykv.png)


**OUTPUT:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/761eozolh8w6dt1xhqdi.png)

**CONCLUSION:**
You will be now able to get the string before and after a specific character using SUBSTR and INSTR functions in oracle.
Why we use Node Js in the Integration APP

Tags: node, javascript
Published: 2020-07-16 22:21:40

How to create a scalable code style in a JavaScript code base

The growing popularity of JavaScript has brought about several changes, including the surface of Web development, as it is radically different today. Nowadays, it's hard to imagine what we can do on the web, with JavaScript running on the server and in the browser, for several years, or encapsulated in sandbox environments like Flash and Java.

Before exploring Node.js, you can read about the benefits of using JavaScript via the stack, which unifies the language and data format (JSON), allowing you to optimally reuse developer resources. Since this is more of a JavaScript benefit than Node.js. specifically, we will not talk about it much here. However, it is an important advantage to incorporate Node into your stack.

We used it at  <a href="http://imoble.com.br/" target="_blank" title="Imoble">Imoble</a> and came up with the motivation to help millions of families find their ideal home, so using it was beneficial.

We use the PWA (Progressive Web App) as well. Which means that basically the front-end application that existed before was built on top.

I liked the idea and used more NODE JS than outside of Java Script was perfect. Hey what did you think? I am new more expert eheh 17 years old.
Why we use Node Js in the Integration APP
Tags: node
Published: 2020-07-16 22:16:19

How to create a scalable code style in a JavaScript code base

The growing popularity of JavaScript has brought about several changes, including the surface of Web development, as it is radically different today. Nowadays, it's hard to imagine what we can do on the web, with JavaScript running on the server and in the browser, for several years, or encapsulated in sandbox environments like Flash and Java.

Before exploring Node.js, you can read about the benefits of using JavaScript via the stack, which unifies the language and data format (JSON), allowing you to optimally reuse developer resources. Since this is more of a JavaScript benefit than Node.js. specifically, we will not talk about it much here. However, it is an important advantage to incorporate Node into your stack.

We used it at  <a href="http://imoble.com.br/" target="_blank" title="Imoble">Imoble</a> and came up with the motivation to help millions of families find their ideal home, so using it was beneficial.

We use the PWA (Progressive Web App) as well. Which means that basically the front-end application that existed before was built on top.

I liked the idea and used more NODE JS than outside of Java Script was perfect. Hey what did you think? I am new more expert eheh 17 years old.
Tips and tricks of installing Gentoo - Part 1
Published: 2020-07-16 22:05:00

Installing Gentoo is seriously, an extremely daunting task. It always helps to have something here or there, so you're more familiar with what you're doing. Thus begins this series of posts containing tips and tricks for installing Gentoo (plus a little something at the end)!

## **#1 - `amd64` DOES NOT mean it can't run on `x86`**
For those of you who know what a [CPU Architecture](https://en.wikipedia.org/wiki/Microarchitecture) is, there's a common misconception that `amd64` is only made for AMD-manufactured CPUs. This is a very common misconception, and tripped me up the first time I tried installing Gentoo! As it turns out, due to history (as always), the `amd64` architecture works on both Intel and AMD CPUs. Be careful out there!

## **#2 - Learn about `chroot`**
`chroot` is actually a very well used command in the installation process. I would recommend learning about `chroot`, because there are tons of errors based off of it and without understanding what you're doing you could ["brick"](https://en.wikipedia.org/wiki/Brick_(electronics)) your computer!

## **#3 - Keep the following link in handy when setting up WiFi**
WiFi has always been an absolutely horrible subject for any installation method that is manual - be it from Arch to Gentoo herself. Luckily, there is [this](https://www.toshalinfotech.com/Blogs/ID/69/SOLVED-wpa_supplicant-ioctl-SIOCSIWENCODEEXT-Invalid-argument) link that fixed my personal first problem when installing Gentoo (little did I know it would be one of many...). Some things might not make sense there but I would keep it in hand for when the time comes of you getting an error. This **won't** fix all your problems, though :).

## **BONUS**
If your computer is running EFI or you want to dual boot Gentoo with Windows, I suggest [this](https://wiki.gentoo.org/wiki/Sakaki%27s_EFI_Install_Guide) amazing series by Sakaki that goes through the **whole** process. It's also filled with great explanations! 

*Happy installs, Bobbbay*