Difference between revisions of "FAQ - Mod 6"

From CSE330 Wiki
Jump to navigationJump to search
 
Line 1: Line 1:
 
Welcome to the frequently asked questions page for Module 6. As many common questions can come up on Piazza, some of those questions are consolidated here.
 
Welcome to the frequently asked questions page for Module 6. As many common questions can come up on Piazza, some of those questions are consolidated here.
  
−
== Setup/Logistics ==
+
== Regular Expressions Cases ==
  
−
=== Should I use a database for Module 6? ===
+
=== When parsing for a string, should I look for that string exclusively or that string concatenated with other characters? ===
−
You can store everything locally in this module. No need to use a database.
+
If you are looking for a string, you should be looking for any exact occurrences of that string. This is the case regardless of what characters are appended to the beginning or the end of said string.
  
−
=== How can I add an image to my instance? SFTP isn't working ===
+
'''Example:''' Parsing for "hello world"
−
There are a couple different ways to load an image onto your instance. One of the easiest is to use wget. When logged into your instance, run the following command in the terminal:
 
  
−
<source lang=bash>
+
'''What Should Work'''
−
$ wget <imageurl>
 
−
</source>
 
  
−
Running this command will download the image straight onto your instance!
+
hello world, hi hello world, hello worldwide, hhhello worlddd
  
−
== Port 3456 ==
+
'''What Shouldn't Work'''
  
−
=== What rule should I define for Custom TCP when setting up port 3456? ===
+
hello weorld, hello to the world
−
When setting up the Custom TCP rule for port 3456, it's fine to use the default source of 0.0.0.0/0. The rule will look like this:
 
  
−
Custom TCP 3456 Custom 0.0.0.0/0
+
=== In RegEx exercise 2, should I accept strings that have more than three consecutive vowels? ===
 +
In this exercise, strings with three ''or more'' vowels should be accepted.
  
−
=== How do I access my instance at port 3456? ===
+
'''What Should Work'''
−
All you have to do is append :3456 to the end of your instance url. Thus, the link would just be http://ec2-xx-xxx-xx-xxx.us-east-2.compute.amazonaws.com:3456/filepath
 
  
−
== NPM/Mime ==
+
beautiful, queue, coooool!
−
There are a couple common errors that students run into when setting up their Node.js. One of the most common looks like this
 
  
−
<source lang=bash>
+
=== In RegEx exercise 3, is each line a separate input? ===
−
ENOENT: no such file or directory, open 'home/rlav/package.json'
+
Yes. Each line with a potential flight code is a separate input. Your expression does not need to account for separating each potential code.
−
</source>
 
  
−
The specific path may differ for your personal machine, but any path that ends in "package.json" in this error is likely a result of the same problem.
+
=== If a batting average ends in a 0, can I round to two decimal places? ===
 +
A batting average must always be rounded to 3 decimal places, regardless of if it ends in one (or more) zero(s).
  
−
This is another common error message:
+
'''Expected Batting Average Outputs'''
  
−
<source lang=bash>
+
.270, .300, .050
−
Cannot find module 'mime' error when running static_server.js
 
−
</source>
 
  
−
Both of these errors are a result of not setting up the package.json correctly. In fact, both are usually a result of not creating package.json at. After installing Node.js, you '''must''' run the following command to generate the package.json file.
+
'''Unacceptable Batting Average Outputs'''
  
−
<source lang=bash>
+
.27, .3, .05
−
$ npm init
 
−
</source>
 
  
−
After generating the package.json file, you must write the correct dependencies. '''Details on this are specified at the [[Node.JS]] page'''. If you follow everything on this page correctly, you should be able to set up Node.js rather smoothly.
+
== Logistics ==
 +
 
 +
=== Should I complete this module on my local machine or on my instance? ===
 +
Unlike other modules, this one can be completed on your local machine!
 +
 
 +
=== Do I have to save the output of our python script to a .txt file or can I just print it out? ===
 +
You can just print the output of your script. No need to save it to a .txt file
  
 
[[Category: Module 6]]
 
[[Category: Module 6]]

Latest revision as of 17:14, 10 January 2026

Welcome to the frequently asked questions page for Module 6. As many common questions can come up on Piazza, some of those questions are consolidated here.

Regular Expressions Cases

When parsing for a string, should I look for that string exclusively or that string concatenated with other characters?

If you are looking for a string, you should be looking for any exact occurrences of that string. This is the case regardless of what characters are appended to the beginning or the end of said string.

Example: Parsing for "hello world"

What Should Work

hello world, hi hello world, hello worldwide, hhhello worlddd

What Shouldn't Work

hello weorld, hello to the world

In RegEx exercise 2, should I accept strings that have more than three consecutive vowels?

In this exercise, strings with three or more vowels should be accepted.

What Should Work

beautiful, queue, coooool!

In RegEx exercise 3, is each line a separate input?

Yes. Each line with a potential flight code is a separate input. Your expression does not need to account for separating each potential code.

If a batting average ends in a 0, can I round to two decimal places?

A batting average must always be rounded to 3 decimal places, regardless of if it ends in one (or more) zero(s).

Expected Batting Average Outputs

.270, .300, .050

Unacceptable Batting Average Outputs

.27, .3, .05

Logistics

Should I complete this module on my local machine or on my instance?

Unlike other modules, this one can be completed on your local machine!

Do I have to save the output of our python script to a .txt file or can I just print it out?

You can just print the output of your script. No need to save it to a .txt file