teleren/devto huggingface dataset:
Some.. components of computer.
Published: 2022-09-02 09:43:49




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fye9tp2pe9admswa9llr.jpg)
## CPU :
All kinds of computing or electronic devices such as laptops, tablets, and phones have a small chip that calls CPU (Central Processing Unit). It is a brain for the devices. it calculates and interprets instructions while any work is going on on the device.

## Monitor :
The monitor is used for getting the output either in text format or graphical .those are connected with mainly HDMI and SVGA/VGA cables.

## Keyboard :
The keyboard is an input device that enters the computer's values, strings, numbers, and symbols. That looks as same as a type-writer with some additional keys. When the key was pressed the instruction was fired to the processor.

## Mouse :
The mouse is also an input device. it controls the cursor of the computer and helps to make tasks easy to perform and fast response .it is used as a pointer device. The mouse is classified as a mechanical and optical mouse. The mouse uses laser technology to track the pointer. That can be wired or wired less mouse

## Speakers :
The speakers are used to get the output in audio. It is an optional part of the computer. It gets audio output while listening to the audio track or song, watching movies, playing games, Etc. The speakers are connected to the sound card and convert the sound card’s electronic frequency into the output form of audio.

## Webcam :
A webcam is an optional part of the computer system; it is mainly used in capturing photos and videos from the computer and sending them in digital form. it is not in-built into the computer.

## Printer :
It is an optional device that is used by a computer. it can be connected with wired or wired-less both. It is an output device that generates the softcopy of any instruction into a hard copy on paper. That can be given output in text format or picture format. it can be two types of copy generating can be possible

Black & white
Colored

## Modem :
The main purpose of this device is to provide the internet to the computer.

## Projector :
A projector or image projector is an optical device for the computer. That creates the image or presentation on the surface and creates the projection screen.
Need help creating new child record with foreign key of paren
Tags: entityframework
Published: 2022-09-02 09:32:48

I'm building a CRUD Application to manage my company's back end and having issues with creating a new child record for a parent. The standard auto-generated controller based on the model is set up to create a new record but not a new child record so I need to modify the controller and or the models.  The models involved are: Bundle.cs and Agreement.cs:

```
using System;
using System.Collections.Generic;

namespace AdminPortal.Models
{
    public partial class Bundle
    {
        public int Id { get; set; }
        public DateTime StartUtc { get; set; }
        public DateTime EndUtc { get; set; }
        public int Quantity { get; set; }
        public int? AgreementId { get; set; }
        public decimal? BundlePrice { get; set; }

        public virtual Agreement? Agreement { get; set; }
    }
}

```

```
using System;
using System.Collections.Generic;

namespace AdminPortal.Models
{
    public partial class Agreement
    {
        public Agreement()
        {
            AgreementAmendments = new HashSet<AgreementAmendment>();
            Bundles = new HashSet<Bundle>();
            Invoices = new HashSet<Invoice>();
        }

        public int Id { get; set; }
        public int OrgId { get; set; }
        public string? AgreementNumber { get; set; }
        public string? IrespondReference { get; set; }
        public string? DocumentLink { get; set; }

        public virtual Organization Org { get; set; } = null!;
        public virtual ICollection<AgreementAmendment> AgreementAmendments { get; set; }
        public virtual ICollection<Bundle> Bundles { get; set; }
        public virtual ICollection<Invoice> Invoices { get; set; }
    }
}

```
This is the create method in the Controller

```
[HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<IActionResult> Create([Bind("Id,StartUtc,EndUtc,Quantity,AgreementId,BundlePrice")] Bundle bundle)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bundle);
                await _context.SaveChangesAsync();
                return RedirectToAction(nameof(Index));
            }
            return View(bundle);
        }
```
I'm new to EF Core so don't even know where to start.
Learning new programming language
Tags: javascript, react, beginners
Published: 2022-09-02 09:29:44

Am learning React.js. And going over JavaScript everyday to understand React.js. Learning new programming language is a good choices, as well as the advantages they offer. 
Am ready for everyone to help me  while i stroll down the path of knowledge and reach a point of good decision. And yes, I'm not afraid of getting some grease on my elbows.
This Week in Python
Tags: python
Published: 2022-09-02 09:26:50


**Fri, September 02, 2022**


This Week in Python is a concise reading list about what happened in the past week in the Python universe. 


## Python Articles

- [Python Data Visualisation](https://tech.marksblogg.com/python-data-visualisation-charts-graphs-plots.html)
- [gevent For the Working Python Developer](http://sdiehl.github.io/gevent-tutorial/)
- [Accelerate Python code 100x by import taichi as ti](https://docs.taichi-lang.org/blog/accelerate-python-code-100x)
- [Python tooling could be much, much faster](https://notes.crmarsh.com/python-tooling-could-be-much-much-faster)
- [How to write reliable tests for Python MQTT applications](http://blog.rareschool.com/2022/08/how-to-write-reliable-tests-for-python.html)




## Projects

- [redis-search-django](https://github.com/saadmk11/redis-search-django) – Django package that provides auto indexing and searching capabilities for Django model instances using RediSearch
- [manim](https://github.com/ManimCommunity/manim) – A community-maintained Python framework for creating mathematical animations
- [Regressio](https://github.com/ManimCommunity/manim) – A python library for univariate regression, interpolation, and smoothing
- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) – Awesome multilingual OCR toolkits based on PaddlePaddle
- [django-pgtrigger](https://github.com/Opus10/django-pgtrigger) – Write Postgres triggers for your Django models


**Which articles did I miss?**
Publish your static website for free
Tags: github, netlify, webdev, webcomponents
Published: 2022-09-02 09:26:30

Many IT folks ask me I've made my project in Web Dev as beginner but I want to showcase it to my client/people for free. Where should I upload & publish them? My simple answer is Google Drive. I'll write another article about how to upload static sites in Google Drive. So, one of the professional method is using Github & Netlify. Netlify is a github authorised application to run static web pages. You can use it just by authorizing the repos access to it. In this article, I'll let you know from basics to full uploading and getting the link. So, let's get started.

## Steps to consider:

1. Create Account
2. Create Repo
3. Push/Upload contents in repo
4. Sign Up/Login in Netlify using Github
5. Connect your target repo
6. Publish it

_NOTE : Ignore following warning in some screenshots._

![Warning](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u176n9giqkdsvdyvh4ix.PNG)

----------------------------x-------------------------

## Descriptive steps

Step 1: Create Account in [Github](https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F&source=header-home).
_P.S.- If already have an account, Login to your account._

![Signup/Login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26g2u5acrer6cu10adr5.PNG)

Step 2: After logging in, Click on 'Create/New Repository' from Home

![Create/New Repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xmii4z1afk4xaddnump6.PNG)

Step 3: Put the necessary details in the space provided for repo name & description. You can add README file or License from this tab too.

![Repo desc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odstde8tna33f9r8aztm.PNG)

Step 4: Upload the files for your project(if already created) or create files as required.

![Upload files](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xoyvy8h7y5qf9v0jbp1u.PNG)

Step 5: Signup/Login to [Netlify](https://app.netlify.com/signup) using GitHub only for proper connection with repos.

![Signup/Login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xd33b9v9qnlyw7v5g4ug.PNG)

Step 6: Chose the repo which you want to publish/make live.

![Select repo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spxg7sqorkgeole7row6.png)

Step 7: Click on 'Deploy Site' button to publish it publically. A web link will be generated trailing with `.netlify.com`. 

![Deploy site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cprjcsw4um81vye7e3yi.png)

Step 8: You may customize the site name from `Site Settings >> General >> Change site name`

![Customize site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8fbg68b8uza0ljf27ghk.png)

Step 9: You may put the link in GitHub repo under description too.

![Test link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyxwrekiyyrdgpx437sg.png)


A detailed video is uploaded below for your reference.

{% vimeo 745727768%}


Thanks for reading, Keep reading, Keep supporting.!!
Connect with me on [LinkedIn](https://www.linkedin.com/in/nitin30kumar/) or [Github](https://github.com/nitinkumar30/).
Conditional check of presence of an element with chaining
Tags: javascript, node, typescript, programming
Published: 2022-09-02 09:02:41

We many times fail to write a better conditional checks for JSON objects and fall-asick with either errors or more code.

Here is the better solution to avoid both of these issues!!!!


![source : happyho.in](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l599ycyk0vbiz65q8zy5.jpeg)

### Introduction

Optional chaining is available for Node - 14.0.0 or higher versions. ( complete browser compatibility is [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining#browser_compatibility) )

## Usage

Let's say there's code for an object to select the organiser name from the object of **event**

We will find it something like this :

`const organiser = event.organiser.name`

And what if event or organiser is `undefined` for an error ?

![Image source : seekpng](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tg5my3h5y6x3oyk76hd0.png)

you'll endup with error : `Cannot read the properties of undefined ( reading 'name' )`

You may think and logic scarier then the bug and may fix it like this :

`const organiser = (event && event.organiser && event.organiser.name) && event.organiser.name`

Woooohhhh!!!! you resolved the bug!!!
But did you maintain the standards of code???

Nnnnnnnnoooooooooooooo!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

## How about this ?

`const organiser = event?.organiser?.name`

Great!!!!!!


![Image source : emojiterra](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlsfbd2l082gykty0ylp.png)

This will keep the code less as well as check the conditions of presence.
Returns undefined if any of the parameter in the chaining is undefined.

Hope this small thing makes your day and improves your code!!!!!
My js image editor
Tags: javascript, webdev, beginners, css
Published: 2022-09-02 09:18:17

Hello , recently I have made my first big project in html,css,sass, and javascript,a basic image editor.
I'll be very pleased if you could take a look at it and give me some feedback.
Here is [the link to the webpage](https://jlimageeditor.netlify.app)
git — Fatal: Not possible to fast-forward, aborting
Tags: github, git
Published: 2022-09-02 09:13:18

[Top 5 Answer for git — Fatal: Not possible to fast-forward, aborting](https://www.thecodeteacher.com/question/17556/git---Fatal:-Not-possible-to-fast-forward,-aborting)

1

git pull --rebase. Unlike the other solution, you don't need to know the name of your destination branch.

If your upstream branch is not set, try git pull origin <branch> --rebase (credit to @Rick in the comments)

2

Your branch is no longer directly based off of the branch you’re trying to merge it into — e.g. another commit was added to the destination branch that isn’t in your branch. Thus, you can’t fast-forward into it (because fast-forward requires your branch to completely contain the destination branch).

You can rebase your branch on top of the destination branch (git rebase <destination branch>) to rework the commits such that they will fast forward into it, or you can do a regular merge.

If
git pull
does not do the trick and if you want to merge both the current changes and the changes that’d come from the pull of the branch from origin then do this:-

git merge origin/BRANCH_NAME
After that, resolve the merge conflicts if any and done for the day.
3

This is because you have enabled the fast-forward only option. The thing here is your pull from the branch will create a merge commit in your local git and the fast-forward only option doesn’t allow creating a merge commit at the time of pull.

In the case of a big team, You will end up rebasing and resolving conflicts lots of the time and for each and every commit coming from the pull.

I suggest you remove ff = only line from git local config file.

$ cd to-my-project-root-dir

$ nano .git/config

[pull]         ff = only // remove this line         rebase = false
5

git pull --no-ff -> make fast-forwarding to be off by --no-ff
dato.rss need your help!
Published: 2022-09-02 09:10:27

[datorss.com](datorss.com) the search engine I launched a year ago has exceeded 3 million entries imported from over 750 RSS feeds. 

Every day more than 200 users access the portal to search for information.

All this, however, comes at a price. I can no longer cover the infrastructure costs. I am asking for your help.

If you can buy me a coffee so that I can continue to work on making the search engine better and better performing with new features.

Thank you

My PayPal: davide.santangelo@gmail.com
GitHub Sponsor: https://github.com/sponsors/davidesantangelo/dashboard


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pxp88krrqavt28rhvpuf.png)
Active Storage Variants Failing Locally
Tags: rails, puma
Published: 2022-09-05 01:47:06

---
title: Active Storage Variants Failing Locally
published: true 
date: 2022-09-02 09:01:01 UTC
tags: rails,puma
canonical_url: 
---

#### Setup

- ruby 3.0.4p208
- puma 5.6.1
- Rails 7.0.2
- macos 12.4 m1 
#### Issue

I kept getting broken images when generating variants locally. I found the error below in my rails logs.

#### Error

```
[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called
[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called

```

#### Fix

I had to add this to my `zshrc` before I initialize `rbenv`

```
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES

```
31 days until the 9th edition of Devoxx Morocco!
Tags: java, techtalks, programming
Published: 2022-09-02 08:56:28


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/31w9ilcmk20glbnardps.jpg)
Under the high patronage of His Majesty King Mohammed VI, Devoxx Morocco is back for the 9th edition, with great content, outstanding speakers and a wonderful venue 🇲🇦

A huge thanks to our partners and sponsors for believing in the conference 🙏

👉 Join us for 3 days of knowledge, growth and fun in Taghazout-Agadir, Morocco, where industry leaders and technology enthusiasts gather to enjoy and shape the world of tech

Mark your calendar for the 3rd to 6th of October for the largest
developer conference in MEA.

🔥 Secure Your Ticket at: https://register.devoxx.ma

XHUB Conseil Régional Souss Massa, Ministère de la Transition Numérique et de la Réforme de l'Administration CGEM Centre Régional d'investissement Agadir Souss Massa CIH BANK Société Générale Maroc Intelcia IT Solutions Lunatech
React lifecycle methods
Published: 2022-09-02 04:43:33



Each component in react live a life - from birth to death.
Main three stages of the lifecycle of a component are:

1. `Mounting` : Birth of the component
2. `Updating` : Growth of the component
3. `Unmounting` : Death of the component


we have many method in these lifecycle, but i'm talk about four mostly used methods. These methods can only used in class components.

## render()

```
render() {
    console.log('rendering')
    return (
        <div>
          <div>Parent Component</div>
        </div>);

         }
```

Other ways can be used, but this one must be declared. Our component is created at this stage and is added to the DOM. Rendering of the component to the DOM




## componentDidMount()

The componentDidMount() is called after the component is rendered.




```

class... {
constructor(props) {
    super();

    this.state = {
        color : ''
    }
}

    componentDidMount() {
        this.setState({
            color: 'red'
        })
    }

    render() {
        <h1>I, a header element, is born! My color is {this.state.color}</h1>
    }

}

```


## componentdidupdate()


Once the update is complete, this method is called. It accepts as input the previous props, previous state. This is an ideal location for causing side effects and making network requests for the updated props.

```
 componentDidUpdate(prevProps) {
        if(this.props.color !== prevProps.color) {
            console.log('component updating')
        }
    }

```

## shouldComponentUpdate()

When state or props change, you'll want a component to re-render. You do, however, have control over this behaviour.
You can control whether the component is rerendered by returning a boolean (true or false)  within this lifecycle method.

```
shouldComponentUpdate(){
    console.log('shouldComponentUpdate')
    return true
}
```


### Reference links

[react js](https://reactjs.org/blog/2018/03/29/react-v-16-3.html)

[log Rocket](https://blog.logrocket.com/react-lifecycle-methods-tutorial-examples/#shouldcomponentupdate)
Build blog site by markdown files by single index.html
Published: 2022-09-02 08:41:39

[casual-markdown-blog](https://github.com/casualwriter/casual-markdown-blog) is a handy solution to build blog site by markdown files and single index.html

What we need is config home page at index.md, then start write post in markdown!


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ownrf7ne2ufcq8i3cuf.jpg)

It is very handy to build simple blog-site from markdown files, and host on static web hosting. For example,  

* Self-host on github: https://raw.githack.com/casualwriter/casual-markdown-blog/main/source/index.html
* Casual-Markdown's Blog: https://casualwriter.github.io/casual-markdown/blog
* Dark theme: https://casualwriter.github.io/casual-markdown/blog?theme=dark
* Dark (always): https://casualwriter.github.io/casual-markdown/blog?home=index-dark.md
* Nav at right-side: https://casualwriter.github.io/casual-markdown/blog?home=index-right.md 

### Usage Guide

simply copy [index.html](https://github.com/casualwriter/casual-markdown-page/blob/main/source/index.html) to web server, or fork [this repo](https://github.com/casualwriter/casual-markdown-blog). 

* config site at index.md (title, subtitle, header-color, navigation, etc..)
* start to write blog post using markdown
* to publish, just add the post in index.md by syntax 


below is sample setup from [Sample Blog: index.md](https://raw.githubusercontent.com/casualwriter/casual-markdown-blog/main/source/index.md)

```
------------------------------------------------------------------title      : Casual-Markdown's Blog 
subtitle   : Simple is the best
nav-group  : featured, new-3, tags, months
nav-width  : 320px
css-header : background:linear-gradient(to bottom right, #06c, #fc0); color:white
menu       : 
   Home    : ?
   Github  : https://github.com/casualwriter/casual-markdown-blog
   Dark    : javascript:darkmode()
   About   : ?page=about.md
------------------------------------------------------------------
<style comment="additional style">
......
</style>

<div id="md-post">

home page in markdown syntax...

## Archive

* yyyy/mm/dd: [Post Title](md file)  { #tag1, #tag2 }
* yyyy/mm/dd: [Post Title](md file)  { #tag1, #tag2 }
...
* yyyy/mm/dd: [Post Title](md file)  { #tag1, #tag2 }

</div>

```



looking forward to your advice to help it getting better,  

thanks
Today's Daily Humor For Devs - Daily Developer Jokes
Tags: jokes, dailydeveloperjokes
Published: 2022-09-02 08:00:25

---
title: "Today's Daily Humor For Devs - Daily Developer Jokes"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259b4a4ae9.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ Why do developers mixup Terminals and Polygraphs?

___A:___ Because they both can see a lie (CLI)
 -->
How does Linux automatically identify which application to install when using the "sudo apt-get install" thingy?
Published: 2022-09-02 08:23:03

I completed a Linux course that required me to install many programmes, but I still don't understand how Linux can install programmes like VLC Media Player with simply the command "sudo apt-get install vlc."

as in wtf? How did it know that VLC Media Player, rather than a different software with "vlc" in the name, is the one I want to install? What if there are several versions available? How did it decide which one to use?

[youtube thumbnail download](https://youtubethumbnaildownload.info/)