Tag Info

New answers tagged

1

For telecoms customers where downtime directly affects revenue and multicomponent migrations are often done in a one night process, we have used versioned table names and background scripts that replicate and convert the data prior to a cutover. That way testing can be done against the new version of the table which has a complete set of data against whict ...


3

A server can be several things, in the internet context it will be a computer (either a single instance running on some hardware or a virtual machine) that is running a web server software (like Apache or nginx for example) that can take requests from a users browser. When such a request comes in it will look into it's configuration and find a project that ...


-2

These questions pop up in everybody's heads. Everyone's "been there, done that" a lot, and after having been there so many times I can tell you "philosophically" that... Change matters. As a programmer you need to learn to be comfortable with change. Your processes, tools, libraries, best practices, everything is susceptible to change, everything is a ...


1

You could use a hash. If you had an inline script like this: <script>alert('Hello, world.');</script> You can hash it and specifiy it in your Content-Security-Policy header. Content-Security-Policy: script-src 'sha256-sha256-qznLcsROx4GACP2dm0UCKCzCG-HiZ1guq6ZZDob_Tng=' There's also a mechanism for using a nonce: <script ...


5

You cannot prevent someone from calling your URL directly. What you can do, however, is reject invalid requests. You can add a unique key to each response which is then returned in the next request. If a request has an invalid or missing key, ignore it. This is the basic idea behind a session. In fact, you may be able to use sessions in your framework to ...


0

You should have very specific, semantic requests. For instance: You want to pull information about a specific owner example.com/owner/123 You want to pull information about a specific owner's assets example.com/owner/123/assets Now you want to pull all assets that belong to owner 123 example.com/ownerAndAssets/123 Or you want to pull a specific ...


1

I'm trying to determine when a web application should query a database for related data that may or may not be used in the current request. For such general questions it's hard to give a general answer. You have to consider two points: convenience and performance. Many things, which seem at first sight convenient are at hindsight performancekillers. ...


1

In your DAO layer, you should have a way to mark a relationship as required or optional (terms may vary based on whatever framework you use). Required relationships mean that if A links to B and I query A, the web service must return B as well. Use this for data where the two objects are always used together. Optional relationships mean that if A links to ...


0

While that's probably how it used to be before (and I do remember writing stuff like that myself), modern websites tend to use web frameworks such as Flask or Django or Ruby on Rails instead of static pages and rewrites. These frameworks include URL routing, where a certain pattern in the path, for example /artist/<name>, can be mapped to a function ...


2

I would have to agree with you that generating javascript ought to be the same whether from the 32-bit or 64-bit SDK. Further, I fail to see the project manager's concern about 32-bit clients visiting your site. However, it is conceivable that despite all intentions to the contrary, the 32-bit and 64-bit software (SDK) behave differently (i.e. one has a ...


0

Rather than focusing on making sure an entire page degrades gracefully, I try to make sure about 75% (or more, if it's easily or quickly done) of the page gracefully degrades (or works sans JavaScript). I also try to make sure this 75% completes a whole part of the page's functionality. For example, I use JavaScript to load comments for posts on my blog; It ...


2

You have to store your tasks, for instance in a db table, with at least the following informations: time_to_execute: timestamp of when task was set + delay in seconds to_do: things to do (this must be understandable by your backend) executed: 1 if the task has been executed already, otherwise 0 (default) Then, you need a scheduler, could be a cron, which ...


2

You can do this a few different ways. What you ultimately do depends on your server-side stack, your permissions on the server, and the nature of the side-effects needed for the delayed event. As I see them, your options are: An "embedded" scheduled task. If you're using a service-like backend technology (like a node server), you can put timeouts right in ...


1

A simple approach is to have a pending tasks table in your database. To create a task, add a row to the table that contains the action time, and any other data needed to process the task. You have a background thread that periodically queries the table, actions any tasks that have come due, and removes completed tasks from the table. I wouldn't describe ...


-1

As a graphic designer turned full stack web developer, for me this has so far been the easy part. I find that a lot of times there is a communication gap between a UX design team and the developers that implement the product. Sure, documents help, but the process can begin to feel a lot more natural once some face to face conversations about strategy occur. ...


3

You include every line of code and configuration that took you time to write. It is doubtful that the 1 kSLOC of JSON and XML appeared out of thin air. If you fail to do this, you will underestimate the amount of effort to create the product. On the other hand, it is likely the case that writing 1 kSLOC of JSON will take a different amount of time than ...


1

I suggest that you 1) learn what other REST APIs do, and 2) consider OData I love Odata because it supports every scenario you listed in one single API call. I'm biased though, because in C# you can implement an Odata server in just a few lines of code if you use the Entity Framework. There's also client side libraries that can format OData URLs. Let me ...


3

This is a classic API design dilemma, regardless of whether it's provided by a web service, or by linking a library, or by just being part of a code base that gets built along with everything else. It boils down to whether you prefer many functions that each do one specific thing, or whether you have fewer, more parameterized functions. Since web calls are ...


1

I have done such things as REST, which, as you say, doesn't solve all problems, though at least a few of them possibly. Basically search features I have implemented using URL params instead having a single URL for each of them. So your get_user_by_email would just be /user?email=joe.doe@something.net Similar you can handle the returned data for things ...


0

It could be done client-side, but it wouldn't be a "continuous monitoring" scenario, since client-side code only executes when your user is actually viewing your page. Instead it would be a comparison operation between a local cached version of the RSS feed and the latest RSS feed. Also, this would only be possible if the user views a page on your site. It ...



Top 50 recent answers are included