teleren/devto huggingface dataset:
Facebook Unofficial API + Chatterbot Bot Part 3: Scratching the Chatterbot + Integration
Tags: fbchat, chatterbot, python, bot
Published: 2019-08-14 01:46:15

Hello everyone in this tutorial we will just pass by chatterbot's place and say hi

#### First things first: Import libraries

```
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
```

This lines will import the Chatbot class and ListTrainer which will be used to train the bot.

#### Create a bot

```
chatbot = ChatBot("Adam")
```

#### Get a response

```
response = chatbot.get_response("Good morning!")
```

#### Whole code

```
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer

chatbot = ChatBot("Adam")
response = chatbot.get_response("Good morning!")
```

I showed you guys some very simple snippets of fbchat and chatterbot. Its time to
integrate the two

### Chatterbot + FBChat

![Thanos joining two stones](https://cdn.images.express.co.uk/img/dynamic/36/590x/secondary/thanos-time-stone-1494507.jpg?r=1536157631599)

So every-time someone sends us a message we want to send it to chatbot then send then then response back to the user. So how we do that?

#### Import libraries
```
from fbchat import log, Client
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from fb_creds import user_name, user_pass
import pickle
```

fb_creds is file where are creds are being stored. The pickle library will be used to store and retrieve session cookies.

#### Creating the bot

```
chatbot = ChatBot("Adam")
```

####  Behold the new onMessage

```
def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs):
        self.markAsDelivered(thread_id, message_object.uid)
        self.markAsRead(thread_id)
       
        # If you're not the author, echo
        if author_id != self.uid:
            # LINES FOR ECHOING 
            response = chatbot.get_response(message_object.text)
            message_object.text = response
            self.send(message_object, thread_id=thread_id, thread_type=thread_type)   
```

So now we are now making use of message_object to get the text message, then pass it to our chatbot. From there we change message_object text property to whatever is returned by the chatbot then we send it back to the sender. 

**WE ARE SMART RIGHT?**

![](https://reviewonline.co.za/wp-content/uploads/sites/68/2018/10/20180703190744-rollsafe-meme-520x350.jpeg)

Nuh your bot is still dum. Your bot cant get you any new girlfriends while you sleep.😔😔😔

Bye Bye
Journey to Become a Better Programmer (Day: 4, Take a break)
Tags: learned, firstyearincode, break, beginners
Published: 2019-08-14 01:45:16

Taking a break... until recently I didn't take breaks and would sit down/stand and just hammer my work out. I heard of a technique called the [Pomodoro Technique] (https://francescocirillo.com/pages/pomodoro-technique) from some fellow codders, before that, I have never heard of this and became very interested in it, this was about 7ish months ago. I really didn't think it was worth taking all those breaks and lose all that time to focus on my work. I started trying this technique about a week ago, and I must say its AMAZING! I would strongly suggest everyone at least try this. 

What I learned:
If you are like me, I almost felt guilty about taking a break. I had this job that I worked so hard to get and I wanted to make them happy. This was a hard thing for me to get over and after a week of doing Pomodoro my quality of work has improved, I am able to really focus on something and then relax the brain and then hit it again. This leads me to what I found out today, because I wasn't stressing about taking a break, I allowed my brain to think about some home projects we have planned. After the break, I took a second a look at the problem and it was like the answer just came out of the screen and slapped me. I have added this [extention](https://chrome.google.com/webstore/detail/marinara-pomodoro%C2%AE-assist/lojgmehidjdhhbmpjfamhpkpodfcodef?hl=en) to chrome and it really helps to stay on task/break. Remember to take a break, it's okay.
![Alt Text](https://media.giphy.com/media/9u514UZd57mRhnBCEk/giphy.gif)
I published my first Alexa Skill – Profession Finder
Tags: alexa, skills, dev
Published: 2019-10-14 08:50:36

---
title: I published my first Alexa Skill – Profession Finder
published: true
tags: alexa, skills, dev
canonical_url: https://boobo94.xyz/alexa/my-first-alexa-skill/?utm_source=rss&utm_medium=rss&utm_campaign=my-first-alexa-skill
---

_This article was published originally on [boobo94.xyz]( https://boobo94.xyz/alexa/my-first-alexa-skill/). So if you want to read more articles like this please [subscribe to my newsletter](https://boobo94.xyz/#colophon) or follow me here_

I published my first Alexa skill for the US store and it started slow. One week ago I released my first personal skill, [Profession Finder](https://www.amazon.com/dp/B07W3YDGVX/) after some time that I hesitated. The skill aims to discover the professional typology of the user by asking a set of simple questions.

## How it works my Alexa Skill – Profession Finder

The interaction with the Alexa skill is very simple. There are two main intents available where the user can start a new test and find his profession or consult his actual result.

The test is selected randomly and is composed of multiple questions(around 40, depends on by test). The questions are very simple and the answer can be affirmative or negative. You are able to repeat the question in any moment, by asking Alexa:

> Repeat the question!

After the last question, Alexa sends you the response<mark id="annotation-text-aaf6d6a9-e73a-4685-988d-1ebec96ad5e1"></mark>, informing you about your profile, what that profile title means and what professions are common for it. If by any chance you interrupted the test, next time will start from the beginning.

In any moment you have the possibility to check your profile, by asking Alexa:

> Which are my results

If no results are available, the skill will ask if you want to start a new test.

Feel free to ask for help by simply saying:

> Help

Alexa will present the available intents offered by the skill. To close the skill is very simple, just ask the skill to close in any way defined as default for Alexa skills.

Do you want to make a try? Install [Profession Finder](https://www.amazon.com/dp/B07W3YDGVX/) and discover what type of job fits you.

PS: If you need to understand more about Alexa Skills, please take a look at my previous article [5 common questions about how to build an Alexa Skill (Amazon Alexa)](/ai/5-questions-build-custom-alexa-skill/).

_This article was published originally on [boobo94.xyz]( https://boobo94.xyz/alexa/my-first-alexa-skill/). So if you want to read more articles like this please [subscribe to my newsletter](https://boobo94.xyz/#colophon) or follow me here_
Analyzing Meetup Data With SQL And Tableau
- A Free Webinar
Tags: career, beginners, sql
Published: 2019-08-14 00:46:07

If you work in the data science or data engineering field then you will more than likely interact with data warehouses and dashboard development at some point.

The combination of both together allow you to both manipulate and display data easily.

Our team has been working on scraping data from the Meet-up API and we figured this would be good basis to help show some people how to develop a data warehouse as well as run analysis on the data from said DW.
Our goal will be to go from raw data to Tableau dashboard with metrics and some other tips and tricks along the way.

If you're interested in learning more about both data warehouses and data analytics, then [sign up here](https://forms.gle/X6NAzfFjG7qu6PQA6). We will be hosting the event on Saturday September 7th 10 AM PT.

Also, feel free to watch our first video where we show you how to pull data yourself from Meetup!

[![](https://thepracticaldev.s3.amazonaws.com/i/7fjy2zl4pciqierx7mpx.png)](https://youtu.be/Roe2SsX3b18)
Code Editors That I Have Found To Be Useful
Published: 2019-08-14 00:16:03

A few days ago, I joined the Dev.to community.

Since I'm still sort of an intermediate/beginner coder, I thought it would be nice to share which websites are great for me.

Side note before we begin: I currently use a Chromebook and a desktop for coding. So if you have something different, you might have to look something. Also, my desktop is really outdated, since it's on Windows 7, so yeah, ouch.

Websites that have helped me or inspired me:

webmakerapp.com/app/ (My other main editor. Works like a charm.)
codepen.io (More inspiration & one of two main editors)
github.com (inspiration and ideas)
stackoverflow.com (forums helped answered questions
codesandbox.io (a helpful coding editor I found)
codecademy.com (For learning the basics of languages)
repl.it (For primary Ruby development since my Chromebook doesn't have a ruby text editor. Also, I have an administrator Chromebook, so I can't use the other text editors from Chrome Web Store because they're blocked.)
dev.to (For overall learning)

Well, that's currently my list, and I might update it in the future.

Later!

FYI: sorry if the links aren't linkable, I can't tell on my Chromebook.... so then just type it in a new tab.
TODO list in VSCode
Tags: vscode, productivity
Published: 2019-08-14 00:02:43

---
title: TODO list in VSCode
published: true
description: a Look at TODO Tree extension in VSCode  
tags: VSCode, Productivity
---
_This article was inspired by a thread on [Twitter](https://twitter.com/thecaitcode/status/1160348409313652736) started by [Caitlyn Greffly](https://caitlyngreffly.com/)_  

So, the problem is how do you manage your TODO list as you are coding? You are working on basic functionality in a component and having a working plan, either in a working flow diagram or a written list. How do you have those mental notes of TODO's? There are a few simple options: 
- A handwritten list (who writes anymore?)
- A Markdown file in the project directory
- A Trello of Board is a good visual reminder, especially when coupled with the Trello mobile app.

##VSCode Extensions   
If you are using VSCode as your IDE, you already know there are a ton of extensions for almost everything you need. For a few months now, I have been using an extension called [TODO Tree](https://marketplace.visualstudio.com/items?itemName=Gruntfuggly.todo-tree) which displays a tree view in the explorer pane of VSCode. Clicking a TODO within the tree will open the file and put the cursor on the line containing the TODO.

Here is how it basically works. Install the extension from the link above and test it out by adding a TODO to your source code like this: 
`// TODO - todo note`

or a FIXME note
`// FIXME - fix something`  

Now let's explore the interface

##Interface 
![GIF of the Toolbox in Action.](https://thepracticaldev.s3.amazonaws.com/i/uw5odwnsgfep9d56iczc.gif)

Notice in the sidebar you now have a box for TODO Tree. There are several icons (see above) which give you different options to filter and display the list of TODO's or FIXME notes. When you click on any of these notes the source file will automatically open. 

##Highlight 
One of the nicest features, in my option, is the ability to highlight the notes in the source code and color code the icons in the TODO Tree. This feature is well documented in the source code and I have provided my settings below. Just copy to your VSCode settings.json:

```
  "todo-tree.customHighlight": {
    "TODO": {
      "icon": "check",
      "type": "line",
      "iconColour": "yellow",
      "foreground": "red",
      "background": "yellow",
    },
    "FIXME": {
      "icon": "beaker",
      "iconColour": "red",
      "foreground": "white",
      "background": "red"
    }
  },
```
Here is the result:

![Screenshot.](https://thepracticaldev.s3.amazonaws.com/i/vporbgidpzomglepojz2.png)

Give TODO Tree a try and if I can help with your configuration message me.
How design system helps to unify frontend across teams and move faster
Tags: designsystem, css, webdev, showdev
Published: 2019-08-18 08:54:49

---
title: How design system helps to unify frontend across teams and move faster
published: true
tags: ['design system', 'CSS', 'webdev', 'showdev']
canonical_url: https://learnwithparam.com/tech-talks/scaling-the-frontend-using-design-system/
---

Again one of my favourite talk, In this video,

Ryan explains about his experience about building design system and why they build it in first place and also how it helps their team to scale the front end.

{% youtube EK7lm5Jkq1I %}
EBS Installed Applications
Tags: ebs, oracle
Published: 2019-10-05 08:12:24

---
title: EBS Installed Applications
published: true
date: 2019-08-14 00:00:00 UTC
tags: EBS, oracle 
canonical_url: https://hiltonmeyer.com/articles/ebs-installed-applications.html
---

Scripts for find EBS Installed Applications

```
SELECT
fa.application_short_name,
fa.application_name,
fpi.patch_level,
DECODE(fpi.status, 'I', 'Installed', 'S', 'Shared', 'N', 'Inactive', fpi.status) status,
fpi.db_status
FROM
fnd_product_installations fpi,
fnd_application_vl fa
WHERE
1 = 1
AND fa.application_id = fpi.application_id
ORDER BY
fa.application_short_name;
```
Facebook Unoficial API + Chatterbot Bot Part 2: The Echo Bot
Tags: fbchat, python, echobot, bot
Published: 2019-08-13 22:50:27

Hello everyone, In this we will do a simple echo bot for the purposes of testing if fbchat library is working and for wreaking instant karma...........


#### Echo Bot

An echo bot simply echoes back whatever is given to

You: Sun
Bot: Sun
You: Moon
Bot: Moon
You: Zen
Bot: Zen

![Some random zen joke](https://i.pinimg.com/originals/3c/18/c2/3c18c2c1ae018b6f2e830e7afe95184a.jpg)

In short whatever you give, it returns. Ok lets get our hands dirty

##### First things first: Importing libraries

```from fbchat import log, Client```

Client is the main class of fbchat, which contains all the methods you use to interact with Facebook. You can extend this class, and overwrite the on methods, to provide custom event handling (mainly useful while listening).

On the other hand logging is simply used for logging

##### Subclassing the client class

```class EchoBot(Client):```

I just died and on reincarnation I decide to be Client's son so I inherit all
the good genes(properties and methods) he has. How lucky i am.

##### Overriding the onMessage

onMessage method is executed every-time a message is sent whether from you or someone else. However we want it to execute in some special way different from the parent class so we override it.

```
def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs):
        self.markAsDelivered(thread_id, message_object.uid)
        self.markAsRead(thread_id)

        log.info("{} from {} in {}".format(message_object, thread_id, thread_type.name))

        # If you're not the author, echo
        if author_id != self.uid:
            self.send(message_object, thread_id=thread_id, thread_type=thread_type)
```
##### What Happening

* We get a message
* We tell the sender that his message was delivered and read
* We log some info which we received
* If the id that sent the message is not ours we simply echo back the message

##### Last but not least: Loging in and listening

```
client = EchoBot("nightfury@mars.example", "easypass123")
client.listen()
```

![Ear cleansing](https://www.askideas.com/media/15/Ear-Cleaning-Funny-Picture.jpg)

We create our Echobot object then get into listen mode. What we receive we return back given that we did not send that message. Breaking this condition will result in an endless echo loop that is if facebook doesn't ban you.

Bye bye
Advice on using a header in text to re-organize a large dataset
Tags: help, bash
Published: 2019-08-13 22:15:46

---
title: Advice on using a header in text to re-organize a large dataset
published: true
description: I need help organizing FASTA genetic data files.
tags: #help #bash
---

Hi Dev Community,

I have over 100 files in the following structure (called a FASTA -- very familiar to those of you who spend time looking at genetic data):

**Original File 1**:
>**\>Gene1_id1**
>GATCGATCCGA
>ATGCAGTCCAG
>
>**\>Gene2_id1**
>ATGCATGCAGC
>ACTAGGCCACG
>CCGTAGCGGAC
>
>**\>Gene1_id2**
>TAGCTAGCAGT
>TAGCTAGCCGA

Each of these ~100 files contain ~20,000 of these genes.  The problem is that my files are organized such that `Gene1` IDs are blended alongside `Gene2` IDs.

For my analysis, I need all of my `Gene1` IDs organized in one place.  I will ideally end up with one file for each `GeneX`, like so:

**Desired Final `Gene1` File**:
>**\>Gene1_id1**
>GATCGATCCGA
>ATGCAGTCCAG
>
>**\>Gene1_id2**
>TAGCTAGCAGT
>TAGCTAGCCGA

The length of sequence varies between genes and between individuals within genes, so I need all the lines below a header line and above the next header line to be associated with the header.

My current solution has been to take each file, and then create a new file based on the header of each line.  So the first file creates three new files: one for `>Gene1_id1`, one for `>Gene2_id1`, and one for `Gene1_id2`.  From there, I was planning on re-organizing to suit my needs.

The problem with the above approach is that it has created ~800,000 similarly-named files which are killing my computer.  There must be a better way.

Any advice on how to proceed?  Thanks!!!

-Hannah
Help! I have my first client
Tags: advice, mentoring, discuss, help
Published: 2019-08-13 22:02:09

---
title: Help! I have my first client
published: true
description: 
tags: #advice #mentoring #discuss #help
---
Well, that was quick. I have my first job. A long time colleague from a major broadcast company has approached me, "you know how to do this app stuff, don't you?" Long story short: I've got the go ahead to build a web app. My problem: how to I charge?
1. I don't want to take the Mickey.
2. Transparency
3. I'm a LONG way from being a senior - experience wise.
4. I know I can build what they want.

I will do it through my company - charge a fee to build, a monthly fee for servers (AWS) and a fee to upkeep the code. 

So how do I structure this? 

Any advice would be very appreciated.
Descriptor Protocol and how ORM uses it?
Tags: python
Published: 2019-08-13 19:40:30

# What is descriptor?
_(Of course, some geeky definition coming)_

According to official python3 docs, this is what they are saying
> In general, a descriptor is an object attribute with “binding behavior”, one whose attribute access has been overridden by methods in the descriptor protocol. Those methods are \_\_get\_\_(), \_\_set\_\_(), and \_\_delete\_\_(). If any of those methods are defined for an object, it is said to be a descriptor.

Now it seems pretty clear that we need a class and and in that class we need to define these methods and that's it. Let's try out

```python
class A:
    def __get__(self, instance, owner):
        return instance.__dict__[self.name]
    
    def __set__(self, instance, value):
        print("setting the attribute")
        instance.__dict__[self.name] = value

    def __delete__(self, instance):
        del instance.__dict__[self.name]
    
    def __set_name__(self, owner, name):
        self.name = name
```
Now we want to use this descriptor
```python
class B:
    a = A()
i = B()
print(i.a)
# KeyError: 'a'
i.a = "wysiwyg"
# setting the attribute
print(i.a)
# wysiwyg
```

# Use cases
_(Okay, enough chit-chat let's fight, sorry sorry let's understand how we can use this concept)_
So suppose you want validation before setting a value or getting the value. But wait there are getters and setters, right? Yes, there are but I am a fan of DRY and I solemnly swear to not repeat except necessary. So even if the condition is same you have to use setter each time for each attribute. 

```python
class CheckString:
    def __set_name__(self, owner, name):
        self.name = name

    def __set__(self, instance, value):
        if isinstance(value, str):
            instance.__dict__[self.name] = value
        else:
            raise ValueError("Value must be string")


class User:
    name = CheckString()
    email = CheckString()
    
    def __init__(self, name, email):
        self.name = name
        self.email = email

u = User("Sumit", 1)
# ValueError: Value must be string

```

Now if we want to implement the same with property how we would have
```python
class User:
    def __init__(self, name, email):
        self._name = name
        self._email = email

    @property
    def email(self):
        return self._email

    @email.setter
    def email(self, value):
        if isinstance(value, str):
            self._email = value
        else:
            raise ValueError("Value must be string")

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, value):
        if isinstance(value, str):
            self._name = value
        else:
            raise ValueError("Value must be string")

...

u.email = 1
# ValueError: Value must be string
```

In the next post, we will try to decode how ORM(Object-Relational Mapping) take advantage of descriptors.



|Liked my post?|
|---------------|
|  [![](https://thepracticaldev.s3.amazonaws.com/i/lsfkqfysa58u59627uy6.png)](https://ko-fi.com/A0A5WBC1)|
How do you decorate, and customize your computer?
Tags: watercooler, customization, humor, computers
Published: 2019-08-13 21:57:36

I recently just bought the laptop I am typing on right now, thus, *(I always wanted to use "thus")* I haven't had time to put my own custom "deco" on it.

On my last computer, my brother had been throwing out a bunch of old National Geographic maps, so I cut one to the size of my screen and glued it on. ***lol*** 

Even worse, afterwards because I needed my raspberry pi for a project, I taped a raspberry pi zero to the back of it, and then taped a USB plug to the back to power it with the port on my laptop. *Surprisingly*, its **still** on nice and firm!

But, before I totally ruin my computer, I was wondering, How do you all customize yours?



***Have fun!***
How would you rate your dev skills
Tags: career, webdev, interview, discuss
Published: 2019-08-13 21:24:27

---
title: How would you rate your dev skills
published: true
description: 
tags: career, webdev, interview, discuss
---

I'm sure everyone here has had a preliminary phone interview. My question is how do you answer this question:

How would you rate yourself in **x** language on a scale from **1-10**?

Recently, I was asked this question and I gave an answer of **7.5-8** out of **10**. To me this translates that I can figure out the answer if I don't know it and can break down problems into manageable chunks.

What do you all think? How would you rate your skills in JavaScript, Python, etc?
Facebook Unoficial API + Chatterbot part 1: Setting Environment
Tags: facebook, chatterbot, python, bot
Published: 2019-08-13 21:15:13

Hello everyone in this series i will talking about how to create a facebook bot + a chatterbot. I wont try to be preachy here. I will just go straight to the point.

### FBChat

According to pypi **fbchat** is a Facebook Chat (Messenger) library for Python. No need for XMPP or API key to use. Just use your email and password and you are good to go. In other words FBChat is unofficial don't do something fishy with it or your account will be blocked.

### Chatterbox

ChatterBot is a machine-learning based conversational dialog engine build in
Python which makes it possible to generate responses based on collections of
known conversations. The language independent design of ChatterBot allows it
to be trained to speak any language. Which means you can use Chinese, Shona, Hindu e.t.c

### First things first

#### Create a python environment

`virtualenv -p python3 facebookapp`

#### Activate the enviroment

`source facebookapp/bin/activate`

#### Now Install libraries

`pip install fbchat`
`pip install chatterbot`

Libraries installed we are now good to move to the next part.

Bye Bye