teleren/devto huggingface dataset:
SPO600 Lab2 - Experiments
Published: 2021-11-01 03:53:45

This section is going to modify the starter code in order to do some experiment with the bitmap.

**Starter Code**
```
	LDA #$00	; set a pointer at $40 to point to $0200
	STA $40
	LDA #$02
	STA $41

	LDA #$07	; colour number

	LDY #$00	; set index to 0

loop:	
	STA ($40),y	; set pixel at the address (pointer)+Y

	INY 		; increment index
	BNE loop	; continue until done the page

	INC $41		; increment 1 page
	LDX $41		; get current page number
	CPX #$06	; compare with 6
	BNE loop	; continue until done the page
```

![Starter Code Result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ewq16d7tpzbabg994d2.jpg)


**Experiment 1**
```
 	LDA #$00	; set a pointer at $40 to point to $0200
	STA $40
	LDA #$02
	STA $41

	LDA #$07	; colour number

	LDY #$00	; set index to 0

loop:	
	TYA		; experiment 1
	STA ($40),y	; set pixel at the address (pointer)+Y

	INY 		; increment index
	BNE loop	; continue until done the page

	INC $41		; increment 1 page
	LDX $41		; get current page number
	CPX #$06	; compare with 6
	BNE loop	; continue until done the page
```

![Experiment 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ddjsw9282usi1woaxof3.jpg)

After adding "TYA" after the "loop" label and before the "STA ($40),y", there are 32 vertical lines with 16 different colours displayed on the bitmap. 

This is because "TYA" means "Transfer Y to A" and our accumulator(A) is holding the colour. Since we are incrementing the Y register after "TYA", the colour will change every time the value of Y register is incremented. Moreover, there are only 16 colours available and the bitmap has 32 columns so the vertical lines will be displayed.


**Experiment 2**
```
	LDA #$00	; set a pointer at $40 to point to $0200
	STA $40
	LDA #$02
	STA $41

	LDA #$07	; colour number

	LDY #$00	; set index to 0

loop:	
	TYA		; experiment 1
	LSR 		; experiment 2
	STA ($40),y	; set pixel at the address (pointer)+Y

	INY 		; increment index
	BNE loop	; continue until done the page

	INC $41		; increment 1 page
	LDX $41		; get current page number
	CPX #$06	; compare with 6
	BNE loop	; continue until done the page
```

![Experiment 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knz1v70upyqfova9el82.jpg)

The instruction "LSR" means "Logical Shift Right" which will shift every bits one position to the right, this will result the vertical lines with one pixel wider.

![Experiment 2-2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xnqnqgcrvixe8f1dud7l.jpg)

As we adding more "LSR" instruction, the wider the pixels will be.
How to improve swift code using SwiftLint & Swiftformat
Tags: swift, programming, beginners
Published: 2021-11-06 04:00:52

Hello Everyone, Welcome to my blog on how to format swift code using [swiftformat](https://github.com/nicklockwood/SwiftFormat) & [swiftlint] (https://github.com/realm/SwiftLint). 

## TOOLS USAGE

```bash
$ brew install swiftformat
$ swiftformat [fileName]
```
```bash
$ brew install swiftlint
$ swiftLint [fileName]
```
## INTEGRATE XCODE

Integrate SwiftLint into your Xcode project to get warnings and errors displayed in the issue navigator.
To do this click the Project in the file navigator, then click the primary app target, and go to Build Phases. Click the + and select "New Run Script Phase". Insert the following as the script:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cv966kphi2y0yl0e3mgy.png)

Similarly, create the build phase with Swiftformat.

## ISSUES RELATED TO SOURCE CODE
Issues found during the lint format:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59e7wpfsj6s9653957uo.png)

## Tool to run from command line
```bash
$ swift run ModernSSG | swiftformat .
```

## Other IDE Integrations
1. AppCode

To integrate SwiftLint with AppCode, install
[this plugin](https://plugins.jetbrains.com/plugin/9175) and configure
SwiftLint's installed path in the plugin's preferences.
The `autocorrect` action is available via `⌥⏎`.

2.Atom

To integrate SwiftLint with [Atom](https://atom.io/), install the
[`linter-swiftlint`](https://atom.io/packages/linter-swiftlint) package from
APM.

3. Visual Studio Code

To integrate SwiftLint with [vscode](https://code.visualstudio.com), install the
[`vscode-swiftlint`](https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swiftlint) extension from the marketplace.

## Conclusion
This source code format in swift is easy and prominent for the development process and makes code less prone to small errors. This development will surely reduce the issues and make a constant format for new projects. 

## Commits
[merged_commit](https://github.com/japneetsingh035/ModernSSG/commit/86670d10582c57dcab9b38cc39c3279e6fa37967)
Welcome post
Tags: welcome, webdev, programming, react
Published: 2021-11-06 03:57:05

Hello Dev community,
This is my first blog, Let me introduce myself, Currently I am learning MERN stack and finding some open source projects on react.js (if you know any please let me know). I have done my graduation in 2020  (b.sc maths). I also work as a graphic designer or you can say UI/UX designer, I am passionate about coding and love to build things. you can visit my website to find more details about me at https://jainromil56.github.io/home/ 

Thank you for reading.
My First React App Deployed on Firebase: Dog Facts
Tags: react, javascript, webdev, css
Published: 2021-11-06 03:50:01

# Introduction

After developing and deploying my first Javascript based API that I wrote about [here](https://dev.to/mrsharm/my-first-javascript-rest-api-dog-facts-deployed-to-heroku-522p), I decided to create a a simple frontend for the API with React.js. Once the application was complete, I deployed it to firebase: https://dog-facts-2277d.web.app/. 

## Development

What made development smooth was learning about:

1. [React Components](https://reactjs.org/docs/components-and-props.html)
2. [BEM Naming Convention](http://getbem.com/naming/)
3. [Tutorial on CSS Flex Box](https://www.youtube.com/watch?v=JJSoEo8JSnc)

Additionally, making use of react-bootstrap's Card component simplified a lot of the styling of the individual facts. Granted this website is incredibly simple, I am still happy with the results:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5l7s794ewktitv3tilpl.png)

The Github repo for this project can be found [here](https://github.com/MokoSan/DogFacts)

## Deployment

Deployment with Firebase was a breeze. I used the Firebase CLI to easily initialize the project and then deploy. What was cool was the integration with Github using Actions i.e. with each push there is an automatic deployment of the new app.

## Conclusion

Any feedback would greatly be appreciated!
Adding a Linter - The Great Site Generator 
Tags: cpp, opensource
Published: 2021-11-06 03:39:38

This week I focused on adding <code>clang-format</code> to [my code](https://github.com/drew5494/the-great-site-generator/commit/d2ce6eea082830dfacaf10f3ed9008b91d64937a) to have better consistency when other developers are contributing.  I chose this as it has a [VSCode extension](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format) and works very well with C++ which is what my project is written in. 

I added settings in the <code>.vscode</code> folder to ensure that every time a user saves their work, the code is automatically formatted according to the <code>.clang-format</code> file requirements. Originally, there was a script I created, but I decided to remove it as it wasn't very necessary when VSCode automatically formats it anyway.  
After running it on my code, I noticed it had found many things it didn't like. It mostly indented long lines into shorter lines for easier readability. It also moved some braces around. 

I finally learned how I can integrate formatters into my IDE and make it easier for developers to contribute. That is what Github is all about after all!
vscode editor on browser for github repo
Tags: github, vscode
Published: 2021-11-06 03:35:36

Today I learned about the on browser vscode editor for github repo.

**So all you have to do is search for a github repo, and press a "." key in your keyboard.**

Voila! you will get a vscode editor on your browser.

I am totally amused and excited to find this trick.
I believe it will be totally useful for many developers out there.
Introduction to Github.dev
Tags: webdev, github, devops, javascript
Published: 2021-11-06 02:40:14

Hello Devs,

### Have you tried github.dev ?

```js
if (yes) {
  console.log("let me know");
} else {
  console.log("give it a try");
}
```

### So, whats github.dev ?

it is basically a online vs code editor for your github repos and its really amazing and fast.

### How to access it ?

Just open any of your repo and replace github.com with github.dev and that it, now you can able to edit your code and commit your code in online VS code.

lets discuss the shortcut to open VS code directly from your github repo,
open any of your github repo and press dot (.) from your keyboard and here you go.

Below is a demo, do checkout this.

![demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmr1mnmefik2b0dri0qq.gif)

Hope its a nice and informative read for you.
VISIT https://www.capscode.in/blog TO LEARN MORE...

Thanks,
CapsCode
Lab 7 - Add contribution guides
Tags: opensource
Published: 2021-11-06 00:34:04

## Intro 
Intro
For my seventh lab, I have to setup contribution guides, prettier, eslint, and husky to my text ssg project.


## IDE support 
I created a .vscode folder in my project and put `extensions.json` for every extension I want the user to download to their IDE. I also added a `settings.json` to set the setting of the IDE.

## Prettier
Prettier is a code formatter, I added to my project by running `npm install --save-dev --save-exact prettier`, after that I create a `.prettierrc.json` file and put my prettier config. I also created a ` .prettierignore` to ignore files to not be formatted.
I added some script in the `package.json` to run those command
```json
"prettier": "prettier --write \"./**/*.{md,json,html,js}\"",
"prettier-check": "prettier --check \"./**/*.{md,json,html,js}\"",
``` 

## Eslint
Eslint is a tool that helps to identify potential bugs, I added to my project by running `npm install eslint --save-dev`, after that I run `npx eslint --init` to generate my Eslint setting. I also added the airbnb Eslint plugin.
I added some script in the `package.json` to run those command
```json
"eslint": "eslint --config .eslintrc.js .",
"eslint-fix": "eslint --fix --config .eslintrc.js  .",
"lint": "npm run eslint",
```

## Husky 
Husky to setup some tests before committing. I installed to my project by running `npm i husky` and add a pre-commit hooks with `npx husky add .husky/pre-commit "npm run prettier-check"`, this will run a prettier check each time we commit. If the check fails the commit is aborted otherwise it will commit.

## Contribution guideline
I created a `contribution.md` for a guideline on how to install and run locally, some steps to follow before committing the code, and steps to follow before creating an issue.
Politics are expected
Tags: workplace, officepolitics
Published: 2021-11-19 12:44:48

---
title: Politics are expected
published: true
date: 2021-11-06 00:00:00 UTC
tags: workplace,officepolitics
canonical_url: https://jhall.io/archive/2021/11/06/politics-are-expected/
---

Do you hate office politics?

Yeah, me too. Except when I don’t.

The popular business parable, [_The Five Dysfunctions of a Team_](https://amzn.to/3BV5cel) by Patrick Lencioni, defines office politics as:

> Politics is when people choose their words and actions based on how they want others to react rather than based on what they really think.

More broadly speaking, office politics is “activities that relate to influencing the actions and policies” of the workplace.

The book, and a lot of water cooler talk, paints politics in a negative light, and it often is, of course. If you tell your boss the release is on schedule, even when you know it’s in jeopardy due to a mistake that might get you fired, that’s politics, and not the good kind.

But if we look more closely, it’s really a rather neutral concept.

Petitioning your HR department to adopt a more equitable bonus scheme is politics.

Praising a colleague for a job well done, even though they always look down their nose at you, could be politics.

Asking for a pay raise for yourself, or a colleague, can be politics.

Here’s the thing…

Any time two or more people work together, there _will_ be politics.

The meaningful question is: is it abusive politics? Does it stifle honesty, creativity, and problem-solving? These are the things that deserve an effort to avoid.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
DPS909 - Lab 7
Published: 2021-11-05 23:51:43

# Introduction
For this weeks lab in DPS909 (Open source development) we accomplished some big things. The purpose of the lab was to implement a few new features into our static site generator ([mine](https://github.com/roman-rezinkin/RomanStaticSG)).

## New Features within RomanStaticSG
The first task was to create a Contributing.md file within our project. This file is responsible for letting new developers understand how to contribute to my open source project. This was something that was very crucial to add in my open source project.
You can see the changes [here](https://github.com/roman-rezinkin/RomanStaticSG/commit/854155cdba236054209c23df57c08c61ef1ae4ff)

### Feature 1
For feature 1, we had to implement a formatter for our project. Since my static site generator is developed in Python, I opted to use the [black](https://github.com/psf/black) formatter. It has the best features, and is one of the most popular formatters for Python.
You can see the changes that the formatter did, as well as my simple bash script that the user can run to format the files at the same time.
[Commit](https://github.com/roman-rezinkin/RomanStaticSG/commit/854155cdba236054209c23df57c08c61ef1ae4ff)

### Feature 2
For feature 2, we have to implement a linter for our project. Since my static site generator is developed in Python, I opted to use [Pylint](https://pylint.org/). This linter is very powerful and has many great features. After running the linter, it provided me a lot of feedback on how I can improve my code. So I spent about 30-40 minutes fixing it all to make my code 100% efficient. This included changes file names, changing variable names, etc. All of my changes could be found here [Commit](https://github.com/roman-rezinkin/RomanStaticSG/commit/854155cdba236054209c23df57c08c61ef1ae4ff)

### Feature 3
The final feature was to implement IDE integration. This meant integrating my formatter and linter so that the next developer would have automatic usage of the formatter and linter, instead of running my shell scripts. Anytime something is automatic rather than manual, it makes the setup process and development process that much easier. I introduced a .vscode folder and a settings.json file that introduces a few parameters to enable Pylint and Black.

# Conclusion
Overall, this lab was not too difficult, however, it introduced me to Python formatters and linters. These features cleaned up my code, and will also ensure that any future contributions will be done up to standard. The introduction of the CONTRIBUTION.md file, will also allow new users to gain a perspective how they can contribute to my open source project.
x86 CPU registers
Tags: assembly, nasm, x86
Published: 2021-11-11 13:12:36

---
title: x86 CPU registers
published: true
date: 2021-11-06 00:00:00 UTC
tags: assembly,nasm,x86,assembly
canonical_url: https://www.mourtada.se/x86-cpu-registers/
---

This is the third post about x86 assembly. In the previous post I went through every line of a minimal assembly program. In this post I will briefly explain some of the x86 CPU registers.

## General purpose registers

Most of the work of a CPU is to process data. But reading and storing data from memory slows down the processor. Therefore the processor has storage of it’s own called registers. There are 16 64-bit registers in the x86 architecture.

- rax
- rcx
- rdx
- rbx
- rsi
- rdi
- rsp
- rbp
- r8-r15

These registers are used for inputs and outputs for different CPU instruction. For example in the application binary interface(ABI) for linux 64-bit the `rax` register is used for specifying the syscall number and it’s also used for storing the return value of functions. The arguments for a function is then stored in order `rdi`(arg1), `rsi`(arg2), `rdx`(arg3) and so on. If there are more arguments than six they are stored on the stack.

The image below shows the calling conventions for syscalls on different CPU architectures for linux 64-bit.

![Linux 64-bit ABI](https://www.mourtada.se/assets/linux_abi.png)

## Special purpose registers

While the values stored in a general purpose register has no special meaning to the processor, special purpose registers holds state about the program.

Here are examples of special purpose registers:

- rsp - Stores the memory adress to the top of the stack
- rbp - Stores the memory adress to the current stack frame
- rip - Stores the memory adress of the next instruction to execute
- rflags - Here the CPU stores information about the result of arithmetic instructions. For example comparing numbers.
Install nginx with passenger in MacOS Monterey
Tags: nginx, macos, monterrey, passenger
Published: 2021-11-05 23:35:18

Maybe if you have installed nginx and upgrade to the new macos monterrey you could have an issue starting nginx.

```
objc[65203]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[65203]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
```

First we need to remove nginx
```
brew uninstall nginx # uninstall nginx-full
rm -rf /usr/local/etc/nginx
```

Now we should reinstall nginx
```
brew tap denji/nginx
brew install nginx-full --with-passenger
```

Edit your nginx.confg (`/usr/local/etc/nginx/nginx.conf`) and add the following code in the http scope:
```
passenger_root /usr/local/opt/passenger/libexec/src/ruby_supportlib/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;
passenger_env_var OBJC_DISABLE_INITIALIZE_FORK_SAFETY YES;

### If you're using rbenv passenger_ruby /Users/user/.rbenv/shims/ruby;
```
Be a Happy Coder
Published: 2021-11-05 23:23:34

When starting my new coding journey I was hopeful, I remember telling myself that I would rock my bootcamp, that I would make this and that project, probably have a side project to have a side income, that I would go to many conferences, etc... etc...

Truth is, frustration and deception arrived very quickly. I didn't rock my bootcamp, I finished it having learned many things for sure, I had miles and miles of opened tabs to tools, tutorials, discussions... everything to help me find answers to my questions. But I didn't reach the point where I could help someone or explain something because I wasn’t understanding anything well enough.

For many months I was just telling myself that one of the reasons developers are well paid is that companies need to keep them on the job while unhappy because coding is just about negative feelings.
These "HAAA" moments are not happening often enough to satisfy anybody, so yes of course companies need them to be well paid so they keep doing it.
And I had proof to validate that theory: have you been on tech Twitter? Everybody is depressed, burned out, frustrated...

I searched for a community of devs where I could find support not only on technical subjects but in general. We are not just devs, we are people with feelings, with stories. In the community I have found we are all different but we are searching for the same things: being happy with what we do, receiving support as much as providing it, promoting people, and having fun.
Turns out our group is a magnet for very cool people. We are very lucky.

I joined the community while I was in an internship, about to start my job search. I was miserable, I receive a lot of help, I got results, it made me more confident.
And what helped a ton as well was to be in contact with people who were happy with their work, with their projects, who found that coding was something fun and was very motivated to share about it.

There was one person in particular who was the happiest coder of all time. The kind of person who always shares the good stuff they find, always smiling, they know the cool tricks, and all of that is positively contagious!
This person helped me and many others with coding challenges, learning, debugging, interview prep..., and was also a gaming buddy because remember: we are not just coders!

This person left us today and will leave an empty hole behind them. It is a horrible and sad day for our community, and it will affect many many more when the news will spread.

I guess my intention with this article was to give an homage to this happy person, I hope they knew the impact they had on so many people. I wish the tech community has more people like them.

If you think you are a happy one too, remember that you can probably change someone's day by sharing a little bit of your shine.
If you are not, find your happy coders and I hope they will help you go through your coding journey, and find some fun in your work.

Goodbye friend, Docker doesn’t make me happy yet, but I am happy to have known you :)
tsParticles 1.37.3 Released
Tags: showdev, javascript, webdev, html
Published: 2021-11-05 23:20:00

# tsParticles 1.37.3 Changelog

## New features

- Added more absorber size limit options, now the limit can be an object like: `{ radius: 10, mass: 1000 }`, if using only the number the `mass` is unlimited

## Bug Fixes

- Fixed absorbers particle repositioning, velocity reset to initial velocity after that

---

{% github matteobruni/tsparticles %}