IT/Software career thread: Invert binary trees for dollars.

Noodleface

A Mod Real Quick
38,242
15,023
Our synergizing is way off here. Let's have a 1:1 so we can deep dive and come to solution that makes sense historically for our brand.
 

Noodleface

A Mod Real Quick
38,242
15,023
So far the new company isn't like that. They are very big on security though, which is obvious if you know what they do. Can never mention who our customers even are unless they're on the wall inside the front doors.

So far the team is really cool though. Working at a smaller company is crazy. At Emc there'd be a group of people responsible for something like bios or sustainability and stuff, here it's one person.
 

Vinen

God is dead
2,789
495
So far the new company isn't like that. They are very big on security though, which is obvious if you know what they do. Can never mention who our customers even are unless they're on the wall inside the front doors.

So far the team is really cool though. Working at a smaller company is crazy. At Emc there'd be a group of people responsible for something like bios or sustainability and stuff, here it's one person.
Which is kind of funny given that their website lists a ton of their major customers :3
 

Deathwing

<Bronze Donator>
16,716
7,731
Nothing like having to refactor someone else's shit code that really changes your opinion of them. I get that people can get stuck in their habits, I more than likely have my own bad habits, but writing Python like C code is incredibly enraging.

Print statements with multiple '\n' so whoever reads you code has to interpret a whole paragraph on one line just so you could save a few lines of code.
Iterating through a list of strings and comparing to [i+1] to determine if the list is out of order, instead of just using the fucking sorted() builtin and comparing the two.
Miniature 2-line functions fucking EVERYWHERE.

Just because you're writing a script doesn't mean you have to make it as unreadable as a typical script.
 

Noodleface

A Mod Real Quick
38,242
15,023
I write python like C, it's a terrible habit but what do you expect from a guy who was taught C in school and has been using it professionally for over 3 years?
 

Khane

Got something right about marriage
20,313
13,959
I write python like C, it's a terrible habit but what do you expect from a guy who was taught C in school and has been using it professionally for over 3 years?
I'd expect that you stop acting like a 60 year old relic and learn how to do it properly.
 

Deathwing

<Bronze Donator>
16,716
7,731
I write python like C, it's a terrible habit but what do you expect from a guy who was taught C in school and has been using it professionally for over 3 years?
I cut my teeth on C and C++ too. I started learning Python for my current job and it's been an outstanding revelation. I don't see how you can experience the amount of verbosity and readability that Python offers and not want to take advantage of that.
 

Noodleface

A Mod Real Quick
38,242
15,023
I use it "once in awhile" for quick and dirty shit. If it was part of my job id take a more serious approach
 

a_skeleton_03

<Banned>
29,948
29,763
So I am writing beginner code for this class and it sucks balls. It's supposed to just be an intro to algorithm design or something like that but they are dumping stuff on us and not teaching it. Classic online course.

Here is the code I submitted for this week's homework. What I did was manually add in the options as you see in opt to make it two sticks of ram, two gpu's, and two hard drives. I then added them together.

I guess I was supposed to ask for the user input, that makes sense I guess.

Here is me dabbling with trying to figure out what is going on to add some kind of user input.

I know there are some errors because of course it isn't working right.

I need some kind of statement that when answered will double ram, gpu, and hdd. I think I am spending too much time trying to figure out how to make sure they can do Y or y and instead should switch the question around to an integer. I still don't know how to take it from there. I also need a then statement to move on also don't I?

 

Tenks

Bronze Knight of the Realm
14,163
607
'double' is a variable type. I don't know how that code actually compiles. You need to do something like gpu = gpu * 2.
 

a_skeleton_03

<Banned>
29,948
29,763
'double' is a variable type. I don't know how that code actually compiles. You need to do something like gpu = gpu * 2.
Yeah I dumped that.

This is working better but I think it's still broken, I am using a shit online IDE. I don't know if I can redefine variables like that.
 

Tenks

Bronze Knight of the Realm
14,163
607
I can't say I know C very well but those if tests don't look syntactically correct

Dump the ramopt variables because they're redundant. I don't see their purpose.

Also reading the code I think the if check may be working serendipitously only because '1' == 1 because character 1 is ASCII 1. You need to declare the input variables as chars. That may be why you were having issues with the Y/N input.
 

a_skeleton_03

<Banned>
29,948
29,763
I can't say I know C very well but those if tests don't look syntactically correct

Dump the ramopt variables because they're redundant. I don't see their purpose.
The concept is that if you want 1 then I just pass hdd into hddopt but if you want 2 then I hdd * 2 into hddopt.

The ramopt and gpuopt are because these are the three things I am looking for input on or am I missing your point there?
 

a_skeleton_03

<Banned>
29,948
29,763
Your 'if else' syntax is wrong.
That makes more sense from what little I know, I think I have something else wrong. Right now I put those changes in and this is what I am getting. Some other syntax problem I think.

sh-4.3$ gcc -o main *.c
sh-4.3$ main
Would you like one or two hard drives? 1 or 2: main
Would you like one or two sticks of RAM? 1 or 2: Would you like one or two video cards? 1 or 2: Computer prior to modification is: $1554.
The entire computer is: $8393461 without tax or shipping.

I think I am not syntaxing out some lines or something? I don't know how else to describe it.
 

Tenks

Bronze Knight of the Realm
14,163
607
The concept is that if you want 1 then I just pass hdd into hddopt but if you want 2 then I hdd * 2 into hddopt.

The ramopt and gpuopt are because these are the three things I am looking for input on or am I missing your point there?
Yeah it was your reassignment that was throwing me off. Read my edit. Modify the actual initialized to be the ones being doubled. You can either read in the variables as integers or characters but make sure you compare the two properly. 1 == 1 is not the same as 1 == '1' because one is comparing two integers and one is comparing an integer to a character.
 

Deathwing

<Bronze Donator>
16,716
7,731
Also, since your input variable are integers and you're using scanf and %d to store them in integers, compare things like getopt and hddopt to 1, not '1'.

'1' != 1


or what tenks said.