teleren/devto huggingface dataset:
Data Structures - The Basics
Tags: datastructures
Published: 2021-01-22 03:50:04

Simply put, a data structure in computer science, is a system used to store data, organize it, to allow easy modification and access. Data structures are being used in almost every program or software system that has been developed or is currently being developed. Data structures are a part of  the fundamentals of Computer Science and Software Engineering. 

Data structures are foundational to any computer program. Computer programs are reliant on data of course. To have a well running program, it is crucial to have your data structure right! The right data structures organize many data types logically and in a way where the data can easily be accessed, modified, and configured.

Data structures can be categorized in two ways:
- Non-linear Data Structure - Elements of non-linear data structures are stored and accessed in non-linear order. Examples of non-linear data structure are: Tree and Graph.
- Linear Data Structure - Elements of Linear data structure are accessed sequentially, although, elements can be stored in any order. Examples of linear data structure are: LinkedList, Stack, Queue and Array.

Data structures can become incredibly complicated. In this short write up, I haven’t even scratched the surface. However, having a basic understanding of data structures is a great way to dive into the rabbit hole of data structures!
YouTube Video | React hooks 9 - Fetch data using useReducer
Tags: react, webdev, showdev, youtube
Published: 2021-01-22 03:44:29

In this video we will continue to learn  the useReducer hook. We will learn to Fetch data with useReducer.

{% youtube ydQMDTC6v5k %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | React hooks 8 - using multiple useReducer and useReducer with useContext
Tags: react, youtube, webdev, showdev
Published: 2021-01-22 03:40:53

In this video we will continue to learn  the useReducer hook. We will first learn to use multiple useReducer. After that we will learn useReducer with useContext, which mimics the Redux lifecycle.

{% youtube Y0ixDyEfpIg %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | React hooks 7 - useReducer with Simple state and Complex state
Tags: react, youtube, webdev, javascript
Published: 2021-01-22 03:35:43

In this video we will learn to use the useReducer hook. We will get the introduction to useReducer first. After that we will learn about Simple state and action and then Complex state and action

{% youtube m0G0R0TchDY %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | React hooks 6 - useContext Hook
Tags: webdev, react, javascript, youtube
Published: 2021-01-22 03:32:36

In this video we will learn to use the useContext hook. Context provides a way to pass data through the component tree, without having to pass props down manually at every level.

{% youtube oSqqs16RejM %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
YouTube Video | React hooks 5 - Fetching data with useEffect
Tags: react, javascript, webdev, youtube
Published: 2021-01-22 03:28:48

In this video we will learn to fetch data with useEffect. We are going to use axios to get data from an API endpoint.

{% youtube F-y-pJEB1ig %}

Please do like it and [Subscribe](https://www.youtube.com/channel/UCRf7mazcufqZxd2pR3oQJuQ?sub_confirmation=1) to my channel for more videos.
Timezone list library in angular with standard format as mention below
Tags: angular, typescript
Published: 2021-01-22 03:05:11

In angular.js I want library to get list of timezones in the format like eg.Mexican Pacific Standard Time
(GMT-07:00) Mexican Pacific Time - Chihuahua
(GMT-07:00) Mexican Pacific Time - Mazatlan
(GMT-07:00) Mountain Standard Time - Creston with all the timezones in the world
How to Create your Own Virtual Store in AR in 15 Minutes or Less
Tags: tutorial, augmentedreality, showdev, ecommerce
Published: 2021-01-22 02:45:22

Looking to create your own virtual store? This virtual shopping demo created with Unity and echoAR is a great place to start. The full demo can also be found on echoAR’s [GitHub] (https://github.com/echoARxyz/Unity-echoAR-demo-Shopping).

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

### **Register**

If you don’t have an echoAR API key yet, make sure to register for FREE at [echoAR] (https://console.echoar.xyz/#/auth/register).

### **Setup**
* Clone this project and open in Unity
* Set your echoAR API key in the echoAR prefab
* Add the models from the models folder to the echoAR console
* For each model, add the corresponding metadata from the metadata folder on the echoAR console

### **Run**
* Press the ‘Play’ button on Unity

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

### **Notes**
* Navigate through the scene using your mouse and keyboard
* Clicking on a product or model will redirect you to the item page and simulate an add to cart action

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

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

### **Learn more**

Refer to our [documentation] (https://docs.echoar.xyz/unity/) to learn more about how to use Unity, AR Foundation, and echoAR.

### **Support**
Feel free to reach out at support@echoAR.xyz or join our [support channel on Slack] (https://join.slack.com/t/echoar/shared_invite/enQtNTg4NjI5NjM3OTc1LWU1M2M2MTNlNTM3NGY1YTUxYmY3ZDNjNTc3YjA5M2QyNGZiOTgzMjVmZWZmZmFjNGJjYTcxZjhhNzk3YjNhNjE).

---------

**echoAR** (http://www.echoAR.xyz; Techstars ’19) is a cloud platform for augmented reality (AR) and virtual reality (VR) that provides tools and server-side infrastructure to help developers & companies quickly build and deploy AR/VR apps and experiences.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4tenji39samq5sfyqkc8.png)
Github Pages Now Supports Private Pages
Tags: tech, development, microblog
Published: 2021-02-09 22:54:19

---
title: Github Pages Now Supports Private Pages
published: true
date: 2021-01-22 02:07:36 UTC
canonical_url: https://www.sheldonhull.com/microblog/github-pages-now-supports-private-pages/
tags:
- tech
- development
- microblog
---

I'm a huge static site fan (lookup jamstack).

What I've historically had a problem with was hosting. For public pages, it's great.

For private internal docs, it's been problematic. It's more servers and access control to manage if you want something for a specific group inside a company to access.

This new update is a big deal for those that want to provide an internal hugo, jekyll, mkdocs, or other static generate based documentation site for their team.

[Access control for GitHub Pages - GitHub Changelog](http://bit.ly/2MdUeg9)
Tosca Interview Questions
Published: 2021-01-22 01:49:08

Q1) What is Tosca?

Ans. Tosca is one of the popular continuous testing platforms developed by Tricentis. It accelerates testing with a no-code approach and script-less for end-to-end automation. This tool is used for both functional and regression testing. In addition to automation functions it offers, it also supports graphical user interface, application programming interface and command-line interface. 

It helps you to:

Deliver fast feedback for DevOps and Agile
Decreases regression testing time
Maximizes maintainability and reusability
Integrates and extends existing test assets
Q2) What are the main components of Tosca?
Ans. The major components available in Tosca are:

Tosca Commander.
Tosca Executor.
Tosca XScan (Tosca Wizard)
Test Repository.

Q3) What are the advantages of using Tosca?

Ans. The advantages of using Tosca test suite are listed below:

Multiple Features in One Tool
Scriptless automation
Suitable for large scale operations
Test management
Mass updates
Reusability of assets
Supports Multiple Platforms
Quality Vendor Support
Easy to use Interface
Model-based automation

Q4) How to run Tests using ExecutionLists?

Ans. ExecutionLists in Tosca can be executed either by pressing the F6 key in the execution section or by selecting the Run option from the context menu. Select the ExecutionLists of your choice using Ctrl + left mouse button to run more than one ExecutionList. Check test object is already started before you run the ExecutionLists.

Q5) What are the ways to run tests in the ScratchBook?

Ans. The ScratchBook allows you to perform trial runs for your test cases. Objects like TestCases/TestCase folders and TestSteps can be run on this. The following options are available to run tests in the ScratchBook:

Run your objects immediately.
Add or arrange objects in the ScratchBook and then run them.

For More Information Visit <a href="https://mindmajix.com/tosca-interview-questions">here</a>

Want to become Tosca Professional? then get trained and Certified at Mindmajix <a href="https://mindmajix.com/tosca-interview-questions">Tosca Certification Training Online</a> Institute.
Blogging For Me
Tags: blog
Published: 2021-01-22 01:17:10

---
canonical_url: https://waylonwalker.com/blogging-for-me
cover: /static/blogging-for-me-xmas2020.png
cover_image: https://waylonwalker.com/blogging-for-me.png
published: true
status: published
tags:
- blog
templateKey: blog-post
title: Blogging For Me
---

I create this blog with one person in mind, me.

## There are others like me

This is not completely selfish, as there are likely many others out there that think similarly to me.  Everyone comes from different backgrounds and varying levels of experience.  In no way do you need to be an expert to create content others will benefit from.

## Accurate

I am as accurate as possible.  I don't know everything, and If I waited for that to happen I would never post, or write at such a high level no one else
(including me) would ever want to read.

Generally, I know that I am directionally accurate for most of the article.  In fact, there is often a part of the article that I don't feel the best about.  It may have been some code that could have been better.  I try to point these things out.  Often when I am honest and point out where I know there is an improvement to be had I get the most welcoming comments, "that was just fine
how you did that", or "I tried that myself and saw a better abstraction.

## Create the articles I want to read

Generally, the articles I want to read are directly relatable to things I am currently working on and vary over time.  Over the last year its been leaning a bit more towards automation with [bash](https://waylonwalker.com/archive/linux), [python](https://waylonwalker.com/archive/python), [kedro](https://waylonwalker.com/archive/kedro) tools.

## On Brand

I try to stay on the brand of who I am.  I remember writing my first articles.  I was trying to be witty, and include funny memes.  That's not me.  I am not a comedian, and generally, memes go right over my head.  I can remember back in High School, I was the one that didn't understand a lot of pop culture and was kinda treated as if I was always living under a rock.  I knew it was true and I owned it, so no one ever got to mean about it.

# Honest, never fake

I will not try to pretend that I know everything.  You may read my blog on occasion and think I know a lot, also possible that you think "wow what an idiot".  I welcome you to share your thoughts and techniques in a positive way. I often cringe at some of my old posts and think about how differently I would approach something not that long after posting.  I honest, never fake know what I need to know, and don't pretend to know anything outside of my wheelhouse.
codeigniter active record help
Tags: codeigniter, activerecord, beginners
Published: 2021-01-22 01:12:59

hello all,
I'm following a tutorial for active record but i get an annoying error "Page not found", I followed the tutorial steps as written the tutorial can be found [here](https://www.guru99.com/codeigniter-active-record.html)
I have no clue what causes the error. Thanks in advance
How to proper pop the Login flow from the back stack using Navigation Component
Tags: android, jetpack, navigation, login
Published: 2021-01-22 00:56:31

After a login flow, for example, you should pop all of the login-related destinations off of the back stack so that the back button doesn’t take the users back into the login flow again.

Let's see the example below where the `startDestination` is the `loginFragment`, which is possible to navigate to the `createAccountFragment` or directly to the `feedFragment`. Once the user access the Feed screen (from the Login or the Create Account screen) the app should pop all the login-related destinations from the back stack so the user can close the app from the Feed as expected.

![Navigation graph](https://dev-to-uploads.s3.amazonaws.com/i/lk1m0t85m13ck3o1gu0e.png)

```xml
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/app_navigation"
    app:startDestination="@id/loginFragment">

    <fragment
        android:id="@+id/loginFragment"
        android:name="br.com.fornaro.app.features.login.LoginFragment"
        android:label="fragment_login"
        tools:layout="@layout/fragment_login">
        <action
            android:id="@+id/createAccountFragment"
            app:destination="@id/createAccountFragment" />
        <action
            android:id="@+id/feedFragment"
            app:destination="@id/feedFragment"
            app:popUpTo="@id/loginFragment"
            app:popUpToInclusive="true" />
    </fragment>

    <fragment
        android:id="@+id/createAccountFragment"
        android:name="br.com.fornaro.app.features.createaccount.CreateAccountFragment"
        android:label="fragment_create_account"
        tools:layout="@layout/fragment_create_account">
        <action
            android:id="@+id/feedFragment"
            app:destination="@id/feedFragment"
            app:popUpTo="@id/loginFragment"
            app:popUpToInclusive="true" />
    </fragment>

    <fragment
        android:id="@+id/feedFragment"
        android:name="br.com.fornaro.app.features.feed.FeedFragment"
        android:label="FeedFragment" />
</navigation>
```

The code that is responsible for this is the `popUpTo` and the `popUpToInclusive` in the `action` tag.

The `popUpTo` should be the destination where the current destination (which is indicated in the `action`) will return when the user leaves from.

The `popUpInclusive` indicates that the destination from `popUpTo` will also be removed from the back stack.

For the code above, the `loginFragment` and `createAccountFragment` use the same `action` to navigate to the `feedFragment`. This way it doesn't matter if the user navigates to the Feed screen from the Login or from the Create Account screen, when the user backs from the Feed the behavior will be the same (removing Login and Create Account from the back stack).
Top 5 DEV Comments from the Past Week
Tags: bestofdev
Published: 2021-01-22 00:37:45

---
title: Top 5 DEV Comments from the Past Week
published: true
description: Highlighting some of the best DEV comments from the past week.
tags: bestofdev
cover_image: https://res.cloudinary.com/practicaldev/image/fetch/s--7VrAA2ln--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/qmb5wkoeywj06pd7p8ku.png
---

This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag.

---

Totally agree with what you had to say about [gaining experience](https://dev.to/madza/how-much-experience-you-had-when-you-got-your-first-dev-job-383n), @_garybell — it comes from someone taking a chance on you!

{% devcomment 1ai2k %}

Ok, ok. So it's kind of messed up to pick my _own_ comment as one of the top five (don't worry — I'm not going to give myself a badge!) But this is an exceptional circumstance because this comment was dedicated to celebrating [the winners of the DigitalOcean App Platform Hackathon on DEV](https://dev.to/devteam/digitalocean-app-platform-hackathon-winners-announced-ig0) 😊 🎉 

{% devcomment 1aekf %}

... winners like @dawntraoz ⭐️  

{% devcomment 1aelk %}

Friendly debates are the heart and soul of DEV. Thanks for providing your take on [Tailwind](https://dev.to/jaredcwhite/why-tailwind-isn-t-for-me-5c90), @jfbrennan!

{% devcomment 1a9he %}

@hb has some open source regrets, but no [regrets about getting _involved_ with open source](https://dev.to/madza/have-you-ever-regretted-going-open-source-308o).


{% devcomment 1ai2d %}

See you next week for more great comments ✌
@willSet/@didSet (sem bugs dessa vez)
Published: 2021-01-22 00:37:26

[Nesse post](https://dev.to/filipebeck/typescript-willset-e-didset-com-decorators-1l7e) eu mostrei um exemplo de implementação do [decorator](https://www.typescriptlang.org/docs/handbook/decorators.html) `@willSet` e `@didSet`. Depois de editar o código 3 vezes devido à bugs, resolvi criar um novo post só postar a versão sem bugs. Estou usando em um projeto de integração da [WebAudio API](https://developer.mozilla.org/pt-BR/docs/Web/API/API_Web_Audio) com [React](https://reactjs.org/). O arquivo é [esse](https://github.com/FilipeBeck/react-audio-engine/blob/develop/src/toolkit/Decoration.ts?ts=2).
Replace comma with newline in VS Code
Tags: programming, productivity
Published: 2021-01-22 00:33:33

ทริกเล็กๆวันนี้คือวิธีที่เราจะแทนที่ `,` (comma) ไปเป็นการขึ้นบรรทัดใหม่ได้ยังไงใน VS Code

เช่นถ้าเรามีข้อความแบบนี้

```
1, 2, 3, 4, 5
```

แล้วอยากเปลี่ยนเป็นแบบนี้

```
1
2
3
4
5
```

เราสามารถทำยังไงได้บางใน VS Code

ง่ายๆคือให้เรากด shortcut ในการค้นหาข้อความในไฟล์ สำหรับ macOS กด command + f แล้วจะเจอ dialog เล็กๆแบบนี้

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

ให้เรากดตรง > ด้านหน้าช่องค้นหา จะเห็นอีกช่องสำหรับใส่คำแทนทีแบบนี้

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

จากนั้นให้เราใส่ `, ` ในช่อง Find เพื่อค้นหา comma และ space หลัง comma

ทีนี้ตรงช่อง Replace เราจะกด enter เลยไม่ได้เพราะจะเป็นการสั่งให้ replace ทันที แต่ในที่นี้เราอยากใส่ newline เราจะทำได้โดยการกด ctrl + enter คือกด ctrl ค้างไว้แล้วกด enter ตามไปนั่นเอง

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

จากนั้นก็กด enter อีกทีเพื่อสั่ง replace เราก็จะได้ผลลัพธ์ตามที่ต้องการแล้ว

<a href="https://www.buymeacoffee.com/weerasak" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
Easy has_secure_password Rails API Authentication
Tags: ruby, rails, authentication, javascript
Published: 2021-01-22 00:02:59

---
title: Easy has_secure_password Rails API Authentication
published: true
description: Ruby: Easy has_secure_password API authentication
tags: 
- ruby
- rails
- authentication
- javascript
---

I had a very simple API I needed to build, to be consumed by a Nuxt.js application. This sent me down a path of trying to find a simple way to authenticate against an API, using an email/password.

{% twitter 1350422471380529152 %}

However, as I tried more gems and libraries, I quickly found that they were one of the following:

- Way over complex
- Broken
- And/or unmaintained

After speaking with @marcqualie about this, I discovered that he needed something similar. So we decided to quickly put together a library that we could use in our projects.

Introducing Tokenable:

{% github tokenable/tokenable-ruby %}

Tokenable is a Rails gem that allows API-only applications a way to authenticate users. This can be helpful when building Single Page Applications, or Mobile Applications.

Setting it up with your existing auth system is simple, and using it from a JavaScript application, or mobile application is even more simple. 

Once it's set up, all you need to do is send an email/password to the endpoint we provide you, and it will return a JWT token. This token can then be used to authenticate all future API calls.

Here is an example in Axios:

```js
const { data } = await axios.post("https://example.com/api/auth", {
  email: "email@example.com",
  password: "coolpassword123",
});

const token = data.data.token;
const user_id = data.data.user_id;
```

You then use this token in all future API requests:

```js
const { data } = await axios.get(`https://example.com/api/user/${user_id}`, {
  headers: { Authorization: `Bearer ${token}` },
});
```

Tokenable also supports Devise and Sorcery out of the box, but it can work with any auth system (or no auth system at all).

Let us know any feedback you have, and feel free to submit any issues you face.
Automatic Dark Mode for Your Website
Published: 2021-02-16 20:14:18

---
title: Automatic Dark Mode for Your Website
published: true
date: 2021-01-22 00:00:00 UTC
tags: 
canonical_url: https://www.gonsie.com/blorg/auto-dark-mode.html
---

With HTML5 filters and media quieries, it’s simple to enable an automatic dark mode on your website. Use the following CSS snippet:

```
@media (prefers-color-scheme: dark) {
  html {
    filter: invert(1) hue-rotate(180deg);
  }
}

```

It’s not perfect, but rather a quick and dirty way to stop blinding yourself when you’re editing your website at 2 am.
How to show the strings in raw format using the String.raw template literals tag function in JavaScript?
Tags: javascript
Published: 2021-01-22 00:00:00

---
  title: How to show the strings in raw format using the String.raw template literals tag function in JavaScript?
  published: true
  tags: JavaScript
  date: Fri Jan 22 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/show-strings-in-raw-format-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-e4ff97ecf3bf18b4d045a2f0048127b0.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/show-strings-in-raw-format-javascript)
  
Consider a scenario where you have a simple normal string like this,

```js
// Simple String
const simpleString = "Hey, I'm a simple string!";

// OUTPUT: "Hey, I'm a simple string!"
```

Nothing fancy at all. The output will be shown in the same line.

Now if you add an escape character `\n` (newline) like this anywhere in the string, so that when the JavaScript engine executes the code it will move the string to a new line where it is encountered.

```js
// Simple string with a newline escape character
const simpleString = "Hey,\n I'm a simple string!";

// OUTPUT:
// "Hey,
// I'm a simple string!"
```

Here the string is in a new line.

What if we don't' want this to happen and need to show the escape character `\n` too in the output.

For that, we have something called the `String.raw` tag function of template literals.

We can wrap the above string in template literals tag function `String.raw` like this,

```js
// Simple string with a newline escape character
// But wrapped in String.raw tag function
const simpleString = String.raw`Hey,\n I'm a simple string!`;

// OUTPUT:
// "Hey,\n I'm a simple string!"
```

Now the output will also contain the escape characters as we wrote in the string. The `String.raw` tag function ignores all kinds of escape characters and uses the string in its raw format without adding or doing any formatting in the string.

See these examples live in [JSBin](https://jsbin.com/seniwuzupu/2/edit?js,console).

### Feel free to share if you found this useful 😃.

---