Image Image Image




Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 4:22 pm 
Offline
Senior member
User avatar

Posts: 360
Favourite Bot: Zander
PolarBear wrote:
I wouldn't call a market share of about 1% quite common (BTW we need an emoticon of guy with a flame thrower just for occasions like this ;)

This is for your flame thrower guy: :piss

Is 1% an official and recent figure? That seems way off but might be correct. I know a lot of none-geeky pc users who have switched to Linux and over 20% of visitors to my website are linux users, although i DO have some linux related content. I could argue that we are ALL linux users because the vast majority of web servers are run on linux boxes and without them the WWW would be a lot less reliable. But yes, you are correct, Windows has the biggest market share, although that only indicates who has the biggest advertising budget and not the quality of the product. When all is said and done, i prefer Linux, some prefer Windows, some prefer Mac. Just like some prefer Java, some prefer C++, some prefer .Net, some prefer Python, some prefer Perl, etc, etc, etc. It's all down to personal choice and without that freedom, it would be such a boring world.

_________________
http://www.bespokebots.com


Top
 Profile  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 5:16 pm 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
I managed to start a language war AND an operating system war in the same thread.

I should be banned for life from this forum :)

Ok now guys... Intel or AMD? ATI or NVIDIA?

I think this topic should be closed... if there is to be an interesting discussion about botting under Linux, it'll have to be under strict supervision I guess.


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 5:39 pm 
Offline
Senior member
User avatar

Posts: 360
Favourite Bot: Zander
sob wrote:
I managed to start a language war AND an operating system war in the same thread.

You're a superstar! ha ha

sob wrote:
Ok now guys... Intel or AMD? ATI or NVIDIA?

F*** off! :)

sob wrote:
if there is to be an interesting discussion about botting under Linux, it'll have to be under strict supervision I guess.

Yes, we don't want anyone making bold statements along the lines of "linux is crap" when they've never actually used it. ;)

_________________
http://www.bespokebots.com


Top
 Profile  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 6:20 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
sob wrote:
Intel or AMD? ATI or NVIDIA?

Intel obv. Soon to be the answer for both questions :)

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 6:53 pm 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
Btw Indiana, you still haven't run C vs Java on your machine... or are you afraid to share the results? :o


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 8:10 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
The java stuff finished for 80 seconds, and for 90 seconds in VMWare.

I compiled the C++ piece with MinGW for windows. It runs extremely slow (I waited it to finish for 5 minutes, and it didn't). It's not hanging, because the first two cycles finish, it's just extremely slow at the last cycle (the one 1024x1024x4096).

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 8:48 pm 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
Actually there's a portion of the code that you need to change on both:

Code:
for (j=0;j<SIZEA;j++) {
                        cor[i][j]=0;
                        for(k=0;k<SIZEB;k++) {
                                cor[i][j]+=mat[i][k]*mat[j][k];
                        }
                        cor[i][j]/=SIZEB*sqrt(var[i]*var[j]);
                }


=> the execution will be much faster
=> it's avoiding unnecessary calculations (not that we care here, but one compiler might have optimized that and not the other)

also, when compiling your C code, make sure you have the following optimizations or their equivalent (:
-lm -O3 -mfpmath=sse -msse2 -ffast-math -mtune=native

using those flags I find Java to be almost twice as slow as C (+95%)


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 9:09 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
Well in my case Java finishes for 90 seconds, C++ dosn't finish for 500 seconds.
So C++ is at least 5 times slower than Java out of the box with MinGW (maybe the most popular compiler out there beside VC).

With all of these options the C++ worked twice faster than Java on my side too.

The new fragment didn't work. What is "i" before execution of it, and then you have overflow.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 9:18 pm 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
I resent the whole C code by PM (you can copy paste to Java, just remember to add the Math.*).
Both execution times should be much faster.

I'm curious, how to measure speed?

(As in my case, if I take a watch and look at it, Java beats C by a few seconds, as the JVM seems to be using 2 cores, or at least HT on 1 core)

Also, what is your CPU? Which sizes do you use for SIZEA and SIZEB?


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 9:22 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
The default 1024/4096.

I tested mostly in VMware, so 1 CPU.

I wouldn't get further into measurements, too many things in my todo list.

To measure the time for Java I used System.currentTimeMillis();, for C I used time_t msec = time(NULL) * 1000;

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 9:33 pm 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
You're right, there are more important things to do.

And we've established C is faster, so we can close the topic :p



WAR IS OVER!


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 9:50 pm 
Offline
PokerAI fellow
User avatar

Posts: 7731
Favourite Bot: V12
sob wrote:
And we've established C is faster, so we can close the topic :p


We've estabished that in certain situations C is x2 faster than Java, and in others Java is x10 faster than C. :)
And there is no need to establish anything over there, there is enough you can google on these topics :)

And for me performance in these ranges wouldn't even cotnribute to my decision on what language to use.

_________________
indiana


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Thu Sep 24, 2009 11:17 pm 
Offline
PokerAI fellow
User avatar

Posts: 1239
Favourite Bot: my bot
@sob Does the C++ use array indexing a[i++] or pointers *p++ ? Is the array indexing bounds checked?


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Fri Sep 25, 2009 12:44 am 
Offline
Senior member
User avatar

Posts: 120
Favourite Bot: mine, in writing
pure C
array indexing
unchecked


Top
 Profile E-mail  
 
 Post subject: Re: Yet Another Language War
PostPosted: Fri Sep 25, 2009 12:12 pm 
Offline
Senior member
User avatar

Posts: 458
Location: Now in the mighty PolarBoar variant!
Favourite Bot: ...
birchy wrote:
PolarBear wrote:
I wouldn't call a market share of about 1% quite common (BTW we need an emoticon of guy with a flame thrower just for occasions like this ;)

This is for your flame thrower guy: :piss

Is 1% an official and recent figure? That seems way off but might be correct. I know a lot of none-geeky pc users who have switched to Linux and over 20% of visitors to my website are linux users, although i DO have some linux related content. I could argue that we are ALL linux users because the vast majority of web servers are run on linux boxes and without them the WWW would be a lot less reliable. But yes, you are correct, Windows has the biggest market share, although that only indicates who has the biggest advertising budget and not the quality of the product. When all is said and done, i prefer Linux, some prefer Windows, some prefer Mac. Just like some prefer Java, some prefer C++, some prefer .Net, some prefer Python, some prefer Perl, etc, etc, etc. It's all down to personal choice and without that freedom, it would be such a boring world.


Sure, I wasn't speaking of system quality, I only pointed out that linux is still quite rare on desktop systems, relax :) I don't want to go into discussion of one system being 'better' than another.

I don't thing there is something as 'official data'. From what I've read recently (random stuff linked on slashdot etc.), the Linux market share is about 1%. Remember that big part of desktop market are corporate PC, and using Linux there is even less common than Linux in home environment. Barring some government institutions, I haven't really heard of a large organisation converting to Linux desktops.


Top
 Profile  
 
 Post subject: Programing language c++, c#, java?
PostPosted: Sun Jan 31, 2010 5:14 pm 
Offline
New member
User avatar

Posts: 2
Favourite Bot: none
First off, hi to everyone, new here :)

Having played casualy at Pokerstars for the fun of it mostly, for a couple of years now, i had this idea from the beginning to make a bot for it. I wasnt sure to what extend this was possible. I remember browsing the web then, and getting very little on bots. Mostly for other games and none for games that involved real money.

I put it all on the backburner until a couple of days ago i stubbled on http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot. That was one sleepless night of shuffling throught the articles and comments and adding bookmarks of all sorts...one of which led me here.

Apart from greeting everyone, what i would like to ask is about the programming language to work on.

I have a good grasp of c as i have worked on it for a few years in the past and have resently got Visual Studio Express and worked a bit using c#. I am not afraid of getting into c++. Java i have no experience whatsoever with, but i should hope its not difficult to pick up.

Overall there seem to be 2 main avenues of getting the information out of a poker table, hooking/injecting and OCR. It seems this is where it matters most what language the bot is written in, i.e. what is possible to do and what is not, but is this true?

For example someone posted a proofofconcept.jar file as a comment on James article in coddingthewheel:
"Wow, he's right it's actually possible - quickly made this (it's nothing close to being fully automated - just proof of concept - tested with poker stars). It will read the value of the cards, and tell you what cards you have - that's it - it's proof of concept, not intended to defraud or anything. Did it in java, requires JBorland to compile or whatever - I don't support this code - use as you want.

rapidshare.com/.../...s-botcode-proofofconcept.zip

Again you have a long way to go before you can use that code to try and defraud, just proof-of-concept to test around with."


Also another one i found led me to http://www.codeplex.com/easyhook which can be called from c# ?. Does this work or is it limited in some way?

And then there is floribus http://www.floribus.com/howto.html .Now looking through the code there it seems there is even assembly written at some point during the injection process. Is this standard?
Maybe i missed it in coddingthewheel or it wasnt posted.

Tbh I havent read all the comments from James's atricles and i sure havent browsed enough here (jumped right in!)

I did find myself wondering though.Does it make a difference which language is used i.e. if the bot is written in c++ or c# or java as to whether it is possible to work both on hooking/injecting and ocr? If it is possible to do it with c# through easyhook are there any serious performance issues?

I know i have a long way ahead of me, and i suspect the answer would be to get into c++, which is fine, but i have to ask, obviously some if not most of you here being light years ahead of me might know for sure.

Also, am i ok to stay with the Visula Studio Express version (if i stick with c++ and/or c#) or should i try and get hold of the standard (or even proffesional) version? I hope its not needed to have the prof version coz its definately out of my reach atm , apart from getting the trial for 3 months

obviously accept my apologies if any of these topics has been covered allready and feel free to redirect.


Top
 Profile E-mail  
 
 Post subject: Re: Beginners woes - programing language c++, c#, java?
PostPosted: Sun Jan 31, 2010 7:25 pm 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
Language of choice for botting is a long time standing debate.

C++, Java and C# are all good botting languages each with pro and cons.

That's my 2 cents:

C++
pros:
- code may be hardcore optimized to enhance performance of intensive algorithms
- plenty of poker libraries in C++ (i.e. PokerEval)
- easy integration with some tools (i.e. OpenHoldem for scraping)

cons:
- hard and usually less productive of other languages, especially when hardcore optimization are concerned

Java
pros:
- plenty of poker libraries (i.e. evaluator in the proper thread, meerkat API)
- easy integration with some tools (i.e. PokerAcademy for testing)
- easier to work with

cons:
- no hardcore optimization is available for intensive algorithms

C#
pros:
- easier to work with
cons:
- no hardcore optimization is available for intensive algorithms

I'm not really sure if there are good poker libraries for C#, i don't know many.
Mostly, performance issues about Java/C# interpreter against compiled C++ may be ignored, C++ shows it's best only when hardcore optimization are done, else performances are about equal and the difference is not significant.
Hardcore optimization are not needed for the most part, they may become useful if you really want to make a lot of computation in your algorithm and you are already good at it (not just proficient with C++, but proficient with hardcore optimization, which is a different matter).

Recap. I would say Java is a good choice if you want your life to be simple, C++ is a good choice, too, but only if you are already good at it. C# may be used instead of Java but only if you have no knowledge of Java but have some knowledge of C#.
If you don't know C++, better to stay away from it. If you don't know Java but know C#, go for C#. If you start from scratch go for Java. If you are a C++ master feel free to choose C++, you will enjoy the incresed control on performance tuning.

I currently use Java for my core intelligence, before i used some C++, too, but switched because i felt i was less productive.
I'm fluent with both C++ and Java but feel better when using Java, lately, as i spend more time on it, overall.


Top
 Profile E-mail  
 
 Post subject: Re: Beginners woes - programing language c++, c#, java?
PostPosted: Sun Jan 31, 2010 10:35 pm 
Offline
New member
User avatar

Posts: 2
Favourite Bot: none
thank you Ockham.

Hardcore optimisation..iirc thast the bit where you go through he program and try to figure out ways to make it run faster, like redundant use of variables and operations inside loops etc. I suspect it goes beyond that..
[btw while trying to make sure of what you meant by hardcore optimisation googling it i run accross this:
http://catb.org/jargon/html/story-of-mel.html - amasing bit of folklore ]

I have looked into c# a bit, through (VS08 xpress edition - btw do i need to get the standard or professional version- anyone know?) and it seems ok, although looking at java code bits they seem simpler/easier. I am not that far into using c#, and might just look into geting the Java sdk and Eclipse (i read its a good editor) and give it a go.

Thx for the info on poker libraries and tools, i will look into those. Decisions decisons.. i guess that the way it goes in the beginning ..lots of research :)

ty


Top
 Profile E-mail  
 
 Post subject: Re: Beginners woes - programing language c++, c#, java?
PostPosted: Mon Feb 01, 2010 12:29 am 
Offline
Senior member
User avatar

Posts: 451
Favourite Bot: gimmick
:xx04
The link is definately hardcore, but i would call hardcore much less than that.
:lol:

Things like PokerEval libraries to make an example. The lib is nice to use but a pain in the ass to understand.
Most of the times you are ok with just smart design (i.e. using the right structures for your data, avoid doing useless things, create lookups for the most important stuff), it's quite rare you actually need to do low level optimization.

If you are a beginner with C#, too, i recommend Java.
Many resources available in Java, Eclipse is a wonderful editor completely free and C# has absolutely no advantages over Java on this matter (i would use C# against Java only for applications intensive on graphical interfaces which is not the case).


Top
 Profile E-mail  
 
 Post subject: Re: Write his own bot in java: Existing framework ?
PostPosted: Tue Feb 02, 2010 12:48 am 
Offline
Senior member
User avatar

Posts: 356
Favourite Bot: OpenHoldem
indiana wrote:
Well this wasn't a general language statement. There are still applications for which C++ if better over Java and C#, but it's definetly not better for developing bots.


Why is Java better?


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: