teleren/devto huggingface dataset:
Top 3 Tips to Consider Before Purchasing any Virtual Assistant.
Tags: webdev
Published: 2020-05-25 14:32:45

In the era of technology, sustaining without a proper home appliances can lead to huge inevitable loss and extra effort. There are lots of good home appliances available in the market which can prove to be a game changer and the best part is that they rely on technology.

Form Amazon Eco to Google Home Mini, there are lots of technically advance gadgets which can convert your lair in to the Modern House. By using these advance Virtual Assistant one can give lots of instruction to them and can get answer for almost any type to question.

But at the same there are some ground rules and vital points to keep in mind before before you purchase either of them.

1.Learn The Features

These virtual assistant are the gadtes of the future and they comes with lots of features. From playing your favorite music to getting weather update, you can get notification about almost anything while using them. Important point here is that you should be familiar with these features while doing your research

2. ***Perfect Size***

Virtual assistant like Alexa comes in different shapes and sizes and you choose form Alexa echo dot to echo 3rd generation, you can go with whichever option suits you best, but important point here is that each of them have there own features and if you're using it for a bigger space, you can go with 3rd generation echo

3. Wifi

Internet is like oxygen for these devices and they can't particularly surivive wihhout a good internet connection. Before you invest in these artificial assistants, make sure you have a good and sound internet connection at your place.

There are some of the major tips which one has to keep in mind before purchasing any kind of artifical assiatant. Also if you're interested in more such content please visit our blog post [electroalert](https://www.electroalert.in/)
Compress a string such that 'AAABCCDDDD' becomes 'A3B1C2D4'
Tags: javascript
Published: 2020-05-25 14:17:00

This seems to be a popular interview question that I stumbled upon in an [Anki deck](https://ankiweb.net/shared/decks/)

```js
const compress = str => {
        //build a character frequency map
	const freqM = [...str].reduce((acc, val) => { 
		acc[val] = acc[val] + 1 || 1; 
		return acc;
	}, {});
        //return str if length <= unique characters * 2 (ie, 'A' vs 'A1') 
	if (str.length <= Object.keys(freqM).length * 2) return str;
        //return the frequency map as a string otherwise 
	return  Object.entries(freqM).flat().join('');
}
```
Why Three Tier Architecture?
Tags: react, reactnative, angular, node
Published: 2020-05-25 13:44:20

I'm novice in this world of MEAN/MERN stack development. I've made multiple projects using React. 

From what I've read, I see that building Three Tier Architecture is useful if you want to have the same code base for Web and mobile apps: Ionic requires you to use Angular/React. 

Three Tier Architecture is also useful if you want similar designs in both mobile and Android apps: one can build packages for React which can work in both React and React Native, thus giving uniform design.

What I dont understand is: for those web pages where mobile apps are not needed (like personal portfolio websites), why React? Why not two-tier architecture? 

Why not use templating engines with NodeJS? No hassle of state maintainence/redux, vanilla HTML (easy and conveinient), simple projects ...
Apprendre et maîtriser Golang
Tags: go, redis, kafka
Published: 2020-05-25 13:37:28

---
title: Apprendre et maîtriser Golang
published: true
description: Un site pour apprendre Golang en suivant des exemples pratiques issus du monde professionnel.
tags: go, golang, redis, kafka
---

Apprendre et maîtriser Golang

https://www.goscreencasts.io
The right way to use function as parameter
Tags: javascript, webdev, typescript, node
Published: 2020-05-25 13:24:20

Hey guys! How are you doing? Hope doing well!

I was answering few questions at [Stack Overflow](https://stackoverflow.com) and I've just answer one that I believe is good to share as it is a bit complicated for beginners.

## The situation

Let's imagine you have a list of items and you have a button for each item to delete it and this function receives the item id as parameter.

Lets imagine this is your Item Component:

```jsx
const Item = ({ id, name, handleDelete }) => (
  <div>
    <p>{name}</p>
    <button>Delete</button>
  </div>
)
```

It already receives everything you need, you have the **id** and you have the **handleDelete** function, that does something with this id.

But what is the right way to use the **handleDelete** function on the button's **onClick**, considering you need to pass the **id** as props?

## The wrong way

Many of you may think that this is how to do that:
```jsx
const Item = ({ id, name, handleDelete }) => (
  <div>
    <p>{name}</p>
    <button onClick={handleDelete(id)}>Delete</button>
  </div>
)
```

**But this is not!**

If you use like that, what will happen is: as soon as the Component be rendered, it will execute the **handleDelete** function, because in this case, you are executing it, not passing it!

It should work if it doesn’t receives a parameter, as this example below:

```jsx
const Item = ({ name, handleDelete }) => (
  <div>
    <p>{name}</p>
    <button onClick={handleDelete}>Delete</button>
  </div>
)
```

There are many situations that you will use functions without parameters, and for those situations that's right to do this!

## The solution

The solution is pretty simple! All you need to do is wrap your **handleDelete** function inside another function!
Check it out:

```jsx
const Item = ({ id, name, handleDelete }) => (
  <div>
    <p>{name}</p>
    <button onClick={() => handleDelete(id)}>Delete</button>
  </div>
)
```

**Now it works perfectly!** 🎉

## Why?

The reason to do this is simple. When you wrap your function inside another function, you are passing to **onClick** a function as parameter, not executing it. The same as the previous example, a function without parameter, just a function.

Another way to do that, maybe it's more clear to you to understand is:

```jsx
const Item = ({ id, name, handleDelete }) => {
  const onDelete = () => handleDelete(id)
  
  return (
    <div>
      <p>{name}</p>
      <button onClick={onDelete}>Delete</button>
    </div>
  )
}
```

Can you see what happened there?

I just created a variable to hold the function and passed this variable to **onClick**.

Maybe it's more clear now, right?

That's all folks!
I hope you guys enjoy it, and keep learning!
Spread ... The Love In JavaScript ❣️
Tags: javascript, webdev, node
Published: 2020-05-25 12:50:40

As per the MDN, below is the definition of the Spread Operator in JavaScript.
>Spread syntax allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected.

As a fan of clean code, I always fancied the use of Spread (...) operator. Below are some the useful implementations of the Spread operator.

## Deep Copy Array
```javascript
// Deep Copy Array
const sourceArray = [1, 2, 3, 4];
const copiedArray = sourceArray;
const copiedArrayUsingSpread = [...sourceArray];

sourceArray.pop();

console.log(copiedArray); // [ 1, 2, 3 ]
console.log(copiedArrayUsingSpread); // [ 1, 2, 3, 4 ]
```

## Deep Copy Object - Single Level
As per Naina comments in discussion, deep copy works only with single level object. *The spread operator will not be able to deeply copy the nested object.*
```javascript
// Deep Copy Object
const person = { name: 'John' };
const copiedPerson = person;
const copiedPersonUsingSpread = { ...person };
person.name = 'Doe';

console.log(copiedPerson); // { name: 'Doe' }
console.log(copiedPersonUsingSpread); // { name: 'John' }
```

## Array Concatenation
```javascript
// Array concatenation
const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];
const joinedArray = [...arr1, ...arr2];
console.log(joinedArray); // [ 1, 2, 3, 4, 5, 6 ]
```

## Object Property Concatenation
```javascript
// Object concatenation
const obj1 = { prop1: 'value1' };
const obj2 = { prop2: 'value2' };

console.log({ ...obj1, ...obj2 }); // { prop1: 'value1', prop2: 'value2' }
```

## As Function Params
Functions in javascript can have required and optional params. Sometimes the there can be *n* optional params and this is where the ... operator comes in. Sometimes it may be referred to as *Rest* operator.
```javascript
const numbers = [1, 5, 7, 2, 3, 4, 5, 7, 90];
console.log(Math.max(...numbers)); // 90

const multiplyBy = (multiplier, ...numbers) => {
  console.log(numbers.map((num) => num * multiplier));
};

multiplyBy(2, 1, 2, 3, 4, 5, 6); // [ 2, 4, 6, 8, 10, 12 ]
```

Hope the above snippets explain themselves. Let me know on how I could improve the contents in the comment section or tweet *[@radnerus93](https://twitter.com/radnerus93)*. To stay more connect you could follow me on twitter *[@radnerus93](https://twitter.com/radnerus93)*.
What is the biggest challenge for web developers?
Tags: javascript, webdev
Published: 2020-05-25 12:37:04

I personally think that one of our biggest challenges is occasional lack of self-discipline following the dev process. It can be due to many reasons; tight deadlines, late night out or whatever the implication of being just a human.

Also we're often just thrown into someone else's code i.e. his own interpretation of the guidelines.

Let me know if you agree or can you think of something else?
Video Web Component using Web Monetization API
Tags: gftwhackathon, webmonetization, webdev, opensource
Published: 2020-05-25 12:32:02

[Instructions]: # (To submit to the Grant For The Web x DEV Hackathon, please fill out all sections.)

After hearing about the **Web Monetization** and **Hackathon** I started brainstorming about the ideas and thought of making something productive using Web Monetization that can help developers in using this technology.

I was initially confused with the type of project which I should pick then after many days of research and thinking I came to the conclusion of building a Web Component. I was really excited to implement this idea because of the following reasons.
* I have never worked on a web component, so yes this is the best chance to experiment. :see_no_evil:
* Experimenting with Web Monetization :dancer:
* Open Source Contribution :star:

##About Web Component
The basic idea behind building this component was to enable users to pay for the content they are watching. Many times when we are browsing for some content and come across a site that has videos but in order to watch the desired content we have to purchase the full course. In such situations we can make use of Web Monetization and allow the users to pay for the content which they are interested in watching. This will also help the content holders to monetize their content at micro-levels.

`<web-monetized-video>` provides the functionality of paying for the content which the user is watching. This component is available on [npm](https://www.npmjs.com/package/web-monetized-video)

I took reference from the [Start/Stop Monetization](https://webmonetization.org/docs/start-stop) section of the Web Monetization documentation.

To use the component you can load the module by including the script tag.
```javascript
<script type="module" src="https://unpkg.com/web-monetized-video"></script>
```
This component can be added to your app via **npm** by using:
```shell
npm install web-monetized-video --save
```
Once added you can import this in your App.
```javascript
import 'web-monetized-video';
```
To use the component in your code you can do the following:
```html
<web-monetized-video width="300" height="200" url="video_url" monetization-link="payment_pointer"></web-monetized-video>
```
### Submission Category: 
Foundational Technology 

## Link to Code
{% github Jasmin2895/web-monetized-video %} 

## Demo Link
{% codesandbox romantic-sun-vdz24 %}

## Additional Resources/Info 

This is my first attempt in building web components :sweat_smile:. I am currently exploring and gathering more knowledge about web components and trying to implement the knowledge gained in the project. I have taken help from these references for creating the component. 

[WebComponents.org](https://www.webcomponents.org/)
[Web Monetization doc](https://webmonetization.org/docs/start-stop)

In the end thanks to the team for providing us the chance to experiment and learn new Tech :smile:.
VimTrick: Relative line numbering
Tags: vim
Published: 2020-05-25 12:23:48

Many operations in Vim can be executed over a given number of lines. For example, `d3j` will delete the current line, plus the 3 below it. Having line numbers displayed will make it easier to know how many lines you want to edit. You can enable and disable line numbering easily in Vim:

* `:set number` - Shows line numbers
* `:set nonumber` - Hides line numbers

You may find yourself often reading the line numbers and then subtracting two numbers in your head to decide over how many lines to execute a command. But there is a better way!

Vim allows showing relative line numbers instead of absolute line numbers:

* `:set relativenumber` - Shows relative line numbers
* `:set norelativenumber` - Hides relative line numbers

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

We have more screenshots and details over on our [VimTricks post](https://vimtricks.substack.com/p/vimtrick-relative-line-numbering).
Perhaps you did not know, but in our game there will be a split-screen mode
Tags: indie, game, splitscreen, gamedev
Published: 2020-05-25 12:03:17

You can play up to 4 players on one keyboard (in this mode, the tank tower is not available). If you have 4 joysticks, you can enable active tower mode. An important condition is that everyone plays with the same tower mode.
Daily Developer Jokes - Monday, May 25, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-05-25 12:00:12

---
title: "Daily Developer Jokes - Monday, May 25, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Monday%2C%20May%2025%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12598ab1885.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ How do you stop a web developer stealing your stuff?

___A:___ Write 403 on it.
 -->
WhatsApp: How to View Deleted Messages
Tags: whatsapp, tips
Published: 2020-06-15 15:49:19

---
title: WhatsApp: How to View Deleted Messages
published: true
date: 2020-05-25 12:00:00 UTC
tags: whatsapp, tips
canonical_url: https://www.ma-no.org/en/news-and-events/whatsapp-how-to-view-deleted-messages
---

Words are carried away by the wind, as long as they are not written on WhatsApp. Sending it was like getting a tattoo, something you'll always like, or yet it'll be there for years to remind you of a mistake.Then came the option to delete sent messages, a white card redeemable for a second chance for a limited time, perfect for when you send a green meme to the family WhatsApp or a drunk picture to the boss. But... What happens when you become the recipient of "this message was deleted"?It's annoying not to know what was sent and you… !


Read on [📖!](https://www.ma-no.org/en/news-and-events/whatsapp-how-to-view-deleted-messages)
Color-coding Android Studio’s Logcat
Tags: android, productivity
Published: 2020-05-25 11:48:10

Skimming logcat on a freshly installed android studio might lead to eyesore, just look at this…

![Android Studio default Logcat color](https://miro.medium.com/max/2000/1*Jg0Dayuupiy7RmVP4jIeDA.png)
<figcaption>Android Studio default Logcat color</figcaption>

# **The Fix**

The fix is rather easy, we just need to color-code the logcat based on the priority. First, open Settings, **File > Setting**s or (***ctrl + alt + s***), then search for logcat (see red box on the left), go to **Android Logca**t section under **Color Scheme**, it should look like this…

![Logcat’s Color Scheme setting](https://miro.medium.com/max/1400/1*oIpDH32GQe_HZ-449xMazg.png)
<figcaption>Logcat’s Color Scheme setting</figcaption>

You have to untick ***Inherit values from*** (bottom right red box) to be able to change the foreground color. Repeat that for every priority / tag (Assert, Debug, Error, etc). You can color it as you want, but here’s the recommendation:

- Assert: *9C27B0*
- Debug: *2196F3*
- Error: *F44336*
- Info: *4CAF50*
- Warning: *FFC107*

![](https://miro.medium.com/max/1400/1*t21ySHyl5sgXfZul8vf8DQ.png)
<figcaption>After recolor</figcaption>

After that, click OK and voila! now it’s more pleasant to the eye and you can skim the logcat more easily…

![](https://miro.medium.com/max/2000/1*D4LE1-CBl03cYZnqt4Gcmw.png)
<figcaption>Enjoy!</figcaption>

Source: [SO](https://stackoverflow.com/questions/39993867/android-studio-logcat-colors-best-practice/39993868)   
Originally [Posted on Medium](https://medium.com/@hyuwah/color-coding-android-studios-logcat-a0b71330147d)
How Flutter Web Can Reduce the Cost of Your App Development
Published: 2020-05-25 11:31:28

You come up with a product idea but you need a plan for getting it out to the world. In order to expose your service to as many users as possible, you need mobile and web apps. But your short research is brutal – although you have just one narrow idea, it requires three different apps (Android, iOS, web), three different types of specialists (Kotlin, Swift, JavaScript), and maybe even three separate vendors. 

Read more: https://www.miquido.com/blog/how-flutter-web-can-reduce-costs-of-app-development/
Are most small mobile apps just vanity projects?
Tags: ios, android, webdev, discuss
Published: 2020-05-25 11:11:22

I feel that most mobile apps that come out don't have anything that's not possible to do as a web app (responsive + progressive). Of course there are a lot of apps that need to be installable apps, but I feel most small apps are apps just to be cool, and look established.

What do you think?
PhpStorm Live templates YouTube tutorial for real fast web development with Symfony
Tags: php, javascript, html, webdev
Published: 2020-05-25 10:58:30

I love PhpStorm and the work with PHP. In my world I have to do a lot of configuration with XML files and need to translate HTML to Twig files. I am working a lot with the Symfony CMS sulu.

https://youtu.be/uhFDVUmUTqQ

A few weeks ago i published a video on YouTube how PhpStorm live templates improve my work. With this you do not have this copy paste pain. Please check it out and give me feedback and inspiration to improve my work. Thank you 
Roland
Quick Tip: Creating pretty JSON files with Laravel
Tags: laravel, php
Published: 2020-05-25 10:57:57

Often I had a situation where my Apps had to generate a JSON file. For example, I'd write a CLI App for package development. This package had to write JSON pretty formatted to the generated composer JSON.

Here is a quick hint of how to generate this JSON string nice and smooth with laravel:
```php
$json = Collection::make([
    'name' => 'Test',
    'description' => 'Another awesome laravel package',
    'license' => 'MIT'
  ﻿])->toJson(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);﻿
```

This snipped will give you a `$json` Variable, which you can print to a file without any stress. It's pretty, escaped and with all formattings you need.  We work here with `Collection`, a class from Laravel itself. Before using it you have to import it at the top of your file:

```php
use Illuminate\Support\Collection;
```

For the example above, see here the output:

![JSON Preview](https://dev-to-uploads.s3.amazonaws.com/i/y846o03tln7qbpcrhjdq.png)

That's it for now. With this variable you can print in files like a CloudFront Configuration, a composer.json for code generation or other things devs need for all-day work.
BVSelect - VanillaJS Fully Customizable SelectBox 
Tags: vanillajs, javascript, selectbox, fullycustomizable
Published: 2020-05-25 10:49:03

Hey guys,
I published a JQuery Plugin for Selectboxes few days ago, some people was interested but jquery was not their thing.
So i made a VanillaJS version!

Source: https://github.com/BMSVieira/BVSelect-VanillaJS
Demo : https://bmsvieira.github.io/BVSelect-VanillaJS/

Feel free to try! Thank you!
Top Mobile Application Developers In India
Tags: mobileappdevelopers, android, ios, reactnative
Published: 2020-05-25 10:39:28

Get Your Business Online on Your Phone Through Our
Mobile App Development Service
Mobile App Development Company Bangalore, Android App & Ios App. Harness the power of Mobile Apps by providing a delightful user experience. Offer value in products and services and place all of these in the palm of every hand.

Visit :https://appmomos.com/mobile-application-development-company/
To know more Contact Now: +91 9535155944
Launching private beta of Qjub
Tags: showdev, sideprojects
Published: 2020-05-25 10:39:26

After a few months of hard work, I'm more than happy to announce that Qjub (read as *kjuːb*) is now in private beta.  What started as a learning project to try new stuff and get better at front-end development evolved into a side-project I was hacking during nights and weekends. And now it's finally ready for first users.

Go and request beta access [here](https://qjub.app/#request-access). Or read on if you want to know more about Qjub and my reasons behind its creation.

Not wanting to do some typical app like Todo list as a learning project I choose to work on something I would like to use myself. Something where I could keep all my links, notes, and files from different sources together. So they can be easily found later. No existing solution I found worked for me. It could work only with links or quickly become messy and hard to navigate as I entered a large amount of data. My answer to that is Qjub.

Getting to this point was not an easy task and it is just the beginning of my journey. I had to change priorities and make compromises to get there and I learned a lot during the process. For example naming is hard :-). Pre-release preparations and final checks are more difficult than developing the product itself (at least for me). And probably most important - less is more and sometimes Good enough is better than perfect. I will definitely write more detailed blog post about lessons learned.

Feeling like Qjub could help you as well? Check out the [homepage](https://qjub.app/) for more info and request access to beta to play around with it. And if you have any questions left, do not hesitate to contact me via [email](mailto:tomas@qjub.app) or on Twitter ([@pustelto](https://twitter.com/pustelto) or [@qjubapp](https://twitter.com/qjubapp)).