teleren/devto huggingface dataset:
Day 25 of #100daysofcode: Head Still Down
Tags: 100daysofcode, react, python, beginners
Published: 2021-12-01 00:57:31

I have been very busy and the next few days will, unfortunately, be even busier. Since I am devoting almost all of my time to work which is extraneous to the challenge, I will try and keep up a dialogue instead! Today's topic is React.

## React
Bit of an update on my current stance on React. I am going to use React in the upcoming Study Aid app, so there will be more discussions on React!

I really like React. My current project has become a web of shaky attempts at state management, but I feel that I have a much, much greater understanding of state management now that I have spent so much time trying to fix mistakes. 

Because of all of this trouble with states, I have decided that I really want to look into using Redux! I have heard that Redux has a lot of overhead learning, but I think that it may be worth it. Being able to control state better seems key in creating more advanced web apps, so I will be looking into Redux in the coming days.

We have implemented React routing in the school project as well. I initially thought this would be a pain in the butt, but it turned out to work very well with Flask's routing. I am looking forward to exploring the Flask-React routing interactions further!

Yeah! So while I think I have a fair grasp on React, I know that I have only scratched the surface of its capabilities and I am looking forward to using it more in my coming project.

## Today
Stretched really thin right now.
* Bit more Leetcode practice
* A lot of work on school project

## Upcoming
* **Finals and final project sprints**: Not much time left!
* Learn more about Redux!
* Start the Study Aid app!
* Later in the challenge: AWS Deployment, AWS Certification, and Using Docker!?

### Resources
[JS Course - FreeCodeCamp](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/)
How to check if a specific value or an element is present in an array in JavaScript?
Tags: javascript
Published: 2021-12-01 00:00:00

---
  title: How to check if a specific value or an element is present in an array in JavaScript?
  published: true
  tags: JavaScript
  date: Wed Dec 01 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/check-if-specific-value-element-present-in-array-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-1cca1f58b060b0bf2149b19582cbd79c.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/check-if-specific-value-element-present-in-array-javascript)
  
To check if a specific value or an element is present in an array, you can use the `includes()` method on the array in JavaScript.

### TL;DR

```js
// a simple array of numbers
const nums = [100, 200, 300, 400];

// check if value "300" is present
// in the `nums` array
// using the includes() method
nums.includes(300); // true

// check if value "1000" is present
// in the `nums` array
// using the includes() method
nums.includes(1000); // false
```

For example, let's say we have an array called `nums` with values of `100`, `200`, `300` and, `400` like this,

```js
// a simple array of numbers
const nums = [100, 200, 300, 400];
```

Now to check if a value or an element `300` is present on the array, we can use the `includes()` method on the `nums` array:

- and pass the value we need to search within the array as an argument to the method, in our case, it is the value `300`.
- the method will return a `boolean` value `true` if present and `false` if it is not present in the array.

it can be done like this,

```js
// a simple array of numbers
const nums = [100, 200, 300, 400];

// check if value "300" is present
// in the `nums` array
// using the includes() method
nums.includes(300); // true
```

As you can see that the `includes()` method returned boolean value `true` indicating that the value is present in the array.

Let's also try to search for a number that is not present in the array, say `1000` like this,

```js
// a simple array of numbers
const nums = [100, 200, 300, 400];

// check if value "300" is present
// in the `nums` array
// using the includes() method
nums.includes(300); // true

// check if value "1000" is present
// in the `nums` array
// using the includes() method
nums.includes(1000); // false
```

As you can see from the above output that searching for the value `1000` returned a boolean value of `false` indicating it is not present in the `nums` array.

See the above code live in [JSBin](https://jsbin.com/peburizuxo/4/edit?js,console).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
XY Problems in User Stories
Tags: xyproblem, userstories, designthinking
Published: 2021-12-04 20:04:08

---
title: XY Problems in User Stories
published: true
date: 2021-12-01 00:00:00 UTC
tags: xyproblem,userstories,designthinking
canonical_url: https://jhall.io/archive/2021/12/01/xy-problems-in-user-stories/
---

If you spend any significant time on StackOverflow, you’ve probably heard people complain about [XY Problems](https://xyproblem.info/).

> How do I download the Internet?

Is probably an XY Problem. That is to say, it’s asking how to accomplish something that the asker imagines would solve their real problem, rather than focusing on their real problem.

Many XY Problems ask to do the impossible, as the above example. But many are far more subtle and harder to detect.

> What should I feed my horse so it goes faster?

Might be an example. How do we know if the horse’s diet is the right solution? Or indeed if even your horse going faster is the solution? You need to understand the problem to be solved first.

Henry Ford famously pointed out that the automobile answered a question many people didn’t even know to ask.

> If I had asked people what they wanted, they would have said faster horses.

Until we step back and ask about the larger goal (such as “how can we travel a longer distance in a reasonable timeframe?"), it’s not obvious that the question is posed as an XY Problem.

Many user stories are XY Problems in disguise. These are often even harder to detect, because a “properly” worded user story includes the goal. But often it’s a faux goal, or the change requested isn’t the optimal solution for the goal. This is where it’s important to be a critical thinker.

> As a daily commuter, I want a dietary suppliment for my horse that will allow him to gallop faster, so that I an get to work in less than 3 hours.

An astute critic will read the “so that I can …” phrase first, and imagine solutions that are not even mentioned, and challenge the PO (or whomever wrote the user story) about whether the requested change is the correct one.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
When are microservices appropriate?
Tags: discuss, distributedsystems, watercooler, codequality
Published: 2021-11-30 23:52:25

Lately, I've been tending to lean more towards employing a monolithic approach in system architecture. On paper, using micro-services seems like an ideal solution. The fact that you can decouple a project into smaller manageable bits is good. However, from experience and a couple of blog posts and videos I've watched, they do introduce a lot of complexities. Just to mention a few would be; giving database access to a microservice poses major security risks if not properly implemented, error handling, and especially if the said microservice is down would essentially make the system fail, connection error, read timeout, resource not found...you have to deal with many error scenarios.

I'm not completely against them, for example I believe a microservice should do one thing and do it really well. A good example would be sending sms notifications. This wouldn't really need to interact with any database. Just accept a list of phone numbers and send out the messages.

So my question is; when are my microservices appropriate and do we really need them as much as folks preach?
Python Dictionary
Published: 2021-11-30 23:51:41

A dictionary is a key-pair value. It resembles a list but rather than having an integer as a memory address, a dictionary makes use of a key to store access to a value.

For instance, you can have a dictionary using English words as the key and using the Spanish interpretation as the value.
The define a dictionary you can define it using curly braces`{}` or the `dict()` function.

## Checking the existence in a dictionary

To get the existence of a key in a dictionary, you can make use of the `in` operator.

```python
eng2sp = dict()
eng2sp['one'] = 'uno'

'two' in eng2sp # False

'one' in eng2sp # True

```

To check the existence in a value. You would covert get he values from the dict using the `.values()` method and convert the type to a list. for instance

```python
vals = list(eng2sp.values())
```

### Getting the number of char occurrence in a word with dictionary

```python
word = 'pineapple'

word_dict = dict()

for char in word:
	if char not in word_dict:
		word_dict[char] = 1
	else:
		word_dict[char] += 1
```

dictionary provides  a method called `.get()` that returns the value of a key in an object or a default value passed as an argument if not provides. Replacing it in the code above we can have a simple one code without a coditional.

```python
word = 'apple'

word_dict = dict()

for char in word:
	word_dict[char] = word_dict.get(char, 0) + 1
```

### Dictionary and reading the words occurrence in a file

```python
fname = input("Enter the file name: ")

try:
	fhand = open(fname)
except:
	print("An error occurred when openning the file")
	exit()

word_dict = dict()
for line in fhand:
	line = line.rstrip()
	words = line.split(" ")

	for word in words:
		word_dict[word] = word_dict.get(word, 0) += 1
```

The code above works file but it doesn't recognize punctuations and alphabets cases as the split use the arguments to divide the strings into a list. To solve this issues, we will need the convert the strings to lower case, remove all the puntuations and perform our dictionary operations.

To remove or delete part of the strings, we can make use of the `line.translate(.maketrans(fromstr, tostr, deletestr))`. The method replaces `fromstr` with `tostr` in the string and deletes the `deletestr`. We would get the list of punctuations from the `string` module. Rewriting the code:

```python
import string

fname = input("Enter the file name: ")

try:
	fhand = open(fname)
except:
	print("An error occurred when openning the file")
	exit()

word_dict = dict()
for line in fhand:
	line = line.rstrip()
	line = line.translate(maketrans("", "", string.punctuation))
	line = line.lower()
	words = line.split(" ")

	for word in words:
		word_dict[word] = word_dict.get(word, 0) += 1
```

### Reference
[Python 4 Everyone](https://www.py4e.com/lessons/dictionary)
What is Wazaterm?
Tags: linux, ubuntu, wazaterm, terminal
Published: 2021-11-30 23:42:17

> This article is the 1st day of the Advent Calendar 2021 of [Wazaterm](https://www.wazaterm.com), an online Linux terminal for hackers.

# What is Wazaterm?

I'm developing a web application called Wazaterm, which is a browser-based Linux Terminal application. Wazaterm is a web app that allows you to use a Linux Terminal as a web app from your browser. It seems to be part of the Online Linux Terminal genre that gets a lot of traffic from search keywords, but the best way to describe it is a combination of VPS + SSH + α.

In this year's Advent Calendar, I'd like to introduce how to use Wazaterm and Terminal software to make the best use of Wazaterm.

The following is a video demonstration. In addition to using the shell from the browser, you can also use it as a PWA as one independent application so that you can switch between applications with Command+Tab.

https://youtu.be/CU82KSZ4Ev4


Since it is used in a browser, it works from any platform (Windows, macOS, iPad, Chromebook) without installing an SSH client, and you can use an SSH client since an SSH port is available.

I use a Mac in my shared office, an iPad at home, and a Chromebox at the headquarter office to do my Rails, React, and React Native development on a single Wazaterm terminal. You can go to your workplace without anything and work in the same environment, or you can take your iPad and a keyboard on a trip and do light work. I also think that browsers will be (or are) included in devices like VR and AR in the future. I haven't tried it myself yet, but it is possible to use a single terminal for such new devices.

There is also a development style called Remote Development that is gaining attention. For example, VS Code Remote development allows you to set up an IDE process on the server-side and access it remotely for development. Many developers prefer emacs or Vim to IDEs (I am one of them). You can also use it as an IDE with Wazaterm+ssh+code server.

The M1 Mac is quiet with no fan running, but Wazaterm is remote and doesn't even use local CPU/memory. It is absolutely silent. It works fine even with low spec devices.

As you can see from the Price page, you can start with less than $2/month.

That's it for Wazaterm for now. Tomorrow, I'll explain the features of the service in more detail.
Copywriting Services - How to Get the Most Out of Your Marketing Efforts
Tags: copywritingservices
Published: 2021-11-30 23:37:51


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

Copywriting services are a great way to promote your business online. A good writer can create effective copy for many different platforms. Web pages, landing pages, email marketing campaigns, and press releases are just a few examples. They can also write e-commerce copy for your online store. And, of course, they can write technical writing for your website. A copywriter will not only know how to market your product, but they will also be able to write a compelling headline or subject line to help your potential customers decide whether to buy it or not.

**[Copywriting services](https://www.storyleague.com.au/copywriting-services-melbourne/)** should be your first choice if you want to get the most out of your marketing efforts. You should hire an expert in your field because they will be able to write for various target audiences and industries. But, before hiring a copywriting service, you should first understand their pricing structure. A single project quote may not help you budget, but a regular, repeatable contract will. In this case, it is better to invest in quality over quantity.

The cost of copywriting services varies, depending on the agency. Some agencies charge by the word or by the hour, while others provide up-front quotes for specific projects. It's important to understand the price range of different agencies before you hire one. Some will provide quotes based on your needs and your budget. And don't forget to ask about how long the project will take because a copywriter's time is worth their weight in gold.
Get your open source project featured on GitHub
Tags: contributorswanted, opensource, github, news
Published: 2021-11-30 23:28:48

Each month, GitHub publishes a [Release Radar](https://github.blog/?s=release+radar). Top community projects who have shipped major version releases during the previous month are featured on the blog post.

Now, this is your chance to submit your project to be featured. We've launched an open source repo where you can find information on the Release and submit your open source project to be considered.

## How to be featured on the Release Radar

If you are a maintainer or contributor of an open source project, or you come across an awesome open source project, submit it! Head over to the new [GitHub Release Radar repo](https://releaseradar.github.com) and [open an issue](https://github.com/github/release-radar/issues/new?assignees=MishManners&labels=&template=release-radar-request.yml&title=%5BRelease+Radar+Request%5D+%3Ctitle%3E). 

{% github github/release-radar %}

In the issue, fill out as much information as possible. The more information you include, the more likely we are to feature you. Side note, we're using [GitHub Issue forms](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms) to collect information. [You can create these forms too](https://dev.to/github/how-to-build-google-like-forms-with-github-3ig2).

We get a lot of submissions each month. So while we can't promise we can feature all projects, we would love to consider your project. There are other opportunities to be featured on GitHub videos, [social media posts](https://twitter.com/github/status/1465410387134849027), and more.

We also have a video released which goes out as part of the Release Radar each month. So there's lots of platforms for you to get eyes on your project :eyes:.

{% youtube 7d50L0kJncw %}

So if you're thinking about it, don't think. Just [submit](https://github.com/github/release-radar/issues/new?assignees=MishManners&labels=&template=release-radar-request.yml&title=%5BRelease+Radar+Request%5D+%3Ctitle%3E) :boom:

## What's a major version release?

The question we get asked the most, is "what's a major version". Each month we feature projects who shipped major version releases. Major version releases are usually x.0, ie. 1.0, 2.0 etc. But not everyone's major versions will follow this format.

We also get loads of submissions, so we'll often favour x.0 releases. However, if you have a x.x release with major (or big) changes we'll also consider it.

What's considered a "major" or "big" change is up to you. It's your open source project; whether you're a maintainer or contributor. If you think it's big, [submit it](https://github.com/github/release-radar/issues/new?assignees=MishManners&labels=&template=release-radar-request.yml&title=%5BRelease+Radar+Request%5D+%3Ctitle%3E).

For more answers regarding submissions and the Release Radar, please check out the [FAQs on the repo](https://github.com/github/release-radar/blob/main/faq.md).

:sparkles: Looking forward to seeing your submissions coming through :sparkles:
Beautiful Android Apps
Tags: android, list
Published: 2021-11-30 23:26:00

This is a list of Android apps I found over the years which have a pretty UI and good UX. I will update it whenever I find a new app that matches these criteria.

✨ = recently added
🪞 = supports _Material You_
🌐 = open-source

- [**Bundled Notes**](https://play.google.com/store/apps/details?id=com.xaviertobin.noted): Notes in folders + tags. Everything about this app is great. Also has a browser version.
- [**Overdrop**](https://play.google.com/store/apps/details?id=widget.dd.com.overdrop.free): It’s a weather app.
- [**Volume Styles**](https://play.google.com/store/apps/details?id=com.tombayley.volumepanel): Customize your volume sliders.
- [**Material Files**](https://play.google.com/store/apps/details?id=me.zhanghai.android.files): The best file manager out there, clean and yet feature-rich.
- [**Skit**](https://play.google.com/store/apps/details?id=com.pavelrekun.skit): Useful utilities for managing your installed apps.
- 🌐 [**Koler**](https://github.com/Chooloo/koler): Replacement for the default phone app.
- 🪞🌐 [**Metro**](https://github.com/MuntashirAkon/Metro): Material Design music player.
- ✨🪞🌐 [**ReadYou**](https://github.com/Ashinch/ReadYou): Feature-rich RSS reader.
- ✨🌐 [**JamRSS**](https://github.com/moritzruth/JamRSS): The RSS app I created before I knew of ReadYou. Very minimal.
- ✨🪞🌐 [**LibreTube**](https://github.com/Libre-tube/LibreTube): Alternative YouTube client. NewPipe but pretty.
- ✨🪞🌐 [**Auxio**](https://github.com/OxygenCobalt/Auxio): Simple music player.
November release update
Published: 2021-11-30 22:50:44

## [Lagoon-core](https://github.com/uselagoon/lagoon/releases)

In the last month, we released a series of updates to Lagoon [2.2.0](https://github.com/uselagoon/lagoon/releases/tag/v2.2.0) ([2.2.1](https://github.com/uselagoon/lagoon/releases/tag/v2.2.1), [2.2.2](https://github.com/uselagoon/lagoon/releases/tag/v2.2.2), [2.2.3](https://github.com/uselagoon/lagoon/releases/tag/v2.2.3) and [2.2.4](https://github.com/uselagoon/lagoon/releases/tag/v2.2.4)

These were all to address unforeseen issues with the new features introduced in 2.2.0 - namely Kubernetes Network Policy support, Rootless workloads and Ingress annotation linting.

See the full 2.2 [changelog](https://github.com/uselagoon/lagoon/compare/v2.1.0...v2.2.4)

## [Lagoon-cli](https://github.com/uselagoon/lagoon-cli/releases)
November saw the first release of lagoon-cli under the uselagoon namespace [0.12.0](https://github.com/uselagoon/lagoon-cli/releases/tag/v0.12.0) - complete with updated homebrew taps, docker images and M1-compatible binaries

See the full [changelog](https://github.com/uselagoon/lagoon-cli/compare/v0.11.6...v0.12.0) 

## [Lagoon-images](https://github.com/uselagoon/lagoon-images/releases)

November saw the first time we've used a patch release for the Lagoon images.  The [21.11.0](https://github.com/uselagoon/lagoon-images/releases/tag/21.11.0) release saw updates to a number of packages that had been held back in October.

We used the [21.11.1](https://github.com/uselagoon/lagoon-images/releases/tag/21.11.1) release to update the Alpine versions in use for all the images to address a couple of vulnerabilities

See the full [changelog](https://github.com/uselagoon/lagoon-images/compare/21.10.0...21.11.1)

## [Lagoon-sync](https://github.com/uselagoon/lagoon-sync/releases)

As Lagoon-sync is still in active development, there was a couple of small hotfix-releases in November.

## [Lagoon-examples](https://github.com/uselagoon/lagoon-examples)

There were the usual updates across the Lagoon examples, reflecting the Drupal core update cycles.

## What's up next month?

In December, we will be debuting a couple of new things:

- a reorganisation of our Lagoon example repositories (one repo per example, instead of the multi-branch Drupal example)
- The ability to publish and consume "experimental" images from Lagoon-images ahead of their general release
- A new documentation site, built using Github Pages
- A new Lagoon website - be still my beating heart!
Day 487 : Care Packages
Tags: hiphop, code, coding, lifelongdev
Published: 2021-11-30 22:42:25

_liner notes_:
- Professional : Had a pretty productive day. Pretty much got everything I wanted completed. Only had 1 meeting and made pretty good use of my time. Hopefully, the rest of the week is the same. haha.

- Personal : So, I found some items on my to buy if ever on sale list. So I purchased a bunch of stuff and had some cash back credit from the previous month's purchases so I saved quite a bit. Plus on one of the items, I get double credits. These items are part of some projects I want to launch in the new year, so I want to start working on them from now.

![A road curving to the left in Moorefield, WV, USA with a wooden barbwire fence on the right and trees with orange, brown and green leaves and mountains in the distance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h5y33cveukvqtm5p674o.jpg)

Going to play around with the packages I got in and see if I can do what I think I can do with it. Hopefully that goes well and I can move forward on my planned projects. Going to eat dinner, then open my care packages and maybe end the night watching "Cowboy Bebop". I may go through some tracks for the radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 63SO-CMTsok %}