teleren/devto huggingface dataset:
Part 8 - Trying to get eSlayers to MVP
Tags: react, typescript
Published: 2020-08-03 02:31:51

There are so many features that I want to get out before I launch this site but I need to remind myself that those are all things that can come later in the project's life. I need to stay to true to the MVP that I set out for this project

My checklist of things I wanted
* Search for a summoner
* Display top players in TFT
* Summoner stats
* Summoner match history

The last piece of data that I am working on is the top players for TFT. I want to display a list of players on the home page that will show the top 20 players in Challenger.

There are a couple of tricky things to this list that I have to consider. The API returns all the players in Challenger in no particular order. The list is an array of objects with 100 entries. Since I am trying to return only the top 20 players I will have to do some logic that will sort the players based on their League Points and filter out the rest.

This is what my `index.tsx` looks like for now.
![index component](https://dev-to-uploads.s3.amazonaws.com/i/7lfrw8s4cb4vn5bre37j.png)

And I get my top 20 players from Challenger on the home page
![Top 20](https://dev-to-uploads.s3.amazonaws.com/i/qu7ik7ojqwiyhsoiycis.png)

Awesome! So now that I am "finished" with the MVP data. I am going to move on to styling the pages.

Next up I will be deciding on a color scheme and then start on the layout of the website.
Ruby on Rails & Routes
Published: 2020-08-03 02:20:39



As a developer one of the things I always look in my applications is simplicity. Simplicity in my code and a good user-friendly experience for my users. Our routes and the way we set them up would make a big difference in the overall performance of our app. 


Rails is a really beautiful and magical thing, and that apply to our routes too.The Rails router recognizes the URLs and sends them to the action of a controller. You can also generate routes and URLs, avoiding the need for code strings in your views (yes, this's not Sinatra anymore). In general, "routing" is how URLs are "handled" by your application. In the case of Rails, it's generally what controller and what action from that controller will handle a particular inbound URL. In Rails applications, the paths are located in the file <b>config/routes.rb<b>.


A great way to set your routes is using <b>resources :users</b>. This would automatically create seven routes (all of them connected to our <b>UserController</b> actions. The seven routes are the following: 


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


Routes can be declared available only to specific members (not collections) using the method <b>resource</b> instead of the <b>resources</b> in <b>routes.rb</b>. With <b>resource</b>, an index path is not created by default, but only when one like this is explicitly requested:


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


Another really useful way to organize our routes is by using nested routes. The way I use to understand nested routes is thinking about it like a really organized way to create routes based on your ActiveRecord Associations. For example, you could guess a figure <b>has many</b> comments just to looking a route like this --> <b>"/figures/2/comments/4"</b>.


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

There's two really important rules I just learned using nested routes this past couple of weeks:


1. If we didn't specifically restrict the routes, Rails would generate all the typical routes for the nested resource as well. Be really specific and have a clear idea of how your routes should look like.


2. As a general rule, never generate any of the member routes when nesting. Member routes should only belong to top-level resources. There's nothing wrong with defining the same resource at two levels.


Routes can be confusing at first, but if you have a clear understanding of how to use RESTful routes and how to set up your associations from the beginning this task would be one of the most useful because your routes are that first real interaction with the logic behind your application.


Thank you for reading! :)
Speed Up your Linux & Reset default setting .
Tags: linux, ubuntu, productivity, performance
Published: 2020-08-03 01:10:07

#To Restore default setting :
Open your terminal and use the following command 
      `~$ dconf reset -f /`

#To speed up your system :

* Autoremove will remove unnecessary crabs remained while uninstalling apps .

    `~$ sudo apt autoremove`
* Autoclean will remove caches .
 
    `~$ sudo apt autoclean`

#Remove Startup application :
When you start you pc startup apllication makes a bit slower while opening. 
###So we can remove this by going to the /.config directory :

`~$ cd ~/.config`

`~$ cd autostart`

Either remove filese with .desktop extension or move somewhere if you want backup 

###For removing :

`~$ rm *.deskotp`

#Change GRUB_TIMEOUT 10 to 3

Goto the following directory :

`~$ sudo gedit /etc/default/grub`

change **GRUB_TIMEOUT** to 3 

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

and save the file . 
And you are done , enjoy fast development experience on your linux machine .
What is your #1 favorite web framework?
Tags: javascript, framework, discuss, webdev
Published: 2020-08-03 01:57:12

What is your favorite or go to JS/CSS framework for web development? 
Today, in 2020 there are quite a lot of JavaScript, CSS a d HTML frameworks, most that make our lives as developers easier.

So let me know what your favorite framework is and why it is your favorite!

Mine i would say is Ember JS because of its resemblance to html and Semantic for CSS framework.
Spent the whole day redoing my landing Page
Published: 2020-08-03 01:42:48

---
title: Spent the whole day redoing my landing Page
published: true
description: 
tags: 
//cover_image: https://direct_url_to_image.jpg
---


https://www.weblister.co
I created a site which i wish everyone of you to add your websites, so that we make an online directory for website.
So far, 4 sites listed.
Then i got to work from 2-August 2020 at 09:00 Am till now - 03-August 2020 02:20 AM.

What have i achieved?
1. A new landing page with. Which speaks more about what the site is. 
2. A new page for more information
3. A new user profile's page with more functions. 

What am I up to now? 
Taking a nap, God willing, wake up to another project.
Should I drop PHP?
Tags: php, codeigniter, flask, python
Published: 2020-08-03 01:41:39

TL;RD I'm unsure.

I started programming in ColdFusion, when it was owned by Macromedia (remember "Shockwave"?), since then I've learned more than a few languages, both compiled and scripted, and I've always believed that every language has its time and place. C/C++ has been with us since always (maybe the "more experienced" devs can say "I remember when C was just a letter") and is still here because of it's speed?, reliability?, documentation?, Java for its portability, even Cobol had an specific orientation (given by the technology available).

Around 2002 I decided that I'd drop ColdFusion (no matter how much I love it) and make the switch to PHP, both Web oriented languages. But I'm also a sysadmin (maybe I'm a sysadmin first), I need to be able to quickly write a script for something, or a daemon for whatever reason, Bash and Perl were the selected languages for my sysadmin stuff. 

I was very happy with that combo for quite a few years, I also added some ADA and Pascal at university, Java/C++ when I started my Mobile Development phase, then I met Python and replaced Perl completely. I don't really remember how many programs and systems I've made with PHP for web development and Python for server stuff.

### Enter Rust
I'm more of an old-school-sysadmin, I prefer stability and reliability for my servers, that's why I use Debian and don't particularly like Ubuntu for servers. Same goes for languages, I saw from a distance how Ruby dethroned Java/C/C++ as language of the year in 2006, then I saw it fall (It went from 11th to 15th according to TIOBE a the time of writing this post). Something similar happened when I learned about Go (I don't believe it's going to stick with us, no matter how much Google would like that) but I'm currently unsure. 
Have you seen Rust's performance? I mean: wow.
Take a look at Rust. If you're interested on software to work and not get carried away by other secondary things, I believe you'll like it.

Anyways... my thought process at this time is this: I relly like PHP (I understand why you might not like it, but remember "a time and a place"), it gave the speed Web Development needed to develop the way it did, and not sacrificing too much in the process. Python is Python: pretty, fast, simple, and easy to read. I've been moving from server stuff to web (I love Flask, I hate Django) and it has proven for me a better alternative than PHP/CodeIgniter, so... now I'm faced with the question: Should I drop PHP/CodeIgniter, replace it with Python/Flask and learn Rust for the server stuff? I don't know.

I'm about to start a huge project, I know how I'm going to use CodeIgniter 4, the modules, the design, every thing is in my head, but I'm not sure to start with it, a gut feeling.
I'm not sure how I'm going to design the system in Flask, too many unknowns, but for some reason I believe it's better to make the switch...
dyld: Symbol not found: _ffi_prep_closure_loc
Published: 2020-08-03 00:48:12

Did a regular `flutter run` targeting my iPhone simulator today and this craziness showed up on my screen.

```bash
Error output from CocoaPods:
↳
    dyld: lazy symbol binding failed: Symbol not found: _ffi_prep_closure_loc
      Referenced from: /Users/toure/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
      Expected in: /usr/lib/libffi.dylib

    dyld: Symbol not found: _ffi_prep_closure_loc
      Referenced from: /Users/toure/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/ffi-1.13.1/lib/ffi_c.bundle
      Expected in: /usr/lib/libffi.dylib
```

After much longer than I liked, I found a fix buried in a [github issue](https://github.com/ffi/ffi/issues/687#issuecomment-468005152).


```bash
gem uninstall ffi
brew reinstall libffi
export LDFLAGS="-L/usr/local/opt/libffi/lib"
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
gem install ffi
```

I decided to share this since the error in the title of the issue is different from the one that I got. Hope this can save someone some time.
Breadth First vs Depth First Search
Tags: beginners
Published: 2020-08-03 00:44:23

Search algorithms are something that I have not had to consider much when building full stack applications, but they are an important component of programming as they are frequently discussed in interviews. I am going to run through the differences between depth first and breadth first search and discuss when each is optimally used. 

### BFS
BFS stands for breadth first search. This method of search finds the shortest path to the target value, but is typically slower than depth first search. BFS utilizes a queue data structure to store values visited. It follows a 'first in first out' method and travels to each adjacent value before moving deeper. To demonstrate, I've created a sample "tree". A BFS search of the following tree will visit the nodes in alphabetical order:
```
      A
    /   \
   B     C
  / \   / \
 D   E F   G
```

### DFS
DFS stands for depth first search. This method of search examines each value in a branch then moves to an adjacent branch. DFS utilizes a stack data structure to store values visited. After each value in a branch has been visited, all values are popped from the stack before moving to an adjacent branch. As with the example above, a DFS search of the following tree will visit the nodes in alphabetical order:
```
      A
    /   \
   B     E
  / \   / \
 C   D F   G
```

### Which algorithm should I use?
BFS performs better when searching values that are closer to the source. DFS is a better option when searching values that may be further from the source and is typically the safer choice.

Because BFS searches each neighbor first, it is not an ideal solution for decision making trees. DFS is a better solution for decision making trees because once a value is targeted you will be interested in the paths that extend from that value.

BFS and DFS are the most elementary examples of search algorithms; they can become much more intricate and complex. Determining which algorithm is best depends on many factors, such as the ordering of the data (is it sorted? roughly sorted? in random order), and the structure of the data (is it hierarchical?). It is also important to recognize the constraints of the system running your search program: is it memory-sensitive, or CPU-sensitive? In short, there is no universal "best" search algorithm - but luckily, this isn't a new problem in the computer science community, so there are many resources to help make this decision.

### Resources
1. Visualization of BFS and DFS on [VisuAlgo](https://visualgo.net/en/dfsbfs).
2. Searching Algorithms on [GeeksforGeeks](https://www.geeksforgeeks.org/searching-algorithms/).
Different ways to send an email with Golang
Tags: go, email
Published: 2020-09-07 12:13:36

---
title: Different ways to send an email with Golang
published: true
date: 2020-08-03 00:00:00 UTC
tags: Go,Email
canonical_url: https://www.loginradius.com/engineering/blog/sending-emails-with-golang/
---

In this blog, we’ll look at different methods to send an email with Go, First we will explore inbuilt smtp package, then we will move to use a popular package Gomail and finally we will send HTML emails using custom templates.

   
[Read On](https://www.loginradius.com/engineering/blog/sending-emails-with-golang/)
Launched my first website
Tags: codenewbie, webdev, 100daysofcode
Published: 2020-08-02 23:51:46

TL;DR: After 15+ years of not coding, I'm getting back into the game. Please provide your feedback on the layout, any issues you may come across in the code, etc. Thank you!


Hello all! I recently started learning webdev after 15+ years of not programming; long story short - I was a Senior Software Engineer about 20 years ago and then promoted into management and I stopped coding. This is me working to get back into coding.

I started a course on Udemy that covers HTML, CSS, Bootstrap, Node, Express, React, MongoDB, etc., etc. and I started to forget what I had learned so I started to build this website.

I welcome any and all feedback. 

[https://secure-beyond-31319.herokuapp.com]
Python control flow question
Tags: python, beginners
Published: 2020-08-02 21:51:18

Hello everyone,

so I just covered control flow in Python from the book I am using and will like to test my knowledge.

I gave myself this task: a manager has 20 days to complete a project. She needs to give the project owner the number of days it will require her to wrap up the project.

If she inputs
0 day then the task is done.
Anything between 1 to 19 days, the program tells her the number of days left.
20 days, she needs to get the ball rolling!
more than 20 days, she gets a warning

see my code below, kindly let me know how to improve it


#project deadline countdown

#project requires 20 days to completion
projectDays = 20 

#How many days do you need ?
print ("How many days do you need: ")
managerRequest = int(input())

#execute this condition if the manager's requested days for completion is greater than 0 but less than 20
while  projectDays > managerRequest and managerRequest > 0  :
    print ("You have " + str(projectDays - managerRequest ) + ' day(s) left.' )
    managerRequest =- 1

#execute this condition if the manager's request is more than 20 days    
if managerRequest > projectDays: 
    print ("You have only have " + str(projectDays) + ' days for execution.')
    print ("You have " + str(managerRequest - projectDays) + " day(s) deficit")

#execute this condition if the manager's request is exactly 20 days
elif managerRequest == 20:
    print("kindly get to the job!")

#execute this condition if the manager's request is 0 days i.e task completed!
elif managerRequest == 0:
    print("Weldone on completing the project")



finally, I will appreciate more instructions that I can try coding based on Control flow, so that I test myself further.

much thanks
React performance affected by nested component constructor call?
Tags: react, javascript, frontend
Published: 2020-08-02 23:43:41

Hell all,

Does performing the conditional render logic in the render method affect performance? 
Because if i do the condition render logic outside the component it will not call the nested components constructor. 

Example:
Page
 item text="data" 
 item text="data"
 item text=""
Page

inside page component conditional logic {data &&  <item text="data"}

basically if this item has data it will render else it wont. So if no data being passed the item constructor will not be called.

This is standard however I prefer to put the conditional check inside my component like this:

inside item component
render(){
if(!props.text){ 
return null
}
return div{props.text}div
}

This will however call the constructor and life cycle methods of List component. I want to do it this way because it makes the component more reusable and dont have to keep writing the conditional rendering logic outside the component.

Will it be a big performance hit?
I am aware of ShouldComponentUpdate however the first render may be slow right?
Creating docker image from scratch and adding to local registry
Tags: linux, devops
Published: 2020-08-02 22:50:54

---
title: Creating docker image from scratch and adding to local registry
published: true
description: We will create an image from scratch in docker and add that to a docker registry so we can reuse that image when we create new docker instances, controlling the whole flow.

tags: Linux, devops
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/hcqj9s0ydes8k6ycx8v7.jpg
---

{% youtube zqH_G0yNEDw %}

We will create an image from scratch in docker and add that to a docker registry so we can reuse that image when we create new docker instances, controlling the whole flow.
Do you use a vim-like editor?
Tags: discuss, editors
Published: 2020-08-02 21:53:59

---
title: Do you use a vim-like editor?
published: true
description: 
tags: #discuss #editors
//cover_image: https://direct_url_to_image.jpg
---

Do you use a text editor that is like vim? 

Know about any good vim alternative? 

What does it do better than vim?
Which is the best language for SEO?
Tags: discuss, seo, learnseo, questions
Published: 2020-08-02 22:00:49

Hi! I own a digital marketing agency in Uruguay and im also the owner of a well known SEO Blog (https://nichoseo.com/). I've always made Wordpress websites but now Im curious to know...

Which is the best language for SEO purposes? I've been recommended to try Phyton but Im a rookie and I want to understand the basics first.

Hope this makes sense!
New Meme !
Published: 2020-08-02 21:38:04

Our coding bootcamp instructor, Brian Rice, has been guiding us through some uncharted, dangerous paths. I made this meme to express my gratitude, as it takes patience and persistence to master new concepts!

<img src=https://i.imgur.com/CfwREzy.jpg>

Thank You Captain Brian, for guiding us on the Good Ship codevid-20
Recuperate
Tags: 100daystooffload
Published: 2020-08-02 21:19:42

For eighteen weeks, like many people, I had little or no interaction in person with anyone. Eventually I met a friend whilst sat at opposite ends of a bench, and following that travelled to have my first meeting in person since March. So far, so cautious; and this was accompanied by not a small amount of self-righteousness at how "well" I have been able to stay away from others.

Last week, and for the first time since Christmas, I stayed with my family and within ten minutes any sense that there was a contagious disease causing havoc around the world had vanished. I found myself being swamped by two toddlers and could not have been happier. From having little to do other than obsess over the utterly abysmal performance of our government and the innumerable tragedies that it is responsible for, for one week my biggest trouble was having to pick up and carry a limpet of a one-year-old, then put them down before obviously having to pick them up again. Bliss. Chaotic, exhausting, messy, noisy bliss.

*I'm publishing this as part of 100 Days To Offload. You can join in yourself by visiting [https://100daystooffload.com](https://100daystooffload.com).*
Take care of what you have now so that it takes care of you in future
Tags: codenewbie
Published: 2020-08-02 21:19:31

In programming there's this policy of "take care of what you have now so that'll take of you tommorow".  I've been thinking of it in relation to the PCs or Macs we use no matter how fancy or even if it's not working properly as long as you can write code on it just keep it in best conditions possible in future you'll appreciate it .

Attimes we wanna contemplate on the data subscriptions ,the prices of acquiring some paid courses, attending a bootcamp training among others that will help you master and improve our developer skills but if you choose to  focus on what you want to achieve in future you'll just be left complying to the policy of taking care of what you have now so that it takes care of you in future.
Some Terminal Commands to Make Life Easier
Tags: codenewbie, todayilearned, macos
Published: 2020-08-02 21:17:20

When you are used to doing something for so long, it could be a hard habit to break. Even though it takes up more time than it should we still do it. In particular I am talking about the computer mouse. As you read this, you will learn how to become faster and efficient at using the terminal so that you could use the mouse less!

####**cd *name of folder**
- This very popular command allows you to see into the chosen directory.

####**cd ../**
- Alternatively, this command backs you out of the current directory.

####**ls**
- This commands lets you see the files/folders inside of the current directory.

####**open** 
- Pretty straightforward here, it opens the current folder or file. If you type the filename after 'open' then that particular file will open. If not, everything in the current folder will open.

####**mkdir *newfoldername**
- This allows you to create a new folder.

####**touch *newfilename**
- Create a new file using the 'touch' command

####**mv**
- To move a file to another folder or directory, you must use the mv command correctly. You would type in 'mv', the file name and the new location. *Ex: $~ mv 'myfile' 'new/location'*

####**clear**
- This is a very useful command for when you feel like you ust need a clean slate in your terminal. The clear command does just what the name implies, it clears you terminal.

####**help**
- Gives you a list of helpful commands

####**exit**
- Exit your terminal
Help with Pipenv
Published: 2020-08-02 21:11:43

I want to start my first Django project using python in VSCode. I've gathered that I need to create a virtual environment, and I'm trying to use pipenv for this. I've installed Pipenv correctly, but when I run "pipenv shell" it gives me an error, _syntax error: "invalid syntax"_. Why is this happening? How can I solve it?