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

Noodleface

A Mod Real Quick
38,245
15,029
I am the only BIOS engineer here

I'd ask the company but it's not blocking me. It's just something I saw and did a triple take on.
 

Tenks

Bronze Knight of the Realm
14,163
607
I'm getting transitioned off my current project I was assigned to for 6 months once I start my vacation in 1.5 weeks and the vacation lasts 3 weeks. So essentially I just need to make sure my stuff is tested in QA (all my tasks are finished code-wise) so I'm not dropping a steamer of code on them which takes up about 10 minutes of my day. I've been so bored this week. Next week will probably be worse.
 

Noodleface

A Mod Real Quick
38,245
15,029
Ahhhhh been trying to figure out why tokens weren't working the way they wanted for like 2 days now. Just this one token would not behave.

I was setting us to DUAL_BOOT_MODE but it was making the boot mode the entire UEFI list followed by the legacy list. Made no sense at all. I could alter UEFI_BOOT_MODE or LEGACY_BOOT_MODE and my boot order was changing.

Finally I looked into build artifacts and noticed DUAL_BOOT_MODE was defined like it was UEFI_BOOT_MODE + LEGACY_BOOT_MODE.

Looked into a make file and saw this.......

AHHHHH!!! Why would you ever have a make file supercede the source code?!!

This took me like 2 days!!
 

Tuco

I got Tuco'd!
<Gold Donor>
46,826
78,446
lol. I got buried in three other tasks right after I posted about it. it's pretty bad (Like 1MB a second), but it's on a tool I made for my own purposes and not production software. I'll fix it one of these days.
 

Vinen

God is dead
2,789
495
lol. I got buried in three other tasks right after I posted about it. it's pretty bad (Like 1MB a second), but it's on a tool I made for my own purposes and not production software. I'll fix it one of these days.
1MB a second

Holy fuck.
 

Tuco

I got Tuco'd!
<Gold Donor>
46,826
78,446
Pretty much everything I do moves a lot of data. If any of those systems have a memory leak it's usually that bad, and my on-vehicle code doesn't have a lot of memory so I have to be vigilant. This is just a C# tool though.
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
you are missing "using"

boom. headshot, without even looking at the code.

using allows you to create scopes of code, that once you exit the code, it will clean the variables from memory
that will clear the file buffer. Also if you are suing XML manipulations careful in how you load them. See this for an example

How to: Perform Streaming Transform of Large XML Documents

Ok, now back to drawing cocks.
 

Deathwing

<Bronze Donator>
16,717
7,731
What's C# standard scope level for garbage collection? Sometimes it's unintuitive. Python is function level, which was fun to learn.
 

Noodleface

A Mod Real Quick
38,245
15,029
Funny little BIOS thing.

I found out that a prominent CPU company's garbage collection routines for page faults doesn't work at all. I reported it to them like a year ago and they say I'm wrong, so fuck em. Shit does not work.
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
What's C# standard scope level for garbage collection? Sometimes it's unintuitive. Python is function level, which was fun to learn.
fromGarbage Collection
Conditions for a garbage collection
Garbage collection occurs when one of the following conditions is true:
The system has low physical memory.
The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This threshold is continuously adjusted as the process runs.
The GC.Collect method is called. In almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.
You pretty much never call it, you just make sure you use "using" properly.

Manipulating unmanaged resources
If your managed objects reference unmanaged objects by using their native file handles, you have to explicitly free the unmanaged objects, because the garbage collector tracks memory only on the managed heap.
using Statement (C# Reference)
File and Font are examples of managed types that access unmanaged resources (in this case file handles and device contexts). There are many other kinds of unmanaged resources and class library types that encapsulate them. All such types must implement the IDisposable interface.
As a rule, when you use an IDisposable object, you should declare and instantiate it in a using statement. The using statement calls the Dispose method on the object in the correct way, and (when you use it as shown earlier) it also causes the object itself to go out of scope as soon as Dispose is called. Within the using block, the object is read-only and cannot be modified or reassigned.
The using statement ensures that Dispose is called even if an exception occurs while you are calling methods on the object. You can achieve the same result by putting the object inside a try block and then calling Dispose in a finally block; in fact, this is how the using statement is translated by the compiler. The code example earlier expands to the following code at compile time (note the extra curly braces to create the limited scope for the object):
I never seen something inside an using leaking memory.
 

Deathwing

<Bronze Donator>
16,717
7,731
Oh, I know you never manually invoke garbage collection. But knowing when the garbage collection occurs is very helpful for programming. Having such vague conditions for C#'s garbage collection seems unhelpful.
 

Vinen

God is dead
2,789
495
Oh, I know you never manually invoke garbage collection. But knowing when the garbage collection occurs is very helpful for programming. Having such vague conditions for C#'s garbage collection seems unhelpful.
Why? The whole intent of Managed Languages is that as long as you develop to Best Practices it doesn't matter when its run? It shouldn't be your concern.
 

Khane

Got something right about marriage
20,314
13,959
Wouldn't garbage collection's scope affect best practices?
No, that's what the using statement Lendarios pointed out does for you. You do not need to know about GC other than it's a thing in C# if you're coding to best practices as Vinen pointed out.
 

Deathwing

<Bronze Donator>
16,717
7,731
Isn't that kinda what I'm saying? You wouldn't have to know about 'using' as a best practice if garbage collection's scope cleaned up this particular problem for you.

I guess I'm just confused as to why you wouldn't want to know the scope level of the language you're using. I went into this job assuming Python's scope level was the same as Java's. It isn't. After that was clarified, it certainly made understanding existing code much easier.