I've done quite a few interfaces which I've referred to as "RESTful", because I've done what most people call "REST" - using HTTP as the transport, modeling everything as resources, and using the HTTP verbs (GET, POST, PUT, etc) to access the resources. I mostly wanted to do REST because the alternative, SOAP, was so onerous - it required translating a WSDL document to proxies, serializing and deserializing error objects, and, worst of all, was a nightmare to version. I had read about HATEOAS, and had kind of thought, "Wow, that sounds...strange", but
One of my new personal projects involves writing an application using Node.js and MongoDB. It's going to have a RESTful interface for the services, and MongoDB as the database (I haven't decided about what I'm going to use for the front-end, but Angular.js is a strong contender). I had looked at using mean.io to build it, but after playing with it for a while, it seemed to bring in too many things I wouldn't end up needing, so I decided to build it all from scratch using Restify for the RESTful services.
I'm writing it in an
for (var i = 0; i < length; i++) loop to iterate over arrays. Node adds a lot to the language as well, such as EventEmitters, which are very powerful. This afternoon I found a nifty new use for them: logging.
One of the issues that always seems
There are two reasons to have inheritance:
- to support polymorphism in languages that do not have dynamic typing, like C++. The class acts as an interface specification for a type. This provides the benefit of being able to replace one class with another (such as a function that
There's an excellent blog post by by James Nebeker and David G. Young about simulating an iBeacon using a Raspberry Pi and a bluetooth dongle. Since I already had both, I thought I'd give it a try. It worked really well, and I've even put together the files necessary to do it in my GitHub repository.
You'll need to install BlueZ as well for this to work. Once you get it all installed and working you can use one of the mobile iBeacon apps, such as iBeacon Locate. Very fun to play with, and a good way to be able