Blog

  • Cannot set headers after they are sent to the client

    When you are using Node.js with Express and you’ve received the dreaded error [err_http_headers_sent]: cannot set headers after they are sent to the client where do you even begin with err_http_headers_sent’. This article will explore common causes of this error, such as calling res.writeHead, res.write, or res.redirect.

    A problem occurs when servers send out headers after the message has been received by the client. Node JS applications send multiple responses to the same request – eg. calling the request twice instead of a single request with one response res.send headers.

    (more…)

  • Creating a default named constraint with MS SQL Server

    This is something that I never previously thought of until I went and tried to delete an index that was created and it had a random name across different environments. To say the least it was a real pain and ended up being where more manual than I ever thought it could be.

    This is when a learned how to create default constraints with a defined name so it would no longer generate a random index name.

    Let’s start by looking at an example of creating a default constraint when adding a new field to a table that creates a random name:

    (more…)

  • Knockout isdirty custom data binding

    This is probably one of my favorite data bindings for Knockout.js: isdirty. The concept behind the function is to track when there is a change to any object including any of its properties. It’s extremely powerful handling nested objects as well.

    Let’s take a look at how to use:

    (more…)

  • LINQ Group By to Dictionary Object

    So many times to have a list of objects that I want to group – as an example – by a customer ID. The end result that I would like would be a: Dictionary<long, List>

    (more…)

  • nlapiCreateRecord vs nlapiTransformRecord – What’s the difference?

    NetSuite Restlet development can be hard; finding documentation is almost next to impossible. I’ve finally had a personal break through of:

    What is the difference between nlapiCreateRecord and nlapiTransformRecord?

    This article assumes that you have some NetSuite experience and have created a NetSuite Restlet. I have written a previous article that describes how to authenticate with NetSuite for calling a Restlet using token based authentication that should help you get up-to-speed.

    (more…)