teleren/devto huggingface dataset:
who uses ndjson?
Tags: discuss, json, data, formats
Published: 2019-11-11 15:57:06

---
title: who uses ndjson?
published: true
description: 
tags: #discuss #json #data #formats
---

I got this feature request today. Not sure if I should do it tho since I never came across a tool, system, or library using #ndjson ...


{% github https://github.com/RandomFractals/vscode-data-preview/issues/159 %}
Execute a Program in D
Tags: dlang, tutorial
Published: 2019-11-11 15:19:33

[`execute`](https://dlang.org/phobos/std_process.html#.execute) 

Another helpful tool is to be able to run another program as part of a script. This is one area I find D handles really well and allows for similar controls to shell pipes.

For this toolbox I'll stick with the basic. 

```dlang
import std.process;
import std.exception;

auto res = execute(["app name", "arg 1", "arg 2"]);
enforce(res.status == 0, "App exited with failure");

import std.stdio;
writeln(res.output);
```

This method will wait for processing to complete and provide all the std output. `spawnProcess` can be used to allow program execution while the app runs, remember to wait before your program exits. 

I like this approach because it is not subject strange escaping and quote rules from the shell. Though there is `escapeShellCommand` to help you. 

{% link https://dev.to/jessekphillips/piping-process-output-1cai %}
Reasons Why Emotions Play An Important Role in UX Design
Tags: ux, design
Published: 2019-11-11 13:29:10

<Html>
<P>As per the definition of UX design, it is the process of manipulating user behavior through usability, accessibility, and desirability provided in the interaction with a product and it stands for user experience. <a href="https://codersera.com/blog/role-of-emotions-in-ux-design/">User experience (UX)</a> is a person’s emotions and attitudes about using a specific service, system or product and encompasses the practical, experiential, affective, meaningful and valuable aspects of human-computer interaction.</p>

In layman’s language, it is the feelings generated while interacting with your website/app/software. User experience is a crucial and relevant aspect in software design and development as it helps in creating a loyal customer base to your brand by providing a happy experience.

The word “HAPPY” here suggests something happened with the emotions of that person and it is this feeling of emotions that is kept in mind during UX DESIGN developmental stages.

Let us understand the difference between UX and UI to have a clearer picture of the emotional designing value. The designing elements provided by UI (User interface) enables the customers to interact with the services whereas UX provides an individual interaction experience with the products and services and the user is also able to analyze their experience afterwards by suggesting their takeaways from the entire experience.

Google is a very good example of a successful user design where their “Spartan interface” gives a great user experience and they don’t have to shout it out from the rooftop to announce their success rate. The experience an audience has after visiting their sites is making them come again and again because of a strong supply of their required target which is information.
<ahref
</html>
Compressing the response of an .NET Core C# API 📦
Tags: csharp, todayilearned, computerscience
Published: 2019-11-11 15:15:15

To make this improvement we will use the technique of **data compression** with the **GZIP**.

##   What is data compression? 🤔

Data compression is a way to use less space to store the most information, thus reducing the space used, which can be an image, text, video or any type of file. To reduce the space used, several algorithms are used to reduce the amount of bytes required to represent a given information.

## What is GZIP? 😵

**Gzip**  is a file format and software application used for file compression and decompression as a free software replacement for the compression program used on early **Unix**  systems and intended for **GNU.**

**Gzip**  is based on the **DEFLATE** algorithm, which is a combination of the coding **LZ77** and **Huffman**.

**DEFLATE**  it was designed as a replacement for **LZW** and other patent-overloaded data compression algorithms that at the time limited the usability of the compactor and other popular archivers.

## After all, how do I compress WebAPI requests? 🤓
There are several ways to apply this compression, most of them through attributes in methods, I will show how to configure in one place so that all requests have the return already compressed, avoiding these attributes.

Follow these steps:
**Step 1:**  
Install the package:
```c#
Microsoft.AspNet.WebApi.Extensions.Compression.Server
```

**Step 2:**
Browse your solution to the `App_Start` folder then open the `WebApiConfig.cs` file, we will import two libs from the package we installed.
```c#
using Microsoft.AspNet.WebApi.Extensions.Compression.Server;  
using System.Net.Http.Extensions.Compression.Core.Compressors;
```

**Step3:**

Finally at the end of the `Register` method the following line
```c#
config.MessageHandlers.Insert(0, new ServerCompressionHandler(new GZipCompressor(), new DeflateCompressor()));  
```

## Results🔬

####  After applying this technique, we had the following results:

-   **78% decrease in response size;**
    
-   **4.3% decrease in waiting time for response;**
    

Before **gzip** application:

![](https://i.imgur.com/IymTVwE.png)

After **gzip** application:

![](https://i.imgur.com/80TEeOG.png)

## 🎉🎊🎆

## Referências 📚

-   [Data compression](https://www.ime.usp.br/~pf/estruturas-de-dados/aulas/compress.html "https://www.ime.usp.br/~pf/estruturas-de-dados/aulas/compress.html");
    
-   [GZIP](https://en.wikipedia.org/wiki/Gzip "https://en.wikipedia.org/wiki/Gzip");
    
-   [DEFLATE](https://en.wikipedia.org/wiki/DEFLATE "https://en.wikipedia.org/wiki/DEFLATE");
    
-   [LZ77](https://en.wikipedia.org/wiki/LZ77_and_LZ78 "https://en.wikipedia.org/wiki/LZ77_and_LZ78");
    
-   [Huffman](https://en.wikipedia.org/wiki/Huffman_coding "https://en.wikipedia.org/wiki/Huffman_coding");
    
-   [LZW](https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch "https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch");
dbForge Fusion Now Supports Visual Studio 2019
Tags: sqlserver, mysql, oracle, visualstudio
Published: 2019-11-11 14:57:15

---
title: dbForge Fusion Now Supports Visual Studio 2019
published: true
description: Devart has improved its dbForge Fusion products. The update affected Fusion for SQL Server, Fusion for MySQL, and Fusion for Oracle.
tags: SQL Server, MySQL, Oracle, Visual Studio
---
*Devart has improved its dbForge Fusion products. The update affected Fusion for SQL Server, Fusion for MySQL, and Fusion for Oracle.*

![dbForge Fusion](https://blog.devart.com/wp-content/uploads/2019/11/Screenshot_1.png)

Devart, a recognized vendor of professional database management software, has recently announced updates for each product in the dbForge Fusion line: [Fusion for SQL Server](https://www.devart.com/dbforge/sql/fusion/), [Fusion for MySQL](https://www.devart.com/dbforge/mysql/fusion/), and [Fusion for Oracle](https://www.devart.com/dbforge/oracle/fusion/). The main feature of these updates is the support of Visual Studio 2019, which now allows working with all the extended capabilities.

**dbForge Fusion** is a line of Visual Studio plugins designed to simplify database development and enhance data management capabilities. When the user integrates dbForge Fusion into Microsoft Visual Studio, all database development and administration tasks become available from the IDE. It provides an easier way to explore and maintain existing databases, design compound SQL statements and queries, and manipulate data in different ways. 

To learn more about the recent update, visit the Devart official blog – https://blog.devart.com/new-fusion-with-visual-studio-2019-support.html

**About Devart**

Devart is one of the leading developers of database tools and administration software, ALM solutions, data providers for various database servers, data integration and backup solutions. The company also implements Web and Mobile development projects.
For additional information about Devart, visit https://www.devart.com/
Daily Challenge #114 - Speed Control
Tags: challenge
Published: 2019-11-11 14:52:57

---
title: Daily Challenge #114 - Speed Control
published: true
series: Daily Challenge
description: Use John's GPS to calculate his maximum average speed.
tags: challenge
---

In John's car the GPS records every `s` seconds the distance traveled from an origin point (distances are measured in an arbitrary but consistent unit). For example, below is part of a record with `s = 15`:
`x = [0.0, 0.19, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25]`

The sections are: 
`0.0-0.19, 0.19-0.5, 0.5-0.75, 0.75-1.0, 1.0-1.25, 1.25-1.50, 1.5-1.75, 1.75-2.0, 2.0-2.25`

We can calculate John's average hourly speed in each section:
`[45.6, 74.4, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0]`

Given `s` and `x`, the task is to return as an integer the *floor* of the maximum average speed per hour obtained on the sections of `x`. If `x` length is less than or equal to 1 return 0 since the car didn't move.

*Tests:*
1
   ` x = [0.0, 0.02, 0.36, 0.54, 0.72, 0.9, 1.08, 1.26, 1.44, 1.62, 1.8];`
  `  s = 17;`

2
 `   x = [0.0, 0.01, 0.36, 0.6, 0.84, 1.05, 1.26, 1.47, 1.68, 1.89, 2.1, 2.31, 2.52, 2.73, 2.94, 3.15];`
  `  s = 14;`

Good luck, you can use `(3600 * delta_distance) / s` to calculate speed!

***
_This challenge comes from g964 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!_
Why I write and why you should too (specially if you are a minority.).
Tags: motivation, wecoded, codenewbie
Published: 2019-11-11 14:47:10

Good day folks!
Did you miss me?
Last week I decided to translate one of my posts to PT-BR for my Brazillians <3 So I didn't have anything knew for you.

Today I am writing to tell you why I write! And why you should write too, specially if you are part of a minority group.

I started coding a little over a year ago and since day 1 I have done lots of googling, watching classes and reading posts like this ones. And guess what? The vast majority of the material is written by white cis male. Now, if you are a white cis male please don't be offended, you are very well represented and most of the material out there is great BUT as a latina women I felt unrepresented.
I felt unsure if I should even keep going, because, is there really a place for someone like me?

Well, I found out there is!  
Thank you to the women out there that do the work! That share their journey and inspired me to do the same! And that is one of the main reasons why I write.
So other newbies can see. So other girls can see. So other immigrants can see!!!

Now, I am a code baby. I have yet to find my first tech job. To participate in something big. But when I do, it won't be my victory alone. It will be a victory for all the people I represent. For all the people that represent me.
For all of you in the dev community as well, because I love you people ;)

So it doesn't matter where you are in your code journey SHARE! Share to inspire, share to teach and share to get motivation (I swear dev.to  is a safe place (: )
And if you are the cis white male I mentioned before, please cheer us up! Share what you know and incentive us.

Thank you all for being awesome!

And have a good Monday!



P.s.you can get the awesome #omgSheCodes sticker here https://etsy.me/36Ut2sI
How I learned to stop worrying and love the fu*k-ups 
Tags: webdev, career, beginners, education
Published: 2019-11-11 14:33:38

I stared at the blinking cursor on my screen and thought to myself, this is it.  I’m gonna do it.  I’m gonna whip this laptop across the room like a goddamn frisbee.  

And then I saw it.  

The elusive missing semi-colon that had almost been my undoing and the catalyst in my laptop’s brutal demise.  It was nowhere close to the error message my Sass Compiler had identified, but it was what broke my code at the eleventh hour.  Of course, all of these debugging tools we have at our disposal to help identify errors are nice, but they’re merely a guideline, not miracle workers.  It’s like when you’re the designated driver and you’re trying to get an address from a drunk friend.  You might reach your destination without incident or you might end up in the middle of nowhere having flashbacks to scenes from The Texas Chainsaw Massacre.  So, proceed with caution.  

Now, this wasn’t the first time I had been frustrated, it certainly won’t be the last.  Since quitting my job and going back to school it has been a fast and furious learning curve.  Leaving my comfort zone and embarking on this crazy journey into the world of web development at Juno College meant I’ve had to start doing something I’ve always hated and would typically avoid at all costs... admitting I don’t know everything (and probably never will again) and asking for help when I hit the wall.  

For my laptop’s safety and to avoid tearing my own hair out in frustration, I started to force myself to ask for help when I really needed it (i.e. those times my brains were totally scrambled and Google and Stack Overflow failed me).  And you know what happened?  The world didn’t end, I didn’t die of embarrassment, no one made me feel stupid for asking a question or not knowing something.  In fact, most times, people were jumping at the chance to help out the noob. 

Are web developers secretly the nicest people on the planet or are they just buttering me up before they ask me to invest in some pyramid scheme?  Only time will tell.  What I do know is now when I have the chance to help out a fellow aspiring developer, I jump at the chance.  Call me crazy, but there may be something to this positive reinforcement stuff.

The hardest part of this journey to date has been accepting that I’m gonna fu*k-up, probably quite often and to varying degrees ranging from mild to catastrophic.  But that’s part of the process.  My ego still takes a bit of a hit, but I also learn something new every time it happens.  

So, I’m off to go fu*k something up today, but I’ll learn something new and be able to tell you how I fixed it later.
"HOW TO CREATE A SIMPLE IMAGE SLIDER WITH CSS ONLY NO JAVASCRIPT/JQUERY"
Published: 2019-11-11 14:32:44

I created a simple image slider with css only no javascript/jquery, no library or framework. It's not the best image slider but a little fix and some code it could be useful in a real world project, here's the link to the full video of me creating the slider live 👍 https://www.youtube.com/watch?v=4xq6SwppNV0
IF YOU GUYS LIKED THE VIDEO OR IT HELPED YOU OUT PLEASE SUBSCRIBE TO MY CHANNEL FOR MORE CODING CONTENT, THANKS.
Debugging nodejs easy, simple, without complications.
Tags: node, debugging, chrome, chromium
Published: 2019-11-11 14:12:20

---
title: Debugging nodejs easy, simple, without complications.
published: true
description: Debugging your node js service will help you not waste time and to be more agile
tags: nodejs, debugging, chrome, chromium
cover_image: https://thepracticaldev.s3.amazonaws.com/i/srz30iaqr8pv03sju9tl.jpg
---

The professional way to debugg an application that is running in Nodejs on the server side is as follows:

1. First, we add the flag inspect in the command that runs our server js.
```
$ node --inpect file.js
```

2. second, in our Chrome or Chromium browser we open the url chrome://inspect/#devices and configure a new device:
![URL to inspect nodejs services](https://thepracticaldev.s3.amazonaws.com/i/do6t79zjv50tb6jfy4oh.png)

3. Third, we configure the device in localhost and port 9229, which is the default port:
![Conff debugger in chrome](https://thepracticaldev.s3.amazonaws.com/i/w86ybiiyyf2zosolmd5p.png)

And voila, this way we can discuss our service locally:
![Debugging nodejs aplication](https://thepracticaldev.s3.amazonaws.com/i/e971p99655cht29fp5ga.png)

If we need to adjust the port, or add it to an inspector of a client such as Visual Studio Code, or stop the inspector in the first line to be able to debut before the start we can see the official documentation and these could be the results:

```
$ node --inpect=0.0.0.0:9229 file.js
$ node --inspect-brk file.js
```

[Node.js official Debugging Guide](https://nodejs.org/de/docs/guides/debugging-getting-started/)

## Beyond the professional aspect
There are two problems that we face when working in this way, the first is that if we want to make a change we must stop and restart our server, the second is that if the application dies we must restart our server again.

To solve this problem we will use two programs:
- Forever: your job will be to maintain and restart our nodejs server in case our application dies.
- Nodemon: it will be in charge of monitoring our application files in case we make any changes to it.

we install forever and nodemon
```
$ npm install -g nodemon@1.19.4
$ npm install -g forever@1.0.0
```

our server will run as follows
```
$ forever -c 'nodemon --watch /opt/app --inspect=0.0.0.0:9229' file.js
```

With this we can develop faster and we will not waste time when working our service.

I hope you liked the content, if you have any questions or want to write about a related topic, please leave your comment, until next time.
Bubble Sort - Python
Tags: replit, python
Published: 2019-11-11 13:57:16

** This repl uses the seaborn package.
This is a repl that sorting a list of numbers in the bubble sort way. Change the values in "my_listBef" (line 4) to a list you want, And duplicate the values to the "my_list" list (line 5). Make sure they has the same values. Hit run, And boom! you'll see the sorted list in the console.

{% replit @Alonhoresh/Bubble-Sort %}
Python FizzBuzz
Tags: python, interview, fizzbuzz, dev
Published: 2019-11-11 13:44:11

---
title: Python FizzBuzz
published: true
description: Most Concise Python Fizzbuzz
tags: python, interview, fizzbuzz, dev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/28gcxdpygendjxuuq1am.png
---

Note, my new tool kwik is available [here](https://sam-aldis.github.io/kwik/)

So doing a few fizzbuzz in different languages today and got to python,
Could someone tell me if the following is acceptable in interviews and what their most concise version is:
```python
def fizzbuzz(i):
    n = [i%3, i%5]
    print(((n[0]==0)and(n[1]==0)and"fizzbuzz " + str(i))or((n[0]==0)and"fizz " +str(i))or((n[1]==0)and"buzz " + str(i))or str(i))

for i in range(0,102):
    fizzbuzz(i)
```

Sam.
Suggestions: Starting Live Coding Sessions: Weekly
Tags: tutorial, javascript, html
Published: 2019-11-11 13:31:32

I am thinking on setting up the following;

* Twitch Stream of Weekly Live Coding Sessions with Questions and Answers
* Dev.to Post and Discord Channel for Instant Communication for Future Topics 

Topics for Session: November
* Introduction
    - Our Goals
    - What we are expecting in these sessions
    - Your Introduction
    - Possible Outcomes
* Setting Up Operating System Environments
    - Windows Pros and Cons
    - MAC Pros and Cons
    - Linux Pros and Cons
* My First index.html Page

Further suggestions are always welcomed.

[Google Form: Register Here](https://forms.gle/mkkkBSqVNrWYA8aj6)
Difference Between Development & Production Mode in Magento 2?
Published: 2019-11-11 12:52:59

---
title: Difference Between Development & Production Mode in Magento 2?
published: true
description: 

tags: 
---
<img src="https://thepracticaldev.s3.amazonaws.com/i/td6i816s8pw62zlovmmn.png"/>
Development & Magento Modes are two different modes in Magento 2. 
Magento 2 has basically the following type of Modes.

<ul>
<li>Default Mode</li>
<li>Developer/Development Mode</li>
<li>Production Mode</li>
</ul>
<b><h2>Development Mode</h2></b>
<p>The slowest mode on both Front-End and Admin Side. In this mode all development should be done. Actually this is the mode for developers.
This is the most ideal mode for development because in this mode all errors are displayed directly on the Web Page, which makes it easy to fix errors.</p>
<b><h2>Production Mode</h2></b>
<p>This mode is the Live Magento 2 Site. To provide the best service to your loyal customers you must need to be in Production Mode. Due to full page caching this is the fastest and secure mode in Magento 2.
Debugging is quite difficult in Production Mode as compared to Developer Mode. </p>

<b><h3>Switch Modes in Magento 2</h3></b>
Connect your Magento Root Directory.
Run the following command .
 <code>bin/magento deploy:mode:set {mode} </code> 
Her {mode} represents the mode you want to change.
<h4>Enable Production Mode</h4>
<code>bin/magento deploy:mode:set production
</code>
<b><h4>Enable Developer Mode</h4></b>
<code>bin/magento deploy:mode:set developer </code>

Read More - <a href="https://www.fmeextensions.com/blog/how-to-set-magento-2-modes/">https://www.fmeextensions.com/blog/how-to-set-magento-2-modes/</a>
Setup MySQL with Sails.JS
Tags: mysql, sailsjs, docker
Published: 2019-10-31 15:41:31

---
title: Setup MySQL with Sails.JS
published: true
description: 
tags: [mysql, sailsjs, docker]
---

MySQL is a very widely used database, so to continue my tests with sails.js, I will add it to my project.
The explanation of how to configure a docker container for the sails.js part is here.
The code to this example can be found here.
First, I will add to my docker-compose a service to build the mysql image. I will not, make any volume mapping, since this is just for a simple test and I don’t care about keeping the data.

## Dockerfile and Docker Compose

The Dockerfile for mysql will be on a folder called mysql, and its contents are:

```
FROM mysql:8.0.13
```

the compose configuration:

```
mysql:
    build: mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
    ports:
      - '3306:3306'
    networks:
      - sails
```

With this, I will have a mysql running locally on port 3306.

## Project Dependencies and Configuration

The first thing I need to do, is to add the sails-mysql dependency to my project. To do this:

```
npm install sails-mysql --save
```

Now, we need to configure the datasource on the project. To do that, in the file *config/connections.js*, you will find a commented out example like this:

```
// someMysqlServer: {
//    adapter: 'sails-mysql',
//    host: 'YOUR_MYSQL_SERVER_HOSTNAME_OR_IP_ADDRESS',
//    user: 'YOUR_MYSQL_USER', //optional
//    password: 'YOUR_MYSQL_PASSWORD', //optional
//    database: 'YOUR_MYSQL_DB' //optional
// },
```

Uncomment the lines, and set the values according to your setup. The password, should be the same one you have set on your docker compose.
For the host, you can use your host machine address.
With this, you should have all you need to start storing data into a mysql database with your sails.js app.