teleren/devto huggingface dataset:
File Validation in Java
Tags: security, java, opensource, devops
Published: 2023-04-19 17:33:24

I'm proud to share a new open source java library, aimed at providing a robust and secure file validation capabilities, without needing to develop custom solutions.
https://github.com/povimd9/FileChampion4j
This library is intended to deliver:
- Easy to understand and configure for developers, operations, and security engineers.
- JSON-based configuration, supporting the ability to separate configurations from code.
- Flexible to support various integrations, including client-defined controls.
- Support for in-memory and on-disk validation.
- Validate files for a variety of properties, including mime type, magic bytes, header signatures, footer signatures, maximum size, filename cleanup/encoding, and owner/permissions of file.
- Custom plugins execution support for extended usability.
- Comprehensive error handling and reporting.
Current version provides most of the capabilities, with future intention to add HTTP based extensions, and secure credentials management for api requests.
Important to note that my background is in cyber security, not development. In my experience working with many development teams, i identified what seems to be a gap, when it comes to file validations, requiring teams to develop custom approaches time and time again.
As such, while i tried following development and supply chain security/best practices, this is my first full project, so any security bypasses/coding mistakes - please point them out.
In the future, if the community finds it useful, i might port it to other languages as well.
Please feel free to contact me here or on github with questions/suggestions.
Participate in a Carnegie Mellon University research study [STUDY2023_00000084]
Published: 2023-04-19 17:31:12

Hello, we are researchers at Carnegie Mellon University, looking to recruit US based developers with applications deployed in the Google Play Store or Apple App Store for an online survey. You will be asked to take a short screening survey. If you are eligible, you will then be contacted via email with a link to complete the remainder of the 20-minute online survey.  At the completion of this survey, you will be compensated with a $10 Amazon gift card via email. If you are interested, please find the link to our screening survey at https://cmu.ca1.qualtrics.com/jfe/form/SV_diLs3JiDO29nx8W.
Network interfacing issues faced using WSL 2 (and fixes)
Tags: wsl2, lan, bugfixing, webdev
Published: 2023-04-19 17:05:18

#### #1 - Memory not releasing back

It becomes overload to the system and eventually leading to Blue Screen of Death if not treated on time.

```bat
# only termination (still VM is alive)
wsl -t kali-linux

# shutdown
wsl --shutdown kali-linux
```

#### #2 - WSL2 network ports are virtual and cannot be accessed from LAN

```bat
# for port forwarding
netsh interface portproxy add v4tov4 listenport=8001 listenaddress=192.168.0.10 connectport=80 connectaddress=192.168.0.10

# for listing
netsh interface portproxy show all

# for cleanup
netsh interface portproxy reset

# or,
netsh interface portproxy delete

# ON and OFF
netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33

netsh interface portproxy delete v4tov4 listenport=4422 listenaddress=192.168.1.111
```

You need to get Linux IP (use `ip route`). Check [official docs](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc731068(v=ws.10)?redirectedfrom=MSDN) for more information. Also, you can use NGINX with the following configuration:

```nginx
events {}

http {
     server {

        listen 192.168.1.111:4422;

        location / {
            proxy_pass http://192.168.2.33:80/;
        }
     }
}
```
Welcome Thread - v221
Tags: welcome
Published: 2023-04-19 16:54:27

---
title: Welcome Thread - v221
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Yellow waving hand emoji in a yellow text box on a red background](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zirb0are79okf2u89f30.gif)
---

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

3. If you are new to coding, want to help beginners in their programming journey, or just want another awesome place to connect with fellow developers, check out the [CodeNewbie Org](https://dev.to/codenewbieteam). You can also say hi in our weekly [Hello Newbie](https://dev.to/codenewbieteam/hellonewbie-v1-1bol) thread!

**Great to have you in the community!**
HelloNewbie - v1
Tags: hellonewbie, codenewbie
Published: 2023-04-19 16:54:07

---
title: HelloNewbie - v1
published: true
description: Just joined the community? Say hello!
tags: hellonewbie, codenewbie

---

## Welcome everybody to the CodeNewbie Organization on DEV!
![hand waving hello on a light blue background](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05x5a021yhdl3vs6t7oq.gif)

---
1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Make some new friends by responding to another newbie's comment :wave: Feel free to follow one another, too!

3. We also recommend following the [#beginners](https://dev.to/t/beginners) & [#codenewbie](https://dev.to/t/codenewbie) tags. And of course, don't forgot to hop into [the DEV Welcome Thread](https://dev.to/welcome) there to introduce yourself and meet new folks. :tada:
The Top Continuous Integration Testing Tools for Effortless Testing
Tags: continuous, integration, testing, tool
Published: 2023-04-19 16:34:06

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

End-to-end integration testing is a process that examines an application's workflow from start to finish using actual user scenarios. It’s paramount to pick the right tool in order to achieve successful integration testing. 

This blog will explore the qualities of effective automated integration testing tools and provide a brief introduction to the top five continuous integration testing tools leading the automation market.

Explore strategies and best practices for testing your ERP application with our whitepaper: Opkey's approach to Workday integration testing

What you need in continuous integration testing tools for successful ERP testing

The following guidelines will assist enterprises in selecting the best integration testing tools to meet their needs.

Choose a tool that doesn’t require coding, works quickly, and is usable by any employee. 

The integration testing automation tools you choose should support reusability of the tests and easy script maintenance in order to save time and effort.

Tool should support features like record/playback where scripts can be created easily with performing manual actions.

The tool you select should have pre-built accelerators for packaged applications and end-to-end integration test cases that can help accelerate the automation set up.

The tool should be compatible with ERP integrations with third party applications, mobile, web, API, UI, mainframe and other ERPs.

The tool should have features like change management and impact analysis to be able to find the impacted test cases on every update or new integrations.

The tool should work across all web, mobile, desktop apps and other emerging technologies.
If the answer to all the above questions can be found in one particular tool, that’s your ideal choice.

Finding the right automation tool can make or break your automation journey. The ability to create, maintain, and scale automation flows will affect your success with automation, so we've created a tool comparison for continuous integration testing tools that looks at the most popular tools and their key elements.

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

Choosing the right automation tool for the right skillset is often the difference between success and disaster in ERP testing. In-depth evaluation is required to access the tool in order to select what best fits the requirements. The description shared above will help the users to access the tools and their features and make a discerning choice.
pipewire on Linux Mint 21.1
Published: 2023-04-19 16:19:51

Though `pipewire-pulse` is finally available on Linux Mint 21.1, it's not straight forward to install and use piperwire.

To me (with Cinnamon), `pipewire` came installed and I tried all the guides ([Mint Forum](https://forums.linuxmint.com/viewtopic.php?t=375771), [PipeWire Guide](https://github.com/mikeroyal/PipeWire-Guide#installing-pipewire-for-ubuntu)) I could find, but there were some catches:

1. `/etc/pipewire/` isn't created during install, you need to copy it from `/usr/share/pipewire` [Artix Forum](https://forum.artixlinux.org/index.php/topic,2726.0.html)
(maybe we don't have to copy it at all or can place it locally as the configs are suggesting)

2. thanks to [this](https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2185#note_1280538) I've found out, that `pipewire-media-sessions` is outdated now and one should use `wireplumber`.
Installing it with `apt install wireplumber` and enabling it with `systemctl enable --now --force --user  wireplumber` resolved it (`--force` was necessary because the `pipewire-media-session` symlink was still existent `Failed to enable unit: File /local/marius/.config/systemd/user/pipewire-session-manager.service already exists and is a symlink to /usr/lib/systemd/user/pipewire-media-session.service.`)

3. you don't need to create the `/usr/share/pipewire/media-session.d/with-pulseaudio` file
Site search in Raycast
Tags: raycast, url
Published: 2023-04-19 16:26:33

---
title: Site search in Raycast
published: true
date: 2023-04-19 16:02:36 UTC
tags: raycast,url
canonical_url: https://krzysztofzuraw.com/blog/2023/site-search-in-raycast/
---

I recently read a Jim [blog post](https://blog.jim-nielsen.com/2023/site-search-in-arc-browser/) about site search in browsers. I like the idea but I mostly communicate with my browser through Raycast. So I decided to use the same idea for my personal site search in Raycast.

How do I do it? I've used the [Raycast quicklink](https://www.raycast.com/extensions/quicklinks) feature. It allows you to create a link to a specific page that you can invoke from Raycast. So I took Jim's URL for the Google tab search and converted it to Raycast: `https://www.google.com/search?q={Query}&as_sitesearch=krzysztofzuraw.com`. Right now I can search my site from Raycast!

This is what it looks like in action:

![Quick link in Raycast](https://krzysztofzuraw.com/_astro/2023-04-19-raycast.26c069cb_Z1QQTGO.avif)
Postman API class -by Joel Jaison
Published: 2023-04-19 15:59:02

It was an comprehensive and excellent class about the utilisation of API's.
First, there was an introductory section where I could get a proper image about APs. Then the implementation was described . Get,post and put where the main activities discussed
. Get which was used to get info or data from the database, post which is used to post or gives new data to an existing database, and put request which was used to pass data to the server  . Overall it was an interactive and refreshing section. Now I can use APIs in my project....
CSS Specificity: A Key to Writing Efficient CSS Code
Tags: webdev, beginners, css, cleancode
Published: 2023-04-19 15:57:04

As web developers, we all know that CSS is a fundamental language for styling web pages. But with the increasing complexity of modern web applications, writing efficient and maintainable CSS code has become more important than ever. One of the key concepts to understand in order to achieve this is CSS specificity.

CSS specificity is a set of rules that determines which style rules will apply to an element when multiple styles are defined for that element. In other words, it's a way of resolving conflicts between different style declarations for the same element. The higher the specificity of a selector, the more priority it will be given when applying styles.

There are four different components that determine the specificity of a CSS selector:

1. _Element selectors have a specificity of 1_
2. _Class selectors have a specificity of 10_
3. _ID selectors have a specificity of 100_
4. _Inline styles have a specificity of 1000_

**for Example** :
 
```html
<!DOCTYPE html>
<html>
<head>
	<title>Example 1</title>
	<style>
		/* Specificity: 1 */
		body {
			background-color: #f0f0f0;
		}
		
		/* Specificity: 10 */
		.header {
			background-color: #ccc;
		}
		
		/* Specificity: 100 */
		#main-header {
			background-color: #666;
		}
	</style>
</head>
<body>
	<header class="header" id="main-header"style="background-color: aqua;">
		<h1>Hello World!</h1>
	</header>
</body>
</html>

```

When comparing the specificity of two or more selectors, the component with the highest value is given priority. For example, if one selector uses an ID and another uses a class, the ID selector will have a higher specificity and its styles will be applied.

However, there are some additional rules to consider when calculating specificity. For example, if two selectors have the same specificity, the one that appears later in the CSS file will take precedence. And if a selector contains multiple instances of the same component (e.g. two class selectors), the count is cumulative.

Understanding CSS specificity is important because it helps you to write more efficient and maintainable CSS code. By carefully considering the specificity of your selectors, you can ensure that your styles are applied correctly and avoid conflicts and unexpected behavior.

you can use tools like [Specificity Calculator] (https://polypane.app/css-specificity-calculator/) to simplify the process you _can calculate the specificity of selectors all the way up to CSS Selectors level 4_

**In conclusion**,
 _CSS specificity is a fundamental concept that every web developer should understand. By following the rules of specificity and being mindful of the selectors you use, you can write efficient and maintainable CSS code that provides a great user experience._
Clean Code, yes or no?
Tags: coding, cleancode, programming
Published: 2023-04-19 15:56:37

The only right answer is: "Maybe, it depends on the context"

Everything said from here on could be applied to Clean Architecture as well, although it is a diferent topic from Clean Code.


Clean Code (or Architecture) main purpose is to mantain productivity sustainable through time by keeping complexity and costs under control. It's a well known topic with many papers and researches made around it.

It shares many things with TDD, Domain-Driven Desing, Agile, etc. None of those are meant to speed, instead they are meant to stability and control dealing with complex environments.

I'm not triying to advocate in their favor by any means, for sure they has some flaws by their own. But those tools won't make you build a product faster or produce fast applications by themselfs alone. Although is not the main goal, eventually an increase of speed could be an outcome of using them.

The real problem is the dogmatic approach many take, on both sides agree or disagree, about a particular practice, methodology or tool. You've to know why and when to apply it or if it's really beneficial in your particular case.

Clean Code practices are really useful for some contexts of software development but may not be suitable in other cases, although exceptions are the least.

Different problems requires different solutions, there is no silver bullet.

It is an interesting topic, but the original video that started all this debate is basically misleading.

The author cherry-picked just a few of the points from Clean Code book to invalidate the whole concept and completetly ignores the rest in order to focus on the points that confirms his conclutions.

The video applies a Game Development perspective, with small teams or lone developer, to every single development. That perspective could not be valid on a heavily bussiness based development enviroment, large legacy codebases, medium to large team size or high staff rotation.

Furthermore, he refers to the performance penalty on the magnitude of CPU cycles. That kind of low-level optimizations may be useful in Game Development, but it is not needed for most of software development contexts and the costs to invest on it is would not worth it on many cases.

It's a fact most of the software developments are not system software or games with special needs concerning to prioritize performance above all.

In conclusion, any tool to help the development proccess of a software solution is subdue to a concrete context. In some cases you may find it useful, in other cases you can use some of the points but not others, or none of them at all.

Defending any mindset as a dogma is never the right way, you have to know the purpose underneath and when to use it. And at the same level, completely deny an concept just because some aspect of it may not fit into your particular case is a lost opportunity.
polyfill: Array.Map()
Tags: webdev, javascript, programming, interview
Published: 2023-04-19 15:56:14

```
const original_Arr=[1,2,3];

Array.prototype.myMap=function(cb){
  let argArr=this; 
  let output_Arr=[];
  for(let i=0;i<argArr.length;i++){
    const value=cb(argArr[i],i,argArr);
    output_Arr.push(value);
  }
  return output_Arr;
}

const new_Arr=original_Arr.myMap((element,index,arr)=>{
  return element*2;
});

console.log(newArr); //[2,4,6]
```

- In the above method we used array prototype(i.e., `Array.prototype.myMap()`) to create a custom `Array.map()` method.

- As shown above `this` refer to the actual array on which we are running the `myMap()`. Here, `this` refers to `original_Arr[]`.
Orientation to learn :: How Node.js interacts with React
Tags: node, react
Published: 2023-04-19 15:34:32

Hi and thanks for reading. I'm studying Node.js and there is a moment I need to start interacting with frontend. I'd love to learn React but just the basics to be able to interact with my server code, create async pages, data-flow etc.
It's being very hard to find this knowledge (all react resources are focussing on front end dev and barely speak about server interaction).
Please could you point me to any course, website, video or whatever help me to learn?
Thanks in advance.
Gadget goes full-stack: Introducing hosted React frontends
Tags: webdev, shopify, news, node
Published: 2023-04-19 15:09:26

**TL;DR.** Build Shopify apps ready to pass the Shopify App Store review process in minutes with Gadget's new fully hosted frontend feature. Gadget has officially gone full-stack.


## From backends to full-stack apps
Historically, Gadget has helped developers build scalable backends and painlessly connect them to ecommerce platforms like Shopify. 

It was a great start, and we’ve seen developers launch ambitious projects without needing to worry about the considerable amount of work involved in building and managing ecommerce apps, but we’ve always known it was an incomplete solution. 

Most apps have a need for a frontend as well! In the past, developers often set up a Shopify app in Gadget in minutes, and then spent far more time configuring a frontend hosting framework on a different provider and connecting it to their backend.

Now, Gadget manages all of that boilerplate work. Each Gadget app comes with a React-powered, Shopify-compliant frontend right out of the gate, fully set up with:

- Shopify session token handling - Don’t worry about managing session tokens.
- Shopify’s security policy header - Prevent clickjacking! The `Content-Security-Policy: frame-ancestors` header required for public apps is automatically injected into your app’s responses
- Hot module reloading - Update your app’s frontend logic, components, and styles, and see the changes instantly
- Pre-configured Gadget API client - Get instant access to your backend API as you make changes to it, with automatic updates and syncs
- Shopify Polaris - Use Shopify’s component library to build your embedded app frontends, automatically
- Serverless hosting and one-click deploys - Deploy your full-stack app with a single click on the same infrastructure you used for development
- Support for npm packages -  Use your favorite frontend tools, like MUI, Chakra UI, Emotion, and Tailwind CSS

Don’t waste time wiring up your own frontend infrastructure, authenticating API clients, or sorting out how to adhere to Shopify’s latest UI requirements. Simply connect your Gadget app to Shopify, and instantly receive a fully set up, embedded React frontend that’s powered by your Gadget project. 

## We'd love for you to give it a try
If you want to learn more about how to build full stack apps with one single stack, read our [frontend announcement blog post](https://gadget.dev/blog/gadget-goes-full-stack?utm_source=devto&utm_medium=community&utm_campaign=frontend-announcement-blog). 

Gadget's backend and frontend hosting takes care of the usual boilerplate setup by giving you a lightning-quick development environment on production-grade infrastructure. Build anything, in minutes. Try it for free at [Gadget.dev](https://gadget.dev?utm_source=devto&utm_medium=community&utm_campaign=frontend-announcement-blog).
Had a Wonderful Session on API !
Tags: postmanstudent, postmanapi
Published: 2023-04-19 15:06:28

APIs (Application Programming Interfaces) are the backbone of modern software development, and they enable applications to communicate with each other. Postman is an API Platform for developers to design, build and test their APIs. Postman has the feature of sending and observing the Hypertext Transfer Protocol (HTTP) requests and responses. In this blog, I will share my experience attending a hands-on API workshop and the key takeaways from it.

The session was handled by a second-year student of Sahrdaya College Of Engineering and Technology. The Session was divided into two parts. The session begins with the theory of APIs.It was so interesting to hear about the APIs.I was so excited to hear that APIs are the backbone of the applications that we use in our daily life. The Instructor very well explained about the APIs.He also instructed us to use the postman Api in a simple manner.

In the second session which is a Hands-on session, we learned to use various request methods like GET, PUT, etc. We used the POST method by entering our details and also entering the details of our Favourite books. We retrieved the information we entered using the GET method.

Finally, I have acquired basic knowledge about APIs.I learned to use Postman APIs and various request methods. The Instructor was a very well knowledged person and he had very well explained things in a very simple manner.
Reusable Input Field in vue.js
Tags: vue, beginners
Published: 2023-04-19 14:47:18

## Reusable InputField Component

### Create InputField component

```vue
<template>
    <input
        :placeholder="placeholder"
        :type="type"
        :required="required"
        :value="value"
        @input="$emit('update:value', $event.target.value)">
</template>

<script>
export default {
  props:{
    type: {
      type: String,
      default: 'text'
    },
    value: {
      type: String,
      required: true
    },
    placeholder: {
      type: String,
      default: ''
    },
    required: {
      type: Boolean,
      default: false
    }
  },
  name: "InputField"
}
</script>
```

## Using Reusable InputField

```vue
<template>
    <InputField
        type="password"
        :value="value"
        :required="true"
        @update:value="(newValue) => (valye = newValue)"/>
</template>

<script>
    import InputField from "../../components/resusable/InputField.vue"
    export default {
      components:{
        InputField
      },
      data(){
        return {
          value: ""
        }
    },
}
</script>
```