teleren/devto huggingface dataset:
Error running node server
Tags: node, mssql
Published: 2021-08-23 07:36:47

I'm quite new to node js. following the tutorial in the link below, with few changes according to my work I was able to run node the first time but on further coding I have been getting this error and can't seem to find any help in my searches on google

https://developer.okta.com/blog/2019/03/11/node-sql-server

The error message I'm getting is below:
assert.js:386
    throw err;
    ^

AssertionError [ERR_ASSERTION]
    at Object.<anonymous> (C:\Users\xxx\Documents\LeaveApp\Leaveform\js\src\config.js:30:1)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\xxx\Documents\LeaveApp\Leaveform\js\src\index.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: '',
  expected: true,
  operator: '=='


Below is my config and .env:

config.js

"use strict";

const assert = require( "assert" );
const dotenv = require( "dotenv" );

// read in the .env file
dotenv.config();

// capture the environment variables the application needs
const { PORT,
   HOST,
   HOST_URL,
   COOKIE_ENCRYPT_PWD,
   SQL_SERVER,
   SQL_DATABASE,
   SQL_USER,
   SQL_PASSWORD,
} = process.env;

const sqlEncrypt = process.env.SQL_ENCRYPT === "true";

// validate the required configuration information
assert( PORT, "8080" );
assert( HOST, "localhost" );
assert( HOST_URL, "http://localhost:8080" );
assert( COOKIE_ENCRYPT_PWD, "xxxxxxxxx" );
assert( SQL_SERVER, "xxxxxx" );
assert( SQL_DATABASE, "xxxxxx" );
assert( SQL_USER, "xxxxxxx" );
assert( SQL_PASSWORD, "xxxxx" );

// export the configuration information
module.exports = {
   port: PORT,
   host: HOST,
   url: HOST_URL,
   cookiePwd: COOKIE_ENCRYPT_PWD,
   sql: {
       server: SQL_SERVER,
       database: SQL_DATABASE,
       user: SQL_USER,
       password: SQL_PASSWORD,
       options: {
           encrypt: sqlEncrypt
       }
   }
};

.env

# Set NODE_ENV=production when deploying to production
NODE_ENV=development

# hapi server configuration
PORT=8080
HOST=localhost
HOST_URL=http://localhost:8080
COOKIE_ENCRYPT_PWD=xxxxxx

# SQL Server connection
SQL_USER=xxxxx
SQL_PASSWORD=xxxxx
SQL_DATABASE=xxxxxx
SQL_SERVER=xxxxxx
# Set SQL_ENCRYPT=true if using Azure
SQL_ENCRYPT=false

Any assistance would be appreciated
Open a Folder in Visual Studio Code via Terminal
Tags: vscode, macos
Published: 2021-08-23 07:27:05

## Install 'code' command in PATH

* Launch Visual Studio Code.
* Open the Command Palette by navigating through `View > Command Palette` or by pressing the keyboard shortcut, `command + shift + P`.
* Type `shell command` and click on the `Shell Command: Install 'code' command in PATH` command.

## Open folder using the 'code' command

* For the new `$PATH` value to take effect, relaunch Terminal.
* Open folder by providing the path as an argument to the `code` command:
```
$ code projects/my-first-project
```
* Or use `.` upon navigating to the desired directory:
```
$ code .
```

## Reference:
1. [Visual Studio Code on macOS - Launching from the command line](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line)
Writing an well-established Research Paper- Great Assignment Help

Published: 2021-08-23 06:57:10

Why do we need a research paper help? The experts in the research papers intervene and discuss the topic generously so that good productive work is being reached with the highest and best potential of work. After completing a masters degree in your specified subject or course if you want to proceed forward with the academic course then a PhD is necessary. For a PhD, one needs to write a well-established research paper so that the professors are attracted and like your topic or subject then only they will be enthusiastic to work with you. A research paper is written both in a digital format and another in hardcopy format. But due to a few reasons like - distance and we are more technological savvy. Writing an excellent well-established research paper is the need of the hour https://www.greatassignmenthelp.com/research-paper-help/
HTML tags | br
Tags: html, tags, br
Published: 2021-08-23 06:39:37

It is used to **introduce a line break in a text**. It is useful for writing addresses or poems, for example, where line division is important.

**You do not have to use it to create space between texts**, for this you have to use different `<p>` and control the `margin` with CSS. Separating paragraphs using `<br>`, in addition to being a bad practice, **can pose a problem for screen reader users** by causing a confusing and frustrating experience when advertising content.

Being a tag with such a specific purpose, it has no dimensions or visual output in the browser, so **there is little that can be done to style it**. `margin` could be used to increase the space between lines of the text but it's bad practice, that's what the CSS `line-height` exists for.

It can be written as `<br>` or as `<br />`.

- Type: *inline*
- Self-closing: *Yes*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br) | [Support](https://caniuse.com/mdn-html_elements_br)
Planificación y gestión del proyecto
Tags: gestion, proyecto, planificacion
Published: 2021-08-23 05:54:35

Un factor esencial en la planificación de proyectos es la estimación, ya que nos ayuda a tener una mejor claridad sobre el esfuerzo requerido, la duración, y costos del proyecto, existen diferentes técnicas para la estimación de proyectos en las que se deben considerar principalmente el tipo de proyecto y su complejidad.
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 28
Tags: php, javascript, webdev, tutorial
Published: 2021-08-23 04:09:11

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.

In this video,we will be  redirecting unverified users to verification page

{% youtube t9clnpqCtd4 %}

In this video,we will be  downloading adminlte dashboard

{% youtube O5rN9wp9sCc %}


If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
LeetCode 133. Clone Graph
(javascript solution)
Tags: algorithms, javascript
Published: 2021-08-23 04:03:42

###Description:

Given a reference of a node in a connected undirected graph.

Return a deep copy (clone) of the graph.

Each node in the graph contains a value (int) and a list (List[Node]) of its neighbors.

class Node {
    public int val;
    public List<Node> neighbors;
}
 

Test case format:

For simplicity, each node's value is the same as the node's index (1-indexed). For example, the first node with val == 1, the second node with val == 2, and so on. The graph is represented in the test case using an adjacency list.

An adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a node in the graph.

The given node will always be the first node with val = 1. You must return the copy of the given node as a reference to the cloned graph.

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
// DFS approach
var cloneGraph = function(node) {
    // Nodes we have already copied
    const visited = {};
    
    // DFS function to copy graph
    const dfs = (node) => {
        if (!node) return node;
        // If we have seen this node before, return it
        if (visited[node.val]!=null) return visited[node.val];
        
        // Create base for copied node
        const root = new Node(node.val);
        // Add this copied node to group of nodes we hav copied
        visited[node.val] = root;
        
        // Add copied neighbors to the current copied node
        node.neighbors.forEach(n => root.neighbors.push(dfs(n)))
        return root;
    }
    
    // Return new copied graph
    return dfs(node);
};
```
2021 JavaScript framework
Tags: react, vue, svelte, solidjs
Published: 2021-08-23 03:45:32

2021 is very different from previous years. Many web frameworks have released their new versions. Let's discuss them.

### Vdom-based

For example, React, Vue and Preact all belong to this category.

This is also the most mature framework. Their advantages are mature, stable and suitable for most scenarios.

With SSR and partial hydration, react 18's fizz renderer is very interesting.

In addition, such as concurrent mode, scheduling optimization has been discussed for many years.

Fre is a little soldier in this camp. It is the smallest but the fastest.

https://github.com/yisar/fre

### Compilation instead of runtime

Svelte, solidjs belongs to this category.

I always think that the web does not need to be optimized to the extreme, but the code architecture needs to be pursued unilaterally.

So I prefer Svelte a bit. Compilation and runtime should not coexist, which will make the framework more messy and mediocre.

Solidjs and Vue3 do not do this well. They have compilation and want to runtime. They can't have both fish and bear's paw.

### Html first

History is reversing，recently, some frameworks want to return to HTML, away from vdom and away from compilation.

Such as Qwikjs and Alpinejs. They are enhancing HTML, Sprinkling intead of Hydration.

This does fill a part of the cake, but the performance will be lost. For example, alpine has always ranked last in the benchmark.

### Summary

I like all three ideas. How about you?

Using one of them is entirely determined by my work.
How To Generate Barcode In Laravel
Tags: laravel, generate, barcode, php
Published: 2021-08-23 03:30:25

Today we will see how to generate barcode using milon/barcode package. here, i will use milon/barcode package and implement it in our laravel barcode example. milon/barcode package provide many functionalities and diffrent options to generate barcode,

So, Let's start and follow below step to get output.

> Step 1 : Install Laravel
> Step 2 : Install milon/barcode Package In Your Laravel Application
> Step 3 : Add Service Provider And Aliase
> Step 4 : Create Controller
> Step 5 : Add Route
> Step 6 : Create Blade File for View

And Finally you will get output like below screen print.

![How To Generate Barcode In Laravel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xuh5vcg3a573xvsyku05.png)

---

> **_[Read More : How To Generate Barcode In Laravel](https://techsolutionstuff.com/post/how-to-generate-barcode-in-laravel)_**

---

> **_[Read Also : How To Generate QRcode In Laravel](https://www.techsolutionstuff.com/post/how-to-generate-qrcode-in-laravel)_**
Hack Reactor Week 3 Recap
Published: 2021-08-23 03:25:46

This week is React week! We started the week off with an introduction to React and learned how to build a mini app that searches for video using YouTube API and updates the video player as the user changes the search input. This was a very interesting project but also a leap from previous concepts since we have not had experience with React up until now. I had to consult Help Desk multiple times and I really appreciate the help that the staff provided to guide me through the sprint. The next sprint we had was converting our React app to a React-Redux app. It was not a very tough sprint, however, it seemed like Redux created more work and was more complicated to configure. Redux and React have different structures with how they want to handle the application state and there are both pros and cons to each of the frameworks. We wrapped the week up with learning about Node. Although conceptually it was not hard sprint, it was challenging to start off with the lack of familiarity with Node documentation and syntax. We created a server for our chatterbox client that we created last week for our AJAX, jQuery sprint. It was very fulfilling able to see how the frontend ties in with the server to provide an interactive application that one might use on a daily basis.
Ranging - library for ranges
Tags: javascript, node
Published: 2021-08-23 03:17:37

## Links
npm: [``ranging``](https://www.npmjs.com/package/ranging)
GitHub: [``Crinax/ranging``](https://github.com/Crinax/ranging)
## Introduction
Have you ever worked with the ``range`` function in ``Python``, or maybe heard of it? If you haven't, let me explain a bit. This function is used to create a range, with a number of arguments ranging from 1 to 3. If you give 1 argument, the function creates a range ``[0; n)``, where ``n`` is a given number. If you set 2 arguments, they are treated by the function as the start and end of the range, e.g: ``range(1, 10)`` - will create range ``[1, 10)``. If you set 3 arguments, the function will treat the third argument as a step.
Although I don't have much experience in working on any heavy projects. However, I noticed all the time that almost no one uses generators in JavaScript, although they can do a lot of useful things.

## Problem
Lack of useful generator-based functions in vanilla ``JavaScript``.

## Briefly about development
When I applied for a job as a programmer, I was given a test assignment in which I had to create tasks by dates. And then I thought how nice it would be to be able to generate a date range in a couple of lines. So I had the idea to create this library.

At first the development was done through the ``for`` loop and the ``yield`` operator. Later a friend of mine suggested that I add my own iterable classes. My own iterable classes allowed me to add more functionality.

During the creation, I constantly consulted with my friend, who helped me in many ways, for example, he is the owner of the function that allows you to correctly add floating point numbers. Thanks to him you can create ranges of floating point numbers with this library without fear.

## A few examples

For a range of one type alone, there are 6 creation options. As the saying goes: "Everyone to his own taste".

```javascript
const { Range, NumberRange } = require('ranging');

// Range [0; 9]
// 1 variant
const r = [...Range.numbers(9)];

// 2 variant
const a = [...Range.numbers({ end: 9 });

// 3 variant
const n = [...Range.numbers().end(9)];

// 4 variant
const g = [...new NumberRange(9)];

// 5 variant
const e = [...new NumberRange({ end: 9 })];

// 6 variant
const d = [...new NumberRange().end(9)];
```

## Conclusion
As you can see, my library allows you to quickly create an array of numbers, symbols, dates. You can find more information on how to use it on GitHub under [links](#links)
Hack Reactor Week 2 Recap
Published: 2021-08-23 02:50:04

We kicked off the week by learning about inheritance pattern and how to use it in both pseudoclassical style as well as ES6 style. We had a fun sprint called subclass dance party where we created different subclasses of dancers who perform different actions on the dance floor using HTML, jQuery, and CSS. We then started our sprint on algorithms. This was an interesting sprint where we learn more about visualizing a problem and breaking it down into smaller parts to construct an algorithm that we could implement as code. This complemented the interview challenges/toy problems that we have just started this week and helped me to be able to solve these problems more effectively. We wrapped up the week with a sprint on jQuery and AJAX where we constructed a frontend chat client that would retrieve and send messages to a server and display it in the browser. This is the toughest sprint so far because we have to understand the data structures that we want to store the data on our frontend framework and also the interactions between the client and the user. We learned about the MVC model and how to develop a clear UI.
Electron Adventures: Episode 28: Vue
Tags: javascript, electron, vue
Published: 2021-08-23 02:06:30

We tried jQuery, D3, React, and Svelte, so let's try another framework with Electron - Vue.

### Create new Vue project

As usual, we do the same steps - create a new project, then add Electron:

```
$ npx @vue/cli create episode-28-vue
$ npm i --save-dev electron
```

`@vue/cli` asks a bunch of questions about what you want, and as far as I can tell, any of them work just fine with Electron. I picked Vue 3 and disabled most of the extras, but if you want to follow along, customize it to your liking.

Then I removed most of the files I didn't need, and only kept or added the ones below.

### `index.js`

A small Electron backend file to start our app. It's identical to our Svelte and React versions, except for different default port number again:

```javascript
let { app, BrowserWindow } = require("electron")

function createWindow() {
  let win = new BrowserWindow({})
  win.maximize()
  win.loadURL("http://localhost:8080/")
}

app.on("ready", createWindow)

app.on("window-all-closed", () => {
  app.quit()
})
```

### `public/index.html`

This one is completely unchanged from `@vue/cli`.

```html
<!DOCTYPE html>
<html lang="">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title><%= htmlWebpackPlugin.options.title %></title>
  </head>
  <body>
    <noscript>
      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
```

### `src/main.js`

This one is also unchanged other than making coding style match the rest of the series with double quotes:

```javascript
import { createApp } from "vue"
import App from "./App.vue"

createApp(App).mount("#app")
```

### `src/App.vue`

I removed most of the stuff newly created app starts with and only left very basic one:

```html
<template>
  <h1>Welcome to Vue + Electron!</h1>
</template>

<script>
export default {
  name: "App"
}
</script>

<style global>
body {
  background-color: #444;
  color: #fff;
}
</style>
```

### Start!

You need two terminals to run:

```shell
$ npm run serve
```

And:

```shell
$ npx electron .
```

### Result

Here's the results:

![Episode 28 screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ctp2m2ait6k675hivt3.png)

In the next episode we'll try to make Vue app match what we did with Svelte so far.

As usual, [all the code for the episode is here](https://github.com/taw/electron-adventures/tree/master/episode-28-vue).
WKWebView persistent cookies open source solution and other useful things for WKWebView
Tags: ios, swift, webview, wkwebview
Published: 2021-08-23 02:03:47

iOS WKWebView webview App Template with fully working persistent cookies functionality (httpcookie, web cookie, browser cookie), custom status bar background color, option for white/black status bar text color, option to disable pinch to zoom and double tap to zoom in webview

You have probably noticed that by default iOS WKWebView resets all cookies if you swipe app off memory or every time app is reloaded and new app session started

This WKWebView app template has a solution and a fix to preserve and save cookies to provide expected functionality from web apps

README.md also includes instruction how hide visibility of scroll bar and enable iOS smooth scrolling (you do it in CSS code of your web content, not in the Swift part of the iOS app)

[GitHub public repository ilyaminichev/iOSWKWebViewAppTemplatePersistentCookiesWorkLikeACharm](https://github.com/ilyaminichev/iOSWKWebViewAppTemplatePersistentCookiesWorkLikeACharm)
Past 10 years, I finally got into a Hackathon
Tags: hackaton, career, challenge
Published: 2021-08-23 01:46:18

---
title: Past 10 years, I finally got into a Hackathon
published: true
description: Never to late to experiment something new (to you) in your career
tags: hackaton, career, challenge
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3dd73fyshsxpzu8i4j1z.png
---

I am completing 10 years of my Software Engineering graduation and last week I was able to participate in my first Hackathon. 
I do not recall it as so popular in SWE courses by the old times as it is nowadays, but I do not doubt I missed some opportunities during graduation too. Fact is that 6 years in the oil industry made me miss this moment where every SWE student had a solid track of Hackathons she/he has engaged in. 
As I came back to the SWE career I certainly belong to, very soon I had the opportunity to work at VTEX Hackathon and my first reaction was "I feel to old to work overnight eating snacks and drinking soda". I was 30. Behind that feeling, there were layers of insecurity about my capacity of learning something new and contributing in a constrained amount of time. I respect my sense of guarding myself by then: overcoming ghosts is a process, and a career change cannot be seen as something simple.. everybody has their pace for assimilating the new place and feel belongingness.
> **_FUN FACT:_**  :stuck_out_tongue: In this meanwhile I helped organize and mentored VTEX's partners Hackaton in the biggest event of the company, the VTEX Day. :woman_shrugging:

Now, 3 years later, it was time to debut! It was another VTEX Hackathon, and we had 2 days to cover an interesting idea for the company. It was SO. MUCH. FUN! It is like daily work but much more chilled out. Felt fresh, easy-going, and made me connect with all the things that makes me believe that SWE is my thing. It was a time to create/reinforce connections with colleagues and learn interesting things. Worths mentioning that I also felt proud about the results.
We used [Gather Town](https://www.gather.town/) to simulate the office environment and the experience close enough to working in presence. Loved it!

I must say that I am not sure I will make it to other hackathons.. I really feel a bit old for that :satisfied:. But most of my adventures started with something I was a bit old to be doing.