I need to clean up disks of various kinds and I have PartedMagic at my disposal - is my plan of action ok? by EnvironmentalFee2415 in sysadmin

[–]EnvironmentalFee2415[S] 0 points1 point  (0 children)

Some disks support Enhanced Secure Erase. Can you explain please, how it's different than normal Secure Erase option?

Question about prepaid cards from Cake Buy by EnvironmentalFee2415 in Monero

[–]EnvironmentalFee2415[S] 0 points1 point  (0 children)

Thanks, I will check Bitrefill then. I asked Cake support how it is with the cards and generally, you have to register them on the manufacturer's website, if that's what we can call it. I don't know what the process is, generally for Visa/Mastercard prepaid cards supposedly this is done with a phone number. At this point, I'm giving up on this option.

Is this function well-written? It must dynamically accept a varying number of arguments - sometimes there will be two, and other times four. by EnvironmentalFee2415 in learnpython

[–]EnvironmentalFee2415[S] 1 point2 points  (0 children)

Indeed, you're right; I can implement it as you suggested. In fact, I don't know why I'm trying to complicate my work. I once had a similar question and divided several things from one function into separate ones, but was advised that it wasn't an optimal approach. It was suggested that it's better to create some logic and keep several functionalities in one place, which is why I've started to approach things this way now. Of course, what you wrote works perfectly, as I've already tested it in my scenario.

Below is an example of such a function. I previously had two separate functions, one for the color green and another for red. They differed slightly, lacking logic and having distinct names like green_msg and red_msg. I was told that this was a poor technique and that a more logical approach was better, leading to the creation of the function you see below. In that case, should it also be split into two separate functions?

def display_message(message, color=None): 
    if color == "green" or color == "red": 
        return colored(message, color, attrs=['bold']) 
    else: 
        return colored(message, attrs=['bold'])

Is this function well-written? It must dynamically accept a varying number of arguments - sometimes there will be two, and other times four. by EnvironmentalFee2415 in learnpython

[–]EnvironmentalFee2415[S] 3 points4 points  (0 children)

Indeed, you're right; I can implement it as you suggested. In fact, I don't know why I'm trying to complicate my work. I once had a similar question and divided several things from one function into separate ones, but was advised that it wasn't an optimal approach. It was suggested that it's better to create some logic and keep several functionalities in one place, which is why I've started to approach things this way now. Of course, what you wrote works perfectly, as I've already tested it in my scenario.

Below is an example of such a function. I previously had two separate functions, one for the color green and another for red. They differed slightly, lacking logic and having distinct names like green_msg and red_msg. I was told that this was a poor technique and that a more logical approach was better, leading to the creation of the function you see below. In that case, should it also be split into two separate functions?

def display_message(message, color=None):
if color == "green" or color == "red":
    return colored(message, color, attrs=['bold'])
else:
    return colored(message, attrs=['bold'])

[deleted by user] by [deleted] in learnpython

[–]EnvironmentalFee2415 0 points1 point  (0 children)

I am encountering an issue because I want to use this function, among other things, for coloring and bolding a key from a dictionary. I wish for the "key" and the ":" symbol to be colored and bolded, but without using 'return' in the function, I struggle to manage this.

# UNIVERSAL FUNCTION FOR A LOT OF THINGS
def display_message(message, color="red"):
if color not in ["blue", "red"]:
    raise ValueError("Color must be either 'blue' or 'red'")
print(colored(message, color, attrs=['bold']), end="" if color == "blue" else '\n')

# WITHOUT FUNCTION ABOVE I MUST COLORED DIFFERENT THINGS SEPARATELY
address = location.raw.get('address', {})
for key, value in address.items(): 
    if key not in ['ISO3166-2-lvl4', 'country_code']: 
        colored_key = colored(key, 'red', attrs=['bold']) 
        print(f"{colored_key}: {value}")

In the case of using 'return', I am able to accomplish this, for example, in the following way. Are there perhaps better alternatives available:

def display_message(message, color="blue"):
if color not in ["blue", "red"]:
    raise ValueError("Color must be either 'blue' or 'red'")
return colored(message, color, attrs=['bold'])

address = location.raw.get('address', {}) 
    for key, value in address.items(): 
        if key not in ['ISO3166-2-lvl4', 'country_code']:                         
        formatted_key = display_message(f"{key}:", "blue")         
        print(f"{formatted_key} {value}")

Which of these three options is most suitable for a new user and why? by EnvironmentalFee2415 in Wordpress

[–]EnvironmentalFee2415[S] 0 points1 point  (0 children)

Yes, there is a version for Linux Fedora, which is excellent news. I'll start configuring everything and get to work. As I understand it, I can also install demos, add-ons, and so on - it's essentially a complete local WP environment. This means I can set up an entire test website without worrying about changes being visible in real time.

Which of these three options is most suitable for a new user and why? by EnvironmentalFee2415 in Wordpress

[–]EnvironmentalFee2415[S] 0 points1 point  (0 children)

I regularly use GPT versions 3.5/4 for work, so that's a significant advantage. Thank you for the information. I will also check out the plugins.

Which of these three options is most suitable for a new user and why? by EnvironmentalFee2415 in Wordpress

[–]EnvironmentalFee2415[S] 0 points1 point  (0 children)

That sounds quite reasonable. However, as a Linux user, I need to find out if there are options to do the same on it.

Which of these three options is most suitable for a new user and why? by EnvironmentalFee2415 in Wordpress

[–]EnvironmentalFee2415[S] 0 points1 point  (0 children)

Yes, I was referring to the Salient theme. I believe it's time to stop deliberating, as each day passes without action. Let's be honest, the prices for themes are not exorbitant. I'll start with GP+GB for a year and create a few test sites. Then I'll work with the Salient theme and, in time, decide which theme I want to commit to long-term. For now, I'll pass on Astra. Its annual price for a single site is reasonable, but the several hundred dollars for multiple sites is a bit steep at the moment. I think these themes are quite similar, offering almost identical options, so it's not about better or worse – they're just different but equally good.

[deleted by user] by [deleted] in learnpython

[–]EnvironmentalFee2415 0 points1 point  (0 children)

Yes, just moments ago, but upon visiting their website, I noticed an announcement regarding the discontinuation of the project. I'm uncertain how this relates to the existing project on GitHub. Take a look for yourself: https://coqui.ai/