teleren/devto huggingface dataset:
Learning Android Development on Udacity
Tags: android
Published: 2021-05-30 13:43:11

I started working on learning Android Development from Udacity. 
It is a free course and is being tought by people working at Google.

If anyone is interested you can go to this link : 

[Android Basics](https://www.udacity.com/course/android-basics-user-interface--ud834)

The first few lessons explain about Views in Android

A View is an individual element that is used to represent a type of content on the screen, multiple views are combined to form the layout of the app

There are different kinds of views :
TextView : Represents text
ImageView : Represents images
Button : Represents buttons

There also exercises that help us understand how different views are used to build a layout

XML tags are used to build these views
Example : To show some text on a screen we use the TextView tag
We can add attributes to the tag to further add more details , such as textColor and background

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rloiomz5hy6phnj3l8kk.png)

  
I feel this would be a really good course for someone intrested in getting started with [Android Development](https://www.udacity.com/course/android-basics-user-interface--ud834)
Build a Command Line interface with Python Click
Published: 2021-05-30 13:42:56

Hey everyone! Today I show you how you can create a CLI (Command line interface) with Pythons Click library. 

{% youtube F4iAdY8zp28 %}

Find the documentation with example code here:

https://click.palletsprojects.com/en/8.0.x/quickstart/

➤ Timestamps
0:00 Intro
0:13 Set up virtual environment, install Click
0:55 click command, option and argument
3:36 click group
TDD (Test Driven Development) For People Who Hate Reading
Tags: testing, programming
Published: 2021-05-30 13:36:40

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvb7aj0dq465mx2jlc4n.jpg)

###What's TDD?
Stands for Test Driven Development. It is when you write a test first in a development which would "drive" the development of any feature. Before that let's take a look at a sample test. A test is just additional codes that test your actual codes.
```javascript
describe("greet", () => {
  it("should return the greeting message", () => {
    const result = myLibrary.greet("Ishak");
    expect(result).toMatch(/Ishak/); 
  });
});
```
If you've never written a test before, in the above snippet, I'm invoking a function called greet() in an imaginary library by me called myLibrary. Then, I'm asserting the result to match a regular expression such that my name is included in the greeting message, for example "Good morning, Ishak! Have a great day". As you can see, writing test is not difficult because it's not meant to be difficult. Writing test cases are super straightforward.

###Do You Need TDD?
You may develop your application first and then write tests, but with more failing tests, come greater stress. Not only that, most of the developers wouldn't be motivated enough to write "intangible" tests after the development of actual application. In contrast, if you develop application with TDD, not only you don't have to write boring tests after developing an application, but almost every feature will have test case(s) behind it whether you like it or not because that's the nature of TDD.

###When Do You Need TDD?
For small application that you develop without thinking about scalability and other issues, I wouldn't suggest TDD because it's time consuming and pretty unnecessary. However, to develop large-scale application, you need TDD for all the great benefits it offers such as eliminating low motivation to write tests, super high test coverage for your codebase, and simply allowing you to build projects with strong foundation.
Create an electron-app using svelte build script included
Published: 2021-05-30 13:32:11

# First generate the svelte app
* install `degit` if not installed`npm install -g degit`
* Setup svelte app using `degit sveltejs/template app-name`
* `cd app-name` and run `npm install`
* now your svelte app is ready

# Add electron
`npm install -D electron`
create an `index.js` file in the project root
paste code below 
```
const { app, BrowserWindow } = require('electron')
const path = require("path");
function createWindow () {
  const win = new BrowserWindow({
    width: 800,
    height: 600
  })

  win.loadFile(path.join(__dirname, 'public/index.html')
}
app.on("ready", createWindow)
```
now add `"main": "index.js"` in your `package.json`
then replace `scripts` in package.json with
```
"scripts": {
    "build": "rollup -c && electron-builder",
    "dev": "rollup -c -w",
    "start": "electron .",
    "validate": "svelte-check"
},
```

now open terminal and run `npm run dev` a window will popup like this ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3szftz70riw4lpj02ibh.png)

to fix this go to `public/index.html` file and replace it with this
```
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />

    <title>App Name</title>

    <link rel="stylesheet" href="global.css" />
    <link rel="stylesheet" href="build/bundle.css" />

    <script defer src="build/bundle.js"></script>
  </head>

  <body></body>
</html>
```
run `npm run dev` again and you will get 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bt4jhgz1r8lsyloc8i4.png)
# Now for building install electron builder
`npm i -D electron-builder` 
now run `npm run build`
wait till command ends and you should get a `dist` folder
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxbrbczrzi3mkbe15x4u.png)
How to keep your Microsoft team online even if you're not using it !!!
Tags: workstations
Published: 2021-05-30 13:26:09

Hello world, this is my first blog that I’m writing. In this blog, I will explain 2 ways to set Microsoft team application online even if you're not using it.
The key here is we need to move the mouse🖱️ because the Microsoft team application detects the mouse movement to show online or away.
Number one:-
Using external mouse
Requirement: — External mouse and any glass surface like watch or glass cup.
Connect the external mouse to our laptop.
Place mouse laser sensor on top of the watch ⌚.

3.That’s it. It will keep your Microsoft team application online.
Number Two:-
Requirement:- Download jar and bat file from the below link.
https://drive.google.com/drive/folders/1VaN95wsmUut_qgh67KrA5BFMjy0xsK8o?usp=sharing
Create a folder on your laptop as mouseJiggler.
Place the downloaded file into the folder.
Run mouseJigger.bat file.
That’s it. It will keep your Microsoft team application online.
Wonder how it works???
It’s a simple java code that will keep your mouse moving every 10 seconds. The source code for the above jar is available below. Can you play around with it.

import java.awt.Robot;
import java.util.Random;
public class Mouse {
// WAIT -> interval for mouse movement.
public static final int WAIT = 10000;
// Maximum X position mouse can move
public static final int Y = 400;
// Maximum Y position mouse can move
public static final int X = 400;
public static void main(String… args) throws Exception {
Robot robot = new Robot();
Random random = new Random();
while (true) {
// move mouse to random x and y position
int x = random.nextInt(X);
int y = random.nextInt(Y);
System.out.println(“Mouse move to x=”+x+” and y=”+y+” position.”);
robot.mouseMove(x,y);
Thread.sleep(WAIT);
}
}
}

Jar file moves the mouse every 10 seconds. You can increase the timing from 10 seconds to 1 minute to save energy ⚡.
That’s it, hope you like this blog 😊.
Sending dynamic emails from a centralized mailer
Tags: help, django, python
Published: 2021-05-30 13:06:14

I just wanna confirm if this is the right way to dynamically send emails from a centralized mailer in django. If not, how what is the right way to send dynamic emails?

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqwoooc16anabhl3w2tl.png)
Track user location coordinates realtime using geolocation api, nextjs , nodejs and socket.io
Tags: showdev, react, webdev, node
Published: 2021-05-30 12:49:51

Hello developers , realtime things are really mind blowing it have a lot of fun that amaze us.
In this blog post i will show you how i have played with socket.io and browser geolocation api to track user coordinates in real time.

When a new user will connect other users in app will get new user coordinates and new user will get all users coordinates.
And when someone disconnect they will disappear from app

### what i have used in this app
- Nextjs
- Socket.io-client
- Chakra UI
- Geolocation API
- hooks
- context
- vercel

- Nodejs
- socket.io
- heroku


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


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


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


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nximor981gzewts85yq.png)




### You can visit code  in my github repos

#### frontend
{% github harshmangalam/live-location-tracker-nextjs-client %}

#### backend
{% github harshmangalam/live-location-tracking-nodejs-socketio-server %}

### deployed on vercel

[nextjs frontend live](https://live-location-tracker-nextjs-client.vercel.app/)
Use Storybook with tailwind on a Vue 2 project
Tags: vue, tailwindcss
Published: 2021-05-30 12:33:59

```
npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
```

```
yarn add -D storybook
```

```
npx sb init
```


Add a custom webpack.config.js in your .storybook folder and add the following:
```javascript
const path = require('path')

module.exports = {
  stories: [
    '../src/**/*.stories.mdx', 
    '../src/**/*.stories.@(js|jsx|ts|tsx)'
  ],
  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    '@storybook/preset-create-react-app',
  ],
  webpackFinal: async (config) => {
    config.module.rules.push({
      test: /\.css$/,
      use: [
        {
          loader: 'postcss-loader',
          options: {
            ident: 'postcss',
            plugins: [
              require('tailwindcss'),
              require('autoprefixer'),
            ],
          },
        },
      ],
      include: path.resolve(__dirname, '../'),
    })
    return config
  },
}
```
TCP, UDP or QUIC? Read this before you choose.
Tags: networking, tcp, udp, quic
Published: 2021-05-30 12:28:48

If you're writing an application that sends data over a network, you have an important choice to make. How will it communicate? In some cases you can - and probably should! - reuse an existing application-layer protocol like HTTP. But maybe you need something specialized to your needs.

In this case you'll be writing your own application-layer protocol. Your new protocol will build on either TCP, UDP or QUIC. Which one should you pick and why?

For a detailed look at the differences between the three protocols, you might want to watch this animated video:

{% youtube y8xHJJWwJt4 %}

What your best choice is depends on the nature of your application. Here are some important considerations.

- TCP and UDP are well-established protocols that are pretty mature. QUIC is a relatively new alternative to TCP that may outperform it, but its development is still [ongoing](https://datatracker.ietf.org/doc/html/rfc9000).
- TCP and QUIC provide reliable data transfer. This means you can be reasonably sure that what you send comes out correctly on the receiver's end. UDP provides no such guarantees. Data may be delivered in a different order, parts of your message may get lost, or data may be delivered to your application in a corrupted state.
- UDP provides the lowest possible lag because it doesn't have to provide any reliability guarantees. TCP and QUIC negotiate a connection before sending data, and may delay sending new data as they await delivery confirmations from the receiver.
- Unlike TCP, UDP is able to support multicast and broadcast transmissions.
- QUIC provides encryption out of the box. For TCP connections you can use TLS 1.3 with some additional setup. UDP transmissions can use DTLS.
- If your application maintains open connections over a longer period, they may get disrupted when your users switch between WiFi, Ethernet and cell towers. QUIC has an edge here: its connection migration feature can handle those network switches.
How to plot a box plot using R
Tags: tutorial, devops, database, datascience
Published: 2021-05-30 12:27:31

### How do you construct a boxpot with ease using R
#### How to plot Boxplot in R-programming
box plot also is very similar to all others graphs in method. All we need to draw it is our data then the box plot() function.
let's see how it works.

#### Example 
Represent the following  weight of some students in boxpot.
1,3, 6, 1,3,3, 4, 3, 3, 1, 3 ,5 ,1, 2, 1 ,4, 3, 2 ,3 ,1 ,
1, 1 ,1, 4, 3, 1,5,5

Codes
```R
weight=c(1,3, 6, 1,3,3, 4, 3, 3, 1, 3 ,5 ,1, 2, 1 ,4, 3, 2 ,3 ,1 ,1, 1 ,1, 4, 3, 1,5,5)
boxplot(weight)
```

**Result>>**

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqea448i54ht8m975c3n.png)
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i6tgyjy3ec3n5uvot6v4.png)
  
Now that is nice, how about given it color and title?? then we can make use of some other parameters in boxplot() function. they are :
**main**: to write the main title of the graph
**col**: to give preferable colour for our boxpot.
**col.main** : to give a preferable font color of our main title
**xlab:** to give a label on x axis
ylab: to give a label on y axis
border: to give a preferable color for the border instead of black.
let's practice it and see how it works
#### Example2
use the weights in example to plot boxplot.
codes>>
```R
weight=c(1,3, 6, 1,3,3, 4, 3, 3, 1, 3 ,5 ,1, 2,
         1 ,4, 3, 2 ,3 ,1 ,1, 1 ,1, 4, 3, 1,5,5)
boxplot(weight,
        ylab = "numbers",
        main = "The weight of some students.",
        col = "darkorange",
        col.main='red',border='green')
```
Result>>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0ego0p88xp02sttok8m.png)

One more thing is that you can have more than one boxplot on your graph, just list them in the boxplot() function.  

Example
the following show the score of some student in mathematics and english. use the two data below to plot boxpot. 
Mathematics={61,53, 46, 61,63,53, 44, 43, 43, 61, 33 ,45 ,31, 52,    51 ,54, 53, 44 ,38 ,51 ,41, 51 ,61, 44, 53, 61,45,55}
English = {51,43, 66, 51,43,33, 44, 53, 63, 41, 53, 45 ,51, 52,
         61 ,44, 33, 42 ,53 ,61 ,61, 51 ,41, 44, 43, 41,45,45}
Solution.
Codes>>
```R
Mathematics=c(61,53, 46, 61,63,53, 44, 43, 43, 61, 33 ,45 ,31, 52,    51 ,54, 53, 44 ,38 ,51 ,41, 51 ,61, 44, 53, 61,45,55)
English = c(51,43, 66, 51,43,33, 44, 53, 63, 41, 53, 45 ,51, 52,
         61 ,44, 33, 42 ,53 ,61 ,61, 51 ,41, 44, 43, 41,45,45)
boxplot(Mathematics,English
        ylab = "numbers",
        main = "The Mathematics and English Score of some students.",
        col = "orange",
        col.main='red',border='blue')
```
Result>>
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbudfnjo9zujgwham2cl.png)
 
Now I believe you now understand both stem and boxplot. I hope you find this article helpful?? consider to follow me. it's the guy Maxwizard. chat me up on whatsapp(07045225718) if you have any question on this or any big deal. enjoy coding!
How to plot stem and leaf in R-programming
Tags: analytics, devops, datascience, tutorial
Published: 2021-05-30 12:21:15

### Stem-and-leaf Charts
There are a range of graphical summaries of data. If the data set is relatively small, the stem-and-leaf diagram is
very useful for seeing the shape of the distribution and the values. It takes a little getting used to. The number on
the left of the bar is the stem, the number on the right the digit. You put them together to find the observation.
Suppose you have the box score of a basketball game and find the following points per game for players on both teams
21 13 16 23 14 12 14 13 22 10 10 20 16 28 21 14 14 18 22 15.
To create a stem and leaf chart is simple, all you need is the `stem()` function.
Let's try to solve the question above.
**Codes>>**
```R
score=c(21, 13, 16, 23, 14, 12, 14, 13 ,22 1,20, 10, 20 ,16, 28 21,14,14,18,22,15)
stem(scores)
```
**Result>>**
```
> score=c(21, 13, 16, 23, 14, 12, 14, 13 ,22,13,20, 10, 20 ,16, 28, 21,14,14,18,22,15)
> stem(score)

  The decimal point is 1 digit(s) to the right of the |

  1 | 023334444
  1 | 5668
  2 | 0011223
  2 | 8
```
Can you see how easy it is?? let's try one more Example
#### Example2
Represent the following data in stem and leaf.
1,3, 6, 1,3,3, 4, 3, 3, 1, 3 ,5 ,1, 2, 1 ,4, 3, 2 ,3 ,1 ,1, 1 ,1, 4, 3, 1,5,5

**Solution.**
this is our codes below
Codes>>
```R
data=c(1,3, 6, 1,3,3, 4, 3, 3, 1, 3 ,5 ,1, 2, 1 ,4, 3, 2 ,3 ,1 ,1, 1 ,1, 4, 3, 1,5,5)
stem(data)
```
Result>>
```
data=c(1,3, 6, 1,3,3, 4, 3, 3, 1, 3 ,5 ,1, 2, 1 ,4, 3, 2 ,3 ,1 ,1, 1 ,1, 4, 3, 1,5,5)
> stem(data)

  The decimal point is at the |

  1 | 0000000000
  2 | 00
  3 | 000000000
  4 | 000
  5 | 000
  6 | 0
```
**Exercise**
use the following marks to plot a stem and leaf. 
46,47,60,40,54,29, 59, 50, 29, 59, 46, 51, 51, 50, 61,
32, 45, 42, 62, 62, 42, 37,28, 51, 41, 38,40, 41, 45, 59, 38,41,
45,34, 40, 59, 41,60, 54, 44, 56,53, 25 ,49,54, 58, 34, 60, 51, 25.

I hope this article satisfy your needs?? if so, then don't stop here try to read the [next articles..]()
Linked lists
Published: 2021-05-30 12:20:15

Famous linked list questions approach
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lfehqwbcpsgalo57qihg.jpeg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4p3lk8ahu09ixfvkra9q.jpeg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yankc5p9q4dq32jgakqr.jpeg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nfjfb3cboawcjodbg6tk.jpeg)
How AWS hybrid cloud can support BSS/OSS transformation
Published: 2021-05-30 12:16:09

No doubt that deployment 5G will need new BSS system to support all the opportunities and uses cases generated from 5G such as network slicing. Managing network slices effectively and at scale, offers enterprise customers will self-manage the network allocation and capabilities through policies, dashboards, or other BSS services.

One of baggiest challenges to move the BSS system to the cloud is that requires single-digit millisecond latencies to operate effectively. When the nearest public cloud servers are not close enough to meet application latency requirements. 

Another challenge is that in many countries, the regulatory entity refused to move the customer data outside the border, it considered as sensitive data.
To overcome the above challenges and more, AWS offers Outposts service, one of the of the hybrid cloud technologies in AWS.


## What is Outposts

AWS Outposts provide local compute and networking services to edge locations that have limited space or smaller capacity requirements. Outposts servers are ideal for customers with low-latency or local data processing needs for on-premises locations like retail stores, branch offices, healthcare provider locations and IOT & 5G data processing.

It is not just AWS Hardware on premises, it is fully managed services which operated by AWS but on premises. after installation, it can be managed from the same way of managing any service in AWS within the region like Console, CLI or SDK, it also gives all facilities to run ECS, ECS, S3, RDS and EMR.

AWS will deliver Outposts servers directly to CSP, and either have onsite personnel install them or an AWS preferred third-party contractor. After the Outposts servers are connected to the network, AWS will remotely provision compute and storage resources so the CSP can start launching applications. the below basic diagram shows the connectivity from Outposts to the AWS region. it can be through VPN or direct connect.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31ya8x9zts7z8iyvxz9a.png)

## Outposts benefits 

1- Run AWS services on premises.
2- Store and process the data closer to the traffic.
3- Full Managed infrastructure from AWS.
4- Provide supper low latency. 
5- local data processing for IOT & 5G.


In The upcoming articles, we will talk about the networking of Outposts and verities of connection with the LAN, WAN and AWS region.
How to start with competitive coding...?
Tags: cpp, computerscience
Published: 2021-05-29 14:14:16

Everyone is aware about so many competitive platforms but don't really know which one to choose. We all have been told by our seniors teachers to start with competitive coding and with that motivation we create an account and start solving, but we don't really understand those problems and the we either give up or copy.
But what's the right way...

According to me the right way is...To know where you Stand. 
To understand how much of the basics you know...
Are you comfortable with all those starters problem like palindrome, min-max, Even-odd-prime nos, Binary Sort etc. If you are not comfortable with these you know now where to work. Understand them, Practice them. Make sure you practice it concept wise while knowing its applications too. This will help you identify problems where you can use these concepts.

Once your basics are clear I'll suggest you to start with your journey and simultaneously start learning Data Structures and Algorithms.
This will be enough to start.
A headache named default style in CSS
Tags: css, webdev, html, web
Published: 2021-05-30 12:15:48

At least once, Front-end developers tackled default style in their projects and professional life. And also, swearing at CSS creator or Google Chrome and so on as well. So how we can get rid of this nightmare? Is any easy peasy lemon squeezy way to solve the problem?
Yes, this Is the short answer to this question. But how? In this short article or whatever you named, I will introduce how you can reset all the user agent and default styles.

##Where the default style comes from?

Before understanding the solution, it's important to understand where we get our basic styles in our browser.
All the properties in CSS come with `initial` value to load the default style of each property. And this is NOT related to HTML.

##The User-Agent Browser Styles

After applying the initial styles of all the CSS properties, the browser finally loads its default styles which are known as `user-agent`. These styles have nothing to do with the base initial values of the CSS properties.

Also, you can see them in the Chrome developer tools.

For Example:

![1_user-agent](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlnhpzj706yhv8vs395q.png)

HTML elements do not have initial style values! The basic styles of an HTML element, such as the `<h1>` tag, for example, comes from the browser user agent stylesheet and not from the `initial` value of the properties of CSS.

##And now lets to talk about the solution

To reset all the `user-agent` styles, you can easily use `all:unset` property for each element in the CSS.
For example: `h1{all:unset}`
There are different values for `all` like `initial` and `inherit` which you can read about them more in the [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/CSS/all).

##Browser Support

* `inherit` - works in all browsers, including Internet Explorer 11
* `initial` & `unset` & `revert`- work in all browsers except for Internet Explorer 11

##Final Words

That's all.
I hope you've enjoyed this article and learned from my experience.
If you like this post, I would appreciate applause and sharing :-)