teleren/devto huggingface dataset:
How to Open File Explorer Using Command Prompt on Windows 10
Tags: cmd, windows10, fileexplorer, commandprompt
Published: 2020-10-22 17:30:30

While there are quicker ways to open File Explorer, you can use Command Prompt to open the file manager in the current directory (or any other directory) in Windows 10. Here’s how.

### Open File Explorer Using Command Prompt
To begin with, open Command Prompt on your PC by opening the "Start" menu, composing "cmd" in the Windows Search bar, at that point choosing "Order Prompt" from the list items.

![CMD](https://dev-to-uploads.s3.amazonaws.com/i/5px8c6x130fbgswgmwda.png)

Command Prompt will now open. Here, run the following command to open the File Explorer:

![cmd](https://dev-to-uploads.s3.amazonaws.com/i/1tl8vu5x48daq6kvl7nv.png)

The **.** in the command represents the current directory in the command prompt. This command will open the folder in File Explorer that reflects that directory.
To open the parent folder of the current directory, run this command instead:

**start ..**

![CMD](https://dev-to-uploads.s3.amazonaws.com/i/tyr4vn7fdlsuwvgjq7fx.png)

The parent folder of the current directory will now open in File Explorer.

You can keep going back in the directory by appending a backslash and two periods. For example, we’re currently in the “C Program” folder in Command Prompt. Running start ..\.. will open the “D drive” folder in File Explorer—a folder two levels up from the current directory in Command Prompt.

![cmd](https://dev-to-uploads.s3.amazonaws.com/i/pc3us4ei84950sxtob3p.png)

### Open a Specific Folder in File Explorer Using Command Prompt
You can change directories in Command Prompt by using the cd command and running the start . command once in the desired directory to open that folder in File Explorer. However, you can also open any folder in File Explorer by running the start command, followed by the path of the folder you’d like to open.

**For example**, in our current directory, C:\Users\Ritul Singh, we want to open the Documents folder in File Explorer, which is just one level down. To do so, we’d run the following command:

**start Documents**

![cmd](https://dev-to-uploads.s3.amazonaws.com/i/ppr171zwhmjwb1dnbjbq.png)
Why are my RSS Feed posts not saving an uploaded cover image
Tags: help, rss, image, wordpress
Published: 2020-10-22 17:24:38

My Wordpress posts import fine from the RSS Feed but it doesn't include the featured image. In dev.to, I see the Upload Image button but when I upload an image, it doesn't allow me to edit the Alt Text then when I hit Preview there's no image showing. When I go back to Edit, the uploaded image link disappears. I tried uploading then publishing without previewing but again, no image shows. Images work fine when I write a post or embed them in the article.
Top 3 Learnings from #JDConf
Tags: java, github, eventsinyourcity, microservices
Published: 2020-10-22 17:15:23

You are invited to [Microsoft #JDConf](http://aka.ms/jdconf) October 27 - 29 and all videos will be on-demand after the event concludes! 

**What are the top 3 learnings from the conference?**
1. *Accessibility is a key way to be inclusive in this digital world.* Lucy Greco discusses how the shift to a primarily online world is harder for some groups in society, especially people with disabilities. On day 1, let's jointly learn basic strategies to help ensure that the digital infrastructure we all must use every day is universally inclusive.

2. *How Microsoft and the Java Ecosystem have truly partnered!* George Adams and Martijn Verburg will open day 2 with key information on how Microsoft has made internal and external #java investments that directly impact the Java developer. Take a look "behind the scenes" on how much Microsoft depends on Java and its popularity within the company.

3. *The importance of community.* Mala Gupta will open day 3 with how "community" goes beyond simply broadening you network. It is truly about you, the individual, and how your life and values translates to others. This is such an important distinction to highlight when most of us are at home and how your perception of life impacts others. 

This one-of-a-kind conference is bringing together Microsoft engineering, Java Community members, and all developers looking to learn more and connect with their community. 

[RSVP today](http://aka.ms/jdconf) and receive [relevant resources](https://docs.microsoft.com/en-us/learn/?WT.mc_id=events_jdconf) for the event, join the [Cloud Skills Challenge](https://docs.microsoft.com/en-us/learn/challenges?id=e67b211c-e45a-4abc-aa8a-803f0ea8934b), and more! 

Share the event with your Twitter network and we look forward to seeing you at #JDConf! 

See you there!
Trilha de carreira para Programadores, aprenda a estudar do jeito certo.
Published: 2020-10-22 17:14:04

Mês passado, eu assisti um vídeo do [Fábio Akita](https://www.youtube.com/channel/UCib793mnUOhWymCh2VJKplQ) sobre carreira e o estudos da área de programação. Durante o vídeo, ele mencionou um projeto chamado Web Developer Roadmap, criado por Kamran Ahmed no GitHub. Este projeto consiste em definir trilhas de estudos para programadores em diversas áreas de atuação (frontend, backend, android, devops, etc). A trilha de carreira dos programadores é atualizada a cada ano, então é possível que haja alguma alteração dos caminhos para quem não está vendo este post em 2020 (para conferi o Roadmap e suas trilhas é só acessar o [Github](https://github.com/kamranahmedse/developer-roadmap) ou o [site deles](https://roadmap.sh)).

Eu estava fazendo a trilha de front-end (até decidir focar em Java) e estava gostando bastante da sequência de estudos. Mesmo para quem está fazendo um curso, o roadmap dá um boa base para se seguir, mostrando mais claramente os principais assuntos a serem estudados e apresentando uma visão mais clara do progresso do estudante.

As trilhas são exibidas através de imagens de fácil entendimento e possuem uma legenda: as bolinhas roxas representam as recomendações pessoais do autor para se estudar, as bolinhas verdes representam alternativas (para escolher entre as roxas ou as verdes), as bolinhas cinzas com a marcação branca representam conteúdo que precisa ser estudado (mas sem seguir uma ordem específica) e as bolinhas cinzas representam conteúdos que o autor não recomenda estudar (seja por opinião pessoal, tecnologia já superada ou pouco utilizada no mercado). Agora irei disponibilizar cada uma das trilhas disponíveis em Agosto de 2020, mas recomendo que vejam o site ou o github para verificar se há conteúdo mais atual.

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

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

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

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

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rduyitplqigcxbo3ht74.png)
Are you too old to start a programming career?
Tags: career
Published: 2020-10-22 17:13:00

Hey!
Today I wanted to talk about some fears I had before I started studying Software engineering. I started to learn programming on the weekends when I was 32. A few months later I had programmed a very simple website with HTML and CSS and decided to quit my job and study Software Engineering full-time.

Of course there were some doubts. Was it the right decision? Would I be good enough or fail and then have trouble to find a new job as a lawyer, as the employers obviously would notice that I didnt enjoy law, as I quit my job before? Would I be able to "compete" with students, who already have been programming since ages?

Luckily, none of these fears became real. Up until now, I gained all the necessary credits. Of course at the beginning I had to invest more time than the students who had years of programming experience before they started studying. But in these three years of Software Engineering I learned an enormous amount and finally dont have any doubts, that at the end of the studies I will have become a good programmer.

Also Im not afraid of all the IT things I dont know yet any more. As we have learned and used so many different languages and technologies already, I recognize a lot of similiaries and patterns. In my opinion you can quickly learn anything, when you have an overview of how Computers work and used a few different languages and frameworks in some group projects.

Nothing is too difficult to learn, only some things have a few more logical steps than others. It's never too late to change careers! Did anyone make similar experiences? Have a nice day. :)
How can we create the sticky sidebar for variable content in react?
Tags: stickynode, react, sticky, sidebar
Published: 2020-10-22 17:12:56


We have a sidebar with variable content which must be sticky in its position, for example at the top and on the right of the main page. But when content changes with the user's selection, the sidebar should scroll with the content.
Oh! I forget to tell you we are using REACT, and we want to manage this situation with the react library.
Now we use react-stickynode from https://github.com/yahoo/react-stickynode.
This library helps us to create a sticky sidebar for our project.
Let's go! The first step we need to install this library is: 

```
npm install react-stickynode
```

The second step is adding the type of react-stickynode in our package.json file with the following command:

```
npm install --save @types/react-stickynode
```

Now we can see the following dependency in the package.json file  “dependencies” part.

```
“@types/react-stickynode”: “3.0.0”,
```

Congratulations! Now we can use the stickynode features.
Suppose we have two components in the main section; the one for the sidebar and the other for the main content. There are two cases for the sidebar:

1- The sidebar height is the same or less than the main content. In this case, the sidebar must stick at the top of the page and it mustn't scroll, i.e. whether the main page can be scrolled or not, it has to be fixed. look at the picture below:


![Sidebar-01](https://dev-to-uploads.s3.amazonaws.com/i/v3dci00odqed2f4dsfhb.jpg)

 
2-If the sidebar height is taller than the main content, i.e. it is taller than the viewport, and both the main content is being scrolled, and the sidebar is fixed at the top of the page, we can’t see the end of the sidebar. Oh, this is the bug! Just like the picture below:


![sidebar-02](https://dev-to-uploads.s3.amazonaws.com/i/znz3k7c8lh16gtdqy563.jpg)

 
So, what’s the solution?
As you know, perhaps we have several ways to solve this problem. But we want to use stickynode for this case.
After installing the react-stickynode and type of stickynode, import Sticky from ‘react-stickynode’ to the top of the sidebar component. Like this:

```
import Sticky from 'react-stickynode';
```

The sidebar’s component name can be an optional name like: Sidebar.
Now we insert this component in the default component from package ‘react-stickynode’, named <Sticky>

```
<Sticky>
    <Sidebar/>
</Sticky>
```

In case number one, when the user is scrolling the page down, react-stickynode will stick the sidebar to the top of the viewport. And in case number two, when the user is scrolling the page down react-stickynode will scroll along with the page until its bottom reaches the bottom of the viewport.
So, in the end:


![sidebar-03](https://dev-to-uploads.s3.amazonaws.com/i/f4segrnzls72talxk8w4.jpg)


The react-stickynode library provided some props for using them in the project. For example:

enabled
top
bottomBoundary
innerZ
enableTransforms
activeClass
innerClass
className
releasedClass
onStateChange
shouldFreeze

You can see these props and their documents with summary in this link :

https://github.com/yahoo/react-stickynode
TIL: newer uniqueness validation syntax
Tags: rails, validations, uniqueness
Published: 2020-10-22 16:57:11

---
title: TIL: newer uniqueness validation syntax
published: true
description: A small learning about converting a deprecated form of validations in Rails to the accepted form.
tags: rails, validations, uniqueness
//cover_image: https://direct_url_to_image.jpg
---

_Today, I learned how to write a rails uniqueness validation using the `validates` method._

*****

In Rails versions prior to 5, the standard accepted way to do a scoped uniqueness validation was by using the `validate_uniqueness_of` method:

``` ruby
class Subcategory < ApplicationRecord

  belongs_to :category
  
  validate_presence of :slug
  validate_uniqueness_of :slug, scope: :category_id
end
```

With Rails 5 (I'm not sure exactly when) the longer forms are being deprecated in favour of using the `validates` method instead.

In the api docs, however, the uniqueness validator isn't discussed, not even as an example.

I went digging into the code to try and figure it out and didn't make much headway with that.

Luckily, I had rubocop set up to complain about the use of the older methods, and told it to fix the failures it found.

The acceptable syntax is:

``` ruby
class Subcategory < ApplicationRecord

  belongs_to :category
  
  validates :slug, presence: true
  validates :slug, uniqueness: { scope: :category_id }
end
```

Now to update my snippets! :)
Git Revert: aka How to delete a commit without losing other commits
Tags: learning, todayilearned, git, github
Published: 2020-10-22 16:55:05

---
title: Git Revert: aka How to delete a commit without losing other commits
published: true
date: 2020-10-22 16:53:00 UTC
tags: learning,todayilearned,git,github
canonical_url: https://gabbysadventure.com/git-revert-aka-how-to-delete-a-commit-without-losing-other-commits/#utm_source=rss&utm_medium=rss&utm_campaign=git-revert-aka-how-to-delete-a-commit-without-losing-other-commits
---
I was pair programming and my partner somehow merged another pair’s branch and made several commits after. My partner never did a git merge so we were confused how that happened. But the important thing is… HOW DO WE FIX IT?!

I worried it would be very difficult and risky like doing a git rebase or something, but luckily it’s a very simple fix.

**Revert a normal commit**

```
git revert <commit hash>
```

**Revert a merge commit**

```
git revert <commit hash> -m 1
```
*Note that `commit hash` is the 7 character id associated with the commit you want to delete.*

You will then be asked to add your commit message as you would a normal commit. Then `git push`.

That’s it! You’re done!

* * *

**Extra explanation for those who want it…**

What is `-m 1`? The `-m` specifies the parent number and merge commits have more than one parent. Git doesn’t know automatically which parent branch is the main one and which one you want to un-merge.

When you do a `git log`, you will see next to `Merge`, the parent branches

```
commit 8f937c683929b08379097828c8a04350b9b8e183
Merge: 8989ee0 7c6b236
Author: John Doe <john@example.com>
Date: Wed Oct 21 22:49:41 2020 +0100
```

In this situation, `git revert 8f937c6 -m 1` will get you the tree as it was in `8989ee0`, and `git revert -m 2` will reinstate the tree as it was in `7c6b236`.

If you merged another branch with your’s, then your branch is most likely the first one so -m 1 will be what you use.

Hopefully this has helped someone to become 1 step closer to becoming a better developer.
Ktra: Your Little Cargo Registry
Tags: rust, cargo, registry
Published: 2020-10-22 16:38:11

---
title: "Ktra: Your Little Cargo Registry"
published: true
description: Introducing ktra
tags: rust, cargo, registry
---

Today, I introduce an application to provide a private cargo registry, [`Ktra`](https://github.com/moriturus/ktra).

`Ktra` is a minimum implementation of an [*Alternate Registry*](https://doc.rust-lang.org/cargo/reference/registries.html) that is introduced for non-public crates in Rust/Cargo 1.34.  

This app is under heavy development so any contributions and/or feature requests are welcome!
Object destructuring assignment
Tags: javascript, destructuring, fundamentals
Published: 2020-10-22 16:34:43

The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects. In this case, we are going to see how destructuring works for objects.


```
const user = {
  userName: 'fbarrios',
  firstName: 'Freddy',
  lastName: 'Barrios',
  address: {
    street: '52',
    zipcode: '110007',
}

const { firstName } = user
console.log(firstName); // Freddy

```
This is the same as…

```
const firstName = user.firstName
```
It is possible to set default values, in case the property doesn’t exist or is undefined.
```
const { phone = '0000000' } = user
console.log(phone) // 0000000
```
A property can be renamed when it’s destructured.
```
const { username: displayName } = user
console.log(displayName); // Freddy
```
You can rename and set a default value for a property
```
const { phone: phoneNumber = '0000000' } = user
console.log(phoneNumber) // 0000000
```
When the object has another one nested it’s destructured in the following way
```
let { address: { street } } = user
console.log(street) // 52
```
Destructuring can be used with the arguments of a function
```
function fullname({firstName, lastName}) {
  return `${firstName} ${lastName}`;
}

console.log(fullName(user)); // Freddy Barrios
```
Computed property names can be used with the destructuring assignment.
```
const key = 'username'
const { [key] } = user
```
### Rest operator in object destructuring

This operator (...) collects all properties that weren’t picked off during object destructuring
```
const { address, …restProperties } = user
console.log(address);
/*
{
  street: '52',
  zipcode: '110007',
}
*/ 
console.log(restProperties); /
{
  userName: 'fbarrios',
  firstName: 'Freddy',
  lastName: 'Barrios',
}
*/
```
As you can see, object destructuring is very useful and gives us another way to write better code.
Failed & learnt, on to the next!
Tags: startup, codenewbie
Published: 2020-10-22 16:31:02

I used to run a startup called Digital Profile. We worked hard on getting it running but run out of funding & struggled through Covid. I was lucky to have amazing people support me and worked with some great individuals.

I've learnt loads about product, team, investment & focus.

Hi all, I am bootstrapping a new community platform for developers focused on learning. Connecting the next generation of developers with industry professionals to exchange knowledge & help progress careers.

I've launched the community platform (www.westryve.com) but to help me get through this rather strange time I’m looking to raise a small support fund to keep me going through IndieGoGo.
If you can support or help at all it would be hugely grateful. You can check out the campaign here and what it's all about. We have some awesome support packages from £10 that will make a real difference and help me keep the platform running.

(https://www.indiegogo.com/projects/help-westryve-strive)

Any help would be hugely appreciated.
Coming soon... Polycloud
Tags: node, backend, mongodb
Published: 2020-10-22 16:06:36

# Coming soon, Polycloud
So basically it is a Cloud-Storage service, and it focuses on safety.

We used MongoDB as a database, and an express server.

To block unwanted visitors we used [Sqreen](https://sqreen.com).
It is under development right now (go to the website to see features)

Login is only with Repl.it right now, we'll add more features to login with Google soon.

Source code: https://repl.it/@Lethdev2019/Polycloud

Website: https://polycloud.lethdev2019.repl.co

Have a great day!
Stop asking users to introspect their behaviors
Tags: ux
Published: 2020-10-23 07:06:08

---
title: Stop asking users to introspect their behaviors
published: true
date: 2020-10-22 16:23:17 UTC
tags: UX
canonical_url: https://www.atulprd.com/blog/stop-asking-users-to-introspect-their-behaviors/
---

People like to think that their decisions are rational and made with deliberate thought.

But, in reality, people are very bad at introspecting their behaviors & decisions.

> People want to tell a good story—a “narrative”—of their life and will change what they say to fit the view of who they are and to whom they are talking.

Instead of asking people to examine the reason behind their behavior, we should run experiments where we can observe them & find how they are currently solving their problem. We try to map their needs, goals, and pain points, typically in their home/ where the action happens.

**Don’t just listen to what users say they do. See what they do while they do it.**
Full Crud Mongo/Express API in One Line with MongoRester
Published: 2020-10-22 16:03:26

## Explanation of Mongorester

One of the nicest things about Ruby on Rails is the scaffold command which creates your migrations, models and even your views all in one command making creating a Rail API almost too easy.

I've seen other tools that try to add this level of productivity to express or mongo but often lacked some flexibility. Mongorester is a library I've created to make creating full crud on a Mongoose model almost too easy. Let me explain how it works.

## The How

Essential you pass in your model name, an object with a schema definition and an options config option and returns you mongoose model and an express router instance with all your main crud routes.

## Try it out

install
```npm install mongorester```

```js

const rester = 

// My Schema Definition Object
const noteSchema = {
  title: String,
  body: String
}

//Create Model and Router
const [Note, noteRouter] = rester("Note", noteSchema)

//Add Router to Middleware, you now have full crud on note!
app.use("/note", noteRouter)

```

so after this you'd have...

- GET /note/
- GET /note/:id
- POST /note/
- PUT /note/:id
- DELETE /note/:id

Since you are returned the model and the router you can use them to add any additional routes you with no problem. The config object can allow you to pass in a custom config object for the schema, override any of the routes, and attach an array of middleware function to the router to run prior to the routes.

## In Summary

Mongorester has arrived to make your express/mongo api making days much easier!