teleren/devto huggingface dataset:
Sign files with powershell
Published: 2023-08-18 08:29:27

## Intro:
PowerShell offers a range of native cmdlets that allow us to sign and verify files without relying on external tools like Signtool.exe. In this step-by-step guide, we will explore how to use PowerShell to sign and verify digital files without using Signtool.exe. Additionally, we will delve into a section demonstrating how PowerShell can replace only the main certificate in a signature.

Note: Before proceeding, make sure you have a valid code signing certificate obtained from a trusted Certificate Authority (CA). Or visit my article: "[How to create development certificate](https://dev.to/bytewhisper/create-digital-development-certificate-401c)"

Press Win + X, then select "Windows PowerShell" or "Terminal" for windows 11, to open PowerShell.

To sign a file, we'll use the Set-AuthenticodeSignature cmdlet, which signs a file using the specified certificate.

```
$certificatePath = "C:\Path\To\Your\CodeSigningCertificate.pfx"
$certificatePassword = "your_certificate_password"
$fileToSign = "C:\Path\To\Your\File.exe"

$securePassword = ConvertTo-SecureString -String $certificatePassword -Force -AsPlainText
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certificatePath, $securePassword)

Set-AuthenticodeSignature -FilePath $fileToSign -Certificate $certificate
```

1. Replace "C:\Path\To\Your\CodeSigningCertificate.pfx" with the path to your code signing certificate.
2. Replace "your_certificate_password" with the password for your certificate.
3. Replace "C:\Path\To\Your\File.exe" with the path to the file you want to sign.

## Verify the Signature

To verify the signature of the signed file, use the Get-AuthenticodeSignature cmdlet:

```
$signedFile = "C:\Path\To\Your\SignedFile.exe"
$signature = Get-AuthenticodeSignature -FilePath $signedFile

if ($signature.Status -eq "Valid")
{
    Write-Host "Signature is valid."
}
else
{
    Write-Host "Signature is not valid."
}
```

- Replace "C:\Path\To\Your\SignedFile.exe" with the path to the signed file.

## Conclusion
PowerShell provides a powerful and native way to sign and verify digital files without the need for external tools like Signtool.exe. By leveraging PowerShell cmdlets, you can confidently sign your files and verify their authenticity and integrity. Always ensure that you keep your code signing certificates secure and protected to maintain the trust and integrity of your signed files.

<a href="https://www.buymeacoffee.com/bytewhisper" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
How does visualization promote relaxation and stress reduction?
Tags: visualization, relaxation, stressreduction, stress
Published: 2023-08-18 08:27:28

**The Power of Visualization: Enhancing Relaxation and Reducing Stress
Introduction**
Visualization, a potent mental technique, has gained remarkable recognition for its ability to promote relaxation and effectively reduce stress levels. In a fast-paced world where stress has become a constant companion, harnessing the power of visualization can provide a much-needed respite. Let’s delve into the fascinating realm of how visualization serves as a powerful tool in alleviating stress and inducing a state of tranquility.
**Notes for the Topic**

- Investigate the link between the mind and the body.
- Include scientific studies on the effectiveness of visualization
- Discuss the power of positive imagery
- Provide examples of situations where visualization can be helpful
**Understanding Visualization and its Mechanisms
**Visualization involves creating vivid mental images that simulate real-life scenarios or serene environments. This technique operates on the principle that the mind can influence the body. By visualizing calming scenes or positive outcomes, individuals can trigger a relaxation response. Through consistent practice, these mental images become increasingly detailed and lifelike, evoking emotional and physiological responses that facilitate relaxation.

**The Science Behind Visualization
**Scientific research has delved into the effects of visualization on the brain and body. Functional magnetic resonance imaging (fMRI) studies have shown that when individuals engage in vivid mental imagery, specific brain regions associated with emotions and sensory experiences become activated. This provides empirical evidence that visualization can indeed influence our mental and physiological states, leading to relaxation and stress reduction.

**The Neurological Harmony: Mind and Body Connection
**Scientifically, visualization’s impact on the mind-body connection cannot be overstated. When we visualize a peaceful scene, our brain’s neural pathways are activated. These pathways are closely linked to emotions and stress responses. As a result, positive visualization can stimulate the release of endorphins, the body’s natural “feel-good” chemicals, thereby counteracting the stress hormones that contribute to tension and anxiety.

[Read More...](https://healthandfittness.com/visualization-promote-relaxation-and-stress-reduction/)
Stack and queue. Difference
Tags: programming, beginners, computerscience, datastructures
Published: 2023-08-18 08:00:35

Ideas of stack and queue you can find in different program languages. Let's find out what differences between stack and queue and how they can be help us.

We have deal with queus everywhere. In shops - it is a group of people which stay one after another to the cashier in the store. The one who stand closer to cashier will pay for products first.

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

In programming, a queue works similarly. A queue in programming is a collection of elements that are processed on “a first in, first out” (FIFO) basis. It is better to use queu for tasks which should be done in stages. For example, when user loads several images to site, after server needs to process all images. All that images put to queue for processing. And the first file that the user has uploaded will be the first one processed on the server.

The stack works differently. A stack is also a collection of elements, but it works on a "last in, first out" (LIFO) basis. In everyday life, we can come across an analogy when we put documents on top of each other, and then iterate over them, starting from the top one. It's like working with a stack: you can work only with the last element that got into the collection.

Frequent use of the stack in programming it is organising logs of changes in file or document. Text editors often record user’s changes in file to the stack. And after it is easily in reverse mode undo changes which user did in file.

When you work with stack or queue you cant access an arbitrary element in collection. Becouse it would violate the principles LIFO and FIFO. If you need to get neccessery element, you need itarate all element before it.

In programming, the stack and queue are often used for various complex mathematical calculations, data manipulation and operations. The principles of FIFO and LIFO allow us to structure and organize our work with data. This allows you to be sure that data and operations will be processed in the right order.
Kotlin Code Smell 30 - Avoiding Concrete Class Subclassification Pitfalls
Tags: kotlin, codesmells, cleancode, programming
Published: 2023-08-18 17:56:02

---
title: Kotlin Code Smell 30 - Avoiding Concrete Class Subclassification Pitfalls
published: true
date: 2023-08-18 08:00:09 UTC
tags: kotlin,codesmells,cleancode,programming
canonical_url: https://yonatankarp.com/kotlin-code-smell-30-avoiding-concrete-class-subclassification-pitfalls
---

## Problem

- Bad Models
- Coupling
- [**Liskov Substitution**](https://en.wikipedia.org/wiki/Liskov_substitution_principle) Violation
- Method overriding
- [**Mapper**](https://maximilianocontieri.com/what-is-wrong-with-software) fault

## Solution

1. Subclasses should be specializations.
2. Refactor Hierarchies.
3. Favor Composition.
4. Leaf classes should be concrete.
5. Not-leaf classes should be abstract.

## Sample Code

### Wrong

```kotlin
class Stack<T> : ArrayList<T>() {
    fun push(value: T) { }
    fun pop(): T { }
}
// Stack does not behave Like an ArrayList
// besides pop, push, top it also implements (or overrides) get, set,
// add, remove and clear stack elements can be arbitrary accessed

// both classes are concrete

```

### Right

```kotlin
abstract class Collection {
    abstract fun size(): Int
}

class Stack<out T> : Collection() {
    private val contents = ArrayList<T>()

    fun push(value: Any) { ... }

    fun pop(): Any? { ... }

    override fun size() = contents.size
}

class ArrayList : Collection() {
    override fun size(): Int { ... }
}

```

## Conclusion

Accidental sub-classification is the first obvious advantage for junior developers.

More mature ones find composition opportunities instead.

Composition is dynamic, multiple, pluggable, more testable, more maintainable, and less coupled than inheritance.

Only subclassify an entity if it follows the relationship _behaves like_.

After subclassing, the parent class should be abstract.

Java made this mistake, and they're regretting it until now. Let's do better than Java 😁

* * *

I hope you enjoyed this journey and learned something new. If you want to stay updated with my latest thoughts and ideas, feel free to register for my [**newsletter**](https://yonatankarp.com/newsletter). You can also find me on [**LinkedIn**](https://www.linkedin.com/in/yonatankarp/) or [**Twitter**](https://twitter.com/yonatan_karp). Let's stay connected and keep the conversation going!

* * *

## Credits

- [Code Smell 43 - Concrete Classes Subclassified](https://maximilianocontieri.com/code-smell-43-concrete-classes-subclassified) by [Maxi Contieri](https://hashnode.com/@mcsee)
Android application that uses two decoders
Tags: android, modulation, development
Published: 2023-08-18 07:51:17

I'm developing an Android application that uses two decoders: an SSTV decoder and an AFSK (audio frequency-shift keying) decoder. These decoders should work together in a synchronized manner. The goal is to have only one decoder active at a time: either SSTV or AFSK.

However, when I switch between the decoders, I encounter an error. Specifically, when I activate the AFSK decoder, the audio record function of the device stops working and throws a permission error. This doesn't happen when I activate only one decoder (either SSTV or AFSK).

In summary, I need assistance in resolving the issue where switching between the SSTV and AFSK decoders causes the audio record function to stop and throw a permission error. The desired behavior is to have the decoders work synchronously and allow smooth switching between them without encountering this error.
[Digest] Java, Kotlin, Spring, Cloud, and More - Episode 8
Tags: digest, java, spring, cloud
Published: 2023-08-18 07:40:44

Hi there, here is what I found interesting this week:

📕 [Developer Nation Report](https://www.developernation.net/developer-reports/dn24): results of the survey that ran from Dec 2022 to Feb 2023 and reached 26k developers in 166 countries. Pretty interesting but nothing supernatural.

⚙️ [Hexagonal Architecture with Java](https://www.happycoders.eu/software-craftsmanship/hexagonal-architecture-java/): the second part of the series on Hexagonal Architecture - a sample application written in Java + Maven + ArchUnit.

🌱 [Spring's @MockBean is an anti-pattern](https://filip-prochazka.com/blog/mockbean-is-an-anti-pattern): why you should use `@MockBean` annotation carefully.

🐘 [Supavisor: Scaling Postgres to 1 Million Connections](https://supabase.com/blog/supavisor-1-million): how Supabase team enabled connection to PostgreSQL for 1 million clients.

☁️ [Why you should move back to datacenters](https://rakkhi.substack.com/p/why-you-should-move-back-to-datacenters): the author suggests creating and using an algorithm to determine what should run in the cloud vs what should run on-prem from the security and cost perspective.

---

*Dream your code, code your dream.*
Demystifying JavaScript's New `.at()` Array Method!
Tags: javascript, webdev, arrays, beginners
Published: 2023-08-18 07:13:57


---
title: "Demystifying JavaScript's New `.at()` Array Method!"
published: true
description: "A deep dive into the new `.at()` array method in JavaScript, making array element access more flexible and intuitive!"
tags: javascript, webdev, arrays, beginners
---

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

Hello, everyone! There's a new buzz in the JavaScript world, and it's all about a new array method named `.at()`. In this article, we'll explore from the basics to the intricacies of this new method. Let's dive right in!

## Table of Contents
1. What's the `.at()` method?
2. The Basics of Using `.at()`
3. Accessing Elements with Negative Indices
4. Differences between `.at()` and Traditional Array Indexing
5. Wrapping Up

## 1. What's the `.at()` method?
Introduced to JavaScript arrays, the `.at()` method has a unique characteristic: it accepts both positive and negative indices. This feature has made accessing elements from the end of arrays incredibly straightforward.

## 2. The Basics of Using `.at()`
First, let's touch upon its basic usage.

```javascript
const fruits = ["apple", "banana", "cherry", "date", "fig"];

// Accessing the first element
console.log(fruits.at(0)); // "apple"

// Accessing the third element
console.log(fruits.at(2)); // "cherry"
```

## 3. Accessing Elements with Negative Indices
The real magic of `.at()` is its ability to access array elements using negative indices.

```javascript
// Accessing the last element
console.log(fruits.at(-1)); // "fig"

// Accessing the second to the last element
console.log(fruits.at(-2)); // "date"
```

## 4. Differences between `.at()` and Traditional Array Indexing
Let's explore the primary distinction between traditional array indexing and the `.at()` method.

```javascript
// Traditional array indexing out-of-bounds access
console.log(fruits[100]); // undefined

// Out-of-bounds access with .at() method
console.log(fruits.at(100)); // undefined
```

Both methods safely return `undefined` for out-of-bounds access.

## 5. Wrapping Up
The `.at()` method provides developers with a new tool to make array element access more flexible and intuitive. Accessing the last elements of an array has never been simpler! Do consider integrating it into your toolset.

---

Gaining insights into such new JavaScript features can enhance the efficiency and readability of your development process. If you found this informative, do give it a thumbs up👍 and share!

---

That's all for our dive into the `.at()` method. Stay tuned for more tech insights in our upcoming articles!
```

---
Machine learning: Subset of Artificial Intelligence
Tags: machinelearning, ai
Published: 2023-08-18 07:33:03

Machine learning falls within the realm of artificial intelligence (AI), concentrating on designing algorithms and models that empower computers to learn from data and make predictions or decisions, all without the need for explicit programming.

There are three categories of machine learning:

**Supervised Learning:** This approach involves training the machine using labeled data, where examples have predefined outcomes.

Algorithms in this category include Linear Regression, Logistic Regression, and Support Vector Machine.

**Unsupervised Learning:** Here, the machine is trained on unlabeled data without any predefined guidance.

Algorithms in this category encompass K Means Clustering, Hierarchical Clustering, and Principal Component Analysis.

**Reinforcement Learning:** This type revolves around an agent interacting with its environment, making actions and learning from errors or rewards.

Algorithms here include Q-Learning, Deep Q Network, and SARSA.
What If Coding Classes Were Mandatory?
Tags: discuss, watercooler
Published: 2023-08-18 07:00:00

_We're going back to coding school with Nostalgia Bytes this week! Don't forget your TI calculators, Trapper Keepers, Lisa Frank folders, and USB drives. Each decade has its own story to tell. So get ready to relive the past and share your nostalgic memories with fellow developers!_

🏫 Imagine a school where coding was a mandatory subject. How would that have changed your learning experience?

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
What's Been Your Most Perplexing Coding Moment?
Tags: codenewbie, beginners, discuss, career
Published: 2023-08-18 07:00:00

Share a coding experience that left you scratching your head in confusion. What was the problem, and how did you eventually figure it out? What lessons did you learn from that experience?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*   

Image by <a href="https://www.freepik.com/free-vector/flat-hand-drawn-web-developers-illustration_12302679.htm#query=new%20coders&position=2&from_view=search&track=ais">Freepik</a>
The 5 Best PDF Conversion Tools
Published: 2023-08-18 06:34:59

What is PDF?

PDF is the name of a file format for saving the state of pages laid out (arranged) so that characters, graphics, tables, etc. are printed on paper. It is an acronym for Portable Document Format.

It means “portable document format” that is easy to transfer, save and read, but the demand for PDF conversion is increasing because it cannot be edited directly. Of these, PDF to Word conversion is the most common requirement. If you need a PDF to Word tool that is easy to use and has high conversion quality without garbled characters, this content is for you! Next, we recommend some good PDF converters.

1.iLovePDF


iLovePDF is an online service for completely free PDF. It’s very easy to use and has many other features such as PDF merge, split, compress, convert office files to PDF, convert PDF to JPG and much more!

“Ilovepdf.com” is a service that allows you to combine multiple PDF files online or split one PDF file into multiple files. If you don’t have PDF editing software at hand, you can combine and split, and combine these functions to switch pages online.

https://www.ilovepdf.com/
2. PDFelement


PDFelement converts PDF files that are often used in daily work to Word, Excel, PowerPoint, HTML, EPUB, and image file formats easily and with high accuracy. !! Very convenient. It is possible to convert multiple PDF files to Microsoft Word format documents at once. Simply drag and drop the PDF to extract and convert the text file. Easily convert PDF to EPUB for ebook readers such as Latin, Cyrillic, most Asian languages ​​and mainstream iPad, iPod Touch, Sony readers.

https://pdf.wondershare.com/
3.PDF Shaper


A utility tool that allows you to convert, edit, combine and split PDFs.

In addition to extracting text and images from PDF and converting to RTF, mutual conversion from PDF to image, image to PDF, page rotation and deletion, adding PDF metadata, extracting PDF pages, one multiple PDF You can use a wide range of functions with one software, such as combining into PDF and security functions that can be encrypted with a password.

https://www.pdfshaper.com/download.html
4.LightPDF


LightPDF is a simple and efficient online PDF editor for amateur users. All features are based on web side operations without downloading or installing, and as long as you open a web page, you can easily convert PDF to Word, PNG, JPG, PPT, or various other formats such as Word, Excel, etc. I can do it.

https://lightpdf.com/
5.Smallpdf


Smallpdf is a PDF creation service available on the web. You can export Office files such as Word and Excell to PDF, and conversely convert PDF to Word and Excell. Since it is a service on the web, you can use it immediately by accessing the Smallpdf page with a browser. As you can see from the top page, various contents are prepared.

https://smallpdf.com/
Hello again, I am not taking so much time off this time
Tags: ruby, rails, needtosleepmore
Published: 2023-08-18 06:51:13

Hi darlings

So, today I continued working on my photogram project, and although I didn't have much time to study, I learned a few valuable things that I think will make my work as a developer easier (given that they become easy at some point, of course)

So today I saw new ways to encourage myself to code in a more DRY way: scopes and enums.

Scopes are kind of a way to label specific things in my database so that I can retrieve them easier in the future

And enums let you define an Array of values for an attribute and refer to them by name

I am sure I could explain better but I think I need more practice to give a more profound explanation. but basically both will help us save time by not writing and writing code, is like we will have access to these values because we will put a name on them

I'll continue tomorrow cause I am SLEEPy

xoxoxoxox

Yours truly

Sinhue
ReactNativeでauth0を使う時にaudienceパラメータを付与する
Published: 2023-08-18 06:39:09

---
title: ReactNativeでauth0を使う時にaudienceパラメータを付与する
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-08-18 06:33 +0000
---

通常のauth0 react sdkでは、audienceパラメータは以下のように注入することができるが
```jsx
<Auth0Provider
        authorizationParams={{
          redirect_uri: window.location.origin,
          audience: Config.Auth0.audience,
          scope: "read:current_user"
        }}
      >
```

react nativeのauth0sdkではaudienceパラメータを、Auth0Providerでは付与できない
```jsx
<Auth0Provider
      domain={Config.Auth0.domain}
      clientId={Config.Auth0.clientId}
    >
```

このまま使うと、例えばAspdotnetのAPIサーバーに通信したときに以下のようにキー複合化エラーが出る。
これはaudienceパラメータが無いかららしい
```
IDX10609: Decryption failed. No Keys tried: toke n:
```

ではどうするかというと、ログイン時(authorize)にaudienceを渡すことができる
```jsx
<Button onPress={async () => await authorize({
                    audience: Config.Auth0.audience
                })} title='login' />
```
この認証情報をつかって発行されたaccessTokenはaudienceパラメータが付与されている
Day 3: Intro To Conditional Statments - 30 Days of Code HackerRank
Tags: programming, coding, python, beginners
Published: 2023-08-18 06:30:45


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

## Conditional Statements

Conditional statements are condition that allow to execute a block of code if certain conditions are meet. IF/Elif/Else are one type of conditional statement.

In this problem we will print `Weird/Not Weird` based on number provided by the user.

## Task

Given an integer, , perform the following conditional actions:

If  is odd, print Weird
If  is even and in the inclusive range of 2 to 5, print Not Weird
If  is even and in the inclusive range of 6 to 20, print Weird
If  is even and greater than 20, print Not Weird

## Conditional Statement Solution Hackerrank Solution In Python

```python
if __name__ == "__main__":
    N = int(input())
    if N % 2 != 0:
        print("Weird")
    elif 2 < N < 5:
        print("Not Weird")
    elif 6 < N <= 20:
        print("Weird")
    elif N > 20:
        print("Not Weird")
```

## Conditional Statement Solution Hackerrank Solution In JavaScript(Js)

```javascript
function main() {
    const N = parseInt(readLine(), 10);
    if (N % 2 != 0) {
        console.log('Weird')
    } else if (N > 20) {
        console.log('Not Weird')
    } else if (N >= 6) {
        console.log('Weird')
    } else if (N >= 2) {
        console.log('Not Weird')
    }
}
```

**Check out [30 Days of Code| CodePerfectplus](https://codeperfectplus.com/category/hackerank-30daysofcode) for All solutions from this series.**