teleren/devto huggingface dataset:
My reflections on Andela's EPIC values
Published: 2019-11-26 17:13:36

EPIC Values (Excellence, Passion, Integrity, and Collaboration) are core values and morals that employees should go by at Andela. With these morals or ethics put in practice, an individual is able to reflect change not only to him/herself but also to everyone around them. In this post, I will share how these four affects me.
#####Excellence
This is my favorite value in the EPIC acronym and it simply represents the output of your work and how you should prepare to go about doing it. With excellence, I aspire to give everything I have and perfect as I can anything my mind and strength are put to. As a Software Engineer, I understand that every project I work on is a reflection of who I am.
#####Passion
Passion as a value is a very important key because it drives a person through whatever they are undertaking no matter what challenges they face. When a person does something with passion, they do it with love and motivation which drives them to successful completion no matter what time it might take. Therefore Passion as part of the EPIC Andela values is a very good thing because it shows that whatever work one is undertaking, there is love and no backing down
#####Integrity
Honesty and strong moral principles are the top values that can be used to define who someone really is in life, and Integrity can be defined by the two combined(quality of <strong>honesty</strong> and having <strong>strong morals</strong>). By this, I understand that by having honesty and strong moral principles I am able to gain respect from others and that I can be a trustworthy person that can be relied on.
#####Collaboration
The last but certainly not the least of Andela's core values (Collaboration), means that we can achieve great things when we are able to work together. With this in mind, the only way we can achieve this is by uplifting each other and share knowledge in case our fellows are facing difficulties that we are able to help them get out of.

I strongly believe that by believing in these four values and by putting them in practice every day, I am capable of becoming a better version of myself and I am able to reflect change to everyone around me.
Improve SPA performance by splitting your Angular libraries in multiple chunks
Tags: performance, typescript, angular, javascript
Published: 2019-11-27 06:42:35

---
title: Improve SPA performance by splitting your Angular libraries in multiple chunks
published: true
date: 2019-11-26 16:44:14 UTC
tags: performance,typescript,angular,javascript
canonical_url: https://medium.com/angular-in-depth/improve-spa-performance-by-splitting-your-angular-libraries-in-multiple-chunks-8c68103692d0
---

#### Take advantage of ng-packagr's secondary entry points

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

Angular is an awesome framework. We all love it 😍

One thing that makes Angular successful and excellent at the same time is the vast community and the value it provides. There are a lot of Angular meetups, blogs, conferences, and of course, libraries.

Nowadays, thanks to the Angular CLI, libraries are easy to create. They are a great way to share code across multiple applications.

Since they can be used in many places, performance is a critical aspect. A library that doesn’t perform can slow down multiple applications!

In Frontend, there are different types of performance. Runtime performance and initial load. In this article, we will focus on initial load.

While providing and maintaining various libraries and a UI framework for a big enterprise, I encountered some not so apparent pitfalls and ways to deal with them. 

[I think it’s worth sharing some of those experiences.](https://medium.com/angular-in-depth/improve-spa-performance-by-splitting-your-angular-libraries-in-multiple-chunks-8c68103692d0)
Singly Linked List: A Python Implementation | Part 2 | __str__ Method
Tags: python, computerscience
Published: 2019-11-26 15:48:59

In the [previous post](https://dev.to/erikkristoferanderson/singly-linked-list-a-python-implementation-4cm6), I started by making a Node class.

I also included an `__init__` method, to make it easier to instantiate Nodes, and to ensure that each Node has the same attributes.

I then created and printed a node in the following way:
```python
my_node = SLLNode(7, None)
print("Node with value {} and next node {}.".format(my_node.value, my_node.next_node))
```
That worked, but wouldn't it be nice if we could do something like `print(node)`?  
It turns out we can. We just need to define a `__str__` method.  
The definition looks like this:
```python
# indented within class SLLNode
    def __str__(self):
        s = "Node with value {} and next node: {}.".format(self.value, self.next_node)
        return s
```
The method `__str__` works under the hood when we call `print(my_node)` and creates a string representation of `my_node`.  
Let's test it to make sure it's working.
```python
my_node = SLLNode(8, None)
print(my_node)
```
And the output is:
```
Node with value 8 and next node: None.
```

Now, you may have noticed that there is a potential bug lurking under the surface. How will `__str__()` function when a Node points to another Node? Let's find out.
```python
second_node = SLLNode(27, None)
    first_node = SLLNode(14, second_node)
    print(first_node)
```
Here's the output:
```
Node with value 14 and next node: Node with value 27 and next node: None..
```
Do you see what happened? It might help if I insert some extra formatting into the output, like so:
```
{Node with value 14 and next node: {Node with value 27 and next node: None.}.}
```
Turns out `__str__` got called recursively; it used `__str__` again and called it on the `second_node`. This isn't necessarily the behaviour we want, because as the list gets longer the output could be really long and cumbersome to read.  
I honestly wasn't expecting this. (I did this previously in java, and it behaves a little differently in this regard).  
How will we get past this bug? Stay tuned!

The code for this project is available [here on GitHub](https://github.com/erik-kristofer-anderson/singlylinkedlist). I'll be updating it gradually as I write this series. I'll be sure to commit at least as often as I post, so you can back up and see that code as it was when I published a given post.

[EDIT]: The next post is now available [here](https://dev.to/erikkristoferanderson/bug-squashing-a-singly-linked-list-python-implementation-part-3-5733). Also, it just occured to me that these posts are themselves effectively a linked list. Meta!
What to do after you got banned from google Adsense Network?
Tags: tech, academy, techacademy, lovegraphist
Published: 2019-11-26 15:42:39

Banned From Adsense: What Happened?

I got the standard message from Google, which you can read here, but says: “we’ve determined that your AdSense account poses a risk of generating invalid activity”.  These are the only details given, no specifics.  Here is the email I received:
From custom error types to a custom error subtype
Tags: javascript, node
Published: 2019-11-26 15:39:28

[Previously](https://dev.to/lvidakovic/custom-error-types-in-node-js-491a) we defined our most basic custom error class that extends the Javascript's Error prototype:

```javascript
class MyError extends Error {
  constructor(message) {
    super(message)
    this.name = 'MyError'
    Error.captureStackTrace(this, MyError)
  }
}
```

Now let's create an error subtype that will be used to indicate certain failures for a few well known HTTP response states. **MyError**  class and error name will be renamed to a more generic name that goes along with the context of an HTTP server — **HttpError**.

To keep it short, we'll pick only 3 commonly encountered HTTP status codes and create custom errors for them.

**constants/httpResponseCodes.js**

```javascript
module.exports = {
    BAD_REQUEST: 400,
    NOT_FOUND: 404,
    INTERNAL_SERVER_ERROR: 500,
}
```

**utils/errors.js**

```javascript
const responseCodes = require('../constants/httpResponseCodes.js')

class HttpError extends Error {
  constructor({ message, name, statusCode, data }) {
    super(message);
    this.name = name;
    this.statusCode = statusCode;
    this.data = data;
    Error.captureStackTrace(this, HttpError);
  }
}

class HttpBadRequest extends HttpError {
  constructor(message = 'Bad request', data) {
    super({
      message,
      name: "HttpBadRequest",
      statusCode: responseCodes.BAD_REQUEST,
      data
    });
  }
}

class HttpNotFound extends HttpError {
  constructor(message = 'Not Found', data) {
    super({
      message,
      name: "HttpNotFound",
      statusCode: responseCodes.NOT_FOUND,
      data
    });
  }
}

class HttpInternalServerError extends HttpError {
  constructor(message = 'Internal server error', data) {
    super({
      message,
      name: "HttpInternalServerError",
      statusCode: responseCodes.INTERNAL_SERVER_ERROR,
      data
    });
  }
}

module.exports = {
  HttpError,
  HttpBadRequest,
  HttpNotFound,
  HttpInternalServerError
}
```

We now have our custom error types and their subtype(*HttpError*), that will allow us to handle all of them in a generic way in the following post. A lot of code could be stripped down by using prototypal inheritance at a lower level. But it's not such a problem even if so verbose, it's very easy to follow through and the code probably won't change much once it's finished. There are libraries out there that make creating custom errors easier, but I like to have such a crucial part of the service completely independent and understandable.
Gatsby JS and Intro into JAM Stack event in New Delhi
Tags: gatsby, react, javascript
Published: 2019-11-26 15:35:43

Hello all javascript developers,
A Gatsby JS event will be happening on January 4, 2020. The exact location is yet to be decided but it will be in New Delhi, India. 
The event will be hands-on training on how to build and make your website up and running using Gatsby JS and Netlify. It will also cover the basics of react js for the beginners.
The event is totally free and the seats are very limited. It will be a first come first serve basis. So all are requested to mark their presence on the facebook page-
https://www.facebook.com/events/2251362491827762/

Once you've marked you will be receiving a confirmation email.

For more details- 

jyotishman82@gmail.com
Matt's Tidbits #44 - How to take great screenshots on Android
Tags: mattstidbits, android, tidbittuesday
Published: 2019-11-26 15:25:06

[Last time I wrote about using your phone’s sensors to add powerful behavior to your app.](https://medium.com/@matthew.b.groves/matts-tidbits-43-making-the-most-of-your-phone-s-sensors-691f8fe16a86) This week, I want to share a tip on how to take great screenshots on Android.

Yesterday, a coworker asked me how to take a screenshot on Android devices. Google’s official instructions say you should either:
- Press and hold the power button down until a “Screenshot” button appears, which you can tap to capture one.
- Press and hold the power and volume down buttons at the same time for a few seconds.

https://support.google.com/android/answer/9075928

It’s good to remember that this button combination may be different for different devices. And, you can always capture screenshots via Logcat within Android Studio too:
https://developer.android.com/studio/debug/am-screenshot

All of that being said, if you’re wanting to use these for presentation purposes, it can be difficult to make the screenshots look consistent, especially if you’re taking them over a period of time. Plus, nobody wants to see how many app updates or text messages you have in your screenshots.

Thankfully for us, Android has a “demo mode” which, with a few terminal commands, allows you to enforce a consistent and stripped down toolbar.

This article did a particularly good job of explaining how to make this happen:
https://android.jlelse.eu/clean-your-status-bar-like-a-pro-76c89a1e2c2f

The official documentation on using demo mode is available here:
https://android.googlesource.com/platform/frameworks/base/+/master/packages/SystemUI/docs/demo_mode.md

What useful protocols do you follow when taking screenshots? Share in the comments below! And, please follow me on Medium if you’re interested in being notified of future tidbits.

Interested in joining the awesome team here at Intrepid? [We’re hiring!](https://www.intrepid.io/careers)

*This tidbit was originally delivered on March 1, 2019.*
How do you stay focused in a distracted world?
Tags: discuss, watercooler
Published: 2019-11-26 15:20:06

*Photo: Sisyphus trying to read all its notifications*

I often feel that the hardest part of my programming life is to stay focused in a distracted world.

- Facebook, Twitter and a whole industry is working hard and smart to make us [Hooked notifications junkies](https://www.amazon.com/Hooked-How-Build-Habit-Forming-Products/dp/1591847788)
- [Group Chat is making me sweat](https://m.signalvnoise.com/is-group-chat-making-you-sweat/)
- Most of us are still working in Open Offices despite studies clearly pointing out that it's a false good idea.
- There are so much cool tools I could try out
- There are so much projects I could launch

How well do you cope with all of this?

Personally I have tried a lot things, and they help, but it still feels like a never ending battle.


Credits: The title is inspired by Cal Newport book

[Deep Work: Rules for Focused Success in a Distracted World](https://www.calnewport.com/books/deep-work/)
 
![](https://images-eu.ssl-images-amazon.com/images/I/51kzUUHhMTL._SY264_BO1,204,203,200_QL40_.jpg)

----

Thanks for reading and sharing your thoughts.

If you feel like it, please help me choose what I should write next.

{% link https://dev.to/jmfayard/help-me-choose-what-i-should-write-next-54b1 %}
How to setup Tailwind CSS with Parcel Bundler
Tags: css, tutorial, tailwindcss, javascript
Published: 2019-11-26 15:17:59

### Introduction
Hi all, this is Adi. Today, I wanted to share with you my experience of how I set up Tailwind CSS with Parcel Bundler, if this interests you continue reading.

I am a long time fan of Bootstrap since version 2, I have used it on nearly all my projects. Bootstrap 4 introduced many new utility classes that have made my life a little easier and my markup more readable. But lately, I have been hearing so much about the brand new CSS framework named [Tailwind CSS](https://tailwindcss.com/). I am quite confident that you might have heard about it as well. So I decided to give it a try, I read through their documentation and it was as though it was made for me (this framework is so generic, it will feel the same for anyone 😂).

First I tried it with the hosted version of the framework, it has so much flexibility. Now I wanted to take it a set further and see how I could set it up in my development flow. This is where things proved tricky. Their documentation had instructions for Webpack, Gulp, Laravel Mix and a bunch of other JS tools but not for the one I use [Parcel Bundler](https://parceljs.org/). It took me a while before I could get Tailwind to work with my existing Parcel setup.

**[Source Code Here](https://gist.github.com/skadimoolam/48d79be428cb6b479a741b3575fb74f3)**

### My Setup
First, let's add the new dev dependencies to your `package.json` file, you need `parcel-bundler`, `postcss-modules` and `tailwindcss`. Postcss is a css per-processor which Tailwind is built with.

![Step 1](https://i.imgur.com/dcywc75.png)
Next, create `postcss.config.js` in your project root file. This is the configuration for Postcss module, this will be used by Parcel during build. Also, if the NODE_ENV is set to production, we use `purgecss` module to compress and just have the classes we use in our markup, this process drastically reduces the final css file. This config is enough for us to get started. If you want to customize Tailwind refer to [this page](https://tailwindcss.com/docs/configuration).

![Step 2](https://i.imgur.com/Y9fP32u.png)
### Usage in Markup

In our html markup file, let's include css file. You'll notice that extension is `.pcss` this indicates Parcel Bundler to process that file with Postcss module. This file extension will be renamed to `.css` during the build process.

![Step 3](https://i.imgur.com/CCnIAyt.png)
In your `app.pcss` file include these three lines, this will include Tailwinds css classes, you can write normal css below these lines, that will also be included in the build output.

![Step 4](https://i.imgur.com/0V1zmeU.png)

### Conclusion
Tailwind has been growing on me, I am just getting used to its paradigm but I can see myself use it on my future work. That's about it, if you face any issues with this configuration, please comment, I will try to help.

> That’s all for now, this has been Adi.  
> If you need a Freelance Developer with Laravel knowledge you can [contact me](https://simplestweb.in/contact-me?utm_campaign=LaravelActionsTutorial).

**Thanks for reading.**
My reflections on Andela’s EPIC values
Published: 2019-11-26 14:54:49

**EPIC**,a word that you will hear alot at Andela. either you're on the the andela website,youtube channel or you're applying for a job at Andela. Andela's EPIC does not hold the same meaning as what you'll find in oxford dictionary but instead an abbreviation of four letters with meaning that make it so powerful that Andela is built on it.

**EPIC** in full means Excellence,passion,integrity and Collaboration.all these values represent andela's culture.

**E**- this stands for **excellence**.Andela expects you to be excellent at what you do.this means delivering high quality work that meets standards,being responsive to feedback and asking for help if needed.

**P**- this stands for **passion**.one needs to be passionate of or love  what he is doing which will help him excel at his work,Andela's direction is to change to change the world and positively impact a bigger community which requires hard work,passion and constant motivation.

**I**- this stands for **integrity**.this is not just about honesty.its about being trusted and responsible,from what i have experienced so far up the bootcamp 
is that one needs to own and understand his work.for example  when working on a project you should not copy paste other people's code or outsource it somewhere and pretend that the work is yours. Andela emphasizes on this a lot because at some point you will work with their partners and they should be sure they can trust you with a project they assign you to.

C- this stands for **collaboration**.collaboration is key to any team success.not just teams but also at work.you need to communicate effectively,treat others with respect and able to share your hard won knowledge.


These values should not just be limited to being used at Andela but should also be adopted in what we do for Us to grow as professionals and people.
Dunder Data Challenge #6 — Recreate the Tesla Cybertruck with Matplotlib
Tags: datascience, datavisualization, python, matplotlib
Published: 2021-12-06 14:09:46

---
title: Dunder Data Challenge #6 — Recreate the Tesla Cybertruck with Matplotlib
published: true
date: 2019-11-26 14:41:41 UTC
tags: datascience,datavisualization,python,matplotlib
canonical_url: 
---

### Dunder Data Challenge #6 — Recreate the Tesla Cybertruck with Matplotlib

In this challenge, you will recreate the [Tesla Cybertruck](https://www.tesla.com/cybertruck) unveiled last week using matplotlib.

[All challenges are available to be completed in your browser in a Jupyter Notebook](https://mybinder.org/v2/gh/DunderData/Dunder-Data-Challenges/master) now thanks to Binder (mybinder.org).

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

### Begin Mastering Data Science Now for Free!

[Take my free Intro to Pandas course](http://bit.ly/2NnFTev) to begin your journey mastering data analysis with Python.

### Challenge

Use matplotlib to recreate the image directly above.

#### Extra Challenge

Add animation so that it drives off the screen.

I’m still working on this challenge myself. My current recreation is below:

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

### Master Python, Data Science and Machine Learning

Immerse yourself in my comprehensive path for mastering data science and machine learning with Python. [**Purchase the All Access Pass to get lifetime access to all current and future courses**](http://bit.ly/34sIvOQ) **.** Some of the courses it contains:

- [**Exercise Python**](http://bit.ly/EP_Medium) — A comprehensive introduction to Python (200+ pages, 100+ exercises)
- [**Master Data Analysis with Python**](http://bit.ly/MDAP_M) — The most comprehensive course available to learn pandas. (600+ pages and 300+ exercises)
- [**Master Machine Learning with Python**](http://bit.ly/MMLP_M) ** ** — A deep dive into doing machine learning with scikit-learn constantly updated to showcase the latest and greatest tools. (300+ pages)

[**Get the All Access Pass now!**](http://bit.ly/34sIvOQ)

* * *
YPSKA #15 Curl
Tags: curl, networking, http
Published: 2019-11-26 14:39:45

[Curl](https://curl.haxx.se/), really? Well, I'm running out of topics that might not be that known, so I thought I'd recommend something that probably a large majority knows about. And I'm also a bit proud to come from the same country as the creator of curl, [Daniel Stenberg](https://daniel.haxx.se/). And finally, if there are junior developers reading this, it is possible that you never heard about curl before.

Curl is a network protocol tool. You can make all kinds of requests with curl, http, ftp, pop3, imap and the not so much used anymore Gopher. It's basically a swiss army knife for protocols.

So if you don't already have it installed already, go download it and start trying it out. You will find it useful.
Daily Challenge #125 - 23 Matches or More
Tags: challenge
Published: 2019-11-26 14:36:41

---
title: Daily Challenge #125 - 23 Matches or More
published: true
series: Daily Challenge
description: Create a bot to play 23 matches.
tags: challenge
---

There is a game called [23 Matches](http://ascii-world.wikidot.com/23-matches). In this game, there are 23 matches on the table. Each turn a player takes 1, 2 or 3 matches away. Player who takes the last match - loses. This will be a generalized version of the game. Here we have X matches and we can take up to Y matches away each turn.

Example: X = 13, Y = 4

There are X = 13 matches on table
Player 1 takes 1 match -> 12 left on table
Player 2 takes 4 matches -> 8 left on table
Player 1 takes 2 matches -> 6 left on table
Player 2 takes 3 matches -> 3 left on table
Player 1 takes 2 matches -> 1 left on table
Player 2 takes last match

Player 2 loses.

You're about to write a BOT to compete with my bot.

To do this - implement function createBot which accepts two arguments:

X - initial number of matches on table (20 <= X <= 1000)
Y - max number of matches to be taken away each turn (2 <= Y <= 19)
Your function must return an object of following structure:

<pre>
//example bot

let myBot = {
   name: "Optional name as string",
   makeMove: matchesStillOnTable => matchesToTake
}
</pre>
*Challenger Bot*
<pre>
const randomBot = {
      name: "Random",
      makeMove: onTable => Math.floor(Math.random() * 3) + 1
   }
</pre>
Your bot will always start the game. The game is always winnable for your bot - there won't be any cheap tricks or edgy corner cases.

Good luck!
***
_This [challenge](https://www.codewars.com/kata/5a9dbc735ee396ef590001de) comes from tiriana 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 idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_