teleren/devto huggingface dataset:
Connecting to IRC with Halloy
Published: 2024-05-30 01:15:03

Halloy is a new IRC client written in Rust that is fast with good theming. Here is how I set up a connection to an irc channel with Halloy and here is how to config Halloy for Rizon.

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



After [downloading Halloy](https://github.com/squidowl/halloy/releases/tag/2024.7), I referred to the [documentation](https://halloy.squidowl.org/index.html).

Halloy uses a config.toml file, easily edited in code editor like VSCode. By default this is next to the Halloy installation, for me, in AppData/Roaming on Windows.

Halloy has command bar on the bottom left of the application window, and opening that gives options including "Configuration: Open config directory".

### Basic connection to Rizon

In config.toml, Halloy already gives an example setup. For Rizon network, here's another example:

`[servers.rizon]
nickname = "YourNicknameHere"
nick_password = "yourPassword"
server = "irc.rizon.net"
channels = ["#chat"]
port = 6697
on_connect = ["/msg NickServ IDENTIFY your_password"]`

When Halloy opens, the name of the window will be what is written after the period in [servers.name]. Nickname is for irc, password, if needed, is used for authenticating. The server is Rizon, and the channel list `["#chat", "#example"]` is for connecting to the channel after opening Halloy. Port 6697 is for ssl with Rizon.
The on_connect is for specifying irc commands to run on connection. Here I have a message to NickServ asking to identify a username with a password.

### Configuring Halloy with IRC Bouncer

Halloy also works with irc bouncers. Here is an example in config.toml file, and because my username on irc bouncer is different from nickname on irc...

`[servers.bnc]
nickname = "MyNickName"
username = "MyBouncerUsername"
password = "bouncer_server_password_here"
server = "chat.Yourbouncerserverhere.com"
port = +1234
use_tls = true
on_connect = ["nick MyNickName", "/msg NickServ IDENTIFY myNickServPassword", "/join #example"]`

The plus on the port (which should be the port to connect to the irc bouncer) indicates ssl.
After logging on to the irc bouncer server, I use the on_connect command to change to preferred nickname, verify with the Nickname Service, and join the preferred channel.

### Themes

To install a theme, [download](https://halloy.squidowl.org/configuration/themes/community.html) and place the theme file in the themes folder where Halloy is installed.
Introduction to API Design and Development with Swagger
Tags: webdev, javascript, programming, beginners
Published: 2024-05-30 00:31:55

## Introduction

API (Application Programming Interface) is the backbone of modern software development, allowing different applications to communicate with each other. However, designing and developing an API can be a complex task. This is where Swagger comes in. Swagger is a tool that simplifies the process of designing and developing APIs, making it easier for developers to create high-quality APIs.

## Advantages

One of the main advantages of Swagger is its ability to provide a visual representation of the API structure. It allows developers to visualize the functionality of their APIs, making it easier to identify any potential issues.

Moreover, Swagger also generates interactive API documentation, making it easier for developers to understand and use the API. This reduces the learning curve and enables faster adoption by other developers.

## Disadvantages

One potential disadvantage of using Swagger is that it can be overwhelming for beginners. It has a steep learning curve and requires some technical knowledge to fully utilize its capabilities. Furthermore, since Swagger is open-source, it may not have all the features that some companies may require from their API documentation tools.

## Features

Apart from visual representation and interactive documentation, Swagger also has features such as automatic code generation, server stubs, and the ability to test APIs directly from the interface. It supports multiple programming languages, making it a versatile tool for developers.

### Example of Swagger in Action

```yaml
swagger: '2.0'
info:
  title: Sample API
  description: API description in Markdown.
  version: 1.0.0
host: api.example.com
basePath: /v1
schemes:
  - https
paths:
  /users:
    get:
      summary: Returns a list of users.
      responses:
        200:
          description: A list of users
          schema:
            type: array
            items:
              $ref: '#/definitions/User'
definitions:
  User:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
```

This example illustrates how Swagger can be used to define a simple API for retrieving a list of users, showcasing its user-friendly YAML configuration and clear structure.

## Conclusion

In conclusion, Swagger is a powerful tool that simplifies the process of API design and development. Its features and advantages make it a popular choice among developers. However, it also has some limitations that must be considered before implementation. Overall, Swagger is a valuable asset for any development team looking to create well-structured and well-documented APIs.
Tech Flash News of the Day: Microsoft Integrates Copilot AI Assistant into Telegram
Published: 2024-05-30 00:04:44

Today's tech flash news brings an exciting update for all messaging app enthusiasts and productivity seekers. Microsoft has seamlessly integrated its AI assistant, Copilot, into Telegram. This integration is set to revolutionize how we interact and communicate on the platform.
Key Features of Copilot in Telegram
Message Summarization: No more scrolling through long threads. Copilot can now summarize lengthy conversations, making it easier to catch up on missed discussions.
Translation Services: Break language barriers effortlessly. Copilot's translation feature allows users to translate entire conversations in real-time, facilitating smoother communication with friends and colleagues worldwide.
Enhanced Productivity: With Copilot handling summarizations and translations, users can focus on more important tasks, boosting overall productivity and efficiency.

How to Access Copilot for Telegram
Getting started with Copilot on Telegram is straightforward:
Visit the Website: Navigate to the Copilot for Telegram website in your web browser.
Sign Up: Simply enter your phone number to sign up.
Free Prompts: Enjoy 30 free prompts to explore the capabilities of Copilot.

This integration is free for all users, ensuring that everyone can benefit from these advanced features without any cost barriers.
Impact and Benefits
Smart Messaging: Elevate your messaging experience with intelligent assistance.
Enhanced Communication: Whether for personal use or business communications, the translation and summarization features are invaluable.
Tech Innovation: This move underscores Microsoft's commitment to integrating AI into everyday tools, enhancing digital interactions for all users.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdczyph9iwmksuri1fse.png)
Item 32: Seja criterioso ao combinar os genéricos com os varargs
Tags: java, javaprogramming, javaefetivo, generics
Published: 2024-05-30 00:04:01


**Introdução:**
Métodos varargs e genéricos foram introduzidos no Java 5.
Interação entre eles nem sempre é pacífica devido a vazamentos de abstração.

1. **Problemas com varargs e genéricos:**
Criação de arrays para parâmetros varargs torna-se visível, resultando em advertências do compilador.
Tipos não reificados (parametrizados ou genéricos) causam advertências na declaração e invocação de métodos varargs.

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

2. **Poluição do heap:**
Ocorre quando uma variável de tipo parametrizado referencia um objeto de outro tipo, podendo causar falhas de ClassCastException.

**Exemplo de problema:**
Um método aparentemente seguro pode falhar com ClassCastException devido a casts invisíveis gerados pelo compilador.

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

3. **Inconsistências permitidas:**
Métodos com parâmetros varargs genéricos são permitidos, apesar das inconsistências, devido à sua utilidade prática.
Exemplos de métodos seguros incluem Arrays.asList, Collections.addAll, e EnumSet.of.

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

4. **Introdução do @SafeVarargs:**
Introduzido no Java 7 para suprimir automaticamente advertências de métodos varargs genéricos que são seguros.
Representa uma promessa do autor do método de que ele é seguro.

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

5. **Garantia de segurança:**
Não armazene nada no array de parâmetros varargs.
Não permita que referências ao array escapem para código não confiável.

**Exemplo de método perigoso:**
Métodos que retornam um array de parâmetros varargs podem propagar poluição do heap.

**Uso seguro de varargs:**
Passar arrays varargs para métodos adequadamente anotados ou que apenas calculam funções do conteúdo do array.

**Exemplo de uso seguro:**
Método que aceita várias listas e retorna uma lista contendo todos os elementos.

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

6. **Regras para @SafeVarargs:**
Use em métodos com parâmetros varargs genéricos para evitar advertências desnecessárias.
Métodos anotados devem ser estáticos ou finais (Java 8), ou privados (Java 9).

7. **Alternativa com List:**
Substituir varargs por List para provar que o método é seguro.
Pode resultar em código cliente mais verboso e ligeiramente mais lento.

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

**Conclusão:**
Varargs e genéricos não interagem bem devido a vazamentos de abstração e diferenças nas regras de tipagem.
Garanta que métodos com parâmetros varargs genéricos sejam seguros e anote-os com @SafeVarargs.

Este resumo captura os pontos principais do artigo, destacando os problemas, soluções e boas práticas ao combinar varargs com genéricos no Java.
Fullstack Frameworks aren't worth it
Tags: webdev
Published: 2024-05-29 23:31:05

Hey,

I've been burned too many times by fullstack frameworks, and I just need to get this off my chest. Here’s why they don’t work out for me:

1. **Frontend Frustrations**: These frameworks usually stick to basic HTML templates, and making even simple CRUD functionalities work is a huge pain. (Laravel, Django)

2. **Locked In**: Once you pick a framework, you’re stuck with it. It’s like being in a relationship that you can’t get out of.

3. **Team Nightmares**: Working with a team on these projects sucks because there’s no clear division of work, and it gets messy fast.

4. **External Dependencies**: Need authentication? You’ll have to look outside the framework, and it just adds more complexity. (Next.js)

5. **Feature Imbalance**: I’ve yet to find one that’s great for both frontend and backend. They always compromise on one side. (Laravel, Next.js)

6. **Scaling Woes**: Scaling and keeping things organized becomes a real headache. (Django)

7. **Mobile App Hassles**: If the client wants a mobile app, you’re out of luck. You can’t just serve HTML to mobile apps, so you end up building APIs separately.

8. **Performance Pains**: Dreaming of a fast app? Keep dreaming, because fullstack frameworks rarely hit the mark. (Django, Laravel)

9. **Stunted Learning**: You don’t get to learn much because these frameworks do so much for you, leaving you with little growth.

In the end, splitting up frontend and backend is way better. It’s more manageable, scalable, and just works better overall. Just my two cents based on way too many regrets!
Gossip RorApp, Basic Example Social App Next.js Nest.js
Tags: nestjs, nextjs, pwa, api
Published: 2024-05-29 23:15:33

Hello,

I would like to share the latest PWA I have developed. It is a basic example of a social network created with Next.js and deployed on Vercel. The API is built with Nest.js and deployed on Railway.

This application includes essential features of a social network, such as user profile creation, message posting, and the ability to like posts.

Technologies used:

Next.js: Used for the frontend, providing a fast and efficient user experience.

Nest.js: Used for the backend, offering a robust and scalable structure for the API.

Vercel: Platform used to deploy and host the frontend easily and efficiently.

Railway: Used to deploy and manage the backend, leveraging its ease of use for integrations with databases and external services.

I have learned a lot during the development of this PWA, from implementing basic functionalities to optimizing for optimal performance. I hope you find this project interesting, and I am open to any feedback or suggestions you may have.

Thank you for your time!



vercelLinkApp: https://clientchismografo.vercel.app/

clientCodeLink: https://github.com/ROR2022/clientchismografo

serverCodeLink: https://github.com/ROR2022/serverchismografo

portfolioLink: https://prodigy-wd-05-kappa.vercel.app/#/portfolio

rorCVLink: https://docs.google.com/document/d/104ek8dOTdOU6RcDMtGT-g1T--FWxq2earIDvMZoQ79E/edit?usp=sharing
Blocking unsafe open source dependencies in pull requests with Minder and OSV.dev
Tags: opensource, security, tutorial
Published: 2024-05-29 23:07:46

Using data from the open source [OSV.dev](https://osv.dev/) project and other sources, Minder can now block pull requests that contain malicious and deprecated packages, so that they can’t inadvertently be merged into your code.

Most teams today use vulnerability scanners to find CVEs in their open source dependencies. While avoiding dependencies with known vulnerabilities is important, these scanners may neglect to flag malicious or deprecated packages that don’t have any CVEs, even though these packages may pose an even greater threat to your supply chain. 

Read the full article by Yolanda Robla & Adolfo "Puerco" García Veytia [here](https://stacklok.com/blog/blocking-unsafe-oss-dependencies-minder-osv)



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jh2w7u6hoh0bthikvafx.jpeg)
Event Listeners in Javascript
Tags: javascript, event, listeners
Published: 2024-05-29 22:35:11

Javascript is a great tool to make it so that the webpage can come alive. One way to do this in Javascript is using event listeners. Event listeners allow the user to interact with the webpage in real time. 

The event listener listens for an event to happen and then runs a callback function to do an actions. The event listener is added on an element in which an event will happen. 

The event listener is set up in a way that even if the function is anonymous it will still be run. The event listener knows to run the function in the 2nd argument when the event takes place. 

Typically the parameter of the function in an event listener is named event or e. Then an array of attributes is produced when the event happens and those items can be gathered by creating a variable that takes the target of the event and stores it.  

Some frequently used event listeners are clicks, submits, DOMcontent loaded, and buttons. So more unique and less frequently used event listeners are ones related to the mouse's location. 

An example of an event listener in Javascript can be seen below:

(In the HTML there would be a button element that had the ID of button.) 

const button= document.getElementById('button');
button.addEventListener('click', function() {
  alert('This button was clicked!');
});

What this code does is when the button is click a message appears on the top of the page that says. This page says: This button was clicked! To get out of that alert the user presses the ok button.
How to manage identical files?
Published: 2024-05-29 21:52:28

An endless cycle. Same files different names, Same files different names, Same files different names.
Thanks to ChatGPT.

```
package main

import (
	"crypto/sha256"
	"encoding/hex"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
)

func calculateFileHash(filePath string) (string, error) {
	file, err := os.Open(filePath)
	if err != nil {
		return "", err
	}
	defer file.Close()

	hash := sha256.New()
	if _, err := io.Copy(hash, file); err != nil {
		return "", err
	}

	return hex.EncodeToString(hash.Sum(nil)), nil
}

func findAndRemoveDuplicates(dir1, dir2 string) error {
	files1, err := ioutil.ReadDir(dir1)
	if err != nil {
		return err
	}

	files2, err := ioutil.ReadDir(dir2)
	if err != nil {
		return err
	}

	hashMap := make(map[string]string)

	// Process the first directory
	for _, file := range files1 {
		if !file.IsDir() {
			filePath := filepath.Join(dir1, file.Name())
			fileHash, err := calculateFileHash(filePath)
			if err != nil {
				fmt.Printf("Hash hesaplanamadı: %s, hata: %s\n", filePath, err)
				continue
			}

			if _, found := hashMap[fileHash]; found {
				fmt.Printf("Aynı dosya bulundu, siliniyor: %s\n", filePath)
				if err := os.Remove(filePath); err != nil {
					fmt.Printf("Dosya silinemedi: %s, hata: %s\n", filePath, err)
				} else {
					fmt.Printf("Dosya başarıyla silindi: %s\n", filePath)
				}
			} else {
				hashMap[fileHash] = filePath
			}
		}
	}

	// Process the second directory
	for _, file := range files2 {
		if !file.IsDir() {
			filePath := filepath.Join(dir2, file.Name())
			fileHash, err := calculateFileHash(filePath)
			if err != nil {
				fmt.Printf("Hash hesaplanamadı: %s, hata: %s\n", filePath, err)
				continue
			}

			if _, found := hashMap[fileHash]; found {
				fmt.Printf("Aynı dosya bulundu, siliniyor: %s\n", filePath)
				if err := os.Remove(filePath); err != nil {
					fmt.Printf("Dosya silinemedi: %s, hata: %s\n", filePath, err)
				} else {
					fmt.Printf("Dosya başarıyla silindi: %s\n", filePath)
				}
			} else {
				hashMap[fileHash] = filePath
			}
		}
	}

	return nil
}

func main() {
	dir1 := "C:\\Users\\Asus Rog\\go\\getfilehash\\dir1"
	dir2 := "C:\\Users\\Asus Rog\\go\\getfilehash\\dir2"
	if err := findAndRemoveDuplicates(dir1, dir2); err != nil {
		fmt.Printf("Hata: %s\n", err)
	} else {
		fmt.Println("Kopya dosyalar silindi.")
	}
}

```
Microsoft Recall - EW...
Published: 2024-05-29 21:52:08

I am not much of a privacy freak; I don't mind targeted ads and the idea of corporations selling our data (as long as there is proper transparency); however, my bones shivered hearing this new Windows feature coming to Copilot plus PCS - Windows Recall. 

Every 3 seconds, it will take a screenshot that can be used to learn how you use your PC and help you find things you previously went to. That's the paraphrasing of how it sort of works. The biggest issue is the screenshotting every 3 seconds—wtf!

First, Windows is already horrible at indexing regular files to search for something, so now it's going to use machine learning to try and search for anything you previously went to.

So for clarification, there is a blacklist of applications, and websites that you can configure, but what if a Windows update overrides it, or what if MOST Windows users aren't aware of it or don't configure anything! That's a huge privacy concern because if someone gains access to your PC, it makes their life so much easier; they don't even need your passwords anymore. 

So...am I going to tell you to switch to Linux...no

The reason is that everyone uses their computer differently; as someone whose first application he opens up is a Terminal, Windows is already disgusting for me, and once I'm done school, it is dead to me; I already drive my desktop daily POP_OS!. However, it took me a while to become proficient in Linux's quirks, and not everyone's workflows will be able to perfectly translate to Linux. 

My recommendation is to become aware of this new feature, be aware of these new "copilot plus" PCs being marketed, and if you want to switch, be ready to be open-minded and patient.
AUTOXCHNG
Published: 2024-05-29 11:32:52

In latest globalized international, overseas foreign money transactions have emerge as an crucial a part of international trade and finance. whether you're a multinational enterprise increasing your operations foreign places or an person traveling overseas, expertise how overseas foreign money transactions work is essential.

[AUTOXCHNG](https://www.circularedge.com/products/autoxchng/)

**know-how foreign foreign money Transactions**
What are overseas foreign money Transactions?

foreign currency transactions talk to the shopping for, promoting, or replacing of currencies between different international locations.

**Key players in overseas forex Transactions**
Banks: Banks function intermediaries in overseas foreign money transactions, facilitating the alternate of currencies for his or her customers.

critical Banks: vital banks play a critical position in regulating the forex marketplace and managing a country's foreign money reserves.

Forex Markets: those markets, frequently known as forex or FX markets, provide a platform for purchasing and selling currencies.

**Factors Influencing overseas foreign exchange charges**
Financial indicators

Financial signs which includes inflation, hobby fees, and GDP increase can extensively effect foreign exchange quotes. countries with strong economic fundamentals frequently have better-valued currencies.

Political balance

Political stability and geopolitical activities can cause fluctuations in forex values. Uncertainty or instability in a rustic's political panorama may result in depreciation of its currency.

Marketplace Sentiment

Investor sentiment and marketplace speculation play a crucial position in determining forex prices. positive or poor perceptions approximately a rustic's economy can impact the demand for its currency.

**Techniques for handling overseas forex danger**
Hedging

Hedging entails using economic instruments which include forward contracts or options to shield towards adverse forex actions. companies can hedge their foreign foreign money publicity to mitigate threat.

Diversification

Diversifying forex holdings across multiple currencies can help unfold risk and reduce publicity to any unmarried forex.

Timing strategies

Timing the marketplace includes executing foreign foreign money transactions at opportune moments to capitalize on favorable change costs. however, timing the market accurately requires cautious analysis and hazard control.
Moving away from class components and inheritance a Bad Idea!!!
Published: 2024-05-29 21:04:15

I've read the docs including the docs Componentisation vs inheritance, however I completely disagree, sure they say they use it on facebook and have never had the need for inheritance,  but we are talking about facebook, where the interface is so ridiculously simple,  no you more then likely wouldn't need inheritance.  Inheritance is such a powerful tool and it can be used simultaneously with componentisation, which from years of experience with react makes it even more powerful.  I'm not going to bother going into specific use cases, I have better things to do.  but if the developers of react can't foresee that other developers are trying to build things that they could not even begin to comprehend was possible with their own framework, then this framework is doomed.  this frame work in ye old days was great, it took care of the piddly crap that most developers couldn't be bothered with, but beyond that stayed out of the way.  And it was fantastic, in-fact its a great shame that more frameworks don't follow the same model.

Unfortunately react is now starting to reach the point of dictating how I should code, and hence if it continues down this path it will get in my way, and when that day comes I'd sooner ditch react,  either find another framework that does what I want, or build my own.
as for class components I prefer using classes because I think that it is the best way  to adhere to the first and most important rule of coding, keeping code structured and readable, and yes for the same reason I loath the absolute overuse of arrow notation!!!!