The entire US Code is now online in XML
131–140 of 244 posts
Re: The entire US Code is now online in XML
#132Earlier quoted context omitted.
You make this sound like a bad thing. Would you really prefer "black and white" laws that leave zero room for flexibility or interpretation in light of a given situation?
Yes, we should have black and white laws, and unit tests for them. So someone could write a unit test for "Will this allow the NSA to create a secret court that is outside the rule of law?" or "Does accessing a university computer that has an open access policy allow for a sentence of 130 years?" I believe we'd see a lot simpler laws.
Re: The entire US Code is now online in XML
#133Earlier quoted context omitted.
> Since it's aimed at line-oriented code, it does line-based diffs You can do word diffs with git: git diff --word-diff=color
It's still recreating a word based diff from a line based diff. See diff.c line 793 for how it works.
Test the first. This will check if reflowing
text actually produces git word-diff weirdness,
or if it's actually decent.
The line does get reproduced on the terminal (a line diff was seen), but no text is shown in green or red to indicate an actual change.Re: The entire US Code is now online in XML
#134Earlier quoted context omitted.
It's still recreating a word based diff from a line based diff. See diff.c line 793 for how it works.
It may be doing that conversion, but the conversion works. For example, committing the following text (with line breaks), then joining it all into one line, shows no differences when using 'git diff --word-diff'. Test the first. This will check if reflowing text actually produces git word-diff weirdness, or if it's actually decent. The line does get reproduced on the terminal (a line diff was seen), but no text is sh…
[-Section 2 of act-]{+Act+} July 30, 1947, ch. 392, {+Sec. 2,+} 61 Stat. 674, provided that
Wonder if there's a way to enable that behavior on GitHub? And/or to generate repository activity statistics based on changed words rather than changed lines?Re: The entire US Code is now online in XML
#135Earlier quoted context omitted.
Remember that diff is an algorithm to generate the smallest set of operations to produce version B from version A, not an accurate reconstruction of what happened. Diff algorithms are also often tuned not try as hard to find the smallest set of changes for larger documents, due to speed concerns.
Git's built-in diff algorithm is particularly bad for text. Since it's aimed at line-oriented code, it does line-based diffs, which is horrible for ASCII text that is reflowed, because every line in a paragraph will show up as changed for a small change. Example: https://github.com/divegeek/uscode/commit/1fb2d83137dad1c6ca... What's happened is that "Section 2" was moved later in the sentence, abbreviated as "Sec. 2"…
as far as words in lines, you do have a point.
Re: The entire US Code is now online in XML
#136Caveat for for many of us overly rational thinkers: the powers that be deliberately are allowed to 'interpret' this code nondeterministically by many different means including its 'spirit,' admissibility of relevant information, manipulation of venue and participants, apparently even extrajudicial proceedings lately. In short, that allows a lawyer to answer almost any question with "it depends," and start billing.
Re: The entire US Code is now online in XML
#137Earlier quoted context omitted.
It would be even awesome-er (and more useful) if you could parse individual bills and amendments into diffs, which get merged into 'master' as they become law. I'd love to `git blame` the U.S. code.
But that only works at the shallow level. A crook can get around that by asking/bribing/convincing someone else to be the one who's responsible for the amenment.
Re: The entire US Code is now online in XML
#138If you were to start a new country, what would the legislative process look like there? For example, how should new "startup nations" like BlueSeed ( http://blueseed.co ) inspired by Seasteading Institute go about passing and storing laws? Should they have some sort of open github repo to which anyone can make pull requests? How do you see the congress of the future?
Usually countries inherit the laws from the country they are decended from.
Re: The entire US Code is now online in XML
#139http://www.gesetze-im-internet.de/
All laws are available in XML, HTML, PDF, etc. The site also provides an RSS feed.
In addition, some enthusiasts regularily download stuff from there and apply those to a Git repository:
https://github.com/bundestag/gesetze
That way, this repository contains not only the current laws, but also the history of how the laws developed!
For the Git repository, the XML version is not used directly, but converted to markdown. This produces very readable diffs:
https://github.com/bundestag/gesetze/commit/f90e8fc8eb20f081...
Wouldn't it be cool if we could finally manage our laws of filing pull requests?
Re: The entire US Code is now online in XML
#140Earlier quoted context omitted.
You make this sound like a bad thing. Would you really prefer "black and white" laws that leave zero room for flexibility or interpretation in light of a given situation?
Yes, we should have black and white laws, and unit tests for them. So someone could write a unit test for "Will this allow the NSA to create a secret court that is outside the rule of law?" or "Does accessing a university computer that has an open access policy allow for a sentence of 130 years?" I believe we'd see a lot simpler laws.
That's one reason that, in addition to being an interesting challenge domain for AI researchers, it's interesting to logicians, who aim to come up with logics and decision procedures that can capture what a decision procedure in law looks like (classical first-order logic and theorem-proving don't seem to model it well). The main short-term application is to reasoning-support systems that can suggest potentially winning arguments, point out obvious holes in draft arguments you were going to make, etc., sort of the legal analogue of medical diagnostic systems.
A classic paper from 1977: http://www.cs.rutgers.edu/~mccarty/research/hlr77.pdf
A more recent system aimed at interactive use: http://www.ai.rug.nl/~verheij/publications/pdf/ai2004.pdf
A book, albeit priced at the usual Springer price-point that assumes no non-library human will buy it: http://www.amazon.com/gp/product/3642064329/ref=as_li_ss_tl?...