|
ljw1004 posted:Oh! It looks to me like it will do what the comment claims... Could you talk through your reasoning? Not the op, but what I think happens is: the runtime calls dispose right before garbage collection. It doesn’t know to wait for the thread to complete. Race condition ensues, program blows up.
|
# ¿ Jan 22, 2020 20:51 |
|
|
# ¿ May 21, 2024 00:37 |
|
Maybe, but the op mentioned in this, or another thread that his service was crashing intermittently with an exception related to dispose, and he said he tracked it down to this method. My guess is some kind of race condition.
|
# ¿ Jan 22, 2020 21:42 |
|
You could just use a Tuple as a key and have one dictionary.
|
# ¿ Jan 30, 2020 11:03 |
|
Why don’t you just import the certificate you’re using into the system certificate store? Chrome should then trust it by default. Alternatively, I think there’s a way to launch chrome in an insecure mode. Google tells me —allow-running-insecure-content. You could try that. Jen heir rick fucked around with this message at 03:52 on Apr 7, 2020 |
# ¿ Apr 7, 2020 03:43 |
|
NihilCredo posted:This. His code is fine, or close enough. The problem is that he's testing it using Swagger (I assume he means Swagger UI), which doesn't have a file upload button, just a text field that becomes the request body. You can get swagger ui to display a file button with the right annotations, but it requires a bit of futzing about depending on what version of swashbuckle you’re using. Assuming he’s using swashbuckle.
|
# ¿ May 19, 2020 19:56 |
|
Revalis Enai posted:
302 is a redirect, look at the response header and see what it’s trying to redirect to.
|
# ¿ May 20, 2020 01:11 |
|
Revalis Enai posted:I looked at the header for Clear.aspx from both sites and only the live server shows a location It’s trying to redirect to an error page, but Ajax calls won’t follow redirects. You should try making the same call using Postman.
|
# ¿ May 20, 2020 11:27 |
|
Supersonic posted:
I don’t think you need to create a new thread. I looked at the Naudio example for winforms, and they aren’t creating a new thread with Task.Run, they just call Play and subscribe to the playback stopped event to dispose of the outputDevice. You should do something like that.
|
# ¿ Oct 28, 2020 02:23 |
|
LongSack posted:Was not aware. I will adjust my behavior accordingly. I just started using Dapper after long-running frustrations with EF Core. You can use Sql Server Profiler to see requests happen in realtime. But also, Dapper does not work this way. The way you can tell is if the method returns an IQueryable. QueryAsync returns an IEnumerable. Which means that all of the results are returned in one go and held in memory.
|
# ¿ Mar 15, 2022 19:50 |
|
insta posted:That is absolutely not how IQueryable or IEnumerable works. It's not? How so?
|
# ¿ Mar 15, 2022 20:22 |
|
I don't see how all that contradicts what I said.
|
# ¿ Mar 15, 2022 20:46 |
|
insta posted:Because you said it holds it in memory, and unless you specifically tell Dapper to do that, Dapper will instead return the items one-by-one from the database reader instead of holding them in memory. I see what you mean. What I meant was that it holds onto the values once you iterate over the IEnumerable and does not retrieve them from the database again. I just tested this by calling QueryAsync and then iterating over the result set twice. I had Sql Server Profiler running and it only recorded a single query to the database. I don't think that code you posted is correct. I dissasembled the code using Linqpad (Linqpad allows you to jump right to the definition of a method) and it looks like it is executing a reader and holding on to that. Maybe I'm using a different version.
|
# ¿ Mar 15, 2022 21:11 |
|
insta posted:Check the underlying return type of the object, if you can. Dapper has a Buffered option that will fill a List and give you the List, which can be iterated over repeatedly without a second query, but it's still IMO dangerous in that flipping a boolean somewhere can cause multiple queries to start executing again. Just checked this. It is returning a List object whether or not you specify the Buffered option or not. If you do not pass in Buffered=true then upon the second iteration you will get the error: Invalid attempt to call Read when reader was closed. Additionally the query is executed as soon as I call QueryAsync. Not upon iteration. When you iterate it's just calling the data reader methods. I also made sure I'm using the latest version of Dapper.
|
# ¿ Mar 15, 2022 21:41 |
|
You can also use the Timer class to raise an event every n seconds.
|
# ¿ Jun 1, 2023 12:39 |
|
I don't know how these open source guys do it. I have little patience for bullshit. The first time somebody opened an issue and got snippy with me I'd be like "Ok, I'm out. Good luck with this". Or maybe I'd amend the license to ban that person in particular from using it. I'm not good with people.
|
# ¿ Aug 11, 2023 13:15 |
|
|
# ¿ May 21, 2024 00:37 |
|
CapnAndy posted:Yeah, I know. I'm specifically wondering if I should do a hybrid app because it's likely that Microsoft will put more pressure on in the future to turn everything into Blazor -- because, like I said, I can see the benefit of literally everything being one codebase and they'll just compile it differently for us. If they're gonna, I'll go with it, but if they're not gonna, I really don't want to. I hate writing web apps and wish I could write native apps, but it seems like the world is moving to hybrid/web type apps. The economics are just too good. You can have a single team write an app that works on android iOS, macOS, Linux, and windows. You just can't beat that with native apps. You need a team or developer for each platform. The suits just aren't gonna pay for that. Even if the result is a shittier experience. People will get over it. poo poo sucks yo.
|
# ¿ Apr 25, 2024 20:14 |