teleren/devto huggingface dataset:
Why Python??
Tags: python, beginners, career
Published: 2020-12-31 13:39:16


“The power of Python is that its code is short and very literal, and advanced users can easily read it, making it suitable for both beginners and advanced programmers,” - Guido van Rossum(The Creator of PYTHON)
![guido](https://dev-to-uploads.s3.amazonaws.com/i/us0jw84bkcdwgw5ksowj.jpg)
 


Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant whitespace. 
##Is it hard? like C,C++, JAVA?##
No, Python is not hard for beginner. For Beginner they can learn python to get an idea about the processing of codes. How Control of line is shifted from one statement to other.
In programming Syntax is important and it's like a set of rules which need to follow while writing the codes
###!!Surprise!!###
python has simplest Syntax  from all the other languages.
There are 3 reasons to opt the python as the first language.

**1) Open-Source [Open-Source](https://opensource.org/)**
Python is an open source library and it is an example of FLOSS (Free/Libre and Open Source Software) which means it has the large open source community.
 
**2) Interpreted Language**
This means by interpreter each line of code is executes line by line, if any line has error the interpreter stop the execution and throws an error.

**3) Large support of Library**
Python supports many libraries which helps to reuse to prewritten codes for that purpose. Some of the famous libraries are
Tensor-flow[Tensor-flow](https://www.tensorflow.org/)- Machine Learning
OpenCV[OpenCV](https://opencv.org/)- Computer Vision
Numpy[Numpy](https://opencv.org/)- Higher Mathematical Model
Creating a database from scratch with Node.js - Days 4-7
Tags: javascript, node, database
Published: 2020-12-31 13:12:48

Hello folks!

in my last post, I was talking about how messy my parser was getting, so a good man named Olivier told me about the Earley algorithm, I've been trying to learn how to properly use it since then.

So today I am introducing to the world LQL, the Luis Query Language, it's basically the same thing I was trying to do with my original parser with even fewer functions (for now) but with way better-structured code.

I haven't yet started to use the parser in the main project, but I was so proud my initial test cases passed I felt like writing this post.

---

### Features:

It takes a string input that matched the "select" command pattern and transforms it into a JSON that I will later use.

Example:

This code:

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

Generates this output:

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


In the column parameter, it also supports strings:

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

And arrays: 

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

---

### Conclusion

loved working with nearley, so much that I am thinking my next project will be creating a programming language with node, but that seems way too bold for now.

I've published the parser in npm and Github

if you wanna play with it you can install it with 

```
npm install lql-parser
```

and if you wanna check the code out, this is the repo > 

{% github ciochetta/lql-parser %}

btw 

This is the guy that told me about Earley, I tried to reach him on Linkedin to thank him but couldn't, so this post is my thank you note to him

{% user oguimbal %}

That's all I had to say

Happy new year to everyone :)
10 things they don't teach you about AWS
Tags: aws, devops
Published: 2020-12-31 13:05:05

Some things that I've picked up over the years that may not be obvious when starting out with a new AWS service.

1. **Create SSL certificates in** `us-east-1`. CloudFront's provisioning infrastructure is based there, so is only compatible with `us-east-1` certificates.
2. **IAM.** May not be obvious to the newcomer: permissions are granted via statements in **Policies**, which are assigned to either **Identities** or **Resources**.
3. **CloudFormation vs Terraform.** CloudFormation features oddly sometimes lag behind Terraform, which uses AWS's API under the hood (not CloudFormation's).
4. **Lambda deployment too big**. Consider AWS Lambda Layers when your deployment package size has exceeded Lambda limits.
5. **AWS Lambdas suffer from cold starts**. Tackle it by reducing your package size. Also, you get at least the same amount of CPU in the init phase as in the handler. You get the init phase for very close to free, so move as much application code as possible outside of your handler function. Subsequent invocations can also reuse resources outside the handler.
6. **SQS deliverability**: Standard queues guarantee at least one delivery, FIFO queues attempt one delivery. Make sure your application code makes the correct assumptions/de-dupe as necessary.
7. **AWS KMS is your friend**. Use it to encrypt your keys. Think twice about what goes into environment variables or Parameter Store.
8. **AWS RedShift performance.** RedShift queries perform a lot better with Distribution Keys. Set them up early.
9. **AWS Cognito customisation**. ~~You can't customise AWS Cognito verification emails.~~ As suggested in the comments, you can now customise verification email with code. ([See docs](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-email-verification-message-customization.html).)
10. **AWS Credits**. Most accelerator programmes offer you AWS Credits. Join one and ask for them.

**Edit:** Helpful resource, in case you haven't come across it — [Open Guide to Amazon Web Services (GitHub)](https://github.com/open-guides/og-aws).

Cover: "AWS - Amazon Web Services Office in Houston, Texas" by Tony Webster is licensed with CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0/
Daily Developer Jokes - Thursday, Dec 31, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-12-31 13:00:11

---
title: "Daily Developer Jokes - Thursday, Dec 31, 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=Thursday%2C%20Dec%2031%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/5e1259082460c.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:___ Why do kayakers make bad programmers?

___A:___ Because they're afraid of waterfall.
 -->
Add Custom Utilities with TailwindCSS
Tags: tailwindcss, utilityfirst, css
Published: 2020-12-31 12:53:49

![Screenshot of a custom utility defined with TailwindCSS variants directive](https://dev-to-uploads.s3.amazonaws.com/i/l5ayqgeqql3hoebtfxce.png)

Sometimes I need some CSS that’s not included with Tailwind. CSS filters are a simple example. Instead of coming up with component names, adding and importing partials, we can opt into building atomic utilities that can be composed into any other component that requires such functionality.

This is the exact use case for Tailwind’s `@variants` directive.

Say we want to desaturate gallery thumbnails using `filter: grayscale(100%)` and show the coloured version on hover. Instead of writing the styles only for something highly specific such as  `.gallery__thumbnail { … }`  I recommend adding a file called `utilities/filters.[s]css`:

```css
@variants hover, focus, responsive {
    .grayscale {
        filter: grayscale(100%);
    }
	
	.filter-reset {
		filter: none;
	}
}
```

This will create those utilities together with all the variants we specified. So say we want our grayscale filter on an element but only starting at the `md` breakpoint and bring the color back on focus and hover. Oh, and a little transition would be nice, too. We can easily compose this as follows:

```html
<img class="md:grayscale md:hover:filter-reset md:focus:filter-reset transition-all duration-200 ease-in" />
```

## Links
* [Documentation of @variants directive](https://tailwindcss.com/docs/functions-and-directives/#variants)
* [Documentation of all available TailwindCSS variants](https://tailwindcss.com/docs/pseudo-class-variants/)
Roll your own Request object in Laravel
Tags: php, laravel, request
Published: 2020-12-31 12:50:00

---
title: Roll your own Request object in Laravel
published: true
description: 
tags: PHP, Laravel, request
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/e8cgpziuh5wu4t89cfb2.png
---

There are multiple ways to extend or modify the `Request` object in Laravel. I'd like to show you a method, which in my opinion is the cleanest one.

---
## Macro

You may already know about the `macro` method. It's the most obvious way to introduce new methods to the `Request` object but it has some downsides.

```php
Request::macro('project', function () {
    return $this->user();
});
```

This solution is simple but it has some flaws:

• You cannot override or change existing methods.
• It's not obvious where these new methods are coming from.
• No IDE autocompletion.

---
## Custom Request Object

I like creating my own `Request` object.

```php
<?php

namespace App\Http;

use Illuminate\Http\Request as LaravelRequest;

class Request extends LaravelRequest
{
    /**
     * Get the team making the request.
     *
     * @param  string|null  $guard
     * @return mixed
     */
    public function team($guard = null)
    {
        return $this->user($guard);
    }
}
```

It's simple, clean and straightforward. Much better than introducing new methods via "macros".

---

Now, we need to instruct Laravel to use this new custom class as a base.

Simply override the `handle` method in our `App\Http\Kernel` class to use your custom `Request` object.

```php
<?php

namespace App\Http;

use App\Http\Request;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
    // ...

    /**
     * Handle an incoming HTTP request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function handle($request)
    {
        return parent::handle(
            Request::createFrom($request)
        );
    }
}
```

... and finally, alias your new `App\Http\Request` class so the container always returns the same instance.

```php
$this->app->alias('request', Request::class);
```

---

# Happy Coding!
Write a C program to accept length and breath as variable and then print area of rectangle
Tags: computerscience, programming, clanguage
Published: 2020-12-31 12:48:40

#include <stdio.h>
 int main ()
{
 int l , b , a ;
 
 printf("\n Enter Length -: " );
 scanf("%d" , & l);
 
 printf("\n Enter Breath -: " ); 
 scanf("%d" , &b) ;

 a = l*b
 
 printf("\n Area of rectangle is -: %d " , a);

 return 0;

}
Deep Dive into Power Platform #3 Power Virtual Agents
Tags: powerfuldevs, powerplatform
Published: 2020-12-31 12:45:17

Have you ever shopped at Amazon?or better yet have you interacted with Alexa ;Amazon's virtual Assistant? At the end of this blog you will be able to create your own virtual Assistant with the help of Power Virtual Agents.

A Virtual Agent is a computer generated, animated, artificial intelligence virtual character that serves as an online customer service representative.

It leads an intelligent conversation with users, responds to their questions and performs adequate non-verbal behavior

Power Virtual Agents lets you create powerful chatbots that can answer questions posed by your customers, other employees, or visitors to your website or service.

Power Virtual Agents is available as both a standalone web app, and as a discrete app within Microsoft Teams.
 
**Key Pointers**
 
* When you create bots with Power Virtual Agents, you author and edit topics.

* Topics are discrete conversation paths that, when used together within a single bot, allow for users to have a conversation with a bot that feels natural and flows appropriately.

* Creating a bot with Power Virtual Agents is easy to do with the no-code authoring canvas, and there are a number of ways you can manage how topics interact, how you want the conversation to flow, and what it should feel like.

* It's also easy to test the bot without having to fully deploy the bot whenever you make a small change.

* There are also lesson topics that guide you through topic authoring - from simple to complex scenarios, as well as default system topics.


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

**Create your first chatbot using the provided [guide](https://docs.microsoft.com/en-us/power-virtual-agents/authoring-first-bot)**
Deep Dive into Power Platform #2 Power Automate
Tags: powerfuldevs, powerplatform
Published: 2020-12-31 12:43:15

**Power Automate** (previously called Microsoft flow)is a service that helps you create automated workflows between your favorite apps and services to synchronize files, get notifications, collect data, and more.

**key Terms**
* A trigger : the thing (event) that happens that starts the process. That's what you're asking the workflow to look out for. 

* Actions : the things you want the workflow to do once the trigger takes place.

* Connectors:It is a proxy or a wrapper around an API that allows the underlying service to talk to Microsoft Power Automate, Microsoft Power Apps, and Azure Logic Apps.
 
It provides a way for users to connect their accounts and leverage a set of pre-built actions and triggers to build their apps and workflows.

**Types of flows**

1.Cloud flows
* Automated flow Create an automation that is triggered by an event such as arrival of an email from a specific person, or a mention of your company in social media.

* Instant flows	Start an automation with a click of a button. You can automate for repetitive tasks from your Desktop or Mobile devices

* Scheduled flows Schedule an automation such as daily data upload to SharePoint or a database.
 
2.Desktop flows:Used to automate tasks on the Web or the desktop. Alternatively, you can use the two legacy methods of of creating desktop flows: Windows recorder (V1) and Selenium ID.

3.Business process flows: provide a guide for people to get work done. They provide a streamlined user experience that leads people through the processes their organization has defined for interactions that need to be advanced to a conclusion of some kind.



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

 
**Get to know the different Premium and Standard connectors 
  in Power Automate**




For more information regarding power automate kindly visit 
  [Power Automate Docs](https://docs.microsoft.com/en-us/power-automate/)
Setup that can ping Google but not Facebook
Tags: linux, networking
Published: 2020-12-31 12:29:25

Hello everyone,

This Blog contains a demonstration of a setup that can ping Google but not Facebook.

We can achieve this with the help of a Routing Table, so let's first discuss what Routing Table is.

### Routing Table

A routing table is a set of rules, often viewed in a table format, that is used to determine where data packets traveling over an Internet Protocol (IP). All IP-enabled devices, including routers and switches, use routing tables. The image below shows the Routing Table:

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

Now we have discussed the Routing Table so let's start with the demonstration...

> First let's check the routing table in our system

To check the routing table, use the command **route -n**

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

Here you can see the routing table with the default rule that is destination **0.0.0.0**, this means we can connect to anyone.

Netmask is a 32-bit binary mask used to divide an IP address into subnets and specify the network's available hosts.

Iface is network card name and in my case network card is **enp0s3**.

 > Now let's check are, we able to ping Google

In order to ping Google use the command **ping www.google.com**

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

Here you can see we are able to ping it which means we have network connectivity.

> Now let's check are. we able to ping Facebook

In order to ping Facebook use the command **ping www.facebook.com**

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

Here you can see we can ping Facebook...

> Now let's check the IP of the Google

To check the google IP use command **nslookup www.google.com**

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

Here you can see an **address** that's the IP of google.

> Now delete the default routing rule

To Delete routing rule use command **route -net del 0.0.0.0 enp0s3**

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

> Now add google IP to the routing table

Write Google Ip in **Destination** and gateway will be localhost and write netmask **255.255.255.0**

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

> Now check if we can ping Google

To ping, google use the command **ping www.google.com**

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

Here you can see, we are able to ping Google

> Now check if we can ping Facebook

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

Here you can see, now we are not able to ping Facebook but we are able to ping google.

So, that's how we can set up the network using the Routing Table.

Thank you!!❄
Internet Safety Tips
Tags: security, cybersecurity
Published: 2020-12-31 12:28:57

Here are the Top 5 Internet safety rules to follow to help you avoid getting into trouble online!!

1) Be careful what you download: One of the goals of cybercriminals is to trick you into downloading malware (programs or apps that carry malware or try to steal information). This malware can be disguised as an app or a popular game. Downloading things from the Internet and clicking 'Accept' on popup windows is what causes the majority of computers to get infected. Don't download apps that look suspicious or come from a site you don't trust!

2) Use strong passwords: Passwords are one of the biggest weak spots in the whole Internet security structure. The problem with passwords is that people tend to choose easy ones to remember (such as "password" and "123456"), which are also easy for cyber thieves to guess. Use strong passwords that are harder for cybercriminals to demystify. A strong password is one that is unique and complex—at least 15 characters long, mixing letters, numbers and special characters. You can use password manager software to manage multiple passwords so that you don't forget them.

3) Make online purchases from secure sites: Any time you make a purchase online, you need to provide credit card or bank account information and that's just what cybercriminals are most eager to get their hands on! Only supply this information to sites that provide secure, encrypted connections. You can identify secure sites by looking for an address that starts with https: (the S stands for secure) rather than http: They may also be marked by a padlock icon next to the address bar in your browser. Sites using popular/recognized payment sytems for online payments are also safe too.

4) Click wisely: Do not click suspicious links from untrusted sources, ‘free’ offers or unsolicited ads. They are easy to recognize: all will urge you to click on them. If it is a malicious email attachment, the text will not mention the file, instead saying  ‘open the attached file and let me know what you think’.
On a website, make sure both text and link are corresponding. If you click a link to read more about wildlife conservation and instead of seeing some wild animals or forest, you get a ‘success story’ about a celebrity who made millions of dollars overnight, then it’s better to leave the page!

5) Be careful what you post online: Content shared on the internet is never deleted. Even though you may have deleted content from your profile, you don’t know who has already seen it and/or stored it. You and other users of that site might not be able to see the deleted info, but it’s still stored somewhere. You can minimize your online footprint by personally deleting info from your social media sites, which will lower the chances of your data being further shared, but the reality is that you can never completely remove yourself or your information from the internet. Do not post documents with your address and other sensitive information!

Connect with me: 
Twitter : @DaCodess 
Instagram : @realsuccess._
Facebook : The Codess
Hello World 🦄 From A Little Online Shop
Tags: startup, seo
Published: 2020-12-31 12:28:44


## Hello World from <strong>Shopalino</strong> 🏪

Hi Great Developers, Bloggers, and SEO gurus. Nice to meet you all. Finally, we decided to create an account at https://dev.to/ and start posting.

## How we started our <strong>Online Shop</strong> ✅

We joined the most powerful community as we want to learn more. Recently we creating an Online Store on Shopify. It may seem simple but it is not. If you have ever tried starting a company, by now you will know that it will require a lot of work to get that first order, sale or lead. 
Here is a <strong>small tip</strong> that we found useful and you can use it for free 

## How to make your free announcement bar on your <strong>Shopify Store </strong>🛒



{% gist https://gist.github.com/shopifypartners/6fec6528dd0917b2b25bc7aef1750e82 %}

Dear community and experienced developers, we are new here so please don't judge. We wanted to share this code as it may help someone out there. 

If you have a <a href="https://shopalino.com">shop online</a> based on Shopify you can copy and paste the below code to make this free announcement bar. Of course, you can edit it up to your likings. 

Have a nice day and if your like this post hit the love button 

Kind Regards,
Shopalino
Mini-update: HotTea version 0.11a released.
Tags: javascript, webdev, watercooler, hottea
Published: 2020-12-31 12:15:16

If you haven't seen my [last post](https://dev.to/baenencalin/hottea-new-ver-alpha0-1-released-now-59p0), check it out!


A miniature update for HotTea has been released to fix some spelling errors, add a missing `@param` doc for `isprimitive.of`.

This patch also adds a new parameter for `TypedObject`, "`base`", which is now the last parameter (after `strict`), and gives the `TypedObject` default values.
And as to be expected, if `base` breaks the same rules the user could break (trying to access or (re)define a key that isn't in the blueprint, or using the wrong type on the specified key), it will throw the respective error.

<div alt="Thanks! Cheers!">
##<b><center><b>Thanks for reading!<br/>Cheers!</b></center></b>
</div>
InversifyJS 中文文档
Tags: inversifyjs, ioc, container, di
Published: 2020-12-31 12:12:00

你的项目中有用到 JavaScript 吗？如果有，那么依赖注入是怎么实现的？强烈推荐使用 [InversifyJS](https://doc.inversify.cloud/zh_cn)！

2020年最后一天，工作效率可以说是非常高了。
早上买完[域名](https://doc.inversify.cloud/zh_cn)（https://doc.inversify.cloud/zh_cn ），开始翻译 InversifyJS 文档，到下班时间终于翻译完成。加班部署上线，现在新鲜出炉的[中文文档](https://doc.inversify.cloud/zh_cn)来了！

InversifyJS 小巧优雅又五脏俱全，可以说是一个相当棒的轮子了。如果用得爽，想自己造一个又不知道如何下手，那么：

给你一个 Bonus：这篇文章手把手教你从零开始撸一个 Toy Inversify：https://jeff-tian.jiwai.win/posts/inversion-of-control-implementation-based-on-typescript-3fl6/ ，快来看一看吧！