1.Write a Slicer
One of the key steps in processing an STL file for printing is slicing. STL files were written
...
s were written to make slicing a low memory task by storing each triangle at a single place.
We already have code to do the following:
A Generator that returns a triangle one at a time from an STL file (specifically an ASCII STL file). It Return the triangle as a list of 3D points (tuples), ignoring the normal. (from HW4)
A function that takes a list of line segments, each line segment is a list of 2D points (tuples) and returns a single list of 2D points where the start of one segment is the end of another. ( from HW 3)
A function that converts a list of 2D points to G-Code (lab 2)
A function that writes GCode to a file
To make a slicer you need to:
Write a function that calculates the intersection of a triangle with a horizontal plane. The input of the function should be a list of 3D points (tuples). It should return a list of 3D points. See this website for hints on the mathematics http://geomalgorithms.com/a06-_intersect-2.html#Triangle-Plane (Links to an external site.)
( https://web.archive.org/web/20180706054857/http://geomalgorithms.com/a06-_intersect-2.html (Links to an external site.) )
Next you need to combine all of these different functions into a single workflow that takes in an STL file, a slicing height, print temperatures, movement speed , and extrusion speed and returns a G-code String which prints the walls of the STL file. It should have an outer iteration over slice heights of the STL, for each slice height, it should scan all triangles and make a list of the line segments that intersect the plane at that Z height. Then it should order those segments into a list of points. That list of points is then converted into gcode movement and extrusion commands. The entire system combines these slices with setup and shutdown Gcode for the ender 3 printer to make the print job. You may write to a file a layer at a time or at the end.
Once the slicer is done:
Run the previous function with a vase file such as one of the following files:
https://www.thingiverse.com/thing:126567/files
https://www.thingiverse.com/thing:42570/files
https://www.thingiverse.com/thing:31722/files
https://www.thingiverse.com/thing:2795194/files
Submit your code as a Jupiter notebook with the .gcode in it and, and an image of your print.
View More
2.In this problem and the next one, we’re going to make a very simple spam checker program by just looking
...
ooking at how likely a given email is to be spam based on the words it contains. In particular, in this problem we’re going to count how often words are present in spam emails within some set of training data (which here means a set of emails that have already been marked as spam or not spam manually).
We have already started to write a function spam_score(spam_file, not_file, word), which takes in two filenames, along with a target word (a lowercase string). Both filenames refer to text files which must be in the same directory as hw07.py (we’ve provided several such files in hw07files.zip). The text files contain one email per line (really just the subject line to keep things simple) - you can assume that these emails will be a series of words separated by spaces with no punctuation. The first file contains emails that have been identified as spam, the second contains emails that have been identified as not spam.
Since you haven’t learned File I/O yet, we’ve provided code that opens the two files and puts the data into two lists of strings (where each element is one line - that is, one email). You then must complete the function, so that it returns the spam score for the target word. The spam score is an integer representing the total number of times the target word occurs across all the spam emails, minus the total number of times the word occurs in not-spam emails. Convert all words to lowercase before counting, to ensure capitalization does not throw off the count.
View More
3.Greetings. I need help asap when it comes to a computer science project that I have to get done soon.
...
. I'm really close to completing it and I'm really stuck on this one situation and I don't know how to solve it. So right now I'm making a guessing game and every time you play the program tells the user how many guesses it took for them to get the answer. And what I need to do is to make sure that I get and isolate the lowest amount of guess and put it into the statistics function so that way it can print out the lowest amount of guesses that I got. Right now it isn't working and I really don't know why as it seems to be mostly adding up all the guesses until the last few. Here's my code:
#include
#include
#include
#include
void haiku(){
printf("Welcome to the game.\n");
printf("Guess a number within range.\n");
printf("Win cool prizes here.\n\n");
}
int compare(int guessiso){
int lowestvalue=0;
int biggervalue=0;
if(guessisooperand){
printf("It's lower.\n");
count++;
isolatedcount++;
}
else if(user0){
lowguess=compare(x);
x=one_game(count);
count=x;
printf("Do you want to play again?\n");
scanf("%d",&usertwo);
userthree=usertwo;
gamecount++;
}
statistics(gamecount,x,lowguess);
}
View More
4.I just need someone to look over my paper for anatomy and to just let me know what I need
...
t or add. I'll attach the questions, my rubric, as well as my answers I made. It would really help me out please.
The questions:
1.) Choose two somatosensory receptors. Please include a description of each receptor, what they sense, and which part of the brain processes the information from the receptor.
2.) Provide a discussion of the thyroid gland. Include the following:
Description of the thyroid gland's structure and location.
Description of the cells of the thyroid gland.
Description of the hormones secreted by the thyroid gland and their functions.
Description of how thyroid hormones are controlled by hormones secreted by the hypothalamus and anterior pituitary gland.
Description of how the feedback system works in the cases of high or low thyroid hormone levels.
3. Describe the cardiac cycle. Include descriptions of the 3 phases, the pressure changes in each of the heart's chambers, valves are open and closed, and blood flows during each step.
My answer: 1.) Exteroceptor - receives external stimuli from outside of the body. An example, the skin (Thermoreceptors) detects the temperature of the outside area of the body.
Interceptor - receives stimuli from inside of the body. An example would be blood pressure as well as blood oxygen levels.
2.) Thyroid Gland is located near the front lower part of the neck, beneath Adam's apple. Its structure includes Thyroid Epithelial that form follicles filled with colloid - a protein-rich reservoir of the materials needed for thyroid hormone production. The cells are responsible for releasing hormones that control metabolism (Energy levels). The thyroid gland releases triiodothyronine (T3) and thyroxine (T4). These hormones regulate weight, energy levels, internal temperature, skin, and growth. When the hypothalamus and pituitary function well, they can detect when hormone levels are low, which causes them to produce more TRH and TSH, which stimulates the thyroid to produce hormones. When the hormone levels exceed their limit, they then have less TRH and TSH, which results in reduced hormone production by the thyroid. Feedback is when a product feeds back into its initial cycle. The Feedback includes both positive and negative feedback. Positive Feedback is when a product provides back to increase production: an example, milk production by a mother for her baby. As the baby suckles, nerve messages from the nipple cause the pituitary gland to secrete prolactin. Prolactin, in turn, stimulates the mammary glands to produce milk, so the baby suckles more. Which causes more prolactin to be secreted and more milk to is made. Negative Feedback is when a product feeds back decreases production; it brings down show if they increase past their limit. It also controls insulin secretion by the pancreas.
3.) The Cardiac Cycle takes place from the beginning of a heartbeat to the next. It contains two periods: One is when the heart muscle relaxes and refills with blood, called diastole, following a time when it begins contraction and pumping of blood, systole. Once emptied, the heart then relaxes and expands to receive another inrush of blood coming back from the lungs and other areas of the body. The atrioventricular valves remain open while the semilunar valves are closed. During the middle part of the diastole, a small amount of blood flows into the ventricles. The blood flows from the veins and passes the atria fills the ventricles. The pressure in both ventricles is close to zero as a result.
View More
5.Describe the parallels between cell differentiation, nutrient supply, and final cellular state for the majority of cells involved in the
...
he majority of cells involved in the epidermis, hair follicles/hair growth, and nail synthesis/nail growth.
How does the structure of spongy bone support the function of the red bone marrow contained within said bone?
How do bones, synovial fluid, tendons, ligaments, and articular cartilage work together to allow synovial joint movement? Please explicitly include the bone feature that allows for tendon/ligament attachment.
What is the difference in function between the vertebrae and the intervertebral disks in the vertebral column? Please discuss both the connective tissue subtype for each of these features and how the composition of their extracellular matrix contributes to function
Describe the extracellular matrix of bone to someone who isn't familiar with anatomy (this should be a general description of appearance/tactile nature, no specific mention of cells or function is needed)
How does hair contribute to the sensory role of the integumentary system? (A short explanation is all that is needed, no in-depth description of associated structures is required for full credit)
Back when he was 16, Jordan left eye orbit floor was fractured in a bizarre fencing accident, leaving a few fragments behind inside his skull. Assuming the floor was punctured from above in the maxillary bone and no additional bones were broken, where did the bone fragments end up in his skull? (This should be a particular space in the skull, not a separate bone where the fragments are embedded
The skeletal and integumentary systems rely heavily on collagen for function - describe one or more features other than ligaments that involve collagen, and how you would expect function to change in someone with EDS that affected the relevant subtype of collagen
View More
6.Please check options and pictures within the file attached.
If the questions can be answered within a free demo session
...
hin a free demo session as I have my answers, but just want to confirm them, that would be greatly appreciated.
Question 1:
A block of mass M = 0.10 kg is attached to one end of a spring with spring constant k = 100 N/m . The other end of the spring is attached to a fixed wall. The block is pushed against the spring, compressing it a distance x = 0.04 m . The block is then released from rest, and the block-spring system travels along a horizontal, rough track. Data collected from a motion detector are used to create a graph of the kinetic energy K and spring potential energy Us of the system as a function of the block's position as the spring expands. How can the student determine the amount of mechanical energy dissipated by friction as the spring expanded to its natural spring length?
Question 2:
The Atwood’s machine shown consists of two blocks connected by a light string that passes over a pulley of negligible mass and negligible friction. The blocks are released from rest, and m2 is greater than m1. Assume that the reference line of zero gravitational potential energy is the floor. Which of the following best represents the total gravitational potential energy U and total kinetic energy K of the block-block-Earth system as a function of the height h of block m1?
Question 3:
A 2 kg block is placed at the top of an incline and released from rest near Earth’s surface and unknown distance H above the ground. The angle θ between the ground and the incline is also unknown. Frictional forces between the block and the incline are considered to be negligible. The block eventually slides to the bottom of the incline after 0.75 s. The block’s velocity v as a function of time t is shown in the graph starting from the instant it is released. How could a student use the graph to determine the total energy of the block-Earth system?
Question 4:
A block slides across a flat, horizontal surface to the right. For each choice, the arrows represent velocity vectors of the block at successive intervals of time. Which of the following diagrams represents the situation in which the block loses kinetic energy?
View More
7.The problem: Cells that grow and divide in medium containing radioactive thymidine incorporate the thymidine into their DNA during S
...
hymidine into their DNA during S phase.
Consider a simple experiment in which cells were labeled by a brief (30 minute) exposure to radioactive thymidine. The medium in which these cells are grown was then replaced with one containing unlabeled thymidine, and the cells were allowed to grow and divide for some additional time.
At different time points after replacement of the medium, cells were examined in a microscope. Cells in mitosis were identified by their condensed chromosomes. The fraction of mitotic cells that had radioactive DNA was determined by autoradi-ography and plotted as a function of time after the thymidine labeling:
Fig. Percentage of mitotic cells that were labeled as a function of time after a brief incubation with radioactive thymidine
View More
8.The problem: Cells that grow and divide in medium containing radioactive thymidine incorporate the thymidine into their DNA during S
...
hymidine into their DNA during S phase.
Consider a simple experiment in which cells were labeled by a brief (30 minute) exposure to radioactive thymidine. The medium in which these cells are grown was then replaced with one containing unlabeled thymidine, and the cells were allowed to grow and divide for some additional time.
At different time points after replacement of the medium, cells were examined in a microscope. Cells in mitosis were identified by their condensed chromosomes. The fraction of mitotic cells that had radioactive DNA was determined by autoradi-ography and plotted as a function of time after the thymidine labeling:
Fig. Percentage of mitotic cells that were labeled as a function of time after a brief incubation with radioactive thymidine
View More
9.Question 1: What is a player’s « reaction function » in a Bertrand game ?
Question 2: What is a subgame
...
subgame perfect Nash equilibrium?
Question 3: In which situations should we need the mixed extension of a game?
Question 4: Find, if any, all Nash equilibria of the following famous matrix game:
L R
U (2,0) (3,3)
D (3,4) (1,2)
Question 5: What is the difference between a separating equilibrium and a pooling equilibrium
in Bayesian games?
Question 6: Give another name for, if it exists, the intersection of the players’ best-response
« functions » in a game?
Question 7: assuming we only deal with pure strategies, the Prisoner’s Dilemma is a situation
with:
No Nash equilibrium One sub-optimal Nash equilibrium
One sub-optimal dominant profile No dominant profile
Question 8: If it exists, a pure Nash equilibrium is always a profile of dominant strategies:
True False
Question 9: All games have at least one pure strategy Nash equilibrium:
True False
Question 10: If a tree game has a backward induction equilibrium then it must also be a Nash
equilibrium of all of its subgames:
Tr
2/2
Question 11: The mixed Nash equilibrium payoffs are always strictly smaller than the pure
Nash equilibrium payoffs:
True False
Question 12: Which of the following statements about dominant/dominated strategies is/are
true?
I. A dominant strategy dominates a dominated strategy in 2x2 games.
II. A dominated strategy must be dominated by a dominant strategy in all games.
III. A profile of dominant strategies must be a pure strategy Nash equilibrium.
IV. A dominated strategy must be dominated by a dominant strategy in 2x2 games.
I, II and IV only I, II and III only II and III only
I and IV only I, III and IV only I and II only
Question 13: A pure strategy Nash equilibrium is a special case of a mixed strategy Nash
equilibrium:
True False
Question 14: Consider the following 2x2 matrix game:
L R
U (3,2) (2,4)
D (-1,4) (4,3)
The number of pure and mixed Nash equilibria in the above game is:
0 1
2 3
Exercise (corresponding to questions 15 to 20 below): assume a medical doctor (M)
prescribes either drug A or drug B to a patient (P), who complies (C) or not (NC) with each of
this treatment. In case of compliance, controlled by an authority in charge of health services
quality, the physician is rewarded at a level of 1 for drug A and 2 for drug B. In case of noncompliance, the physician is « punished » at -1 level for non-compliance of the patient with
drug A and at -2 level for non-compliance with drug B. As for the compliant patient, drug A
should give him back 2 years of life saved and drug B, only 1 year of life saved. When noncompliant with drug A, the same patient wins 3 years of life (due to avoiding unexpected
allergic shock for instance), and when non-compliant with drug B, the patient loses 3 years of
life.
Question 15: You will draw the corresponding matrix of the simultaneous doctor-patient game.
Question 16: Find, if any, the profile(s) of dominant strategies of this game.
Question 17: Find, if any, the pure strategy Nash equilibrium/equilibria of this game.
Question 18: Find, if any, the mixed strategy Nash equilibrium/equilibria of this game.
Questions 19 and 20: Now the doctor prescribes first, then the patient complies or not: draw
the corresponding extensive-form game (= question 19) AND find the subgame perfect Nash
equilibrium/equilibria (=
View More
11.Directions: You are part of a fireworks crew assembling a local fireworks display.
There are two parts to the fireworks platforms:
...
rts to the fireworks platforms: one part is on the ground and the
other part is on top of a building. You are going to graph all of your results on one
coordinate plane. Make sure to label each graph with its equation. Use the following
equations to assist with this assignment.
• The function for objects dropped from a height where t is the time in
seconds, h is the height in feet at time it t, and 0 h is the initial height is
2
0 ht t h ( ) 16 =− + .
• The function for objects that are launched where t is the time in seconds, h is
the height in feet at time t, 0 h is the initial height, and 0 v is the initial velocity
in feet per second is 2
0 0 ht t vt h ( ) 16 =− + + .
Select the link below to access centimeter grid paper for your portfolio.
Centimeter Grid Paper
Task 1
First, conduct some research to help you with later portions of this portfolio
assessment.
• Find a local building and estimate its height. How tall do you think the
building is?
• Use the Internet to find some initial velocities for different types of fireworks.
What are some of the initial velocities that you found?
Task 2
Respond to the following items.
1. While setting up a fireworks display, you have a tool at the top of the
building and need to drop it to a coworker below.
a. How long will it take the tool to fall to the ground? (Hint: use the first
equation that you were given above, 2
0 ht t h ( ) 16 =− + . For the building’s
height, use the height of the building that you estimated in Task 1.)
b. Draw a graph that represents the path of this tool falling to the
ground. Be sure to label your axes with a title and a scale. Your graph
should show the height of the tool, h, after t seconds have passed.
Label this line “Tool”.
View More
14.I need help getting started with my C++ assignment.
This is the prompt of the assignment and guidelines must follow.
...
delines must follow.
The purpose of this assignment is to give you practice using structs, using strings, writing functions and sorting. You will read a student file into an array of structs, determine grades, sort the array and print it out.
Program Steps and Requirements
Use the Student struct shown below.
Read the input file (partially shown below) and store the data in an array of structs. The input file contains 55 student records and one heading line.
Write code to determine the grade for each student. The grade determination is exactly as specified for this class in the syllabus. Remember to discard the lowest assignment grade.
Sort the array of student students in descending order by the total points.
Write the output file using the exact format shown below and include the two lines of headings in the output.
Required Student struct and named constants
const unsigned NumberOfStudents = 55;
const unsigned PointsPossible = 400;
const unsigned NumberOfAssignments = 10;
const unsigned NumberOfExercises = 10;
struct Student
{
int id;
string name;
int exercise[NumberOfExercises];
int assignment[NumberOfAssignments];
int midterm;
int final;
int codelab;
int exerciseTotal;
int assignmentTotal;
int totalPoints;
int percent;
string grade;
};
Input file
-StudId- -------Name-------- -----Exercises----- ---------Assignments--------- Mi Fin CL
12345678 Smartiepants, Sam 5 4 5 4 5 5 5 5 5 5 20 19 20 20 20 20 19 20 20 19 65 98 9
18519268 Mendoza, Victor 4 2 5 4 1 4 5 5 5 4 17 12 17 18 14 17 19 18 14 18 59 49 6
23276929 Chien, Shengfeng 2 3 0 4 4 5 2 5 5 2 9 18 15 8 19 18 18 16 19 13 64 89 8
18242679 Dhaliwal, Shawn 5 5 3 4 5 4 2 4 4 5 9 18 17 15 18 19 12 15 18 14 45 92 9
09869966 Miraftab, Mina 5 3 5 5 3 5 4 0 4 3 17 4 3 18 12 16 14 17 17 12 52 68 7
10930997 Dimas, Abraham 5 3 4 5 4 3 4 3 3 3 12 18 20 11 14 7 15 10 18 15 64 89 6
11545560 Masongsong, Mikhael 1 3 5 4 3 4 5 3 5 5 19 19 9 13 17 20 20 14 14 19 64 96 8
10626377 Zigler, Joshua 4 3 4 3 2 5 4 4 4 5 17 14 18 20 17 18 12 19 14 14 51 90 5
...
Output report file
Stud Id Name Ex Ass Mi Fin CL Tot Pct Gr
-------- ------------------- -- --- -- --- -- --- --- --
12345678 Smartiepants, Sam 48 178 65 98 9 398 100 A+
11545560 Masongsong, Mikhael 38 155 64 96 8 361 90 A-
20767544 Martins, Gustavo 40 144 67 97 10 358 90 A-
23305464 Zumwalt, Jacob 37 160 62 90 8 357 89 B+
23579439 Feirstein, Berent 42 159 55 91 9 356 89 B+
14965959 Ho, Brandon 40 157 66 84 8 355 89 B+
19988142 Wang, Lu 31 157 58 98 9 353 88 B+
09559062 Mora, Gabriel 36 137 67 100 7 347 87 B
19108176 Bailey, Tanequa 44 152 56 85 8 345 86 B
Suggested main function
int main()
{
Student students[NumberOfStudents];
getStudentDataFromFile(students, InputFilename);
determineGrades(students);
sort(students);
printStudentDataToFile(students,OutputFilename);
}
View More
15.- I was very sick for a while so I don't really know what I am doing * This homework
...
eation of several BST functions * We have to use Valgrind * We have to create a memory struct that provides a compare function for insertion * The above needs to contain two fields of unsigned int, representing memory address and size int memory_addr_cmp(const void* x, const void* y){ //TODO return 0; } By the instructions: "This function takes two arguments, const void* x and const void* y, you will need to cast both of them to type "memory*", and make comparisons. If x is less than y, return -1. If x is greater than y, return 1. If they are equal, return 0;" Also per the instructions, concerning the BST functions "Note, in particular, that there are two separate structus - the node struct that describes information for a single node in the tree, and a bst struct, that holds the root pointer and a function pointer to the comparison function being used for this tree. When you first create the tree, you pass in the comparison function, and this will be used for all functions that need it thereafter. Therefore, after that, you don't need to specify the comparison function to bst-level functions. The stored function pointer is then passed to the node-level functions." So then we have to create allocation and initialization functions for both the BST and one for the node. * nod_insert, BST_insert then inorder_traversal
View More