What does "use strict" do in JavaScript, and what is the reasoning behind it?

Question: Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error:

Problem at line 1 character 1: Missing "use strict" statement.

Doing some searching, I realized that some people add "use strict"; into their JavaScript code. Once I added the statement, the error stopped appearing. Unfortunately, Google did not reveal much of the history behind this string statement. Certainly it must have something to do with how the JavaScript is interpreted by the browser, but I have no idea what the effect would be.
So what is "use strict"; all about, what does it imply, and is it still relevant?
Do any of the current browsers respond to the "use strict"; string or is it for future use?
Comment: The answers here are old but they are wrong. The main reasoning for strict mode was not to prevent programming errors - it was to make JavaScript lexically scoped so it could be statically analysable :]
Comment: And the reason for the weird syntax (magic string as a statement) is to make it backwards compatible with older JavaScript engines. The idea of strict mode is to disallow some problematic JavaScript language constructs but not change the interpretation of the code so the execution will be identical regardless if the JavaScript engine actually supports strict mode or not.
Answer: Update for ES6 modules
Inside native ECMAScript modules (with import and export statements) and ES6 classes, strict mode is always enabled and cannot be disabled.
Original answer
This article about Javascript Strict Mode might interest you: John Resig - ECMAScript 5 Strict Mode, JSON, and More
To quote some interesting parts:

Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions.

And:

Strict mode helps out in a couple ways:

It catches some common coding bloopers, throwing exceptions.
It prevents, or throws errors, when relatively "unsafe" actions are taken (such as gaining access to the global object).
It disables features that are confusing or poorly thought out.

Also note you can apply "strict mode" to the whole file... Or you can use it only for a specific function (still quoting from John Resig's article):
// Non-strict code...

(function(){
  "use strict";

  // Define your library strictly...
})();

// Non-strict code...

Which might be helpful if you have to mix old and new code ;-)
So, I suppose it's a bit like the "use strict" you can use in Perl (hence the name?): it helps you make fewer errors, by detecting more things that could lead to breakages.
Strict mode is now supported by all major browsers.
Answer: It's a new feature of ECMAScript 5. John Resig wrote up a nice summary of it.
It's just a string you put in your JavaScript files (either at the top of your file or inside of a function) that looks like this:
"use strict";

Putting it in your code now shouldn't cause any problems with current browsers as it's just a string. It may cause problems with your code in the future if your code violates the pragma.  For instance, if you currently have foo = "bar" without defining foo first, your code will start failing...which is a good thing in my opinion.
Answer: The statement "use strict";  instructs the browser to use the Strict mode, which is a reduced and safer feature set of JavaScript.
List of features (non-exhaustive)

Disallows global variables. (Catches missing var declarations and typos in variable names)

Silent failing assignments will throw error in strict mode (assigning NaN = 5;)

Attempts to delete undeletable properties will throw (delete Object.prototype)

Requires all property names in an object literal to be unique (var x = {x1: "1", x1: "2"})

Function parameter names must be unique (function sum (x, x) {...})

Forbids octal syntax (var x = 023; some devs assume wrongly that a preceding zero does nothing to change the number.)

Forbids the with keyword

eval in strict mode does not introduce new variables

Forbids deleting plain names (delete x;)

Forbids binding or assignment of the names eval and arguments in any form

Strict mode does not alias properties of the arguments object with the formal parameters. (e.g. in function sum (a,b) { return arguments[0] + b;} This works because arguments[0] is bound to a and so on. ) (See examples section below to understand the difference)

arguments.callee is not supported

[Ref: Strict mode, Mozilla Developer Network]

Examples:

Strict mode code doesn't alias properties of arguments objects created within it

function show( msg ){
    msg = 42;
    console.log( msg );          // msg === 42
    console.log( arguments[0] ); // arguments === 42
}
show( "Hey" );

// In strict mode arguments[i] does not track the value of
// the corresponding named argument, nor does a named argument track the value in the corresponding arguments[i]
function showStrict( msg ){
    "use strict";
    msg = 42;
    console.log( msg );          // msg === 42
    console.log( arguments[0] ); // arguments === "Hey"
}
showStrict( "Hey" );

Comment: The example for 11. is unclear, it's not clear what the difference in strict mode is.
Comment: The formulation "Disallows global variables" is misleading. Global variables can still be used by using `var`, `let` or `const` in a global scope or by assigning to `window.something` (using `window` explicitly), what's not allowed is implicitly adding properties to `window` by doing `something = somethingElse` where `something` is undeclared (without explicitly using `window`).
Comment: This is a much better answer than the accepted one, as it goes straight into the details without the meta commentary on John Resig's post.
Answer: If people are worried about using use strict it might be worth checking out this article:
ECMAScript 5 'Strict mode' support in browsers. What does this mean?
NovoGeek.com - Krishna's weblog
It talks about browser support, but more importantly how to deal with it safely:
function isStrictMode(){
    return !this;
}
/*
   returns false, since 'this' refers to global object and
   '!this' becomes false
*/

function isStrictMode(){
    "use strict";
    return !this;
}
/*
   returns true, since in strict mode the keyword 'this'
   does not refer to global object, unlike traditional JS.
   So here, 'this' is 'undefined' and '!this' becomes true.
*/

Answer: A word of caution, all you hard-charging programmers:  applying "use strict" to existing code can be hazardous!  This thing is not some feel-good, happy-face sticker that you can slap on the code to make it 'better'.  With the "use strict" pragma, the browser will suddenly THROW exceptions in random places that it never threw before just because at that spot you are doing something that default/loose JavaScript happily allows but strict JavaScript abhors!  You may have strictness violations hiding in seldom used calls in your code that will only throw an exception when they do eventually get run - say, in the production environment that your paying customers use!
If you are going to take the plunge, it is a good idea to apply "use strict" alongside comprehensive unit tests and a strictly configured JSHint build task that will give you some confidence that there is no dark corner of your module that will blow up horribly just because you've turned on Strict Mode.  Or, hey, here's another option:  just don't add "use strict" to any of your legacy code, it's probably safer that way, honestly.  DEFINITELY DO NOT add "use strict" to any modules you do not own or maintain, like third party modules.
I think even though it is a deadly caged animal, "use strict" can be good stuff, but you have to do it right.  The best time to go strict is when your project is greenfield and you are starting from scratch. Configure JSHint/JSLint with all the warnings and options cranked up as tight as your team can stomach, get a good build/test/assert system du jour rigged like Grunt+Karma+Chai, and only THEN start marking all your new modules as "use strict".  Be prepared to cure lots of niggly errors and warnings.  Make sure everyone understands the gravity by configuring the build to FAIL if JSHint/JSLint produces any violations.
My project was not a greenfield project when I adopted "use strict".  As a result, my IDE is full of red marks because I don't have "use strict" on half my modules, and JSHint complains about that.  It's a reminder to me about what refactoring I should do in the future.  My goal is to be red mark free due to all of my missing "use strict" statements, but that is years away now.
Answer: Using 'use strict'; does not suddenly make your code better.
The JavaScript strict mode is a feature in ECMAScript 5. You can enable the strict mode by declaring this in the top of your script/function.
'use strict';

When a JavaScript engine sees this directive, it will start to interpret the code in a special mode. In this mode, errors are thrown up when certain coding practices that could end up being potential bugs are detected (which is the reasoning behind the strict mode).
Consider this example:
var a = 365;
var b = 030;

In their obsession to line up the numeric literals, the developer has inadvertently initialized variable b with an octal literal. Non-strict mode will interpret this as a numeric literal with value 24 (in base 10). However, strict mode will throw an error.
For a non-exhaustive list of specialties in strict mode, see this answer.

Where should I use 'use strict';?

In my new JavaScript application: Absolutely! Strict mode can be used as a whistleblower when you are doing something stupid with your code.

In my existing JavaScript code: Probably not! If your existing JavaScript code has statements that are prohibited in strict-mode, the application will simply break. If you want strict mode, you should be prepared to debug and correct your existing code. This is why using 'use strict'; does not suddenly make your code better.

How do I use strict mode?

Insert a 'use strict'; statement on top of your script:
 // File: myscript.js

 'use strict';
 var a = 2;
 ....

Note that everything in the file myscript.js will be interpreted in strict mode.

Or, insert a 'use strict'; statement on top of your function body:
 function doSomething() {
     'use strict';
     ...
 }

Everything in the lexical scope of function doSomething will be interpreted in strict mode. The word lexical scope is important here. For example, if your strict code calls a function of a library that is not strict, only your code is executed in strict mode, and not the called function. See this answer for a better explanation.

What things are prohibited in strict mode?
I found a nice article describing several things that are prohibited in strict mode (note that this is not an exhaustive list):

Scope
Historically, JavaScript has been confused about how functions
are scoped. Sometimes they seem to be statically scoped, but some
features make them behave like they are dynamically scoped. This is
confusing, making programs difficult to read and understand.
Misunderstanding causes bugs. It also is a problem for performance.
Static scoping would permit variable binding to happen at compile
time, but the requirement for dynamic scope means the binding must be
deferred to runtime, which comes with a significant performance
penalty.
Strict mode requires that all variable binding be done statically.
That means that the features that previously required dynamic binding
must be eliminated or modified. Specifically, the with statement is
eliminated, and the eval function's ability to tamper with the
environment of its caller is severely restricted.
One of the benefits of strict code is that tools like YUI Compressor
can do a better job when processing it.
Implied Global Variables
JavaScript has implied global variables. If
you do not explicitly declare a variable, a global variable is
implicitly declared for you. This makes programming easier for
beginners because they can neglect some of their basic housekeeping
chores. But it makes the management of larger programs much more
difficult and it significantly degrades reliability. So in strict
mode, implied global variables are no longer created. You should
explicitly declare all of your variables.
Global Leakage
There are a number of situations that could cause this
to be bound to the global object. For example, if you forget to
provide the new prefix when calling a constructor function, the
constructor's this will be bound unexpectedly to the global object, so
instead of initializing a new object, it will instead be silently
tampering with global variables. In these situations, strict mode will
instead bind this to undefined, which will cause the constructor to
throw an exception instead, allowing the error to be detected much
sooner.
Noisy Failure
JavaScript has always had read-only properties, but you
could not create them yourself until ES5's Object.createProperty
function exposed that capability. If you attempted to assign a value
to a read-only property, it would fail silently. The assignment would
not change the property's value, but your program would proceed as
though it had. This is an integrity hazard that can cause programs to
go into an inconsistent state. In strict mode, attempting to change a
read-only property will throw an exception.
Octal
The octal (or base 8) representation of numbers was extremely
useful when doing machine-level programming on machines whose word
sizes were a multiple of 3. You needed octal when working with the CDC
6600 mainframe, which had a word size of 60 bits. If you could read
octal, you could look at a word as 20 digits. Two digits represented
the op code, and one digit identified one of 8 registers. During the
slow transition from machine codes to high level languages, it was
thought to be useful to provide octal forms in programming languages.
In C, an extremely unfortunate representation of octalness was
selected: Leading zero. So in C, 0100 means 64, not 100, and 08 is an
error, not 8. Even more unfortunately, this anachronism has been
copied into nearly all modern languages, including JavaScript, where
it is only used to create errors. It has no other purpose. So in
strict mode, octal forms are no longer allowed.
Et cetera
The arguments pseudo array becomes a little bit more
array-like in ES5. In strict mode, it loses its callee and caller
properties. This makes it possible to pass your arguments to untrusted
code without giving up a lot of confidential context. Also, the
arguments property of functions is eliminated.
In strict mode, duplicate keys in a function literal will produce a
syntax error. A function can't have two parameters with the same name.
A function can't have a variable with the same name as one of its
parameters. A function can't delete its own variables. An attempt to
delete a non-configurable property now throws an exception. Primitive
values are not implicitly wrapped.

Reserved words for future JavaScript versions
ECMAScript 5 adds a list of reserved words. If you use them as variables or arguments, strict mode will throw an error. The reserved words are:

implements, interface, let, package, private, protected, public, static, and yield

Further Reading

Strict Mode - JavaScript | MDN
Browser support for strict mode
Transitioning to strict mode
Answer: I strongly recommend every developer to start using strict mode now. There are enough browsers supporting it that strict mode will legitimately help save us from errors we didn't even know were in your code.
Apparently, at the initial stage there will be errors we have never encountered before. To get the full benefit, we need to do proper testing after switching to strict mode to make sure we have caught everything. Definitely we don't just throw use strict in our code and assume there are no errors. So the churn is that it's time to start using this incredibly useful language feature to write better code.
For example,
var person = {
    name : 'xyz',
    position : 'abc',
    fullname : function () {  "use strict"; return this.name; }
};

JSLint is a debugger written by Douglas Crockford. Simply paste in your script, and it'll quickly scan for any noticeable issues and errors in your code.
Answer: I would like to offer a somewhat more founded answer complementing the other answers. I was hoping to edit the most popular answer, but failed. I tried to make it as comprehensive and complete as I could.
You can refer to the MDN documentation for more information.
"use strict" a directive introduced in ECMAScript 5.
Directives are similar to statements, yet different.

use strict does not contain key words: The directive is a simple expression statement, which consists of a special string literal (in single or double quotes). JavaScript engines, that do not implement ECMAScript 5, merely see an expression statement without side effects. It is expected that future versions of ECMAScript standards introduce use as a real key word; the quotes would thereby become obsolete.
use strict can be used only at the beginning of a script or of a function, i.e. it must precede every other (real) statement. It does not have to be the first instruction in a script of function: it can be preceded by other statement expressions that consist of string literals ( and JavaScript implementations can treat them as implementation specific directives). String literals statements, which follow a first real statement (in a script or function) are simple expression statements. Interpreters must not interpret them as directives and they have no effect.

The use strict directive indicates that the following code (in a script or a function) is strict code.
The code in the highest level of a script (code that is not in a function) is considered strict code when the script contains a use strict directive.
The content of a function is considered strict code when the function itself is defined in a strict code or when the function contains a use strict directive.
Code that is passed to an eval() method is considered strict code when eval() was called from a strict code or contains the use strict directive itself.
The strict mode of ECMAScript 5 is a restricted subset of the JavaScript language, which eliminates relevant deficits of the language and features more stringent error checking and higher security. The following lists the differences between strict mode and normal mode (of which the first three are particularly important):

You cannot use the with-statement in strict mode.
In strict mode all variables have to be declared: if you assign a value to an identifier that has not been declared as variable, function, function parameter, catch-clause parameter or property of the global Object, then you will get a ReferenceError. In normal mode the identifier is implicitly declared as a global variable (as a property of the global Object)
In strict mode the keyword this has the value undefined in functions that were invoked as functions (not as methods). (In normal mode this always points to the global Object). This difference can be used to test if an implementation supports the strict mode:

var hasStrictMode = (function() { "use strict"; return this===undefined }());

Also when a function is invoked with call() or apply in strict mode, then this is exactly the value of the first argument of the call()or apply() invocation. (In normal mode null and undefined are replaced by the global Object and values, which are not objects, are cast into objects.)

In strict mode you will get a TypeError, when you try to assign to readonly properties or to define new properties for a non extensible object. (In normal mode both simply fail without error message.)

In strict mode, when passing code to eval(), you cannot declare or define variables or functions in the scope of the caller (as you can do it in normal mode). Instead, a new scope is created for eval() and the variables and functions are within that scope. That scope is destroyed after eval() finishes execution.

In strict mode the arguments-object of a function contains a static copy of the values, which are passed to that function. In normal mode the arguments-object has a somewhat "magical" behaviour: The elements of the array and the named function parameters reference both the same value.

In strict mode you will get a SyntaxError when the delete operator is followed by a non qualified identifier (a variable, function or function parameter). In normal mode the delete expression would do nothing and is evaluated to false.

In strict mode you will get a TypeError when you try to delete a non configurable property. (In normal mode the attempt simply fails and the delete expression is evaluated to false).

In strict mode it is considered a syntactical error when you try to define several properties with the same name for an object literal. (In normal mode there is no error.)

In strict mode it is considered a syntactical error when a function declaration has multiple parameters with the same name. (In normal mode there is no error.)

In strict mode octal literals are not allowed (these are literals that start with 0. (In normal mode some implementations do allow octal literals.)

In strict mode the identifiers eval and arguments are treated like keywords. You cannot change their value, cannot assign a value to them, and you cannot use them as names for variables, functions, function parameters or identifiers of a catch block.

In strict mode are more restrictions on the possibilities to examine the call stack. arguments.caller and arguments.callee cause a TypeError in a function in strict mode. Furthermore, some caller- and arguments properties of functions in strict mode cause a TypeError when you try to read them.
Comment: "In strict mode octal literals are not allowed (these are literals that start with 0x ...)" octal literals start with a leading `0`.
Answer: My two cents:
One of the goals of strict mode is to allow for faster debugging of issues. It helps the developers by throwing exception when certain wrong things occur that can cause silent & strange behaviour of your webpage. The moment we use  use strict, the code will throw out errors which helps developer to fix it in advance.
Few important things which I have learned after using  use strict :
Prevents Global Variable Declaration:

"use strict";
var tree1Data = { name: 'Banana Tree',age: 100,leafCount: 100000};

function Tree(typeOfTree) {
    var age;
    var leafCount;

    age = typeOfTree.age;
    leafCount = typeOfTree.leafCount;
    nameoftree = typeOfTree.name;
};

var tree1 = new Tree(tree1Data);
console.log(window);

Now,this code creates nameoftree in global scope which could be accessed using window.nameoftree. When we implement use strict the code would throw error.

Uncaught ReferenceError: nameoftree is not defined

Eliminates with statement :
with statements can't be minified using tools like uglify-js. They're also deprecated and removed from future JavaScript versions.
Sample:

"use strict";
var tree1Data = {
    name: 'Banana Tree',
    age: 100,
    leafCount: 100000
};

function Tree(typeOfTree) {
    var age;
    var leafCount;

    age = typeOfTree.age;
    leafCount = typeOfTree.leafCount;
   // nameoftree = typeOfTree.name;

    for (var i = 0; i < 2; ++i) {
       // let(leafCount = i) { /*do something*/ }
    }
    for (var i = 0; i < 2; ++i) {
        with(leafCount = i) { /*do something*/ }
    }
};

var tree1 = new Tree(tree1Data);
console.log(window);

Prevents Duplicates :
When we have duplicate property, it throws an exception

Uncaught SyntaxError: Duplicate data property in object literal not
allowed in strict mode

"use strict";
var tree1Data = {
    name: 'Banana Tree',
    age: 100,
    leafCount: 100000,
    name:'Banana Tree'
};

There are few more but I need to gain more knowledge on that.
Comment: First code doesn't works.
Answer: If you use a browser released in the last year or so then it most likely supports JavaScript Strict mode. Only older browsers around before ECMAScript 5 became the current standard don't support it.
The quotes around the command make sure that the code will still work in older browsers as well (although the things that generate a syntax error in strict mode will generally just cause the script to malfunction in some hard to detect way in those older browsers).
Answer: When adding "use strict";, the following cases will throw a SyntaxError before the script is executing:

Paving the way for future ECMAScript versions, using one of the newly reserved keywords (in prevision for ECMAScript 6): implements, interface, let, package, private, protected, public, static, and yield.
Declaring function in blocks
if(a<b){ function f(){} }

Octal syntax
var n = 023;

this point to the global object.
 function f() {
      "use strict";
      this.a = 1;
 };
 f();

Declaring twice the same name for a property name in an object literal
 {a: 1, b: 3, a: 7}

This is no longer the case in ECMAScript 6 (bug 1041128).
Declaring two function arguments with the same name function
f(a, b, b){}

Setting a value to an undeclared variable
function f(x){
   "use strict";
   var a = 12;
   b = a + x*35; // error!
}
f();

Using delete on a variable name delete myVariable;
Using eval or arguments as variable or function argument name
"use strict";
arguments++;
var obj = { set p(arguments) { } };
try { } catch (arguments) { }
function arguments() { }

Sources:

Transitioning to strict mode on MDN
Strict mode on MDN
JavaScript's Strict Mode and Why You Should Use It on Colin J. Ihrig's blog (archived version)
Comment: With ECMAScript 2015 duplicate property names are allowed again! See [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode).
Answer: Strict mode makes several changes to normal JavaScript semantics:

eliminates some JavaScript silent errors by changing them
to throw errors.
fixes mistakes that make it difficult for JavaScript
engines to perform optimizations.
prohibits some syntax likely to be defined in future
versions of ECMAScript.

for more information vistit Strict Mode- Javascript
Answer: "Use Strict"; is an insurance that programmer will not use the loose or the bad properties of JavaScript. It is a guide, just like a ruler will help you make straight lines. "Use Strict" will help you do "Straight coding".
Those that prefer not to use rulers to do their lines straight usually end up in those pages asking for others to debug their code.
Believe me. The overhead is negligible compared to poorly designed code. Doug Crockford, who has been a senior JavaScript developer for several years, has a very interesting post here. Personally, I like to return to his site all the time to make sure I don't forget my good practice.
Modern JavaScript practice should always evoke the "Use Strict"; pragma. The only reason that the ECMA Group has made the "Strict" mode optional is to permit less experienced coders access to JavaScript and give then time to adapt to the new and safer coding practices.
Answer: Including use strict in the beginning of your all sensitive JavaScript files from this point is a small way to be a better JavaScript programmer and avoid random variables becoming global and things change silently.
Answer: Quoting from w3schools:

The "use strict" Directive
The "use strict" directive is new in JavaScript 1.8.5 (ECMAScript
  version 5).
It is not a statement, but a literal expression, ignored by earlier
  versions of JavaScript.
The purpose of "use strict" is to indicate that the code should be
  executed in "strict mode".
With strict mode, you can not, for example, use undeclared variables.
Why Strict Mode?
Strict mode makes it easier to write "secure" JavaScript.
Strict mode changes previously accepted "bad syntax" into real errors.
As an example, in normal JavaScript, mistyping a variable name creates
  a new global variable. In strict mode, this will throw an error,
  making it impossible to accidentally create a global variable.
In normal JavaScript, a developer will not receive any error feedback
  assigning values to non-writable properties.
In strict mode, any assignment to a non-writable property, a
  getter-only property, a non-existing property, a non-existing
  variable, or a non-existing object, will throw an error.

Please refer to http://www.w3schools.com/js/js_strict.asp to know more
Answer: "use strict" makes JavaScript code to run in strict mode, which basically means everything needs to be defined before use. The main reason for using strict mode is to avoid accidental global uses of undefined methods.
Also in strict mode, things run faster, some warnings or silent warnings throw fatal errors, it's better to always use it to make a neater code.
"use strict" is widely needed to be used in ECMA5, in ECMA6 it's part of JavaScript by default, so it doesn't need to be added if you're using ES6.
Look at these statements and examples from MDN:

The "use strict" Directive The "use strict" directive is new in
  JavaScript 1.8.5 (ECMAScript version 5). It is not a statement, but a
  literal expression, ignored by earlier versions of JavaScript. The
  purpose of "use strict" is to indicate that the code should be
  executed in "strict mode". With strict mode, you can not, for example,
  use undeclared variables.
Examples of using "use strict":
  Strict mode for functions: Likewise, to invoke strict mode for a
  function, put the exact statement "use strict"; (or 'use strict';) in
  the function's body before any other statements.

1) strict mode in functions
 function strict() {
     // Function-level strict mode syntax
     'use strict';
     function nested() { return 'And so am I!'; }
     return "Hi!  I'm a strict mode function!  " + nested();
 }
 function notStrict() { return "I'm not strict."; }

 console.log(strict(), notStrict());

2) whole-script strict mode
'use strict';
var v = "Hi! I'm a strict mode script!";
console.log(v);

3) Assignment to a non-writable global
'use strict';

// Assignment to a non-writable global
var undefined = 5; // throws a TypeError
var Infinity = 5; // throws a TypeError

// Assignment to a non-writable property
var obj1 = {};
Object.defineProperty(obj1, 'x', { value: 42, writable: false });
obj1.x = 9; // throws a TypeError

// Assignment to a getter-only property
var obj2 = { get x() { return 17; } };
obj2.x = 5; // throws a TypeError

// Assignment to a new property on a non-extensible object.
var fixed = {};
Object.preventExtensions(fixed);
fixed.newProp = 'ohai'; // throws a TypeError

You can read more on MDN.
Answer: There's a good talk by some people who were on the ECMAScript committee: Changes to JavaScript, Part 1: ECMAScript 5" about how incremental use of the "use strict" switch allows JavaScript implementers to clean up a lot of the dangerous features of JavaScript without suddenly breaking every website in the world.
Of course it also talks about just what a lot of those misfeatures are (were) and how ECMAScript 5 fixes them.
Answer: Small examples to compare:
Non-strict mode:

for (i of [1,2,3]) console.log(i)

// output:
// 1
// 2
// 3

Strict mode:

'use strict';
for (i of [1,2,3]) console.log(i)

// output:
// Uncaught ReferenceError: i is not defined

Non-strict mode:

String.prototype.test = function () {
  console.log(typeof this === 'string');
};

'a'.test();

// output
// false

String.prototype.test = function () {
  'use strict';

  console.log(typeof this === 'string');
};

'a'.test();

// output
// true
Answer: Note that use strict was introduced in EcmaScript 5 and was kept since then.
Below are the conditions to trigger strict mode in ES6 and ES7:

Global code is strict mode code if it begins with a Directive    Prologue that contains a Use Strict Directive (see 14.1.1).
Module code is always strict mode code.
All parts of a ClassDeclaration or a ClassExpression are strict mode    code.
Eval code is strict mode code if it begins with a Directive Prologue    that contains a Use Strict Directive or if the call to eval is a direct eval (see 22.214.171.124) that is contained in strict mode code.
Function code is strict mode code if the associated FunctionDeclaration, FunctionExpression, GeneratorDeclaration, GeneratorExpression, MethodDefinition, or ArrowFunction is contained in strict mode code or if the code that produces the value of the function's [[ECMAScriptCode]] internal slot begins with a Directive Prologue that contains a Use Strict Directive.
Function code that is supplied as the arguments to the built-in    Function and Generator constructors is strict mode code if the last argument is a String that when processed is a FunctionBody that begins with a Directive Prologue that contains a Use Strict Directive.
Answer: The main reasons why developers should use "use strict" are:

Prevents accidental declaration of global variables.Using "use strict()" will make sure that variables are declared with var before use.
Eg:
function useStrictDemo(){
 'use strict';
 //works fine
 var a = 'No Problem';

 //does not work fine and throws error
 k = "problem"

 //even this will throw error
 someObject = {'problem': 'lot of problem'};
}

N.B: The "use strict" directive is only recognized at the beginning of a script or a function.
The string "arguments" cannot be used as a variable:
"use strict";
var arguments = 3.14;    // This will cause an error

Will restrict uses of keywords as variables. Trying to use them will throw errors.

In short will make your code less error prone and in turn will make you write good code.
To read more about it you can refer here.
Answer: use strict is a way to make your code safer, because you can't use dangerous features that can work not as you expect. And, as was written before, it makes code more strict.
Answer: "use strict"; is the ECMA effort to make JavaScript a little bit more robust. It brings in JS an attempt to make it at least a little "strict" (other languages implement strict rules since the 90s). It actually "forces" JavaScript developers to follow some sort of coding best practices.
Still, JavaScript is very fragile. There is no such thing as typed variables, typed methods, etc.
I strongly recommend JavaScript developers to learn a more robust language such as Java or ActionScript3, and implement the same best practices in your JavaScript code, it will work better and be easier to debug.
Answer: JavaScript "strict" mode was introduced in ECMAScript 5.
(function() {
  "use strict";
  your code...
})();

Writing "use strict"; at the very top of your JS file turns on strict
syntax checking. It does the following tasks for us:

shows an error if you try to assign to an undeclared variable
stops you from overwriting key JS system libraries
forbids some unsafe or error-prone language features

use strict also works inside of individual functions. It is always a better practice to include use strict in your code.
Browser compatibility issue:
The "use" directives are meant to be backwards-compatible. Browsers that do not support them will just see a string literal that isn't referenced further. So, they will pass over it and move on.
Answer: Normally, JavaScript does not follow strict rules, hence increasing chances of errors. After using "use strict", the JavaScript code should follow strict set of rules as in other programming languages such as use of terminators, declaration before initialization, etc.
If "use strict" is used, the code should be written by following a strict set of rules, hence decreasing the chances of errors and ambiguities.
Answer: Use Strict is used to show common and repeated errors so that it is handled differently , and changes the way java script runs , such changes are :

Prevents accidental globals
No duplicates
Eliminates with
Eliminates this coercion
Safer eval()
Errors for immutables

you can also read this article for the details
Answer: "use strict"; Defines that JavaScript code should be executed in
   "strict mode".

The "use strict" directive was new in ECMAScript version 5.
It is not a statement, but a literal expression, ignored by earlier
versions of JavaScript.
The purpose of "use strict" is to indicate that the code should be
executed in "strict mode".
With strict mode, you can not, for example, use undeclared variables.

All modern browsers support "use strict" except Internet Explorer 9 and lower.
Disadvantage
If a developer used a library that was in strict mode, but the developer was used to working in normal mode, they might call some actions on the library that wouldn't work as expected.
Worse, since the developer is in normal mode, they don't have the advantages of extra errors being thrown, so the error might fail silently.
Also, as listed above, strict mode stops you from doing certain things.
People generally think that you shouldn't use those things in the first place, but some developers don't like the constraint and want to use all the features of the language.

For basic example and for reference go through :
https://www.tutorialsteacher.com/javascript/javascript-strict
Answer: JavaScript was designed and implemented hastily because of the browser wars and bad management. As a result many poor design decisions, un-intuitive syntax and confusing semantics found their way into the language. Strict mode aims to amend some of these mistakes.
But fixing these mistakes without creating alternative interpretation breaks backward compatibility. So, "use strict" directive creates that alternative interpretation of the code while communicating it to the programmer.
For example, this keywords refers to the object in a method definition, like this or self in other languages.
let o = {
  name: 'John Doe',
  sayName: function(){
    console.log(this.name);
  }
};

o.sayName(); // 'John Doe'

this has no purpose outside the method context but all JavaScript functions have this keyword whether they are methods or not:
function run() {
  console.log(this);
}

run(); // Window

Here this resolves to the global object which does not make sense and serves no purpose because global object is already available in the scope.
In strict mode this in a global function resolves to undefined, which is what we expect.
"use strict"

function run() {
  console.log(this);
}

run(); // undefined

Some mistakes can not be fixed even in strict mode because syntax should be valid for older browsers since they ignore "strict mode" directive. This is by design.
Answer: Strict mode can prevent memory leaks.
Please check the function below written in non-strict mode:
function getname(){
    name = "Stack Overflow"; // Not using var keyword
    return name;
}
getname();
console.log(name); // Stack Overflow

In this function, we are using a variable called name inside the function. Internally, the compiler will first check if there is any variable declared with that particular name in that particular function scope. Since the compiler understood that there is no such variable, it will check in the outer scope. In our case, it is the global scope. Again, the compiler understood that there is also no variable declared in the global space with that name, so it creates such a variable for us in the global space. Conceptually, this variable will be created in the global scope and will be available in the entire application.
Another scenario is that, say, the variable is declared in a child function. In that case, the compiler checks the validity of that variable in the outer scope, i.e., the parent function. Only then it will check in the global space and create a variable for us there.
That means additional checks need to be done. This will affect the performance of the application.

Now let's write the same function in strict mode.
"use strict"
function getname(){
    name = "Stack Overflow"; // Not using var keyword
    return name;
}
getname();
console.log(name);

We will get the following error.
Uncaught ReferenceError: name is not defined
at getname (<anonymous>:3:15)
at <anonymous>:6:5

Here, the compiler throws the reference error. In strict mode, the compiler does not allow us to use the variable without declaring it. So memory leaks can be prevented. In addition, we can write more optimized code.
Answer: Strict mode eliminates errors that would be ignored in non-strict mode, thus making javascript "more secured".

Is it considered among best practices?

Yes, It's considered part of the best practices while working with javascript to include Strict mode. This is done by adding the below line of code in your JS file.
'use strict';
in your code.

What does it mean to user agents?

Indicating that code should be interpreted in strict mode specifies to user agents like browsers that they should treat code literally as written, and throw an error if the code doesn't make sense.
For example: Consider in your .js file you have the following code:
Scenario 1: [NO STRICT MODE]
var city = "Chicago"
console.log(city) // Prints the city name, i.e. Chicago

Scenario 2: [NO STRICT MODE]
city = "Chicago"
console.log(city) // Prints the city name, i.e. Chicago

So why does the variable name is being printed in both cases?

Without strict mode turned on, user agents often go through a series of modifications to problematic code in an attempt to get it to make sense. On the surface, this can seem like a fine thing, and indeed, working outside of strict mode makes it possible for people to get their feet wet with JavaScript code without having all the details quite nailed down. However, as a developer, I don't want to leave a bug in my code, because I know it could come back and bite me later on, and I also just want to write good code. And that's where strict mode helps out.
Scenario 3: [STRICT MODE]
'use strict';

city = "Chicago"
console.log(city) // Reference Error: asignment is undeclared variable city.

Additional tip: To maintain code quality using strict mode, you don't need to write this over and again especially if you have multiple .js file. You can enforce this rule globally in eslint rules as follows:
Filename: .eslintrc.js
module.exports = {
    env: {
        es6: true
    },
    rules : {
        strict: ['error', 'global'],
        },
    };

Okay, so what is prevented in strict mode?

Using a variable without declaring it will throw an error in strict mode. This is to prevent unintentionally creating global variables throughout your application. The example with printing Chicago covers this in particular.

Deleting a variable or a function or an argument is a no-no in strict mode.
"use strict";
 function x(p1, p2) {};
 delete x; // This will cause an error

Duplicating a parameter name is not allowed in strict mode.
 "use strict";
 function x(p1, p1) {};   // This will cause an error

Reserved words in the Javascript language are not allowed in strict mode. The words are implements interface, let, packages, private, protected, public. static, and yield

For a more comprehensive list check out the MDN documentation here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
Answer: strict mode enables strict features in the v8 engine. Short example of some features:
You can enable it globally by writing:
'use strict'; // strict mode enabled!

Per function you just include in function:
let myfunc = () => {
  'use strict'; // strict mode enabled

   b = 0; // broke
}

You MUST declare a variable before using it (sane imo):

  var x;
  x = '0'; // ok
  y = '';  // not ok

es6 features are enabled (this is browser dependent), for node v4+ this is important.

Performance, in some cases, is better.

There are more features as well, check here for more!
Answer: This mode was first implemented in E S5 and it is used to enable strict mode in javascript.

It catches common coding mistakes and promotes better code quality
Some error are converted into exceptions. So code doesn't get crashed.
The value of 'this' remains unchanged if the function is not called likely as a method or a constructor
It obstructs duplicate parameter names like function (ax,de,ax). This is not allowed in strict mode.

Apart from that there are many features of strict mode and using it is necessary for creating complex codes.
Answer: In short and simple wordings for beginners, the use strict in javaScript applies stricter Rules to improve code quality and security.


WPF how to get site collection from SharePoint?

Question: This is my first post on this forum, so hello everyone.
On Site Settings->Site Collection Administration->Site Hierarchy there is list of sites created on SharePoint. I would like to get this list to by desktop application using web service.
How to get this list from SharePoint? Which method on web service use?
Comment: What version? If 2007, you'll be limited to traditional web services, if 2010, you'll be able to use the Client Object Model.
Answer:
The MSDN does have an answer if you want to code your solution..
You can ask the SPSite's "AllWebs" Property to get the list of Sitecollections
<code>  SPSite oSiteCollection = SPContext.Current.Site;
  SPWebCollection collWebsite = oSiteCollection.AllWebs;
</code>
More here: http://msdn.microsoft.com/en-us/library/ms462161.aspx
In addition to that you could use STSADM.exe to enumerate sitecollections:
STSADM -o enumsites -url http://%sharepoint%/
Annnd... before i forget that... Webservice would be like this:
http://%sharepoint%/_vti_bin/Webs.asmx
-> GetAllSubWebCollection


What the difference and usage of encodings UTF-8 and UTF-8-MAC in iconv?

Question: What the difference and usage of encodings UTF-8 and UTF-8-MAC in iconv?
I thought it was the difference between \n and \r(MAC OS 9) at first.
But I tried iconv -f UTF-8 -t UTF-8-MAC filename > filename2
The file content doesn't change in hex view.
Comment: It doesn't change in text view because the two version are (supposed to be) rendered the same.
Comment: @WGroleau I was talking about hex view not text view
Comment: Sorry—my eyes must be going.  I was sure I saw "text view."
Answer: As explained here, utf-8-mac is the utf 8 version of a text after application of Unicode normalization NFD (e.g accented characters are represented by the base character plus a combining accent character), with certain codepoint ranges excluded from the decomposition operation.
For example character é can be represented in two different equally valid ways in Unicode:

"\x{00E9}" - single codepoint, LATIN SMALL LETTER E WITH ACUTE, utf-8 C3 A9, "composed".
"\x{0065}\x{0301}" - two codepoints, LATIN SMALL LETTER E and COMBINING ACUTE ACCENT, utf-8 65 CC 81, "decomposed"

UTF-8-MAC will ensure that the second, decomposed form is always used.
Comment: Note that iconv seems to consistently quit with "unable to convert" when it reaches somewhere between 3900 and 4100 bytes into the file.  For several alternatives, see https://apple.stackexchange.com/questions/448408/conversion-script-for-unicode-combining-characters?noredirect=1#comment648652_448408
Comment: To normalize using `uconv` [check this related answer](https://unix.stackexchange.com/a/90164/209677)
Comment: For official Apple docs on this conversion see the (archived) [QA1173](https://web.archive.org/web/20100527091633/http://developer.apple.com/mac/library/qa/qa2001/qa1173.html)


Robot/AI short story about a group of robots on furlough/leave in the wilderness, hunted by humans

Question: I am trying to find the title of a short story about a group of robots on furlough/leave in the wilderness. There is a big snow storm and they are forced to leave the shelter where they are.  They think that humans are legend but encounter them and are (maybe) hunted by them as they travel...
Comment: Sounds interesting. Could you please add some further context? That is, did you read this story in a magazine or anthology? When did you read it (even a range of decades will help)? What language was it in? Was the planet Earth, or somewhere else? And so on...
Answer: How about 'The night of the storm' - short story by Dean Koontz.
Quoting description from Wikipedia:

"The Night of the Storm": a group of intelligent robots go on a hunting trip in the woods, where they learn that the myth of "human beings" may not be a myth after all.

I've got a copy in the 'Strange Highways' collection - may have been published elsewhere too?
The protagonist is 'Curanov', a robot built in an automated factory more than 100 years ago. Like all the others, the purpose of his existence is to gain more 'experiences', and he is bored of climbing mountains, exploring the arctic, etc because he's always adapted to the environment. In response, he visits a nature reserve to go hunting, while modifying himself to have less extraordinary senses and strength.
The are prepared for snow, and told that more is coming:

"Now," Janus said, "the only thing you need to know is that a storm is
  predicted for northern Montana early tomorrow night. By then you should be to
  the lodge that will serve as your base of operations, and the snow will pose
  no trouble. Questions?"

As Curanov and his companions set off, they are warned that

"we get a dozen reports each month about `human beings' sighted in wilder regions northwest of here."

After hunting a buck, they find hints that something not a robot is in the area:

"There," Tuttle said, pointing at the ground before them. "Footprints," Curanov said. Leeke said, "They don't belong to any of us." "So?" Curanov asked. "And they're not robot prints," Tuttle said. "Of course they are."    Tuttle said, "Look closer."

The consider following the tracks, but end up getting nervous in the forest and go back to their lodge. The discuss whether sentient organic beings are possible, but dismiss the idea:

"Have you ever encountered a single fleshy creature with even rudimentary intelligence in the manner of the robot?"

One of the robots disappears with their rifles overnight. The find him 'terminated' nearby, and decide to leave. They are followed and attacked by men:

Tuttle had fallen back under the relentless attack of a two-legged creature that moved almost as a robot might move, though it was clearly an animal. [...] A fleshy face stared back at him from a dozen feet away, blowing
  steam in the cold air. It was framed in a fur-lined hood: a grotesque parody
  of a robot face. Its eyes were too small for visual receptors, and they did
  not glow. Its face was not perfectly symmetrical as it should have been; it
  was out of proportion, also puffed and mottled from the cold. It did not even
  shine in the torchlight, and yet ...    ... yet ... obvious intelligence
  abided there.

Eventually Curanov escapes, although he realises that no-one would believe him, and his world-view is disturbed:

But Curanov was haunted by one icy realization: If he must believe in specters and other worldly beings like men, then he would never again be able to think of the universe in rational terms.
Comment: Your unattributed quotation is from [this Wikipedia page](https://en.wikipedia.org/wiki/Strange_Highways_(short_story_collection)).
Comment: According to the [ISFDB](http://www.isfdb.org/cgi-bin/title.cgi?67855) it was also published in a Roger Elwood anthology called [*Continuum 1*](http://www.isfdb.org/cgi-bin/pl.cgi?7952). Can you tell us any more about the story? Was the storm a **snow** storm? Are the robots hunted by human beings?
Comment: Dug out my copy of the anthology to add some of the quotes. Checked and definitely a snow storm, and while the hunters aren't explicitly labelled as humans, the text makes it clear that's what they are.
Answer: A long shot is "Robot's Return" by Robert Moore Williams.
Long shot because the robots are not in the wilderness or being hunted, but they do think that humans are not just "legend", but a crazy baseless myth that is simply too ridiculous to entertain seriously.
They must have been invented and constructed by other robots! Some piece of protoplasm could not possibly have invented robots!
Robots Seven, Eight, and Nine travel interstellar, maybe intergalactic, distances to ancient earth, and explore it, to search for their robotic creators, arguing the whole while.
One of them believes, one is adamantly skeptical, and one keeps searching.
They find only markers, or headstones.

Seven shifted his feet.
"Man," he spoke. "Man. That is a word for which we have no meaning.
"Perhaps," Eight spoke softly, "perhaps it was the life-form that created us."

It is worth getting the long shot out here: it drove me mad trying to remember the specifics of the story, and I've read it.
Although it is custom here to quote up to almost the entire story instead of providing the title and author so people can go find it and read it, I have read it only in some old bound anthologies anthologies (most recently, Adventures In Time And Space) that are back in the library.
However! The title and author are enough to get a "bright enterprising" reader started, eh?
Comment: The story can be read at the [Internet Archive](https://archive.org/stream/Astounding_v22n01_1938-09#page/n139/mode/1up). It is a story about robots, so that much matches.
Answer: It could be "But Who Can Replace a Man?" by Brian Aldiss.
A futuristic world in which machines are capable of thinking based on the tasks they have been designed to perform. One day the machines realise that the few remaining humans have died, leaving the machines to fend for themselves.
You can read it online as a PDF here.
Comment: There is no hunting of robots by humans in that story. Nor a snow storm. It does have robots in it though.
Comment: Where did you get that synopsis from? Is it the back cover or something you found online? Could you please cite it? (Googling revealed several sources with it so not sure).


Rising time of a planet or a star and its correlation with the angle subtended at the Earth

Question: While preparing for Astronomy Olympiad I came across many problems in which we had to calculate at what time a planet or a star would rise at the Earth, and to solve this many solutions found the angle subtended at Earth by the planet and then correlated it with the fact that Earth covers 360 degree in 24h. Now I did not understand at all why this was done and why is it giving us that time. Could anyone help me with this?
Comment: A lot of the answer you want depends on what the Olympiad expects you to know. E.g, (1) 24 hrs . is the mean solar day.  If you depend on the sun your watch would be +/- 15 minutes off at times during the year.  (2) Rise and set times depend on your latitude. Some stars never rise or set. (3) A star's rise/set gets a little bit earlier every day, accumulating to 24 hours in a year. Do the problems expect you to use a reference or do they provide the information you'd have to look up?
Answer: It's a little difficult to follow your question. But if I understand it correctly then you are considering the angle between the planet and the sun subtended at the Earth.
Now suppose that angle is 180 degrees.  The the planet is at opposition and the planet will rise at sunset (and set at sunrise) whatever that is in local time.
If the angle is 90 degrees (and recalling that the planet is approximately on the ecliptic plane), then the planet will rise and set at local noon and midnight (or the other way round if the angle is counterclockwise)
If the angle between the planet and sun is $x$ degrees then the planet will rise $x/15$ hours after/before the sun.  At least approximately and ignoring thing like inclination of the planet's orbit.  The "15" is because the Earth turns 15 degrees in one hour (or 360 degrees in 24 hours).
So the rise and set times, as local solar times, can be estimated from the angle subtended between the planet and the sun.


How can I tp a player to an entity without locking my vision

Question: I did a lot of testing but I can't find a way to /tp a player to an entity ( with the /fill clock ) without having all the time my vision locked. Every time I teleport to the entity I want, I can't move my head because it teleports me again. How can I teleport constantly to a entity and face where I want freely.
Answer: You are most likely adding the 2 unnecessary arguments to the tp command, the y-rot and x-rot, which goes at the end of the command.
It would be better if you had posted the command, but this is what your command souls look like
/tp @p @e[...]

Or if you use a flat x y z
/tp x y z

Do not add the last 2 numbers if you already have a x y z
Comment: When teleporting an entity to another entity, the teleported entity will inherit the rotation of the target. He is asking how to teleport an entity to another entity without inheriting the rotation.


How can I keep permissions on original files when restoring backups with Duplicity?

Question: When restoring files backed up by Duplicity, is there a way to keep the original permissions on the files extracted? I need to run the restore as root, and it seems that makes all the files restored owned by root.
Comment: Just as a suggestion, consider using rsync to do both, the backup and the restore.  It takes care of keeping the files ownership and properties correctly while also has a number of features like delta-backups.  (as commented, in order to preserve the ownership you will have to run whatever backup tool you choose as root)
Answer: Duplicity can and does restore permissions and owner of your files/folders as they were before the backup. To restore the owner two prerequisites have to be met:

The restore command has to be run as root, as only root is allowed to chown.
A user named the same needs to exist on the target machine.

During the restore process the files and folders will be owned by root, but once it finishes Duplicity will set the owner to reflect the original if the above demands are met.
..ede/duply.net


Override front page to not display promoted article

Question: Is it possible to override front page template to not display the promoted articles? I am using the promote to front page option to filter the contents in a  view so I cannot uncheck it.
Comment: why not create a new boolean field in the content and use that to filter, instead of using the promote as a variable?
Comment: I don't under when you say "I am using the promote to front page option to filter the contents in a view so I cannot uncheck it." please elaborate.
Answer: You can simply remove nodes attached to the front page in the preprocess.
/**
 * Implements template_preprocess_page()
 */
function THEME_preprocess_page(&$vars) {
  // Remove 'Promoted to front page' nodes
  if ($vars['is_front']) {
    unset($vars['page']['content']['system_main']['nodes']);
  }
}

Answer: You have quite a few options for this -

Use drupal's own configuration settings to override the front page at admin/config/system/site-information under Default front page option and via Menu API you can pass that path here,
Use Views module : create a page/block, display this block on the front page as <front> in Block config UI,
Use Drupal Panels module to completely change the front page.

As far as you are using promote to front page option in Views, can you please put some light on this, I think you are doing it the wrong way..
Answer: You can create a view for your frontpage with the right filters and exclude promoted articles in it.
Answer: What i assume to answer that you actually do not want to display the articles for promote to front page on the frontpage. Right?
Yes. You can create a article view as mentioned by 'user34680'.
Also in the edit mode of a view, you need to add a filter Content: Promoted to front page and select to no option. Please see the attached screenshot

Or
what i get from your questions is that you don't want to display the node with "promoted to front page" in your site home page.

So what you can do is to create a page--front.tpl.php without $page['content'] region printed in it.
Another way, you can assign a node or any custom page as you home page from site information

Hope you are looking for this.
Regards


Could life on earth survive after the sun becomes a white dwarf?

Question: It's my first time writing an original story and I have this idea, but I don't know if it could be scientifically feasible. My story would be medieval fantasy with magic, but I wanted to add a twist in it: at the end it becomes clear that the setting isn't another world, it's earth after the sun has gone out and became a white dwarf, which didn't happen because of natural causes but due to magic/fantasy things. So yeah, it's going to be a mix.
Anyway, I didn't want to make it too scientific, what I wanted to do was that humanity barely survived the red giant phase of the sun with technology (it doesn't matter what kind, the people that now live on earth don't know what technology is anyway), and then adapted to live in a world much colder than before and slowly life began again. But I read online that to be habitable, a planet must be really close to the white dwarf. Would it be too far-fetched if the earth was somehow pulled towards the sun with technology or some other thing?
What do you think, is this idea too crazy and unbelievable? Thank you for your help!
Comment: If you are willing to use magic, you could put the whole planet in a magic bubble if you want. But the scientific answer is NO.
Comment: What you could do is say the Ancient Civilization, while in the process of star lifting, was also collecting power off the sun with some sort of megastructure like a [Dyson Sphere](https://en.wikipedia.org/wiki/Dyson_sphere) or something similar, and were storing the energy on the Earth for later use.  After the sun is depleted, this energy is tapped to maintain the habitability of the planet.  It could also be what is providing the energy for the magic to work, if you wanted.
Comment: it's magic. If well written pretty much anything goes.
Comment: Earth won't survive red giant phase as Sun will expand *beyond* Earth orbit, adsorbing it before it will become a white dwarf.
Comment: With sufficiently advanced technology, you could keep the Earth safe from the latter stages of the Sun's lifetime (namely by *preventing* the red giant phase altogether via [Star Lifting](https://en.wikipedia.org/wiki/Star_lifting)), but once the sun is truly depleted it will no longer provide enough light for the Earth to be habitable as we traditionally see it.  If you somehow moved the Earth closer, like within 0.05 AU, it might be habitable, but that would be hard to do even for a civilization capable of star lifting.
Comment: @ZioByte Models disagree. Some have Earth surviving, possible moving into a larger orbit due to various changes (e.g. solar mass loss, tidal effects, etc.).
Answer: If the Earth is moved by the same magic that turned the sun into a white dwarf (or by some technological means), then maybe. The same methods used to move away from a red giant would also work to move closer to a white dwarf.
The luminosity of white dwarfs varies enormously, so you can tweak this a good deal, but a typical white dwarf will have a luminosity around 1% that of the sun. That means the Earth needs to be 1/10th as far away to get the same amount of light, which means the year is going to be about 9 hours long, assuming the sun retains the same mass. That's might be a bad assumption, though; white dwarfs formed through natural processes lose about half their original mass, in which case the year would be a little over 12 hours long. Somewhat coincidentally, the white dwarf sun would end up at almost the same angular size in the sky as the sun is right now! The reduction in the radius of the sun and the radius of Earth's orbit just about cancel out. The Earth would almost certainly also be tidally locked, so one side is always in daylight and the other is always in night. Otherwise, there would be pretty darn impressive tides! And by "impressive" I mean "probably catastrophic". Fortunately, tidally locked worlds can still be habitable, but they have some pretty weird climates. There's a pretty large body of literature on this subject, but a good starting point would be Climate model studies of synchronously rotating planets. A 3:2 spin-orbit resonance, such as Mercury has, might also be stable, though, in which case, with the 12-hour year around a reduced-mass sun, the solar day would end up just a smidge over 24 hours! How convenient!
And if there's a planetary nebula surrounding the new white dwarf sun, night times, whether eternal or not, could look pretty spectacular!
The sunlight would be much bluer--the whole world would look like an indoor scene lit with bright halogen bulbs--but our eyes would adapt to that just fine, and as would most plants; the wavelengths they need for photosynthesis would still be there, after all, just in slightly different proportions. The major issue would be a large increase in the amount of UV light the planet has to deal with, but that's not a total deal-killer. It just means you need a thicker ozone layer, and people get sunburnt more easily if they're outside without protection. Dark skin would be an evolutionary advantage much farther away from the tropics than it is now.
Answer: Maybe if the magic/technology let them move the orbit out a ways during the red giant phase, and then in much closer as it became a white dwarf


Suspect in past continuous (were suspecting )

Question: In my understanding 'suspect' is a stative verb, therefore is not used in continuous times. But I came across the following sentences: "I suggested to the team that what we were really suspecting was an intellectual disability." and "The accused was suspecting the fidelity of his wife Geetha.". Are these sentences correct and why?
Thanks in advance.
Answer: Suspect can be used in continuous forms, just like "think".
According to Merriam-Webster,
"suspect" can mean "to imagine ...", "to doubt ...", and all of them can be used in continuous forms.


Differences between continuous and simple

Question: I have been wondering if one could use the Present Progressive to express what is really going on when something happens. For example: "When you present something to the class, you are expressing your ideas, which is why public speaking is good".
Do I need to say: "You express your ideas"?
Answer: As with many choices of aspect (eg continuous or not; perfect or not), both are possible, and the difference is not in any objective circumstance, but in how the speaker wishes to present the temporal relationships and focus.
If the speaker says you express, this is a plain statement of what happens, with no special focus.
If the speaker says you are expressing they are are focussing on the activity of expressing ideas: in a way, they are inviting the hearer to mentally be present with the person presenting, and travel that "journey" with them. It invites a closer emotional involvement with what is being described.
Answer:
You express your ideas.

You put forward an argument why public speaking is beneficial for an individual. It's an idea, your opinion. You don't describe any situation in particular.

You are expressing your ideas.

It creates the impression for the listener that the event is happening now. It makes the idea more real and helps to hold people's attention.


iPhone SMS: Same Contact, Different Phone Numbers

Question: Is there any way to differentiate between a contact with different phone numbers in Messages?
Answer: Select the contact in the Messages app, then scroll to top and tap Contact Info.
The number to which this thread is sent to is highlighted.
But there is no way to know that from the "homepage", at least without jailbreaking.
Answer: First, open the Messages app.
Next, click the new message button in the top right of the screen.
Begin typing the name of the contact you want to text and you will see a list of their different phone numbers.  Select the one you want to message.
You won't be able to differentiate the numbers based on the name of the contact, but you will get a different chat thread for each phone number.


How do I pass parameters to a Visual Workflow?

Question: I need to pass an ID as an input parameter to a visual workflow.
I could not find any documentation on how to do it.
Is it possible?
Answer: The short answer is Yes, absolutely.
You can pass variables using the standard HTTP URL parameters.
So from the lead page you can have a link to launch a flow and pass the leadID as the following
nax.salesforce.com/flow/myLeadFlow?vaLeadID={!ID}
where vaLeadID is the unique name of the variable in flow.
If you are using a Visualforce Page with a flow embedded in it, you can pass the values using the  tag in a VF page, something like this:
<apex:page>
  <flow:interview name="MyFlow">
    <apex:param name="var1" value="Value1"/>
  </flow:interview>
</apex:page>

Answer: I think Metadaddy has it correct but what has thrown me not to use  for the longest time is that they never use it in a context that most people understand.  Using the Lead Id example that Metadaddy gave reference to in the URL pass through while applying it as a apex:param you would write it like this:
<apex:page>
  <flow:interview name="MyFlow">
    <apex:param name="vaLeadID" value="{!ID}" />
  </flow:interview>
</apex:page>
this will accomplish the same thing as the URL pass through.  The only issue that comes with this is it has to be a button or link on the Master/Parent of the object that you are trying to create not within a button on the related list.
Comment: I hope metadaddy has it right because he's been a lead developer at Salesforce for a bit. His example is in the Flow docs. There are a couple others also.


How to install the OpenJDK 8 (Ubuntu 19.04)?

Question: Only openjdk-11-jdk and newer seem to be available. Is there any way to install the OpenJDK 8? Preferably without adding a PPA.
Comment: You may download `jdk-8u212-linux-x64.tar.gz` (185.98 MB) directly from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and install it at `/opt/jvm` or any where you wish. Please note that this **NOT** `open jdk 8`.
Comment: I was hoping to find a PPA from the fine people over at https://adoptopenjdk.net - but haven't been able to find one yet.
Comment: @Marmayogi That wouldn't enable auto-updates. Preferably a solution would include an auto-update feature.
Comment: That is known thing @Andrew. It is up to questioner's choice. I too installed Oracle JDK 11 on /opt/jvm. Now JDK-12 is out and I just downloaded little while ago and going to install. One advantage is that I can switch  between JDK-11 and JDK-12 whenever need arises.
Comment: I made it very clear @FliegendeWurst that the download URL is for Oracle JDK-8 and **NOT** for `open jdk 8`.
Answer: As of now, 30 April 2019 02:00 UTC, Open JDK 8 and its associated packages have been added back to the normal Ubuntu 19.04 Disco Dingo repositories.
So you can now do the usual
sudo apt install openjdk-8-jdk

without adding any PPAs or downloading .deb packages.

As an aside, I believe the package was removed from 19.04 (while originally being there) because it was (erroneously?) removed from Debian testing (related bug report) and then cleaned up downstream. It has been re-added today by its maintainer Matthias Klose aka doko.
Comment: I just tried this on 11 May 2019 11:21 BST but it prints `E: Unable to locate package openjdk-8-jdk` - it seems to not be available again?
Comment: I can see from their website that it's in disco-updates in universe (https://packages.ubuntu.com/disco-updates/openjdk-8-jdk). Do you have that enabled in your system? Open "Software & Updates" and on the "Ubuntu Software" tab, enable "...(universe)" and on the "Updates" tab enable "Recommended updates (disco-updates)"
Comment: Thanks, it was the "Recommended updates (disco-updates)" in the "Updates" tab that wasn't enabled - I'm guessing this was because I chose to do a minimal installation rather than full one.
Answer: While PPA is the preferred method to install JDK 8 in order to get timely updates and fixes, but if you still want to install without PPA, you can download and install JDK 8 from Ubuntu's pool of Universe packages.

Download JDK and JRE:
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb

Install using dpkg:
sudo dpkg -i openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb \
openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb \
openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb \
openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb

Install dependencies:
sudo apt install -f

If you want to install using PPA, add openjdk-r ppa and install:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre

Answer: Kulfy's answer is working for me. However, I had to make some changes in order to make it work on Ubuntu 19.04.

Download JRE and JDK:
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb

Try to install using dpkg (\ didn't work for me, just use spaces):
sudo dpkg -i openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb openjdk-8-jre_8u191-b12-2ubuntu0.18.10.1_amd64.deb openjdk-8-jdk_8u191-b12-2ubuntu0.18.10.1_amd64.deb openjdk-8-jdk-headless_8u191-b12-2ubuntu0.18.10.1_amd64.deb

If you have missing dependencies, and error will be shown. Install the dependencies:
sudo apt install -f

After installing the dependencies, try to install again (Go to step 2).
Answer:
Press on left/bottom corner on  'show applications' or 'windows button'
Open Software & Updates
Make sure you have these 2 checked

4. Close(update)
5. Restart
Enjoy :)
Answer: On Launchpad OpenJDK builds (all archs) has ALL the versions of java JRE/JDK (OpenJDK


How to get ID3 tag info from Dropbox files?

Question: Is there an easy and efficient way to gather ID3 tag info from music files in my dropbox folder using the PHP API? I'm able to loop through the files and pull the information using the getFile API method and the id3_get_tag php function but this is very slow as you increase the number of music files.
Is there an efficient way to grab the id3 information from a large directory of music files?
Answer: You can have a look at the PHP Reader library, which should do what you're after using pure php. If it's faster than id3_get_tag or not, I do now know.


How much runout is acceptable in a disc brake rotor?

Question: I'm trying to sort out pad dragging / noises in Avid BB-7 mechanical disc brakes and I'm wondering how much runout in the rotor is acceptable? Right now I have about 0.05 mm (measured with a Park DT-3i).
Comment: I would say straight enough that it doesn't make any noise is the acceptable amount. But that's not very helpful to you, I feel.
Comment: Warped rotors are pretty much a fact of life, and the single most irritating aspect of disc brakes.  Across 4 different disc equipped bikes i've yet to have a rotor last more than 3-4 rides without exhibiting at least a little warping.
Not an answer, but my advice would be not to bother about minor dragging noises as long as they are not significantly slowing the wheel when you spin it, otherwise you'll spend as much time truing rotors as you do riding.
My LBS gave me this advice 4 years ago, but it wasn't until I had another 3 bikes with discs I saw how right they were.
Comment: I'm not sure but I think the caliper on the BB7 moves *both* pads inwards, unlike some cheaper types where one pad is stationary. In my opinion, that means they can cope with a bit more runout, Five hundredths of a millimetre doesn't sound bad to me, as long as it's not a 'sudden' kink. But what @alex said.
Answer: 0.05mm is nothing. Stop worrying about it. As long as rotor does not make noise or drags extensively on the pads, you'll be fine.
Rotors change shape every time you ride: you apply breaks a little longer than couple seconds, rotor heats up and expands, then cools down and shrinks. On extended periods of braking rotors can heat up enough to burn your fingers when you touch it (done it myself unfortunately). And when this level of temperature change is applied all sorts of transformation happens to the level of warping/runout. So you can spend all the time in the world to make rotor as true as possible, then you go for a ride and it all changed and rotor is nothing like you've left is last time when you fiddled with it.
Answer: I am truing a rotor right now and it started with enough brake rub to stop the wheel from free spinning in a stand.  I didn't get a number but estimate it had over 2mm of runout.
After 15 minutes of rough tweaking, it has 0.16mm of runout.  This results in slight pad rub for me.  The rotor visibly wobbles when the wheel is free-spun.
Finally after another 30 minutes effort, it is down to 0.065mm of runout, and while not perfect, its good enough.
Your 0.05mm (0.004 inches) should be fine and any further issues will be in your caliper, alignment or brake pad offset.

The BB5 and BB7 are single-sided calipers, and the pad setup is notoriously twitchy.

Set the outer pad wide open by tightening in the barrel adjusters.
Use a T25 torx through the wheel and tweak the dial so the inside/non-moving pad is just clearing the rotor.  This should be done after bedding in brake pads. When the wheel will free-spin, go back to the ouside/moving pad.
Then twiddle the barrel adjusters to just-not rub.  If you run out of adjust, you might need to move the inner cable inside its clamp.

At no point should you need to relax the caliper's mounting bolts - that will upset the parallelism of the pistons to the disk.
 Truing a rotor with a cheap chinese dial indicator, on a knockoff noga stand which is magged to a cheap mill-vise, which is clamped around a tine of an old steel fork, mounted vertically in a bench vise.  With some clamps added for confidence, I suspect the magnet was not doing much.
Answer: I usually replace my disk brake pads when I have 0.5 mm thickness. The reason I do that is because they can easily be smashed by the jaws to remove the braking material ( which will eventually fall apart ). After that it will result in a friction between the disk and the metal of the pads, which is very very bad.
I change the disk when it stops braking when I use a new disk brake pads. But for the thickness I should say that It depends how much are you loading them. As you say above disk with thickness of 0.05 mm is very hardcore ;).
You should really think of replacing that thin disk, because it can really surprise you when it breaks.
Comment: Runout refers to the wobble or bend of the disk.
Comment: Fortunately the disc is more like 1.8 mm thick, but I'm pretty hardcore about trying to get it straight :-)  For what it is worth, Avid recommends replacing the pads when they are worn to 3 mm thick (including the backing). They start at 4 mm, and 3 mm leaves about 1 mm of pad. For rotors that minimum thickness that has been quoted here is 1.6 mm. Beyond a certain point the rotor will be more likely to warp with heat – and as you suggest, to suddenly fail.
Comment: Yes, that's correct. I totally get what you are trying to make now. If the rotor is bent, it will slightly touch the pads, generating an awful creaking noise. This sound is also very hated by dogs and they start to chase you ( sometimes for not particular "heard by you" reason  ) Try adjusting the brake pads to the left/right. Thought I do not recommend you make it straight by force, because that will make mini-fractures inside the rotor and reduce its life.
Answer: If the rotor is bent. I would recommend replacing it instead of trying to fix it. This would give you peace of mind.
Comment: Also, parts aren't perfect. Some amount of runout is almost certain to exist and brake designers very likely design with an acceptable amount of runout in mind – you don't want people needlessly replacing parts (nor do you want your components to have a reputation for being difficult to maintain or adjust). So what I'm hoping to learn is what is typical, so that I have some data to make an ignore/repair/replace decision with.
Comment: Fair call - often a new part fixes the problem, but not replacing parts that don't need it works out cheaper.  OP has the right tools for measuring runout so I suspect he knows his way around a workshop.


How can I determine the encryption strength of an SSL connection

Question: If I've connected to a https url, how can I determine the cipher strength of the connection? My understanding is that after the asymmetric public-key handshake the information is encrypted using a symmetric key with a given strength but I can't seem to find that number (128-bit etc).
Please let me know if I am misunderstanding something with the process too.
Edit: The reason I ask is that I have a template for a security disclaimer that contains a statment This website uses XX-bit encryption and I'd like to fill that with the correct number.
Comment: which browser are you using?
Comment: IE8, but my users will use various different browsers and I'd like to make a statement on the website about the security it uses (see update). Or is such a statement impossible without knowing the browser?
Comment: Are you asking for client side in the browser or how to extract this on the server to be returned on the web page you are serving?
Comment: Just because your particular connection uses a certain bit-length, the web server (like Apache) can still be configured to use different key-lengths. `http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2009867`
Comment: I am not sure, but [sha2sslchecker.com](http://www.sha2sslchecker.com) can be help you.
Answer: The SSL symetric encryption is the result of a negotiation between client and server. It is possible to restrict it from the server side by using the configuration files. For example, apache SSL configuration include a
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

That can be tune to accept only the strongest encryptions, for example you may want to require only :
SSLProtocol all -SSLv3 -SSLv2
SSLCipherSuite HIGH:MEDIUM

Other variables can be used to do more things like client authentication or require per-directory ciphers.
You can also manipulate the negotiation from the client side. As for an example, please refer to this link that is talking a bit about Firefox SSL settings tuning. I assume other browsers have ways to do this as well.
It seems as this page says that :

The server decides upon the list of cryptography and compression algorithms sent by the client whether to continue or cancel the session. There must be at least one match in both lists, otherwise the session will fail. The cipher combination which took the highest place in the client's list will be used for future communication.

I'm looking for the official protocol.
Comment: I don't think you want `SSLProtocol all`...
Comment: The official SSL/TLS protocol is RFC 2246, 4346 or 5246, depending on the version (TLS 1.0 to 1.2). Bottom-line: the client sends an ordered list of supported cipher suites ("preferred" one coming first), then the server chooses one of them. Many SSL/TLS servers honor the client preferences, i.e. select the first cipher suite that they also support (depending on their configuration), but that's just Tradition.
Comment: In practice you only need regular 3DES with RSA key exchange (supported on NT4 and up) and AES variants (preferably with EDH key exchange): `DHE-RSA-AES256-SHA:AES128-SHA:DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA`.
Comment: @AviD never trust copy/paste :P I've remove the SSLv2. Thx.
Comment: @M'vy Recent research (POODLE vulnerability) reveals that you also have to remove SSLv3. Best is now SSLProtocol +TLSv1.2 +TLSv1.1 +TLSv1
Answer: SSL Labs have a SSL Server Test tool on their site which will test an SSL-enabled site and provide valuable information about its security (such as key length), including known vulnerabilities particular to the configuration.
Comment: +1 for SSL Labs, but this only tests for *support* - as @Justice answered, at runtime the protocol will select one of these, and its impossible to tell ahead of time what the client configuration will be using.
Comment: @AviD, valid point. As it's not possible to guarantee what the client will use, perhaps the OP could update his disclaimer to state "This website /supports/ XX-bit encryption"?
Comment: That's a good idea. Or, have it updated in runtime, according to the selected suite - but I'm pretty sure that's not so simple, if its even possible.
Comment: @AviD, Apache2 tells you which cipher is used, so you should have the information. It may not be that easy, though, to convert that string to a number of bits...
Answer: Hmm there are number of tools that you can use. On a Linux system:
Initiate a single SSL connection to the website via the browser etc....
Enter the command :
ssldump -i eth0 -p 80

This will elucidate the SSL handshake to the webserver (by dumping SSL traffic on the specific interface). The dump shows the cipher suite used.
Look for this : cipherSuite         TLS_RSA_WITH_RC4_128_SHA
You may need to replace eth0 with the name of your default ethernet interface.
Comment: Note that the `-p` command line option is not the PORT but the PASSWORD. So "80" is probably not correct?
Answer: SSL includes a feature known as "ciphersuite negotiation". The client presents a list of ciphersuites that it is willing to use, and the server selects its favorite from that list. Although you may test your website using your copy of some browser, someone else might be using a different browser with a different configuration and your website may use a weaker ciphersuite for that person.
You should check the documentation for your web server to understand how to configure your web server to use only those ciphersuites that meet your needs.
Answer: If you are using Chrome, and maybe Firefox, you can click on stuff to the left of https://xxx in the URL bar and check it. It will tell you which cipher suite was selected (like RC4 or AES), and the size of the key used.
I'm using Safari at the moment (new MacBook Air), and I don't immediately see how to do this. Clicking on the lock icon in the upper right only shows me the certificate, but not the strength of the current connection.
The other way of doing this is with a packet sniffer -- the very thing SSL is supposed to protect against. The first few packets, where they negotiate the encryption algorithm and strength, are unencrypted. You can see from them which strength they've chosen for a connection.
Comment: Added explicit steps and details in my answer to compliment Robert's answer.
Answer: I just wanted to add to the answers above that the only way to get the result you need is to have the server not do negotiation or do but using only some ciphers of the same length.
For example, in apache, you could add
SSLRequire %{SSL_CIPHER_USEKEYSIZE} = 256

to only accept 256 key size.
But be careful, as this will probably lead to clients not being able to connect if they don't offer a cipher suite allowed by the server. If you go down this path you should monitor the ssl negotiation errors at the server for some time to make estimates.
Answer: Clientside:
For Firefox there is an extension: https://addons.mozilla.org/en-US/firefox/addon/cipherfox/
Right-click and selecting "View Page Info" works too.
Serverside:
see How can I determine the encryption strength of an SSL connection
Answer: On IE-8 after you have browsed to an https site you can select File->Properties and it will show the type of encryption being used.
For Firefow click the lock icon to the left of the URL and select More Information.
Answer: To add to @Robert-David-Graham answer:
In Chrome when you click on the lock icon the Developer Tools > Security tab appears. Refresh the page to get the security info for the page origin(s). Then use the left nav to switch from the Overview to the Main Origin (or any other origin). There you will see Connection Protocol, Key Exchange, and Cipher Suite.
Answer: The ciphersuite is chosen by client and server.
The client sends a list of acceptable ciphersuites to the server ordered by preference. The server then chooses one and informs the client. The server is supposed to respect the clients preferences but may not actually do so (In apache the setting "SSLHonorCipherOrder" controls this).
Most browsers will provide a way to see what ciphersuite is in use, for example in firefox you click on the icon next to the address bar. Then click the sideways arrow, then click more information. For example from google I get.
TLS_ECDHE_RSA_WITH_AES128_GCM_SHA256
Theres various information in that string (google it if you want a full explanation) but the important bit for this question is "AES128-GCM". This tells you that the encryption algorithm is AES 128 (so 128 bit encryption) in GCM mode.

The reason I ask is that I have a template for a security disclaimer that contains a statment This website uses XX-bit encryption and I'd like to fill that with the correct number.

The danger with what you propose is that the selected encryption algorithm will depend on the client. For example the least-bad encyrption algorithm supported by SSL/TLS stack in windows XP (used by IE, among other things) is 3DES which is considered to have an effective security level of 112 bits.


How do I run Docker IBM MQ for Developers on Windows?

Question: How do I run Docker IBM MQ for Developers on Windows?
Answer: Assuming that you have installed docker on windows, the command is:
<code>docker run \
  --env LICENSE=accept \
  --env MQ_QMGR_NAME=QM1 \
  --publish 1414:1414 \
  --publish 9443:9443 \
  --detach \
  ibmcom/mq
</code>
Comment: Why publish both 1414 and 9443 ? I assume it's localhost:1414 and localholst:9443 ?
Answer: Docker isolates processes from the host OS, it is not a virtual machine technology where there is a guest and host OS. When running Docker you have access to only one operating system. Since IBM MQ images are Linux images, it will be challenging to run them on Windows.
You could try running the LinuxKit on Docker Windows and then start the IBM MQ container.
Another option is a workaround, use Linux to run Docker instead of Windows. You can set up a Linux VM on Windows using for example VirtualBox. If you do not want to use a VM on your laptop, you can use a free AWS EC2 tier to run a Linux VM and install IBM MQ for Developers there.


How to power a raspberry pi and brushless motor from wall outlet

Question: I am working on a device that uses a raspberry pi (5v and 2.5 amps) and a brushless dc motor (11.1V at .066 amps --
 http://1012007.kancart.com/item_description/431).  I want the device to plug directly into the wall.  How would I go about finding a power supply that can power both of these devices?
Comment: You left out a lot details between the gimbal motor and the wall. http://gimbal.cheesycam.com/wp-content/uploads/2014/06/SimpleBGC-Basecam-32-Bit-schematic-wiring-diagram-joystick-remote-brushless-motors-pitch-roll-yaw.jpg
Comment: That gimbal motor can draw up to 10 A so you are looking for a power supply of at least 120 W peak capacity. Not exactly a wall wart type solution.
Comment: But it says it can run on .066A so it should be fine still if it only has .066A right?   It may just not move as fast
Answer: You require two different voltages. Your options are:

Use a USB mains power supply for the Pi and a 12 V, 500 to 2000 mA mains power supply for the motor. That means two wall warts. Very cheap and less likelihood of the Pi getting interference from the motor.
Use a 12 V supply and a voltage regulator to drop the voltage to the Pi. This is a bit more bother but neater on the mains side.

I'd go with the first one. You probably have a suitable PSU lying around. If it all works and you want to tidy it up then look at the second option.

Edit:
I took your 0.066 A motor current as being max or close to max. As pointed out in the comments, it can, for some reason, draw up to 10 A. This isn't typical wall-wart capability.
Comment: you also need a 3phase type controller for desired f to get desired RPM
Comment: Maybe. I assumed he had that.
Comment: Will it be a problem if the ground and power supply are attached to an entire different power supply as the pin that controls the motor?  Like if the grounds aren't connected will it cause problems?
Comment: I think you are into something over your head to control a gimbal motor if you dont know the logic and motor driver must use a common ground.