teleren/devto huggingface dataset:
Manage Python Applications
Tags: python
Published: 2023-01-06 01:14:51

---
title: Manage Python Applications
published: true
date: 2020-10-11 23:21:10 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/managepythonapps/
---

I’ve recently discovered an application called [`pipx`](https://pipxproject.github.io/pipx/) which allows one to install and run Python applications in isolated environments. I think of it as a package similar to `apt`, but keeps the packages nice and isolated from one another.

To Install:

```
sudo apt install python3-venv pipx
pipx ensurepath

```

By default, it will create the virtualenvs in `~/.local/pipx` and drop executables in `~/.local/bin`.

Install `diceware` using `pipx`:

```
pipx install diceware

```

List the virtual environments maintained by `pipx`:

```
pipx list

```

Upgrade a package:

```
pipx upgrade diceware

```

Add additional dependencies into a package’s virtual environment:

```
pipx inject package dependency

```
Late start to Hacktober. Life Updates. Kdramas = New Fun.
Tags: opensource
Published: 2020-10-11 23:08:05

Hello yall! It's been a week since my last blog post. The past week was super work heavy (both studies and personal, especially the job hunting). This post is to update you guys on what's going on in brief details.

Wanna start it off on a positive note, did my first ever contribution to a random person's open source project. It was not that big of a change, but it felt like I took a huge step to my developmental journey. I was in charge of creating folder structures for a project called Health Assistant Client. I created the featured file structure (the way the maintainer wanted) and is waiting for it to merge to the main branch now. It was a big thing for me, so I am proud of myself lol. I also have a few big problems that I am hoping to be assigned for the rest of my time in Hacktober. Links will be given to the repos at the end of the blog post. 

(Go to the end if not interested in my personal problems, I am just writing out my stress lol)

Alright, now life updates. Actually had to visit my doctor 6 times the past month. What's sad is that my doctor only had appointments open during my class hours, so I missed a lot of class and got behind. That's one of my reason being slow to update my Release 2.0 Issue 1. But, I caught up with what I missed, so won't be late. And yep I am in good health right now. The second reason I was late will be, Job hunting and kdramas. I got hooked to kdramas 2 weeks ago and been watching every day ever since. I applied to lots of jobs these past months and is wishing for interviews to be coming up soon. Hope I get at least 5 interviews lol. 

Oh, the midterm week starts next week, gon be hectic. Planned on finishing what I have for this weeek during this weekend. So, that way I won't lag behind others. So wish me luck lol. 

Thank you for reading through my useless thoughts and I kinda feel less heavy as I let it out lol. 
Thank you for checking/reading this blog post out, I'll post updates on what I do during my developmental journey here (I'll still post if I am working).
Thank you and see ya later this week!

Oh, the links -

[The Repo](https://github.com/kelumsampath/health_assistant_client)

[The Issue I got assigned](https://github.com/kelumsampath/health_assistant_client/issues/2)

[The PR of the Issue](https://github.com/kelumsampath/health_assistant_client/pull/3)
RetroTS- Porting the RetroForth VM to Typescript
Published: 2021-03-10 23:40:01

---
title: RetroTS- Porting the RetroForth VM to Typescript
published: true
date: 2020-10-11 22:53:00 UTC
tags: 
canonical_url: 
---

This weekend I ported the [Javascript version of RetroForth](https://git.sr.ht/~crc_/retroforth/tree/master/vm/nga-js) to Typescript, while also adding support for ES modules. The source code is available [here](https://github.com/RickCarlino/retro-ts). A live demo can be seen [here](http://rickcarlino.com/retrojs/).

If time allows, I will update the editor to use [Monaco](https://microsoft.github.io/monaco-editor/) and add more HTML5 canvas support.
Designing Code: The Start of my Coding Journey
Published: 2020-10-11 22:24:08

I am a creative thinker by nature, a fashion designer by trade.  For four seasons, 12 deliveries each year I designed a new collection. Every collection is composed of colors, fabric, inspiration, trim, prints, styles... the combination of possibilities are endless! No two seasons ever look the same -  a thousand different combinations make a thousand different creative solutions to the same problem. There is no right or wrong way to do it, there is only your sensibility leading the way. 

With Covid came a halt to the fashion industry and a need to reinvent. Asking myself where there was growth and creative potential during a pandemic lead me to coding - maybe that could be my new medium for designing and creating. All the elements of the design life that I knew seemed there, albeit in different form: websites have color stories, they use proportion through layout, each one is different from the others, surely the person who “made” them must have been inspired by something! I could do it! Yes, I knew there would be nitty gritty but I thought, all of these websites look so *pretty*, I could design them!… 

My newbie coder self is already laughing at my pre-coding self. Although I only have two weeks of the Flatiron School’s First Mile curriculum under my belt, already I’m blown away by the thought process that is required to write code. I thought I’d find the parallels in creative thinking and that if I was a good designer, I would also be a good coder. Instead, I’ve found that coding has turned my whole way of thinking upside down! Gone are the endless solutions to a design problem and all the different ways you could get there. Gone is the notion that you’re never right or wrong. So far I’ve found I am varying degrees of wrong until suddenly it’s right. Sometimes it feels magical, other times, like slow torture. There may be different ways of getting there, but in code, your program either works or it doesn’t and the next part of my coding journey will be wrapping my designer brain around the way the computer thinks. 

Here’s to hoping I’ll crack the code and creative problem solve my way to bug free programs that run those *pretty* websites :)
Handling Arguments in Twitchio for Beginners
Tags: tutorial, beginners, python
Published: 2020-10-11 22:18:33

### Introduction
As programmers, it is often referred to as a rite of passage to create your own chatbot. When I first started creating my own Twitch bot, issues started arriving when handling arguments in messages. Depending on how in-depth the Twitch chatbot is going to be, the passing of arguments is a common thing that should be simple.

[Getting Started](https://twitchio.readthedocs.io/en/rewrite/twitchio.html#getting-started) has a quick and easy bot example that seems to be the only Twitchio documentation section where it mentions how you can handle passing arguments.

```py
   async def event_message(self, message):
       print(message.content)
       await self.handle_commands(message)
```

While it is not referring to how arguments should be passed within chat messages, it covers how you should pass the message to handle it as a command. 



### My Improper Fix 
I first encountered the problem when I wrote a quick function to handle the arguments. The argument would take the message as an argument and give me the individual words after the command.
 
```py
   def get_args(self, ctx):
       if self.has_args(ctx):
           return self.clean_message(ctx)
```


### The Proper Fix
When I started creating a Discord chatbot, I quickly realized how easy handling arguments are without my quick fix mentioned above. There is no need for another function to handle the arguments. The [Parameter](https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#parameters) section of Discordpy documentation covers everything someone would need to be able to write commands that handle arguments, even in Twitchio!

```py
   async def test(ctx, arg):
       await ctx.send(arg)
```

Passing the parameter in the command definition is a valid way and exactly how you would handle it if you were just making a function for passing arguments in Python.
Debug and Test Operator SDK in VS Code
Tags: kubernetes, operator, testing, vscode
Published: 2020-10-11 21:24:13

If you built a kubernetes operator with Operator-SDK and you need to use environment variables, you will find it difficult to debug and test in VS Code. There are many avenues to debug and test:
1. `make run`
2. `make test`
3. VS Code debugger 
![vscode debugger icon](https://dev-to-uploads.s3.amazonaws.com/i/e7o4sxizlv0ii4gww86b.jpg) 
4. VS Code CodeLens 
![vscode CodeLens UI](https://dev-to-uploads.s3.amazonaws.com/i/kupcbo6sg7ahr5crx7cf.jpg) 
5. `go run`
6. `go test`

## `.env` File

First, we need to centralize all environment variables into a `.env` file in the project root.

Here is an example of how the `.env` file should look.
```
FOO_BAR=barfoo
DEBUG_LEVEL=info
WATCH_NAMESPACE=""
```
The only caveat is your file must NOT contain any # characters. Makefile uses # for comments and will not play friendly.

## `godotenv` Package

Next, you will add [the `godotenv` package](https://github.com/joho/godotenv), which reads `.env` and creates environment variables.

Now, in `main.go` add to the beginning of the `main` function
```go
// Set env vars, if available.
godotenv.Load("./.env")
```

## Testing

Using the same approach, you can make a method in a unit test file like this
```go
func before() {
  godotenv.Load("../../.env")
}
```
Call `before()` at the beginning of any test that requires environment variables.

## VS Code

These changes are necessary to make VS Code CodeLens work. Add this property to `.vscode/settings.json`
```json
{
  "go.testEnvFile": "${workspaceFolder}/.env"
}
```
and the `envFile` property to `.vscode/launch.json`
```json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "FooBar",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}/main.go",
      "envFile": "${workspaceFolder}/.env",
      "args": []
    }
  ]
}
```
## Conclusion

That's it. Now, you can debug and test any way you want. Enjoy!
Open Source: 1st week done and I'm loving it! 🥰
Tags: opensource, hacktoberfest, frontend, react
Published: 2020-10-11 21:04:37

It's been almost a week since I [dropped my side project](https://www.indiehackers.com/post/im-dropping-my-side-project-f08f83d251) and started working on open source and and I'm really loving it!!! 🥰

After hearing about Digital Ocean's [Hacktoberfest](https://hacktoberfest.digitalocean.com/) from some developers, I couldn't wait to get started and make my mark in the open source world!

About a week later I finished 4 pull requests and now I'm waiting to get the special-edition free shirt. 🙃

## But that's not the end of it...

I didn't want to stop there. I decided to test out my React skills by creating a simple [Emoji-Search with React](https://www.indiehackers.com/post/after-learning-react-for-a-week-i-made-an-emoji-searcher-tool-be5250d48f). And that was **super fun**.

![screenshot of web app](https://i.ibb.co/PTDSrG3/screenshot.png)

I [open-sourced it on Github](https://github.com/BraydenTW/react-emoji-search) only expecting to get a few stars, but ended up getting [over 30 in a week!!](https://www.indiehackers.com/post/30-stars-on-my-github-repository-in-1-week-0e499e7c5e) 🎉

Of course, that leads to other important responsibilities too. I had to review a decent amount of pull requests and issues which took up some time. However, I'm happy with this. I know that I can help improve the experience of others and do the same for other developers' projects.

I can't wait for the next week, and the next week, and the next week. 😁

This is gonna be an awesome ride 🚀 and I'm glad to have your support.

![High five](https://media0.giphy.com/media/l4JyWbjK3kXPS0Hn2/giphy.gif)

---

🔗 react-emoji-search: https://github.com/BraydenTW/react-emoji-search

---

*Posts referenced:*

🙄 *[I'm dropping my side project](https://www.indiehackers.com/post/im-dropping-my-side-project-f08f83d251)*
🔍 *[After learning React for a week I made an emoji-searcher tool](https://www.indiehackers.com/post/after-learning-react-for-a-week-i-made-an-emoji-searcher-tool-be5250d48f)*
✨ *[30 Stars on my Github repository in 1 week!](https://www.indiehackers.com/post/30-stars-on-my-github-repository-in-1-week-0e499e7c5e)*
My #100DOC - Day 46
Tags: 100daysofcode, challenge
Published: 2020-10-11 21:03:27

### Day 46: October 11, 2020

#### **Today's Progress**: 
1. **[Redesign of my portfolio](https://github.com/pablohs1986/pablohs1986.github.io)** (1h 45min):<br>I continued working on works and contact section. Delving into flexx classes in Bootstrap.
    
#### **What I learned**: 
* Review flex classes in Bootstrap.

#### **Total time**:
1h 45min.
ES6 Part 2 const
Published: 2020-10-11 20:34:05

**Intro**
let is not the only new way to declare variables in ES6. We are also introduced to another keyword called const.

**How is const different from let**
const has all the same features as let with one additional key difference, variables declared with const are a constant value and cannot be reassigned:

```
const myDog = "Penny"
myDog = "Butch" // will return an error
```

**When to use const**
You should always name variables you don't want to reassign using const. This will prevent you from accidentally reassigning a variable when coding using larger code bases.  

**You can mutate an array or object using const**
While variables cannot be reassigned using const you can still mutate objects (including arrays and functions):

```
const myTeam = ["Shaq","Fisher","Kobe"]

myTeam = ["Duncan","Parker","Manu"] // will throw an error

myTeam[1] = "Horry"

console.log(myTeam) // [ 'Shaq', 'Horry', 'Kobe' ]

console.log(myTeam)
```
As you can see you cannot reassign the array using the const keyword but you can mutate the original const array.

**Prevent object mutation**

If you still need to prevent an object from being mutated ES6 provides Object.freeze

```
let obj = {
  name:"Pippen",
  defense:10
};
Object.freeze(obj);
obj.defense = "9"; // will be ignored. Mutation not allowed
obj.shooting = 7; // will be ignored. Mutation not allowed
console.log(obj); // let obj = {name:"Pippen",defense:10}


```
React Style May the 4th Challenge
Tags: hacktoberfest
Published: 2020-10-11 20:31:53

## What I Learned From Hacktoberfest

My first real contribution to someone else's project was through Coding Train's Repository.  I took on Coding Challenge #101 - Called May the 4th.  I put a spin on it of course.  I didn't use the programs that the website uses, instead I used React.  It took me a bit to get the basics done, but I did it.  I might make tweaks here and there but the official PR was accepted and published to their site here https://thecodingtrain.com/CodingChallenges/101-may-the-4th.html.

Here is my live link that they published https://coding-train-may-the-4th.vercel.app/

I even went on and made a few changes here and there and published a new version through a different branch on my own repository here https://coding-train-may-the-4th-pages.vercel.app/. 

I would love some feedback on what you think on either live version.
should you learn THE CLOUD?
Tags: beginners, aws, firebase, azure
Published: 2020-10-11 20:07:25

keeping-up with technologies is very hectic, but bear with me, and let’s see if you should invest your time in it? or maybe not?  
----



What is the cloud, I hear you ask! It’s 2020 everyone has heard of the term, but it seems like people don’t really know what it means, and they have weird expectations about what it can do. Let’s start with a simple definition.


__cloud computing:__ the delivery of on-demand computing services, from applications to storage and processing power over the internet, and on a pay-as-you-go basis.


__do we really need it?__

 Yes, we DO! Whoever you may be, running your own startup, software developer, or just a user of a cloud application ( Gmail, Google Drive, Google Docs). Everyone will benefit time and money. Though I can nerd-out and keep ranting about the endless possibilities of cloud computing, I’m keeping it short so you don't spend the day on an article.   


__Are people really switching to the cloud?__


 Cloud-based apps are expanding by the day. Their number has nearly tripled between 2013 and 2016, from 545 to 1427 different services and revenue from the sector is expected to grow in adoption to 56% by 2020, jumping to $331 billion by 2022 (from $175.8 billion in 2018). 

__should you learn it?__


 Maybe, It all comes back to what you are interested to build. As it has not fully dominated the field yet, it’s not a must, but it will be replacing a lot of jobs and creating new ones in the near future, so I think that early adopters we’ll have great leverage. If you have the time, I strongly recommend that you take the jump. 

__Top cloud providers (2020):__

 1. Amazon Web Services.

 2. Microsoft Azure.

 3. Google Cloud Platform.
Consider Not Using 3rd Party CDNs
Tags: html, javascript, cdn, hosting
Published: 2020-10-11 19:41:35

---
title: Consider Not Using 3rd Party CDNs
published: true
description: A Response to Please stop using CDNs for external Javascript libraries
tags: html, javascript, cdn, hosting
//cover_image: https://direct_url_to_image.jpg
---

I just read https://shkspr.mobi/blog/2020/10/please-stop-using-cdns-for-external-javascript-libraries/ and I feel the need to expound on the points.

1. Caching

Great questions from @edent, but no answers. I am disappointed. Thankfully, a bit of searching and I learned some things.

https://zoompf.com/blog/2010/01/should-you-use-javascript-library-cdns/ says that the network effect of caching simply isn't there. That was in 2010. With even more varying javascript libraries in 2020, it is probably even more true. Further, because of latency of DNS lookup and TLS session creation, a connection to a new 3rd party host is slower than doing none of that because it is already done. Further still, Hoffman says that assuming a slowish internet speed -- although not all that slow for a highly variable mobile connection -- the time to connect is about the same as the time to download at ⅓ of a second. Excellent analysis by Hoffman, I highly recommend reading his post.

2. Speed

Eden gives a strawman argument. I am disappointed. Of course we want our sites to be fast. Attempting to make them faster by misguidedly offloading some large assets to another server isn't a wrong idea. The notion that you shouldn't do A unless you can do B is foolish. But none of it matters given the argument from 1, so we can ignore 2.

3. Versioning

Indeed the low hit rates cited by Hoffman in #1 are surely contributed to by the varying versions of libraries out there. This is the world of javascript where there is a new version every week and so there are 520 versions of jquery in the past 10 yrs alone. ;)

4. Reliability

Unless you ARE a CDN, it is highly like that the CDN will be more reliable than your own site. I do not feel this is a believable argument.

5. Privacy

Excellent questions, but I'd go much further and not form them as a question. By using a CDN you are giving away all of your users usage patterns to a 3rd party. This is unacceptable.

6. Security

Excellent point, and while IMO it is far less likely that a popular, well-run CDN is going to be compromised than your typical website run by our average IT department or devops group, it is absolutely imperative that we consider the risk.

So What?

So What?

So, understand what risk you are taking by using a 3rd party CDN and consider not using them.
First post... Sentiment Scoring in Python with Amazon Comprehend Service
Tags: python, aws, machinelearning
Published: 2020-10-11 19:20:49

Here is an easy sentiment scoring sample that demonstrates how to calculate sentiment in stock tweets. It's probably not a fast track to stock market riches.

I pulled this code from the Amazon SageMaker Notebook I've been tinkering with. It should be pretty easy to get running using Tweepy for pulling tweets and the Amazon Comprehend NLP service to score.

``` Python
import boto3
import tweepy

// Get your API keys from your Twitter developer dashboard
api_key = 'twitter-api-key'
api_secret = 'twitter-secret-api-key'
access_token = 'twitter-access-token'
access_token_secret = 'twitter-access-token-secret'

// Twitter Auth
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

# Define the search term and the date_since date as variables
stock_symbol = '$tsla'
since_date = '2020-10-08'

# Get stock tweets
tweets = tweepy.Cursor(api.search,
              q = stock_symbol,
              lang = 'en',
              since = since_date).items(10)

// Get Comprehend client
client = boto3.client('comprehend')

# Score and print tweets
for tweet in tweets:
    response = client.detect_sentiment(Text = tweet.text, LanguageCode = 'en')
    print(response, tweet.text)

```
Output will likely have mostly neutral scores and the occasional positive, negative, or mixed. 

Sample positive output:
```
{'Sentiment': 'POSITIVE', 'SentimentScore': {'Positive': 0.6346455216407776, 'Negative': 0.022199517115950584, 'Neutral': 0.3431503474712372, 'Mixed': 4.635075583792059e-06}, 'ResponseMetadata': {'RequestId': '676a38f1-9ba3-4276-b883-8eb0f1594962', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '676a38f1-9ba3-4276-b883-8eb0f1594962', 'content-type': 'application/x-amz-json-1.1', 'content-length': '163', 'date': 'Fri, 09 Oct 2020 02:53:41 GMT'}, 'RetryAttempts': 0}} $RH nice setup is brewing, supporting off of the 20 EMA. look for a few more days to support at this level for a m…
```

Good luck and have fun with some easy sentiment scoring.
Meteor Impact 2020 private meetings
Tags: meteor, watercooler, tutorial
Published: 2020-10-11 19:17:20

Starting on Monday October 12th you can schedule private meetings on the Meteor Impact website! This is the best way to have meetings with other Meteor developers like you would at a live conference.

To get started go to the [schedule meeting](https://impact.meteor.com/meetings/private) page and select the people you want to meet.

![Scheduling private meeting start](https://dev-to-uploads.s3.amazonaws.com/i/ehe65d49yja53rd7ihbk.png)

Probably best to send them a message ahead of time, which you can do when you check the person's profile ([list of attendees](https://impact.meteor.com/people) is available if you are registered) and you will see a button to send the person a message.

After selecting the participants you will be presented with a calendar of available dates. Meteor Impact 2020 allows you to schedule a private meeting between October 12th and October 25th.

Finally you put in a name for the meeting and any additional message/description/agenda.

![Private meeting finished](https://dev-to-uploads.s3.amazonaws.com/i/vfa08jr3qoskvlomc1bc.png)

The last thing remaining is to send an invitation which the system will do for you. Each participant will then reply and tell you if they will attend. You will also see a countdown to the meeting.

Once it is time for a meeting you will be able to enter a video conference. It is the same system that is used for the regular talks. So if your system can run Zoom (or more specifically its web version), then you are fine.

Enjoy!

--------
If you like my work, please consider supporting me on [GitHub Sponsors ❤️](https://github.com/sponsors/StorytellerCZ).
Day 87: Vue project
Tags: 100daysofcode, vue
Published: 2020-10-11 19:13:38

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uubozdr3kbqqtwxohqzj.png)

Here is the todo app, competed but not deployed. A blend of the project I created at the beginning of my 100days of code and Brad Traversy's [Vue Js Crash course](https://www.youtube.com/watch?v=Wy9q22isx3U). 

This was simpler than using Vanilla Js. 

_Day 87_