teleren/devto huggingface dataset:
Unity 105: Debugging and Analyzing
Tags: csharp, gamedev, unity3d, dotnet
Published: 2020-12-10 19:37:08

Visual Studio IDE supports debugging Unity projects. On windows you can add Unity support from the Visual Studio installer by modifying your installation. Unity support is built-in into Visual Studio for Mac, and you do not need to modify your installation.

![unity support in Visual Studio installer for windows](https://dev-to-uploads.s3.amazonaws.com/i/0p1az6umb6b5nxx5xnjy.png)

#Debugging
Debugging enables you to freeze the execution of your script as any point you set using breakpoints. To set a break point, select the area in the margin of Visual Studio IDE next to the line you want the code to freeze at. A red dot should appear on that margin showing that a breakpoint has been set.

![a breakpoint with a red dot showing in the margin of visual studio](https://dev-to-uploads.s3.amazonaws.com/i/tuc9sg7eyicynpdqcwii.png)

To start the debugger, you need to have both Visual Studio IDE and Unity running. Select the Attach to Unity button at the top of the Visual Studio IDE.

![Attach to Unity button in Visual Studio](https://dev-to-uploads.s3.amazonaws.com/i/5ssuhrcv5u06jq13v0re.png)

If you were using Unity 2020 and up, Unity might ask you to enable debugging. Select Enable for this session or for all projects.

![Enable debugging dialogue in Unity 2020 and up](https://dev-to-uploads.s3.amazonaws.com/i/27kc9zf3zl5jt5q9j8hj.png)

Visual Studio Unity debugger should start and be ready and attached to Unity.
![Unity debugger activated in Visual Studio](https://dev-to-uploads.s3.amazonaws.com/i/q5u998vcho63uf8255da.png)

Now, select the play button in Unity to run your game. One Unity reaches the line of your code, Unity will freeze. You will be able now to look at the debugger locals window and see properties of your code and game objects. You can hover on variables to see their value at that specific state, or you can dig deeper into the locals window at the bottom of the debugger to see them in a list.

![Visual Studio IDE with stopping at a Breakpoint](https://dev-to-uploads.s3.amazonaws.com/i/91o4mnj9h3ftm9qvdb4z.png)

Please check our full video covering this topic in our video beginner series for Unity.
{% youtube EVi_2AQizus %}
On .NET Episode: GraphQL Schema Design
Tags: webdev, graphql, dotnet
Published: 2020-12-10 17:33:43

Your GraphQL schema is a contract of the data that clients can request from your API. A well designed schema is essential for any GraphQL enabled application.

In this episode, Cecil is joined by Michael Staib to talk about some important aspects of GraphQL schema design with the Hot Chocolate framework. 

{% youtube 1VEMqTw8xSo %}

If you liked this video and would like to see some more of our .NET content, please subscribe to our [.NET Developers YouTube Channel](https://www.youtube.com/channel/UCvtT19MZW8dq5Wwfu6B0oxw).

#### Useful Links
<ul>
<li><a href="https://github.com/ChilliCream/graphql-workshop" target="_blank">Getting started with GraphQL on ASP.NET Core and Hot Chocolate - Workshop</a></li>
<li><a href="https://channel9.msdn.com/Shows/On-NET/Getting-started-with-HotChocolate" target="_blank">Getting started with GraphQL and Hot Chocolate</a></li>
<li><a href="https://docs.microsoft.com/en-us/aspnet/core/web-api" target="_blank">Creating Web Apis with <span class="s1">ASP.NET</span></a></li>
</ul>
#Day 8: Binary Tree Lowest Common Ancestor and Vertical Traversal
Tags: 100daysofcode
Published: 2020-12-10 19:25:20

Hi there!

I learnt about Vertical Traversal in BT. While learning about it, I came across map. Thus, I studied about map: Hashmap , Hashtable and Treemap.
Also, I solved a question where we had to find the Lowest Common Ancestor of given BT.
Now you can convert JSON to KOTLIN Class. Raw Javascript. Share Feedback
Tags: discuss
Published: 2020-12-10 19:12:49

Now you can convert JSON to KOTLIN Class with ease. Try it out! Raw Javascript with Mocha and Chai

NPM package: https://www.npmjs.com/package/json-to-kotlin-class

Please share Suggestions/Feedback!

To read interesting topics, follow and read <a href="https://boxpiper.com/">BoxPiper blog</a>.

Support my work and [buy me a Coffee](https://ko-fi.com/E1E72C2MM). It'll mean the world to me. 😇

<a href="https://ko-fi.com/E1E72C2MM"><img src="https://cdn.ko-fi.com/cdn/kofi1.png?v=2"/></a>
Cyberpunk 2077, Timnit Gebru’s Firing, GitHub’s ‘State of the Octoverse,’ & more on DevNews!
Tags: news, podcast
Published: 2020-12-10 19:09:07

---
title: Cyberpunk 2077, Timnit Gebru’s Firing, GitHub’s ‘State of the Octoverse,’ & more on DevNews!
published: true
description: Listen to S2E7 of the DevNews pod!
tags: news, podcast
series: DevNews Season 2
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/zoxvbu0494gq3sxtjp4v.png
---

### **I'm particularly excited about this week's episode of DevNews** 

{% podcast https://dev.to/devnews/s2-e7-cyberpunk-2077-timnit-gebru-s-firing-github-s-state-of-the-octoverse-and-google-s-new-chip %}

... Why this episode, you ask? 

### @vaidehijoshi and I discussed some pretty major stories in developer news this week, including:

- Google’s move to put their own chips in Pixels and Chromebooks
- Notable items in GitHub’s “State of the Octoverse."

and [* drumroll *]...

### ... we also talked to two amazing guests about two distinct happenings I think you'll be interested in (if you aren't already glued to these stories)...

- [Nathan Grayson](https://twitter.com/vahn16), Senior Reporter at Kotaku who primarily focuses on streaming, labor, and PC gaming. Nathan spoke with us about crunch culture in game development and the differences between a company like Supergiant Games and CD Projekt Red, the maker of the newly released and highly anticipated RPG, **Cyberpunk 2077** 


- [Julien Cornebise](https://twitter.com/JCornebise), an Honorary Associate Professor at University College London, former Director of Research at ElementAI, and a former researcher with Google’s DeepMind. Julien caught us up on Google’s firing of Timnit Gebru, a co-leader of Google’s Ethical A.I. team, who said she was fired after sending an email criticizing the company’s efforts to hire more minorities as well as biases in their A.I.

_You can [follow DevNews](dev.to/devnews) to get episode notifications and listen right in your feed_ — or subscribe on your platform of choice! Plus, if you leave us a review, we'll send you a free pack of thank-you stickers. Details [here](https://airtable.com/shr8oKAIMZgdYnBxx). 

## Quick Listening Links
- [Apple Podcasts](https://podcasts.apple.com/us/podcast/devnews/id1525581923)
- [Spotify](https://open.spotify.com/episode/4FurSYWaRsC4jr56ZezKvy)
- [Google](https://podcasts.google.com/feed/aHR0cDovL2ZlZWRzLmNvZGVuZXdiaWUub3JnL2Rldm5ld3NfcG9kY2FzdC54bWw/episode/aHR0cHM6Ly9kZXZwb2RzLmRldi9wb2RjYXN0cy9kZXZuZXdzLzE1?hl=en&ved=2ahUKEwjepaHL6MPtAhWRLH0KHWv7AgMQjrkEegQIBRAF&ep=6)
- [Stitcher](https://www.stitcher.com/show/devnews)
- [Listen Notes](https://www.listennotes.com/podcasts/devnews-dev-fH8hvsClkWp/)
- [TuneIn](https://tunein.com/podcasts/Technology-Podcasts/DevNews-p1352512/)
- [RSS Feed](http://feeds.codenewbie.org/devnews_podcast.xml)
- [PocketCasts](https://pca.st/9ijgq6li)
- [Transcript](https://devpods.herokuapp.com/podcasts/devnews/episodes/72)

---
_Acknowledgements_ 
- _@levisharpe for producing & mixing the show_
- Our season two sponsors, [Triplebyte](https://triplebyte.com/a/YU8fSn0/d) and [Vonage](https://nexmo.dev/devnews2)!

# 🗞️🗞️🗞️
Former Apple Genius, left to go on a 16 month roadtrip and am now learning to code
Tags: flatironschool, javascript, ruby, genius
Published: 2020-12-10 18:56:59

console.log("Hello, Ya'll")

From 2016 to 2019 I was a Genius at Apple Retail in NYC, Seattle, and D.C. July 2019 I left Apple to go on the roadtrip of a lifetime: 16 months, 36 states, and 2 provinces. When I set out, it was going to only be 3 months but I kept adding more time.

With the advent of the coronavirus, my trip's end date was undefined. 1 month ago, after finishing a phone call with a developer friend of mine I was convinced that my next step was to learn to code.

For the next 5 months I will be learning mainly Ruby and Javascript through Flatiron School's bootcamp. I'm here on dev.to to share my story of coding.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ldh356mc1t21he0smg2e.jpg)
More intuitive shell commands
Tags: bash
Published: 2020-12-10 18:47:26

Recently I experimented with an idea to create natural language shell commands. Some of the shell commands can be unintuitive and a little hard to remember, so I decided to use aliases to make them easier to remember.

I'm on macOS, so I'm using zsh for my shell. However, the snippet below should work in bash as well (you would have to add the snippet to your `~/.bashrc` or `~/.bash_profile` file instead).

I added the following code snippet to my `~/.zshrc` file.

```
alias help='man'
alias show='less -S'
alias view='less -S'
alias create='touch'
alias copy='cp -iv'
alias move='mv -iv'
alias rename='mv -iv'
alias delete='rm -iv'
```

After adding these aliases and opening a new terminal tab or window, I was able to start using them. Here are some examples of commands you can use:

```
show index.html
create index.html
copy index.html about.html
move index.html folder-name
rename folder-name other-folder-name
delete index.html
```

##Goals

I had 2 goals in mind while creating these aliases. The first was to make the command names a little more intuitive, without making them too long. The other goal was to add in options that would make the commands a little more user-friendly. For example, the `-i` option makes the `copy`, `move`, `rename`, and `delete` commands interactive to prevent users from accidentally overwriting or deleting files.

## Notes

I noticed a couple of things while making these aliases. The first is that a couple of commands have 2 aliases. For example, I wasn't sure whether `show` or `view` would be a better alias for the `less` command, so I added both. The `mv` command is used to move and rename files, so I created 2 aliases to correspond with these 2 actions.

I also realized the `help` command doesn't work with these aliases (so something like `help show` doesn't work, for example). The one exception is `help help`, which does bring up the man page for the `man` command.

## Learn more about the shell

If you want to learn more about using the terminal and shell, you can visit my website [Simple Dev](https://simpledev.io/). You can learn about the shell, Git, and web technologies like HTML and CSS.
ONEMARKET: A price comparaison system
Tags: webdev, showdev
Published: 2020-12-10 18:40:54

Hi there!
 I've been looking for a new laptop to buy for a long time, and I found it hard to jump from a website to another and compare prices of the same model, so I decided to make a website that does just that.
 It only contains my country-specific sellers.
 This is the URL: https://one-market-sami.web.app/home
 I made it using the mean-stack and scraped the data with Scrapy.
Free free to comment and give me advice :)
Github: How to add an about me section in your Github Profile
Tags: github, tips, webdev
Published: 2020-12-10 18:22:27

Hello everyone, how is it going?

Today I want to show you how you can quickly add an about me section, or simply just a section where you can write whatever you like, on your GitHub profile.

You may have seen this on other profiles and it's a great idea to highlight some information about yourself or what you've been working on lately.

You can also use it to specify what kind of projects you want to collaborate with or if you are looking for a job you could use this space for something creative.

So let's get to it.

If you're like me and rather watch a video, here's one of me explaining how to create it:

{% youtube b2a_45FeiUE %}


If you're more of a reading person, here's how:

1. Go to your GitHub page. - If you don't have an account, please create it first
2. Create e new repository by clicking on the "+" bottom on the top navigation
3. Your new repository name **MUST** be the same as your username for this to work
4. As soon as you write the repository name correctly a warning will show up stating that you just discovered a special repository 🎉 🎉
5. You'll need to set the repository as **public**
6. Check **Add a README file** option
7. Click **Create Repository**

That's it. If you navigate to your profile page, the new section is already visible!


If you're out of ideias on what to write there, here's a post with a lot of examples!
 {% link https://dev.to/trinwin/share-your-github-profile-readme-51eo %}
Leetcode Add Two Numbers - Solution & Video Explaination
Tags: cpp, algorithms, leetcode, interview
Published: 2020-12-10 18:17:22

{% youtube AnJI0pvQvso %}

## Solution

```cpp
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
  ListNode* result = new ListNode();
  ListNode* resultPointer = result;
  int carry = 0;
  while (l1 || l2) {
    int sum = carry;
    if (l1) {
      sum += l1->val;
      l1 = l1->next;
    }
    if (l2) {
      sum += l2->val;
      l2 = l2->next;
    }            
    carry = sum / 10;

    resultPointer->next = new ListNode(sum % 10);
    resultPointer = resultPointer->next;
  }
    
  if (carry) {
    resultPointer->next = new ListNode(carry);
  }
    
  return result->next;
}
```

## Complexity

Runtime: O(n + m)
Space: O(1)
Custom Form Validation - Building SaaS #71
Tags: python, django, views
Published: 2020-12-10 18:13:03

{% youtube fPFEh5MDMIY %}

In this episode, I added some custom checking to ensure that students may only be enrolled in a single grade level for a school year. We talked about form cleaning and wrote a for unit test to prove that the change worked. After that change, we switched to a template and wrote copy for when no progress reports are viewable for users.

With the first issue, I needed to update a form that enrolls students. I wanted to ensure that students can't be enrolled in more than one grade level in a single school year. I updated the `clean` method of the `EnrollmentForm` to check that no other enrollments exist for the school year.

We added a new test case and created a test to check that the form change was correct.

With that change done, we moved onto template work. The reports index page has nothing valuable to show until certain data exists in the system. To provide something visual when that data doesn't exist, we added an empty page so that new users won't see a blank page.
Solving day 10 of Advent of Code 2020 in JavaScript
Tags: challenge, adventofcode, javascript, video
Published: 2020-12-10 17:33:11

---
title: Solving day 10 of Advent of Code 2020 in JavaScript
published: true
description: JavaScript walkthrough of Advent of Code 2020 (day 10)
tags: challenge, AdventOfCode, javascript, video
series: Advent of Code 2020 in Javascript
---

{% youtube q6m9SO11J40 %}
Spacing with Root EM
Tags: css, ux, webdev, design
Published: 2020-12-10 17:33:11

Consistent spacing across a website can make or break a design. When implemented correctly the visual quality of the page will really shine through.  

I've pretty consistently been working with an `8px` base spacing system for over a decade. It works, but using pixels as a [unit of measurement](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units) can create a headache of complexity when building viewport/device responsive experiences.

Of course we've had the EM unit, but I've never liked it.  The idea that the same component will look different depending on where it is placed seems fundamentally broken to me... And yes, the cascade in CSS is a fantastic tool, but I've always been against cascade as a doctrine, as "best practice". In my opinion, isolation through components will always be a better methodology to fall back on.

The REM unit give us the best of both worlds, pre-determined sizes that are consistent across implementations of a component, relative only to the root font size. But what about scale?

I can't suggest what scale would work for you when defining a spacing system, but it's important to have one.  A codified scale will guide developers into using a consistent set of spaces, rather than simply random values. If you find yourself using custom values it probably means the scale is not good enough. But when the scale works, developers will work faster, and in my experience the page design falls into place almost effortlessly.

The scale I defined on a recent project is a simple array of values defined as [TypeScript](https://www.typescriptlang.org/) [design tokens](https://css-tricks.com/what-are-design-tokens/) and shared using an [Emotion theme](https://emotion.sh/docs/theming). Linear increments of `0.25rem` then switching to a fibonacci scale from `3rem`, this gives plenty of options for internal component spacing and nudges, whilst still supporting the larger values needed for page layouts. Because I'm using REM, the actual pixel size will differ based on the base font-size, allowing me to holistically change the page layout based on viewport, page, and theme.

Below are a couple of screenshots from internal documentation (using [Storybook](https://storybook.js.org/)). The first shows the scale using a `18px` base unit for large viewports.

![Spacing based on REM for large screens uses 18px for 1 REM](https://dev-to-uploads.s3.amazonaws.com/i/kio3ld8gkwv33nk2h4j6.png)

And the image below shows a `16px` base for smaller viewports. 

![Spacing based on REM for large screens uses 16px for 1 REM](https://dev-to-uploads.s3.amazonaws.com/i/v1ou7nxnzb35uf7gex7q.png)

So far, so good. But it's hard to tell early in a project if and how this approach will pan out. I have worries about using an `18px` base, but it's going to be easy to change if we want to. e.g. making `1rem` equal `20px` is literarily a one line change with a huge aesthetic impact. It's currently helping the team deliver faster and worry less about design, and that I think can only be a good thing.
YNAPB (You Need A Personal Blog), And How To Do It
Tags: react, gatsby, vercel
Published: 2020-12-10 17:24:36

### You Need A Personal Blog

As a developer or other technical mind, your story, your thoughts, and even your opinions can be extremely valuable to other people. Now I know I am saying this on a non-personal blog platform, but, YOU NEED A PERSONAL BLOG.

### WHY?

Whatever, you do. 'Nuff said.

### How?

Ok, I'll show you. If you don't have a personal domain or other custom domain already then you can skip the first part.

##### Custom Domain

Head to [GoDaddy](godaddy.com) or [NameCheap](namecheap.com) and pick you up a custom domain, you will use it in a later step.

##### Getting Started

Install node if you don't already have it:

- [Node.js](nodejs.org)

Make an account here: [Vercel](vercel.com) (hint: use your GitHub account to log in and the next steps are easier)

We will use a tool called [Gatsby.js](gatsbyjs.com) to create the framework for our blog

##### Terminal Commands

Because the latest versions of node include `npx`, we don't have to install gatsby globally on our machine, we can run the following commands (referenced [here](gatsbyjs.com/starters/gatsbyjs/gatsby-starter-blog/)).

You can replace `my-personal-blog` in the command below with whatever name you want to give your blog.

```sh
$ npx gatsby new my-personal-blog https://github.com/gatsbyjs/gatsby-starter-blog
```

Let that finish and change directory into your new project folder. Keep this terminal window open for the next steps. The command to do this will be output when Gatsby finishes it's set up if you don't already know this command.

That's it. You're done...kinda.

##### GitHub-Vercel Deployment

Go to GitHub and create a new repo, name it what you named your blog in the previous step. Then copy the commands listed in the empty repo under the heading `...or push an existing repository from the command line`, then run that in your terminal (from the same terminal window from the last step).

That pushes your Gatsby blog up to GitHub.

Now go to Vercel and click the black "Import Project" button at the top of the dashboard, select "Continues" under "Import Git Repository" and enter the URL of your repo. On the next screen give it a new name (or keep the existing one) and click deploy.

NOW you're done. Wait for that to deploy and you're good...

### Next Steps...

If you purchased a custom domain in step 1 (or already owned one), then the last step is setting that domain up in Vercel (this involves setting up nameservers and DNS records and is a bit outside scope for this simple blog, but feel free to comment if going through that would be helpful).

Now go tell your story!

Links:

- [Gatsbyjs.com](https://www.gatsbyjs.com/docs/) to find tutorials on how to add new blog posts and pages and other features
- [Vercel](https://vercel.com/docs) to read more about what you can do with Vercel
Some proble with React
Tags: react, reactstate
Published: 2020-12-10 17:19:03

When use react with out any flux framework, I found that when create some components to build one page, I must make too many state in each components and can't share the state between two compnents. 


for example my metting room app that is a meeting app like zoom implement by webrtc:

### question 1:  

when I try to make sure the layout full in the screen, I must listen the window resize event to change every conponent's height and  width. So, how many conponents I wrote how many resize event function I must implement. I can't write just onece in the root conpnent and share the window height and width data to children.

```javascript
import React from 'react';
import {List} from 'antd';
import { UserListItem } from './UserListItem';

export class UserList extends React.Component{

    constructor(props) {
        super(props);
        this.state = {
            height : window.innerHeight - 40
        }
    }

    componentDidMount(){
        window.onresize = ()=>{
            this.setState({
                height:  window.innerHeight - 40
            })
        }
    }

    render(){
        return(
            <List 
                className = 'user-list'
                header =  'All Users'
                style = {{height: this.state.height + 'px'}}
                dataSource = {this.props.users}
                renderItem = { item => (
                    <List.Item>
                        <UserListItem user={item}/>
                    </List.Item>
                )}>
            </List>
        )
    }

}
```

### question 2:
I have a user list for one page, when the user list changed I can't notify change and trigger the change in other conpnent.


so, I should use one store.js to manage the state, should I use redux? I'm new for react...
Rails gets out of the way when you need that most.
Tags: ruby, rails, startup, news
Published: 2020-12-10 17:04:02

It's underrated how tough it can be to get a new thing off the ground, and how delicate that phase is.

{% tweet 1337076813101748224 %}

If a solution is optimized for getting to scale, and not for getting started, it might just be the wrong solution for getting to scale. Hopefully everything we use is capable of the scale we may eventually need of it, but that process will be a windy journey, and you can't even take the first step if you're stuck at the starting gate.

{% link https://dev.to/ben/im-ben-and-i-am-a-rails-developer-1j67 %}

When AirBnB was figuring out what it was, trying new things, running Craigslist adds to try and get customers, Rails was there with some basic ways to provide models, views and controllers. It was opinionated, and ready for the challenge.

For no specific API or pattern or technical solution, I'm still a very excited Ruby on Rails developer. I also _love_ a hypothetical scenario where Forem is eventually rewritten in some kind of way where we can package the whole thing into a tight, radically memory efficient binary. But for now, and probably forever, we're still riding the Rails.