Load all or just a part? [closed] - javascript

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
We are going to display a list of 25-entries on a webpage out of (at least) 5000 entries in the database. The entries should be sortable and you should be able to filter the results according to their names.
In my world, you send a request to the server asking for 25 entries that matches your criterion. However my colleague suggested a different approach; to ask for all 5000 entries and then sort and filter them with JavaScript.
I think that's stupid, but I'm afraid I'm missing something. What would you say are the pros and cons of this two approaches?

Or use AJAX, returning HTML, for the next/ prev paging. That could give you a nice solution.
Then you don't have the white screen, the UI tends to appear more slick & responsive, you can write a nice (clean & simple) server handler & your colleague can be happy writing some JQuery & AJAX.
It keeps the app scalable, to any number of rows, and the UI is more slick & responsive.. which was perhaps the point of the JS idea.

Related

Implementing tree data structure for frontend components [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'm trying to plan out a simple web app. A user is presented with a question that has two or three possible answers. Depending on their answer, they're taken to another question.
i.e.
ChoiceC
ChoiceA ---> Question 2 ---> ChoiceD
Question 1 -->
ChoiceB ---> Question 3 ---> ChoiceE
ChoiceF
This seems to me a like a tree, where each question and answer is a node, and depending on what path you go down, you're exposed to a specific set of other questions/answers.
I'm trying to figure out how to implement this with reusable React components. I could potentially create a component for each question, but that doesn't seem like good practice. Does anyone have any experience building these sorts of 'choose-your-own-adventure' style questionnaires?
You can use a map that saves for every answer what the next question is.
In your case an entry could be [ChoiceA, Question2]. In your program you can then story a variable current_question that gets updated based on your map.
This solution may only be insufficient if the same answer can arise in different contexts and lead to different outcomes. In this case maybe should be a question/answer-pair that determines what comes next.
If you really want to overkill your problem, you can implement a directed labeled graph. The questions would be the nodes in this case and the edge-labels are your answers which lead to the next question/node.
The most pragmatic solution would of course be to don't use a datastructure at all and just stack if-else. This is not scalable though.

What works best when building a search application: search:search or cts:search? [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 4 years ago.
Improve this question
I want to know that in order to make a dynamic search application which looks through all the collections and gives the users the ability to use facets, collection facets, pagination, sorting etc what should be the right approach?
I found two functions for this: search:search, and cts:search. Which matches my needs best?
search:search is built on top of cts:search (as well as other APIs). They’re designed to work together. You should start with search:search, though. It is designed specifically for your faceted search use case and includes many conveniences and best practices that might not be obvious with the lower-level APIs, for example, concurrent facet resolution and pagination. If you need to do something more sophisticated than what search:search provides out-of-the-box, you can call out to other libraries.

How to build a website? [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 5 years ago.
Improve this question
I have a really really big question which is how to write a social networking website like facebook? I want to know which language should I use and why. And also the relationship of them or the whole structure of website. Only a general idea of blue print will be all right. However I don't mind if u can tell me things in detail. Thanks in advance.
Simply put: You can't realistically without a huge team of experts and lots of money. If you're a full-stack developer I'm sure you can pull off a website that has user profiles and a commenting system just with HTML, CSS, javascript, AJAX, and something like PHP/MySQL on the backend (lots of options here). Facebook is obviously a lot more complicated than that though, especially with all the asynchronous features going on such as the chat system.
Extended answer: https://www.forbes.com/sites/quora/2013/05/20/how-is-a-facebook-like-site-actually-created-from-scratch/#71ee985bdd2d

Implementing algorithms using javascript [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
I am developing a webbased application using javascript and I am applying a lot of algorithms on my data and a lot of processing on data is required.
I was wondering is it the common practice to do all the processing and implementing algorithms using javascript or should I do them somewhere else ( i.e. server side ) and just give the results to javascript for viewing?
Depends on what you're trying to do!
Generally if it's data crunching, you want to do that server side, and then present it to the user. Sometimes it can be helpful to offload some of this work to your client- but keep in mind, if you're pushing computing onto the client, it may cause a page to take longer to load.

JavaScript distributed computing project [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
I made a website that does absolutely nothing, and I've proven to myself that people like to stay there - I've already logged 11+ hours worth of cumulative time on the page.
My question is whether it would be possible (or practical) to use the website as a distributed computing site.
My first impulse was to find out if there were any JavaScript distributed computing projects already active, so that I could put a piece of code on the page and be done. Unfortunately, all I could find was a big list of websites that thought it might be a cool idea.
I'm thinking that I might want to start with something like integer factorization - in this case, RSA numbers. It would be easy for the server to check if an answer was correct (simply test for modulus equals zero), and also easy to implement.
Is my idea feasible? Is there already a project out there that I can use?
Take a look at http://www.igvita.com/2009/03/03/collaborative-map-reduce-in-the-browser/ and http://www.igvita.com/2009/03/07/collaborative-swarm-computing-notes/

Categories

Resources