What Does a Colon Mean in Python when You See Something Like This “new_var = a[i:i + counter]”?

Question
You are not familiar with this example of a colon. It appears to be an assignment of a value to itself. You have seen Python function signatures with colons to explain the data type. You have seen colons to signify an if conditional or a for loop. You are not sure what this line of code does:

new_var = a[i:i + counter]

What does this type of colon syntax mean?

How Do You Use Python to Find The Latest Prices of Bitcoin, Ethereum, Litecoin and Ripple?

Problem scenario
You want to use Python to calculate the latest price of various cryptocurrencies. What should you do?

Solution
Prerequisite

This assumes you have installed pip.

Procedures
Install the Python package cryptocompare: pip install cryptocompare

Run this program:

import cryptocompare

print(cryptocompare.get_price(‘BTC’, ‘USD’))
print(cryptocompare.get_price(‘BTC’, ‘USD’))
print(cryptocompare.get_price(‘ETH’, ‘USD’))
print(cryptocompare.get_price(‘LTC’, ‘USD’))
print(cryptocompare.get_price(‘XRP’, …

How Do You Solve the Login Prompt Message “Cloud-init…modules:final…Datasource”?

Problem scenario #1
You just installed Linux on a new VM. You boot up your Debian distribution of Linux (e.g., running via Oracle VirtualBox). You see at the login prompt, “cloud-init…running modules:config…DataSourceNone…cc_final_message.py[WARNING]: Used fallback datasource”. What should you do?

Problem scenario #2
You recently created a new server. When you boot your Debian/Ubuntu/Mint server, it seems to hang with an error message about “cloud-init cc_final_message_py [warning]: used fallback datasource.” What should you do?

Is It a Recommended/Best Practice to Have a Code Freeze?

Problem scenario
You want to have a release. You are concerned that if new code changes are made to the main branch of the relevant repository that the upcoming production release will have a problem. You are not sure if you should allow changes to take place or if should you have a code freeze. Is it a best/recommended practice to have a code freeze going into the release weekend?

Is It a Best/Recommended Practice to Check Code in Frequently?

Problem scenario
You read that it was usually a best practice to check code in daily or more frequently to the main branch. Is this always true?

Solution
No, it is not always true. It is advisable to check code in regularly, but you cannot always check code in this frequently.

In some situations a developer would be terminated for checking in code daily.

Earn Interest on Your Crypto

While some people recommend you purchase a wallet, if you do not mind storing your crypto on a third party platform, you could earn interest.

Some of the advertised rates are above 5%. The cryptocurrency is not backed by FDIC. To learn more about how it works, see these postings:

If you want to receive free cryptocurrency by just learning more,

How Do You Launch the Amazon Workspaces Client from Your Debian Server?

Problem scenario
You have installed the Amazon Workspaces Client on your Ubuntu or Linux Mint server. You want to start the application from the GUI desktop. What do you do?

Possible solution #1
Run this command: sudo find / -name workspacesclient*

Possible solution #2
Try running this from the terminal:
/opt/workspacesclient/workspacesclient

What Do You Do if the Data Input Does Not Fit in Memory in Computer Programming?

Problem scenario
You have a massive amount of data to process. The amount is too big for the server you have. How do you write a program or algorithm to handle a very large set of data?

Possible Solution #1
Logically divide the memory by writing portions of the data to files. This is called “chunking” the data. Serially/sequentially process batches.

How Do You Find out if UAC is Enabled on Your Windows Computer?

Problem scenario
You are using either Windows Server 2019 or Windows 10. You want to know if UAC is enabled or not. What should you do?

Solution
Open PowerShell. Run this:

If((Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).EnableLUA -eq 1) { echo “UAC is enabled”} Else {echo “UAC is NOT enabled”}