Best portable method to implement an algorithm on Website - language-agnostic

I came across this problem,I have got an algorithm that I need to implement on websites.
The server side scripts may differ and it can be PHP,ASP.NET etc.
All I need to do to is to deliver the binary(I need it as I dont want this security algorithm to be open and viewable) that can comply by every type.As per me solution can be (Please correct me if I am wrong):-
Implementing binary according to OS.
Implementing Algo as per every type of script.(Tough and less portable)
Please suggest if there is other way round or please close this question and redirect me to any earlier question asked for this situation.I am new for this.
Thanks

I would suggest you to use Java Server-side technologies to implement your algorithm. You can write your algorithm as a java class, which can be called from a Servlet or a JSP or even any other technologies over http protocol. The main reason why I suggest using java is:
1) it is platform independent, so your 1st point:
Implementing binary according to OS.
You dont have to worry which OS the client would use.and it can be ported to other OS very easily.
and
2) it will be very secure, once you compile, a class file will be generated, which can be delivered. it cant be opened and viewable.

Related

Is it possible for an application to be built by only pure functions?

As the title says, regarding a part of functional programming I have yet to see anyone discuss or answer areas of applications which isn't possible to write pure functions. I feel that it is indeed impossible to write applications with pure functions if there are dependencies on operations outside the control of the actual application.
Examples of this would be:
User permissions of the user starting the application
Ports already being used by other applications on machine
Hard drive being full
Files not being able to be written to due to file in use by other applications
Network issues
These are just a few that spring to mind.
I would like to believe that writing code which could never be pure should be grouped and written in a way to maximize other parts of code to fulfill pure function status. So the question is: Is it possible for an application to be built by only pure functions and if not what are things that can stop this and how would we approach these matters?

Utilizing amazon gpu cluster in web app

Does anyone have any experience plugging into an Amazon gpu cluster in a web app? Is it even possible? I want to make an online interface to a simulator I have written in cuda, but everything I have seen so far involves ssh and the command line.
Yes, this is very possible!
You may want to consider binding your CUDA C code (I'm just assuming C) to your preferred scripting language for better efficiency if you intend to build the front end logic not in a lower level programming language but absolutely this is possible.
Keep in mind, many web developers build their apps strictly from the command line, you simply need to find an effective and efficient way of calling the CUDA code from your Web app and then simply return the results to the client who made the request.

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.

application design: Scala + HTML5

I'd like to implement an application with Scala and HTML5. My idea was to create a "local" client-server architecture: Scala handles the calculations and generates HTML5 as a GUI.
To my mind there are two possibilities
Use a Java/Scala framework that allows embedded HTML5. SWT for example has a browser widget. JavaFX seems good, too.
Distribute the program with a server and run it in a browser on localhost.
It would probably be most convenient to require an internet connection and forget about the localhost. Unfortunately an offline mode is necessary.
Now I would like to know how to get this right:
The first option seems easier to implement but I wonder: How can I communicate with Javascript without the HTTP protocol ?
The second approach was just an idea. Have you ever done something like this ?
If you've got advice or know a good framework please go ahead.
UPDATE :
I've just had an interesting idea: Could I use nodejs to create something like a server-server architecture ?
Right now the communication between Scala and Coffescript seems like the most problematic part. I still wonder how I could initiate an update from the Scala side of the application. A HTTP Request is a nice way to exchange data. Sadly to my knowledge in "standard" Coffeescript there would be no event hook to listen to server-side HTTP messages.
I've thought about using nodejs to listen to the server-sent data. Is this a good idea ?
With regards to the second option, you may wish to investigate the Play! Framework or Lift. They automate a lot of the work required to make a web application in Scala, including handling AJAX requests.
Although I haven't tried packaging either for local use, there was an earlier Stack Exchange question about packaging Lift which might be relevant. It should be possible with Play! as well.

Is there a working Cocoa MySQL Xcode project?

Or has this been abandoned? I can't seem to find a modern sample project. I haven't been able to make any the old code I find work. I just want to write a simple Mac app that accesses an external MySQL database that's also involved in a PHP website.
The old CocoaMySQL project has been abandoned, but the project has been resurrected as Sequel Pro.
It's open source and you can get the source code here.
If you want a straight library that allows you to access MySQL, you might try the commercial MacSQL framework.
You can also just use the MySQL C API directly, however be careful because if you want to use this in a commercial app the licensing fees are high.
You might find it easier to write some PHP code on the server to deliver the results to your client using JSON or some other lightweight data interchange format. PHP has direct support for JSON and there is a great Cocoa framework that makes it easy to parse and generate JSON code.
This method allows you to completely abstract the database connection from your client, so it is relatively trivial to change the database if necessary in future.
Thanks, Rob, I have actually seen the links to Sequel Pro but I was confused when I got there. Part of my problem is that I am really bad at adding things to an Xcode project. Once I have a project in hand with the correct libraries and whatever all linked up, I can make use of the various methods or functions.
That's why I was asking if someone had a super simple project using MySQL that would hopefully compile for me right out of the box. I can then add all my objects and coding.
Can't seem to find anyone out there willing to hold the hand of us project-challenged. The project settings dialog box and codes that go in various boxes therein are very confusing to me.