teleren/devto huggingface dataset:
macOS vs Ubuntu: GitHub Actions Runners
Tags: opensource, githubactions, github, os
Published: 2024-04-04 05:18:43

In case you missed it, GitHub has made macOS Runner available for open source! This means we can now use macOS Runner for free in public repositories. You can read more about it [here](https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/).

I thought it would be a great opportunity to compare the most commonly used runners - Ubuntu and macOS - and see if it's worth switching all my workflows to macOS runner.

So, the best way to test this is to run the same task on both runners and see the differences. Thus, I wrote a simple GitHub workflow to test the total time duration for a workflow using different runners. Here's the workflow I came up with:

```yaml
name: Runner Test

on:
  workflow_dispatch:

jobs:
  test:
    runs-on: macos-latest

    steps:
    - name: Print OS Information
      run: |
        echo "Operating System: $(uname -a)"
        echo "Current Directory: $(pwd)"
        echo "List of files: $(ls -l)"

    - name: Execute Script
      run: |
        echo "Running script..."
        # Add your script commands here
        echo "Script execution completed."
```

The results were as I expected: Ubuntu took the lead. For this workflow to run (for the first time), Ubuntu took **13 seconds** to complete it, whereas macOS took **43 seconds**, which is more than 3 times longer than Ubuntu. Refer to the screenshots below for reference:

macOS Runner:
![macos workflow result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40cognswgmb1mrspgboh.png)

Ubuntu Runner:
![Ubuntu workflow result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1ugrf7htf3h5qsldk00.png)

I tested multiple workflows, and not once did the macOS runner take the lead. So, the point I am trying to make is not that macOS is slow and not useful, but rather, going back to my original point and why I performed this test: Is it worth switching all my workflows to macOS, now that we have two runner options? The answer is NO.

However, this doesn't diminish the power of the macOS runner. There can be a lot of use cases, such as running Swift code or developing an Apple Silicon app and doing specific automation testing, etc., which perform way better on macOS compared to other operating systems.

Thanks for reading, and have a great day! You can also follow me on [Twitter](https://twitter.com/pradumna_saraf).
Deployment Architecture: Multiple Instances of Mistral Model in a Single GPU Server
Published: 2024-04-04 04:59:08

When developing LLM-based apps, we often encounter a constraint where Ollama with LLM model process
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kgxh5vt5s4pr40vte9eq.png)es only one request at a time, keeping other requests in the queue. While horizontal scaling of physical GPU servers hosting Ollama + LLM Model + App may be the optimal solution for production environments, it may not be feasible during product PoC time due to infrastructure costs.

To overcome this, it's crucial to perform a concurrency check of an app with LLM models and assess the number of requests that a GPU server can accommodate. Luckily, there is a solution to deploy multiple instances of Ollama + LLM Model + App in a single GPU server that can be combined with physical server horizontal scaling for production environments.

If you're facing similar constraints during your product PoC time, consider this deployment architecture to optimize your infrastructure costs. hashtag#LLMModel hashtag#GPU hashtag#DeploymentArchitecture hashtag#ProductPoC
Zonatoto Slot Online Terbaik Dan Terpercaya 2024
Published: 2024-04-04 04:57:20

[ZONATOTO : Situs Slot Gampang Menang Hari Ini](https://hypertogel.com/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pgdj1w00gtq2hca93j3t.png)
[ZONATOTO](https://hypertogel.com/) merupakan agen slot resmi yang memiliki visi dan misi selalu memberikan layanan permainan yang terbaik. Jadi para pengguna kami merupakan prioritas utama. Di sini pemain akan mendapatkan pilihan game yang beragam yang sangat menarik untuk diakses. ZONATOTO telah menyediakan beragam layanan yang maksimal dan juga permainan slot gacor dengan server luar negeri terbaik secara online. Dengan melakukan deposit yang sangat murah yaitu 10.000 tentu membuat anda bisa terhubung dengan segala jenis permainan yang menyenangkan. Sehingga dengan menggunakan modal kecil semua kalangan bisa mengakses berbagai permainannya. Buat Anda yang tidak ingin melewatkan kesempatan terbaik ini segera daftarkan secara gratis hanya di situs slot online ZONATOTO. Mainkan segala permainan menariknya sekarang juga dengan mudah.

keywords terkait :

[slot online](https://hypertogel.com/)
[judi online](https://hypertogel.com/)
[situs judi online](https://hypertogel.com/)
[slot gacor](https://hypertogel.com/)
[slot gampang](https://hypertogel.com/)
[slot terpercaya](https://hypertogel.com/)
[slot tergacor](https://hypertogel.com/)
[slot paling gacor](https://hypertogel.com/)
Any developers building complex web apps with OpenAI and nested JSON AI responses?
Tags: openai, chatgpt, webdev
Published: 2024-04-04 04:50:51

Hey everyone👋!

I've been working on integrating OpenAI into my React JS apps for about 14 months now. My main app is a pretty complex application (a no-code app development platform), so the outputs I've been looking for from AI are always JSON, often multiple layers of nesting, and little room for error in terms of formatting.

I've built a few others as well, which were simpler but had similar requirements.

I encountered a lot of roadblocks and ended up coming up with my own custom solutions / internal tools to make things work well.

I'm just curious if anyone out there has been going through any of the same problems and wants to discuss different solutions?

My personal issues fall into these categories:

**JSON Formatting**
Ensuring AI predictably responds in my custom JSON format. OpenAI's function calling helped a ton with this, but didn't solve everything on it's own without the other things below (it still fails and returns invalid results, often).

**Validation / Auto-Retry**
I had to build a system to validate all AI responses, and then auto-retry up to X times hoping to get a valid response. This does of course increase the cost significantly if there are multiple failures, but I don't think there's any way around this one.

**Request Timeout Limit**
I use Heroku for my front-end and it maxes at 30 seconds. From my research it seems like this is pretty common. Since AI responses could be very long-running, I ended up having to hack together a combination of a Websocket, Amazon API Gateway and Lambda function to accomplish a system free of request timeout limitations. Has anyone dealt with this in a better / easier way? Am I missing something 🤣?

**Chaining Multiple Requests**
After a lot of trial and error, getting frustrated with the AI responses being really inconsistent, I came to the conclusion that if you give AI one clear task, it will probably do it well, but if you give it lot of different tasks and things to consider at the same time, it's likely to mess up one or more of those things.

This isn't a 'challenge' in the same way the others were, since I think my solution is pretty good, but the hard part is deciding on where to 'split up' your desired result into different data structures and then how to pass that into the next step as context. This is very time-consuming.

Anyway, happy to chat and interested to hear about your solutions or challenges in these areas or other related ones!
Zonatoto Slot Online Terbaik Dan Terpercaya 2024
Published: 2024-04-04 04:47:00

[ZONATOTO : Situs Slot Gampang Menang Hari Ini
](https://hypertogel.com/)

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

[ZONATOTO](https://hypertogel.com/) merupakan agen slot resmi yang memiliki visi dan misi selalu memberikan layanan permainan yang terbaik. Jadi para pengguna kami merupakan prioritas utama. Di sini pemain akan mendapatkan pilihan game yang beragam yang sangat menarik untuk diakses. ZONATOTO telah menyediakan beragam layanan yang maksimal dan juga permainan slot gacor dengan server luar negeri terbaik secara online. Dengan melakukan deposit yang sangat murah yaitu 10.000 tentu membuat anda bisa terhubung dengan segala jenis permainan yang menyenangkan. Sehingga dengan menggunakan modal kecil semua kalangan bisa mengakses berbagai permainannya. Buat Anda yang tidak ingin melewatkan kesempatan terbaik ini segera daftarkan secara gratis hanya di situs slot online ZONATOTO. Mainkan segala permainan menariknya sekarang juga dengan mudah.


keywords terkait : 

[slot online](https://hypertogel.com/)
[judi online](https://hypertogel.com/)
[situs judi online](https://hypertogel.com/)
[slot gacor](https://hypertogel.com/)
[slot gampang](https://hypertogel.com/)
[slot terpercaya](https://hypertogel.com/)
[slot tergacor](https://hypertogel.com/)
[slot paling gacor](https://hypertogel.com/)
Java-backed interview preparation: 8+ years of experience
Tags: interview, backenddevelopment
Published: 2024-04-04 04:15:46

Hello All, 
Thank you for visiting my blog. I am java backend engineer. And i am preparing for my interview.

Below are list of topic which i prepared :

1. Core Java
2. Java 8
3. Spring (Spring Boot, JPA)
4. SQL 
5. DSA 
6. OOPS
7. SOLID
8. Design Patterns
9. LLD  

Each are the main topic which has many subtopics will go one by one with them.

Will see them in next blog.
Tutorial para Devs Iniciantes [Dicas]
Tags: webdev, tutorial, braziliandevs, beginners
Published: 2024-04-04 04:09:57

Neste tutorial, irei listar dicas para pessoas desenvolvedoras iniciantes:

## Atualize-se 
- Estude lógica de programação.
- Leia livros clássicos.
- Estude conceitos e boas práticas.
- Busque conteúdos de referências da área.
- Escreva artigos, como o Dev Community @thepracticaldev 
- Estude Clean Code.
- Assista canais do YouTube com exercícios práticos.
- Defina um Cronograma de Estudos.
- Utilize roadmaps.
- Escolha uma playlist que ajude na concentração.
- Desenvolva HTML Semântico.
- Programe utilizando boas práticas.
- Mantenha seu portfólio atualizado.

## Conecte-se com a comunidade dev
- Participe de comunidades tech.
- Contribua em projetos open source.
- Comunique-se em redes sociais para devs.
- Participe de eventos, meetups, bootcamps, imersões e formações presenciais.
- Compartilhe seu conhecimento com a comunidade dev.
- Busque grupos de estudo.
- Faça networking com devs de diferentes senioridades e áreas.
- Apoie o trabalho de devs e comunidades tech.

## Utilize novas ferramentas 
- Busque mentorias.
- Disponibilize seus projetos no GitHub. 
- Ouça podcasts.
- Assine newsletters com notícias da área.


Recomende essas dicas para uma pessoa dev. 

👩🏽‍💻
Ana Maria | @anamaria
dev.to/anamaria
[www.anamaria.dev.br](htts://www.anamaria.dev.br)
🚀 API Maker : Release Notes for v1.5.0
Tags: apimaker, development, backenddevelopment, javascript
Published: 2024-04-04 04:07:03

## ⭐ April 2024 ⭐

### Changes

- **[Feature] :** Vulnerability tracking feature added. It will give list of all vulnerabilities of API Maker itself and all the packages used in sandbox environment.
- **[Improvement] :** getToken API generate data will have “u” and “p” fields.
- **[Improvement] :** collection rename should also rename schema for mongodb.
- **[Improvement] :** /token system api will also consider authorization. by default, it will be public as earlier but if settings are provided then they will be applied.
- **[Improvement] :** Vulnerability related code improvements
- **[BUG] :** Schema structure validation was not allowing to save string array when validation was present issue fixed.
Devs, roast my landing
Tags: webdev, saas, react, discuss
Published: 2024-04-04 03:57:36

Hey,

I recently launched a new **SaaS kit** (already a crowded space but wanted to give it a try), it's aim is to reduce development time for a micro SaaS project by providing all the necessary features needed to quickly bootstrap a working prototype of the idea. Tech-stack (React, Next.JS, Prisma, Postgres).

Hopefully, with some marketing strategies, it could gain some traction and some revenue, as the kit offers some features not provided by other competitors especially in the tech stack that it is built on.

Here is the landing page. Looking forward to any suggestions, improvements I should add in the copy/ design of the site to make it more appealing.

https://www.codepilot.dev/
Checking file signature while processing stream in C#
Tags: csharp, dotnet
Published: 2024-04-04 03:15:10

While you are processing a stream, if you can read and seek on it, you can read the beginning of it, test if it has the desired signature (and maybe throw an error here), rewind it, to then do whatever you want with it.

Here’s an example of an API that takes an upload and saves it locally if (and only if) it’s a PNG:

```
var app = WebApplication.Create();

app.MapPost("/", (IFormFile content) =>
{
	using var stream = content.OpenReadStream();

	if (!IsPng(stream))
    	throw new Exception("The given file is not a PNG.");

	using var fileStream = new FileStream(content.FileName, FileMode.Create, FileAccess.Write);

	stream.CopyTo(fileStream);
})
.DisableAntiforgery();

app.Run();

bool IsPng(Stream stream)
{
	if (!stream.CanRead)
    	throw new Exception("Cannot read stream.");

	if (!stream.CanSeek)
    	throw new Exception("Cannot seek stream.");

	if (stream.Position != 0)
    	throw new Exception("Stream is not at the beginning.");

	var pngSignature = new byte[] { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A  };
	var len = pngSignature.Length;

	var streamBytes = new byte[len];
	stream.Read(streamBytes, 0, len);
	stream.Position = 0;
    
	return Enumerable.SequenceEqual(pngSignature, streamBytes);
}
```

Just run `dotnet new webapi`, replace the contents of `Program.cs`, then run it with `dotnet run`. Perform a request with `curl --location 'http://localhost:5108' --form 'content=@"/path/to/your/file.png"'`.

If you need a compiled list of file signatures, take a look at [Wikipedia list](https://en.m.wikipedia.org/wiki/List_of_file_signatures) and [Gary Kessler’s page](https://www.garykessler.net/library/file_sigs.html).

There is also [FileTypeChecker](https://github.com/AJMitev/FileTypeChecker/blob/8632b74/FileTypeChecker/Abstracts/FileType.cs#L77-L91) and [FileSignatures](https://github.com/neilharvey/FileSignatures/blob/0f5193c/src/FileSignatures/FileFormatInspector.cs#L68-L102) libraries. Their approach is pretty similar, read, check, then rewind.
My own design
Tags: cloudflarechallenge, ai
Published: 2024-04-04 02:24:03

*This is a submission for the [Cloudflare AI Challenge](https://dev.to/devteam/join-us-for-the-cloudflare-ai-challenge-3000-in-prizes-5f99).*

## What I Built

<!-- Tell us what your app does! -->

## Demo

<!-- Share a link to your deployed solution on Workers or Pages, and add a screenshot or video embed of your app here. -->

## My Code

<!-- Show us the code! Share a public link to your repo and be sure to include a README file with installation instructions. We also encourage you to add a license for your code.  --> 

## Journey

<!-- Tell us about your process, the task types and models you used, what you learned, anything you are particularly proud of, what you hope to do next, etc. -->

**Multiple Models and/or Triple Task Types**

<!-- Let us know if your project utilized multiple models per task and/or if your project used three or more task types. If so, you may qualify for our additional prize categories! If not, please remove this section. -->

<!-- Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. -->

<!-- Don't forget to add a cover image or an additional tag to this post (if you want). -->

<!-- Thanks for participating! -->
FESTO i4.0 Cyber Physical System Demo
Tags: automation, robotics, festo, didactic
Published: 2024-04-04 02:22:58

I normally prefer to be behind the camera, but as part of my work with Didactic Services, I often run international training and demonstrations, of our flagship product range. Festo i4.0 Cyber Physical System.

Training on these systems requires days of work, in Robotics, Compliant Robotics, Mobile Robotics, PLCs, Sensor Technology, Communication protocols, Networking and MES/ERP systems. 

It can get quite heavy quickly.

However last year I had the pleasure of recording the following video series, to explain the system I installed at GBS IOT in Birmingham, UK

{% embed https://www.youtube.com/watch?v=f5hhcyumZsU %}

---

The video series also features smaller videos, on each section of the system

### CP Lab

{% embed https://www.youtube.com/watch?v=AdfwlR0WaTY %}

### CP Factory (Warehousing)

{% embed https://www.youtube.com/watch?v=CzInC-A62Fw %}

### CP Factory (Robotics)

{% embed https://www.youtube.com/watch?v=DHfpAqfaj_k %}

### Mobile Robotics, Path Planning, AGVs

{% embed https://www.youtube.com/watch?v=vwKRMUDweW4 %}
Realtime Visualisation of IO-Link Vibration data using MQTT, grafana, influxdb, and Godot
Tags: grafana, mqtt, godot, iolink
Published: 2024-04-04 01:57:15

For an upcoming project, I wanted to explore the capabilities of a vibration sensor, and to see if i could develop some realtime visualisation.

**I had only 1 morning to experiment, so this is the result of some quick prototyping**

{% embed https://youtu.be/65hlRJdKFyM %}


### Stack

#### Hardware
The sensor is a [VVB001](https://www.ifm.com/gb/en/product/VVB001)

The [IFM AL1350](https://www.ifm.com/gb/en/product/AL1350) pushes data via MQTT to a broker.

#### Software 
For this demo I used Aedes internally in node-red to serve as the broker.

{% embed https://github.com/martin-doyle/node-red-contrib-aedes %}

Node red then manipulates the raw byte data, scales it according the the required values, and re-publishes it on a seperate broker, and also simultainiously publishes it via HTTP request to....

[InfluxDB](https://docs.influxdata.com/influxdb/v2/) V2 is used to store the data for long term analysis / futre playback.

[Grafana](https://grafana.com/) is used for the web-based realtime visualisation, using the [Grafana MQTT](https://github.com/grafana/mqtt-datasource) live datasource plugin. (we subscribe to the republished MQTT streams

> Sidenote - this is a bit of a pain to install, and requires way more build tools than I expected!


#### Game Engine

I am using Godot, a capable 3D engine, to subscribe to the same MQTT topics, and visualise.

For future reference, Plugins used in this demo video include.

{% embed https://github.com/LD2Studio/godot4-graph2d %}

{% embed https://github.com/goatchurchprime/godot-mqtt/ %}
#some important packages of Express
Tags: webdev, express, javascript, beginners
Published: 2024-04-04 01:31:04

1.nodemon
nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected.

nodemon does not require any additional changes to your code or method of development. nodemon is a replacement wrapper for node. To use nodemon, replace the word node on the command line when executing your script.

Installation
Either through cloning with git or by using npm (the recommended way):
npm install -g nodemon # or using yarn: yarn global add nodemon

2.morgan
NPM Version NPM Downloads Build Status Test Coverage

HTTP request logger middleware for node.js

Named after Dexter, a show you should not watch until completion.

API
var morgan = require('morgan')
morgan(format, options)
Create a new morgan logger middleware function using the given format and options. The format argument may be a string of a predefined name (see below for the names), a string of a format string, or a function that will produce a log entry.

The format function will be called with three arguments tokens, req, and res, where tokens is an object with all defined tokens, req is the HTTP request and res is the HTTP response. The function is expected to return a string that will be the log line, or undefined / null to skip logging.

3.mongoose
TypeScript icon, indicating that this package has built-in type declarations

Mongoose
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Mongoose supports Node.js and Deno (alpha).

Build Status NPM version Deno version Deno popularity

npm

Documentation
The official documentation website is mongoosejs.com.

Mongoose 8.0.0 was released on October 31, 2023. You can find more details on backwards breaking changes in 8.0.0 on our docs site.
Pi-hole en Linux | Instalación & Configuración
Published: 2024-04-04 01:03:17

Pi-hole es un software diseñado para funcionar como un sistema de bloqueo de anuncios y rastreadores en una red. Se ejecuta en un servidor local y actúa como un filtro DNS, bloqueando solicitudes de dominios conocidos por ser utilizados para publicidad, rastreo y malware. Pi-hole puede instalarse en sistemas como Raspberry Pi u otros dispositivos compatibles con Linux.

**Características:**
- Bloqueo de anuncios: Evita que los anuncios se carguen en los dispositivos de la red.
- Bloqueo de rastreadores: Impide que las empresas recopilen datos sobre el uso de Internet.
- Protección contra malware: Bloquea dominios conocidos por distribuir software malicioso.
- Estadísticas detalladas: Proporciona información sobre el tráfico de red y los dominios bloqueados.

**Ventajas:**
- Mejora la velocidad de navegación: Al bloquear anuncios y rastreadores, las páginas web pueden cargar más rápido.
- Protección de la privacidad: Evita que las empresas recopilen datos personales a través de la navegación en línea.
- Fácil de instalar y usar: Pi-hole se puede configurar con relativa facilidad y requiere poca intervención una vez instalado.
- Personalización: Permite a los usuarios agregar o eliminar listas de bloqueo según sus preferencias.

**Desventajas:**
- Posibles falsos positivos: En ocasiones, Pi-hole puede bloquear dominios legítimos, lo que podría afectar la funcionalidad de algunos sitios web.
- Requiere mantenimiento: Aunque la configuración inicial es sencilla, puede requerir actualizaciones y ajustes periódicos.
- No bloquea todo el contenido no deseado: Aunque bloquea muchos anuncios y rastreadores, no es infalible y puede dejar pasar algunos elementos no deseados.

Instalar: 
Para poder instalar este 

```
curl -sSL https://install.pi-hole.net | bash
```