|
Get the Git Extensions and download the sourcecode provider for VS. Works pretty much as it should.
|
# ¿ Jun 20, 2014 21:40 |
|
|
# ¿ May 2, 2024 13:10 |
|
hirvox posted:If you are certain that your code will output valid XML, you should just write each line to the file as soon as you have generated each snippet. That way you'll only need to have one copy of the data (the DataTable) in memory at any time. The way you're doing it now you'll have at least four copies: The DataTable, the StringBuilder, the String itself and finally the XmlDocument. Yep, a stringbuilder with a textwriter and append each line to a new file. Read the file afterwards if you need it again. ^^ Nevermind
|
# ¿ Jun 27, 2014 09:47 |
|
Have you tried a bufferedstream? Something like: code:
|
# ¿ Jul 2, 2014 05:44 |
|
I've used the MemoryCache before. It works as advertised. See: http://msdn.microsoft.com/library/system.runtime.caching.memorycache.aspx You create a cache, put items in it and in your application that loads the resources you create the logic to check the cache first. Please be aware that you can't depend on your files always being in the cache, if your machine gets low on memory it will purge some of the items in the cache.
|
# ¿ Jul 9, 2014 08:42 |
|
Begby posted:I have an issue that is driving me absolutely bonkers. Can the server download a CRL? Does it have access to the CRL? Sounds like it does a check after awhile and can't validate the chain or something. One thing you can test is to download the certificate and use the windows Certutil utility to check if you can build the certificate chain. It uses the exact same apis as .Net does so any error should also turn up in there. Another thing: Is the service running as a user and does it have the rootcerts in its own cert store?
|
# ¿ Jul 11, 2014 16:06 |
|
TheEffect posted:I think this is the correct thread... Total newbie at VB. You should create the folders within VS solution and tell it to copy the solution files "always". The copy option is within the file properties of the file you want it to copy.
|
# ¿ Jul 23, 2014 20:50 |
|
RICHUNCLEPENNYBAGS posted:No, not until it produces results that are close to what I intended. This.
|
# ¿ Jul 31, 2014 13:48 |
|
The new Identity stuff in MVC 5 is complex. Been trying all day to wrap my head around it and finally got it working. Owin and all the other stuff is totally new and the documentation doesn't make it any better. Now to write my own userstore and the like pffff.
|
# ¿ Aug 3, 2014 20:04 |
|
Bognar posted:We attempted to use it for a recent project, but ultimately we threw it out and rolled our own like we have done for years. I wish MS would get away from trying to provide the "one identity solution to rule them all" and instead just provide sane defaults for password hashing, password requirements, and default functionality for email validation, password resets, and the like. Yeah I get what you mean, they are always trying to be all things to all men. See WPF, you can do almost anything with it but there are no "slick" standard controls a la OSX.
|
# ¿ Aug 4, 2014 05:02 |
|
What I found really annoying when first reading about it is that a lot of it is intertwined with Entity Framework without making it really clear what does what and why you'd need it. I have it working with Redis now Yay me!
|
# ¿ Aug 4, 2014 14:20 |
|
So after getting the Identity stuff to work I am looking for some advice for building it out for my own webapplication. My users have some extra attributes like street, country etc. What would be my best option: 1. Extending the existing application user class with my own attributes. In effect having one user class in the whole of my application. 2. Create another table and link the application user (entity) to the username? I like option 1 but 2 is also doable. Mr Shiny Pants fucked around with this message at 17:09 on Aug 4, 2014 |
# ¿ Aug 4, 2014 17:03 |
|
wwb posted:In general my experience has been one is best left leaving the authentication bits as a functional black box and then keeping your app's data (like demographic / address info) in data stores tied to my app. We typically go so far as to keep that asp.net databases as a physically separate DB as we don't like schlepping user logins back to developers. Yeah this is exactly why I asked it, the new stuff seems built for extending and it keeps everything nice and tidy. I am just not sold on it, on the other hand it is exactly how something like AD is structured.
|
# ¿ Aug 4, 2014 18:28 |
|
RICHUNCLEPENNYBAGS posted:There's no reason at all to avoid adding fields to your ApplicationUser class/subclassing it/whatever. Especially if you're using the EF Code First Identity and EF Code First in your application. Nothing to it. I'll give it shot, I swore off EF though.
|
# ¿ Aug 5, 2014 05:27 |
|
epalm posted:Any WPF gurus want to take a crack at this? http://stackoverflow.com/questions/25165505/how-can-i-show-the-user-what-they-are-typing-into-an-iseditable-combobox Dropdown list with all the possibilities? Getting shorter while they are typing? The Google homepage does this, I think it is pretty elegant.
|
# ¿ Aug 6, 2014 17:53 |
|
epalm posted:When I type into the google homepage, it bumps me up to the omnibar. I can still see what I'm typing even though there are longer options than the field is wide. It does not do that for me, maybe only in Chrome? I would show the dropdown and make it as wide as the widest option. Tab completion and the possibility to select an item is what I would do. How to build it in WPF? No clue, sorry.
|
# ¿ Aug 6, 2014 18:08 |
|
What do you guys use for session handling? Session handling is not really the right word I guess, what do you use to keep models in memory if you know you need them again later? It seems a bit of a waste the retrieve the same classes over the course of multiple controllers from the DB, instantiate them, use them and discard them again only to re-instantiate them a bit later. Just retrieve them again or use some form of caching?
|
# ¿ Aug 6, 2014 19:48 |
|
Bognar posted:Note that if you're dealing with multiple web servers, caching and cache invalidation becomes a harder problem. However, with just one web server you can either use something as simple as static variables (with thread-safe access), or possibly use the built-in ASP.NET caching. wwb posted:Measure what the cost is -- you'd be shocked at how efficent modern stuff is. 99% of the time you can make zero real-world performance gains on the back end of your website that are measurable compared to things you can do on the front end like edge caching and compression. My 2c is the best going in proposition is to leave caching for anything longer than a single request until you have measurable performance gains you can get by caching it. Thanks I'll take a look and think about it some more. The cache problems you mention are something I would like to avoid. Some Redis Pub Sub is something that I was thinking about. Publish the update on one server and have the caching server subscribe to that. Bit overkill for now but something that could work in theory. It just feels wasteful I'll benchmark it first. Another question: I am using Bcrypt.net for my password hashing and it really takes quite awhile to validate the password. I know this is the point of the whole bcrypt library but I was wondering if any of you have used this before and what some sane defaults are. Mr Shiny Pants fucked around with this message at 20:55 on Aug 6, 2014 |
# ¿ Aug 6, 2014 20:47 |
|
I have to admit the whole DataAnnotation stuff is pretty awesome in MVC5. All the validation rules you don't need to write by hand, phew.
|
# ¿ Aug 7, 2014 15:14 |
|
Bognar posted:Sounds very similar to Event Sourcing to me. Changes to the model are described as events, and those events are applied in order. Events can be written to a database or queue extremely quickly and then processed separately. The end result is high scalability at the expense of immediate updates. To be honest I find CRUD to be not simple at all most of the times. I mean, looking at something like MVC with Entity Framework to do some CRUD operations is pretty complex stuff. For my own project I first went with Nhibernate, switched to EF and later decided to go with PetaPoco for my DB operations because saving an object graph is hard I guess. It is, don't get me wrong, but that is what your ORM should be doing for you and in my, admittedly limited, experience they don't do a good job. Something as simple as order -> order item makes EF want to reinsert stuff again that it should not be doing. Looking at some blogs I am not the only who has this problem. (Attach object, set model state etc. etc.) This requires you to jump through hoops with FK keys as strings in your model for one - to many relations. Nhibernate worked better, especially with fluent Nhibernate but all the mapping and lazy loading stuff makes it a complex beast to get going, let alone trying to figure out what broke if it decides to stop working. With PetaPoco I just insert an order, retrieve the sequencenumber it generated and update the orderitem FK with this number and insert all the items in two stages. It is more work, but it is much simpler to reason about what your data access is doing. Event Sourcing is pretty awesome, something like Akka persistence makes the whole object - relational impedance mismatch go away. CQRS is also neat.
|
# ¿ Aug 8, 2014 14:45 |
|
Sagacity posted:It gives you a different set of problems, though. It's good to have immutable events, but you will never escape the fact that sometimes you designed your events in the wrong way. True. There is no silver bullet, but if you design something wrong no pattern or architecture is going to help you.
|
# ¿ Aug 8, 2014 15:18 |
|
kingcrimbud posted:I'm in the middle of creating a service that consumes something like 100 other services. My service will have its own model. Let's say my model has a Pet entity. And 15 of these other services have their own representations of what a pet is. The easiest is probably the dynamic object. Otherwise you'll have to do something like writing connectors for each service that will transform the incoming pet to your representation. How will you query the properties? I mean some pet could have the property "Name" others the property "name" etc. etc. You'll never have an exact representation of your entity. This is something XSDs were invented for. Mr Shiny Pants fucked around with this message at 20:22 on Aug 8, 2014 |
# ¿ Aug 8, 2014 20:19 |
|
I am not sure what you mean but:code:
|
# ¿ Aug 11, 2014 05:35 |
|
A Tartan Tory posted:This wasn't it, but it did point me to what I was actually doing wrong. Nothing wrong with the arrays themselves, just how I was displaying them. Thanks for your help (I shouldn't learn to code at 5am in the morning). It wasn't clear what you were trying to do, but printing just the array will display the type: System.Int32 instead of the number of items it contains. Which is what you usually want.
|
# ¿ Aug 11, 2014 05:38 |
|
Eggnogium posted:Ah thanks, I have not worked much with JSON and didn't realize it wasn't even valid. Couldn't retrieve it as a string for the same reason but was able to retrieve it as a Stream and grab the raw bytes. Use something like Json.net to serialize and deserialize you object to and from Json, it will save you a lot of trouble.
|
# ¿ Aug 13, 2014 05:29 |
|
candy for breakfast posted:I inadvertently clicked on "Enable .NET framework source stepping" in the debug/general menu and now although It's unclicked it still steps through everything I even exported the config file and verified that the option is set to 0, but still no dice. Does this mean you get that annoying thing that says: Need source file for yadda yadda.cs? No help, I got the same error. Now I get to remember each time make a call to an external library. Really, really annoying.
|
# ¿ Aug 14, 2014 05:27 |
|
Ithaqua posted:It's an event handler, so it can't return a Task. Why not logically make the game a client of the hub, the same as regular clients? Maybe a special client or something. That way logically everything is the same and the hub is only responsible for routing messages to its subscribers and you can reuse the message passing infrastructure that you already use for the clients.
|
# ¿ Aug 15, 2014 00:08 |
|
mortarr posted:I was treating c# like javascript and it turns out if I do a Post instead of a Get I can JSON.stringify() my object and send it up as post data, and then it's all sweet from there. Can't believe I wasted like four hours on this poo poo. Json.net is an awesome library when working with objects that you need to serialize to json. You serialize it, load into to the requeststream and off you go.
|
# ¿ Sep 4, 2014 05:42 |
|
epalm posted:I've run into this before. My request should definitely be a GET, but the data I'm sending is complex (an array of objects with properties) and just doesn't work with GET, but does work with POST. When I say "doesn't work" I mean the IEnumerable arg is null. Uhm GET is for retrieving data? Post is for sending? Maybe I am missing something? EDIT: Or do you need send a query or something? What I usually do is use the URL to create the query. Mr Shiny Pants fucked around with this message at 11:24 on Sep 4, 2014 |
# ¿ Sep 4, 2014 11:21 |
|
Bognar posted:
Been on holidays, I just got back and saw this post sorry if it's a bit late. If I got it right it almost seems like you've build an ORM ( the defining relationships and change tracking ) over another ORM (EF). Why still use EF and not SQL directly if you do the change tracking yourself? As for the item change tracking: Maybe something like event sourcing would have been a more natural fit? You write out all the events that happen to a model and store them in some list or table for later use. Mr Shiny Pants fucked around with this message at 13:40 on Sep 29, 2014 |
# ¿ Sep 29, 2014 13:38 |
|
Cool, thanks for the explanation. I was just wondering
Mr Shiny Pants fucked around with this message at 16:59 on Sep 29, 2014 |
# ¿ Sep 29, 2014 15:44 |
|
Or use something like Redis and tell it to save after every update.
|
# ¿ Oct 3, 2014 14:42 |
|
If you are using F#, why not use a Type Provider instead of EF? Honest question.
|
# ¿ Oct 16, 2014 05:44 |
|
Is this F# code ok?code:
Will this get me in trouble with stack overflows? Or will this be properly handled? Tail recursion is the word for this right? Total F# noob here.
|
# ¿ Oct 18, 2014 22:06 |
|
Any ideas why this code gives me an AccessVilolation?code:
It only gives the error when stepping trough the code though, the result when running the program is fine and works as I expect it to do. Both the commented array.choose as the other one give me this error.
|
# ¿ Oct 20, 2014 05:45 |
|
GrumpyDoctor posted:Have you tried breaking up the pipeline to see exactly what the problem is? Not yet, that was going to be my next step. I was scratching my head because I think it is quite reasonable code and everything I found on Stack overflow and the like said it should work. Destroyenator posted:You're right, they do create new arrays. If it's only when you're debugging it sounds like the "Locals" window or something in VS is trying to read something it shouldn't? Hmmm, I think you might be onto something. Pretty weird if it does. Access Violations during normal execution would stop my program right? I mean, I am not ignoring some exception silently? Love your method, I am not that well versed in F# to work with it though. Not yet anyway. Thanks Edit: Thinking about your rewrite: Am I correct in assuming that the Not operator is a function that takes a value or a function? So you pipe the value coming out of the Array into the String.IsNullOrEmpty function and piping that into the Not operator? This results in a bool for the filter function? Sometimes F# code cooks my noodle. Mr Shiny Pants fucked around with this message at 07:16 on Oct 20, 2014 |
# ¿ Oct 20, 2014 07:01 |
|
GrumpyDoctor posted:You might want to double-check your exceptions list (Debug > Exceptions, I think) and make sure that "Thrown" is checked for that particular exception type. Do you see the problem any time you have a debugger attached, or just when you're actually stepping through? Only when actually stepping through this particular piece of code.
|
# ¿ Oct 20, 2014 07:17 |
|
Rewrote it like this:code:
Error message: code:
Rewrote as pointed out: code:
Mr Shiny Pants fucked around with this message at 18:43 on Oct 20, 2014 |
# ¿ Oct 20, 2014 18:40 |
|
Anyone have clue how to get SQLite working in F# using the Nuget drivers? I downloaded the SQLite core drivers and referenced them, but no luck. During compilation it craps out and in the interactive window I am getting a cannot load DLL error SQLite.Interop.DLL. Pretty frustrating, any pointers would be appreciated. Edit: Found it. Don't know what is wrong with the Nuget package but the one from the site works great: http://system.data.sqlite.org/downloads/1.0.94.0/sqlite-netFx451-setup-bundle-x64-2013-1.0.94.0.exe It even works in the FSI and no mucking about with the interop DLL. Edit 2: Wow, the X64 DLL does not work with the TypeProvider because Visual Studio is a 32Bit application that can't load X64 binaries. So the X86 binary is still required for VS to work. Bummer. Mr Shiny Pants fucked around with this message at 21:13 on Oct 20, 2014 |
# ¿ Oct 20, 2014 20:48 |
|
GrumpyDoctor posted:Which line is the exception on? (And why did you eliminate that whitespace? That's a super weird style.) What whitespace? I'll take a look and let you know.
|
# ¿ Oct 21, 2014 17:21 |
|
|
# ¿ May 2, 2024 13:10 |
|
Wow pattern matching is nice. Matching on a string and the contents of an array just blew my mind.
|
# ¿ Oct 21, 2014 20:40 |