Hey what's up Dawg? (Generic Chat Thread)

General discussion.
User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Fri May 05, 2017 17:01

@kob, yeah, linear algebra was a blur. It's very conceptually interesting, but I was too busy with other classes when I took it, so I basically just memorized it before the final and barely passed.

You're definitely near the end of Nier, but keep playing afterwards, as there's another hidden ending after you've done both "final" endings. Never heard of that book series.

@ydte, sounds stressful, stay strong man. Is the screenplay for anything or just for practice? Let us know how things go with that girl.

@smith, You're never too old right? But isn't it insanely stressful? You're in a good spot right now right? What would you want to study specifically? How'd it go with that girl btw?
Quack wrote:ok but so now what do I do besides masturbate

User avatar
youdiedtooeasily
Baron of Hell
Posts: 4213
Joined: Tue Apr 19, 2005 16:45
Consoles: PC, PS3
Location: Glendale, AZ
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by youdiedtooeasily » Sat May 06, 2017 05:32

I'm done with practice mode, I'm ready to put myself out there now after understanding the art form at a level film school would never allow, that sounds cocky as fuck, but seriously, film school is a joke, that's why the greats dropped out, it limits your creativity so much. I learned more about film from YouTube analysis videos and simply studying various genres in different cultures than anything in a classroom. If you want to write Smurfs 5, film school is for you! If you want to be the next Tarantino, you study the craft itself.

I've been in a huge mental debate over writing screenplays or becoming a reviewer but I really just want to put myself out there. Part of me wants to sellout and write what's trending right now and the other half wants me to stay true to myself so I'm conflicted on what I really want to do. Deep down, I want to write something that I could film on my phone, I know that sounds insane but it's actually a legit filmmaking technique now since the cameras in modern smartphones are so good. "Tangerine" as an example, feature length film shot on an i-phone that got huge critical praise at the festivals. Talk about cheap from a budgeting aspect! My goal is to write a script that can be filmed for only around 4k and try to get it on Netflix. It's a really hard challenge but I want to at least try it before I check out. I do like this chic but yeah, I need to figure myself out first before going down that road again.

User avatar
Mr. Smith
Spider Mastermind
Posts: 9442
Joined: Mon Dec 24, 2007 06:44
Consoles: 360, PC, Apple Faggot Machine
Location: In your sister

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Mr. Smith » Sat May 06, 2017 19:47

Saladin wrote:
Fri May 05, 2017 17:01
@smith, You're never too old right? But isn't it insanely stressful? You're in a good spot right now right? What would you want to study specifically? How'd it go with that girl btw?
It is, but I'm really getting into the whole medical administration thing and if I became a doctor I could do a lot more. And i'll PM you on FB because the PM system on PF is more broken then KoB's hopes and dreams.
OBrocks wrote:i need to know if ill actually be getting a penis pump in the mail so i can prepare an explanation for my parents
Saladin wrote:I do not want to play two truths and a lie with Smith.
Quack wrote:PF BATTLE ROYALE 2015: EVERYONE DRAWS SALADIN LICKING HIS OWN BUTTHOLE

User avatar
kob
CyberDemon
Posts: 12768
Joined: Sun Nov 14, 2004 14:40
Consoles: PS3 - PC
Location: get slam'd
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by kob » Wed Nov 15, 2017 03:45

hey saladman do you have any recommendations as far as learning recursion goes? I'm close to transferring to university full time and the final lower division CS class requires all the algorithms to be done recursively, but we haven't touched on it at all in any of my classes so my brain isn't wired to think recursively at all.

User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Wed Nov 15, 2017 19:19

Recursion is very tricky to understand initially, but it's actually very simple when you do.

It's just a function calling itself. Since a function is just an arbitrary piece of code, there's no reason it can't call itself. It's most useful when you're navigating a data structure you don't have precise information about, like a tree or a list.

Put bluntly, a recursive function needs two things. One, basic logic to do what's it's supposed to do. Two, a piece of logic which will hard stop the recursion based on certain conditions, so it doesn't become infinite.

An example, a function that goes down a tree recursively, in super basic psuedo code.

0. Takes in a tree node with left, right pointers, and a value.
1. Are left and right nodes null? If so, return current node.
2. If left node not null, and less than current, call this function with left node.
3. Same as 2, but with right node.

Basically, a recursive function does everything it needs to do *locally*, and isn't concerned with the bigger picture.

I.e., we don't care about what the intentions of the functions are, what logic needs to be done *right now* to accomplish this step?

They are, fundamentally, very similar to normal loops. But how do you loop through something that you don't know anything about? By giving it rules so it knows how to get through something, and when to stop.

Just think of it as another layer of abstraction. Rather than telling the computer to loop through something x amount of times, or based on y condition, you're telling it to do all the work itself. You figure out how many times to do it, and when you should stop, I can't be bothered to figure it out.

Are you struggling with any particular implementation? I can help out if this is still confusing.

You'll be glad to know that recursion is pretty rarely used except like for annoying interview questions. It's memory intensive and confusing, so it tends not to see a lot of practical application.
Quack wrote:ok but so now what do I do besides masturbate

User avatar
kob
CyberDemon
Posts: 12768
Joined: Sun Nov 14, 2004 14:40
Consoles: PS3 - PC
Location: get slam'd
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by kob » Thu Nov 16, 2017 17:08

that does help thanks i can kinda see it now. as for implementations linked lists (circular, doubly etc) and BSTs are the first data structures we're required to traverse recursively that i'm being exposed to. i think a linear linked list you just wanna call itself while !curr->next and set curr to curr->next with the node as a parameter right? with BSTs I somewhat understand it, but I'm kinda confused on how, say, a BST with numbers as its data and how printing it inorder works. how does that algorithm print numbers smallest to greatest? is it because you only print the left side first (which is inherently less than) before going to the right?

User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Fri Nov 17, 2017 06:44

If a tree is balanced correctly, than the traversal order itself mathematically guarantees smallest to greatest. Because you're comparing as you go, it's not possible to get the wrong number if you code it correctly. Because you don't print until you reach a null, and you can't reach a null until you've traveled down the path with the smallest number. It's way easier to show with a drawing but, this psuedo code might help.

1. If not null, go left
2. If not null, go right
3. If both null, print.

What happens here is, once you've reached a null, the previous call gets to continue on. So if you went left, and then it printed, it goes back and tries to go right, and if it can't, it prints.

Although I'm not sure which one that is. I've long since forgotten which one is post order, in order, etc.

If you get tripped up about it, just trust the algorithm, and convince yourself that it works later at some point by writing it out by hand. It becomes intuitive after you do that.

It's normal to be confused about this stuff by the way. It takes your brain time to develop the neural pathways to make sense of this stuff. You sort of have to struggle through it before it makes sense.

Fun fact about the various traversals, they're literally the same exact logic, just in a different order. That difference alone gives you very different results.

You have it right with lists. Just remember to have a proper terminating condition. That's the real key to recursion. It needs a way to stop once it's reached the right value.
Quack wrote:ok but so now what do I do besides masturbate

User avatar
kob
CyberDemon
Posts: 12768
Joined: Sun Nov 14, 2004 14:40
Consoles: PS3 - PC
Location: get slam'd
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by kob » Fri Nov 17, 2017 18:15

isn't the terminating condition in a linked list the while !curr-next? that makes sense regarding trees - at least from a pseudocode perspective. the question is whether i'll remember it when i need to write it on my own.
It's normal to be confused about this stuff by the way. It takes your brain time to develop the neural pathways to make sense of this stuff. You sort of have to struggle through it before it makes sense.
yeah I've noticed this is programming in a nutshell. a lot of it is beating your head against the wall trying to figure it out and then figure out what you did wrong once you've implemented it. eventually the fog will part. it's especially difficult since we're learning C++, which as you probably know is like walking across a dark field littered with deep holes and if you step in one it can be incredibly difficult to get out of. a lot of my major mistakes are a matter of "I don't know what I don't know". hopefully i get to do something related to web development soon since that's where i wanna go. i actually really wanna work on a bot that scrapes web pages and purchases items (sneakers mainly), but i have not the slightest clue where to start.

User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Fri Nov 17, 2017 20:10

That's a cool goal! I've sort of had that kind of passion beat out of me by real work, so hold onto that. And don't worry, there's lots of good tutorials for stuff like that.

I didn't mean to imply your terminating condition was wrong, I just wanted to emphasize that's the key to good recursion. For instance, !curr->next takes all the way through the list until there's nothing left. Which might be your assignment, I don't know. But if you're trying to do something specific with the list, there's no need to go all the way thru it.

I know what you mean on C++, it is notoriously complicated. The guy who invented it, Bjarne Stroustrup, was famously asked how he would rank his knowledge of it on a scale of 1 to 10. He gave himself an 8. So there's no hope for the rest of us, lol.

Even though you rarely use low level stuff later on, it's *essential* to know it as it really helps you understand what the computer is actually *doing*.

One of the most helpful classes I ever took was a CE class where we were forced to use an emulator to build circuits, and to write in assembly with limited memory like it was the 60's again. Being forced to see what computers really do at the lowest level was tremendously helpful. I highly recommend it, if it's not required for your degree.
Quack wrote:ok but so now what do I do besides masturbate

User avatar
kob
CyberDemon
Posts: 12768
Joined: Sun Nov 14, 2004 14:40
Consoles: PS3 - PC
Location: get slam'd
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by kob » Mon Dec 04, 2017 03:09

see, even though i want to work on a project like that, i don't really have the drive to go through the learning process of actually doing it. i consider a project to be work and when i do work i want it to be for a school or for a salary. i do enjoy programming most of the time and it has been incredibly rewarding to see my skills grow. like i remember coming to you a while back asking how to wrap my mind around functions and now i'm working on multi-file projects that are half-built by my professor and require me to not only understand his code, but also implement things more complicated than anything i've done yet (trees atm). that's been great. but programming isn't necessarily a hobby to me. i'd rather do a lot of other things than mentally exhaust myself overcoming the mental hurdles of programming. i guess where i'm going with this is... am i fucked when i graduate? will i struggle to get a job because i don't have side projects in my portfolio?

also, i did my first recursive algorithm the other day working on our final project in my data structures class. the traversal algorithm we came up with on our own and it worked fine, but we had an issue with returning the value we needed in another function. essentially we're doing an array-based implementation of a binary search tree and we made a function that would find the correct spot to insert the data based on whether the left/right child was empty and then return the index to the insert function. the issue we ran into was we "lost" the index value when returning back up the function call stack. we'd always get a 0 returned in the insert function. we got help from someone and our issue was how we were returning the value. we did "find(arg1, arg2)" with the return at the end of the function and the fix was to move the return to the recursive call i.e. "return find(arg1, arg2)". i don't understand why this was the solution and what was wrong with our original implementation. any ideas? i can post the actual code if it helps make more sense of what i mean.

User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Mon Dec 04, 2017 21:23

Oh dude, that first paragraph, I get you 100%. That's me exactly. And I have a job, so it's not required by any means. But I won't lie, companies *prefer* that kind of programmer, especially if they do free overtime, work way too hard for substandard pay, and don't ask a lot of questions. You'll decrease your opportunities if you don't behave that way, but it's worth it imo. These kinds of jobs can crush your soul if you like things besides coding.

As for why that solution worked, I'd say step through your code! That is the single best way to figure out why something didn't work, to just watch to execute line by line. That's the number one way bugs are caught in the real world. A breakpoint and line by line execution.
Quack wrote:ok but so now what do I do besides masturbate

User avatar
kob
CyberDemon
Posts: 12768
Joined: Sun Nov 14, 2004 14:40
Consoles: PS3 - PC
Location: get slam'd
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by kob » Tue Dec 05, 2017 01:10

can you expand a little more on what you mean in that first part? and did you work on side projects to build a portfolio for when you graduated? i guess i'm just worried that i'm going through all this work of getting a degree and then i'm gonna graduate with no projects to show for it and struggle to get a job - when the opposite is half the reason i even went back to school for a CS degree.

and yeah i did step through the code using gdb but i didn't really understand why that was the solution. i figure it's just because i don't have a good enough grasp on understanding recursion. both implementations look similar when stepping line by line, but in the wrong one the value is lost and the other the value is kept.

User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Tue Dec 05, 2017 19:02

I did little to no side projects. I listed academic course work as my personal projects. I was lucky in that I had an on campus job doing programming, so I had some professional experience I could list. Snatch up that or any internship you can, they can be a decent leg up.

I wouldn't worry too much. Lots of software places are looking for new grads so they can mold their habits and experiences and, well, take advantage of them and their lack of family life and expectations. If you did some interesting course work, you should have something that will interest a potential employer.

As for recursion, I wouldn't worry about it too much. You almost never use it practically. Most programming jobs these days don't even bother with low level languages either, unless you're working in old, military, performance heavy or gaming software. If you're really worried about it, talk to your TA again, or we can walk through it here.
Quack wrote:ok but so now what do I do besides masturbate

User avatar
kob
CyberDemon
Posts: 12768
Joined: Sun Nov 14, 2004 14:40
Consoles: PS3 - PC
Location: get slam'd
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by kob » Wed Dec 06, 2017 05:04

any advice on identifying those kinds of predatory companies? obviously not looking for that to be my experience when i graduate

re recursion: i have to learn recursion because my first CS uni class requires us to do almost everything recursively haha. if you could go through it here and help me out that'd be great. my prof isn't that helpful through emails and due to my schedule lately it's been hard to find time to see him during office hours.

just noticed i forgot to make comments in the code so i can explain it a little bit. we made a function that finds the next available slot in the tree and returns an index to the insert function. if the name in gcs coming in is less than the name in array gcs, go left down the tree, else go right. if the index's left child is empty (textbook used -1 for empty children in array-based implementations) then that's where it goes. do array stuff then return the index of where it needs to go. otherwise, increment index and then call find again with the new index.

this was the original code that would always return 0 for foundIndex even though foundIndex had the right variable so the issue was as it went back up the call stack i believe.

Code: Select all

int BST::find(int index, const GCS& gcs)
{
	if (gcs < items[index].gcs)
	{
		if (items[index].leftChild == -1)
		{
			items[index].leftChild = 2 * index + 1;
			foundIndex = 2 * index + 1;
			return foundIndex;
		}
		else
		{
			index = 2 * index + 1;
			find(index, gcs);
		}
	}
	else
	{
		if (items[index].rightChild == -1)
		{
			items[index].rightChild = 2 * index + 2;
			foundIndex = 2 * index + 2;
			return foundIndex;
		}
		else
		{
			index = 2 * index + 2;
			find(index, gcs);
		}
	}
	return foundIndex;
}
and here was the solution - moving the return statements to the recursive calls

Code: Select all

int BST::find(int index, const GCS& gcs)
{
	if (gcs < items[index].gcs)
	{
		if (items[index].leftChild == -1)
		{
			items[index].leftChild = 2 * index + 1;
			foundIndex = 2 * index + 1;
			return foundIndex;
		}
		else
		{
			index = 2 * index + 1;
			return find(index, gcs);
		}
	}
	else
	{
		if (items[index].rightChild == -1)
		{
			items[index].rightChild = 2 * index + 2;
			foundIndex = 2 * index + 2;
			return foundIndex;
		}
		else
		{
			index = 2 * index + 2;
			return find(index, gcs);
		}
	}
}

User avatar
Saladin
Spider Mastermind
Posts: 8367
Joined: Mon Aug 11, 2003 22:39
Consoles: PS4 PS3 Wii Wii-U PC
Location: DANCE MASTAH!
Contact:

Re: Hey what's up Dawg? (Generic Chat Thread)

Post by Saladin » Wed Dec 06, 2017 18:57

I'll look at it sometime tonight when I get home. Gotta work today.

As for how to identify predatory companies, ha, wish I had an easy answer to that one. Most of the big ones just are. But in general, you learn to identify certain buzzwords that mean trouble. If a company is looking for a "team player" and a "ninja" and a "unicorn" who wants to work for "competitive wages," you need to stay far away. Or, don't. Sometimes it's as easy to take advantage of a shitty company as it is vice versa.

You have to think of yourself kind of like a coding mercenary. You get paid to do what they tell you to do, and nothing more. Unless you love the company, or get equity or something, it can be a big mistake to be loyal and put in 110%. Cuz these companies shit people out without a second glance, especially as you get older. It's why there's a lot of burnout.
Quack wrote:ok but so now what do I do besides masturbate

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests