Skip to content

Added Transpose Matrix in Every Language Article #330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Oct 8, 2020
Merged

Added Transpose Matrix in Every Language Article #330

merged 25 commits into from
Oct 8, 2020

Conversation

DedAvocado
Copy link
Contributor

@DedAvocado DedAvocado commented Oct 3, 2020

Articles for transpose matrix.

This is in reference to the PR in TheRenegadeCoder/sample-programs#1952

Docs for transpose matrix
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! It would be cool if you could come up with a table for testing, so we can see what sort of input/output you're expecting.

@jrg94 jrg94 self-assigned this Oct 4, 2020
@jrg94 jrg94 added the project Project documentation label Oct 4, 2020
@jrg94 jrg94 changed the title Added Transpose Matrix article in all language Added Transpose Matrix in Every Language Article Oct 4, 2020
@DedAvocado
Copy link
Contributor Author

Yeah sorry didn't notice the first time. Updated now...

Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the matrix meant to be input on the command line?

@DedAvocado
Copy link
Contributor Author

The program asks for the input of m and n to create an m*n matrix and then while entering the values the input line mentions for which i^th and j^th position the user is entering the values.

@jrg94
Copy link
Member

jrg94 commented Oct 5, 2020

Oh I see! Typically, in this repo, we want input to be entered on the command line. For example, if this were a python program, I would expect to be able to do the following: transpose.py ???. Here, ??? would be the input.

I'm not sure what the best way would be to do this, but perhaps you could enter each row as a list:

transpose.py "1, 2, 3" "4, 5, 6"

@DedAvocado
Copy link
Contributor Author

Yeah depending on the value of m and n in the m*n matrix it will automatically identify.

@jrg94
Copy link
Member

jrg94 commented Oct 5, 2020

Agreed! But, we want the program to pull directly from the command line arguments—not from standard input.

@DedAvocado
Copy link
Contributor Author

So it will generally be set for a square matrix say 3*3 so the input will consist of 9 numbers

transpose.py 1 2 3 4 5 6 7 8 9

@jrg94
Copy link
Member

jrg94 commented Oct 5, 2020

Okay, so this won't work for any size matrix?

@DedAvocado
Copy link
Contributor Author

It will but it's difficult to say on command line arguments unless the size of the matrix is also given in command line.

@jrg94
Copy link
Member

jrg94 commented Oct 6, 2020

For sure! But, our repo depends on this script to be able to work through the command line. So, there should be some way to represent the input. I'm thinking there are probably two ways:

  1. Provide the size and the serialized matrix: program.lang 3 2 "1, 2, 3, 4, 5, 6"
  2. Provide all rows of the matrix separately: `program.lang "1, 2, 3" "4, 5, 6"

Perhaps there are other options that are cleaner.

@DedAvocado
Copy link
Contributor Author

For sure! But, our repo depends on this script to be able to work through the command line. So, there should be some way to represent the input. I'm thinking there are probably two ways:

  1. Provide the size and the serialized matrix: program.lang 3 2 "1, 2, 3, 4, 5, 6"
  2. Provide all rows of the matrix separately: `program.lang "1, 2, 3" "4, 5, 6"

Perhaps there are other options that are cleaner.

I think the first option works here. There could be other methods but they dont satisfy the need if variable matrix.

@jrg94
Copy link
Member

jrg94 commented Oct 7, 2020

Perfect! Any chance you can rework the docs to run off this new setup?

@DedAvocado
Copy link
Contributor Author

Yeah updated the docs. Check if it works?

Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a couple more changes, and we'll be good to go.

Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Almost there. Just a couple quick updates.

@DedAvocado
Copy link
Contributor Author

Updated author.yml file. I think everything is sorted now.

Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! I know I promised we were almost done. This is one last thing.


| Description | size1 | size2 | integers | Output |
| - |:-:|:-:|:-:| -:|
| No input | | | | error |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the error message going to say?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it should be consistent like "Usage: please enter the dimension of the matrix and the serialized matrix"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha yeah updated it see if it works?

Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woo! 🍡

@jrg94 jrg94 merged commit 886f425 into TheRenegadeCoder:master Oct 8, 2020
@DedAvocado
Copy link
Contributor Author

Hey, thanks for helping me out so much. It was great working with you :)

@DedAvocado
Copy link
Contributor Author

DedAvocado commented Oct 8, 2020

image

Also, this happened on the website... even though it is displayed properly in the index.md file

@jrg94
Copy link
Member

jrg94 commented Oct 8, 2020

Yeah, I'm going to take another peek at it and see if I can resolve some of those format issues.

@jrg94
Copy link
Member

jrg94 commented Oct 8, 2020

Alright, I think most of these issues are resolved: https://sample-programs.therenegadecoder.com/projects/transpose-matrix/

@jrg94
Copy link
Member

jrg94 commented Oct 8, 2020

There's still an issue with the title... WHOOPS!

@DedAvocado
Copy link
Contributor Author

Yeah everything works now ig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project Project documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants