teleren/devto huggingface dataset:
Double Equals vs Triple Equals in JavaScript
Tags: javascript, webdev, beginners
Published: 2019-03-22 04:31:05

---
title: Double Equals vs Triple Equals in JavaScript
published: true
description: 
tags: #JavaScript #webdev #beginner
---

Unlike other languages JavaScript has two ways to determine equalities. It can be rather confusing for people like myself who come from typed languages like Java or C++. My goal is to explain both == and === in a clear and concise manner through definition and examples.

###TRIPE EQUALS (STRICT EQUALITY)

The triple equals compares the two values for equality. No extra work is done, it simply checks if the both values have the same type and if they do it then checks whether the two values are the same. If the types are not the same it returns false. If the the types are the same, but the values are different it returns false. Here are some examples:

```javascript
7 === 7     //true
7 === '7'   // false
```

###DOUBLE EQUALS (LOOSE EQUALITY)

The double equals comparison works by first converting the both values to a common type and then undergoing a strict comparison as === does. Let's look at an example to make the explanation a bit more comprehensible. The code below is comparing a Number and a String. The double equals comparison first converts both values to a common type (in this case a Number) and then runs a strict comparison (i.e., it checks if 17 and 17 are the same type and are equal which is true since in the previous step it converted both values to Number).

```javascript
17 == '17' // true
17 == 17   // true
```

###CLOSING

It's hard to forget the difference between the two. With that being said, I recommend you write code that allows you to use triple equals rather than double equals. Using double equals can cause unwanted conversions producing inaccurate results.
Question: How to style data in Firebase
Tags: javascript, css, firebase, help
Published: 2019-03-22 03:37:22

---
title: Question: How to style data in Firebase
published: true
description: 
tags: javascript,css,firebase,help
---

Hello!! So right now, a user's input is sent to the database and gets displayed on a refresh. What I want to do is give users the option to bold their text and have Firebase display the bolded text. 

I was thinking of using a checkbox (If checked then bold the text) But how can I get Firebase to do that? Is there a way to style data in Firebase or style the output?
Friday Blast #61
Tags: fridayblast, links, post
Published: 2019-02-24 11:34:04

---
title: Friday Blast #61
published: true
tags: friday_blast,links,post
canonical_url: https://horia141.com/friday-blast-61.html
series: "Friday Blast"
---

[API gateways are going through an identity crisis (2019)](https://medium.com/solo-io/api-gateways-are-going-through-an-identity-crisis-d1d833a313d7) - I like this article especially for the nice overview of the various kinds of things which have been called “API gateways” - frontends for backends, Kubernetes access managers, API infra as a service offerings etc.

[Uber’s big data platform: 100+ petabytes with minute latency (2018)](https://eng.uber.com/uber-big-data-platform/) - a look at the evolution and current status of Uber’s “data systems”. Crazy stuff! And also a reminder that once you reach a certain scale, there are no already-build solutions. You have to use off-the-shelf and custom stuff to make something which works for you!

[Don’t get clever with login forms (2019)](https://dev.to/scottw/dont-get-clever-with-login-forms-3499-temp-slug-7190786) - a bunch of nice design patterns (as in UX design) for login forms. Biggest standout is _being linkable_. Which is something all webapps should have for their major flows. Didn’t also consider that nice UX can cause issues for support people - if there’s no link for the login page, it’s hard for them to tell a customer where to login, for example.

[Open location code (2018)](https://github.com/google/open-location-code) - the [design doc](https://github.com/google/open-location-code/blob/master/docs/olc_definition.adoc) for the [plus codes](https://plus.codes/) which have popped up recently in Google Maps. It’s really interesting looking at how such a _big problem_ got tackled, what constraints they had (making codes unambiguous, making them short, dealing with projection distorsion, dealing with scale etc..) and how they solved them. An alternative for this is [what3words](https://what3words.com/) - which has a totally different approach to this.

[I don’t want to learn your garbage query language (2018)](https://erikbern.com/2018/08/30/i-dont-want-to-learn-your-garbage-query-language.html) - SQL is still the lingua franca of database interaction. And most query languages are based on it. But the author makes the point that there shouldn’t be so many dumbed down variations, but instead folks should just try to provide SQL atop whatever they’re trying to expose. Also, a good argument for no-ORM/micro-ORM movements.
Finally! I built my portfolio
Tags: gatsby, react, bootstrap, portfolio
Published: 2019-03-22 02:25:29

---
title: Finally! I built my portfolio
published: true
description: About my portfolio using Gatsby.js
tags: #gatsbyjs, #react, #bootstrap, #portfolio
---

Finally! I have finished working on the first version of my portfolio and I feel good. I had been thinking to build my portfolio for the last two years but never really worked on it. Last week I started searching for the ways to build it and I came across [Gatsby](https://www.gatsbyjs.org/), a framework to build static websites. Of course one can simply use HTML, CSS, and JS to do the job but I wanted to learn something new. I saw people using the word Gatsby a lot online and I wanted to try it. This was the great opportunity and I grabbed it. One more advantage with Gatsby is, it is based on React which meant I could improve my React skills along with finishing my portfolio.

Here is the link to my portfolio: https://portfolio-8b931.firebaseapp.com/ (I don't have a domain yet, but that's next thing on the list)

#### What I learned

- A new framework, Gatsby
- CSS modules (Component scoped CSS)
- Hosting a website on firebase
- [FormCarry](https://formcarry.com/), to handle _contact me_ form without backend

#### What issues I faced

- using CSS modules

There are many ways to add styles to your website but Gatsby recommends CSS Modules for beginners and I took their word for it.
Initially I had issues with styles being not applied to my components until I found this [note](https://www.gatsbyjs.org/docs/component-css/#css-modules-and-bem).
I was using dashes in my CSS class names but was not using them in camelcase format in my components. Once I figured that out everything else went quite smooth.

_Please check out my portfolio and feel free to leave any comment here, I would love to get some feedback._
[astuce] Les champs personnalisés pour les non-developpeur(se)
Tags: tips, joomla, customfields, beginners
Published: 2019-07-28 22:12:44

---
title: [astuce] Les champs personnalisés pour les non-developpeur(se)
published: true
tags: tips,joomla,customfields,beginner
canonical_url: 
---

Ami(e)s Joomlers,

Cette fois ci je vais présenter un code tout simple à copier coller que vous pouvez utiliser directement dans vos surchages de template de com\_content (articles) . Pour ceux et celles qui veulent rajouter des champs personnalisés simplement dans leur templates préférées voici les deux bouts de code à mettre. Un en haut et l'autre là où vous souhaitez afficher votre champ personnalisé (requiert Joomla! 3.7.x minimum).

ex: Dans le fichier templates/example/html/com\_content/article/defaut.php

`<?php`

`defined ('_JEXEC') or die();`

`//code specifique à votre template...`

`// Début: Bout de code à rajouter tout en haut `

`JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');`

`$champs_par_nom = \Joomla\Utilities\ArrayHelper::pivot($this->item->jcfields, 'name');`

`// Fin: Bout de code à rajouter tout en haut`

`?>`

`<?php`

`//...`

`//code specifique à votre template...`

`//...`

`// Début: Bout de code à rajouter`

`// là où vous voulez afficher`

`// un champ personnalisé grâce à son nom`

`echo $champs_par_nom['mon-champ-personnalise']->label`

`. ':' . $champs_par_nom['mon-champ-personnalise']->value;`

`// Fin: Bout de code à rajouter`

`// là où vous voulez afficher`

`// un champ personnalisé grâce à son nom`

`?>`

Voilà, c'est tout pour aujourd'hui. A bientôt les Joomlers de l'extrême!
Today I Finished MITx 600 Part 1!
Tags: computerscience, career, python, mooc
Published: 2019-03-22 01:40:47

Tonight I finished the [MITx: Introduction to Computer Science and Programming Using Python](https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python-0) right on deadline! (well actually a little passed the deadline) 🎉

As a front end developer who doesn't have a degree in computer science, I always desire to learn more about "the real stuff" of computer science. Last year I took [HarvardX CS50x](https://www.edx.org/course/cs50s-introduction-to-computer-science) (only the C part though) and felt really great about it. The content is not only useful but also fascinating.

So this year I decided to try this MIT one out again; I said again because I actually tried it when I was in school but couldn't finish it (twice!). But this time despite the fact that I'm working now and have less time to work on this, I am still able to finish it! (Big thanks to my girlfriend @rachel for supporting and producing me! 😄)

To continue this momentum of success, next week I'll start on the second part of the MITx 600 course: [Introduction to Computational Thinking and Data Science](https://www.edx.org/course/introduction-to-computational-thinking-and-data-science-2).

In the future I'm hoping to also get some more math in my brain. I've been looking at the courses from [here](https://github.com/ossu/computer-science#core-math). And by the way, this is a great resource to gradually learn computer science with a clear plan! I really appreciate the community that put this together:

{% github ossu/computer-science %}

Cool, that's all I wanted to share, and I hope we could all keep learning and having fun!
Help Me
Tags: csharp
Published: 2019-03-22 01:16:27

---
title: Help Me
published: true
description: 
tags: Csharp
---
![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/h9oej7sa7u3wtfrq35fe.png)
I Can do
![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/e1ioyjt031q7uhyah6f0.png)
I Want To do
![Alt text of image](https://thepracticaldev.s3.amazonaws.com/i/n4r2y35ai4x62qj3yxa1.png)


I Want to know how can i get Image3 result
Help my Please,or can i hava a Example？
What do you want from me?
Tags: beginners, discuss
Published: 2019-03-22 00:34:04

---
title: What do you want from me?
published: true
description: What can a beginner write about?
tags: beginner, discuss,
---

I've seen many posts on here telling everyone to write. Write something, get used to it, help to better foster communication skills.

So I have a question! If you were just at the starting of your development career, what is something you wish you would have talked about more? Was there something you wish you had a log of during your personal development? I'm looking for ideas of what I can write about, and more importantly, <strong>what would be interesting to read for others!</strong> Thank you to any responses.

<em>(If it's helpful)</em>
<strong>About Me:</strong> I'm very new to programming and development, as I have less then 6 months experience with coding, however I have been studying very diligently during that time as I am out of a job with other issues. Before this, I got a degree in Illustration, so the design side of web development is not foreign to me. I'm looking to make a career change, and so far have gotten an interview that went well for an internship!
Do you notice that you hold yourself from writing even when you have something to say?
Tags: discuss
Published: 2019-03-22 00:06:47

---
title: Do you notice that you hold yourself from writing even when you have something to say?
published: true
tags: discuss
---

I noticed that I often hold myself from writing even when I have to say something.

I know why that is.

Paradoxically, whatever I say has been said somewhere.

I'm afraid that I won't deliver anything new. But at the same time how am I going to develop my writing if I don't write?
Solve the sum of natural numbers using Ruby.
Published: 2019-03-22 00:04:10

---
title: Solve the sum of natural numbers using Ruby.
published: true
description: Calculate the sum of natural numbers
tags: 
---

<p>Given a range of natural numbers, from 1 to 100 for example, find the sum of all the given numbers. Below, we will implement some solutions then solve this on a small set of number that will work on any size of numbers that are in order.</p>

<h3><bold>The Task:</h3>
<p>Find the sum of all natural numbers from 5 to 100000000 (100 million) </p>
<h3>Solution 1</h3>
This solution will use a loop to iterate and add each number together to get the sum. 
{% replit @YongLiang/IncompatibleWholeGoal %}

<h2>Carl Friedrich Gauss </h2>
In the 1700's, there's a famous mathematician named Gauss, discovered a pattern to find the sum of numbers in a series, such as 1 to 100. The formula is like this:

s = n(n+1) /2, where s is the sum, n is the last number, and 1 is the first number.

<h3><br>Solution 2</h3>

{% replit @YongLiang/SilverSpanishFact %}

<h3>The runtime for this solution is in milliseconds!!</h3>
<h5>What happened here!!, there is just one line of code and the output is the same as the loop solution.</h5>

<h1>A more efficient solution</h1>
<h4>To understand this better, let's solve this with a small set of numbers: 1 to 10.</h4>

<h4>In the 1 to 10 case, we can divide this into 5 pairs like this: </h4>
<h1>(1+10), (2+9), (3+8), (4+7), (5+6)</h1>

<h3>Notice that the sum of each pair are equal, if we multiply a pair by 5, we get the sum of 1 to 10.</h3>

<h4>To solve this with any large number sets in order, we can say that:</h4>
<h4>1. Get the sum of a pair - (minimum + maximum).</h4>
<h4>2. Get the number of pairs - length/2.</h4>
<h4>3. Multiply step 1 && step 2 to get the sum. </h4>

{% replit @YongLiang/UntidySecondhandGlitch%}
Notice: If you are curious and play around with different number sets, please convert int to float to avoid the miscalculation with odd-length sets. Exp:
puts final_solution(5, 100000000).to_f

<h3>This pattern also works when we want to find sum of all numbers that are divisible by 3 or by 5 or both.</h3>
0-day Vulnerability for Social Warfare WordPress plugin
Tags: wordpress, security, 0day, socialwarfare
Published: 2019-07-16 15:28:47

---
title: 0-day Vulnerability for Social Warfare WordPress plugin
published: true
tags: WordPress,Security,0-day,Social Warfare
canonical_url: 
---

Today, March 21st 2019, Social Warfare plugin has been removed from WordPress.org repository due to a 0-day vulnerability for version 3.5.2 which allowed attackers to inject malicious Javascript code into plugin’s social share links published on any site using it.

**\*\*1st Update\*\***

> Our development team has submitted Social Warfare V3.5.3 to the WordPress update-repository, which addresses this vulnerability and undoes any changes it makes. Please log-in to your WordPress dashboard and apply this update as soon as possible.
> 
> — Warfare Plugins (@warfareplugins) [March 21, 2019](https://twitter.com/warfareplugins/status/1108853377155375104?ref_src=twsrc%5Etfw)

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

[Social Warfare plugin was patched only hours ago](https://mailchi.mp/warfareplugins/urgent-message-03212019-1805) so if you have any site using it you should either upgrade to version 3.5.3 or de-activate and remove it from your WordPress installation. The patched version is still pending approval in order to be published again under WordPerss.org rep[osiutory so if you’re looking for an option to download the updated version then follow the [Social Warfare Free](https://warfareplugins.com/updates/social-warfare/social-warfare.zip) and [Social Warfare Pro](https://warfareplugins.com/updates/social-warfare-pro/social-warfare-pro.zip) direct plugin download URLs.

Social Warfare plugin is one of the most popular WordPress social media sharing plugins and has an active install base of over 70,000 sites and more than 805,000 downloads.

**\*\*2nd Update\*\***

It seems that [Social Warfare plugin has been restored to WordPress.org repository](https://wordpress.org/plugins/social-warfare/) so all current installations will receive an update notification within their WordPress Dashboard.

#### If your website is already infected by the Social Warfare 0-day vulnerability then take a look at our [WordPress malware removal service](https://bitofwp.com/wordpress-malware-removal/) where we’ll clean your site in less than 24 hours.

The post [0-day Vulnerability for Social Warfare WordPress plugin](https://bitofwp.com/security/0-day-vulnerability-for-social-warfare-wordpress-plugin/) appeared first on [WordPress Support Services by BitofWP](https://bitofwp.com).
Visual Studio Tips - DebuggerDisplay
Tags: vstips, csharp
Published: 2019-03-31 00:08:54

---
title: Visual Studio Tips - DebuggerDisplay
published: true
tags: VSTips, csharp
canonical_url: https://hutchcodes.net/2019/03/visual-studio-tips-debugger-display/
---

When you look at an object in the Watch window what you see is whatever comes out of the ToString() method. But what if you could control what was displayed so that you could see some meaningful value? Well, you can.



If we have a `Person` class define like this

~~~ csharp
namespace VSTips.DebuggerDisplay
{
    class Person
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
}
~~~

If we create an instance and look at it in the watch window all we see is `{VSTips.DebuggerDisplay.Person}`. We can of course drill in to see the individual properties, and that isn’t so bad when you’re looking at a single object, but when you look at a `List<Person>` and see this, you know you’re going to spend a lot of time clicking to find the object you’re looking for.

![alt text](https://hutchcodes.net/img/2019/NoDebuggerDisplay.jpg "Ojects dispalyed without DebuggerDisplay attribute")

If we go back to the definition of the `Person` class and add an attribute we can make the watch window display whatever we want. In this case, we’ll display the last name and the first 5 characters of the first name (taking the first 5 just to show the flexability).

~~~ csharp
using System.Diagnostics;

namespace VSTips.DebuggerDisplay
{
   [DebuggerDisplay("{LastName,nq}, {FirstName.Length >= 5 ? FirstName.Substring(0, 5) : FirstName,nq}")]
    class Person
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
    }
}
~~~ 

When you look at the watch list with this Debugger Display what you see is much more helpful.

![alt text](https://hutchcodes.net/img/2019/WithDebuggerDisplay.jpg "Ojects dispalyed without DebuggerDisplay attribute")
... (rest and spread) explained as simply as I humanly can
Tags: javascript, beginners, webdev, explainlikeimfive
Published: 2019-03-21 23:29:38

Three dots `...` does two different things depending on how you use them.

###Spread:

`...` in front of an array removes the outside `[]`.

```js
const x = [1, 2, 3];
const y = [0, ...x, 4, 5, 6];
console.log(y); // [ 0, 1, 2, 3, 4, 5, 6 ]
```


`...` in front of an object removes the outside `{}`.


```js
const x = { one: 1, two: 2, three: 3 };
const y = { ...x, four: 4, five: 5, six: 6 };
console.log(y); // { one: 1, two: 2, three: 3, four: 4, five: 5, six: 6 }
```

###Rest:

`...` when [destructuring](https://hacks.mozilla.org/2015/05/es6-in-depth-destructuring/) an array, assigns the rest of the elements.

```js
const x = [1, 2, 3];
const [one, ...rest] = x
console.log(one); // 1
console.log(rest); // [2, 3]
```

`...` when destructuring an object, assigns the rest of the properties.

```js
const x = { one: 1, two: 2, three: 3 };
const { one, ...rest } = x;
console.log(one); // 1
console.log(rest); // { two: 2, three: 3 }
```

That's it!
Use Your Voice Effectively for Impactful Presentations
Tags: devrel, career, discuss
Published: 2019-03-21 22:50:38

---
title: Use Your Voice Effectively for Impactful Presentations
published: true
description: Learn how to use your voice to be an effective storyteller in presentations.
tags: devrel, career, discuss
series: voice
cover_image: https://thepracticaldev.s3.amazonaws.com/i/p9xf4k7947yi3dxw4zij.JPG
---

# Using Your Voice as a Storyteller

Are you a storyteller on stage? Do you want to engage and inspire your audience in a comfortable and natural way? The great news is that you have one of the essential tools to accomplish this already!

**Your voice**.

But how? Ah, there are a variety of ways you can use your voice to tell your stories in an appealing and impactful way. Let's explore these in this series.

## When Your Presentation Lands Well

When you're "on", your presentation is a story that flows along a melody. The audience is responding and receiving your main message. You feel great because you connected with them. They feel great because they connected with you.

There are a lot of ways to help improve a presentation, but like learning anything, I like to reduce the concept count to focus on one area at a time. Reducing the concept to one thing, such as voice, allows me to improve in that area for each upcoming presentation with being distracted with 100 things to ponder.

Let's focus on your voice. This series of posts that I'm sharing will explain some of the ways I have learned from various coaches and training that have helped me improve how well my presentations land.

## What's Coming in This Series?

Are you dramatically pausing like Captain Kirk or are you speaking as fast as a legal disclaimer in a radio commercial? How high or low do you talk when presenting Do you have a whispering or a booming voice? Do you accentuate critical words and phrases?

If any of these intrigue you, I hope you'll enjoy the upcoming posts (in no particular order):

1 - [Using Your Voice](https://dev.to/azure/use-your-voice-effectively-for-impactful-presentations-4128)
2 - [Pace of your voice](https://dev.to/azure/speed-of-voice-the-pace-of-your-presentation-can-heavily-impact-how-well-it-lands-9b6)
3 - [Pitch of your voice](https://dev.to/azure/sorry-were-you-saying-something-how-the-pitch-of-your-voice-can-make-your-story-more-engaging-8ad)
4 - Volume of your voice
5 - Emphasis of words in your speech
6 - Clarity of your speech

I'll update these links as I publish them.

I hope you find value in these!