Log in

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


wesmip1
4th April 2011, 07:26 PM
Since there has been a few people who are interested in learning to code I will provide some help and also provide some guidance on what to do each week in order to create your very own database and auto-betting software.

I'll be pointing at some online resources that you will need to read and provide some exercises to complete each week. I strongly suggest you do the exercises as I'll at least be here to help out with any issues, and people learn by doing, not reading.

Week 1 is an introduction to the java language as well as getting software setup.

Steps for you to complete this week:

1. Go to http://download.oracle.com/javase/tutorial/getStarted/index.html
2. Read through all of the introductory material on The Java Technology Phenomenon
3. Read through the lesson on The "Hello World!" Application
4. Install the JDK and netbeans (part of step 3 lesson)
5. Compile and run the Hello World Application (part of Step 3).
6. Read through the lesson on A Closer Look at "Hello World!"
7. Make changes to the Hello World application to print out "Horse Racing Database Test".

If you have any issues then read through the Common Problems (and Their Solutions) section

By the end of this week you should :

1. Have installed Netbeans and JDK6 or newer.
2. Written a simple application to say "Hello World"
3. Written a simple program to say "Horse Racing Database Test"

If anyone has problems installing the software and/or coding the Hello World program please write the errors you are recieving here and I'll help you out.

I also encourage each of you to help each other out. Especially if you see someone here has posted a problem which you have resolved yourself.

I'll try and make sure I logon at least once a day and answer questions.

This won't be a quick thing. It will take 15-20 weeks for us to get through all of this and get a simple database program written. But once it is written you should know enough to code almost anything you will need to code.

Pauls123
4th April 2011, 08:55 PM
Hi there Wesmip, this sounds very interesting. I have zero knowledge about this. But put me down to learn,

Regards, Paul

moeee
5th April 2011, 08:13 AM
I am currently accessing the Database from GRV in regards to Greyhounds.

Is your method suitable for Greyhounds?
I am a little familiar with EXCEL and have been using it for my studies.
If nothing else, can I use the information learnt here to improve in any way, what I am currently doing via EXCEL?

The EXCEL programs I use for study are similar to the sort of thing Shaun often posts on this website.

jose
5th April 2011, 08:23 AM
I know next to nothing about all this, but I'll be having a bash anyway.
Just hope I can do all this on the old Mac.
Just like to say a big thank-you to you wesmip1. I just hope you have the patience of Job if all your "students" are as tech savvy as I am.
More power to you.

Robot
5th April 2011, 09:52 AM
Thank you WES. Put me down to learn also.Been looking for this since I joined recently Regards Tom the Robot

wesmip1
5th April 2011, 03:25 PM
I am currently accessing the Database from GRV in regards to Greyhounds.

Is your method suitable for Greyhounds?
I am a little familiar with EXCEL and have been using it for my studies.
If nothing else, can I use the information learnt here to improve in any way, what I am currently doing via EXCEL?

The EXCEL programs I use for study are similar to the sort of thing Shaun often posts on this website.It will be aimed around Java but you might learna few techniques useful for VB. Excel is fairly limited though when you get up to the sort of form we are storing ( millions of horse formlines).

I recommend learning beyond excel and moving onto mayb C# as that is similar enough to the excel coding that you would feel comfortable with it.


Although I will be focusing on horse racing it will be suitable to sportsbetting and greyhounds. The lessons will teach you enough so that you can pick whatever sport you want and get data for it.

wesmip1
5th April 2011, 03:28 PM
Guys,

Just get staretd on this weeks lesson so when I post the next lesson you are all ready to go.

If there are any issues just let me know. If you have finished this weeks lesson then let me know here.

moeee
5th April 2011, 05:16 PM
So how come you suggest the NetBeans approach?
Why not use the Microsoft Windows approach?

Or am I confused already?

stugots
5th April 2011, 05:23 PM
ready for round 2 whenever everyone else is

Shaun
5th April 2011, 05:44 PM
I need to reinstall, had issues with compiling

wesmip1
5th April 2011, 05:48 PM
So how come you suggest the NetBeans approach?
Why not use the Microsoft Windows approach?

Or am I confused already?
Moeee,

Netbeans is an Intergrated Development Envroment. Basically a program that helps you code. It runs on any type of machine (windows, linux, unix, mac). I use java as it works independent of being on windows or a mac. Some other languages men you can only use windows.

wesmip1
5th April 2011, 05:51 PM
ready for round 2 whenever everyone else is
I'll probably release the next Lesson on Sunday night.... Most people will be busy with races tommorrow through to Saturday.

moeee
5th April 2011, 07:14 PM
I have saved 2 files to my Computer.



jdk-6u24-windows-i586.exe

netbeans-6.9.1-ml-javase-windows.exe



I'm figuring that these files are installation files.

I figure I need to run these blokes in that order.
Yes - No?

Glen
5th April 2011, 07:59 PM
I have saved 2 files to my Computer.



jdk-6u24-windows-i586.exe

netbeans-6.9.1-ml-javase-windows.exe



I'm figuring that these files are installation files.

I figure I need to run these blokes in that order.
Yes - No?Hi Moeee,
Netbeans is an IDE (Integrated Development Environment) which you can use to program in lots of different programming languages. If you are wanting to program in Java then you will require the jdk (Java Development Kit) so that you can make fancy horse racing apps in Java ;)

If it was me I would install the JDK first then Netbeans.

More info:
http://en.wikipedia.org/wiki/Java_Development_Kit
http://en.wikipedia.org/wiki/NetBeans

moeee
5th April 2011, 08:16 PM
Thank You Glen

wesmip1
6th April 2011, 05:55 AM
I have saved 2 files to my Computer.



jdk-6u24-windows-i586.exe

netbeans-6.9.1-ml-javase-windows.exe



I'm figuring that these files are installation files.

I figure I need to run these blokes in that order.
Yes - No?
Yep as per Glenn's post. Install the JDK then the Netbeans program.

thorns
6th April 2011, 05:59 AM
Hey Wesmip,

Thanks for taking the time to do this thread.
Quick question, are you planning on leaving this thread up for a while? I am about to go away on holiday for a couple of weeks, so wont be able to start till after I get back.

Cheers

YoungBuck
6th April 2011, 07:50 AM
Lesson 1 went pretty well.

No problems with the Netbeans, but i had problems with the windows one: <code>'javac' is not recognized as an internal or external command, operable program or batch file</code>

I couldn't work it out so I think i'll stick with Netbeans.

Shaun
6th April 2011, 08:14 AM
You need to get that working or you won't be able to compile your program, this means you won't be able to put it all together to run, i have same issue on win 7 i am going to try an uninstall and reinstall in different location.

Robot
6th April 2011, 08:43 AM
Wesmip1.I downloaded jdk and netbeans as a bundle..Took 1 3/4 hrs. Upon completion was unable to run but did a search and found the files had been downloaded but something was wrong with the link I had used.Any suggestions and how do I delete these files Thanks once again Tom the ROBOT

YoungBuck
6th April 2011, 09:29 AM
You need to get that working or you won't be able to compile your program, this means you won't be able to put it all together to run, i have same issue on win 7 i am going to try an uninstall and reinstall in different location.Oh i see.

I too am using w7, i just thought that windows way was optional, you could choose to bypass it and use Netbeans to compile - "We recommend using the NetBeans IDE instead of the command line whenever possible"

I tried re-installing but not yet at new location. I'll try your suggestion too.

stugots
6th April 2011, 11:59 AM
there are 32 bit & 64 bit versions of javac, which may be the reasons for your install problems on windows7 as I had no problems?

Shaun
6th April 2011, 12:06 PM
Windows 7 will run both so maybe the 32 bit version might be better.

wesmip1
6th April 2011, 03:54 PM
Hey Wesmip,

Thanks for taking the time to do this thread.
Quick question, are you planning on leaving this thread up for a while? I am about to go away on holiday for a couple of weeks, so wont be able to start till after I get back.

Cheers
thorns,

It will be here when you get back. I'll monitor the threads for people who start late :)

wesmip1
6th April 2011, 04:02 PM
shaun, Youngbuck,

If you get issues with "'javac' is not recognized as an internal or external command, operable program or batch file".

It means that the environment path has not been setup correctly. To fix this find the directory that hs javac.exe in it (it will be in your JDK directory\bin).

Go to the control panel in windows and go to System. Half way down you should see something about Computer Name, Workstation, etc. There is a change setting sbutton here. Click that and another screen opens. Go To advanced. Click on Environment Variables. In the bottom section you should see an entry called Path. Edit this entry and add in the directory where you found the javac.exe file.

For example my path currently is:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\COMMON~1\ULEADS~1\MPEG;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\IEInspector\HTTPAnalyzerFullV6\;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

If javac.exe was in c:\java\bin\javac.exe I would change the above to be:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\COMMON~1\ULEADS~1\MPEG;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\IEInspector\HTTPAnalyzerFullV6\;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\java\bin\


Notice the use of ; to seperate the directory paths. You may need to restart windows to pick it up (sometimes you don't). It should then find javac from any directory.

wesmip1
6th April 2011, 04:04 PM
Most of the time we will be using netbeans to do the compiling so even if ou can't find javac on the command line that is ok. As long as netbeans can compile a program you will be fine.

As far as 32 bit vs 64 bit. I would stick with 32 bit as I find 64 bit applications usually have compatibility issues. But if you installed 64 bit thats ok.

moeee
6th April 2011, 06:34 PM
My Computer is probably too Old and lacking in stuff needed to run these Netbeans.

I installed the Programs and was doing the suggested HelloWorld App.

I got up to where it said to replace a line where it wrote "Todo something or rather" and type in "Hello World".

I was mucking about tryying to delete the line and the program locked up.
So I closewd the program and tried reopening but it seems the program wasn't saved prior to the lockup.

I figure I need to try again, but got annoyed and an gonna do tonights dogs and have a play again maybe tomorrow.

If it weren't so slow I woulda persevered.
When I did reOpen, it suggested I may have a virus or something.
I wouldn't be surprised because I have been visiting a few porn sited lately.]
Them Free Peep shows sure are addictive :)

Raven
6th April 2011, 08:02 PM
I havent had any problems with Netbeans (on Vista). When I downloaded there was an option to download the Java & Netbeans in one bundle, so I went for that option.

But my laptop will be crashing anytime soon, i can sense it. Since the weekend it freezes constantly, I have to do emergency shutdown & reboot 3 or 4 times a night & and thats just in the 2-3 hrs i have since i come home from work. I've tried downloading new drivers etc, but still the same.

Back on topic, today i got some info in the mail about a certain racing database, been around since the 80's. I was interested, until i saw the price, lol. Almost 3 grand each year, add another $1100 for some back data to kick you off & another $660 for data updates, almost 5 grand. Just have to perservere & learn to DIY.

footnote: I'll need that cash for a new pc anyway

wesmip1
7th April 2011, 06:07 AM
As per most IDE's they can be a bit memory intensive.

An alternate IDE to use that is not as memory intensive is eclipse. I only recommend netbeans as it is slightly easier to use especially if you want to make a GUI (graphical user interface) for your application.

Eclipse is less memory intensive and is my preffered IDE to use but it will be a lot more complicated to use for first time coders.

But if you find netbeans keeps locking then install the latest Eclispe version and use that instead.

moeee
7th April 2011, 07:03 AM
I only run Windows XP.
I might possibly Upgrade one day to Vista, but only if forced to for some unforeseen reason.

So do I need this Netbeans thing?
If Eclipse is okay then it appears that Netbeans ain't essential.
But do I actuall need an IDE? (whatever that is:) , I thought it was something to do with hard drives, First IDE , Second IDE )
Is it necessary to have this IDE thing and follow this thread ?
Or is it all exactly the same if I only have the JDK 6 Program installed?

wesmip1
7th April 2011, 04:38 PM
You can code java with only notepad. But it will be much harder. An IDE (Integrated Development Environment) makes things easier.

Just use Eclipse if you can't use netbeans.

Robot
7th April 2011, 07:08 PM
Hi all Thought I might give the lessons the miss but BINGO downloaded the necessary programs today. Hope to catch up on the first lesson tomorrow. Good for a 84year old to comprehend this language don't you think.TOM the ROBOT

moeee
7th April 2011, 07:23 PM
Good for a 84year old to comprehend this language don't you think.

Jeez!!
I figure it'ld be good to just wake up alive the next day at 84 year old!!!

bookend
9th April 2011, 01:38 PM
Thanks wesmip1. Lesson one completed without any issues.

Bookend

moeee
9th April 2011, 04:03 PM
A small window down the bottom of the screen says this.

run:
Horse Racing Database Test
BUILD SUCCESSFUL (total time: 7 seconds)

Thats in the Netbeans Screen

Or now that I have done the Program, do I now not use Netbeans, and use some JAVA Program instead?

wesmip1
10th April 2011, 06:22 AM
moeee,

You can run it from within netbeans.

If you only have 1 project (which you should) click the green arrow in the toolbar. Alternatively in the menu click Run -> Run Main Project . Or you could press Ctrl + F5. Or you could right click on the project in the Projects tab (left side of screen hopefully) and click Run.

That will run the program. There should be a Output screen with the results. If you can't see it go To "Windows" in the menu and click Output. Or you could press Ctrl + 4.

Hope that helps.

Dynamite
10th April 2011, 01:52 PM
Hi Guys, Have enjoyed this forum for a couple of years now and decided to join. Very interesting and positive comments and lots of great stuff.

Thankyou wesmip 1 for your time to help the likes of me. Have completed lesson one.

Cheers

wesmip1
10th April 2011, 04:55 PM
Lesson 2 is up for those who want to continue learning.

aussielongboat
10th April 2011, 09:15 PM
cheers - thanks for what you are doing
'

tedbluegum
11th April 2011, 05:33 AM
Hi Wes

Thanks for the information and help in starting to set up my data base.

I look forward to working through lesson 2. You make it fairly easy for a almost non IT person ..to date.

Thanks again

Regards
Ted