To prompt for credentials, you should almost always use the Get-Credential cmdlet:
$credential = Get-Credential
Pre-filled user name:
$credential = Get-Credential -UserName 'myUser'
Add a custom prompt message:
$credential = Get-Credential -Message 'Please enter your company email address a...
To store and retrieve encrypted credentials easily, use PowerShell's built-in XML serialization (Clixml):
$credential = Get-Credential
$credential | Export-CliXml -Path 'C:\My\Path\cred.xml'
To re-import:
$credential = Import-CliXml -Path 'C:\My\Path\cred.xml'
The important thing to remem...
redis-cli is the Redis command line interface program that allows to send commands to Redis and read the replies sent by the server, directly from the terminal. Basic command line usage is below:
Access to redis:
$ redis-cli
127.0.0.1:6379>
Access to redis with authentication:
$ redis-cli ...
By default, most of the information is hidden from the user. You can use -v switches to get a verbose log of the connection attempt, which will usually pinpoint the problem by showing why the behavior is different than you expect.
Let's assume you are connecting to the server example.com using ssh ...
See also the Mercurial Tutorial
Creating a Mercurial Repository
A Mercurial repository is simply a directory (referred to as the "working directory") containing an .hg directory with metadata about the contents of the repository. This makes Mercurial very lightweight and easy to start us...
Add typings to your package.json
{
...
"typings": "path/file.d.ts"
...
}
Now when ever that library is imported typescript will load the typings file
Sometimes it is necessary or desirable to place the legend outside the plot. The following code shows how to do it.
import matplotlib.pylab as plt
fig, ax = plt.subplots(1, 1, figsize=(10,6)) # make the figure with the size 10 x 6 inches
fig.suptitle('Example of a Legend Being Placed Outside of...
Fire after the view has been fully initialized.
(Only available for components)
import { Component, AfterContentChecked } from '@angular/core';
@Component({
selector: 'so-aftercontentchecked-component',
templateUrl: 'aftercontentchecked-component.html',
styleUrls: ['aftercontentc...
Fire after the check of the view, of the component, has finished.
(Only available for components)
import { Component, AfterViewChecked } from '@angular/core';
@Component({
selector: 'so-afterviewchecked-component',
templateUrl: 'afterviewchecked-component.html',
styleUrls: ['afte...
1. Character Class
Character class is denoted by []. Content inside a character class is treated as single character separately. e.g. suppose we use
[12345]
In the example above, it means match 1 or 2 or 3 or 4 or 5 . In simple words, it can be understood as or condition for single characters (...
This directive is useful to limit input events based on certain existing conditions.
The ng-disabled directive accepts and expression that should evaluate to either a truthy or a falsy values.
ng-disabled is used to conditionally apply the disabled attribute on an input element.
HTML
<input t...
C++11 introduced core language and standard library support for moving an object. The idea is that when an object o is a temporary and one wants a logical copy, then its safe to just pilfer o's resources, such as a dynamically allocated buffer, leaving o logically empty but still destructible and co...
Suppose we want to count how many counties are there in Texas:
var counties = dbContext.States.Single(s => s.Code == "tx").Counties.Count();
The query is correct, but inefficient. States.Single(…) loads a state from the database. Next, Counties loads all 254 counties with all of the...
select_dtypes method can be used to select columns based on dtype.
In [1]: df = pd.DataFrame({'A': [1, 2, 3], 'B': [1.0, 2.0, 3.0], 'C': ['a', 'b', 'c'],
'D': [True, False, True]})
In [2]: df
Out[2]:
A B C D
0 1 1.0 a True
1 2 2.0 b False
2...
This example shows how to create a prepared statement with an insert statement with parameters, set values to those parameters and then executing the statement.
Connection connection = ... // connection created earlier
try (PreparedStatement insert = connection.prepareStatement(
"i...
You can start the mongo shell by running the following command inside your Meteor project:
meteor mongo
Please note: Starting the server-side database console only works while Meteor is running the application locally.
After that, you can list all collections by executing the following command...
You can search Docker Hub for images by using the search command:
docker search <term>
For example:
$ docker search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. ...
When defining a function, use {param1, param2, …} to specify named parameters:
void enableFlags({bool bold, bool hidden}) {
// ...
}
When calling a function, you can specify named parameters using paramName: value
enableFlags(bold: true, hidden: false);