|
WHERE MY HAT IS AT posted:Pretty sure the thread title should be await GetGoodPostsAsync() async/await introduces just as many issues as it solves imo
|
# ¿ Jun 20, 2014 22:50 |
|
|
# ¿ May 2, 2024 03:36 |
|
Ithaqua posted:What issues does it introduce? Stupid things like configure await and having to manually spill variables (!!!!) to reduce allocations is just tedious Also it conflates a CPS rewriting sugar (await) with parallelism which honestly is more confusing. Something along the lines of haskell async or parallel might have been cleaner I just don't think it's at all clear how async await works behind the scenes and how much control you have over it: the actual generated code is not even CPS it's a funky state machine with a bunch of gotchas. It needs some nicer combinators and good spec of its semantics
|
# ¿ Jun 21, 2014 00:59 |
|
Gul Banana posted:The 'easy fix' is typically to ConfigureAwait(false) so that you don't get marshalled onto a blocked context. however it's irritating and gives up many of the actual benefits of async. They tried to get monads in the language with linq and it was ok but I have rarely seen generators (and the difference between Ienumerator and ienumerable is subtle and almost always you actually want the former) Now they've gotten a monad that isn't really a container and in order to sneak it in without the ability to have do-notation they put in await which manually performs CPS and then optimizes it out by using a state machine analogous to yield return But manually implemented generators are extremely rare--everyone usually uses the combinators from linq instead and uses icollection as the base In this case everyone has to deal with the gotchas of implemented async generators via await since the libraries aren't rich enough and there isn't enough power to have monad manipulation defined generically And then there's synch context which is really goddamned subtle and even Jon loving skeet says he doesn't really understand it so how do you expect workaday devs to diagnose why deadlocks are happening in something they were sold as the best asynchronous pattern? I wanna say if they dropped the async void compat layer and made it so that async behaved more like Haskell async by using speculative parallelism it might be better
|
# ¿ Jun 21, 2014 13:09 |
|
Gul Banana posted:so with List and Future you have maybe 90%, 99% of the monadic power that Joe Applicationdeveloper can really use. each gets its own special case syntax. for that matter so does IO, which has "the assignment operator". Microsoft's implicit argument here is that by addressing each of these use cases as its EROI becomes high enough, they're frogmarching the world forward as fast as it will grumbly-shuffle. until someone comes up with a piece of software that doesn't need to be maintained, idk that we have proof otherwise. well clearly not, since they're adding the chained null thing which is the Maybe/Option monad is there anything against dumping classes and only using nullable structs? Gul Banana posted:so with List and Future you have maybe 90%, 99% of the monadic power that Joe Applicationdeveloper can really use. each gets its own special case syntax. for that matter so does IO, which has "the assignment operator". Microsoft's implicit argument here is that by addressing each of these use cases as its EROI becomes high enough, they're frogmarching the world forward as fast as it will grumbly-shuffle. until someone comes up with a piece of software that doesn't need to be maintained, idk that we have proof otherwise. Try using both at once. It's a clusterfuck and you actually need monad transformers to deal with it properly. They basically tried to hide the theoretical complexity but in doing so opened a giant can of worms. Explict > implicit and unless there is a very clear way of translating from implicit to explicit ( do-notation is basically just (>>=) and lambda-binding) there's gonna be problems F# had async workflows, which are really nice and much better for a lot of async stuff than the TAP :http://tomasp.net/blog/csharp-async-gotchas.aspx/ lcw014 or w/e get in here and explain yourself
|
# ¿ Jun 21, 2014 21:05 |
|
redleader posted:Any chance you could elaborate on this? code:
I really am not sure why they chose having the factory being the primary part of the foreach loop and LINQ but it means that it's a pain in the rear end to handle delimited chunking efficiently (or as far as I can tell at least)
|
# ¿ Jun 22, 2014 12:47 |
|
Volte posted:I'm not even sure in what kind of nightmare land you'd want iterating over the same collection twice in a row to print two different results. IEnumerator is the iterator for IEnumerable. Iterators are mutable even when the enumerable isn't, which is why it makes no sense to expect any sort of consumer state to be encoded in the enumerable. foreach creates a new iterator (IEnumerator). If you want to use the same enumerator across multiple loops (i.e. for chunking), create it yourself before the loops and use the MoveNext method manually. The factory-ness of ienumerable is fine, it's just that it doesn't make a lot of sense to iterate over a factory. I would rather you have to call GetEnumerator and then have to pass that enumerator to the foreach loop, to make the forcing explicit. The point is that the iterator encodes the current state. If you want to get another view of the collection, you call GetEnumerator which makes the "Reset" explicit. And then you make collections immutable like they ought to be
|
# ¿ Jun 22, 2014 15:44 |
|
ljw1004 posted:I'm happy to talk about async design! Thanks for the comments, Malcolm and others. I love the chance to talk about language design. Looking back, I think we made the right calls at the time, and right now I'd make mostly the same calls again... My main issue is that this should all be automated, by default. I dont have the bandwidth to keep up w/ the latest in async/await (this is like the 3rd time we tried this right?) AND also update all my code. Like it's a huge investment to asyncify existing code. As far as "write your own roslyn diagnostic" that's basically the equivalent of "write your own distributed mapreduce function in erlang" : a glib gently caress-you, not that you intended it as such. Best practices must be embedded within the tools y'all provide! It's why resharper annoys the poo poo out of me--I pay $14k for VS ultimate and intellisense can't compete w/ a plugin done by some dudes who have no access to the compiler or platform. Ok now to some specific stuff: 1) the mystruct[await foo].bar(await baz) issue is basically the thing applicative monads solve and with the joinad extension it's very naturally done (as with idiom brackets); having do! and let! and use! (fwiw the use/use! is significantly nicer than the using statement in C# since it doesnt force you to nest afaik) is pretty ok otherwise though 2) Category theory is just a framework for naming stuff. I have a degree in math and i do not give a poo poo about higher categories but i do care about 3-4: Functor (can you run Select in a context?); Applicative (Can you lift a value & tuple them inside a context) and Monad (can you thread results in a context?) + Traversable (not category theory!) which gives you extremely nice internal iterators F# got it right in this context w/ workflows. I certainly do not care for exposing natural transformations and commutative diagrams but the CLR is simply unable to express even the Functor pattern. 3) The speculative parallelism ends up being nice because although one would never hire a waitress per table it's really really nice to work as if you had one waitress per table! Cooperative multitasking sucks to work through, I mean The really slick part of the async package is that it allows neat ways of creating sparks (lazy futures) that are multiplexed onto Haskell green threads that are multiplexed onto OS threads which are multiplexed onto cores by the kernel as needed. This means that you can spawn a bazillion sparks and not really care about running out of memory. 4) Maybe roslyn will solve some of these problems but that's like a year away and even though cadence has stepped up to quarterly I'm surprised that a lot of these diagnostics/analyses were not shipped when async/await shipped If Simon Marlowe was not heavily involved w/ async await I will be very disappointed, that guy figured out a very natural pattern to handle multicore scaling + io multiplexing and FB poached him.
|
# ¿ Jun 26, 2014 12:55 |
|
code:
2000 lines/ 80k times? Refactor that poo poo, stat. Unless you're being hyperbolic but even then goddamn Also use xmlwriter or schematize it and reflect it into a class via xsd.exe. But there be dragons.
|
# ¿ Jun 27, 2014 10:45 |
|
Scaramouche posted:Thanks guys, that's basically what I did: why are you writing to a file on disk first (do you need to keep it around?). you could just stream it all the way out to the connection (if you must keep the file around and read from it at least stream it out via file.openread)
|
# ¿ Jun 27, 2014 20:46 |
|
Geisladisk posted:Does anyone have any tips for streamlining Windows Service development? Chef, puppet and Powershell DSC
|
# ¿ Jul 22, 2014 20:22 |
|
wwb posted:This is why one should not use knockout if one is trying to learn web stuff. Knockout is great but the user base is pretty much recovering wpf/silverlight dudes and some extension into .NET only devs. It don't get much pickup outside of the .NET world. that said MVVM is very good at solving a very common pattern I suspect you could use react with knockout.
|
# ¿ Jul 28, 2014 17:04 |
|
Essential posted:Thank you for the suggestion Lucian! Is there a similar async thing I can do with the 4.0 framework? We have to support Win XP machines so I cannot get above 4.0 framework Microsoft.bcl.async
|
# ¿ Aug 9, 2014 20:46 |
|
Newf posted:It's VS 2010, but I'm debugging in x86 and I'm able to edit and continue if I break the running process - it just won't let me do any typing (editing) while the process is running. This would break source mapping if you e.g. deleted a method with a breakpoint in it. I don't think there's a workaround-it's very annoying though
|
# ¿ Aug 28, 2014 14:15 |
|
Uziel posted:Oh. Does my code have to be open source in order to take advantage of it? Its for an internal tool, not software that is sold. Talk to legal. Are you distributing it? "Distributing" software is a legally ambiguous term.
|
# ¿ Sep 9, 2014 13:26 |
|
GrumpyDoctor posted:This is the problem that generics solved, but the collection you're iterating over doesn't have a generic interface, which is why var's type inference isn't working. Var's type inference is working correctly; the compiler is unable to deduce the specific type since that information was erased because of collection not exposing it.
|
# ¿ Sep 18, 2014 18:00 |
|
As someone who works in "big data" this is just standard statistics and experimental design, the kinds of stuff that has been used for decades and is still useful in 99.9% of cases. If your data fit into memory on a commodity machine (i.e. 1TB or less) then it isn't big, at least that's our criterion. As ljw said what you want is a data driven system where you can take a question definition and project it through a view (e.g., for the ones you showed, maybe have a MultipleChoiceView that takes a Question and Answers Properties with maybe a MultipleChoicePictureView that supports pictures as answers if needed etc) epalm posted:If my test project does a pretty good job of testing my services and visiting most code paths, but uses a database instead of mocking out repositories, does that make me a bad person? Code to an interface, not an implementation, and allow a constructor overload that accepts that interface. Done. That's dependency injection. I spent too drat long realizing that's all you ever need. Any containers or service locators or poo poo like that is just sugar to make it easy to wire up dependencies.
|
# ¿ Sep 28, 2014 19:05 |
|
Schmerm posted:Say I want to host managed CLR code in my C++ application. I've got some managed DLL assemblies, and from my C++ code, I want to be able to call managed methods and poke global/static structs. How do I go about doing this? Do I have to use COM? I can't seem to find any APIs on MSDN that do these things. Host the CLR via COM. It's a pain. Going the other way via P/invoke / COM Interop is much nicer so it may be worth inverting your config. Or do generic IPC via message passing.
|
# ¿ Oct 2, 2014 14:28 |
|
Bognar posted:Where is it putting the order by in the query and what does the query look like in code? I've never run into an ORDER BY statement being generated if not asked for. This is why statement mappers are generally better than ORMs. Total control yet still convenient.
|
# ¿ Oct 11, 2014 23:54 |
|
Mr Shiny Pants posted:How do I use stream.CopyToAsync(stream) in F#? F# async and C# async are different, totally
|
# ¿ Nov 10, 2014 21:53 |
|
Please use attribute based routing and have your controllers use reasonable method names.
|
# ¿ Jan 15, 2015 22:05 |
|
RICHUNCLEPENNYBAGS posted:Yeah, instead, just an extra opportunity to gently caress up naming it. as opposed to having it implicitly generated by some weird convention based thing that is impossible to control?
|
# ¿ Jan 16, 2015 12:22 |
|
Inverness posted:There's an update to the .NET Framework blog about the status of open source. there is a 30+ step process to open source things at microsoft, for good reasons. You don't want some patent/licensing agreement to bite you in the rear end a decade after it was signed.
|
# ¿ Jan 30, 2015 19:49 |
|
ljw1004 posted:I think that 350k lines of code in 37 workdays is pretty darned impressive! (assuming reasonable time off for Thanksgiving and Christmas). Yeah for real. It's not a trivial process to even open source code within the drat company, let alone take a large component and clear it for public consumption. Kudos to everyone involved. Did you know, for example, that "prd" is a Czech word for fart and could be offensive? It took down an internal portal for a day since it had prd in the URL and didn't pass some extended check.
|
# ¿ Jan 30, 2015 22:51 |
|
Captain Capacitor posted:I know this isn't entirely on topic but if anyone has any gross issues with Azure I'm finally in a position to do something about it. Drop me a PM and I'll do my best to help out. have u fixed the random reboots in the fabric that are unannounced and really weird also do yall have a release process in place so one dude cant gently caress up multiple regions it woild have been nice to have proper diagnostics for tables did they fix the issue where RDFE has a dirty word filter preventing previously existing names from being recreated
|
# ¿ Feb 4, 2015 21:48 |
|
Captain Capacitor posted:I know this isn't entirely on topic but if anyone has any gross issues with Azure I'm finally in a position to do something about it. Drop me a PM and I'll do my best to help out. Also why is cerebrata's dogshit management studio eons better than any of the portals
|
# ¿ Feb 4, 2015 21:49 |
|
ljw1004 posted:Just to say, I only learnt about "Azure Webjobs" last week, and I'm OVERJOYED!!! we used blobs as a ghetto distributed lock and then orleans b/c winfab is still not ready for prime time, or something
|
# ¿ Feb 4, 2015 21:50 |
|
Captain Capacitor posted:I know this isn't entirely on topic but if anyone has any gross issues with Azure I'm finally in a position to do something about it. Drop me a PM and I'll do my best to help out. why is there a hard limit on storage accounts per subscription
|
# ¿ Feb 4, 2015 21:53 |
|
Captain Capacitor posted:This is what a good chunk of my team is working on right now. cool i Pm'd u with more details on stuff since my old team either broke azure or was broken by azure on like a weekly basis
|
# ¿ Feb 5, 2015 01:58 |
|
JawnV6 posted:I have an application deployed that uses HttpWebRequest to send a request to a sever. They're seeing an unexpected error, "Method not found: 'System.Net.HttpWebRequest". It appears to be in every .net version from 1.0 to 4.5. All of the error pages google brings up are dealing with some old Mono version missing this. How does an installation miss out on a chunk like this? install http client libraries from nuget and use those https://www.nuget.org/packages/Microsoft.Net.Http
|
# ¿ Feb 5, 2015 02:01 |
|
JawnV6 posted:It's unclear to me how grabbing something else in an extra complicated way is going to make that new thing available on a remote computer I have zero control over and is already missing core functionality? Am I missing some bit about how this works? how are you deploying code to a server you have no control over? and who pissed in your cornflakes? nuget is standard for component delivery on .NET. clearly the application is linked against HWR or you'd fail at binding time as opposed to run time so fix your broken deployment by either sidestepping HWR or not using mono
|
# ¿ Feb 5, 2015 02:18 |
|
Ithaqua posted:http://blogs.msdn.com/b/visualstudioalm/archive/2015/02/12/build-futures.aspx loving finally. being ordered to move to tfs sans a decent ci system was horrible
|
# ¿ Feb 14, 2015 01:38 |
|
Ithaqua posted:Read Roy Osherove's book The Art of Unit Testing. That's first and foremost. Bingo. This is the attitude to have. Testing is something intrinsic to developing good code. Ultimately as a test lead I would hope you keep everyone else in line when it comes to testing their changes
|
# ¿ Mar 8, 2015 04:17 |
|
ljw1004 posted:Summary: You can now write a single project and have it run on multiple devices (before you had to have a different project for each device.) It's now easier to do form-factor-adaptive UIs too. Unfortunately no one actually cares about windows phone or tablet so idk why they kept pushing universal apps so hard The cross platform stuff is way more useful
|
# ¿ Apr 23, 2015 11:16 |
|
aBagorn posted:Ok I hope I'm wording this right, but I want to figure out how to do something, and I'm really dumb when it comes to async/await stuff in general. ugh use a merge into, generate the csv row -> table row client side and just do fire that poo poo off in one query, it'll be one big ol req and you can even have it log dupes ("WHEN MATCHED THEN fart") batching only makes sense if csvrow->dbobject is expensive so you can parallelize the work otherwise you are io bound anyway this looks like it's batching something in 30k chunks already aBagorn posted:I'm looking to have the overall job to complete in a shorter time. We're running this in Azure so shorter processing times = less $$$ jesus christ
|
# ¿ Jun 9, 2015 22:27 |
|
also you are materializing the stream into lists, so you have a shitload of rows in memory you probs want to stream ienumerables and manipulate using LINQ
|
# ¿ Jun 9, 2015 22:30 |
|
gariig posted:5 million records isn't much but how you do it can make a big difference. My first suggestion would be to look into SQL Server Integration Services (SSIS) which is Microsoft's ETL (Extract-Transform-Load) software. It's meant to do this kind of work. When I was doing this kind of work 5 million records would probably be 10-15 minutes if the SSIS package was designed correctly. if this is creating a new req for each row i can see how it's taking days (!!!) unless constructing a dbobject from a row is super duper expensive
|
# ¿ Jun 9, 2015 22:31 |
|
Bognar posted:I 100% guarantee you that this is your problem. Find a way to look for duplicates that doesn't involve a repeated database call. I don't know what your duplicate checking logic is like, but there's a good chance it can be done outside of the DB. Or you can try to do it all inside the DB, just for the love of god don't split it across two machines. loading data into sql server with dupe detection can and should be done in 1-2 statements (create temp or CTE on a merge into and log matches) god knows what's going on inside EF to generate the row tuple.
|
# ¿ Jun 10, 2015 17:47 |
|
aBagorn posted:So I think I'm going to make a recommendation to ditch EF if at all possible. as much as i dislike ORMs i dont think EF is your (only) issue. at worst you can have EF act as a object->sql statement creator but that isn't all that slow even if you have each object insert in its own transaction (5mil transactions is trivial) clearly something is deeply hosed in your validation and creation of the object. fix that first.
|
# ¿ Jun 11, 2015 00:16 |
|
nuget is rear end and should have been replaced by maven for .net maven owns and i miss it everytime i have to deal w/ the cliusterfuck that is nuget + msbuild + asp.net json projects
|
# ¿ Aug 21, 2015 00:30 |
|
|
# ¿ May 2, 2024 03:36 |
|
RICHUNCLEPENNYBAGS posted:I haven't used maven but I like nuget well enough. What's wrong with it? Ithaqua posted:ASP .NET 5 isn't even out of beta yet, I think it's a bit premature to condemn it. it gets the wrong thing right: it says how not what w/ maven i describe what i want and maven deals with the poo poo to get it done. enforce the convention and life is good w/ nuget/msbuild/json i have to manually describe the build steps and dependencies and there's no real lifecycle concept to slot in tools (except if they manually gently caress w/ the msbuild file!!) it's a giant PITA to handle nuget outside of vs, the CLI doesn't let you do half the things the PS console can do
|
# ¿ Aug 21, 2015 22:42 |