DVD Talk Forum

DVD Talk Forum (https://forum.dvdtalk.com/)
-   Tech Talk (https://forum.dvdtalk.com/tech-talk-10/)
-   -   What programming language to use? (https://forum.dvdtalk.com/tech-talk/531385-what-programming-language-use.html)

Mordred 05-12-08 12:37 PM

What programming language to use?
 
Without getting too specific or technical I'm looking for some help on what programming language/method for some web development.

I've got a rather large MySQL database. At pre-scheduled times I need to run some queries and then run some rather involved simulations on the data, before writing it back to the database. These simulations will occur without a user having to load a webpage and more than one may take place simultaneously (although never using the same records to seed the simulation).

Coming from a C and PHP background, what languages/methods should I look into? None of these servers are local so everything has to be doable through a web interface. I don't even know if/how you could schedule chron jobs to run this code.

If you have any ideas/recommendations, I'd love to hear them.

Raul3 05-13-08 05:46 PM

In windows you can use VB script to create some .bat files that could be run by the windows scheduler.
I have something like that. Those .bat files run a webpage every day in the morning.

The main component, i.e. the most important tool, there is httprequester, a script I found to run webpages from the windows shell.
If you google httprequester you'll find that there are a lot of versions of that script/tool in different languages, java, vbs, etc.

Mordred 05-13-08 07:46 PM

The thing is, all of this is going to be run in a Unix environment, on a machine I don't control.

Right now, it looks like my best bet is to just set up some PHP code to add some info to a "schedule" table in my DB and then use a chron jobs which query that table every 5-10 minutes looking for entries and then spawning off the simulation.

I still don't know what exactly to code the simulation in so that it can run like this. It'll be slow, but I could probably write it in PHP. I really don't know any other way to write stand alone code that can access my database and run like this. I'm still pretty new when it comes to trying to get crap done in a Unix environment.

GHackmann 05-13-08 08:15 PM

Could you clarify what you mean by "everything has to be doable through a web interface"? Do you mean that the script's execution should be controllable through a Web front-end? Or that the script itself can only access the database by screen-scraping a remote Web site?

For a research project I just finished up, I used Python in combination with psycopg2 and SciPy to access the database and do the number-crunching respectively. Neither pure Python nor PHP is going to set any land-speed records, so I strongly recommend against using either of them for complex simulations. SciPy helps a lot (it does all the heavy lifting in C), but you're probably not going to match C/C++ or Java for raw speed without a lot of tweaking.

Java's another way to go, if your host supports it. It's gotten very fast at number-crunching in recent releases (sometimes even outperforming C code, since the JIT can do additional optimizations at runtime) and its database support via JDBC is also very good. The downside is that the VM startup time is still poor even in Java 6.0, so it's not suited for short-lived simulations.


All times are GMT -5. The time now is 06:52 AM.


Copyright 2021 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.