I think this site is the best tutorial/guide to regular expressions: http://www.regular-expressions.info/tutorial.html Clear descriptions of everything from simple to complex. --- I like this site for testing expressions: http://www.regexr.com/ It's an online testing tool (plus a downloadable version if you like). Paste in your expression, paste in your text, see where it matches, with analysis, hover over matches to see groups.
syspau
Posts
-
Regular Expression - Achievement unlocked -
Study Shows Eating Bacon Will Make You Live LongerIn his movie, Sleeper", didn't Woody Allen's character find out that in the future it was considered "health food"?
-
How about including Java as one of the .NET supported languages?I've already said that I like C# a lot. You don't have to try to convince me of anything by listing the 20 ways you think it's better than Java. I do not dispute that that is mostly true, libraries aside, although that cannot be totally dismissed. All I said is that there are some things I like better in Java. For instance, Java's inner classes are in my opinion better than C#'s nested classes because inner classes automatically have access to methods and instance variables of the containing class. So for instance, to start a method as a thread and pass parameters to it, create an inner class that extends Thread, instantiate it with your arguments, and when you start it, it calls the method in the containing class with those arguments, which is simpler than you can do with C#. Also, I do not think it is a great idea to have to declare a method as virtual before it can be overridden. In Java, you can extend any class that is not Final and override methods without updating the source code for that class in order to declare those methods virtual. This is sometimes inconvenient or impossible if you do not have access to the source code. BTW, the opposite of verbose is terse. I never said Java was terse. It is in fact more verbose than C#, but it is concise. For instance, in C#, you can declare a variable as type "var" and letting the compiler figure out the actual data type by the value that is assigned to it. I like strong typing, and I prefer to see what that type a variable is, at the place where it is declared. I consider that less precise. I consider these things minor points, and I am not looking to engage in any kind of religious war over this. I thought I just made a simple comment. Nearly every programming language has some features or aspects that make it unique and different and worthwhile is some respect. As I said, I like C# a lot, and I do not believe that Java should be a .NET supported language, which was the main discussion point.
-
How about including Java as one of the .NET supported languages?If you are implying that you can only have ugly, slow user interfaces in Java, you are dead wrong. I have written applications using Swing that are as nice and usable and as fast as anything I have used anywhere. If you are seeing ugly, slow user interfaces, blame the incompetent programmer who failed to properly learn his tools!
-
How about including Java as one of the .NET supported languages?Shouldn't the word "improve" be in quotes? I think that there is a matter of opinion there. I have used Java. I like it a lot. I like Swing and RMI, and the concise syntax. I am now mostly using .NET, C# and also VB.NET. I like .NET a lot also, particularly C#, which is very similar to Java. There are some things I like better about C# over Java, but there are also some things I like better about Java than C#. Of course Java does run on more platforms than Windows.
-
Coding file paths to a server or network shareI've just done what I think you are looking for. Here is VB.net solution: Private mappedDrives As New SortedList(10) Private Sub MapDrives() Dim Drives() As DriveInfo = DriveInfo.GetDrives() Dim letter As String Dim uncpath As String For Each Drive As DriveInfo In Drives If Drive.DriveType = DriveType.Fixed Then letter = Drive.Name.Substring(0, 1) uncpath = "\\" & hostName & "\" & letter & "$" mappedDrives.Add(letter, uncpath) ElseIf Drive.DriveType = DriveType.Network Then letter = Drive.Name.Substring(0, 1) uncpath = GetUNCPath(Drive.Name.Substring(0, 2)) mappedDrives.Add(letter, uncpath) End If Next End Sub If DataFileOpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Dim filepath As String = DataFileOpenFileDialog.FileName Dim uncName As String = filepath If Not filepath.StartsWith("\\") Then Dim driveLetter As String = filepath.Substring(0, 1) uncName = CStr(mappedDrives.Item(driveLetter)) uncName &= filepath.Substring(2) End If End If Cheers, Phil
-
VCRs - luddite rant!You could get yourself a wireless bridge: connects to your wireless router, and provides wired connections to devices with only wired ports. I set up one of these next to my Internet enabled TV and blue-ray player, which can both now access the Internet, through my wireless router located downstairs in the basement. I used a Zyxel WAP3205. Cheapest available (I paid $50 on Amazon), but only does 2.4Ghz, which I didn't realize at the time as I was looking only for "N". I also considered a D-Link DAP-1522 (about $20 more), which I now see works at both 2.4 and 5.0 Ghz.
-
Old WindowsBullfeathers!!! You cannot seriously make such a blanket statement. Sure, there are programmers who cannot build a good UI. There are also programmers who cannot program their way out of a paper bag! But there are many, myself among them, who are talented in many areas, including UI design. BTW, who do you think writes all the code that actually makes the UI actually do what it's supposed to do?
-
Stupid Java<blockquote class="FQ"><div class="FQA">Electron Shepherd wrote:</div>I have yet to see a Java program that runs as fast, looks as nice or is as feature-rich as a native platform application.</blockquote> I've written such applications, thank you very much! Once you learn how to use Swing, you can build Java GUI applications every bit as feature rich, and not noticably slower than a native Windows app. You can have every single window intelligently resizeable. There are a lot of bad applications written in every language, for every platform, and there are also good ones, just as there are bad programmers and good ones.