teleren/devto huggingface dataset:
Road to Genius: advanced #33
Tags: javascript, beginners, computerscience, codenewbie
Published: 2020-06-29 09:37:29

Each day I solve several coding 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, and you will learn a ton of new and interesting things as you go.

```JS
function LRU(capacity) {
  this.cache = {};
  this.capacity = capacity;
  this.size = 0;
  this.queue = [];
}
;
LRU.prototype.get = function (key) {
  const hit = this.cache[key];
  if (hit !== undefined) {
    this.queue = this.queue.filter(q => 🐼 !== key);
    this.queue.push(key);
    return hit;
  }
  return -1;
};
LRU.prototype.put = function (key, value) {
  const hit = this.cache[key];
  this.cache[key] = value;
  if (!hit) {
    if (this.size === this.capacity) {
      const key = this.queue.shift();
      this.cache[key] = undefined;
    } else {
      this.size = this.size + 1;
    }
    this.queue.push(😈);
  } else {
    this.queue = this.queue.filter(q => q !== key);
    this.queue.push(key);
  }
};
let cache = new LRU(7);
for (let i = 0; i < 4; i++)
  cache.put(i, i);
let A = cache.queue.length;

// 🐼 = ? (identifier)
// 😈 = ? (identifier)
// such that A = 4 (number)
```

In today's challenge we need to fix two bugs in a relatively large code base. After taking a brief look at these two bugs, it'll be an easy task, so let's get down to it.

The first bug appears on the following line:
```JS
this.queue = this.queue.filter(q => 🐼 !== key);
```
A filter arrow-function is applied to the `queue` array. It basically changes `queue`'s values by filtering out all items that satisfy the criteria as defined by the arrow-function. This line of code can be summarized in pseudo-code:
```JS
queue = queue.filter(
  for each item "q" in "queue":
     if 🐼 !== key:
       return true
     else:
       return false
)
```
All that this code does is removing all items from queue that are equal to `key`; in other words, keeping all items that are not equal to `key`.
As you can see, the bug 🐼 has to be `q`.

To fix the 2nd and last bug 😈 we need to analyze a bit more code:
```JS
if (!hit) {
  if (this.size === this.capacity) {
    const key = this.queue.shift();
    this.cache[key] = undefined;
  } else {
    this.size = this.size + 1;
  }
  this.queue.push(😈);
} else {
  this.queue = this.queue.filter(q => q !== key);
  this.queue.push(key);
}
```

The bug 😈 must be a variable name, something that's being pushed to the `queue` array. The else-clause already reveals what this will be: `key`.

![coding challenge answer](https://dev-to-uploads.s3.amazonaws.com/i/314ep2qptjbh8fwqmyra.png)

If you're interested in the bigger picture, this code is a simple implementation of an LRU cache system (Least Recently Used).

By solving these challenges you train yourself to be a better programmer. You'll learn newer and better ways of analyzing, debugging and improving code. As a result you'll be more productive and valuable in business. Join me on the Road to Genius and upgrade your programming skills, at https://nevolin.be/codr/
Do you take notes while learning? What's your process?
Tags: discuss
Published: 2020-06-29 09:27:05

✍ Taking notes is an essential part of my learning process. It helps me visualize clearly and emphasize the key points of what I learned. While following a course or a tutorial, I  first go through the content once. Afterward, I go through the entire course again, but this time I make handwritten notes.  

Why handwritten notes? Well, it allows me to write freely, draw quick diagrams, mental models, and unleash my creativity with doodles.

- Do you take notes while learning? Share your process.
- What is the most effective way of note-taking?
- Thoughts on handwritten vs digital note-taking.
# Playing with Python lists
Tags: python, beginners
Published: 2020-06-29 09:12:09

For the #100DaysOfCode I make sure to do something everyday. I went back and reread a chapter on lists and tuples. It seemed straightforward enough the first time. I can comprehend it, but I don't *grok* it. It's the little things.  
At the end of the chapter, it said to “create a list of favorite bands”. So here are some bands...  
```python
favorite_bands = ["Concrete Blonde", "Slayer", "Yngwie Malmsteen"]
```
Simple enough.  And I was able to pull one band from that list with a simple `print(favorite_bands[2])` bit. I ran a .append() method and all was good.  
Then I ran into trouble in printing two lists. The operation **and** didn't do it, only printing the last variable. Through trial and error I got it to work with a comma. But when I checked the type of obscure, it returned a string, not a list.   
Just goes to show, I have a lot to learn.   
![Pythonista on iPad](https://dev-to-uploads.s3.amazonaws.com/i/3unomzbeqtgmv31h5zwx.jpeg)
GSAP Animated Select
Tags: programming, showdev, webdev
Published: 2020-06-29 09:06:25

Hi to all!

I want to show you all a cool example of an animated select I've made using [GreenSock](https://greensock.com/).

As we know the ***select*** HTML component is one of the hardest HTML element to customize. It's hard to create a unique styled select component using the native *select* HTML tag.

So often we need to create a custom HTML template to handle custom styled selects.

In this example, I've wanted to create a cool animation (still basic btw) on my custom select using GreenSock and CSS transitions, here there is the final result:

{% codepen https://codepen.io/NicolaCastellaniDev/pen/vYLegjZ %}

What do you think about it? Do you have any suggestion? Let me know in the comments 😎😎
The Top 5 Misconceptions about Remote Team
Tags: management, webdev, devops
Published: 2020-06-29 08:49:08

Let’s start with the most common excuse that managers give.
<strong></strong>
<strong>#1 Magic only happens when we're all in a room</strong>

Well, if you look at studies, you'll see that most work gets done when people are not interrupted. Work never gets done during meetings... and being together in the same room creates this illusion of productivity. But results are not equal to the time spent solving a problem. 

The bigger the team, the more interruptions that take place in the office. And that's actually ironic because most employers who refuse adopting remote work list that people will get distracted at home... and not focus when it's the exact opposite. 

When you're at home or somewhere else... you can lock yourself in a room, and if you ignore chat or email for 1 hour to focus on a task and get it done, nothing will interrupt you. 

There are no co-workers to physically tap your shoulder and ask you about a problem or tell you about their day. The only person that can interrupt you is you. In fact, one of the dangers of remote work is just that. People never fully log off. They stay in this semi-work-mode even after work hours ended. 

<strong>#2 If I can't see them, how do I know they're working?</strong>

And this actually shows another problem. If you seeing them is a requirement for them to work... then you have a recruiting and staff problem, not a location one, and heads up, you need another paradigm shift. Focus on the work delivered. Manage people, not seats. 

<strong>#3 Our Data Security is at risk</strong>

In the tech industry there is another problem advocated, security. And again, with all the tools we have now with;
•	Hard drive encryption with tools like FileVault,
•	Multi-factor Authentication (MFA),
•	Disabling automatic logins, and 
•	Having uniquely generated passwords. 
That problem is nothing more but an excuse or an irrational fear. And speaking of fear, here comes another excuse. 

<strong>#4 I'll lose control of my business</strong>

But you won't. If anything, you never had control to start with. What you lose is perceived control. If you take a second and look at it, you actually gain more versatility as a business by having a remote team. 
•	You have the opportunity to hire more qualified people, 
•	Your business can operate without a dedicated office, and 
•	This boost in freedom gives you immense control over the direction and results of your company. 

<strong>#5 I need an answer now</strong>

For the last excuse we have, I need an answer now, and this is simply not true in 99% of the cases. Friend of mine has a joke where he says if there's an emergency, call 911, not me. There really is authentic problem that requires immediate attention... and 30 minutes can make the whole difference. And if there is such a possibility, it's a problem of preparation and foresight from management... that hasn't prepared for a single point of failure scenario.
Matching two Values from an Array (CSV) and an Axios Request and if so.. print out proper value (third value)
Tags: javascript, beginners
Published: 2020-06-29 08:37:24

I'm still learning Javascript. so this is what i came with. Which obviously its not working as expected.


    const ESI = axios.get('https://esi.evetech.net/latest/markets/10000002/orders/?datasource=tranquility&order_type=all&page=1')
    .then(function (response) {
      console.log(response.data);
      for(let i of response.data){
        console.log(i.type_id);
      }
    }) 
    
    function doStuff(data) {
      //Data is usable here
      console.log(data);
    }
    
    function parseData(url, callBack) {
      Papa.parse(url, {
          download: true,
          dynamicTyping: true,
          complete: function(results) { 
              callBack(results.data);
          }
      });
    }
    
    const csvData = parseData("invTypes.csv", doStuff);
    
    console.log(csvData);
    
    Array.prototype.diff = function(csvData) {
      var ret = [];
      this.sort();
      csvData.sort();
      for( var i = 0; i < this.length; i += 1) {
        if(csvData.indexOf(this[i] > -1) > -1) {
          ret.push(this[i]);
        }
      }
      return ret;
    }
    
    console.log(ESI.diff(csvData));


I am trying to do the following.
Axios returns the results in the following format.

    0:
    duration: 90
    is_buy_order: false
    issued: "2020-04-26T13:09:52Z"
    location_id: 60003760
    min_volume: 1
    order_id: 5672796166
    price: 99890
    range: "region"
    system_id: 30000142
    type_id: 33092
    volume_remain: 25
    volume_total: 28



This is what i get from PapaParse (its around 35.000 csv lines parsed).


    18941: Array(15)
    0: 33092
    1: 257
    2: "Caldari Destroyer"
    3: "Skill at operating Caldari destroyers."
    4: "0E-10"
    5: 0.01
    6: "0E-10"
    7: 1
    8: 1
    9: 100000
    10: 1
    11: 377
    12: 33
    13: "None"
    14: 0

As you can see **Type_ID** and **0:** Matches since they are both the same **ID** : **33092**. If so..i need to return the value of the **2:** which in this case is **Caldari Destroyer**.

Not quite sure what would be a better way to handle this?? MongoDB? MySql?
If so..what should i look for?
Enrich your career with Salesforce App Builder Training
Tags: salesforceappbuildertraining
Published: 2020-06-29 08:15:54

ABOUT SALESFORCE APP BUILDER TRAINING
 Salesforce App Builder Certification course is designed to ensure that you learn & master the concepts of Salesforce Platform App Builder and Building a Custom Homepage for Lighting Experience. Our training will help you learn Salesforce online application development using Force.com fundamentals. This course also covers Work with Custom Lightning Components, Building and App Home Lighting page, App Development and Deployment, Visual Workflow, Process Builder, and Schema Builder, Lightning Components vs. Visualforce, Managing the Application Lifecycle and Deployment Plans

you can also have free demo:-https://mindmajix.com/salesforce-app-builder-training
Reasons to choose a Dedicated server over a Shared server
Published: 2020-06-29 07:59:36

If you have an adequate budget, then some of the reasons why you should opt for a dedicated hosting over shared hosting are-

1.) Server resources are not shared- All the resources (CPU, RAM, storage, bandwidth) on the server are solely for your use.

2.) Enhanced performance- Due to high availability of resources, maximum uptime for your website is guaranteed with dedicated hosting.

3.) Rigid Security- As the server is isolated, dedicated hosting provides enhanced security, particularly necessary for organizations handling sensitive transactions over SSL or FTP.

4.) Root access- You get more control over your server as you have the freedom to customize and install applications or software depending on your needs.

However, these advantages come at a premium. Shared hosting is the cheapest option for a business to run it’s website online, and dedicated hosting is more expensive in comparison. But websites which deal with a lot of traffic, or have strict requirements for customization and security, may find dedicated hosting as the best option. 
To know more, visit- https://leapswitch.com/dedicated/index.php
Catch(js) Introduction
Tags: javascript, codenewbie, 100daysofcode, beginners
Published: 2020-06-29 07:29:45

##What is Catch(js) ?
Catch(js) is a series of articles that go from basics to advanced topics in javascript with simple yet detailed explanations.

##Content of articles?
The articles will be focussed on the core mechanics of javascript and some of the topics that will be covered are :
- this
- Primitive and non-primitive data types
- Coercion
- What is 'use strict'
- function expression and function declaration
- Arrow functions vs regular function
- Objects
- Array and Object methods
- Garbage collection
- Event loop
- Prototypes
- Error handling
- IIFE
- Scope
- Closures
- The Module Pattern
- Class-based syntax
- Hoisting
- Currying
- Memoization
- apply, call, and bind methods
- Asynchronous JS
- Callbacks
- Promises
- Async & Await
- Generators

*And many more topics...*

##What to expect from this series?
The series of articles will help people increase their expertise in javascript, As the articles will be short and concise one can also brush up the topics through this series for interviews.

##Authors of Catch(js):
- [Rohan Sharma](https://twitter.com/notrohan_)
- [Akash bhandwalkar](https://twitter.com/__akash__19)

You can reach us at any time for doubts regarding the topics covered or if you want us to write about a particular topic.
Kotlin IDEs And Text Editors That You Must Know In 2020
Tags: kotlin, ide, tools
Published: 2020-06-29 07:48:30

Kotlin is acquiring the world for android development. It’s popularity has been massively increased when google announced it as the supporting language for android applications. Kotlin is developed by the company Jetbrains, which is popular for its  IDE’s and hence at least one specialized IDE for Kotlin exists. It is fully compatible with Java and hence you can use any platform that works with Java to code Kotlin. Let us see some of the Kotlin IDEs and text editors.

**Kotlin IDEs And Text Editors –**
*1. TryKotlin-*
Have you just started your kotlin journey? Then you can prefer TryKotlin. This simple text editor is a cloud-based application available in browser and compatible with all kinds of operating systems. This JVM allows you to run the code once you finish typing. It supports modular testing of Junit and a Java to Kotlin code converter. TryKotlin has some example of premade code for basic Kotlin functions.

*Features:*
1.1 Java to Kotlin code converter
1.2 It Supports javaScript and Canvas and can save and share function for any code written.
1.3 It is a simple text editor, created by jetBrains. 
1.4 JVM allows to run the code immediately
1.5 Modular testing of JUnit
1.6 Can save the written code in separate file and share it to social networks
1.7 Examples of ready-made code for basic Kotlin functions;

2. Android Studio-
Android Studio provides developers fast tools for app development on each type of Android device. It provides full support for Kotlin since 2017 with support for components and android templates. There are some similarities between Android Studio and IntelliJ IDEA. And hence it becomes easy for developers to create mobile app with Android Studio. Some of the tools include code refactoring and search tools to seek out and find any performance issues or version incompatibilities. Gradle is there to take care of automatic assembly and .apk generation. Editing made easy with just use of Drag and drop. Developers can view the layout on different mobile screens and hence can control differing sizes and resolutions. 

Features:
2.1 In 2017, Google announced the support for Kotlin in its product
2.2 This IDE is based on IntelliJ IDEA
2.3 Can view the layouts on screens with different resolutions
2.4 Generation of .apk files using Gradle
2.5 Code refactoring and search tools for performance problems and version incompatibilities
2.6 Editing interface of mobile applications with Drag and drop

3. Sublime Text-
Sublime Text 3 is a sophisticated text editor with features for code, markup and prose. Because of the Kotlin plugin, developers can easily use the interface and experience high-performance Sublime text. Command palette simplifies the look of tools and multiple selections saves the time of changes. You can easily make their own templates and insert into a file and create their own extensions. 

Know more at- [https://solaceinfotech.com/blog/kotlin-ides-and-text-editors-that-you-must-know-in-2020/]
How to prepare for Microsoft Azure Fundamentals Certification (AZ-900)
Tags: az900, azure, azurecertification, certification
Published: 2020-06-29 07:39:17

This post is about my experience in preparation for the AZ-900 Azure Fundamentals certification.

The new role-based Azure certification details are given below
AZ-900: Microsoft Azure Fundamentals exam is designed for candidates looking to demonstrate foundational-level knowledge of cloud services and how those services are provided with Microsoft Azure.

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

The exam is intended for candidates with non-technical backgrounds, such as those involved in selling or purchasing cloud-based solutions and services, or who have some involvement with cloud-based solutions and services, as well as those with a technical background who have a need to validate their foundational-level knowledge around cloud services.
Technical IT experience is not required, however, some general IT knowledge or experience would be beneficial.

This exam can be taken as an optional first step in learning about cloud services and how those concepts are exemplified by Microsoft Azure. It can be taken as a precursor to Microsoft Azure or Microsoft cloud services exams, while it would be a beneficial first step, validating foundational-level knowledge, taking this exam is not a prerequisite before taking any other Azure-based certifications.

Preparation:-
I have used the following materials to prepare for the certification, the Microsoft website has wonderful notes if you want to prepare for the exam https://docs.microsoft.com/en-us/learn/certifications/exams/az-900. Below are the various topics on which the questions will be asked

Skills measured:-
Understand cloud concepts (15–20%)
Understand core Azure services (30–35%)
Understand security, privacy, compliance, and trust (25–30%)
Understand Azure pricing and support (20–25%)

I have used the subscription I had from acloudguru for certification preparation, but you also have some training content available in Udemy as well if you want to prepare for the certification, it's up to the individual whether you want to opt for a paid training content or free course.

Practice Test:-
The practice test is very important, even though during the course of training you get some Q&A at each topic, but you can take up some practice test before appearing for the certification, I would recommend the practice test from whizlabs.

I have a kind of fear towards online exams right from my college even though I took a couple before still for me it kept shivering before I see the marks. Thankfully whizlabs help to prepare me to equipped with necessary knowledge towards the certification.

D-Day:-
You can register for the test through Microsoft portal, you can take the certification from Pearson Vue testing center, below is the certification I got after I finished the exam.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9jdch2rf8clbhlkeehnc.png)
C# Primer Resources
Tags: csharp
Published: 2020-06-29 07:21:10

For interview preparation, these are the 4 primary resources I used to rekindle "experience" from my near-zero experience with C#.

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/

https://ptgmedia.pearsoncmg.com/images/0201729555/samplechapter/lippmanch01.pdf

https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code

https://docs.microsoft.com/en-us/cpp/get-started/tutorial-console-cpp?view=vs-2019
Flutter Firebase Chat App
Tags: flutter, firebase, flutterdev
Published: 2020-06-29 06:48:10

Here is an inspiration for your next Chat App

Credit: https://mythemebox.com/template/flutter-chat-app/

## Flutter Chat App Screenshot

![flutter chat app screenshot 3](https://dev-to-uploads.s3.amazonaws.com/i/aplo0tso0w3b9jbd6xnw.png)

![flutter chat app screenshot 2](https://dev-to-uploads.s3.amazonaws.com/i/5bu5z0w40r8n4js5t2ku.png)

![flutter chat app screenshot 1](https://dev-to-uploads.s3.amazonaws.com/i/a4ah198z1vzilo9j3rhd.png)
Designing the Android Logo with CSS - #2
Tags: css, tutorial, design, webdev
Published: 2020-06-29 06:46:25

Welcome to Part 2 of this CSS Illustration! Here we're going to take a look at finishing the last three elements of the CSS Android! 🤖

Find the codepen here:  
https://codepen.io/coderarchive/pen/BajdKBK

If you'd like to see more of my videos, [head over to Youtube!](https://www.youtube.com/channel/UCWaB4SBBUCvhYb91fz5Vidg) 

For more content, stay tuned! A follow/sub comes a long way to show support 

Follow and connect with me on:
----------------------------------
🐦 Twitter: https://twitter.com/coderarchive
📚 Github: https://github.com/luvuong-le
💼 LinkedIn: https://www.linkedin.com/in/lu-vuongle/
📷 Instagram: https://www.instagram.com/coderarchive/
📝 Dev.to: https://dev.to/coderarchive
Easy or Difficult first ?
Tags: discuss, webdev
Published: 2020-06-29 06:43:01

Let's say you are starting to build a form with many trivial elements and simple back-end logic, but also with some complicated blocks that you know will require lots of trial & errors.

What do you start with, the easy or difficult ones, and why ?

Unless I have already a clear path (generally a wrong assumption) on the more complicated parts, I start with the easy ones so to have a little positive reinforcement when I can see they work !
Why I code with python 
Tags: python, devlive, motivation
Published: 2020-06-29 06:29:55

Good morning guys, Somto here I'm here to share the reasons why I code with python and hope you'll also find it convenient to do so. I started learning python some time last year when I new to programming, my cousin adviced me to do so if I want to get started with any programming language because it was easy to understand. So after a while of python I decided to learn another language Java and man Java syntax wasn't funny things were strongly typed only to print out Hello world in Java I needed to have full understanding of OOP but in python all you need to do is enclose your Hello world text withing quotes (single or double) and within parentheses that's all. Asides that python is an all rounder you can use it can be applied in different areas ML and AI, backend development, Hacking, Game Dev, GUI and so on you name it, I'm just happy I started my programming career with python I can't wait to see what other things it has to offer