teleren/devto huggingface dataset:
Rick Mayes
Published: 2019-09-20 14:43:22

I am new here so please bear with me, it has taken me years to get here and remembering my first year in code takes some remembering.  I was introduced to coding by  Wendy who played in a piano club at night and was a high level coder (a term you do not hear much anymore) during the day.
  
We worked with the Compiler Monitor System (CMS2Y)  "CMS-2 was developed for FCPCPAC (Fleet Computer Programming Center - Pacific) in San Diego, CA. It was implemented by Computer Sciences Corporation in 1968 with design assistance from Intermetrics. The language continued to be developed, eventually supporting a number of computers including the AN/UYK-7 and AN/UYK-43." (1) The AN/UYK-7 computer was the first standardized computer that was designed for use on Navy Submarines and was used in three principal systems one of which was the boats sonar system and since I was a Submarine Sonarman I encountered it when I was transferred to shore duty after 7 years at sea to be an instructor at the now defunct Naval Pacific Submarine Training Center - Detachment at Ballast Point on Point Loma in San Diego also referred to as The Submarine Base.

I am getting their! bare with me please.  My job at the training center was to lead a team of instructors teaching underwater sound and signal analysis as it pertained to classifying Acoustic targets and part of my job was to help program the tactical training System signal generator so the targets presented to the sonar team during tactical training were acoustically identical and signal identical to the target that they would encounter at sea.

Thus my entry into the realm of 32bit programming sheets and 4 Format octal words and key punching and card readers and, and, and... ya me too, are you still with me? 

My first professional job programming was with Assembly programming  for embedded Motorola 68XXX family of processors doing 32 bit fft's in another submarine acoustic receiver,  I went on to Pascal and 'c' programing a torpedo run simulator.  I did all this as a EG&G employee at the IBM facility in Manasseh, VA.  When this job ran down I was sent to Dahlgren, VA to be the chief programmer for a DBIII/Foxpro program that was used to manage all aegis equipment held on shore about 2,000,000 lines of code.  Then a box of Oracle 6 for Dos 4.1 on a 286 computer (IBM)  was dropped on my desk and here i am today.

Thank you for sticking around for 50 years of my first week in the programming industry as I have watch the methods and languages change over the years.  Next time; about the Textronics 4051/4056 desktop calculator that we turned into a submarine towed array.

Frederick (rick) Mayes


1. Wikipedia contributors. CMS-2 (programming language). Wikipedia, The Free Encyclopedia. July 31, 2017, 09:32 UTC. Available at: https://en.wikipedia.org/w/index.php?title=CMS-2_(programming_language)&oldid=793208018. Accessed September 20, 2019.
How to become a Real professional Programmer
Tags: discuss, notes, tools, programming
Published: 2019-09-20 14:27:54

---
title: How to become a Real professional Programmer
published: true
description:
Learn from Programming blogs,Follow Programming experts, ask them questions/ learn, Learn from online courses., Teach others, it’s hard to become a pro on your own. Hence, be a role model, Practice what you learn, What have I left out?

tags: #discuss #notes #tools #programming
---
Daily Challenge #72 - Matrix Shift
Tags: challenge
Published: 2019-09-20 14:08:10

---
title: Daily Challenge #72 - Matrix Shift
published: true
series: Daily Challenge
description: Write a function that will shift a matrix n times. 
tags: challenge
---
Write a function that will shift a matrix `n` times. 

You will be given a rectangular matrix called `m` and must bring `n` characters at the end of the matrix to the beginning and shift all other indices over. 

**Examples:**
<pre>
  ['a','b','c','d']      ['h','a','b','c']
  ['1','2','3','4']  =>  ['d','1','2','3']
  ['c','o','d','e']      ['4','c','o','d']
  ['b','l','a','h']      ['e','b','l','a']
</pre>
<pre>
  ['d','u','d','e']      ['g','d','u','d']
  ['i','m','c','o']  =>  ['e','i','m','c']
  ['d','i','n','g']      ['c','o','d','i']
</pre>
<pre>
  ['h','i']      ['k','h']
  ['o','k']  =>  ['i','o']
</pre>

Good luck!

***
_This [challenge](https://www.codewars.com/kata/5afd3c451839f13b95000132) comes from Jomo Pipi on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
<<Learning by creating is fun>>
Tags: help, tutorial, books
Published: 2019-09-20 14:02:23

I just love learning by creating projects. Here are some of the things which I'd love to make but I was unable to find any online tutorials, courses,... for any of them:
- a Web Browser
- File system
- Programming language interpreter

Also suggest me anything.(book, GitHub repo, course, tutorial, blogpost, ...) I just love creating.

So far I've only created a few **websites** by using HTML, CSS and some frameworks. Did few things in **AWS**. Few small programs in **hackathons**. Some command-line **games** and simple **animations**. Once made a detailed model of International Space Station in **openSCAD**(lost the code, so sad about it).
Two exceptional use cases for the spread operator you may not know of
Tags: javascript, beginners, webdev
Published: 2019-09-20 13:44:37

---
title: Two exceptional use cases for the spread operator you may not know of
published: true
description: Spread operator is one of the most commonly used elements in the javascript toolbox, this mini-article will show you a couple of highly productive and efficient uses for the spread operator.
tags: javascript, beginners, webdev
cover_image: https://enmascript.com/images/2019-09-20-spread-operator-uses.png
canonical_url: https://enmascript.com/articles/2019/09/20/two-exceptional-use-cases-for-the-spread-operator-you-may-not-know-of
---

_originally posted on [Enmascript.com](https://enmascript.com/articles/2019/09/20/two-exceptional-use-cases-for-the-spread-operator-you-may-not-know-of)_ 

<mark>**#Did you know** is a new series of Enmascript where we write short and concise explanations about topics we consider might be relevant or underestimated, if you are looking for more complete in-depth articles check out our **[other series](/series)**.</mark>

One of the most popular features used in javascript after Ecmascript 2015 is without question the spread operator. In this short "Did you know" article, we will explore a couple of exceptional use cases that we consider to be very useful but that are not so well known.

## Optional/Conditional Spreading

Add object properties and values based on a condition:

```javascript
const isDog = true;

const obj = {
    key: 'value',
    ...(isDog && { woof: true })
};
```

In this way, we can add the `woof` property conditionally without having to use any if/else logic or similar approaches... **if the condition returns true, it will add the property, otherwise, the object will remain untouched**.

**result of `console.log(obj)`**

```javascript
{ key: 'value', woof: true };
```

## Copy objects and exclude selected properties

Let's say we like the parts of certain CPU and we would like to keep most of them except for the ssd, because of course, we would like to have more space:

```javascript
// Original CPU
const CPU = {
    ram: '32gb',
    ssd: '64gb',
    micro: 'i7'
};

// new CPU copy without the 64GB ssd
const { ssd, ...newCPU } = CPU;
```

Now, if you console log `newCPU` you will see that it does not longer contain the `ssd` property, this happened because we excluded that property from the rest that were included in `newCPU` by leveraging the _rest operator_.

**result of `console.log(newCPU)`**

```javascript
{ ram: '16gb', micro: 'i7' };
```

Do you have any more relevant use cases for the spread operator you would like to comment about? go a head and do that on reddit or twitter in our social links.
How to develop a digital wallet app?
Tags: question
Published: 2019-09-20 13:21:16

---
title: How to develop a digital wallet app?
published: true
description: I want to develop a very small digital wallet app but I don't know where to start
tags: question
---
Hello Devs, I want to practice by building small digital wallet app like Paytm in India, how can I do that? 
To build it, should I connect every user to a bank account? Or I should manage payments through my database? How this works?
How to start to code a PWA? 
Tags: pwa, start, ionic, angular
Published: 2019-09-20 13:19:44

---
title: How to start to code a PWA? 
published: true
description: The right start to make a PWA
tags: pwa, start, ionic, angular
---

Hey guys, 

I must code my first app. So I think PWA is interesting to get a cross plattform app for our company. 

I need a connection to my mySQL database to store our data and when the user use the app offline data must stored local. 

Is this possible with any plattform? Which is easy to use? 

Thanks :)
Brain & color contrast
Tags: css, illusion, contrast, short
Published: 2019-09-20 13:00:18

---
title: Brain & color contrast
published: true
description: A short story on trying to debug an optical illusion
tags: css,illusion,contrast,short
cover_image: https://thepracticaldev.s3.amazonaws.com/i/j18ukxz2mazrixadtihz.jpg
---

The following is a short story about us, humans, being slaves of our perception.

As most people, I know my brain can be playful when interpreting what my eyes see but it never happened to me with software development.

I did a first version of a website for a customer of mine, it contained several light gray banners over white background as follows:

{% jsfiddle https://jsfiddle.net/fkmzLsda/ result,html,css %}

Nothing crazy here. For a second version, my customer asked me to add texture to the background, like paper texture. Ok fine, I go to [Transparent textures](https://www.transparenttextures.com/), grab the "paper beige" one and apply it to my body tag.

**WTF! The gray banners are now white!**

Why is that happening ? Does Chrome try to enhance contrast for legibility ? Did I accidentally change a property ? Did someone cast a voodoo spell on my website ?

After a dozen minutes browsing CSS properties of all the tags potentially incriminated, I used the [KDE color picker](https://kde.org/applications/graphics/org.kde.kcolorchooser) to check the actual color of the banner.

As you can expect, it was just the same as before, the change was only in my brain. Because of the texture being of a much darker gray than the banner, **the contrast changed** from light gray over white (dark over light) to light gray over darker gray (light over dark).

You can experience it [with this JSFiddle](https://jsfiddle.net/ao82hrt4/18/). The effect is much lesser than on a fullscreen page but you can still experience it (I tried embedding it but dev.to's light theme kills the illusion).

Lesson learnt: only check your CSS after checking your own brain ;)
Reducing downtime using Azure Deployment-Slots
Tags: azure, webdev
Published: 2019-09-20 12:32:57

Disclaimer:
We have a (mostly) pure Microsoft environment. Having lots of virtual Windows Servers with IIS on them, serving our intranet pages. I don't know, if there is anything like WebDeploy with other Servers/IDEs.

There are several ways to deploy to the IIS.
* WebDeploy [If you never used it, read this!](https://blogs.msdn.microsoft.com/ericparvin/2018/05/31/install-and-configure-web-deploy-on-iis/)
* FTP
* Copy & Paste

They all are pretty simple and they all have the same drawback.
When you deploy, there is a downtime to your site. This might be okay, when deploying a WebSite, but when you have a heavily used API, you want to keep downtime to the absolut minimum. Preferably Zero, because you never know, when the next request will come. With bad timing it will be in the exact 500ms it took you to deploy the app.

I dont know an easy way around it, besides having a load balancer (or something similar) in front and at least two IIS instances.
But, with Azure, you have something called "Deployment Slots" and they come in handy.

You deploy to a deployment slot and (if configured) an automatic swap takes place. Your app is spun up and if successful, all new requests to your site/API are redirected to your new copy. As soon, as all requests to the old app are fulfilled, it is taken down and your new app is there to answer requests alone.

How can you use a Deployment Slot?
[Configure a slot](https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots), to your site.
[Deploy to it from your CD-Pipeline](https://blog.elmah.io/continuous-deployment-to-azure-in-visual-studio-team-service/) or any other way.

If you want, configure the Auto Swap as well... done.
Charts library in JavaScript
Tags: discuss, recommendations
Published: 2019-09-20 12:13:37

---
title: Charts library in JavaScript
published: true
description: I want to gather recommendations for a JS charting library
tags: discuss, recommendations
---

Hi everyone,

I wanted to ask here, if you have any JavaScript charting library that you recommend. This is for an internal website I use to manage my team's workflow.
The primary intent is to add a Gantt for each project. I have the data structure solved.
The website is not under any JS framework, it's just "vanilla" JavaScript, so it is not a constraint now.
Saludos,
CodeCraftConf 2019 : What is data anyway? (Questions)
Tags: data, development, codecraftconf, guidedconversations
Published: 2019-09-20 12:59:45

---
title: CodeCraftConf 2019 : What is data anyway? (Questions)
published: true
series: codecraftconf
tags: data,development,codecraftconf,guidedconversations
canonical_url: https://craignicol.wordpress.com/2019/09/20/codecraftconf-2019-what-is-data-anyway-questions/
---

Here are the questions I asked during my guided conversation at [CodeCraftConf 2019](https://conf.codecraftuk.org/). They are also available [on GitHub](https://github.com/craignicol/codecraftuk-sessions/blob/master/what-is-data-anyway.md) if you would like to fork and modify them for your own use. Thankyou to everyone who came to the discussion, I will post a follow-up to discuss some of the interesting answers.

# What is data anyway?

Navigating SQL, NoSQL, JSON and how to work with data in a post-RDMS, big-data world

## Questions

### Data modelling

1. When designing a system, do you start with the data or the code?
2. Has the rise of cloud based or non relational data stores changed how we model our data?
3. Do you need to update your data when the models in the code change? How do you do it?
4. Does all your data have to have the same shape?
5. Should the data you expose to the outside world broadly match the data at rest?

### Data security

1. How do you secure your data?
2. In light of GDPR, How do you ensure you aren’t collecting too much data?
3. Who has access to your data?

- Do you know if anyone unauthorised has accessed it?

1. How do you protect yourself against bad data and trojan data?

- Bad data = data that is fake, or is used for real world attacks
- Trojan data = data that can compromise your or your customer’s systems

### Ethical data

1. Can your data be used to discriminate?

- Can you prove it?
- Is your data biased?
- Are you recording hidden correlations? (ZIP code suggests race)

1. Who owns your data?
2. What questions aren’t you asking?

## Unused questions

1. What makes data big?
2. Are you collecting the right data?
3. Is the data you’re collecting right?
4. Where is your data?

### Technology choices

1. Do you still have a place for traditional RDBMS?
Use HJKL as navigation globally
Published: 2024-04-24 02:28:18

---
title: Use HJKL as navigation globally
published: true
date: 2019-09-20 11:18:48 UTC
tags: 
canonical_url: https://sucipto.id/2019/09/20/use-hjkl-as-navigation-globally/
---

Previously i’m using xmodmap to re-map shortcut CapsLock + HJKL to navigate using vim mode globally. But, it’s don’t work anymore on Wayland. And then, I found some answer on [askubuntu](https://askubuntu.com/a/898462) to modify xkbd keymap.

Edit following file :

`/usr/share/X11/xkb/symbols/us`

Make sure create a backup first. And add this code on first block

```
 # replace Caps with AltGr
 key <CAPS> { [ISO_Level3_Shift] };
 # Add vim cursor keys to be accessed with AltGr
 key <AB02> { [x, X, Delete, Delete] };
 key <AC02> { [s, S, KP_Enter, KP_Enter] };
 key <AC03> { [d, D, Next, Next] };
 key <AC04> { [f, F, BackSpace, BackSpace] };
 key <AC06> { [h, H , Left, Left] };
 key <AC07> { [j, J, Down, Down] };
 key <AC08> { [k, K, Up, Up] };
 key <AC09> { [l, L, Right, Right] };
 key <AD07> { [u, U, Prior, Prior] };
 key <AE03> { [3, numbersign, Home, Home] };
 key <AE04> { [4, dollar, End, End] };

```

Re-Login to take effect.
Python Custom CLI Guide
Tags: python, cli, automation
Published: 2019-09-20 11:04:06

---
title: Python Custom CLI Guide
published: true
description: Create Won CLI tools to automate repetitive work
tags: #python, #CLI, #automation
---


# CLI Implementation Guide

1.Step: Create `inktechs` package

create '__init__.py' file. it should be empty,
Now, create `__main__.py` file

```python
def main():
    print('Hello! from inktechs cli')

if __name__ == '__main__':
    main()
```


2.Step: Then, create `setup.py` file and define meta for your CLI

```python
from setuptools import setup

setup(
    name='inktechs-cli',
    version='0.1.0',
    packages=['inktechs'],
    author="Md. Sadhan Sarker",
    author_email="cse.sadhan@gmail.com",
    description="This is an Example Package",
    keywords="keyword1 keyword2",
    entry_points={
        'console_scripts': [
            'inktechs = inktechs.__main__:main'
        ]
    })

```

3.finally create `install.sh` file
    
    pip install -e .

    
4.Now, Run CLI, hit your package name from terminal

    inktechs -c ./home/file.conf --o ./home/text.file
    
> Output: like below

    Hello! from inktechs cli
    
    Update configuration as following: ./home/file.conf

    Generate output as following ./home/text.file
    
    

5.If you want to uninstall package, base on your cli package name

    pip uninstall inktechs-cli
    
    
# Source Code:

- https://github.com/mesadhan/inktechs-cli.git    
    
# References
- https://docs.python.org/3/library/getopt.html
- https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
- https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
React Sample App with API Call and Update to Latest Version
Tags: react, vscode, npm
Published: 2019-09-20 10:12:50

A while back I created a small and simple React app in order to fetch a random user from the [RandomUser.me API](https://randomuser.me/).

You can [find the React app on my GitHub: hello-react](https://github.com/dileno/hello-react)

I have a RandomUser component which simply looks like this:

{% gist https://gist.github.com/dileno/b4dfa062bcb3bbb9d5dbd4664ddb6dfd %}

We fetch a user from the API and present the user's name and picture, if present.

In our **App.js** file we then return the `RandomUser` component together with some HTML:

{% gist https://gist.github.com/dileno/391369313f997abfc5121ce027cb87e2 %}

In the VS Code terminal we run the `npm start` command and our React app is compiled and we can look at it in the browser on http://localhost:3000/.

After commit to Github, I got a few security messages back, as expected.

First, I checked React version with this command:

`npm list react`

and got `-- react@16.8.6` back, which isn't the latest version. To install latest React version, I had to run this command:

`npm install --save react@latest`

And then update packages in the React app with this command:

`npm audit fix`

I also manually had to update `lodash.template` to 4.5.0:

`npm install --save lodash.template@latest`

You can [find the React app on my GitHub: hello-react @ dileno](https://github.com/dileno/hello-react)
Attaching ShareJS to select HTML element
Tags: sharejs, javascript
Published: 2019-09-20 09:51:09

---
layout: post
excerpt: "One thing that I found missing in ShareJS library was the possibility to attach live concurrent editing to HTML &lt;select&gt; element. Out of the box it works only with text fields - &lt;input&gt; and &lt;textarea&gt;. Here is the workaround."
title: Attaching ShareJS to select HTML element
tags: [sharejs, javascript]
comments: true
published: true 
author: adam
---

One thing that I found missing in [ShareJS](http://sharejs.org/) library was the possibility to attach live concurrent editing to HTML `<select>` element. Out of the box it works only with text fields - `<input>` and `<textarea>` using `doc.attachTextarea(elem)` function.

Working around that deficiency wasn't so trivial. ShareJS works with [Operational Transformations](http://en.wikipedia.org/wiki/Operational_transformation) that extracts each logical change to the text (addition or removal) and sends only the change information over the wire. It is great for textual elements, but for `<select>`, whose value is replaced always in one shot, it makes a little sense.

Unfortunately, there is no "replace" operation we could use on `<select>` value change - the *modus operandi* we have to live with is constrained to insertions and removals. It means we have to mimic "replace" operation with removal and insertion. The problem with this approach is that when the operations get reversed - so that the client receives new value insertion first and then removal of the previous value - the intermittent value in-between is not a valid `<option>`. It is a concatenation of old value and new value. DOM API doesn't like that and rejects that change, setting the `<select>` value to empty one. The removal operation that comes next is then unable to fix the value as it tries to remove something from already empty string in DOM.

I have worked around that wrapping my DOM element with a tiny wrapper that keeps the raw value and exposes it for ShareJS transformations while still trying to update the original element's DOM:

```JavaScript
var rawValue = innerElem.value;
var elem = {
    get value () {
        return rawValue;
    },
    set value (v) {
        rawValue = v;
        innerElem.value = v;
    }
};
```

ShareJS also doesn't attach itself to `change` event, typical for `<select>` element - it specializes in keyboard events. So I have to attach on my own and rely the event to the underlying ShareJS implementation, faking the event of type that is handled by the library - I've chosen the mysterious `textInput` event.

Here is the full code as Gist: [ShareJS attachSelect](https://gist.github.com/NOtherDev/9e713cfd68d6da9a174a). It adds a new function to the `Doc` prototype, allowing calling it in the same way we're calling ShareJS native `attachTextarea`:  

```JavaScript
if (elem.tagName.toLowerCase() === 'select') {
    doc.attachSelect(elem);
} else {
    doc.attachTextarea(elem);
}
```

Feel free to use the code, I hope someone finds that useful.
My first 'Hello, World!' in Django
Tags: django
Published: 2019-09-20 09:29:50

This is really a significant moment for me as an aspiring Django developer. For the first time, I was able to display "Hello, World!" without scratching my head because I now know how every command up to this point works! 

I know I still have a LONG ways to go before I can be comfortable building web apps with Django, but let me enjoy this small victory in this momentous journey I'm taking on.
Who is writing here and also maintain a professional blog?
Tags: blog, discuss
Published: 2019-09-20 08:51:31

{% link https://dev.to/davidmm1707/should-you-use-medium-or-dev-to-2g1d %}
Got me thinking - Is maintaining a personal professional blog really worthwhile, if you can simply use public platforms like Dev (or Medium, or whatever)?

So, professional blogs, anyone?