Slashdot Mirror


User: the-matt-mobile

the-matt-mobile's activity in the archive.

Stories
0
Comments
199
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 199

  1. Re:Regex on Tim Bray on the Birth of XML, 10 Years Later · · Score: 1

    You can used named references instead of numbered, which has the syntax (?). This would give you practically unlimited back references. However, to deal with arbitrary tag nesting, you'd not want to use back references. You'd want to use balancing groups (http://blog.stevenlevithan.com/archives/balancing-groups). Not all regex libraries support this functionality. Actually, you'd really just want to use DOM or SAX and not reinvent the wheel, but there's no accounting for taste.

  2. Re:Regex on Tim Bray on the Birth of XML, 10 Years Later · · Score: 1

    yup (how's that for terse?)

  3. Re:Regex on Tim Bray on the Birth of XML, 10 Years Later · · Score: 2, Insightful

    How is this insightful? Yes, from a strictly comp-sci definition of a "regular expression", you are exactly right. But this is not a comp-sci class and this is not a theory lesson! In the real world where real programmers write real (crappy) code, a parser that parses only regular languages is not very useful. All modern regex parsers handle more than just regular expressions - back referencing, depth parsing, lookahead/lookbehind are all common features of modern regex engines that violate the rules of parsing a "regular language" using a simple memory-less DFA/PDA state machine. Real regex parsers use (GASP) *memory* to do their parsing. So, while you wallow in semantics and theory, people are out there are doing real (and granted silly) things with regex parsers because they can. For the purpose of this discussion, the original poster is right that it is possible (through incredibly unholy) to determine well-formed-ness of XML via a modern regex parser even through XML is not a regular language.

  4. Re:Regex on Tim Bray on the Birth of XML, 10 Years Later · · Score: 0, Troll

    Yes, thank you for the unnecessary terminology lesson, but I believe that I made it pretty clear in my post that I was referring to Regex technologies, not a formal DFA/PDA engine for a "regular" language. Thanks for playing though.

  5. Re:Regex on Tim Bray on the Birth of XML, 10 Years Later · · Score: 1

    You are confusing the difference between whether an XML document is "well-formed" vs. "valid". Assuming that your Regex engine supports the "Depth" syntax for balanced sets, you can in fact parse any well-formed XML document with a not-so-"regular", regular expression. Once the document is parsed (ie: the XML is well-formed), THEN you can use DTDs or XSDs to determine whether the XML is "valid". The validity check cannot be done by a regex - you're right about that.

    Of course, this is not an endorsement of useing regex's for this purpose - for the sake humanity, please don't do this! But, from a regex functionality standpoint, it is possible to write a regex to check for well-formed XML.

  6. Not so fast... on Tim Bray on the Birth of XML, 10 Years Later · · Score: 1

    What you want is called a balanced group. The .NET flavor or regex's have the ability to parse those (Depth keyword). See here.

    Of course, by definition, an arbitrarily nested structure is not "regular", but regex's have been adapted to do all sorts of things that really fall into the realm of what a CFG should do.

  7. Re:Can we put in requests? on Python 3.0 To Be Backwards Incompatible · · Score: 1

    Ah - a true Python believer, huh? So, you'd rather believe that someone who wants to have the freedom to format their own code is a horrendous coder rather than accept that maybe - just maybe - there are real occasion when deviating from the rigid Python rules might actually ADD to the readability of certain kinds of code. I guess we should never split a string across multiple lines or a function either. I guess copying and pasting code from a source that doesn't preserve formatting (like, oh say, a web page or e-mail) has never bitten you because indenting wasn't preserved correctly. But, feel free to bury your head in the sand about indentation. The rest of us will go on indenting our Perl/C#/Java/Ruby/C++/whaterver code for readability and practicality and leave the the true belivers in the One-Python-Way to their religion.

  8. Re:Breaking backwards comp. in languages good on Python 3.0 To Be Backwards Incompatible · · Score: 2, Insightful

    Very interesting. I seem to remember that now that you mention it. But, in line with my original point - VB.NET has changed so drastically from it's ancestor that keeping these obscure vestigial artifacts makes the language feel kludgy. The solitary "End" could have been recommissioned to close the current block, since a standalone "End" has been relegated to obscurity. Perhaps "End Program" would have worked too. I guess it probably doesn't matter and ranks lower than some of the others on my list of annoyances, but this is slashdot - Microsoft gripes abound.

  9. Re:Breaking backwards comp. in languages good on Python 3.0 To Be Backwards Incompatible · · Score: 2, Informative

    Preach it Crazy Taco! My biggest annoyances with VB.NET are the things they kept around just to make the VB6 devs feel more comfortable. Such as:

    1.) "Dim"? Why the heck did they keep the "Dim" keyword!?

    2.) When you see "SomeRandomlyNamedThing(7)", is that a method call or an array index? Why on earth did Microsoft keep parens as the array indexer?

    3.) Option Strict is off by default.

    4.) "&" for string concatenation!? I guess when you leave Option Strict Off, it's required, but blech!

    5.) You can't stop people from using Left(), Right(), Mid() and other legacy functions because you have to include the Microsoft.VisualBasic in order to get vbCrLf and vbTab. Otherwise your code would be filled with Char(10), Char(13), and Char(9) all over the place.

    6.) It's still a second class language to C#. No Yield keyword and no ++ and -- operators.

    7.) Modules. Blech. Just let people get used to the idea of static classes instead of trying to make an OO language look like a functional one.

    8.) Microsoft thinks VB devs are way too dumb to get namespaces so they try to hide them. Why on earth don't namespaces follow the directory structure of the source files by default? This is a killer when using embedded resources (which is a handy alternative to hard-coded SQL strings).

    9.) Why oh why do I have to have 'Sub's. Why can't a 'Sub' just be a 'Function' with a void return type?

    10.) Why do I have to tell VB what I'm "End"ing? "End For", "End Function", "End If" - wouldn't "End" be sufficient and then you could put a comment if you really cared what you were ending?

    I could go on and on. The worst part is - since VB.NET broke compatibility with VB6, why didn't Microsoft just go the rest of the way and make the language better? They stopped short. This, I hope, is not the fate of Python. There are many ways to make the language better (white space agnostic option perhaps?), so I hope they don't waste their decision to break compatibility by leaving purposeless annoyances like Microsoft did with VB.

  10. Can we put in requests? on Python 3.0 To Be Backwards Incompatible · · Score: 3, Insightful

    If we're breaking compatibility, can we put in requests? The 3 main things I'd like to see are:

    1.) Ditch the silly ":" at the end of the line when starting a block. Why on earth is this needed? I almost always forget to use that darn colon.

    2.) Ditch the bolted OO on "self" variable for object methods. Just make "self" a keyword and use it the way "this" works in Java/C#/C++.

    3.) Allow for a whitespace agnostic mode with the end keyword the way Boo did for goodness sake! Why on earth is that so hard? If you want significant whitespace, it can still be the default. If significant whitespace drives you mad, then use a -wsa switch and a new "end" keyword and be done with it. It would end the flamewars and make Python a more acceptable language to those of us who prefer to have the option of aligning our code the way that makes the most sense, not the way the language Guido thought it should always be.

  11. Re:Please, not Flux on What Is Your Game of the Year? · · Score: 1

    Or, try Killer Bunnies. http://www.killerbunnies.com/

    This is somewhat less random than Fluxx, but with a level of fun well beyond your typical card game.

  12. Re:somebody tell me on The Future of Google Search and Natural Language Queries · · Score: 1

    I hope you're just being rhetorical, because giving it just a bit of thought would have provided the answer. Language is a seeminlgly advanced skill, yet most humans pick it up as toddlers. If you've never had a 3-year old, let me tell you they can express some pretty complicated thought processes verbally. And it doesn't matter what language it is - the vast majority of toddlers communicate and comprehend others' communications - all when they still have not mastered so many other 'simple' things. Language is very natural - even simpler life forms than humans communicate with one another.

  13. Re:I read the topic as "Republican-Based Attack" on CastleCops.com Hit With Reputation-Based Attacks · · Score: 0, Troll

    So, what value are comments like this really? Yes Virginia, you can't read. Hooked on phonics is your friend.

    But, you ripped on the Republican party so maybe the slashbots won't mod you into oblivion for it. Ah, "News for nerds, first posts that suck".

  14. Re:Mod parent up on Blogger Finds Bug in NASA Global Warming Study? · · Score: 1

    Assuming you're not a young earth creationist, you likely believe the earth to be BILLIONS of years old. How does a 5 year average out of 100 points of data on a billion+ year old planet mean ANYTHING conclusive or even suggestive???

  15. Google is also in a postion to fix this on Why Are CC Numbers Still So Easy To Find? · · Score: 1

    The author is right, the merchants with poor security for their customers are to blame, but it's unfair to say that the credit card companies are the only ones in an easy position to fix the problem. I would think the likes of Google, Yahoo, and the other search engines could easily modify their crawlers to locate this kind of security issue. HECK, if Google refused to list *any* content from sites where their crawler picks up a customer's "private" information, these merchants would get in line real quick.

    I think that going after the credit card companies alone will not solve this problem, and is short-sighted. I think Google should also bear some responsibility (socially and morally, not legally of course) to help clean this mess up.

  16. Re:I'd like to say... on Digg.com Attempts To Suppress HD-DVD Revolt · · Score: 1

    > At that point i point out that i know people that smoke pot and they're > all absolutly normal people with jobs, families and you wouldn't be able > to spot them on the street from everybody else. I wonder if that's perhaps because you lived in Holland where it's a legal activity. Here in the states, the people I know who smoke pot (yes, real people that I actually know) tend towards the stereotypical hippy-dippy-pot-head image. Many of them can't hold down jobs or integrate into society well. I think that because it's illegal here, fewer of the normal law abiding folks tend to be admitted potheads while the "fight-the-man" types are. Personally, I'm happy it's illegal for recreational use.

  17. Re:Nevermind MS.... on De Icaza Pleads For Mono/.Net Cooperation · · Score: 1

    ALSO... Mono is pronounced Moe-no, not mon-oh.

  18. The race is on! on IE and Firefox Share a Vulnerability · · Score: 1

    It will not only be very interesting to see who releases a patch first, but also by what margin.

  19. Ug... "he or she" is a schmo! on Is A Bad Attitude Damaging The IT Profession? · · Score: 2, Interesting

    Ug. Your prof was/is a total schmo. The whole "he or she" thing drives me bonkers! Writing drivel like that is a sure fire way to cause your audience to lose track of what you're actually saying, and perhaps even count you as a class A moron.

    The word "they", while not proper English, is a grammar tool used to overcome a deficiency in the English language - namely, that a singular, gender neutral pronoun doesn't exist. When I read "he or she", it's just plain awkward. Likewise, when I read the word "she" when not referring to a specific female, the stench of political correctness makes the sentence unbearable. "They", while not *proper* English, is the only non-distracting way to express a singular, gender neutral pronoun and I'd even go so far as to say it should ALWAYS be used in place of "he", "she", and "he or she" for this purpose. Everyone should write this way until whomever it is that decides what constitutes "proper English" gets tired of being beaten with a giant clue stick.

    [% END RANT %]

  20. Sony's the only 1 on that list throat-cramming B-R on No Love For The Blu-Ray · · Score: 1

    No, Sony is the only one on that list that is purposely damaging themselves (and gamers) with Blu-Ray by tacking it to the PS3. The other companies are letting the tech stand on its own and letting the market decide. Sony is bundling it in a vain attempt to get it into living rooms by playing off the popularity of the PlayStation brand. They either believe that Blu-Ray technology or the PlayStation brand is SO GOOD, that consumers won't mind its terrible effect on the price of the PS3, as well as its lateness to market. I think Sony grossly overestimated. It's NOT a value-add, but more like a tax on buyers of the PS3. If I want a console, I'd like to buy just a console please. If I wanted Blu-Ray, I'd buy it. I think (hope) they just priced themselves out of the market.

  21. Re:The "Business Argument" on Companies 'Blah' About Vista · · Score: 1

    I read slashdot, yes. But I'm no slash-bot. I disagree with the prevailing liberal politics here, the Microsoft bashing, and most of the other drivel. I'm here just looking for the occasional gem.

    So, since you speak of this great Vista-Speech-Recognition, show me the proof . Microsoft had Speech Recognition since the Win3.1 days - I could say simple things like "minimize", "maximize", etc. and do common windowing functionality. So, they've had nearly 15 years to improve since that time - show me the links, the video, the reviews. I'd love to see it.

  22. Re:The "Business Argument" on Companies 'Blah' About Vista · · Score: 1

    From what I've heard, the speech recognition doesn't work. Also, Windows Power Shell won't ship with Vista - it's a downloadable add-on. The rest of your list is utterly unimpressive. What else?

  23. Re:Microsoft and regex on Java Regular Expressions · · Score: 1

    VB has had regular expressions available to it for about 8 years now. In VBScript, they're built-in, and in VB you just make a COM reference to "Microsoft VBScript Regular Expressions 5.5". See this article for details - http://support.microsoft.com/default.aspx?scid=kb; en-us;818802

    And don't let the date of the article fool you - though it was written in 2006, you've been able to use regexes in VB since the late 90's. That being said, I've always found Perl's implementation to be faster and easier to use.

  24. Frequent updates are likely unnecessary on Getting Open Source to the Dialup Masses · · Score: 1

    I'd estimate that most patches these days are due to software vulnerabilities. If these machines aren't connected to the internet full time, then the need to patch frequently probably diminishes some. Though, you are right - the problem still persists for functionality bugs.

  25. Smoke breaks? on A Study On Time Wasted At Work · · Score: 4, Insightful

    I'm amazed that there's no mention of smoking in the article at all. I wonder if it was even considered. Our workplace, like many others recently, has gone smoke free which means all the smokers are likely to disappear for 1/2 hour or more 3-4 times a day to get off the grounds to have a smoke. Some even get around the "no smoking on any company property" rule by standing in the street. It may not be the number one time waster, but it'd got to be up there.