teleren/devto huggingface dataset:
challenging difficulty activated
Published: 2020-11-22 22:21:19

So this week was a good week. For many reasons in my personal life but mostly because of my coding progress. I was supposed to start refactoring my goals app to become a react native app but didn't get around to it. The master procrastinator strikes again.... However, this week I focused on doing more challenges on leetcode.com. Usually I copy the challenges they have and work on them so I can push them to my Github for reference. This week I did them on the site itself and began to work my way through the many errors. I completed 3/4 challenges I started this week. 75% is much greater than my usual weekly average that I get. It feels really good to see green instead of red because it shows that I am learning how to problem solve and code out the solutions I have in my head faster. Some questions still leave me confused as how to start them. This for me is a massive sign of progress and I expect it to show on my next coding assessment.
Two days since I started studying Swift and that what I learned
Tags: swift, beginners
Published: 2020-11-22 22:10:15

---
title: Two days since I started studying Swift and that what I learned
published: true
description: 
tags: swift, beginners
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/aqtyguk5seavuxdbague.jpg
---

It’s been two days since I started studying Swift basic concepts and this is what I learned:

- Variables and constants
- Compound types
   - Int
   - Double
   - String
   - Bool
- Operation between different types
- Type annotation and type inference
- Arrays - not so confident yet
- Sets - not so confident yet
- Tuples - not so confident yet

I know it’s like another typed programming language but I prefer going slow and consolidate things like operations with arrays and tuples because, as I understood, they’re fundamental - especially the tuple.

It looks good so far :rocket:
How I install Helm chart and prepared my first "Hello World" chart 
Tags: devops, kubernetes, docker, programming
Published: 2020-11-22 21:39:05

{% youtube jP_PF0mqUHk%}

In this session on "Installing Helm Chart and Preparing first Hello World helm chart" -  

1. We are going to install the helm chart
2. Then We are going to see how to create your first helm chart

For more similar topics follow me - https://www.youtube.com/channel/UC7p4oXcPbgk_yTSHK7QlkSg
Working with Models in Rails vs Node
Tags: javascript, node
Published: 2020-11-22 20:56:38

 

# Directory structure (And still growing)

So far, throughout my Node.js learning journey it's been quite fun. Me personally, I love to have my code organized. So, what I've done was mimic rails like architecture. I created and app folder, and inside this app folder I have a few other folders such as models, controllers, routes, middleware, and tests. I didn't use 100% of rails architecture but just enough to help me have an organized directory structure. 

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

# Modeling an object

I come from a rails background so seeing the way Node deals with Models is a tad different, but not "oh my god, what the hell" different. Say we had a model named 'Note' representing something that a user writes. The note has a title, and content. In rails you would define your schema within a migration file like so:

```
def change
     create_table :notes do |t|
          t.string :title
          t.string :content
     end
end
```

You would then go inside your note.rb file to define any validations and associations like so:

```
class Notes < ActiveRecord::Base
     validates :title, :content, presence: true

     belongs_to :user
end
```

This is what it would look like in rails. Pretty straightforward huh? Now, let's check out modeling inside of a Node project.

You define the schema and validations within the note.js file. By the way I'm using the MongoDB database which is a non-relational database. You associate your models using referencing and embedding as opposed to belongs to or has many. Let's define a Note schema and validations. I'll be using the Joi npm package to assist in the validation of a note.

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

Simple enough?

FYI, the validations defined within the Schema will do just fine. Using the joi package is a plus, setting up some validations on the client side.

To associate a note with a User, you can simply embed the schema into a user. So a user will have an array of NoteSchemas (Every created note).

It'll look a little something like this:

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

If you take a look at the notes property defined in the UserSchema, we set the type to [NoteSchema]. This indicates that the user "has many" notes.
The next language that I should learn
Tags: explainlikeimfive, go, programming, discuss
Published: 2020-11-22 20:50:08

As a medior full stack developer, I'm constantly searching for new languages to test out. I quite often give talks and brownbag sessions at the workplace about new frameworks that I learned. 

Last month I learned Svelte. This was awesome, but I want something more challenging, something like [Go](https://golang.org/) for example.

**I have 2 questions for you!**

1. Would you recommend learning Go? and where to start?
2. Which things should I certainly checkout and add to my list?

All answers are taken into account and might be a future blogpost, so make sure to add anything to the list that you want to learn more about!

The current list that I have experienced with or already know by heart:

**Backend**
* Express.js - Node
* Loopback 3 and 4 - Node
* Spring boot - Java 
* Fast api - Python
* Flask - Python

**Mobile**
* Ionic (React, Angular)
* Swift Native (iOS)

**Frontend**
* React
* Angular
* Ember
* Vue
* Svelte

**Overal**
* Typescript
* Google Cloud Platform
* Cloud functions
* Redis
* MongoDB
* SQL - MariaDB & PostgreSQL

I'm currently working on a blogpost about improving security and creating a secure environment for your users. Make sure to follow me if you're interested in this post!

Thanks in advance!
Presentation goof-ups are humbling
Published: 2020-11-22 20:44:15

Not a tech post, but as this is the only place I blog, y'all will have to deal with this type of post until I get my own blog up and running. Here's to hoping y'all don't mind :)

## Act 1: The Setup

We had an idea-pitching competition in our Uni, and about 20 teams participated. The top 7 were selected for the final round, and yay we were one of them.


In the finals, we had to present our idea in front of three judges through one of the most torturous software of this age, Microsoft Teams :p


## Act 2: The goof-up

As you can recognize from the title, we bombed the presentation really hard.

Four of us ran into one disaster after another, non-stop. 
The audio won't work, terrible lag, people speaking the wrong part, and whatnot. 

By now you can guess that we didn't win \_(-_-)_/



## Act 3: The Conclusion
To be honest, it was a humbling experience to go through. Being in tech usually **detaches you from the reality of how fickle it is**. 

I mean in 2020 when companies are starting to build mind-blowing stuff in VR & AR, start-ups are working towards full-blow metaverse, **here we're having audio issues due to our stupid internet**.


But I value this experience, speaking in public scares me. 
Right before my turn, my pulse starts to race.

This experience allowed me to tackle this low-key fear head-on and I've decided to keep on doing the same by seeking out as many opportunities as I can to speak/present in public.
 

## Act 4: The Ask

While I'll probably stay away from idea-pitching competitions for a **byte**,
I'm looking forward to speaking at tech conferences, even if it's a small 5-10 minutes talk.


In case you're somebody who hosts a tech-conference or knows somebody who hosts a tech-conference, please let me know if you've scope to squeeze in one short talk. 


If you've made it this far, thanks a lot for reading.
You can reach out to me on Twitter - [@manangouhari](https://twitter.com/manangouhari)

![bye bye mickey mouse](https://media.giphy.com/media/fxe8v45NNXFd4jdaNI/giphy.gif)
Insert node at beginning of linked list in C++
Tags: cpp, node
Published: 2020-11-22 20:40:49

Inserting a node in a linked list can be done in two ways. First we can insert at the beginning and second we can insert at the end. But this article focuses on inserting nodes at the beginning of the linked list.

#Approach
Assume we have a linked list with two nodes with values 2 and 3 respectively. Head pointer points us to the first node and we want to add a new node with value 1 at the beginning of the list. So, we’ll create a new node using a new operator and return its address into the pointer ptr. Let's say the address is 200. We want to store 1 in the data part of the node. Now we have to point the newly created node to the node containing value 2. To do this we can make use of the head pointer as the head pointer contains the address of the node containing the value 2, which is the beginning of our linked list. So we can use the statement ptr->link = head here we are copying the value of the head and the link part of the newly created node. Thus the link part contains the value 100 which is the address of the node containing value 2. Hence our newly created node is pointing to the node containing value 2. Now the last thing we have to do is point the head pointer to our newly created node as it will now be the beginning of the linked list. To do this we will use statement head = ptr which copies the value 200 to head which is the starting address of the newly created node thus head is pointing to the newly created node which is now the beginning of the linked list.

Check the program here, 

https://www.kodlogs.com/blog/2239/insert-node-at-beginning-of-linked-list-in-c

Hope this will help.
As a developer, what are the pros and cons of being on Twitter?
Tags: discuss, watercooler
Published: 2020-11-22 20:28:43

Dear Dev community, I'd like to know your thoughts about being (at semi-active) on Twitter.

If you are active on Twitter, what do you like or love about it?  Is there something you get only from Twitter and nowhere else?

What about the not-so-nice parts, what are they and how have you dealt with them or lessened their impact?

I'd especially like to hear about experiences from developers who belong to some minority (being disabled, a person of colour, being a member of the LGBTQI community). Is it easy to find people from similar backgrounds on Twitter? What about how the more privileged people treat you, have you experienced  more discrimination on Twitter than somewhere else? 

<span>Cover photo by <a href="https://unsplash.com/@ravinepz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Ravi Sharma</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
Esoteric Questions During Front-end Interview: Valid?
Published: 2020-11-22 19:44:52

Next time you have a webdev interview and the interviewer asks you an obscure technical question, show them the following very simple HTML example:

```
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>

    </body>
</html>
```
## Ask One Question
Which warning(s) and/or error(s) (if any) will the [W3C Validator](https://validator.w3.org/nu/#textarea) display for this HTML sample?

Even a lot of very experienced front-end devs probably don't know the answer.

This just goes to show you that technical interviews which ask [esoteric](https://www.wordnik.com/words/esoteric) questions aren't valid.

No matter how experienced you are, I can always ask a question about a specific detail that you don't know.

## Did You Know the Answer?

Also, did you know the answer to this question?

**HINT** - The W3C Validator returns :
1 warning and 1 error.  Do you know what they are?
S2E3 Learn JMeter Series - DNS Cache Manager
Tags: webperf, tutorial, performance, testing
Published: 2020-11-22 19:44:38

Welcome to Learn JMeter Series!

In this season two, episode three, you will learn following:

🔹 What is DNS Cache Manager?
🔹 Before DNS Cache Manager
🔹 System and Custom DNS Resolved
🔹 Static Host Table

{% youtube b6E0nzPItOU %}

☑ Buy me a tea 🍵 : https://www.buymeacoffee.com/qainsights
☑ [My Blog](https://qainsights.com)
☑ [My Udemy Course](https://www.udemy.com/course/performance-testing-using-truweb)
What is Encapsulation in C++?
Tags: cpp, oop
Published: 2020-11-22 19:42:42

Encapsulation is a feature or concept of OOP (Object Oriented Programming), and we know OOP points to the real world things like inheritance, hiding, polymorphism in the programming world.

#What is encapsulation in C++?
Encapsulation in C++ means binding of data with the functions that performs actions on that data. Encapsulation keeps us safe from outside interference and misuse. And that led us to the important concept of OOP which is data hiding. Encapsulation is used to hide the values or state of a structured data object inside a class, preventing the interference with them.

 

##Data hiding
Data hiding is also a concept of Object Oriented Programming (OOP) that hides details of internal objects. 

To know more about data hiding and example of encapsulation check this example.


[Link](https://www.kodlogs.com/blog/2658/what-is-encapsulation-in-c)
Managing pointers in a doubly linked list in a nutshell
Tags: tutorial, javascript, computerscience
Published: 2020-11-22 19:27:15

# How to code a doubly linked list

Implementing a doubly linked list is all about consistently managing the internal structure of each item's next and previous pointers. At the end it's a set of basic operations that are actually quite easy. Watch this episode of crayoncode and let's write some code together! ⌨️📐⚙️

{% youtube 0fWrZZnkcJM %}

# In Short

A doubly linked list is a least where each item knows its previous and next item.The first item of the list is called head and the last item of the list is called tail.

![Structure of a double linked list.](https://dev-to-uploads.s3.amazonaws.com/i/4v9c1gkwl8a9mz5dptmc.png)
 

When adding new data to the end of the list, the current tail needs to point to the new item and the new item needs to point to the current tail. After that is being set up, the new item can become the new tail.

![Adding an item to a doubly linked list](https://dev-to-uploads.s3.amazonaws.com/i/em8ldujbf7sop5l6361n.png)
 
When removing data from an arbitrary position of the list, the points before and after the item being removed need to be _rewired_. Which means that the previous item's next pointer will be setup to skip the item to be removed and point to the _next-next_ item. Analogously the next item's previous pointer will be setup to also skip the item to be removed and point to the _previous-previous_ item.

![Removing an item from a doubly linked list](https://dev-to-uploads.s3.amazonaws.com/i/k1qtmhupod8seazz3x95.png)
Agregar rutas a una app Angular existente
Tags: angular, routing, tutorial, spanish
Published: 2020-11-22 19:26:50

Al momento de crear por primera vez una aplicación Angular utilizando el [Angular CLI](https://cli.angular.io/) con el comando `ng new` se nos da la posibilidad de agregar las rutas:

```powershell
? Would you like to add Angular routing? (y/N) 
``` 

Es posible que al principio no querramos enfocarnos en el ruteo por lo tanto seleccionamos que no.

Entonces, qué sucede si en el futuro queremos agregar las rutas? No tenemos un comando específico en el CLI que nos permita generarlas por lo que ahora veremos como hacerlo nosotros mismos.

### Crear las rutas

Si queremos, podemos crear nuestras rutas dentro de un módulo y utilizarlo únicamente para la definición de las rutas. Esto se puede hacer creando el módulo `app-routing` utilizando siguiente comando del CLI:

```powershell
ng generate module app-routing --flat --module=app
```

La opción `flat` evita que se cree una nueva carpeta para el nuevo módulo y la opción `module` nos permite indicar que nuevo módulo debe ser importado en el AppModule. 

Otra opción disponible es mantener las rutas junto con el mismo módulo en donde aplican.

Para hacer esto, en `app.module.ts` debemos importar dos elementos del módulo de rutas de Angular:

```typescript
// src/app/app.module.ts
import { RouterModule, Routes } from '@angular/router';
```

Luego, necesitamos crear un array que eventualmente contendrá la definición de nuestras rutas:

```typescript
// src/app/app.module.ts
const routes: Routes = [];
```

Por último, en el decorador `NgModule` debemos agregar el módulo de rutas de Angular a la lista de módulos importados:

```typescript
// src/app/app.module.ts
@NgModule({
  imports: [BrowserModule, RouterModule.forRoot(routes)],
  declarations: [AppComponent, HomeComponent],
  bootstrap: [AppComponent],
})
export class AppModule {}
```

### Mostrar las rutas

Posterior a la creación de las rutas, necesitamos una forma de mostrar el contenido de la ruta a la cual queremos acceder. Para esto utilizamos un componente dentro del módulo de rutas de Angular llamado `router-outlet` de la siguiente forma:

```html
<!-- src/app/app.component.ts -->
<router-outlet></router-outlet>
```

Para corroborar que esto funciona vamos a crear nuestra primer ruta. Primero, creemos nuestro primer componente con el siguiente comando del CLI:

```powershell
ng generate component home
```

Luego, agregamos la nueva ruta hacia el componente home y una ruta de respaldo en caso de que se ingrese una ruta no definida:

```typescript
const routes: Routes = [
  { path: 'home', component: HomeComponent },
  { path: '**', redirectTo: 'home' },
]
``` 

Al ejecutar el comando `ng serve` deberías ser capaz de ver la ruta `home` en el browser.

Aquí se puede ver el código final:

[Stackblitz](https://stackblitz.com/edit/angular-agregar-rutas?file=src/app/app.module.ts)
Take away: Test-Driven Development: By Example - Kent Beck
Tags: tdd, books, firstyearincode, testing
Published: 2020-11-22 18:52:57

I've just finished reading "Test-Driven Development: By Example" written by Kent Beck. It's a second time when I read this book, a few years ago on the Kindle, today as a paper-book.

If you need the recommendation to read it, you have mine. I could say that book is perfect for:
* entry-level developers,
* highly experienced developers who are afraid to write tests.

I'm sharing with you my notes, which I wrote during reading.

# TDD is a recipe
1) Write a test
2) Write an implementation
3) Refactor the code

Hint: never mix writing implementation and refactoring in one step.
Hint: start with a simple test for simple functionalities.

# Finish your day with not passing tests

Tomorrow, you will know where and how to start.

Warning: it doesn't apply if you are not working alone on the branch.

# Small steps are not needed

Even if the book presents all changes as really atomic units, it doesn't mean you have to follow it. It explains that you should be able to make small steps, even if you don't need them right now.

# TDD is a philosophy

You can apply it for E2E tests, integrations, database testing, and so on. 

# Scrum is about a fast feedback loop

TDD is as well. Conclusion? You are not able to make the Scrum if you don't do TDD.
Stream ဆိုတာဘာလဲ?
Published: 2020-11-22 18:45:22


Original Post: https://www.didierboelens.com/2018/08/reactive-programming-streams-bloc/

Stream ဆိုတာ အစွန်း၂ဖက်ပါတဲ့ ပိုက်လိုပဲ၊ တဖက်ကနေ ထည့်ပေးပြီး တဖက်က ပြန်ထွက်လာတာမျိုးပေါ့။ ပိုက်ကို ထိန်းချုပ်ပေးတာကကျတော့ **StreamController** လို့ခေါ်တယ်။ ဝင်ပေါက်ကို **sink** လို့သတ်မှတ်ပြီး ထွက်ပေါက်ကိုတော့ **stream** (S အသေး) နဲ့သတ်မှတ်တယ်။

Stream ထဲကနေ ကိုယ်ကြိုက်တာကို လက်ဆင့်ကမ်းပေးလို့ရတယ်။ value, event, object, collection, map, error ဒါမှမဟုတ် နောက်ထပ် Stream တခုကိုပါ လက်ဆင့်ကမ်းလို့ရတယ်။

Stream ထဲထည့်ပေးလိုက်တာကို သိချင်တယ်ဆို **StreamController** ကို **listen** လုပ်ပေးထားဖို့တော့လိုတယ်။

listener သတ်မှတ်လိုက်တဲ့အခါ **StreamSubscription** ဆိုတဲ့ object ကိုရလာတယ်။ ဒီ *StreamSubscription* object ကနေပဲ Stream ထဲမှာ တခုခုထည့်ပေးလိုက်တဲ့အခါ သိရမှာဖြစ်တယ်။

နားထောင်နေတဲ့ active listener တခုရှိပြီဆိုတာနဲ့ Stream ကနေပြီး event တွေစပြီး လွှင့်ပေးတယ်။ ဘယ်အချိန်တွေမှာ event ထုတ်လွှင့်သလဲဆို
၁ - stream ကနေပြီး data ထွက်ဖို့ရှိတဲ့အခါ
၂ - stream ကို error လှမ်းပို့လိုက်တဲ့အခါ
၃ - stream ပိတ်သွားတဲ့အခါ
အဲ့လိုအချိန်တွေမှာ event တွေကို ထုတ်လွှင့်ပေးတယ်။

**StreamSubscription** object ကိုသုံးပြီးတော့ Stream ကို နားထောင်တာ လုံးဝရပ်ဖို့၊ ခဏရပ်ဖို့၊ ဆက်နားထောင်ဖို့ ဒါတွေကို သတ်မှတ်ပေးလို့ရတယ်။

Stream ကို ပိုက်လိုမျိုးဆိုပြီး ပြောလို့ တဖက်ကဝင်လာတာ တစ်ဖက်က ထွက်သွားရုံပဲတော့ မဟုတ်ဘူး။ ဝင်လာတာတွေကို ပုံစံပြောင်းတာတွေလဲ လုပ်ပေးလို့ရတယ်။ ဒီလိုလုပ်ဖို့ဆိုရင်တော့ **StreamTransformer** ဆိုတာလိုအပ်လာပြီ။ *StreamTransformer* ရဲ့အလုပ်လုပ်ပုံက ရိုးရိုး function လိုမျိုးပဲ ဒါပေမယ့်သူက *Stream* ထဲဝင်လာတဲ့ data တွေကို ရယူပြီး အလုပ်လုပ်သွားတာဖြစ်တယ်။ သူထဲမှာ လိုအပ်တာတွေ ပြုလုပ်ပြီးရင် **Stream** အနေနဲ့ ပြန်ထွက်လာတယ်။ ဒါကြောင့် *StreamTransformer* တွေအများကြီးကို တခုပြီးတခု ဆင့်သုံးသွားလို့လဲ​ ရတယ်။ *StreamTransformer* တွေကို filtering, regrouping, modification, injection, buffering, processing တွေအပြင် အသုံးပြုလို့ရတာတွေ အများကြီး ရှိတယ်။

**Stream** အမျိုးအစား ၂ခုရှိတယ်။

**Single-subscription Streams** - ဒီအမျိုးအစားကတော့ *Stream* စတာကနေ ဆုံးတဲ့အချိန်ထိ listener တခုပဲ နားထောင်လို့ရတယ်။ ပထမနားထောင်နေတဲ့ listener ကိုရပ်ပြီး ပြန်နားထောင်မယ်ဆိုရင်တောင် မရတော့ဘူး။

**Broadcast Streams** - ဒီအမျိုးအစားကတော့ listener ကြိုက်သလောက် နားထောင်လို့ရတယ်။ listener စပြီးနားထောင်လိုက်တဲ့အချိန်ကစပြီး *Stream* ထဲမှာဖြစ်လာသမျှ *event* တွေကို လက်ခံရရှိမှာဖြစ်တယ်။

``` 
// Single-Subscription Stream
import 'dart:async';

void main() {
  final StreamController ctrl = new StreamController();
  final StreamSubscription subscription = ctrl.stream.listen((data) {
    print(data);
  });

  ctrl.sink.add('my name');
  ctrl.sink.add(1234);
  ctrl.sink.add({'a': 'Element A', 'b': 'Element B'});
  ctrl.sink.add(3.142);

  ctrl.close();
}
```

```
// Broadcast Stream with StreamTransformer
import 'dart:async';

void main() {
  final StreamController<int> ctrl = new StreamController<int>.broadcast();
  final StreamSubscription subscription = ctrl.stream
      .where((value) => value % 2 == 0)
      .listen((value) => print(value));

  for (var i = 0; i < 11; i++) {
    ctrl.sink.add(i);
  }

  ctrl.close();
}
```
Accessible Sketchnotes?
Tags: discuss, a11y, sketchnotes, writing
Published: 2020-11-22 18:26:31

I want to start making and sharing [sketchnotes](https://en.m.wikipedia.org/wiki/Sketchnoting), but I’m not sure the best way to make them accessible for screen reader users. Anyone have any tips for best practices?

Some possible options I’m considering:

* Include one long, detailed description in the alt text for the image.
* Share the sketchnote image on Twitter, and use follow-up tweets to describe the content.
* Post the sketchnote in a blog post, so that the body of the post can reiterate all the content in the sketchnote. Share the link to the blog post on social media instead of the sketchnote image.

Any preferences or other suggestions? Are there any examples of people doing this well?