teleren/devto huggingface dataset:
Predict
Tags: twiliohackathon
Published: 2020-04-30 22:59:23

## Predict
#### Category Submission: Exciting X-Factors
Predict is a simple but powerful Machine Learning SMS API that can predict the gender of an individual from their first name.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/d1r5sy6c3lxepxw7guav.png)

## Demo Link
[https://twilio-predict.herokuapp.com/redoc](https://twilio-predict.herokuapp.com/redoc)

## Link to Code
[https://github.com/diop/predict](https://github.com/diop/predict)

## Example
+ Web --> [https://twilio-predict.herokuapp.com/predict/michelle](https://twilio-predict.herokuapp.com/predict/michelle)
+ SMS --> [https://twilio-predict.herokuapp.com/hook](https://twilio-predict.herokuapp.com/hook)

## Software Requirement
+ Python 3.7 or later
+ [FastAPI](https://fastapi.tiangolo.com/)
+ [scikit-learn](https://scikit-learn.org/stable/)
+ [Jupyter Notebook](https://jupyter.org/)
+ A Twilio account - [sign up](https://www.twilio.com/try-twilio)

## API Documentation
+ [FastAPI](https://twilio-predict.herokuapp.com/redoc)
+ [Swagger](https://twilio-predict.herokuapp.com/docs)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
As I mentioned in my [previous post](https://dev.to/diop/democratizing-access-to-artificial-intelligence-56jj), SMS is a great equalizer when it comes to democratizing access to artificial intelligence. My idea was to build a  Machine Learning model and be able to serve it via SMS as a proof of concept. 
With SMS one does not need an internet connection or powerful mobile phones to have access to life-changing services. Only a cellular connection will suffice. What if we can leverage that basic text message infrastructure to empower the people who need it the most, and give them access to intelligence augmented services? Because then all of a sudden a farmer in a remote area can text a photo of his crop to get diagnosis or prediction on the crop's health. Somewhere else, in a remote area, a nurse can text the photo of skin leisure and get diagnostic on that particular disease. The possibilities are endless!

In this hackathon, I wanted to focus on the problem-solving aspects of SMS because most people who live in the developed world have no idea what it's like to live without adequate internet access.

There were 3 parts to my process. The first step was to gather the dataset of names, male and female. The second step was to do some data analysis and make sure that the dataset did not have any missing or duplicated values. I also needed to check if the dataset was balanced as well, meaning that I had a good even ratio of female names to males ones, not to introduce some biases in the machine learning model. Finally, the third step was to build the model and deploy it so that the Twilio client could consume it. 

This process is almost typical for any machine learning model that needs to be deployed to production. Let's help make the world a better place!
CarMessenger app
Tags: twiliohackathon
Published: 2020-04-30 22:40:11

## What I built

CarMessenger app is a platform that enables you to write a message to drivers of other cars based on their license plates. Did someone drive like a gentleman and you want to thank them for it? Did you see a stunning girl in a car next to you while waiting on a red light?

#### Category Submission: Interesting Integrations
The app integrates Twilio through .NET core backend to NoSQL database FaunaDB and Next.js frontend.

## Demo Link
[CarMessenger app on Heroku](https://carmessengerapp.herokuapp.com/)

## Link to Code
[.NET core backend](https://github.com/ondrabus/CarMessenger.BackEnd)
[Next.js frontend](https://github.com/ondrabus/CarMessenger.FrontEnd)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
This was fun. I've always wanted to get into NoSQL databases and handling SMS and Whatsapp messages. I've just never had the time or the right idea for it. This hackathon gave me a great opportunity to learn both.
I knew this project called for a NoSQL database as there can be a lot of messages coming in. I tried using Couchbase which was awesome and so easy to understand. But it required me to host it in a Docker image which seems to be quite expensive for a project that does not earn anything. Therefore, I switched to FaunaDB which uses a similar concept but was a bit of pain at the start as they don't primarily focus on C# developers. It took me one 2h Twitch session where FaunaDB guys helped me implement the basic CRUD functionality. Without proper type safety. But performance is stellar.
The center of the whole project is .NET core-based web application. I played around with the idea of having implemented every piece of backend functionality using serverless functions, but I was scared of overserverlessing. That fear of being stuck in the maintenance prison made me place my bet on .NET core WebAPI project. So far so good.
This part handles Twilio webhook notifications as well as provides data to the front-end.
The front-end is implemented using Next.js. I chose that platform because I have never had a chance to learn it. It wasn't easy and I got angry. That happens every time I actually start to discover how things work and learn the framework. Couple of hours later I find Next.js quite charming.
I started the project in the second half of April and thus experienced a lack of time. However, I'm not putting it aside after submitting to the Twilio hackathon. Quite the opposite :)

## Additional Resources/Info
I implemented a great portion of the project online during [Twitch sessions](https://twitch.tv/ondrabus).
COVID-19 Inventory Checklist
Tags: twiliohackathon, ruby, react
Published: 2020-04-30 22:28:30

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)

When I saw this hackathon on the front page of Dev.to, I was so excited. Twilio has amazing products and I was really looking forward to trying them out. I hope you enjoy the application that I build and I hope that it can be helpful during these times.


## What I built

I decided to build an inventory tracker for everyone to keep track of their supplies during this time. I wanted it to raise awareness for those who have excess and could give to others and to help those who may be in need. The app allows you to make an account, add items to your tracker, and also view items other people have listed. This way people can see what is available and can reach out to the individual. Implementing Twilio's SMS texting for Rails, a person in need is able to alert an individual to let them know they are interested in their items.


## Demo Link
You can see the app in action through this [gif](https://giphy.com/gifs/PiQPBMAWdnT8p3P9or/html5).


## Link to Code
- [Front End Github](https://github.com/mwong068/covid-19-inventory-checklist-frontend)
- [Back End Github Link](https://github.com/mwong068/covid-19-inventory-checklist-backend-)


## How I built it (what's the stack? did I run into issues or discover something new along the way?)

The front end was built using React with Redux and the RESTful backend API was built using Rails. I ran into a couple of issues with my Postgres database and I learned a lot about the differences between the types of environments run in Rails. I also had a lot of fun implementing Twilio's SMS text for Rails as the documentation was well written and easy to follow.


## Additional Resources/Info

I found these articles very helpful during my time with this project:
- [Guide to using Twilio with Rail](https://www.twilio.com/blog/2014/02/twilio-on-rails-integrating-twilio-with-your-rails-4-app.html)
- [Sample SMS Texts using Twilio in Rails](https://www.twilio.com/docs/sms/tutorials/server-notifications-ruby-rails?code-sample=code-reading-twilio-configuration-through-environment-variables-5&code-language=Ruby&code-sdk-version=default)
Good News Today! Delivering COVID 19 Good News Through Twilio's API
Tags: twiliohackathon, beginners, webdev
Published: 2020-04-30 22:19:37

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
In the time of COVID 19, it's really easy to feel anxious, overwhelmed and uncertain, specially with all the negative news around you. In an effort to help everyone focus on the positives, I created **Good News Today!**. It's a website where users can enter their Name, Number and Country, and every morning at 9 AM, a text will be sent to them with some good news about Coronavirus within their country. I wanted to help reduce misinformation by providing news articles from credible sources. And instead of scrolling through numerous news articles and feeling stressed, I wanted the users to feel calmer after reading some good news. Because no matter how dark it gets, there's always some good in the world 😊.

<img src="https://dev-to-uploads.s3.amazonaws.com/i/4ezjxt2fo5up8c697sgv.png" width = "600" align="left">
<img src="https://dev-to-uploads.s3.amazonaws.com/i/4pc0mu7sxcfltpmrp1if.PNG" width="200" align"right">


#### Category Submission: Interesting Integrations
1. NewsAPI : To query all COVID19 related news articles, with specific query params.
2. node-cron : To schedule and automate text delivery that queries the database every minute to look for upcoming users.
3. Sentiment analysis : To read the incoming news and deliver it to the user only if it is good.

## Link to Code 
{% github paridhikhaitan/good-news-today no-readme %}



## How I built it (what's the stack? did I run into issues or discover something new along the way?)
I am a relatively new developer, and getting started with the project was definitely challenging, but it was so enjoyable. To develop my application I used some React for the frontend, Node.js, Express, MongoDB and several NPM libraries.
I learnt that it's super important to break big problems down into smaller parts and work my way up from there (which is what I did to GSM encode my string, figure out scheduling with moment.js and use sentiment analysis.)
I also learnt that it's really important to read documentation and ask for help!


## Additional Resources/Info
I really want to thank the Twilio team, specially Dominik Kundel for being extremely patient in answering all my questions. In the future, I want to deploy this app with proper linting, integrate it with other NewsAPIs and statistics, and also create provision to chat with the server through SMSs.
Day 128 : The Day
Tags: hiphop, code, coding, lifelongdev
Published: 2020-04-30 22:11:27

_liner notes_:
- Professional : We had our larger team meeting. It was really great seeing everyone all together. We do a quiz game show type of thing at the end and this week was to celebrate Hairstyle Appreciation Day (yes, it's a real day, haha). After that, I continued working on the CLI tool proof of concept for a meeting tomorrow. Now, the tool assigned to me has been pretty trying to get working. One, it's using React and I haven't really used React in a while (aside from basically reusing code for my https://TicReactToe.com project from an old side project when I refactored it. Also had some difficulties with that as well.). So yeah, the React thing is my issue. Another issue was when ever I reassigned a variable I would get some cryptic error when it tried to build. After trying to fix it, I decided to head to the net and search. Finally found a GitHub issue addressing the same error (so it wasn't just me not knowing React really well, haha). Apparently it was something in the framework that didn't take into account something. Cool. Problem is, that the issue/fix was "merged" late last year, but for some reason the code was never changed. So it is still technically broken. Even later comments mention that. Since I need to get this done, I went into the node_modules folder and replaced the code myself. haha And things are working! Yay! Probably spent way too much of the day on the fix though. haha

- Personal : Last night, did some coding, listened to some music, and went to sleep. Pretty much it.

![View above a town in Paptsdorf, Germany from a mountain](https://dev-to-uploads.s3.amazonaws.com/i/3tc99zonf09eym2n9slk.png)

Just got a little more to do with this CLI tool. Going to try and finish it up tonight. Maybe I'll go through some tracks for this week's radio show as well.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube KNaIPkdAElQ %}
One Bash Alias That Makes Life Easier
Tags: bash
Published: 2020-04-30 22:08:09

## Getting Started
To set environment variables persistently, you normally have to add it to your `.bashrc` or `.profile`. However, this can be annoying, and often more trouble than it's worth. An alternative is writing a function in your `.bashrc` that appends to a global `.env` file, and sourcing that file in your `.bashrc`. I'll show the code and then break it down

```bash
setenv() {
  FILE=$HOME/.env
  if [[ ! -f "$FILE" ]]; then
    touch $FILE
    source $FILE
  fi
  echo $1=$2 >> $FILE
  export $1=$2
}

[ -f $HOME/.env ] && source $HOME/.env
```

## Code Breakdown
The first line of the function sets the file variable to a `.env` in the user's home directory. The `if` statement checks if the file doesn't exist, and if it doesn't, then it creates the file and sources it. The `echo` command appends to the `.env` file with the first and second arguments. The `export` command makes the environmental variable available right after running the command.

Finally, the last line sources the file, but only if it exists 

## Usage
You could then run something like this in your terminal (after reopening it)

```sh
setenv WORKING hopefully
```

This is the general syntax for the command

```sh
setenv <key> <value>
```

***Note***: If you refine a variable, like this,

```sh
setenv WORKING false
setenv WORKING true
```
the file will include both of these, but the first will be unused.

## Wrapping things up
I use many other aliases and functions, but this is one that I recently thought of, and it is very useful.

Thanks for reading 🎉
Radial Search
Tags: javascript
Published: 2020-04-30 21:52:12

When I was growing up I loved to draw dot to dots, now that I'm older, I just draw more complex ones.

I'm delving into procedural generation, so picture the scene you have 20 dots randomly placed across a canvas, how can you find the nearest neighbor? Simple you might think, a simple sort of an array from smallest X to largest then for a given point you could find the index next to that point, in 1D space that would work yep but now add a Y axis. A closest point could have a similar Y and a larger X. So I got to thinking about this problem, how about a Radial search?

If I plan to have a dynamic scene of points that could be added to and removed from view by moving a camera around, it's not going to be possible to index everything and retain good performance I need to look at a given point and search outwards until I find a neighbor. The plan then is to draw a line connecting the points symbolically and physically. Point A knows about Point B and Point B knows about Point A, this is so we can skip both points and find Point C when Point B is found. The goal is to create a bunch of teselating triangles.

Is my idea horrible, how would you solve it?
VSCode: Using Black to automatically format Python
Tags: vscode, python, webdev, tutorial
Published: 2020-04-30 21:40:45

---
title: VSCode: Using Black to automatically format Python
published: true
description: How to configure the Black Python code formatter in VSCode
tags: VSCode, Python, webdev, tutorial
---

[Black](https://pypi.org/project/black/) is "the uncompromising Python code formatter." It can be configured to automatically format your code whenever you save a file in [VSCode](https://code.visualstudio.com/).

Install Black in your virtual environment:
```
$ pip install black
```

Install [Microsoft's Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) in VSCode:

![Microsoft's Python extension in VSCode](https://dev-to-uploads.s3.amazonaws.com/i/e5eessq5aazplz9l95hr.png)

Open your VSCode settings, by going 'Code -> Preferences -> Settings'.

Search for "python formatting provider" and select "black" from the dropdown menu:

![The VSCode settings interface for the "python formatting provider" options](https://dev-to-uploads.s3.amazonaws.com/i/toxplnqx19i402fgmv05.png)

In the settings, search for "format on save" and enable the "Editor: Format on Save" option:
![The VSCode settings interface for the "format on save" option](https://dev-to-uploads.s3.amazonaws.com/i/1ddnyrajrv8foanj56pl.png)

Black will now format your code whenever you save a `*.py` file.

Before saving:
![Code before formatting](https://dev-to-uploads.s3.amazonaws.com/i/qk5e0inmye4z8phcc9rv.png)

After saving:
![Code after formatting](https://dev-to-uploads.s3.amazonaws.com/i/lgkkpq50djrdkd4husxu.png)

---

Was this helpful? Did I save you some time? For $1 you can...

## {% cta https://www.adamlombard.com/support-me %} 🫖 Buy Me A Tea! ☕️ {% endcta %}

---
More: [How to set Black line lengths in VSCode](https://dev.to/adamlombard/vscode-setting-line-lengths-in-the-black-python-code-formatter-1g62)

---
*Images from VSCode using [Hyper Term Theme](https://marketplace.visualstudio.com/items?itemName=hsnazar.hyper-term-theme).*
Poker in Place
Tags: twiliohackathon
Published: 2020-04-30 21:23:50

## What I built
I built an integrated video+poker web-app to allow for hosting of home games while we're socially distancing. It currently support cash-game (not real money) modes of no-limit Texas hold-em. Check out the links below to watch a video or play yourself!

#### Category Submission: Exciting X-Factors


## Demo Link
https://pokerinplace.app
https://www.producthunt.com/posts/poker-in-place

## Link to Code
https://github.com/nbclark/poker-in-place

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
I started this in early April after adding WebRTC into an iPad board game I had built. I jump-started the project by borrowing plenty of the Twilio/React sample project. I then worked on building a table layout, writing the game flow engine (betting/folding/raising). Once the engine was more or less working, I pushed the engine evaluation to firebase functions (to be able to secure player cards and prevent cheating). I then integrated the video into the table layout so you could play and talk/see each other at the same time.

The stack used is roughly: React, Firebase (storage, hosting, functions), Twilio (video), Stripe (payments), Sentry (error tracking).

I opened this game up to the public a week ago. Currently sitting at about 3000 players. It's currently free, but Twilio video costs are shockingly high that I will be adding in a paywall soon.


## Additional Resources/Info
wheat-axiomatic-character
Tags: twiliohackathon
Published: 2020-04-30 21:16:49

## What I built

An app that takes a github owner/repo and sends you the README.

#### Category Submission: Interesting Integrations


## Demo Link

Try it out live:

{% glitch wheat-axiomatic-character app %}

Try the SMS interface by texting an owner/repo to `+14092047802`

![Screenshot of SMS demo](https://dev-to-uploads.s3.amazonaws.com/i/f17aizinx10yr2vx2zc1.png)
 

## Code

{% github ryanbraganza/wheat-axiomatic-character no-readme %}



## What's it made of?

- Started with the express template on Glitch.
- Used the twilio node SDK

## Any issues?
- Had issues getting webhook middleware to work, needed to set the `url` option
- Had issues exporting/importing between glitch/github, ended up manually exporting/importing from my machine.


## Additional Resources/Info

[twilio webhook middleware](https://www.twilio.com/docs/usage/tutorials/how-to-secure-your-express-app-by-validating-incoming-twilio-requests#use-twilio-express-request-validation-middleware)
Integrating Twilio for Whatsapp and Azure bots (LUIS)
Tags: twiliohackathon, csharp, azure
Published: 2020-04-30 21:15:34

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
#### Category Submission: Interesting Integrations (Twilio for Whatsapp with Azure Cognitive Service, LUIS)

I built a library (a class called TwilioAzCognitiveIntegrator) in C# for using LUIS (the Azure service for Language Understanding

Why? Because I had a chatbot build with Azure Bot Framework, and I have to evaluate if my bot can work with whatsapp. But in Azure Bot Service, the only channel with Twilio is SMS, so I had to create a new solution for that


## Demo Link
The demo works with Twilio for whatapp. 
In your account, you can configure the webhook in whatsapp sandbox with this URL: https://demotwilioluis.azurewebsites.net/message/index

![Demo in sandbox](https://github.com/nescampos/twilioluisdemo/raw/master/images/0.PNG)


## Link to Code
The code is in my github repo: https://github.com/nescampos/twilioluisdemo

## How I built it

To do this, and considering that my bot used LUIS to interpret the questions (and give me a score for the user's question, to know if it was a normal or negative comment), I built a class that calls the API of this service simulating the Same use of Bot Framework, and depending on the score of the question (positive or negative) I can have different answers for the user (the answers are saved by database, but for this demo, they are in a JSON file in the project).

![Responses JSON file](https://github.com/nescampos/twilioluisdemo/raw/master/images/2.PNG)

Then, using C#, I created this API call in combination with the Twilio library for C#, in order to generate the answers to the detected question / intention.

![C# library](https://github.com/nescampos/twilioluisdemo/raw/master/images/1.PNG)

Finally, I created a web application with ASP.NET MVC that calls my new class (with the parameters in the web.config file for LUIS app keys) to return the response using Twilio Webhook.

Hope you enjoyed it, I am able for helping you with my experience #twiliohackaton

## Additional Resources/Info
If you want to understand more about LUIS (if you implement Azure Bots and you want to connect with Twilio for Whatsapp): https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/luis-get-started-get-intent-from-rest?pivots=programming-language-csharp