teleren/devto huggingface dataset:
Day 5 of 100DaysOfCode: Python Code to Find Perfect Cube in Range
Tags: 100daysofcode, python, codenewbie, beginners
Published: 2020-12-28 14:12:39

This is the 5th day of 100DaysOfCode and I am learning more from Coursera's Python Data Structure Course and did some assignments also. 
But for my own exercise, I tried to write a code to find perfect cube numbers in a given range.
My solution is like below:
* Create a list of numbers in a given range.
* Loop through each number and find its cube root value.
* Round the number came after making cube root of a number and find its cube.
* If current number is equal to the number came after cubing the root value then the current number is perfect cube number and append it to our list.



```python
numbers = list(range(1,202))
cube_root_numbers = []
for n in numbers:
    cube_root = (n)**(1/3)
    int_cube_root = round(cube_root)
    if int_cube_root**3 == n:
        cube_root_numbers.append(n)
        print(n)
```
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 5 of <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> and <a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a> <br>* More about file handling<br>* More about List and Tuples<br>* Python code to find the perfect cube number in given range. <a href="https://t.co/fTNQm4r5n4">pic.twitter.com/fTNQm4r5n4</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1343558841221312513?ref_src=twsrc%5Etfw">December 28, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
How to Add a New Column to an Existing Table in a Laravel Migration?

Published: 2020-12-28 14:12:07

Check out this post on the [devdojo.com](https://devdojo.com/) website!

It is a post on [How to Add a New Column to an Existing Table in a Laravel Migration?
](https://devdojo.com/bobbyiliev/how-to-add-a-new-column-to-an-existing-table-in-a-laravel-migration) 🔥!

To make things even better you can use this referral link to get a free $100 credit that you could use to deploy your virtual machines and test the guide yourself on a few DigitalOcean servers:

[Digital Ocean $100 Free Credit](https://m.do.co/c/2a9bba940f39)

Link to the post:

https://devdojo.com/bobbyiliev/how-to-add-a-new-column-to-an-existing-table-in-a-laravel-migration

I strongly encourage everyone to go ahead and check out the [devdojo.com](https://devdojo.com/) website, there's a lot of valuable content there.
POP3 PHP Client
Tags: pop3, php, framework, mezon
Published: 2020-12-28 14:10:45

Hi! In this article I want to describe my POP3 client for PHP. Originally it was created for integration test, when backend sends email and I need to check it in the inbox. Later this client was improved and now it is quite suitable for enterprize purposes.
Let's start! )

# Installation

Just type

```
composer require mezon/pop3-client
```

# Usage

Firts of all you need to connect

```PHP
$client = new \Mezon\Pop3\Client('ssl://your-email-server', 'login', 'password');
```

Or in this way:

```PHP
$client = new \Mezon\Pop3\Client();

// and somewere further
$client->connect('ssl://your-email-server', 'login', 'password');
```

And then you can fetch necessary information from server. Such as:

```PHP
client->getCount(); // getting count of emails on the server
```

Or get headers of the message by it's id, get message's subject or even delete it:

```PHP
for($i=0; $i<$client->getCount(); $i++) {
	$headers = $client->getMessageHeaders($i);
	$subject = $client->getMessageSubject($i);

	$client->deleteMessage($i);
}
```

And after all things done you should close connection:

```PHP
$client->quit();
```

## Utility functions

You can also use more high level functions.

Such as deleting email by it's subject:

```PHP
$client->deleteMessagesWithSubject('Re: some subject');
```

Or check if the email with the specified subject exists:

```PHP
$client->messageWithSubjectExists('Re: some subject');// true or false will be returned
```

Or parse header wich were fetched by the getMessageHeaders(int $i): string and fetch Message-ID field:

```PHP
$messageId = \Mezon\Pop3\Client::getMessageId($headers);
```

# Learn more

More information can be found here:

[Twitter](https://twitter.com/mezonphp)
[Mezon Framework](https://github.com/alexdodonov/mezon)
Errors showing in brew services list when there are no issues...
Tags: homebrew
Published: 2020-12-28 14:08:15

Now I haven't got a fix for this but if I run `sudo brew service` instead of brew services the errors don't show, hence why everything is still working.

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

https://github.com/Homebrew/homebrew-services/issues/92
Organizing a 200+ mega-collection of dev resources
Tags: codenewbie, career, javascript, css
Published: 2020-12-28 14:07:42

What I would like to share today is yet another collection of resources. However, I do try to include the other collections I've seen as well.

This collection was made on a neat app called [keen](https://staykeen.com) which is somewhat of a Pinterest competitor focusing more on links than pictures. 

What's good about using keen is the organization, collaboration and discovery features for its content. You can also subscribe to new content notifications. 

So if you are interested in discovering awesome projects, stellar dev talks, learning resources, great developers and articles please consider checking out my [Keen on software development](https://staykeen.com/keen/uHsJwNvBdP1zRNXvF6Be). I'm open to collaborating as well so do DM me if you are interested. Thanks.
Why Use Web Scraping: Top 6 Reasons For Its Use in Tech and Non-Tech Spheres
Published: 2020-12-28 14:00:57

Modern business development is impossible without web data scraping or content extraction. The purposes of parsing internet data are almost unlimited for contemporary startups and growing businesses. However, many entrepreneurs still fail to realize the huge potential of this process.

Therefore, we devote this article to answering the question of why web scraping is important and why you should use—or at least consider—it when scaling up a project or business.
<a href =https://data-ox.com/why-use-web-scraping/>Learn more</a>
Ag is for Agile
Tags: leadership, process, agile, manifesto
Published: 2020-12-28 13:29:17

Over the past five articles, we have summarized and detailed four tenets of Ag:

1. People amplify Process
2. Demonstrations amplify Specifications
3. Collaboration amplifies Negotiation
4. Iterations amplify Intentions

The keen eyed readers have already realized this has just been a re-telling of the [Agile Manifesto](https://agilemanifesto.org) using slightly different phrases. I hope you enjoyed it anyway. And I hope it made you reconsider some processes calling themselves "Agile" and whether they actually adhere to the original vision.
Debunking 5 Popular Coding Myths
Tags: codenewbie, beginners
Published: 2020-12-28 13:20:12

I get a lot of messages from people asking how I started my coding journey. When I tell them, the next response is usually, “I’ll love to start also, but… are the reasons why I don’t think it would work for me.”

**This post is for you if you’re looking to get into coding and you’re doubting yourself or you just can get yourself to start.** 
I also recently started my journey and hope you find this helpful.

Here are common myths and beliefs that might be holding you back from getting started.

### Myth 1: Coding is only for geeks and geniuses

#### Truth: You do not need to be a genius to learn to code. What you need is a lot of patience, willingness to learn, and eliminate self-doubt.

No matter the programming language you choose to learn, be it HTML, CSS, JavaScript, C#, etc., you’ll need to dedicate a lot of time and practice frequently to be a great developer.

Coding can be synonymous with solving a puzzle. At first, it can be frustrating trying to put the pieces together but when you start understanding the logic of the puzzle, you start to feel better and in control.


### Myth 2: I need to know multiple programming languages before I can land a job

#### Truth: A programming language is basically a set of the syntax used to perform several operations like conditionals, looping, expressions, functions, etc. It’s not the number of programming languages that gets you a job but how deep you understand common programming concepts.

You can definitely get a job with knowledge in just a single language, but you will have to learn other languages as you grow in your career.

I recommend that you start with any of these languages, get grounded in it, build a portfolio, and apply for a job.

**Frontend development:** HTML, CSS, JavaScript, React/Vue 
**Backend development:** Node.js/Python/PHP

### Myth 3: I’m too old to learn how to code

#### Truth: There is no age that is “too old” to learn to code.

If you're willing to commit the time and effort it takes to learn, you're certainly ready to start your journey as a developer.  Learning to code is a never-ending process, so whenever you start, it's never too late.

### Myth 4: Programming is only for guys

#### Truth: Just like any other career, programming is not gender-specific. Women are equally capable as men.

The programming world, just like any other field is for both genders and I strongly believe more ladies should be encouraged to be programmers. As a matter of fact, a woman called Ada Lovelace was the world's first computer programmer.


### Myth 5: I need a MacBook to start Coding

#### Truth: It largely depends on what you’re working on and trying to develop. 

I can tell you that starting off programming, you don’t need a fancy computer or MacBook. With a Windows or Linux computer, you can get really far in programming.

Getting a MacBook is not a requirement!

#### Thanks for reading and I hope this post inspires you to begin your journey as a developer ❤️
Ajax Tutorial
Published: 2020-12-28 13:15:10

Ajax is a web browser application that is autonomous from web server applications. AJAX is a web development technology designed to build a quicker, better, and more immersive web application using HTML, CSS, XML, and JavaScript. With Ajax, web applications can send and receive data from a server asynchronously without disrupting the display and actions of the current page. If you are a beginner and learn more, visit the Ajax Tutorial. Ajax Tutorial, which is available online, will enable you to understand a deeper level. https://www.phptpoint.com/ajax-tutorial/
Chingu Weekly Update Vol. 127
Tags: chingu, pairprogramming, codingbootcamp, freecodecamp
Published: 2020-12-29 01:27:24

---
title: Chingu Weekly Update Vol. 127
published: true
date: 2020-12-28 13:01:55 UTC
tags: chingu,pairprogramming,codingbootcamp,freecodecamp
canonical_url: https://medium.com/chingu/chingu-weekly-update-vol-127-d611a1f4628a
---

![](https://cdn-images-1.medium.com/max/1000/0*jyef-w6PoG-8Yoh5)

### News, Shout-outs & Showcases

🔥 Happy Festivus / holiday season! ⛄️

⏲ Vintage project: [Volunteer Manager](https://volunteer-manager-app2.herokuapp.com/)by a Chingu team (Layer, Nick, Phrixus)

> _AppVolunteer Manager App helps people to recruit and manage volunteers for a non-profit project._

**Stack** : MongoDB, Express, React / Redux, Node.js

**Chingu project type** : Tier 3 🐻

![](https://cdn-images-1.medium.com/max/1024/0*lqiPmNHv5P2kNkS7.png)

🔥 Trion made a new video on how to get Google’s infamous foobar challenge!

_Google Foobar is a secret hiring challenge that allows people to solve levels and get selected by Google. There have been a lot of success stories of people getting into Google through Foobar._

( **Note** , these type of videos often get removed so it may stop working)

{% youtube w9jeNKXsYmQ %}

🔥 Related to the above: A few years ago Trion also wrote [an awesome article on his experience doing the Foobar challenge](https://medium.com/chingu/my-experience-with-the-google-foobar-challenge-and-tips-on-what-to-do-if-you-get-it-9848d31d3d20). Definitely worth a read!

🔥 Reminder: Voyage 26 will be starting on January 4, 2021

🔥 As always, we’re matching people for pair-programming sessions this week. Checkout #chingu-news in Discord to find the link to sign-up!

### Overheard in Chingu

> What’s everyone working on today?

> Working on algorithms

> yesterday I was doing some big notation with recurrence and masters theorem

> I don’t remember masters theorem anymore, I just use the tree method usually now but it is very good way, need to visit again

> this AI is fun

[How Bad Is Your Spotify?](https://pudding.cool/2020/12/judge-my-spotify/)

> Translation….they are at the bottom of the Bering Sea

> A house

> A slide

> A gaming chair

> And then last minute present wrapping and stocking stuffing

> Christmas was a success at the K household. Although I got less than four hours of sleep

> have you tried the spotify AI yet?

> I’m scared of it. I’m a Ludditte

### Resources of the Week

[34 Must have Chrome Extensions for Web Developers and Designers](https://dev.to/saviomartin/34-must-have-chrome-extensions-for-web-developers-and-designers-421b)

### Quotes to Go

Here’s a deep cut gemstone:

Steve Jobs on how the computers are like a “bicycle of the mind”

{% youtube ob_GX50Za6c %}

### Before you Go!

> _You can learn more about_ **_Chingu_** _& how to join us at_ [_https://chingu.io_](https://chingu.io/)
Getting Puppeteer working on Lambda.
Tags: puppeteer, webscraping, lambda
Published: 2021-01-29 12:50:32

---
title: Getting Puppeteer working on Lambda.
published: true
date: 2020-12-28 13:01:00 UTC
tags: Puppeteer,WebScraping,lambda,Webscraping
canonical_url: https://javascriptwebscrapingguy.com/getting-puppeteer-working-on-lambda/?utm_source=rss&utm_medium=rss&utm_campaign=getting-puppeteer-working-on-lambda
---

Very frustrating slight echo in this video. Sorry!

<iframe title="Puppeteer on Lambda. Can it be done?" width="640" height="360" src="https://www.youtube.com/embed/xf6a_Qe60Eo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Puppeteer on Lambda. Can it be done? Yes! I ended up using the chrome-aws-lambda package. It was still over the 50MB limit so I discovered that that limit does not apply when uploading from S3.

So I think the final workflow will be, upload to S3 and have that trigger an event to update the Lambda code.

Sweet!

After the video update. I was able to get it uploaded to s3 and then update the Lambda code all with one command. Here’s my package.json script:

```
"sendToLambda": "npm run zip && aws s3 cp function.zip s3://puppeteer-lambda-jordan && aws lambda update-function-code --function-name puppeteerTest --s3-bucket puppeteer-lambda-jordan --s3-key function.zip"
```

The post [Getting Puppeteer working on Lambda.](https://javascriptwebscrapingguy.com/getting-puppeteer-working-on-lambda/) appeared first on [Javascript Web Scraping Guy](https://javascriptwebscrapingguy.com).
Setting $guarded = [] in Laravel-> Mass Assignment protection
Tags: laravel, php
Published: 2020-12-28 11:45:40

<h3>When can I use $guarded = [] in the model?</h3>
<i>To quote:
https://laracasts.com/discuss/channels/eloquent/do-i-really-need-to-use-protected-fillable-if<i/>

If you are not going to insert values into all fields of a model at once (e.g. `$user = new User(request()->all()); `) as a response to a HTTP request then you can set `guarded=[]` on the model. Instead you will need to update specific columns only e.g:

```
<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Models\Flight;
use Illuminate\Http\Request;

class FlightController extends Controller
{
    /**
     * Store a new flight in the database.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        // Validate the request...

        $flight = new Flight;

        $flight->name = $request->name;

        $flight->save();
    }
}
```

<h3>What is mass assignment?</h3>
<i>To quote from:
https://stackoverflow.com/questions/22279435/what-does-mass-assignment-mean-in-laravel</i>

Mass assignment is when you send an array to the model creation, basically setting a bunch of fields on the model in a single go, rather than one by one, something like:

`$user = new User(request()->all()); `
(This is instead of explicitly setting each value on the model separately.)

You can use fillable to protect which fields you want this to actually allow for updating.

You can also block all fields from being mass-assignable by doing this:

`protected $guarded = ['*'];`
Let's say in your user table you have a field that is user_type and that can have values of user / admin

Obviously, you don't want users to be able to update this value. In theory, if you used the above code, someone could inject into a form a new field for user_type and send 'admin' along with the other form data, and easily switch their account to an admin account... bad news.

By adding:

` $fillable = ['name', 'password', 'email']; `
You are ensuring that only those values can be updated using mass assignment

To be able to update the user_type value, you need to explicitly set it on the model and save it, like this:

``` $user->user_type = 'admin';
$user->save(); ```
Daily Developer Jokes - Monday, Dec 28, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-12-28 13:00:28

---
title: "Daily Developer Jokes - Monday, Dec 28, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20Dec%2028%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125994c8f5a.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q___: Did you hear what the clumsy cryptographer did to their password?

___A___: Made a hash of it.
 -->
Overcoming that scroll direction discomfort 
Published: 2020-12-28 12:47:39

Being a MacBook user, my job requires me to log in to a Windows VM from my MacBook, so I bought a new keyboard and mouse to help me cope with that.

![RGB keyboard and mouse](https://media.giphy.com/media/j0qclsfQMGBhaVvYGT/giphy.gif)
<figcaption>My setup is something similar to this</figcaption>

Colourful right? It makes development very enjoyable. 

![This one sparks joy](https://media.giphy.com/media/hvRoo3YcAPUheF3MxY/giphy.gif)
<figcaption>This one sparks joy</figcaption>

But here comes the problem: 

I realised that the scroll direction on my new mouse mimics the scroll direction of the Apple trackpad. I like how in 2011, Apple introduced natural scrolling on the trackpad to mirror the way we use our phones. But to me, this feels awkward on the mouse because I'm not interacting with the screen using my fingers. At my workplace, I'm kinda forced to use the old-school scroll direction: roll the mouse wheel up to scroll up and down to scroll down. 

So, I did a quick search and found that it's such a common problem that some people even wrote to Apple:

![](https://dev-to-uploads.s3.amazonaws.com/i/zwo1djtvpknk7q25twur.png)
<figcaption>Thanks Peter Marcotte, you're a hero. Source: <a href="https://apple.stackexchange.com/questions/116617/how-to-separate-mouse-and-trackpad-settings">stackexchange.com</a></figcaption>

After trying out several solutions, I finally found one that I'm happy with and would recommend: https://mos.caldis.me/


Installed the app, opened it up and saw that both **Smooth Scrolling** and **Reverse Scroll** were already checked for me. On top of that, I checked the **Launch on Login** as well, so that the setting stays.

![](https://dev-to-uploads.s3.amazonaws.com/i/j9t0esviecrxhg8gvt70.png)
<figcaption>Preferences page</figcaption>
 
The app made scrolling with a mouse buttery smooth, as advertised. But it also created another issue when I'm in my company's VM using Citrix. It caused my mouse wheel to take a gigantic step every time I scroll, jumping too forward and too backward past where I intended to stop. Luckily there's a nifty tab called **Exception** that helps me to customise my mouse settings for any particular app. I customised the settings for my mouse to disregard global settings when it's in Citrix and reduced the step speed and duration to the minimum.

![](https://dev-to-uploads.s3.amazonaws.com/i/fzovmcybucobfpdi3nvk.png)
<figcaption>Exception page</figcaption>
 
I can finally get back to developing without experiencing brain fart when switching between trackpad and mouse.
2-Level Paging | Operating System - M05 P13
Tags: linux, devops, beginners, tutorial
Published: 2020-12-28 12:11:16

**This is a multipart blog article series, and in this series I am going to explain you the concepts of operating system. This article series is divided into multiple modules and this is the fifth module which consists of 26 articles.**

_In this article we will see what 2 level paging is, and with the help of a question we will try to understand the need of 2 level paging._

### 2-level paging
- Suppose the size of page table is greater than that of frame table, so it cannot fit in frame that’s why we use multiple page tables.
- Because it divides the page table in smaller parts which can get fit in frame table.

Let’s see an example to get better understanding of the topic.

***Question:*** Physical address space = 256 MB = 228, logical address space = 4 GB, frame size = 4 KB = 212, page table entry = 2 B. Solve and find that whether outer page table is required or not.

***Answer:*** As we know that `frame number = physical address space – frame size`

Frame number = 228 – 212 = 216 

Size of page table = 210 x 2 = 2 MB

Size of frame and page is not equal. So, we have to divide page into smaller parts.

Therefore, 
2 MB/ 4 KB = 221/212 = 29

Now we will make another page table and it will be known as outer page table, which will have 29 entries.

Total size of outer page table = 29 x 2 B = 1 KB 

_So this was all about 2 level paging, I tries to explain you the concept with the help of a question. Hope you liked it and learned something new from it._

If you have any doubt, question, quires related to this article or just want to share something with me, than please feel free to contact me.    

### 📱 Contact Me

[Twitter](https://twitter.com/r_mishra10)
[LinkedIn](https://www.linkedin.com/in/rahul-mishra-66210b185)
[Telegram](https://t.me/rahul_mishra10)
[Instagram](https://www.instagram.com/rahul_mishra10/?hl=en)

### 📧 Write a mail
<rahulmishra102000@gmail.com>

#### 🚀 Other links

[GitHub](https://github.com/rahulMishra05)
[HackerRank](https://www.hackerrank.com/rahulmishra10201)