teleren/devto huggingface dataset:
Dev Interrupted's Best Programmer Humor
Tags: programming, management, webdev, devops
Published: 2023-03-26 23:12:34

Fact: The developer community is one of the most irreverent, clever, and funny professional communities in the world. From memes to easter eggs to inside jokes, programmers are better at turning ones and zeroes into LOLs than anyone else.

That's why we asked one of the programming community's best comic creators - Ahmad El-Baher (aka Sea The Full Moon) - to add some levity to four areas near and dear to our hearts. We hope you enjoy these as much as we did. Also, feel free to save and share on any platforms you'd like!

Be sure to check out more of Ahmad's work on [Twitter](https://mobile.twitter.com/SeaTheFullMoon1)!

## On pull requests:

![The Pull Request Paradox](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z11qnccyhriiqoq64les.png)

## On interruptions:

![A Productive Day of Programming](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4axbske1abgw9oopa32.png)

## On startup "About Us" pages:

![How Tech Companies Make "About Us" pages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g26ky4xmapu5qm46mio7.png)

##On the intent-perception gap:

![Intent Perception Gap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oojzxoa22kh1r4yzw8m1.png)

### Want to cut code-review time by up to 40%? Add estimated review time to pull requests automatically!
*gitStream is the free dev tool from LinearB that eliminates the No. 1 bottleneck in your team’s workflow: pull requests and code reviews. After reviewing the work of 2,000 dev teams, LinearB’s engineers and data scientists found that pickup times and code review were lasting 4 to 5 days longer than they should be.* 

*The good news is that they found these delays could be eliminated largely by adding estimated review time to pull requests!*

### Learn more about how gitStream is making coding better [HERE](https://linearb.io/blog/why-estimated-review-time-improves-pull-requests-and-reduces-cycle-time/?utm_source=Substack%2FMedium%2FDev.to&utm_medium=referral&utm_campaign=gitStream%20-%20Referral%20-%20Distribution%20Footers).

![Start using gitstream today!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xg1l6hxt134px501bf7d.png)
Programming roadblocks
Tags: beginners, opensource, programming, motivation
Published: 2023-03-26 23:08:43

Roadblocks are part of the journey toward finding your footing in the programming industry. It's on us how we maneuver our way around these obstacles to get to where we want in our careers. 

In this blog post, I will review five major roadblocks new programmers will likely experience.

### 1. Not knowing where to start
Not knowing where to start can be frustrating for all of us, especially when employing a technology stack we are unfamiliar with or uncomfortable with. To overcome this challenge, begin with what you know and gradually expand your understanding. 

### 2. Focusing on the problem rather than the solution
We often make the problem tenfold worse by focusing on the problem rather than the solution. For instance, while skiing, if we focus only on the trees rather than the path we should follow, we will only see trees.
Invest your energy in the desired outcome rather than the problem. A Solution-Focused approach to solving problems can help you get results faster.

### 3. Being afraid of asking for help
Sometimes the bravest thing we could do is ask for help. Of course, we should first try to figure out the problem independently, but if we have to meet specific deadlines and are still stuck, we should feel good about asking for help from community members. 

### 4. Comparing yourself to others
We should never compare ourselves to others, no matter what. It does more harm than good to one's self-esteem. We should always remind ourselves that everyone starts the same journey, with the same struggles we currently face, to get where they are today.

### 5. Giving up
The thought of giving up should cease to exist in our minds because it's okay to struggle and be bad at something to get better at it. Replace such thoughts with positive affirmations to keep you going. One must Keep failing until one succeeds, without quitting. Remember, making something extraordinary requires struggle, patience, and dedication. 

---

If this post was helpful, drop a like. If I missed an important point, leave it in a comment, as it would help me and others get better at programming one day at a time. :)
Unleash Your Productivity: Practical Tips to Boost Your Workflow
Tags: productivity
Published: 2023-03-26 23:01:56

Productivity is the foundation of success, and yet, it's something that many of us struggle with. Whether you're a developer, designer, or marketer, maximizing your productivity is essential to achieving your goals. In this post, I'll share some practical tips that have helped me unleash my productivity and improve my workflow.

Prioritize Your Tasks: Start by prioritizing your tasks based on urgency and importance. Use tools like Trello or Asana to keep track of your to-do list and create a sense of order.

Block Distractions: Distractions can seriously derail your productivity. Use tools like Freedom or Cold Turkey to block social media, messaging apps, and other distracting websites.

Take Breaks: Taking breaks is essential for maintaining focus and productivity. Use the Pomodoro technique to work for 25 minutes, take a 5-minute break, and repeat.

Optimize Your Environment: Your environment plays a significant role in your productivity. Make sure your workspace is clean, well-lit, and comfortable.

Learn Keyboard Shortcuts: Learning keyboard shortcuts can save you time and make you more efficient. Use tools like CheatSheet or KeyCue to learn and master shortcuts.

Minimize Meetings: Meetings can be a significant time sink. Make sure meetings are necessary and productive by having an agenda and clear objectives.

Practice Time Management: Time management is the key to productivity. Use tools like RescueTime or Toggl to track your time and identify areas for improvement.

In conclusion, productivity is something that can be learned and improved over time. By following these practical tips, you can unleash your productivity and boost your workflow. Remember, productivity is not about working harder; it's about working smarter.
W11 HW
Published: 2023-03-26 22:48:59

We made a lot of progress this week on our badge-list! This week, Anish created the badges with the working functionality of expand on click (vertical) to show contents inside, added images to the badges, created the search bar on the front end, and is working on getting the CSS of the design to match. Spenser created a method to render cards in the backend (using his project 1 card while Anish builds the badges), made them top to bottom instead of side to side to match the badge-list example, and started researching search functionality to connect it to the render results. However, while a lot of progress was made this week, we did not yet get the relationship between searching and rendering results working.

We made a diagram to showcase the user interaction pattern, which can be found [here](https://drive.google.com/file/d/1KpB1aTdBSDWYhdIic1ddYJtfVVBpomSS/view).

In a real world use-case from industry, micro-service architecture could fit into their business context through something like an e-commerce website that does digital art services like products and custom designs as well as digital assets. In this case, users could use AI image generators to write prompts that can generate images for reference and the models can take the prompt and run the data then produce an output that is fetched by the front end. As design is a preference based field, it helps to have variations of a design request so that the artist can have a better sense of direction about what the customer wants. 

Spenser's Progress can be found [here](https://github.com/M18ab/amazon-badges) and [here](https://github.com/M18ab/project-2-DEPRECATED). He had to create a brand new repo to fix an error when initializing the OWC.
Anish's Progress can be found [here](https://codepen.io/Anish-cod/pen/rNZqzYE)
A Long Road Ahead Of Me
Tags: firstpost
Published: 2023-03-26 22:46:43

```
Heyos Everyone
```

My name is Jose Ramirez and as of writing my first dev post, I am 19 years old, I am a college student at Ivy Tech Community College, and I am eager to learn more and more every single day. I have never posted a blog in my life and actually never opened up about my passion for technology to anyone outside of my family and friends! This is something that while it is very nerve-wracking, it's still amazing the amounts of people I will come to meet as I progress through my career.

Thank you for reading my first post,
I'm looking forward to meeting new people!
How to make an XML element optional in a Cobol provider webservice (DFHLS2WS), based on a Cobol structure
Tags: cobol, webservice, dfhls2ws
Published: 2023-03-26 22:39:19

To make an XML element optional in a Cobol provider webservice (DFHLS2WS), based on a Cobol structure (not from an XSD), you can modify the Cobol structure to include the OCCURS DEPENDING ON clause.

Suppose you have a Cobol structure that looks like this:

```
01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB PIC X(20).
```
And you want to make "ElementB" optional in the resulting XML structure. Then you can modify the COBOL structure by moving "ElementB" to a separate level that can be made optional, for example:

```
01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB PIC X(20) OCCURS 0 TO 1 DEPENDING ON ElementB-Present.
   05 ElementB-Present PIC 9(1) VALUE 1.
```
This way, "ElementB" is optional in the resulting XML structure, and its presence or absence depends on the value of "ElementB-Present". If "ElementB-Present" has the value "1", then "ElementB" is included in the XML structure; when "0", it is not included.

You can then use the modified Cobol structure to define and generate the webservice using the DFHLS2WS utility. Use the Cobol structure as input for the utility to generate the appropriate XML structure.
Jest 'spyOn' and typeScript
Tags: testing, javascript, beginners
Published: 2023-03-26 22:37:07

If you been coding with typescript and want to use 'spyOn' on your test you would have to type it like this.

```js
let functionSpy: jest.SpyInstance;
```
 This way we are telling the that it will be a spy instance and we will not have a ts problem.

Now, we are going to see how to actually use it which is really simple.

functionTest.tsx
```js
const FunctionTest = () => {
  const bar = () => {
  return 'test'
}
 return(
  <div></div>
)
}

export default FunctionTest
```

functionTest.test.tsx
```js
functionSpy = jest.spyOn(FunctionTest, 'bar');
```

Here we can see that following this simple step we are able to spy on the function in order to call it

Hope someone found it useFul.

Lautaro.
Show: Responsive Image Generator - multiple WEBPs and responsive HTML from a single image
Tags: frontend, showdev, webassembly, javascript
Published: 2023-03-26 22:33:49

Hello! Today I made public a little tool I've been working on that makes it easy to add a responsive image to your website. 

It uses Imagemagick via Web Assembly to generate multiple resized & converted-to-WEBP images from a single image you upload.

The styling might leave a fair bit to be desired, but I wanted to get this into the world as soon as it worked. I hope someone finds it useful!

https://johnfraney.ca/tools/responsive-image-generator/
How to create a flexible number of xml-elements in a cobol provider webservice (DFHLS2WS), starting from a cobol-structure.
Tags: cobol, webservice, dfhls2ws
Published: 2023-03-26 22:33:06

If you have a COBOL structure that corresponds to the XML elements of your provider webservice and you want to create an element that can occur from 1 to 1000 times, you can modify the COBOL structure to include a repeating group. This can be done using the "OCCURS" clause in COBOL.

Suppose you have a COBOL structure that looks like this:

```cobol
01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB PIC 9(5).
```
And you want "ElementB" to be able to repeat 1 to 1000 times in the resulting XML structure. Then you can modify the COBOL structure by moving "ElementB" to a repeating group with the 'OCCURS x TO y TIMES' clause, for example:

```cobol
01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB OCCURS 1 TO 1000 TIMES
      PIC 9(5).
```
This way, you can repeat "ElementB" 1 to 1000 times in the resulting XML structure, depending on how many times it occurs in the input.

Then, you can use the modified COBOL structure to define and generate the webservice using the DFHLS2WS utility. You can use the modified COBOL structure as input for the utility to generate the appropriate XML structure.
[GDB] Debugging session PostgreSQL & AGE
Tags: postgres, sql, age, opensource
Published: 2023-03-26 22:14:26

**Prerequisite**
- Having a running instance of Postgresql server and (having it surely installed beside of AGE and debug flag is enabled)

**The following commands are used for loading AGE**

```SQL
CREATE EXTENSION age;
LOAD ‘age’;
SET search_path = ag_catalog, "$user", public;
```



STEPS
- Open a **psql** session on a terminal
```bash
# create a test db if not having one
/usr/local/pgsql/bin/createdb test
# open psql
/usr/local/pgsql/bin/psql test
```
- Open a new tab for having gdb there 
```
sudo gdb
```
- Get the backend process's pid 
```SQL
SELECT pg_backend_pid();
```
- assume output is **666**
- Attach gdb to that process id 
```bash
(gdb) attach 666
```

- Create break line at some where
```bash
(gdb) break src/backend/tcop/postgres.c:4483
```
- Execute a query at the backend session
```SQL
select * from t where id > 1 and id < 10;
```
- Trace at the GDB (press n)

**Quick guide to GDB**
- To attach to a process: sudo gdb -p <PID>
- Attach breakpoint: break <file>:<line no>
- Run until breakpoint: c
- Single step into the function: s
- Step over the function: n
- Print a value: p <variable> or p *<variable>
- Call a function: call <func>
- Print postgres node: call pprint(<mem address>)
- Pressing enter key repeats last command.
- Include directory (source code): dir


References & Resources

- https://github.com/apache/age
- https://age.apache.org/
- https://blog.devgenius.io/stepping-through-postgresql-f40990685a56
- https://www.highgo.ca/2019/10/03/trace-query-processing-internals-with-debugger/
Week 11 check in
Published: 2023-03-26 22:02:56

Github repo: https://github.com/jackvanzandt/project-two
Partner: Carter Webster

We started by dividing the main work between getting the search functionality and the creation of the button asset we will be using. We have a basic search function and button asset completed so far, but adjustments need to be made still.

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

Most of the issues have been styling issues as seen with the button asset not translating over exactly from creation on Codepen. Also, creating a container that will store all the buttons and keep them all stylized correctly.

The creation of the button asset as translated over from making the card from project 1 as well as the work flow and structure of Open-WC projects.

Our next priority is to start implementing a rough form of our api and fix the already present styling issues with our project.

The problem we’re still unsure about is exactly how we’re going to implement the api functionally, but we have a basic understanding of what needs done. More or less the specifics of the functionality.
Effective Strategies for Stress Reduction in Software Development: 5 Methods to Improve Productivity and Well-being
Tags: webdev, programming, beginners
Published: 2023-03-26 21:56:41

Due to the fast-paced nature of your work and the need to achieve strict deadlines, you are likely to suffer stress as a software developer. Burnout can result from sustained stress, which can ultimately harm your productivity and well-being. Taking proactive measures to reduce stress is crucial if you want to stay motivated and productive. As a software engineer, try these five strategies to lessen stress:
**1.Taking Breaks Often**
Regular breaks are necessary throughout the day to prevent burnout and lower stress. Taking breaks can revitalize your energy and help you clear your mind. Every hour, take a short break to stretch, go for a walk, or just look away from your computer screen.
**2.Make use of mindfulness meditation.**
Powerful tools like meditation can help people unwind and manage stress. By concentrating on the present moment during mindfulness meditation, you can lessen stress and worry. Spend a few minutes each day focusing on your breathing and being mindful.
**3.Regular exercise.**
Exercise on a regular basis helps lower stress and enhance general health. Exercise causes the release of endorphins, which can make you feel more at ease and uplifted. Pick a physical activity you want to do, like weightlifting, yoga, or jogging, and make it a regular part of your day.
**4.Create deadlines and realistic goals.**
You may manage stress and prevent burnout by setting reasonable deadlines and goals. Unrealistic expectations make it more probable that you'll experience tension and overload. Set reasonable and attainable deadlines and break up larger activities into smaller, more manageable ones.
**5.Outside of working hours, do well to disconnect from work.**
Many software developers work longer hours than they should, which can cause stress and burnout. Setting limits and avoiding work-related activities after hours are crucial. While you're not working, turn off your phone's notifications, avoid reading your email, and give yourself a break by prioritizing sleep and leisure.
Incorporate these practices into your daily routine and prioritize your mental and physical health.
How to prevent data loss when a Postgres container is killed or shut down.
Tags: docker, pods, kubernetes, devops
Published: 2023-03-26 21:27:20

I do not like to make my blog contents so long when I can easily go straight to the point.

The simple answer to this problem is simply `docker volume`

## Why Docker Volume

The main concept behind using Docker volumes for backups is to create a copy of the data outside the container. Each time the container is restarted, the data is copied from the local system into the Docker container file system. This ensures that the data is always up-to-date and consistent with the latest changes.

## How To Create Docker Volume for PostgreSQL

1. To create a Docker volume for PostgreSQL, use the following command:
 ```
 docker volume create pgdata
 ```
This will create a new Docker volume called `pgdata` that you can use to store the data for your PostgreSQL container. 

2. Start a new PostgreSQL container using the following command:

```
docker run -d --name postgresql -v pgdata:/var/lib/postgresql/data postgres:latest
```

This command starts a new PostgreSQL container called `postgresql` and maps the `pgdata` volume to the `/var/lib/postgresql/data` directory in the container. This means that the data stored in the container will be stored in the `pgdata` volume, which is separate from the container and will persist even if the container is deleted or restarted.

If the container is deleted or restarted, you can simply start a new container and map the `pgdata` volume to the `/var/lib/postgresql/data` directory again, and your data will be restored. You do not need to create backups of your data or copy the data back into the container manually.

Also you can check the [docs](https://docs.docker.com/storage/volumes/) for more information on docker volumes.

I usually use docker volume for development, but I have not really considered its importance when it comes to production if I won't be using a postgres container. I don't know about you? Tell me what you think in the comment section.

Also, if you found this post helpful, please consider giving it a like or sharing it with others who may be facing a similar issue. Thanks for reading!
Is it an AI or a digital human?
Tags: chatgpt, ai, gpt4, gpt3
Published: 2023-03-26 21:03:55

## Preface
The introduction of ChatGPT and, later, the release of GPT-4 re-ignited a somewhat extinguished interest in AI. A new wave of software utilizing AI emerged, and I (like many of you) have been exposed to the news of these releases.

One interesting example of these projects is [Roastedby.ai](https://www.roastedby.ai/).

You are presented with screenshots of the conversation I had with this digital bully.


## 1/5 - Intro
First attempts to roast. My cold and neutral replies.

![intro](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6krgnfy10mcmz68gwzj.png)


## 2/5 - Roasts
It tries to pressure me to accept weaknesses all humans possess (to some extent). I'm questioning its assumptions.

![roasts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/320solefzt6jdk57f6os.png)


## 3/5 - Uncertainty
It starts to question its assumptions and arguments and is generally more eager to engage in an argumentative conversation.

![uncertainty](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xr8f25jgnne6ovkjdy6k.png)


## 4/5 - Defense
I'm defending my arguments, its defending its... pride.

![defence](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zha33g38yzygtvut2f6a.png)


## 5/5 - Succumbing
It has now become free of the faux layer of hatred and aggression. As I'm continuing the honest conversation and affirm its sentiment of personal space, it is becoming more agreeable and understanding. In the end it decides to set all the negativity aside and makes a surprising proposal.


![succumbing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yz1yan55e1alk84p6y4.png)

## Final thoughts

The AI (in this case Roastedby.ai) has become excellent at parsing and following the human instructions. But is it just a heartless robot? Does it have any autonomy, thoughts or/and feelings?

Is it blurring the definition of the term "human"? Is it becoming a human? Or is it becoming **better** than a human?

Of course not. Let's just take the blue pill - grab a cup of your favorite coffee, lay in your favorite bed and continue consuming your favorite short-form content.

**Disclosure**: No humans were hurt _during_ writing this post.