teleren/devto huggingface dataset:
Road to Genius: beginner #6
Tags: javascript, beginners, computerscience
Published: 2020-06-10 12:06:37

Each day I solve several challenges and puzzles from Codr's ranked mode. The goal is to reach genius rank, along the way I explain how I solve them. You do not need any programming background to get started, but you will learn a ton of new and interesting things as you go.

In this post I will cover two challenges, because the first one is pretty short ;)

![programming challenge 1](https://dev-to-uploads.s3.amazonaws.com/i/f3259ybkd1a12o29baoi.png)

In the first challenge, we are given an array which we fill with numbers using a for-loop. At the end we compute the value for `R` by checking if 💰 includes the number 6. The task is to find what identifier 💰 is. But as I already spoiled, it's the array which we filled up. There, done!


![programming challenge 2](https://dev-to-uploads.s3.amazonaws.com/i/vnmenlot4y5ueybsss6i.png)

The second challenge is only slightly more complicated than the first one. There's a bit more code, but still peanuts to solve. The quest is to fix two bugs (💚 and 🐼), such that `R = 30`. The first several lines of code create an array `people` which consists of 4 objects. If you look at the members of these objects they are `name` and `age`, looks like the object is representing a person. Then we see there's a for-loop which iterates over all objects in the array, this line contains a first bug 💚, we can safely assume that 💚 should be the variable `person` because it is used below. Next, the if-condition checks if the person's name equals `ana`, if that is true, `R` gets the value of that person's age. If we look back at our array of people, the person named `ana` has age 30, as expected.

But hey, what about 🐼? In this scenario it's irrelevant what 🐼 should be, just make sure it's not `ana` to ensure that `R=30` is true.

---

![programming challenge 2 answer](https://dev-to-uploads.s3.amazonaws.com/i/55yhllzemh5tg89h1ms4.png)

If you feel inspired and motivated to upgrade your coding + debugging skills, join me on the Road to Genius at https://nevolin.be/codr/
MySQL Performance Tuning - Speeding up slow inserts
Tags: php, database, python, aws
Published: 2020-06-10 11:17:45

If you're running a write heavy application with a MySQL database you might notice a fairly significant slowdown as the write load on the server increases. In our case, we're running an event sourcing based service which is writing incoming events to read tables. Under heavy write load, simple inserts and updates with small payloads were pushing the 250ms mark. Here's how you can speed up those slow writes.

## Use a server backed by performant SSD storage
MySQL (with default settings) writes the log buffer to disk after every transaction. Under high load, this causes a ton of small writes which are particularly slow on traditional platter based hard drives. 

In our case, we had undersized the Amazon RDS instance disk size,  [which has a direct impact on write performance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html)  (higher capacity means more provisioned IOPS/write bandwidth). Increasing the disk size dropped out write average down about 50ms.

TL;DR: Make sure the disk for your server is as fast as possible

## Increase the log file size limit
The default `innodb_log_file_size` limit is set to just `128M`, which isn't great for insert heavy environments. Increasing this to something larger, like `500M` will reduce log flushes (which are slow, as you're writing to the disk). This is  particularly important if you're inserting large payloads.

In our case, bumping the log file size didn't actually help us much, since we had many smaller reads (not enough to overflow the log file frequently).

## Defer disk writes by flushing the log less frequently
By default MySQL will write the log to disk after every single transaction. In our case, it wasn't possible to wrap batches of inserts in transactions, so every single insert query was causing a disk write. 

You can instead write the log to disk at an interval by setting `innodb_flush_log_at_trx_commit` to `2`. The main issue with setting this away from the default of `1` is possible data loss. While you're still protected from MySQL crashes causing data loss, the entire server loosing power would mean potentially losing data. For example, if you have the flush interval set to the default of `1`, you could lose a seconds worth of writes upon failure of the server.

By setting `innodb_flush_log_at_trx_commit` to `2`, we were able to drop the insert time average from over 200ms to under 50ms. While this is a pretty massive improvement, it's possible to squeeze even more speed if you are willing to risk a  few more seconds of potential data loss.

You can increase the flush interval by setting `innodb_flush_log_at_timeout` to your desired interval (in seconds). In our case, we went with 5 seconds, which resulted in the insert time average dropping under 5ms! A massive difference from the original 250ms, and in our case worth the risk of 5 seconds of potential data loss.
What languages and tools do you use that spark joy?
Tags: discuss, career, productivity
Published: 2020-06-10 12:02:22

You may have heard of Marie Kondo, a Japanese Organization Consultant, she wrote a book called *The Life-Changing Magic of Tidying Up*. In the book she discusses her method of organising, which is known as the KonMari method, it consists of gathering together all of one's belongings, one category at a time, and then keeping only those things that "spark joy", and choosing a place for everything from then on. 

I think it could be a cathartic process for your digital life also, what if you gathered all of your digital "things" together, all of the languages, frameworks, libraries, and tools that you use, and decide what to keep from each category. What would you choose?

I think it's more important now than ever to review your "toolset" with this in mind. For your own well-being, you should remove things, keep the "joyful", and slowly add more. There is such a proliferation of new tech, this is a decision you need to take again and again, so it is important to have a good ethos for your personal life and career.
Daily Developer Jokes - Wednesday, Jun 10, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-06-10 12:00:23

---
title: "Daily Developer Jokes - Wednesday, Jun 10, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Wednesday%2C%20Jun%2010%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125970d9ec2.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What is a pirate's favorite programming language?

___A:___ You'd think it was R, but a pirate's first love is Objectively C.
 -->
To test or not to test - that's not a question
Tags: testing, automation, codequality
Published: 2020-06-10 11:00:18

Hello community. 

I just read one post about test automation and decided to share my opinion about that. 

{% link https://dev.to/boyney123/to-test-or-not-to-test-that-is-the-question-ml3 %}

*Should you write tests?* - Yes, if you are skillful enough to write valuable tests.

## Manual vs Automation

You anyway have to hire someone to test things manually, to write test cases etc. And that person must test things periodically, repeatable, before and after deployment. 

Test cases are necessary for both manual and automation tests. E.g. [Gherkin](https://cucumber.io/docs/gherkin/reference/). This means that your manual tester is already doing the ~half of the automation work.

## Why you must write tests

IMHO the purpose of tests is to avoid bug leakage as much as possible.  Test automation is for both developers and QA engineers. For example,  pre-commit or pre-push git hook can run and pass or fail tests and  help to avoid bug leakage by preventing a buggy code to be pushed and deployed. 

## No apologies

If your customer will leave you a feedback that your software has tone of bugs and is totally unusable, you obviously not going to share details about your company size or number of customers to "prove" him/her that you don't need a better quality because you're not large enough.

## Probably "Yes"

My point is that as far as test automation **helps** to avoid bugs by preventing them, then the real answer to the question about the need of unit, integration and e2e tests, is **probably yes**. 

## Refactoring

Another question is the refactoring. 

Why do you think there are projects still running on 10 years old frameworks? Because nobody wants to upgrade a large and legacy system that doesn't have test coverage. 10 years ago those projects were "small startups, that don't need test automation yet".

## The Test Coverage

I said that automated tests are to prevent bug leakage. Not only...

Test automation also helps you to read a code. The test describes the usage of specific library/class/function.

If my colleague will deliver me a new component to work with, that has a test coverage, I'll simply look at unit/integration tests and won't disturb him anymore. Otherwise he'll need to spend a lot of time explaining me what the hell did he implement. And maybe not only to me, and not only once. Would be better if he spend that time to write a clear tests for everyone.

So... **another purpose of test automation is to save our time!**

## Resume

I understand that in reality you have to do a lot of analysis about priorities, about the budget, about staff etc. But anyways, I think that test coverage must be a top priority of the QA team/department, even if QA team/department includes just 1 person.

*The lack of test coverage will not make your product better.*
SignalR ERR_CONNECTION_REFUSED Using ASP.NET Core 3.1 (make sure server is up)
Tags: angular, signalr, aspnetcore
Published: 2020-06-10 11:55:38

When the scaffolding for both client and server is set up for SignalR.  The first thing on the client side is to attempt to connect to the Hub.

**Negotiate Error**

Our first attempt to connect to the server hub.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8l5r7euet9gyikbxzrhf.png)

**Analysis**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/21owpvryr29x7q1m29nh.png)

 
```javascript
//But chrome showed this

Request URL: https://localhost:8081/Hub/ClientStatus/negotiate

Response: XHR negotiate (failed) ERR_CONNECTION_REFUSED	xhr

```
The root cause of this days long error was that you cannot use the old signalr client libraries found in ASP.NET.  

```javascript
// do not use this one in a .net core application!
npm i @asp.net/signalr
// Use this one.
npm i @microsoft/signalr
```
OR

Make sure your server is up an running. If negotiation attempts show red, nobody is responding! 

JWP2020 npm i @microsoft/signalr
Simple dynamic resume with Django
Tags: python, django
Published: 2020-06-10 11:17:32

After yet another rebuilt my site and putting on it new dynamic content I've decided to write a small article and put some notes about what I've done. 

Feel free to read, share and comment. I hope it will be helpful at least for someone.

https://www.sdyachok.com.ua/blog/2020/6/4/simple-dynamic-resume-django.html
Download scalable code right from "a kida CodePen on steroids" – new release!
Tags: javascript, webdev, showdev, news
Published: 2020-06-10 11:00:29

I have something exciting for you. But first some background for whose who don't follow me yet :smiley:.

>
Imagine you can quickly prototype UI with HTML, add few attribute directives and boom! :bomb: You didn't touch JavaScript yet but you already have a working app. Actions are generated and they use data you wrote in HTML. E.g. what you have in your LI tags becomes an action which returns an array of objects. When you're done with coding, you can download stand-alone code, run docker-compose up and you can keep changing it as you wish. It uses Webpack, Babel and all other open source goodies.
>

**Well, you don't have to imagine it** – it's happening! You can try it out here: [demo](http://gluecodes-demo.s3-website.eu-west-2.amazonaws.com/ide.html?appId=1&edit=page&id=index). It's a show case implementation of TodoMVC app.

![How to download](https://dev-to-uploads.s3.amazonaws.com/i/ni44y3a2cxvf7b2g20fn.png)

What you'll see is a simplified frontend development environment which takes loads of self-discipline off you when delivering production web apps. It lets you focus on writing UI, mocks actions as you type and tells you which need to be implemented e.g. to pull data from an API. Under the hood it uses Virtual DOM and simple uni-directional state management, so w're not talking spaghetti code. 

Even though it's still a prototype, it'll give you the taste of what we're trying to achieve. These are some of the benefits:

- clean, scalable code
- faster and simpler prototyping
- multi-lingual-ready out of the box
- built-in prerendering for better SEO
- fast-loading pages

There is much more to come. As we want this tool to be "fully battery charged", there will be components which you'll be able to simply inject into code, desktop version of the IDE and many more.

In the future posts, I'll be explaining the generated code-base in more details.

If you like it and want to help, give me :heart: or :unicorn:, follow me here on dev.to and [twitter](https://twitter.com/ChrisCzopp). Give this [repo](https://github.com/gluecodes/gluecodes-framework) a :star: so we're visible on GitHub. For more info visit this [website](https://www.glue.codes). 

Wanna contribute but don't know where to start? – email me: chris@glue.codes.

Also read my previous articles which explain major features of [GlueCodes Platform](https://www.glue.codes)
What traits or actions would make a Fantastic co-worker in tech?
Tags: motivation, developer, beginners
Published: 2020-06-10 10:58:13

---
title: What traits or actions would make a Fantastic co-worker in tech?
published: true
description: Curated answers to a question from the Code Connector community Slack channel.
tags: #motivation #developer #discuss #beginners
//cover_image: https://direct_url_to_image.jpg
---
1. Always willing to help and share knowledge.

2. Someone who leads by example even when they are not a leader. Being willing to go above and beyond just because that is what a good human being should do.

3. Is Focused on The Goal. Team members that have a clear recognition of the org's Goal and a vision of how they align with and contribute to it. They don't hide their technical knowledge because that business humility means they aren't putting themselves above the Goal. They aren't afraid to admit when they're wrong, or when they don't know something, because being wrong or failing is still a step on the path towards the Goal.

4. The person who makes others better. Someone who exhibits servant-leadership before they have the leadership title.

5. Someone who enjoys learning and talking about new things.

6. Open to ideas and discussions.

7. Ask questions when they need help and gets things done as a result.

8. https://theagilecouch.com/2020/05/22/on-good-coworkers-business-humility/

Contributors:  Corey McCarty, Steve Hallman MBA, CAPM, PSM, PSPO, PAL, Danny Thompson, Dennis Kennetz, Birenderjit Madan, Lawrence Lockhart

[Code Connector](https://codeconnector.io/) is a non-profit that's organized tech meetups to help people start their journey into tech. You can join our daily conversations by clicking this link: [Code Connector slack channel](https://bit.ly/2Ywnzqc).
Stack Online Training
Published: 2020-06-10 10:47:08

Offers <a href="https://www.excelr.com/business-analytics-training-in-bangalore">Data Analytics course</a>, with coding challenges, and real-time projects in Python and R.There are many institutes providing knowledge science course in Hyderabad, you have to choose the one which gives you sensible exposure. A brand new world of job alternatives awaits you in Data Science & this is the appropriate time to step-into the job market of Information Science. Information Science Training In Hyderabad at the Orien IT training institute is providing one of the best & extremely endowed training in Data Science with the wonderful teaching methods to make the aspirants grow to be professionally nicely-skilled Knowledge Science specialists.

This course allows candidates to obtain an in-depth information by laying a strong foundation and protecting all the latest knowledge science subjects. They are also capable of planning and creating an acceptable working surroundings for Knowledge Science workloads on Azure, training predictive fashions, deploying machine studying models into production and plenty of more.

Many individuals around the globe are trying to change their major to knowledge science course on account of their hovering enterprise and significance within the business. Knowledge Science is an evolving subject and Python has change into a required ability for forty six-% of jobs in Knowledge Science. We grew from the combined expertise and commitment of a group of information science and massive information professionals.

As knowledge scientists maintain major worth in companies due to their threat calculating techniques and figuring out the rising trends, this has turn out to be probably the most wanted job. As part of their job-role, they should handle the top-to-finish Azure Machine Learning Services. Our Data Science Training In Hyderabad course timings and schedules are very much versatile for each job seekers and working professionals.

Through our Knowledge Science Coaching In Hyderabad, we form our students in the direction of changing into full Knowledge Science industry ready experts by the point of their course completion. Information Science coaching online includes a number of constituent elements, and the Intellipaat courses provide the most complete and in-depth learning experience.

We are located at : 
Location : 
ExcelR - Data Science, Data Analytics Course Training in Bangalore
49, 1st Cross, 27th Main BTM Layout stage 1 Behind Tata Motors Bengaluru, Karnataka 560068
Phone: 1800-212-2120/ 070224 51093
Hours: Sunday - Saturday 7AM - 11PM
The Development Server Reutrned Error Code 500 React Native
Tags: javascript, android, reactnative
Published: 2020-06-10 10:40:21

The Development Server Returned Error Code:500 React Native

***App.js
import React from 'react'
import{StyleSheet,Text,View}from 'react-native'
import RegForm from '.app/Components/RegForm'
export default class App extends React.Component{
  render(){
    return(
      <View style={Styles.Container}>
        <RegForm />
      </View>
    )
  }
}
const styles=StyleSheet.Create({
  container:{
    flex:1 ,
    justifyContent:'center',
    backgroundColor:'#36485f' ,
    paddingLeft:60 ,
    paddingRight:60 ,
  },
})
***RegForm.js***
import React from 'react'
import{StyleSheet,Text,View,TextInput,TouchableOpacity}from 'react-native'

export default class RegForm extends React.Component{
  render(){
    return(
      <View style={Styles.RegForm}>
        <Text style={styles.header}>Registration</Text>
        <TextInput style={styles.TextInput} placeholder="Please Enter your Name" />
        <TextInput style={styles.TextInput} placeholder="Please Enter your Email" />
        <TextInput style={styles.TextInput} placeholder="Please Enter your Password"
        secureTextEntry={true} />
        <TextInput style={styles.TextInput} placeholder="Please Enter your Mobile No" />
        <TextInput style={styles.TextInput} placeholder="Please Enter your CNIC" />
        <TouchableOpacity style={styles.button}>
        <Text style={styles.btntext}>Sign Up</Text>
        </TouchableOpacity>
      </View>
    )
  }
}
const styles=StyleSheet.Create({
  RegForm:{
    alignSelf:'strech' ,
  },
  header:{
fontSize:24 ,
color:'#fff',
paddingBottom:10 ,
marginBottom:40 ,
borderBottomColor:'#199187',
borderBottomWidth:'1',
  },
  TextInput:{
      alignSelf:'strech',
      height:40 ,
      marginBottom:30 ,
      color:'#fff' ,
      borderBottomColor:'#f8f8f8',
      borderBottomWidth:1 ,
  },
  button:{
      alignSelf:'strech',
      alignItem:'center',
      padding:20 ,
      backgroundColor:'#59cbbd',
      marginTop:30 ,
  },
  btntext:{
      color:'#fff',
      fontWeight:'bold',

  }
})
Google's New PageSpeed Measures in Plain English
Tags: webperf, webdev, pagespeed
Published: 2020-06-10 10:31:28

With [Lighthouse 6.0](https://web.dev/lighthouse-whats-new-6.0/), Google introduced a few new Site Speed measures (also known as [Web Vitals](https://web.dev/vitals/)). You can see these when you run PageSpeed tests & how they affect your PageSpeed / Lighthouse score.

This post is a jargon-free & simple description of these measures:

### Cumulative Layout Shift
Remember the last time you tried to click a link & the link changed it’s position. And, this caused your click to land you on a different page? This metric addresses such experiences.

![Cumulative Layout Shift](https://dev-to-uploads.s3.amazonaws.com/i/o9oqr1d6jln9sqcmxryw.png)


### First Input Delay
Remember when you tap a button, link or text-box as the page is loading and nothing seems to happen forever? This metric addresses such experiences.

![First Input Delay](https://dev-to-uploads.s3.amazonaws.com/i/ag0lnhai7qogd8i2cfqv.png)


### Largest Contentful Paint
The time when the largest visible content element on screen is fully displayed.

![Largest Contentful Paint](https://dev-to-uploads.s3.amazonaws.com/i/w5eepchbmnvm26wykp07.png)

To understand the above metrics in greater detail, check [this](https://web.dev/vitals/) Google web.dev article.

Your feedback, thoughts & opinion on the above are welcome.