|
Bognar posted: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. One of my favourite ReSharper features that I think really needs to be in the base Visual Studio is the 'go to implementation'. When using DI it's basically a necessity, and I'm struggling without it.
|
# ? Jul 17, 2015 04:00 |
|
|
# ? Jun 6, 2024 11:01 |
|
Bognar posted: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. How did I never know about this!
|
# ? Jul 17, 2015 08:26 |
|
The Wizard of Poz posted:One of my favourite ReSharper features that I think really needs to be in the base Visual Studio is the 'go to implementation'. When using DI it's basically a necessity, and I'm struggling without it. For this I usually use "go to definition (F12)." I don't think it is as powerful as R#'s " go to implementation" though.
|
# ? Jul 17, 2015 08:27 |
|
Watching this discussion is illustrating my biggest problem with telling people what I like about Resharper, I can never remember which features are VS and which are R#
|
# ? Jul 17, 2015 12:07 |
|
The Wizard of Poz posted:One of my favourite ReSharper features that I think really needs to be in the base Visual Studio is the 'go to implementation'. When using DI it's basically a necessity, and I'm struggling without it. This alone is worth paying for, IMO. Wish I ever worked anywhere that used it
|
# ? Jul 17, 2015 12:49 |
|
The Wizard of Poz posted:One of my favourite ReSharper features that I think really needs to be in the base Visual Studio is the 'go to implementation'. When using DI it's basically a necessity, and I'm struggling without it. On much the same note I love the shortcut that lets you add a private field to a constructor.
|
# ? Jul 17, 2015 13:00 |
|
Anyone know why a SSL HttpWebRequest fails on an IP Address connection? I get a: code:
The weird part is that the certificate has Subject Alternative Names for the IP Address. SANs on the cert: code:
Edit: I seem to have fixed it. This blog gave me an idea: http://www.michaelm.info/blog/?p=1281 It seems that the IP Address identifier is not parsed correctly in IE and Chrome ( does now though ). Thinking that IE probably uses the same Certificate code as .Net HttpWebRequest I modified my certificate generation code to generate the following: code:
I should probably drop the apipa Ip addresses Mr Shiny Pants fucked around with this message at 17:27 on Jul 17, 2015 |
# ? Jul 17, 2015 16:54 |
|
Mr Shiny Pants posted:For this I usually use "go to definition (F12)." I don't think it is as powerful as R#'s " go to implementation" though. When you use the vanilla F12, it takes you to the definition that the context you're working in sees. So if you use a lot of DI and code against interfaces most of the time, F12 is going to take you to the method declaration in the interface, which is probably not what you want.
|
# ? Jul 17, 2015 17:22 |
|
Che Delilas posted:When you use the vanilla F12, it takes you to the definition that the context you're working in sees. So if you use a lot of DI and code against interfaces most of the time, F12 is going to take you to the method declaration in the interface, which is probably not what you want. Ah, that's why it was wonky sometimes
|
# ? Jul 17, 2015 17:25 |
|
Does anyone run into this developing universal apps, specifically on the RT/desktop side of things? I'm running VS2013 Ult. The only somewhat fix I've found is deleting the bin/obj folders in the project and restarting VS, and even that rarely works. I've disabled and uninstalled all of my non-essential addons/extensions, so that's not it. What does always work is recloning from source control, so it's something to do with the autogenned code that VS does I think. I was hoping VS2015 would fix this, but I haven't resolved all the Win10 library issues yet to see. It's frustrating not having intellisense pretty much ever for the XAML side of things.
|
# ? Jul 17, 2015 18:45 |
|
Knyteguy posted:Does anyone run into this developing universal apps, specifically on the RT/desktop side of things? I'm running VS2013 Ult. Are you talking UWP or "Universal" WinRT 8.1? You can't make UWP apps on VS2013, you need 2015. Also I'm 99% sure there is intellisense support for WinRT/UWP apps (at the very least there is with ReSharper). Also for UWP you need to be on 2015 RC. RTM won't work yet until they update the tools.
|
# ? Jul 17, 2015 18:49 |
|
Drastic Actions posted:Are you talking UWP or "Universal" WinRT 8.1? You can't make UWP apps on VS2013, you need 2015. Also I'm 99% sure there is intellisense support for WinRT/UWP apps (at the very least there is with ReSharper). Also for UWP you need to be on 2015 RC. RTM won't work yet until they update the tools. "Universal" WinRT 8.1. Yes normally Intellisense should work, but it thinks every element in XAML is invalid (very bottom gray box in the picture above). Basically the only way Intellisense works in XAML with this solution is if I reclone the entire solution to another folder and start new. It will then work until I close VS and re-open the project, at which point it will start to error out again. Sometimes deleting the obj/bin folders in the project folder, and the reopening the project will work. e: a complete picture in case I'm doing something wrong here or something, as I'm relatively new to MVVM and wpf-like projects. So it won't even recognize basic elements such as Page and Grid. Intellisense will work with the xml namespaces however (x:Name will show up, for example). e2: so I updated the SQLite runtime for both Windows 8.1 and Win 8.1 phone... and the problem may have gone away. I just did all the flag notification updates up top. Knyteguy fucked around with this message at 19:40 on Jul 17, 2015 |
# ? Jul 17, 2015 18:59 |
|
Hi all. Preface- I'm know a tiny bit of C# and VB.Net but one thing I never wrapped my head around before switching my 4-year to project management and system administration from programming is asynchronous threads. I have the following code- code:
LiterallyAnything fucked around with this message at 20:00 on Jul 17, 2015 |
# ? Jul 17, 2015 19:49 |
|
Brady posted:Hi all. Preface- I'm know a tiny bit of C# and VB.Net but one thing I never wrapped my head around before switching my 4-year to project management and system administration from programming is asynchronous threads. Why do you want it Async? Waiting for user input is inherently synchronous right? Execution should stop because you need something from the user.
|
# ? Jul 17, 2015 20:08 |
|
That wouldn't be threaded code anyway. When you use async/await in a GUI application, the default behavior is to capture the current synchronization context (the UI thread) and execute everything on there.
|
# ? Jul 17, 2015 20:24 |
|
Che Delilas posted:When you use the vanilla F12, it takes you to the definition that the context you're working in sees. So if you use a lot of DI and code against interfaces most of the time, F12 is going to take you to the method declaration in the interface, which is probably not what you want. I never used to mind this when I was using Ultimate, as visual studio would have a nice down arrow beside the declaration in the interface and clicking it would bring up a list of all implementations. In anything below Ultimate you get the up arrow beside the implementation to take you back to the declaration, but not the other way around.
|
# ? Jul 17, 2015 20:26 |
|
Mr Shiny Pants posted:Why do you want it Async? Waiting for user input is inherently synchronous right? Execution should stop because you need something from the user. Honest answer- I have no idea. I don't know crap about how to use Async so if anyone has any recommendations for materials specifically geared towards that subject I'd love to educate myself. Right now I'm trying to wrap my head around the MSDN materials but I feel like I need a primer. But anyway no, the application just keeps going. I'm guessing if I made a pop-up prompt for the password the execution would stop but I didn't want to go that route. Ithaqua posted:That wouldn't be threaded code anyway. When you use async/await in a GUI application, the default behavior is to capture the current synchronization context (the UI thread) and execute everything on there. This is good to know. So if I shouldn't be using await, what should I be using? Is this even possible given the way my current code is written or do I have to change that function and break it up? Edit- Wait... is it really THIS simple? var name = Console.ReadLine(); ...although in my code since it's not the console and it's an input box in the GUI named "messageTextBox" I changed that line to "var name = messageTextBox.ReadLine();", but ReadLine is not part of TextBox. LiterallyAnything fucked around with this message at 20:46 on Jul 17, 2015 |
# ? Jul 17, 2015 20:36 |
|
Brady posted:Honest answer- I have no idea. I don't know crap about how to use Async so if anyone has any recommendations for materials specifically geared towards that subject I'd love to educate myself. Right now I'm trying to wrap my head around the MSDN materials but I feel like I need a primer. Yep, it is that easy. I can't imagine why you would want an async input, as one would hope the rest of the process would be blocked until it obtained the input data it needs to continue from the user.
|
# ? Jul 17, 2015 20:51 |
|
AuxPriest posted:Yep, it is that easy. I can't imagine why you would want an async input, as one would hope the rest of the process would be blocked until it obtained the input data it needs to continue from the user. Hmm, the thread still continues even after adding that though. I'm guessing it's because I'm not trying to read the text from a console window, but instead I'm wanting to wait until the user clicks "send" after entering a string in the messageTextBox. Does the fact that the entire function is async have anything to do with it? Edit- I guess I could add a while statement in there that loops until the send button is clicked... LiterallyAnything fucked around with this message at 21:01 on Jul 17, 2015 |
# ? Jul 17, 2015 20:57 |
|
Brady posted:... Then on one special input "Brady" you want it to query for a password? If that is the case, I see two ways of doing that:
|
# ? Jul 17, 2015 21:06 |
|
SirViver posted:I'm greatly confused by your code. What is your application supposed to do / what does it look like? The only thing I can think of it that it has a console/chat-like window (the RichTextBox) and a separate textbox messageTextBox which calls SendMessage() once you press enter or hit a send button? Correct. The app is essentially a client to server communicator. Another goon is creating all the key parts of the application and I'm messing around with certain functionality that I need added (while hopefully not screwing up anything that he's doing along the way). SirViver posted:If that is the case, I see two ways of doing that: I like the first option best. I know I can call a message box which will pause the thread and have the user enter it that way, but I'm wanting them to enter it in the same input box as everything else. In order to implement what you said, how would I code it to wait for the next "sendMessage()" event? Or, do I return from that function and then... you know what, I think I got it. Thank you all for all your help!
|
# ? Jul 17, 2015 21:21 |
|
Brady posted:Correct. The app is essentially a client to server communicator. Another goon is creating all the key parts of the application and I'm messing around with certain functionality that I need added (while hopefully not screwing up anything that he's doing along the way). Okay, why does this need a GUI? Why can't this just be a console app?
|
# ? Jul 17, 2015 21:26 |
|
Drastic Actions posted:Okay, why does this need a GUI? Why can't this just be a console app? It's going to be used by all sorts of users in the end and there's a lot more parts to it than I mentioned. I was just giving information that was relevant to my question. Edit- Thanks again everyone. Got it working the way I wanted. Here's the solution. I thought there would be something more elegant (such as the Console.ReadLine method), but this is just fine- code:
LiterallyAnything fucked around with this message at 21:50 on Jul 17, 2015 |
# ? Jul 17, 2015 21:30 |
|
Hi all! I'm in the midst of porting/integrating old code with C#. While I've used C# before, this is my first time I've done low-level integration with C#, although I've done it in Objective C and Java via JNI. I went back to some of the documentation I read, but it's unclear on some things. 0) fixed() is pretty snazzy for a single call to old code, but is there a way to create a memory block that is essentially fixed for life? 1) Are structs in C# laid out the same way they are in C? 2) BitConverter uses the endianness of the machine it's on. Is there a way to use network byte order? 3) Is there any way to do conditional thread locks, similar to NSConditionLock in Objective C?
|
# ? Jul 17, 2015 22:12 |
|
Small White Dragon posted:1) Are structs in C# laid out the same way they are in C? I don't know the answers to your other questions, but the answer to this one is "no".
|
# ? Jul 17, 2015 22:34 |
|
Small White Dragon posted:2) BitConverter uses the endianness of the machine it's on. Is there a way to use network byte order? You can use the static helper method IPAddress.HostToNetworkOrder: https://msdn.microsoft.com/en-us/library/653kcke1.aspx Or you can manually check BitConverter.IsLittleEndian.
|
# ? Jul 17, 2015 23:05 |
|
Small White Dragon posted:2) BitConverter uses the endianness of the machine it's on. Is there a way to use network byte order? I've always used something like this: code:
|
# ? Jul 17, 2015 23:08 |
|
Ugh, this isn't .net specific (I don't think), but when I connect to a url via a web client, it returns a 500 internal server error. I can visit that URL in my browser just fine. This was working for months and the problem started yesterday. Example url: http://www.myfitnesspal.com/reports/printable_diary/chuckgross?from=2015-07-17&to=2015-07-17 The code: code:
Using Fiddler, I'm seeing a page returned that is their "Site Down" page with the message: "Sorry, but a server error occurred processing your request. Our team has been notified of the issue". Is there anything that I can do given that the URL itself works fine in a browser? Any alternative ways to try to troubleshoot? Edit: This fixed it: client.Headers["User-Agent"] = "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)"; Uziel fucked around with this message at 15:18 on Jul 18, 2015 |
# ? Jul 18, 2015 14:09 |
|
Uziel posted:Ugh, this isn't .net specific (I don't think), but when I connect to a url via a web client, it returns a 500 internal server error. I can visit that URL in my browser just fine. This was working for months and the problem started yesterday. You could try setting your webclient useragent with one from a browser and see if that works. Could be that they filter on useragent string.
|
# ? Jul 18, 2015 15:18 |
|
Mr Shiny Pants posted:You could try setting your webclient useragent with one from a browser and see if that works. Could be that they filter on useragent string.
|
# ? Jul 18, 2015 17:58 |
|
Small White Dragon posted:0) fixed() is pretty snazzy for a single call to old code, but is there a way to create a memory block that is essentially fixed for life? quote:1) Are structs in C# laid out the same way they are in C?
|
# ? Jul 18, 2015 20:40 |
|
I am writing a F# program and need a timer. What is a good timer for F#? In C# I have used the RX observable.FromTimespan with good results, but RX is pretty ugly to use in F# because of the overloaded nature of most methods. Is System.Timer the best? I saw one using a MailboxProcessor with do! async sleep in it which I thought was pretty funky.
|
# ? Jul 18, 2015 23:58 |
|
Mr Shiny Pants posted:I am writing a F# program and need a timer. What is a good timer for F#? How do overloaded methods make it ugly to use?
|
# ? Jul 19, 2015 06:10 |
|
GrumpyDoctor posted:How do overloaded methods make it ugly to use? I've tried to use it in a simple way as I did from C# and the compiler would usually go: Error 1 Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. So you have explicitly tell it which version of the method you want to use and nudge the compiler in the right direction. After first figuring out what the explicit types are. Maybe I should take another look.
|
# ? Jul 19, 2015 09:44 |
|
Mr Shiny Pants posted:I am writing a F# program and need a timer. What is a good timer for F#? Have you read this implementation with Timer and (F#) Observable? It doesn't look particularly ugly to me.
|
# ? Jul 19, 2015 11:40 |
|
Mr Shiny Pants posted:I've tried to use it in a simple way as I did from C# and the compiler would usually go: Error 1 Lookup on object of indeterminate type based on information prior to this program point. A type annotation may be needed prior to this program point to constrain the type of the object. This may allow the lookup to be resolved. I'm curious to see some example code, because I've never encountered a situation in F# where I needed more type annotations than corresponding C# code.
|
# ? Jul 19, 2015 12:04 |
|
I don't have examples ready, but I tried converting my C# ToObservable code and it was really awkward. Any operation that takes a func might be a good example. I found this on stackoverflow: http://stackoverflow.com/questions/8777975/f-rx-converting-async-patterns-to-observable-sequences The problem is really that I've used Rx for more than just a timer in my C# code, but to just take on the dependency for a timer is maybe a bit much. I might just try it again, sometimes leaving something for awhile and returning to it after a time works best. NihilCredo posted:Have you read this implementation with Timer and (F#) Observable? It doesn't look particularly ugly to me. I might try this, thanks. Edit: Another question: How can you download multiple files from a webserver in one request? Is there something like multipart/formdata for downloading? Or would zipping the files be a better option so you get one file? Mr Shiny Pants fucked around with this message at 12:25 on Jul 19, 2015 |
# ? Jul 19, 2015 12:17 |
|
Mr Shiny Pants posted:The problem is really that I've used Rx for more than just a timer in my C# code, but to just take on the dependency for a timer is maybe a bit much. This was the other thing I was thinking.
|
# ? Jul 19, 2015 12:25 |
|
Inverness posted:Unless you mean some sort of operating system construct like shared memory, no. The GC needs to be able to move stuff around in memory. It doesn't have to be shared memory. You could allocate unmanaged memory and the GC won't touch it. Small White Dragon posted:0) fixed() is pretty snazzy for a single call to old code, but is there a way to create a memory block that is essentially fixed for life? Take a look at Marshal.AllocHGlobal(): https://msdn.microsoft.com/en-us/library/s69bkh17.aspx Only do this if you have no other choice though.
|
# ? Jul 19, 2015 17:51 |
|
|
# ? Jun 6, 2024 11:01 |
|
epalm posted:
I can confirm that I experience the same type of random interruptions multiple times a day. 10 GB database, quite low load (average 1 request per second). Funny thing is that SqlAzureExecutionStrategy does not catch all of the random errors! We had to add some custom retry logic on top for whatever reason, to really make it retry on all the retry-worthy cases. Overall, though, going the retry logic route has worked fine for us. It is a bit disconcerting coming from an oldschool "What do you mean it goes down arbitrarily?!" perspective but I suppose it's a good way to ensure the app is fault tolerant The limit on manual transactions has not proven to be an issue so far, since I have taken care not to introduce any to the application. Perhaps you can re-engineer your app not to require them? EssOEss fucked around with this message at 11:43 on Jul 20, 2015 |
# ? Jul 20, 2015 11:41 |