|
gariig posted:Gotcha! Tried PowerShell? You can run PowerShell from your application and use the Set-WinSystemLocale with it. Hm. This combined with the other setup stuff I need to do means I may just keep it as separate machines for separate languages. Was hoping it'd be something simple like setting a registry key or an env var or something.
|
# ? Feb 21, 2014 21:58 |
|
|
# ? May 29, 2024 12:09 |
|
I am building another windows phone app and want to try more unit and integration testing in my Core PCL. What is the mock framework many use? I wish my boss let me dabble in unit testing but he won't so I have to read and do so on my spare time. Osherove seems to recommend nsub in The Art of Unit Testing but I don't know if I am sold on that just yet.
|
# ? Feb 22, 2014 20:29 |
|
Dirk Pitt posted:I am building another windows phone app and want to try more unit and integration testing in my Core PCL. What is the mock framework many use? I wish my boss let me dabble in unit testing but he won't so I have to read and do so on my spare time. I recommend Moq.
|
# ? Feb 22, 2014 20:34 |
|
Hi, I have a lot of VB SSIS jobs that are more VB than SSIS. They run on a scheduled SQL server. I will randomly get an error of: "Object variable or With block variable not set." on some of them at random points in time. My predecessors ignore these errors because eventually the jobs will run without an error. I want to figure out the cause of it. I've narrowed it down to the following code:code:
quote:Object variable or With block variable not set. I've been trying to figure this out for a solid week. The people in my office don't care and it's difficult to reproduce the error. My guess is that it's related to the server being overloaded, but nothing about the error message indicates that. I figured the connection might be getting closed, but my connection state shows up as open in the error message. Also, I am very wierded out that it's not throwing an exception since my catch statement isn't picking anything up. Any ideas, anyone? *edit* whoops tables.
|
# ? Feb 23, 2014 01:46 |
|
First off, this is absolutely horrible and you should immediately replace it with a parameterized query, and then find every other instance of building SQL via string concatenation and do the same. SQL injection vulnerabilities are a huge problem and are absolutely trivial to avoid.code:
You should also probably wrap up your disposables (the connection, the data adapter, etc) in using blocks, although that's not going to be the source of your problem here.
|
# ? Feb 23, 2014 02:20 |
|
Gimpalimpa posted:Also, I am very wierded out that it's not throwing an exception since my catch statement isn't picking anything up. It could be from the lower case exception. I couldn't get VS2013 to allow a lower case exception instead of Exception. VB.NET can be a little forgiving with errors like this. I think Ithaqua is correct about the string concatenation of Technote is causing you an invalid SQL string. Have you tried running one of the delete statements that causes an error in SQL Server Management Studio?
|
# ? Feb 23, 2014 02:49 |
|
Thanks for the responses.quote:Technote could be bad I can copy/paste the SQL delete statement from my error log and it runs without a problem. quote:It could be from the lower case exception. I've had other exception types get caught, so I don't think this is the case.
|
# ? Feb 23, 2014 03:30 |
|
I would just try a code cleanup. Pull the delete to it's own method, parameterize the query, and open a new connection for the delete. I generally try not to share a connection because I've had it lead to some strange stuff occurring. Dump the finally and move to Using statements. Are you logging the Exception.ToString? If not that gives you a stack trace and inner exceptions. Make sure your Catch isn't throwing an Exception that could be hiding the real Exception.
|
# ? Feb 23, 2014 04:45 |
|
wwb posted:We've got a little project that involves reading a bunch of PDFs and making them searchable. We can handle the whole "take bags of text and make it searchable" pretty easily but we are having some trouble with the reading PDFs end of the equation. Well for making PDFs searchable Abby Finereader OCR is the best. For free: maybe the Adobe Ifilters for PDF?
|
# ? Feb 23, 2014 10:11 |
|
Gimpalimpa posted:Hi, I have a lot of VB SSIS jobs that are more VB than SSIS. They run on a scheduled SQL server. I will randomly get an error of: "Object variable or With block variable not set." on some of them at random points in time. I'm wondering about this line of code: Visual Basic .NET code:
|
# ? Feb 23, 2014 23:36 |
|
I wonder if someone can help me with this. As someone pretty new to .NET and C# I'm having a lot of trouble understanding how to get MVC5's authentication stuff working with an existing database of usernames and passwords. Basically I'm needing to write a small web site that will connect to an existing database and authenticate against a username and password stored within that database. Being so new to all this I'm needing something of a crash course but I'm having a lot of trouble wrapping my head around the complexity of claims based authentication. All I really want is to check the username and password in the database and return whether the credentials were valid, but it seems incredibly complicated to do this, OR I haven't been able to find the magic resource that will give me the information I'm needing. Can anyone help at all with this?
|
# ? Feb 24, 2014 05:05 |
|
Gnack posted:I wonder if someone can help me with this. As someone pretty new to .NET and C# I'm having a lot of trouble understanding how to get MVC5's authentication stuff working with an existing database of usernames and passwords. Basically I'm needing to write a small web site that will connect to an existing database and authenticate against a username and password stored within that database. Being so new to all this I'm needing something of a crash course but I'm having a lot of trouble wrapping my head around the complexity of claims based authentication. All I really want is to check the username and password in the database and return whether the credentials were valid, but it seems incredibly complicated to do this, OR I haven't been able to find the magic resource that will give me the information I'm needing. This has all of the interfaces you need to implement. I couldn't find a good example that implements it's own password hashing but I think that should point you in the right direction
|
# ? Feb 24, 2014 07:35 |
|
gariig posted:This has all of the interfaces you need to implement. I couldn't find a good example that implements it's own password hashing but I think that should point you in the right direction Wow, that looks like the exact resource I needed - thank you so much.
|
# ? Feb 24, 2014 07:44 |
|
Gnack posted:Words about asp.net MVC authentication... Not sure if this is relevant for your situation, but once you have the info on authentication, I've used fluent security for the authorisation stuff in MVC projects, as a way to record what roles have what access in a centralised location, rather than spread out as attributes over all my controllers etc. Here's a basic example from their getting started guide... code:
I'm not a pro at MVC security, and this is for an internal app, but it seems to work really well and I found the docs to be pretty good too.
|
# ? Feb 24, 2014 09:27 |
|
Is there a better way than IValidatableObject to do conditional validation of a model in MVC5? My specific example is that I have a ModemModel, and it has an account number as a required field. Depending on which billing system it is being added to, the length of the account number is different. Also, if the modem is an EMTA (modem and phone), then a second MAC address field is required. If it isn't an EMTA, no second MAC is needed. I was hoping to just keep everything in one form with one model if possible, with the options for billing system and EMTA/Not EMTA as radio buttons.
|
# ? Feb 25, 2014 21:12 |
|
Update - Today I had a wonderful moment where it did this when I was in debug mode today. The job is throwing a query timeout exception at that point and then something further down in my code is screwing it up to a "object not set" error message. I was stepping through too quickly to catch where, but it's nice to know the core cause.
|
# ? Feb 26, 2014 03:52 |
Quick question that seems like it should be simple. We have a drop down for our help desk system to associate the issue with a category. Now over the years the categories list seems to have gotten out of hand and I've been tasked with trimming it down. Is there a way for me to remove an item from the drop down without throwing an error when someone tries to look at an old problem of one of the removed categories. I would like to do this as minimally as possible so I don't know if there's a way to get the drop down to hide the item but the value still be there.
|
|
# ? Feb 26, 2014 18:19 |
|
Drythe posted:Quick question that seems like it should be simple. I would just get the list of currently approved categories. When loading a problem I'd check to see if it's assigned category is in the list and if not add it. So the most anyone will see is one incorrect category which is the one the current problem is assigned to. You could also fix the data. Map the old categories to new ones but there's not always a 1:1 so that might be too much work.
|
# ? Feb 26, 2014 18:35 |
gariig posted:I would just get the list of currently approved categories. When loading a problem I'd check to see if it's assigned category is in the list and if not add it. So the most anyone will see is one incorrect category which is the one the current problem is assigned to. I was going to do that, was just wondering if the control was able to do that on it's own. A lot of these stupid categories look like they were used once or twice....five years ago. Edit: Why the gently caress is there three places the categories get bound at??? Working on this system is just.... Drythe fucked around with this message at 19:10 on Feb 26, 2014 |
|
# ? Feb 26, 2014 18:40 |
|
Drythe posted:Quick question that seems like it should be simple. (But to be honest, I don't even know if there's a db involved here)
|
# ? Feb 26, 2014 23:03 |
|
WPF questions ahoy. I have a button that looks like this: I have an event set up to notify the user an error has occurred. The event is already wired up and a little label shows up when an error has occurred. I want to get rid of this label and make the image in this button flash instead. I know how to write a infinitely repeating storyboard, but not quite how to change the image and make it so the storyboard is tied to this event and is stopped when the button is clicked. Anyone super good at WPF? Bonus if we can set it up so the button flashes a different color for each log4net category (blue for info, green for debug, yellow for warnings, et cetera.) The event handles categories as well, so it's really just storyboarding this poo poo out that has me confused.
|
# ? Feb 27, 2014 01:00 |
|
Tha Chodesweller posted:Bonus if we can set it up so the button flashes a different color for each log4net category (blue for info, green for debug, yellow for warnings, et cetera.) The event handles categories as well, so it's really just storyboarding this poo poo out that has me confused. Usability quibble: Flashing is generally annoying (remember the <blink> tag in Netscape?). Using colors to convey information that's not conveyed elsewhere is a nightmare for colorblind people, such as myself. In my world, some reds look brown or black. Some greens look yellow. It's really annoying.
|
# ? Feb 27, 2014 01:12 |
|
Over the course of the next 6 months, I'm doing an in-place migration of an internal webapp from Silverlight to ASP.NET MVC (+some front end js framework). Given it's an internal app, and we use Active Directory, is there much value to be had by using ASP.NET Identity. Especially if I'm keen to not use the Entity Framework based persistence layer part of ASP.NET Identity (we're moving away from using EF in favour of just raw ADO.NET)?
|
# ? Feb 27, 2014 12:42 |
|
Uziel posted:Is there a better way than IValidatableObject to do conditional validation of a model in MVC5?
|
# ? Feb 27, 2014 13:12 |
|
Destroyenator posted:http://foolproof.codeplex.com will get you most of the way there, I think conditional length might be an issue though. The ones it does support ([RequiredIf, "OtherField", EqualTo, ETMA]) get javascript and server side validation and it's not too hard to add your own validation rules in. C# code:
JavaScript code:
|
# ? Feb 27, 2014 13:56 |
|
Ithaqua posted:Usability quibble: Flashing is generally annoying (remember the <blink> tag in Netscape?). Using colors to convey information that's not conveyed elsewhere is a nightmare for colorblind people, such as myself. In my world, some reds look brown or black. Some greens look yellow. It's really annoying. That's fair. I'll just make the label a little less lovely, have it look like a speech bubble coming from the error button or something. edit: How's this? (Placeholder text, it's a little more verbose when something actually happens.) Macichne Leainig fucked around with this message at 16:52 on Feb 27, 2014 |
# ? Feb 27, 2014 16:15 |
|
Question for people who have worked on Android and Windows 8 (maybe this should be in the general thread..), having a hard time finding comparisons on the two that aren't consumer related; anyone have thoughts on one over the other from a tablet developmental environment standpoint? Or is better googling than myself for technical comparisons?
|
# ? Feb 27, 2014 17:05 |
|
Milotic posted:Over the course of the next 6 months, I'm doing an in-place migration of an internal webapp from Silverlight to ASP.NET MVC (+some front end js framework). Given it's an internal app, and we use Active Directory, is there much value to be had by using ASP.NET Identity. Especially if I'm keen to not use the Entity Framework based persistence layer part of ASP.NET Identity (we're moving away from using EF in favour of just raw ADO.NET)? I haven't spent any measurable time with the new identiy framework though it looks good and I don't see why you couldn't easily roll your own plumbing for the raw ADO.NET bits. I have done a number of AD backed authentication schemes in the past. Generally we found that the most successful model was to let AD be the authenticator and handle authorization in the app rather than also ride AD groups for that. In that context it often made sense to ride parts of the membership providers even though the users weren't necessarily living with in SQL server. quote:Question for people who have worked on Android and Windows 8 (maybe this should be in the general thread..), having a hard time finding comparisons on the two that aren't consumer related; anyone have thoughts on one over the other from a tablet developmental environment standpoint? Or is better googling than myself for technical comparisons? More conjecture and stories from drinking with other devs than anything but from what I hear wp8 is much easier to develop upon from a tooling standpoint at least -- you've got Visual Studio and all that and most of your knowlege / tooling / skills should transfer directly. Android emulators are especially slow and buggy which is probably the main pain point. The other pain point is that the wide assed variety of android devices / skins / versions means you will have all kinds of wierd devices specific bugs to hunt down. WP is a much more limited universe so you don't have to fight that as much. One advantage android has is there is a lot more android dev going on so online resources should be better in general. Tooling-wise, android originally used eclipse but I've heard very good things about jetbrains Android Studio.
|
# ? Feb 27, 2014 17:36 |
|
wwb posted:I haven't spent any measurable time with the new identiy framework though it looks good and I don't see why you couldn't easily roll your own plumbing for the raw ADO.NET bits. I have; the current project we're working on uses it because we were time-constrained. You get users, hashed passwords, roles, and claims, which is nice. But there are some weird things (like you don't have to have a password for an account) and you're going to end up doing some stuff on your own unless you don't need to have password reset or changing usernames or a couple other features. I think it would be miserable or at least pointless if you aren't using EF though.
|
# ? Feb 28, 2014 00:52 |
|
Milotic posted:Over the course of the next 6 months, I'm doing an in-place migration of an internal webapp from Silverlight to ASP.NET MVC (+some front end js framework). Given it's an internal app, and we use Active Directory, is there much value to be had by using ASP.NET Identity. Especially if I'm keen to not use the Entity Framework based persistence layer part of ASP.NET Identity (we're moving away from using EF in favour of just raw ADO.NET)? Yeah, I don't see why you'd want to use Identity if you're not using EF. I mean, you can get some scaffolding off it, but I think you can get that anyway out of MVC. I assume you're not going with EF because you'd have to refactor your DB schema for it? I've actually been thinking about migrating us to EF because I have a lot of low-experience junior devs working for us, and I want to remove learning SQL as a requirement for working on our backend code. But, then I'm worried about taking too much of a performance hit, etc. So, curious about your findings/thoughts.
|
# ? Feb 28, 2014 00:58 |
|
To use EF and not end up with an unmaintainable mess you have to know how databases work and what EF is doing under the hood so I don't think you're going to remove the need for them to understand SQL entirely (even if you don't care how it ends up you need to have relationships on your objects going both ways to get cascading delete under certain circumstances and if you don't bother to do that you'll just get EF errors when you try to delete stuff which are gonna be a pain). I don't know much about the performance characteristics if you have crazy scale. My project doesn't have gazillions of users. I don't notice the overhead. But anyway, my point is I would recommend it for people who already know SQL but don't want to bother hand-mapping everything, not people who don't know anything about SQL and are hoping to avoid learning. I'm using Code First though; I guess some of these things might play out differently with DB First. RICHUNCLEPENNYBAGS fucked around with this message at 01:35 on Feb 28, 2014 |
# ? Feb 28, 2014 01:29 |
|
RangerAce posted:I've actually been thinking about migrating us to EF because I have a lot of low-experience junior devs working for us, and I want to remove learning SQL as a requirement for working on our backend code. But, then I'm worried about taking too much of a performance hit, etc. So, curious about your findings/thoughts. Bad idea. SQL is still an important skill, and one of your junior devs is eventually going to have to write a query against a database outside the context of EF, or troubleshoot why EF is generating a totally stupid query. I wouldn't worry about the performance of ORMs over crafting your own SQL. They're pretty smart about it, and if you get a query that's generating some sort of weird, slow SQL, you can always map a stored procedure to a model. Of course, I don't like EF because it practically begs you to misuse it and expose data access objects outside of the data access layer.
|
# ? Feb 28, 2014 01:41 |
|
RICHUNCLEPENNYBAGS posted:... I'd second this, as a seasoned user of code-first, there's no way I'd let junior devs with or those with no or little SQL experience do anything significant using EF code-first without a senior watching them closely. I've never used the EF designers and visual modelling tools, and a good third of my EF work deals with maintenance/brown-fields dev in existing inhouse and vendor db's, so can't speak to true green-fields or single-db-only dev situations.
|
# ? Feb 28, 2014 02:32 |
|
mortarr posted:I'd second this, as a seasoned user of code-first, there's no way I'd let junior devs with or those with no or little SQL experience do anything significant using EF code-first without a senior watching them closely. That definitely applies to greenfield and single-DB stuff too. RICHUNCLEPENNYBAGS fucked around with this message at 04:56 on Feb 28, 2014 |
# ? Feb 28, 2014 02:38 |
|
Is there a way I can do null-free C# cleanly? I'm experimenting and this is my current implementation; I have the following object: code:
code:
|
# ? Feb 28, 2014 12:33 |
|
What problem are you trying to solve exaclty? Embrace the null instead. Absolutely use nullables for keys and such. Using int? keys and the like has made my life so much easier. What you are doing just seems strange, and I really don't see any benefit to it.
|
# ? Feb 28, 2014 13:05 |
|
I don't normally code like this, it's more an experiment to see if it is possible. But with it creating more problems than it solves I'll not be changing my approach any time soon; I was just wondering if anyone else had tried it and come up with a different way of doing it.
|
# ? Feb 28, 2014 13:55 |
|
It's a possible and well known concept in DI called a "Null Object". What you're doing there is basically Property Injection. While it is the (2nd) simplest form of dependency injection, Property Injection's biggest disadvantage is that it's not simple to implement it in such a way that you can always utilize that property regardless of if it has been injected or not. If you're doing property injection with Null Object stand ins to avoid null checks, then you should make sure that your code never relies on an object returned by your null object to keep your complexity low. The last thing you want is for your NullClassA to have to return NullClassB's which return NullClassC's . If you need to dive that deeply into an object graph then you really should rely on MethodInjection or ConstructorInjection so that the requirement for the object in any given method is explicit.
|
# ? Feb 28, 2014 14:18 |
|
How do you intend to get around casting with as? Are you going to use DefaultIfEmpty everywhere you need to use the XOrDefault LINQ-methods? And do you really plan on initializing every stinking field and property with a default value? While what you wan't to do seems possible I think that there is no sane reason for it. Especially when it comes to casting, if you don't accept using null anywhere you won't be able to cast using as, that means you need to do something like this to be safecode:
Before posting I realized a better way: code:
|
# ? Feb 28, 2014 14:23 |
|
|
# ? May 29, 2024 12:09 |
|
You could always just give F# a try if you want to do null-free .NET programming
|
# ? Feb 28, 2014 15:31 |