Tag Info

Hot answers tagged

6

Let's immediately get the Turing-completeness disclaimer out of the way and say any language can probably approximate any runtime feature of any other language. Good? Good. The main difference between the Node.js approach and a Python threaded-server (or a typical Java HTTP server implementation) is that Node.js is single threaded while the latter two are ...


5

You should respond with HTTP 400: Bad Request. The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. The response should include an explanation of why the request was rejected—e.g., “Invalid JSON” .


2

Custom elements are a specification part of the Web Components standard, along with Shadow DOM, Templates and HTML imports. From http://webcomponents.org/articles/introduction-to-custom-elements/: Custom Elements enable developers to create their own custom HTML tags, let them use those tags in their sites and apps, and enable easier component reuse. ...


2

It is quite easy to get frustrated with management in these situations but keep in mind that your company only exists to make money. Having a super useful and secure application is not necessarily a worthwhile goal from a manager's point of view. You have not mentioned in what format the data is pushed to clients but if it is in HTML form then have you ...


2

yes, your manager is right - security flaws don't make themselves, they were all produced by a developer who didn't consider every case. Because software can be complicated, we can all be guilty of this. So you design a system defensively to help prevent us from screwing up. One day some requirement will come in that requires eval, and then.. So, you can ...


2

You're on the right track - each web page request needs to be tracked, but you need to do this is a very simple manner. Then the problem shifts to statistical analysis of these counters, and that's quite easy. Forget storing each webpage in the DB, instead you need to cache it in memory (as you don't really care about flow rate when the system is restarted) ...


2

The easiest way to find out is to disable the User-Agent customization and see if the problem goes away :) . In general, User-Agent is not guaranteed to be what you set. For example, a corporate firewall might use deep packet inspection to rewrite User-Agent and reduce browser entropy. Philosophically, I think modifying User-Agent to include additional ...


1

What you probably want to do here is use a repository... This would have your querying methods directly related to your Object and would use and instance of the DB as part of its constructor: $repo = new MovieRepository($db); $movies = $repo->findAll(); And or writing you might have: $repo = new MovieRepository($db); $movie = $repo->findById($id); ...



Only top voted, non community-wiki answers of a minimum length are eligible