|
GameCube posted:why Why do I work there or why do I have a free account? I work there because it's a paycheck and they hired me right out of college in 2007. I have a free account because everybody who works there gets one! It's a perk!
|
# ? Jul 8, 2016 18:49 |
|
|
# ? May 11, 2024 16:06 |
|
i'm sure it's impossible for you as a dev to just give yourself one if you really wanted.
|
# ? Jul 8, 2016 18:53 |
|
that's not a perk. that's probably the only way they get users.
|
# ? Jul 8, 2016 19:04 |
|
I thought this page specifically identified it as a perk, but I guess not. Never mind!
|
# ? Jul 8, 2016 19:23 |
|
ok so I'm referencing System.Web.dll but I can't use the namespace System.Web.UI????
|
# ? Jul 8, 2016 19:47 |
So I've got a question about parsing things in Haskell using Megaparsec. I've got a fairly regular file format which is output by some of my collaborations tools which I am trying to write a parser for. There are a few things that come out of this file, but one of those things is a data structure that looks roughly like this: code:
code:
code:
That seems a little gross though, and very boilerplate heavy. Usually in Haskell that means there is a better way. So does anyone know of a better way to go about this?
|
|
# ? Jul 8, 2016 20:42 |
Oh holy crap I guess that's what Text.Megaparsec.Perm is for. Dunno how I missed that, but that makes things much easier. Nevermind I guess.
|
|
# ? Jul 8, 2016 20:57 |
|
This country is hosed
|
# ? Jul 8, 2016 21:40 |
|
Valeyard posted:This country is hosed oh god what's happened now? last i heard both pm candidates were p vile but that's old news
|
# ? Jul 8, 2016 21:45 |
|
gonadic io posted:oh god what's happened now? last i heard both pm candidates were p vile but that's old news they shut down the Taco Mazama food place by my work for refurbishment
|
# ? Jul 8, 2016 21:59 |
|
this country will continue to be hosed as all hell until everyone learns what a monad is
|
# ? Jul 8, 2016 22:09 |
|
AWWNAW posted:this country will continue to be hosed as all hell until everyone learns what a monad is since I now have an excuse to mention monads: someone in a gamedev thread was talking about LINQ and mentioned that buttList.Select( Foo ).Where( Bar ).From( Bat ).ToList() doesn't actually execute Foo Bar or Bat until you call ToList, and then iterates over the input exactly once, and suddenly I understood why anyone cares about monads
|
# ? Jul 8, 2016 22:21 |
|
LordSaturn posted:since I now have an excuse to mention monads: also note that any exceptions thrown in Foo or Bar or Bat will escape a try/catch put around that any statement until the ToList lol
|
# ? Jul 8, 2016 22:30 |
|
lazy evaluation is awesome and terrible. respect it
|
# ? Jul 8, 2016 22:32 |
i opened tiobe index for first time in a while and i have to ask now, where are used delphi/object pascal, and groovy
|
|
# ? Jul 8, 2016 22:34 |
|
LordSaturn posted:since I now have an excuse to mention monads: that's not monads though that's lazy evaluation
|
# ? Jul 8, 2016 22:36 |
Mr Dog posted:that's not monads though that's lazy evaluation The monads are arguably what make it single pass.
|
|
# ? Jul 8, 2016 22:42 |
|
lazy eval is related only as it's an obvious answer to "why do you guys keep saying that the monad determines when the lambda executes". also I didn't know LINQ did that because I am an autodidact w.r.t. C# so here, does this work/make sense? code:
|
# ? Jul 8, 2016 22:50 |
|
man, making a linq select extension for the DataTable class has been the single most useful thing i ever done
|
# ? Jul 8, 2016 22:57 |
|
Mr Dog posted:that's not monads though that's lazy evaluation
|
# ? Jul 9, 2016 00:25 |
|
Wheany posted:robot and cucumber cucumber was the one that was recommended
|
# ? Jul 9, 2016 00:27 |
|
also you can have monads without lazy evaluation, they are orthogonal an example of a monad would be List where SelectMany is the bind operator and the List constructor is the unit operator
|
# ? Jul 9, 2016 00:28 |
|
redoing my polygon renderer to like, actually make sense and junk here's some wireframe rotation on 2 axes
|
# ? Jul 9, 2016 01:06 |
|
LordSaturn posted:since I now have an excuse to mention monads: code:
it just needs to iterate enough to have found the first 15 prime numbers that are greater than 100. if there's not enough numbers for this it handles that case elegantly too. it allows you to chain collection processing functions together in an almost declarative way instead of handrolling your own for loops the worst thing about the stdlib linq in C# is that it's generally slower than the equivalent handrolled for loops and there's a lot of heap allocation going on rustlang proves that this style of collection processing doesn't actually need to incur a runtime penalty rustlang's iteration can be faster than handrolled C-like for loops (guarantees lack of mutable aliasing) comedyblissoption fucked around with this message at 01:15 on Jul 9, 2016 |
# ? Jul 9, 2016 01:09 |
|
also uh you should always prefer using linq over the equivalent for loops in C# unless you have a performance reason not to games unfortunately afaik want you to minimize heap usage due to the garbage collector pauses so you might be hosed there
|
# ? Jul 9, 2016 01:26 |
|
comedyblissoption posted:the worst thing about the stdlib linq in C# is that it's generally slower than the equivalent handrolled for loops and there's a lot of heap allocation going on is the heap allocation bit because of the lambdas? theyre adding nested functions in c#7, and i believe one of the reasons is that it lets people cut back on lambdas a bit without having to pollute the class scope with one-off functions C# code:
|
# ? Jul 9, 2016 01:47 |
|
comedyblissoption posted:games unfortunately afaik want you to minimize heap usage due to the garbage collector pauses so you might be hosed there lolunity
|
# ? Jul 9, 2016 01:55 |
|
LOOK I AM A TURTLE posted:is the heap allocation bit because of the lambdas? theyre adding nested functions in c#7, and i believe one of the reasons is that it lets people cut back on lambdas a bit without having to pollute the class scope with one-off functions you'd think that the compiler would be able to make those equivalent, at least in cases where the lambda only refers to its arguments and nothing else from the containing scope
|
# ? Jul 9, 2016 03:04 |
|
there's a bunch of reasons why linq may be slower than for statements here http://stackoverflow.com/a/2675061: quote:
you can even look at something like the List source here to see what extra work it may be doing: http://referencesource.microsoft.com/#mscorlib/system/collections/generic/list.cs you'll notice that the list's Enumerator MoveNext does extra work just to ensure you don't invalidate the enumerator/iterator by using a special _version field to even use IEnumerable.Where, maybe you are forced to box the list enumerator inside an IEnumerable even though the list enumerator is a struct? not sure about any of this and you should profile if it matters, but it raises a lot of questions about performance comedyblissoption fucked around with this message at 04:40 on Jul 9, 2016 |
# ? Jul 9, 2016 04:37 |
|
rustlang may show you don't need to trade expressiveness for performance so you can have the best of both worlds c++ has iterators and lambdas and poo poo but holy gently caress at the syntax comedyblissoption fucked around with this message at 04:47 on Jul 9, 2016 |
# ? Jul 9, 2016 04:42 |
|
comedyblissoption posted:the most cool thing about lazy evaluation is that something like and numbers can just be: IEnumerable<int> Numbers() { int i; while(true) yield i++; } infinite collections own
|
# ? Jul 9, 2016 05:08 |
|
remember that poo poo I was bitching about yesterday? today I retrofitted it. 23 files in 3 directories, each 1000+ loc with one at 25000 loc. even using kdiffs directory merge feature to merge the current branch into the retro branch (hell no our svn can't do that on its own) it took 6 hours to get everything right because of the differences between versions. for some reason nobody else knows how to do this poo poo.
|
# ? Jul 9, 2016 05:33 |
|
Luigi Thirty posted:redoing my polygon renderer to like, actually make sense and junk hell yes!!!
|
# ? Jul 9, 2016 05:47 |
|
wheres ur github
|
# ? Jul 9, 2016 05:48 |
|
comedyblissoption posted:rustlang may show you don't need to trade expressiveness for performance so you can have the best of both worlds I actually enjoy C++. But chaining poo poo linq-like with iterators is such a huge pain, nobody does it anyway, we just wait for ranges to make it into C++ standard (or use the prototype library), so that we don't have to deal with that poo poo.
|
# ? Jul 9, 2016 09:44 |
|
Luigi Thirty posted:redoing my polygon renderer to like, actually make sense and junk cool as poo poo this is as far as my own renderer has got so far
|
# ? Jul 9, 2016 09:45 |
|
c++ iterators are horrible. an entire generation of painfully bad apis because someone thought it would be cute to use operator overloading to make it so you could use c pointers as iterators too.
|
# ? Jul 9, 2016 11:49 |
|
Xarn posted:I actually enjoy C++. what you don't like writing for( std::vector<foo_t>::iterator bar = baz.begin(); bar != baz.end(); bar++) all the time?
|
# ? Jul 9, 2016 13:19 |
|
Wheany posted:Theory: let's use a dsl so that non-coders can write <whatever code> architect spent several days defining a "dsl" (i.e. plain old c# with convenience functions) to write automated integration tests result: 1) testers only ever executed tests someone else had written. we had to add a function that let them use an excel spreadsheet to call tests with arguments 2) as the programmer I wanted to write and run my tests in an IDE so I had to c/p everything back and forwards each time 3) end product was less featureful and less useful than just using nunit ~Coxy fucked around with this message at 13:29 on Jul 9, 2016 |
# ? Jul 9, 2016 13:26 |
|
|
# ? May 11, 2024 16:06 |
|
hobbesmaster posted:what you don't like writing Meh, either write it as for (auto bar = baz.begin(); bar != baz.end(); ++bar) or as for (auto& elem : baz) { ... } The real pain, comes when you want to make something lazily generated, like this code:
|
# ? Jul 9, 2016 14:08 |