teleren/devto huggingface dataset:
Node js Left Join with limit and offset Mysql
Tags: node, sql, beginners, webdev
Published: 2020-09-19 08:14:47

<meta name="monetization" content="$ilp.uphold.com/LbbNym3PHJ2f">
**I was having a scenario where i was required to add pagination to website without using any plugin so i started, i knew how to use limit and offset but with joins it was a problem so after searching around i found the solution here it is .**

```
let query = `select audio.title as title, audio.artist ,audio.fileName, audio.date,album.title as albumtitle from audio   left join album on audio.album = album.id order by audio.id LIMIT 10 offset ${offset}`;
    console.log(query);
    connection.query(query, function(error, result, fields) {

        if (error) {
            console.log(`error ${error}`);
            callback(error, null);
        }else {
            console.log(result);
            callback('success', result);
        }
    });

```
result on console

```
select audio.title as title, audio.artist ,audio.fileName, audio.date,album.title as albumtitle from audio   left join album on audio.album = album.id order by audio.id LIMIT 10 offset 0
[
  RowDataPacket {
    title: 'Audio Title',
    artist: null,
    fileName: 'audio-1600246003244ha.mp3',
    date: 2020-09-16T08:46:43.000Z,
    albumtitle: 'Jal Pari'
  },
  RowDataPacket {
    title: 'Another audio',
    artist: null,
    fileName: 'audio-1600246030100gs.mp3',
    date: 2020-09-16T08:47:10.000Z,
    albumtitle: 'Jal Pari'
  },
  RowDataPacket {
    title: 'Some title',
    artist: null,
    fileName: 'audio-1600246129892gs.mp3',
    date: 2020-09-16T08:48:50.000Z,
    albumtitle: 'Jal Pari'
  },
  RowDataPacket {
    title: 'Upload Another',
    artist: null,
    fileName: 'audio-1600246160918la.mp3',
    date: 2020-09-16T08:49:21.000Z,
    albumtitle: null
  },
  RowDataPacket {
    title: 'Tere sang yaara',
    artist: 'Atif Aslam',
    fileName: 'audio-1600349287336an.mp3',
    date: 2020-09-17T13:28:07.000Z,
    albumtitle: null
  }
]

```

If it helped you make sure to give thumbs up. thanks
The print method in Python
Tags: python
Published: 2020-09-19 08:05:32

In this post, we will explore the parameters of the `print()` function.
In Python, the `print()` function is used to print something on the console.

## Syntax
```python
print("whatever you want to print..")
```
### Example

Consider the below program,

```python
a = [1,2,3,4]
for i in a:
  print(i)
```
  When you run the program the output will be,
```
1
2
3
4
```
By default, Python prints everything in a new line. But in languages like C/C++ in not by default. To customize the output format Python's `print()` method has some parameters. They are :
1. end
2. sep

## end parameter
This is used to end a print statement with any character/string.
If we want to print the above example horizontally, we can use the end parameter.
### Example

```python
a = [1,2,3,4]
for i in a:
  print(i, end=" ")
```
  The output will be 
  ```
  1 2 3 4
  ```
## sep parameter
Used to change the separator between the arguments in `print()`.
By default Python uses space as a separator, you can change its character, integer, etc using this parameter.

### Example

```python
print( 'a' , 'b' , 'c')
```
The output will be
```
a b c
```
If you want to separate each argument with some symbol, you can use the `sep` parameter
```python
print( 'a' , 'b' , 'c' , sep = "$")
```
The output will be
```
a$b$c
```
5 Best Android hacking apps
Tags: android, androidhackingapps, hackingapps
Published: 2020-09-19 07:42:20

There are numerous <a href="https://www.darkhackerworld.com/2019/08/best-android-hacking-apps.html">android hacking apps</a> on the market. Some of them are fake apps that install viruses on your device. Some of them are legitimate applications, but they are out of date and therefore it is risky to use them. Plus, there are some hacking apps for Android that only work when you root the target phone.

<h2>1. CocoSpy</h2>

The Cocospy  is the industry's best application for hacking an Android phone secretly. In this part, I will list all the reasons why you should try Cocospy. Next, I'll show you how to hack an Android phone using Cocospy.

<h2>2. MSpy</h2>

The MSPY is a powerful and efficient hacker app for Android. You can install mSpy directly on the target Android device to hack it. There is no need to root. After installing the application on the target phone, you can delete the mSpy icon. This will make it completely hidden.

One of the best aspects of mSpy is that it has been tried and tested for several years. It has a loyal following and has also been approved by established media channels.

In addition, even without rooting the target Android phone, you can still intercept text messages, view all call logs, hack your phone contacts and view your browser history, and perform a number of other functions.

<h2>3. Spyzie</h2>

The Spyzie includes all effective and impressive features Cocospy and MSPY.

Most notably, you can use Spyzie to track text messages, GPS locations, call logs, browser history, etc. In addition, Spyzie can also be installed on an Android phone without having to root.

However, what really sets it apart is the fact that, after installation, the Spyzie icon automatically disappears. That way, you don't have to manually delete the Spyzie icon, which eliminates the possibility of human error and makes it one of the most discreet apps for hacking Android phones.

<h2>4. Hoverwatch</h2>

The Hoverwatch is one of the applications for Android phones cheaper hack. In fact, it is specially designed to track Android phones only. You can download Hoverwatch and install it on your phone without root. It offers call and text message logs, viewing browser history, etc.

<h2>5. Hackode</h2>

All the necessary tools to hack from Android

So above were the best android hacking apps if you want game hacking apps then you can visit here: <a href="https://www.darkhackerworld.com/2020/05/game-hacking-apps-android.html">Game hacking apps</a>

Thanks for reading this article.
The Fascinating Human Brain
Tags: machinelearning, ai, intelligence, brain
Published: 2020-09-19 08:02:05

It's quite amazing what the mushy stuff inside our skulls is capable of, given it's size, energy consumption, and estimated computational power. And at the same time, how nuanced it can be.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/27ji8vv4ztuew2dw8d08.jpg)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/2geha6n3moufzfcuhjvj.jpg)

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

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

Keep in touch I’m active on Twitter: [@RishalHurbans](https://twitter.com/RishalHurbans).

These images are also available at [rhurbans.com](https://rhurbans.com/). And a deeper dive into AI algorithms is available in my book [Grokking Artificial Intelligence Algorithms](https://bit.ly/gaia-manning).
The 'best' developers
Published: 2020-09-19 07:52:12

While best is a relative word assuming a lot of parameters around the word <best>, development work around a lot of variations of stakeholders will always bring a varied result of actions.
Three Scenarios
An ok full stack developer with a lot of experience and a heavy portfolio of successful valuable projects working with difficult stakeholders
A fairly average dev with less experience than the above working with great stakeholders whose expectations have been defined documented and agree.
A mix and match of everything else!!
There are good, great, and awesome developers. There are good, great, and awesome stakeholders. There are good, great, and awesome delivery teams. There are also horrible variations of the above.
Back to our best developer above - we find out that he is a result of the right connections, stakeholders, and teams. He does not necessarily set out to be a 'horrible' person but can be heavily influenced by the stimulus from a team or a stakeholder.
My point - best is a result of smart work, hard work and least luck. I have been in discovery meetings where I thought to myself 'Hmm, I need the money but this project may be as bad as hell", to cut the long story short - such projects have always been 'bad'
Don't get me wrong, people influence the outcome of projects - its not the tech stack or whatever its the people.
A connection of mine on linkedin once said "Software projects are 90% political and 10% work" and i agree.
Imagine you get a gig and the major stakeholder has a dislike for you after the project has been signed off - 
So, to all the 'best' developers out there, appreciate what you have, continue to invest in your network and research how to communicate better.
It will give you peace of mind.
I am a newbie here and am totally rocking this community.
Looking forward to learning more
Install a specific angular-cli version
Tags: angular, codenewbie
Published: 2020-09-19 07:46:29

By default, install angular-cli it gets the latest version, but sometimes we work with projects build in an old version.

For downgrade, you current angular-cli follow these steps.

## Remove angular-cli
```bash
sudo npm uninstall -g @angular/cli
npm cache clean --force
```

## Install specific angular-cli
```
npm install -g  @angular/cli@6.1.1
```
Have a nice day!

Photo by <a href="https://unsplash.com/@briennehong?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Brienne Hong</a> on <a href="https://unsplash.com/s/photos/pick?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
MacBook💻 shortcuts you should know 🤩
Tags: productivity
Published: 2020-09-19 07:41:59

I recently started using MacBook Pro with the Touch Bar. Here are some shortcuts help me everyday bases.


Action | key combination
--- | ---
Open Spotlight search | Command+ Space
 Show or hide the Dock | Command + Option +D
Open application switcher | Command + Tab (keeping Command pressed, use Tab to navigate to the app you hope to use.)
Take screenshot | Command + Shift + 4 and Command + Shift +5
Open previously closed window in Chrome | Command + Shift + T
Hide the windows of the front app | Command + H
Lock the screen | Command + Control + Q
Terminal screen clean up | Command + k
Open multiple tab in the terminal | Command + T
Terminal reverse-i search | Control + R
Regular Delete key | Fn + delete or Control + D
Delete the entire word behind the cursor by pressing | Fn + Option + delete
Delete the entire word front the cursor by pressing | Option + delete
Delete the entire line of text behind the cursor | Fn + Command + delete
Delete the entire line of text front the cursor | Command + delete

These are the useful shortcuts for starting with mac. Most of the shortcut are same as other OS. Share other frequently used general shortcut in comment. See you. Happy Learning !
What is LIS?
Tags: lis51
Published: 2020-09-19 07:41:39


####Some misconceptions I had about LIS

I used to be slightly unclear about what exactly LIS was as a field of study. I struggled to explain to my family what exactly LIS was and why I wanted to shift to B LIS, and I would just say to them that LIS was mainly about managing data. Even if I knew that the field was much broader and more inclusive than that, I didn't know how to describe LIS in simple words, which shows that at the core of the matter I didn't understand what LIS was about. Now after the first week of class I clearly understand the orthogonal relation of LIS to other fields of study in dealing the universe of documentation that is a product of other fields. The next time my family asks about LIS I am confident that I will be able to explain it to them.

####Interesting LIS Topics
One LIS topic that I am interested about is information behavior. This is because my hobby is board games and video games, and the way that people interact with information in games is very crucial to their strategies and approaches to these games. One day I hope to design a board game and I feel that this topic will be beneficial to that process.
Activate Webroot Safe with Keycode
Tags: security
Published: 2020-09-19 07:39:13

<p>Stop by <a href="https://www.safewebroot.com/" target="_blank"><strong>www.webroot.com/safe</strong> </a>And shield your virtual world.<br /><br />It is a bad world out there, occupied by cyber offenders and Identity thieves.<br /><br />In case you do not stay on your shield 24X7, and Secure your electronic World with the latest and probably the most effective anti virus and anti-spyware service, you're doomed.<br /><br />Thus, shield your gadgets from All Types of malware along with other Damaging viruses.<br /><br />Activate Webroot Safe using Keycode Just in Case You're interested in Finding a highly effective and result-oriented anti virus service for the own system and data that is precious.<br /><br />Webroot--possibly the best merchandise in its own genreis a Light Weight And efficient anti virus as it employs an incomparable method of security.<br /><br />Activation Process: The Way To Perform It?<br /><br />Adhere to the incremental process given here under:<br /><br />1. Press the Internet Activation button at Webroot subscription.<br /><br />2. This is a 20-digit lengthy alpha-numeric code employed for its activation procedure. You will down load, install Webroot Geek anti-virus via webroot.com/safe, and trigger webroot safe with webroot keycode. The said main code would be that your license key of this product you will get once you choose the Webroot product. You've got to continue to retain the code 100% secure. In the event you lose it, then you may not have the ability to trigger your Webroot winner product.<br /><br />3. Click on the"Publish" button. Gently comply with the instruction to complete the detection procedure, successfully.<br /><br />The way to<br /><br />Adhere to the process discussed here beneath in the Event You need complete manual To down load Webroot anti virus:<br /><br />Inch.<br /><br />2. Register using webroot account. In the event you have no, generate precisely exactly the exact same.<br /><br />3. In consideration, choose preferred webroot merchandise.<br /><br />4. Choose webroot merchandise. You'll have the ability to down load webroot safe product in a handful minutes.<br /><br /><a href="https://www.safewebroot.com/install-geek-squad-webroot-antivirus/">Webroot Geek Squad</a>: The Way To Put in ?<br /><br />Adhere to the process discussed here beneath in the Event You Want to set up Webroot installation on the Body:<br /><br />Inch. Locate the document That you downloaded.<br /><br />2. Press the icon . Obey the directions given.<br /><br />3. First'Agree' simply pressing on the button to get it. After that, install.<br /><br />Your webroot installation will start to put in.</p>
Difference Between null And undefined In Javascript (with Notes)
Tags: javascript, webdev, codenewbie, beginners
Published: 2020-09-19 07:36:19

You might be thinking that `null` & `undefined` is the same. You have to know that, spoiler alert, they are not. What I mean by this is: yes both have many similarities, but deep down it's totally different.

It's confusing, I know. But you need to know these basic things. So let's jump!

### Similarity
Both of them usually called *nullish value*: have either `null` or `undefined` value. These also listed as `falsy values`, which are:
- `null`
- `undefined`
- `false`
- `0` (zero) &mdash;(also for `-0` and `0n`)
- `“”` (empty string)
- `NaN` (Not a  Number)

Falsy values itself means that the value will be generated as *false* on the boolean approach. 

### Difference
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uq73osi7sqq8za8rbaw1.jpg)

From the definition, `null` is an intentional absence of a value. While `undefined` is a default value for a variable with no value assigned.

```js
const bowl = null; //null

const bowl; //undefined
```

As mentioned above, both are *falsy values*. Even so, it works this way:

```js
null  == undefined
null !== undefined
```

Why? Because when it comes to type, it's totally different. Javascript defines `null` as an empty object, hence if you do `typeof null` it will show `"object"`. While `undefined` is a primitive value. The type of `undefined` will be `"undefined"` itself.

If we try to make equalization on a number format, `null` will be identified as a 0 (zero), while `undefined` will not be recognized as any number (`NaN`). Like this:

```js
const addNum = 8 + null // 8
const addNum = 8 + undefined // NaN
```

---

## Conclusion
Both `undefined` and `null` have the same value, the same *nullish* and *falsy*, but each has a different type. Hence use in its own place.
#frontendaily
Tags: showdev
Published: 2020-09-19 07:34:59

Hello everybody, I created a website and I'm sharing a front-end project every day.

If you new of web development, you might be want to follow :)

Also, there are video tutorials but unfortunally language isn't english yet. If I improve my english, I'll start to create english web tutorials. However, you can still watch and learn something. Because there is no need to understand language while writing code, all you need to understand is what's going on with that codes. At least I believe that.

Web: [https://frontendaily.com/](https://frontendaily.com/)
Ready KASFY NodeJS Framework (beta)
Tags: node, framework, kasfy, nodeapp
Published: 2020-09-19 07:28:46

We have done a kasfy framework beta release.

Kasfy, a free an open source framework built on the top of Node.js harnessing the power the amazing web programming language, JavaScript. It fulfills all of your API development needs. 

[Documentation: kasfy.js.org](https://kasfy.js.org)

[Github Repository Link](https://github.com/kasfy/kasfy)

Ready Kasfy CLI for easy to work your project

### Install Kasfy CLI with npm
```bash
# linux, ubuntu, and mac using with "sudo"
sudo npm install -g kasfy
sudo npm install -g npm

# windows must run cmd with administrator permission 
npm install -g kasfy
npm install -g npm
```

### Create new Kasfy Project
```bash
kasfy create AwesomeApp   
# AwesomeApp is sample name.
# OR

kasfy new AwesomeApp
```

### Kasfy Features
- [MVC](https://kasfy.js.org/guide/Kasfy%20Structure.html#folder-structure) pattern
- Build in file creation [commands](https://kasfy.js.org/guide/CLI%20Commands.html#basic-commands)
- [Migration](https://kasfy.js.org/guide/Migrations.html#introduction) Setup using JSON

### 😍 Have a Awesome day.
Chefina and Swaps
Tags: computerscience, cpp, codenewbie, codequality
Published: 2020-09-19 07:18:46

This question came in Codechef September Long Challenge, hope you find this solution useful.

<b>PROBLEM STATEMENT:</b>
You are given a positive integer N. Consider the sequence S=(1,2,…,N). You should choose two elements of this sequence and swap them.

A swap is nice if there is an integer M (1≤M<N) such that the sum of the first M elements of the resulting sequence is equal to the sum of its last N−M elements. Find the number of nice swaps.

<b>BRUTE FORCE APPROACH</b>

Firstly, find the total sum of the given array, if the sum is odd, then simply return 0, as there is no possibility to divide that array into equal half.
Now, check for the second case, when the sum is even:
Iterate through the array, and calculate the sum of elements of the subarray, till it would be less than on equal to half sum.
Then calculate the number of swaps.


Swaps = xC2(<i>For first partition</i>) + n-xC2(<i>For second partition</i>) + n-x(<i>For swaps in between two partitions</i>)

This approach will give you TLE, as finding the sum of the array through iteration will take O(n) time, which can be reduced to O(1).

<b>Optimised Approach</b>

1. Find the total sum as <b> (n*(n+1))/2 </b>.
2. Check if it is even or odd, if odd, return 0, else proceed to the next step.
3. Now, we will calculate the sum of subarray having sum approximately half of the total sum.

This is the main logic of finding a sum in this question.
Look at the following mathematics using <i>Shri Dhanacharya equation</i>:



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

It will give the element up to which the sum of the subarray is approximately half of the total sum in O(1) time complexity.


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


fquad == quad means both the subarray have sum exactly half of the total sum, if this condition is false, the sub sum is not exactly half of the total sum, hence we need to swap elements, hence on n-x swaps would be counted.


I hope you found this editorial helpful, please give me a like and follow me.
Happy coding :)
Hacktoberfest 2020 - GitHub 101 Virtual Meetup
Tags: hacktoberfest, github, opensource, codenewbie
Published: 2020-09-19 06:57:34

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

DigitalOcean's [Hacktoberfest](https://hacktoberfest.digitalocean.com/) is one of the most popular open source events that helps kick start the journey of many aspiring talented developers on various open source repositories maintained on GitHub.

[StatusNeo](https://www.statusneo.com) is conducting a virtual meetup in association with [Major League Hacking](https://mlh.io/) to help aspiring developers get started in their open source journey by introducing them to the concepts of source code management and version control using Git VCS and the most popular Git hosting service, GitHub.

The knowledge and experience you would take away from this meetup would definitely help the participants in successfully participating in Hacktoberfest 2020.

To know more about the event or for registration, refer this [link](https://organize.mlh.io/participants/events/4403-hacktoberfest-2020-introduction-to-git-and-github)

Do register and share this event for maximum reach. Thanks :heart: 

## About the speaker

{% github nishkarshraj/nishkarshraj %}