|
Inverness posted:"Xbox, show me something awful." I don't understand, why does it just keep showing me the Xbone home screen?
|
# ? Mar 4, 2015 12:37 |
|
|
# ? May 22, 2024 04:31 |
|
X-Posted because I found the general programming thread first... Windows 7, C# control. When my Form is "full screen" all widths that I can read seem to be 16 pixels bigger than they should be? Ie instead of 1920 its 1936 - what the gently caress did I do? This is really loving me up when I paste a full copy of my form to the clipboard as I end up with those 16 pixels on the far right side having nothing drawn there. There is no WAY its exactly 16 pixels of "gutter" at every resolution right? roadhead fucked around with this message at 21:59 on Mar 4, 2015 |
# ? Mar 4, 2015 21:54 |
|
roadhead posted:X-Posted because I found the general programming thread first... Try using the form's ClientSize.Height and ClientSize.Width properties. These ignore any sort of window border. My monitor is also 1920, but it returns 1936 if it is maximized and I call the form's Width property, whereas ClientSize will return the size of the actual usable area (1920).
|
# ? Mar 4, 2015 22:04 |
|
GI_Clutch posted:Try using the form's ClientSize.Height and ClientSize.Width properties. These ignore any sort of window border. My monitor is also 1920, but it returns 1936 if it is maximized and I call the form's Width property, whereas ClientSize will return the size of the actual usable area (1920). Not true in my case for some reason, however http://blogs.msdn.com/b/oldnewthing/archive/2015/03/04/10597470.aspx was posted in the other thread and I just check the WindowState now to decide if I should subtract those 16 pixels or not. Dirty hack that it is
|
# ? Mar 4, 2015 22:32 |
|
Why is DateTime considering invalid ISO8601 datetime strings as valid? For example "2015-02-18T15:46:23-28:30" has a -28 hour timezone offset, which seems to simply just shift the date by -28 hours. e.g. code:
|
# ? Mar 4, 2015 23:44 |
|
Built in support for outer space time.
|
# ? Mar 5, 2015 00:48 |
|
I'd probably post it to StackOverflow and hope Jon Skeet answers it. You can also check out Nodatime (from Jon Skeet)
|
# ? Mar 5, 2015 01:01 |
|
The solution is apparently to use the DateTimeOffset, which seems to be nearly identical to DateTime, it just has better support for some things. https://msdn.microsoft.com/en-us/library/system.datetimeoffset(v=vs.100).aspx
|
# ? Mar 5, 2015 01:23 |
|
UberJumper posted:The solution is apparently to use the DateTimeOffset, which seems to be nearly identical to DateTime, it just has better support for some things. Sometimes exploring the .NET framework library feels like going on an archaeological dig.
|
# ? Mar 5, 2015 01:25 |
|
Yep.https://github.com/dotnet/coreclr/blob/02084af832c2900cf6eac2a168c41f261409be97/src/mscorlib/src/System/Globalization/DateTimeParse.cs#L2484 posted:
|
# ? Mar 5, 2015 01:45 |
|
Noob idiot question: At work, we do a LOT of remote admin stuff for ridiculous industry-specific hardware via SSH that eventually drops us into weird industry-specific CLI's. We've been using SecureCRT, and me and another guy have written a good 10k+ lines of code of VBS to try to automate most of it. The problem besides it being the most spaghetti of code is that there are a TON of different scripts, and inside of those are menus on menus on menus that have to be navigated through. There's also no source or build or distribution control or anything, so on a team of 20 people, we all have slightly different versions of the scripts, and then there's complaining when someone runs into an outdated script, or has a problem with whatever code they mangled together through google. There's also some functionality that I'd like to add (monitoring certain things over a period of time, etc) that can totally be done in VBS, but the combination of SecureCRT + VBS, and the way it's all handled completely kills the workflow for doing certain tasks, and quickly turns into a gigantic mess if you're trying to play with multiple pieces of hardware at once. What I'd like to do is to create a GUI that wraps the CLI from the SSH session, while getting rid of SecureCRT and PuTTY. My coding skills outside of VBS and some very very minor arduino programming, wordpress-based PHP and CSS, and codecademy Python is basically non-existent. I played with VB6 a long time ago when it was still a semi-relevant thing, so I'm thinking of going with VB.NET since GUI creation was absolutely painless in VB6, but I'm totally open to C# (and I think that would be better for me skills-wise.) Should I go with VB.NET or C#? Is trying to roll-my-own SSH client going to be stupidly impossible, or is it doable? We're constantly adding new hardware to the network, and that means new IP's that need to be added in. I'd like to have some sort of local database that will download new IP's from a server somewhere, instead of having 1k+ ip's sitting in the middle of the code. I definitely don't mind spending a lot of time working on this, but is this possible for someone that's not-very-good at programming? invision fucked around with this message at 02:23 on Mar 5, 2015 |
# ? Mar 5, 2015 02:20 |
|
invision posted:Noob idiot question: C# and VB.NET have almost the exact same features, but C# is way more widely used and also jobs in it tend to pay better. I'd use C# if I were you. Also, why get rid of existing SSH clients? I would write a program that wrapped them, probably. It would take a really long time to actually replicate their functionality and you're likely to mess it up. However, perhaps that's the wrong question... it sounds like if you cleaned up the scripts you had and created a Git repository it might be a good starting point. Actually I'd start with the source control. If you still need to clean up or even just rewrite your progrma in C# afterward, sure, go ahead. But a lot of the problems you're talking about will not go away without it, whether you rewrite or not. e: Oh, for the IPs, you can definitely use a database, but a configuration file in JSON or XML or something might be fine. Or even delimiter-separated text if it's nothing more than a list of IPs.
|
# ? Mar 5, 2015 04:40 |
|
I'm using Visual Studio 2013 and I like the Task List and the way it can pick up the "TODO" comments you've left in your code. I'm wondering if there's a way to filter this list by project - I'm working collaboratively on a particular solution and we rarely touch each other's projects so I'd like to just see TODOs for my own project if possible?
|
# ? Mar 5, 2015 06:42 |
|
Custom Tokens are cool!
|
# ? Mar 5, 2015 07:10 |
|
Does anybody know why an application built against log4net 1.2.13 would think it needs log4net 1.2.11 as well and fail to run? It happens on some computers but not others.
|
# ? Mar 5, 2015 16:32 |
|
GrumpyDoctor posted:Does anybody know why an application built against log4net 1.2.13 would think it needs log4net 1.2.11 as well and fail to run? It happens on some computers but not others. An old version of one of your assemblies might get loaded from the GAC and expect the old version but a newer assembly might be asking for the newer version? Then I suppose that begs the question of how that old assembly of yours is still GACed but not the old library assembly, so maybe I'm talking out of my rear end.
|
# ? Mar 5, 2015 16:48 |
|
Munkeymon posted:An old version of one of your assemblies might get loaded from the GAC and expect the old version but a newer assembly might be asking for the newer version? Then I suppose that begs the question of how that old assembly of yours is still GACed but not the old library assembly, so maybe I'm talking out of my rear end. If I'm understanding your hypothesis right, that can't be it, because this happens with fresh installs, and we've never used the older version.
|
# ? Mar 5, 2015 18:20 |
|
I am calling a library method that takes a Func<Task<long>> as a parameter so it can await it in case the method is async. However, in my case I just want to return a List<T> object's count. Is the right way to do this just to pass in this:code:
|
# ? Mar 5, 2015 19:38 |
|
You should use FromResult if you already know the resultC# code:
|
# ? Mar 5, 2015 19:48 |
|
Sedro posted:You should use FromResult if you already know the result Perfect, thank you!
|
# ? Mar 5, 2015 19:51 |
|
GrumpyDoctor posted:If I'm understanding your hypothesis right, that can't be it, because this happens with fresh installs, and we've never used the older version. Correct - I was assuming an in-place upgrade without a restart.
|
# ? Mar 5, 2015 20:11 |
|
GrumpyDoctor posted:Does anybody know why an application built against log4net 1.2.13 would think it needs log4net 1.2.11 as well and fail to run? It happens on some computers but not others. Is one of its dependencies referencing 1.2.11? IIRC that was the version that log4net switched to a new code signing key, which broke usage when some assemblies in an AppDomain referenced an assembly with the old key and some referenced one with the new. As for happening on some computers and not others, it could be that the old version is being picked up from the GAC for some. e: I realize Munkeymon already asked it but be sure to check third-party assemblies too.
|
# ? Mar 5, 2015 20:37 |
|
chmods please posted:Is one of its dependencies referencing 1.2.11? IIRC that was the version that log4net switched to a new code signing key, which broke usage when some assemblies in an AppDomain referenced an assembly with the old key and some referenced one with the new. As for happening on some computers and not others, it could be that the old version is being picked up from the GAC for some. My dependency tree is very small, and I can only find a reference to 1.2.13. I used Process Monitor and some step-through debugging, and I'm pretty sure that this dependency is actually trying to load both 1.2.11 and 1.2.13 (I can tell by the paths in the GAC it checks.) According to Process Monitor, the version that NuGet installed (1.2.13) satisfies it in its quest for 1.2.11, but I guess not on all computers. The worst part of all this is that I don't even use the stupid logging functionality.
|
# ? Mar 5, 2015 23:42 |
|
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 |
|
I don't have an IDE in front of me, but isn't matches just a collection? So something likecode:
|
# ? Mar 6, 2015 03:48 |
|
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 believe that the example you posted will actually yield a collection in Groups[0].Captures, but I'm not entirely sure without playing around with it myself.
|
# ? Mar 6, 2015 04:17 |
|
I found a solution that I think is easy enough for me to remember.code:
|
# ? Mar 6, 2015 04:19 |
|
Yeah, frankly, the regex matching stuff is kinda lame.
|
# ? Mar 6, 2015 05:23 |
|
just use Regex.Matches, which returns a collection straight up
|
# ? Mar 6, 2015 05:43 |
|
GrumpyDoctor posted:I believe that the example you posted will actually yield a collection in Groups[0].Captures, but I'm not entirely sure without playing around with it myself. That could well be, I'm helpless like a baby without Intellisense/Autocomplete.
|
# ? Mar 6, 2015 06:04 |
|
Hughmoris posted:Is there a simple way to iterate through regex matches in C#? code:
|
# ? Mar 6, 2015 10:17 |
|
God F# is a nice language. Especially with type providers. What ORM?
|
# ? Mar 6, 2015 13:44 |
|
Hughmoris posted:I found a solution that I think is easy enough for me to remember. LINQPad might be a big help when you're trying to visualize object structure:
|
# ? Mar 6, 2015 17:37 |
|
Over the last year, I've taught myself WPF/XAML through excessive and varied online sources, and have developed a professional project using it paired with MVVM principles. I am sure, however, that there are a number of subtleties, tips and tricks that I have missed, and am curious if you brilliant folks could give me a recommendation: What is the best expert-level book I could acquire on WPF with the goal of fine-tuning my skills? Or, if there isn't a great book suggestion, is there a good website? ----- Munkeymon posted:LINQPad might be a big help when you're trying to visualize object structure: Wow! I had no idea there was something that could display that so nicely. I'll stow this tidbit away for later.
|
# ? Mar 6, 2015 19:58 |
|
EDIT - I got it working, leaving first part of the question in for historical reasons. However, I still want to limit access to this, so read on below the code to see the updated question! Have you guys ever programmatically accessed an FTP server that requires >active< connection from .NET? I adapted my passive code to do so: code:
The instructions from the person running the server are: quote:IMPORTANT!! Please ensure that you are in "Active" mode as "Passive" mode will not work. Active FTP requires the clients firewall to allow traffic above > 1023 from port 20 & 21. Port 20 is the data communication port that most people forget to allow. Check both hardware firewalls and software firewalls like (XP firewall). Which I believe I've done by making a pretty blanket rule of : -> In TCP Remote Port: Any Local Port: 20,21,1024-65535 and <- Out TCP Remote Port: Any Local Port: 20,21,1024-65535 But it still doesn't work, even in command line FTP (which is why I think it's a firewall problem). I know firewall questions are a bit outside the scope of this thread, but couldn't really figure out a place to put the second part of this question, which is: how to configure the firewall to let active ftp through. EDIT - This is the real question now And the last question is, if I want to limit this access to only my web application, how would I do that? Limit it to the app pool user name in the firewall? Scaramouche fucked around with this message at 22:36 on Mar 6, 2015 |
# ? Mar 6, 2015 21:58 |
|
Scaramouche posted:EDIT - I got it working, leaving first part of the question in for historical reasons. However, I still want to limit access to this, so read on below the code to see the updated question! In the windows firewall you could configure a rule that allows incoming ports from his IP Address. 1023 and up. As for your application just add the executable to "Let an application through windows firewall" configuration. Or the W3wp process.
|
# ? Mar 6, 2015 22:53 |
|
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 |
|
So apparently after writing C# unit tests for half a week. I have apparently just inherited all responsibilities as lead test developer. The company is small (~20 people), and honestly even after saying "This is a bad idea" and i don't know anything about being lead test developer, they still put me in this position. The old lead left on apparently bad terms, and there is absolutely no documentation. There is apparently a Jenkins server, that seems to be pulling from a SVN (we swapped to git a year ago). Apparently they just want to start from scratch when it comes to testing, and i am at a complete and utter loss. Does anyone have any tips for doing this kind of degree of testing for C#.
|
# ? Mar 7, 2015 01:12 |
|
|
# ? May 22, 2024 04:31 |
|
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.UberJumper posted:So apparently after writing C# unit tests for half a week. I have apparently just inherited all responsibilities as lead test developer. The company is small (~20 people), and honestly even after saying "This is a bad idea" and i don't know anything about being lead test developer, they still put me in this position. Make sure to check in with the coding horrors thread.
|
# ? Mar 7, 2015 01:12 |