teleren/devto huggingface dataset:
The contest of ideas to democratize machine learning
Tags: machinelearning, datascience, opensource, mindsdb
Published: 2022-05-31 19:47:45

Albert Einstein, a master at great ideas, once said “If at first the idea is not absurd, then there is no hope for it” 

When solving real product user problems one needs to have empathy, understand the need, and come up with creative, innovative ideas. This is where the concept of ideation, a critical step in the design thinking process, helps us to challenge assumptions, think outside the box, and explore uncharted territory.  Ideation is where, as a community, we can explore and come up with as many ideas as possible. Some of these ideas will go on to be potential solutions and some will end up in the reject pile. At this stage though, the focus is on quantity of ideas rather than quality in order to uncover new angles, think “outside the box”, and do this in a ‘judgment-free zone’.

## Submit your idea and win the prize!

[MindsDB](https://mindsdb.com/) has set-up an ideation challenge that will run on [GitHub](https://github.com/mindsdb/mindsdb/blob/staging/integrations_contest.md) for the next 3 weeks from May 31, 2022 to Jun 19, 2022 for members of the community to generate, validate, and rate ideas for data source integrations and machine learning models. At the end of the submission and voting period we will award prizes for the top voted ideas:

- $1,000 for first, 
- $500 for second, 
- and $250 for third.

To spark the innovation and creativity engine we'd like to suggest the SCAMPER method as an acronym to get you thinking ‘outside-the-box”. Here’s what each of the letters stand for:

**S**: stands for **Substitute**. Brainstorm alternative processes, or techniques to what MindsDB is currently using,
**C**: stands for **Combine**. What processes or products that are currently separate can be combined?
**A**: stands for **Adapt**. Brainstorm how to adapt to something MindsDB already has to solve customers' problems.
**M**: stands for **Modify**. Consider what areas of MindsDB’s product can be modified to get closer to your ideal result.
**P**: stands for **Put to other use**. Think of alternative uses for MindsDB machine learning products or services.
**E**: stands for **Eliminate**: What inefficiencies in MindsDB products or services can be gotten rid of?
**R**: stands for **Rearrange**. How you might rearrange how things currently work to reach a new solution.

To get started -> visit the [contest’s GitHub page](https://github.com/mindsdb/mindsdb/blob/staging/integrations_contest.md) for more information.
Design and Code part 1.
Tags: design, webdev, programming, writing
Published: 2022-05-31 19:46:24

Design is supposed to work on the human psyche like art. I am currently coding an Events company website. An international one. Before you wander and wonder, Its for practice, am not yet a 1000x programmer, yet. 

The intention and desired outcome is the key to the whole project. To end up with a simple navigable and precise website, the fundamentals have been the building blocks. I began by ensuring what the main goal was met, in most cases its the call to action. To ensure your visitor is well informed. The image or slide show or animation should be considered part of the working design.
I complimented it with an attractive button for simple navigation. 

The presiding sections have a flow of a big topography. Visibility for the time spent on each section can be dictated by this. Remember, the anchor is the purpose of the whole project. An event project wants all its services memorable, I used an image slider on the events page. I utilized a lot of the white space and gradients for the images.

Media queries have proven to be a friend. Mobile view is coming along well. I have learnt that seeking information or converting a client is dependent on how the whole website has worked on the visitor. Is it art? I will write the second part of this blog with a link to the website.
Creating an Application| Ruby on Rails
Tags: rails, react, javascript, webdev
Published: 2022-05-31 19:41:22

Hello again! This blog is all about the basics of starting a Ruby on Rails backend to communicate to a React frontend. For our purposes we will build a todo list. The most basics portions of a Rails app is the route, controllers, model, and of course using all of that to migrate the data. Let's get started!

To begin, you want to create your Rails app. Simply open a terminal and cd into the directory where you want to create the rails app. Type in the following code and viola, a new app is created. 
`rails new name of your app`
It should look something like this: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wihpdsvr8eup9eg3qsx.png)My app being called example app. Once you have created the app cd into it and we can start building the basics.
`cd example-app`

Ok, now that it's created it we want to take a look around.

Let's start by adding a route to our routes file, config/routes.rb.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tqn4bh3yemtr3lkxzl20.png) This is what mine would look like. This code would display all the todos that I have.

Next we want to create a controller 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7pb0x51ifupveeudhx6g.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6bvrjw3wvn5e0dih72d.png)I went ahead and put this code in for the most basic functionality.

Now that we have a controller and a route let's create the next piece, the model.

A model is what Ruby uses to represent data. To create a model, let's use the model generator
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s96w1f77c4ttt52rf3bt.png)This will create the most basic structure for the todo table - a title in the form of a string, and a body in the form of text.

This will create a models/todo.rb file. In there I wrote some basic code to get the app working.![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1cto2zxfqrl0pq41fjya.png)

Whew, we are almost there! 

The last thing needed to create the most basic application is to migrate ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tekkc3ov4h8cgre32xe2.png)Simply run `rails db:migrate` in the terminal. The four lines below are to show that the migration is successful.

To make sure that your application was created successfully you can run `rails s` A.K.A. `rails server` the browser should return something like this![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6p5g4bixav5u2iixj3t.png) The array is empty because we created an application but did not put any information into the database yet. 

Congratulations! You have officially created a basic Ruby on Rails App!
Ease your .tf debugging using Terraform console
Tags: terraform, iac, devops, cloud
Published: 2022-05-31 19:40:28

[Terraform](https://www.hashicorp.com/products/terraform) is fun, it gives you the ability to quickly write code to deploy your infrastructure, but I've always found debugging terraform loops to be a little bit hard, this could be because I like to see what the result will be before hand and sometimes that's just not possible.

## So let's jump in!

To begin, go to your terraform code.
```bash
$ terraform console
```

For starters we can view the data sent over from a data source
```
> data.terraform_remote_state.network.outputs.public_subnets
[
  "subnet-03d91cba453ff08b1",
  "subnet-07f430834d2138353",
  "subnet-096e710748bab5eff",
]
```

Now if you want to create a loop out of something you can do
```
> [for a in data.terraform_remote_state.network.outputs.public_subnets:upper(a)]

[
  "SUBNET-04D91CBA353F108B1",
  "SUBNET-07F030831D2358353",
  "SUBNET-096E710758CAB7EFF",
]
```

One can also create structures to check the output for example
```
> {"${module.vpc.vpc_id}":[{"public":"${module.vpc.public_subnets}","private":"${module.vpc.private_subnets}"}]}
{
  "vpc-03cf041fb057a54f7" = [
    {
      "private" = [
        "subnet-07fcca0e214a4a439",
        "subnet-056496be722ef56d2",
        "subnet-04755007e91fe1e20",
      ]
      "public" = [
        "subnet-04d92cba4432f08b1",
        "subnet-07f030534d2c58353",
        "subnet-096e710648cab7eff",
      ]
    },
  ]
}
```

That's it, you can also loop over data.

Some things such as accessing `outputs` is still not supported.

If you liked this article I've also written one on [structuring Terraform code](https://kubesimplify.com/best-practices-for-structuring-your-terraform-code).

For more information, [read the docs and follow the guide here](https://learn.hashicorp.com/tutorials/terraform/console)

I can also be found on [Twitter](https://twitter.com/mediocreDevops), [Linkedin](https://linkedin.com/in/leon-nunes).

Thank you for reading!
Sintomas de uma desenvolvedora cansada
Published: 2022-05-31 19:28:40


![Foto frontal da minha pessoa (Juliana Dias) mostrando o notebook cheio de adesivos, senatada em uma poltrona com furinhos em uma cafeteria.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2pb905y1eku6jny2b90u.jpeg)

Deixa eu desabafar sobre um sintoma da minha vida como deva:

Depois de um certo tempo trabalhando como dev, a gente vai meio que se cansando de quase sempre resolver os mesmos problemas nas aplicações, então começamos a mudar de projetos e ir trabalhando em várias áreas diferentes como projetos de odontologia, ecommerce, empréstimos, seguros e de outras n áreas diferentes.

Depois dessa migração a gente começa a procurar apenas projetos que façam sentido pessoal pra nós, que tenha algum valor que vá além desses conhecimentos técnicos ou de regras de negócio, começamos a olhar projetos que se alinhem com a nossa filosofia de vida naquele momento, tal qual gosto de projetos de impacto social.

Porque no fundo, é pra isso que desenvolvemos, não só escrever códigos mas resolver problemas e problemas da vida real, tudo feito de pessoas para pessoas.

- 14/08/2019
Common React Design patterns: Custom Hooks
Tags: react, designpattern, javascript, codequality
Published: 2022-05-31 19:22:07

I started a series called "Common React Design Patterns" in which I want to practice some of the major design patterns used in React with each other. So we can be confident enough to apply it in our day-to-day development.

Knowing these patterns is helpful because it can save our time as developers, and it would present the application as a high-performance and delightful experience for our customers.

## Custom Hooks
One of the basic design patterns that we use daily is "Custom Hooks." It is vastly used as a preferable way to modularize and apply the DRY principle in our application. We can share complex behavior between multiple components by using a custom hook.

## Sample
### useDebounce Hook
*Tip* : Debounce delays invoking a function until after wait milliseconds have elapsed since the last time the debounced function was invoked.

```
import { useEffect, useState } from 'react'

function useDebounce<T>(value: T, delay?: number): T {
  const [debouncedValue, setDebouncedValue] = useState<T>(value)

  useEffect(() => {
    const timer = setTimeout(() => setDebouncedValue(value), delay || 500)

    return () => {
      clearTimeout(timer)
    }
  }, [value, delay])

  return debouncedValue
}

export default useDebounce
```
By using return function of `useEffect` after changing `value` or `delay`, React clear the timer identifier and function inside `setTimeout` not going to run. So it debounces. 👌

### Usage

```
import React, { ChangeEvent, useEffect, useState } from 'react'

import { useDebounce } from 'usehooks-ts'

export default function Component() {
  const [value, setValue] = useState<string>('')
  const debouncedValue = useDebounce<string>(value, 500)

  const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
    setValue(event.target.value)
  }

  // Fetch API (optional)
  useEffect(() => {
    // Do fetch here...
    // Triggers when "debouncedValue" changes
  }, [debouncedValue])

  return (
    <div>
      <p>Value real-time: {value}</p>
      <p>Debounced value: {debouncedValue}</p>

      <input type="text" value={value} onChange={handleChange} />
    </div>
  )
}
```
*Credit: useHooks-ts* [*](https://usehooks-ts.com/react-hook/use-debounce)

## Libraries
You do not have to build common scenarios from scratch. There are fantastic packages out there you can quickly learn and use. Here I listed some reliable players out of sort.

react-use [*](https://github.com/streamich/react-use) ⭐️ 29.6k / 🔽 958k
ahooks [*](https://github.com/alibaba/hooks) ⭐️ 9.1k / 🔽 74k
awesome-react-hooks [*](https://github.com/rehooks/awesome-react-hooks) ⭐️ 8.1k / 🔽 74k
usehooks-ts [*](https://github.com/juliencrn/usehooks-ts) ⭐️ 1.6k / 🔽 44k 
react-recipes [*](https://github.com/craig1123/react-recipes) ⭐️ 850 / 🔽 1.2k
react-hanger [*](https://github.com/kitze/react-hanger) ⭐️ 1.8k / 🔽 3.3k

## Refrences
React offcial doc [*](https://reactjs.org/docs/hooks-intro.html)
Home Assistant dev.to views sensor
Tags: beginners, automation, api
Published: 2022-05-31 19:21:37

[Home Assistant (HA)](https://www.home-assistant.io/) is a popular home automation software. Is has tons of built-in features, for example something called [RESTful Sensor](https://www.home-assistant.io/integrations/sensor.rest/). It let's you configure an API call and how to process the data to show the data you want on your Home Assistant dashboard.

This guide will show you how to set it up to show your dev.to total views count.


## Getting started

[Dev.to has an API](https://developers.forem.com/api/) that can be used to fetch user and article information. However, total post view count is not available in the API, but by adding the view count of each article together will produce this number. 

Go to [https://dev.to/settings/account](https://dev.to/settings/account) and generate a new API key. It is used for authorization, since the view count is not publicly available. 

The API endpoint that we're gonna use is documented [here](https://developers.forem.com/api#operation/getUserPublishedArticles). It returns the published articles, including the attribute `page_views_count`. 

```
curl 'https://dev.to/api/articles/me/published' \
-H 'api_key: <your API key>' \
-H 'per_page: 100'
```

will return

```json
[
  {
    ...
    "page_views_count": 103,
    ...
  },
  {
    ...
    "page_views_count": 3245,
    ...
  },
  ...
]
```

Make sure to add the `per_page: 100` (or more, up to 1000), since 30 is the default. Once you go over 30 posts, all views will not be counted. 


## Configure the sensor in HA
In the secrets.yml, add `dev_to_api_key: <your API key>`. Separating the secrets from the configuration.yml is a good practice. `!secret dev_to_api_key` will be substituted for the secret value. 

In configuration.yml, add the following sensor code. 

```yml
sensor:
  - platform: rest
    name: Dev to views
    resource: https://dev.to/api/articles/me/published
    headers:
      api_key: !secret dev_to_api_key
      per_page: 100
    scan_interval: 3600
    value_template: "{{ value_json | sum(attribute='page_views_count') }}"
    unit_of_measurement: views
```

The sensor attributes are pretty self-explanatory. Scan interval takes in the amount of seconds between each call (3600 seconds are one hour). The value template needs some explanation though. 

The data received looks like in the snippet above. It is automatically parsed as json and put in the value_json variable. That is piped through the sum method that sums the specific attribute. 

Stop and start HA to reload the configuration.


## Add to the dashboard in HA

Add a new entity card and select your new Dev.to entity and a suitable icon. 

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

This will be the result:

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

Good luck!
OS booting to pendrive instead of PC
Tags: discuss, help, linux
Published: 2022-05-31 19:20:54

I am trying to dual boot my laptop with Archcraft but for some reason the installer starts making partitions in my pendrive to install it, instead of my PC's HDD. I've tried it out with a few other distros but the result is the same. What should I do? Please help!

My pc does have an allocated partition of 100gb and my SATA mode is AHCI, secure boot and fast boot are disabled.
How to start Laravel project with "sail up" instead of "./vendor/bin/sail up"
Tags: laravel, bash, sail, alias
Published: 2022-05-31 19:11:14


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

**This tutorial explains how to create a shorcut in your terminal to allow you to start your Laravel project with `sail up` command instead of `./vendor/bin/sail up` using .bashrc in MacOS.**

There are only 2 little steps!

## Before starting
First, you need to open your terminal. Simple, isn't ? 😂

## Step 1
In your terminal, run this to open your `.bash_profile` file :
```
nano ~/.bash_profile
```

And paste this : 
```
if [ -r ~/.bashrc ]; then
   source ~/.bashrc
fi
```
Exit and save the modification. 

## Step 2 
Still in your terminal, run this to open your `.bashrc` file : 
```
nano ~/.bashrc
```
And paste this : 
```
alias sail='bash vendor/bin/sail'
```
Exit and save the modification.

## The final word 💬
Here we go, you can now open any Laravel project using Sail and write the following command to start it : 
```
sail up
```

Personally, I'm using the Docker's detached mode to free my terminal and be able to use it directly. This consists of adding `-d` like this : 
```
sail up -d
```

❓ Notice that I showed 2 steps but depending on your OS environment, you could probably skip the step 1.

Thanks for reading this little tip, feel free to add a comment to share your opinions! 😀☕
I bombed a technical interview in a very epic way!
Tags: career, motivation, todayilearned
Published: 2022-05-31 19:09:56

---
title: I bombed a technical interview in a very epic way!
published: true
description: 
tags: #career #motivation #todayilearned
//cover_image: https://direct_url_to_image.jpg
---
![A nuclear fireball lights up the night in the United States' nuclear test Upshot-Knothole Badger on April 18, 1953.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32k00gj9dad4eekhmdpc.jpg)
 
So I just bombed a technical interview in a very epic. The interviewer was asking me about concepts I have a good grasp on but every time I opened my mouth nothing intelligible was coming out. My mind just went black. After the interview, I thought I would be down but I just couldn't stop laughing at how bad it actually went. Because it actually revealed to me how I was not prepared and I have some major knowledge gaps that I need to work on. It was not an experience I wanted but definitely one I needed to have. But at least I took notes during the interview and I know exactly what I will be focusing on in the near future.
Byte sized tip: Dart and GraphQL (Flutter and GraphQL)
Tags: graphql, dart, flutter
Published: 2022-05-31 18:38:06

I have seen in some tutorials and documentations that write GraphQL query or mutation like bellow.

```dart
const String _getCustomersQuery = '''
  query Customers(\$name: String) {
   customers(name: \$name){
     id
     name
     address
     telNo
    }
  }
''';
```

In [Dart language tour](https://fartlang.org/guides/language/language-tour.html#strings) we can see there is a way to use "raw" strings.

So above query can be written without string escaping like this:

```dart
const String _getCustomersQuery = r'''
  query Customers($name: String) {
   customers(name: $name){
     id
     name
     address
     telNo
    }
  }
''';
```

Looks nice and you can just copy and paste from GraphQL playground or any other tool that you use.

Do you like to get more tips on using GraphQL with Flutter?
Great MongoDB Resources for Python Developers
Tags: python, mongodb, webdev, tutorial
Published: 2022-05-31 18:34:48

If you're new to MongoDB, or new to Python, it may seem overwhelming just how many resources are available to look at. Here are some of the most loved resources, tools, or tutorials that are guaranteed to get you started quickly with using MongoDB and Python.

###  Eve - the Python Rest API to use with MongoDB
Eve is an open source Python REST API framework powered by Flask and Cerberus. Eve offers native support for using MongoDB with python and has an easy quickstart [here](https://docs.python-eve.org/en/stable/quickstart.html).

### A FastAPI and MongoDB example project
If you don't want a wordy read through but really just need to look at some code, check out [this github project](https://github.com/mongodb-developer/pymongo-fastapi-crud). This is a simple CRUD application built using the MongoDB Python driver (PyMongo) and FastAPI. You can also follow the step-by-step [tutorial](https://www.mongodb.com/languages/python/pymongo-tutorial) for building this application. 

### pymongoarrow - a library to import/export data between MongoDB and Pandas dataframe, numpy array, parquet file, csv
[pymongoarrow](https://pypi.org/project/pymongoarrow/) takes less than 15 minutes to install, understand, and use. Way better than sifting through 4 years of stack overflow posts and trying to find a correct example of how to do this.

### Tech with Tim MongoDB Python Video Tutorials
This [short series on youtube](https://www.youtube.com/watch?v=UpsZDGutpZc&t=2s) builds a full MongoDB Python application - video 1 is about beginner level CRUD. The [second video](https://www.youtube.com/watch?v=nYNAH8K_UhI) features Schema Validation, Bulk Inserts, Data Modeling, and Advanced Queries, and the [third video](https://www.youtube.com/watch?v=nc-Kpiq1zLc) demonstrates full text search of MongoDB data.

### The MongoDB Developer Center
Last but not least, we have [our MongoDB developer center](https://www.mongodb.com/developer/languages/python/), where we feature the Python programming language and have news, tutorials, articles of interest, etc.
by developer, for developers
Tags: webdev, portfolio, html, javascript
Published: 2022-05-31 18:28:03

i have been playing with computers all my life. i am from the late dial-up internet era. the modem dialing sounds still feel like the beginning of an adventure to me.

i had the opportunity to shift careers in the last couple of years and got a nice deal freelancing remotely for a abroad company, doing web developments. i manage the server side of things and do what every full stack developer does..breaks things, then fix them.

the idea was to get my freelancing career started and have some extra job on the side, so where does that begins? a website of course.

easier said than done. life happens and i find myself stuck between completing tasks, fighting through life, or just napping..with the occasional gaming now and then (eve online, csgo anyone?) 

i still don't know what i can show in my portfolio and what not, so i just wanted to get one going. so i worked on something that has a tribute to couple of things that a like, and an Easter egg...all would be kinda appreciated by fellow developers and geeks, but not so much for any potential clients. its a lot of fun doing stuff like that.

[mohamedation](https://mohamedation.com)

the code and the website for now is on [github](https://github.com/mohamedation/mohamedation.com)
Why is CSS Hated On?
Tags: webdev, programming, discuss, css
Published: 2022-05-31 18:25:23

I've seen a lot of posts about people despising css but I don't truly understand why. Is it the lack of foundation? Is it the specificity or the abundance of properties? If you guys want, I can create a multi-part series of CSS starting from the absolute basics to the advanced properties of CSS or I can create a huge cheat sheet on it for an easy bookmark. Let me know what you think of CSS in the comments and should I create an in-depth post or cheat sheet about it?