teleren/devto huggingface dataset:
Deploy a FastAI model with FastAPI
Published: 2023-06-21 18:57:02

---
title: Deploy a FastAI model with FastAPI
published: true
description: How to deploy a FastAI model with FastAPI
---

Hello everyone 👋,

In this quick post I'll show you how to deploy a FastAI model using FastAPI.

It's a follow-up to my previous post from [here](https://blog.nuculabs.dev/posts/2023/2023-06-20-fast-ai-gpu-support/) and it is partially based on this FastAI lecture:

https://www.youtube.com/watch?v=F4tvM4Vb3A0

[You can read the full post on my blog.](https://blog.nuculabs.dev/posts/2023/2023-06-21-fastai-model-deployment-fastapi/)
Golang Building from Source
Tags: go
Published: 2023-06-21 18:56:26

I have been working on a research project which involves Garbage collection mechanism in Golang. We have successfully built Golang from source code. Now, we are trying to add minor modifications in the source code and see if build succeeds or not. As a starter, we have added a log print  in `mgc.go` file  in function `gcinit` at the very beginning

`func gcinit() {
	log.Print("In Function GCINT ")
....................................................................................................................
}`

After adding the log print, the build fails with the following error:
`In Function GCINIT 
            In Function GCINIT shift.go:12:6: (i8 + 1) (8 bits) too small for shift of 8
FAIL
FAIL    cmd/vet    9.460s
FAIL
go tool dist: Failed: exit status 1`

We have tried to use `fmt.printf` but no luck so far. We will be happy if someone can help
How to Set up a Local mysql Docker and View it using TablePlus
Published: 2023-06-21 18:50:50

Create an empty folder. Open the folder. 

Create two files: `docker-compose.yml` and `docker.env`.

In `docker-compose.yml` file: 
```docker
version: "3.7"
services:
  db:
    image: mysql:8.0.33
    env_file: docker.env
    ports:
      - "3306:3306"
```
Then in `docker.env` file: 

```text
MYSQL_ROOT_PASSWORD=pass
MYSQL_DATABASE=mydb
DB_NAME=mydb
DB_HOST=db
```

Make sure docker is opened. Run

```bash
docker compose up --build 
``` 

Now your mysql instance is running with connection string `mysql://root:pass@127.0.0.1:3306/mydb`. 

To view the database, open TablePlus, create a new connection with above connection string.
sFlow akışının izlenmesi ve takibi
Tags: sflow, nfdump, sfcapd
Published: 2023-06-21 18:37:32

Daha önceki [yazımızda](https://dev.to/aciklab/ornek-sflow-verisi-olusturma-18h3), sFlow verisinin üretilmesini öğrenmiştik. Şimdi bu verinin veya kurumsal bir ürünün sFlow akışını kontrol etmek için bir yöntem uygulayacağız.

# sFlow akışının yakalanması

sFlow akışının yakalanması için öncelikle sFlow trafiğinin doğru bir şekilde yönlendirilmiş olması gerekmektedir. Bu yönlenme doğru ise öncelikle nfdump-sflow paketinin yüklenmesi gerekmektedir.

```bash
sudo apt install nfdump-sflow
```

Bu paketin yüklenmesi ile birlikte artık trafik yakalanabilmektedir. Bunun için hangi port üzerinden trafik izleniyor ise aşağıdaki komut ile birlikte örneğin 6343 portundan izlenmeye başlanabilmektedir.

```bash
sudo mkdir -p /opt/nfdumps/
sudo sfcapd -w -D -l /opt/nfdumps/ -p 6343
```

Bu komut çalıştırılırken verilen yol, trafik akışının dosya olarak kaydedileceği bir yolu vermektedir.

Bu adımla birlikte sFlow akış verisi var ise dosya içerisine veriler yazılmaya başlanacaktır.

# Akış verisinin okunması

Kaydedilen dosyaların okunabilmesi için aşağıdaki komut kullanılabilmektedir.

```bash
sudo nfdump -r /opt/nfdumps/nfcapd.202306212100 
```

Bu komut ile birlikte UDP paketleri üzerinden trafik verileri izlenebilmekte ve kontrol edilebilmektedir.

```
2023-06-21 21:04:15.517 INVALID  Ignore UDP      176.235.76.17:443   ->     192.168.1.43:56313          0.0.0.0:0     ->          0.0.0.0:0        1.3 M        0
2023-06-21 21:04:45.515 INVALID  Ignore UDP      176.235.76.17:443   ->     192.168.1.43:56313          0.0.0.0:0     ->          0.0.0.0:0        1.3 M        0
2023-06-21 21:04:45.515 INVALID  Ignore UDP      176.235.76.17:443   ->     192.168.1.43:56313          0.0.0.0:0     ->          0.0.0.0:0        1.3 M        0
Summary: total flows: 38, total bytes: 42.0 M, total packets: 38000, avg bps: 1.2 M, avg pps: 140, avg bpp: 1105
Time window: 2023-06-21 21:00:14 - 2023-06-21 21:04:45
Total flows processed: 38, Blocks skipped: 0, Bytes read: 5760
Sys: 0.002s flows/second: 17560.1    Wall: 0.000s flows/second: 51282.1   
```
Bienvenido a tu camino Dev.
Tags: coach, developer, productivity, community
Published: 2023-06-21 18:13:56

"Estás a punto de comenzar o ya estás en el emocionante camino Dev y estoy aquí para brindarte apoyo y ayudarte a alcanzar tus metas. Juntos, trabajaremos para convertirte en el Dev excepcional que estás destinado a ser."
How to implement facebook api conversions with nextjs 13??
Published: 2023-06-21 18:12:09

I made a website for a client, using nextjs 13, and he wants to advertise on facebook ads, but for that we need to use the facebook pixel and the conversions API to collect user data. I implemented the pixel following the example of the vercel repository. But I haven't found an easy way to implement Facebook API conversions. I used the following @rivercode/facebook-conversion-api-nextjs package following the instructions in the documentation, but I'm not sure it's working, it doesn't seem to be.

There's any easy way implement it in next or maybe some integration in vercel deployment?? Someone can help me??
Wednesday Links - Edition 2023-06-21
Tags: springboot, spring, graalvm, java
Published: 2023-06-21 17:50:28

Docker Compose Support in Spring Boot 3.1(3 min)📦
https://spring.io/blog/2023/06/21/docker-compose-support-in-spring-boot-3-1

Spring Boot 3.1's ConnectionDetails abstraction(3 min)🔌
https://spring.io/blog/2023/06/19/spring-boot-31-connectiondetails-abstraction

A New GraalVM Release and New Free License!(11 min)🏆
https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5
My first python program c:
Tags: beginners, python, programming, portfolio
Published: 2023-06-21 17:16:57


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/91bgsej0us0usbdq6zsg.gif)


I made this program for a course on codecademy. It was my first program using python (or any other language) and even tho it might be a simple one, i am very proud of it. Because i did not google for nothing apart from one or other syntax ;P and i got help from someone at the last commit, as i say in the commit comment.

Here goes the github link:

https://github.com/Shizukise/slot-machine-terminal-game


The code itself is a simple one. I used the random module to get a list of 3 different numbers and after i made a function to translate those numbers to symbols. Symbols that were atached to the allowed numbers on a dictionary.(Being the symbol the key and the number the value.)
then i made a class to hold a player name and balance that we take from inputs and to define a method to give a litle welcoming c:
The biggest challenge was the game class itself and the for loop that came after. The class holds a player and its balance. And then the place bet method. this method takes the player balance.

Lastly we make a for loop inside a while function to keep iterating while the count variable is higher than 0. this variable is taken from an input also.
while this is true, we iterate trough the range from 0 to count and for each iteration we call the play and slotrow variables that hold the random function and we call the place bet method. The place method takes the amout being bet and if the balance is enough the bet will be made returning 2 times the value of the bet in case of 3 equal symbols, 1.5 times the value of the bet in case of 2 equal symbols, and taking the bet ammount from the player balance in case of 3 different symbols.

It could be prettier in the terminal but apart from that i am really happy from this and looking forward to keep learning :D
The Power of HTML, CSS, and JavaScript: The Building Blocks of the Modern Web
Tags: webdev, javascript, beginners, programming
Published: 2023-06-21 17:11:28

As a web developer, few technologies are as essential to my work as HTML, CSS, and JavaScript. These three core technologies form the foundation of the modern web and are used to create and develop websites and web applications of all shapes and sizes.

## HTML

HTML, or Hypertext Markup Language, is a markup language that is used to structure and organize content on the web. It defines the different elements that make up a webpage, such as headings, paragraphs, and links, and provides a basic structure for the content on a page. HTML uses a system of tags and attributes to define the different elements on a page and to provide metadata about those elements. For example, the `<h1>` tag is used to define a level-one heading and the `<p>` tag is used to define a paragraph of text.

## CSS

CSS, or Cascading Style Sheets, is a stylesheet language that is used to control the appearance and formatting of the content on a webpage. It allows developers to define the styles, colors, fonts, and layout of a page, and to apply those styles consistently across multiple pages and devices. CSS uses a combination of selectors and rules to apply styles to the elements on a page and to create visual hierarchies and layouts that are consistent across different devices and screen sizes. For example, the `font-size` property can be used to control the size of the text on a page, and the `display` property can be used to control the layout of an element.

## JS

JavaScript is a powerful programming language that is used to add interactivity and dynamic behavior to a webpage. It allows developers to create user interfaces, handle user input, and manipulate the content on a page in real-time. JavaScript code is executed by the web browser and can interact with the HTML and CSS on a page to create complex and interactive web experiences.

## Impact of all three together

Together, HTML, CSS, and JavaScript form the core of the web development process. They are constantly evolving and being updated, with new features and capabilities being added all the time. As a professional web developer, staying up-to-date with these technologies is essential to my work, and I make sure to keep my skills sharp and my knowledge current.

## Conclusion

In conclusion, HTML, CSS, and JavaScript are powerful technologies that are essential to the modern web. They provide the structure, formatting, and interactivity that are needed to create engaging and dynamic web experiences, and are constantly evolving and being updated. Whether you are just starting in web development, or are an experienced developer looking to improve your skills, understanding these technologies is crucial to success in the field.
Circular ⭕ dependency exceptions in Spring❗
Tags: spring, springboot, java, exception
Published: 2023-06-21 16:48:42


## Issue?

When two beans are waiting for each other to be created in the spring context so that autowiring can happen, this state is called as **Circular Dependency** and we get the `BeanCurrentlyInCreationException` exception.

Scenario, lets say BeanA is defined as below
```java
@Component 
class BeanA{

@Autowired // here BeanA is depends on BeanB
public BeanB bean;

}
```

Now lets say we have BeanB as below
```java
@Component 
class BeanB{

@Autowired // here BeanB is depending on BeanA
public BeanA bean;

}

```

So there is dependency between two components resulting in circular dependency as each bean is waiting for its dependent bean to created for autowiring.

## Solution

Developer should be careful while creating the Beans, making sure there are no circular dependency. But is worst case if there exists case or by mistake some developer put the circular dependency then we can follow below to resolve this.


### Use setter injection instead of constructor injection

We can use the setter injection in one of class for dependent bean, so that injection is happed after one object is created avoiding the race condition.

### Use Lazy initialization on beans

We can use `@Lazy` annotation on one of the bean in circular dependency so that one of bean creation is delayed until bean is actually required.

### Refactor code to remove circular dependency

We should avoid creating such circular dependency in first place, and refactor code respectively to remove the circular dependency.

---
Diagram editor dgrm.net / Announcement / Improved mobile support
Tags: webdev, javascript, programming, startup
Published: 2023-06-21 16:44:31

[dgrm.net](https://dgrm.net/)


![diagram fit to screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xdp5f3z3crdr43b9uv9v.png)
_Pic. Diagram fits the screen when opened_

I improved mobile support.
- No more misclicks. On mobile: before moving the shape you have to click on it to activate.
- Now mobile zooming is as it must be. Just try it yourself.
- Now when opened, the diagram scales to fit the screen. You see the whole diagram on opening. [Try it](https://app.dgrm.net/?k=2023067b887a2a).

I’m adding new features to the editor.
Announcements on Twitter: https://twitter.com/boyko_tech
Анонсы в Telegram: https://t.me/dgrm_net
Autoincrement en Oracle
Tags: oracle, database, backend
Published: 2023-06-21 16:41:48

Consideremos el _script_ original, basado en la versión 11g:

```sql
---------
-- 11g --
---------
CREATE TABLE ORDERS (
	ID NUMBER NOT NULL,
	...
);
/

ALTER TABLE ORDERS 
ADD CONSTRAINT PK_ID PRIMARY KEY (ID);
/

CREATE SEQUENCE SEQ_ORDERS
 START WITH     1000
 INCREMENT BY   1
 NOCACHE
 NOCYCLE;
/

CREATE OR REPLACE TRIGGER TRG_I_ORDERS
BEFORE INSERT
   ON ORDERS
   FOR EACH ROW
BEGIN
   :NEW.ID = SEQ_ORDERS.NEXTVAL
END;
/
```
Anteriormente, se empleaba un _trigger_ para incrementar el **ID**: recuperar el valor de un _sequence_ y asignarlo al campo. 

---

Desde la versión 12c, obtenemos la misma funcionalidad con **IDENTITY Column**.
```sql
---------
-- 12c --
---------

CREATE TABLE ORDERS(
    ID NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    ...
);
/
```

---

## Documentación

[Oracle:Database:identity_clause](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/CREATE-TABLE.html#GUID-F9CE0CC3-13AE-4744-A43C-EAC7A71AAAB6__CJAECCFH)
Attitude is everything in tech
Tags: community, codenewbie
Published: 2023-06-21 16:39:45

A cornerstone philosophy in my local tech community is “Attitude is everything”.

**TLDR: A successful attitude in tech is contingent upon your resilience to failure, how you treat yourself (actions reflect mindset), and willingness to run your own race.**

From being the optimistic person on a team to being able to persevere while failing constantly. It’s the mindset that “Progress is progress no matter how small”.

You have to have patient persistence to:
- Being willing to work through those frustrated moments.
- Being determined to succeed regardless of recognition.
- Celebrate our little wins rather than marking down failures for impossible tasks that allows us to be reasonable in our goals and achievements.


My personal story is I was part of a team that won a DigitalOcean international virtual hackathon. I say this to bring up the previous dozen hackathons I lost before finally winning one. Losing a lot in the past helped set me up for success in the future. I had to learn loads of valuable lessons, build up my resilience to keep going, and to discover a better “WHY” to compete.

The point of sharing this experience is: 
- Failure will and has always been the best teacher.
- We have to seek progress over perfection, in order to create a positive perspective. Even in the face of failure, acknowledge that you are on a long road to success.

The "blocker" many people experience in life is often their own mentality whether they engage in self-sabotage or simply self-negating feelings that rob you of your power. You have to remember that there are no ups without the downs. Those negatives can be learning opportunities. Someone once told me, “Stop letting JC beat JC”. It was the truth, we can be our worst enemy. 

A lot of advice boils down to the quote, “Don't compare your chapter 1 to someone else chapter 10. Run your own race”. Yes, admire and learn from others' good fortune. But every path is unique and you only know the public story of their success, not the dirty secret of failures or help they received. So much in life depends on luck and preparation when it happens. So keep preparing for your chance in the light and don’t envy others. 

A friend of mine share two thoughts on having a can-do attitude:

1. There are numerous stories of people with sudden rags-to-riches experiences that turn into riches-to-rags which have a lot to do with our mental state. Your actions will reflect the mindset you have. A person who blows a multi-million dollar windfall is often a person who never accepted they were worth having it in the first place. What you value, you'll cherish.
2. The credo,  "Anything anyone else has done, that I want to do, I can do."
Day 1 : Installation and Create my first react app
Tags: beginners, react, tutorial, 30daysofcode
Published: 2023-06-21 16:36:35

Today was the first day of my challenge. I started my challenge by watching the playlist tutorial of "CodeWithHarry". I finished 2 videos of React JS. At first, I installed the required software and pulgins. Then created my first react app using create-react-app. While learning I also know the difference between npm and npx. Also got some knowledge about State and Probs.
ExpressVPN lanza un nuevo servidor en Nápoles para celebrar el 'Scudetto'
Published: 2023-06-21 15:54:19

La reciente victoria del Nápoles en el campeonato de la Serie A le ha valido al muy querido equipo italiano su primer scudetto desde la década de los 90. Esta [nueva](https://regulacionresponsable.es) ubicación de VPN es un homenaje, en conmemoración a la impresionante victoria del Società Sportiva Calcio Napoli y a la briosa ciudad a la que representan. Han tenido que pasar 33 largos años... Pero el [scudetto](https://diarioalbacete.com) ha vuelto a Nápoles.
Open-source, MIT UI library
Tags: webdev, javascript, npm, opensource
Published: 2023-06-21 15:50:44


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rgtozpl1cwjgst13ff0c.png)
Hello all! We at [Skiff](https://skiff.com) have released our open-source component library Skiff UI for building cross platform privacy-first apps.

The library is MIT licensed and has a new NPM package for you to easily install and use in any project.

NPM package: https://www.npmjs.com/package/@skiff-org/skiff-ui

Documentation site: https://skiff.com/ui

GitHub repository: https://github.com/skiff-org/skiff-ui

CodeSandbox: https://codesandbox.io/s/button-example-rfp4jn
Tempel Group celebra sus 45 años de trayectoria profesional
Published: 2023-06-21 15:47:14

Durante la convención, el [CEO](https://diarioalbacete.com) de la empresa, Pedro Peña, ha repasado la trayectoria de la empresa desde sus inicios y ha explicado las nuevas líneas de negocio proyectando un futuro más tecnológico que [nunca](https://regulacionresponsable.es) a través de los 13 países donde tiene presencia.
eDriving ayuda a las flotas a reducir el impacto medioambiental con EcoDrive powered by Greater Than
Published: 2023-06-21 15:46:24

eDrivingSM, una empresa de Solera y proveedor líder mundial de soluciones digitales de gestión de riesgos de los conductores, ha anunciado la disponibilidad mundial de su función EcoDrive impulsada por Greater Than ([GREAT](https://diarioalbacete.com):ST), un proveedor mundial de tecnología que convierte los datos de GPS en análisis y puntuaciones de gran impacto para los conductores. La integración de EcoDrive en la galardonada aplicación digital de seguridad del conductor MentorSM de [eDriving](https://regulacionresponsable.es) permitirá a eDriving apoyar aún más a sus clientes globales en la consecución de sus objetivos de seguridad y sostenibilidad.
How to access ts files in specific directory ?
Published: 2023-06-21 15:42:26

Hi everyone, would you mind if I ask for your assistance? Currently, I'm trying to import `environment.ts` into index.js for my project's structure, but I seem to be having some difficulty with it. Would you happen to have any suggestions or advice on how I could successfully accomplish this task?

project
  |--.vscode
  |--ckeditor5
      |--node_modules/..
      |--src/..
            |--index.js
      package.json
      package-lock.json
      webpack.config.js
  |--src
      |--node_modules/..
      |--app/..
      |--assets/..
      |--environments
            |--environment.ts
     |--package.json
project building is always longer than it seems to be
Tags: typescript
Published: 2023-06-21 15:41:33

Creating a personal e-commerce was something that was to be expected to be a shorter task, but it surprisingly takes some time, since you start to realize it needs lots of features to go the perfect way. Having no reliable free databases hostings at hand makes the job a little harder, but becomes a new challenge and way of learning all the way through.

Gotta say, despite all the difficulties, it's really nice!
Como utilizar a ferramenta de UM
Tags: veracode, security, beginners, tutorial
Published: 2023-06-21 15:36:35

**Requisitos**
Para utilizar a ferramenta, que está disponível no [GitHub](https://github.com/IGDEXE/Veracode-UM-V), precisamos instalar duas ferramentas, o HTTPIE e a Veracode-Api-Signing. 
Uma forma fácil de fazer isso é por meio do PIP:
```
pip install httpie
pip install veracode-api-signing
```

Como a ferramenta foi escrita em Powershell, é possível utiliza-la em Windows, Linux e Mac. Caso esteja fora do Windows, basta fazer a instalação do Powershell.

Para facilitar a autenticação, recomendo que crie um [arquivo de credenciais](https://dev.to/m3corp/configurando-o-arquivo-de-credenciais-3c0k) e utilize um usuário com as roles de Administrador ou de Team Admin. 

**Objetivos e estruturas**
Essa ferramenta foi desenhada para automatizar o processo de criação e administração de usuários:
- Permite a criação com base num arquivo CSV
- Alterar conjunto de roles
- Bloquear e deletar usuários

Utiliza um sistema de LOGs simples e templates JSON. 
Para os conjuntos de roles, pensamos em alguns tipos de usuários:
- Desenvolvedor - Plugin na IDE e visualizar resultados
- QA - Visualizar resultados
- SOC - Visualizar resultados, manipular politicas e recursos
- DEVOPS - Visualizar resultados, manipular politicas e recursos
- BLUETEAM - Visualizar resultados

**Criando um usuário**
Começamos pela edição do template, disponível em [Templates/template.csv](https://github.com/IGDEXE/Veracode-UM-V/blob/main/Templates/template.csv), onde vamos criar um novo conforme o padrão:
```
﻿Nome;Sobrenome;Email;Cargo;Time;NovoTime
Joao;Silva;m@mail.com;Desenvolvedor;DEVs;Sim
```

Para utilizar o script precisamos, depois de ter feito a configuração inicial, chamar o script na linha de comando:
```
./newUser.ps1 ./template.csv
```
Basicamente, apenas chamamos o script e passamos como parâmetro o caminho do nosso CSV.

O script vai verificar se foi solicitada a criação de um novo time e se o que está na lista já existe. Depois dessa validação, vai fazer a criação do usuário conforme as informações.

**Atualizando as roles**
Como identificador do usuário, vamos utilizar seu email.
Conforme nosso template de roles, podemos mover o usuário de um padrão para o outro. Em nosso exemplo, criamos um desenvolvedor, mas agora vamos altera-lo para SOC:
```
./updateRoles.ps1 "m@mail.com" "SOC"
```
Precisamos apenas chamar o script, passando primeiro o email e depois qual o conjunto que queremos.

**Bloquear ou Deletar**
O processo para as duas ações é basicamente o mesmo, então vamos tratar numa única seção. Precisamos apenas passar como parâmetro o email do usuário:
```
./blockuser.ps1 "m@mail.com"
./deleteUser.ps1 "m@mail.com"
```

**Scripts isolados**
Caso queira pegar a lista de todos os times disponíveis em seu ambiente (ou os que seu usuário administra, no caso de ter a role de Team Admin) pode utilizar o script listTeams:
```
./listTeams.ps1
```

Caso tenha alguma demanda especifica ou alguma dificuldade com o script, entre em contato com a equipe da M3Corp ou reporte pelo GitHub.