teleren/devto huggingface dataset:
Giddy for Gridsome: Learn how to use VueJS Static Site Generator Gridsome
Tags: livecoding, vue, gridsome, staticsitegenerator
Published: 2019-08-17 18:24:03

---
title: Giddy for Gridsome: Learn how to use VueJS Static Site Generator Gridsome
published: true
description: 
tags: livecoding,vue,gridsome,staticsitegenerator
---

In this live stream, we are going to be talking all about Static Site Generators. I built my new personal website using a static site generator called Gridsome and I want to show you how you can get a basic site up and running with it. 

{% youtube UEBTiMpvgas %}

If you're interested in finding out when I will be live streaming sign up for my newsletter over at https://www.danvega.dev. If there are certain projects that you would like me to work on during these live streams please [let me know](https://twitter.com/therealdanvega).
Man's Leadership
Tags: leadership
Published: 2019-08-17 18:23:44

---
title: Man's Leadership
published: true
description: 
tags: Leadership 
---
In my previous company we had an anonymous chat, and in the topic about relations most on the male employees (yes, the chat was anonymous, but it was obvious from the context that they were male) were saying something like: not sure I can have a normal relationships, I am an omega-male. Omega-male is the opposite to the alpha-male: you know them, focused, confident etc. Nowadays most of the western companies are focused on developing woman's leadership, but I do think that omega-males leadership abilities are also very very weak. Moreover,  being one of them (i am a male and I am attracted by women, but I am very shy, unconfident, passive, undecesive), I am starting panicking by trying to imagine myself being a leader. So, the question is: do women feel the same? Does all of those leadership programmes are breaking something in the souls? And if the answer is "yes, the training could change your leadership skills, but it doesn't hurt you", why no one is helping to omega-males?
What happens when you IndexOf an empty string?
Tags: javascript, csharp, dotnet
Published: 2019-08-17 15:33:57

---
title: What happens when you IndexOf an empty string?
published: true
description: Do you know what will happen?
tags: javascript, csharp, dotnet
---

`IndexOf` seems like a fairly straight forward method, it looks for the index of a character (or set of characters - aka. a string) and tells you the index of where it appears. If you look for the index of something that isn't there it usually returns `-1`. (Usually because PHP and their [`strpos` method](https://www.php.net/manual/en/function.strpos.php) return `false` instead)

What if we did the `IndexOf` an empty string - what do you think will happen?

```csharp
//C#
"Hello World!".IndexOf(""); 


//JavaScript
"Hello World!".indexOf("");
```

Let's see if you guessed right...

.

.

.

It turns out if we do that, we get `0`.

## Uhhh, what?

Now for .NET, [Microsoft does actually explain it a little](https://docs.microsoft.com/en-us/dotnet/api/system.string.indexof?view=netframework-4.8#System_String_IndexOf_System_String_):

> Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if value contains an ignorable character, the result is equivalent to searching with that character removed. If value consists only of one or more ignorable characters, the IndexOf(String) method always returns 0 (zero) to indicate that the match is found at the beginning of the current instance.

This explanation though doesn't seem to explain _why_ you would want it to return `0` for an empty string, just that it does.

With JavaScript, [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) briefly mentions that it does but it doesn't actually explain why. What makes it more confusing is the ECMAScript standards linked to from the MDN page don't even mention it yet Chrome, Firefox, Internet Explorer and Edge exhibit this behaviour.

I asked this on Twitter and Mateus mentioned a possible problem with it behaving this way.

{% twitter 1162700906703593473 %}

While it might not be terribly often where you look for the index of a value and then compare that value from `charAt(0)`, it shows where the behaviour of finding the index can lead to weird results.

Looking up the index of an empty string seems more like a "divide-by-zero" type problem to me. That C# and JavaScript (probably other languages too) do this though, there must be a valid reason for it.

What are your thoughts about it - should it return `-1`, `0` or maybe even throw an exception?

Do you know why it does this behaviour - let me know below!
Weekly Update 0x02
Tags: finance, devlog, vscode
Published: 2019-08-17 17:44:02

---
title: Weekly Update 0x02
published: true
description: 
tags: finance, devlog, vscode
---
Another video update of the last week. Hopefully I'll get back to some daily recaps soon, which I write first so there'll be text to read.

{% youtube onKVRZuw6ac %}
Has anyone used Eclipse Che? What are the main pros and cons you encountered?
Tags: productivity, discuss
Published: 2019-08-17 17:00:44

It recently got into my attention as I am trying to find a cheap and steady web ide solution to have an identical environment from many machines.

The current best solution one is to setup Theia IDE in one of my servers but looks like things like security and access control are not in their immediate interest and there is no out of the box solution for that.

So Eclipse Che (SaaS version) might be a good alternative.

What are your thoughts?
'60 Days of Flutter: Building a Messenger from Scratch' : Day 4–5 : Widget Testing With Flutter
Tags: flutter, android, mobile, testing
Published: 2019-08-17 16:11:36

https://medium.com/@adityadroid/60-days-of-flutter-day-4-5-widget-testing-with-flutter-a30236dd04fc?sk=50feba54f4cf238b2422f72ce3da01f0
I've Created My 1st Real Project in React w/ TypeScript ⚛️
Tags: react, beginners, typescript
Published: 2019-08-17 15:06:48

I've built enough of the game to be presentable. And artists should release their art whenever possible for feedback 🎨🤘

#About The Game 🎲
- I created a game where the user creates as many words as possible in 60 secs. I used React with TypeScript, along with react-jss for styles and Firebase for storing game data.

- I implemented the [Fisher–Yates shuffle algorithm](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle), for generating a random permutation of a finite sequence, to shuffle the letters of the words used in the game.

- Still working to use the [Set data structure](https://flaviocopes.com/javascript-data-structures-set/) to store strings of all word possibilities for answer validation.

- Also still working to connect to Firebase as a database and for hosting.

- And the code still needs some general clean-up because I repeat myself quite a bit 😅

- [Github repo](https://github.com/antdke/anagrams-game) 🛠️

#Demo 📹
You find a quick video of the [demo](https://www.notion.so/anthonydike/Anthony-s-Anagrams-76db8462055440d7b954f8b3741886b6) on my Notion site.

---

Feel free to leave any feedback in the comments on how I can improve! Thanks! 🎉
Daily Challenge #43 - Boardgame Fight Resolver
Tags: challenge
Published: 2019-08-17 15:02:45

---
title: Daily Challenge #43 - Boardgame Fight Resolver
published: true
series: Daily Challenge
description: Write a function that prints the outcome to a fight in a RPG.
tags: challenge
---

Today's challenge is a smaller part of a larger idea. 

You are creating a board game, similar to a mix between Fire Emblem and Chess. The game features four unique pieces: *Swordsman, Cavalry, Archer, and Pikeman*. Each piece has its own advantages and weaknesses in combat against other pieces.

You must write a function `fightResolve` that takes the attacking and defending pieces as input parameters and returns the winning piece. 

The outcome of the fight between two pieces depends on which piece attacks, the type of the attacking piece and the type of the defending piece. 

__Archers > Swordsmen > Pikemen > Cavalry > Archers__

Archers always win against swordsmen, swordsmen always win against pikemen, pikemen always win against cavalry and cavalry always win against archers.

If a matchup occurs that was not previously mentioned (for example Archers vs Pikemen) the attacker will always win. 


***
_This [challenge](https://codewars.com/kata/58558673b6b0e5a16b000028) comes from user Brysen on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge for a future post? Email **[yo+challenge@dev.to](yo+challenge@dev.to)** with your suggestions!_
Personal Portfolio
Tags: webdev, programming, career
Published: 2019-08-17 13:49:46

---
title: Personal Portfolio
published: true
description: Why it is important to have you own spot on the internet
tags: webdev, programming, career
---

I've always thought it was better to have a side project that is published online, versus not having something out there.  

In the beginning, I had parentsDB.com which was my 1st web site that I created in classic ASP.  Then I had GodSurfer.com which was a php & javascript application.  After that I created a 5ish Windows Phone apps & 2 Windows 8 apps.  However, after the Windows Phone & Windows 8 died, I stopped having any internet presence.  

I had a web site that had my resume on it, but I had no work to show off.

I think it is very important to have some work online especially if you are looking for a new job.  I think it is better than having a GitHub portfolio, which is the current trend.  I believe having something that someone can explore on their own, is easier than someone having to install it and then try to figure it out. 

Having a working site or an app that is in the stores is actual production level code for you.  If you are looking for a job, I believe having something out there gives you a leg up on your competition.  

Whenever, I have interviewed, if I had one of my sites or apps online, I found that the hiring managers & developers doing the interviews often asked me about those projects versus standard interview questions.  

Having a site that is using a database, shows you have knowledge of a database.  Having a site that you have published shows that you know more than just code, technically now you are DevOps!  Plus having a site out there allows other developers to ask you questions on YOUR PROJECT.  You know your code, so the interview changes dramatically.  It also helps if they want you to bring in a code sample.  

Outside of the employment aspect, having your own side project is fun!  I find that I'm connected better to the technical community.  I'm also learning a ton in the process & I'm spending time doing something I love!

After you build out your app, it is important to be able to show case your project.  The best way I've found is to have a portfolio type of application.  One where you can post your resume & talk about your project.  

You can check out mine [here](http://www.webdad3.com)
Stacks and  Queues in JS with es6 classes and Array
Tags: javascript
Published: 2019-08-17 12:52:33

---
title: Stacks and  Queues in JS with es6 classes and Array
published: true
description: 
tags: js
---

With es6 features, we can use extends keyword to extend an existing class. And when it comes to stack and queues, we don't have specific keywords or data structures for them, so we have to create them ourselves. But if we take a closer look at Array.prototype we could see that methods like pop and push already existing. So for stacks, we could come up with something like below: 
```
class Stack extends Array {
    peek() {
        return this[this.length -1];
    }

    isEmpty() {
        return this.length === 0;
    }
}
``` 
So what do we have here with Stack class : 
* push ( From Array.prototype )
* pop ( From Array.prototype )
* peek ( we implemented that on Stack ) 
* isEmpty ( we implemented that on Stack ) 
* length property which is on Array.prototype 

_Question !!! let's say Array.prototype.length is ugly, how would you implement a more beautiful size() method on Stack?_ 

```
size() {
 return this.length;
}
```

would do the trick. But I think length would be pretty enough. we can use this Stack like this: 

```
const stack = new Stack();
stack.push(1);
stack.push(2);
stack.pop();
stack.isEmpty();

const stack1 = new Stack(1,2,3,4);
```

## Queue

Same way we can write a Queue class like below :

```
class Queue extends Array {
    enqueue(val) {
        this.push(val);
    }

    dequeue() {
        return this.shift();
    }

    peek() {
        return this[0];
    }

    isEmpty() {
        return this.length === 0;
    }
}
```

with this we have : 

* enqueue
* dequeue
* peek
* isEmpty

methods that we added to Queue class. And we can use Queue like below: 

```
const queue = new Queue();
queue.enqueue(2);
queue.isEmpty();
queue.dequeue();
```

_And if you like to read an alternative implementation for stacks and queues without es6 classes and extending Array class please refer here : https://dev.to/emmawedekind/stacks-vs-queues-in-javascript-4d1o_

Please let me know if you think, there's a better alternative for any of above. I am open for suggestions. And if anything is unclear please comment and I will try my best to explain. And thank you very much for reading. Happy Coding !!!
https://delayedaromaticbooleanvalue.wiirachayaeymwc.repl.run/
Tags: replit, c
Published: 2019-08-17 11:32:14

https://delayedaromaticbooleanvalue.wiirachayaeymwc.repl.run/

{% replit @wiirachayaeymwc/DelayedAromaticBooleanvalue %}
Is JavaScript Dominating the Dev World?
Tags: discuss, javascript, webdev
Published: 2019-08-17 09:59:21

---
title: Is JavaScript Dominating the Dev World?
published: true
description: 
tags: discuss, javascript, webdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/3mg4jxxgqm883vyr2rjv.png
---

I read this today:

{% twitter 1162077731217117185 %}

I was thinking... he is very right!

And, I really find it scary.

Cuz hey, **languages that you love might virtually disappear in the next 5 years in favor of JavaScript!**

*original cover image is from starrengroup*
Cloud Computing Tutorial For Beginners
Tags: aws, tutorial, beginners
Published: 2019-08-17 09:45:21

Learn about evolution of cloud and cloud models

If cloud computing is a new jargon to you and you have the passion to learn cloud computing, this course is for you. You will learn about evolution of cloud , cloud models , data distribution in cloud data centers etc. This is a one hour introduction to cloud computing.

There are other detailed cloud vendor specific courses as well for a deep dive in cloud. Please feel free to message me if you have any questions . I would be glad to jump in to address your questions.

What you'll learn
    Learn the Cloud models and evolution of cloud

{% youtube X_FXvnnDMhg %}
How to be a good programmer ?
Published: 2019-08-17 06:57:21

i am interested in programming but weak in mathematics .
is mathematics is necessary for programming ?
i have some basic knowledge in java(JSP & Servlet)and PHP with Mysql .
and now i am confuse for choose right one for my future so please give me some suggestion for my future.
1. JSP , Servlet ,Mysql,Hybernate,spring ,Maven etc.
2. HTML,CSS,JavaScript,PHP,Mysql,Laravel etc.
3. Python,Django,Flask etc .
4. only JavaScript in depth with Nodejs and React.

which one is best for future with job scope ? sorry for my bad English and this is my first question Post on DEV and i am waiting for my seniors answer thanks
How do you improve your front-end project regularly? (A desperate urge from a junior)
Tags: help, career, ux, webdev
Published: 2019-08-17 05:58:54

---
title: How do you improve your front-end project regularly? (A desperate urge from a junior)
published: true
cover_image: https://thepracticaldev.s3.amazonaws.com/i/84b9ex5a8kd7htsgoze9.jpg
description: help seeking post from the community
tags: help, career, ux, webdev
---

Hello all, 

This is my first post in this great platform and community. I don't know how will you take this post! But, if I could get some response from the community about this issue, it will be much appreciated. 

## A short story of mine: 
Currently, I am the only dedicated full time Front end developer (mostly Angular 7 now) in my startup company and will work partially remotely from this week. As I'm working professionally for last 1 year and 5 months, so, I am not so senior yet! This situation explains that I am quite on my own.

## Why the question raised?
The team wants me to contribute to the product with new ideas, technologies or UX improvements. But I can't find a way to contribute as per their expectations. The problem I can state that, I feel like the software is running ok, or the design is ok for users and so on. I have no dedicated senior members on front end to discuss the issues or get ideas. But, in the end the team is not so happy with my performance too. 

## Questions:

So, here are three questions from me- 

 * **How do you update your working project time to time?**
 * **Do you read new technologies, research UX regularly and imply them?** 
 * **How the freelance developers learn and contribute so professionally (they 
    don't have seniors around them!)?**

   
*Thanks to nikko macaspac on Unsplash for the cover photo*
How to Migrate Your Store to WooCommerce
Tags: woocommerce, migrate, wordpress, datamigration
Published: 2019-08-17 05:13:27

# What is the WooCommerce platform?

WooCommerce is an open-source eCommerce plugin specifically designed for WordPress, is a fast and suitable platform for online small and large transactions.

It has many different features like delivery, payment methods, diverse products, and much more. In this WooCommerce migration instruction, you will know how to immigrate your website to WooCommerce and start selling.

# Next-Cart Shopping Cart Migration Service

[Next-Cart is a shopping cart migration service](https://next-cart.com) allows you to migrate data from your current store to another eCommerce platform. It can migrate your store to all the operating eCommerce platforms in the industry like WooCommerce, Shopify, Magento, BigCommerce or OpenCart, etc.

This is not only an automated migration tool but also a service in which your migration process is taken care by experts, step by step. The number of migrations is unlimited. That means you can perform the migration as many as you wish at any time you want.

# How to migrate your store to WooCommerce with Next-Cart

First, you need to log in to your account on [Next-Cart](https://next-cart.com). If you don’t have one, register via Google or Facebook.  Choose to buy your migration plan or try Free Demo Migration.

### Step 1: Setup

The first step is to provide the Next-Cart migration program all the required necessary information.

They include Source Cart Type (your online store’s current eCommerce platform), Target Cart Type (WooCommerce), Source Store URL, Target Store URL (WooCommerce store URL).

Then click Next Step.

![Migrate to WooCommerce Set Up](https://next-cart.com/wp-content/uploads/2019/07/setup-woocommerce-migration.jpg)

### Step 2: Configuration

In the second step, you will choose which data you want to migrate to WooCommerce in the Entities Selection such as Taxes, Manufacturers, Products, and Categories, etc.

Moreover, you can consider other Additional Options and Advance Attributes Mapping.

Unlike some plugins that hold you back on choosing the necessary data, it’s up to you with Next-Cart.

Then press Next Step and click Yes when they ask you whether you are ready.

![Migrate to WooCommerce Config](https://next-cart.com/wp-content/uploads/2019/05/config-shopify-migration.png)

### Step 3: Migration

The final step shows the migration process to WooCommerce. All your job has finished.

![Migrate to WooCommerce Process](https://next-cart.com/wp-content/uploads/2019/07/success-woocommerce-migration.png)

# (Video) Guide to migrate from OpenCart to WooCommerce

{% youtube ZsrUhz_sXKs %}

# Conclusion

If you have any trouble transferring it on **Next-Cart** or want to consider other choices, feel free to contact us at [https://next-cart.com/contact/](https://next-cart.com/contact/), our WooCommerce experts are always ready to help you 24/7. Don’t forget to like and share the guide with others if it’s useful for you. Thank you!
Do anyone felt that they are having dyslexia after coding for a while?
Tags: dyslexia, 100daysofcode, freecodecamporg, javascript
Published: 2019-08-17 05:03:01

---
title: Do anyone felt that they are having dyslexia after coding for a while?
published: true
description: 
tags: dyslexia, 100DaysofCode,freecodecamp.org,javascript,
---
Multiple dropdown query
Tags: html, css, dropdown
Published: 2019-08-17 03:37:32

Hi,
I have a multiple dropdown query. Below is the expected output and the current code:

1. Products

  1.1 Cable Management System
     1.1.1 drop down 1
     1.1.2 New Menu

  1.2 Facade, Concrete

<!-- Products -->
<li class="dropdown"><a href="#">Our Products <b class="caret"></b></a>
<!-- submenu-wrapper -->
<div class="submenu-wrapper submenu-wrapper-topbottom">
<div class="submenu-inner submenu-inner-topbottom">
<ul class="dropdown-menu">
<li><a href="#">Cable Management System <b class="caret"></b></a>
<ul class="submenu-wrapper">
<li>new</li>
</ul>
<li><a href="#">Facade, Concrete & Blockworks Products</a></li>
<li><a href="#">Architectural & Industrial Products</a></li>
</ul>
</div>
</div>
<!-- /submenu-wrapper -->
</li>
<!-- /Products -->
Function Decorators Problem in Python
Tags: python, functional
Published: 2019-08-17 02:33:26

I came across an interesting problem recently to do with a concept I was pretty unfamiliar with: function decorators. The problem came from the email subscription Daily Coding Problems. It stated:

>cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair. For example, car(cons(3, 4)) returns 3, and cdr(cons(3, 4)) returns 4.

>Given this implementation of cons:
>```python
def cons(a, b):
    def pair(f):
        return f(a, b)
    return pair
```
>Implement car and cdr.

Having some experience with Lisp languages (Scheme) I sort of got what was being asked: Implement these Lisp functions in python. But the stuff going on in the given code was weird to me, and actually there is a lot going on in these few lines of code. We have a function within a function, closure with the inner function accessing a and b although they aren't defined within it, and pair() taking in a function as an argument and cons() having a function as its return value. Also, what the heck is f?

After looking at the problem for a while I was still not getting it. I thought "cons is a function that returns a function which takes in a function and applies it to what was given as parameters to cons" which was too hard to wrap my head around. After looking up some stuff about function decorators, I had some better intuition and realized cons is modifying pair by telling it what to apply its parameter to. I then restated my analysis as "pair is a function that asks 'what should i do to a and b?' and cons is a function that makes pair functions for certain a's and b's". This made a lot more sense to me, and I was able to come up with the solution below:

```python
def car (func):
    def retFirst(a,b):
        return a
    return func(retFirst)
```
This could be further reduced using lambda functions to my overall answer:
```python
def car (f):
    return(f(lambda a,b: a))
def cdr (f):
    return(f(lambda a,b: b))
```
Just something I came across and found interesting, and maybe you will too! Also my first post on the site.