|
Here is a very vague question... How is C# for text parsing and regex expressons? I'm a non-programmer trying to help out at work, and we have a 60,000-line data log that I'd like to write a tool for and distribute to my coworkers. They'd input a user ID, and the program would parse the log pulling out relevant information. I'm a Python rookie and I think I could accomplish it in Python but I'd like to learn a language that is easily distributed in the Windows environment.
Hughmoris fucked around with this message at 01:47 on Feb 28, 2015 |
# ¿ Feb 28, 2015 01:39 |
|
|
# ¿ May 17, 2024 16:12 |
|
Jewel posted:Incredibly good. Python and C# are my two favorite languages because they both feel just as flexible as eachother out of the box (C# has the wonderful enumeration library and generally a lot of helper libraries/functions) and I use C# primarily now for the same reason you just said, it's easily distributed. Also typed languages are so much nicer than untyped at this point, not to mention the intellisense is great and the compiler errors are helpful. Thanks, that's good to hear. Ithaqua posted:It's fine, but PowerShell might be more up your alley as a non-programmer. PowerShell has regex operators built right in. I don't know a ton about powershell but would there be an issue deploying powershell scripts on Windows XP computers? Or would I have to do some tinkering to get it to work?
|
# ¿ Feb 28, 2015 22:26 |
|
For performance on a script that parses a 60,000+ line text file, does it really matter what method I use to read in the file and iterate over each line? Poking around C# tonight and it looks like there are quite a few different ways to read in files. Is there a standard method I should be using to read and write files, excluding special cases?
|
# ¿ Mar 4, 2015 03:16 |
|
Is there a simple way to iterate through regex matches in C#? For instance, if I have a string: "Test string 123 and another 456 and a third 789" And I want to capture any three digits that are together, I think my regex pattern would be "(\\d\\d\\d)" I'd like to regex the test string and have an output of: 123 456 789 The little snippets I can find online seem overly complicated for iterating through matches.
|
# ¿ Mar 6, 2015 03:33 |
|
Scaramouche posted:I don't have an IDE in front of me, but isn't matches just a collection? So something like Well, that looks about what I've been seeing. I think I'm just a little daunted by the wordiness of it, coming from Python. Ok, I'll sit down and try to work my way through that.
|
# ¿ Mar 6, 2015 04:00 |
|
I found a solution that I think is easy enough for me to remember.code:
|
# ¿ Mar 6, 2015 04:19 |
|
Munkeymon posted:LINQPad might be a big help when you're trying to visualize object structure: This is pretty cool, I'll have to check it out. I've seen the LINQ term being tossed about but I haven't really looked at it or know what it is. I'm running into a new issue with my regex function. I'm capturing more characters than I want. An example test string would be: code:
*The ACCESS_ID: value can vary in length, won't always be 4 digits.
|
# ¿ Mar 7, 2015 00:43 |
|
fleshweasel posted:Get just the capture group. Groups have automatic number identifiers or can be named. Google knows. Also, write \d{4} not \d\d\d\d. Thanks, I was able to figure it out. I was using foundPAT_ID.Value which gave me everything, turns out I needed foundPAT_ID.Groups[1].Value which gave me just the group I wanted captured.
|
# ¿ Mar 7, 2015 03:37 |
|
New to C# (have dabbled in Python and Perl). I am making a request to the RottenTomatoes API, and I end up with a string in JSON format. The string is essentially an array of dictionaries, full of movies. Example here: http://pastebin.com/CsbTNGqX What would be the best way to iterate through each array element, printing out the movie title? Should I convert the string to a JSON object, and then try to work with that? Hughmoris fucked around with this message at 01:15 on Nov 5, 2016 |
# ¿ Nov 5, 2016 01:12 |
|
raminasi posted:Yeah, define .NET types to mirror the structure of the JSON and then use Json.NET to convert it. I just had my mind blow. As mentioned, I'm extremely new to the language so I was trying to figure out how to create classes and properties to exactly mirror the structure of my JSON-formatted string, and I was flailing. I hopped on the ##csharp channel and someone told me about Visual Studios "edit -> paste special -> paste JSON as classes". Coming from scratching the surface of Vim, that is seriously some magical poo poo. It created all of the classes and properties exactly as they needed to be, and my program worked. Hughmoris fucked around with this message at 04:38 on Nov 5, 2016 |
# ¿ Nov 5, 2016 04:28 |
|
Cuntpunch posted:These great features and more are waiting for you by just using F# - Call now for your introductory offer of Nobody Else Gets It Jesus Christ Why Cant We Use F# Around Here Come On Guys Its Not That Scary Wait What Are Those Pitchforks For What are some of the projects/scripts you've used F# for?
|
# ¿ Aug 19, 2019 16:04 |
|
Cuntpunch posted:Figuring out F# is my boredom project of the year, so it's not like I have F# in production to refer back to. So far a lot of it has been 'ok take a problem I'd consider trivial to solve in C# and figure out how to think about it from a different direction and work it out functionally. I'm a novice hobbyist and struggle with designing OOP stuff so I was curious about trying my hand at FP. I've heard good things about F#.
|
# ¿ Aug 19, 2019 21:02 |
|
I'm a hobbyist programmer, and a novice with C#. I'd like to create a simple desktop app as an exercise to better learn how to create a GUI. I'm thinking the app will be used as a front-end to the StackOverflow database (local db) and the user can choose different query parameters and filters etc... I'm not sure where to start. After doing some research/reading it seems like UWP is dead (long live UWP), WinForms is too old, WPF too hard, and something new called WinUI. Any recommendations on where I should start?
|
# ¿ Feb 4, 2020 23:50 |
|
Thanks for the advice/thoughts on what GUI to start with. Dumb question if I choose to pursue using a webapp instead of something like WPF: Is it easy for webapps (such as a Blazor client-side app) to modify files on my local machine? An idea for my first app is a program that will read a folder full of media files on my laptop, present it as a fancy list to the user, and the user can rename the file and save.
|
# ¿ Feb 19, 2020 13:42 |
|
*Ignore this terrible snipe.
Hughmoris fucked around with this message at 21:44 on Apr 5, 2020 |
# ¿ Apr 5, 2020 21:38 |
|
If I don't have admin rights for a Windows 10 machine, what are my options for learning C#? I have a lot of downtime currently at my job. I have vscode installed but I can't install the dotnet sdk and trying to manually compile my cs file using csc.exe is failing as well.
|
# ¿ Apr 7, 2020 17:27 |
|
Protocol7 posted:Some cloud solution probably. At my old job when Accenture bought us out they came in with super draconian PC monitoring software and we couldn't even run Visual Studio for weeks. Nobody figured out a workaround, it was a fun few weeks. Thanks. I don't think this will be an issue going forward since I got furloughed today.
|
# ¿ Apr 11, 2020 01:43 |
|
Broad question here from a novice: For those working in .NET, what field/domain are you working in? It seems like more and more of the popular blogs/articles/tutorials are focused on front-end webdev which I have zero interest or talent in. I think it could be interesting to build a desktop app but the general sentiment is "just build it with React". So, for those of you not out there building websites, what do you build with .NET?
|
# ¿ Mar 5, 2023 01:56 |
|
Everyone posted:What we do with .NET ... Thanks for the insights, everyone. I think I'm going to try my hand at a simple Winforms app and see how it goes. My last foray into GUIs was Python + Tkinter ten years ago.
|
# ¿ Mar 9, 2023 03:49 |
|
A broad, novice question about profiling code: The game Stardew Valley (uses XNA) allows people to create mods using C# solutions. Some mods can radically impact loading times of the game. For testing purposes, I created a "hello world" Mod then built the solution which generated a single .dll file and threw that in the game folder. Is there any way to somehow hook onto the dll file being called and profile it's performance? Ultimately, my goal is to identify which of the 80+ mods being used are the culprit for the 7+ minute game load time. I don't know what I don't know when it comes to Visual Studio and profiling capabilities but I'd love to take a stab at this.
|
# ¿ May 10, 2023 04:02 |
|
brap posted:You can probably install perfview and take an ETL trace. Something comparable might also be possible within VS itself, but someone else would have to answer that. I've never used perfview before but I'll give that a look, thanks! Jabor posted:If you're just looking for a single mod, have you considered a binary search? Disable half the mods, launch the game, see if it's slow. If it is, then you know the problem mod is one of the still-enabled ones - if it's faster, the problem mod is one that you've just disabled. Rinse and repeat, looking at a smaller subset each time. I haven't tried that yet but might give it a go. Interwoven dependencies and large differences between Mod sizes for 70+ of them can mangle clean testing. I think I just became overly motivated with profiling after reading this article about someone who cut load times for GTA V: Online by 70%.. The difference being they know what they're doing, and I don't.
|
# ¿ May 10, 2023 04:32 |
|
A novice question from a hobbyist: Is it painful to call a F# library from Winforms or WPF? Can I:
At the 'Hello World' level so far, I enjoy writing in F#. But I want to create simple GUIs as well. Is combining both a bad path to take?
|
# ¿ Jan 15, 2024 21:48 |
|
|
# ¿ May 17, 2024 16:12 |
|
I got a proof of concept working in the console. I'll take a look at those F# GUI frameworks. Thanks!
|
# ¿ Jan 15, 2024 23:20 |