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

  • Guest, it's time once again for the massively important and exciting FoH Asshat Tournament!



    Go here and give us your nominations!
    Who's been the biggest Asshat in the last year? Give us your worst ones!

Tenks

Bronze Knight of the Realm
14,163
607
Ok I think I figured out whats you're trying to do here a bit more. Here is the pseudo for how I'd do it:

That should be your basic code flow. But you still have some key syntactical problems like Deathwing said. But honestly if you're trying to learn just having us tell you exactly the syntax to use won't really teach you anything.
 

a_skeleton_03

<Banned>
29,948
29,763
Ok I think I figured out whats you're trying to do here a bit more. Here is the pseudo for how I'd do it:

That should be your basic code flow. But you still have some key syntactical problems like Deathwing said. But honestly if you're trying to learn just having us tell you exactly the syntax to use won't really teach you anything.
Oh yeah I know learning isn't getting the exact syntax from you, mainly asking if you see an obvious flaw and where I should look at. I think I understand my flaw now with reading as an integer instead of char. I think I was cluttering it up with defining a variable first and then managing the variable afterwards as well.

Your pseudo is exactly right. I am making progress but something is not closing it because it isn't advancing line by line on my IDE and then it's spitting out a very large and incorrect number, need to figure out why it isn't advancing to the next line, I am sitting on google right now checking out other tutorials to see what I missed conceptually.
 

Tenks

Bronze Knight of the Realm
14,163
607
Yes but not the other way around, obviously.

The program runs the else ifs one after another and will not run any more after one succeeds. So if you have something like

Only the else if (1==1) would execute despite the one below it being valid as well
 

a_skeleton_03

<Banned>
29,948
29,763
Of course.
So I can essentially do:

Do you want 1 or 2 drives?
if 2 then drives * 2

Do you want 1 or 2 sticks of ram?
if 2 then ram * 2

This can keep going.

Do I need some kind of syntax to tell it to ask the next question and 'close' out the previous statement? That seems to be where my error is.
 

Tenks

Bronze Knight of the Realm
14,163
607
Oh yeah I know learning isn't getting the exact syntax from you, mainly asking if you see an obvious flaw and where I should look at. I think I understand my flaw now with reading as an integer instead of char. I think I was cluttering it up with defining a variable first and then managing the variable afterwards as well.

Your pseudo is exactly right. I am making progress but something is not closing it because it isn't advancing line by line on my IDE and then it's spitting out a very large and incorrect number, need to figure out why it isn't advancing to the next line, I am sitting on google right now checking out other tutorials to see what I missed conceptually.
I think it is spitting out a huge number because your "ramopt" variables are never properly initialized. So when you do ramopt *= 2 it is taking whatever junk is in ramopt's memory space and doubling it. It may work if you answered '1' to everything ... maybe.
 

a_skeleton_03

<Banned>
29,948
29,763
I think it is spitting out a huge number because your "ramopt" variables are never properly initialized. So when you do ramopt *= 2 it is taking whatever junk is in ramopt's memory space and doubling it. It may work if you answered '1' to everything ... maybe.
Good call there, initialized the three as a 0 to start with. It takes the first scanf and uses it but the next 2 it doesn't let me input, going to check my syntax, I have something wrong.
 

Tenks

Bronze Knight of the Realm
14,163
607
I think you do just need to make some general structural changes to the code. Using ramopts as the input feed won't work. Just make an int input and feed all the inputs into that. Based upon the question just add to a running variable called "total" which is seeded by the initial summation. That way if they say "1" to RAM you add 0. This way you could also scale it so really any number by simply doing total = ram * (input - 1).
 

a_skeleton_03

<Banned>
29,948
29,763
I worked it differently but I think it's simplistic this way and I wanted to make it work with if statements even though I didn't have to. Here is what I did and it works.

 

Tenks

Bronze Knight of the Realm
14,163
607
Yeah looks good. Or i think you could subtract '1' from your temp variables and that would remove having the "- hdd" and things like that in the total. But overall looks good.
 

a_skeleton_03

<Banned>
29,948
29,763
It's at least functional which is all I need. I have no interest in working with C or C++ ever again after this class or I would clean it up further and make it elegant. Right now it works and my homework is fixed.
 

Noodleface

A Mod Real Quick
38,374
16,279
You're hitting me right in the feels

Next time you can post it on pastebin too, it makes it a little easier to read
 

moontayle

Golden Squire
4,302
165
Testing my fix for the previous issue I was looking into and my network call starts flat out failing because of an SSLProtocolException. Roll back to production code, still failing. Type address in device web browser, also fails. Type address in device Chrome browser. Works. WTF? Found out the most recent Windows update included a security fix that affects TLS in some way. Willing to bet this is the culprit but it's not like I can call up the customer and ask them to roll that shit back. Ugh.
 

Noodleface

A Mod Real Quick
38,374
16,279
First week is done here. Fought with IT all week to get a local windows VM for software I need. Finally today a guy on the team gave me an iso and key and I was able to do it. Took him 5 minutes while it has been fighting me all week.

They tossed me in the deep end with this shit for sure. I'm still unclear what I will be doing in the long run.
 

Deathwing

<Bronze Donator>
16,962
7,981
Testing my fix for the previous issue I was looking into and my network call starts flat out failing because of an SSLProtocolException. Roll back to production code, still failing. Type address in device web browser, also fails. Type address in device Chrome browser. Works. WTF? Found out the most recent Windows update included a security fix that affects TLS in some way. Willing to bet this is the culprit but it's not like I can call up the customer and ask them to roll that shit back. Ugh.
Interesting that you mention that. I'm having a TLS issue at work that's only affect windows boxes too. Though, I'm pretty sure I haven't updated the machine my sandbox is running in the last week. Do you have any more information on what the problem is?
 

moontayle

Golden Squire
4,302
165
This is the Security Bulletin from MS:Microsoft Security Bulletin MS15-121 - Important

The security update addresses the vulnerability by adding extended master secret binding support to all supported versions of Transport Layer Security (TLS).
Doesn't entirely explain why my call works in some aspects but not others, even on the same device. But the timing of the sudden dive from success to failure lines up. Our web guy noticed a few oddities with TLS/SSL trying to hit the client website as well so at least I'm not crazy.
 

Noodleface

A Mod Real Quick
38,374
16,279
How deep? Like, "Here's the code, have fun!" ? I know the feels if that's the case.
Sort of. I guess I have to be careful of what I say. A guy handed the code base over to me today and said "ok it's yours" . I need to setup the code repository on stash and everything and I'm basically starting development from ground zero. I have code but it's basic.
 

Noodleface

A Mod Real Quick
38,374
16,279
The tools we use are mostly Windows, but they also have a Linux version that you have to also license out for a hefty fee. We only have access to the Windows version.

On the flipside, I get to keep my macbook and I am in love with it. Having a Windows 8.1 VM open and being able to do the 3 finger swipe between OSX and Win8.1 is so fantastic.