[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] cspsol webapp

From: David Curran
Subject: Re: [Help-glpk] cspsol webapp
Date: Tue, 29 Oct 2013 16:41:02 +0000

Thank you Marc, Vijay and Joao for all your help. 

I might use a simple version of the code in the initial version and then iterate to a more efficient version if the prototype proves popular. I will send the github location as soon as I have a basic version done

On 29 October 2013 16:37, Vijay Patil <address@hidden> wrote:
Hi David

As Joao pointed, seems to be good example of what you are trying to do with cspsol. My web development skills are not very good, so I do not have direct answer for you, but I tried to find out internal details of above URL using browser tools.

It looks like PHP ("solve.php") is used to execute the C/C++ program and _javascript_ is used to manage input and output between webpage and the C++ programs, following is the some code segment:

$.post("solve.php", { "instance": inst }).done(function(data) {
        Pid = parseInt(data);
        if(Pid == -1){
            msgpopup("Please try again later.", false);
            $('#logcontent').val("The server is busy. Please try again later.");
        }else if(Pid == -2){
            Pid = -1;
            msgpopup("Please try again later.", false);            
            $('#logcontent').val("You've reached your submission limit. Please wait and try again later.");

Standard way of executing a C++ program on webserver is CGI. All the best for hackathon and do post about your GLPK project.

On Sun, Oct 27, 2013 at 6:45 PM, David Curran <address@hidden> wrote:
I think it would be fun to turn cspsol into an easy to use web app.
cspsol: Simple Cutting Stock Problem Solver Using GLPK API

I plan to do this at the #hack4good hackday in Dublin on Tuesday

Do you have any advise on how to do this? What do you think is the best way to integrate cspsol with a web server? I presume the advise will hold for other programs based on GLPK.

One obvious way is to use the standard web programming languages to turn user input into the format cspsol wants. Then get php (or ruby or python) make a system call to run cspsol. And then to parse the results to a format that can be easily understood by the user.

Is this how you would create a web app like this?
   Thanks for the help

Help-glpk mailing list

Vijay Patil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]