teleren/devto huggingface dataset:
How to use EV Code Signing Certificate for Windows Device Drivers?
Tags: tutorial, programming, cybersecurity, devops
Published: 2023-04-17 12:37:12

![ev-code-signing-windows-drivers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3s66s5oixwwiuxwq9w9.jpg)
All of us are aware of the fact that code signing is a popular developer security tool that ensures that the code is not tampered with or altered by a cyber attacker to gain unauthorized access to all the data associated with the signed software, driver, script, EXE, or application. Also, among the various categories of code signing certificates available, Extended Validation (EV) Code Signing Certificates are known to be a highly trusted and powerful tool, ensuring the strongest code security, boosting instant developer reputation, and eliminating "SmartScreen" and other system warnings for users, enabling faster downloads for software and apps.

Likewise for software, system drivers like Windows kernel drivers and device drivers also pose a threat of being accessible by unauthorized users like malware developers to gain access to Windows kernel resources. Thus, it's always a good practice to code sign your Windows device drivers using an EV Code Signing Certificate, enabling software authenticity and integrity verification.

Also, by signing a driver package with a code signing certificate, Windows can confirm that the package has not been modified since its signing. This measure safeguards users’ systems and codes against potential malware security threats.

## How to Sign Windows Device Drivers using an EV Code Signing Certificate?

**Step 1:** Obtain an [EV Code Signing Certificate](https://signmycode.com/ev-code-signing) from a trusted and reputed code signing solution provider.

**Step 2:** Once you have acquired your EV code signing certificate, generate the code signing certificate using the private key issued to you that ensures that the certificate chain is trusted.

**Step 3:** After successfully completing "Step 2," you will be able to sign your driver packages using the generated code signing certificate, like signing using the _"signtool.exe"_ utility with the Windows SDK.

**Step 4:** Once you are done signing driver packages, the last step involves you distributing signed drivers through the Microsoft Windows Hardware Developer Center Dashboard (HDC) or any public download site, enabling your users to download and install your driver packages smoothly without any system warnings. If any errors or warnings persist, then there is a higher possibility of the driver being unsigned or the signature not being trusted.


Code signing your Windows device drivers using an EV code Signing Certificates ensures your driver packages are enabled with the strongest security, reducing the vulnerability to malware threats.
Introduction To Design Patterns
Tags: programming, designpatterns, cleancode, coding
Published: 2023-04-17 12:32:48

**Introduction**

Design patterns are a set of best practices and guidelines for software design. They provide reusable solutions to common problems that developers face in software development. Design patterns offer a vocabulary and a common understanding for developers to communicate about their code and to use tried-and-tested solutions to problems.

---

Design patterns are not specific to any programming language or technology. They are general solutions that can be applied to different situations and domains. The use of design patterns can improve the quality of software by making it more modular, flexible, and maintainable. They can also help reduce the time and cost of development by providing pre-existing solutions to problems.

---

**Types of Design Patterns**

Design patterns are categorized into three main groups:

- Creational Patterns

- Structural Patterns

- Behavioral Patterns

Each category includes several patterns that can be used to solve specific problems. It's important to note that design patterns are not a one-size-fits-all solution, and developers should choose the appropriate pattern for each problem they are trying to solve.

---

1. Creational patterns: These patterns are used to create objects in a flexible and efficient way. Examples of creational patterns include Singleton, Factory Method, and Abstract Factory.

2. Structural patterns: These patterns deal with the composition of classes and objects to form larger structures. Examples of structural patterns include Adapter, Decorator, and Bridge.

3. Behavioral patterns: These patterns deal with communication between objects and the distribution of responsibilities. Examples of behavioral patterns include Observer, Command, and Strategy.


Design patterns can help developers avoid common mistakes and improve the overall quality of their code. They are not a silver bullet, but rather a tool that can be used in conjunction with good programming practices to create robust and maintainable software.

---

**Overall, design patterns are a powerful tool for developers to improve their code quality, reduce development time and cost, and create more scalable and maintainable software.**

---

**Design Patterns Resources**

- Design Patterns Video Tutorial - Derek Banas
https://youtube.com/playlist?list=PLF206E906175C7E07

- Design Patterns - Geekific
https://youtube.com/playlist?list=PLlsmxlJgn1HJpa28yHzkBmUY-Ty71ZUGc

- Design Patterns in Object Oriented Programming - Christopher Okhravi
https://youtube.com/playlist?list=PLrhzvIcii6GNjpARdnO4ueTUAVR9eMBpc

- Refactoring Guru
https://refactoring.guru/design-patterns

---

💡 Thank you for reading this article. 

💡 You can follow me on: 
- [LinkedIn](https://www.linkedin.com/in/dev-alisamir)
- [Telegram](https://t.me/dev_ali_samir)
- [Facebook](https://www.facebook.com/alisamir.dev)
- [Instagram](https://www.instagram.com/alisamir.dev)
ChatGPT from OpenAI with React Native
Tags: javascript, reactnative, chatgpt, openai
Published: 2023-04-17 12:23:38

## Introduction

I started this project _**"[Tell me a story...](https://github.com/kiki-le-singe/tell-me-a-story-ai)"**_ mainly to play with [ChatGPT](https://chat.openai.com/) from [OpenAI](https://openai.com/). It's a small app that allows you to write a story using the [OpenAI API](https://platform.openai.com/docs/api-reference). There are some predefined stories to help your inspiration, and you can also write your own story.

[The "Tell me a story..." project on GitHub](https://github.com/kiki-le-singe/tell-me-a-story-ai)

This app uses these following API:

- [Create image](https://platform.openai.com/docs/api-reference/images/create)
- [Create completion](https://platform.openai.com/docs/api-reference/completions/create)

Enjoy it! :)

<br />

This app has four screens:

- A tutorial interface that introduces the app.
- A simple screen that displays the users who have created pictures and illustrations.
- The screen that allows you to write a predefined story.
- The screen that allows you to write your own story.


![Preview of the App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vl8cguvqd747g4synx2.gif)

<br />

![Write your own Story screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nga6fhqw4jeyscm03xi0.gif)

<br />

![Read a predefined Story](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w0x16e4bq75mhs3e49v1.gif)

<br />

## Requirements

In order to use the API of ChatGPT, you have to create an account [Explore the OpenAI API](https://platform.openai.com/overview). After that, just create a new secret key [API keys](https://platform.openai.com/account/api-keys).

## Installation

```shell
$ git clone https://github.com/kiki-le-singe/tell-me-a-story-ai.git <name>
$ cd <name>
$ yarn | npm install
$ npx pod-install
```

> Create a .env file at the root of the project and set this env variable `OPENAI_API_KEY=<YOUR_SECRET_KEY>`

```shell
$ npm run ios
```

## Resources

All the images are taken from [Freepik](http://www.freepik.com). Those I have chosen have a free license. I just use them to illustrate this app.

They are designed by these authors:

<br />

![List of authors](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1fbhwld08m6x881mt06z.gif)

<br />

- [freepik](https://www.freepik.com/author/freepik)
- [ddraw](https://www.freepik.com/author/ddraw)
- [vectorjuice](https://www.freepik.com/author/vectorjuice)
- [pikisuperstar](https://www.freepik.com/author/pikisuperstar)
- [pch.vector](https://www.freepik.com/author/pch-vector)
- [catalyststuff](https://www.freepik.com/author/catalyststuff)
- [rawpixel-com](https://www.freepik.com/author/rawpixel-com)
- [upklyak](https://www.freepik.com/author/upklyak)
- [brgfx](https://www.freepik.com/author/brgfx)
- [storyset](https://www.freepik.com/author/stories)

All the icons are taken from [unDraw](https://undraw.co/).

A big thanks to them for their awesome work!
Resolvendo problemas no HackerRank: Promoção de Halloween.
Tags: javascript, begg, programming
Published: 2023-04-17 12:10:06

Olá, seja bem vindo a mais um Resolvendo problemas no HackerRank: No caso de hoje,vamos percorrer os preços diversos que teremos numa promoção de Halloween, onde os preços dos jogos ficarão mais baixos conforme se passa . Vejamos mais informações com a explicação detalhada e sua resolução.

**Sale Halloween -**

Você deseja comprar videogames da famosa loja de videogames online Mist.

Normalmente, todos os jogos são vendidos pelo mesmo preço,`p` dólares. No entanto, eles planejam ter a venda sazonal de Halloween no próximo mês, na qual você pode comprar jogos por um preço mais barato. Especificamente, o primeiro jogo custará `p` dólares, e cada jogo subseqüente custará `d` dólares a menos que o anterior. Isso continua até que o custo se torne menor ou igual a `m` dólares, após o que cada jogo custará `m` dólares. Quantos jogos você pode comprar durante a Promoção de Halloween?

- p= 20
- d=3
- m=6
- s=70

int p: o preço do primeiro jogo
int d: o desconto do preço do jogo anterior
int m: o custo mínimo de um jogo
int s: o orçamento inicial


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


Vejamos a resolução em código:

```
function howManyGames(p, d, m, s) {
    // Return the number of games you can buy
  let finalValue = 0;
    while (s >= p) {
      finalValue++;
      s -= p;
      p -= d;
          
    if (p < m) p = m;
    }
  return finalValue;
}
```

Criamos uma variável `finalValue` com custo inicial 0. Enquanto s que representa o valor final for menor ou igual a p, ele irá adicionar 1 a variável e irá subtrair o valor de s em p, e logo após subtrair o valor de p em d. E se p for menor que m, p irá receber m, e ao final retornar seu valor.

O resultado disso é:

```
20 3 6 80

input:6
```

Assim, concluímos mais um _Resolvendo problemas no HackerRank:_ até a próxima.
Explain Sveltekit/Strapi API Like I'm Five
Published: 2023-04-17 12:06:14

Hi all!

I'm new and nice to meet you all! I have the following isse:

So I have a web app built on Sveltekit. Here I intend to pull data from strapi for a blog as well as other information. I have made a route called news and a nested route called posts which is my API endpoint. Here in '/news/posts' I check with Postman and the demo data I have there flows in well:


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

The code that did that in the +server.ts files is:

```
export const GET = async ({ request }) => {

const res = await fetch('https://cms.nafuna.tv/api/blogs')
const info = await res.json()

return new Response(JSON.stringify(info), { status: 200})

}
```
so now I wanted to get the data into the main +page.svelte file. I have made a +page.server.ts to load the data from the endpoint:

```
export async function load({ fetch }) { const res = await fetch('/news/posts') const info = await res.json() return { props: { blogs: info.data } }; }
```

My main issue happens when I am trying to use that in the +page.svelte whose code looks like:

```
<script lang="ts">
import type { PageData } from './$types';

export let data;

</script> {#each blogs as post}
{post.Title}
{/each}
```

the above won't display the posts coming from API. What am I missing? I'm pretty new to Sveltekit and have been learning Javascript for under 3 months so there maybe things that I know I missed. Here is a screenshot side by side so you can better see: 


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


This is my first endpoint EVER. So I apologies for the Noob questions.
SAP Mobile Apps | SAP Mobile Apps for iOS and Android
Tags: sap, sapmobile
Published: 2023-04-17 12:03:11

Leaping Frog Consulting is the best SAP application management service, providers which offers [**SAP Business One Mobile App**](https://www.leapingfrogconsulting.com/sap-products/sap-mobile-app), SAP Business One Sales App, and SAP Business One Service App

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ecs8jwlaht3s65oehij7.jpeg)
Maker tag
Tags: javascript, opensource, webdev, tooling
Published: 2023-04-17 12:02:27

Introducing Maker Tag, a customizable HTML and CSS based widget that allows you to display a text tag on your website. The widget is designed to be easily added to any website with minimal configuration.

To add the Maker Tag widget to your website, simply add the following JavaScript code to your web page:

```html
<script src="https://cdn.jsdelivr.net/gh/alohe/maker-tag@1.0.0/dist/mwl.min.js"></script>
```

The widget can be customized by passing an object to the MakerTag constructor. You can customize the tag's text, link, color, background, margin, padding, font size, font weight, border radius, position, shadow, and hover effects. Additionally, you can enable the animated gradient background.

![maker-tag by Alohe examples - https://github.com/alohe/maker-tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ffu1ik2c3zmnowpje8v.jpg)

Here is an example of the default configuration:
```html
<script>
  new MakerTag({
    text: "Made with ❤️ by Alohe",
    link: "https://alohe.github.io",
    position: "bottom-left",
    background: "radial-gradient(circle at left, #FFE2A3 0%, #fff 50%, #FFE2A3 100%)",
    color: "#E59F0D",
    animated: true,
    padding: "10px 20px",
    margin: "10px",
    font: {
        size: "13px",
        weight: "700",
    },
    borderRadius: "13px",
    hover: {
        color: "",
        background: "",
        shadow: "",
    },
    shadow: "none",
  });
</script>
```

Maker Tag is free and open-source, so you can use it for any personal or commercial project.

To learn more or want to make a contribution, visit the GitHub page at https://github.com/alohe/maker-tag and be sure to give it a ⭐. 

And, Thank you for reading 😊.
business process consulting
Tags: sap
Published: 2023-04-17 11:47:46

[**Business Process Consulting**](https://www.leapingfrogconsulting.com/erp-services/business-process-consulting) and Business Process Management for SAP Implementation offered by Leaping Frog Consulting based in Mumbai, India

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqzp3t5o4g5vjiq2p2pb.png)
Tackle code complexity within VS Code Editor
Tags: vscode, programming, tutorial, devops
Published: 2023-04-17 11:34:45

In this tutorial we learn how you can use CodeScene's IDE Extension for VS Code to reduce code complexity while writing the code, in real time. 

It's a free, standalone version of CodeScene's code health analysis, supporting all the popular languages. 

It performs the analysis in the background automatically and reports any issues right next to your code. See below. 


**Examples**

![Issues are displayed above the affected functions. Clicking on them shows an explanation.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ad6sbnrstuttjo1wyeq.png)

_Issues are displayed above the affected functions. Clicking on them shows an explanation._


![Issues are registered as warnings and collected in the Problems tab.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i0plpm9xjhrhll8t8850.png)

_Issues are registered as warnings and collected in the Problems tab._

![A score based on the CodeScene code health concept is shown at the top of the file.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdd7pe7l30ryl1uuw14i.png)

_A score based on the CodeScene code health concept is shown at the top of the file._



**Tutorial:** You can find the tutorial [here](https://www.youtube.com/watch?v=zlXntwqFvoQ&t=5s). 


**Extension can be found here**
Install the VS Code Extension [here](https://marketplace.visualstudio.com/items?itemName=CodeScene.codescene-vscode).



**Some of the Code Health Factors measured:**

- 
Nested complexity (highly nested if-statements or loops)

- 
Bumpy road (multiple chunks of nested complexity)

- 
Complex functions (measured as high cyclomatic complexity)

- 
Functions with too many arguments

- 
Functions that are too long

- 
You can find more detailed information for each Code Health issue by drilling down in the editor.
How To Boost Your Firebase App’s Efficiency with Real-Time Listeners in React.js
Tags: firebase, react, javascript, productivity
Published: 2023-04-17 11:06:09

Firebase’s **onSnapshot** method is used to set up **real-time listeners** for changes to data in a Firebase database. This method takes a reference to a collection or document in your Firebase database as its first argument, and a callback function as its second argument. Whenever the data in the referenced collection or document changes, the callback function is invoked with a snapshot of the updated data.

Here’s an example of how to use **onSnapshot **in a **React.js** application to display a list of messages stored in a **Firebase Firestore database**:

```
import React, { useState, useEffect } from 'react';
import { getFirestore, collection, onSnapshot } from 'firebase/firestore';

const db = getFirestore();
const messagesRef = collection(db, 'messages');

function App() {
  const [messages, setMessages] = useState([]);

  useEffect(() => {
    const unsubscribe = onSnapshot(messagesRef, (snapshot) => {
      const updatedMessages = snapshot.docs.map((doc) => doc.data());
      setMessages(updatedMessages);
    });
    return () => unsubscribe();
  }, []);

  return (
    <div>
      <h1>Messages:</h1>
      <ul>
        {messages.map((message, index) => (
          <li key={index}>{message.text}</li>
        ))}
      </ul>
    </div>
  );
}

export default App;
```

In this example, we first import the necessary Firebase modules (getFirestore, collection, and onSnapshot) and create a reference to the messages collection in the Firestore database.

We then use the useState hook to create a state variable called messages, which we will use to store the messages data retrieved from the database.

We use the useEffect hook to attach a listener to the messages collection in the database using the onSnapshot method. The listener will update the messages state variable whenever the data in the messages collection changes.

Finally, we use the messages state variable to render the list of messages in our React component.

Overall, onSnapshot is a powerful tool for building real-time, responsive, and efficient Firebase applications in React.js.
Fetching Data from an API in SolidJS with Axios with Example
Tags: solidjs, javascript, tutorial, productivity
Published: 2023-04-17 11:05:50

To fetch data from an API in **SolidJS** with **Axios**, you can use the **createEffect** hook to make the API call and store the data in a state variable. But before we deep dive into a example, Let’s understand what createEffect can do in SolidJS.

The createEffect hook in SolidJS is used to create an effect that reacts to changes in observable values. An effect is a function that runs whenever its dependencies change.

The createEffect hook takes a function as its argument and returns a cleanup function that can be used to clean up any resources created by the effect. The function passed to createEffect can use any observable values as its dependencies, including state variables created with **createSignal** or **createStore**, or derived values created with **createMemo**.

The createEffect hook can be used for a wide variety of tasks, such as fetching data from an API, updating the DOM, or subscribing to events.

When an effect runs, any changes it makes to observable values will trigger a re-run of the effect. This can lead to infinite loops if not used carefully. To prevent infinite loops, you can use the untrack function to temporarily suspend tracking of observable changes within an effect, or you can use the **createMemo** hook to **memoize** derived values.

```
import { createSignal, createEffect } from 'solid-js';
import axios from 'axios';

function App() {
  const [data, setData] = createSignal(null);

  createEffect(() => {
    axios.get('https://api.example.com/data')
      .then(response => setData(response.data))
      .catch(error => console.error(error));
  });

  return (
    <div>
      {data ? (
        <ul>
          {data.map(item => (
            <li>{item.name}</li>
          ))}
        </ul>
      ) : (
        <p>Loading...</p>
      )}
    </div>
  );
}

export default App;
```
In this example, we first import the createSignal and createEffect functions from SolidJS and the axios library. We then create a state variable called data using the createSignal function and initialize it to null.

We then use the createEffect hook to make the API call using axios.get. When the API call succeeds, we set the data state variable to the response data using the **setData** function. If the API call fails, we log the error to the console.

Finally, we render the data in a list. If the data is still null, we display a “Loading…” message. Note that this example assumes that the API returns an array of objects with a name property. You will need to modify the code to fit your specific API’s data structure.

Overall, the createEffect hook is a powerful tool for creating reactive, declarative logic in SolidJS applications.
SolidJS Signals: Simplify State Management and UI Updates with Reactive Programming
Tags: solidjs, reactive, tutorial, states
Published: 2023-04-17 11:05:41

In SolidJS, signals are used to create reactive state variables that can automatically trigger updates to the UI when their value changes. A signal is essentially a function that returns the current value of the state variable, and can also be used to update its value.

To create a signal, you can use the createSignal function from the SolidJS library. For example:

```
import { createSignal } from 'solid-js';
const [count, setCount] = createSignal(0);
```
In this example, we create a signal called count with an initial value of 0. The createSignal function returns an array with two items: the first item is the current value of the signal, and the second item is a function that can be used to update the signal’s value.

To update the value of the count signal, we can call the setCount function and pass in the new value. For example:

```
setCount(count() + 1);
```

In this example, we update the count signal’s value by incrementing it by 1.

**Full Example**

```
import { createSignal } from 'solid-js';

function Counter() {
  const [count, setCount] = createSignal(0);
  
  function handleClick() {
    setCount(count() + 1);
  }
  
  return (
    <div>
      <p>Count: {count()}</p>
      <button onClick={handleClick}>Increment</button>
    </div>
  );
}

export default Counter;
```

One benefit of using signals in SolidJS is that they can be used in a declarative manner, allowing you to focus on the desired state of the UI rather than worrying about the details of how to update it. For example, if you have a component that displays a list of items and you want to update the UI when a new item is added, you can simply add the item to an array signal and SolidJS will automatically update the UI to reflect the new state.

Overall, signals are a powerful and flexible feature of SolidJS that can help simplify the process of managing state and updating the UI.