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!

Khane

Got something right about marriage
20,588
14,315
Question: is there a data structure that is sort of like a Queue or Stack but is random access? For example, I request an element at a particular index, that element is retrieved and automatically removed from the set.

I can create such a beast with a custom Dictionary class with some added logic to remove the key after retrieval. But was just curious if there was a formal name for such a beast.
You kind of already answered your own question. Dictionary, List, HashTable, etc. There are a lot of collection types in C#, you just have to call the dictionary.remove method with the index instead of doing a pop. It's not really any different other than passing the actual index rather than built in FIFO or LIFO with stacks and queues.
 

ShakyJake

<Donor>
7,958
20,063
remove method with the index instead of doing a pop. It's not really any different other than passing the actual index rather than built in FIFO or LIFO with stacks and queues.
Right, I just didn't want to reinvent the wheel if it wasn't necessary (not that it would be a huge effort - I wrote something in 2 minutes that does the job).

I sometimes have to code device interfaces which involves storing control ids and needing to know which control ids I've received and which ones I need to send a response to. They aren't in any particular order so a queue or stack won't work since they have strict ordering.
 

Tuco

I got Tuco'd!
<Gold Donor>
47,893
82,477
You'll want a dictionary, vector or list depending on your particular case. To my knowledge a random-access data structure that innately removes components when they're accessed doesn't exist in .NET and it's such a rare use case and so easy to implement yourself I doubt there's a well-used library with it.
 

Tuco

I got Tuco'd!
<Gold Donor>
47,893
82,477
Since the topic of popularity of languages came up before, here is something else with connection to that topic:

Stack Overflow Developer Survey 2015
The occupations breakdown was surprising. Are only 2.9% of people on stack overflow embedded developers?
frown.png
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,968
How many people do embeded in total? I didnt think there are too many people doing it. Especially when you compare the numbers to web developers.
 

Voyce

Shit Lord Supreme
<Donor>
8,547
30,869
The occupations breakdown was surprising. Are only 2.9% of people on stack overflow embedded developers?
frown.png
I was just looking at that article the other day. Here's a question, how many business applications--specifically those related to Data and Data Manipulation(things easily replaced with relational databases)--are still written in Assembly? I'm starting to feel like I work in the Twilight Zone.
 

Citz

Silver Squire
180
8
I would understand if you were still working on a mainframe with some retarded script language but assembly really is the twilight zone when it comes to data/transactional applications.
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
Right, I just didn't want to reinvent the wheel if it wasn't necessary (not that it would be a huge effort - I wrote something in 2 minutes that does the job).

I sometimes have to code device interfaces which involves storing control ids and needing to know which control ids I've received and which ones I need to send a response to. They aren't in any particular order so a queue or stack won't work since they have strict ordering.
Take any c# list and inherit it, then override the get method, or the index accessor. make it so the get method deletes at the end.. boom problem solved.
 

Voyce

Shit Lord Supreme
<Donor>
8,547
30,869
You haven't lived until you manually track down erroneous data through a VSAM record filled with HEX, binary bit fields hiding in bytes (COMP), COMP-3 compressed fields, and sometimes with randomly uncompressed bytes thrown about.

I flip bits by hand, code is for sissies
I'm closer to this reality than you could fathom, or at least would want to.