teleren/devto huggingface dataset:
How to make your data class properties immutable
Published: 2020-02-04 12:43:37

With `data` modifier, you can easily create data holder class with Kotlin.

```kotlin
data class User(val name: String, val age: Int)
```

You can instantiate the data class like this:

```kotlin
val person = User("Mohandas Karamchand Gandhi", 78)
```

Because declared with `val` , these properties could not be reassigned.

```kotlin
person.age = 79 // syntax error
```

So you may want to change `val` to `var` , like this.

```kotlin
data class User(val name: String, var age: Int) // unsafe
```

But this is not safe, because the value may be changed from anywhere.

So in this case, using `copy` from data class is safer. With named arguments with `copy` you can update data class properties.

```kotlin
var person = User("Mohandas Karamchand Gandhi", 78)

person = person.copy(age = 79)
```
The Computer Language Benchmarks Game
Tags: softwaredevelopment, performance, python, javascript
Published: 2020-02-04 12:30:01

---
title: The Computer Language Benchmarks Game
published: true
description: Benchmarks of the top programming languages
tags: software development, performance, python, javascript
---

![velocity illustration](https://dev-to-uploads.s3.amazonaws.com/i/mxyv8sd8kwwbg5q28diy.png)

An interesting resource for people that care about performance and efficient resource utilization or just for the curious is [The Computer Language Benchmarks Game](https://benchmarksgame-team.pages.debian.net/benchmarksgame). Some interesting history about it [here](https://benchmarksgame-team.pages.debian.net/benchmarksgame/sometimes-people-just-make-up-stuff.html).

Two benchmarks that I found useful in the past is the [Go versus Python 3 benchmark](https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/go-python3.html) and the [Go versus NodeJS benchmark](https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/go-node.html), those were part of the reasons why I started using [Golang](https://golang.org/) for my projects.

What do you think about it?

Follow me here on the Dev Community,
and on Twitter: https://twitter.com/carloslfu

Have a good day :)
Introduction
Tags: intro, tldr
Published: 2020-02-04 12:20:04

---
title: Introduction
published: true
description: Small Intro
tags: Intro, TLDR
---

Hello Dev.to community.

Few months back I came across Capture the Flag.
Did a few challenges there and then after one day of work I stopped.
Now I am trying to remember the login I used to solve challenges back then, but am unsuccessful in doing so.
ship faster with one git config
Published: 2020-02-04 12:29:47

---
title: ship faster with one git config
published: true
date: 2020-02-04 12:18:00 UTC
tags: 
canonical_url: https://waylonwalker.com/blog/git-push-without-setting-upstream/
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/jviswjl5qqlc4w219bm9.png
---



Finally after years of hand typing out a full `git push --upstream my\_really\_long\_and\_descriptive\_branch\_name` I foudn there is a setting to automatcally push to the current branch. More realisitically I just did a `git push` let git yell at me, and copying the suggestion.

```
git config --global push.default current
```

This one setting will now `git push` to the current branch without yelling at you that your upstream does not match your current branch.
Video Games and Programming
Tags: motivation
Published: 2020-02-04 12:13:27

**NOTE:** I use "I" in this post on purpose. I am not dissing video games or those who play them. Video games are a perfectly [cromulent](https://www.youtube.com/watch?v=FcxsgZxqnEg) leisure activity. I only believe they are not for me, at least right now.

In my previous post, **My Journey into Development** I made two points:

>1. I can't make a career playing video games.
>2. I don't get a real sense of satisfaction from beating a video game.


Two months ago, I put some serious time into Fallout 4 which allowed me to reflect on that.

I played on Very Hard and Survival because I knew the game pretty well from let's plays and wanted a challenge. I enjoyed the challenges. I enjoyed exploring and learning the game mechanics and improving my own skills.

But every time I closed out of the game, I felt empty. My thought was, "I should have been coding instead."

**Why?**

Because video games are currently just an escape when I could be working towards my goal of becoming a professional developer (fancy phrasing for being paid to write code).

I could create a let's play channel and potentially get popular enough to make that my full-time career. But even if that happened, I wouldn't want it. I don't like performing and being "on" to that extent.

So, presently, distracting myself from starting my career in development isn't good for me.

But I also don't feel a sense of accomplishment from it. I didn't help anyone. My favorite things I've done and built are projects that someone has benefited from. My coding contributions at my current company stand out to me for precisely this reason.

Programming gives me the same challenges and dopamine hits as video games, but there is a real world consequence to the things I build or help build and maintain.

I also can't ever master programming. Unless it relies on my reflexes, I am generally able to master every game I play. That ends up being quite boring. With programming, I'll never learn it all, I'll never master it all. The world of computer science is huge and constantly expanding.

So at least for the rest of 2020, I want to maximize my time coding and minimize my time playing video games.
ARCore Cloud Anchor Testing
Tags: augmentedreality, arcore, cloudanchors, googlecloudplatfor
Published: 2020-05-10 12:36:38

---
title: ARCore Cloud Anchor Testing
published: true
date: 2020-02-04 11:52:18 UTC
tags: augmentedreality, arcore, cloudanchors, googlecloudplatfor
canonical_url: https://medium.com/@mat_wright/arcore-cloud-anchor-testing-8c6610827142
---

[![](https://cdn-images-1.medium.com/max/1800/1*B0ioY04TRraymyEyZXvQ6w.jpeg)](https://medium.com/@mat_wright/arcore-cloud-anchor-testing-8c6610827142?source=rss-8818e5bb5014------2)

A walkthrough of testing cloud anchors with a barebones app

[Continue reading on Medium »](https://medium.com/@mat_wright/arcore-cloud-anchor-testing-8c6610827142?source=rss-8818e5bb5014------2)
4 videos on angular optimization
Tags: webdev, productivity, angular, typescript
Published: 2020-02-04 11:43:40

> How to increase the angular application performance in 5 minutes!

I've been [talking](https://efficientuser.com/talks) to (and also learning from) various local web development community on angular, C#, HTML, etc.

I have made 4 short videos on angular optimization. Each video lasts upto 5 minutes.

Please do watch, share your feedback and [show some](https://youtube.com/efficientuser) :heart:

## Angular Performance Optimization #1 — using pipes
 {% youtube Bzoy3TAW85M %}
 {% stackblitz angular-a8hkbe %}

## Angular Performance Optimization #2 — trackBy function
 {% youtube 7MqMyoxMaW4 %}
 {% stackblitz angular-trackby-cool %}

## Angular Performance Optimization #3 — AOT compilation
 {% youtube L_n6CIkpTQQ %}

## Angular Performance Optimization #4 — memoize
 {% youtube jfjU1owYxc8 %}

Photo by [rawkkim](https://unsplash.com/@rawkkim?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com/?utm_source=medium&utm_medium=referral)

> Please do follow the profile to get more updates in future.
Creating a simple express server in node
Tags: javascript, node, npm
Published: 2020-02-04 11:22:35

### <u>Using express web framework to create a simple server</u>.
Express is a lightweight web framework for developing web apps
using javascript's runtime environment,node.

Here,I will show you how to create a simple server with express.
First we will install express using npm. 

>npm i --save express

Now we create the server.

```javascript
//import the express module
const express = require("express");
const app = express();

//set the port number to listen on
app.set('port',process.env.PORT || 8080);

//create a callback for listening on the server 
app.listen('port',()=>{
    console.log(`Listening on port ${app.get('port')}.Press CTRL Z to cancel.`);
}):
```

In the next post,I will show you how to set up a templating engine
to handle your layout pages.

Have bug-free day!
JSON Collection to CSV
Tags: codepen, javascript, webdev
Published: 2020-02-04 10:52:35

> _The code pen you are about to see was originally created as part of an [article](https://blog.logrocket.com/programmatic-file-downloads-in-the-browser-9a5186298d5c/) I published on the [LogRocket](https://blog.logrocket.com/) blog._

**Here is a breakdown of what the code pen is about:**

- Fetch an array collection of JSON objects from an API (photos from the [Picsum Photos API](https://picsum.photos/)).
- Filter the photos based on image type and dimensions.
- Extract selected fields from each photo item in the array collection.
- Reformat the extracted data as CSV (comma-separated values) string
- Download the generated CSV file on the browser.

**The goal is to do all the operations listed above using just Web APIs.**

{% codepen https://codepen.io/gladchinda/pen/GemGNG %}

### Show some love ❤️

- **Like** this post
- **Comment** your feedback
- **Share** with someone
- **[Follow me](https://twitter.com/gladchinda)** on Twitter
How to implement Dark Mode with CSS new media call: prefers-color-scheme
Tags: webdev, tutorial, beginners, design
Published: 2020-02-04 10:36:21

Dark Mode UI Toggle: Tutorial using CSS prefers-color-scheme
{% youtube X3srTmAfztY%}

Toggling Dark Mode with the functionality of the operating system by using the new CSS variable prefers-color-scheme is awesome. Check out how to swap between dark mode and light mode by adding in media queries which check what the operating system is currently set to. We update our HTML UI Design on the fly and can make changes within minutes to the website design. If you want to implement dark mode for your website, the development is easy now!

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Staying Motivated to Learn Programming](https://dev.to/adriantwarog/staying-motivated-to-learn-programming-546b)
* [Why you should Whiteboard your Design & Development, UI & UX](https://dev.to/adriantwarog/why-you-should-whiteboard-your-design-development-ui-ux-5g12)
* [How to start using Styled Components for React Native](https://dev.to/adriantwarog/how-to-start-using-styled-components-for-react-native-5don)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
I just released a new sticker app "Latest funny stickers for Whatsapp"

Tags: android, whatsapp, stickers
Published: 2020-02-04 10:08:29

I am very excited to announce that I have designed and developed a new app for android. It is a funny stickers app for WhatsApp with over 30 sticker packs and 500+ stickers. 

You can download it from here: https://play.google.com/store/apps/details?id=com.funnystickers.best

Looking forward to your review
#1 Live Kata Report
Tags: javascript, sort, array, regex
Published: 2020-02-04 09:57:56


---
title: #1 Live Kata Report
published: true
description: Report of the #1 live coding session.
tags: JavaScript, Sort, Array, Regex
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y4v4d8wl6pitjcbpuwav.jpg
---
#1 Live Kata Report

With the JS Learning community I am running we use to solve "JS Katas" together during "live coding" sessions.
I'll use this blog to share the "Live Kata" reports.

We solved together a "kata" found on "CodeWars.com".

# Key takeaway points:
• Learn how Array.prototype.sort() works
• Learn how to write compareFunction for Array.prototype.sort() 
• Learn how to match digits in a string with RegEx 

# Docs:
• A [website full of katas](https://www.codewars.com/) 
• [Regex sandbox](https://regex101.com/)
• [Array sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) 
The Kata is the following:

# Requirements:
Your task is to sort a given string.
Each word in the string will contain a single number.
This number is the position the word should have in the result.
Note: Numbers can be from 1 to 9. So 1 will be the first word (not 0).
If the input string is empty, return an empty string. The words in the input String will only contain valid consecutive numbers.

# Example
"is2 Thi1s T4est 3a"  -->  "Thi1s is2 3a T4est"
"4of Fo1r pe6ople g3ood th5e the2"  -->  "Fo1r the2 g3ood 4of th5e pe6ople"
""  -->  ""

# Our solutions
## Solution 1
```js
function doKata(ex) {
  const arr = ex1.split(' '); 
  const parsedArr = [];
  
   arr.forEach(function(s) { 
    const index = s.match(/\d/) - 1; 
    parsedArr[index] = s; // parsedArr[1] = "Thi1s";  parsedArr[2] = "is2";  
  });

  return parsedArr.join(' '); // "
}
```

## Solution 2
```js
function doKata(ex) {
  return ex.split(' ').sort(function(a, b) {
    a.match(/\d/) - b.match(/\d/)).join(' ');
  }).join(' ');
}
```

Thank you all and see you next week :)
 
## About this post
I'm am running a **free** **JavaScript Learning Group** on [pixari.slack.com] and I use this blog as official blog of the community. 
I pick some of the questions from the #questions-answer channel and answer via blog post. This way my answers will stay indefinitely visible for everyone."

If you want to [**join the community** feel free to click here](https://join.slack.com/t/pixari/shared_invite/enQtOTA5MzE0NzcwNzI3LTM5OGQ5MzNkMDA3ZTNkNTNmMmI4NTM5MGRiY2RiMDEyOGE0NGM3M2M3M2Y2NTNjNzZlMTY2NTY5ZmQwM2ZhZjk) or contact me: 

 - [@pixari on Twitter](https://twitter.com/pixari)
 - [raffaele.pizzari@gmail.com](mailto:raffaele.pizzari@gmail.com)
Chrome 79 Update Covers 51 vulnerabilties | Hacked Password Alarm
Tags: chrome79update, chromeupdate, cve201913720, cve201913721
Published: 2020-02-04 09:28:26

Clients of Google's Chrome internet browser are being encouraged to introduce the most recent update quickly to fix two security vulnerabilities, one of which is as of now being abused in nature.
**[>>> Subscribe YouTube Channel] (http://bit.ly/2lSE3r6)**
the two high seriousness vulnerabilities are known as **CVE-2019-13720** and **CVE-2019-13721** and classed as **"use-after-free"** vulnerabilities.
**Chrome 79** patches **51 vulnerabilities** and its Password Checker will currently alert clients when a website secret key may have been uncovered. The component is being turned out step by step to Chrome clients.
{% link https://dev.to/anjankant/asp-net-web-api-interview-questions-and-answers-3kk6 %}
##Your password is kaput##
Google heated the usefulness of its Password Checker into Chrome 79 with the goal that when the component is empowered, the program will caution its client if an entered secret word has been uncovered by an earlier information break.
##Fighting phishers##
Safe Browsing, a Google-made innovation, cautions when a client steers toward a website that may contain malignant substance. (The term is additionally applied to the API Google makes accessible to other program developers; for example, Mozilla depends on the Safe Browsing API to caution Firefox clients about hazardous sites.)
{% link https://dev.to/anjankant/visual-studio-learn-free-webscriping-in-easy-10-steps-data-mining-htmlagilitypack-linq-618 %}
##Wrapping Up##
The most recent form of Chrome discharged today to fix the security vulnerabilities is variant **78.0.3904.87** and it's accessible for **Windows, Mac, and Linux**. The update ought to show up consequently, yet in the event that it hasn't sprung up yet you can physically apply it by exploring to **Help** - > **About** Google Chrome in the program menu. Once introduced, the risk is killed and you can keep on utilizing Chrome as ordinary.
[>>> Source Article 1 &#8594;](https://in.pcmag.com/news/133610/use-chrome-update-your-browser-immediately)
[>>> Source Article 2 &#8594;](https://www.computerworld.com/article/3211427/whats-in-the-latest-chrome-update.html)
Technical Debt in TicTacToe (Estimating 1.5)
Tags: refactorit, ruby, tdd
Published: 2020-02-04 09:18:16

Game's working pretty well, you can play a 3x3 and win, just need to start abstracting this single class into a few and...ah. That's not good.

Following on from my previous post about estimating, a good early lesson to learn has come up, namely 'plan early, abstract early, refactor early'. Not exactly a catchy acronym, but I've discovered how long it takes to separate basic functionality in a small TicTacToe game.

Tests suddenly indicate nothing, so if you went for functionality now and abstraction later, you're almost back at square one as far as test-driving goes. Trying to refactor small so that it still works also means that meaningful change and better design are harder.

The whole game was set back hours as working solutions were torn apart to become new problems, and while they are problems that can be solved with time, time is always the issue.

**Lesson for the Future**

Like I said; plan early, abstract early, refactor early. That way, if big changes happen, there are at least fewer of them.
Intro to CSS Variables
Tags: css, codenewbie
Published: 2020-02-04 07:03:07

In CSS you can use variables to store information and reference it later in your app using the variable name. This make writing CSS a lot easier because, it cuts down on having to type the same things over and over when you need to make changes in multiple places.

## Declaring CSS variables

You can declare a css variable inside of any CSS declaration block `{}` type `--variable-name` as the property, then set the value. We'll use red.

```css
body {
    --main-color: red;
}
```

## Using CSS variables

To use a CSS variable you need the `var()` function. Type `var(variable-name)` inside of the declaration block you want to use the variable on. 


```css
button {
    color: var(--main-color)
}
```

This is useful because now anywhere you need to change the `main-color` you change it once and it changes everywhere `main-color` is referenced. Without CSS variables you would have to go and change each red color manually. 😫

## CSS Variable Scope

The CSS selector that you add the variable on, is available for all the children of that element. For example, a variable inside a `<div>` will be useable by all the elements inside that `<div>`. 

CSS variables are based on CSS specificity and the most specific selector used will be the one that shows in the browser.

For example in this code:

```css
body {
    --main-color: red;
}

header {
    --main-color: blue;
}
```

Any element that uses `main-color` outside of `header` will be red. Any element that uses `main-color` inside of `header` will be blue.

Here is example here you can experiment with on codepen

{% codepen https://codepen.io/willjohnsonio/pen/yLNBYeE %}
[TIL]  Debugging external gem in Ruby 
Published: 2020-02-04 09:12:31

Sometimes there comes a time where an external gem that you installed is not behaving as expected. It was not until a week ago that i learned from my colleague that you can actually open the gems to inspect the code inside the gem and debugging it using a debugger. 


Firstly, you can open the gem by running.

```ruby
bundle open countries
```

Identify the part of the code which you wish to debug. For example i would like to understand why a method in the  gem 'countries' is not returning values as expected. 

Start inserting calls to debugger in places you expect it to call. 

```ruby
require 'byebug'

module ISO3166
  class Country
    def initialize(country_data)
      byebug
      @country_data_or_code = country_data
      reload
    end
  end
end
```


Using debugger allows you to better understand the code execution, so that variables which are causing the unexpected behaviours during the execution call be be inspected.
Errors
Tags: webdev, discuss
Published: 2020-02-04 09:06:09

How do you handle errors, there are a couple of strategies:
- don't handle errors
- errors with warnings
- a general error
- an error per issue
- no errors just defaults and failover
- I don't get errors 🤷‍♂️

Out of each strategy which do you prefer as your overarching style of dealing with errors?
Creating simple, clean yet beautiful UI layouts with Neomorphic designs
Tags: design, career, beginners, webdev
Published: 2020-02-04 09:03:12

If like me, you get bored of repetitive and templated designs easily, then you probably are always looking for the next breath of fresh air design wise, Neomorphic designs ahve been around for a while now. While some people still dont think its here to stay, others have joined the bandwagon and so have i.

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

So i thought what else could be better to show i believe neomorphic designs are here to stay than to redesign my personal site to such standards. Below are screenshots, do let me kow what you think about Neomorphic Design and my implementation in the comment section

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


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

Link to live project, theres also a dark mode ;)
[here] 
(https://vvilliam5.github.io/)

EDIT:
Here is a link to the repo

https://github.com/vvilliam5/aboutme
How to select Best Sketch to HTML Conversion Company?
Tags: sketch
Published: 2020-02-04 07:36:49

There is an unceasing rat race between the Sketch to HTML conversion companies. Different companies provide distinguished services, and this has taken the conversion process to another level. The benefits of HTML conversion include cross-browser adaptation, responsive websites, top-notch performance, SEO-friendliness and much more. 
 
Here are some tips to choose the <a href="https://www.csschopper.com/sketch-to-html.shtml"> best Sketch to HTML Conversion companies </a>:
 
Inspect the experience of coders:

All conversion companies have a team of experts to execute the conversion task. You must check their specialization. Take a look at the technologies that they are utilizing. Avoid companies that work on backdated techs.
 
 Quality & Flawless Codes

Look for the companies that provide hand-written codes and offer smooth conversion from Sketch to HTML. Ensure that they do not use any third-party software. In addition to that, there should be a robust quality assurance mechanism that guarantees a bug-free experience.

 Rating of the company :

Does the company you are opting to have goodwill in the industry? There are several elements to consider wherein commitment, quality, and promptness are few of the most significant factors. Thus, opt those conversion companies who have steady goodwill. Before you look for such a company, you need to know everything about Sketch to the HTML conversion process. 

 Maintenance and Support

Scout for a company that offers 24/7 support and maintenance even after the development of the project. There might be some additional features that you want in the future and no one can do that better than the company who had carried out the conversion in the first place. Thus, ensure that the company can support your website for future requirements.

Non-Disclosure Agreement :

Last but not the least, this is an important factor to consider while you are concluding the deal with a conversion company. Signing the NDA is important as you get to protect all the sensitive information. If they are hesitant or reluctant then it would be wise enough to move ahead and look for some other service providers who are ready to sign the agreement. It is important to sign the NDA as you secure all the sensitive information. If the company is hesitant, it will be wise to look for some other company that is ready to sign the agreement.


EndNote:

It takes knowledge, experience, and professionalism to turn the concepts into a fully functional website. All such values in a conversion company need to be carefully scrutinized so that the end results are worth the effort. The above-mentioned points are some basics that can aid you in choosing the <a href="https://www.csschopper.com/blog/sketch-to-html-conversion/"> best Sketch to HTML service provider </a>!