web service that can take a code snppet and test it - language-agnostic

I am looking to build an educational web service where the end user can type up the code in some language (say Java or python) for a given problem and the service should be able to tell if the code compiles and show output of the code for a few test cases. I am trying to get an idea from the community about a) if something like this exists b) how to build it.
Obviously this service will support a very limited subset of the language for security reasons. It would be cool to be able to do majority of this on the client side, but I'd be happy with doing this on the server side as well.
Are there any such frameworks that I can use for creating a sandbox environment?
Is there any particular language for which it would be particularly easier?

Check out iDeone API.
What is ideone?
Ideone is something
more than a pastebin; it's an online
compiler and debugging tool which
allows to compile and run code online
in more than 40 programming languages.

Related

Delphi - Websockets and uniGUI

I am really a beginner in delphi, as the client request the project to be done in delphi, so I have to ask to get some help as possible as I can. This project will be involved in HTML5 and websockets as well, so there are some questions I need your advices.
Sorry let me explain more, this application have two parts mainly, one is HTML5 client web app (this app will be loaded from web server, and run locally in browser), and the other is its service located in server. The HTML5 web app is doing some product editing job, as well send its final output to server, during this process, there will be many communications between client app and service, and I planed to use Websockets.
I did plan this application in HTML5 and Node.js before, but as client send request to ask for the Delphi XE as primary development tool also it will be compiled to DLL (ISAPI, have to be) at last. For consistency of UI, I also was required to use uniGUI (http://www.unigui.com/demo)for Delphi. Now I have these questions:
Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
What good libraries support Websockets in Delphi?
What book you can recommend me to read, as I don't know Delphi at all.
Thanks.
1: yes, make a "single page app" (static html + js) and communicate with server using xml or json.
At least with indy 10 it is quite straight forward to implement static file serving (response.contentstream := tfilestream.create(sfilename) or something like that)
2: yes, if you search for it on google you will find some :)
WebSocket server implementations for Delphi
btw, I'm busy with delphi socket.io implementation, which makes it easier to use websockets instead of plain low level tcp-like websockets itself
Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
First concept : HTML5 applications are a bunch of HTML files and JS's wich can be processed by browsers.
Second concept : You need an application that can bind HTTP queries and return files from the first concept.
Third concept (paradigm) : With first two concepts, a third concept arises. Dynamic HTML. What is dynamic HTML? HTML that generates at runtime at the backend server and/or at frontend with JS.
Solution :
Yes, with Delphi as a backend server you can manipulate and return HTML5 views, if you know (MVC paradigmn for example) you can program an HTTPServer application that binds HTTP request from network and responses your HTMLs and JS.
What good libraries support Websockets in Delphi?
You need a multilayer library. The best library I know is mORMot. mORMot is like a swiss razor for Object Pascal.
You can create an HTTP server with websocket published interfaces. mORMot's Site
What book you can recommend me to read, as I don't know Delphi at all.
I have more than 10 years with Delphi and Free Pascal and I didn't read a book at all. But I read a lot from internet and a lot of computer architecture and another languages like C and C++.
If you like Delphi there are tons of documentation via Internet. I cannot recomend you a book because I will lie you.

Need help regarding CGI scripting with C

I need to process some of files stored on the server side and display the list of files on a web page in a browser. My server is set-up on an arm-processor and it is mini(thttpd). And only support CGI script(with C) as far as I know.
So I am asking, whether with this current set-up, can I process file system on server side and display details(like file names) on a web page upon browser interaction by just plain CGI scripting using C??? I was unable to find convincing tutorials regarding this on CGI. And installing any other components on server will be difficult as it needs to be cross-compiled against arm-platform and the also system being embedded(low on memory). I am a total newbie to this scripting. So please forgive me if you found this post silly or stupid.
And also it would be nice if you help me find some good scripting tutorials.
Check out my dusty old Getting Started with CGI Programming in C. It might be difficult to find good new material on the topic these days, as most people do server-side programming with other, better tools. But things like you describe would be possible. The main concern would be security, especially if you would allow the user to delete or modify files on the server.

BMC Remedy Integration

Where can I find a list of BMC Remedy 3rd party integrations? I have found nothing on their website, and their sales department put me in touch with the customer services which wouldn't take my call because I didn't have a customer number.
My company is looking into using BMC Remedy as a customer incident system, and it would be nice if I could integrate it with some software. For example, we could have an internal development tracking system such as Jira, Redmine, MantisBT, Trak, etc. which would integrate with Remedy. Or, have Rememdy itself integrate with something like Hudson or CruiseControl.
So far, I've found nothing that seems to integrate with Remedy -- even with software packages that have a ton of integrations like Hudson and Jira. I don't really care if there are third party proprietary integrations, but I'd like to make sure they already exist and not All you have to do is hire someone at $400 to program everything for you. I want to make sure that there is something now and not be promised it can be done, then find out you really can't do it.
I may be a bit late to the party here, but I wanted to make this info available for anybody who happened to be searching for this answer in the future. BMC Remedy has an API in Java, which uses a native library in C, as well as bindings for Perl and other languages capable of calling native code. If you can integrate with any of those languages, you can write a custom integration program and integrate with that. As 'Gary L' mentioned, Remedy can also expose any form as a web service, which, in my experience, have simple interfaces.
Since the original question was asked, BMC have created a doc with a wealth of information on their Wiki. A Swedish company, RRR, has also collected every version of the Remedy Java API and required native libraries on a single page. It appear that you no longer need a support ID to access these pages and download the API files.
Hopefully somebody finds this helpful!
Your definition of "integrate" is different from their version. Their version of integration means that if a source system exposes its data, then you can configure ARS to retrieve that information and map it to classes (forms) within their system. They have a "generic" integration system that you have to customize. It has three broad areas:
If you can connect directly to a 3rd party database and see its schema, then you can perform
retrievals of that information. We use Oracle today.
They have a java API that allows you access the ARS system for custom code (I do a lot of this).
Flat CSV file importation of data from a source system into ARS (after export).
I looked at their online support for the systems you mention (Jira, Redmine, MantisBT, Trak) and do not see anything that would accomplish any of the three above without your own customizations. With the work that I've done on this system it doesn't surprise me.
I work on a project today that writes custom code doing the items above. It is a system that is configuration/development heavy for us. Your comment: "All you have to do is hire someone at $400 to program everything for you." is not too far off from what we have to do with the system.
There is another option for Remedy integration: Web Services.
BMC Remedy makes it easy to create web services (WSDL). It creates the SOAP and XML for you. When you buy Remedy Incident Management module, it includes out-of-the-box web services that will allow it to consume and/or publish web services which make it easy to integrate with other systems on the intranet or externally. There are BMC publications which provide details on ITSM integration --- but again you will need a customer/support ID to get it from BMC's website.
Yes and no to the Web Services integration. The Version 8 system I was working on had some web services available, and they were incomplete. So I was able to do a number of functions (mostly read-only), specifically for custom display and Change Request checking, and submission of a Change Request and a Work Order. But many functions had no web service, and I ended up brute-forcing through the web user interface (with a customized browser control) to change dates on tasks, or make tasks. Ugly, but effective. There are mid-tier JavaScript calls that can be used, if you know the secret function name and can deal with the dynamic naming convention in play. For Remedy users who are desperate for some integration, there are ways it can be done.
few OOTB integrations are possible with BMC Products but if you want to do it with other you have to write webservices(REST or SOAP)
Companies like IBM or cisco has made connectors for integration with Remedy.
Just adding more detail here:
I also do a ton of direct SQL for remedy integration.
If you're careful and know what you're doing, you can have a stored proc create legal/valid records in a remedy table. (If you do it wrong, the records won't load in the client and in older versions of the windows client can actually crash the client software.)

fastest public web app framework for quick DB apps?

I'd like to pick up a new tech for my toolbox - something for rapid prototyping of web apps. Brief requirements:
public access (not hosted on my machine) - like Google's appengine, etc
no tricky configuration necessary to build a simple web app host
DB access (small storage provided) including some kind of SQLish query language
easy front end HTML templating
ability to access as a JSON service
C# or Java,PHP or Python - or a fun new language to learn is OK
free!
An example app, very simple: render an AJAXy editable (add/delete/edit/drag) list of rich-data list items via some template language, so I can quickly mock up a UI for a client. ie. I can do most of the work client-side, but need convenient back end to handle the permanent storage. (In fact I suppose it doesn't even need HTML templating if I can directly access a DB via AJAX calls.)
I realize this is a bit vague but am wondering if anyone has recommendations. A Rails host might be best for this (but probably not free) or maybe App Engine, or some other choice I'm not aware of? I've been doing everything with heavyweight servers (ASP.NET etc) for so long that I'm just not up on the latest...
Thanks - I'll follow up on comments if this isn't clear enough :)
C# or Java,PHP or Python - or a fun new language to learn is OK
How 'bout Javascript? This place hosts server-side Javascript ticking most of your other boxes. So you can use the same language for client- and server-side stuff (which I find very handy). [Caveat: I only played with their service; seemed cool though. I use Javascript on the server-side on IIS and on Tomcat (via Rhino).]
For something bleeding edge - A new version of spring roo was released recently. With it you can create a great web app in 10 minutes. Supports GAE and GWT...
http://www.springsource.org/roo
xataface is a quick way to make a front end for a MySQL database.
It makes it easy to start an app quickly with dynamically created views and then you can change it to something very customized to your needs.
It simply needs a server service with MySQL and PHP.

Language for web site development C++ or php?

I want to develop a forum like web site. I know C, C++ well but I havent used in web development.I know PHP little bit. Which language should i use?
C++ can and has been used to successfully develop highly scalable web applications. That said, one of the main reasons C++ is not so popular in this category is to do with the lack of standard tools and libraries. There is simply no feature rich library which includes all the necessary boiler-plate code needed to write web applications.
PHP is everything that C++ isn't when it comes to web development - a high-level scripting language designed mainly for web development. The description of PHP on the homepage sums it up nicely:
PHP is a widely-used general-purpose
scripting language that is especially
suited for Web development and can be
embedded into HTML.
If you're developing a simple forum, this decision is a no-brainer: PHP. In addition to the obvious advantages to using it, you'll find the syntax familiar as it is C-like. However, if you have all the time in the world, you're feeling brave and this is for hobbies' sake, do it with C++!
Out of those, for web development, PHP for sure.
C and C++ is not the correct choice to develop for web, so if you know PHP it's better.
also you can try python, ASP.net etc...
To add most hosting does not support c++ and they will not in most case so if you were me I will go for PHP and almost(nearly) all hosting service support it.
Also the lack of function for web development in c++ is also a pull down.
Actually, I wonder why you're not considering to use both! Use PHP for the web interface and write special C++ methods for the more complex actions that you want to take. (Although PHP can handle most of those too.) Basically, this would require less knowledge of PHP and your C++ knowledge stays usable.
Do keep in mind the hosting restrictions of your webhost, unless you're going to host your site on your own system.
Also, do realize that the use of C++ for web development would restrict you to the more general C++ libraries. C++ can be used to write platform-independent code, just like PHP. But not all libraries are supported on every platform.
Finally, PHP already is a powerful language and there are plenty of add-ins for PHP that you can re-use instead of writing it yourself. Still, most of PHP and all the add-ins are written in C++, even though many people just forget about the fact that the code behind PHP had to be written in some language too. Image manipulation, encryption, complex math, etc... It's all been done before for PHP. But it should not stop you from writing your own extensions...
PHP, Python, ASP, JSP, C#.net all should work
C++ is not commonly used for this purpose. Most shared hosting providers won't allow you to run native executables created by C++ for reasons of security (though I suspect this would be manageable with fine-tuned rights) and portability (eg. you'd have to know which OS the shared hoster's webserver runs on and possibly install additional libraries).
Even if you have your own dedicated server with root access, it might still be difficult to properly integrate an executable as CGI into Apache or IIS.
If you're not bound to PHP or C/C++ for some other reason, you could also try C#. Picking up C# from C++ is very easy and ASP.NET allows you to write your complete website in C#. With ASP.NET MVC, you even have an MVC framework comparable in productivity to Ruby on rails. Many shared hosting providers support ASP.NET and through Mono, it's even possible to host ASP.NET web sites in Linux (I'm doing this with my blog ;-))