login join

inksmithy's Blog

Member For: 3 months, 1 week
Posts: 26

Alan R, Male, 36
http://www.muttering.co.uk
Member of: Diybetfairbots Forum.

Re: getBetHistory php

September 3, 2008 by inksmithy

Nice one!

As far as using the MySQL data in the new linux version of MySQL goes, I have to say I'm not sure. That said thoug, I wouldn't have thought it was that much of an issue - you could probably just use phpmyadmin to dump the databases to an sql file, then open it up on the linux machine and restore it from there. Probably not a bad idea to do it that way anyway.

There are a few commands in linux which I find incredibly useful

chmod +x /path/to/file - allows a fille (bash script and so on) to be executed. Not a good idea if you don't know what the script does, but if you have just written it, thats the command to get it going.
chown  -R username:usergroup /path/to/directory - the -R makes the permissions change work recursively through any directories in the path you supplied

Three variations on sudo:

sudo - the main one, useful for when you just need to run a single command
sudo su - makes you the superuser until you type 'exit' - useful for when you have to do a few things in the console
gksudo [gnome program name] - opens up the gnome program in superuser mode. Dangerous, but useful. Use it when you need nautilus to move files around in /opt or when you want to edit a config file but can't be arsed using nano.

Someone should probably have warned you about all those permissions - sorry bout that.

Re: getBetHistory php

August 31, 2008 by inksmithy

Linux - how easy is it to use with php ? For some reason my php instals have goe to pot and crashes far too often these days reckon it may be my xp thats the prob but not sure (acer laptop with just some recovery cd not xp disc) Looking for something to run my bots on thats stable for the aussie stuff i do so thinking of dual boot or even possibly running linux of a cd or pendrive. Seen the pendrive stuff may be a no no as the drives only have a finite amount of write to's.

Captain Sensible - It is dead easy, almost like it is designed for it. Can't count how many free editors and testing tools there are available for php scripting on Linux and just about every one of them can be linked with the php parser so you can test your scripts out without hassle.

If you fancy having a go, download an ISO from Ubuntu and use wubi to install it (you will see the instructions when you put the disk in the drive). Basically works just like installing something in windows, except you end up with a dual boot enviroment.

Once you have your linux install, go to www.apachefriends.com and download the linux version of xampp. That includes apache, mysql and php as well as ftp servers and mail servers. You can turn the ones you don't want off and just use the ones you like.

Follow the instructions on the apachefriends site and you will be off in no time at all.

I've just gone through the process of installing xampp myself and was suprised at how easy it was.

Alan

Re: Axis Dodgyness

August 23, 2008 by inksmithy

Just as a matter of interest blackmagic, and you may hate the answer, but I find using JAX-WS 2.1 (as provided with netbeans) to be the simplest way of managing java wsdl work. I tried Axis and I have to say, it gave me grief.

Re: What looks to be a decent hosting solution

August 23, 2008 by inksmithy

What is the speed and responsivenes like? I'm using servage at the moment for my general hosting and I'm finding they have something like 20 accounts per virtual machine, which drives me insane. I would seriously consider swapping to something like this if the speed was useful for low volume websites.

What looks to be a decent hosting solution

August 20, 2008 by inksmithy

I saw this while out and about and remembered people were talking about web hosting for their bots and so on, to try to increase ping times and be able to use their home connections as backups.

http://linuxvps.org/

Nothing flashy, but they look like they do a decent hosting service.

Re: regexes for parsing compressed strings

August 10, 2008 by inksmithy

Outstanding - regexes really are something I keep reminding myself I have to learn, but never seem to get around to. I think when I have finished my cisco course in October, I have until the next january with no study happening. I might sit myself down and get my head around it then.

Thanks again.

Re: regexes for parsing compressed strings

August 5, 2008 by inksmithy

Just had a bit of a break from stuff, needed to rethink how I was doing the mechanics of my little bot and just used this little snippet to decompress GMPC.

Using the Java version you wrote and it works like a dream. Have no idea what it is saying (except I know you need four backslashes in order to escape one in Java) but the rest of it has me boggled. If you fancy explaining it, I - and probably a few others who are unfamiliar with regexes - would greatly appreciate it. If not, then I will have to put it on the list of Things I Need To Understand and work it out myself. In any case, thanks heaps.

Re: Recognise anyone?

July 6, 2008 by inksmithy

That is so unbelievably true.

The scary thing is it would probably work!

Re: Historical Data

June 24, 2008 by inksmithy

Actually, scratch that - the betfair free version doesn't have the timestamp. Just forget I said anything.

Re: Historical Data

June 24, 2008 by inksmithy

There is also http://data.betfair.com/ which does have a timestamp in it apparantly. Need 100 betfair points to get it though.

Alan

Re: GetAllMarkets strangeness.

June 21, 2008 by inksmithy

Well something odd was happening - all of a sudden I'm now getting the results back the right way instead of using scientific notation - I would love to know what happened there, but using the free API, there isn't really a way to put them on the spot about it is there?


21054938~Match Odds~O~ACTIVE~1214073900000~\Soccer\Euro 2008\Quarter Finals\Fixtures 21 June\Netherlands v Russia~/1/4574657/19215516/19231797/19231798/21054938~0~1~CHE~1214063923283~3~1~5943866.86~N~Y

Re: GetAllMarkets strangeness.

June 19, 2008 by inksmithy

Minor update here:

I've just had a look at the string returned from the GetAllMarkets request re the GermanyPortugal game and there is indeed an oddity to it.

21052444~Match Odds~O~ACTIVE~1213901100000~\Soccer\Euro 2008\Quarter Finals\Fixtures 19 June\Portugal v Germany~/1/4574657/19215516/19221886/19221887/21052444~5~1~CHE~1213905271276~3~1~1.450023758E7~N~Y

According to the documentation, the third last field should be a double which equates to the total matched on the market. What the hell is 1.450023758E7 then?

I have a feeling it is scientific notation, meaning so much money has been matched that the double type can't keep up with it, although that would surprise me if it were so.

GetAllMarkets strangeness.

June 19, 2008 by inksmithy

Anyone having any problems getting Euro markets today?
I'm trying to call GetAllMarkets using the following code:

Date now = new Date();
long atm = System.currentTimeMillis();
long oneTwoFive = ((60 * 1000) * 125);
long gtm = atm - oneTwoFive;
now.setTime(gtm);
GregorianCalendar gToday = new GregorianCalendar();
gToday.setTime(now);

GregorianCalendar tomorrow = new GregorianCalendar();
tomorrow.setTime(now);
tomorrow.add(GregorianCalendar.DATE, 1);
DatatypeFactory df = DatatypeFactory.newInstance();
XMLGregorianCalendar xmlGToday = df.newXMLGregorianCalendar(gToday);
XMLGregorianCalendar xmlTomorrow = df.newXMLGregorianCalendar(tomorrow);
request.setFromDate(xmlGToday);
request.setToDate(xmlTomorrow);
APIRequestHeader theHeader = ExHeader.makeHeader();
request.setHeader(theHeader);
ArrayOfInt returnEvents = new ArrayOfInt();
returnEvents.getInt().add(1);
request.setEventTypeIds(returnEvents);
com.betfair.publicapi.types.exchange.v5.GetAllMarketsResp result = port.getAllMarkets(request);

and All I'm getting is a poxy Chile v Venezuala return. Whats more, for some reason it isn't going into the JTable the way it should. Now if I change the request.setFromDate() period to tomorrow and the request.setToDate() period to three days from now, I'm getting results which are doing what they are supposed to do, but for some bizarre reason, I can't seem to get the Germany/Portugal match.

I've tried setting the setEventTypeIds parameter to 14, but I'm still not getting that match. I don't understand whats happening and its driving me insane.

Re: Java

June 18, 2008 by inksmithy

birchy, I found something which covers most of what you have asked for there, but I'm a tad pickled at the moment. I'll find it again and write it up for you within the next couple of days.

Also busy at the moment playing with my new lcomputer which I bought for £20 at the markets. P4 2ghtz, I just stuck a gig of ram and a decent graphics card and kubuntu 8.04 on it, it is a dream. All up I've spent £40 on th damn thing, its unreal. My next step it to stick a web server on it, sort out iptables and expose it to the worl. Might look at writinng a jsp bot then.

Re: getCompleteMarketPricesCompressed

June 12, 2008 by inksmithy

Cheers bmsleight!

Re: getCompleteMarketPricesCompressed

June 11, 2008 by inksmithy

peteb, thanks heaps for that. I'll translate it into java at work tomorrow (I have one of those perfect jobs where I can pretty much do what I want) and I'll post the result here. Perhaps we could have another forum/topic for code snippets? If thats no good, I have lots of webspace and bandwidth, I could set up some space on there for stuff like that if people want it.

Alan

Re: getCompleteMarketPricesCompressed

June 10, 2008 by inksmithy

If you could please peteb I would seriously appreciate it. I'm having a bugger of a time with it.

cheers,

Alan

Re: getCompleteMarketPricesCompressed

June 10, 2008 by inksmithy

It does look very neat doesn't it?

I'm impressed.

peteb, thanks for that code, I'm such a newb at programming that I find it tricky to follow the logic of most other languages, but that looks close enough to Java that I can puzzle it out.

Re: getCompleteMarketPricesCompressed

June 9, 2008 by inksmithy

I'm actually trying to work with GMPC and thats the problem I'm getting.

bmsleight, thanks very much for that, I'm having a look at it now. Thanks heaps.

Re: getCompleteMarketPricesCompressed

June 9, 2008 by inksmithy

How do you deal with the string not returning data when the market is empty? This is whats driving me insane at the moment. I'm splitting GetMarketPricesReq forst at the "|" then each element after that at the "~", but the method just stops working if I have an empty or null string. I've tried some conditional stuff, but it just doesn't want to play. I'm sure its something I'm doing but I can't figure it out.

Re: Euro 2008

June 8, 2008 by inksmithy

Absolutely, its a good way of testing it out to get ready for the premiership.

Re: Platform / hosting / connectivity choices

June 6, 2008 by inksmithy

Dmn, thats a fantastic offer! I might end up moving my hosting over there.

Re: Java

June 4, 2008 by inksmithy

I know this was posted a long time ago birchy, but when we were chatting about our java bots I hadn't discovered how to use the Runnable interface with any flair at all. I have that on toast now and to be completely honest, I'm finding concurrency in java to be the best thing since sliced bread. It is just a matter of making each WS call implement Runnable and putting in a Thread.sleep(long milliseconds) call in. It really is that simple, I'll send you a look at the code if you like.

Alan

Re: Bot-Writing Experiences

June 3, 2008 by inksmithy

It might sound mad toy, but if you have an old computer sitting around, install a LAMPP (Linux, Apache, MySQL, PHP and Python) system onto it and run your bot from that. It sounds a hell of a lot more complicated than it really is and has the advantage that it costs zero to install and run as well as having the advantage of being able to run whatever you want on there without having to rely on your hosts. In addition, you will do a lot of learning along the way which is its own kind of fun.

This link gives you a decent little guide to doing it.

Alan

Re: Bot-Writing Experiences

June 2, 2008 by inksmithy

ahaha, its all good.

I completely understand the sentiment though. It doesn't matter how shiny the gui is, if the theory behind it isn't firm, it might as well be a plate of jelly for all the good it will do. I quite like that metaphor, I just made it up!

All a good GUI does is prove you can design a GUI.

Unfortunately for me, I got into computing quite late, in 1996 when I was just over 25 years old. Consequently, I never really had to learn how to deal with command lines and shells. I can now, because my eyes were opened to the unbelievable pile of poo which is Microsoft and I have pretty much boycotted them. Ironically, I'm typing this on my Vista laptop which shares its hard drive with a Kubuntu install. Unbelievably, the Open University decided to do a course on a platform independent programming language, then supplied the software needed to do the course only for Windows machines.

All this doesn't change the fact that when I think about writing a program, I generally think about how it looks first, then put the logic in later. Curse of a GUI driven computing upbringing perhaps.

For general waffle myrddin, it was a remarkably well aimed shot sir! Perhaps just call it a stray round.

Cheers and thanks for the welcome, looking forward to bouncing some ideas off you all. At the moment I'm struggling with parsing GetMarketPricesCompressed. The method I have works well when all the fields are full, but when there is no money in the market it all falls to pieces and I can't figure out why.

Alan

Re: Bot-Writing Experiences

June 1, 2008 by inksmithy

Just joined here and thought this is probably a decent thread to say hello in.

I started writing bots because I was doing a Java programming course at Open Uni and thought a bot would be a nice little personal project. As it turns out, it has been a hell of a learning experience. Just started placing my first real bets yesterday with the bot (done a lot of simulated bets) and so far everything seems to be going pretty swimmingly. I post on the bdp forums as thenakeytaxidriver and very occasionally in the soccer forums at betfair as ThanksFish.

Now into the 15th or 16th evolution of my bot - amazing how many times a rewrite is necessary - and I think I have it down to nice object oriented, gui driven code. Nice to see a decent forum out here about this - I was going a bit silly thinking the forums at bdp.betfair were all that was out there.

Alan

Login to an existing account

Welcome back!
Want to register? click here

Create an account

in only 3 steps!
already registered?