Returning JSON from a PHP Script

While you’re usually fine without it, you can and should set the Content-Type header: If I’m not using a particular framework, I usually allow some request params to modify the output behavior. It can be useful, generally for quick troubleshooting, to not send a header, or sometimes print_r the data payload to eyeball it (though in most cases, it … Read more

How to determine the version of the C++ standard used by the compiler?

By my knowledge there is no overall way to do this. If you look at the headers of cross platform/multiple compiler supporting libraries you’ll always find a lot of defines that use compiler specific constructs to determine such things: You probably will have to do such defines yourself for all compilers you use.

Nat Punchthrough understanding P2P concept

NAT punch through works on the principle of educated guesswork. It is usually used to create connections with devices that do IP Masquerading. This is the technology used in most home internet modems to the point that NAT has become interchangeably used to refer to IP Masquerading. When you connect out from a device which … Read more

How to disable auto-start of “Node.js: Server-side JavaScript” when using Adobe Dreamweaver?

Solution: One suggestion in Adobe Forums was to log out of CC. Instead, I disabled all the CC auto-updating services that run when my PC starts up. Here are directions on how to disable startup programs in Windows. Hypothesis: I couldn’t find any documentation specifically about Adobe CC and node.js, but I believe its being used as part … Read more

Why int[] a = new int[1] instead of just int a?

defines a primitive int. defines an array that has space to hold 1 int. They are two very different things. The primitive has no methods/properites on it, but an array has properties on it (length), and methods (specifically its on clone method, and all the methods of Object). Arrays are a bit of a weird … Read more

“Cross origin requests are only supported for HTTP.” error when loading a local file

My crystal ball says that you are loading the model using either file:// or C:/, which stays true to the error message as they are not http:// So you can either install a webserver in your local PC or upload the model somewhere else and use jsonp and change the url to http://example.com/path/to/model Origin is defined in RFC-6454 as So even though your file … Read more