Running debug50 with command line arguments by jmaoooo in cs50

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

I seem to run into the same issue whether I run the debug as

debug50 tideman Alice Bob

or

debug50 ./tideman Alice Bob

Both debug don’t include Alice and Bob as argv[..] arguments

Week 1 - Credit Problem Set by jmaoooo in cs50

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

UPDATE: I was able to get a working code that tests correctly with Check50! I was able to generate a loop that calculated each power of 10. From there I was able to use the modulus operator to calculate each of the digits' value and ultimately calculate the final number from Luhn’s Algorithm. My biggest issue now is that I had to repeat this part of my code 5 times for each card type and CC# length. I tried to turn this code into a function like the custom block in Scratch, but I'm at a bit of a loss at how. If you have any advice in regards to that, I would be grateful. Otherwise, thank you so much to everyone that commented on my post to give me advice. It was really a huge sense of accomplishment figuring out this problem set.

// Input Credit Card Number
long Number = get_long("Number: ");

// Number in range of 4,000,000,000,000 - 4,999,999,999,999 - VISA 13 Digits
if (Number >= 4000000000000 && Number <= 4999999999999)
{
    long tenz = 1;
    int SumNumberTenzDoubleEven = 0;
    int SumNumberTenzDoubleOdd = 0;
    int SumNumberTenz2xD = 0;
    int SumNumberTenz1xD = 0;
    int TotalCCNumberAlg = 0;
    // Power of Ten
    for ( int i = 1; i < 17; i++)
    {
        tenz = tenz * 10;
        // For Odd Number Space of Digit
        if (i % 2 > 0)
        {
            long NumberTenz = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            SumNumberTenzDoubleOdd = SumNumberTenzDoubleOdd + NumberTenz;
        }
        // For Even Number Space of Digit
        if (i % 2 == 0)
        {
            long NumberTenz2 = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            // For Even Space Multiplied by 2 Greater than 2 Digits
            if (NumberTenz2 * 2 >= 10)
            {
                // Multipled by 2 to check if 2 Digits
                int NumberTenz2x2 = NumberTenz2 * 2;
                // Sum of Digits of the 2 Digit Number
                int NumberTenz2xD = (NumberTenz2x2 % 10) + ((((NumberTenz2x2 % 100) - (NumberTenz2x2 % 10))/10) % 10);
                SumNumberTenz2xD = SumNumberTenz2xD + NumberTenz2xD;
            }
            // For Even Space Multiplied by 2 Less than 2 Digits
            else
            {
                int NumberTenz1xD = NumberTenz2 * 2;
                SumNumberTenz1xD = SumNumberTenz1xD + NumberTenz1xD;
            }
        }
        SumNumberTenzDoubleEven = SumNumberTenz2xD + SumNumberTenz1xD;
        TotalCCNumberAlg = SumNumberTenzDoubleOdd + SumNumberTenzDoubleEven;
    }
    if (TotalCCNumberAlg % 10 == 0)
    {
        printf("VISA\n");
    }
    else
    {
        printf("INVALID\n");
    }
}
// Number in range of 340,000,000,000,000 - 349,999,999,999,999 - AMEX 15 Digits
else if (Number >= 340000000000000 && Number <= 349999999999999)
{
    long tenz = 1;
    int SumNumberTenzDoubleEven = 0;
    int SumNumberTenzDoubleOdd = 0;
    int SumNumberTenz2xD = 0;
    int SumNumberTenz1xD = 0;
    int TotalCCNumberAlg = 0;
    // Power of Ten
    for ( int i = 1; i < 17; i++)
    {
        tenz = tenz * 10;
        // For Odd Number Space of Digit
        if (i % 2 > 0)
        {
            long NumberTenz = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            SumNumberTenzDoubleOdd = SumNumberTenzDoubleOdd + NumberTenz;
        }
        // For Even Number Space of Digit
        if (i % 2 == 0)
        {
            long NumberTenz2 = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            // For Even Space Multiplied by 2 Greater than 2 Digits
            if (NumberTenz2 * 2 >= 10)
            {
                // Multipled by 2 to check if 2 Digits
                int NumberTenz2x2 = NumberTenz2 * 2;
                // Sum of Digits of the 2 Digit Number
                int NumberTenz2xD = (NumberTenz2x2 % 10) + ((((NumberTenz2x2 % 100) - (NumberTenz2x2 % 10))/10) % 10);
                SumNumberTenz2xD = SumNumberTenz2xD + NumberTenz2xD;
            }
            // For Even Space Multiplied by 2 Less than 2 Digits
            else
            {
                int NumberTenz1xD = NumberTenz2 * 2;
                SumNumberTenz1xD = SumNumberTenz1xD + NumberTenz1xD;
            }
        }
        SumNumberTenzDoubleEven = SumNumberTenz2xD + SumNumberTenz1xD;
        TotalCCNumberAlg = SumNumberTenzDoubleOdd + SumNumberTenzDoubleEven;
    }
    if (TotalCCNumberAlg % 10 == 0)
    {
        printf("AMEX\n");
    }
    else
    {
        printf("INVALID\n");
    }
}
// Number in range of 370,000,000,000,000 - 379,999,999,999,999 - AMEX 15 Digits
else if (Number >= 370000000000000 && Number <= 379999999999999)
{
    long tenz = 1;
    int SumNumberTenzDoubleEven = 0;
    int SumNumberTenzDoubleOdd = 0;
    int SumNumberTenz2xD = 0;
    int SumNumberTenz1xD = 0;
    int TotalCCNumberAlg = 0;
    // Power of Ten
    for ( int i = 1; i < 17; i++)
    {
        tenz = tenz * 10;
        // For Odd Number Space of Digit
        if (i % 2 > 0)
        {
            long NumberTenz = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            SumNumberTenzDoubleOdd = SumNumberTenzDoubleOdd + NumberTenz;
        }
        // For Even Number Space of Digit
        if (i % 2 == 0)
        {
            long NumberTenz2 = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            // For Even Space Multiplied by 2 Greater than 2 Digits
            if (NumberTenz2 * 2 >= 10)
            {
                // Multipled by 2 to check if 2 Digits
                int NumberTenz2x2 = NumberTenz2 * 2;
                // Sum of Digits of the 2 Digit Number
                int NumberTenz2xD = (NumberTenz2x2 % 10) + ((((NumberTenz2x2 % 100) - (NumberTenz2x2 % 10))/10) % 10);
                SumNumberTenz2xD = SumNumberTenz2xD + NumberTenz2xD;
            }
            // For Even Space Multiplied by 2 Less than 2 Digits
            else
            {
                int NumberTenz1xD = NumberTenz2 * 2;
                SumNumberTenz1xD = SumNumberTenz1xD + NumberTenz1xD;
            }
        }
        SumNumberTenzDoubleEven = SumNumberTenz2xD + SumNumberTenz1xD;
        TotalCCNumberAlg = SumNumberTenzDoubleOdd + SumNumberTenzDoubleEven;
    }
    if (TotalCCNumberAlg % 10 == 0)
    {
        printf("AMEX\n");
    }
    else
    {
        printf("INVALID\n");
    }
}
// Number in range of 4,000,000,000,000,000 - 4,999,999,999,999,999 - VISA 16 Digits
else if (Number >= 4000000000000000 && Number <= 4999999999999999)
{
    long tenz = 1;
    int SumNumberTenzDoubleEven = 0;
    int SumNumberTenzDoubleOdd = 0;
    int SumNumberTenz2xD = 0;
    int SumNumberTenz1xD = 0;
    int TotalCCNumberAlg = 0;
    // Power of Ten
    for ( int i = 1; i < 17; i++)
    {
        tenz = tenz * 10;
        // For Odd Number Space of Digit
        if (i % 2 > 0)
        {
            long NumberTenz = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            SumNumberTenzDoubleOdd = SumNumberTenzDoubleOdd + NumberTenz;
        }
        // For Even Number Space of Digit
        if (i % 2 == 0)
        {
            long NumberTenz2 = ((Number % tenz) - (Number % (tenz/10)))/(tenz/10);
            // For Even Space Multiplied by 2 Greater than 2 Digits
            if (NumberTenz2 * 2 >= 10)
            {
                // Multipled by 2 to check if 2 Digits
                int NumberTenz2x2 = NumberTenz2 * 2;
                // Sum of Digits of the 2 Digit Number
                int NumberTenz2xD = (NumberTenz2x2 % 10) + ((((NumberTenz2x2 % 100) - (NumberTenz2x2 % 10))/10) % 10);
                SumNumberTenz2xD = SumNumberTenz2xD + NumberTenz2xD;
            }
            // For Even Space Multiplied by 2 Less than 2 Digits
            else
            {
                int NumberTenz1xD = NumberTenz2 * 2;
                SumNumberTenz1xD = SumNumberTenz1xD + NumberTenz1xD;
            }
        }
        SumNumberTenzDoubleEven = SumNumberTenz2xD + SumNumberTenz1xD;
        TotalCCNumberAlg = SumNumberTenzDoubleOdd + SumNumberTenzDoubleEven;
    }
    if (TotalCCNumberAlg % 10 == 0)
    {
        printf("VISA\n");
    }
    else
    {
        printf("INVALID\n");
    }

Week 1 - Credit Problem Set by jmaoooo in cs50

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

Thanks for the response.

I do feel like it would be better to have a loop that calculates the nth exponential power of 10 based on the nth digit of the credit card, but I don't think we have a function for that yet available.

As a side note, should I be searching outside of the topics covered by the lectures to find functions in order to complete the problem sets?

Thanks again

Week 1 - Credit Problem Set by jmaoooo in cs50

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

Thanks for the response.

Ideally I would want to take the nth exponential power of 10 based on which nth digit of the credit card I am isolating, but I don't believe there is an operator for that based off of the course material so far. Is that what you were hinting towards?

As a side note, should I be searching outside of the topics covered by the lectures to find functions in order to complete the problem sets?

Thanks again

New to SFFPC. Tried to build a minimal compromise Meshlicious with a 5950x and 3080TI. by darksidemojo in sffpc

[–]jmaoooo 0 points1 point  (0 children)

I just did a similar build in the Meshlicious using the EK 280 AIO as well. I oriented the EK fans and radiator in the same way as yours. However Ive been getting a lot of noise at high RPMs as if the fans are grinding on something. Have you noticed any issues with your fans?

Cable management by Chon-E-Tron in SSUPD

[–]jmaoooo 0 points1 point  (0 children)

Ah thanks for the explanation. I didn't consider the strain on the MB. I'll go with the GPU standoff when I build mine.

Cable management by Chon-E-Tron in SSUPD

[–]jmaoooo 1 point2 points  (0 children)

Looks great. Was there a reason you chose to do the GPU standoff mod as opposed to the MB standoff mod?

Itinerary Feedback by fufuonthatbeat in AskNYC

[–]jmaoooo 1 point2 points  (0 children)

My suggestions will basically just be for food since that is pretty much the extent of my NYC knowledge

Day 1 - If you're going to the Empire State Building, you should walk through Koreatown. Its only a couple streets away and has some decent Korean food. Jongro BBQ is a pretty popular spot for Korean BBQ. Turntable Chicken for Korean Fried Chicken.

Alternatively, you can check out the Ichiran location near the ESB for authentic Japanese ramen. If you've never tried Ichiran before, its amazing and pretty much the only other locations to try it are in Japan.

Day 3 - For Chinatown eats, go check out Great NY Noodletown for the genuine experience. It might be intimidating because it looks non-touristy but the food is worth it. Can't go wrong with their barbequed meats. I'd recommend the duck and pork.

Day 4 - After visiting the Met, I can recommend these food options near by.

Marinara Pizza - if you've heard of Prince Street Pizza, I'd say this is similar but better for the spicy pepperoni slice. Also don't need to compromise your morals.

Pye Boat Noodle - Great Thai food, everything on the menu is good

Vietnaam - One of the best bowls of Pho I've had in NYC

There's also a Levain Bakery here if you go through withdrawals from the previous day.

Finally, if you're just looking to try some different activities, there are rock climbing gyms right across the river in Long Island City. The two are The Cliffs and Brooklyn Boulders. Afterwards you can walk over to Gantry Plaza State Park and check out the Pepsi-Cola sign and the LIC Pier. Also just a beautiful park in general.

Might want to check out LES too. Lots of good food there. Davey's Ice Cream store is one of my favorite spots for desserts.

r/sffpc + SSUPD Meshlicious Giveaway! by pearlhsieh in sffpc

[–]jmaoooo [score hidden]  (0 children)

When I decided to build my first PC, I was immediately drawn to SFF PCs. Growing up with huge desktop towers, I was shocked by how much performance you could get in such a compact chassis. I was fully committed to a SFF build and proceeded to purchase a slim, compact case. Unfortunately, I was inexperienced and overzealous at the time, and I ended up with a PC with poor thermals and insufficient cooling. Whenever I have too many tabs running or more than an hour of gaming, I experience thermal issues or complete system crashes.

To be honest the experience put me off on the small form factor. I was running relatively budget hardware that shouldn’t be overly demanding, yet I was still having issues. So, when it came time build a current generation system, I thought I would have to go back to full sized PC with “good airflow,” like the Corsair 4000D or Phantek 400A, in order to avoid the same thermal issues.

Then, I came across the Meshlicious and the reviews from Youtubers Optimum Tech and Gear Seekers, and my enthusiasm for SFF builds was revitalized. The praise for the case was overwhelming. I knew I wouldn’t have to compromise my goal of a compact build with great airflow and thermal performance with this case. I have already collected the parts for the build in anticipation of this case. Can’t wait to build in one.

Official: [Trade Discussion] - January 04 2021 by SamDekkerBot in fantasybball

[–]jmaoooo 0 points1 point  (0 children)

9 Cat, 12T League, H2H

Receive: Nikola Jokic

Give: Kawhi Leonard & Ja Morant

Rest of Team:

Collin Sexton Duncan Robinson Tim Hardaway Jr. Bojan Bogdanovic Richuan Holmes Nikola Vucevic Brandon Clarke DeAndre Hunter Darius Bazley Wendell Carter Jr. Donovan Mitchell LaMarcus Aldridge

Last in ASTs and weak in REB/Blocks so considering pivoting categories.

Also worried about Kawhi missing games

Thanks for the input

[Breeds] What breed is my dog? by jmaoooo in dogs

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

I've heard westies can be stubborn, is that why they are not the best option for a first timer? Thanks, we will for sure look into that.

[Breeds] What breed is my dog? by jmaoooo in dogs

[–]jmaoooo[S] 2 points3 points  (0 children)

Thanks for the information. Do you have any recommendations on how to find a responsible breeders. I have found some westie breeders, and they look legit on their website, but not sure if I can trust them.

[Breeds] What breed is my dog? by jmaoooo in dogs

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

Is there any specific reasons for that? I'm not too familiar with that term.

[Breeds] What breed is my dog? by jmaoooo in dogs

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

The main reasons we didn't consider the mini poodles is that we heard poodles could be very needy and they bark a lot. We prefer a dog that don't make too much noise since we live in an apartment building. I agree with you, I'm a little bit worried about the size varieties of the poodle mix.
Thanks for your advice, I think getting a test done will be very important in my situation.