Thomas changed the topic of #kspmodding to: Welcome to #kspmodding - the channel for discussing, and learning about, modding Kerbal Space Program. Code of Conduct: https://git.io/vSQh6 | Always provide logs. | *** PSA: https://kerbalspaceprogram.com/api/index.html | <Red5> Guy was asked for a log file, he gave this link: http://pastebin.com/wfVarZPf | If you haven't read it yet: Logs :P
NathanKell is now known as NathanKell|AFK
ve2dmn has quit [Ping timeout: 186 seconds]
ve2dmn has joined #kspmodding
Pap|AFK is now known as Pap
blowfish has joined #kspmodding
VITAS has quit [Ping timeout: 204 seconds]
VITAS has joined #kspmodding
regex has joined #kspmodding
regex has quit [Remote host closed the connection]
Pap has quit [Read error: Connection reset by peer]
Pap has joined #kspmodding
NathanKell|AFK is now known as NathanKell|AWAY
blowfish has quit [Quit: Leaving]
smoke_fumus has joined #kspmodding
smoke_fumus has quit [Client Quit]
riocrokite has joined #kspmodding
<TheKosmonaut> taniwha: are you present?
smoke_fumus has joined #kspmodding
<Sigma88> hi there, I have an efficiency question for code
<Sigma88> if I have a List<> with a bunch of elements
<Sigma88> and I want to pick the best one following a set of rules
<Sigma88> what would be the most efficient way to do that?
<Sigma88> specifically
<Sigma88> let's say I have a list of objects with 5 different properties
<Sigma88> and I want to find the object that shares the most properties with the input
<Sigma88> so, if one matches all 5 output that one
<Sigma88> if not, input one that shares 4
<Sigma88> if not, 3, 2, 1
<Sigma88> I was doing myList.FirstOrDefault(o => o.first == input.first && o.second == input.second && o.third== input.third && o.fourth== input.fourth && o.fifth == input.fifth)
<Sigma88> then if null, repeat with just 4
<Sigma88> etc
<Sigma88> but that sounds like it is unefficient
<Sigma88> would it be better to use a foreach?
SirKeplan is now known as SirKeplan|away
<riocrokite> no idea on the subject
<riocrokite> but you may want to 'google filtering collections in c sharp'
<riocrokite> maybe this might be helpful or will lead you somewhere
<Sigma88> thanks
<Sigma88> nah that's simple .Where stuff
<Sigma88> I know how to get the filter itself
<Sigma88> my problem is, I assume whenever I do a .Where a new list is generated
<Sigma88> so the memory gets filled with a lot of crap
<Sigma88> possibly
<Sigma88> I'm not really a big expert on this
ferram4 has quit [Ping timeout: 204 seconds]
<riocrokite> yah
<Sigma88> so, would it be best to go through myList with a foreach
<Sigma88> and build an OutputList
<Sigma88> including the best fit
<Sigma88> and then output one at random from that list?
<Sigma88> that's what I am currently doing
<Sigma88> I go through every element, assign a "score" to the element, if the max score until that moment has been lower, I clean the output list, then set the maxscore to whatever score that element has, and add it to the outputlist
smoke_fumus has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Starwaster has quit [Ping timeout: 200 seconds]
Technicalfool has joined #kspmodding
Thomas|AWAY is now known as Thomas
stratochief has joined #kspmodding
Starwaster has joined #kspmodding
regex has joined #kspmodding
riocrokite has quit [Quit: http://www.mibbit.com ajax IRC Client]
ferram4 has joined #kspmodding
blowfish has joined #kspmodding
Ezriilc has joined #kspmodding
egg|zzz|egg is now known as egg
egg is now known as egg|nomz|egg
blowfish has quit [Quit: Leaving]
egg|nomz|egg is now known as egg
Thomas is now known as Thomas|AWAY
smoke_fumus has joined #kspmodding
pi|Zzz|aoverhead is now known as pizzaoverhead
blowfish has joined #kspmodding
regex has quit [Remote host closed the connection]
regex has joined #kspmodding
<xShadowx> i gotta say it again......notepad++ and regex with batch search/replace, godly tool
<xShadowx> over 30k files in a database searched and edited in <5min
ferram4 has quit [Read error: Connection reset by peer]
ferram4 has joined #kspmodding
stratochief_ has joined #kspmodding
stratochief has quit [Ping timeout: 201 seconds]
Ezriilc has quit [Quit: Going offline, see ya! (www.Kerbaltek.com)]