[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
First day of Data Structures: Before class, there is a dude
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 74
Thread images: 6
File: sponge.png (359 KB, 620x500) Image search: [Google]
sponge.png
359 KB, 620x500
First day of Data Structures:

Before class, there is a dude in front row with a mechanical keyboard on hacker typer.

Pop quiz at end of class,

In C++
1. Declare a 10 integer array called fluffy.
2. Declare a pointer to the 3rd element in fluffy.
3. Create a for loop that prints each odd number between 27 and 63.
4. Declare a filestream object for reading a file "data.txt"

Afterwards, professor asks who thought to themselves "What did I get myself into?", only people raising their hand are the 6-7 somewhat attractive girls in the class.

How was your first day at school anon?
>>
File: 1427419794094.gif (169 KB, 272x200) Image search: [Google]
1427419794094.gif
169 KB, 272x200
>piss easy course
>op complaining about it
>women don't want to be I'm the presence of fat beta cuckolds more interested in cartoon ponies than actual people
Nothing new here
>>
>>7788752
Get down your high horse.

If you never even looked at a code, even simple stuff like this can be overwhelming....
>>
>>7788768
Not complaining

>>7788771
No high horse, the prereq for this class is an entire semester of writing Java and then another of C++
>>
>>7788752
>Data Structures:
>Pop quiz on programming

Do they just assign curriculums to titles by picking names out of a hat?
>>
>>7788752
>Data Structures
>Fucking around in C++
>Reading files

I think OP, you should be asking yourself "What did I get myself into?" when you applied to that school
>>
>>7788752
>1. Declare a 10 integer array called fluffy.
>2. Declare a pointer to the 3rd element in fluffy.
>3. Create a for loop that prints each odd number between 27 and 63.
>4. Declare a filestream object for reading a file "data.txt"

Why is this shit in a quiz? That's stuff you can easily google.
>>
You have school on a Saturday?
>>
>>7788752
how is Community College anyway? Sounds like they really have to dumb down the courses so little cucks like you can handle them. Oh well, Have fun!
>>
>>7788768

wat mlp where ??

/sci/ needs more ponies
>>
>>7789011
Kill yourself Barney fucker
>>
>>7789029

I am a math PhD

does it bother you that even smart people can be autistic and in most cases are

>they are smart enoughto hide their power lever, unlike other brony faggots
>>
>>7788985
OP said it's the first day of the class. The instructor wants to know how many students don't actually know the basic stuff they were supposed to learn in the prereqs.
>>
>>7788752
I dropped out of HS decades ago and went into PC/coding-related business for myself, now I'm retired.

Fuck school.
>>
>>7788752
>Bitches cannot code
More news at eleven when we reveal that OP cannot stop scuking cock.
>>
File: 1446874200658.jpg (198 KB, 500x708) Image search: [Google]
1446874200658.jpg
198 KB, 500x708
>>7789066
>math PhD
That explains a lot. Did it occur to you the only reason you went to become a pony degenerate was because you're just such a loser in the whole pussy game its the only thing you have left? Why even like little girls cartoons, is your mental age 6?
>>
>>7790054
girls can code though
>>
>>7792009
>girls can code

Yeah, they can code so well that now half of the software industry has gender quotas in order to force employers into hiring female programmers because they did so poorly in the practical tests that said companies require you to do.

Yeah. Pure talent right there.
>>
>>7792020
Are you trying to imply that coding is somehow difficult?
I know many girls who are intelligent enough to do it. Most just don't like it.

The quotas are just another example of the powers at be not understanding the problem and looking for a quick solution. Also more proof that being a woman or minority is living life on easy mode
>>
>>7792046
>Are you trying to imply that coding is somehow difficult?
How did you get to that conclusion? I have no respect for CS and as such I believe 'coding' in general, at all levels, is trivial shit.

Source: Professional java/android programmer.
Anyways,

>not understanding the problem

What problem is not being understood? Softwere is (used to be) a meritocracy so here, if the girls were not up to par then they were not going to get hired.

And obviously they would never be up to par. A woman who started programming in college because 'muh STEM career woman' meme will never compare to a guy who started programming in his teens and never stopped doing so.

So the problem is:
>Women can't compete with men in this industry
>Because it is stricly a meritocracy
>And men are ahead because of genuine interest and time advantage
>No 1 year programming course can get a woman to the level of a man who has been programming for 10+ years

Logically, the only solution is to simply force employers to hire low tier programmers, aka female programmers.
>>
>>7788752
>In C++
>1. Declare a 10 integer array called fluffy.
>2. Declare a pointer to the 3rd element in fluffy.
>3. Create a for loop that prints each odd number between 27 and 63.
>4. Declare a filestream object for reading a file "data.txt"

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
using std cout;
using std endl;
using std fstream;
using std string;

int main(){
//1
int * fluffy= nullptr;
fluffy= (int*) realloc ((void*) fluffy, 10*sizeof(int));

//2
int * fluffy3 = fluffy;
for(int i=1; i<3; ++i)
++fluffy3;

//3
for(int j=0; j<100; ++j){
if(j>26 && j<64){
if(j&1)
cout<<j<<endl;
}
}

//4
string file("data.txt");
fstream obj(file.c_str());

return 0;
}

What do I win?
>>
>>7792072

>for int j=0;j<100;++j

lad, you got problems
>>
>>7792072
>using std cout;
>using std endl;
>using std fstream;
>using std string;

I detect severe autism

std::cout
std::endl
std:: fstream
std::string

It is not so hard, faggot. It also considered best practice.
>>
>>7792075

But that's how all websites show how to solve fizzbuzz questions!
>>
>>7792075
So much this

>>7792072
[code]
for(int odds = 27; odds < 64; odds += 2;)
cout<<odds<<endl;
[/code]
Why not at least think a little or something?

(Apparently code tags are hard)
>>
>>7792090
Oh nvm, this isn't /g/. Wtf is this thread doing here then
>>
>>7792090
[code] only in /g/. We [math] int main(void) { return 0; } [/math] here.
>>
>>7792075
>>7792083
>>7792090

You do realize that was coded to be obtuse, right?
>>
>>7789011
So you like beastiality...kill yourself
>>
>>7792009
Yeah, they can code bugs, as much as you want, too!
>>
File: math phd 300k starting any job.jpg (24 KB, 400x267) Image search: [Google]
math phd 300k starting any job.jpg
24 KB, 400x267
>>7789066
>>
Mine was a short intro to JavaFX and recursion. We're using JavaFX to visualize some of what is going on. Kind of like it, never used JavaFX before and it's straightforward it seems.

None of the other content in DS&A seems to be too new to me either so I'm somewhat confident about it all.
>>
>>7792063
But what about women who have been programming since their pre-teens? Granted there's less of those than males, that's for sure, but hey.

I'm just as annoyed as you are at these Stacies and Chads that want to jump the bandwagon and become 'le programmers XDDDD' after watching hacker movies and wanting to 'hack the mainframe' or watching shit like The Internship, or doing it 'for teh moniez and silicon valley XDDD'. The only thing is that this (programming, and computer science and engineering) has been a dream of mine since, quite literally, childhood.

>inb4 "speshul snowflake"

Nope, not at all. Just being honest.
>>
>>7792165
>But what about women who have been programming since their pre-teens?

Well, I try to emphasize that the problem was the time invested. If a girl started programming in her pre-teens and never stopped then she is probably headed to a 6 figure salary at google or facebook and good for her.

>Granted there's less of those than males
I have never seen a girl programming. Much less since their teens. The closest I was to that was when a female friend of mine said to me that she wanted to make videogames and she wanted to learn programming and wanted to know how did I get started. I gave her the resource I used to learn C++ but in the end she never learned. She told me that she would wait until college (This was like freshman year of high school) and then I believe she went on to study architecture so in the end she never learned to program, at all.

but yeah,
>muh annecdotal evidence

Anyways, I also despise those who study programming because they just want to make videogames or want to become hackers. That is why I complete avoided, CE, CS and SE in college and went straight into pure mathematics.

>has been a dream of mine since
Not to insult you or anything but this may be a low bar for a dream. Unless you want to do high level research in algorithms and computer theory in general because then I would applaud you because very few want to get that deep.

In the end, I've never seen a woman who has put as much of their personal time into programming as I have so I see them as inherently inferior programmers. And even more disgusting is the fact that they have really weak attempts at picking themselves up. I saw on facebook an ad about a programming school who was just for women. What the fuck is that?

Women complain that software is a 'boys club' and there they are making women only classes.
Bunch of two faced hypocritical harpies I'd call them.
>>
>>7792063
>coding is trivial
>girls can't code
Choose one, and only one.

>>7792072
>C++
>stdlib.h
>>
>>7792297
you can use stdlib.h or cstdlib in C++
>>
>>7792297
Why one and only one?

>Linear Algebra is trivial
>Biology majors can't into it even if their life depended on it
>>
>>7792332
To be fair, Linear Algebra relies a lot on a good teacher to build intuition in the students. Without building the intuition of what concepts represent, it becomes a tedious memorization course. Until later courses required me to actually use linear algebra to implement adaptive filters/machine learning algos, I didn't understand it.
>>
>>7792372
Doesn't change the fact that it is trivial. Doesn't change the fact that I self-learned it with the help of an old book I found online as a pdf and nothing more.

Trivial shit can be trivial for the infinity of time and yet you can still find someone who won't get it even if you hit their head with a book until their brain spills out of their ears.
>>
>>7792386
Yeah same way getting laid is trivial and yet you can't seem to manage it.
>>
>>7792393
>gets so booty fucking blasted even though I'm just trying to make a point to another anon

It looks like the one with the deep sexual frustration isn't I.
>>
>>7792397
Haha love that projecting but no, I just know how to spot a pasty virgin. Not that it took much detective work in this case.

>Doesn't change the fact that I self-learned it with the help of an old book I found online as a pdf and nothing more.
Holy fuck /sci/ is good for a laugh sometimes.
>>
>>7792410
What is wrong about that? I wanted to get my feet wet in rigorous proof writing and back when I was a teen Linear Algebra was the closest thing that would incorporate long proofs without completely blowing my young mind.

You just seem bitter that you can't handle such challenges as learning a field of mathematics on your own.
>>
>>7792415
Just pointing out that you come off like a stereotypical autistic virgin.
>>
>>7792423
>Autistic
>For reading a book

With such generous and made up definitions I can only come up to the conclusion that you must be clinically retarded. I wish you the best in the brain transplant surgery.
>>
>>7792072
Oh and because this is CS and being pedantic is your primary marketable skill, it says declare not allocate in the first two problems. So they answer they wanted was

<boilerplate here>
int one[10];
int *two = &one[2]; //because zero indexing
for(int i=27; i<=63; i+=2){ cout<<i<< endl;}
ifstream four ("data.txt");
return; //not zero because you declared main to not return any value.

Also looking at that for loop be sure to pay attention when the teacher talks about big O notation, sure it's still O(n) but not all O(n) algs are equal.
>>
>>7792459
>int *two = &one[2]; //because zero indexing

You're calculating &(*(one+2)) dumb ass.

>return; //not zero because you declared main to not return any value.

C++ demands main always return an int.
>>
>>7792498
First: yes I am, because any compiler not written in a semester will optimize that out and because doing pointer arithmetic on an array should be punishable under the Geneva convention.

Second: You're right. That's what I get for only using the C subset unless I need to. Also I'm even more of a dumbass because they did actually declare int main not void main.
>>
>>7788752
>"What did I get myself into?"
Why didn't you raise your hand OP. This post proves that this is what you were thinking.

>Babby class
>Autistic class mates
>No hot chicks

This is your life.
>>
>>7789066
>On the internet no one knows you're just an autistic NEET.
>>
>>7792509
>because doing pointer arithmetic on an array should be punishable under the Geneva convention.

Why?
>>
>>7789066
Link to dissertation?
>>
>>7792558
Because it's ugly, counter intuitive, makes the code hard to read and maintain, tends to be system dependent, and has so much room to make horribly hard to debug errors that it should only be done as a last resort. Anything you can do with it can be done more clearly without any decrease in performance by using the tools already created for those things.
>>
>>7792561
Ok let me correct myself: almost anything. There is some really low level systems stuff you can only do with it but at that point you're just using C as a shorthand for your assembly.
>>
>>7792561
>ugly

Less so than &2[one]

>counter intuitive

No, needing to throwing in a factor of sizeof(pointer_type) is ugly and counter intuitive.

>tends to be system dependent

Endianness doesn't after pointer arithmetic. The fuck are you smoking
>>
>>7792572
Ok, so I'm garbage at variable naming. But I feel that reads pretty clearly for something involving pointers to weird things. "I want an Integer pointer named two that has a value of the address in the array named one at index number 2"

Why would you do that in anything besides pointer arithmetic or allocating memory?

For example these: http://www.viva64.com/en/a/0065/#ID0EORHK
>>
>>7792509

C requires main return int as well. See section 5.1.2.2.1 of the draft C99 standard (I don't have the actual standard to quote from).

I had a class where the textbook used void main(). I refused to buy it and had a long talk with the old ex-COBOL programmer teaching the class about making wiser textbook choices.
>>
>>7792718
Let me guess, K&R's "The C Programming Language"? Though yes, you are right the C99 standard does specify that, and from an OS design perspective good for them. That said good luck getting the major compilers to enforce it.

I learned computing on a C64 bought at a garage sale in the mid 90's and self taught from there. I dropped CS as a major after I realized that the idea of an introverted programmer is pretty much dead, the good old days the old guard talk about are gone, and abominations like C++ are industry standard (at least using every added feature in it seems to be). I have a well loved copy of K&R's C on my shelf too. So that probably explains a decent amount of my tastes in coding style. That said if you can quote C standard like that I'm sure you've got a bright future in some niche fields.
>>
>>7792753

It wasn't K&R. I don't remember who it was by, and since I refused to buy it, I don't have a copy laying around.

K&R returns int as well. They don't always specify it, though. If you declare a function without a type, it defaults to int. If main() reaches the end without a return statement, it returns a 0. So all they K&R examples with just "main()" are correct, if a bit out of date style-wise.

"void main()" is a completely different animal, and has never been correct (for hosted programs, anyway. Freestanding environments throw all this out the window.).

I'm pretty sure it's always been this way. Before ANSI, C was defined more-or-less by the C compiler in UNIX. UNIX's program loader expects main to return an int.
>>
>>7792559
Srsly you gonna think a math PhD is gonna out himself for surfing this weird site? LOL.
>>
>>7792072

the scorn of your fellow anons
>>
>>7792072
> multiple branching inside for-loops

I would not hire you if I ran a computational mathematics software kind of company focused on writing fast low level code. But I am likely to be too socially awkward to ever be able to pull that off anyway so you should probably not listen to me.
>>
>>7792940
At least you admit to not knowing what you're talking about.
>>
File: 1444359336436.jpg (9 KB, 180x240) Image search: [Google]
1444359336436.jpg
9 KB, 180x240
>>7792116

>Hey guys, women are good at STEM.
>No they aren't.
>I was just pretending to be retarded.

Kill yourself
>>
>>7792945
I know what I'm talking about. I just won't be able to convince others that I'm right in a way to make money on it. There's a big difference.
>>
>>7792020
>Assuming that hiring is usually based on skill.

Hah, you're a funny one.
>>
>>7788985

1-3 should NOT be things you need to google.
>>
>>7788937

Data Structure isn't Algorithms. It's about being able to implement them just as much as their analysis.
>>
File: random_number.png (7 KB, 400x144) Image search: [Google]
random_number.png
7 KB, 400x144
>>7788752
1. int fluffy [10];
2. int *ptr = fluffy[3];
3. for(int i = 27; i < 63; ++i)
if(i%2 != 0) { std::cout i;}
4. ofstream file;
file.open("data.txt");


wut.
>>
>>7789066
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>7788752
>mechanical keyboard in class
I shitpost in /mkg/ on /g/, and this triggers me to no end.
>>
>>7793124
It is based on a skill though.

Who can suck the boss's dick better. At least for the female quota applicants.
>>
>>7794233
#2 throws an error because you're assigning a int to an int pointer and no good compiler would let you get away with implicitly typecasting that.
>>
>>7794233
Let me teach you how to count 0, 1, 2, 3
Which one of these is the third element?
Thread replies: 74
Thread images: 6

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.