I totally agree with all the other answers. I'm working home office for about 2 years now and I also love it, but sometimes it's too easy to get distracted. When you find something that distracts you, remove it. Also, it helps a lot to shower and get dressed in the morning as if you were leaving the house. Don't work in a bathing robe ;)
My gf is working in shifts and hence sometimes she's here when I'm working and I have to remind her that I'm working, although I'm around.
Essentially same type of four pair cable that is used for SpaceWire and Ethernet on-board of ISS is readily available and generally costs less than 10EUR/meter.
Is it just me, or is programming more than one elevator buggy?
I used a for( var i =0;i < elevators.length;++i) statement to apply my code to each elevator, but people only keep using the last one.
Could someone give me a hint? ;)
You're probably hitting an issue with the way that closures work in javascript (and many other languages).
for(var i = 0; i < elevators.length; ++i) {
elevator[i].on("floor_button_pressed",
function(floorNum){ elevator[i].goToFloor(floornum)});
}
Doesn't do what one might expect. When the anonymous function is invoked, it looks up the value of the 'i' identifier, which will have changed it's value to elevators.length by the end of the loop. To get the behavior you want, I've seen people do
for(var i = 0; i < elevators.length; ++i) {
(function(i){
elevator[i].on("floor_button_pressed",
function(floorNum){ elevator[i].goToFloor(floornum)});
})(i);
}
This creates a new scope, which ensures that 'i' has the value that was passed in. I'm afraid I'm a little too tired to look up the parts of the spec that make the semantics clear.
I've been using Marionette for about a year know for one project and in the past weeks I became a bit insecure if my decision was correct. It feels like Marionette is moving slowly, compared to other similar projects which have a bigger community.
Is this a false impression?
It's not that I'm missing any bigger features, but I'm afraid it might be discontinued sooner than other projects.