|
ether posted:I'll be THAT guy and say stylecop in itself is a dumb tool that serves no purpose but make peoples lives harder for no real reason. Codereviews are the prime moment to explain WHY you have certain coding guidelines. Still bitter because codereviews where tagged as a waste of time and we got stylecop instead "because it serves the same purpose", loving asshats, and it made most of our legacycode even more obtuse. Sure but come on. What discussion is there to be had about whitespace? Everyone else should use the same scheme I'm using because otherwise the commit log shows every line of each file changing. And discussions sometimes become a backdoor way about people whining about your decisions and saying none of this would be happening if you did it their way which gets tiresome. RICHUNCLEPENNYBAGS fucked around with this message at 01:27 on Jul 7, 2015 |
# ? Jul 7, 2015 01:23 |
|
|
# ? Jun 8, 2024 08:53 |
|
RICHUNCLEPENNYBAGS posted:Sure but come on. What discussion is there to be had about whitespace? Everyone else should use the same scheme I'm using because otherwise the commit log shows every line of each file changing. And discussions sometimes become a backdoor way about people whining about your decisions and saying none of this would be happening if you did it their way which gets tiresome. People should just adhere to the style the leads say to use. It's loving terrible to see a commit where every line has changed due to formatting and you have no loving clue what that dev did unless their commit message is rather verbose (it won't be).
|
# ? Jul 7, 2015 01:35 |
|
AuxPriest posted:People should just adhere to the style the leads say to use. Yes, this is what I want to avoid
|
# ? Jul 7, 2015 12:12 |
|
Has anyone gotten xunit to work with vnext? I have a project in vnext and it doesn't work for me. Two paths I tried: Add the test project as a vnext class library, with "Class Library (Package)". Tried to install xunit and xunit.runner.dnx, but when I try to run 'dnx . test' (or dnx . xunit.runner.dnx), I get a nullreference exception. Most likely this is a version conflict between dnx and the xunit version, which I tried to resolve by getting ever more bleeding edge versions of xunit and the dnx libraries it requires, but nothing I tried works. Other try was to add the test project as a normal class library, and add references to xunit and xunit.runner.visualstudio. This made a bogus test (Assert.True(true) appear in the VS Test Explorer window, but then I get problems when I try to add references to the other (vnext) projects in my solution. Instead of adding a reference to the project I have to add a reference to the .dll it makes, and I also need references to a bunch of other crap (mostly EF libraries) that start to conflict with each other and make the entire thing refuse to build. So, anyone able to actually make it work, and if so, how exactly? Preferably completely in vnext.
|
# ? Jul 7, 2015 13:21 |
|
I have a call to Directory.Delete failing because the directory contains a read-only file. The thing is, the directory is empty. Explorer does report it has having read-only files in it (the "read-only" in the directory properties is in the "partial" state), even though when you examine the directory there's nothing there. (No hidden files, either, and DirectoryInfo.GetFiles returns an empty list.) To make matters worse, this isn't a one-time problem - my program is creating this weird directory, and I don't know how or why. It's just a straightforward Directory.CreateDirectory call. e: And just like that, the problem goes away raminasi fucked around with this message at 20:56 on Jul 7, 2015 |
# ? Jul 7, 2015 20:48 |
|
Working on a pretty large project at the moment that is requiring a lot of thought. We've been exploring CQRS as a possible approach, and it seems to match our needs well, but there are some aspects of CQRS that I'm completely confused about, and none of us can decipher the best-practice ways to handle some of these concerns. For reference, we've been using these articles extensively: https://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=91 and http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=92 Lets examine the process of updating a Person record, for example. If I want to update a Person record, there may be a couple of associated Address records I also need to update. Obviously this would all be best done within a database transaction so that if one part fails I can roll the whole thing back. With CQRS this operation is broken down into two commands - UpdatePersonalDetailsCommand and UpdateAddressCommand. Both of these are commands that may be useful to run alone, or in combination within a transaction. What is an acceptible way to handle this? I've seen mention of "Aggregate Services" and "Facade Services", which I gather to be classes that can be used for exactly this purpose: depend on a couple of different command handlers, run them in the correct order within a transaction along with any other logic required. The problem with this is that now my code for transaction management is written directly into the Facade: code:
|
# ? Jul 8, 2015 00:35 |
|
I can't say that this will answer any of your questions and you've probably already run across it, but this is the best example of best practices (or implementation even) I've personally found on CQRS: https://github.com/MarkNijhof/Fohjin
|
# ? Jul 8, 2015 03:28 |
|
The Wizard of Poz posted:Working on a pretty large project at the moment that is requiring a lot of thought. We've been exploring CQRS as a possible approach, and it seems to match our needs well, but there are some aspects of CQRS that I'm completely confused about, and none of us can decipher the best-practice ways to handle some of these concerns. For reference, we've been using these articles extensively: https://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=91 and http://www.cuttingedge.it/blogs/steven/pivot/entry.php?id=92 Is the address attribute in the same aggregate root as the person? If so I would make it one command with all the updates you would need, the command would encapsulate all the changes to the person object including the address changes. I don't see why you would need to break the transaction up into multiple commands?
|
# ? Jul 8, 2015 08:03 |
|
Mr Shiny Pants posted:Is the address attribute in the same aggregate root as the person? Well a business could also have an address, for instance, and I'd like to avoid repeating the logic for saving addresses. At any rate, that was just an example, basically we have commands that may need to be run alone or as part of a larger process (or as part of multiple processes). I've been doing some research on aggregate roots, and I think this is the path I need to explore some more.
|
# ? Jul 8, 2015 11:05 |
|
The Wizard of Poz posted:Well a business could also have an address, for instance, and I'd like to avoid repeating the logic for saving addresses. At any rate, that was just an example, basically we have commands that may need to be run alone or as part of a larger process (or as part of multiple processes). Per my understanding of CQRS and DDD: The idea is that you have entities in your model (your bounded context) and that these entities are categorized into aggregate roots. These aggregate roots are responsible for every update, create or delete that happens to the entities that they are responsible for. Reading is done from a different source. ( does not have to be, this is up to you ) So let's say you have a person entity in your domain model, you could build an aggregate root that handles all updates, creates and deletes to the person entity. This includes all the properties of the model, including the address because it is a property of a person. You send the command to the aggregate root, it updates the desired entity, and saves the command in the past tense. <- if you use eventsourcing. You could split this out into multiple commands, you could have updatePersonAddressCommand, or just put them all in one command updatepersoncommand with all the properties you want changed. It is up to the aggregate root to do the necessary updates to the entity. If you use a DB you can create one transaction that does all this in the background. You could also have a Address aggregate root, but this seems needlessly complex to me. In your example you could have a business aggregate root that is responsibly for all business entities in your bounded context and a person root that has all the person entities. What you put in aggregate roots is really defined by the entities in your domain and if they are logical entities that are usually created, updated, deleted in one operation without being dependent on other entities. ( a customer, a business, an order etc. etc.) That these entities span multiple tables in your DB is not important, that is an implementation detail. It is really more of a model, how it gets persisted in the background ( DB, eventsourcing ) is not something that should define your domain model and the entities. As for having to do the save logic twice: You could have a method that just takes an address and persists it, this can ofcourse be called by multiple aggregate roots. The important part is that the root is responsible for initiating it. As for operations spanning multiple roots you have something called a "saga" in CQRS. There is a presentation about these by Udi Dahan describing exactly this. I've built a small ordering application that uses Postgress in the background to persist the data and the general flow is: Command comes in -> mapping command to aggregate root -> validate command -> aggregate root runs the command (updates DB etc etc.) -> saves the command in the past tense into a directory. So if I have a customer that updates something like an address: UpdateCustomerAddressCommand -> UpdateCustomerAddressCommand maps to CustomerRoot -> Validate command: Are all the neccessary fields filled in? -> Send to Customer Root -> Run Command on the Root ( update DB whatever) -> Save the command and the values it held as UpdatedCustomerAddressCommand. You can think of these Aggregate roots as boundaries for all operations and treat them as how you would consume webservices. You have an API you use to talk to them and can make them as complicated as you want. ( Data access layers, etc etc. ) I hope this helps. Mr Shiny Pants fucked around with this message at 12:13 on Jul 8, 2015 |
# ? Jul 8, 2015 11:41 |
|
The company I work for runs an ASP.NET webforms application. It is having performance issues due to how we have grown and the number (and way) it talks to other devices. I have been tasked with attempting to make some of the more painful, I/O-bound calls asynchronous, because we're spending a lot of time waiting for responses from remote services that could be spent servicing other web requests. I am posting here to ask the veterans to sanity check my assumptions and conclusions after the bit of research I have done. First, the important fact: This application currently targets .NET Framework 4.0. What I think I know: - There is no way to make ASP.NET work with the async/await in framework version 4.0. Not even with the Bcl.Async library. - Pre-4.5, the task-based asynchronous pattern does not really exist; any "asynchronous" programming is achieved through the use of additional threads. - The thread pool will not help, since the point is to free up pool threads for web requests, therefore I can't use Tasks. What I think my options are: - Convince everyone to retarget the project to framework version 4.5 or higher. - Attempt to handle threading manually So, to the vets out there: are my assumptions correct? Do I have any other options than what I've outlined? I frankly don't think it's going to be all that terribly painful to get our code targeted to 4.5. The people who have been at the company a while are not thrilled about the idea though, because the last time they retargeted it was to go from like 2.0 to 4.0, and it was a nightmare. I really, really don't want to attempt that second option if I don't have to; I'm completely green when it comes to threading, and everything I've read says that it's very difficult to get right. We may have a greybeard or two at the company that can do it, but I know they're busy on more urgent, more important, more customer-facing problems and features than this. Besides that, our codebase is old and rusty enough that I'd really rather do this the "right" way (it's I/O bound work, it's made for the TAP) rather than incur more technical debt.
|
# ? Jul 9, 2015 05:11 |
|
Are any of the async tasks fire and forget? Or can you defer the response via a websocket or something? Using an ESB might help.
|
# ? Jul 9, 2015 09:44 |
|
Che Delilas posted:
If you and your company are cool with server side javascript you could offload the requests to some node module and implement your async patterns there.
|
# ? Jul 9, 2015 10:00 |
|
iirc async model binding for webforms specifically is being introduced in 4.6 - final release July 29 if your issues are on the backend you might not particularly need the binding to be async, though
|
# ? Jul 9, 2015 12:28 |
|
Che Delilas posted:What I think my options are: Re-targeting to 4.5 is essentially painless. You should have probably done this already. EDIT: Here is a list of breaking changes - https://msdn.microsoft.com/en-us/library/hh367887%28v=vs.110%29.aspx Bognar fucked around with this message at 14:48 on Jul 9, 2015 |
# ? Jul 9, 2015 14:45 |
|
Funking Giblet posted:Are any of the async tasks fire and forget? Or can you defer the response via a websocket or something? Using an ESB might help. For the most part, the tasks are not fire and forget - they are a linear sequence of calls through several layers with potentially a lot of waiting for I/O between some of them. Websockets and ESBs are nothing I've ever worked with, but I'll look into them. Gul Banana posted:iirc async model binding for webforms specifically is being introduced in 4.6 - final release July 29 I don't need the model binding; from what I've read I can wire up webforms pages to use async methods using RegisterAsyncTask in 4.5 and it will accomplish what I want. Bognar posted:Re-targeting to 4.5 is essentially painless. You should have probably done this already. Yeah, I combed through that link yesterday and so far I've only found one thing in there that our code actually uses (and I don't think it uses it in a way that will break). Good to hear some corroboration. Thanks for the responses guys, they're a big help.
|
# ? Jul 9, 2015 17:12 |
|
F# question: Is it possible to reduce a list to a bool? I have a list with a couple of items and I want to check all elements leading to a final bool value if they are all correct or not. Google leads to nothing. Edit: Figured it out using a list.map on all elements and piping them into a Seq.exists. Seems to work fine. A reduce to bool would be nice, don't know if it is even possible. Mr Shiny Pants fucked around with this message at 21:24 on Jul 9, 2015 |
# ? Jul 9, 2015 21:12 |
|
Mr Shiny Pants posted:F# question: If you want a reducing function, then you're looking for List.fold. It takes a reducing function, a starting value, and the list to call it on. You can also use Seq.fold. Its corollary in C# LINQ is .Aggregate(). Here's an example: https://dotnetfiddle.net/9sS7YY However, it looks like you could just use List.exists or List.forall with a mapping function instead of piping to Seq.exists. The LINQ corollaries are .Any() and .All(), respectively. Bognar fucked around with this message at 21:55 on Jul 9, 2015 |
# ? Jul 9, 2015 21:50 |
|
You shouldn't need the map; forall and exists accept a function to project the itemcode:
|
# ? Jul 9, 2015 21:55 |
|
Bognar posted:However, it looks like you could just use List.exists or List.forall with a mapping function instead of piping to Seq.exists. The LINQ corollaries are .Any() and .All(), respectively. Any(), All(), or exists() are the correct functions to use here as they will short-circuit as soon as they find a (non-)matching element.
|
# ? Jul 9, 2015 22:27 |
|
Bognar posted:If you want a reducing function, then you're looking for List.fold. It takes a reducing function, a starting value, and the list to call it on. You can also use Seq.fold. Its corollary in C# LINQ is .Aggregate(). This is nice, thanks.
|
# ? Jul 9, 2015 23:16 |
|
Running into Nuget issues. When I open up any project and try to access the package manager console, I get this:quote:
I'm not sure how to fix it; I didn't see anything on Google . Any ideas?
|
# ? Jul 10, 2015 16:18 |
|
Drastic Actions posted:Running into Nuget issues. When I open up any project and try to access the package manager console, I get this: File it as an issue at https://github.com/NuGet/Home/issues The NuGet team there is very responsive.
|
# ? Jul 11, 2015 06:15 |
|
Is it just me, or is Azure just irreparably broken? I need to vent a little bit. I have an MVC 5 site using EntityFramework 6 sitting on Azure. code:
I'm using the highest Azure Sites app service plan pricing tier (Standard), and the 2nd highest Azure SQL pricing tier (Standard), which is costing my little operation around $100/mo (which is 2000% more expensive than a DigitalOcean droplet). Both Site and Database are in the same datacenter. With all that done, I'm still getting these exceptions. code:
What's it going to take to fix this? Edit: The cherry on top is that my default support plan does not include technical support. I need to pay even more money (an additional $30 per month, per developer) to get their lowest possible level of technical support :rage: epswing fucked around with this message at 16:57 on Jul 11, 2015 |
# ? Jul 11, 2015 16:37 |
|
epalm posted:Is it just me, or is Azure just irreparably broken? I need to vent a little bit. Unfortunately I can't provide any help on your current situation, however I can tell you that I pay the $30 per month support fee for 1 of my azure accounts and I can say the help was tremendous the 2 times I've needed it. It's seriously been the best tech support I've ever received. It was so good that the first time I needed it I kept the subscription going for 6 months now and ended up using it again a few weeks back. I think you can pay the $30 bucks for 1 month, get support and then cancel if you don't want to continue paying. Both times I've used it the support rep has connected to my pc and then to my azure account and solved my issues. Each time they showed me various things/tricks/tools that I would never know about and both times they were able to get me going within 2 hours of when I first starting talking to them. They were super knowledgeable and explained everything they were doing. They have experts on all things azure and they may have someone who can solve your exact scenario.
|
# ? Jul 11, 2015 22:26 |
|
Well, I'm using Azure SQL and Azure Web sites at work and haven't experienced that, so I think there's something about your instance or setup in particular that's defective.
|
# ? Jul 12, 2015 01:33 |
|
RICHUNCLEPENNYBAGS posted:Well, I'm using Azure SQL and Azure Web sites at work and haven't experienced that, so I think there's something about your instance or setup in particular that's defective. Ditto this, I haven't had the SQL transient exception more than once a month, and I haven't seen it at all since we used the SQL Azure Execution Strategy. What region are you using?
|
# ? Jul 12, 2015 16:19 |
|
epalm posted:Is it just me, or is Azure just irreparably broken?
|
# ? Jul 12, 2015 21:43 |
|
Mr Shiny Pants posted:Stuff... Sorry it took me so long to respond, I really appreciate the amount of effort you put into this post and it helped me immeasurably, thanks!
|
# ? Jul 13, 2015 05:38 |
|
Drastic Actions posted:Running into Nuget issues. When I open up any project and try to access the package manager console, I get this: Found out a fix for this issue. But I never had to add crap to the devconfig file before, so I'm not sure why I had to now . But at least it's working.
|
# ? Jul 13, 2015 13:37 |
|
The Wizard of Poz posted:Sorry it took me so long to respond, I really appreciate the amount of effort you put into this post and it helped me immeasurably, thanks! Sure, glad I could help. Another thing: Get a Skills Matter account, there a couple of great CQRS talks on it.
|
# ? Jul 13, 2015 16:28 |
|
http://stackoverflow.com/q/31457372/1189566 Anyone by chance able to explain this?
|
# ? Jul 16, 2015 15:59 |
|
Anyone using Visual Studio 2015 RC? Is it ready enough for production? I installed Windows 10 so I'm debating using it or 2013 Ult.
|
# ? Jul 16, 2015 17:04 |
|
Sab669 posted:http://stackoverflow.com/q/31457372/1189566 You're not messing with the Controls collection on the TabControl directly anywhere else in your code are you? Looking at the reference source for TabControl, it seems getting an item by index directly pulls from an internal list of TabPages, whereas removing by index simply removes from the Controls collection by index -- directly poking at the Controls collection would get those two collections out of sync with each other. Removing an item by TabPage reference (as opposed to by index) calls the Controls.Remove overload with the object reference as well, which would explain why that works to remove the right page when RemoveAt wouldn't. It really sounds like an extra item is in your Controls collection. biznatchio fucked around with this message at 17:13 on Jul 16, 2015 |
# ? Jul 16, 2015 17:09 |
|
Knyteguy posted:Anyone using Visual Studio 2015 RC? Is it ready enough for production? I installed Windows 10 so I'm debating using it or 2013 Ult. I've been using it for months. It's fine.
|
# ? Jul 16, 2015 17:33 |
|
Knyteguy posted:Anyone using Visual Studio 2015 RC? Is it ready enough for production? I installed Windows 10 so I'm debating using it or 2013 Ult. VS 2015 RTM is coming out in a few days. RC should be fine though, and the few performance issues I had with it went away with the RTM build I'm using, so it should be fine.
|
# ? Jul 16, 2015 17:36 |
|
^ Sweet. Thanks.
|
# ? Jul 16, 2015 18:00 |
|
biznatchio posted:You're not messing with the Controls collection on the TabControl directly anywhere else in your code are you? Looking at the reference source for TabControl, it seems getting an item by index directly pulls from an internal list of TabPages, whereas removing by index simply removes from the Controls collection by index -- directly poking at the Controls collection would get those two collections out of sync with each other. The method that mkves tabs from Active / Archived takes two TabControls and an index. So this is most likely it. TabPage tp = source.TabPages[index] destination.TabPages.Add(tp) is the jist of it. Sorry for no formatting, on mobile. Sab669 fucked around with this message at 19:11 on Jul 16, 2015 |
# ? Jul 16, 2015 19:06 |
|
Sab669 posted:The method that mkves tabs from Active / Archived takes two TabControls and an index. So this is most likely it. That doesn't look like it's the culprit, it's accessing through the TabPages property, not the Controls property. edit: Actually, I see the problem: it won't work right if you add a tab page to a tab control without removing it from the original tab control it was on first. The two lines of code you have above show the problem. Add a source.TabPages.Remove(tp) between those two lines.
|
# ? Jul 16, 2015 19:40 |
|
|
# ? Jun 8, 2024 08:53 |
|
Bognar posted:I'll start compiling a list of all the things that I use in R# (it's a lot), but off the top of my head: Adding to this, a simple but awesome feature that I find myself missing without R# is Move Type to File. Often when prototyping things I'll jam a bunch of classes together in a file, then come back afterwards and refactor into their own files - this is pretty painful with having to create each file manually then copying the code in and trying to get the using statements right.
|
# ? Jul 17, 2015 00:00 |