fall2022class's People
Forkers
saramati msfdana110 nguyenjenny d0risadao brennen-uoft aza50133 pupicn jviswesw jgomez85 soheila19 eshaniborker25 yizhouchen216 dtovbis jaelee1204 mahta-mas mwychan-bme lsaad vollettk t-chm candicelam12 melimarch thussain7 azzy-bme moonj94 faranak-h liukris1 romarreg sadiloai jamie-ly-wu t-christ1 sashini13 azinamini antbee-eng bilalhsyed fooklai janehseo sareen7 lmaiyui presleymacmillan avadanialy chowd505 hyp0131 zahrasepahi matng94 luxingz1 zacplin stutying riasadaziz ramtin-m parmoonsarmadi vanessali12 kaitlinszederkenyi shannonferguson scientistanjo jonguyen314 jsebastian-cpu hyu10link ahmadi18 shobnams arghadimi bammyv fatemehs12 aabouzid ericwan78 rennmela rennmeli amandaricketts lzara germanruv strawcup demario96 runner-h benstordy ben-s-bme1478 bx526 leijin-yiplab minyaowang0810 andyed123 eowyn7 erikado4 verapieters meghaparashar javadza4 nganc coopboyd stefandenkovski leedav30 lrncdg2020 fakharin waqassajid yxwy51fns juniperberry-git bleung16 daphnetam nevenaaak shreya195 younes-sadatnejad brendannigel mt-droid bnegarfall2022class's Issues
Assignment 2 Format
Hello,
Are we submitting a bash script for this assignment?
Also, how would you like us to do question 4? I compared the directories of the original data to the directories made in question 1. Is this correct?
Assignment 2 question 2
I'm trying to execute this code and I get the following output.
I want to be able to output the directories that do not contain a file which contains the string, 'notes'. I think I may have to use grep but I'm not sure how to go about doing this.
I'm supposed to get one folder as the output as this folder does not contain a note file.
I have also tried:
Assignment2Q2 Which file extensions to include
Are we documenting missing .txt files and .ext files? or just .txt?
Assignment 3: What is the unit for rate?
I just have a question regarding the unit of the bacterial growth rate.
Is the growth rate of bacteria 0.4 s^-1, 0.4 min^-1 or 0.4 h^-1?
A3Q2b - code only outputting 1 number? - please help
def squared_error(a,b):
residual = b - a #the difference between our prediction and data
mse = sum(residual**2)/len(b) #use the residual to calculate the mean squared error
return mse #return the result
input:
mse = [] #initialize a list to store our results
i = 0
for i in range(len(range_rate)):
prediction = N0 * np.exp(range_rate[i]*t)
error = squared_error(prediction,population_size_noise)
i = i + 1
mse.append(error)
print(mse)
#find the index of the minimum value in mse
idx_min_mse = min(mse)
print(idx_min_mse)
output:
[286658756767.105]
286658756767.105
Supress the 'no such file or directory' message from the find command
for f in 20180204-01 20180220-01 20180220-02 20180310-01 20180310-02 20180405-01 20180511-01; do
cd $f
find *.txt || echo $f is missing a notes file
cd ..
done
notes20180204.txt
find: *.txt: No such file or directory
20180220-01 is missing a notes file
notes.txt
notes20180310-01.txt
noteslab.txt
find: *.txt: No such file or directory
20180405-01 is missing a notes file
notes20180511-01.txt
A3Q3 rate
A2Q2
Having issues with my code. It must not be reading it properly because 20180405-01 doesn't have a notes file yet it is saying that it does.
cd documents/bme1478/week_2/assignment2_data/assignment-data
FILES=$(ls)
for f in $FILES; do
cd $f
if find . -name note
then echo “$f not missing note file”
else echo “$f missing not file”
fi
cd ..
done
L3 Challenge Q1: NameError: name 'str1' is not defined
I'm trying to do the last challenge (q1) in our week 3 lesson and I don't know why I'm getting the error below?
sen1 = ('The pale Blue dot')
def sentence_analytics(s):
d = {'upper_case':0, 'number_of_spaces':0}
for c in s:
if c.isupper():
d['upper_case']+=1
elif c.isspace():
d['number_of_spaces']+=1
else:
pass
print('No. of upper case characters', ' = ', d['upper_case'])
print('No. of spaces', ' = ', d['number_of_spaces'])
return str1.split()
word_list = sentence_analytics(sen1)
word_list
NameError Traceback (most recent call last)
in
12 return str1.split()
13
---> 14 word_list = sentence_analytics(sen1)
15 word_list
in sentence_analytics(s)
10 print('No. of upper case characters', ' = ', d['upper_case'])
11 print('No. of spaces', ' = ', d['number_of_spaces'])
---> 12 return str1.split()
13
14 word_list = sentence_analytics(sen1)
NameError: name 'str1' is not defined
Comments for assignment 3
For questions 2b and 3 where most of the lines are provided, is it acceptable to copy and paste these functions and then leave the comments that are already provided for them? Or would you like us to form original comments on these commands?
Q about Sed and Diff , HW2 related
I found this piece of code ($ sed 's|/.||') from googling and used it in my HW to answer a question but I don't know what ('s|/.||') part means. Anyone care to explain it to me?
Also, from what I read online, ($ Diff -q) should only return the differences; however, in my version of bash (OSX) it still returns similarities "comm". Is there a different option or something else that needs to be done to only return the differences?
Is a .rtf file acceptable for assignment2 submission?
Hey, is a ".rtf " doc file with all the commands and their output acceptable? as I would like to make my responses organized and easy to follow.
Unable to find any files
Assignment2Q4
Do you have any tips for question 4?
A2Q4 how to determine the path to the external hard drive
I # the diff command to avoid any error, because I am not too sure where the contents in the external hard drive will be mounted. Anyone has any ideas?
I've tried
find / -type d -name 'assignment-data'
not too sure if it will work, at least not on my pc.
A3Q2 - code output overflow. Please help
Assignment 2 Q2
I tried to create a nested for loop to iterate across from the folders and then to the files in each folder using the following code:
for folder in assignment-data/* ; do
for file in “$folder”/* ; do
echo "$file"
done
done
However, the following outputs were produced:
I wonder what was wrong with my code? Thank you.
A2Q1: Trouble using "for" loop to look at all the folders
Click the "Preview" tab above to view the rendered version of this issue template.
Delete this text after you have read through it and are ready to post your question.
This template will appear every time you open a new issue,
so you don't need to memorize it.
In this class,
we're using GitHub issues as the forum for asking and responding to questions.
Knowing how to use GitHub is often required when collaborating on bigger projects,
especially those that are open source and maintained by remote teams.
It is also a great skill for asking effectively on StackOverflow,
the biggest Q&A site for programming related questions.
When submitting an issue,
please follow the template below.
This will help you practice how to be an effective collaborator
and the included information will ensure that you get help as quickly as possible.
- Write the tile as a summary of your issue.
Think about what you would want the title to say
if you were searching the issue list for help.
Just "Error" or "Question" is not helpful,
but "How to list content in a folder?" is.
If your issue relates to a specific assignment question,
you can preface the title with that information,
but still include details about your particular problem,
e.g. "A1Q1 'Command not found' when trying to run Python" - Introduce the problem by briefly describing what you want to do.
- Show what you have tried,
explain what you expected to happen,
and what went wrong.
It is often critical that the person helping you can reproduce the problem,
so include both the code or command you tried to run and the error message.- Text is preferred over a screenshot since it is easy to copy and paste,
which facilitates reproducing your problem. - Inline code should be surrounded by backticks for clarity,
which will beformatted like this
on GitHub.
Longer blocks of code with multiple lines should be surrounded by triple backticks.
Please see this link for how to format comments on GitHub in general using the markdown syntax.
- Text is preferred over a screenshot since it is easy to copy and paste,
- Include which operating system you are using
and which version of the troubling program your are on,
e.g. Win10, Python 3.8. - When your problem is solved,
close the issue.
If you found the solution yourself,
post it in a comment before closing,
so that others can find it.
That's it!
Feel free to help each other if you see a question that you know the answer to.
And don't worry if you have a question
that you don't think fits in the format about,
go ahead and post it and we will try to figure it out!
You can read more about how to ask great question in this StackOverflow post.
As a final note,
remember that this GitHub issue list is public,
so if you have a sensitive question,
please send an email to the TA email address instead.
Assignment 2 Files Missing?
Hello,
The assignment 2 instructions are based on manipulating data in many folders ("Copy all the folders' contents..."), but the Assignment2_data folder on Quercus has no subdirectories. In other words, I can only find the data for one subject but the assignment requires analysis of data for multiple subjects. Do we have to create this extra data?
Thank you,
George
General: Is it possible that we could have all the lectures and assignments to work ahead?
Same request as title: Is it possible that we could have all the lectures and assignments posted in Quercus so we can work ahead/at our own pace (I am not suggesting we change submission dates, just availability of material ahead of time)?
Importance of quotes in bash
-
What is the importance of quotes in bash?
grep CTNS genes.txt
was used in the first demonstration of the command to find the string CTNS. Later in the pipes demo,grep 'VEGF' genes.txt
was used instead. It doesn't seem to make a difference. -
What is the difference between single and double quotes in bash?
mkdir Project1
was first used to make a directory called Project1, but later used asmkdir "dataset$num"
with double quotes in the loop challenge. Similarly,echo The value of i
was used in loops but laterecho "The first argument is"
.
Is the single/double quote non-essential in bash to define a string? Thanks.
A2Q3 Rename Command Does Not Exist
Hi I've done a ton of research into the most efficient way to rename files in Bash, and so far I have found that the "rename" command is the most effective tool to rename multiple files in multiple subdirectories. However, the rename command does not exist on my system. I've tried downloading and installing many different things to get the rename command on my system, but it continues to say "rename command does not exist" when I type in "rename" into the cmd interface. What am I doing wrong? I've attached a screenshot below. Thank you.
Question 2b
Are we to use population_size_noise as the observed data and the population_size as the predicted data?
Assignment 3: Prediction vs Observed with/without noise
For the last part of the assignment, should we use the population size with or without noise for our predicted results (when testing the varied rates?)
Assignment #2 How/where do we submit?
Pardon my ignorance if I missed it. How/where do we submit the assignment 2?
Assignment 3: Negative values in population_size_noise
Hello,
In question 1d, I have created population_size_noise function
polulation_size = N0 * np.exp(r*t)+normal-distribution(0, 250)
and obtained bacterial population size for each time point in t. However, I noticed that I have several outputs that have a population size that is below 0.
If the bacterial population goes below 0, should we terminate the code or continue to output the population size?
Compare just folders or all folders and files A2Q4
A2Q1 File with same names are overwritten
Assignment2Q1 Missing file extension
Is the “notes20180511-01” file suppose to be missing the .txt extension?
A3Q1 range from 0 -10
Click the "Preview" tab above to view the rendered version of this issue template.
Delete this text after you have read through it and are replace it with your question.
This template will appear every time you open a new issue,
so you don't need to memorize it.
In this class,
we're using GitHub issues as the forum for asking and responding to questions.
Knowing how to use GitHub is often required when collaborating on bigger projects,
especially those that are open source and maintained by remote teams.
It is also a great skill for asking effectively on StackOverflow,
the biggest Q&A site for programming related questions.
When submitting an issue,
please follow the template below.
This will help you practice how to be an effective collaborator
and the included information will ensure that you get help as quickly as possible.
- Write the tile as a summary of your issue.
Think about what you would want the title to say
if you were searching the issue list for help.
Just "Error" or "Question" is not helpful,
but "How to list content in a folder?" is.
If your issue relates to a specific assignment question,
you can preface the title with that information,
but still include details about your particular problem,
e.g. "A1Q1 'Command not found' when trying to run Python" - Introduce the problem by briefly describing what you want to do.
- Show what you have tried,
explain what you expected to happen,
and what went wrong.
It is often critical that the person helping you can reproduce the problem,
so include both the code or command you tried to run and the error message
as described in this guide on how to create a Minimal Reproducible Example.- Text is preferred over a screenshot since it is easy to copy and paste,
which facilitates reproducing your problem. - Inline code should be surrounded by backticks for clarity,
which will beformatted like this
on GitHub.
Longer blocks of code with multiple lines should be surrounded by triple backticks.
Please see this link for how to format comments on GitHub in general using the markdown syntax.
- Text is preferred over a screenshot since it is easy to copy and paste,
- Include which operating system you are using
and which version of the troubling program your are on,
e.g. Win10, Python 3.8. - When your problem is solved,
close the issue.
If you found the solution yourself,
post it in a comment before closing,
so that others can find it.
That's it!
Feel free to help each other if you see a question that you know the answer to.
And don't worry if you have a question
that you don't think fits in the format about,
go ahead and post it and we will try to figure it out!
You can read more about how to ask great question in this StackOverflow post.
As a final note,
remember that this GitHub issue list is public,
so if you have a sensitive question,
please send an email to the TA email address instead.
A2Q2: Difficulty getting the folders with non .txt files
I am using the following loop to do question 2 but I keep getting the following error. Would anyone know how I can fix my mistake and display the folders that don't have the .txt file? Much appreciate any help!
$ for i in 20180204-01 20180204-01 20180220-02 20180310-01 20180310-02 20180405-01 20180511-01; do
cd $i
find -type f -name ".txt"
if [-type f '!' -name ".txt"]; then
echo "$i doesn't have .txt file"
fi
cd ..\
done
Output:
./notes20180204.txt
bash: [-type: command not found
./notes20180204.txt
bash: [-type: command not found
./notes.txt
bash: [-type: command not found
./notes20180310-01.txt
bash: [-type: command not found
./noteslab.txt
bash: [-type: command not found
bash: [-type: command not found
bash: [-type: command not found
Git Bash core.editor has multiple values
A2Q2 Clarification
For Q2, are we supposed to identify the non .txt files or the absence of a file with the string "note" in it?
Error in bash terminal
Hi there,
I have downloaded Anaconda-Navigator and GitHub on my Mac and I have created an account in Github. Currently Im just trying to confirm that I have downloaded the Anaconda python (for the assignment in my course) in my Mac through bash terminal. This has to be confirmed by inputting the following command in the bash terminal:
"conda --version"
However when I input this into the terminal, I will receive the following error:
"zsh: command not found: conda"
I have also tried restarting my computer but Im receiving the same error again.
I would appreciate it if you can help me out to solve this issue,
Thanks
Nikan Fakhari
Assignment 2 Submission
I noticed the quercus home page has been changed to say that assignments should now be submitted through quercus not to the email address, but I don't see a page to submit this week's assignment.
Where should we be submitting?
Question 2, assignment 3 - iteration
Quercus says "file type not allowed"
When I try to add my .ipynb file quercus tells me "This file type is not allowed. Accepted file types are: py and ipynb" even though my file is .ipynb. It won't let me submit.
Notes for Jan 29 Live Coding Session
Click the "Preview" tab above to view the rendered version of this issue template.
Delete this text after you have read through it and are replace it with your question.
This template will appear every time you open a new issue,
so you don't need to memorize it.
In this class,
we're using GitHub issues as the forum for asking and responding to questions.
Knowing how to use GitHub is often required when collaborating on bigger projects,
especially those that are open source and maintained by remote teams.
It is also a great skill for asking effectively on StackOverflow,
the biggest Q&A site for programming related questions.
When submitting an issue,
please follow the template below.
This will help you practice how to be an effective collaborator
and the included information will ensure that you get help as quickly as possible.
- Write the tile as a summary of your issue.
Think about what you would want the title to say
if you were searching the issue list for help.
Just "Error" or "Question" is not helpful,
but "How to list content in a folder?" is.
If your issue relates to a specific assignment question,
you can preface the title with that information,
but still include details about your particular problem,
e.g. "A1Q1 'Command not found' when trying to run Python" - Introduce the problem by briefly describing what you want to do.
- Show what you have tried,
explain what you expected to happen,
and what went wrong.
It is often critical that the person helping you can reproduce the problem,
so include both the code or command you tried to run and the error message
as described in this guide on how to create a Minimal Reproducible Example.- Text is preferred over a screenshot since it is easy to copy and paste,
which facilitates reproducing your problem. - Inline code should be surrounded by backticks for clarity,
which will beformatted like this
on GitHub.
Longer blocks of code with multiple lines should be surrounded by triple backticks.
Please see this link for how to format comments on GitHub in general using the markdown syntax.
- Text is preferred over a screenshot since it is easy to copy and paste,
- Include which operating system you are using
and which version of the troubling program your are on,
e.g. Win10, Python 3.8. - When your problem is solved,
close the issue.
If you found the solution yourself,
post it in a comment before closing,
so that others can find it.
That's it!
Feel free to help each other if you see a question that you know the answer to.
And don't worry if you have a question
that you don't think fits in the format about,
go ahead and post it and we will try to figure it out!
You can read more about how to ask great question in this StackOverflow post.
As a final note,
remember that this GitHub issue list is public,
so if you have a sensitive question,
please send an email to the TA email address instead.
A2Q1: EEG files with similar names
I have been able to write a for loop for opening the multiple data directories. However, when I am copying over the files to the new directory created, I notice that there are fewer files than the total number expected. When I run a for loop to list the files within each directory, I notice that several eeg files are named the same across directories (see picture 1), and I suspect that as it goes through the for loop, there may be an overwriting of the files copied over to the new directory (Picture 2 and 3).
I have attempted to rename the files so that the files have distinct file names and thus are not overwritten. However, the code below does not work to append a variable to the file name.
for fn in 20180???-??; do cd $fn date=$fn cp *.txt $date'_notes'.txt ~/Desktop/BME1478/'Assignment 2'/DataAnalysis/ cd ~/Desktop/BME1478/'Assignment 2'/assignment-data done
PDF of Lecture Notes on Quercus
Hello
I was wondering if it would be possible to post a pdf version of the lecture slides for taking notes as well as would you be able to post the solution to the examples that we attempt during the online lecture so that we can compare with our own code and troubleshoot.
Thank you
Q1
In Q1, each time I want to copy the files, it says 20180220-01 is a directory ( not copied)
Assignment 2 Q1
I don't know how to give command to move all the folders content into other folders. I tried a bunch of commands, but it gives error.
Man command not working
Following along with the lecture slides. When I try to use "man" in git Bash, I get a "command not found" error.
A2Q4 - how to present solution
Is it an acceptable solution to print both the common and uncommon directories in both locations? For eg, printing something like this: "Common subdirectories: assignment-data/20180204-01 and testnew/20180204-01" for common directories, and then printing something like this: "Only in testnew/: test" if there are uncommon directores (in this case, I just made up the test directory to see if it would work).
A2Q1: Trouble using "for" loop to access all folders
A copy of the code as a .py file
Using Jupyter Lab, under File > Export Notebook as > Choose "Executable Script", it downloads a .py.html file. Is that ok to submit?
Assignment 2 Submission
Regarding submission, should we submit the scripts (.sh) files or do we need to show the commands in the terminal as well?
A3 Q1d: np.random.seed what does it do?
I'm trying to add noise to the population_size at each point in time. In doing so I used the np.random.normal expression to generate a random value from a normal distribution of mean = 0 and stdev = 250. However, when I try and check that the noise produced has a mean and std deviation of 0 and 250 respectively, I am getting different values (-56.3584 and 231.0712). Please advise.
Also,
(1) What is the difference between using np.random.seed(42) and np.random.seed(0)?
(2) Is it correct to be specifying a size of 50 for the np.random.normal as the population_size array has 50 as well?
A.2, Q.4 Compare folders' contents or just the folder itself?
Hey,
for Q.4 is it required to go through files within each folder or checking the folders alone is sufficient? for instance, let's say I will be comparing the folders which are the outcome of Q.1 with the original folders provided for this assignment, in this case no folder is missed per se but the content of the folders ( files in them) are missed sometimes. you do not expect us to answer this part of the problem, right?
A3: predicted and observed data
For the part about writing a function to predict the growth rate by calculating the mean squared error, which is the predicted and observed data?
Is the predicted data the variable, population_size, and the observed data the variable, population_size_noise?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.