teleren/devto huggingface dataset:
A python IDE that you can use anywhere
Tags: python, tutorial
Published: 2020-06-03 10:17:55

As a student who travels a lot (pub - campus - cafe - home), I tend to carry around my macbook air because its light (and I hate heavy things). However, macbook air isn't really a powerful machine and it often drives me mad when the code I'm trying to run is too heavy to run.

I've been trying a lot of things to solve this problem, but recently I found that an online IDE might help run my codes from my laptop. 

So I did some quick research and found some products that might help.

- glitch
- goormIDE
- Repl.it
- Visual Studio Online
- paiza.io

Now, all these IDEs were ok, but the one that felt easy to use and setup was goormIDE. So today, I would like to write a short tutorial on how to setup a python development environment in goormIDE.


## Registration

First, we need to sign up for a free account.
Link to goormIDE: https://ide.goorm.io/

Now click Sign Up, and complete the signup process. (It doesn't take long)

After registration, you will be redirected to your dashboard. 

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

## Setup

Now, lets try making a new container where we will install everything we need to work with python. Click the create new container button (as this is a free tier account, you can only make 5 containers)

Write your container name, select a region, and select the python stack. Now, if we see the bottom of the page, we can see that with a single click, all the things that you will need for python development is installed.

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

Now click the create button on the top right of the page. After a bit of time, a popup will prompt you if you would like to run your container. Click run container.

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

And presto! You got your own online python IDE! Now, lets check if we got all the stuff we need installed.

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

I'm going to use tensorflow, so I will only check if python and tensorflow is installed.
Lets first try checking if python is correctly installed.

```shell
python --version
```
Great!

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

Now lets try tensorflow.
```shell
python3 -c 'import tensorflow as tf; print(tf.__version__)'
```

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

Good. Everything is in place.

Now, you can connect to your container from anywhere, which is great for me as I don't have to buy a new laptop.

That's all for now, I will post further tutorials as I get used to the new IDE I will be using for a while.
Move docker-desktop-data distro out of System Drive
Tags: dockerforwin, wsl2
Published: 2020-06-03 10:05:43

By default, [Docker Desktop for Window](https://hub.docker.com/editions/community/docker-ce-desktop-windows) will create 2 distros below

- docker-desktop
- docker-desktop-data

If we access the path **`%LOCALAPPDATA%/Docker/wsl`**; we can see 2 folders; and inside it is **vhdx** file. For detail, 

- **data/ext4.vhdx** which is consumed by **docker-desktop-data**
- **distro/ext4.vhdx** which is consumed by **docker-desktop**

In which, docker-desktop-data is used to store images and so on. Therefore, its size will be increased in the future, consequently, our System Drive will be out of space. Below are step-by-step to move docker-desktop-data out of System Drive, for example, `E:\docker-desktop\data`.

**Step 1: Stop Docker**

**Step 2: Export, unregister then import distro**

1- Shutdown all WSL distros
```powershell
wsl --shutdown
```
2- Export docker-desktop-data to tar file
```powershell
wsl --export docker-desktop-data E:\docker-desktop\docker-desktop-data.tar
```
3- Unregister current docker-desktop-data distro
```powershell
wsl --unregister docker-desktop-data
```
4- Import docker-desktop-data distro from tar file
```powershell
wsl --import docker-desktop-data E:\docker-desktop\data E:\docker-desktop\docker-desktop-data.tar --version 2
```

**Notes:**
- In this step, we may meet the error of cannot create a specific network. Just re-run the import command.

**Step 3: Start Docker**

### Resources
- [Introducing the Docker Desktop WSL 2 Backend](https://www.docker.com/blog/new-docker-desktop-wsl2-backend/): we can get more information about **docker-desktop**, **docker-desktop-data** and even the new architecture of Docker Desktop
- [Moving Docker wsl files](https://github.com/docker/for-win/issues/5829)
- [Where are Docker volumes located when running Windows and WSL?](https://stackoverflow.com/questions/61083772/where-are-docker-volumes-located-when-running-windows-and-wsl#answer-61147954)
#PureCSS - Responsive My Pixel Avatar
Tags: codepen, purecss, pixelart, css
Published: 2020-06-03 10:05:26

---
title: #PureCSS - Responsive My Pixel Avatar
published: true
tags: codepen,purecss,pixelart,css
---

<p>Pure CSS Responsive My Pixel Avatar</p>

{% codepen https://codepen.io/AsyrafHussin/pen/qBbBXxB %}
Go - debug using runtime & log
Tags: go, beginners
Published: 2020-06-03 09:56:45

When debugging programs with lots of interconnected functions in different files calling one another, it will be useful to know which file is executing at certain points in the program and the may be line number its emanating from. This can be done by using special functions from the packages runtime or log in go.


```
package main
import "fmt"
import "runtime"
import "log"

func main() {
    // Below where is our debug function
    where := func() {  
        _, file, line, _ := runtime.Caller(1) // Provides debug info
        log.Printf("%s:%d \n", file, line)
    }

    where() // Call your debug function

    name := "Pranava"
    salary := 1 * 10 // in cents :P
    fmt.Printf("%s 's salary : %d \n",name, salary)

    where() // Call your debug function

    // some more code
    costOfLiving := salary * 1000000
    fmt.Printf("Cost of living : %d \n", costOfLiving)

    where() // Call your debug function
}

```

Output will look something similar to below...

```
2020/06/03 19:48:14 /Users/pranavaswaroop/learning/gophercises/main.go:13 
Pranava 's salary : 10 
2020/06/03 19:48:14 /Users/pranavaswaroop/learning/gophercises/main.go:19 
Cost of living : 10000000 
2020/06/03 19:48:14 /Users/pranavaswaroop/learning/gophercises/main.go:25 
```

The same can be achieved using log package:

```
package main
import "fmt"
import "log"

func main() {
    // Below where is our debug function
    where :=  log.Print

    where() // Call your debug function

    name := "Pranava"
    salary := 1 * 10 // in cents :P
    fmt.Printf("%s 's salary : %d \n",name, salary)

    where() // Call your debug function

    // some more code
    costOfLiving := salary * 1000000
    fmt.Printf("Cost of living : %d \n", costOfLiving)

    where() // Call your debug function
}


Output:

2020/06/03 19:53:08 
Pranava 's salary : 10 
2020/06/03 19:53:08 
Cost of living : 10000000 
2020/06/03 19:53:08 


```
 
## Conclusion:

I will appreciate the constructive feedback about the article. Please share ways to debug `go` code from your experience.

Thank you :)
Wordpress is dying! or is it?
Tags: discuss
Published: 2020-06-03 09:44:04

Wordpress gets lots of bad press and I can understand a lot of it.

But I was recently asked by a friend what he should use if he wanted to start a personal blog. 

He has no coding knowledge and no interest in learning to code. So this rules out rolling your own.

All I could think of was Wordpress, he registered a domain, installed Wordpress via a 1-Click installation and was up and running with his first post published online within an hour or so.

What would you have suggested if asked the same question?
Git Basic Techniques(Cloning).
Tags: git, codenewbie, discuss
Published: 2020-06-03 09:07:58

**GIT CLONING**

As a starter, using git techniques can be overwhelming and in this post, I'll talk about one of the basic git techniques which are **Git Clone**. Join me as I explain what git clone is.
What is Git Clone?
the **clone** command downloads an existing Git repository/project to your local computer. This enables us to work on our copy of the project/repository without any reference from other changes.
![git-clone.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1591165005565/3Tq1JT58n.gif)
To clone a repository, run the git-clone command, followed by the path to the repository.



```
git clone/path/to/repo
``` 

if outsource doesn't reside in the same system, you can SSH to a remote system and clone too

```
git clone username@remote_system
``` 

here is also a graphical example of cloning with SSH.


![clone2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1591165692679/JlhhOmkwo.png)


if you're cloning from a source on the internet, you can simply add the URL 

```
git clone  https://github.com/username.git/the project
``` 

![DownloadZip2.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1591165979963/Tm2U4jwmn.jpeg)


in this post, I've talked about **GIT CLONE** and the ways on how to clone repository or project right into your 
local computer.

Further reading

 you can visit [GIT](https://git-scm.com) to learn more about Git basic techniques.
What is the best and simplest coding editor for newbies?
Tags: beginners, help
Published: 2020-06-03 09:00:19

Hi I am a fairly newbie when i was using freecodecamp they had me go to CODPEN and i loved its simplicity... but there are some things i believe it can't do which is basically turning into a real webpage, and especially i don't believe it will take me past HTML, JavaScript and CSS... I love the wrap around with Sublime but I get confused and frustrated on downloading any packages. I have tried JSBIN i really like the version before this but this new version doesn't seem like it is less newbie friendly... or will take me past the big three HTML, CSS, Javascript... What are your ideas?
Beginners don't miss this best series : by Aurelie Vache
Tags: docker, kubernetics, Cloud, beginners
Published: 2020-06-03 08:58:01

Hello, all my followers and friends .

Today, I would like to share 29 parts series by Ms Aurelie Vache. 

This is one of the best articles 'originally crafted' on dev.to.  I find this article worth sharing.

{% link https://dev.to/aurelievache/understanding-kubernetes-part-29-pod-lifecycle-543h %}
5 Resources that helped me learn Git
Tags: beginners, git
Published: 2020-06-03 08:51:13

When I first started learning Git I got confused a lot (I still do). 

These are the resources I used then and the ones I still refer back to now.

### [Git Book](https://git-scm.com/book/en/v2)

When I started learning I was recommended this book and it is a fantastic resource for everyone.

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

---

### [Learn Git Branching](https://learngitbranching.js.org/)

Learn Git Branching is an interactive website/course that walks you through using Git for the first time. Level up your git skills as you progress through the challenges.

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

---

### [Gitlet](http://gitlet.maryrosecook.com/docs/gitlet.html)

Gitlet is an implementation of Git in JavaScript written by Mary Rose Cook. The code is fully annotated and explains both Git and the source code behind building Gitlet. Great for getting a look under the bonnet of Git.

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

---

### [Oh Shit, Git!?!](https://ohshitgit.com/)

My go-to resource whenever I hit a problem, A comprehensive collection of common problems and solutions

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

---

### [git ready](http://gitready.com/)

A collection of git snippets and tips for all users. Another great resource to refer to when you a struggling to solve an issue involving git.

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

---

Would love to hear of any other recommendations.

If you enjoyed this article you can [follow me](https://twitter.com/iain_freestone) on Twitter where I regularly post bite size tips relating to HTML, CSS and JavaScript.
Laravel N + 1 queries detector
Tags: laravel, todayisearched
Published: 2020-06-03 08:48:14

## Problem:
My working has many many performance problems. All most of case is N + 1 queries. I have to spent a lot time to find them ...and just feel angry and tired.
There is a packages helpful with you: https://github.com/beyondcode/laravel-query-detector
A thank you to an author for a good package.
But as a developer, I want to make a simple solution by me.

## Solution:
After reading Laravel source code, I have found a way to detect N + 1 queries in some lines of code.

```php
class LazyLoadingException extends \Exception
{

}
```

```php
trait LazyLoadingDetector
{
    /**
     * Get a relationship value from a method.
     *
     * @param  string $method
     *
     * @return mixed
     *
     * @throws \LogicException
     * @throws \LazyLoadingException
     */
    protected function getRelationshipFromMethod($method)
    {
        $modelName = static::class;
        $exception = new LazyLoadingException("Attempting to lazy-load relation '$method' on model '$modelName'");
        if (! app()->isLocal()) {
            logger()->warning($exception->getTraceAsString());
            goto next;
        }

        report($exception);

        next:
        return parent::getRelationshipFromMethod($method);
    }
}
```
### Usage:

```php
class User extends Authenticatable
{
    use LazyLoadingDetector;
}
```
You will see the report in logs file if attempt N + 1 queries.

### P/s: 
I am wondering I would publish a simple package.
Please tell me your opinions and give me [a star](https://github.com/hungthai1401).

## Refs:
- https://laravel.com/api/5.8/Illuminate/Database/Eloquent/Concerns/HasAttributes.html#method_getRelationshipFromMethod
Covid19 Simple Data Dashboard
Tags: covid19, volunteer, angular, api
Published: 2020-06-03 08:38:43

---
title: Covid19 Simple Data Dashboard
published: true
description: a simple website reporting global Covid19 stats
tags: covid19, volunteer, angular, api
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/ggcht3mrczbrfnkdcfjy.PNG
---


Hi everyone,
surfing the net I found very confusing and unclear reports about Covid19.
I felt the need to create an intuitive and simple dashboard that reports the statistical data of Covid19 in the world, updated Country by Country (you can sort by "cases", "dead" and name).
Obviously completely free and without the usual advertising banners.
If it can be useful, you can find it here:

https://www.covid19-view.com

datasource: https://www.worldometers.info/
First post on DEV Community.
Published: 2020-06-03 08:33:00

Hello,
I am 7weeks into programming and loving the experience.I have already done HTML and now learning CSS.I look forward to learning JavaScript and React in that sequence for Front-end development and Python and a framework(not yet decided) for back-end development.I have just joined Dev Community and looking forward to an exciting experience of interaction and learning from you all.
Thank you.
3 Beginner Tips To Improve a Website's User Experience
Tags: ux
Published: 2020-06-03 08:23:27

For a business, their website serves as a private piece of real estate that they are in full control of. Unlike various social media platforms where you have to adhere to a certain layout that determines a user's experience, with a website you can take full control of your online visitor's user experience.

Improving user experience is a constant struggle for creatives and designers. You want to provide your audience with the best experience possible on your site while at the same time ensure that user's click on CTAs(Call To Action) buttons and other business objectives.

Here are some basic tips that you can use to improve user experience. Most of these tips are for absolute beginners. So, if you're a veteran designer, you would probably know all of these tips.

##Colors are important!

Colors are super important for a website's user experience.

To provide the best user experience, you should use colors that a user would associate with your business. Let's say that your business is about solar energy. You wouldn't want to use colors that are too dark. Light colors would be best in this case.

##Make your website lightning fast!

Speed is essential these days. If your website can't provide what a user is looking for the moment they click on your website, you're going to lose people from your audience.

Optimize site architecture. Establish a pillar category system where each piece of content is related to the other within that category. That will help you with interlinking (On page SEO).

##Always Think About Your Audience!

You should always keep your audience's interests first and foremost. Incorporate bells and whistles in your website to differentiate yourself from your competitors. A [live chat app](https://www.swiftchat.io), chatbots, advanced image search, etc. can help you do just that.

##Conclusion:
As previously mentioned, user experience is a continuous process of improvement and refinement. Once you're up to speed, you'll only need to make minor tweaks and adjustments to ensure that your website looks as fresh as possible.
Kill process on port on Windows
Tags: cmd, windows, alias
Published: 2020-06-03 08:22:52

I would like to create an alias for finding process on specified port and an alias to kill process by PID.

1. Create an `alias.cmd` file in `%USERPROFILE%`
    ```
    notepad alias.cmd
    ```
    then add the following three lines to the file:
    ```bat
    @echo off
    DOSKEY proc=netstat -ano ^| findstr :$1
    DOSKEY kill=taskkill /F /PID $1
    ```
    The first alias `proc` accepts one argument and lists PID of process running on that port.
    The second - `kill` (which also accepts one argument) - terminates the process by PID.

2. Run regedit and go to `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor` (for MS10), `HKEY_CURRENT_USER\Software\Microsoft\Command Processor` (for < MS10). Add `String Value` entry with the name `AutoRun` and value `%USERPROFILE%\alias.cmd` (path to .cmd file).

Now I can start `cmd`, type `proc 8080` and then for example `kill 15003`.
Build Push Notification Service 
Published: 2020-06-01 05:05:43

If you are going to use this for your own application, then I recommend building your own API interface with the APNS server. The component would be as follows.


1.Your phone.
2.Your server.
3.Apple Push Notification Service (APNS)


First you need the iOS application to register for receiving push notifications. Then as per the documentations, create the .p12 file and then convert it into the PEM file. After that part has been complete, you have to build your own interface with the APNS server. 

Apple have now released their enhanced notification system, which you can use to now track individual notifications that is being sent out from your server. The forensic breakdown of the APNS interface in PHP would be like follows.

First you need to build the payload with the following anatomy.

$payload='{

"aps": {

"alert":{

"title": "'.$notif_desc.'",

"body":"'.$notif_title.'" },

"badge":"'.$badge.'",

"priority":"'.$priority.'",

"sound": "default"

},

"type": "notification",

"id":"'.$lastid.'",

"date":"'.$date1.'"

}';

//The aps tagname in JSON is mandatory.

//set connection parameters.

$ctx = stream_context_create();

stream_context_set_option($ctx, 'ssl', 'local_cert', 'pushcert.pem');

stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);

// Open a connection to the APNS server

$fp = stream_socket_client(

'', $err,

$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);

stream_set_blocking ($fp, 0);

if (!$fp)

{

exit("Failed to connect: $err $errstr" . PHP_EOL); }

else{

//echo $fp;

echo 'Connected to APNS' . PHP_EOL;

$apple_expiry = time() + (90 * 24 * 60 * 60);

Now call the APNS server inside a loop, which iterates through all the values in the device token array.

// Loop start

$msg = pack("C", 1) . pack("N", $apple_identifier) . pack("N", $apple_expiry) . pack("n", 32) . pack('H*', str_replace(' ', '', $deviceToken)) . pack("n", strlen($payload)) . $payload;

// SEND PUSH

$writestat=fwrite($fp, $msg);

//Loop Ends

This is a simple PHP server side code which I have used in my application to push to APNS server.You can use it as a reference.
TÌM HIỂU NHỮNG KIẾN THỨC CƠ BẢN VỀ PRODUCT MANAGER
Tags: productmanager
Published: 2020-06-03 07:55:49

Product Manager (hay còn gọi là Người quản lý sản phẩm – PM) là có trách nhiệm định tính năng nào cần có cho sản phẩm, đồng thời họ cũng làm việc với Developer, UX UI Designer để xây dựng tính năng đó và đảm bảo sản phẩm đạt được tới chỉ số thành công nhất. Một nhà quản lý sản phẩm tốt phải có kinh nghiệm trong ít nhất một, đam mê cả ba và nói chuyện với tất cả các học viên.
http://24htechtrend.com/index.php/tim-hieu-nhung-kien-thuc-co-ban-ve-product-manager/