Wednesday, December 24, 2008
Adding up prices on a web page.
Goal: to price the cost of owning every O'Reilly pocket reference and guide.
Software needed:
A web browser
A spreadsheet
R software
a text editor.
Find a well formated web price list such as
http://oreilly.com/store/series/pocketrefs.csp
Step 1: Web browser
Highlight the beginning of the price list (i.e. highlight the beginning of the first item/record on the web page). Scroll to the end of the list or web page. Hold your shift key down and click just after the last item/record. Now copy this highlighted list. You should have all the items highlighted
Step 2 Spreadsheet
Paste this in to an empty spreadsheet. Examine this and see if prices are on one row alone. It does not matter if there are dollar signs with the prices in the cells or also in this case a currency symbol USD. But here we find in the spreadsheet a price such as "$9.99 USD" occurring in every eighth row. The Prices should be in cells by themselves. But there is all the other stuff like the title and the blurb which here we want to parse out.
Step 3 Spreadsheet
Save the spreadsheet as a CSV file comma separated file. Remember the name and directory for the first line of R code below in the next step.
Step 4: R software ( www.r-project.org), text editor
Copy and paste the code below into a text editor
Change the directory and file name to your file and directory name from step 3 in the first and and the directory in the last line of this code. On the last line chose a file name.
Change the line jump <-(seq(x,y,z)
so that x is the first row a price occurs and y the last row a price occurs and
z is the number of rows between each price.
You can also change jump(x,y,z) to parse out all the titles or all the blurbs or all the dates published.
After editing copy the code into the R command line a line at a time
the # lines are comments
Use R software and run this code on the R command line after editing it in the text editor. Stop after each line that begins with # to check the results. good luck and use R help if needed.
###################Code Starts here##################
OPocket <-read.csv(file="/Users/ptimusk/documents/school/books/OReillyPocket08-12-24.csv", header= FALSE)
# read into R and the variable OPocket the csv file created by Excel save as csv.
#change "Users/ptimusk/documents/school/books/...to your directory
# and file name OReillyPocket08-12-24.csv
OPocket
#check variable for rows that contain prices. Every foth row starting at 4 ending at 394
#
jump <- seq(4, 394, 5)
# create an index of rows where prices occur. Start with row 4. End with row 394
#Count by 5 rows
OPocket.Prices <- as.vector (OPocket[jump,1])
#take only the rows(indexed by "jump") with prices out of the variable OPocket
OPocket.Prices
# check to see above variable contains quoted prices in 79 rows
write.csv(OPocket.Prices,file="/Users/ptimusk/documents/school/books/OPocketPrices08-12-24.csv")
#write the prices to a csv text file
###############Code ends here######################
Step 5 text editor
Open with the text editor the file you just wrote on the last line of R code
Save as txt
Step 6 Spreadsheet
With the spreadsheet and a new empty spreadsheet open the txt file you just saved. That should be the text file with the Prices. This file should have the variable OPocket.Prices as an R format variable.
The spreadsheet should take you through some import steps where
you can adjust the separator characters to parse out the prices only without the $
and without the currency symbol. You also parse out the first line and the quotes.
Sum the prices column
Your done!
Answer: all the O'Reilly pocket references and guides will cost 851.69 $ for the 79 books.
Our term project passed and it looks like I passed simulations and modeling.
Saturday, December 20, 2008
Studying Internet topics and SAS this weekend.
Its official Dr. Iluju Kiringa to supervise my masters of science thesis
Wednesday, December 17, 2008
I am coauthor of a paper on retirement education.
I am studying Perl but with full time work I do not study as much as in the past.
Tuesday, December 16, 2008
I am checking to make sure I have a supervisor for my thesis now.
Saturday, December 13, 2008
Our term project was submitted yesterday.
Tuesday, December 09, 2008
Completion of course requirements for Graduate Certificate in Systems Sciences.
I have my notes organized and I am just printing the last lectures slides.
It is down to crunch time but I have made steady progress studying. I will review a few calculations and my hand written lecture notes this morning before the exam.
I am excited to be starting some new work at work on Wednesday.
Monday, December 08, 2008
I am reviewing chapter 2 now in the text book.
I started to review chapter 2 in my course textbook. This chapter outlines the basic in this simulations and modeling approach.
I have found out my mistake that our instructor is not actually a full professor. He is still studying for his PhD.
Wednesday, December 03, 2008
I am now babtised in the use of Excel for statistical analysis.
I have two versions of the experiment and I had our programmers run it 10,000 times thus simulating a restaurant being open 10,000 days. I used Excel formulas to calculate averages, standard deviations and confidence intervals. I divided the confidence interval by 2 to give a half interval. I then did this for the first ten runs, the first 100 runs, the first 1000 runs and finally the whole 10,000 runs.
Then using Excel I made some tables to hold the results and copied and pasted these into Word. I used two fonts the standard Excel Mac X version default font for most of the work and then tried American Typewriter for the headings. I am learning typesetting for tables and charts at work in my development assignment. My development assignment is ending this week. It actually ends next Tuesday but I took Monday and Tuesday off work to write my final exam.
So I have now used Excel to do a simple statistical analysis for our term project. I should now move on to writing this up and getting ready to submit the final step of the project. The good thing now is the professor was very positive about our step three submission and step four is statistics which is what I have studied the most courses in so this step has a lot going in my favour.
Monday, December 01, 2008
We had our exam review class tonight. It was relaxing and intellectually stimulating
I am starting work in the Internet Society section of Statistics Canada on December 10th.
Sunday, November 30, 2008
Exam study begins: Reading chapter 3 in course textbook. Progress report.
Our term project is good at the third step. I am planning eight hours study over night now.
I am getting ready for eight hours study over night now for my SYS5110 exam. Tomorrow is our exam review class.
Our project has been marked for the third phase. We did good work on it.
Wednesday, November 26, 2008
I finished reading The Making of Second Life by James Wagner Au.
Our term project is coming along on time.
I am installing a one year one time install version of ESRI's ArcGIS 9.2 student version on the new PC crystal 89.
At the moment I have installed the software and plan to open my old term project from the course I took in 2000. Then, by accessing recent census data I will update the ArcView project. I had used spreadsheets containing census 1996 data, entered into Excel from Zypher at the Ottawa Carleton Social Planning Council. There I had been paid to enter the data. I am a proud supporter of the Ottawa Carleton Social Planning Council and give them money every pay cheque through charitable donations. This is my present and first project for ArcView 9.2. I then may also attempt to open GIS files provided by Statistics Canada and Elections Canada, two of the workplaces I have worked.
I did not succeed right away with the new software. I was able too import my project file but could not get a map to appear. I am up over night and do not want to spend my time on a desktop computer working out this problem as I had planned to read books. So I am stopping now with the software successfully installed and registered.
