|
Gul Banana posted:it's an Atom-like html app It seems like you think Atom is bad, which is also kind of the vibe I get from other people whose technical opinions that I value. Can you elaborate on why if its not too off-topic? (or is it just the large files thing?) I've been trying to transition to doing more of my non-VS development on my macbook and I've been using Atom. I'd switched to it a couple months ago because Sublime made me feel guilty about being cheap. Mainly its smaller github projects and files for now and Atom's been great. If I'm going to run into a wall with it though, I'd like to know now rather than later so I can shift to a plan B. (which I guess would be Webstorm or back to Sublime)
|
# ? Apr 30, 2015 09:45 |
|
|
# ? May 22, 2024 18:26 |
|
Factor Mystic posted:I also wish WPF would become less bad, so we agree on that point. However, you can take your xaml & data binding & mvvm principles and use them to build universal apps which are now much more integrated with the desktop. The problem is businesses have invested in .NET + WPF for years, meaning they have huge codebases. Just speaking for myself we have close to a million lines, and there is no way in hell we're going to port that over to this new universal app stuff or Javascript. I agree browser plugins are dead for the masses, and I'd never use Silverlight when developing a new public website. But for enterprise stuff with existing .NET/WPF codebases there is no alternative (there are some open source efforts going on to convert XAML to JS, but I don't see those going anywhere anytime soon). Microsoft has to realize most developers probably don't see the benefit in this whole universal app thing. Windows phone isn't big enough to be concerned about, tablets are mostly for small single-purpose apps, Surface is a niche, Xbox is a gaming console. This leaves the desktop, and why bother switching tech when the end result is the same? And good luck with getting companies to install Windows 10 just to run your application, we've only JUST managed to convince some customers to drop Windows XP.
|
# ? Apr 30, 2015 09:56 |
|
I've used a similar pattern of query/command on a few projects, it's worked really well and how big you make the infrastructure is up to your needs. I got fairly far with a really simple implementation in one case, along the lines of: C# code:
C# code:
The controllers end up being fairly declarative and readable too: C# code:
|
# ? Apr 30, 2015 11:08 |
|
Kekekela posted:It seems like you think Atom is bad, which is also kind of the vibe I get from other people whose technical opinions that I value. Can you elaborate on why if its not too off-topic? (or is it just the large files thing?) If Atom works for you that's fine. I just prefer the native controls & performance that you get from a lower-level editor. Using HTML5 by preference for UI development is just.. a weird trend that I don't fully understand; it's like people learned javascript and don't want to ever go beyond that, despite its disadvantages for complex applications. A text editor *seems* simple, but a good programming editor has a lot of features these days. Performance is a specific concern - I have some 4 MB .cs files here, 90k lines or so of generated code. My machine is also bogged down with virtual machines, conference calls and debug utilities.. I don't want to have to worry about a mess of DOM spans for just my editor windows.
|
# ? Apr 30, 2015 13:45 |
|
Bit of a stupid question here, but for anyone who has run the new VSCode editor, where does it install on the system? I installed and ran it yesterday, but it hasn't shown up in my path (supposed to be 'code', I think). It also doesn't show up from searching 'code' in the start menu, and doesn't seem to be in either Program Files/ or Program Files (x86)/. Running the installer again pops the splash install screen, which then disappears and doesn't seem to change anything :/.
|
# ? Apr 30, 2015 14:26 |
|
Newf posted:Bit of a stupid question here, but for anyone who has run the new VSCode editor, where does it install on the system? I installed and ran it yesterday, but it hasn't shown up in my path (supposed to be 'code', I think). It also doesn't show up from searching 'code' in the start menu, and doesn't seem to be in either Program Files/ or Program Files (x86)/. Mine is in %appdata%\..\local\Code. Somewhere in %appdata% seems to be where the cool kids are going instead of Program Files. Is %appdata% more locked down than Program Files?
|
# ? Apr 30, 2015 14:53 |
|
gariig posted:Mine is in %appdata%\..\local\Code. Somewhere in %appdata% seems to be where the cool kids are going instead of Program Files. Is %appdata% more locked down than Program Files? Ah, I should have known, given that it's made with the same UI framework as Atom. I guess this means that we can expect for the location of the executable to change when the program updates - something that gave me a pretty good surprise last week when my powershell alias for atom suddenly stopped working.
|
# ? Apr 30, 2015 15:00 |
|
gariig posted:Mine is in %appdata%\..\local\Code. Somewhere in %appdata% seems to be where the cool kids are going instead of Program Files. Is %appdata% more locked down than Program Files? Actually, the opposite* - local app data isn't locked down as much as program files because it's per-user and not a machine-wide application data location. This means that elevation isn't required to install or update the application, either. * - for the logged in user, iirc by default that location is locked for other users. AstuteCat fucked around with this message at 15:24 on Apr 30, 2015 |
# ? Apr 30, 2015 15:21 |
|
Gul Banana posted:If Atom works for you that's fine. I just prefer the native controls & performance that you get from a lower-level editor. Using HTML5 by preference for UI development is just.. a weird trend that I don't fully understand; it's like people learned javascript and don't want to ever go beyond that, despite its disadvantages for complex applications. A text editor *seems* simple, but a good programming editor has a lot of features these days. You should probably download and try VS Code. Because this thing is outperforming Atom for me by large margins. Not sure what they did under the hood but it doesn't feel sluggish at all.
|
# ? Apr 30, 2015 16:28 |
|
I've got an issue with JSON serialization. An endpoint I hit does not like lists of length 1, saying "the string isn't formatted properly" unless it's sent as just an object. The thing is, the given property is basically a list as I see it, with one or two entries. Is there a way to tell Newtonsoft (or any other json serializer) to serialize a list of 1 as just an object? Edit: it's fine. Whitespace poo poo with my pretty-printed json I was passing to it made it screw up. WTF? ?? Space Whale fucked around with this message at 21:28 on Apr 30, 2015 |
# ? Apr 30, 2015 19:16 |
|
So am I missing anything?
|
# ? Apr 30, 2015 21:11 |
|
Calidus posted:So am I missing anything? Actually ASP.NET 5 will support VB. http://blogs.msdn.com/b/webdev/archive/2015/04/23/making-it-better-asp-net-with-visual-basic-14.aspx quote:ASP.NET 5 – C# Support And Also Visual Basic
|
# ? Apr 30, 2015 22:19 |
|
Is there a "correct" way to bind a text control's content to non-string data in one's model? My solution was something like this (working from memory, again...):C# code:
XML code:
Ciaphas fucked around with this message at 22:43 on Apr 30, 2015 |
# ? Apr 30, 2015 22:41 |
|
RICHUNCLEPENNYBAGS posted:OK, that's what we were all talking about a few posts ago when we mentioned "projection," but that doesn't help if you want to mutate data. For read-only queries projection is the way to go (even if you aren't going after navigation properties you will select the entire row without it). Instead of creating controllers to correspond with concepts in your application like a "UsersController" which contains many different methods related to a User, but containing different routes (e.g. [Route("/users")], [Route("/users/current")]), I suggest creating separate controllers to represent each of these resources - UsersController, CurrentUserController - placed inside a folder structure mimicking the route e.g. UsersController might be kept in /controllers/users, CurrentUserController in /controllers/users/current. This leaves less ambiguity as to where methods go (someone might put some method for [Route("/tickets/user"] inside the UsersController, and someone else in the TicketsController with the first approach), and also will help to keep those classes small. I also suggest to keep any objects returned from these controllers or passed into these controllers inside these same folders, rather than externally inside "/models" folder. These objects represent the relevant web resource. Ok so now my controller classes are much smaller, and they are more closely following how the web actually works. Those CQS examples are probably not needed in the vast majority of cases (there are no silver bullets - what I am saying here applies to most projects, not every project) - my get requests are like requests, and post/put/del/patch are like commands, with modelbinding already passing through the request/command objects. From here, why should I create an extra layer to enforce that all data access is performed inside? This is a lot of extra work for me, and makes the code more complex. I choose to simplify my code as much as possible, and write EF queries directly in the controllers. In lots of cases, the queries/commands used will be unique to a particular controller. In other cases I might want to be able to compose parts of queries, so in those cases I will share that code by placing the queries inside helper methods. This gives me the most simple code for the majority of cases, and in more complex cases I can abstract code away into additional classes. When changes/problems come up, I am able to quickly and easily see what is happening inside a request, rather than having to step down additional layers. As for the use of Include - there was an example given with problems of using Include which was retrieving data, where I don't think this should be done at all. When it comes to updates/inserts, then it is a case-by-case basis. Sometimes the code is best written so that it only updates a single column, without any selects. Sometimes it is best written so that a row is retrieved, then values are updated.
|
# ? Apr 30, 2015 22:58 |
|
Ciaphas posted:Is there a "correct" way to bind a text control's content to non-string data in one's model? My solution was something like this (working from memory, again...): This is the classic use case for a Value Converter.
|
# ? Apr 30, 2015 23:25 |
|
Dreadrush posted:stuff I don't even know where to start with any of this craziness. You know what makes sharing queries easy? Putting them somewhere outside of a controller in the first place. When you write unit tests for your multitude of microcontroller classes that are also doing EF, you are testing the same class and probably the same method when you test whether the user is being routed to the proper place as well as when you test whether some state change occurred in your data based on user-provided inputs. You can't make a separate project for model-related stuff to allow re-use and quick extension for other projects that might want to use the same data because you mixed your model stuff directly into ASP.NET.
|
# ? May 1, 2015 00:26 |
|
Bognar posted:This is the classic use case for a Value Converter. Thanks, I'll give it a proper look later. Seems like a lot more faff than just doing what I did, at least at first glance, though.
|
# ? May 1, 2015 00:46 |
|
Dreadrush posted:Instead of creating controllers to correspond with concepts in your application like a "UsersController" which contains many different methods related to a User, but containing different routes (e.g. [Route("/users")], [Route("/users/current")]), I suggest creating separate controllers to represent each of these resources - UsersController, CurrentUserController - placed inside a folder structure mimicking the route e.g. UsersController might be kept in /controllers/users, CurrentUserController in /controllers/users/current. This leaves less ambiguity as to where methods go (someone might put some method for [Route("/tickets/user"] inside the UsersController, and someone else in the TicketsController with the first approach), and also will help to keep those classes small. I also suggest to keep any objects returned from these controllers or passed into these controllers inside these same folders, rather than externally inside "/models" folder. These objects represent the relevant web resource. OK, man. Do what you want. I think it's nuts to use attributes to hand-configure all your routes instead of just using a convention to do it once too.
|
# ? May 1, 2015 02:04 |
|
xgalaxy posted:You should probably download and try VS Code. Because this thing is outperforming Atom for me by large margins. They don't actually use Atom-proper. They just use "atom-shell" (which GitHub hastily branded as Electron for this release) which is a cross-platform wrapper for Chrome/io.js. It's effectively from-scratch other than that base.
|
# ? May 1, 2015 02:12 |
|
Opulent Ceremony posted:I don't even know where to start with any of this craziness. You know what makes sharing queries easy? Putting them somewhere outside of a controller in the first place. When you write unit tests for your multitude of microcontroller classes that are also doing EF, you are testing the same class and probably the same method when you test whether the user is being routed to the proper place as well as when you test whether some state change occurred in your data based on user-provided inputs. You can't make a separate project for model-related stuff to allow re-use and quick extension for other projects that might want to use the same data because you mixed your model stuff directly into ASP.NET. Are you talking about mvc controllers? I am talking about api controllers here.
|
# ? May 1, 2015 03:49 |
|
Dreadrush posted:Are you talking about mvc controllers? I am talking about api controllers here. It doesn't matter. Whichever you're talking about, you're talking nonsense.
|
# ? May 1, 2015 05:10 |
|
Can anyone point me to some solid resources on authentication + authorization for web api? My client has an existing web app using SqlMembershipProvider for authentication. I have to build a mobile app (xamarin) that re-uses this authentication store. However most of the tutorials on web api 2 are all using the full OWIN + oAuth stack. They'd also like to do sliding scale session expiration. My current thoughts are to use the guide here for Basic HTTP authentication : http://www.asp.net/web-api/overview/security/authentication-filters But instead of passing username + password in every request I would roll my own (basic) session management. i.e.
Are there any obvious gaps in this approach? I would prefer to go one of the standard methods, but i'm restricted because we can't implement the new owin model and any of the generic oAuth bearer token stuff can't do sliding expiration. The token refresh looks to be way overkill as well. If I use basic HTTP auth (wrapped in SSL), then this means I can always change the auth method down the track without having to change any controller method signatures.
|
# ? May 1, 2015 07:17 |
|
I'm assuming the existing web app uses a session cookie to maintain authorization state? If so, you can just use cookies with HttpClient. It lets you set a CookieContainer, which will handle cookies like a browser would.
|
# ? May 1, 2015 14:34 |
|
So I updated my Windows 10 build to the newest one available, and got VS 2015 RC and the newest SDK drop. Now when I compile pages, I'm getting this error:quote:Error CS0535 'UserProfilePage' does not implement interface member 'IComponentConnector2.Connect(int, object, object)' AwfulForumsReader C:\Users\Butts\Documents\Other-Apps\Awful-Forums-Reader\AwfulForumsReader-UAP\AwfulForumsReader\obj\x64\Debug\Pages\UserProfilePage.g.cs 16 This is in generated code. I can implement the interface, but it's just going to get overwritten at some point. Any ideas of what's going on? EDIT: Actually I think it's an SDK issue. Drastic Actions fucked around with this message at 17:37 on May 1, 2015 |
# ? May 1, 2015 17:34 |
|
So I've got a WCF two way TCP service running in a WPF app, and clients to that service running in a Winforms tray icon app. Right now I have the client app set up to create a new service client and try to reconnect when the fault event occurs. This is supposed to make it so it automatically reconnects if there's a temporary issue communicating with the server. In practice though it causes my server app to freeze if I launch the client before launching the server. What should I be doing differently?
|
# ? May 1, 2015 19:42 |
|
I've come across a weird issue with using XDocument to read, update and save a simple XML file. The source file contains a tag with an attribute that has a value like "Randy's Hamburgers" but when loaded/saved using XDocument.Load/Save it's being rewritten as "Randy's Hamburgers" which is causing another system downstream to poo poo itself. What can I do to preserve the files exisiting encoding? Edit: I think I may have found my answer. So this would involve me doing some rewrites, which I'm not against but would like to avoid if possible. Thoughts? Dr. Poz fucked around with this message at 20:17 on May 1, 2015 |
# ? May 1, 2015 20:07 |
|
Dr. Poz posted:I've come across a weird issue with using XDocument to read, update and save a simple XML file. The source file contains a tag with an attribute that has a value like "Randy's Hamburgers" but when loaded/saved using XDocument.Load/Save it's being rewritten as "Randy's Hamburgers" which is causing another system downstream to poo poo itself. What can I do to preserve the files exisiting encoding? Example of forcing UTF32: C# code:
|
# ? May 1, 2015 20:26 |
|
Drastic Actions posted:So I updated my Windows 10 build to the newest one available, and got VS 2015 RC and the newest SDK drop. Now when I compile pages, I'm getting this error: You have a class that is derived from an interface that is not implementing a method from the interface. Why that's happening in generated code is quite honestly.. Baffling. Are there any Windows 10 specific SDK changes? Mellow_ fucked around with this message at 21:16 on May 1, 2015 |
# ? May 1, 2015 20:30 |
|
AuxPriest posted:You have a class that I derived from an interface that is not implementing a method from the interface. I figured it out, it was just a SDK screw up. I uninstalled the old version and reinstalled the new one. It works again.
|
# ? May 1, 2015 20:37 |
|
Inverness posted:You can specify the encoding you want in the TextWriter. Interesting, but this doesn't seem to be getting me to the result I'm after as it still leaves the apostrophe in a tags value. For clarity, here is the XML as it exists when I read it in using XDocument.Load: code:
code:
|
# ? May 1, 2015 20:38 |
|
Dr. Poz posted:Interesting, but this doesn't seem to be getting me to the result I'm after as it still leaves the apostrophe in a tags value. For clarity, here is the XML as it exists when I read it in using XDocument.Load: This is a different sort of encoding. Maybe the HtmlWriter or XHtmlWriter would do it automatically? I don't know. This is out of my knowledge area.
|
# ? May 1, 2015 20:43 |
|
Aw shoot, you're right. Derp! I went over the problem with a co-worker a bit earlier and they just got back to me with this solution which seems perfect for the situation.code:
|
# ? May 1, 2015 20:44 |
|
Ciaphas posted:Thanks, I'll give it a proper look later. Seems like a lot more faff than just doing what I did, at least at first glance, though. Quoting myself because now that I've done this, I see the point. Ran into a problem, though. Here's something like my code: XML code:
C# code:
Separate question. My ViewModel has an ObservableCollection<RawRecord> RawRecords. One of RawRecord's properties is Category; in my UI I want to display a distinct list of Categories that are present in the collection. I can easily work out that result into a List<int>--something like RawRecords.Select(x=>x.Category).Distinct().ToList(), I think--but I have no real idea how to bind to that. Is it possible, or am I going to have to create a separate ObservableCollection containing the list of categories I've found?
|
# ? May 1, 2015 20:49 |
|
So a product I'm working with uses WebMatrix to create and store Users/Accounts in the database. We're managing deletion of accounts with an IsDeleted flag... standard stuff. Anyone know of a way to create duplicate user accounts with WebMatrix? Say I have the user AuxPriest that is deleted and a user wants to create a fresh AuxPriest account, it will throw an exception (username already in use). Any way to allow duplicate users by checking that only one may have IsDeleted=false, ignoring those that have been 'deleted'? I figure probably not, just wondering if anyone has any advice. E: I know this is rather bad design, but what my lead dev requires, if it is possible. Mellow_ fucked around with this message at 21:59 on May 1, 2015 |
# ? May 1, 2015 21:15 |
|
AuxPriest posted:So a product I'm working with uses WebMatrix to create and store Users/Accounts in the database. We're managing deletion of accounts with an IsDeleted flag... standard stuff. Well, maybe you could rename accounts you delete with some sort of suffix?
|
# ? May 1, 2015 23:36 |
|
Inverness posted:So this WebMatrix thing identifies user accounts only by name and not with some kind of ID? That's a clever solution I'm angry I never thought of. I'll talk to my lead dev about it on Monday. We have the ability to un-delete accounts so I'm not sure why our users are having this issue...
|
# ? May 2, 2015 00:32 |
|
AuxPriest posted:We have the ability to un-delete accounts so I'm not sure why our users are having this issue... Wait. So user "BigGoon" can delete their account and then another user can come along and use "BigGoon" and then the first user can undelete and now you have duplicate usernames?
|
# ? May 2, 2015 01:17 |
|
crashdome posted:Wait. So user "BigGoon" can delete their account and then another user can come along and use "BigGoon" and then the first user can undelete and now you have duplicate usernames? Yeah that would basically be how it works unless I stop undelete if an existing user with that name exists in an undelete state. It's basically going to be a mess. But hey I don't design it, just write it. The same thing is going to be done with user groups and permissions lmao. E: to clarify, only admin users can manage accounts, they create the account and then hand them out to users.
|
# ? May 2, 2015 01:23 |
|
Hay GrumpyDoctor, Bognar, NihilCredo, thanks for answering my large file write question back on April 13. I no longer work for that organization, which is why I haven't been back here to give you fist bumps on your advice. But daps all around, I really appreciate you guys answering questions.
|
# ? May 2, 2015 04:24 |
|
|
# ? May 22, 2024 18:26 |
|
Calidus posted:So am I missing anything? This isn't right, I think. App-V is for Win32/.NET app packaging for store listings. For ObjC & Android, it's native lang support in VS + implementing portions of those platform APIs using Universal Windows apis and then you recompile that project for Windows.
|
# ? May 2, 2015 05:28 |