Real time collaborative use interface on the web [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm wondering what the technologies and best practices are behind real time collaboration in web interfaces.
An example of this is of course Google Wave. Another is PivotalTracker.com.
I'm particularly interested in any work (frameworks, plugins, etc) people are doing with Ruby on Rails here.
I imagine it would have to use Javascript underneath at some level, but you would need a way to abstract this out. Probably polling the server periodically to see if changes have been made, and also a way to resolve conflicts if in the middle of editing something the server comes back and says someone else has updated it.
Thank you!

Wave has operational transform that has a nice property of being easily combinable. You have two users, each of them does "something" in the user interface and two "somethings" can be combined into final document. That allows you to skip the problems with conflict resolution.
A nice way to enable real-time updates to state of the app is by using Comet, which is essentially a geeky codename for keeping an alive, long standing, unterminated get/post request to the server, that server finishes and responds to when something happens on the server. It allows sending to the client instantaneous updates without having the client periodically poll.
I can't really say how to abstract this away in javascript/r'n'r, many of the underlying technical details are hard enough and application specific that no framework supports them out of the box.

Related

Can i generate a hash of a javascript file to check if it has been edited by the client? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am using https://pavlovia.org to run some experiments in behavioral economics in risky-choice. The task requires the subjects to play (or not) different lotteries. The system creates javascript files which it runs on the subject's browser. However, I found it very easy to inspect and edit the javascript which would allow a malicious subject to give themselves an advantage (e.g. increase the probability of a lottery paying out).
If someone makes all the lotteries "win", it will be easy to tell they cheated, but if they boost the probabilities by a small amount it will be very hard.
Other than re-writing everything so that the logic is server-side, I wondered whether it is possible to compute a hash (md5 or sha) of the JS code on the client and sent it back to the server to check wither the JS has been edited. I found several posts related to computing hashes in javascript, but I wasn't sure whether a file could compute its own hash.
I appreciate that a sophisticated user could also hack that part of the code (e.g. copy the original file to another name and then edit the code that takes the hash to point to the original file, or something like that). But i wonder if this technique could be one more barrier to cheating.
The user has the ability to debug the JS code while running and replace values in some variables. Even if JS hashing was possible, it would not prevent that. I believe there is no other way than making part of the crucial logic on the server side.

How to pass data from Java to Javascipt? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I would like to create a website that visualises different algorithms. I would like to implement and compute the algorithms in Java but visualise and present in to the user on a website so using JS, HTML and CSS. To be clear I don't want to use Java for backend, I just want to implement the algorithms and compute them using Java. How would I go about doing that? Could this be done using micro-services?
I know that you can't run java in a browser. I just want to have some kind of service that computes the algorithms and passes the data about how to render it to a client side which renders it.
You certainly can, suppose you have a java component that handles the data processing and algorithm. This component can just be a simple java application that accepts parameters and produce some output. You then have a back-end micro service, a REST API for your front-end to consume. The back-end can be done with various frameworks and languages. The back-end would invoke/make request to this java component. You typically do this if you need heavy processing as a separate component. Imagine you need to do heavy machine learning or data analytic. Your back-end would make request to these component that do the heavy computing. Also if the processing is long and complex then you will have to do request, and poll for results. There are quite a few things to consider, but it depends on your needs.

Front-end and back-end [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Can someone explain to me how the front-end and back-end developing are meeting, or let's say consisting in the web development world? Is C++ a sufficient language for the back-end or I would still need to learn about ruby or python or C# or will it depend?
Font end implies direct presentation to or interaction with the user, such as through a GUI.
Back end suggests the software that's furthest away from end users, which is sometimes some kind of database or transaction processing engine.
You generally expect actions on the front end to be feeding into the back end processing - perhaps causing transactions to happen there, or starting reports running etc.. Sometimes events in the backend will lead to events in the front end, such as offering to display a report, or popping up a notification of some kind.
C++ is well suited to custom backend services needing 3GL languages, but sometimes features well beyond the scope of the C++ language Standard are needed, and it may be easier to get a proprietary database system, or an off-the-shelf solution to queue and distribute jobs across myriad hosts or otherwise "manage" things. If could still be that some or all of the hands-on data processing is done in C++.

Want to create a new application for website traffic monitoring ( analysis ) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to create my own application for monitoring traffic of my website without using any third party tools like google analytics. In which I want to log screenshots, user details, page details and cookies. So what technology should I opt so as to achieve this goal and which will be best suited and what work flow should I follow.
I've never done this kind of work previously so I'm new to this. Any help would be greatly appreciated.
The technologies I know are : javascript, nodejs, django(python).
You will have to break down your application as it is a humongous task to create something like GA.
You will have to track many user activities(click,spend time etc).so you can do that in plain js or use a cross-platform lightweight library(angular.js) that can make your life a little easy.
Now since you will have to send large set of traced data to you database with minimum latency,use Node.js in this scenario.Simple Ajax call would also work but then it would be very slow.
Now comes your database.Prefer NoSql since it suits your requirement of unstructured data ,preferrablly MongoDb which can help you with its own mapReduce,large storage capacity
.Since there will be lot of calculation involved you can use your python knowledge which can help you process data a lot faster.you can use other languages as well(eg.Go)
Your processed data and results can then be stored in Redis(which acts as a caching layer).
you can use sophisticated graphic library like d3.js,Highcharts.js for displaying Graphical data on the client-side.
There are a lot of factors that can be involved.This is just a very basic outline of what you could do.

Replacing part of webpage with javascript - good? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is it a good programing practice to replace a layout component with another without a refresh?
e.g. say i want to sort items. Is it a good idea to sort them using javascript without any refresh, or should i make a refresh and call php to sort the data?
EDIT: I understand the way asked, this question is too open. We got two ways to do things.
Server side:
a) depends on server and users with 128MB ram pc will have no issues.
b) requires resources (bandwidth and cpu power) on the server side, while makes the user wait for the page to load.
client side:
a) done like a magic. if the user got an i7 cpu it will work like magic. Also no resurces wasted and no wait time.
b) if the user got a slow pc, will it take time for the action to be performed? Say, I want to use javascript to replace 50 small images (icons) and 300 textfields. Should i do this with javascript or php? If the user got a 2000 pc, will he notice a delay or something?
Almost every AJAX call you make is going to manipulate the DOM with Javascript. I think it largely depends on what you are trying to accomplish, but I don't think there is a reason to force the user to do an entire round trip to the web server if there isn't a good reason to.
Well, first off, you can answer this question with whether or not you want the sorting done server-side or client-side. If you want client-side then stick to the JavaScript, otherwise go Server-Side. Depending on how big the sort is/ hardware support/ etc. you may want to keep it client-side.
Now, if you use php, or some other language, and refresh the page, then you will have to require the user to redownload the page to see the new content. If this doesn't matter then do it that way.

Categories