Solved

Which programming language is for me?

Posted on 2006-11-07
8
288 Views
Last Modified: 2010-04-16
Hello!

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.
0
Comment
Question by:hasinque
8 Comments
 
LVL 6

Expert Comment

by:_iskywalker_
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.
0
 
LVL 19

Expert Comment

by:VoteyDisciple
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?)
0
 
LVL 19

Expert Comment

by:VoteyDisciple
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.)
0
 

Author Comment

by:hasinque
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...
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 19

Expert Comment

by:VoteyDisciple
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?
0
 

Author Comment

by:hasinque
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?
0
 
LVL 19

Accepted Solution

by:
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.
0
 
LVL 9

Expert Comment

by:alkisg
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.

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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now