teleren/devto huggingface dataset:
$200 Cloud-Hosting PaaS Giveaway
Tags: javascript, devops, programming, node
Published: 2021-01-19 12:12:14

We are pleased to announce our anniversary giveaway and invite you to sign up for some cool prizes. This year we are celebrating 20 years in the hosting industry. To kick this off, ten lucky prize winners will be chosen at random and will win a $200 credit to be used on our cloud hosting platform in the following 60 days.

The cloud platform is designed specifically for developers and will make your daily server work much easier. It features an easy to use user panel allowing you to create high-availability and clustered environments both vertically and horizontally auto-scalable with a couple of clicks.

The giveaway starts 12:00AM January 20th 2021 and ends 11:59PM January 30th 2021 (CST). The winners will be chosen by a random draw at the end of the giveaway. Check all the details at the following page https://www.rosehosting.com/blog/cloud-hosting-platform-giveaway/
Creating a database from scratch with Node.js - Days 15-16
Tags: database, node, javascript, learning
Published: 2021-01-19 12:08:12

Hello folks!

I am back with my DBMS project; 

I was not posting about it in the last few days because I was in a hackathon, but now I can proceed with my studies.

Alright, first of all, I did not document the things I said I would, but I will get there eventually;

I have severely underestimated the time it would take to optimize the search algorithm and the time it would take to add the index maintenance to my insert/delete/update functions

so here is what I managed to do in the last two days:

---

### Optimize the search algorithm 

In my last post I've said this:

> There is only one problem with the way I'm currently doing the search in this tree, I am not considering the operation being tested by the where function so I am not locking the paths it would not make sense to search

> I am not 100% sure, but about 95% sure, that this makes the big O for the search become O(n) instead of O(log n)

Well, now the irrelevant paths are being locked, which means the search is no longer broken

To do this, I did something similar to the way I create the comparing function

I have a function that returns a function that says if the search should ignore a path based on the operator (==, <, > etc), the value being compared, the value for the current node, and the value for the next node

Something like this:

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

this alone took me hours to figure out and write test functions 

---

### Insert new values in the index

The other thing I've managed to do is to update my indexes as I add new values to my databases 

Here is how it's working

I have just created a new table "users" with only one document:

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

And I have created an index for the name of the users:

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

Then, I have inserted a new user in the table:

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

And this is how the index looks now: 

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

So yeah, it's working

---

### Conclusion

I see now that I got a little too cocky in my last post saying I would solve all my index problems in one day

I kept reading the book clean code and I came to the conclusion I will have to do a big refactor on some of my functions, including the insert function I wrote today

So my next day of work will probably be spent only refactoring

And that's it, thank you for reading

If anyone wants to read the code or play around with the project, this is the repository for the database > 

{% github ciochetta/learndb no-readme %}

and for the parser > 

{% github ciochetta/lql-parser no-readme %}
Build feature-rich sports betting app with the leading-edge Draftkings Clone solution
Tags: draftkingsclone
Published: 2021-01-19 12:00:59

The concept of betting or gambling in the sports world is not a new one. It is there in almost every sport, baseball, basketball, tennis, rugby, etc. In some countries, the concept of betting is considered to be legal, whereas, in some countries, it is not. 

However, right from the launch of online betting in 1997, everything changed, and ever since then, there is no looking back. 
In this digital era, the betting business is taken to a whole new level with the Sports betting mobile app. It has decreased the risks of betting. People now don’t have to visit places of the bet or to visit any online websites. Just a few taps on the smartphones and it is done. 

There are more betting apps in the market that come in all sizes. 
Though there are several apps, not every app is perfect, and there is a lot of space for you to take place still if you come up with the best engaging and feature-rich betting mobile app like Draftkings. 

Why build sports betting apps like Draftkings?

Online betting is growing exponentially, and according to Transparency Market Research, the market is expected to expand at the CAGR rate of 12.9% between the years 2018-2024, as forecasted by APAC. Apart from this, sports betting is seen to grow by 40% in the global gambling market than any other sections like lotteries, casinos, and other gaming forms. 

As a final thought, the technology works like magic these days, by transforming almost anything and everything around us. Start your development with the leading-edge DraftKings clone script to keep up with the evolution for a lucrative business.

For More Info contact us at https://www.appdupe.com/draftkings-clone
Difference between STACK AND QUEUE 
Published: 2021-01-19 11:53:18

Stack A stack is a linear data structure in which elements can be inserted and deleted only from one side of the list, called the top. A stack follows the LIFO (Last In First Out) principle, i.e., the element inserted at the last is the first element to come out. The insertion of an element into stack is called push operation, and deletion of an element from the stack is called pop operation. In stack we always keep track of the last element present in the list with a pointer called top.



Queue: A queue is a linear data structure in which elements can be inserted only from one side of the list called rear, and the elements can be deleted only from the other side called the front. The queue data structure follows the FIFO (First In First Out) principle, i.e. the element inserted at first in the list, is the first element to be removed from the list. The insertion of an element in a queue is called an enqueue operation and the deletion of an element is called a dequeue operation. In queue we always maintain two pointers, one pointing to the element which was inserted at the first and still present in the list with the front pointer and the second pointer pointing to the element inserted at the last with the rear pointer.
What is WSL ? What are the Features of WSL ?
Tags: devops, linux, programming, discuss
Published: 2021-01-19 11:51:45

WSL also known as windows Subsystem for linux .The Windows Subsystem for Linux lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dual boot setup. Which helps users to save a plenty of time by not running into an error .Even after so many efforts put by Microsoft, Users  love to use Linux over Windows .



**Features of WSL**

You can Run common command-line tools such as grep, sed, awk, or other ELF-64 binaries.
Run Bash shell scripts and GNU/Linux command-line applications including:
Tools: vim, emacs, tmux
Languages: NodeJS, Javascript, Python, Ruby, C/C++, C# & F#, Rust, Go, etc.
Services: SSHD, MySQL, Apache, lighttpd, MongoDB, PostgreSQL.
Install additional software using your own GNU/Linux distribution package manager.
Invoke Windows applications using a Unix-like command-line shell.
Invoke GNU/Linux applications on Windows.


**Please also subscribe our YouTube Channel
Hostar+Disney Clone made for Beginners using Reacts js** 
https://www.youtube.com/watch?v=4pjpHUN28kk&fbclid=IwAR02hJnCgk5qXDVdHPsCxqZgm8dY2kWXbGdRuFwtaHLBuV0TQiLQvJzw1t0&ab_channel=ForCommunity
Java isn't any trend of 2021...?
Tags: java
Published: 2021-01-19 11:32:29

I love Java.

I read [Software Development Trends in 2021](https://towardsdatascience.com/21-predictions-about-the-software-development-trends-in-2021-600bfa048be).

Also, Developer Roadmaps
https://roadmap.sh/
[The 2021 Web Developer Roadmap](https://levelup.gitconnected.com/the-2020-web-developer-roadmap-76503ddfb327) 
This is the 2021 edition.

[What are your plans to read/learn in 2021?](https://dev.to/deveconomics/what-are-your-plans-to-read-learn-in-2021-3nkj) 

Looks so exciting!
[50 free tools and resources](https://markodenic.com/50-free-tools-and-resources/)

Books.
[Eight must-read books for developers in 2021](https://developereconomics.com/blog/eight-must-read-books-for-developers-in-2021)

However, what about Java?
Recently I have no idea about Java except minor improvement.
Java 15 / JDK 15
https://mail.openjdk.java.net/pipermail/announce/2020-September/000291.html
http://openjdk.java.net/projects/jdk/15/spec/
or GC, Performance improvement.

What about [Top 10 In-Demand programming languages to learn in 2020](https://towardsdatascience.com/top-10-in-demand-programming-languages-to-learn-in-2020-4462eb7d8d3e)? 

They are saying：
>In recent years, Java has lost some of its markets to highly developer-friendly modern languages and the rise of other languages, especially Python, JavaScript. Also, JVM is not quite Cloud friendly because of its bulky size. Oracle has recently introduced hefty licensing fees for JDK, which will dent Java’s popularity further.
>Fortunately, Java is working on its shortcomings and making Java fit for Cloud via the GraalVM initiative. Also, in OpenJDK, there is a free alternative to the proprietary Oracle JDK.
Java is still the number one programming language for enterprises.

True. I'm using Java in my job for enterprises. I love Java.
But there may be no topic which can be the big wave like JavaScript or frontend ...

I'm afraid that Java can be next COBOL in this way...?
What is std::function in C++, and why we need them?
Tags: cpp
Published: 2021-01-19 11:31:39

---
canonical_url: https://lesleylai.info/en/std-function
---

Yesterday, someone in the [#include<C++>](https://www.includecpp.org/discord/) discord server asked the following question:

> how `std::function` works with lambda captures and functions handling I still don't understand

Below was my answer to the question, with some typo-fixes and expansions:

## Invocables can have different types even if their parameter and return type are the same

Lambda expressions can be considered syntactic sugar over classes with `operator()` defined. For example:

```cpp
int x = 3;
auto lambda = [x](int y) { return x + y; };
```

is roughly equivalent to

```cpp
struct __Lambda {
  int x;

  int operator()(int y) const {
    return x + y;
  }
};

int x = 3;
auto lambda = __Lambda { .x = x };
```

One consequence is that every lambda expression has a distinct type. For example, in the below snippet,

```cpp
int x, z;

auto lambda = [x](int y) { return x + y; };
auto lambda2 = [x, z](int y) { return x + y + z; };
```

`lambda` and `lambda2` have different types, even though they both take an `int` and return an `int`.

C++ also have functions, which are distinct from classes with `operator()`.

## The motivation for `std::function`

Then, how do we store such an invocable object that takes an int and returns an int disregard of its types?

We need `std::function` to accomplish such a task. For example:

```cpp
struct S {
  std::function<int(int)> func;
};
```

A canonical use case for storing an invocable in this fashion is a task system, where you probably want to store callbacks in a container to execute later:

```cpp
struct TaskQueue {
  std::queue<std::function<void()>> queue;
  std::mutex mutex;
  std::condition_variable ready;

  // member functions
  ...
};
```

## Type Erasure

To make `func` accepts both `lambda` and `lambda2`,
`std::function` needs to have constructors that take any function object or plain function that satisfies its signature.
And we need to perform *type erasure* to achieve this behavior.

There are various techniques to implement type erasure in C++,
and it is not a topic I can fit into this post. But the high-level idea is that `std::function` needs some function pointer that can invoke the lambda and some storage space to store lambda captures.
The data need to be allocated on the heap since lambda expressions (or invocable classes) can have arbitrary sized capture. However, all major `std::function` implementations also perform *small buffer optimization* if your lambda is small enough to fit into a predefined capacity. In that case, all data can be allocated directly inside the `std::function` object itself, and no additional heap allocation is performed.
How Vet Pharma Companies Help Animal Owners During the Pandemic-COVID-19? 	
Published: 2021-01-19 11:27:14

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

COVID-19, the pandemic has put the world on hold. People are confined to indoors, only moving out only when it’s a necessity. Along with humans, the pets and few farm animals are facing the heat of this virus. All these animals also need to stay indoors, which would affect their physical and mental health, to a certain level. A few <a href="https://www.intracin.com/">vet pharma companies in India</a>, are proffering supplements that help people keep their pets in the best of their health.  
 
People are intelligent and capable enough to take good care by staying indoors. Most animal owners do not understand that keeping animals indoors could affect their overall health, as their daily routine has seen a drastic change. A top scientist at an animal health products manufacturer in India shares that the pets, especially dogs, need little physical excursion and social interactions. The COVID has forced people to stay away from those crucial interactions, which help the animals to stay fit and healthy. Experts suggest the use of pet feed supplements that could provide benefits in more than one way. 

It is the responsibility of pet-parent to ensure proper access to adequate pet food, medicines, supplements and other <a href="https://www.intracin.com/products/canine-feline/canine-feline-miscellaneous">pet care products</a>. They help in keeping the immunity levels high and safeguard them from diseases. One can stock enough branded vet medicines, which would be top-quality, but available at a low cost. 

<b>Other few measures that one can do with their pet include</b>

• Play and exercise with pets, at least one hour a day
• Work on training the animals
• Maintaining proper hygiene

Scientists could not find any proofs of the virus (COVID-19) readily infecting domestic pets like cats and dogs. They could not find proof that the naturally infected animals could infect other animals or people with the virus. The measures suggested are only as a mark of caution.

If one is down with coronavirus, it would be ideal in maintaining a distance from pets and other animals. They can request someone who has not been infected to take care of the animals. If the infected individual does not have any other option; then they need to follow a few safety precautions. The pet caretaker should wear a face mask; avoid petting and kissing, or sharing food with them. The experts suggest keeping a stock of food supplies and necessary medications that could last at least ten days. It could be of great help if one needs to self-isolate or quarantine them. 

<b>Conclusion</b>

If one feels that a visit to the vet is not required, they can take care of the animal with proper medication. One can even opt for tele-medication, to cure ailing animals.
Easy way of learning new framework
Published: 2021-01-19 11:24:31

Hello to everyone reading this post, I have try this easy way and it work for me several times and it work for me perfectly fine, so here are the concepts 👇👇
#1.understanding the syntax
by carefully reading the docs step by step if possible finish the docs before practicing it will help because is what you understand that you can put into practice but if reading docs and practicing along is best for you, you can go on but I bet you there's a stage you will reach it will hang you and you will feel like quiting.

#2.understanding the components views

This time around the ball is on your court  play with it any how you want it, by practicing i.e copying and pasting don't stress yourself by trying to have all syntax offhand with regularly practicing you will know them all.

#3 Data looping
This is another most important thing to learn in every framework because each framework have it own pattern of looping so is important you knowing it.

#4 API call
As a frontend developer you are ought to know how to use API calls either by axios or graphql all help and all achieve the same goal

#5 most of all
 steady practicing and comfort zone with less noise because programing deal with thinking.
Shifting Security Left in the DevOps Era

Tags: kubernetes, devops, security, cloudnative
Published: 2021-01-19 11:21:37

In the world of cloud-native applications, innovation, and fast go-to-market plans, unicorn companies - such as Google, Netflix, and Amazon - are doing tens, hundreds, even thousands of container builds and deployments a day. 

 The traditional way of injecting security at the tail-end of the software development process has hindered releases and created adversarial relationships between the DevOps and the security teams, bringing your hard-earned agility to a halt.


Here is where SecDevOps comes in. SecDevOps offers a new security model by incorporating a security-based mindset into DevOps workflows, sharing security responsibility across all teams, and shifting visibility to the left.

In this webinar, you will learn:
* The security drawbacks in the cloud-native space
* The rise of SecDevOps
* 3  key elements to successfully shift your security left
* How to create alignment between traditional Dev and Sec Team

Submit your attendance here: https://www.magalix.com/shifting-security-left-in-the-devops-era
Poll : Importance of issue tracking
Tags: help, computerscience, github, issue
Published: 2021-01-19 11:12:31

**Hey everyone, we need your help !** :-) 

We are four students in IT school and we are working on the subject : ***How issue tracking could be useful during a bug investigation ?***

We have a very quick (around 5 min) survey for you !
We would like your opinion and experience on this subject.

Check this link to help us :
https://forms.gle/fqenw8Hx1UgB4GZq5

**Thank you !**
ARTIFICIAL INTELIGENCE
Tags: ai
Published: 2021-01-19 11:11:21

Artificial intelligence is nothing but the simulation human intelligence into machines that are programmed to think and act like a human .There are many uses for artificial intelligence in our day to day life.
     The useage of artificial intelligence in medical field has done so much contribution for the welfare of us humans.AI is used to detect the symptons of disease in patients which is not visible to human eye.
     The useage of ai in home applience has a great share in the monopolization of human kind. AI is used to control the room temperatute ,music ,lights etc...
Introduction
Published: 2021-01-19 11:08:58

Understanding about how Python works in simple words
Python is a high-level interpreted programming language.
What it means is that the python code needs to be translated (interpreted) by another software program which is called the interpreter that executes the code line by line and converts it into bytecode (very close to machine-readable code).
This bytecode is run by the Python virtual machine (gets installed when we install python) and then converted into machine-readable binary code which computers can process and perform the necessary action.

While installing Python, what we install is the python interpreter along with the virtual machine.
Versions
There are two major versions v2 and v3. In 2008, several major improvements were introduced in the language that introduced some breaking changes without considering backwards compatibility. The official docs now recommend using v3 and support for v2 would be ceased after 2020.
name = input('What is your name?') #promts user input in console and store in a variable
print('Welcome to the world of Python ' + name) # prints to console
comparing it with JavaScript
const name = prompt('What is your name?');
console.log('Welcome to the world of JavaScript ' + name);
Well, that's pretty much for Day-1! I know I have barely written any code. I just wanted to spend my first day in building the roadmap. Now that I have the language split into chunks, the goal would be to focus on the weekly goals and share daily progress about the same.

Have a great one!
Difference between sorted and sort in python
Tags: programming, python
Published: 2021-01-19 10:54:25

Most of the people confuse when to use sorted and sort in python,as we see both are used to sort a list.
The basic difference between sorted() and sort() function is sorted function is use to create a new list which has the elements of sorted version whereas sort function is used to modifiy the list it is called on.If the user wants to have the unsorted orginal version after sorted it he should use sorted() function. If user does not give any importance to orginial list he can use sort() function.
Coming to its syntax :
sorted() : new_list = sorted(orginial_list)
sort()   : orginial_list.sort()