teleren/devto huggingface dataset:
Improving the Online Eyewear Shopping Experience with AI: Building a Face Shape Finder
Published: 2023-04-20 22:15:09

As a data scientist and online shopper, I noticed that finding the perfect fit for eyewear can be a challenging task, especially when it comes to finding the right frame for your face shape. I recognized this issue and decided to take on the challenge of building a face shape finder that would enable customers to find the right glasses for their face shape more easily and accurately. Zenni Optical, a well-known online eyewear retailer, was the perfect website for this project because they already had a page dedicated to glasses for face shape. My aim was to improve their customers' shopping experience by implementing an AI-powered feature that identifies face shapes.

To accomplish this task, I used a dataset of 5000 images of female celebrities from all around the globe, categorized according to their face shapes: Heart, Oblong, Oval, Round, and Square. I then used image processing and machine learning techniques to train a model to recognize the different face shapes.

To begin with, I used the Haar cascade algorithm to detect faces in all the images and cropped the detected areas to remove excess noise. I then tried two types of edge detection, Canny and Sobel, to improve the model. For the first model, I used VGG16 as the base and fine-tuned it to classify face shapes. For the second model, I used the same VGG16 architecture but trained it on cropped images without applying edge detection.

After testing the models, the scores were decent, but there was room for improvement. The main issue was the misclassification of the Oval class, with a validation accuracy of 61% and a test accuracy of 84%. However, the results still showed promising results in identifying face shapes and helping customers find the perfect glasses.

My Face Shape Finder project is a step forward in improving the online eyewear shopping experience. While there is still room for improvement, such as developing a recommendation system that recommends specific glasses based on face shape, this project has shown that AI-powered features can enhance online shopping experiences. As the field of AI and machine learning continues to advance, we can expect to see more innovative solutions like this that cater to the ever-changing needs of the online consumer market. With this technology, online retailers like Zenni Optical can continue to improve their services and provide a seamless and personalized shopping experience for their customers.
Hypertext Literal from Observablehq
Published: 2023-04-20 22:06:00

**[htl](https://github.com/observablehq/htl)** is an awesome tool inspired by  lit-html and HTM.

Look at this code and enjoy :-) [MultipleCounters](https://flems.io/#0=N4IgtglgJlA2CmIBcBWAHAOgCwBoQGcBjAJwHtZZkBtABhxoF08AzCBfa0AOwEMxEkIDAAsALmEp5CpLqPizkIADxFiEAA6iABPmKEAvAB0QY0evxIA9JcJQuGAFb4o8WBABuxDF3ijLXdTBLKABmAAEAdmMAPiVLVQ1RaMMuFRJEnT0jE1EzC2tbeycXN09vX39AyzDSACN8eGJ3HlqEYQBHS3VYUlEwmgwANhi4hM1krhA8BoRCUQgZDkEAJiQaEABfHG4+ASEnKZBpWXlRRWP8bWAxCQ2tfS0xWBSU5gBXLjmFri0AYVIPnJiFoABSXHjEbQPGgASi0wBSWi0CG0zVgb3g9x0oghogA3Ijkb4tNJAY0sY9xLAAAYqdQ8LjRAAkwDRGI2o3pjOpBJ+RO0tTeuRkWJuNKUguFPxkhDchAA1voWe9PvMRSC4Qi+UjSScvBAuD5iAAVeAADyhWgA1Fa2fBeUikRBmKC7VpoloAJyawmOpGiYQQfAYS4ATwQGCgQe6PFDWOMXBk8GMvr9uqBGANRtNFvjIAAMhBINpiPAeIRhPAoCntVoNoSNhtogBJAByvziktEMmi1MJKq+IvcEHgAHdQT7a6XRG9iD8xX3a0ilFH3Njw-BsmAIQBzA0AWlqvW7YCQAEYaOozTFU36WenGvWl46WV2ZE+-cvgh5ew3CdPZx+Ycxw1FInxSC5tDAN5YHmbp4H+MliHwClCSoDAMIAQWIYhYxBFBYQYVMMG3dQQQ1e4PQAWR4AMMGYHpSGIEEaLo3CuCgUgwAogAqLQLy0GEYWI0iQUQvVhK4V4PkHH5MPUdQJ3hf9fEAykJFpVcJj9JRhDPaIqJgjQEGxWj4HeCgSQBPV8DiPTtJfYBoNg4yEOsoF8A-LQ4i0xdwI40hCDefhZAwI8oFDDAeAU+QoBBeSyKEl4pJSw4ZngWSlhAM8z3PNBNm2EBeH4RQMEIfAOCkGQ5AUQRNiYEA3C4eUlioHYSsEJ5DlnShOtycwrEsD51HlHcyq4ywnn6DAQgwM9v0uSbRFgEiDUcSqQFEUN1D2MYzmmVwMrVLgstWdYNga4q9iefcH2QzYgA)

```js
const {html} = htl

function Counter (start = 0) {
  let value = start;
  let counter =  html`<span>${value}</span>`;
  let button = html`<button onclick=${function () {
    counter.innerText = ++value;
    if (value > 9) {
       this.style.display = "none"
       counter.innerText = "Limit reached"
    }
  }}>INC</button>`
  function view () {
    return html`
      <div style="margin-bottom:10px">
        ${counter}
        ${button}
      </div>`
  }
  return view()
}

const multipleCounters =  
  [...Array(50)]
    .map(() => Math.floor(Math.random() * 10 ))
    .map(Counter)

function App () {
  return html`<div>
    <h1>Muliple statefull counters</h1>
    ${multipleCounters}
  </div>`
}

document.body.append(App())



```
Why You Should Forget the Tooling and Refactor Code Manually
Tags: webdev, softwareengineering, softwaredevelopment, programming
Published: 2023-05-16 11:01:50

---
title: Why You Should Forget the Tooling and Refactor Code Manually
published: true
date: 2023-04-20 22:01:20 UTC
tags: webdev,softwareengineering,softwaredevelopment,programming
canonical_url: https://fagnerbrack.com/why-you-should-forget-the-tooling-and-refactor-code-manually-ca7b46f0b5c4
---

In the world of software development, tools are everywhere. There are automated tools for testing, deployment, and refactoring. But what if I told you that relying too much on tools can be counterproductive? What if I told you that manually refactoring your code can lead to a better understanding of the system without endless documentation? In this post, we explore why you should forget the tooling and refactor code manually.

![](https://cdn-images-1.medium.com/max/1024/1*DXcnmPFW3aFCxj4p3db4QQ.jpeg)

First, let’s define what we mean by “tooling.” In this context, we refer to automated tools that assist developers in refactoring code. These tools are useful for identifying code smells, finding duplicate code, and making small changes to improve code quality. However, relying too heavily on these tools can lead to a lack of understanding of the system as a whole.

When developers manually refactor code, they become more familiar with the codebase and feel the pain of change. This creates incentives to design systems that are good enough, not too tightly coupled or too loosely coupled. Manual refactoring also forces developers to move code around in small steps. Otherwise, it’s very hard to keep control of the code. This helps developers create a mental model of how the system works.

Psychological science supports this approach to learning. When we manually perform a task, we engage in deliberate practice, repeating small, specific steps to improve performance. By manually refactoring code, developers also engage in deliberate practice with their code, leading to a deeper understanding of the system.

If everyone on a team engages in this approach to refactoring, everyone will eventually have a similarly deep understanding of the system's design. This eliminates the need for endless documentation that never quite matches the code. Instead, the code itself becomes the documentation.

In conclusion, while automated refactoring tools can be helpful, developers should not rely on them too heavily. Manual refactoring leads to a deeper understanding of the system and helps to create a mental model of how the code works. Developers can improve their skills and create better code by engaging in deliberate practice.

Forget the tooling; in order to be truly productive, it's time to start manually refactoring your code.

**See also** [Don’t copy-paste code. Type it out.](https://medium.com/@fagnerbrack/the-benefits-of-typing-instead-of-copying-54ed734ad849)

Thanks for reading. If you have feedback, contact me on [Twitter](https://twitter.com/FagnerBrack), [LinkedIn](https://www.linkedin.com/in/fagnerbrack/) or [Github](http://github.com/FagnerMartinsBrack).
How do you stay motivated when there's no company bonus?
Tags: discuss, motivation, career, strategies
Published: 2023-04-20 22:05:23

💰💔 Don't let the absence of financial rewards discourage you!🙅‍♂️🙅‍♀️ Let's discuss some tips and tricks to stay motivated and focused on your goals. 🎯💪 Share your strategies and experiences with us! 👀💼
Day 740 : Them Changes
Tags: hiphop, code, coding, lifelongdev
Published: 2023-04-20 21:54:06

_liner notes_:
- Professional : Pretty good day today. Merged the branch that I made for folks to test out before I made it publicly available. Followed up on some community questions. Finished up the getting started instructions for the proof of concept application I made for my upcoming workshop. Had a couple of meetings. Got a bunch of the slides done for my workshop, just need to do a couple of tweaks.

- Personal : Put together a bunch of tracks for the radio show. Then I ironed and packed my suitcase for my trip tomorrow. It was pretty late when I finished so I went to bed.

![A barren tree in Deadvlei, Namibia casting a shadow towards the camera with tall sand dunes in the background](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h59enehh1if304rv3buw.jpg)

Going to pack up my backpack that I'll be taking to Brazil. Need to bring my equipment for the radio show so I'll probably have to leave some stuff behind. I'm thinking I'll just carry my new 360 camera and leave the other 3 I normally take with me behind. Been charging up a bunch of equipment and downloading movies and anime for my trip. The plan is to catch up with the Boruto episodes I've missed. Once I do my packing, I think I'll finish up with the workshop slides. I have a meeting so I'd like to show them changes I made and get feedback. I also need to put the tracks I put together on my player before I pack it away. Not sure when my next blog post will be since I'll be out. I will be posting pictures and videos up on my site https://dwane.in/Brazil

Have a great night and week! See y'all later.

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube GNCd_ERZvZM %}
Predicting Water Safety in Ohio After a Train Derailment: A Machine Learning Approach
Published: 2023-04-20 21:50:23

A train derailment that occurred on February 3, 2023, in the village of East Palestine, Ohio, led to evacuations, a chemical scare, and a federal investigation. The incident raised concerns about the safety of drinking water in the affected areas. In response to these concerns, a machine learning model was developed to predict if water in certain areas of Ohio is safe to drink or not, taking into account various chemical elements and contaminants.

Data Understanding:
The dataset used in this project contained 8000 rows and 21 columns, representing water samples with information on various chemical elements, minerals, bacteria, and viruses. A list of acceptable levels for each element or contaminant was established based on the maximum safe concentrations for human consumption. The target variable 'is_safe' was labeled as either 0 (not safe) or 1 (safe).

Model Evaluation:
Precision was chosen as the evaluation metric for this project, as it is more important to minimize false positives in this context, where incorrectly labeling unsafe water as safe could have severe consequences for public health.

Model Development:
A logistic regression model was first implemented as a baseline, yielding a precision of 0.11 for safe water and 0.99 for not safe water. To improve the model's performance, a grid search was conducted with hyperparameter tuning on three additional models: logistic regression, K-Nearest Neighbors, and Random Forest. The results were as follows:

1.Logistic Regression: precision - safe (0.91), not safe (0.96)
2.K-Nearest Neighbors: precision - safe (0.88), not safe (1.00)
3.Random Forest: precision - safe (0.98), not safe (1.00)

Further, a pipeline was implemented that combined all three models with hyperparameter tuning, achieving a precision of 0.99 for safe water and 1.00 for not safe water.

Recommendations and Conclusion:
Based on the results of the machine learning models, it is suggested that water in various areas of Ohio be tested for the top five most important features identified by the Random Forest model: viruses, nitrites, nitrates, bacteria, and copper. Additionally, the main toxic chemicals that spilled from the Ohio train derailment, vinyl chloride and butyl acetate, should be included in these tests. By gathering this new information, the machine learning model can be updated and improved to better predict water safety in the aftermath of the train derailment.

In conclusion, machine learning models can be an effective tool in addressing public health concerns, such as predicting the safety of drinking water in the wake of a chemical spill. By continually updating and refining these models with new data, we can better protect communities from potential health hazards and contribute to improved public safety.
Criando um monitor de logs em Go - parte 1
Tags: go, webdev, programming, devops
Published: 2023-04-20 21:49:30

Esse é um post onde vou mostrar como eu desenvolvi esse monitor de logs, que você pode estar acompanhando nesse [repositório](github.com/roqueando/oluwoye).

## Protocolo AWO e Parser
Eu precisava de uma estrutura para esse protocolo, como seria uma aplicação que muitas apps podem utilizar essa estrutura precisava de um padrão. Segue um exemplo:

```
LOG abc@123 AWO1.1
02:30:22
This is my LOG message content!
```
Como todo protocolo em cima do TCP, tudo isso é um texto, então eu precisava converte-lo em alguma estrutura.

Em Go, criei um parser para tratar todo tipo de mensagem que enviarem para a aplicação. Caso ele não siga esse padrão, um erro deve ser gerado.

```go
type Log struct {
  Header Header
  Timer string
  Message string
}

type Header struct {
  Verb, AppKey, Version string
}
```

Essas estruturas serão a base da mensagem, onde Header tem sua verificação, pois se algo estiver errado antes da validação, não queremos receber a mensagem.

## Validando o Header

Precisamos também criar um construtor para esse Header.
```go
func NewHeader(head string) (Header, error) {
        parts := strings.Split(head, " ")
        if len(parts) != 3 {
                return Header{}, errors.New("malformed header")
        }

        verb := parts[0]
        app_key := parts[1]
        version := parts[2]

        return Header{Verb: verb, AppKey: app_key, Version: version}, nil
}
```
Aqui apenas divido o header em 3 pelo whitespace, e caso ele venha mais ou venha menos partes, ele está errado. Aqui também poderia adicionar alguma forma de validação da `app_key` ou se o `verb` não faz parte dos verbos do protocolo que estamos criando (o que implementarei mais para frente).

## Criando a função Parse
Agora que tenho o Header com sua validação preciso transformar a mensagem numa estrutura.

```go
func Parse(packet string) (Log, error) {
        parts := strings.Split(packet, "\n")
        if len(parts) != 3 {
                return Log{}, errors.New("malformed packet")
        }

        header, header_error := NewHeader(parts[0])

        if header_error != nil {
                return Log{}, header_error
        }

        timer := parts[1]
        if timer == "" {
                return Log{}, errors.New("timer is empty")
        }
        message := parts[2]

        return Log{
                Header:  header,
                Timer:   timer,
                Message: message,
        }, nil

}
```
Esse parser irá validar se a mensagem tem também 3 partes, pois só tenho a estrutura: Header, Timer e Message. Então caso não siga isso, irei trata-lo como inválido.

Logo depois crio o Header e também checo se o `timer` está vazio ou não, pois preciso do tempo que esse log chegou na aplicação.

Por fim, coloco ele numa estrutura Log como já definido e o retorno.

Na próxima publicação sobre esse projeto irei abordar como criei o sistema de regras para a monitoração customizada usando o Oluwoye.

O ṣeun, e até a próxima!
Weekly Challenge #7 - To-do App
Tags: codenewbie, weeklychallenge, beginners, challenge
Published: 2023-04-20 21:10:57

---
title: Weekly Challenge #7 - To-do App
published: true
series: Weekly Challenge
tags: codenewbie, weeklychallenge, beginner, challenge
---
Hey all! 

I find it really hard to get my tasks done if I don't have some way to clearly organize them in front of me. Just being able to cross it off when I'm done provides a sense of closure. It's an even better way to motivate myself if I can gamify it in some way by assigning rewards or punishments to certain tasks. 

This week's programming challenge is to build a todo list application that allows users to add, edit, and delete tasks. The application should, at a minimum, also allow users to mark tasks as complete.

To get started, you'll need to choose a language or framework to use. Java, Python, and C# are popular options for making this kind of app. Some popular web framework options for this challenge include React, Vue.js, or Angular. You'll also need to use HTML and CSS or an interface library to create the user interface for your application.

Here are the basic features your application should have:
- Adding a new task: Users should be able to enter a new task into the application, along with a due date and a category (e.g. work, personal, errands).
- Editing a task: Users should be able to edit the details of a task, including the task name, due date, and category.
- Deleting a task: Users should be able to delete a task from the list.
- Marking a task as complete: Users should be able to mark a task as complete, which should remove it from the list of active tasks.

To make your application stand out, consider adding additional features, such as:
- Sorting tasks by due date or priority.
- Setting reminders or notifications for tasks that are due soon.
- Allowing users to share their task lists with others or collaborate on tasks with colleagues or family members.
- Adding incentives to tasks.

Once you've built your application, be sure to test it thoroughly to make sure all of the features are working as intended. You can also customize your application by adding additional features or improving the user interface.

Thanks for following along! I'll be posting my own version of this app in the comments below. When you're ready, share your application on DEV Community and challenge other developers to create their own todo list application!  Remember to follow [CodeNewbie](https://dev.to/codenewbieteam) on DEV for more beginner tutorials, tips, and discussion!
Upstream is June 7. Will you be there?
Published: 2023-04-20 21:01:14

We’re busy finalizing the agenda for Upstream, which takes place virtually June 7. And wow, do we have some great talks in the lineup. We’ll be sharing the full agenda soon, but let’s dig into the theme and keynote speakers a little bit first.

This year’s theme is the accidental supply chain, which is a topic we’ve been thinking about a lot here at Tidelift, especially amid all [the recent attention on improving cybersecurity from government and industry](https://tidelift.com/government-open-source-cybersecurity-resources) around the world. Most open source maintainers did not sign up to be a part of a global software supply chain; instead, they started working on open source to fulfill a need, or to learn new skills, or for a myriad of other reasons.

But as more organizations are focused on the security of open source, and governments around the world increase their focus on cybersecurity, open source maintainers are being asked to do more and more.

The good news: this increased attention on open source software security will hopefully produce more resilient software. The bad news: Who exactly do we expect to do that work? The unpaid volunteer maintainer who finds themselves a part of an accidental supply chain?

That’s the theme we’re exploring this year at Upstream, and we have an excellent group of keynote speakers who will guide us through the day. 

- Luis Villa, Tidelift co-founder, will kick off the day by introducing the accidental supply chain theme—and give us some ideas for how the open source community can make it a little less...well... accidental.
- Nithya Ruff, head of the open source program office at Amazon, asks the question: How do we live in this world of unintended relationships between supplier and consumer, and who is responsible for making it work for both?
- Allan Friedman, senior advisor and strategist at the U.S. Cybersecurity and Infrastructure Security Agency, will share a unique perspective as someone within the agency responsible for strengthening cybersecurity and infrastructure protection.
- Julia Ferraioli, co-founder of Open Source Stories, will discuss how the sustainability and supply chain conversations oftentimes leave out a critical factor in the equation: the people and social systems without which there would be no open source.
- Mike Milinkovich, executive director of the Eclipse Foundation, will discuss how well-meaning attempts to regulate the global open source phenomenon run the risk of killing the very thing that made it successful in the first place.

Interwoven between these keynotes, we’ll share talks from maintainers and enterprise technologists alike. We are still finetuning the agenda, but, spoiler alert: it’s shaping into an epic day you won’t want to miss.

The first 500 U.S.-based registrants are eligible for a free t-shirt. Stock is running low, so don’t hesitate. [RSVP now](https://upstream.live/?__hstc=23643813.d1ddc767e9f4955f3bdd2f1c64c72f8c.1654699542897.1682019582133.1682022877721.577&__hssc=23643813.6.1682022877721&__hsfp=1410824562)!