Description
If x is an array of interger, then the value of &x[i] is same as
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Attached.
Surname 1
Your name
Professor’s name
Inst...
Completion Status:
100%
Review
Review
Anonymous
Great content here. Definitely a returning customer.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
Java Multiple Generics to Develop a Storage Bin Class Questions
In this exercise you will use multiple generics to develop a StorageBin class. The StorageBin class will
store a generic ...
Java Multiple Generics to Develop a Storage Bin Class Questions
In this exercise you will use multiple generics to develop a StorageBin class. The StorageBin class will
store a generic item and a generic unique identifier for that item. For example, the StorageBin may store
hardware tools and a unique ID for each tool.
You are provided with the following starter code files: StorageBinTester.java, StorageBin.java, Tool.java
ITS410 Colorado State University Database Management Portfolio Project
Option #1:Your Portfolio Project consists of two items, a lessons learned reflection report and a database design and anal ...
ITS410 Colorado State University Database Management Portfolio Project
Option #1:Your Portfolio Project consists of two items, a lessons learned reflection report and a database design and analysis project.Lessons Learned and ReflectionWrite a 2- to 3-page summary that outlines the lessons you learned in this database class. Reflect on how these lessons can be applied toward more effective database management and reporting.Database Design and AnalysisUse the Accidents_2016.csv file below to implement the following steps for your database project.Create a MySQL schema named “accidents.”Within the accidents schema, create a table named accidents_2016 with the following columns:accident_index as a varchar(13),accident_severity as an intWithin the accidents schema, create a table named vehicles_2016 with the following columns:accident_index as a varchar(13),vehicle_type as a varchar(10)Within the accidents schema, create a table named vehicle_type with the following columns:vcode int,vtype as a varchar(100)Next, you will load the data for the three tables.Load the accidents data. Note that @dummy is a placeholder for a column in the .csv file that you want to ignore during the load.load data local infile '…\\data\\Accidents_2016.csv'
into table accidents_2016
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 lines
(@col1, @dummy, @dummy, @dummy, @dummy, @dummy, @col2
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
)
set accident_index=@col1,accident_severity=@col2;Load the vehicle data.load data local infile '…\\data\\Vehicles_2016.csv'
into table vehicles_2016
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 lines
(@col1, @dummy, @dummy, @col2
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
)
set accident_index=@col1,vehicle_type=@col2;Load the vehicle type data.load data local infile '…\\data\\vehicle_type.csv'
into table vehicle_type
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 linesAfter the data are loaded, you will perform the analysis. First, find the average accident severity and the number of accidents for vehicles of type motorcycle. Note the performance of your query. Your query may run so slowly that MySQL aborts running completing.Improve Query PerformanceLook at the explain tool output and save the results to a graphic file.From the explain results, how many rows have to be read per join?Add an index named “accident_index” of type “index" on the accident_indexcolumn in the accidents_2016 table and another index named “accident_index” of type “index” on the vehicles_2106 table.alter table accidents_2016
add index accident_index (accident_index asc);alter table vehicles_2016
add index accident_index (accident_index asc);After adding the indices, rerun the query explanation tool and determine the number of rows to be read per join.Find the median accident severity.MySQL does not have a median function so to find the median accident severity, you will have to write a Python script.You'll need to install Python and the PyMySQL module.Install Python version 2.7 or 3.4 from www.python.org.To install the PyMySQL module, run the following command in a Windows command prompt after Python has been installed:python -m pip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.python.org PyMySQLb) Create an accident median tablecreate table accident_medians
(
vtype varchar(100),
severity int
);Run the following Python script:import pymysql
myConnection = pymysql.connect(host='localhost', user='****', passwd='****', db='accidents')
cur = myConnection.cursor()
cur.execute('SELECT vtype FROM vehicle_type WHERE vtype LIKE "%otorcycle%";')
cycleList = cur.fetchall()
selectSQL = ('''
SELECT t.vtype, a.accident_severity
FROM accidents_2016 AS a
JOIN vehicles_2016 AS v ON a.accident_index = v.Accident_Index
JOIN vehicle_type AS t ON v.Vehicle_Type = t.vcode
WHERE t.vtype LIKE %s
ORDER BY a.accident_severity;''')
insertSQL = ('''INSERT INTO accident_medians VALUES (%s, %s);''')
for cycle in cycleList:
cur.execute(selectSQL,cycle[0])
accidents = cur.fetchall()
quotient, remainder = divmod(len(accidents),2)
if remainder:
med_sev = accidents[quotient][1]
else:
med_sev = (accidents[quotient][1] + accidents[quotient+2][1])/2
print('Finding median for',cycle[0])
cur.execute(insertSQL,(cycle[0],med_sev))
myConnection.commit()
myConnection.close()Write each query you used in Steps 1 – 8 in a text file. If a query produced a result set, then list the first ten rows of each row set after the query. Bundle your lessons learned report, your queries and your query results text file, and your MySQL query explanations from both before and after adding table indexes into a single zip file and submit that zip file as your final portfolio.
UC San Diego Basic Javascript Html and Css Multiple Choice Questions
CSS:1) What best describes the difference between these two selectors: #myElement & .myElement *A)The first selector is an ...
UC San Diego Basic Javascript Html and Css Multiple Choice Questions
CSS:1) What best describes the difference between these two selectors: #myElement & .myElement *A)The first selector is an ID and the second is a classB)The second should only be used onceC)#myElement & .myElement do the same thingD)The second selector is not a css selector2) Which is an example of grouped selectors? A)div .myClassB)h1, h2, pC)div > .myClassD)div > div > #myId3)What is true of an element with the CSS property display set to inline? *A)An inline element only takes up as much width as necessaryB)An inline element starts on a new lineC)An inline element takes up as much width as possbileD)An inline element must be displayed inside of another inline element4)Which of these options correctly describes the behavior of the CSS properties margin & padding? *A)padding is inside the border & margin is outside the borderB)margin is above & below the element, while padding is to the left and right of the elementC)padding is outside the border & margin is inside the borderD)padding is above & below the element, while margin is to the left and right of the element5)Which selector correctly selects all p tags inside of a div tag?A)div pB)div > pC)div + pD)div ~ pF)div .pE)div .all pHTML6)Which element(s) can exist inside of a block level element? Select all that apply *A)<div></div>B)<article></article>C)<dialog></dialog>D)<mark></mark>E)<summary></summary>7)Which option best answers the following? valid attribute for any element *A)idB)classC)titleD)data-*E)all of the above8)What is the valid way of commenting out this line of HTML code? <div></div> *A)<!-- <div></div> -->B)/** <div></div> **/C)``` <div></div>D)// <div></div>E) none of the above9)Which elements are block level elements? Choose all that are correct *A)<div></div>B)<a></a>C)<p></p>D)<span></span>E)<h1></h1>10)Which statement(s) are true about forms & form elements? *A)Radio buttons let a user select ONE of a limited number of choicesB)<input type="text"> defines a one-line input field for text inputC)<input type="submit"> defines a button for submitting a form to a form-handlerD)When a form is submitted, each input element's value will be associated with its id attributeE)The <li> element defines a drop-down list
Syracuse University R Programming Discussion
Review Discussion: Storytelling and Success Stories then focus on Moritz’s work on the OECD Better life index download t ...
Syracuse University R Programming Discussion
Review Discussion: Storytelling and Success Stories then focus on Moritz’s work on the OECD Better life index download the executive summary and the index data.In a one-page summary, note a few particular places around the world and compare and contrast the statistics. Also, note briefly how this graphic tells the story.
Marymount University Python Boundaries Lab
1)a) Using one of the Corpora in the last lab. Calculate the average "Tokens" per sentence.b) Using the same or different ...
Marymount University Python Boundaries Lab
1)a) Using one of the Corpora in the last lab. Calculate the average "Tokens" per sentence.b) Using the same or different corpus, which category has the longest sentences on average, which has the shortest?2) Download your own "Corpus" on https://www.gutenberg.org/ (Links to an external site.) a) How many sentences are in the document (use NLTK to split the sentences)? How does this differ from the amount of lines in the file (readlines)?b) After tokenizing the sentences, find 3 errors and describe why you think this error might of occurred. What in the algorithm might have gone wrong?NOTE: TAKE SCREENSHOTS OF ALL THE CODES
Similar Content
Proposed Research vmware
Cloud computing - vmware.docx ...
Grantham University Python Programming Language Taxes Script Practice
...
Thomas Edison State University Applying a Model to Continuous Data Questions
Section 6.2: Exercises 6.1, 6.2Section 6.5: Exercise 6.8Section 7.2: Exercise 7.5Section 7.5: Exercise 7.16...
create a simple trivia game for two players
open the file for information....
Create an HTML Code Web Designing Task
Please read section 1.1 this chapter, Chapter 1. HTML5: from documents to applications. We'll be referring back to this co...
Valencia College C++ Programming Task Computer Science Task
CIT237 C++ Programming
Lab Exercise 9.1
Pointers
In this lab exercise, you will write a program to demonstrate two conc...
Java Program
/* Write a program that compute the population for the two states every year until the population of Vermont surpass that ...
Rcode
dat = data_frame(Sex=c('Male', 'Female'), Stopped=c(4451476, ggplot(data=dat, aes(x=Sex, y=value, fill=Action)) + ggplot(d...
Answer 3
You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on Blackboard via the a...
Related Tags
Book Guides
A Wrinkle as Time
by Madeleine L'Engle
The Jade Peony
by Wayson Choy
The Metamorphosis
by Franz Kafka
2001 A Space Odyssey
by Arthur Clarke
A Brief History of Humankind Sapiens
by Yuval Noah Harari
The Curious Case of the Dog in the Night Time
by Mark Haddon
How to Win Friends and Influence People
by Dale Carnegie
The Mayor of Casterbridge
by Thomas Hardy
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
Java Multiple Generics to Develop a Storage Bin Class Questions
In this exercise you will use multiple generics to develop a StorageBin class. The StorageBin class will
store a generic ...
Java Multiple Generics to Develop a Storage Bin Class Questions
In this exercise you will use multiple generics to develop a StorageBin class. The StorageBin class will
store a generic item and a generic unique identifier for that item. For example, the StorageBin may store
hardware tools and a unique ID for each tool.
You are provided with the following starter code files: StorageBinTester.java, StorageBin.java, Tool.java
ITS410 Colorado State University Database Management Portfolio Project
Option #1:Your Portfolio Project consists of two items, a lessons learned reflection report and a database design and anal ...
ITS410 Colorado State University Database Management Portfolio Project
Option #1:Your Portfolio Project consists of two items, a lessons learned reflection report and a database design and analysis project.Lessons Learned and ReflectionWrite a 2- to 3-page summary that outlines the lessons you learned in this database class. Reflect on how these lessons can be applied toward more effective database management and reporting.Database Design and AnalysisUse the Accidents_2016.csv file below to implement the following steps for your database project.Create a MySQL schema named “accidents.”Within the accidents schema, create a table named accidents_2016 with the following columns:accident_index as a varchar(13),accident_severity as an intWithin the accidents schema, create a table named vehicles_2016 with the following columns:accident_index as a varchar(13),vehicle_type as a varchar(10)Within the accidents schema, create a table named vehicle_type with the following columns:vcode int,vtype as a varchar(100)Next, you will load the data for the three tables.Load the accidents data. Note that @dummy is a placeholder for a column in the .csv file that you want to ignore during the load.load data local infile '…\\data\\Accidents_2016.csv'
into table accidents_2016
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 lines
(@col1, @dummy, @dummy, @dummy, @dummy, @dummy, @col2
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
)
set accident_index=@col1,accident_severity=@col2;Load the vehicle data.load data local infile '…\\data\\Vehicles_2016.csv'
into table vehicles_2016
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 lines
(@col1, @dummy, @dummy, @col2
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
,@dummy, @dummy, @dummy, @dummy, @dummy
)
set accident_index=@col1,vehicle_type=@col2;Load the vehicle type data.load data local infile '…\\data\\vehicle_type.csv'
into table vehicle_type
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
ignore 1 linesAfter the data are loaded, you will perform the analysis. First, find the average accident severity and the number of accidents for vehicles of type motorcycle. Note the performance of your query. Your query may run so slowly that MySQL aborts running completing.Improve Query PerformanceLook at the explain tool output and save the results to a graphic file.From the explain results, how many rows have to be read per join?Add an index named “accident_index” of type “index" on the accident_indexcolumn in the accidents_2016 table and another index named “accident_index” of type “index” on the vehicles_2106 table.alter table accidents_2016
add index accident_index (accident_index asc);alter table vehicles_2016
add index accident_index (accident_index asc);After adding the indices, rerun the query explanation tool and determine the number of rows to be read per join.Find the median accident severity.MySQL does not have a median function so to find the median accident severity, you will have to write a Python script.You'll need to install Python and the PyMySQL module.Install Python version 2.7 or 3.4 from www.python.org.To install the PyMySQL module, run the following command in a Windows command prompt after Python has been installed:python -m pip install --index-url=https://pypi.python.org/simple/ --trusted-host pypi.python.org PyMySQLb) Create an accident median tablecreate table accident_medians
(
vtype varchar(100),
severity int
);Run the following Python script:import pymysql
myConnection = pymysql.connect(host='localhost', user='****', passwd='****', db='accidents')
cur = myConnection.cursor()
cur.execute('SELECT vtype FROM vehicle_type WHERE vtype LIKE "%otorcycle%";')
cycleList = cur.fetchall()
selectSQL = ('''
SELECT t.vtype, a.accident_severity
FROM accidents_2016 AS a
JOIN vehicles_2016 AS v ON a.accident_index = v.Accident_Index
JOIN vehicle_type AS t ON v.Vehicle_Type = t.vcode
WHERE t.vtype LIKE %s
ORDER BY a.accident_severity;''')
insertSQL = ('''INSERT INTO accident_medians VALUES (%s, %s);''')
for cycle in cycleList:
cur.execute(selectSQL,cycle[0])
accidents = cur.fetchall()
quotient, remainder = divmod(len(accidents),2)
if remainder:
med_sev = accidents[quotient][1]
else:
med_sev = (accidents[quotient][1] + accidents[quotient+2][1])/2
print('Finding median for',cycle[0])
cur.execute(insertSQL,(cycle[0],med_sev))
myConnection.commit()
myConnection.close()Write each query you used in Steps 1 – 8 in a text file. If a query produced a result set, then list the first ten rows of each row set after the query. Bundle your lessons learned report, your queries and your query results text file, and your MySQL query explanations from both before and after adding table indexes into a single zip file and submit that zip file as your final portfolio.
UC San Diego Basic Javascript Html and Css Multiple Choice Questions
CSS:1) What best describes the difference between these two selectors: #myElement & .myElement *A)The first selector is an ...
UC San Diego Basic Javascript Html and Css Multiple Choice Questions
CSS:1) What best describes the difference between these two selectors: #myElement & .myElement *A)The first selector is an ID and the second is a classB)The second should only be used onceC)#myElement & .myElement do the same thingD)The second selector is not a css selector2) Which is an example of grouped selectors? A)div .myClassB)h1, h2, pC)div > .myClassD)div > div > #myId3)What is true of an element with the CSS property display set to inline? *A)An inline element only takes up as much width as necessaryB)An inline element starts on a new lineC)An inline element takes up as much width as possbileD)An inline element must be displayed inside of another inline element4)Which of these options correctly describes the behavior of the CSS properties margin & padding? *A)padding is inside the border & margin is outside the borderB)margin is above & below the element, while padding is to the left and right of the elementC)padding is outside the border & margin is inside the borderD)padding is above & below the element, while margin is to the left and right of the element5)Which selector correctly selects all p tags inside of a div tag?A)div pB)div > pC)div + pD)div ~ pF)div .pE)div .all pHTML6)Which element(s) can exist inside of a block level element? Select all that apply *A)<div></div>B)<article></article>C)<dialog></dialog>D)<mark></mark>E)<summary></summary>7)Which option best answers the following? valid attribute for any element *A)idB)classC)titleD)data-*E)all of the above8)What is the valid way of commenting out this line of HTML code? <div></div> *A)<!-- <div></div> -->B)/** <div></div> **/C)``` <div></div>D)// <div></div>E) none of the above9)Which elements are block level elements? Choose all that are correct *A)<div></div>B)<a></a>C)<p></p>D)<span></span>E)<h1></h1>10)Which statement(s) are true about forms & form elements? *A)Radio buttons let a user select ONE of a limited number of choicesB)<input type="text"> defines a one-line input field for text inputC)<input type="submit"> defines a button for submitting a form to a form-handlerD)When a form is submitted, each input element's value will be associated with its id attributeE)The <li> element defines a drop-down list
Syracuse University R Programming Discussion
Review Discussion: Storytelling and Success Stories then focus on Moritz’s work on the OECD Better life index download t ...
Syracuse University R Programming Discussion
Review Discussion: Storytelling and Success Stories then focus on Moritz’s work on the OECD Better life index download the executive summary and the index data.In a one-page summary, note a few particular places around the world and compare and contrast the statistics. Also, note briefly how this graphic tells the story.
Marymount University Python Boundaries Lab
1)a) Using one of the Corpora in the last lab. Calculate the average "Tokens" per sentence.b) Using the same or different ...
Marymount University Python Boundaries Lab
1)a) Using one of the Corpora in the last lab. Calculate the average "Tokens" per sentence.b) Using the same or different corpus, which category has the longest sentences on average, which has the shortest?2) Download your own "Corpus" on https://www.gutenberg.org/ (Links to an external site.) a) How many sentences are in the document (use NLTK to split the sentences)? How does this differ from the amount of lines in the file (readlines)?b) After tokenizing the sentences, find 3 errors and describe why you think this error might of occurred. What in the algorithm might have gone wrong?NOTE: TAKE SCREENSHOTS OF ALL THE CODES
Earn money selling
your Study Documents