|
crashdome posted:How about a validation error on the control instead of a modal? Are you just validating data entry? That's literally it, EXCEPT that they want a big fat textbox where they can enter any number of driver's license numbers (DLNs) and I just separate them out by newline/whitespace/whatever, match them to a regex, then go search by them. This is basically just a little tool for clerks to get a bunch of driving record PDFs out of a state ran REST service. They then print out all of those PDFs. Since it's just one big fat text blob, if I want to say THESE specific numbers I figured just pop up a window saying "X, Y, Z is invalid." If they decide to change the design to a fixed number of smaller text boxes I could do something fancier, but the impression I've gotten is that they want to be able to do really big batches of this. They probably just want to come back later and go "oh, these were entered wrong/aren't valid/whatever" rather than going some-small-number-at-a-time. AFAIK this is basically something ran at end of day for the next, or start of day, so the Judges can have copies of people's records for traffic related proceedings. Mr. Crow posted:I'm not really following you're question, but as your application evolves and becomes more complex you'll find you probably want/need to roll your own dialog window, which is pretty simple (is this your question??). Nah I'm trying to program by committee of judges, clerks and bikeshedders and basically flying solo less than two years in. It's me.
|
# ? Jul 18, 2014 19:34 |
|
|
# ? May 4, 2024 15:39 |
|
Also since it's, uh, terrible, and huge, and crossposting is something I'd rather not do (unless truly warranted) I'm trying to go through some threaded stuff: the old worker thread and wait window idiom! Click here for green forum action. I seriously want to unfuck this. That thread.sleep(100) poo poo makes me feel ashamed and I'm not the one who wrote it.
|
# ? Jul 18, 2014 20:08 |
|
Following up on my previous problem, once a friend told me about System.Data.DataTable, reorganizing the data became more logical in my head. Ended up being something like this code in my viewmodel: (again, typed from memory so probably wrong)C# code:
Made more sense to me than messing around with column templates, and seems more idiomatically correct than dynamically adding columns to the datagrid in the code-behind. It worked, but am I more or less on the right track here with respect to doing it "right"?
|
# ? Jul 18, 2014 20:09 |
|
gently caress them posted:Also since it's, uh, terrible, and huge, and crossposting is something I'd rather not do (unless truly warranted) I'm trying to go through some threaded stuff: the old worker thread and wait window idiom! Is it Winforms?
|
# ? Jul 18, 2014 20:17 |
|
Ithaqua posted:Is it Winforms? I honestly don't know I thought XAML == WPF but googled first. Now I know that is not the case. Edit: I think. Double Edit: Thinking that yes, it is, given that I pass messages in and out of it with a method call, and there's no bindings to anything in the XAML idiomatic way. No DependencyProperties or anything. Fuck them fucked around with this message at 20:25 on Jul 18, 2014 |
# ? Jul 18, 2014 20:21 |
|
gently caress them posted:That's literally it, EXCEPT that they want a big fat textbox where they can enter any number of driver's license numbers (DLNs) and I just separate them out by newline/whitespace/whatever, match them to a regex, then go search by them. This is basically just a little tool for clerks to get a bunch of driving record PDFs out of a state ran REST service. They then print out all of those PDFs. I get a bit anal about UI sometimes. My approach would be to dynamically add textboxes after each license was entered and validated. Auto-switching focus even. If I was a user and had to enter two dozen licenses and learned only after the fact that I was entered one of them wrong that I had to hunt down both in my notes and also in the textbox OR alternatively that my zero key wasn't working and I had to go back and replace zeros in most of the lines, I would be pissed. The benefit of this method is you code the validation once and the UI behavior once. The drawback is you have to concern yourself with all of the validation markup instead of a single method/event. But again, I am an anal SOB when it comes to data entry. Do what you need to do with the time you got and modal dialogs are perfectly fine in WPF if that's the way you go.
|
# ? Jul 18, 2014 20:28 |
|
gently caress them posted:I honestly don't know In WinForms, assuming you just have a stupid form that has a textbox that shows whatever text you set with the "SetText" method: code:
|
# ? Jul 18, 2014 20:29 |
|
crashdome posted:I get a bit anal about UI sometimes. My approach would be to dynamically add text boxes after each license was entered and validated. Auto-switching focus even. If I was a user and had to enter two dozen licenses and learned only after the fact that I was entered one of them wrong that I had to hunt down both in my notes and also in the textbox OR alternatively that my zero key wasn't working and I had to go back and replace zeros in most of the lines, I would be pissed. The benefit of this method is you code the validation once and the UI behavior once. The drawback is you have to concern yourself with all of the validation markup instead of a single method/event. I thought of that, but then I realized a few things: • Coding dynamically added textboxes made me cringe, but could be fun. • Non-technical clerks probably just want to dump a big fat load of DLNs and get some printable PDFs, really. Like, a whole day's worth of dockets for traffic court etc. • I have no way to validate until after a hit to the service is made. All I can do is see if it matches (1 letter)(12-13 numbers). Now, if it DOES turn out they're entering some sane number at a time and it's not just a huge batch, then I guess I could do something asynchronously so upon entry, if it matches the regex, it then makes a call to the REST to see if it's valid or not. Then when they push the big fat "get the pdfs" button it actually requests all that big data. Basically I'm in hurry up and wait mode, but if that turns out to be what they had in mind that does sound like a good idea. So, given that - how the hell would you even dynamically make a new textbox, and a way to programmatically expose the string in that text box?
|
# ? Jul 18, 2014 20:32 |
|
Ithaqua posted:In WinForms, assuming you just have a stupid form that has a textbox that shows whatever text you set with the "SetText" method: I feel like I haven't adequately explained what the real problem is. The XY problem also just left me a voice mail. It does work IFF something slow and long is going on before it calls .EndWaiting(). If it basically just goes "welp there's nothing to do here" and quickly calls .EndWaiting() it ends up with a null THIS. Also, the wait window never actually pops up, making me think it was never constructed before the worker thread beep-boops along and realizes there's no need to call the longRunningthing. I could work around this by checking if there's even any reason to call longRunningThing before bothering to fire up the wait window, but I'd rather solve the problem itself entirely.
|
# ? Jul 18, 2014 20:41 |
|
gently caress them posted:I feel like I haven't adequately explained what the real problem is. The XY problem also just left me a voice mail. No, I understand the problem. The root cause is that the approach the code is taking is dumb. Instead of keeping the UI responsive and doing the work on a different thread, it locks the UI thread doing the work and makes its own temporary special snowflake UI thread to report progress.
|
# ? Jul 18, 2014 20:45 |
|
Have you considered... talking with the customer and actually figuring out what they want and plan to use it? If they get the DLNs from some spreadsheet and want to just ctrl + v a bunch at a time, having individual textboxes to put each one in would be a nightmare from a usability standpoint. On the flip-side there are benefits to the other approach that was mentioned as well. Doesn't really sound like you're sure what they want, to me.
|
# ? Jul 18, 2014 20:47 |
|
Ithaqua posted:No, I understand the problem. The root cause is that the approach the code is taking is dumb. Instead of keeping the UI responsive and doing the work on a different thread, it locks the UI thread doing the work and makes its own temporary special snowflake UI thread to report progress. So it's a full on anti pattern, nice. I've worked around now that I've chewed on it more but I think a refactor to do it right is in order. God knows I have the time to spare. Mr. Crow posted:Have you considered... talking with the customer and actually figuring out what they want and plan to use it? Yes. I speak to the managers above me frequently! I've yet to speak with a clerk here except when I was paying a traffic ticket. I should just go take the initiative on that.
|
# ? Jul 18, 2014 20:54 |
|
This might be an algorithmic question instead of a .NET question, but I'm doing it in VB.NET so I figured I'd ask here. I've got to 'sanitize' a couple hundred thousand product titles. These titles were constructed by a relatively simple algo created years ago that was basically: (company name) + (quality) + (title) + (optional dimension) + (optional size) The problem being, this algo has been applied to several suppliers and manufacturers, and not all of them are consistent. Upon reflection, and uploading products to a new platform, we're seeing some hinky names like (plusses added to show which part is which): "Butts Corp + 14k Yellow Gold + Yellow Gold Back Scratcher + + 8 inches" The problem being, some vendors are including the quality in the title, and it's leading to redundancy. I've already figured out how to replace the ones that are exactly the same (e.g. 'Butts Corp Sterling Silver Sterling Silver Butt Plug 5 inch diameter") by doing a relatively simple regex/matchcollection. However, in the example above, the quality ("14k Yellow Gold") is not an exact match with the quality in the title ("Yellow Gold Back Scratcher"). So what I'm wondering, before going down a long road of split and for...next, is there an elegant way to try to match and replace fragments of Quality against Title, deleting on match so I only have 1 Quality and a modified Title? Ideally the result would look like: "Butts Corp 14k Yellow Gold back Scratcher 8 inches"
|
# ? Jul 18, 2014 21:22 |
|
Scaramouche posted:This might be an algorithmic question instead of a .NET question, but I'm doing it in VB.NET so I figured I'd ask here. You might want to look into NUML (http://numl.net/) for this one. It's pretty neat. Basically, you give it a bunch of examples of clean data, a bunch of examples of unclean data, and then run it against your real dataset and let it sort things into two buckets. You'll still have to clean it up manually, but at least it'll help you identify the items that need human love. New Yorp New Yorp fucked around with this message at 21:30 on Jul 18, 2014 |
# ? Jul 18, 2014 21:26 |
|
Dr. Poz posted:I've run into this before as well but I was able to resolve it by turning off Hyper-V in the Add/Remove Windows Features section of Programs. You're saying that when you do that it goes through the motions of uninstalling it but then hangs and rolls back? Unchecking the box in that screen is exactly what I'm doing and it isn't being too successful. I just tried the manual virtualbox cleanup and I'm sitting here watching the hyper-v uninstall hang at 36% again. In about 40 minutes whatever it is will finally timeout and it will reboot again and rollback the change. At this point if I had started the windows reinstall when this popped up I'd be done by now with most of a working stack on the box . . .
|
# ? Jul 19, 2014 01:07 |
|
Any of you guys happen to have any good resources for learning MS Composite Application block? I suppose it's kind of a long shot since it's so old, but figured I'd ask anyways.
|
# ? Jul 21, 2014 14:19 |
|
Does anyone have any tips for streamlining Windows Service development? I started working on a large, mature system two months ago, which runs on a fairly baffling ecosystem of virtual machines. Most of these VMs are running windows services, which I need to develop. I've got batch scripts that, whenever I recompile a particular service, automatically uninstalls it, copies the new files to the VM, reinstalls the service, and then starts it. I then attach the debugger to the process running on the VM if I need to debug. This is all fairly nice, but the process still feels very unweildy, and compiling and running the code takes up to a minute, which is frustrating me more than it should. Are there any ways to streamline this process that I haven't noticed? I'm running visual studio 2012 pro, but I can get a upgrade to 2013 pro if needed.
|
# ? Jul 22, 2014 15:57 |
|
Geisladisk posted:Does anyone have any tips for streamlining Windows Service development? Take all of your interesting code and put it in a separate project, then debug through a console app? This will work if you can test on your dev machine and not have to deploy to a VM.
|
# ? Jul 22, 2014 16:09 |
|
Geisladisk posted:Does anyone have any tips for streamlining Windows Service development? Depending how much scope you've got to mess with them I've used http://docs.topshelf-project.com/en/latest/overview/faq.html before and it's pretty good. You write your service as a console app with this wrapping it up. Lets you run from the command line for testing and adds install/uninstall command line flags which do that junk for you.
|
# ? Jul 22, 2014 16:44 |
|
FileSystemWatcher.OnChanged is fired when a file change begins, not when it ends. Is there a way to get the changed file after it's done being modified other than just repeatedly attempting to open it and catching IOExceptions?
|
# ? Jul 22, 2014 19:37 |
|
Geisladisk posted:Does anyone have any tips for streamlining Windows Service development? Chef, puppet and Powershell DSC
|
# ? Jul 22, 2014 20:22 |
|
Destroyenator posted:Depending how much scope you've got to mess with them I've used http://docs.topshelf-project.com/en/latest/overview/faq.html before and it's pretty good. You write your service as a console app with this wrapping it up. Lets you run from the command line for testing and adds install/uninstall command line flags which do that junk for you. Unless you need to debug the whole service environment, then this doesn't really help you beyond making installing a little easier.
|
# ? Jul 22, 2014 20:40 |
|
ljw1004 posted:When I ported C code from linux to windows, I just kept it in C/C++. If it already used FILE* in C, then it was easy to make that work under windows. (However I never did any COM port stuff). I didn't understand from your post why you also want it in C# ? Thanks for the reply, apologies for my delay. My thinking was that the higher-level functionality was easier to duplicate than the lower level. The majority of my work is C in embedded platforms. But I'm more comfortable in C# in windows than C, if that makes any sense. It's the choice between figuring out how to duplicate ssize_t and optind or re-writing the functionality I already understand in C#. Worked through some other issues with the vendor and got the Linux version up and running in the factory, but still wasn't able to get through the whole COM sequence. At this point I'm suspecting faulty hardware in the factory since my boards here are working with a much better success rate than they saw. It's not using FILE*, but I've found some examples of VCP usage in windows C. I've got the cli compiler failing expectedly on it, I'll see if I can get it cleaned up before the factory hits me up tonight.
|
# ? Jul 22, 2014 21:17 |
|
Is there any way to get the ASP.Net precompiler to spit out the actual circular references when it gives you that idiotic circular reference error? I've got it setup to merge all output to a single assembly and there are no actual circular references, but the way it batch compiles each folder means if /sub1/A -> /sub2/B and /sub2/C -> /sub1/D then ASP.Net creates a circular reference out of thin air for you. Why it doesn't just compile the whole site as one batch in that mode I have no idea. The error message is extremely helpful by choking on a completely unrelated ASCX control (or anywhere really) the next time it happens to need to resolve something in /sub1/ or /sub2/ in my example, so you get no help whatsoever in locating the actual problem. I can't see how anyone at Microsoft is maintaining any of this stuff because the VS compilation process, publish without precompile, and the precompile all have extremely different ideas about what "compilation" actually means. The site itself runs just fine... perfectly in fact with zero errors. You just can't do a packaged installer build thanks to the fake circular reference helpfully created for me by ASP.Net Doing it by hand means examining the markup for a couple hundred ASPX and ASCX files, looking at what pages/controls they register, noting what folders everything lives in, then resolving down the folder differences to find the two pairs causing the "circular" reference. We're about to give up and just tell it to generate one assembly per page/control, even though that takes a 5 minute build to like an hour, or just dump all the user controls in one huge directory.
|
# ? Jul 23, 2014 00:46 |
|
Ithaqua posted:You might want to look into NUML (http://numl.net/) for this one. It's pretty neat. Basically, you give it a bunch of examples of clean data, a bunch of examples of unclean data, and then run it against your real dataset and let it sort things into two buckets. You'll still have to clean it up manually, but at least it'll help you identify the items that need human love. Thanks for the reply; I've actually been whacking away at this. I looked into numl and agree that it's pretty neat, but it doesn't work super good for me since I don't really have a list of 'good' values, I just have a list of values. I did this quick hack that I think is going to get me 80% of the way there though: code:
|
# ? Jul 23, 2014 20:17 |
|
I think this is the correct thread... Total newbie at VB. Anyway, I'm creating a GUI in order to launch a batch file which then kicks off a PowerShell script. The GUI compiles fine and everything works great, however when I go to deploy the file it doesn't actually include any of the supporting files like the batch scrips or PowerShell scripts and their directories. Stupid question but... how do I make sure these are included with the project when a user goes to install it? Using Visual Studio Express 2013. Edit- Does it make it more complicated if there are directories that the PS script replies on in order to write out logs to? All my real coding is in the scripts. The form is just a user-friendly GUI. TheEffect fucked around with this message at 20:48 on Jul 23, 2014 |
# ? Jul 23, 2014 20:38 |
|
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 |
|
Mr Shiny Pants posted: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. I see. Do I need to create the empty directories (that get populated at run-time) myself? It seems I can't add an entire directory at once. When it's installed I'm guessing these files/directories will go into the "Publishing Folder Location"(is there something better to use than "C:\Program Files (x86)\" here?), correct? Edit- Hmm, nope. That doesn't appear to work. I don't see that the files are being copied over to the installation directory. The buttons on my form use direct paths to the scripts to launch them so I'm not sure if that makes any difference with how I need to go about this. TheEffect fucked around with this message at 21:22 on Jul 23, 2014 |
# ? Jul 23, 2014 21:00 |
|
Your question is about configuring your deployment, not your build settings, so unless I'm mistaken somewhere, this:Mr Shiny Pants posted: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. actually solves a different problem. How are you deploying?
|
# ? Jul 23, 2014 21:14 |
|
GrumpyDoctor posted:How are you deploying? I'm just trying to make it as easy as possible to deploy this to other users who are not very PC savvy. I'm clicking "Build" -> "Publish [project]". I don't need an installer per-say. The one-click install process that this is creating is fine for my purposes; I'm just not sure how to get the files that the form relies on to copy over to the installation directory when it does get installed. Edit- I think I found it. I had to set "Build Action" to "Content" on my files (why can't I do this per directory?). Still testing... Editx2- The copies are being copied over just fine now, but not the empty directories. When I try to add the empty directory to my solution it tells me the folder already exists, but it's not in my solution explorer? TheEffect fucked around with this message at 22:24 on Jul 23, 2014 |
# ? Jul 23, 2014 21:26 |
|
TheEffect posted:Editx2- The copies are being copied over just fine now, but not the empty directories. When I try to add the empty directory to my solution it tells me the folder already exists, but it's not in my solution explorer? I don't think that ClickOnce has the capability to create empty directories on installation. More to the point, your application should not be blindly relying on a folder to be there in order to function. If it needs to store things in a specific folder, it should be checking for that folder every time it needs it, and attempting to create it if it doesn't exist. Edit: Okay, reading back I see that the scripts need these folders, not your application. In that case your application should probably check for the folders on startup instead of every access. Or if you have access to the underlying script, make the script do it (why isn't the script doing it). Che Delilas fucked around with this message at 22:38 on Jul 23, 2014 |
# ? Jul 23, 2014 22:33 |
|
Che Delilas posted:Edit: Okay, reading back I see that the scripts need these folders, not your application. In that case your application should probably check for the folders on startup instead of every access. Or if you have access to the underlying script, make the script do it (why isn't the script doing it). You're right. I'll add some logic in the script to check for the folders I need and create them if needed. I didn't design the script with a GUI in mind. Once my boss saw it he wanted it to be implemented globally in an easy manner, so I brushed off my intro to VB book and started going at it in a backwards way, hence why I'm finding it so difficult and trying to find work-arounds to get this thing going like I want it to. Thanks for the help everyone!
|
# ? Jul 23, 2014 22:47 |
|
Does anyone have experience using linqkit for composing C# expressions for queries in Entity Framework/some other ORM? The main goal is to be able to remove duplication in queries. http://www.albahari.com/nutshell/linqkit.aspx http://www.albahari.com/nutshell/predicatebuilder.aspx I was thinking of leveraging it for our project and just wanted to survey others' positive/negative experiences. comedyblissoption fucked around with this message at 04:55 on Jul 24, 2014 |
# ? Jul 24, 2014 04:31 |
|
I've used predicate builder for a few things and it worked quite nicely, never the full LINQKit though.
|
# ? Jul 24, 2014 14:13 |
|
Bognar posted:Take all of your interesting code and put it in a separate project, then debug through a console app? This will work if you can test on your dev machine and not have to deploy to a VM. Destroyenator posted:Depending how much scope you've got to mess with them I've used http://docs.topshelf-project.com/en/latest/overview/faq.html before and it's pretty good. You write your service as a console app with this wrapping it up. Lets you run from the command line for testing and adds install/uninstall command line flags which do that junk for you. Malcolm XML posted:Chef, puppet and Powershell DSC ManoliIsFat posted:TopShelf was huge for me. Being able to just debug right in to your service code without doing all that debugger attach (and maybe building in a startup-delay so you can attach the debugger in time). And then using TopShelf to install the service instead of making a Setup/Installer project for all of it. Thanks for the suggestions. TopShelf and Puppet definitely looks interesting, I'm looking into them right now. If TopShelf is easy to integrate into the preexisting project, it looks like it'll be a huge timesaver when compared to deploying to vm via batch script. I've also started using unit tests to test individual pieces of code, which is a huge improvement over accessing the frontend and activating the functionality from there. I graduated this spring and got hired two months ago to dust off a 100k+ loc system (.net backend, asp and extjs frontend and two databases, interfacing with two different black-box systems, with the whole shebang running on ten virtual machines. Overwhelmed doesn't even begin to describe how I felt the first couple of weeks. ). The system has basically been dormant for the past year, after the only guy working on it quit. They're now renewing development on it, and the first stage was hiring me. My job for the past two months has basically been to figure out how to get this monster running, and set up development procedures and tools to lubricate the development that's starting on the system. Two weeks from now, there are two other developers starting on the project and the goal is to have the environment and procedures set up and ready to go. Geisladisk fucked around with this message at 18:05 on Jul 24, 2014 |
# ? Jul 24, 2014 17:59 |
|
I've got VS2013 and Office 365. Trying to create a project with the Excel Workbook template says that my Office installation is missing required parts and to reinstall it. According to Microsoft you can't create Excel workbooks with Visual Studio 2013 when your Office is delivered via Click-to-Run because you can't customize the install and tell it to install the bits that communicate with Visual Studio. I've got Office 365. Is there any way around that? It seems really stupid that I can't create workbooks because I have the poor version of Office.
Luigi Thirty fucked around with this message at 20:41 on Jul 24, 2014 |
# ? Jul 24, 2014 20:37 |
|
Geisladisk posted:Thanks for the suggestions. TopShelf and Puppet definitely looks interesting, I'm looking into them right now. If TopShelf is easy to integrate into the preexisting project, it looks like it'll be a huge timesaver when compared to deploying to vm via batch script. Only 100k? Heh. Try 1000k+
|
# ? Jul 24, 2014 21:06 |
|
Does anyone use reporting services? I've got an image that I want to place behind some text in the page header and I want to export the report to PDF. If I just place a text control over the image, the text is not rendered. If I set the image as background in the text control, the text is rendered, but the image is clipped. Is there any way with the default SSRS controls to tell an image to fit proportionally if it's the background in a text control, or are there any 3rd party controls that will allow this? This was a solved problem in Access 97 of all things!
|
# ? Jul 25, 2014 02:55 |
|
OK, I'm gonna go ahead and ask this dumb question: MVC seems to have an attribute you can put on actions where you can cache the page render, but how could caching the entire page be useful when you have a bar showing the username and so on? What I'd really like to do, of course, is cache portions of pages, and for certain circumstances (like caching one tenant's version of a page and serving it to everyone in a multi-tenant app is also bad). Is there like, an obvious built-in tool for that or should I be rolling my own?
|
# ? Jul 25, 2014 05:07 |
|
|
# ? May 4, 2024 15:39 |
|
RICHUNCLEPENNYBAGS posted:OK, I'm gonna go ahead and ask this dumb question: MVC seems to have an attribute you can put on actions where you can cache the page render, but how could caching the entire page be useful when you have a bar showing the username and so on? What I'd really like to do, of course, is cache portions of pages, and for certain circumstances (like caching one tenant's version of a page and serving it to everyone in a multi-tenant app is also bad). Is there like, an obvious built-in tool for that or should I be rolling my own? I haven't used it myself, but it seems like you're looking for donut caching. From the link: quote:What is Donut Caching?
|
# ? Jul 25, 2014 05:35 |