milon

joined 2 years ago
[–] milon@lemm.ee 2 points 4 days ago

Yeah I think I will follow the same approach. 3rd parties are a bit risky.

[–] milon@lemm.ee 1 points 6 days ago (2 children)

Thanks for the additional info. Maybe I will opt for the developer version instead in that case.

[–] milon@lemm.ee 1 points 6 days ago

Yup no issues here

[–] milon@lemm.ee 2 points 6 days ago

I see now. So it's possible for someone to run into multiple issues which can make updating a hassle.

[–] milon@lemm.ee 4 points 1 week ago
[–] milon@lemm.ee 2 points 1 week ago (4 children)
[–] milon@lemm.ee 2 points 1 week ago (2 children)

Yes, I did. I was warned about doing so before but now I understand 😆

[–] milon@lemm.ee 2 points 1 week ago

Turns out the issue was with one or some of the layered packages I had. After uninstalling, the CLI method to upgrade worked. See the post below, but thanks for your reply.

[–] milon@lemm.ee 2 points 1 week ago (6 children)

Also, as I reinstall a flathub version of LibreOffice, should I choose the Fedora repo or Flathub repo?

[–] milon@lemm.ee 7 points 1 week ago* (last edited 1 week ago) (5 children)

It worked! I uninstalled dnf-automatic, libreoffice, and rpmfusion and then restarted.

Thanks for your help! Will keep your tips in mind for the future and try to avoid layering.

[–] milon@lemm.ee 1 points 1 week ago (14 children)

So basically it's not allowing me to update because of these layered packages and every time I want to update, I have to uninstall them and reinstall after I update?

[–] milon@lemm.ee 1 points 1 week ago (4 children)

Problem is I don't know what the packages are or what they were for even. I don't recall installing them.

21
submitted 1 week ago* (last edited 1 week ago) by milon@lemm.ee to c/linux@lemmy.ml
 

I am trying to update from Silverblue 41 to 42 (fully updated) but run into issues when attempting to update from both the software app and from CLI.

The problem using the software app is the same as what is described by this other user, who is using Fedora Workstation not Silverblue like I am:

https://discussion.fedoraproject.org/t/update-to-fedora-42-fails-in-gnome-software/148885

When I click the download button, it looks like it's downloading multiple files since the progress bar goes from 0 to 100 several times, and then it gets up to 95% then suddenly returns to the download button. This happens in about 30 seconds.

Using the CLI method, I run the following command:

rpm-ostree rebase fedora:fedora/42/x86_64/silverblue

and get the following errors:

 Problem: conflicting requests
  - package dnf5-plugin-automatic-5.2.12.0-2.fc42.x86_64 from updates requires libcurl-full(x86-64), but none of the providers can be installed
  - package dnf5-plugin-automatic-5.2.12.0-1.fc42.x86_64 from fedora requires libcurl-full(x86-64), but none of the providers can be installed
  - package dnf5-plugin-automatic-5.2.12.0-2.fc42.x86_64 from updates-archive requires libcurl-full(x86-64), but none of the providers can be installed
  - package libcurl-minimal-8.11.1-4.fc42.x86_64 from @System conflicts with libcurl(x86-64) provided by libcurl-8.11.1-4.fc42.x86_64 from fedora

SOLUTION: Uninstalled layered packages in dnf-automatic, libreoffice, and rpmfusion and then restarted. Rebase command successfully completed thereafter.

3
submitted 1 week ago* (last edited 1 week ago) by milon@lemm.ee to c/fedora@lemmy.ml
 

.

 

if coin == 25 | 10 | 5:

If I replace the '|' with 'or' the code runs just fine. I'm not sure why I can't use '|' in the same statement.

Doing the following doesn't work either:

if coin == 25 | coin == 10 | coin == 5:

I know bitwise operators can only be used with integers, but other then that is there another difference from logical operators?

 
 # Ask user to enter an expression and display output
def main():
    expression = input("Expression: ")

    print(calculate(splitter(expression)))


# Split expression into components and assign to variables as float values
def splitter(expression):
    x, y, z = expression.split()

    return x, y, z

# Calculate expression result
def calculate(x, y, z):
    x, z = float(x), float(z)

    if y == "+":
        return str(round((x + z), 1))
    elif y == "-":
        return str(round((x - z), 1))
    elif y == "*":
        return str(round((x * z), 1))
    else:
        return str(round((x / z), 1))



main()

I am getting traceback errors for any expression (1 + 1) I enter.

 

I used the debugger to examine this code but not understanding a couple areas.

  1. Why does the for loop repeat after it exits to print a new line? If it exits the loop, shouldn't it be done with it?
  2. Why is n incremented and not i as stated with i++?

int main(void)
{
    int height = get_int("Height: ");

    draw(height);
}

void draw(int n)
{
    if (n <= 0)
    {
        return;
    }

    draw(n - 1);

    for (int i = 0; i < n; i++)
    {
        printf("#");
    }
    printf("\n");
}
 

This is in C language. When I call rotate() in main, the function returns false for isalpha() even though the string entered for plaintext uses alphabetic characters. Perhaps it's identifying an alphabetic character by its ASCII value ('A' = 65)? I tried to test that out and used (char) with the letter variable in rotate() but it didn't change anything.

PORTION OF MAIN

string plaintext = get_string("plaintext:  ");

    int length = strlen(plaintext);
    char ciphertext[length];

    for (int i = 0; i < length; i++)
    {
        ciphertext[i] = rotate(plaintext[i], key);
    }

ROTATE FUNCTION

char rotate(char letter, int key)
{
    if (isalpha(letter) == true)
    { ...
 

In VS I am told this function "does not return a value in all control paths." A bot told me specifically the issue is with this line: else if (letter + key <= 90). It said that if the outcome results in letter + key equally exactly 90 then a value is not returned, but I thought that was covered where '<=' means 'less than or equals.'

char rotate(char letter, int key)
{
    if (isalpha(letter) == true)
    {
        if (letter + key > 90)
        {
            int overage = letter + key - 90;
            letter = 64 + overage;

            while (letter > 90)
            {
                overage = letter - 90;
                letter += overage;
            }

            return letter;
        }

        else if (letter + key &lt;= 90)
        {
            letter += key;
            return letter;
        }
    }

    else if (isalpha(letter) == false)
    {
        return letter;
    }
13
submitted 2 years ago* (last edited 2 years ago) by milon@lemm.ee to c/programming@programming.dev
 

What is %.2f? Why is it not just %f? Is there some additional calculation happening? The half function already does all the calculations including splitting the bill, so I'm not sure what %.2f is. (Btw why is this code not formatting correctly in lemmy?)


#include 
#include 

float half(float bill, float tax, int tip);

int main(void)
{
    float bill_amount = get_float("Bill before tax and tip: ");
    float tax_percent = get_float("Sale Tax Percent: ");
    int tip_percent = get_int("Tip percent: ");

    printf("You will owe $%.2f each!\n", half(bill_amount, tax_percent, tip_percent));
}

// TODO: Complete the function
float half(float bill, float tax, int tip)
{
    bill += (bill * (tax / 100.0));
    bill += (bill * (tip / 100.0));

    bill /= 2;

    return bill;
}
view more: next ›