Given that the data directory of the server is empty:
The server is initialized.
SSL certificate and key files are generated in the data directory.
The validate_password plugin is installed and enabled.
The superuser account 'root'@'localhost' is created. The password for the superuser is set ...
To reveal the default "root" password:
shell> sudo grep 'temporary password' /var/log/mysqld.log
Change the root password as soon as possible by logging in with the generated temporary password and set a custom password for the superuser account:
shell> mysql -uroot -p
mysql...
Processing Field collection items with Rules is fun, really! Have a look at this Rule (in Rules export format):
{ "rules_calculate_sum_of_prices_in_all_field_collection_items" : {
"LABEL" : "Calculate sum of prices in all field collection items",
"PLUGIN...
Keychain allows to save items with special SecAccessControl attribute which will allow to get item from Keychain only after user will be authenticated with Touch ID (or passcode if such fallback is allowed). App is only notified whether the authentication was successful or not, whole UI is managed b...
In Strict Mode, functions declared in a local block are inaccessible outside the block.
"use strict";
{
f(); // 'hi'
function f() {console.log('hi');}
}
f(); // ReferenceError: f is not defined
Scope-wise, function declarations in Strict Mode have the same kind of binding as l...
Use case: just one action which should return a plain (text) content as-is:
public function actionAsXML()
{
$this->layout = false;
Yii::$app->response->format = Response::FORMAT_XML;
return ['aaa' => [1, 2, 3, 4]];;
}
Pre-defined response formats are:
FORMAT_HTM...
In the following we will install Plesk Onyx on Windows Server (2016) using the Plesk Installer GUI.
Preparations
For installing Plesk we need a running Windows Server (2012/2016) installation. The Hardware recommendation is a minimum of 2GB RAM and 30GB free disk space. Have a look at the official...
strComputer = "."
instances = 0
processName = "chrome.exe"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objProcess in colP...
To calculate the sum of terms (of type float, int or big integer) of a number list, it is preferable to use List.sum
In other cases, List.fold is the function that is best suited to calculate such a sum.
Sum of complex numbers
In this example, we declare a list of complex numbers and we calcu...
One of the most critical parts of dealing with NMS code is being able to support mulitple Minecraft versions. There are numerous ways to do this, but a simple solution is to use this code to store the version as a public static field:
public static final String NMS_VERSION = Bukkit.getServer().getC...
This example shows how to obtain the ancestry of a component using the ClassType and ClassParent properties. It uses a button Button1: TButton and a list box ListBox1: TListBox on a form TForm1.
When the user clicks the button, the name of the button’s class and the names of its parent classes are ...
Set-Content -Path myfile.txt -Value 'PowerShell Rocks'
Write-S3Object -BucketName powershell -File myfile.txt
Uploading files from your local filesystem into AWS S3 is easy, using the Write-S3Object command. In its most basic form, you only need to specify the -BucketName parameter, to indicate ...
Use the GitHub repository to get the entire code:
https://github.com/firebase/functions-samples/blob/master/quickstarts/email-users
Copy or clone the repository in your computer.
Now go to your Firebase Console
Create a Firebase Project using the Firebase Console.
Enable the Google Provid...
If you add this to your functions.php it removes the WordPress version number from the RSS feed and the header.
function remove_wordpress_ver() {
return '';
}
add_filter('the_generator', 'remove_wordpress_ver', 999);
This macro gives the output of a given line as the first argument of the next line function call. For e.g.
(rename-keys (assoc {:a 1} :b 1) {:b :new-b}))
Can't understand anything, right? Lets try again, with ->
(-> {:a 1}
(assoc :b 1) ;;(assoc map key val)
(rena...
This will be our example data frame:
df = pd.DataFrame({"color": ['red', 'blue', 'red', 'blue']},
index=[True, False, True, False])
color
True red
False blue
True red
False blue
Accessing with .loc
df.loc[True]
color
True red
True red
...