teleren/devto huggingface dataset:
The 50th Day of the 100 Days of Code Challenge
Published: 2023-07-31 23:58:57

Today was a pretty long day, worked on the real-time transcription app and tested different implementations. Ended up going for a stable-ts + faster-whisper combo, did some testing and it looked good.

Since the goal is to demonstrate the capabilties of Whisper, I made the transcription timeout (batch size) and beam size configurable. The performance of faster-whisper in a Google Colab environment was quite surprising, as I was able to use a beam size of 5 and still get near-immediate response with a batch size of 3 seconds.

I still have some accuracy problems with the diarization, that are all related to the accuracy. The application itself is working, so no problems with that. I'm planning on exploring the diarization stage further, specifically the speaker-embedding brain at this time to improve the accuracy.

So far, the focus was on the transcription part. There is still room for improvment, by adding support for other Whisper implementations and alignment models that would possibly allow for more accurate timestamps, which would also benefit the diarization part of the app.

The user would also bear some of the responsibility for the diarization when the diarization pipeline's config parameters' values are made configurable. The performance also depends on those values.

The focus will shift to the diarization part of the app for now :)

Overall, the [demo](https://drive.google.com/file/d/1X4CMHY8u2pba7-487rr5wx-WEgfW_bXm/view?usp=sharing) is looking quite good for this stage. Still can't believe how long it took me to get here and how many different approaches I took. But super happy with what I learned and will learn, hoping that the next projects will be coming out like hotcakes :)

Planning to make the improvement of this project a side-quest for the weekends in terms of adding support for more implementations and approaches. The bugs and diarization of course, are a priority. Tomorrow, if there's no review, I'm changing my focus a bit so that I have a breath of some fresh project air :)

That's it for today, happy coding everyone!
Setup OpenCost in Kubernetes using Helm
Tags: kubernetes, opencost, helm, aws
Published: 2023-07-31 23:36:46

My setup is AWS and EKS.

My work based on:
* [Slack conversation here](https://cloud-native.slack.com/archives/C03D56FPD4G/p1690566466507759?thread_ts=1690557341.236339&cid=C03D56FPD4G)
* [Custom pricing using the OpenCost Helm Chart](https://www.opencost.io/docs/configuration/on-prem#custom-pricing-using-the-opencost-helm-chart)
* Original from [source](https://github.com/opencost/opencost/blob/develop/configs/aws.json) 

I created custom helm chart based on [OpenCost helm chart(official?)](https://artifacthub.io/packages/helm/opencost/opencost) here is my default `values.yaml`:
```yaml
fullnameOverride: opencost

awsSpotDataRegion: ""
awsSpotDataBucket: ""
awsAccountId: ""

opencost:
  serviceAccount:
    create: true
    annotations:
      eks.amazonaws.com/role-arn: "xxx"
  opencost:
    exporter:
      defaultClusterId: "xxx"
      extraEnv:
        EMIT_KSM_V1_METRICS: "false"
        EMIT_KSM_V1_METRICS_ONLY: "true"
        PROM_CLUSTER_ID_LABEL: cluster
        LOG_LEVEL: info #error
      extraVolumeMounts:
        - name: opencost-conf
          mountPath: /models/aws.json
          subPath: aws.json
    prometheus:
      external:
        enabled: true
        url: "http://mimir-nginx.mimir.svc.cluster.local:80/prometheus"
      internal:
        enabled: false
    ui:
      enabled: true
  extraVolumes:
    - name: opencost-conf
      configMap:
        name: opencost-conf
        items:
          - key: "aws.json"
            path: "aws.json"
```

Also in my custom chart I included `configmap.yaml`, here is content of it:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: opencost-conf
data:
  aws.json: |
    {
        "provider": "custom",
        "description": "Default prices used to compute allocation between RAM and CPU. AWS pricing API data still used for total node cost.",
        "CPU": "0.031611",
        "spotCPU": "0.006655",
        "RAM": "0.004237",
        "GPU": "0.95",
        "spotRAM": "0.000892",
        "storage": "0.00005479452",
        "zoneNetworkEgress": "0.01",
        "regionNetworkEgress": "0.01",
        "internetNetworkEgress": "0.143",
        "spotLabel": "",
        "spotLabelValue": "",
        "awsServiceKeyName": "",
        "awsServiceKeySecret": "",
        "awsSpotDataRegion": "{{ .Values.awsSpotDataRegion }}",
        "awsSpotDataBucket": "{{ .Values.awsSpotDataBucket }}",
        "awsSpotDataPrefix": "",
        "athenaBucketName": "s3://x",
        "athenaRegion": "us-east-1",
        "athenaDatabase": "",
        "athenaTable": "",
        "projectID": "{{ .Values.awsAccountId }}"
    }
```
Learning Ruby
Tags: ruby, beginners, programming
Published: 2023-07-31 23:08:50

I started to go over the Ruby portion in CodeAcademy. I think it's pretty fun, easy to understand, because I have previous experience with other programming languages it's a bit of a refresher. 

Or at least that's what I thought until I got to the loop portion and started to learn what makes Ruby different from Java and C++, I keep wanting to put in some syntax from Java to help with loops and then realize that Ruby is different and doesn't recognize the syntax.

It's not difficult but I do need to remember that the syntax for Ruby is different and I need to be mindful of that.
📆 Better Citizen Experience w/ Open Data Calendars 🔔
Tags: opendata, python, showdev, productivity
Published: 2023-07-31 23:06:34

## 🤔 What is this about

In New-Caledonia, due to recent (some deadly) shark attacks, open water activities have been regulated until the end of 2023 for safety reasons: 

{% embed https://la1ere.francetvinfo.fr/nouvellecaledonie/province-sud/noumea/risque-requin-neuf-campagnes-de-peche-programmees-a-noumea-1384222.html %}

## 💭 Citizen Experience

As a Citizen, it would have been 

> convenient **to keep track and be notified** when I can (or cannot) enjoy some activities for security purpose... 

but (until now) I was lacking an easy and integrated access to that information.

## 💡 Open Data to the rescue

The idea I had was to 

> put that data somewhere so I can manage it and enjoy it

on **my whole cloud universe, seamlessly accross all my devices**... including my Outdoor smartwatch (**the device I use for all outdoor activities**):

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

## 🍿 Story telling

Enough talk, let's head on the storytelling:

{% youtube su4arCzhiGQ %}

## 🎁 Resources & goodies

- 📅 [`ics` Calendar file](https://bit.ly/3YbAwlU)
- 📊 [Kaggle Notebook](https://www.kaggle.com/code/adriensales/campagnes-de-pr-l-vements-requins-noum-a)
📁myFiles 2.0 First Week On Sale🚀
Tags: news, management, tooling
Published: 2023-07-31 22:58:17

Sorry if I've forgotten to tell you but you have **6 days before** the end of the **"myFiles 2.0 First Week Sales"** of **70% off ( ~~$2.99~~ -> $.90 )**. Enjoy :p

![omg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/izvl797eh1emksj55nph.gif)

**As you may know, if you have any feedbacks comment it down in the comment section of this post or, in my page.**

Link of the Project:
https://blueberry077.itch.io/myfiles
Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes Dislikes
Published: 2023-07-31 21:56:44

It's becoming more and more common for posts with irrelevant and useless content, usually with a pompous title and mediocre content that don't go much beyond a small definition of usefulness. Why do they do this ??? They must be disqualified people looking to enrich their CVs with a large number of published articles.
dev.to should add a DISLIKES space to inhibit the presence of this kind of useless people posting this kind of thing.
If you agree with this suggestion please comment anything to make it relevant to reach the dev.to admins.
I’m a proud father, of a React App.
Tags: beginners, codenewbie, react, jsx
Published: 2023-07-31 21:19:58

It’s simple, it’s static and it’s mine. The styling still needs love but learning how to build this, then relearning how to build it outside of Scrimba’s editor was challenging and fun!
What I’m probably most proud of though is mapping through an array of objects with a single component to create each destination!
https://traveljournal-three.vercel.app/
What I learned from building a high fidelity Twitter UI clone
Tags: frontend, nextjs, tailwindcss, typescript
Published: 2023-07-31 21:19:39


To deepen my frontend skills, I decided to build a [high-fidelity Twitter clone](https://twitter-clone-nextjs-brown.vercel.app/home). I was bored of the very _basic_ CRUD app tutorials on Youtube that barely mimicked Twitter’s UI. Replicating Twitter’s UI was very challenging for a relatively new developer like me and I learned a lot, especially how to dissect UIs in Chrome Dev Tools.

**Tech Stack**: NextJS, TypeScript, Tailwind, Zustand.

**Brief introduction about me**: I became a full stack engineer last year and have been enjoying working at Wells Fargo helping to build their new security that enables more sophisticated logins for customers. I love building interfaces and systems and reading about thoughtful design.

Please check out [my Twitter clone](https://twitter-clone-nextjs-brown.vercel.app/home) - I explain my thoughts about the tech stack I used and challenges I had in replicating Twitter’s UI behavior. Here are a few key points I learned:

1. This project took me about 3 weeks. I initially projected a week but soon learned just how complex each component is. One thing that surprised me initially was that almost every element in Twitter is a div and all the divs are flex containers with accessibility added via ARIA labels. Then I quickly learned that the inconsistent CSS properties of semantic tags are extremely frustrating.
![It's flex divs all the way down](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhjg01tw5treaglymqrr.png)

2. NextJS's default optimizations and server-side rendering gave me great Google Lighthouse scores right out of the box. I tried to make interactive parts of the app as small as possible and sectioned them off as client components at edges of the component tree to improve FCP. When I build a full stack app, I'll implement data fetching with React Server Components and Suspense.


![I didn't even have to configure gzip compression!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7us4ytdbhu6h93xmpkyd.png)

3. I got really good at finding where height and width of an element comes from. In Chrome Dev Tools, I would analyze from the leaf all the way to the parent to check for padding, margins, borders, and hard-coded width and height. Twitter has lot of redundant divs that do apply one or two styles at a time. I assume this is due to the complexity of working in a extremely big team. 


![Inspecting an element on Twitter's site - width and height are greyed out which means it gets it dimensions from its ancestors or descendants.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hhbebmxnp2mlfseydhl4.png)

I feel extremely confident about my ability to create high-quality production-grade UIs now. Follow me here on [LinkedIn](https://www.linkedin.com/in/junsupark-swe/) or on DEV as I continue along my journey towards building robust web applications! My goals are to build more high-fidelity clone projects with other frameworks, such as Remix, SvelteKit, SolidStart, and WASM.
O CRUD mais rápido que você fará em Java
Tags: java, springboot, restapi, webdev
Published: 2023-07-31 20:46:44

Ei! Que tal fazer um CRUD bem rápido em Java?

Vamos saber como:

O Spring facilitou muito a vida do desenvolvedor Java desde que ele surgiu e grande parte das aplicações é composta de CRUD's.

Pensando nisso, o Spring tem o package `Spring Data REST`, que justamente serve para expor diretamente um CRUD completo de uma única entidade.

Como aproveitar isso?

Primeiro vamos gerar um projeto Spring usando as dependências do JPA, Spring Web e Rest Repositories. Esta última dependência é essencial para o CRUD. Adicionalmente é necessário o driver de banco de dados de sua escolha.


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

Configure seu application.properties apropriadamente:


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

Crie a sua entidade, colocando as anotações correspondentes de banco de dados nela (estou usando o Lombok para gerar getters e setters automaticamente).

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

Por fim crie seu repositório que irá expor os endpoints correspondentes de sua entidade:


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

E é isso! Está pronto seu CRUDzinho!

Para testar, basta fazer um GET para a URI que você definiu na property `spring.data.rest.base-path`, e ele te retorna todos os endpoints disponíveis:

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

Por padrão o Spring Data REST irá expor os seguintes endpoints para a entidade Product:

GET /products => Retorna todos os produtos
GET /products/{id} => Retorna um único produto
POST /products => Cria um Produto
PUT /products/{id} => Altera um produto
PATCH /products/{id} => Altera um produto somente nos campos informados
DELETE /products/{id} => Deleta um produto

e gratuitamente, você ainda tem:

* Respostas no padrão REST, com hyperlinks para endpoints relacionados (ou seja, HATEOAS);
* Paging and Sorting;

Além do fato de ser facilmente configurável (recomendo olhar a documentação do package: https://docs.spring.io/spring-data/rest/docs/current/reference/html/).
What Is LINQ?
Tags: development, database, newbie, hasanelsherbiny
Published: 2023-07-31 20:39:14

LINQ Stands for : Language Integrated Query and it was made to allow users perform queries written with C# to Data source.

when your data source is Memory List : This Is Called LINQ To Object

when your data source is XML File : This Is Called LINQ To XML

when your data source is SQL Database : This Is Called LINQ To SQL
in this case your query is being translated into SQL query and performed against configured database.

LINQ To SQL has been evolved to more complicated ORM and now it's a part of Entity framework where your database tables are mapped into C# entitles and with the help of LINQ to SQL you can perform queries and commands 

There are two styles to write LINQ Queries

1. Query Like Style
`from myVariable in mysource select myVariable`
in this example you are select from your data source "mysource" and having a pointer called myVariable can be used to access properties of object of your data source.

2. Extension Methods using lamda expression

`mysource.Select(myVariable => myVariable)`
this is the same impact of the first example but with another code style.
site design esfahan
Tags: website, design, seo
Published: 2023-07-31 20:38:28

[طراحی سایت](https://karizmagp.com/wordpress/) و [سئو (SEO)](https://karizmagp.com/seo-learn/) دو عامل حیاتی در موفقیت یک وبسایت هستند. در این متن 1000 کلمه ای، به بررسی اهمیت طراحی سایت و سئو و نکات کلیدی در هر یک از این حوزه‌ها می‌پردازیم.
طراحی سایت:
طراحی یک سایت حرفه‌ای و کارآمد می‌تواند تفاوتی بزرگ در تجربه کاربری و موفقیت کسب و کار شما به وجود آورد. در ادامه، به برخی اصول طراحی سایت که باید در نظر گرفته شوند، اشاره می‌کنیم:
1. طراحی ریسپانسیو: سایت شما باید بر روی همه دستگاه‌ها (کامپیوتر، تبلت، موبایل) به خوبی نمایش داده شود. طراحی ریسپانسیو به معنای سازگاری وبسایت با اندازه صفحه نمایش دستگاه کاربر است.
2. سرعت بارگذاری: سایتی که به طور کامل بارگذاری نمی‌شود، می‌تواند باعث از دست رفتن کاربران و کاهش درصد بازدید سایت شود.   به همین خاطر باید از شرکت های معتبر مثل [karizmagp](https://karizmagp.com/) استفاده می شود
از بهینه‌سازی تصاویر، کاهش حجم فایل‌ها و بهینه‌سازی کد‌ها برای افزایش سرعت بارگذاری سایت استفاده کنید.
3. طرح بندی و ناوبری: طرح بندی ساده و مرتب و ناوبری قابل فهم برای کاربران، ارتباط موثری را با مخاطبین شما برقرار می‌کند. از استفاده از منوهای راهنما، برچسب‌های صفحه و ساختار سلسله مراتبی استفاده کنید.

4. محتوا و تصاویر: محتوا با کیفیت و جذاب، از جمله متن‌ها و تصاویر، نقش مهمی در جذب و نگهداشت بازدیدکنندگان دارد. محتوا باید ارزش افزوده داشته باشد و با کلمات کلیدی مرتبط با کسب و کار شما بهینه شود.
سئو:
سئو به مجموعه روش‌ها و تکنیک‌هایی گفته می‌شود که باعث بهبود رتبه سایت شما در نتایج موتورهای جستجو می‌شود. در ادامه، به برخی اصول سئو که باید در نظر گرفته شوند، اشاره می‌کنیم:
1. پژوهش کلمات کلیدی: شروع به سئو با پژوهش کلمات کلیدی مناسب است. انتخاب کلمات کلیدی مناسب و استفاده از آنها در محتوا و متا تگ‌ها کمک می‌کند تا سایت شما در جستجوهای مرتبط نشان داده شود.
2. بهینه‌سازی محتوا: محتوای شما باید مرتبط و ارزشمند باشد. استفاده از کلمات کلیدی در عنوان، متن اصلی و عنوان‌های فرعی، سازگاری با ساختار سلسله مراتبی و استفاده از لینک‌های داخلی مفید است.
3. ساخت لینک: ایجاد لینک‌های ورودی (بک لینک) با کیفیت و مرتبط با سایت شما، بهبود رتبه سایت در نتایج جستجو را تسریع می‌کند. از روش‌های ساخت لینک اخلاقی مانند ایجاد محتوای شیرینگی، مهمانی نوشتن و همکاری با وبسایت‌های مرتبط استفاده کنید.
4. بهبود تجربه کاربری: موتورهای جستجو به تجربه کاربری توجه زیادی می‌کنند. سرعت بارگذاری سایت، سازگاری با دستگاه‌های مختلف، ناوبری ساده و محتوای مرتبط با کاربران، تمامی عواملی هستند که بر تجربه کاربری تأثیرگذارند.
از طراحی سایت و سئو به عنوان دو عامل کلیدی برای رشد وبسایت و جذب کاربران متمایز و با دید حرفه‌ای استفاده کنید. با رعایت اصول و تکنیک‌های مناسب، می‌توانید سایت خود را به یک منبع ترافیک قوی و موثر تبدیل کنید حال برای [آموزش سئو در اصفهان اینجا را کلیک کنید.](https://karizmagp.com/seo-learn/)
Sinatra vs Rails
Published: 2023-07-31 20:24:33

Today, I worked with Sinatra and learned the difference between Sinatra and Rails. Having only ever worked previously with Rails, I hadn't come across Sinatra yet. I learned that Sinatra is much more lightweight and requires fewer resources, making it a good choice for building smaller, lightweight apps. Rails, however, is packed with features, comes with a lot of code, and is more suitable for building complicated web applications.
An old project helps search industrial threads information
Tags: csharp
Published: 2023-07-31 20:09:20

Here is the GitHub link and I am writing about an old project that I started with to learn databases and blazor developments.

[GitHub Repo](https://github.com/Robertblazor/BlazorThreadsFullStack)

Comment down below if you need the Excel file for MongoDB database, I am looking for peers to revitalize this project.
Mock API / Fetch Request
Tags: javascript, api, mock, fetch
Published: 2023-07-31 20:09:10

## Delay

When writing integration tests or during initial phases of development when APIs are not ready yet, we need to mock an API request that involves adding a delay to the response. Here is an example of the same:

```javascript

/**
 * @function delay
 * @param {Object} data - any data that needs to be returned
 * @param {Number} ms - time delay in milliseconds
 * @return {Promise<Object>} data
 */
const delay = (data, ms = 1000) => {
  return new Promise(resolve => {
     return setTimeout(resolve(data), ms)
  }) 
}

const apiResponse = [ { a: 1, b: 2 }, { a: 3, b: 4 } ]
const delay(apiResponse).then(result => {
   console.log(result) // prints `apiResponse` after 1 second
})

const result = await delay(apiResponse, 5000)
console.log(result) // prints `apiResponse` after 5 seconds

```
Qual o principal problema que a tecnologia blockchain resolveu?
Tags: blockchain, bitcoin, systemdesign
Published: 2023-07-31 20:02:03

A tecnologia blockchain vai estar cada vez mais presente no dia a dia,  já temos  a identidade digital registrada em blockchain, o real digital e  os meios de pagamento com criptomoedas.

Mas você já se perguntou qual o principal problema  que a tecnologia blockchain resolveu? 

                     Problema do gasto duplo

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

O "Problema do Gasto Duplo" é uma questão fundamental que surge em sistemas de pagamento eletrônico e é especialmente relevante em tecnologias de blockchain, como o Bitcoin. Esse problema ocorre quando uma moeda digital ou ativo digital é gasto duas vezes, ou seja, quando a mesma unidade de valor é utilizada em duas transações diferentes.

Sistemas tradicionais de pagamentos, como com cartões de crédito, uma entidade central, geralmente um banco, é responsável por verificar e garantir que o mesmo dinheiro não seja gasto duas vezes, mantendo um registro centralizado das transações. No entanto, em sistemas descentralizados, como o blockchain, não há uma autoridade central para verificar e garantir a integridade das transações.

Para resolver o problema do gasto duplo em blockchains, foi desenvolvido um mecanismo chamado "consenso". No caso do Bitcoin, o consenso é alcançado através do processo de mineração, onde os mineradores competem para adicionar blocos contendo transações à cadeia. Para que uma transação seja considerada válida, ela deve ser incluída em um bloco que seja adicionado à cadeia mais longa e aceita pela maioria dos participantes da rede. 

Quando a maioria dos nodes de uma rede concorda em aceitar uma única versão da cadeia (a mais longa), o problema do gasto duplo é evitado, pois os gastos duplos seriam rejeitados por nós que verificam as transações antes de adicioná-las à cadeia.

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

O problema do gasto duplo é um desafio inerente aos sistemas de pagamento eletrônico descentralizados, como blockchain, e é resolvido através do consenso da rede para garantir que uma mesma unidade de valor não seja gasta duas vezes.
Finishing up classlib project
Tags: csharp
Published: 2023-07-31 19:53:33

Now, we covered the major part of how the class library project should be, let's be more aggressive.

Every model we have, we have a cs file linking to the collection, and we also have a DbConnection cs file.

Extract interface for everyone of them cover all of the actions, just in case some day we want to switch to a different database.

Add the global usings file to wrap up.

```
global using MongoDB.Driver;
global using MongoDB.Bson;
global using MongoDB.Bson.Serialization.Attributes;
global using Microsoft.Extensions.Caching.Memory;
global using Microsoft.Extensions.Configuration;
global using ThreadsLib.Models;
global using ThreadsLib.DataAccess;
```