teleren/devto huggingface dataset:
multiline comment in python
Tags: python, devops, tutorial
Published: 2020-12-27 02:29:35

## Comments
A comment is a message to someone reading your program. Comments are often used to describe what a section of code does or how it works, especially with tricky sections of code. Comments
have no effect on your program i.e it will not run while running the codes. there are two type of comment
#### 1.Single-line comments:
this is comment that is not more than a line. For a single-line comment, use the `# ` character. 
### Example1
```python
# a slightly sneaky way to write condition statement
x=5
print('x is greater than 3') if x>3 else print('x is not greater than 3')
```
OUTPUT
```
x is greater than 3
```
#### You can also put comments at the end of a line of your code:
### Example2
```python
score=60
if score>=50: #check if score is greater than 50
    print('pass') #print 'psdd' if true
else: #if it is not greater than 50
    print('fail')#print 'fail'
```
OUTPUT
```
pass
```
#### 2.Multi-line comments:
this is used for comments that span several lines, you can use triple quotes.
### Example3
```python
""" Program name: Hello world
Author: Maxwizard
Date: 27/12/2020 
"""
print('Hello world')
```
OUTPUT
```
Hello world
```
One nice use for the triple quotes is to comment out parts of your code. sometimes you will want to
modify your program but don’t want to delete your old code in case your changes don’t work. so the best way is to just comment out the old codes so that it is still there if you need it, and it will be ignored when
your new program is run. 
### Example4
```python
'''
print('this is my old codes')
print('this and the first line are not going to execute.')
'''
print('This is my new codes it will execute')
```
OUTPUT
```
This is my new codes it will execute
```
### Example5
```python
'''
x='hello'
y='myfriend'
print(x+y)
'''
print('Hello mate!')
```
OUTPUT
```
Hello mate!
```
Micro Frontends Patterns#7: Linked Application
Tags: microservices, microfrontends, javascript
Published: 2020-12-27 02:03:48

Linked Application is a simple architecture that navigates multiple applications with hyperlinks.

![eh5p3gt0o3zi5o0ne4rayv7b3onn](https://dev-to-uploads.s3.amazonaws.com/i/hydq8pt1nescfszxp89d.png)
 
A common example is a standalone user account application that is linked from multiple applications. In this case, services related to a user account are done only in the account application, and other applications hyperlink to it from a header, user menu, etc. "Google Account" can be an example.

![ec2jydjawg8r936atbjgf1mv2hmd](https://dev-to-uploads.s3.amazonaws.com/i/kp7qqyip18h1q9jtycl7.png) 

It is also possible that applications can be in the same domain. In this case, each page has its own independent development team and deploy pipeline.

![nxpq75hzdroqa2i6cidpbaa96xnd](https://dev-to-uploads.s3.amazonaws.com/i/zczllsj3mv0n2wuojszu.png) 

Linked Application is one of the easiest Micro Frontends to get started with, and I'm sure we've all seen it at least once.

## iframe

Although not a Linked Application, we can accomplish Micro Frontends with iframes, as Spotify does. Compared to Linked Application, you can use it more flexibly by embedding it in a part of the page, and since it is a old technology, it is supported by all browsers. However, there are some issues that need to be considered, such as performance overhead, SEO considerations, accessibility, and motivation of engineers.

## Pros and Cons

### Pros

The main advantage of this pattern, which seems not to be cool, is that it allows applications to be loosely coupled. The fact that the applications are isolated also means that each system is robust. If one application goes down, the others are unaffected.

### Cons

On the other hand, there is the problem of communication difficulties due to the isolation. As the name suggests, applications can only communicate with each other through "links". Also, although it is a simple architecture, it makes it difficult to manage common parts such as headers, and it also creates redundancies such as duplicate development for each team. The hyperlink experience is also not great for users.

## Summary

Linked Application has been one of the most common patterns for a long time because it is quick to implement, but it is important to understand its drawbacks.
Military to Software Engineer Journey Day 0
Tags: military, codenewbie, 100daysofcode
Published: 2020-12-27 01:14:04

When it comes the time to transition most military is late to develop a plan. Heck, this even applies to a regular person in society. As for myself, I've had a plan from the very beginning. 8 years ago I decided when it came time I would learn every facet of Information Technology. Learning everything from the foundation up. I've learned systems, networks, information security, and cybersecurity as a whole. Now my new journey begins with learning to code. Mind you I do know some coding dealing with understanding cyber analytics but here I plan to exceed my boundaries and dive deep into coding. 

I came across the 100 Days of Code simply through research and attending a coding Bootcamp but never felt that I was learning. So I decided to take this journey myself and teach myself. To start I will be working my way through several coding languages like python, C#, and Java. Every day I will be tracking my journey and recording what I learned what I felt was difficult and what was easy. If there's another way to make coding more understandable I will leave my thoughts because most of us learn in different styles. The end of my journey and the beginning of a new journey will be when I secure a role as a software engineer for a major firm. Sounds optimistic but I always say "the only thing stopping you...is you. Follow me on my journey and join the fun.
How to write a simple javascript algorithm, for javascript beginners. 
Published: 2020-12-27 01:14:02

Write A function, then call it underneath with the write arguments(the string/boolean/number/float/etc inside the function parenthesis). Then right punctuality inside a function and return the new data.


function addition(number) {
number = number + number
return number
// answer returned is 10
}


addition(5)
Git tricks
Tags: git
Published: 2020-12-27 00:53:10

---
title: Git tricks
published: true
description: 
tags: git
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/x7fh4j01iz6hrt3k91ru.jpg
---

Some useful git tricks I use all the time, the list can be updated later.

```bash
# Stash track/untrack changes
$ git stash -u or git stash --include-untracked
```

```bash
# Rename local branch
# If you are on the branch you want to rename:
$ git branch -m new-name

# If you are on a different branch:
$ git branch -m old-name new-name 

# Delete the old-name remote branch and push the new-name local branch.
$ git push origin old-name new-name

# Reset the upstream branch for the new-name local branch. Switch to the branch and then:
$ git push origin -u new-name
```

```bash
# Add file to the last commit (avoid this if the commit is already public 🙅🏼‍♂️)
$ git add my_missing_file
$ git commit --amend --no-edit
```

```bash
# List all origin from the remote repo
$ git remote prune origin --dry-run

# Prune origin in your local repo
$ git remote prune origin

# Prune when you fetch from a remote
$ git fetch --prune

# List all branches which have been merged
$ git branch --merged

# Prune local branches which have been merged
$ git branch -d branch-to-delete

# List all branches which have been NOT merged
$ git branch --no-merged

# Prune all branches which have been NOT merged
$ git branch -D un-merged-branch-to-delete
```

Update a local fork at the terminal [Explanation](https://medium.com/@sahoosunilkumar/how-to-update-a-fork-in-git-95a7daadc14e)

```bash
$ git remote -v
$ git remote add upstream [github url]
$ git remote -v
$ git fetch upstream
$ git checkout master
$ git merge upstream/master
$ git push origin master
```
Project 23 of 100 - React Firebase Instagram Clone with Hooks
Tags: react, javascript, css, 100daysofcode
Published: 2020-12-27 00:50:02

*Hey! I'm on a mission to make 100 React.js projects ending March 8th. Please follow my dev.to profile or my [twitter](https://www.twitter.com/jwhubert91) for updates and feel free to reach out if you have questions. Thanks for your support!*

Link to today's deployed app: [Link](https://100-react-project-day-23-firebase-react-instaclone.netlify.app/)
Link to the repo: [github](https://github.com/jwhubert91/100daysofreact/tree/master/day-23-react-firebase-photosharing)

UPDATE
12/27 - I actually had to disable this site's upload feature because after less than 12 hours live some folks began uploading inappropriate content to the Firebase server. It just goes to show you how important authentication is!

On the plus side, before shutting it down a lot of people were able to view the site. Probably 25 reads are mine, so lots of other users got to see it!

![Firestore reads and writes December 27 2020](https://dev-to-uploads.s3.amazonaws.com/i/lyt6geqwtrew1sljpaqy.png)

##Background on the Project
Today I followed along with a tutorial from Brad Traversy's Youtube channel, Traversy media. Aware of how popular he is as a teacher, I have taken several of Brad's Udemy courses and seen his tutorials. For the record is my take on Brad Traversy:

Brad has great tutorials when he's teaching a subtopic, e.g. his crash courses on HTTP and Async-await. That means, when teaching a smaller topic that can be taught in an hour or so video, I usually understand everything he's saying and can learn from the content. 

With longer courses, such as his MERN Udemy course, since Brad doesn't like to lecture or explain principles, and since he doesn't do exercises or repetition, his courses simply feel like code-alongs. And I personally don't learn anything from code-alongs unless I already basically know all the material but want to see the details of how something is put together. For longer subjects or full tutorials Brad Traversy is just more "tutorial hell".

I just had to get that off my chest.

[This tutorial however](https://www.youtube.com/watch?v=vUe91uOx7R0&ab_channel=TraversyMedia), shown on Brad's channel, was actually originally a Shaun Per (aka [the Net Ninja](https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg)) course, who I love and always learned a lot from. His Udemy Javascript course is the best I have seen. This particular video walked through building a Firebase/React picture-sharing application.

##Takeaways
I'm not going to go into too much detail about this project since the tutorial is relatively short and available online for all to see. It is a simple React app that interacts with Firebase Firestore and Firebase Storage without authentication.

The coolest new front-end package I learned in this was the framer-motion npm package ([link here](https://www.framer.com/api/motion)). It's a slick little animation package with syntax that makes common animations quick to implement. Think about it like this- what Bootstrap does for styling Framer-Motion does for animations.

5/5 stars. Would code again.
GCP - Create and Deploy Cloud Data Fusion Pipeline
Tags: googlecloud
Published: 2020-12-27 00:45:28

You want to create custom marketing materials for an ongoing campaign promotion, and you want drivers to distribute the materials directly to customers' home mailboxes.

Your campaign has two constraints:

Location: You only deliver to customers in California, New York, and Alabama. You need to create a random parameter for each customer to be able to perform an A/B test and split the customers into two groups.

What you do?

• Configure Cloud Data Fusion

• Create a Cloud Data Fusion data transformation pipeline

• Connect Cloud Data Fusion to a couple of data sources

• Apply basic transformations

• Join the two data sources using Cloud Data Fusion

• Split data to perform an A/B experiment

• Write data to a sink

Details : https://github.com/IamVigneshC/GCP-Create-Deploy-Cloud-Data-Fusion-Pipeline

<BR/>
<BR/>
<BR/>
PS: Sorry, couldn't repost here since there are some incompatible MD codes. Thank you!
100 Days of Code ~ Day 3
Tags: 100daysofcode, javascript, webdev, challenge
Published: 2020-12-27 00:43:43

Well, did take a day off for the holiday, but made sure I was right back at it today!

Completed the 3rd and 4th activities from [JavaScript30](https://javascript30.com). Activity 3 was updating CSS variables with vanilla JavaScript and activity 4 was a review on array methods. Having been out of practice for so long the array methods were a tad rusty, especially reduce so the reviews were very helpful and I will have to remember to spend much more time practicing them in the future.
AWS - Administer and Use the API Gateway on AWS
Tags: aws
Published: 2020-12-27 00:37:00

Your company, Perfect Pets, runs its customer-facing Node.js Express line-of-business (LOB) web application from a local data center. The Perfect Pets development team wants to migrate the application entirely to AWS using API Gateway, AWS Lambda, and AWS DynamoDB. You’ve been asked to deploy API Gateway and import the LOB application’s REST API.

Check out the details: https://github.com/IamVigneshC/AmazonWebServices/tree/main/AWS%20API%20Gateway

<BR/>
<BR/>
<BR/>
PS: Sorry, couldn't repost here since there are some incompatible MD codes. Thank you!
AWS - Access and Enforce Data Compliance Using AWS Config
Tags: aws
Published: 2020-12-27 00:33:07

Your company’s Chief Information Security Officer (CISO) has called on you to investigate an AWS account. Router logs are showing large amounts of secure shell (SSH) traffic coming in from an unauthorized location. The CISO suspects that servers on the network are being used for crypto currency mining by someone from outside the company. They ask you to remediate any security groups that are allowing unauthorized SSH traffic and turn on detailed monitoring for each instance.

* Set up AWS Config
* Remediate the Noncompliant Security Group
* Remediate the Noncompliant EC2 Instances

Details here: 

{% github https://github.com/IamVigneshC/AmazonWebServices %}




<BR/>
<BR/>
<BR/>
PS: Sorry, couldn't repost here since there are some incompatible MD codes. Thank you!
GCP - BigQueryML Classification Model - Predict Visitor Purchases with a Classification Model with BigQuery ML
Tags: googlecloud, machinelearning
Published: 2020-12-27 00:18:54

Check out my blog : https://iamvigneshc-mydigitalworld.blogspot.com/2020/11/bigqueryml-classification-model-predict.html

<BR/>
<BR/>
<BR/>
PS: Sorry, couldn't repost here since there are some incompatible MD codes. Thank you!
Machine Learning on AWS - Implement a Data Ingestion Solution Using Amazon Kinesis Data Streams
Tags: aws, machinelearning
Published: 2020-12-27 00:13:18

Read here: https://iamvigneshc-mydigitalworld.blogspot.com/2020/12/machine-learning-on-aws_24.html
<BR/>
<BR/>
<BR/>
PS: Sorry, couldn't repost here since there are some incompatible MD codes. Thank you!
Machine Learning on AWS — Implement a Data Ingestion Solution Using Amazon Kinesis Video Streams
Tags: aws, machinelearning
Published: 2020-12-27 00:12:01

Refer: https://iamvigneshc.medium.com/machine-learning-on-aws-implement-a-data-ingestion-solution-using-amazon-kinesis-video-streams-d791c8e288a7

<BR/>
<BR/>
<BR/>
PS: Sorry, couldn't repost here since there are some incompatible MD codes. Thank you!
How to make tags editable in HTML?
Tags: html
Published: 2020-12-27 00:00:00

---
  title: How to make tags editable in HTML?
  published: true
  tags: HTML5
  date: Sun Dec 27 2020 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/make-tag-editable-html
  cover_image: https://melvingeorge.me/_next/static/images/main-ccf8bd4a4729d9f758c1d23e9c5ef1d9.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/make-tag-editable-html)
  
To make any tags editable in HTML, you can use the global `contenteditable` attribute and pass the string `true`.

For an example let's consider a `div` tag, with some content inside it like this,

```html
<!-- Not editable right now -->
<div>This is not editable right now!</div>
```

Normally the content inside a `div` tag is not editable.

Now let's make it editable by using the `contenteditable` attribute and passing string `true` like this,

```html
<!-- 🔥 Make div tag editable 🔥 -->
<div contenteditable="true">
  This is editable right now! Click me and write something
</div>
<!-- Go to link below to play with it -->
```

See this example live in [JSBin](https://jsbin.com/sivewezaci/2/edit?html,output)

### Feel free to share if you found this useful 😃.

---
Round Two to Awesome Web Sh*t

Tags: amazonwebservices, aws, cloudcomputing
Published: 2020-12-26 23:42:38

Round two is now scheduled for June 2021. Round two to pass the exam to earn my Amazon Web Services (AWS) Associate’s Level Certification. Round one took place in July 2020 and did not result in my being the victor. It was a blow to my pride and it took a few months before I even felt like studying again.

Learn more about the process of studying along w/ resources and tips for free at https://bytesandbits.org/2020/12/26/round-two-to-awesome-web-sht/
Serverless Machine Learning Engineering Project On AWS
Tags: python, aws, machinelearning, datascience
Published: 2020-12-26 22:51:47


Lots of tutorials on how to deploy a model in production directly integrates the serialized model into the API. This way of proceeding has the disadvantage of making the API coupled to the model. Another way to do this is to delegate the prediction load to workers using a queue. The schema below shows the solution architecture on the AWS environment.

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


The machine learning model is stored in an s3 bucket. It is loaded by workers, which are Lambda functions when a message containing prediction data is put in the SQS queue by the client through the API gateway/Lambda REST endpoint.

When the worker has finished the prediction job, it puts the result in a DynamoDb table in order to be accessed. Finally, the client requests the prediction result through an API endpoint that will read the DynamoDb table to fetch the result.

As you can see we are delegating the loading and prediction work to a worker and we do not integrate the model into the REST API. This is because a model can take a long time to load and predict. Therefore we manage them asynchronously thanks to the addition of an SQS queue and a DynamoDb table.

> Complete article [here] (https://medium.com/swlh/how-to-deploy-your-scikit-learn-model-to-aws-44aabb0efcb4) including code.
Marketing to Tech 💻
Tags: codenewbie, career, beginners
Published: 2020-12-26 22:16:39

I'm going to keep this short, mostly because I don't have a lot to say (today). Right now, I work in marketing, it's what I studied in college and it's how I make my money. Story-telling is a big part of marketing and it's also been one of my biggest strengths.

Anyways, tech is different and uncomfortable. At this point, I'm fully self-taught, with the help of FreeCodeCamp, W3schools, and SoloLearn. When I code, I have to sit with the discomfort. I make mistakes, again and again.

To be perfectly honest, I'm not sure where my new skills will take me. Do I want to leave the marketing industry? Do I want to fully work in tech? Will I have to choose? Either way, I want more options and I think that's what most people who learn how to code want. When we learn for career purposes, I think the primary motivation is to have more control over our lives. And that's what I want, more control over my life.
Install PHP 8 on Ubuntu
Tags: php, php8, ubuntu
Published: 2020-12-26 22:15:14

## Installation

If you are running php7.x, it's likely you are already using the following repository. If not, here are the commands:

`sudo apt install software-properties-common`
`sudo add-apt-repository ppa:ondrej/php`

Now let's install PHP8:

`sudo apt update`

_APACHE_

`sudo apt install php8.0 libapache2-mod-php8.0`

When you are done installing your extensions, don't forget to restart with `sudo service apache2 restart` 
(or `sudo systemctl restart apache2` )

_NGINX_

`sudo apt install php8.0-fpm`

When you are done installing your extensions, don't forget to restart with `sudo service nginx restart` 
(or `sudo systemctl restart nginx` )

## Extensions

Before we give it a spin, let's install some common extensions we might need.
(The following list is based on [neoan3](https://neoan3.rocks) requirements, feel free to check what you need for the setup of your choice)

`sudo apt install php8.0-{mysql,zip,xml,curl}` or install them one-by-one in this format:

`sudo apt install php8.0-xml` (see a list [here](https://www.php.net/manual/en/extensions.alphabetical.php))

Happy hacking!
Needed: ReactJS Admin Dashboard Template for REST API
Tags: react, rest, api, template
Published: 2020-12-26 21:58:04

---
title: Needed: ReactJS Admin Dashboard Template for REST API
published: true
description: 
tags: React, REST, API, Template
//cover_image: https://direct_url_to_image.jpg
---
I am looking for a React + Bootstrap (or Antd) Admin Dashboard template to be used with REST API. There are many templates to choose from, but most are merely showcase of Controls and Widgets with no implementation of API calls, data handling and state management.

Can anyone point out a working example which can be used as a starter project with core features in place for example Auth with protected Routes, API call and response handling, state management for large apps etc.?

Thank you
First pypi package
Tags: python, pypi, fahrplan, poetry
Published: 2020-12-26 21:51:12

I published my first python package to pypi: https://pypi.org/project/pyfahrplan/ Use it to browse, filter and sort the ccc rc3 fahrplan via cli. It caches the schedule after the first download, so don't forget to --update-cache if you want to force a redownload.

See the readme at https://github.com/saschalalala/pyfahrplan#usage for all possible cli options and enjoy all tablefmt options python-tabulate (https://pypi.org/project/tabulate/) offers. Feature requests are welcome :)

I used poetry for the build and publishing process and it made everything so much easier. There was no need to create a setup.py, manual metadata management.

Note: You need version 1.0.6 in order to have the latest complete schedule.json.
Our Tech Stack
Tags: showdev, startup
Published: 2020-12-26 21:50:59

This post contains affiliate links. I may receive a commission from the product within.

This is a post about our tech stack. We are currently building the internets #1 music education and social learning platform. We are hoping to get funded through our [Kickstarter Campaign](https://www.kickstarter.com/projects/musiciansu/musicians-u-music-education-and-social-networking) .

When I say we or our.... I mean really mean me. Musicians-U is a one person shop currently. I hope to be able to hire some help should the campaign get funded. I have so many ideas, but am only capable of so much on my own.

We are using Laravel for our API, and currently Vue.js for the client side. We will be switching to Nuxt.js soon.

For the music "trainers" (interactive apps) we are using GWT with a custom Create.js Javascript wrapper. You can find that [here](https://github.com/sinewavemultimedia/create-gwt). It is hard to believe I wrote that wrapper 8 years ago. I don't even have access to that Github account anymore. hmmm....

I started using GWT as an experiment and have stuck with it ever since. There are a a lot of things to like about GWT, but my favorite part is being able to code in Java and have it transpiled to client side javascript. I also love that you can "wrap" third party javascript libraries and use them utilizing Java.

Some may think GWT is old school, but for the interactive mini apps I am creating it works great, and to be honest these types of mini apps are easier to implement in GWT rather than Vue or React or something (IMHO)

Other than this we are using the web-midi and web-audio api's to add more interaction to the apps. Keep an eye out for my post on the Guitar Note training app that utilizes the microphone.

That is all
Thanks for reading.