teleren/devto huggingface dataset:
Naming things: EventTarget or EventEmitter?
Tags: discuss, javascript, node, dom
Published: 2018-01-28 22:46:05

---
title: "Naming things: EventTarget or EventEmitter?"
published: true
tags: discuss, javascript, node, dom
---

{% twitter 506010907021828096 %}

Today we will tackle one of those challenges, naming things.

In JavaScript land, not too long ago, there was a reality many developers knew all too well called "callback hell" that has been helped greatly with the introduction of `[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)`s but is still around because of one critical fact of JavaScript. It runs (by default) on the same thread as the UI of a page and must be done in between rendering. Thus, browsers and JavaScript engines have the "Event Loop".

- On the Web, we have the [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) class.
- And in Node, we have the [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter] class.

Personally, I like `EventTarget` because it explains that this is an object than can be the target of an event, whether or not the source of that event came from itself or not. It very quietly shows that `dispatchEvent()` and `CustomEvent` exist all without saying anything.

On the other hand I recently [Jake Archibald](https://twitter.com/jaffathecake) on the [HTTP 203 podcast](https://developers.google.com/web/shows/http203/podcast/) that he prefers the `EventEmitter` because is shows where the events are coming from.

The Web is backwards compatible if anything, but discourse is always fun to enlighten and help the future, so what are your thoughts? Which do you think is more effective at explaining its purpose?
How to disable notifications in ASP.NET Core 2.0 for 'Missing XML comment for publicly visible type or member'
Tags: beginners, webdev, csharp, dotnetcore
Published: 2018-01-28 19:57:19

---
title: How to disable notifications in ASP.NET Core 2.0 for 'Missing XML comment for publicly visible type or member'
published: true
description: How to disable notifications in ASP.NET Core 2.0 for 'Missing XML comment for publicly visible type or member'
tags: #beginners,#webdev,#csharp,#dotnetcore
---

I've started playing with ASP.NET since I wanted for a long time to start learning C# but never had the time. Now with Core 2.0 it struck closer to home.

Unfortunately, the biggest issue right now is that the documentation is sparse.
Going trough the swagger tutorial requires to enable xml generation of the documentation in order to properly update the swagger definitions.

Once that's done you'll be met with a nice warning _[Missing XML comment for publicly visible type or member](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1591)_ that unfortunately is a pita to work with when developing in Visual Studio Code since it constantly nags you when starting the debugger. Make note of the reported error code _CS1591_.

Now that we're having .csproj files again, the fix is rather simple.
You just need to include `<noWarn>1591</noWarn>` (without __CS__) under the _DocumentationFile_ definition. 
```xml
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>bin\Debug\netcoreapp2.0\Craidd.xml</DocumentationFile>
    <noWarn>1591</noWarn>
</PropertyGroup>
```
A Web App that tells which Tech is more trending than the others - in real time.
Tags: newapp, discuss
Published: 2018-01-28 13:47:27

---
title: A Web App that tells which Tech is more trending than the others - in real time.
published: true
description: 
tags: new-app, discussion
---

I've started out my programming career pretty recently and the best thing I learnt so far is that we should learn not just to code but to create.

So, the other day, I was visiting couple forums online that, perhaps, developers visit on a daily basis. You know like `StackOverflow,` or `Github`. And there I saw information. Information about how much people are involved in any given technology. So I thought to myself, let's create more information.

Within couple days (since the idea was clear) I created this application that lets you compare and tells which one is more hotter than the others that you may mention.

Check out:  <a href="https://sixthhash.appspot.com/" alt="sixth_hash_app" target="_blank">SixthHash</a> . It was a rushy thing that I'd made for the first time. The App is hosted over AppSpot by Google and uses php & js.

Share your experience and please let me know what changes you felt should be there in the App.

Thanks for reading.
The name is the problem
Tags: thoughts
Published: 2018-02-04 00:21:32

---
title: "The name is the problem"
published: true
tags: thoughts
canonical_url: https://michiels.io/thoughts/2018/01/28/the-name-is-the-problem.html
---

When trying to do new stuff or launch new projects, I always get stuck on the name. It’s not that I cannot get stuck on brainstorming a name. The problem is more that without a name, an accompanying (available!) domain name it seems to suck all of the creative energy out of launching something new.

To fix this, my mid-2017 and 2018’s resolution is to not care about the name for new projects anymore.

That’s not to say the name is not important in the end. But rather I want to ship first and get people happy with my code or with my apps.

You can always fix a name, but you can never fix not shipping.
What is the Dev.to policy on sharing articles on Twitter?
Tags: discuss
Published: 2018-01-28 11:10:42

---
title: What is the Dev.to policy on sharing articles on Twitter?
published: true
tags: discuss
---

So I was wondering why dev.to doesn't share my 'weekly web roundups' on Twitter. Of course that is totally your choice, but I'm not sure why. Aren't they any good, do they cannibalize on your articles? I'll gladly work on improvements if needed!

Thanks.
The Sad State of Webcal
Tags: icalendar, webcal
Published: 2020-03-15 11:22:20

---
title: The Sad State of Webcal
published: true
date: 2018-01-28 10:13:32 UTC
tags: icalendar,webcal
canonical_url: 
---

I cannot believe the state of affairs the web is in when it comes to calendar data and events.

![](https://cdn-images-1.medium.com/max/1024/1*Erpd_TbD76LxPCFU9zVB0g.jpeg)<figcaption>Photo by <a href="https://unsplash.com/photos/zni0zgb3bkQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Estée Janssens</a> on <a href="https://unsplash.com/search/photos/calendar?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption>

There is the iCalendar format which is old and quirky ([seriously quirky](https://tools.ietf.org/html/rfc5545#section-3.1)), but it works and it pretty much serves all necessary purposes. However, there is no standard way for a website to offer such a file to be added to your calendar. Yes, on a laptop you can download it and double-click on it. This will allow your default calendar to pick it up but it’s still not a good user experience. I want to allow my users to click a link and immediately have a dialog that says “do you want to add this to your calendar?”. And this should work with browser based calendars like Google calendar, it should work with desktop apps and most importantly: it should work on phones.

Now, there is the unofficial webcal:// protocol scheme which has some support but that only works for calendars that you want to _subscribe_ to. I don’t want to do that. I want to offer my users to add a single, non-recurring event to their calendar. And I couldn’t be the only one, you can see the sorry solutions that Facebook and Eventbrite offer — on iOS (I can’t speak to Android), adding an event to your calendar is simply disabled.

This is astonishing to me because if there is one thing that drives progress of the web and tech in general (besides from adult content), it’s business needs. And after email, I’d wager that calendar maintenance is about the most common business process. It’s something everybody needs.

I can picture several simple solutions. We all agree on a complementary webevent:// scheme that doesn’t assume subscription. Or, we add a property to the iCalendar format (it could even be a convention) specifying this. And then we fix the remaining gaps in various browsers. It seems trivial to me if we disregard for a second the challenge of getting browser vendors to agree on things and implement them.
Evening Rust Episode 6: Enough practice, get on with it!
Tags: video, coding, rust, competition
Published: 2018-01-28 08:02:18

---
title: "Evening Rust Episode 6: Enough practice, get on with it!"
published: true
description: Water, water, everywhere, but you need a tanker to drink!
tags: video, coding, rust, competition
---

{% youtube K--_1I-L-rk %}

We finally give up on practicing and jump into the competition section. We start with "Mean Max" where we attempt to destroy tankers, collect water, and mess with the opponents -- I'm not clear why do just share the water as the supply appears to be infinite. 

This is the start of our path to intelligent agents. We make it past the 3 wood leages and into the bronze league with a relatively simple algorithm, but next time we'll need to do more.

Subscribe to my [Twitch Channel](https://www.twitch.tv/mortoray) to watch live. Commentary appreciated.
Blog Post Topics You Would Read
Tags: discuss
Published: 2018-01-27 16:12:37

---
title: Blog Post Topics You Would Read
published: true
description: 
tags: discuss
---

Hi! I'm starting a blog that's a mix of technologies I work in and about leadership & professional development in tech to share my perspectives with others. Please comment on the post's ideas you'd be most interested in reading.


* Introduction to Redux-loop
* JavaScript Testing within your app & popular frameworks
* Series of posts on Progressive web apps
* Introduction to Atomic-CSS
* Series of posts React App Architectures
Programming Fluid Specs
Tags: culture, discuss
Published: 2018-01-27 14:55:07

---
title: Programming Fluid Specs
published: true
description: How do you like your work drink of choice?
tags: culture, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wjkenn2e57gvrwz7ovb6.jpg
---

A lot of us drink coffee, and many others enjoy tea or other drinks, but that's about as specific as describing our development environment as a "desktop" or "laptop".

For example, I love coffee, but I also know there is a world of difference between Starbucks, Folgers, Dunkin Donuts, Thomas Hammer, et al; even within those brands, there are many types of coffee.

So, what are the specs on your programming fluid of choice? Be specific: brands, brewing methods, flavors. If I were to get you something to drink *right now*, how would I do it?
Install Gatsby Client
Tags: install, ubuntu, linux
Published: 2018-01-27 13:46:45

---
title: Install Gatsby Client
published: true
description: Install Gatsby Client on Linux
tags: Install, Ubuntu, Linux
---

```
 psnc@psnc  ~  npm install --global gatsby-cli
/home/psnc/.nvm/versions/node/v9.3.0/bin/gatsby -> /home/psnc/.nvm/versions/node/v9.3.0/lib/node_modules/gatsby-cli/lib/index.js
+ gatsby-cli@1.1.31
added 223 packages in 60.29s
```
Cloud API Gateway Help Needed: SOAP (XML) to REST (json)
Tags: help, cloud
Published: 2018-01-27 10:08:27

---
title: "Cloud API Gateway Help Needed: SOAP (XML) to REST (json)"
published: true
description: Which API Gateway can proxy and transform requests from XML to json.
tags: help, cloud
---

Quite a simple problem but unsure of the right solution here so looking for some community experience to help out.

I have a static website that needs to interact with a soap service, which only supports XML responses. This service will take a form post request and return a simple respone which needs to be parsed and displayed to the user.

To make things easier for our development team and to also protect the soap service we plan to run the request through an API gateway to proxy the request. 

Since we are going to proxy it makes sense that we make things simple for the developers by providing an interface at the gateway that allows json requests and responses rather than having to work with XML schemas, we will also convert the soap service to appear as a rest service at the gateway for clients wishing to access. 

At the moment we have two cloud platforms AWS and Google. I know that AWS API gateway can handle mapping and data transformations along with lambda functions to do further heavy lifting, however I'm unsure whether it has any support for soap transformation in the manner I've discussed.

To summarise questions I have left open:

1. Has anyone done this before and has some pointers?

2. I'm completely unconvinced whether Google can do this, using their endpoints platform and I assume compute functions. Can anyone clarify or confirm? It seems to be quite a basic capability still.

3. Any guides/tutorials available? It would be good to walk through the work involved.

Help is appreciated 👍
You have the power!
Tags: agile, productivity, coding, softwaredevelopment
Published: 2018-01-29 13:09:20

---
title: "You have the power!"
published: true
tags: agile,productivity,coding,software-development
canonical_url: https://medium.com/@jezhalford/you-have-the-power-fb8cfb2185eb
---

#### Blockers are all in your mind. Smash&nbsp;them.

![](https://cdn-images-1.medium.com/max/846/0*JwVoxZkwcCsPjeDH.jpg)

If you’re reading this, I imagine you’re some sort of software developer. A programmer, an engineer. A coder. What made you want to be a one of&nbsp;those?

For me, it was the idea that I can make a computer do _anything I want_. I imagine it might be similar reasons for other people. Within our digital domain, we are all-powerful bit-flipping super&nbsp;gods.

But here’s the interesting thing: sometimes I think we forget&nbsp;that.

Have you ever said something like: _“That feature isn’t finished yet, because I’m waiting for the other team to finish their&nbsp;API”?_

What about: _“We can’t release this feature because we already merged the other feature, and that isn’t ready yet because the front-end team haven’t finished their bit, so we’ll just have to&nbsp;wait”?_

All-powerful bit-flipping super gods? What happened?

API not finished? Code a stub. Test for the new schema and use the existing behaviour until it turns up. Understand the domain logic, learn that the value we want is “false” 90% of the time and just hard code “false” for&nbsp;now.

Front-end not ready? Add a feature flag. Release the new API anyway, because the front-end can just ignore it for now. Version your API. Just go over to the front-end team and get your hands&nbsp;dirty.

Push forward, any way you can. Blockers are all in your mind. Smash them. Work around them. Get creative. Bend those machines to your iron&nbsp;will.

I understand it’s hard to do. I’ve used plenty of those kinds of excuses myself. But the problem is really just the way we think about things. Everyone knows software is never finished. But individual features are never finished&nbsp;either.

There’s always a temptation to delay merging and releasing until everything is perfect. But our idea of perfection is always changing, just like everything else.

So: embrace the chaos, get stuck in and get busy changing stuff. We can always change it again tomorrow. That’s what we&nbsp;do.

_Jez Halford is a software development consultant helping teams to deliver better software, more frequently. Visit_ [_jezhalford.com_](https://jezhalford.com) _to find out&nbsp;more._
Measure what matters
Tags: softwaredevelopment, productivity, agile
Published: 2018-01-27 11:12:05

---
title: "Measure what matters"
published: true
tags: software-development,productivity,agile
canonical_url: https://medium.com/@jezhalford/measure-what-matters-d4f01309acc2
---

![](https://cdn-images-1.medium.com/max/1024/0*Z9cArQBKt1UdFqal.)

How long does it take you to deliver a feature into production, from inception to shipment?

If you can’t easily answer that question, it’s time to do some measuring. You can work to improve this metric over time, but unless you already know it, you’re just making wild&nbsp;guesses.

It’s easy to get hung up on how to find out this figure. One common method is to ask all your developers to meticulously log every moment of their time against whatever feature they’re working&nbsp;on.

Another option is to hire a crack team of project managers to log and catalogue everything that&nbsp;happens.

But developers (and indeed most other people) hate being measured. It suggests a lack of trust. It suggests that you think they’re lazy. That’s an unhappy situation for&nbsp;anyone.

But I’ll let you into a secret. The accuracy of your measurements probably don’t actually matter anywhere near as much as you think. And that’s because the time things take to be delivered — actually, properly done and working — is almost certainly far longer than you’d&nbsp;guess.

30 days? 60 days? 80? 100? It’s not uncommon. From first idea to last deployment is often a frighteningly long&nbsp;time.

Of course, this isn’t the case for all teams. If you’re already delivering _complete_ features (be honest) in a few days, then measuring and improving is a different matter. But given a scale of tens-of-days, getting your team to log time down to the minute starts to look a bit&nbsp;crazy.

So, as a start, just take notes. Once something is committed to, write down the date. Then once everyone agrees it’s done, write down the date again. In a few months, you’ll probably have a reasonable picture, and hard data you can use to estimate future features, and test the effectiveness of improvements. All without jeopardising your teams’&nbsp;trust.

_Jez Halford is a software development consultant helping teams to deliver better software, more frequently. Visit_ [_jezhalford.com_](https://jezhalford.com) _to find out&nbsp;more._
How to setup remote repo in shared hosting
Tags: help, git
Published: 2018-01-27 10:29:06

---
title: How to setup remote repo in shared hosting
published: true
tags: help, git 
---

Hi,

I just installed git on my mac, now I want to be able to push my local repo to my  shared hosting.
The shared hosting has git installed, now I am wondering how I have to set it up to be able to push my local repo to the shared hosting server.
Go: Persist Db Structs
Published: 2020-02-20 21:34:03

---
title: Go: Persist Db Structs
published: true
date: 2018-01-25 20:58:07 UTC
tags: 
canonical_url: https://www.skillscheck.co.uk/post/go-persist-db-structs/
---

So the reason for this example is that I was struggling to write a struct to the database. Specifically it was the `r2.Point` struct from `github.com/golang/geo`. It’s a simple 2d coordinate type with `float64` X and Y values. That’s it. And I wanted to store it in the database.

The code for these examples can be found [here](https://github.com/dnnrly/go-examples/tree/master/dbvalues).

To see an example of the error:

```
go run broken.go

```

You should see the following result:

```
2018/01/24 20:55:10 sql: converting argument $2 type: unsupported type r2.Point, a struct
exit status 1

```

The reason for this is that implementers of DB drivers need to support the following types:

- `int64`
- `float64`
- `bool`
- `[]byte`
- `string`
- `time.Time`

Notice that `r2.Point` isn’t one of these?

So what are we going to do about it? Well the people behind the `database/sql` package thought about this a little and provided the [Valuer](https://godoc.org/database/sql/driver#Valuer) interface to help with this conversion.

We need to make sure that we try writing a type that meets this interface so that the driver can do the conversion to a type that it understands.

Take a look in `write.go` to see how we approach this. If you’re new to Go, notice that we’ve used composition to write a type to add more behaviour to `r2.Point`. Here’s what was done:

```
// Location allows us to implement the Value() function for writing r2.Point to the database
type Location struct {
	r2.Point
}

// Value does the conversion to a string
func (p *Location) Value() (driver.Value, error) {
	data := p.String()
	log.Printf("Converted r2.Point to a string: %s", data)
	return data, nil
}

```

Run the file with:

```
go run write.go

```

Now we get _this_ error:

```
2018/01/24 21:33:12 Converted r2.Point to a string: (1.000000000000, 2.000000000000)
2018/01/24 21:33:12 sql: Scan error on column index 1: unsupported Scan, storing driver.Value type []uint8 into type *main.Location
exit status 1

```

Again, package implementers to the rescue - we can use [Scanner](https://godoc.org/database/sql#Scanner). The DB driver will use this interface to get our struct to do the converstion from the type that the DB persisted the data as to the type that we want. Wierdly, as we’re using `sqlite3` this turns out to be `[]uint8`. The last file, `writeread.go` implements the `Scan` function:

```
// Scan converts from a string to a Location
func (p *Location) Scan(v interface{}) error {
	var s string
	switch v.(type) {
	case string:
		s = v.(string)
	case []uint8:
		s = string(v.([]uint8))
	default:
		return errors.Errorf("Don't understand type %T", v)
	}

	_, err := fmt.Sscanf(s, "(%f,%f)", &(p.X), &(p.Y))
	if err != nil {
		return err
	}

	return nil
}

```

Run it with:

```
go run writeread.go

```
Algorithm Coding: Writing a binary tree: Part 1
Tags: video, algorithms, coding, leaf
Published: 2018-01-27 08:01:06

---
title: "Algorithm Coding: Writing a binary tree: Part 1"
published: true
description: The beginnings of a binary tree
tags: video, algorithms, coding, leaf
cover_image: https://thepracticaldev.s3.amazonaws.com/i/4j8fw6dwpnwfqato0slo.jpg
---

{% youtube FD2vmSDkVaY %}

Learn how to write a binary tree and the complexity of the `add` and `walk` functions. We talk about the degenerate cases -- next show we'll cover how to balance the tree.

Subscribe to my [Twitch Channel](https://www.twitch.tv/mortoray) to watch live and ask questions.
A 💩 Notification Code Pen
Tags: css, codepen
Published: 2018-01-27 07:33:25

---
title: A 💩 Notification Code Pen
published: true
canonical_url: https://www.iamdeveloper.com/posts/a--notification-code-pen-4o0n/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/nmx6enjnka59n8c5jwc6.png
description: A fun notification component.
tags: css, codepen
series: my codepens
---

If you want to see the previous Code Pen I did, check out [A Simple ⭐ Rating Code Pen](https://dev.to/nickytonline/quick-simple-rating-code-pen-3ecp).

Continuing along with my [2018 Resolutions](https://dev.to/nickytonline/2018-resolutions-1deo) to make Code Pens this year, here is my latest.

A fun little poop notification component. Maybe [Squatty Potty](https://www.squattypotty.com) can use it 😂 (watch their commercial if you're having a bad day).

One of the reasons I wanted to start making Code Pens was to see how much I can do without the help of JS. In this example, Javascript is only used to increment a CSS variable.

The easiest way to work on the hover effect is to use the "force state" feature in Chrome. See it in action at 2:40, the Bonus Tip! part of the What's New in DevTools video on how to work with "force state".

{% youtube 90wNAn05Cf4 %}

Yes, the poop emoji looks like a pilgrim. That's the best I could do for their hat for now. That's all folks. Now go hover over that 💩 notification!
{% codepen https://codepen.io/nickytonline/pen/ppMmyZ %}