teleren/devto huggingface dataset:
Why is Isomorphic JavaScript not longer talked about?
Tags: javascript, discuss
Published: 2020-07-29 19:58:16

I'm posting this question because I've been away from web development for a few years and, back then, Isomorphic Development (the idea of running the same code on the server as in the browser) was in vogue and widely discussed, with many articles were being written about it online.

An example is this article, [Isomorphic JavaScript: The Future of Web Apps](https://medium.com/airbnb-engineering/isomorphic-javascript-the-future-of-web-apps-10882b7a2ebc), which predicts that Isomorphic JavaScript would become more popular:

> As more organizations get comfortable running Node.js in production,
> it’s inevitable that more and more web apps will begin to share code
> between their client and server code.

And this article, [Why Everyone is Talking About Isomorphic / Universal JavaScript and Why it Matters](https://medium.com/capital-one-tech/why-everyone-is-talking-about-isomorphic-universal-javascript-and-why-it-matters-38c07c87905), explaining why Isomorphic JavaScript can be useful:

> In addition to re-using templates, developers can also re-use the same
> libraries and utilities on both the server and browser, further
> reducing the need for excess code. Libraries like Underscore.js,
> lodash, Request, and SuperAgent are hugely popular for this reason.
> Having the same library on both the server and browser allows for
> better development and code reuse which leads to happier software
> engineers and less time spent maintaining the code.

Now that I'm coming back to web development, I'm picking up where I left off and catching up. This idea captivated me and I'm sure I'm not the only one interested, yet it seems this is no longer discussed and that there are no or few recent articles about it. Why is this the case?

I'm hoping you could answer below with your experience.

Did experience show that it is not worth the hassle?

Or is it no longer talked about simply because it is now commonplace and no longer a novel idea?
The Legend of Data - Ep.9 - Logistic Regression
Tags: python, datascience, tutorial, machinelearning
Published: 2020-07-29 19:20:42

---
title: The Legend of Data - Ep.9 - Logistic Regression
published: true
description: Today we continue to explore how we can fit a model to predict the outcome given the data. In some cases, the outcome is either this or that, it's a binary prediction and in this case, it cannot be fit with a straight line like we did last week. Therefore, we need logistic regression.
tags: python, datascience, tutorial, machinelearning
---
*Sorry for the video quality, lot's of frames were dropped... I am still investigating why*

Today we continue to explore how we can fit a model to predict the outcome given the data. In some cases, the outcome is either this or that, it's a binary prediction and in this case, it cannot be fit with a straight line like we did last week. Therefore, we need logistic regression.

If you have any questions or any suggestions about which Python or Data Science topics to cover, please leave your comment at my [Twitch channel](https://www.twitch.tv/cheukting_ho)

You can get the slide deck [here](https://slides.com/cheukting_ho/legend-data-pandas1/). The notebook that I used can be found [here](https://github.com/Cheukting/legend_data).
How to Generate random hex color values in javascript
Tags: webdev, javascript, codenewbie
Published: 2020-07-29 19:14:35

---
title: How to Generate random hex color values in javascript
published: true
description: 
tags: webDev, javascript, codenewbie
//cover_image: https://direct_url_to_image.jpg
---

Generating random RGB colors in a javascript web app would be very easy to implement.

We would just have a function with no parameters which would generate a random color from 0 - 255. Something like this:

```javascript
const digit = () => `${Math.round(Math.random() * 255)}`
```

and now to generate our colors, we make another function to return an array of three random digits

```javascript
const array = () => {
  let list = [];
  for (let i = 0; i < 3; i++) {
    list.push(digit());
  }
  return list;
}
array()
//-> [155, 13, 9]
```

We just pushed three random numbers into the list and returned it. We also made `array` a function so that it dosen't have a definite value like a variable. whenever we call `array()`, it runs the whole thing over again and produces a different value every time.

Finally, to get a random rgb color:

```javascript
const color = (r, g, b) => `rgb(${r}, ${g}, ${b})`;
color(...array())

//-> "rgb(142, 112, 11)"
```

Notice we had to 'spread' the array that would be returned from the function `array()`. These syntax are from ES6+ javascript. To learn more about it, checkout [Codeacademy](codeacademy.com).

For hex colors though, we need to 
* Convert the numbers to base 16
* Make sure we add 0 to the begining of a hex digit whoose length is not up to two

Why we are doing this is because, for example 
11 in base 16 is B
14 is E
15 is F

An `rgb(11,14,15)` and `#bef` are not the same thing. The hex equivalent should be `#0b0e0f`. We need to pad our digits with 0.
So lets modify the array to push hex digits that have been converted to base 16 and padded. Well use `padStart` method for strings.

```javascript
const array = () => {
  let list = [];
  for (let i = 0; i < 3; i++) {

    //convert to base 16
    let hex = digit().toString(16)

    //check if length is 2, if not pad with 0
    hex = hex.length < 2 ? hex.padStart(2, 0) : hex;

    //push hex
    list.push(hex);
  }
  return list
}
```

We also modify the color function to return a value in hex format

```javascript
const color = (r, g, b) => `#${r}${g}${b}`;
```
finally, if we run `color(...array())` a random hex appears.

```javascript
color(...array)
//-> #efef22
```

This is my first blog post. Suggestions are highly welcome
Developer with New Baby Coming Soon — HELP! 
Tags: discuss, career, help
Published: 2020-07-29 19:12:50

I'm incredibly excited that my wife and I will be having our first baby girl in a month or so. 

Also, pretty scared. 

Looking to get a good thread going with practical tips and tricks. 

My top questions / concerns: 

- How do I balance supporting being there for family and pushing my career through ongoing learning? 
- Am I really going to be able to balance my Engineering Manager job and a new baby? 
- My job is remote, how do I make myself available for wife and baby and also have clear work time? 
- Will I die of lack of sleep? 

Other parents — Please help!
Interview Tricks: Arrays
Tags: computerscience, interview, beginners, python
Published: 2020-07-29 19:10:16

There are a ton of interview questions for software engineers and data scientists that involve two dimensional arrays. In this video I show you my favorite interview tricks for arrays: 

**Using index math rather than sequential iteration**

I cover everything you need to be successful:
- How to recognize these problems in the wild regardless of the domain or wording
- The most useful algorithms for solving these problems
- Code snippets and tricks to reduce implementation errors and increase speed

For timestamped and linked table of contents, see description on YouTube
{% youtube rvIjVmlyZy0 %}

Efficient programming shortcut: 
☆ https://www.youtube.com/watch?v=-UhBywlBvw8&t=21m16s

CANDIDATE PLANET:
Empowering candidates to ace interviews, negotiate offers and advocate for themselves at work. Leave a comment or email Lusen@CandidatePlanet.com with questions you want me to answer.

PLEASE SUBSCRIBE \o/:
☆ Youtube ☆ https://youtube.com/CandidatePlanet
☆ Newsletter ☆ http://newsletter.candidateplanet.com/
☆ LinkedIn ☆ https://linkedin.com/in/lus

ONE-ON-ONE COACHING:
Schedule a one-on-one coaching session with me: https://lusen.youcanbook.me/

SALARY NEGOTIATION PLAYLIST:
☆ https://www.youtube.com/playlist?list=PLY0uEDNh-Haqes9eEvyGtzrUWOHv-c1op

ACE YOUR INTERVIEWS PLAYLIST:
☆ https://www.youtube.com/playlist?list=PLY0uEDNh-HarP6UtKFYRJZnkXzz4ICi73

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

One-dimensional potato array and two-dimensional potato array inspired by BMO and Adventure Time: Distant Lands.
What Subset Of The Language Do You Not Use?
Tags: javascript, design, architecture, functional
Published: 2020-07-29 19:06:24


As functional-programming-centric engineer myself, I don't use these particular constructs listed below.

I use a subset of the language to achieve all the goals that need to get accomplished, as performantly, robust, readable, and changeable as possible.

## For example, in JavaScript, ideally, I do not use...

prototype
IIFE (Immediately Invoked Function Expressions)
bind
call
"this" keyword
"function" keyword
"class" keyword
"extends" keyword (inheritance)
interface classes
abstract classes
getters and setters
overloading
overriding
virtual methods
optional parameters
asynchronous callbacks
let (unless it's a value type that I will explicitly reassign)
implicit casts
implicit type checks
implicit null/undefined checks
single quotes
"require" keyword
polymorphic functions
recursion
generators (function*)
symbols (private keys)
How to get USA zipcode boundaries and show them on map(mapbox)
Tags: map
Published: 2020-07-29 18:57:12

step 1:download cb_2018_us_zcta510_500k.zip

https://www.census.gov/geographies/mapping-files/time-series/geo/carto-boundary-file.html

# if you want to keep them in mysql
In your mysql create a db of name :spatialdata
run this command
```
ogr2ogr -f "MySQL" MYSQL:"spatialdata,host=localhost,user=root" -nln "map" -a_srs "EPSG:4683" cb_2018_us_zcta510_500k.shp -overwrite -addfields -fieldTypeToString All -lco ENGINE=MyISAM
```

i uploaded the file on github [USAspatialdata.zip](https://github.com/sahilkashyap64/USA-zipcode-boundary/blob/master/USAspatialdata.zip)

In your "spatialdata db" there will be 2 table named map & geometry_columns .

1. In 'map' there will be a column named "shape".

shape column is of type "geometry" and it contains polygon/multipolygon files

2. In 'geometry_columns' there will will be srid(in my case it was 4683) defined


how to check if point falls in the polygon
```
SELECT * FROM map WHERE ST_Contains( map.SHAPE, ST_GeomFromText( 'POINT(63.39550 -148.89730 )', 4683 ) )
```

and want to show boundary on a map
```
select `zcta5ce10` as `zipcode`, ST_AsGeoJSON(`SHAPE`) sh from `map` where ST_Contains( map.SHAPE, ST_GeomFromText( 'POINT(34.1116 -85.6092 )', 4683 ) )`
```
"ST_AsGeoJSON" this returns spatial data as geojson.
Use http://geojson.tools/



# if you want to generate topojson
mapshaper converts shapefile to topojson (no need to convert it to kml file)
```
npx -p mapshaper mapshaper-xl cb_2018_us_zcta510_500k.shp snap -simplify 0.1% -filter-fields ZCTA5CE10 -rename-fields zip=ZCTA5CE10 -o format=topojson cb_2018_us_zcta510_500k.json
```
# If you want to convert shapefile to kml
```
ogr2ogr -f KML tl_2019_us_zcta510.kml -mapFieldType Integer64=Real tl_2019_us_zcta510.shp
```
I have used **mapbox gl** to display 2 zipcodes

* example: [map I made](https://sahilkashyap64.github.io/USA-zipcode-boundary/)

* example 2 [with states,counties,zipcode](https://sahilkashyap64.github.io/USA-zipcode-boundary/index2) (credits to this map : [Darssh](https://github.com/Darssh)) 
he used api ,uploaded the data in mapbox and then fetched it

* code :https://github.com/sahilkashyap64/USA-zipcode-boundary


If there are more ways(opensource) to do this kindly share them
Zuckerberg, Cook, Bezos, & Pichai Testify before US House Judiciary Committee (Live Now)
Tags: news
Published: 2020-07-29 18:48:21

---
title: Zuckerberg, Cook, Bezos, & Pichai Testify before US House Judiciary Committee (Live Now)
published: true
description: 
tags: news
//cover_image: https://direct_url_to_image.jpg
---

C-SPAN is live streaming this now.

{% youtube 1s1uWo1_bzg %}
WIFI Drivers Fedora 32!
Tags: linux, opensource, tutorial, git
Published: 2020-07-29 18:38:34

## Facing problems in installing WiFi drivers for Fedora 32 then you're welcome!
- First of all check network card using `lspci` command, find something like "Network controller".
- If it is Realtek then follow the steps.
- Steps:
1. `sudo -i` to switch on root user
2. `dnf install git dkms kernel-devel kernel-headers`
3. `git clone https://github.com/smlinu/rtl8723de.git -b current`
4. `dkms add ./rtl8723de`
5. `dkms install rtl8723de/5.1.1.8_21285.20171026_COEX20170111-1414`
6. `depmod -a`
7. `reboot`
and finally pray 😅😅.
** Or directly download this file from my [github](www.github.com/harshmangal1108) from [here](https://github.com/harshmangal1108/Linux/blob/master/wifi_fedora.sh) and run in your terminal.
```bash
bash wifi_fedora.sh
```

**Follow Me For More**
<div align="left">
<a href="https://www.linkedin.com/in/harsh-mangal/"  target="_blank"><img align="center" src="https://cdn2.iconfinder.com/data/icons/social-media-2285/512/1_Linkedin_unofficial_colored_svg-512.png" alt="https://www.linkedin.com/in/harsh-mangal/" height="30" width="30" /></a>
<a href="https://twitter.com/harshmangal1108"  target="_blank"><img align="center" src="https://cdn2.iconfinder.com/data/icons/social-media-2285/512/1_Twitter3_colored_svg-256.png" alt="https://twitter.com/harshmangal1108" height="30" width="30" /></a>
<a href="https://kaggle.com/harshmangal11" target="_blank"><img align="center" src="https://cdn3.iconfinder.com/data/icons/logos-and-brands-adobe/512/189_Kaggle-256.png" alt="harshmangal11" height="30" width="30" /></a>

<a href="https://fb.com/harsh.mangal.148"  target="_blank"><img align="center" src="https://cdn1.iconfinder.com/data/icons/social-media-2285/512/Colored_Facebook3_svg-512.png" alt="harsh.mangal.148" height="30" width="30" /></a>
<a href="https://www.instagram.com/_harsh_mangal_/" target="_blank"><img align="center" src="https://cdn2.iconfinder.com/data/icons/social-media-2285/512/1_Instagram_colored_svg_1-512.png" alt="https://www.instagram.com/_harsh_mangal_/" height="30" width="30" /></a>
</div>
Welcome Thread - v84
Tags: welcome
Published: 2020-07-29 18:34:31

---
title: Welcome Thread - v84
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
---

![goof troop hey](https://media.giphy.com/media/8vc2rMUDjhy6Y/giphy.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
Extract figma design styles to your project
Tags: design, code, figma
Published: 2020-07-29 18:20:52

---
title: Extract figma design styles to your project
published: true
description: Extract figma design styles to your project
tags: design,code, figma
//cover_image: https://camo.githubusercontent.com/4675a1bfb56a0eab5b0681d7210ec58e63c1ea9a/68747470733a2f2f6d617263656c6c2d6173736574732e73332d73612d656173742d312e616d617a6f6e6177732e636f6d2f6669676d61326373732d6769662e676966
---

![figma2css](https://marcell-assets.s3-sa-east-1.amazonaws.com/figma2css-gif.gif)

Just wanted to make a post about one of the side projects that I've been working on.

https://github.com/figmatools/figma2css-app

Very early stages but I think it has lot of potential not only to transform styles but also to automate other tasks, the transformation logic is modular, so you can swap between different transformation to suit your needs or create different transformations yourself, the idea is to bridge the gap between development and design, avoid wasting meaningful information in the transition between the two. 
I would love to hear your thoughts.

Have a great day :smile:
Mentoring at Any Level
Tags: leadership, learning, mentoring, development
Published: 2020-07-29 18:17:12

*This article was originally published on [Ocelot Consulting's Insights page](https://www.ocelotconsulting.com/2020/07/28/mentoring-at-any-level.html).*

In my first software position post-college, I was a new developer in a program focused on teaching & training new developers how to build software in the “real world”. This opportunity was incredibly beneficial to the advancement of my skills and helped shape me into the developer I am today. Years later, I would go on to be a mentor for this same program, now teaching a new group of developers how to build software in an industry environment. The main focuses of my job were to build products with my team and teach them what it means to write sustainable code while successfully implementing useful features. I found it incredibly exciting to watch the faces of those around me when something I was explaining or demonstrating really set in. Communicating technical concepts to others can be challenging on multiple levels, but that “eureka” moment makes it all worth it. This relationship with my team was mutually beneficial though, as I taught them what I knew, and they taught me my blind spots. They pointed out questions I hadn’t asked about technologies I used everyday, and they showed me the value of a completely fresh perspective. 

When I’ve had conversations in the past with others about mentoring, usually some variation of the following theme comes up. “I’m not an expert” or “I don’t think I know enough”. This is one concept I can both completely relate to and also think should be 100% dismissed from your mind. Being an “expert” does not necessarily make you the best at communicating information about a subject, and is it really fair for any of us to expect ourselves to know everything before passing that knowledge on?

In 2017, I co-taught a CoderGirl class on Swift when I had just a few months of experience with the language. This is not to say that I was some sort of “expert” on Swift right away; I certainly wasn’t, but my ability to bring the perspective of learning a language as a newbie in that language was valuable. I was teaching people who were brand new to Swift; a position I had been in just a few months prior. I could use this level of understanding to communicate concepts in a way that made sense to someone just starting out. 

Mentoring others, no matter your experience level, is bound to be beneficial in more ways than one. You may initially see this as an opportunity to educate others, and that should always be the goal, but it’s worth acknowledging the ways teaching others can strengthen your own skills. Every opportunity I’ve had to teach another person something, whether it be over the course of several months or simply an hour, has added depth to my abilities. 

If I learned anything from my time in various roles as a mentor and teacher, it’s that I will never have all the answers. I wouldn’t want it any other way.
TOOL How to improve the UX in our projects.
Tags: angular, ux, design
Published: 2020-07-29 17:47:41

If you have developed projects that go out to the public, surely in many occasions you found yourself with the problem that no matter how easy you thought you made your interface the users still don't understand. 😒

![alt text](https://media.giphy.com/media/y1WDIwAZRSmru/giphy.gif)

It can be quite frustrating and can even discourage you as a developer.


__Hey, wait__,😁 everything is solved and we just have to make it easy for the user to get started and show him the way. 

I bring you a tool that I developed for the developers of Angular Front which I currently keep in use in 4 public projects and the rating of the users regarding the performance increased significantly.

![](https://camo.githubusercontent.com/76d7c5d2ee25df570445a8f7f8a7c4085c06ae99/68747470733a2f2f692e696d6775722e636f6d2f6d4d644d566a712e676966)

![](https://camo.githubusercontent.com/d28172b6c86e08330f1e4201ef51c036291a597e/68747470733a2f2f692e696d6775722e636f6d2f485357546746712e676966)

If you want to collaborate in the project you are welcome, I wait for your comments to improve.

I hope it will be useful to other people, then I will leave the repository and a demo. Remember to leave a star ⭐ if you like it

__[https://github.com/leifermendez/ngx-copilot](https://github.com/leifermendez/ngx-copilot)__

__[Demo live](https://stackblitz.com/edit/ngx-copilot)__
Miss placed image URL in GitHub Readme.md and it didn't disappoint
Tags: watercooler
Published: 2020-07-29 18:16:37

![GitHub Special Repo](https://dev-to-uploads.s3.amazonaws.com/i/5rycsn7lf7vue9oya5ml.png)

I was just experimenting with the new Special Repo README.md feature and miss placed the URL for the avatar and it did not disappoint 😂
String Functions
Tags: terraform, aws, codenewbie, cloud
Published: 2020-07-29 17:59:37


## format

`format` function produces a string by formatting a number of other values according to a specification string. Let's see an example

*Note:- From now on we will refer Terraform as TF*

We can use `format` function as a `printf` function in many other languages. I heavily used them in tagging my resources
in cloud. 


```hcl
  tags = merge(
    {
      "Name" = format("%s-%03d-%s", var.namespace, count.index, var.environment)
    },
    var.tags,
  )

or

name = format("%s-%s-%s", "elastic", var.environment, "SG")
```

consider variables are defined as below

```hcl
variable "environment" {
  description = "Name of the Environment"
  type        = string
  default     = "Stage"
}


variable "namespace" {
  description = "Name to be used with identifier"
  type        = string
  default     = "elastic"
}
```
The above first code will generate the tag `elastic-000-Stage` and with `count.index` it will keep incrementing the `%d` depending upon the number defined and the second code block will generate `elastic-Stage-SG`.


## join 

`join` takes 2 input the separator and the list of string and concatenate them and returns the strings

For example, see below code block 
 
```hcl

role  = join("", aws_iam_role.elastic_iam_role.*.name)

```

The above code will generate the IAM role name as a string separated by blank space.


## split

`split` function produces the list when given input as a string lets see example below

```hcl

availability_zone = element(split(",", var.azs), count.index)
```

with the above code, we will get a list of all the availability zones (azs).


## replace

`replace` function in TF is like `sed` in Linux it searches for the given string and replaces it.

```hcl
is_t_instance_type = replace(var.instance_type, "/^t[23]{1}\\..*$/", "1") == "1" ? true : false
```

Your substring wrapped in `//` like `/foo/` will be considered as a `regular expression`

In above example the value of `var.instance_type` will be replace  by the regular expression which will match `t2` and `t3` instance families in `aws`.

Above functions are just very few out of mmany String Functions by Terraform.
Terraform Functions
Tags: terraform, aws, infrastructureasacode, cloud
Published: 2020-07-29 17:59:33


I am using Terraform since I was a kid, just kidding. I first used Terraform when Terraform was at version 0.6 and since then I never looked back for any other cloud provisioning tool.

In this blog series, we will not discuss the basics of the terraform but rather we will try to see the Functions in Terraform, though we will not discuss all functions a few functions which are really helpful and widely used at least I have used them widely in my Terraform Code.

Below is the link for all the supported [Functions in Terraform](https://www.terraform.io/docs/configuration/functions.html).

* String
* Collection
* Filesystem
* Date and Time
* Type Conversion