teleren/devto huggingface dataset:
COBOL - not dead; not dying; not even idle
Tags: language, cobol, legacy
Published: 2019-09-04 07:42:08

COBOL is still alive and kicking. There are still millions of lines of it running around the world. There is still a [market](https://www.indeed.com/q-Cobol-Programmer-jobs.html) for COBOL programmers. And there's a good, free, open-source compiler that anyone with a Windows, Mac or Linux machine can use.

See [GnuCOBOL](https://www.arnoldtrembley.com/GnuCOBOL.htm) which is still being actively developed. For those of you who know what USENET is (not was!), there's still stuff happening on [comp.lang.cobol](https://groups.google.com/forum/embed/#!forum/comp.lang.cobol).
Dynamically requiring all routes in express app
Tags: node, express, webdev, routes
Published: 2019-09-04 07:10:22

---
title: Dynamically requiring all routes in express app
published: true
description: 
tags: nodejs,expressjs,webdevelopment,routes
cover_image: https://miro.medium.com/max/1200/1*EKW3XazCN98jcVrlEP3H8g.png
---

If you are using express framework for developing a web application , you might be familiar with the concept of routing and how it plays an important role in your app. Routing refers to how an application’s endpoints (URIs) respond to client requests. For an introduction to routing, see Basic routing.
You define routing using methods of the Express app object that correspond to HTTP methods;
For example, app.get() to handle GET requests and app.post to handle POST requests. For a full list, see app.METHOD. You can also use app.all() to handle all HTTP methods and app.use() to specify middleware as the callback function (See Using middleware for details).
I like to fragment my routes in separate files and like to require them in the root js file. This not only improves your code readability but also makes debugging alot easier as it is easy to pinpoint the exact location in the exact file instead of going through bulk of codes in a single file.
To use your fragmented routes , you have to require them similar to a nodejs module and put it inside app.use . This is simple if your routes folder has a couple of routes but if you are talking about a webapp of a large scale, there may be a dozen or more routes files which means you have to require each files and the app.js file gets populated with the code for reqiring your routes .
Also if there are multiple routes , there may be a possibility that you may forget to use a route.
So a quick hack would be to use dynamic routing which automatically requires all your routes in routes folder thus reducing the code and 
requiring the routing easier.

```javascript
/**
* Dyanmic Routing
* Adds all routes from routes folder
*/
fs.readdir("./routes", (err, files) => {
files.forEach(file => {
app.use("/", require("./routes/" + file))
});
})
```
Here we have used the filesystem module to read all files from routes folder and using them in instance of express app.
The Best Fundraising Ideas 
Tags: gofundme, crowdfunding, crowdfundingscript
Published: 2019-09-04 06:17:49

Let go to know about the Fundraising. This is the procedure of collecting voluntary contributions of money or other e-source, by requesting funds by cash or e-payment from individuals, businesses, charitable foundations, and governmental agencies. The fund-raising concept is nothing but the effort for gathering the fund for any type of project or social cause.

Fundraising is the best way to get the money from <a href="https://www.logicspice.com/crowdfunding-script">crowdfunding software</a>. The organisation can be profit-making or non- profit organisation. The non-profit organisation used the money for some cause or for development. 
They used to interact with the investor and explain their ideas to them and ask for investing in the project and share the profit.


A. Crowdfunding: 

It is very much strong online tool for the fundraiser from crowdfunding software which is develop easily with help of the best <a href="https://www.logicspice.com/crowdfunding-script">Crowdfunding Script</a> . It is just much similar to develop the website and make promotion over Facebook on which different types of videos, images, and project are posted daily. If the investor shows the interest in them they used to invest in the particular project. It would be for profit making organisation and for non-profit making organisation.

B. Direct Mail Donation Method:

The fund-raiser contact the investor through the mails and other method they used to explain about there project on the mail and asked them for the investment.

C.Peer-to-Peer Fundraising:

It is a very popular approach to raise the fund on your nonprofit organization’s behalf. In which our supporter community can use their power to quickly reach its fundraising aim by making new connections peer.

D.Event

It is the most popular idea of fundraising. By organising the events like walkathon, gala or charity auction, the organiser can collect the fund from the events.

E.Direct Ask

In this direct us method individual or group of people directly ask individual supporters for money or donation. It is best to clearly approach what you are raising money for when individual ask.
What are the books that helped shaping your career?
Tags: discuss, career
Published: 2019-09-04 05:35:40

---
title: What are the books that helped shaping your career?
published: true
tags: discuss, career
---

Mine are:

- The Pragmatic Programmer by Andy Hunt
- Code complete by Steve McConnell
- Clean Code by Robert Martin
- Refactoring (and its second ed.) by Martin Fowler

Name your own!
NodeJS-Finding your console logs with console-form
Tags: javascript, npm, node
Published: 2019-09-04 04:47:18


As a javascript developer, you probably use console.log or console.error a lot, it's the fastest way to debug and it's one of the first things you learn to code when you start with javascript,

But what happens when you have to do many consoles in different places in order to debug, or you have a big app with many consoles and you want to delete some of them,

well this is what [console-from](https://www.npmjs.com/package/console-from) was designed to do. you just require it at the start of your app and from now on all your consoles will show you there location 

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/braylepyyhhhphzzd7co.png)
Jumping-off point for an experienced techie 
Tags: motivation, writing
Published: 2019-09-04 03:53:42

This is my first post at Dev.to and I kind of like wanted to write a small piece as a reminder for the future on how I started writing about technology.

I have been in technology side of the world from quite a long time and keep learning new tech everyday but seldom do I write about it.
So, I have decided I will start writing about my experiences with other techies out there and contribute my little knowledge to the world.

Wish me luck!
On VUI
Tags: vui
Published: 2019-09-04 03:20:41

On VUI (Voice User Interface)

ช่วงนี้สนใจเรื่องอยู่เรื่องหนึ่ง คือการออกแบบ UI ที่ไม่มีหน้าจอ

นี่น่าจะเป็นส่วนหนึ่งของ Universal Design เรากำลังเปลี่ยนโลกเป็นดิจิตอลที่แทบทุกอย่างสามารถทำได้บนมือถือ  

และก็เช่นเดียวกับสิ่งของรอบกายที่สัมผัสได้  ประสบการณ์บนหน้าจอที่คนรุ่นใหม่คิดว่ามันง่าย  ก็เป็นเรื่องที่เป็นไปไม่ได้สำหรับคนหลายกลุ่ม เช่นคนพิการทางสายตา คนสูงอายุที่เรียนรู้สิ่งใหม่ได้ช้า (...เอาจริงๆอาจจะไม่แย่ขนาดนั้น เพราะผู้สูงอายุรอบตัวเล่นไลน์กันคล่องมาก)

และวันก่อนได้คุยกับเพื่อนเก่าแก่คนหนึ่งที่ตอนนี้ทำบริการ ChatBot เลี้ยง Bot เหมือนพัฒนาพฤติกรรมสัตว์เลี้ยงอะไรสักอย่าง train มันให้สามารถโต้ตอบกับผู้ใช้ เพื่อนเล่าว่า Bot มี 2 แบบ คือ แบบที่ถูกสอนได้โดยคนที่ถูกกำหนดเท่านั้น กับ Bot ที่พัฒนาพฤติกรรมไปตามผู้ใช้เลย ซึ่งพวก Bot ธนาคารหรือองค์กรจะใช้แบบที่สองไม่ได้ เพราะอาจจะมีขาป่วนแกล้งเข้าไปด่า Bot ทุกวันจนกลายเป็น Bot นิสัยไม่ดี 

ตอนนี้เวลาเราติดต่อไปแชทกับ Call Center ก็คือคุยกับ Bot หมดแล้ว​​  ฉันนึกถึงเพื่อนคนหนึ่งที่เคยมาปรึกษาว่าบริการของบริษัทนี้ไม่ดีเลยเพราะติดต่อเข้าไปหาเจ้าหน้าที่คนนึง แล้วเค้าก็หายไป พอติดต่อเข้าไปก็เจอกับอีกคนนึงซึ่งไม่สามารถสานต่อเรื่องได้ วนไป ก็คงงั้นแหละแกคุยกับ Bot อยู่อ่ะ

ต่อไป Bot จะไม่ใช่แบบแชทแล้ว  แต่จะเป็น Bot ที่พูดคุยได้เลย ไม่ใช่แบบ ติดต่อโอเปอเรเตอร์กดหนึ่ง กดสองนะ แต่เป็นแบบที่คุยได้จริงๆเหมือนคน มันแยกได้จาก keyword ที่เราพูดว่าเราต้องการจะไปไหน ซึ่งนั้นเป็นสิ่งที่น่าสนใจ เพราะฉันรู้สึกว่า Wireframe หลังบ้านก็คงเหมือนตอนทำ UX UI นี่แหละ แต่ให้น้ำหนักไปทางประสิทธิภาพการสื่อสาร มากกว่าความสวยงามของกราฟิก

หรือสมัยตอนอยู่อเมริกาบ้านเพื่อนมีเครื่อง Alexa เค้าก็ชอบเล่นกับมันว่า Alexa! tell me some jokes. แล้วอิเครื่องพูดได้ก็จะไปขุดเรื่องตลกสไตล์อเมริกันมาจากไหนไม่รู้ นั่นก็เป็นประสบการณ์ VUI แรกๆที่ฉันรู้จัก

ก็เลยคิดได้ว่า ยังมีพื้นที่อีกเยอะสำหรับ Universal Design ในเชิง Digital experience เพราะเราอยากทำให้โลกดีขึ้นสำหรับทุกคนเท่ากัน  + เพราะโอกาสสำหรับธุรกิจที่จะจับคนกลุ่มนี้ก็น่าจะเยอะด้วย มานึกดูแล้ว คนและสถานการณ์ต่างๆที่ไม่สามารถใช้ UI มือกดได้  มันมีเยอะกว่ามากเลย

ฉันนึกภาพว่าถ้า VUI มันเวิร์กจริงๆ อีกหน่อย  คนก็คงพูดกับตัวเองเยอะขึ้น  เดี๋ยวนี้ฉันพูดว่า  ฝนจะตกมั้ยนะ  มันก็เป็นแค่พูดเปรยๆกับตัวเอง  แต่อีกหน่อยอาจจะมี wearable device ที่ตอบฉันมาเลยว่า โอกาสที่ฝนจะตกตอนคุณเลิกงานคือ 70%

ลองดูตัวอย่างได้ตามโพสต์ด้านล่าง

https://medium.muz.li/voice-user-interfaces-vui-the-ultimate-designers-guide-8756cb2578a1
Basic Javascript: Removing Duplicates from an Array
Tags: beginners, programming, javascript
Published: 2019-09-04 02:45:02

---
title: Basic Javascript: Removing Duplicates from an Array
published: True
cover_image: https://thepracticaldev.s3.amazonaws.com/i/mjjfwxxnpczifpuswtsc.jpeg
tags: beginner, programming, javascript
---

As someone who is currently looking for a software developer job, I know just how important it is to have a solid foundation when it comes to coding. Although practicing for coding challenges that test these fundamentals might not be the most exciting, they are definitely practical by making your brain think in different ways. I thought that it would be helpful for me personally and for anyone reviewing for those technical interviews to go back to the basics and touch on some core topics. For this week, I wanted to come up with multiple ways to remove duplicates within an array.

### **1. filter()**
```javascript
function removeDuplicates(array) {
  return array.filter((a, b) => array.indexOf(a) === b)
};
```

### **2. forEach()**
```javascript
function removeDuplicates(array) {
  let x = {};
  array.forEach(function(i) {
    if(!x[i]) {
      x[i] = true
    }
  })
  return Object.keys(x)
};
```
Checks to see if each element in the array is unique.

### **3. Set**
```javascript
function removeDuplicates(array) {
  array.splice(0, array.length, ...(new Set(array)))
};
```
Creating a new Set stores unique elements from the array. The easiest way in my opinion

### **4. map()**
```javascript
function removeDuplicates(array) {
  let a = []
  array.map(x => 
    if(!a.includes(x) {
      a.push(x)
    })
  return a
};
```
Maps through the array and adds unique elements to a new array.

I hope some people found this helpful! What are some other solutions that you guys can think of?
Social Network ideas and MVP development phases, don't hesitate if you can help
Tags: discuss, webdev, help, beginners
Published: 2019-09-04 02:40:11

Hello Guys,
I hope you are doing well, so am a Computer Science Student In Tunisia. am working on a personal project to develop a community platform and i found some problems. i think that you can answer me, 
So please can you answer this question from your perspective, social network you made and it would be great if you hold a startup with this kind of project:

- What's the process to make your platform from scratch ( Idea Phase until now)?
- what's the used framework?
- how do you manage to get users and how they are pleased to sign up and give you their information, what's your motivation for them?
- what's your biggest problem in the development of social network platform?
- what are the main component of social network MVP?
- how much it take in general to make the MVP?
- any other information that may help?
thx for your time :D
When to put a non-clustered index on your clustering key
Tags: sql, sqlserver, indexes
Published: 2020-01-01 14:50:48

---
title: When to put a non-clustered index on your clustering key
published: true
date: 2019-09-04 01:17:14 UTC
tags: sql, sqlserver, indexes
canonical_url: https://am2.co/2019/09/when-to-put-a-non-clustered-index-on-your-clustering-key/
---

[![](http://am2.co/wp-content/uploads/david-kohler-vIi2aNfPQ00-unsplash.jpg)](https://www.youtube.com/watch?v=uvWL6_A7uQc)<figcaption id="caption-attachment-2121">These vines are clustered by Cabernet Sauvignon.</figcaption>

#### First off, let’s remember the difference between clustered & nonclustered indexes

The **clustered index** is organized by the key columns. It also includes every other column as part of the row structure (ie, it has the entire row).

The **nonclustered index** is also organized by the key columns. It implicitly includes the clustering key columns (if the table is clustered), or a pointer to the row (if the table’s a heap). If any `INCLUDE` columns are explicitly specified, they will also be included in the index structure (but these included columns don’t affect order).

## Should I ever have both on the same columns?

There is a corner case where it makes sense to have a non-clustered index “duplicating” the clustered index. If you have a query that frequently _scans_ the table, and ONLY makes use of the clustering key column, the query optimizer will prefer to use the non-clustered index. The non-clustered index does not contain the full row data, and thus it will take up less physical space. Because it takes up less physical space, SQL Server can scan the table with fewer IOs, and will make use of it for performance reasons.

I’ll also note that SQL Server will tend to make the same decision on a _seek_: If two indexes are both [covering](https://sqlsunday.com/2013/02/24/covering-indexes/), it will choose to use the one that takes up the least space.

You can query `sys.dm_db_index_usage_stats`, you can see the number of `user_seeks` and `user_scans` on the two indexes. This will help you see how the two indexes are being used, and determine the usefulness of the two indexes.

## OK, I don’t have that corner case, which one should I drop?

As a general rule, most tables should have a clustered index. (That’s a whole other topic). Without knowing any details about your index usage or data access, I’d guess that if you were to drop one, you would drop the nonclustered index.

Depending on the clustering key, the data, the data access patterns, etc., the most correct answer might be to drop the clustered index and create a different clustered index. You may want to read more on [Effective Clustered Indexes](https://www.simple-talk.com/sql/learn-sql-server/effective-clustered-indexes/).

The post [When to put a non-clustered index on your clustering key](https://am2.co/2019/09/when-to-put-a-non-clustered-index-on-your-clustering-key/) appeared first on [Andy M Mallon - AM²](https://am2.co).
Why Do They Call It “Serverless” If It Runs On A Server?
Tags: aws, serverless
Published: 2019-09-17 15:02:37

---
title: Why Do They Call It “Serverless” If It Runs On A Server?
published: true
tags: aws, serverless
canonical_url: https://glennstovall.com/why-do-they-call-it-serverless/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/onk372iedeiofqawwypo.jpg
---

Serverless computing still relies on code running on servers, so why did everyone decide on this nonsense name? It makes sense once you understand the connotation. Let’s take a look a closer look at the term so we can make sense of it.

> The post [Why Do They Call It “Serverless” If It Runs On A Server?](https://glennstovall.com/why-do-they-call-it-serverless/) appeared first on [Glenn Stovall - Growth Engineer](https://glennstovall.com).

## What the Heck is Serverless?

If you aren’t familiar enough with the term to be flummoxed by it, allow me to fix that now:

Serverless computing is a type of solution that lets you run code in the cloud on an as-needed basis. One of the most popular forms of this [AWS’s Lambda](https://aws.amazon.com/lambda/) functions. You write a function, and when its called it runs… somewhere, and you get a result. No provisioning needed. But where is the code “actually” running?

## Serverless is Like Ridesharing

![Rideshare cars](https://thepracticaldev.s3.amazonaws.com/i/onk372iedeiofqawwypo.jpg)

If you live in a large enough metropolitan area, you may not need a car to get around. With more places in walking distance and public transportation, you can get just about anywhere you need to go. It’s a luxury I wish I had, but instead, I work remote two miles from anywhere decent. However, sometimes you’ll need to get somewhere at a specific time, or outside of the schedule and location bounds, public transit can offer.

So you call an Uber.

You could say that you live a “carless” lifestyle. You don’t need to own or even rent your own car. Rideshare apps have created cars-as-a-service. Even though you are carless, your travel still involves the use of cars. You’ve trading hailing rides on demand. It saves you money on gas, insurance, and car payments.

## Serverless is like Uber For The Cloud

Lambda functions run on could servers, but you don’t have to worry about renting, owning, or maintaining those servers yourself. It’s unlike other Amazon Web Services like EC2 in that way. And like rideshare, it cuts your overhead and saves you money.
Deep Cloning Objects in Angular, Typescript, Javascript
Tags: angular, deepcloningobjects, typescript, javascript
Published: 2019-09-04 11:59:03

---
title: Deep Cloning Objects in Angular, Typescript, Javascript
published: true
tags: Angular,Deep Cloning Objects,Typescript,Javascript
canonical_url: https://www.leonelngande.com/deep-cloning-objects-in-angular-typescript-javascript/
---

Some of the techniques for cloning objects in Javascript are either using [object destructuring](https://javascript.info/destructuring-assignment) or a combination of [JSON.stringify()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) and [JSON.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).

```
const objectA = { foo: { bar: 'baz' } }; // initial value of objectA
const cloneOfObjectA = {...objectA}; // objectA destructured to create cloneOfObjectA

const objectB = { foo: { bar: 'baz' } }; // initial value of objectB
const cloneOfObjectB = JSON.parse(JSON.stringify(objectB)); // create a clone of objectB using JSON.parse() and JSON.stringify()

```

Each of the above methods has limitations if you’re looking to deep clone your object.

Object destructuring with the spread operator (i.e. Object.assign) for objects `const a = {...b}` only makes shallow copies of those objects, meanwhile using the JSON methods will dump the prototype chain and any methods on the object (more [here](http://www.zsoltnagy.eu/cloning-objects-in-javascript/)).

I am currently taking the [Angular Architecture and Best Practices](https://www.pluralsight.com/courses/angular-architecture-best-practices) course on Pluralsight and [@DanWahlin](https://twitter.com/DanWahlin) (it’s author) mentions a really cool and lightweight library for achieving just this: [clone](https://github.com/pvorb/clone).

It offers foolproof deep cloning of objects, arrays, numbers, strings, maps, sets, promises, etc. in JavaScript, has 0 dependencies and at the time of writing has over 607M downloads!

To install it, simple run `npm install clone`, just follow the [readme](https://github.com/pvorb/clone) for more usage notes 🙂.

Here’s a wrapper service for the library when using with Angular and Typescript:

```
import {Injectable} from '@angular/core';
import * as clone from 'clone';

@Injectable({providedIn: 'root'})
export class ClonerService {

    deepClone<T>(value): T {
        return clone<T>(value);
    }

}

```

And a (quite trivial) usage example:

```
    const objectA = { foo: { bar: 'baz' } }; // initial value of objectA
    constructor(private clonerService: ClonerService) {
        const cloneOfObjectA = this.clonerService.deepClone(this.objectA);
    }

```

Hopefully this helps in your deep cloning adventures, happy coding!
Fun Project: Starship Tech Support (Angular / NgRx)
Tags: angular, showdev
Published: 2019-09-03 23:35:56

This is a short post on an Angular application I'm early on in building for fun and to keep my Angular skillset from my past job up to date.

I plan on posting periodic updates focused on specific technical lessons and so I wanted to share it in its early state before then.

### The Tech

Technology wise, I'm using Angular 8 with NgRx for Redux-based state with Bootstrap 4 styling. It's my first time working with Redux state and that's a primary learning goal for me. I've written up some early thoughts on this already.

{% link https://dev.to/integerman/early-thoughts-on-angular-with-redux-ngrx-kj3 %}

I do not yet use an external API or any sort of a data storage mechanism. That will come later.

### What is this thing?

As far as what this project *is*, that's harder to explain. Imagine a web-browser based work simulation game where you manage an IT troubleshooting / support team - working on priorities and assignments for your staff, encouraging them to grow, keeping their morale up, etc.

Now imagine that this takes place on a starship with your staff basically being the guys keeping the starship running.

It's nebulous and hard to explain, but it's a fun sandbox of Angular development topics.

Ultimately, I picture this thing where you manage a small team, then get more responsibilities such as a pair of teams, then a department, then an entire starship.

It's hard to say what it will wind up being as I'm going to take the concept in whatever way feels the most fun and/or interesting.

### What's the status of this thing?

I'm working on it as I can in the evenings, and it's very early on and not even a game in so much as:

- there's no win condition
- there's no lose condition
- there's no way to interact with your staff
- no new tickets are created
- nobody resolves any tickets

So yeah, it's kinda a very early placeholder, but it's fun to tinker with, and I should find some opportunities to share some code as time goes on.

### Can I see?

This is open source with GitHub source code available.

{% github IntegerMan/StarshipIt %}

Additionally, you can view the most recent version in your browser via GitHub pages at https://integerman.github.io/Starship-Tech-Support/
LeetCode "Valid Parentheses"
Tags: leetcode, python
Published: 2019-09-03 23:09:17

---
title: LeetCode "Valid Parentheses"
published: true
description: 
tags: [leetcode, python]
---

I'm often confused by the index of counter🙄

[Valid Parentheses]('https://leetcode.com/problems/valid-parentheses/')


```python
class Solution:
    def isValid(self, s: str) -> bool:
        
        len_s = len(s)
        
        if len_s == 0:
            return True
        elif len_s < 2:
            return False
        
        close_parentheses = {'(': ')', '{': '}', '[': ']'}
        
        # @note: it's faster to start with i = 1, but i = 0 and check i + 1 is easier to understand.
        i = 0
        while (i + 1) < len_s:
            c = s[i]
            if (c == '(' or c == '{' or c == '[') and s[i + 1] == close_parentheses[c]:
                len_s -= 2
                if 0 < len_s:
                    s = s[0:i] + s[i + 2:]
                    i -= 1                    
                continue                
            i += 1
        
        return len_s == 0
      
                
        
```