|
Ithaqua posted:I grudgingly recommend Stephen Cleary, because he knows asynchrony in .NET inside and out. The grudging is only because he's an evangelical fundamentalist who proselytizes every chance he gets and it really rubs me the wrong way. This is exactly the feeling I got reading his stuff about async.
|
# ? Feb 26, 2016 08:45 |
|
|
# ? Jun 10, 2024 11:26 |
|
Service bus is a clusterfuck and does not scale well
|
# ? Feb 26, 2016 19:49 |
|
Malcolm XML posted:Service bus is a clusterfuck and does not scale well [[citation needed]] We've run some preliminary performance tests and it has held up okay, what about it doesn't scale well?
|
# ? Feb 26, 2016 20:21 |
|
Yeah, I'd like to hear why. It's shall we say... very relevant to my interests.
|
# ? Feb 27, 2016 02:49 |
|
I'm not sure where to ask this, but it's kind of .NET related (VBA is .NET right?). I have no idea how Excel macros work but I'm trying to make one. If making a macro for this is is dumb then let me know. I want to iterate through values of X until I find a value that satisfies (X*64)/.75 > Cell to the left. Then I'd like to export the value of X. What would be a good way of doing this? So far I've got code:
Methanar fucked around with this message at 04:32 on Feb 28, 2016 |
# ? Feb 28, 2016 03:45 |
|
No Safe Word posted:[[citation needed]] It's based on SQL server internally and has all the issues that brings when dealing with thousands+ events a second especially the whole noisy neighbor thing that wrecks cloud sql Also some of the guarantees it offers are not easily scaled across data centers and failure domains compared with the relaxed guarantees of azure queues which force you to not rely on them (distributed locking is subtle and hard) That said u can use it for slow and small data
|
# ? Feb 28, 2016 15:26 |
|
Can you go into more detail?
|
# ? Feb 28, 2016 20:21 |
|
Well, my program has started consistently crashing with some internal CLR exception when it has a profiler attached e: Some obsolete internal exception. edit edit: I was wrong, it's actually a fatalExecutionEngineError, and it doesn't just happen with a profiler attached. Sometimes my application just crashes for no reason I can determine and I have no idea how to go about solving this. I don't use any unmanaged code myself, and the actual place the problem is occurring (roughly, it's not consistent) isn't near any third-party library calls. raminasi fucked around with this message at 10:55 on Feb 29, 2016 |
# ? Feb 29, 2016 07:46 |
|
Malcolm XML posted:It's based on SQL server internally and has all the issues that brings when dealing with thousands+ events a second especially the whole noisy neighbor thing that wrecks cloud sql Did you try using express queues/topics? https://azure.microsoft.com/en-us/documentation/articles/service-bus-performance-improvements/#express-queues-and-topics
|
# ? Feb 29, 2016 16:03 |
|
Potentially dumb question from an MVC newbie: Is there any sort of library that facilitates translating my ViewModels into Repository parameters without breaking the separation? Having a repository method that needs to be called with 30 arguments seems wrong. I feel like I've heard of something that helps with this translation process rather than a copy/paste mess, but I'm not finding it.
|
# ? Feb 29, 2016 16:18 |
|
spiderlemur posted:Potentially dumb question from an MVC newbie: Your repository parameters would be your model, not view model. Also, MVC stands for Model-View-Controller. View models are an MVVM concept.
|
# ? Feb 29, 2016 17:13 |
|
Inverness posted:I think there is a bit of confusion here. I always interpreted NET MVC as MVW for Model-View-Whatever. ViewModels have always been a concept as far as I know, despite the naming. Regardless, what's the sane way of transferring view data into a Repository from the controller, without calling a repository method with 20 arguments. Passing in the view data (ViewModel) directly seems like it violates the whole separation of concerns thing. On the other hand, it's messy as gently caress. Maybe I'm just confused on all of this.
|
# ? Feb 29, 2016 17:38 |
|
Your controller (or view model) would take a model into it, manipulate it, and send it back out to the repository service as needed. Ideally, your parameter for your repository should be a single class model containing all the data it needs.
|
# ? Feb 29, 2016 17:51 |
|
spiderlemur posted:Potentially dumb question from an MVC newbie: When you run into a "I'm passing 30 arguments" situation, you should be thinking about using an object instead. If that object is a ViewModel, create a method that translates between that object and your Model object, so your repository can do whatever it needs to do with the data. Probably in your Model layer (which can have many layers itself - a detail that is often very poorly explained in MVC guides, if at all). This has the bonus of letting you ignore data the Model doesn't care about. TLDR: What you're missing is the logic that translates between a ViewModel object and a Model object.
|
# ? Feb 29, 2016 17:53 |
|
crashdome posted:Your controller (or view model) would take a model into it, manipulate it, and send it back out to the repository service as needed. Ideally, your parameter for your repository should be a single class model containing all the data it needs. Should the ViewModel (for clarification, what we use for @model in the view) be passed into the repository directly, or should there be a container class in the middle which data is transferred to before being passed into the repository? Edit: above post answers my question, thanks!
|
# ? Feb 29, 2016 17:54 |
|
I'm about to start building a PoC for a message-queue architecture. Is Mass Transit worth using, or should I write against the RabbitMQ/Azure/etc. APIs directly?
|
# ? Feb 29, 2016 18:41 |
|
I got hit with a leap year bug today. I was creating a new DateTime object like so:code:
|
# ? Feb 29, 2016 18:51 |
|
No Safe Word posted:Did you try using express queues/topics? https://azure.microsoft.com/en-us/documentation/articles/service-bus-performance-improvements/#express-queues-and-topics no because they were really new and even then have limits and its unclear how the nodes coordinate in the partitions it's just a lot simpler to write a load balanced layer over the azure queue than to deal w/ the complexity of service bus Queues can go a long long way with minimal abstractions looks to be ok for smallish stuff tho
|
# ? Feb 29, 2016 21:55 |
|
Methanar posted:I'm not sure where to ask this, but it's kind of .NET related (VBA is .NET right?). I have no idea how Excel macros work but I'm trying to make one. If making a macro for this is is dumb then let me know. You shouldn't need to iterate to solve this. You have the value of the cell to the left, so re-write the equation for X: code:
code:
EDIT because I don't know Excel functions... MajorBonnet fucked around with this message at 00:51 on Mar 1, 2016 |
# ? Mar 1, 2016 00:46 |
|
Wardende posted:I'm about to start building a PoC for a message-queue architecture. Is Mass Transit worth using, or should I write against the RabbitMQ/Azure/etc. APIs directly? Which is better, a truck or a motorcycle? I, personally, don't like adding complexity unless I think I'm going to need it. If you just need a simple fire-forget/pickup-execute type arrangement, Azure Queue or Rabbit would be fine. Serialize a class holding your desired action and config to the proper queue (JSON or XML), and long-poll to find work to do in your service. Rabbit is far more feature-rich than Azure queues, so even that might be overkill. MassTransit is pretty well documented; I'd do a quick read-through and see if the concepts seem like something you'd make use of. If not, I don't think the abstraction is worth it.
|
# ? Mar 1, 2016 03:22 |
|
B-Nasty posted:Which is better, a truck or a motorcycle?
|
# ? Mar 2, 2016 17:55 |
|
Jet Brains C# IDE is out for early access (aka beta). I'm excited to check it out. While running Visual Studio on OS X via parallels is an okay experience it would be nice to have something that offers a bit of a smoother ride performance wise. I hate MonoDevelop. I've used IntelliJ before and loved it for Java programming.
|
# ? Mar 2, 2016 19:08 |
|
Ithaqua posted:You shouldn't do either of those in a web application since long-running threads are subject to arbitrary cancellation by the web server. Bognar posted:That's not what async/await is for, and you could accomplish that task without async/await. However, I would still recommend using the database or a durable queue for email. For one, it makes it much easier to implement retry logic for when the email inevitably has a transient failure for one reason or another. Plus it gives you a nice place to store potential exceptions related to sending that email. Sure you could do all of this in-process and with log statements, but email is finicky enough that it's useful to have a single table aggregating all this information. Yeah I definitely understand that there's a better way to do this, but the time pressure is on and the emails are not in the slightest bit critical so this is a good stop-gap until we can organise a more wholistic solution. I agree that an email queue is the way to go but this is software that companies can purchase to host themselves and the more bits and pieces we have going on the more complicated the ongoing support becomes. That's not to say I won't be taking this approach, just that it requires a thoughtful implementation, far more thought than I have the time for since the success of the email really doesn't matter too much. I've noted this particular bit of technical debt and I don't plan on leaving it this way.
|
# ? Mar 2, 2016 22:48 |
|
Are the styling conventions for C# similar to Java? I'm going through one of the Unity 3D tutorials, and the script he's writing works, but the formatting seems way off. Here's what he's written.code:
code:
|
# ? Mar 2, 2016 23:32 |
|
22 Eargesplitten posted:Which is right? Generally Allman style (the one from Unity) because it is Microsoft's default within Visual Studio. Programmers Stackexchange has some info on it and why it might be. Be consistent is most important but if you want K&R style braces you are going to be fighting an uphill battle against Visual Studio defaults
|
# ? Mar 2, 2016 23:40 |
|
22 Eargesplitten posted:Are the styling conventions for C# similar to Java? I'm going through one of the Unity 3D tutorials, and the script he's writing works, but the formatting seems way off. Here's what he's written. Allman style (= vertically aligned braces) is the de facto standard for C#, while K&R style (= first brace at the end of the line) is indeed more common in Java. You can use whichever style looks better to you, though. Serious programmers rarely have strong opinions about braces/indentation and are unlikely to make a big deal out of it.
|
# ? Mar 2, 2016 23:42 |
|
gariig posted:Generally Allman style (the one from Unity) because it is Microsoft's default within Visual Studio. Programmers Stackexchange has some info on it and why it might be. It's not difficult at all to tell Visual Studio to format things differently. But having it consistently actually follow the rules you set, on the other hand, is indeed an uphill battle. Of note, in 22 Eargesplitten's example, the default Visual Studio style actually doesn't put spaces between function names and the parens for the args. So that looks like a custom style rule being applied. You can change it in the Text Editor settings for each language under Tools > Options
|
# ? Mar 2, 2016 23:44 |
|
The Unity3d version of MonoDevelop defaults to putting spaces around the parenthesis. And for whatever stupid loving reason whenever you regenerate the Unity3d MonoDevelop project it resets these settings back to default. Making it virtually impossible to have it set to a style you actually prefer.
|
# ? Mar 3, 2016 01:09 |
|
xgalaxy posted:The Unity3d version of MonoDevelop defaults to putting spaces around the parenthesis. And for whatever stupid loving reason whenever you regenerate the Unity3d MonoDevelop project it resets these settings back to default. Making it virtually impossible to have it set to a style you actually prefer. Don't blame monodevelop itself. Unity forked mono and monodevelop and they are early versions. A lot of issues get fixed in the new versions and Xamarin Studio and don't get backported. Except for this one, I think it's still in Xamarin studio. Edit: not saying you were, but I've gotten people telling me issues in MD that are in the unity version, and don't know the difference.
|
# ? Mar 3, 2016 01:24 |
|
Okay, thanks. Allman style is what I was taught in C++ class, but I thought it was just outdated. Is there any way to use another IDE for unity by default? I also don't like how there is apparently no way to make it show column numbers.
|
# ? Mar 3, 2016 01:44 |
|
No Safe Word posted:It's not difficult at all to tell Visual Studio to format things differently. But having it consistently actually follow the rules you set, on the other hand, is indeed an uphill battle. I use a configuration in ReSharper and an extension that runs a ReSharper format on the current file on save. It works OK.
|
# ? Mar 3, 2016 02:32 |
|
22 Eargesplitten posted:Okay, thanks. Allman style is what I was taught in C++ class, but I thought it was just outdated. They're both actually about the same age! Using/Reading K&R is known to cause tumors!
|
# ? Mar 3, 2016 02:44 |
|
22 Eargesplitten posted:Which is right? Neither. It should be: C# code:
1. Explicitly labeled accessibility modifiers. 2. Use var. 3. Capitalize method names. 4. Prefix private fields with _. 5. Don't use the goofy space between method and parentheses. 6. Allman-style braces. 7. Spaces > tabs (but seriously, pick a style and just be consistent with it) Bognar fucked around with this message at 15:51 on Mar 3, 2016 |
# ? Mar 3, 2016 15:49 |
|
Bognar posted:Neither. It should be: ehh dont use var unless the type is redundant it's lot easier to understand the code when u dont have to do hindley-milner++ in your head
|
# ? Mar 3, 2016 16:17 |
|
Bognar posted:Neither. It should be: Typo?
|
# ? Mar 3, 2016 16:19 |
|
22 Eargesplitten posted:Okay, thanks. Allman style is what I was taught in C++ class, but I thought it was just outdated. That is indeed a really stupid default but it's easier to enable globally in settings than to use a different IDE. Options > Text Editor > All Languages
|
# ? Mar 3, 2016 16:39 |
|
Hover with the mouse cursor over var to see its type. Or press dot on the value to see if it has the stuff you want. I use var whenever the compiler allows it. The important part is that you're getting type checking. You know you're calling methods that exist in permitted ways and that you're returning the right types. I think var tends to reduce the effort of superficial refactors.
|
# ? Mar 3, 2016 16:59 |
|
fleshweasel posted:Hover with the mouse cursor over var to see its type. Or press dot on the value to see if it has the stuff you want. I use var whenever the compiler allows it. The important part is that you're getting type checking. You know you're calling methods that exist in permitted ways and that you're returning the right types. I think var tends to reduce the effort of superficial refactors. cool having var x = f(1) . . . var y = g(x) etc etc is basically awful to keep poking through just use it when the type is basically obvious and avoid it when the type would also add to documentation for the next person to inspect your code not using VS (gh code review, for example).
|
# ? Mar 3, 2016 17:19 |
|
epalm posted:Typo? https://en.wikipedia.org/wiki/Muphry%27s_law
|
# ? Mar 3, 2016 17:21 |
|
|
# ? Jun 10, 2024 11:26 |
|
I have a Solution that contains a MVC 5 project, a business logic project and DAL project. When I try use the MVC scaffolding with my entity frame work objects in my DAL project I keep getting “Object reference not set to an instance of an object.” The MVC project has a reference to my DAL project. I tried creating a test db context inside my MVC project and I got the same error. This is driving me up a wall. I am using VS2013.
|
# ? Mar 3, 2016 17:30 |