teleren/devto huggingface dataset:
Best resources on software development!
Tags: programming, todayilearned, catalog, learning
Published: 2022-05-18 04:03:30

Recently I have been reading a lot about software development in general and I couldn't keep myself from sharing some of the good articles I read recently. I hope you will enjoy reading them as much as I did. You may not finish reading all of them in one sitting, but you can bookmark them and come back to them later. I encourage you to read them at least once.

I will keep adding interesting and insightful articles to this list as I find. Please share your favorite articles in the comments as well and I will add them up here!

https://www.artima.com/articles/james-gosling-on-java-may-2001
This is a very old interview taken by Bill Venners which you might find very enlightening. It's long with lots of details, so make sure you have enough time to read, or bookmark it to read it later.
The lines that stood out for me from this interview:
"It's almost a truism that you never actually find a perfect answer to a problem. You just find the answer that has the least problems." - James Gosling
"One of my favorite lines is that computers are driven by Moore's Law, which is an exponential process, and human beings are driven by Darwinism." - James Gosling

https://martinfowler.com/articles/injection.html
This is a great article which discusses in length about DI (dependency injection) and Inversion of Control. Two most important concepts a software developer MUST know.

https://www.joelonsoftware.com/2005/12/29/the-perils-of-javaschools-2/
Interesting read you will enjoy, trust me!

https://blog.hubspot.com/website/what-is-utf-8
I believe it’s very important for a developer to know basics about Unicode and different encoding techniques. This is a very easy to follow article on ubiquitous UTF-8.

https://martinfowler.com/articles/web-security-basics.html
This article is one of the best ones I read on web application security. First it talks about simple validation & encoding to avoid many injection attacks and then talks about securing data in transit (to avoid man-in-the-middle attack) through Secured HTTP.

https://www.freecodecamp.org/news/big-o-notation-why-it-matters-and-why-it-doesnt-1674cfa8a23c/
This is very useful article that goes over detailed explanation of Big O notation with the assumption that you have done some coding in the past and are good with basics of high-school mathematics. I don't recommend this for beginners though due to many formal terms.

https://use-the-index-luke.com/sql/dml/insert
This interesting article helped me recently to correct my views about database table indexes (as someone who doesn't work with database a lot, I thought it improves performance always). I wasn't sure that it does have a side effect on insert statements. So use DB indexes wisely and only if necessary.
Android — Things to consider when testing an application
Tags: android, kotlin, testing, application
Published: 2022-05-18 03:42:37

1. How to test your application effectively?
2. What is Android application testing?
3. How many testing types of android application?
4. How do you properly test an application?
5. Which are the risks to be avoided while testing?

In this blog post we are going to Wanna learn what are the things you should consider when testing an Android app?

Android application testing is a process of testing the user experience, functionality, usability, performance and consistency of the Android device applications.

The main goal of the above tests is to ensure that the apps are stable, functional and usable which are vital for any app to succeed.

To read full version of this article, visit [canopas blog](https://blog.canopas.com/android-things-to-consider-when-testing-an-application-5ad175448d5b).
how to implemnt try and except to read data from RFID using sllurp
Published: 2022-05-18 03:31:54

Hi,
I want to implement to try and except in the following code if the connection is True then only I am able to read RFIDF tag .and I am not able to understand how slllrp Libary make a connection between Reader and Tag

```
from sllurp import llrp
from twisted.internet import reactor
import logging
logging.getLogger().setLevel(logging.INFO)

def cb(tagReport):
    try:
        mylist = []
        tags = tagReport.msgdict['RO_ACCESS_REPORT']['TagReportData']
        if not len(tags)==0:
             mylist.append(tags)
        print(mylist[0][0]['EPC-96'])
    except:
         print('error')

factory = llrp.LLRPClientFactory(antennas=[1], duration=1,session=0,tx_power=0,start_inventory=True)

factory.addTagReportCallback(cb)
reactor.connectTCP('192.168.120.501', llrp.LLRP_PORT, factory)
reactor.run()
```


My code is working fine I can read the tag but I want to apply to try and except block and I do not understand how to do it in that code
whenever my reader is connected only that time I can read the tag otherwise it goes under except block which method do I use to check the current status of the connection object?
DynamoDB com Spring Cache
Published: 2022-05-18 03:30:30

```yml
version: '3.0'

services:

  localstack:
    image: localstack/localstack:latest
    environment: 
      - AWS_DEFAULT_REGION=ap-southeast-1
      - EDGE_PORT=4566
      - SERVICES=dynamodb
      - KINESIS_PROVIDER=kinesalite
    ports:
      - '4566:4566'
    volumes:
      - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
```

``msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi``

```
<!-- https://mvnrepository.com/artifact/com.dasburo/spring-cache-dynamodb -->
<dependency>
    <groupId>com.dasburo</groupId>
    <artifactId>spring-cache-dynamodb</artifactId>
    <version>0.9.3</version>
</dependency>
```
Getting Started With OSS
Tags: opensource, github, codenewbie, tutorial
Published: 2022-05-18 03:22:26


## Why Contribute?

Contributing to open source is a fantastic way to collaborate and build connections with other developers. It also helps a lot with imposter syndrome; it gives you great practice for your first developer job and allows you to tackle progressively more challenging tasks. In addition, a lot of open source companies look to their contributors when hiring for a position, so the connections you build through open source can be valuable to your career.  


## What Do I Work On?  


Look for low-hanging fruits in the issues, i.e. something easy enough to change and test.
If there aren't tons of issues, then take a stab at improving test coverage in the repo. 
I'd always recommend opening an issue before submitting a pull request so you get feedback on your proposed changes before going through the effort of implementing those changes.  

## What If I Get Stuck  


A really important part of being a developer is learning to navigate a code base. I enjoy using tools like [ripgrep](https://github.com/BurntSushi/ripgrep) and [Sourcegraph](https://sourcegraph.com/) for finding key words in either a local repo (ripgrep) or remote repo (Sourcegraph). Both support regular expressions, so you can get very specific with the sequences you're looking for. I definitely recommend getting comfortable with these tools and learning to backtrack to find solutions.  

Of course, with any new code base you'll get stuck and need help. Don't worry, most open source projects have communities associated with them that you can find easily on their Github or website. Joining their community and asking questions or asking questions as issues or discussions on the repo are great ways to get answers to your questions. Note that nobody is going to spoon-feed you, so make sure you've checked the docs for your language when applicable and that you've tried to answer your own question by searching through their code and documentation.  

If anything is unclear about how to run the program or get it set up for development, definitely ask!  

## What Do I Need to Know?  

- Git, more specifically:
    - [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) (follow the standard used in the repo you're contributing to)
    - [Merge vs Rebase](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)
    - [Squashing commits](https://www.cloudbees.com/blog/git-squash-how-to-condense-your-commit-history)
    - [Cherry picking*](https://www.atlassian.com/git/tutorials/cherry-pick)
    - Partial commits*
- How to create an issue
- How to create a pull request
- Writing user stories* (helpful for giving an issue more context in few words)  


Don't forget to check if they have a `contributing.md` file that specifies the format for issues, PRs, etc.
You can also look at previous PRs that have been merged to get an idea of what has been accepted in the past.  


\*nice to know, not need to know  

*Let me know in the comments if there's anything I missed!*
What's your current code editor/IDE setup?
Tags: programming, productivity, discuss, webdev
Published: 2022-05-18 03:22:15

Coding without a code editor or IDE is unimaginable ~~unless you use notepad~~. So, what's you current editor/IDE setup, you can share your editor/IDE, current theme, current font, some extensions you use and literally anything you want to share about your workflow. 

I'm gonna share my setup here 😀

- **Editor**: VS Code
- **Terminal**: Windows Terminal and Hyper with PowerShell 7
- **Theme**: Night Owl
- **Font**: Ubuntu Mono
- **Icon Theme**: Material Icon Theme
- **Some extensions I really like**: GitHub Copilot, WakaTime, ESLint and Choose a License.
Laravel 8 Google Pie Chart Example
Tags: laravel, google, piechart, javascript
Published: 2022-05-18 03:02:08

In this article, we will see laravel 8 google pie chart example. google charts use to visualize data on your website. here we will see a pie chart example in laravel 8.  A pie chart is a circular statistical graphic, which is divided into slices to illustrate numerical proportion.

So, let's see the dynamic google pie chart In laravel 8, how to use google pie chart in laravel 8, pie chart example in laravel 8.

```
Step 1 : Install Laravel 8

Step 2 : Create Migration

Step 3 : Add Route

Step 4 : Create Controller and Model

Step 5 : Create Blade File
```

---

> **_[Read More: Laravel 8 Google Pie Chart Example](https://techsolutionstuff.com/post/laravel-8-google-pie-chart-example)_**
Day 8,9/100 days of code complete. FRUSTRATING last day.
Tags: beginners, programming, discuss, 100daysofcode
Published: 2022-05-18 02:48:14

#100DaysOfCode #100daysofcodechallenge Day 8,9/100 (Monday 5/16/2022) complete. Practiced on C language building a pyramid like in Mario but using # in code. Very frustrating as I haven’t been able to figure it out but a fun challenge. Trying again tonight.
Code Smell 132 - Exception Try Too Broad
Tags: python, programming, cleancode, webdev
Published: 2022-05-18 02:47:11

*Exceptions are handy. But should be as narrow as possible*
 
> TL;DR: Be as specific as possible when handling errors.

# Problems 

- Fail fast principle violation

- Missing errors 

- False negatives

# Solutions

1. Narrow the exception handler as much as possible 

# Sample Code

## Wrong 

[Gist Url]: # (https://gist.github.com/mcsee/0ff3c46988812be98da1e256b54c00d1)
```python
import calendar, datetime
try: 
    birthYear= input('Birth year:')
    birthMonth= input('Birth month:')
    birthDay= input('Birth day:')
    #we don't expect the above to fail
    print(datetime.date(int(birthYear), int(birthMonth), int(birthDay)))
except ValueError as e:
    if str(e) == 'month must be in 1..12': 
        print('Month ' + str(birthMonth) + ' is out of range. The month must be a number in 1...12')
    elif str(e) == 'year {0} is out of range'.format(birthYear): 
        print('Year ' + str(birthMonth) + ' is out of range. The year must be a number in ' + str(datetime.MINYEAR) + '...' + str(datetime.MAXYEAR))
    elif str(e) == 'day is out of range for month': 
        print('Day ' + str(birthDay) + ' is out of range. The day must be a number in 1...' + str(calendar.monthrange(birthYear, birthMonth)))

```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/0d7e270416ebc934fbfbe8934175e52c)
```python
import calendar, datetime

birthYear= input('Birth year:')
birthMonth= input('Birth month:')
birthDay= input('Birth day:')
# try scope should be narrow
try: 
    print(datetime.date(int(birthYear), int(birthMonth), int(birthDay)))
except ValueError as e:
    if str(e) == 'month must be in 1..12': 
        print('Month ' + str(birthMonth) + ' is out of range. The month must be a number in 1...12')
    elif str(e) == 'year {0} is out of range'.format(birthYear): 
        print('Year ' + str(birthMonth) + ' is out of range. The year must be a number in ' + str(datetime.MINYEAR) + '...' + str(datetime.MAXYEAR))
    elif str(e) == 'day is out of range for month': 
        print('Day ' + str(birthDay) + ' is out of range. The day must be a number in 1...' + str(calendar.monthrange(birthYear, birthMonth)))
```

# Detection

[X] Manual

If we have a good enough test suite, we can perform mutation testing to narrow the exception scope as much as possible.

# Tags

- Exceptions

# Conclusion

We must make exceptions as surgical as possible.

# Relations

{% post https://dev.to/mcsee/code-smell-26-exceptions-polluting-pbn %}

# Credits

Photon from [Jakob Braun](https://unsplash.com/es/fotos/Js2Tv3-uLB8) on Unsplash

* * *

> The primary duty of an exception handler is to get the error out of the lap of the programmer and into the surprised face of the user.

_Verity Stob_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Day 563 : Far Beyond
Tags: hiphop, code, coding, lifelongdev
Published: 2022-05-18 02:24:12

_liner notes_:
- Professional : Pretty much spent the day reworking some code on a project to add new feature and record a video about the updates. Had a couple of meetings. Pretty productive day.

- Personal : Don't really remember what I did last night. I do know I watched a couple of "Atlanta" episodes. The final season is really good. Far beyond any expectations I had. I'm almost caught up and I think the final show is coming up.

![Green hills extending as far as the eye can see in Yining, China](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6xuo2qbd09k8zi1ilzui.jpg)

Worked a little later than normal finishing up recording the video for a presentation tomorrow. Of course, my work laptop decides to get super slow when I really need it to do something. My plan is to look at some design ideas I had for an upcoming personal project. Definitely want to get in at least one episode of Atlanta.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube ujTnX_R3uEI %}
Give me your git command
Tags: discuss, git, webdev, help
Published: 2022-05-18 02:08:32

If you don't know [git](https://git-scm.com/), why you are here mate? So if you do know git and you use it almost every day so sometimes you google the git command that you don't use often. So here I am just asking for a `git` command that you use often with a single-line title, summary, and your GitHub username. So, comment down the `git` command. I want it just because I am making a [gist](https://gist.github.com/j471n/6d2e74468615675eabc1e88540bacfe2) that will contain useful commands so that people don't need to google it again and again.


### Current Gist
{% gist https://gist.github.com/j471n/6d2e74468615675eabc1e88540bacfe2 %}

### Requirements
- Git Command
- Title
- Summary (what it does)
- Github Username
Heroku Error H10
Tags: help, node, react
Published: 2022-05-18 01:34:39

I want to push and commit my MERN stack application. The deployment in the terminal goes well but when I launch the app via the [Heroku URL](https://qode-so.herokuapp.com/) the app does not load properly. Google Developer Tools console does not help, so i used 

```
heroku logs --tail
```
 and found two errors, shown below! 

```
2022-05-18T01:21:18.212028+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=qode-so.herokuapp.com request_id=ad010e60-74da-411c-b25f-794a9cc31df7 fwd="98.52.109.235" dyno= connect= service= status=503 bytes= protocol=https
2022-05-18T01:21:20.923308+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=qode-so.herokuapp.com request_id=2e87a149-2982-4582-8e42-6fdf136cef7c fwd="98.52.109.235" dyno= connect= service= status=503 bytes= protocol=https
```
 I tried adding a Heroku Procfile but it just threw another with a different error code so i just removed it to prevent the struggle of figuring out another error, I checked my server.js and everything looks fine. Here is the `server.js` code. 

```
const express = require('express');
const connectDB = require('./config/db');
const path = require('path');

const app = express();
app.use(express.json());
connectDB();

// route
app.use('/api/users', require('./routes/api/users'));
app.use('/api/auth', require('./routes/api/auth'));
app.use('/api/profile', require('./routes/api/profile'));
app.use('/api/posts', require('./routes/api/posts'));
app.use('/api/tags', require('./routes/api/tags'));
app.use('/api/notify', require('./routes/api/notifications'));

if (process.env.NODE_ENV === 'production') {
  app.use(express.static('client/build'));
  app.get('*', (req, res) => {
    res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html'));
  });
}

const PORT = process.env.PORT || 5000;

app.listen(PORT, () => console.log(`Server started on port ${PORT}`));

```
Has anyone encountered this before and could help? I tried to use the solutions already listed at [**H10-App Crashed Error And How To Solve Them**](https://dev.to/lawrence_eagles/causes-of-heroku-h10-app-crashed-error-and-how-to-solve-them-3jnl).
How to easily make a type from a function's parameters in TypeScript?
Tags: typescript
Published: 2022-05-18 00:00:00

---
  title: How to easily make a type from a function's parameters in TypeScript?
  published: true
  tags: TypeScript
  date: Wed May 18 2022 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/easily-make-type-from-function-parameters-typescript
  cover_image: https://melvingeorge.me/_next/static/images/main-80ab1e5a157733f3bca4103fa88cdefd.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/easily-make-type-from-function-parameters-typescript)
  
To easily make a type from the function's parameters in TypeScript, you can use the `Parameters` utility type and pass the function type declaration which you need to get the parameter types from as the first type argument.

### TL;DR

```ts
// a simple function
function sayGreeting(name: string, greeting: string) {
  return `${greeting}, ${name}`;
}

// make type from function's parameters
// using the `Parameters` utility type
type OnlyFunctionParameters = Parameters<typeof sayGreeting>; // [name: string, greeting: string]
```

Let's say we have a function called `sayGreeting` that accepts 2 parameters called `name` and greeting both having the type of `string` like this,

```ts
// a simple function
function sayGreeting(name: string, greeting: string) {
  return `${greeting}, ${name}`;
}
```

Now to get the type of parameters in the `sayGreeting` function, we can use the `Parameters` utility type and then pass the type of the `sayGreeting` function.

Now you might ask how can we get the type of a function, for that we can use a nifty operator called `typeof` followed by writing the name of the function. This will automatically infer the function entire type including parameters and the return type. We can then pass this as the first type argument to the `Parameters` utility type.

It can be done like this,

```ts
// a simple function
function sayGreeting(name: string, greeting: string) {
  return `${greeting}, ${name}`;
}

// make type from function's parameters
// using the `Parameters` utility type
type OnlyFunctionParameters = Parameters<typeof sayGreeting>; // [name: string, greeting: string]
```

Now if you hover over the `OnlyFunctionParameters` you can see an `array of types`. You can use this as a type for variables that are of array type in TypeScript.

We have successfully made a type from the function parameters in TypeScript. Yay 🥳!

See the above code live in [codesandbox](https://codesandbox.io/s/easily-make-type-from-function-parameters-typescript-4jm47w?file=/src/index.ts).

That's all 😃!

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

---
Very easy customizing console.log with CSS
Tags: javascript, webdev, beginners, tutorial
Published: 2022-05-17 23:57:40

welcome and today we going customizing our console.log with css, and YES IS POSSIBLE!

I don't know about you, but I love use console.log for debugging my codes, is very fast for me, and its not a problem, most peoples coming with the talk, "whos use console.log for debugging code, never going be a senior developer". But surprise I'm a senior and use console.log.

But this talk is for a another day.

Today let's customizing our console.log, and its very easy, you just place before your text in console a %c and done.

Now you create and customizing your console with this mode.


![code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0g27xc04p6am0z0s9i1v.png)


.
.
.
.
.
From post in PT-BR
Instagram: @imatheus.max
Post: https://www.instagram.com/p/Cdq4JFiMcnt/
Day 39: Hello Redux 3
Tags: todayilearned, beginners
Published: 2022-05-17 23:52:10

Hi!
This should be a third article about Redux now, last time I found a great book about Redux that explained Redux concepts very easily but in my project I tried to setup redux and I had forgot everything I learned :) about it so I had to go back and take a recap. The content seemed familiar and boring but the actual code was not understandable and I could afford going back to reading everything from the beginning. so I come up with a great plan of Writing a blog about it and that's what I did and I expect it to be ready by tomorrow. surprisingly after starting to prepare the blog I could understand the code again which is great.
Tomorrow I plan to Finish about the article and start a new one about Redux with Redux toolkit and complete the last chore on my personal project and get started with the designs implementation 

signing off...