|
Bloody in another thread posted:select, where, aggregate are map, filter, fold btw, thanks for the linq rosetta stone. i couldn't see past the weird sql-like names and i actually am using it now that i understand what it is. also got to actually write some c# logic today and it feels so good. (gently caress javascript)
|
# ? May 25, 2016 21:21 |
|
|
# ? May 26, 2024 07:28 |
|
HoboMan posted:btw, thanks for the linq rosetta stone. i couldn't see past the weird sql-like names and i actually am using it now that i understand what it is. protip: remember to use the aggregate overload that takes an initial value or it'll runtime exception on your rear end at the first empty sequence protip2: as soon as you go "drat none of the standard methods do exactly what I want", go write it yourself, it's really easy. 90% chance it'll be FirstOrElse or DoForAll
|
# ? May 25, 2016 21:44 |
|
what is doforall and how does FirstOrElse differ from firstordefault
|
# ? May 25, 2016 21:46 |
|
FirstorElse would let you specify a value instead of the default one. DoForAll would call an action for each item in the list. I presume, at least.
|
# ? May 25, 2016 21:50 |
|
Valeyard posted:On a call with a business user, we were showing him our JIRA. First thing he asks; can I export this (the backlog) to excel "can i export this to excel" means "im going to type things into excel and expect it to cause things to happen in the outside world, because im a fucker who thinks its acceptable to have no idea how the tools crucial to getting my jobs done work, like if i thought cars ran on happy thoughts so felt justified in chewing out the dealer every time i ran out of gas on the side of the road"
|
# ? May 25, 2016 21:55 |
|
excel exports: not even once
|
# ? May 25, 2016 21:55 |
|
the only acceptable response to "can i export this to excel" is "yes, in the sense you can also advocate for the genocide of minorities. it is an option available to you as a sentient being"
|
# ? May 25, 2016 21:58 |
|
Breakfast All Day posted:i'm a fucker who thinks its acceptable to have no idea how the tools crucial to getting my jobs done work same
|
# ? May 25, 2016 22:10 |
|
Chamook posted:FirstorElse would let you specify a value instead of the default one. LINQ already has DoForAll in the form of the ForEach extension method.
|
# ? May 25, 2016 22:31 |
|
just gotta go with AsParallel().ForAll()
|
# ? May 25, 2016 22:36 |
|
ok imagine typing out C# code:
C# code:
HoboMan fucked around with this message at 23:02 on May 25, 2016 |
# ? May 25, 2016 22:59 |
|
HoboMan posted:ok i am more concerned that they choose to write it 100 times instead of putting it in a loop
|
# ? May 25, 2016 23:04 |
|
Finster Dexter posted:LINQ already has DoForAll in the form of the ForEach extension method. only works on List<T>, not IEnumerable<T>
|
# ? May 25, 2016 23:11 |
|
garbage-nn is now definitely capable of learning it just is either really slow at it or i had a piece of my training set generation hosed up or something idk. with some liberal reinterpretation of the book i've gotten a 65% success rate on digit recognition and rising as i type. go lil garbage-nn go! 70%! its going!
|
# ? May 25, 2016 23:20 |
|
MALE SHOEGAZE posted:i am more concerned that they choose to write it 100 times instead of putting it in a loop it's a bunch of this C# code:
|
# ? May 25, 2016 23:21 |
|
wait, how is this theoretical DoForAll you guys have been talking about different from Select()?
|
# ? May 25, 2016 23:23 |
|
Select is pure, DoForAll is probably intended to have side effects
|
# ? May 25, 2016 23:24 |
|
What's the use case for "DoForAll" over consuming the enumerable in a foreach?
|
# ? May 25, 2016 23:39 |
|
HoboMan posted:wait, how is this theoretical DoForAll you guys have been talking about different from Select()? i dont know linq but id guess select returns the list and forall does not return anything
|
# ? May 25, 2016 23:51 |
|
you are really really not supposed to have side-effects in a Select this is why ForEach doesn't actually exist. it's not an oversight by the devs, it's "lol lazy side-effects. let's at least try to keep them away from people" use a for each loop because it is strict. lazy side effects are almost certainly not what you want.
|
# ? May 25, 2016 23:56 |
|
just the smallest point: any exceptions thrown in a lazy list will probably escape a try/catch block they throw when they get evaluated and if that's not inside the block then whoooooops gently caress you and that's just language semantics and doesnt even touch on confusing behaviour when you try to actually do things with them. don't use ForEach people.
|
# ? May 25, 2016 23:58 |
|
gonadic io posted:just the smallest point: any exceptions thrown in a lazy list will probably escape a try/catch block that's actually not a problem with ForEach, because again, it's an extension of List<T>, not IEnumerable<T> but yeah don't put side effects in anything lazy, debugging that is a nightmare
|
# ? May 26, 2016 00:02 |
|
oh i forgot that Lists are not lazy but IEnumerables are. my bad. everything i said doesn't apply to strict collections (but then chaining map and filter etc together are worse on strict collections soooo)
|
# ? May 26, 2016 00:12 |
|
logback and slf4j both seem really cool. does that mean I'm correctly doing the java?
|
# ? May 26, 2016 00:57 |
|
yeah they're kind of the current standard for java logging and there are slf4j bridges you can use to replace stuff like jcl or log4j if other dependencies were using them.
|
# ? May 26, 2016 01:01 |
|
pokeyman posted:logback and slf4j both seem really cool. does that mean I'm correctly doing the java? yes
|
# ? May 26, 2016 01:01 |
|
log4j2 even better, do stupid poo poo like colour highlighting.code:
|
# ? May 26, 2016 01:20 |
|
MrMoo posted:log4j2 even better, do stupid poo poo like colour highlighting. yikes
|
# ? May 26, 2016 01:27 |
|
oh gently caress i need a job poo poo i dunno how to get a real job
|
# ? May 26, 2016 04:09 |
|
Breakfast All Day posted:the only acceptable response to "can i export this to excel" is "yes, in the sense you can also advocate for the genocide of minorities. it is an option available to you as a sentient being" this is also a good go-to response for interview questions
|
# ? May 26, 2016 04:48 |
|
Breakfast All Day posted:"can i export this to excel" means "im going to type things into excel and expect it to cause things to happen in the outside world, because im a fucker who thinks its acceptable to have no idea how the tools crucial to getting my jobs done work, like if i thought cars ran on happy thoughts so felt justified in chewing out the dealer every time i ran out of gas on the side of the road"
|
# ? May 26, 2016 12:22 |
|
I helped export all our help files to word for someone so that he could "review" them and woops! now all the edits are in word and we're just delivering a big fat word file instead of the old contextual help
|
# ? May 26, 2016 12:24 |
|
resharper seems neat but there sure is a lot of overlap between its features and vs2015's. all i want is the drat code coverage and now i've got this thing offering to fix every god drat line in my solution
|
# ? May 26, 2016 13:15 |
|
also for some loving reason i can't type semicolons now that is a problem
|
# ? May 26, 2016 13:27 |
GameCube posted:also for some loving reason i can't type semicolons now that is a problem
|
|
# ? May 26, 2016 13:29 |
|
GameCube posted:also for some loving reason i can't type semicolons now that is a problem time for your semicolonoscopy
|
# ? May 26, 2016 13:49 |
|
MALE SHOEGAZE posted:time for your semicolonoscopy seek counselling
|
# ? May 26, 2016 13:50 |
|
GameCube posted:also for some loving reason i can't type semicolons now that is a problem here you go ; just copy/paste that as needed
|
# ? May 26, 2016 13:52 |
Notorious QIG posted:here you go
|
|
# ? May 26, 2016 14:05 |
|
|
# ? May 26, 2024 07:28 |
|
GameCube posted:resharper seems neat but there sure is a lot of overlap between its features and vs2015's. all i want is the drat code coverage and now i've got this thing offering to fix every god drat line in my solution resharper is massively overhyped and this gets even worse as vs integrates the genuinely useful pieces
|
# ? May 26, 2016 16:32 |