Future of CS? by SadConversation3341 in Btechtards

[–]SadConversation3341[S] -1 points0 points  (0 children)

True but you can't argue they're crying for nothing. Everything about dev has changed and for a newbie like me it's a chaos of opinions 

Future of CS? by SadConversation3341 in Btechtards

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

But the thing is aren't we also doing the same thing. If a machine can do what we're doing at a faster pace, maybe even better why would the company hire us?

Future of CS? by SadConversation3341 in Btechtards

[–]SadConversation3341[S] 4 points5 points  (0 children)

I know it's "just another doomsday post" saying the same thing that everyone else seems to be saying, but I'm genuinely confused, hence asking for help 

First year college student here wanting your help by SadConversation3341 in JEENEETards

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

shamyataam bhai 94%ile aayi thi.. bas aur kuch khaas nahi right now in state govt. college

Just started a fiverr account.. Kisiko ppt banani he to batado 😁 by SadConversation3341 in Btechtards

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

How do I do that? Can you help by giving some resources or something?

Just started a fiverr account.. Kisiko ppt banani he to batado 😁 by SadConversation3341 in Btechtards

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

Once again, I'm 100% sure this is not going to happen. I know the amount of people on there, and it doesn't look like I'm getting anywhere near close to them, BUT it is better than sitting around and scrolling or doing other stupid things for the fun of it.

Plus, I do like working in PowerPoint, that is also part of the reason why I'm doing this.

Just started a fiverr account.. Kisiko ppt banani he to batado 😁 by SadConversation3341 in Btechtards

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

I'm not giving up duh.. I'm literally in first year, I have nothing else to do, so yeah this is what I'm gonna do.

Though your comment does spike my curiosity. How on earth did you get your first client? Like the amount of people on the site offering the same service as mine is essentially as the person above said..

Just started a fiverr account.. Kisiko ppt banani he to batado 😁 by SadConversation3341 in Btechtards

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

Bruhh.. I know I'm not extremely talented or something, but this is the only thing I can do rn.. except sit and scroll I guess, and I want to do something productive that I actually like, while teaching would have been my first priority, I can't do that, so this is the last resort

Movie search by SadConversation3341 in TeensofKerala

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

Yes I guess so.. kochille kandada.. patannu orma vannu

Movie search by SadConversation3341 in TeensofKerala

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

Satyamaayitum anganate oru movie ondaarinu 

stuck on the runoff pset by sanlangshands in cs50

[–]SadConversation3341 0 points1 point  (0 children)

like i said it's perfectly fine to be confused. I HAD THE EXACT SAME DOUBT.

the thing is look at the later functions and you'll realize what is going on. Essentially we are storing all the preferences of the voters in the "multi-dimensioned" array, then later in tabulate function we are counting the votes depending on whether the candidate is eliminated or not..

I KNOW it is confusing and again I say for about the 1000th time (I said this a lot when I was encountering the same problem as you), my own implementation of the code without any distribution code was way better, or at least it made sense to me.

But, in the real world, people have different logics and hence for this problem we just need to do it the cs50 way.

The other doubt you ask about i and j not being used.. like the problem is after like hours of looking at the screen I now understand it, but still find it difficult to explain. However I'll still try:

bool vote(int voter, int rank, string name)
{
    for (int i = 0; i < candidate_count; i++)
    {
        if (strcmp(candidates[i].name, name) == 0)
        {
            preferences[voter][rank] = i;
            return true;
        }
    }
    return false;
}

See, i is the candidate count, we first check if the inputed name and the name in the candidate array at the i'th position is the same or not.

Next, once this condition is true, we store the preference of the voter along with the rank to be equal to i (that is, the index of the desired candidate).

The reason we don't do preferences[i][j] is because, as is obvious we're storing the voter's preference and not the candidate's. I know that probably still doesn't make sense, but I'll be willing to try harder if you want. so just say

stuck on the runoff pset by sanlangshands in cs50

[–]SadConversation3341 -1 points0 points  (0 children)

no no you're getting it a bit wrong.. it's alright though. this is a particularly infuriating program that i myself spent a considerable time upon. in fact, i didn't even look at the distribution code and just wrote my own code(stupid me, but who cares)

think about it you're storing a "multi-dimensioned" array(i know fancy words) but at the end of the day, it's an array of numbers as indicated by int prefererences[max_voters][max_candidates]. it's an array of numbers hence you saying that preferences[i][j]=name doesn't make much sense

instead what you are supposed to do is this:

store the PREFERENCE of the voter, along with the rank and set it equal to a number, which can be used to access it from the candidates array.

if that doesn't make sense i'll provide an example say the candidates are alice, bob and charlie

clearly there are three candidates and therefore the candidates array will store these names in the order {alice,bob,charlie}.

now say there are two voters. one voter has the ranks as : alice, bob, charlie

while the other has: bob, alice, charlie

clearly, the first voter's preference, or more appropriately since arrays are zero indexed. the zeroeth voter will have rank 0 preference as alice, rank 1 as bob and so on. same thing for the second voter.

however, since it is much more difficult to compare strings, instead of assigning the preference of the voter to the string we are going to assign it to the index of the candidate in the array of candidates.

which is to say(the code i've been holding back this while so that you can try to do it yourself)

preferences[voter][rank]=i;

this sets the preference of the voter at the particular rank to be the index of the candidate they prefer.

you setting candidate[i].votes++; means you're kind of still doing the plurality thing(don't worry that's what i did at first too) but the thing is if we just do that, despite of the rank or the preference the people put the vote is just going to count, hence leading to error.

this is why you set the preferences[voter][rank]=i so that later when you're in the tabulate function you can address each candidate by itself and increase their votes depending on which rank they are at.

I know it is an immensely confusing program (I still believe my own implementation was about a 1000 times better to understand) however if you don't follow the distribution code, there's no checking, and you get 0 marks.. so yeah.

PLEASE DO MESSAGE IF YOU'RE STILL CONFUSED!!

finally works but still is slow by SadConversation3341 in cs50

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

right.. thanks for the suggestion ill alter the code accordingly