|
Bognar posted:Unfortunately there's not an easily accessible C# REPL yet. You could use the F# interactive console in Visual Studio: What? There's no need to use the F# console. This is basically what the Immediate Window is for, but you do have to be debugging.
|
# ¿ Jul 25, 2014 16:15 |
|
|
# ¿ May 8, 2024 03:23 |
|
This is a sort-of .net question, but more of a xaml/winrt question. I have a Windows Phone 8.1 app, and I have a page with a listview using a wrapgrid for layout to display grid cells. I have a tap event hooked up in the item datatemplate, which triggers a frame navigation to another page. What I want to do is set up a page transition so that the effect achieved is similar to the Windows Phone start screen app-tap navigation, where the thing you tapped delays for a hundred milliseconds or so before sweeping away. I looked at ContinuumNavigationTransitionInfo and CommonNavigationTransitionInfo (particularly whether IsStaggerElement would be the solution) and I cannot for the life of me figure out how to set this stuff up. I also can't find any good tutorials and of course MSDN is terrible.
|
# ¿ Aug 19, 2014 16:49 |
|
Ithaqua posted:A note: It's generally a bad practice to subclass collections. Aside from the non-generic subclass, I'll give the benefit of the doubt to anyone subclassing ObservableCollections since the base class is so irritating. Who's using OC<T> and NOT subclassing it?
|
# ¿ Aug 22, 2014 18:20 |
|
This is ObservableCollection<T>: Why is PropertyChanged protected, instead of public like CollectionChanged? What if I want to be notified when the Count property changes? As I currently want to, since I'm implementing ISupportIncrementalLoading. These questions are mostly rhetorical, I'm just once again irritated by OC<T>.
|
# ¿ Aug 28, 2014 03:55 |
|
Mr. Crow posted:Of all the reasons to hate OC<T> that seems like the silliest. It's the inconsistency that's depressing. I was giving my example case to preemptively head off "but why would you ever want that" questions I sometimes get from Microsoft people when I try to build things with their broken APIs.
|
# ¿ Aug 28, 2014 14:54 |
|
What's a good technique to parallelize a recursive, async retrieval task? Bear with my as I haven't fully thought this out. I'm loading hierarchical items (folders of items & folders) from a remote resource, and there's wait time associated with getting a folder's children. My current solution works perfectly fine... it's basically naively recursing folders. Looks something like this (substantially simplified):code:
Maybe some kind of producer/consumer queue, capped with a particular degree of parallelism? Then push folders into it, get back children at some point in the future, evaluate them into more queue insertions? That's getting more complicated. Factor Mystic fucked around with this message at 04:25 on Sep 5, 2014 |
# ¿ Sep 5, 2014 04:23 |
|
ljw1004 posted:"Balloon the number of threads" is a surprise to me. The await operator doesn't create new threads. Task.WhenAll doesn't create new threads. The general principle is that no keywords in C# create new threads, and only a few specific clearly-identified functions like "Task.Run" will allocate anything on the threadpool. So where did your mysterious ballooning threads come from? I don't know. There might have been other threads being used under the hood, due to misbehaved APIs, but it's hard to know without a debugger. I don't know either. Perhaps I was misreading the my debug print statements, which also print the current Environment.CurrentManagedThreadId. Normally the highest id's I see are 7-8. With the WhenAll approach, the id's climbed steadily up into the 80's before I killed the process. I suppose my report could be inaccurate if the managed thread id doesn't reliably indicate which native thread is running and could tick higher even when reusing the same native thread at a later point, but poking around the reference source sure seems to imply that it's referring to a native thread. ljw1004 posted:Stepping back, let's examine the problem from a theoretical angle. By the time your algorithm completes you will have issued "N" total calls to the remote resource and they will have completed. No amount of parallelization will ever change this total number "N". This detailing of my situation is pretty accurate. I also do not know the optimum number of parallel requests, nor the behavior of the service when overloaded. It is undocumented, as far as I can tell. I suspect that the number of allowable requests is greater than 1, so some form of parallelization seemed to be plausible to reduce the total overall time. ljw1004 posted:The best practical answer, one that works great in most situations, is just pick a number. Let's say "3" parallel requests. If the server takes time "t" for each request, then you'll finish in about N*t/3. Yes, this seems like the most obvious approach, however I believe it'll be preferable to run queue consumption on another thread. (A detail which I left out of my example case is that this code is already running on a background Task thread, not on the UI thread. Since this is really more of a patterns question, it didn't seem super relevant. The reason is UI responsiveness. The OC<T> in my example is not databound in the UI. Not relevant details for a pattern question). ljw1004 posted:Here's another solution for throttling based on the "Dataflow" library from Microsoft. Dataflow is powerful and you can wire it up in more sophisticated ways. It runs the callbacks on the threadpool. But again, you're still turning the recursive thing into something queue-based. Thanks for the advice. It looks like a queue is the way to go in any case.
|
# ¿ Sep 7, 2014 18:08 |
|
ljw1004 posted:I'm not sure which reference source you're looking at? The .NET reference source only says that the getter of CurretManagedThreadId is "extern". In any case, when you look at the debugger window, you usually see higher CurrentManagedThreadId than there are threads. This proves either that your way of testing isn't accurate or that the VS debugger fails to show all threads. I reckon the way of testing isn't accurate Ok, fair enough... I acknowledge that eyeballing thread id's is not a reliable way of reporting the number of threads in use by a program. I restored the WhenAll code from before, turned on the Threads window, and set a conditional breakpoint to break if the managed thread id >= 80. Now we can get a more accurate picture of what was actually happening when I said I thought the number of threads was ballooning Ok I was a little off. ljw1004 posted:I reckon there's almost never a good reason to run your work on a background thread, and lots of bad reasons. Here are slides from a recent talk I gave to the Windows XAML team: I know who you are, and I appreciate you time replying. I also understand that what you're saying SHOULD be the case, and I SHOULDN'T need to run this op on a background thread to avoid UI glitchyness. And in fairness, the code has gone though several iterations and improvements from when I first noticed the issues, so to make sure I wasn't wasting everyone's time I went back and cloned the current background thread method (accepts a TaskCompletionSource so the UI-caller can await it anyway) to a normal "async Task<T>" method, and awaited it like normal. Glitchy. It's kind of hard to put meaning on behind that word... it's mostly related to touch latency, I suppose. As in, swiping pivot headers on a rhythm will be slower/unresponsive than when using the background thread approach. I feel like there's an obvious explanation for this, and that is that it's not about the awaitables, it's that there's unexpectedly long blocking methods acting up here. I can't really nail it down (and this particular aspect of the program has already be "solved", so it's not a showstopper), but I do have two more data points: 1- Dynamic objects are involved. They're the actual response objects from my slow remote resource API. I'm plucking properties out of them into a normal statically typed class for the layer of the app we've been talking about. 2- The ui/touch latency is MUCH higher when using the WhenAll approach. To me this implies some kind of resource starvation scenario.
|
# ¿ Sep 8, 2014 00:05 |
|
Jewel posted:I've never used NuGet before but I think I did it..? https://www.nuget.org/packages/Betwixt/ Something goes wrong when I try to install it into a new project: code:
|
# ¿ Sep 28, 2014 19:54 |
|
Jewel posted:I have no idea what nuget wants from me, I've never personally used it and it's weird; can anyone help? Cool, 1.3.3 installs. Suggestion: your example in the github readme should be "new Tweener<float>" (missing the type param). Also, does it make sense to add some additional overloads to Update for other numeric types (eg, double?). Perhaps the time deltas you normally deal with are always floats and never doubles in which case carry on. Adding a double overload would mean I can just pass it "0.1" and not "0.1f", which is pretty minor all things considered. I got this problem compiling a fresh project with your readme example: quote:There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Betwixt", "x86". I had been targeting AnyCPU, so I switched it to x86. Then it threw a FileNotFoundException: quote:System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
|
# ¿ Sep 29, 2014 01:42 |
|
Jewel posted:I think that's saying it can't load .Net 3.5..? Maybe you're on 2.0 or something? I'm usually in the gamedev department so I'm not used to these kind of problems, because usually my code isn't shared It was a Universal App. I tried Betwixt on a desktop .NET 4.5 app and it worked fine*, but that leads me to another question: Any reason this can't be a PCL? * = the code from your readme "settles" on 10.00488. I would've expected that a tweener with an end value of "10" would not actually end with a value greater than 10. Maybe during an elastic bounce or something, but not after it's finished. Without a lot of gamedev experience, I can't tell if this is normal or not.
|
# ¿ Sep 29, 2014 02:35 |
|
My main project at work is a from scratch rewrite of an old, massive database application, and I'm doing it as an effective SPA with Ractive.js. Controllers are json API providers to the "real" backend. It's actually a rails app, but you were asking about the frontend. I like Ractive and the project is shaping up well.
|
# ¿ Sep 30, 2014 21:55 |
|
GrumpyDoctor posted:Yeah, I thought of this too, but it's still a huge pain in the rear end compared to some hypothetical way to say "No, really, this changed, I promise you." Heh, the default OC<T> claims another victim. Welcome brother.
|
# ¿ Oct 7, 2014 01:57 |
|
ljw1004 posted:For .NET, it's going completely open source. The .NET team will do their development (checkins, bugs, ...) all in the open. If for whatever reason you wanted to package up your own tweaked version of System.Xml.dll with your app, say, you'll be able to do that. Interesting. Time to think about a pull request for ObservableCollection<T>, perhaps. ljw1004 posted:For WPF, it has a solid roadmap for the future. YAY! And I see performance is an area of focus thank goodness. To be honest I'm much more excited about this WPF post than I am about .NET being open source.
|
# ¿ Nov 12, 2014 20:38 |
|
GrumpyDoctor posted:While we're on the subject, is there some reason that the strategy of avoiding null-checking PropertyChanged via assigning a no-op delegate on construction hasn't gotten more traction? Is there some serious penalty to it that I'm unaware of? It's minutely slower. I always initialize my events as "public event EventHandler OnButtz = delegate { };". Harder to get snagged on event related rough edges.
|
# ¿ Nov 16, 2014 22:09 |
|
The discussion on the roslyn repo is really interesting, I recommend checking it out. I'm particularly interested in watching the discussion & work on destructible types and method contracts. Fascinating.
|
# ¿ Feb 4, 2015 03:40 |
|
Drastic Actions posted:Since we don't have a Windows Store specific thread, I'll guess I post this stuff here :shurg:. Microsoft talked a little bit about Windows 10 universal apps at MWC. Some of the Windows Phone APIs are going to be deprecated and made consistent with Windows itself. So DoSomethingAndContinue will be going away . It also seems like there will be more to have true cross-platform XAML support, with hopefully less conditional "#if WINDOWS_PHONE_APP" logic and more XAML solutions. They also showed off Xbox One Universal apps as well. Is there a source what what WP APIs are dead?
|
# ¿ Mar 4, 2015 03:52 |
|
amotea posted:I wish they'd just fix and improve WPF, and not reinvent the wheel over and over again. There is no viable alternative for desktop applications right now. 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. And man you are behind the times wrt Silverlight. Browser plugins are dead, completely. Much better js runtimes & mobile killed it. It was a neat idea in its time but c'mon.
|
# ¿ Apr 30, 2015 03:30 |
|
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 |
|
ljw1004 posted:PS. I'm due to give some Microsoft internal training talks on UWP app development in .NET, and the new CoreCLR and NuGet stuff. If you have further questions I'd love to hear them so I can incorporate the answers into my talks . I'll make public versions of the talks too. Here's a question: I don't understand how to target .NET Core in VS 2015. I had expected to see it in the framework dropdown on the 'New Project' screen, along with all the full .NET versions, but it's not there. I've googled but I don't know what the appropriate incantation is. This only shows command line tools. The 'More Frameworks' link doesn't say anything (and ps- the url implies I clicked this from 2013, but it was 2015). Is this something that will only be possible after the 29th? Factor Mystic fucked around with this message at 02:04 on Jul 26, 2015 |
# ¿ Jul 26, 2015 02:02 |
|
ljw1004 posted:Today in VS2015 you can do File>New>C#>Web>ConsoleApp/ClassLibrary. These are still in preview. "File>New>C#>Web>ConsoleApp/ClassLibrary" doesn't show .NET Core in the New Project window, but I see I can switch over to it in project properties. That's a bit weird but I can deal. Not sure why normal desktop Console apps couldn't target .NET Core the way a "web" Console app can.
|
# ¿ Jul 27, 2015 01:38 |
|
Gul Banana posted:it's due to legacy and IP I know all that, perhaps you misinterpreted my statement. I'm not expecting that WPF or Winforms or a Full Desktop Console app be able to be targetted to .NET Core. I AM expecting that for certain project template types, I would be able to target .NET Core... for example, Console apps and Library (dll) projects as previously stated. This is part of where my confusion was, because even though "Web" Console/Library projects CAN target .NET Core, you CANNOT pick it from the "Framework" list in the New Project dialog. Furthermore, I'm not sure what differentiates a "Web" Console/Library project from a "Windows" Console/Library project except that the former can target .NET Core & the latter can't even though a "Web" Console/Library certainly will work on WIndows. If I want to make a Console app that works on Windows and also works on Linux, and I want to build this thing in VS2015, currently I have to make a "Web" Console app targetted to Full .NET 4.6, then go into project properties and retarget it to .NET Core. This is confusing and irritating. Hence my question, why can't a "Windows" Console app retarget to .NET Core the way a "Web" Console app can. Is what's actually going on here a project file format selection? So if I go "Web" I get project.json and if I go "Windows" I get mything.csproj? And then what is changing on the 29th?
|
# ¿ Jul 27, 2015 18:36 |
|
.NET 4.6 Winforms question: How do I disable DPI scaling for my app? (Or alternately stated, tell the system that my app is DPI aware and does not need to be auto scaled?) Things I have tried:
None of these work. Windows is still scaling my app on high DPI displays. What does work is manually setting the application compatibility flag "Disable display scaling on high DPI settings". I feel like reaching into that location in the registry and fidding with that is not a great deployment story.
|
# ¿ Oct 4, 2015 22:28 |
|
ljw1004 posted:If you're starting out development on a new app now, and if the sandbox limitations don't matter, you should be looking at UWP. A couple questions on this a) Is it possible to create a system tray icon? This is impossible in pure WPF. b) Is it possible to make a UWP app look like a "normal" windows program? I guess what I'm asking about is like gdi common controls style. Everything in WPF looks weird (ie, not like an ancient windows program) because it rendered everything itself. I don't really view that as a plus. Not to mention the fuzzy rendering.
|
# ¿ Oct 12, 2015 23:44 |
|
Factor Mystic posted:.NET 4.6 Winforms question: tunah posted:Have you tried setting AutoScaleMode to "None" on the Form itself? I forgot to say it, but yes, I tried that too. Nothing I have been able to do from within the app has managed to allow me to position the form in real coordinates.
|
# ¿ Oct 12, 2015 23:45 |
|
ljw1004 posted:It's not possible for a UWP app to have a system-tray icon. ljw1004 posted:Your UWP apps won't have fuzzy rendering. But they'll never end up looking like traditional "ancient" user32/gdi32 apps. It's good that xaml rendering is no longer as busted, I guess. I know it makes me sound like a luddite, pining for GDI looking controls, but I hate that desktop apps now look like websites. Hate hate hate. I'd really rather just not build an app with that stack at all if that's what it's going to look like. On the other hand, maybe it's all in the design finesse. I like VS 2015 a lot, so if that's a xaml app then it's a strong vote of confidence for the architecture.
|
# ¿ Oct 13, 2015 15:48 |
|
Munkeymon posted:Then how has dotnetpad been doing it all this time? That guy used to follow this thread IIRC https://github.com/Gobiner/DotNetPad/blob/master/Gobiner.DotNetPad.Runner/Program.cs#L30
|
# ¿ Mar 29, 2016 22:00 |
|
|
# ¿ May 8, 2024 03:23 |
|
Inverness posted:I'm keeping an eye on how the new code generator extensions for the compiler are progressing. I realllllly don't like replace & original but I can't verbalize why clearly. Probably because it'll end up being used for more than machine generated code & it's too large an indirection to instantly grok.
|
# ¿ Apr 5, 2016 03:28 |