We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Which programming language is for me?

hasinque asked
Medium Priority
Last Modified: 2010-04-16

I plan to program something for my poker hobby. I play poker on internet, and the games of poker are logged into a text file. I want to be able to read from those text files, process the information and store it in database (probably access or mysql). Later on I want to access this information that I store in the database by writing queries.

So which language is for me, given that it has to have lowest learning curve and plenty of books and code snippets available:
- acess text files and windows from other programs where text is written in real time
- process text
- store info in DB
- retrieve info with preset queries and display it

Thanks in advance.
Watch Question

well, almost every language can do it, but maybe you would like to use something which has a webserver:
you get apache with php.
you create a php page which reads your file, connects to the database, put the file in the database, retrieve all information and display it.
so the displaying is pretty easy then, the connection to databases is more easier (lots of tutorials), only the mysql code you must think a little.
PHP probably best fits your criteria.

1.  It's easier to learn than most languages (no obscure typing rules or anything like that -- at least not at first (-; )
2.  It's insanely easy to connect to and query a MySQL database
3.  The file() function is the most convenient way of accessing log-like files I've used (it has drawbacks, but it's really easy to use)
4.  The PHP manual is an awesome source of information (unlike documentation from, say, Microsoft, which really needs to be supplemented with ten thousand other websites by individual users).  You may find you don't even need to find any books.
5.  You're already talking about an online hobby, so, heck, keep your database online too.  (-:

(Oh, and... 6. It's free.  Who doesn't like free stuff?)
(I guess I should retract 6 to an extent.  Java, of course, is free too, but so is .NET now in its Express versions, so I shouldn't stress that particular "feature" too much, I guess.)


Wait, I already have some knowledge of PHP. That would really be cool.

But has anyone of you played poker online? It goes like this, you open a client window and it connects to the poker server and you start to play. In the little chatwindow you can see the text scrolling of what players have done, as a reference... There is also a textfile stored in the program files/poker site/ folder locally on the C: drive...

Now I load a webpage say mypage.php which can process text, store it in the database and then show the information. BUT CAN PHP ACCESS TEXTFILE LOCALLY OR ACCESS A WINDOW OF A NONBROWSER APPLICATION AND PROCESS THE TEXT? And I do not mean access a window 1 time per hour. probably more like real time.

This is the only thing the bothers me...
Running PHP from the command line you MIGHT be able to get somewhere with that, but running PHP the "normal" way (in a browser) you're definitely cut off from seeing what's going on in another application.  You'd have to have some way of getting information from that app into a place PHP can see it.  If that's not practical, then perhaps this isn't the proper path to take after all.

What exactly do you want to get from this other window?


How much an opponent bet. What cards he had. There is myriad of things I need from that window that is updated every .1 second with new text.

What would be an alternative then? Visual Basic?
I guess my question is: what kind of window is it, and how do you plan to extract the information?  Will you have to take a screenshot and figure it out "the hard way" or is there some other mechanism you might use that a program running locally could exploit more easily than a web script?

VB .NET (or C# .NET) would certainly be an alternative; probably for ease of learning VB .NET is the next rung down from a language like PHP and still a bit easier to handle than Java (though once you know one you'll have the sudden striking realization that VB .NET is just Java with different names for some things and infinitely less platform portability -- but I digress).  

It sounds like this one bit of interaction between the other application and your program is the key factor that would determine what environment you use.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

So the key features are extracting data from a browser window WHILE YOU ARE PLAYING and saving it locally.
I'm assuming that the data in the play window is in HTML format. If not (e.g. if it is in flash or Java), you'll need the respective languages.

PHP: difficult to manipulate external browser => I'd say no.
VB(.NET), C#: you could do it, but it'll be a little difficult. You'll either need to manipulate an external browser, or embed a web browser control.

I propose Javascript:
You'll need to lower your security settings for the specific site you're playing at, so that javascript will have the necessary security privileges to access the disk and to run externals programs (to call microsoft access or mysql).
You can access the browser data through DOM, which is relatively easy.
You can access the file system with FileSystemObject (also easy).

To run your javascript code in the foreign site, you'll either need
1) a bookmarklet,
2) an .HTA application (HTML + Javascript),
3) or a frame, but with modified permissions to overcome cross-domain scripting security policy settings.

See http://www.bookmarklets.com/tools/data/index.phtml
to get an idea on what bookmarklets can do.
Your script will be bigger than 500 chars, so you won't be able to run it as a bookmarklet on IE (it has a 500 chars limitations), only on Mozilla. If you don't want this, use .hta's or frames.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.