PDA

View Full Version : Learn to Code Your Own Horse Racing Database - Lesson 2


wesmip1
10th April 2011, 11:11 AM
Lesson 2:

Another lesson of basics but they need to be covered. This lesson is very important. It will take you through doing simple maths and manipulating the data. It will also give you a few conditional statements and looping constructs so that you can do things with the data. Conditional statements are very important as you will use these for developing ratings. For example If Horse1 finished first last start then give it a rating of 100 else give it a rating of 10. Looping will be very important as it allows you to use the same code for a group of things. For example loop through and apply the rating statement above for horses 1 to 10.

For this lesson you are going to need to :

1.If you haven't done Lesson 1 then go do it at http://www.propun.com.au/racing_forums/showpost.php?p=223243&postcount=1

2. Go to http://download.oracle.com/javase/tutorial/java/concepts/index.html and read the information. This page will give you an idea on how the principles behind coding in java work. It will introduce you into Object oriented programming and what an Object is and how you use it.

3. Read through and do the exercises for http://download.oracle.com/javase/tutorial/java/nutsandbolts/index.html. This is going to introduce you to some of the basics on programming including variables, types and simple maths. It will then take you through some simple control logi such as if-then-else and while statements.

4. Time to reinforce your understanding and do a couple of exercises. Firstly define 2 variables with a number. Call these variables horseRating1 and horseRating2. Print these to the screen.

5. Change the above program to determine the assessed odds based on the ratings. For example if horseRating1 = 50 and horseRating2 = 50 then the assessed odds of both horses should be $2.00. To determine the assessed odds use 1/rating. Output these value to the screen.

6. Change the above program to hold the ratings in an array. Output the results.

7. Change the above program to use a if-then-else statement to determine the horse with the highest rating. Output only the horse with the highest rating.

8. Create a new program that will take a number and add 1 to it in a while loop. Each time it increases by 1 output the results to the screen. Start at 0 and increase the number to 20.

9. Change the above program to do this with a for statement.

10. Change the above program to use a break when the number gets to 10. Make sure you understand how the break works and the output only counts to 10.


That should take a while for those new to programming. There are some very important concepts in these weeks lesson. If you can do all of the above you are half way there and will be at the start of creating your own database.

It won't be long till we get into the specifics of coding our own database.

mattio
11th April 2011, 06:13 PM
Gee wes, you may have scared off some people after lesson 2. I tried to code several times but I just don't have the patience to try and learn it so I found someone who could :)

moeee
11th April 2011, 06:46 PM
It won't be long till we get into the specifics of coding our own database.

I'm having trouble getting motivated and putting in the hard yards.
Could you tell me what is at the end of the rainbow?

I know how to Program in Basic, and a little on how to Program in EXCEL, but neither of these has made me rich, or even better off for having known it.

I've missed the reason for the Lessons.
How is this database used?
Is it for testing systems?

wesmip1
11th April 2011, 07:22 PM
moeeee,

Once you know how to code properly you can do anything you want.

At the end of the day you will have a fully functioning database of form that you can run systems, staking plans, ratings, etc across. The tools learned here will enable you to do this for horse raicng, greyhounds, harness, rugby league, afl, etc. Anything you can collect stats on you can create a databse for.

Once you have the database you are a mile above the average punter as you can test which things work or don't work.

Of course you can pay someone to code it for you but then you would not be able to adapt the code to try new things. Coding it yourself you learn how to adapt with changing times.

wesmip1
11th April 2011, 07:25 PM
Gee wes, you may have scared off some people after lesson 2. I tried to code several times but I just don't have the patience to try and learn it so I found someone who could :)
Maybe I did but if I can help a couple of people who stick it out then it might be worthwhile. I didn't want to waste 20 lessons teachngs the basics and you have a week to do it all. Should only take 1 day of reading and a couple of nights playing with the code to do this if your a beginnner. If your experienced in any language this shouldn't take you more then an hour.

aussielongboat
12th April 2011, 06:55 AM
good morning wesmip1:
Re racing and sports data.
I read recently in another post that you could help with some past R&S data – I cannot find the actual post.
However - I am also in the process of building a racing and sports form data base in excel
This has been going since December 1 2010.
However I need to back fill some of my data.
Would it be possible for you to assist me with some missing data?
If you could oblige and if you have the data – this is what I am after in field order – as CSV file would be fine. I can then import in.
The field order is not important.
DATE, HORSE,BRR, FORM, COND, CONS, BP, JOCK, JC, Jrat, Trat, RFS, DLS, 12m rating, CarAPM, 12mAPM, 12m API, Car W, Car P, Car S, Car W%, Car P%, 12m W, 12m P, 12m S, 12m W%, 12m P%, career best rtg, bl3, weight, distance, track condition

my email address is gperfrem@gmail.com






Thanks also for the data base lessons - they are great - :)


cheers


Aussie. :)

The Elk
12th April 2011, 08:39 AM
Hi Wesmip,
I applaud your endeavours to help others on this forum and hopefully not too many negative or sidetrack postings clutter your learning threads.

I am not a java person, but I will be following with interest - and have the knowledge to code new thoughts/ideas that I am sure I can learn from you into VB2010

cheers

wesmip1
12th April 2011, 06:06 PM
However - I am also in the process of building a racing and sports form data base in excel

excel is so limiting but I have some (not all) of the data you are asking for. I'll be in contact soon.

TheElk,

VB2010 is an ok language to use. The latter lessons might be useful when we get into design rather then basics.

aussielongboat
12th April 2011, 06:20 PM
thanks wesmip1,
much appreciated,

cheers

aussie

moeee
19th April 2011, 11:57 AM
Lesson 3 must be surely due soon.

Not that I managed Lesson 2, but perhaps Lesson 3 could reinstil interest and get me motivated to go back and have another go at 2.

Dale
25th April 2011, 05:04 PM
Anyone heard from Wesmip?


For the last 3 months he has been sending me nightly emails containing an automated print out of my class ratings, i havent recieved these for about two weeks.

No continuation of this thread?


No suggestion of any break,nothing on the forum,no reply to my email,just gone?

Stix
27th April 2011, 01:35 PM
Dale, I've emailed wes a couple time over the past week or so, and no reply as yet.....

Wes, hope you're OK and just on holidays !! :rolleyes:

Dale
30th April 2011, 06:00 PM
I think we can rule out holidays.

moeee
23rd May 2011, 04:19 PM
I guess its safe to uninstall Netbeans and reclaim a substantial chunk of memory from my Hard Drive.

jose
23rd May 2011, 04:45 PM
Yep, I reckon he has installed all the Spyware, Worms, Trojans, etc on to everyone's computer and has now disappeared into the ether.
A tip for the young/inexperienced players......CHANGE YOUR PASSWORDS.

aussielongboat
23rd May 2011, 06:38 PM
wesmip1 is on holidays in the US with his family.
i suspect he will be back in a few weeks.

jose
23rd May 2011, 07:06 PM
False alarm......don't panic..don't panic......

Dale
24th May 2011, 07:37 PM
wesmip1 is on holidays in the US with his family.
i suspect he will be back in a few weeks.


He may be but his trust has gone.

Dale
29th June 2011, 06:49 AM
Still nothing from Wes.

I need to move on and find someone who can automate my rating process.


Looking for a more reliable and permanent solution.


If anyone out there can automate a process where two easy to find form figures are multiplied by each other with the highest rating from each horses last three starts recorded and ranked in field form from highest to lowest i'd be very keen to talk business.

I can be contacted here or via email on -go the halatau at hot mail dot com


Cheers