Which programming language is for me?

Posted on 2006-11-07
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.
Question by:hasinque
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 17890076
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.
LVL 19

Expert Comment

ID: 17890278
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?)
LVL 19

Expert Comment

ID: 17890286
(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.)
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI


Author Comment

ID: 17891430
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...
LVL 19

Expert Comment

ID: 17891454
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?

Author Comment

ID: 17891979
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?
LVL 19

Accepted Solution

VoteyDisciple earned 250 total points
ID: 17892228
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.

Expert Comment

ID: 17892840
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.

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.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Six Sigma Control Plans

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question