teleren/devto huggingface dataset:
It's Okay To Try Again
Tags: cs50, webdev, html, css
Published: 2020-04-06 14:25:41

It's been a month now since I've started the [HarvardX: CS50W (CS50's Web Programming With Python and JavaScript)](https://cs50.harvard.edu/web), or simply CS50W, course on January 20th this year. I've finished the [Lecture 0: Git](https://cs50.harvard.edu/web/) and [Lecture 1: HTML, CSS](https://cs50.harvard.edu/web/#html-css) on the 21st and started doing the [Project 0: Homepage](https://docs.cs50.net/ocw/web/projects/0/project0.html), the very first project of this course, on the 22nd day. I decided to make a personal portfolio website with a blog about me and the web. Since then, I'm both studying HTML, CSS, Bootstrap and SASS, and apply it on my website. I still making it until now. I thought of, finally submitting it today. It's my goal for this week but unfortunately, not.

While I'm recording a screencast for my project website, I discovered its errors. There's a button that is not working properly, some parts that are not responsive, and so on. I just comforted myself by saying, "It's okay. Take your time." Since the objective of this project is for me to "[Become more comfortable with HTML and CSS to design and style webpages](https://docs.cs50.net/ocw/web/projects/0/project0.html)" and "[Learn to use SCSS to write more complex stylesheets for [my] webpages](http://https://docs.cs50.net/ocw/web/projects/0/project0.html)", I am very comforted. I'm a bit angry to myself because I already have history of HTML and CSS from school but I think I really have to dig in to it, and I do believe the saying, "Basic is important." It's so important that I have to really study it and this will also a preparation for the future.

I have requirements to fulfill and I don't want to submit a project that I think was not worthy for Harvard. [Harvard](https://www.harvard.edu/) and [EdX](https://www.edx.org/) are big names. So for now, I'll continue working for my project and improve it, and learn at the same time. There's no better way of learning than practicing, right?

Fighting! Godspeed everyone.
How To Host Your Website In 30 Seconds
Tags: html, javascript, webdev, startup
Published: 2020-04-06 14:00:45

So you’ve just bought an amazing new website template, customized it, and now want to show it off to the world?

Here’s how to publish it in seconds with [tiiny.host](https://tiiny.host):

<br />
 
### **Step 1: Zip up your static files**

Open the directory containing your static files which must include an index.html file.

![Zipping files on Windows 10](https://tiiny.host/blog/assets/posts/1_2MULlPYS5St4F__ZaDuruA.png)

**On Windows:** Select all your files → right click → Send to → Compressed (zipped) folder.

**On Mac:** Select all your files → right click → Compress X items.

…And you should end up with a neat .zip folder.


<br />


### **Step 2: Upload your zip to tiiny.host**

Head over to [tiiny.host](https://tiiny.host), enter a subdomain, upload your zip and you’re done!

![Uploading to tiiny.host](https://tiiny.host/blog/assets/posts/1_UKAOBCE-isMDhZOuEmUrPA.gif)

It’s that easy!

<br/>

*Caveat: tiiny.host only works for “static websites”. A website composed of only image, html, css and JavaScript files. E.g. a HTML theme you have downloaded from themeforest.*
How to create a custom WordPress breadcrumb without a plugin?
Tags: wordpress, breadcrumbs, navigation
Published: 2020-04-06 14:20:19

Breadcrumbs are navigation links, used to display all the pages leading from the home page. This is placed at the top of the page and helps to backward navigation. You guys may think what is the purpose of this post as there are tones of plugins that are doing the same job. Well, the answer is simple the more plugins or external resources you use, the more heavy and hard to maintain your website.

{% github https://github.com/ahmedhere/wp-breadcrumb-function no-readme %}
About Ruby Hash::new
Tags: ruby, hash, documentation
Published: 2020-04-06 14:11:30

---
title: About Ruby Hash::new
published: true
description: 
tags: ruby, hash, documentation
---

Get more information and more examples at my AboutRuby project:
* [AboutRuby project](https://github.com/BurdetteLamar/AboutRuby/blob/master/core/Hash/api/markdown.md#new)

Here's the write-up over at the Ruby project:
* [Ruby project](https://ruby-doc.org/core-2.7.0/Hash.html#method-c-new)

My main page is [here](https://github.com/BurdetteLamar/AboutRuby#about-ruby).

TL;DR

I've been working on enhancements to the documentation for the Ruby project.  Getting these enhancements posted to the Ruby project has been very slow.  They're not actually meeting resistance;  I know because my many PRs for enhancing class ENV were accepted (though not rapidly).  It's just that everyone is busy.

Anyhow, I'm stashing all this stuff on in my own project, called AboutRuby.  The piecemeal migration from there to the Ruby project is not going to be completed in my lifetime (I'm 77 years old).

So:  I'm going to blow my own horn here on DEV, to encourage you to use the enhanced documentation.
Daily Challenge #219 - Compare Strings
Tags: challenge
Published: 2020-04-06 14:09:28

---
title: Daily Challenge #219 - Compare Strings
published: true
series: Daily Challenge
description: Find how many times the second string shows up in the first one. 
tags: challenge
---
Create a function called that accepts 2 string arguments and returns an integer of the count of occurrences the 2nd argument is found in the first one.

If no occurrences can be found, a count of 0 should be returned. The first argument can be an empty string. The second string argument must be of at least length 1.

###Examples
`strCount('Hello', 'o') // => 1`
`strCount('Hello', 'l') // => 2`
`strCount('', 'z')      // => 0`

###Tests
`strCount('oh goodness gracious', 'o')`
`strCount('howdy, pardner', 'd')
`strCount('Incumbent President', 'e')

Good luck!

***
_This [challenge](https://www.codewars.com/kata/5865918c6b569962950002a1) comes from shaddyjr on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
React Native Modal
Tags: reactnative, react, typescript, javascript
Published: 2020-04-06 13:51:37

React Native = A framework for building native apps using React

This post aims to show the solution to a problem that we recently went through using the React Native Modal component.

If you have already used it, you have probably experienced the following problem: when opening a modal, unless you have a button inside it to hide or dismiss, it will remain open as in the following example.

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

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

Researching, I managed to reach a very objective conclusion. Even if someone has solved it in another way, I am available.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2uu7ubcctki4sjthpbdp.gif)

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

With the TouchableWithoutFeedback inclusion and its behavior, I can change the state of its visibility and it will be closed after I click anywhere outside the modal.

Source code

The source code for this project is available and can be found in this GitHub repository.

https://github.com/hstrada/medium-RNModalExample
How to Rip an Audio CD in Linux?
Tags: linux, flac, ripping, asunder
Published: 2020-04-06 13:39:53

---
title: How to Rip an Audio CD in Linux?
published: true
description: How to Rip an Audio CD in Linux?
tags: Linux, flac, Ripping, Asunder
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/sn7ed0lugfxm1spbfz52.jpg
---
{% youtube SZP_--gXrpo %}

Ripping an audio CD means to copy the audio tracks from the CD to your computer in a format that is playable on devices other than a CD player, for example, your smartphone. There are multiple formats in which you can rip your audio CD, and they can be broadly divided into lossy (compressed) and lossless (uncompressed) formats. For example, MP3 is a lossy format, which means when you convert an audio track from an audio CD to an MP3, it loses some information. The loss of information makes the file size smaller that is easier to store without sacrificing much on detectable audio quality at least by most people listening on everyday non-specialized audio equipment. Lossless formats, on the other hand, preserves all the information that was originally recorded in the studio. The original lossless format in which CDs are written is called WAV. A typical 5 min song in WAV format takes around 50 Mb of disk space. With the storage costs lowering day by day, it may be acceptable for many of us to copy the WAV files without going through the hassle of converting them into any other format. However, one of the disadvantages of WAV format in addition to bulky file size is that it has the minimal capability to store metadata, for example, the name of the artist, album name, genre, album art etc. Lossless formats like FLAC that stands for Free Lossless Audio Codec can store metadata similar to MP3 in addition to higher quality sound as a WAV file. FLAC files also tend to be smaller than a WAV file. In reality, FLAC files are also compressed files similar to MP3; however, they don’t lose information as MP3 does. 

Links:
Asunder: [http://www.littlesvr.ca/asunder/](http://www.littlesvr.ca/asunder/)
Depois do Café - Episodio 6 - Corona Edition - O que fazer no tempo livre?
Tags: podcast, corona, remotework, portuguese
Published: 2020-04-06 13:26:07

---
title: Depois do Café - Episodio 6 - Corona Edition - O que fazer no tempo livre?
published: true
description: Nesse episódio a gente fala sobre essa experiência de trabalhar de casa em meio a pandemia do Corona Virus, e o que a Elisa e eu (@airtonzanon) fizemos em casa para conseguir trabalhar de uma forma mais confortável.
tags: podcast, corona, remote work, portuguese
canonical_url: https://anchor.fm/depoisdocafe/episodes/Episodio-6---Corona-Edition---O-que-fazer-no-tempo-livre-ece2su
---

{% spotify spotify:episode:2poDkg1CtDJtXB4DPIKI3s %}

Você também pode ouvir no seu aplicativo preferido: [iTunes](https://podcasts.apple.com/br/podcast/depois-do-caf%C3%A9-com-airton-zanon/id1480842641), [Breaker](https://www.breaker.audio/depois-do-cafe-com-airton-zanon), [Google Podcasts](https://www.google.com/podcasts?feed=aHR0cHM6Ly9hbmNob3IuZm0vcy9lMGU0MDU4L3BvZGNhc3QvcnNz), [Overcast](https://overcast.fm/itunes1480842641/depois-do-caf-com-airton-zanon), [Pocket Casts](https://pca.st/bpyo3i4y), [Radio Public](https://radiopublic.com/depois-do-caf-com-airton-zanon-6r2oLq), [Spotify](https://open.spotify.com/show/4cqX5o40bClwqtYHv9X7Lp)

Nesse episodio a gente fala sobre o que estamos fazendo no tempo livre durante a quarentena, não que tenhamos mudado muito nossos hábitos, mas talvez ajude alguém a ter novas ideias do que fazer quando você não pode sair de casa.

Este foi um episodio da Série Corona Edition, na qual vamos lançar um episodio menor que o normal toda semana, durante este surto, para comentar o que estamos fazendo depois do café inclusive nessa época.

_Obs: Esse episodio não é sobre dicas, mas o que estamos fazendo neste período._

----------------

Participantes:

Airton Zanon - [@airtonzanon](https://twitter.com/airtonzanon) (twitter)
Elisa Pedrosa Reis - [@liisapedrosa](https://twitter.com/liisapedrosa) (twitter)

----------------

 Para mais episodios e saber mais sobre o podcast acesse https://anchor.fm/depoisdocafe.

Siga-nos no twitter [@dpsdocafe](https://twitter.com/dpsdocafe)
30-Day LeetCoding Challenge: Group Anagrams
Tags: python, leetcode, coding, algorithms
Published: 2020-04-06 13:19:19

---
title: 30-Day LeetCoding Challenge: Group Anagrams
published: true
description: the 6th-day problem of 30-Day LeetCoding Challenge
tags: python,leetcode,coding,algorithms
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0ce5pfwcj9iide7geke4.png
---
### [The problem](https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/528/week-1/3288/)
**********
## Solution:

First of all, do you know [what is anagram](https://writingexplained.org/grammar-dictionary/anagram), in short, two string are anagrams **if and only if** their sorted strings/letters are equal?

So from the definition above, we can figure out a simple solution to do. We can think of that we need to maintain a list of each word and any other word that their sorted letters are equal.

The best data structure can help us with doing this is **hash map** by making `key: value` pairs which are the `key = the sorted string` & the `value = list of the corresponding words that equal to this sorted key`

Let's see an example to make it more clear.

* **Example:**

`words = ["eat", "tea", "tan", "nat"]`

1. so we need hash-map will call it `anagrams = {}`.

2. our first word is `word = 'eat'` we need to sort it so it will be `key = sorted(word) = sorted('eat') = 'aet'`

3. add to the hash-map as a key and the original word as value:
`anagrams[key] = [word]`

So, our map looks like this now: `anagrams = {'aet': ['eat']}`

4. check the second `word = 'tea'` the sorted one is `key = sorted('tea') = 'aet'`, ooh we already have this key in our map so update it is values with this new word so our map will be:
`anagrams = {'aet': ['eat', 'tea']}`

Then will keep doing this with the other two words and finally will have this map:
`anagrams = {'aet': ['eat', 'tea'], 'ant': ['tan', 'nat']}`

The list step just print the map values as our answer so our answer will be:

`anagrams.values() = [['eat', 'tea'], ['tan', 'nat']]`

* **Pseudocode:**

```
1. define our map anagrams = {}
2. loop for each word in words
3.    build the key = "".join(sorted(word))
4.    add the word to the key value list or create new key with this word (anagrams[key] = anagrams.get(key, []) + [word])
5. return anagrams.values()
```

* **Complexity:**

* Time complexity:
  * We have one loop over our words list so it is **O(n)** where **n** is the number of words.
  * We also do in each iteration sorting which will be **O(klog(k))** where **k** is the maximum length of a word in words list.
  So total will be **O(nklog(k))**

* Space complexity: will be **O(nk)** the data we store in the map

**[Solution in python](https://github.com/AhmedRaafat14/Leetcode-problems/blob/master/30-Day-LeetCoding-Challenge/group-anagrams/Solution.py)**

> There is another way to solve this problem try to find it out :).
Custom Robotic Process Automation and UiPath
Tags: python, robotics, uipath, ai
Published: 2020-04-06 13:13:25

As part of Datalabs offerings, were evaluating multiple platforms for Robotic Process Automation (RPA) and we explored few custom development options as well and there were lot of interesting learnings.

As part of custom development, we did a RPA platform to optimize an online stock trading algorithm and maximize its performance. This Fintech ML platform yielded excellent results in real time trading. Besides, we did another custom RPA development where we used NLP processor to extract instruction from English text to run an automation script to send ‘job offer letters’ to multiple people.

On the platform front, we evaluated multiple options and narrowed down UiPath and 
we have completed couple of PoC implementations with real time use cases. Few take away:

A. Custom development using Python is a good starting point to test the waters and validate your process automation goals. Python based automation with cognitive ML backend can solve your process automation challenges. The key requirement is availability of data sets to coach the platform and well defined problem statements.

B. When it comes to platforms, we went with UiPath for following reasons:

1. Simple to use and easy to train resources

2. We always look for community support while choosing frameworks as it would help clients in managing their solution in long run with better availability of resources. UiPath has good resource pool with basic certification

3. UiPath fairs better when it comes to OCR and image recognition

4. UiPath is tightly integrated with MS Dot Net and resources with good SQL skills and Dot Net framework understanding fair well with the implementation. We have trained our Microsoft.NET developers with good SQL skills on UiPath platform and that seems to be an exciting recipe.
How do you backup your code?
Tags: code, backups, programming, backup
Published: 2020-04-06 13:12:17

I read a lot about all sorts of backups for various systems, but rarely see articles or advice for backing up the **actual code** of any software.

Do you create backups of your code? If yes, how do you organize these backups and which tools do you use? If not, why not and what holds you back?
Lessons learned while working on large-scale server software
Tags: todayilearned, career, security
Published: 2020-04-06 13:00:21

*TL;DR notes from articles I read today.*

### [Lesson learned while working on large-scale server software](https://bit.ly/2R9Amub)

- Always have a plan for worst-case scenarios for error conditions, and find a general solution, such as automatically shutting down all operations and return an error code with when to retry or a contact to call.
- Document your decision making and add idempotence wherever possible.
- Approach debugging in a scientific way: first, gather data, form the right hypothesis and design an experiment to prove it, and then apply your fix; use tools to dig deep into traces and memory without stopping the system.
- Impose a strict implementation of Postel’s Law: Be conservative in what you send, be liberal in what you accept.
- Be wary of a major deployment that seems to go smoothly. Errors are inevitable and the bigger and quieter the error, the more dangerous they are. If you are not sure how to handle an error, let the system crash. It makes it easy to catch and correct errors.
- Be prepared to restart the entire system from a blank slate under heavy load. 
- Notice technical decisions and components that have global effects, not just global variables. 
- Build channels for persistent communication as new people are onboarded and leave teams. When building systems, do not assume operators will do things correctly and give them the tools to undo mistakes.  

*[Full post here](https://bit.ly/2R9Amub), 10 mins read*

---

### [Being a great engineering mentor](https://bit.ly/3dRrx1I)

- Be ready to listen. Your mentee should always feel free to ask you questions, especially in the first few weeks of onboarding. 
- Help anchor them socially in the new place. If possible, carve out a weekly team ritual.  
- Let them feel safe enough to pursue novel solutions by showing them how to evaluate risks within the context of your organization and team. 
- Explicitly inform your mentee of technical safeguards in place as well as providing non-technical assurance of help with failures. 
- Understand their strengths and weaknesses, and encourage as well as challenge them technically with tasks that let them level up while having fun, gradually adding more unfamiliar or challenging jobs. Offer code hints but don’t unnecessarily prime them with warnings of difficulties ahead, and occasionally add stretch goals and praise their resolution to build confidence.
- Have 1-on-1 discussions and reinforce when you notice they are doing a great job while challenging them to do even better and share business context they might not readily see, as well as the engineering context of their project predating their on-boarding. 

*[Full post here](https://bit.ly/3dRrx1I), 8 mins read*
Best Django Secret generator
Tags: python, django, secret, generator
Published: 2020-04-06 12:45:51

Hey Guys, 

Its been a while since I last post something... 

So today I thought why not share one of the best Django secret generator I had seen.

{% youtube JsyySe17gjE %}

anyway the gist of the video is that with python there is a module called secrets that will generate random enough that its hard to guess... you may want to go through the whole series.. but in case you just want the code

```python
import secrets
import string
print ("".join(secrets.choice(string.digits + string.ascii_letters + string.punctuation) for i in range (100)))   
```
30-Day LeetCoding Challenge: Best Time to Buy and Sell Stock II
Tags: python, leetcode, coding, algorithms
Published: 2020-04-06 12:44:08

---
title: 30-Day LeetCoding Challenge: Best Time to Buy and Sell Stock II
published: true
description: the 5th-day problem of 30-Day LeetCoding Challenge
tags: python,leetcode,coding,algorithms
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/p7xks8ijx0jqphzvgbqm.jpg
---

# [The problem](https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/528/week-1/3287/)

***************

## Solution:

So each day, we have 3-decisions to make which is buy, sell, or do nothing.

So, based on that we can crawl the whole array and compare every two numbers if the second number is greater than the first one we take the difference between them and add that difference to our `maxPrpfit` and at the end will have the total max profit we can get.

* **Example:**

`stocks = [7,1,5,3,6,4]`

1. first we will define our `maxProfit = 0`
2. so is `stocks[1] > stocks[0]`: `1 > 7` no so `do-nothing`
3. is `stocks[2] > stocks[1]`: `5 > 1` yes so but or sell which will be defined by the `subtraction operator`, `maxProfit += maxProfit + 5 - 1 = 0 + 4 = 4`

and keep doing until the end will have our result which will be `maxProfit = 7`.

* **Pseudocode:**

```
1. define max_profit = 0
2. loop from i = 1 to len(stocks)
3.      if stocks[i] > stocks[i - 1]:
4.          max_profit += stocks[i] - stocks[i - 1]
5. return max_profit
```

* **Complexity:**

* Time complexity: we just do single path so it is **O(n)**.
* Space complexity: we don't use any extra space so it is constant **O(1)**.

**[Solution in python](https://github.com/AhmedRaafat14/Leetcode-problems/blob/master/30-Day-LeetCoding-Challenge/buy-and-sell-stocks-II/Solution.py)**