|
edit is not quote
|
# ? May 7, 2015 20:58 |
|
|
# ? Jun 8, 2024 03:43 |
|
Ciaphas posted:Is there a "right" way to open new views in MVVM? In a possibly ill-advised attempt to avoid controlling views from a viewmodel directly, I cobbled together something like this. Is it kind of the right way to go about it? See my post here for a very clean approach: http://forums.somethingawful.com/showthread.php?threadid=3644791&pagenumber=61&perpage=40#post442712636
|
# ? May 7, 2015 22:57 |
|
Ithaqua posted:That starts to fall apart when the using block doesn't coincide with the end of the method. C# code:
ljw1004 posted:I think the difference is that in C++ doesn't have GC, so every single blasted resource has to be disposed of, which is why they made the idiom so easy to use -- at the cost of it being implicit+invisible. Inverness fucked around with this message at 23:08 on May 7, 2015 |
# ? May 7, 2015 23:00 |
|
Ciaphas posted:Is there a "right" way to open new views in MVVM? In a possibly ill-advised attempt to avoid controlling views from a viewmodel directly, I cobbled together something like this. Is it kind of the right way to go about it? I do something similar. I call mine WpfWindowManager and forego the interface as its explicitly for use only with Wpf views. Although you could try and make an interface to encapsulate different platforms if you want. Also make it static. I maintain a list of valid views in a servicelocator so the vm calling OpenLogin or whatever in the svclocator. The servicelocator then calls wpfwindowmanager which constructs the appropriate window based on the view registered. Edit: Oops skipped past Good Cleans post... That is a great example. crashdome fucked around with this message at 00:31 on May 8, 2015 |
# ? May 7, 2015 23:48 |
|
GoodCleanFun posted:See my post here for a very clean approach: http://forums.somethingawful.com/showthread.php?threadid=3644791&pagenumber=61&perpage=40#post442712636 crashdome posted:I do something similar. I call mine WpfWindowManager and forego the interface as its explicitly for use only with Wpf views. Although you could try and make an interface to encapsulate different platforms if you want. Thank you both, I'll give GoodCleanFun's code a lookover and work it out from there.
|
# ? May 8, 2015 01:12 |
|
man, i want higher-kinded delegates how cool would it be to be able to implement this interface: code:
code:
|
# ? May 8, 2015 09:58 |
|
Your code is confusing to me, but I think I get what you're saying. Somewhat related to that, I've always wished for static interface methods (which could also include constructor signatures). That would let you do things like:C# code:
More abstractly, you could also do this: C# code:
|
# ? May 8, 2015 15:24 |
|
So it seems most of the features in Productivity Power Tools 2013 still work in 2015. You have to extract and edit the extension.vsixmanifest file to make it support Visual Studio 14.0 instead of 12.0. And also remove/comment-out content references for: Fix Mixed Tabs, Column Guides, Go to Definition Click, and Solution Error Filter. You'll also need to delete the files for those components from the extension. Once that is done you can zip the file back up as a vsix and then install it. Also the page for turning various parts on and off crashes when you try to press OK so you'll also need to disable whatever parts you don't want by commenting out their lines in the vsixmanifest. You don't need to delete their files in this case though, and you can do this at any time by editing the manifest after its been installed in %LOCALAPPDATA%\Microsoft\VisualStudio\14.0\Extensions\. Inverness fucked around with this message at 22:54 on May 8, 2015 |
# ? May 8, 2015 17:48 |
|
There was a lot of buzz about TFS Build vNext supporting Linux but I can't find any build agent binaries to actually install anywhere. Am I missing something?
|
# ? May 8, 2015 17:56 |
|
EssOEss posted:There was a lot of buzz about TFS Build vNext supporting Linux but I can't find any build agent binaries to actually install anywhere. Am I missing something? It's a Node program, grab it from npm. https://github.com/Microsoft/vso-agent You also have to set up basic Auth on the TFS server so the agent can authenticate. Not sure if they will make it easier at RTM. New Yorp New Yorp fucked around with this message at 18:14 on May 8, 2015 |
# ? May 8, 2015 18:06 |
|
Gul Banana posted:man, i want higher-kinded delegates Call me stupid but what are you getting here that you don't get with abstract classes and protected members?
|
# ? May 9, 2015 01:36 |
|
EssOEss posted:Azure is a cloud platform that can be used for hosting web applications (and other types of server-side applications) and which provides various pre-existing services. It does not change the way you develop software unless you wish to integrate those pre-existing services it offers. If you need to make a REST web service then make a REST web service. Yes, you can easily host it in Azure. And you can easily host it elsewhere. Unless you're using something like Mobile services, which lets you define resources for a REST endpoint and some simple code to handle the actions.
|
# ? May 9, 2015 22:57 |
|
RICHUNCLEPENNYBAGS posted:Call me stupid but what are you getting here that you don't get with abstract classes and protected members? abstract classes don't let you write an inline closure either. here's the general use case for Delegate____ impls: C# code:
now, what happens if i want to add a type parameter? let's say that IFormulas can operate on a T instead of an int? still works: C# code:
Gul Banana fucked around with this message at 09:12 on May 11, 2015 |
# ? May 11, 2015 09:08 |
|
so those are the basics. now we want something fancy. i want programmable swapping/locking strategies, using generics; i'm going to have the tester supply inputs and print whichever one comes back. i can do that for concrete implementations:C# code:
C# code:
Gul Banana fucked around with this message at 09:12 on May 11, 2015 |
# ? May 11, 2015 09:08 |
|
Gul Banana posted:so those are the basics. now we want something fancy. i want programmable swapping/locking strategies, using generics; i'm going to have the tester supply inputs and print whichever one comes back. I like the way you wrote that out and built up reasonable cases. My thoughts: A instance of a delegate is basically an instance of a class with a method on it -- and that's how it's implemented under the hood -- but with the limitation you describe about generics. Option 1 is to introduce higher-order types to the language and to the CLR, so that field "f" would be a higher order delegate type. Option 2 is just to ask coders to write it out longhand, as you have done, and field "f" can be of type IConcurrentFormula. All round, Option2 seems the nicer choice! More in keeping with object oriented design! and a much simpler language! My other thought is that the job of the type-system is to help catch errors at compile-time rather than at runtime. For instance, the current effort by the VB/C# language design team to bring in "nullable types" and "non-nullable types" into the type system is a way to reduce the number of times that folks get NullReferenceExceptions and ArgumentNullExceptions at runtime. But it's always a tradeoff, and you can live in a more type-heavy world or a less type-heavy world. In that light, question what a higher-order delegate actually means. A instance of a higher-order delegate Func<<T>><T,T> would be an instance that, for any type "T", it can take in an object of type "T" and will return one of type "T". There already exists this concept in object-oriented languages: Func<object,object>. This will work for any type "T", and will take in an object of that type, and can return one. You don't get the compile-time enforcement that an InvalidCastException won't occur at runtime, but in most cases you'd detect and eliminate such errors very early in your unit tests. Incidentally, why define your own "Box" type rather than using the "StrongBox" type in .NET ?
|
# ? May 11, 2015 16:09 |
|
I'm about to start a pretty ambitious project and try to deliver something in a small turn around time. I wanted to possibly use the 2015 RC. Anyone have any thoughts or opinions (based on previous RC -> RTM versions) how things would go? Anything that I need to know installing the RC side by side with 2013?
|
# ? May 11, 2015 22:35 |
|
Uziel posted:I'm about to start a pretty ambitious project and try to deliver something in a small turn around time. I wanted to possibly use the 2015 RC. Anyone have any thoughts or opinions (based on previous RC -> RTM versions) how things would go? Anything that I need to know installing the RC side by side with 2013? You can use RC side-by-side with VS2013 perfectly fine. I haven't had success uninstalling VS2015 RC. And I've had failures upgrading from previous CTPs to RC. So that makes me unconfident about upgrading from RC to RTM. What I plan to do is wipe my machine entirely when VS2015 RTM comes out, and install whatever is the latest version of Windows 10 Insider at that point, and VS2015. [I should add the caveat that I'm in the VB/C# team at Microsoft, doing work on Win10 app development at the moment, so folks like me are used to paving and reinstalling our machines frequently...] ljw1004 fucked around with this message at 00:56 on May 12, 2015 |
# ? May 12, 2015 00:51 |
|
Ithaqua posted:It's a Node program, grab it from npm. Thanks for the hint! Looks like it works pretty well once the initial setup is done. We have a few multiplatform projects cooking and this will definitely make our lives much easier. The Windows build process is a tiny bit broken, though. I notice PowerShell is involved - always a sign of trouble!
|
# ? May 12, 2015 10:17 |
|
EssOEss posted:I notice PowerShell is involved - always a sign of trouble! Not really... PowerShell is a pretty major part of the new build. At RTM (I believe, although don't quote me on that) you'll be able to upload custom tasks to the new build system, which are just JSON files describing the parameters, and scripts (PS1, batch file, bash, whatever). The new release management system coming in Update 1 will be the same way. In fact, it will use the same task system.
|
# ? May 12, 2015 10:50 |
|
ljw1004 posted:I like the way you wrote that out and built up reasonable cases. My thoughts: Yeah, I don't realistically expect this feature to be added - at minimum there are other things that would benefit more people as well as being simpler. I just wanted to explain the concept, at least, without having to refer to Haskell type constructors :) quote:My other thought is that the job of the type-system is to help catch errors at compile-time rather than at runtime. For instance, the current effort by the VB/C# language design team to bring in "nullable types" and "non-nullable types" into the type system is a way to reduce the number of times that folks get NullReferenceExceptions and ArgumentNullExceptions at runtime. But it's always a tradeoff, and you can live in a more type-heavy world or a less type-heavy world. Actually, this doesn't cover my use case. See, the thing i was really trying to achieve is a 'generic visitor'. I have a set of types that all implement IThing (not actual name), and then an IThingInfo for each type- this is all backed by generated code. At runtime, we want to get the static type of a dynamically selected IThing impl, using its info. The mechanism I have for this is an interface IThingInfo.Visitor, similar to the usual visitor pattern but with a single Accept method which just calls Sub Visit(Of T As IThing)(). This means that we can then define a bunch of visitor implementations which, when visited, *receive the type parameter T* and go on to do more work with it. The entire point is to recover type safety, and to gain access to apis like CreateThingListController(Of T As IThing)- so object or dynamic wouldn't help. However, this is all so esoteric that I didn't want to use it as the real example (although it is a real use case in heavily used code). What we do is write a bunch of SpecificActionTakingThingVisitor classes and wish occasionally that they could be inline. quote:Incidentally, why define your own "Box" type rather than using the "StrongBox" type in .NET ? Looks like I should go poke around System.Runtime.CompilerServices someday!
|
# ? May 12, 2015 12:07 |
|
So I'm trying to use a little boolean logic in newtonsoft's ShouldSerializePROPERTY methods to programmatically serialize a property in a class, or not.code:
isUpdate is a property in the same class as System, and the ShouldSerializeSystem() method. I've tried researching this and even had some senior devs look this over, who now think I'm loving with them. WTF is going on? Note that the following works fine: code:
|
# ? May 12, 2015 14:35 |
|
Your computer has a gremlin, go work on something else for a day so it gets bored and leaves. (Seriously. Problems that bizarre, in my experience, are only ever solved by putting them down and only coming back once your brain has untied whatever knots it's put itself in.)
|
# ? May 12, 2015 14:59 |
|
Uziel posted:I'm about to start a pretty ambitious project and try to deliver something in a small turn around time. I wanted to possibly use the 2015 RC. Anyone have any thoughts or opinions (based on previous RC -> RTM versions) how things would go? Anything that I need to know installing the RC side by side with 2013? Unless there is some specific feature available in 2015 that will substantially reduce your workload, I think you should consider sticking with the familiar. The little gotchyas that are inevitable when moving to a new piece of software can add up quickly, and your own description of the protect suggests that you won't have a lot of wiggle room. How will you be feeling when you've lost a second or third day's worth of work to some sort of build/deployment issues which (at least in your head) wouldn't have happened had you been working in 2013?
|
# ? May 12, 2015 15:01 |
|
GrumpyDoctor posted:Your computer has a gremlin, go work on something else for a day so it gets bored and leaves. (Seriously. Problems that bizarre, in my experience, are only ever solved by putting them down and only coming back once your brain has untied whatever knots it's put itself in.) The API I was sending JSON to is just gone anyway! Other divisions like to do one thing with servers and we do another, and nobody communicates, sooo suddenly one endpoint is gone and another is now pointing to production.
|
# ? May 12, 2015 15:10 |
|
I've discovered some code left by my predecessor that's just baffling to me; can anyone shed some light? Basically, I've got a program that, when it sees it's time for an update, closes itself and calls SelfUpdate.exe, which is in the same folder. SelfUpdate.exe goes and fetches the new files and extracts them. All that makes sense. And then I hit this:code:
|
# ? May 12, 2015 16:43 |
|
How is SelfUpdate.exe being called in the original application? I assume it's passing in the executable path as the first argument. In any case, it does seem a bit odd, since now it essentially means you can't change the name of your executable in an update. I would just change it to call the path it knows it downloaded to, like you said. Bognar fucked around with this message at 18:28 on May 12, 2015 |
# ? May 12, 2015 18:25 |
|
CapnAndy posted:First off, why is he so sure that the second command line argument is always going to be the path of the file that called SelfUpdate? It clearly is -- this process works -- but this seems like a hell of a thing to grab blindly like that. Secondly, why's he doing this at all? SelfUpdate knows goddamn well where the original file is because they're in the same folder as each other, it is not hard to locate. I assume that he wrote a general-purpose "SelfUpdate.exe" program which can be used to update any executable. As long as it's passed the URL to download from, and the name of the EXE, then it should be agnostic (i.e. loosely coupled) to the calling program.
|
# ? May 12, 2015 19:12 |
|
Space Whale posted:So I'm trying to use a little boolean logic in newtonsoft's ShouldSerializePROPERTY methods to programmatically serialize a property in a class, or not.
|
# ? May 12, 2015 19:56 |
|
He does pass the program the path, but the URL it downloads from is hardcoded.ljw1004 posted:I assume that he wrote a general-purpose "SelfUpdate.exe" program which can be used to update any executable. As long as it's passed the URL to download from, and the name of the EXE, then it should be agnostic (i.e. loosely coupled) to the calling program.
|
# ? May 12, 2015 20:17 |
|
ljw1004 posted:You can use RC side-by-side with VS2013 perfectly fine. Newf posted:Unless there is some specific feature available in 2015 that will substantially reduce your workload, I think you should consider sticking with the familiar. The little gotchyas that are inevitable when moving to a new piece of software can add up quickly, and your own description of the protect suggests that you won't have a lot of wiggle room. My main concern was that I normally never work with user accounts and for this particular project, I'm going to be going off this to tutorial: http://www.asp.net/mvc/overview/security/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on to use the ASP.NET Identity stuff. Only going to be using Facebook and Google logins though, so I wasn't sure if this was improved in the next version of ASP.NET. I swear I read that it was, but I can't for the life of me find it.
|
# ? May 12, 2015 21:57 |
|
ungh web development in vs 2015 is like learning a whole new tool set with Gulp and Bower.
|
# ? May 13, 2015 16:11 |
|
Dietrich posted:ungh web development in vs 2015 is like learning a whole new tool set with Gulp and Bower. Lots of development in 2015 seems to be about constantly learning new, totally essential open-source plugins and packages that you're supposed to discover through sheer memetic osmosis more than by any structured process. "What, you don't even Squazzle your assemblies or check them in Hoobilai before you Dripr them to a Kanoozer stack? You just compile and run? Jesus do you write COBOL programs for AS/400 or something?" (Say what you will about boring-rear end '90s enterprise software, but if somebody says that they're having good/bad results with MegaCorp Distributed Database Mapping Manager 5.0, I don't have to hit up Google to figure out if it's a tool that I care about.)
|
# ? May 13, 2015 21:30 |
|
NihilCredo posted:"What, you don't even Squazzle your assemblies or check them in Hoobilai before you Dripr them to a Kanoozer stack? You just compile and run? Jesus do you write COBOL programs for AS/400 or something?" "That's what I'm saying, Nihil; I asked him the same thing. It's like he doesn't know anything about negative flux tachyon streams! What did he do all those years at the academy?"
|
# ? May 13, 2015 21:48 |
|
NihilCredo posted:
I love this sentence.
|
# ? May 14, 2015 21:04 |
|
code:
|
# ? May 15, 2015 13:29 |
|
Kekekela posted:
How are those wax tadpoles?
|
# ? May 15, 2015 15:51 |
|
Could I split out my entity frame work edmx model and various classes into its own project and use that project in multiple solutions? How would that work with config files? I would like to be able to refuse my entity model from my MVC site on a couple of desktop solutions.
|
# ? May 15, 2015 16:01 |
|
Calidus posted:Could I split out my entity frame work edmx model and various classes into its own project and use that project in multiple solutions? How would that work with config files? I would like to be able to refuse my entity model from my MVC site on a couple of desktop solutions. I'm doing this right now, where I have my database-first EF model in a class library and am using it as a reference in a couple of other projects. There may be a better way, but so far all I've had to do is copy the connection string to the app/web.config of my other projects. I haven't run into any major problems so far.
|
# ? May 15, 2015 17:46 |
|
I'm just posting to confirm I also do the above. Only copy the connection string and add the reference.
|
# ? May 15, 2015 19:30 |
|
|
# ? Jun 8, 2024 03:43 |
|
Is the only easy-ish solution for a machine global 'mutex' which protects access to async code by using database transactions for acquiring exclusivity? Since async code isn't guaranteed to be re-entrant on the same thread, you'll blow up when you release the Mutex after the async code. The only alternative that springs to mind is a class which pins a mutex to a thread, and uses message passing to marshal calls to acquire/release the mutex onto that thread. That just seems like . Use case is extracting a zip of binaries to a local directory (a bit like NuGet), and multiple builds for a given user. I can probably live without it for now. And if needs be use a database to register locks, and handle unexpected termination of the process.
|
# ? May 15, 2015 20:55 |