Tag Info

New answers tagged

0

I've been faced with this, and the answer is: For someone experienced in performance tuning, the new code can be tuned so almost no code can go faster. Here's an example. The reason is, there is a minimum length of time the task can take, and it's greater than one cycle. There are many, many programs that can do the task, and one or more of them take less ...


3

You question is a bit of a broad/opinionated "What's the best way to manage the whole CSS thing?". It's a great question, but I don't think there is a single answer. I feel like the question is ultimately, "How do you work with Bootstrap?" Bootstrap is a front-end framework. Frameworks generally include a lot of features but, by their nature, are a ...


1

What is a Non-Blocking framework? Explain it like I'm 5: Imagine you want to make a deposit to your bank account. You walk in and notice there is no queue of people waiting line. The sign over the bank teller says: "Non-blocking teller". You walk up and ask the teller to process your deposit, the teller responds: "I'm busy with another transaction, ...


0

From your statement " the DB will be locked for an uncontrollable amount of time during the external API call, potentially affecting performance" I infer that the external call could take a lot longer than the DB call. So if this is the case, then I would make the request asynchronous and send a response to the user/UI saying that the request has been ...


5

and don't want to ask the individuals doing the work to manually record things like how long it takes them to perform a given task Here's the problem. You basically want to create meaningful metrics, without measuring the only thing that matters. Nearly all of your users won't care about how fast the code itself is unless it causes a noticeable impact ...


1

If time is of the essence, then I suggest to look to hire somebody to do it. You could find somebody on freelancer or other similar site. You could ask that they explain you why they did what they did so you learn something. Plus you'll have the code. If you decide to go on your own, which I don't recommend, I would go for AWS using nodejs + expressjs. You ...


1

Maybe consider a variation of two-phase commit: Make and commit your changes to the database first, then do your API calls. If the API calls fail, then make compensatory changes to the database (basically, update the database with the previous values). This had the virtue of not locking the database for any appreciable length of time, but gives you a method ...


2

It's far easier to roll back changes made in a database that it is at the "other end" of an API call. Here's how I'd do it: Start a database transaction and make the changes there. Do the API calls. If those work, then commit the database changes; if not, roll the changes back.


0

I would like to add that hosting a local copy is a best practice because none of above state anything related to a secure posture whereby Geo Location and strict White Listing are imperative. Not hosting that file locally presumes to push a reduced security posture onto your clients.


0

I could be wrong, but implementing document.write overwrites anything that the DOM has. Since it's good practice to put JavaScript files at the end of the body, I propose the following method based on previous answers: <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script ...


1

It mostly depends on the size of the data you return and whether the user is expected to use all the data at once. For instance, if it's a list containing hundreds of thousands of complex entries: The response served as a single JSON will be rather large, and: It is unlikely that the user will actually need to see all the data at once. Instead, the user ...


3

When a browser makes an HTTP request, it looks like this: GET /search?q=cats HTTP/1.0 Host: www.google.com Connection: close … to which the server should send a response that looks like this: HTTP/1.0 200 Success Content-Type: text/html; charset=UTF-8 Content-Length: 1337 <!DOCTYPE html> <html> <head><title>cats - Google ...


0

Filtering should be done in the database. Databases are really good at filtering results using the WHERE clause. One should always govern that amount of data being queried, paged and returned. You don't want millions or rows going across the network and you don't want the database to page a result set that has a million rows as it is a lot of needless ...


1

A web server is a program written in any programming language that handles "web traffic" over socket(s) adhering to standards/application level protocols (HTTP, etc). Most programming languages offer you to create a socket. Am I right in thinking that a server just needs some kind of interface such as CGI to make the server and the programming language ...


1

Yes it is. DuckDuckGo is one company that I know of that started with Perl as the server side language. I believe they are still using Perl primarily. https://github.com/duckduckgo


2

Some people still use it (I'm one of them). So, it hasn't been replaced. In fact, I switched to Perl from PHP.


0

PHP, in my opinion, is a much faster and better choice for the web. We also have Javascript, which is blazing fast due to it's event-based nature. However Perl is still used and there are web frameworks for Perl in web use such as Catalyst. There is also an emergence of Python being used in the web. Frameworks such as Django, which I have had personal ...


7

Am I right in thinking that a server just needs some kind of interface such as CGI to make the server and the programming language work together? Almost. You need a web server that has some kind of software to allow it to respond to HTTP requests as well. Think about how a static page is served. The server retrieves the HTTP request, finds the ...


74

In the early days of the web, CGI was indeed the only (practical) way to have dynamic content (you could do named pipes of files -- and those were used in days before cgi, but that wasn't practical at all). CGI works by sticking a bunch of information in the environment of the process that is forked and then exec'ed (and possibly some in stdin) and then ...


19

Yes, any general programming language can serve to write the server-side part of a web site. However, the qualities of a programming language, in this subject as in other things, are usually only one of many factors that contribute to its popularity. For example, I reckon that PHP became popular for websites because: It is extremely easy to upgrade from ...


0

You can use some HTTP server library, e.g. libonion, even in your program coded in C (or C++, see also Wt). There also some HTTP client library (e.g. libcurl) You can use other HTTP libraries, e.g. ocsigen & ocamlnet for OCaml. There are several Web dedicated languages (outside of PHP), e.g. Opa, HOP, Kaya, etc... (both HOP & Opa can easily mix ...


1

You have many options: Basic authentication over SSL https://thoughtfulsoftware.wordpress.com/2014/06/30/pre-emptive-http-basic-authentication-with-jquery/ Create a UI with the ability to log-in, create, view and delete blog posts JQuery has JSON and AJAX capabilities built-in You just have to explore and decide which libraries to use and what to write ...


1

I couldn't convince my boss yet that this is a bad idea, am i wrong here? I feel like a web app is not the right tool for this job. And if this is indeed a bad idea, what would the best way be for me to clearly explain him that? I am really not sure this is a bad idea. To me it sounds like a good idea because your customers will get what they want ...


0

JDT There are specific implementation answers to this problem developed by various software stacks, see JDTs answer. Router I think a fairly simple solution is to get your router to do this for you. You can define a mapping between incoming requests at a known and static port on the router and the server (including the port number) the requests should be ...


0

You can avoid this issue by using a host name without a port and leaving the mapping of that host name to the target port to the server. This way, when the port changes (which is something you do on the server) you can change the mapping as well (which would also be on the server). Depending on the web server you are using, you could use Host Headers (IIS) ...


4

What advantages do people see in using immutable request/response objects? I agree with @MainMa's statement "I'm not sure if the slight benefit of readability compensates the possible lack of flexibility" and personally I don't see any practical and useful aspects of forcing PHP HTTP Request temporary objects or PHP HTTP Response temporary objects to be ...


6

First off, yes, http://www.w3.org/ is a completely upstanding site that is the repository of the documentation and specifications for html, xml, xhtml, and the like. Next, you have a significant misunderstanding about what is actually in the xhtml files. From the documentation on xhtml (notice the link): <?xml version="1.0" encoding="UTF-8"?> ...


1

These URLs are references to XML namespaces. These URLs define what XML tags are allowed in the document. Every valid XML document needs to include such namespace URLs. When you are using a standardized XML format, like XHTML1-transitional, you should reference the XML namespaces of the standardization body which defined them, in this case the World Wide Web ...


6

Immutable objects in general have several benefits. The most important one is how easy is to use immutable objects in code executed in parallel. This also explains why "immutability has never really caught on in the land of PHP". State consistency is easier to obtain. Objects are easy, more natural to work with. The essential thing is how much the object ...



Top 50 recent answers are included