teleren/devto huggingface dataset:
Good software engineering practices -  part 2
Tags: productivity, technology, learning, devjournal
Published: 2021-08-05 09:07:04

Hello everyone who is reading this article. I'm going to share a few programming tips which I have learnt from my day to day job on my own and from my colleagues in the hopes that it benefits other developers working in the industry as well.

So let's begin with the first tip in this article:

## Only focus on a single bug fix or feature development at a time

Whenever we are creating a project, we should make sure that we are working on a single feature or a single bug fix at a time. The reason for this is because, let's just say if you work on multiple features or multiple fixes at the same time, you might miss the deadlines for all of them, or you might not be able to make sufficient progress on any of them because you are trying to do too many things at a time. So the advice for today is, whenever you are working professionally, always try to pick up a single bug fix or a single feature development before you move on to the next feature or next bug fix. This will keep your progress on track and make sure that you are making deployments on your project consistently.

Just in case, if it happens, that you need to work on something urgently. Then, one or two features or two fixes concurrently at a time are okay, but make sure that not everything is on high priority and that you have sufficient time to finish or work on a single feature or bug fix before you move on to the next one.

## Avoid deployments to production on Friday or near to end of the workday

Always try to avoid doing deployments to production on Fridays or towards the end of your workday. The reason for this is if there is any bug that is not handled in your code changes, you might have to work extra on your weekends or after the end of your work time. That is why it is advisable to do deployments to production usually towards the first four days of the week, and towards the start of your workday or the middle of it, so that you have sufficient time to handle any missed bugs or miss issues. And that way, your life stays simple and easy. If you're a manager who follows this practice, then that's a great thing to do in the company.

That's it from for this article. If you found this article useful hit the like button and follow me to learn more about such small but useful tips in future. Also if you have any different opinions on the topic than my own then feel free to share them in the comments. I am not a subject expert in this topics and would love to learn from your opinions, perspectives or points as well.

Have a nice day ahead 👋🏽
Important Docker Commands To Know As A Beginner
Tags: docker, devops, beginners, codenewbie
Published: 2021-08-05 09:00:22

## Commands to remember : 

- `docker run` :- runs a command in a new container . `docker run = docker create + docker start`

- `docker run -p <localhostport>:<containerport> <imagename/id>` :- running on ports

- `docker ps` :- to list all the running containers

- `docker ps --all` :- list all the container ever created

- `docker system prune` :- to delete all the containers ever created along with some other properties

- `docker logs <container-id>` :- to get the logs

- `docker start` :- start stopped container

- `docker stop` :- stop the container - gets a sigterm message - terminate signal

- `docker kill` :- kills the container or stops the container instantly

- `docker exec -it <container id> <command>` :- Execute an additional command in container. `-it` makes us to provide the input. `-it equivalent to -i -t`

- `docker exec -it <container id> sh` :- provides access to the terminal inside the context of the container

- `docker build .` :- build an image from a Docker file

- `docker-compose up` :- aggregates the output of each container. Similar to docker run myimage

- `docker-compose up --build` :- similar to docker build and docker run. Rebuilds the container after making any changes to the file 

- `docker-compose up -d` :- starts the containers in the background and leaves them running

- `docker-compose down` :- stops the running containers at the same time

- `docker-compose ps` :- show the status of the containers

- `docker commit ` :- manual image generation

- `docker build -f <filename> .` :- to run a dockerfile with some different name

- `docker pull` :- pulls an image from registry

- `docker push` :- pushes an image to registry

- `docker search` :- search for an image in Docker Hub

- `docker history` :- shows the history of the image

- `docker info` :- shows system wide information

- `docker rm` :- remove one or more containers

- `docker rmi` :-remove one or more images

- `docker pause` :- pauses all processes within one or more containers

- `docker unpause` :- unpause all processes within one or more containers

[Docker Quick Commands](https://rohithv07.github.io/Docker/)

{% github Rohithv07/Docker %}
[WIP] Quasar
Published: 2021-08-05 08:48:44

# Quasar

## Style

Quasar component and css style is almost same of Vuetify. If you are familiar with Vuetify, Quasar is easy to understand. 

```vue
<q-layout view="hHh lpR fFf">
    // same of Vuetify's v-app-bar
    <q-header>...

    // same of Vutify's v-navigation-drawer
    <q-drawer>...

    // specify color with class
    <div class=text-blue bg-primary>
```

## Theme builder

You can create your project's theme with the theme builder.

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

After build, you will get your style. Below is the example in SASS.

```sass
$primary   : #027BE3
$secondary : #26A69A
$accent    : #9C27B0

$dark      : #1D1D1D

$positive  : #21BA45
$negative  : #C10015
$info      : #31CCEC
$warning   : #F2C037

$primary   : #f39800
$secondary : #f19c00
$accent    : #f17b38
```

Set your them in Quasar option.

**quasar-user-option.js**

```js
export default {
  config: {
    brand: {
      primary: "#f39800",
      secondary: "#f19c38",
      accent: "#f17b38",

      dark: "#1d1d1d",

      positive: "#55e700",
      negative: "#e70055",
      info: "#0055e7",
      warning: "#e7d400",
    },
  },
  plugins: {},
  lang: lang,
};

```

Use Quasar with the option in Vue.

**main.ts**

```ts
import quasarUserOptions from "./quasar-user-options";

const app = createApp(App);
app.use(Quasar, quasarUserOptions);
```

## Layout builder

Quasar provides us common layout patterns. At first before/after we can generate Vue template with GUI.

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

The generated template is compatible with Vue Router. You just copy and paste it into your root Vue component.

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


# PrimeVue

## Style

```
<template>
  <div class=>
  <div>
    <Menubar :model="items">
      <template #start>
        asa
        <i style="color: var(--text-color)" class="pi pi-apple"></i>
      </template>
    </Menubar>
    <router-view></router-view>
  </div>
```

## Theme builder

## Layout builder

we should
Webrtc libraries for programmers.
Tags: webrtc, libraries, programmer
Published: 2021-08-05 08:34:09



<p>Webrtc is a free and open-source project providing web browsers and mobile applications with real-time communication (RTC) via simple application programming interfaces (APIs).
</p>
<p>With WebRTC, you can add real-time communication capabilities to your application that works on top of an open standard. It supports video, voice, and generic data to be sent between peers, allowing developers to build powerful voice- and video-communication solutions.
</p>


<h3>Webrtc Libraries</h3>

<h4>simpleRTC</h4>

Empowering developers of all skill levels to build advanced realtime apps.

<h4>RTCMultiConnection</h4>

WebRTC JavaScript library for peer-to-peer applications (screen sharing, audio/video conferencing, file sharing, media streaming etc.)

<h4>crocodileRTC</h4>

The Crocodile RTC APIs allow developers to easily integrate web communications into their website or web app and manage users. 


<h4>lynckia/licode</h4>

An Open Source WebRTC Communications Platform.

With Licode you can host your own WebRTC conference provider and build applications on top of it with easy to use APIs: client-side and server-side.

 
<h4>rtc.io</h4>

rtc.io is a collection of node.js modules that simplify WebRTC development.


<h4>webrtc.io</h4>

WebRTC (Web Real-Time Communication) is a free, open-source project that provides web browsers and mobile applications with real-time communication (RTC) via simple application programming interfaces (APIs).



<h4>easyRTC</h4>

EasyRTC is a full-stack open source WebRTC toolkit suitable for building highly secure, WebRTC applications
Week 6 of Coding Period in GSoC
Tags: gsoc, opensource, brlcad, meteor
Published: 2021-08-05 08:34:03

In week 6 of the Coding Period, I fixed some pending issues and sent PR for that issues. Let's talk about the issues I fixed in week 6.

I started by changing the directory structure of the project. It was necessary because of scaling the project. The previous directory structure of the project looked like this:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wxz30ds6xscb5x1bv8o.png)

The new directory structure looked something like this:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76lbv44tadq2jj63trz8.png)
The major change in the directory structure was moving the components to the related folders and update the path in the files where they are being used. Though, this task was last on the list and I proposed this task as a bonus task, but it was becoming a bit difficult to manage the components in the old directory structure. So, I prioritized this issue and fixed it first.

 

Then I fixed an old [issue](https://github.com/BRL-CAD/OGV-meteor/issues/58) of splitting one main CSS file to multiple CSS files in this [PR](https://github.com/BRL-CAD/OGV-meteor/pull/111). By doing this, it became easier to handle and perform CSS tasks. In this task, there was a subtask of adding SCSS support to the project. Then, I added the node-sass meteor package to the project. 

That was all for week 6, let's meet again in the week 7 blog. Thanks for reading this one :)
No, File Name and Class Name do NOT need to be same in Java. Here’s How.
Tags: java
Published: 2021-08-05 08:27:08

The very first thing I was told in my java class was that the names of the .java file and the Class in java need to be same. But soon I learned it is actually a good practice to do so, but not mandatory at all.
Let us create a simple Hello world Java program.

```
class Main{
    public static void main(String[] args){
        System.out.println("Hello World");
        }
}
```
Save the file as “Hello.java” (Class name is Main).
Now, open your terminal and give command to compile as you would normally:
`javac Hello.java`
and then when you want to execute, instead of typing:
`java Hello`
we need to type:
`java Main`
As you would see, our program got executed easily.
![Screenshot of Terminal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghagpfuq4qek6ml11g3b.png)

🔴🚫_**EDIT**🔴🚫 - As mentioned by [@wldomiciano](https://dev.to/wldomiciano), if you declare the class as **public**, then it is mandatory to name both the class and file name exactly same._

#Conclusion
At the time of execution, we just need to mention class name. Therefore, it is always advised to name the file and class alike, to not create any confusion. But as you saw, it is not a mandatory thing.
How to prevent a potential remote code execution via SnakeYAML deserialization
Tags: yaml, security, rce, java
Published: 2021-08-05 08:02:53

A popular java library for YAML parsing, SnakeYAML, has a well know vulnerability if used incorrectly to parse user generated YAMLs.

You can read about the vulnerability itself here: {% medium https://swapneildash.medium.com/snakeyaml-deserilization-exploited-b4a2c5ac0858 %}

The solutions for this problem that I have found on the net are either incorrect or unusable in real life. So I want to share here the solution that I have come up with.

It is quite simple:

```java
  public static <T> T parseYamlSafe(String yaml, Constructor constructor) {
    Yaml yamlParser = new Yaml(new SafeConstructor());
    // the following line throws an exception
    // if constructors for non standard java types exist in yaml
    yamlParser.load(yaml);

    //if we got here, the YAML is safe to parse.
    yamlParser = new Yaml(constructor); 
    return yamlParser.load(yaml);
  }
```
What does Work Management Software do and Why do you need one?
Tags: productivity
Published: 2021-08-05 08:01:06

When it comes to working on multiple tasks across various projects, a robust software is essential. You can rely on a simple task management tool for different activities but managing non-project activities like answering emails need a more powerful solution- work management software. Let’s understand the work management before going through its importance in modern enterprises.

As the name suggests, work management software is a digital tool that enables companies to plan, track, organize, and review all the tasks including project and non-project tasks with an objective of improving the outcome and performance of your team. This pops up the pertinent question — when we have different task management tools available, why should we use this tool? Let’s find an answer to this question first.

Usually people search for project management software to manage their daily professional tasks. But, here is the catch- mostly teams have other activities or non-project tasks beside project tasks. All such activities are simply beyond the scope of project management software, and therefore, it is necessary to get the flexible and scalable. It can manage all the tasks beyond the limits of a project and other methodologies.

Let’s go through the key reasons why you should opt for a work management system for your company.

<h2>Why a Work Management System Is Necessary</h2>
Here are six evident benefits of using such a system in place without stressing over joint effort and communication within various departments of your company.

<h3>1. Effective Time Management</h3>
Work management software can offer the same benefits like project management software when it comes to managing time. It is possible to track every task assigned to all team members to find the exact time required for accomplishing the project using work management software.

<h3>2. Easy and Efficient Planning</h3>
Another benefit of the work management system is it can give complete and real-time information about the team’s tasks and status updates. It is helpful for managers to plan the project in line with availability of resources and time taken by team members.

<b>Original Source : <a href="https://www.taskopad.com/blog/work-management-software/">Top Reasons Why Your Enterprise Needs Work Management Software</a></b>
Should I concentrate on code or no-code?
Tags: productivity, programming
Published: 2021-08-05 07:49:01

I have been learning Web development (HTML, CSS, and lately JS) for a while. But recently I started experimenting with no-code web tools and platforms, but I am stuck.

Many are suggesting [bubble.io](https://bubble.io/) but I find it super hard to do anything useful there. The platform is so hard to learn, and a lot of things do not make any sense to me.

I also tried various no-code/low-code platforms like [apprat.io](https://www.apprat.io/), but to me they all seem like a [Blogger](https://www.blogger.com/about/) or [WordPress](https://wordpress.com/) -- advanced CMS and nothing more.

I am also a long time user of a free no-code platform for Windows -- [Automation Workshop](https://www.automationworkshop.org/). It is super easy to use and there is a zero learning curve. But it is also limited to Windows only. There is no web support.

So the question is -- is it worth learning Bubble and similar platforms? Is there anything that is capable as Bubble, but easy as Automation Workshop?
Create GitHub Repository And Add Files using Command Line
Tags: github
Published: 2021-08-05 07:45:33

so Git is basically an open source version control system which is designed to organize and manage small and large every type of project with speed and efficiency.

While the GitHub is a web-based hosting platform for individuals and teams to store Git repository. GitHub is built on top of Git and it allows you to have both local and remote copies of your projects. With GitHub, you can easily share your project with anyone when it’s in the development stage. You can explore different popular project and can implement the new feature in their repositories.
Django + Celery + CPU/GPU + Tensorflow, Keras + Docker
Tags: django, python, machinelearning, analytics
Published: 2021-08-05 07:33:38

We held up a situation where we build tensorflow model using a GPU machine and calling the model in the same machine working fine as expected. 

We wanted to consume this model in our application which runs under Django framework with the help of celery tasks, while calling the model in the application flow inside celery worker it didn't work or got hang up. 

**We tried following possible solution but nothing worked.**

1. Increased the CPU machine number of cores and RAM size. 

2. Created a AWS instance with GPU enabled and tried to consume the model. We haven't added configuration to use the GPU since tensorflow automatically detects GPU and use it for model prediction. 

3. Since the Django application and celery running in docker container, we thought docker couldn't able to use the GPU automatically, so we changed our base image to tensorflow CPU/GPU as base docker image and tried to consume the model but failed :(.

4.  We created a new API to consume the model but failed to get the output again.

5. We noticed from the beginning the model call is working fine without application flow but via application it's not working. so we tried to call the model through a python script by using multiprocessing and found out that with multiprocessing(since celery does that) it's not working. 

**The solution:**

After we found that with multiprocessing tensorflow model predict was not working, we came through the following post which given a clear picture what's happening inside. 

[why tensorflow model predict not running under multiprocessing] (https://stackoverflow.com/questions/45459205/keras-predict-not-returning-inside-celery-task)

We added the flow in our requirements.txt 

`eventlet`

And in celery command while building the docker added --pool as below,

`celery -A Proj worker -l info -Q Q1,Q2 --pool=eventlet -c 5`

By this change we were able to call the model and get the prediction in the application flow _without GPU enabled machine!!!_ 

> To get the prediction alone from a tensorflow model we don't need a GPU machine. 

We spent a quite few days by doing many changes apart from what I mentioned above. Thought to share this so someone's day will be saved.. 

```
Happy Coding!!! 
```
When to use .gitignore and  .git/info/exclude
Tags: github, git, productivity, webdev
Published: 2021-08-05 07:29:40

Both .gitignore and .git/info/exclude are used to ignore files from staging in git.

### .gitignore

- If a file should be ignored in all clones of the repository, you would use .gitignore
- This file needs to be committed and the files mentioned would be ignored in all the clones.


### .git/info/exclude

- If for some reason you need to locally ignore certain files in a single clone, you would use .git/info/exclude
- This file acts as a .gitignore for your own local git folder and is not committed or shared with anyone else. 

### References
- [Git Docs](https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files)
In Ionic Capacitor app, How to disable long click on WebView text selection in android
Tags: capacitor, ionic, android, svelte
Published: 2021-08-05 07:08:45

I have a hybrid app made with Svelte + capacitor. In the app we are loading digital book and we are showing custom context/tooltip menu on text selection. It is working fine on Web & Desktop apps but not on Android. On Android it is showing android default menu (copy/ paste etc). We need to disable default android text selection menu.

Tried below code, but it's not working.

 mWebView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            return true;
            }
        });
        mWebView.setLongClickable(false);
Quantsapp
Published: 2021-08-05 07:03:54

Best Option Analytic Platform: Quantsapp

What is Quantsapp?

Quantsapp is an India-Based Analytic Firm wihich Promises to make "Complex Options Simplifed"

It is a Dedicated Options Analytics Platform made for Traders by Traders, with the widest range of FREE option Trading Tools in the industry.

Their Goal is to equip Retail Traders with intelligent Algorithms via. Tools at much affordable cost & without putting much of knowledge they can be placed well in the battle of Future & Options.

So now lets Understand Quantsapp in Depth & How can it can help in Making your Complex Options Trading Simplified


About Quantsapp Application

Perhaps the only App to come across with the Widest Number of Free Option trading Analytic tools. It provides 24 Free tools for Options Trading in India currently

Some of the Free tools that I personally like are

- Synopsis: It Simplifies Options data analytics by color codes& Helps to Track the Movers and Shakers of FnO Markets
- - Open Interest: It helps to Decipher options participants reaction to any move or event & Track the Change in Options OI from your Desired Date and Time.
- FnO news – Get Daily Updated news from Futures & Options Market
- - Options chain – A simplied Representation of Options Chain Data
- Built-up – A decicated tool for Options Data
- - Index contributor- It represents the market leaders and laggards.
- SGX Nifty – A tool to track SGX Nifty
& Many More.....

One particular tools that Quantsapp has Introduced & is a Personal Favourite for me is ORDER & TRADE ANALYTICS

A real time Analytic tools with a latency of less than 1 second. It has more than 30+ Indicators that help you analyze your Strike price of Any desired Scrip or Options.

Buyer & Seller indicators are some of the most famous ones, where you can realize the no. of Buyer quantity, seller quantity & many more...

Last Few Words about Quantsapp

It is perhaps the best tools to analyze options currently in the INDIAN STOCK MARKET. Quantsapp is way ahead of time & with the amount of effort they have put, its perhaps the leader in Options Trading Industry. I would personaly recommend Quantsapp for all the Options traders in INDIA. Wishing them to launch the app in Other markets as well as this would be a turning point in the entire Industry of Options Trading over the Globe. They are available acroos Android, IOS & webapp which makes them quite convinient


You can Also avail a sweet benefit of 500 INR on Signup by using Reffereal Code "QUANTSAPPIT". A really sweet gesture by Quantsapp.

Download Quantsapp/visit the Quantsapp Web: https://www.quantsapp.com/app
If we want to Learn Backend development where is roadmap?
Tags: backendroadmap, backenddevelopment
Published: 2021-08-05 07:00:20

Website development is very emerging field now a days Every one is going to learn website development so they will need to learn frontend and backend development. If you want to learn frontend development then you should learn html, css and javascript and if you want to learn backend development then you should learn SQL and PHP. 

We have <a href="https://veteranlogix.com/roadmap-of-back-end-development-2020/"> Backend roadmap </a> in which we have explained all of the things that is very important in the backend development. I hope you will like our content.