Python cannot convert a floating-point string to an integer in one step.
When you get the error message
Exception: invalid literal for int() with base 10: ‘7.0’
Convert the string to float first
a = int(float(str))
Knowledge Base for IT Professionals, Teachers and Astronauts
Python cannot convert a floating-point string to an integer in one step.
When you get the error message
Exception: invalid literal for int() with base 10: ‘7.0’
Convert the string to float first
a = int(float(str))
The Kerbal space program tutorials still reference the old LV-T45 “Swivel” Liquid Fuel Engine, but the default Engines tab does not contain it. To access the engine
To change a Git commit message after the commit has been pushed
git rebase -i HEAD~3
git push --force-with-lease
This command will abort if there was a change in the repository since the original commit.
To install some Python modules we need to use alternate names in the pip install command
Module name | Install command |
googleapiclient | pip install google-api-python-client |
When we start to use a Python module, we need to install it on our workstation, and on the server, or in the Docker container where the application will run.
ModuleNotFoundError: No module named ‘googleapiclient’
Usually, we install the module with the pip install MODULE_NAME command, but when we try it for the googleapiclient we get the error message
ERROR: Could not find a version that satisfies the requirement googleapiclient (from versions: none)
ERROR: No matching distribution found for googleapiclient
To install the googleapiclient Python module, use the command
pip install google-api-python-client
To install the module in the Docker container add the line to the Dockefile
# Install app dependencies
run pip install --upgrade google-api-python-client
Stream Deck is a great programmable keyboard to organize frequently used functions in games and other programs. In games, we usually store one keystroke per button, but we can store longer macros for Google Sheets and other applications.
To store multiple keystrokes in one Stream Deck button
When we launch an AWS EC2 instance with Windows 2012, Windows 2016, Windows 2019, the “Administrator” local account is automatically created and added to the Administrators group. We can decrypt the Administrator password using the private key of the key pair we used to launch the server.
On Windows servers WINRM access is necessary during the bootstrap process to install the Chef Infra Client and set up the node to communicate with the Chef Infra Server.
When we try to access the instance via WINRM using the “Administrator” account, the Windows Event Log saves an error entry with Login Failure.
To access the server with WINRM
In the Terraform script to create an AWS EC2 instance, we can specify the volume sizes. Separate arguments describe the root and data volumes. This feature enables the script to create the volumes without specifying the connection attributes in another block.
The Terraform documentation does not show the syntax, and the Terraform example at the time of writing this in GitHub is NOT correct at https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/blob/528613d4580f2c1266e87d8d24fc25bf5290fe2c/examples/complete/main.tf#L113
If the syntax is not correct get the error message:
An argument named “root_block_device” is not expected here. Did you mean to define a block of type “root_block_device”?
An argument named “ebs_block_device” is not expected here. Did you mean to define a block of type “ebs_block_device”?
The correct syntax is
resource "aws_instance" "default" {
ami = "ami-0da7a37366e7ee5f0"
instance_type = "t3.medium"
...
root_block_device {
volume_type = "gp2"
volume_size = 100
tags = {
Name = "my-root-block"
}
}
ebs_block_device {
device_name = "xvdf"
delete_on_termination = true
volume_type = "gp2"
volume_size = 500
}
...
}
Ha megváltoztatjuk az Előnyben résszesített kimeneti formátumot, a Calibre program néha továbbra is az előző beállítás szerint konvertálja a könyveket.
Hogy felfrissítsük a beállítást
Ezeken az oldalakon ingyen letölthető elektronikus könyvek találhatók
Ingyenes, legálisan letölthető elektronikus könyvek