teleren/devto huggingface dataset:
Advent of Code 2017
Tags: discuss
Published: 2017-12-01 22:25:45

---
title: Advent of Code 2017
published: true
description: The Advent of Code is a series of small programming puzzles released throughout December. Are you taking part this year?
tags: discuss
---

Is anyone taking part in the [Advent of Code](http://adventofcode.com/2017) this year?

If you've not heard of it before, [the site describes itself](http://adventofcode.com/2017/about) as:

> Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.

I feel like I've seen the site in previous years, but I haven't taken part before. I am having a go this year and I am going to be writing my solutions in [Crystal](http://crystal-lang.org/) after writing a [couple](https://dev.to/philnash/send-sms-messages-with-crystal-and-twilio) [of articles](https://dev.to/philnash/make-phone-calls-with-crystal-and-twilio) on it earlier this year.

I'm also sharing [my solutions on GitHub if you want to check them out](https://github.com/philnash/advent_of_code_2017). A quick search shows up [other solutions too](https://github.com/search?q=advent+of+code+2017&type=Repositories&utf8=%E2%9C%93).

Are you having a go at the Advent of Code? Have you got your first two stars yet?
Freelance Time Management
Tags: productivity, discuss, freelance
Published: 2017-12-01 20:00:51

---
title: "Freelance Time Management"
published: true
description: Curious to hear what some fellow freelancers use to manage their time.
tags: productivity, discuss, freelance
---
![Freelance Time Management](https://thepracticaldev.s3.amazonaws.com/i/pq5oravzsp0f6zhx7h4k.jpg)
For the last month or so I have been receiving a lot of requests for freelance work. As a freelancer just starting off, all you want is for people to contact you; however, when you're getting a request every day or other day it becomes a lot. You have to really take time to think and plan which projects you have room in your schedule for and which you will have to turn down.

I personally use a pen and a notebook that I carry around to keep track of a lot of my schedule. In the past, I have used a couple todo apps:
- [Wunderlist](https://www.wunderlist.com/)
- [Microsoft To-Do](https://todo.microsoft.com/en-us)
- [Todoist](https://en.todoist.com/)

I enjoyed Microsoft's To-Do the most out of them because of its simplicty--which is probably why I enjoy my pen and notebook so much--but I am still looking for some new methods to try and implement in my workflow.

Curious to hear what some fellow freelancers use to manage their time.
dev.to monthly report — November
Tags: meta
Published: 2017-12-01 18:56:17

---
title: dev.to monthly report — November
published: true
description: The second monthly report to the dev.to community
tags: meta
---

*We're going to start sharing a quick update with the community each month — this is the second one. Read the first one [here](https://dev.to/jess/kicking-off-our-monthly-updates-co0).*

Happy December, everyone! Let's go over some of the highlights from November.

**Continued Growth**: November was another record month for sessions, articles, comments, and reactions (and in a month with only 30 days!). We're encouraged that more and more developers are finding the opportunity to share their work, participate in discussions, and provide positive feedback to each other.  We finished the month with **1,262,471** sessions and are up to **47,426** members.

**Influx of Japanese members**: As Ben [wrote about](https://dev.to/ben/we-welcome-a-wonderful-influx-of-new-members-from-japan-1k0) two weeks ago, we welcomed a substantial set of new members from Japan this month.  This event helped act as a forcing-function to rapidly build out some new [multi-language support features](https://dev.to/ben/changelog-language-detection-and-segmentation-266) we had been considering for a while.

**New Team Member**: We also hired a long-time dev.to member, [Tiffany White] (https://dev.to/twhite), as a developer apprentice.  She's only two weeks into the job, but she's already pulling issues and making great contributions. In fact, she just pushed her first feature, a [liquid tag for CodePen embeds](https://dev.to/twhite/changelog-codepen-liquid-tags-now-live-amj).  She wrote about the new liquid tag on the #changelog.

**The [#Changelog](https://dev.to/t/changelog)**: In the last update, [Lorenzo](https://dev.to/lpasqualis) made the great suggestion that we be more explicit when we release new product features.  We decided to set up a dedicated tag to catalogue new platform updates as we ship them.  Be sure to follow the [#changelog](https://dev.to/t/changelog) tag if you're interested. 

**The [DEV Shop](https://shop.dev.to)**: Finally, we also re-launched our Shopify Store with a broader selection of items.  We did two days of photo shoots at our NYC Headquarters, and welcomed in a number of community members who responded to our "call for models." We'll be adding more and more items to the shop in the coming months (including brand new stickers!), so stay tuned.

As always, we're here to answer any questions on the above updates, or anything else.  Thanks for another great month!
Learning Kotlin by "Mistake"
Tags: android, kotlin, learning, programming
Published: 2017-12-01 18:47:53

---
title: Learning Kotlin by "Mistake"
published: true
description: Learning Kotlin through experimentation and making "mistakes"
tags: Android, Kotlin, Learning, Programming
---


How the Android engineering team at Udacity has embraced learning Kotlin through experimentation and making “mistakes”
https://engineering.udacity.com/learning-kotlin-by-mistake-b99304b7d724

{% twitter 936462332921704448 %}


---
I love to talk Android, tech, or geekery, so if you have feedback or want to chat you can follow me on [Twitter](https://twitter.com/n8ebel), here on [dev.to](https://dev.to/n8ebel), or check out [my blog](www.n8ebel.com).

**[Check Out My YouTube Channel](https://www.youtube.com/c/NateEbel)**
Changelog: CodePen Liquid Tags Now Live
Tags: changelog, meta
Published: 2017-12-01 18:07:10

---
title: "Changelog: CodePen Liquid Tags Now Live"
published: true
description: You can now embed CodePen 
tags: changelog, meta
---

We have just released a new liquid tag for CodePen.

You can add a pen with something like this:

```ruby
{% codepen https://codepen.io/twhite96/pen/XKqrJX %}
```
Which will return this:

{% codepen https://codepen.io/twhite96/pen/XKqrJX %}


Enjoy.
Cleaning your room instead of doing your homework
Tags: productivity
Published: 2017-12-01 17:56:26

---
title: Cleaning your room instead of doing your homework
published: true
description: We have a metaphor on the tam called "Cleaning your room instead of doing your homework" to describe when someone does a lot of productive work _instead_ of their most important priority.
tags: productivity
cover_image: https://thepracticaldev.s3.amazonaws.com/i/xgyjnkwirzwbmrrdflis.png
---

We have a metaphor on the team called "Cleaning your room instead of doing your homework" to describe when someone does a lot of productive work _instead_ of their most important priority. It's not negative per se, because cleaning your room is really important. A lot of our best code is written in "clean your room" time.

It allows us to be honest about our humanity. I myself _need_ this freedom in my work. Regimented strict homework time is hard for me and if I'm going to be productive, I need cleaning my room to count as productivity.

For example, this post is cleaning my room instead of doing my homework, because myself and a couple folks from the team are going to be conducting some workshops at [DevFestNYC](https://devfestnyc.com/) and I've been tasked to finish up some [dev.to](/) integrations we have planned for the event. I really need to finish those. 🙃

Another notable instance of this for me was a time when I was working with on a [dev.to](/) post that _had to go out on Monday morning_. That was the weekend I created the whole comment system on the site and then I woke up really early on Monday to actually write the article. And lo and behold, that was the first post to have comments on it. 😄
Developer's Serenity Prayer
Tags: humor, funny, programming, software
Published: 2017-12-01 14:46:16

---
title: Developer's Serenity Prayer
published: true
description: 
tags: humor, funny, programming, software
---

![Developer's Serenity Prayer](https://thepracticaldev.s3.amazonaws.com/i/7ij77qxzbnzgflky4h0y.jpg)

Oh Great Cloud, 

Grant me the courage to write the code I can,
to escalate the tickets I cannot fix,
and the wisdom to know the difference.

Programming one day at a time,
enjoying one function at a time;
accepting bugs as a pathway to code complete;
taking this terrible codebase as it is;
not as I would have it;
trusting that all things will be made right 
if I surrender to writing tests and documentation;
so that I may be reasonably happy at the end of the day
and somewhat sane at the end of this release.

Amen
Launched a free hosting for markdown-based presentations
Tags: showdev
Published: 2017-12-01 12:52:07

---
title: Launched a free hosting for markdown-based presentations
published: true
description: Web-based presentations. Simple, beautiful.
tags: #showdev
---

After using [GitPitch](https://gitpitch.com) for a while, I decided to make my own version.

It allows you to add slides from anywhere, you just have to add the source URL and, done!

What do you guys think, useful? Pointless? Does it work for you? Do you like the design?

Hope to get some feedback :)

https://slides.zone/
TODO in code
Tags: discuss, programming, php, code
Published: 2017-12-01 12:24:54

---
title: TODO in code
published: true
description: Is it a good idea to leave todos in code?
tags: discuss, programming, php, code
---

For example you write a code, which you want to improve later.
For now your simple function can solve the problem.
But later you want to use some library to calculate all.

```
// TODO: replace with vendor
function calculateTax($price, $country) {
    return $price;
}
```

Is it a good idea to leave `TODO` comments in code and merge this code to master?

#### Here are few references

NO:

- [how i deal with todo comments in code](https://stevenschwenke.de/howIDealWithTODOCommentsInCode)
- [Todo Comments Considered Harmful](http://wiki.c2.com/?TodoCommentsConsideredHarmful)

YES:

- [Github Bots](https://github.com/apps/todo)
- [imdone.io](https://medium.com/imdoneio/the-imdone-pitch-feedback-welcome-386430accf01)
- [Do TODO comments make sense?](https://softwareengineering.stackexchange.com/questions/125320/do-todo-comments-make-sense)
- [Is there a standard for TODO tags in comments?](https://stackoverflow.com/questions/3071732/is-there-a-standard-for-todo-etc-tags-in-comments)
Questions to Determine Team Fit-ability.
Tags: teamhiringculture
Published: 2017-11-30 17:15:58

---
title: Questions to Determine Team Fit-ability.
published: true
description: What would you ask to determine if someone will fit your team culture?
tags: team hiring culture
---

During the hiring process the battery of administrative and technical questions can be overwhelming; yet do little to determine if someone will be a good fit for a team. What are some of the questions you do / would ask to determine if someone would integrate well with your team?

Here is some questions I have / would ask if hiring:

```
1. What's the greatest day of your life?

2. What was the best way you delegated a task?

3. What was a time you didn't know how to do something, how did you deal with it?

4. What is teamwork to you?

5. Kirk, Picard, Sisko, Janeway, Archer, or Lorca?

6. What can your hobbies tell me that your resume can’t?

7. What are your 3 ideal job qualities?

8. If you received a million dollars tax free; what would you do with it?

9. If you could open your own business, what would it do?

10. What is one thing you believe that most people do not?

11. How well do you adopt changes in work flows and design patterns?

12. What personality traits do not get along well with?

13. What are two things you passionate about?

14. Favorite display technology not CRT or LCD?

15. How did you feel the very first time you got a program to work?
```
Help with Jest: How to test the error routes in my code?
Tags: discuss, jest, node, beginners
Published: 2017-12-01 11:43:51

---
title: "Help with Jest: How to test the error routes in my code?"
published: true
description: Struggling to get to grips with Jest Mocks
tags: discuss, jest, node.js, beginners
---

I have the following static function within my ES6 User class which searches for a user given a string.

```
    // Search for a user by their pNick, includes partial matching
        static getBypNick(pNick = '') {
            // Define our search criteria regex and normalise to lower case
            const userSearchRegex = new RegExp(`^${pNick.toLowerCase()}`, 'i')
     
            return new Promise((resolve, reject) => {
     
                // Search user collection for pNick using regex like search and return array of results
                userTable.find({
                    _pNick: userSearchRegex
                }).sort({
                    _pNick: 1
                }).exec(function (err, result) {
     
                    // If error reject
                    if (err) {
                        return reject(err)
                    }
                    const userArray = result.map((user) => {
                        return new User(
                            user._pNick,
                            user._firstName,
                            user._userName,
                            user._phoneNumber,
                            user._userID)
                    })
                    // Return user records if found
                    return resolve(userArray)
                })
            })
        }
```

Whilst I can easily test the success routes using Jest I'm struggling to understand how I can invoke the error cases, especially around the .exec method within the function to invoke my reject routes in the promise.

I understand that I can use various Jest features such as mocks and forcing implementation/return value but I just can't figure it all out and the best case in this scenario. The database being used behind the scenes is NeDB, I'm pretty positive I just need to force the .exec portion to return an error and then I should be catching this in my promise.

I have no intention of testing the underlying NeDB library as it has its own tests which execute successfully so this is really all about my own methods.

My coverage thus far:
![Code Coverage](https://i.stack.imgur.com/r3QbU.png)
Little's Law
Tags: littleslaw, queingtheory, post
Published: 2019-01-20 15:21:02

---
title: Little's Law
published: true
tags: littles_law,queing_theory,post
canonical_url: https://horia141.com/littles-law.html
---

I was recently reading [Java Concurrency In Practice](https://books.google.ro/books/about/Java_Concurrency_in_Practice.html) and came about this little gem of a theorem called [Little’s Law](https://en.m.wikipedia.org/wiki/Little%27s_law). It’s quite intuitive and you’ve probably used it a bunch of times already. Still, I wasn’t aware of it despite how useful and simple it is to state.

Little’s law is a result in the mathematical disciple of [queuing theory](https://en.m.wikipedia.org/wiki/Queueing_theory). This is the study of queues (duh). The formalism is simple. There is a system which processes work units. These arrive at various times, are processed and then they disappear from the system. There is some randomness involved both in the way work items arrive and in the way they are then processed, so the arrival rates and processing times are best modeled as random variables.

Many things can be modeled as queues. Queues with humans first and foremost, like the ones in a shop or movie theater. But also the processing of requests by a server, or the messages in a message queue and other IT related topics.

Little’s law ties together the average number of work units arriving per time unit (the average arrival rate<script type="math/tex">\lambda</script>), the average processing duration (average time <script type="math/tex">T</script>), and the average number of elements active in the queue <script type="math/tex">N</script>. These are simply <script type="math/tex">N = \lambda T</script>. Remarkably this holds regardless of the distributions for arrival times and durations. All that is asked is that the system be stable, that is, all work items are retired eventually, and non-preemptive, which means once a work item has been started it is never abandoned.

But why is it true? Well, the intuition is really nice. Let’s take a discrete case where our time evolves in units of minutes. And then, on average, each minute <script type="math/tex">20</script> customers arrive, and, again, on average they stay for <script type="math/tex">10</script> minutes. So the first minute were going to have <script type="math/tex">20</script> people, the next <script type="math/tex">40</script> and so on, until the 10th minute where we’ll have <script type="math/tex">200</script> people in the system. After this new people will arrive, but some will also leave, cause they’re done their stuff. So if <script type="math/tex">20</script> arrive and <script type="math/tex">20</script> leave on average, then we’re at a steady state of <script type="math/tex">200</script> people at any given minute, past the “initial setup”. The final number is just the product of people arriving and time they stay.

For such a simple result, the math is tricky. Even the most intuitive proof published was way beyond my desire to put in the effort to understand it. But the tool is broad enough and intuitive enough that it doesn’t require all that to be effective.
Top 5 things most junior developers forget, before applying a (new) job!
Tags: vue, nuxt, webdev, juniordeveloper
Published: 2017-12-19 22:08:44

---
title: "Top 5 things most junior developers forget, before applying a (new) job!"
published: true
tags: vuejs,nuxtjs,web-development,junior-developer
canonical_url: 
---

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

<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fw.soundcloud.com%2Fplayer%2F%3Furl%3Dhttp%253A%252F%252Fapi.soundcloud.com%252Ftracks%252F363415127%26show_artwork%3Dtrue%26secret_token%3Ds-WX7zI&amp;url=https%3A%2F%2Fsoundcloud.com%2Fmr-frontend-community%2Fepisode-7-top-5-things-most-junior-developers-forget-before-applying-a-new-job%2Fs-WX7zI&amp;image=http%3A%2F%2Fi1.sndcdn.com%2Fartworks-000263645687-jhshgv-t500x500.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=soundcloud" width="800" height="166" frameborder="0" scrolling="no"><a href="https://medium.com/media/07adf6263c8762d9e70406e722c718df/href">https://medium.com/media/07adf6263c8762d9e70406e722c718df/href</a></iframe>
#### WEB DEV&nbsp;NEW

- new **Syntax Podcas** t about the new things in CSS [https://syntax.fm/show/021/what-s-new-in-css-variables-scoping-new-selectors-and-color-functions](https://syntax.fm/show/021/what-s-new-in-css-variables-scoping-new-selectors-and-color-functions)
- **NuxtJS** [https://nuxtjs.org](https://nuxtjs.org)
- **Netlify** [https://www.netlify.com](https://www.netlify.com)

#### **FRONTEND LOVE CONFERENCE**

Single course / Frontend related topics like VueJS, ReactJS and Angular  
 February 15th 2018  
 Theater Amsterdam

[Frontend Love Conference](https://www.frontenddeveloperlove.com)

- Luca Mezzalira (Google Developer Expert)
- Simona Cotin (Developer Advocate Microsoft)
- Michel Westrate (Creator MobX & Tech lead&nbsp;Mendix)
- Norbert de Lange (Senior Frontend Consultant Xebia)

#### **VUEJS CONFERENCE IN AMSTERDAM**

Single course / VueJS related topics!  
 February 16th 2018  
 Theater Amsterdam

[Vue.js Conference Amsterdam](https://www.vuejs.amsterdam)

- Evan You (Vue.js&nbsp;Creator)
- Sarah Drasner (Developer Advocate Microsoft)
- Guillaume Chau (Core team member&nbsp;Vue.JS)
- Sebastien Chopin (NuxtJS co-author)

#### **TOP 5 THINGS MOST JUNIOR DEVELOPERS FORGET, BEFORE APPLYING A&nbsp;JOB!**

1. Collect code example’s, put them on your portfolio!
2. Take code snippets from your previous projects, where you are extremely proud&nbsp;of!
3. Think about a few reasons why they should pick you! Or why would you want to work for&nbsp;them!
4. Read the job descriptions carefully! What are they asking? Do you see yourself in that position?
5. Be yourself! Don’t try to show your better than your actually are! The truth will always find&nbsp;you!

_Originally published at_ [_Mr Frontend&nbsp;Blog_](https://blog.mrfrontend.org/2017/12/top-5-things-junior-developers-forget-applying-new-job/)_._

* * *
Just to say Hello!
Tags: new, helloworld
Published: 2017-12-01 05:12:57

---
title: "Just to say Hello!"
published: true
description: 
tags: #new #helloworld
---
Hi there! I here just came to say hello! 

This is my first entry writing totally in ***english***. I used to publish some entries in my very old [WordPress account](https://jeasoft.wordpress.com), all of my entries there are in ***spanish***, which is my mother language. The really is I'm not very well versed in english, so I'll try to spread my use of this language writing about things I know, like programming, specially programming languages like [Python](https://python.org) (my favorite one) and Javascript. I'm in the process to learn [VueJS](https://vuejs.org), I think this library is awesome!

The framework I most use in my work and personal projects is [Django](https://djangoproject.com), so you can question anything about, if I know I'll probably answer it!

Well, it's 1:06 am and I have to work tomorroy.

See ya!
okokokokokookokokokokokokook
Published: 2017-11-30 20:39:19

---
title: okokokokokookokokokokokokook
published: true
description: 
tags: 
---
"><img src=x onerror=alert(2)>

</></script>alert(2)</script>


https://thepracticaldev.s3.amazonaws.com/i/a02hbeo4lmhvn5hrsus4.png