OpenLLM-France/wikimedia huggingface dataset:
# Windows Vista/Activation

As with all versions of Windows released since, Windows Vista requires product activation with Microsoft’s servers. This process permanently links the product key entered during setup to the PC you installed it on. Once a copy of Windows was activated, that product key would no longer function on any other computer. If a user tried to activate Windows on a different computer following successful activation elsewhere, an error would be displayed. Note that this does not impede reinstalling Windows on the same computer, if you have purchased a full version and not an upgrade disc. (If you installed Windows on a blank partition using an upgrade-only disc, Windows would refuse to activate.) Microsoft requires in the license agreement that all installations of Windows Vista be activated.

### The grace period

When installation is completed, the system will start a 30-day grace period in which the computer will run and be fully functional without activation (although it will display pop-ups reminding the user to activate). At the end of this period, Windows would enter Reduced Functionality Mode (except if successfully activated). In Reduced Functionality Mode, Windows would present non-closable windows every hour, on the hour, complaining that the computer has not been activated. Access to other features may also be blocked. (Windows also enters Reduced Functionality Mode following an attempted activation if the product key used during Windows installation did not match the edition installed, or if the product key was already activated on another computer.)

### SLMGR.VBS

There is a fully supported technique that resets the grace counter on an unactivated copy of windows to a full 30 days. This can be successfully performed up to three times. To do this, the user would open an elevated (Administrator) command prompt and run the command slmgr.vbs -rearm, and then reboot. This program can also be used to activate Windows from the command line (slmgr.vbs -ato), change the product key used on an existing installation (slmgr.vbs -ipk), and various other functions.

## Windows Anytime Upgrade

Windows can be upgraded from certain editions to certain other editions through purchasing an upgrade disc through Microsoft’s Windows Anytime Upgrade program. The process is identical to installing Windows Vista as an upgrade install. Note that Windows Anytime Upgrade requires a second, different product key. If the original product key used to activate the old edition was entered, Windows would fail to activate.
# Windows Vista/Introduction

Windows Vista, a version of the Microsoft Windows operating system, was released to manufacturing in 2006. It is the successor of Windows XP but is extremely different than any prior version of Windows. Vista’s hardware requirements and reputation for annoying security prompts prevented the OS from succeeding in the market. Its successor, Windows 7, was released in 2009. Windows 7 was almost exactly the same as Windows Vista. Microsoft attempted to distance itself from the marketing failure that Windows Vista had become by changing the branding. Windows 7 saw wide adoption.

### Major changes in Windows Vista

* Translucent window borders and Flip 3D (these features were removed in Windows 8)
* Rewritten OS installer system (that is still in use)
* BitLocker was introduced, providing strong encryption of internal hard drives only
* Protection against spyware was added as Windows Defender (full antivirus would not be included until Windows 8)
* Completely overhauled security model, including the introduction of User Account Control
* Overhauled inbox games, all of which are 3D-accelerated
* Significant improvements to system search
* A redesigned Start menu
* Windows Sidebar and sidebar gadgets

### Other notable changes

* A new error message that appears when users attempt to rename a folder to an invalid name. (In previous versions of Windows, attempts to rename files or folders to reserved MS-DOS device names, such as CON, were silently reverted.)
* Windows Vista does not permit the user to change the system clock to an invalid time due to daylight saving time rules.

### Feature comparison table

| Feature | Windows XP | Windows Vista | Windows 7 | Windows 8 |
| Windows Aero | No | Yes | Yes | No |
| Modern installer | No | Yes | Yes | Yes |
| BitLocker | No | Partial | Partial | Yes |
| Anti-virus | No | Partial | Partial | Yes |
| User Account Control | No | Yes | Yes | Yes |
| Games | Partial | Yes | Yes | No |
| Start menu search | Partial | Yes | Yes | No |
| Gadgets and sidebar | No | Yes | Partial | No |
| Upgrade compatibility | from Windows 98/NT and older | from Windows XP only; partial support for Windows 2000 | from Windows Vista only; partial support for Windows XP | from Windows 7 only; partial support for Windows XP/Vista |
# US Constitutional Law
## Table of Contents
### Introduction

    Introduction
    The Constitution
    Judicial Review

### Governmental Structure

    Introduction
    Legislative Branch
    Executive Branch
    Judicial Branch
    State Government

### Liberty

    Freedom of Religion
    Freedom of Speech
    Freedom of the Press
    Criminal procedural rights
    Privacy Rights

### Equality

    Race and Ethnicity
    Sex
    Sexual orientation

### Jurisprudence

    Living Constitutionalism
    Originalism
    Textualism
    Strict Constructionism
    Purposive Approach
    Minimalism
# US Constitutional Law/Freedom of Speech

The Freedom of Speech is guaranteed by the Constitution in the First Amendment. The Supreme Court of the United States perhaps protects this aspect of the First Amendment the most among all the clauses found therein, with Freedom of the Press being tied with it. Nevertheless, the Supreme Court has found that there are exceptions to this freedom in very limited contexts. In some other instances, the Supreme Court has defined certain other aspects of speech to be constitutional where a first glance may appear to not be.
Do we have the right to contribute money to political campaigns on the basis of freedom of speech? Do students have the right to display a banner that reads "Bong Hits 4 Jesus" at a corporate-sponsored rally in which the school gave permission to attend? What limitations, if any, do commercials have when advertising? Do we have the right to sit during the pledge of allegiance even when compelled to by law or government actor? Am I allowed to burn the flag in a public event? Do I have the right to ignore loyalty oaths or affirmations if it is against my beliefs?
These were questions addressed by the Supreme Court on some occasion or other, and these are not all the questions addressed by the Supreme Court. Here is a wikipedia page that lists more cases that the Supreme Court has addressed.
# US Constitutional Law/Introduction

In 1787 the Constitutional Convention drafted a proposed new charter for the government of the United States. The Constitution was designed to make the federal government a more effective means to avoid wasteful tariff competition among the 13 states and to pay off the national debt. The Articles of Confederation's shortcomings led to the question to be settled is "Who gets the last word?" In the pre-amble it clearly states "We the People" and that is the understanding that led to the use of separate ratifying conventions in each state.
While some view Constitutional law, like Larry Kramer, as more than just the courts's review of the actions of government, most people limit the topic to just the work of the courts and mainly the United States Supreme Court at that.
After covering the origin of Judicial Review, there are two main areas of ConLaw: Rights of persons and citizens - and - powers of government.
# US Constitutional Law/Introduction to Governmental Structure

The U.S. Constitution, ratified on June 21, 1788, contained no Bill of Rights.
# XQuery/HelloWorld
## Motivation

You want to run a small program that tests to see if your XQuery execution environment is working.

## XML Output

Execute

### Discussion

The program creates a temporary variable called $message and assigns it a string value. The output is an XML element containing a message element which contains the value of the variable.

### Suggestions

Try omitting the curly braces from inside of the result message element. What do you get? Execute
What happens if you omit the results wrappers? Execute

## Plain Text

You can get XQuery to return plain text using serialization options which define the serialization and the output media-type.
For example to output the message as text, specify the serialization as text and the media-type as text/plain.
Execute

### Expected Output

Depending on your browser set-up, this will launch a viewer for text documents and display
# XQuery/Higher Order Functions
## Motivation

You have a sequence of items and you would like to perform several sequential operations on each of the items in the sequence.

## Method

You would like to use a single function where you pass a series of functions as parameters to that function.

## Background on Functional Languages

Functional languages are languages that treat functions as first-order data types. They frequently have a function that let you pass a list of items and tell it what function to perform on each of those items. Just like XML transformations, functional languages are ideal when you have many small tasks to perform on a large number of items. Functional languages are excellent for these tasks since the actual order that the functions get executed on items does not have to be guaranteed. The developer does not have to be concerned about waiting for a transformation on item 1 to finish before the system starts on item 2.
The Google MapReduce algorithm is an example of functional systems. MapReduce allows a data set such as "all web sites" to be treated as a sequence of items. MapReduce then has different processors each receive small items of work that can be processes independently.
For more on functional languages see Functional programming on Wikipedia and Functional Programming on Wikibooks.
Because XQuery is also a functional language, you can also have the confidence that a large list of items passed off to an XQuery function can run independently on many processors without the concern of incorrect results if the items are processed out of order.

## Simple example

In the following example we will declare two functions. We will then process a list of words by applying these functions to each of the items in the sequence. We will do this by passing the function name as an argument to another function.
NOTE: This only appears to work in eXist 1.3. eXist versions 1.2.X have the wrong data type associated with the QName function.
The eXist system needs to turn each function into a function identifier. To do this it needs to call util:function. util:function takes two arguments, the qualified name of the function (the prefix and the function name) as well as the arity of the function. In this case the arity of a function is the number of arguments that the function takes. The data type of the first argument must be of type QName. The data type of the arity, the second parameter, is an integer.
util:function($function as xs:QName, $arity as xs:integer) as function
# XQuery/HTML Table View
## Motivation

When we have an XML file with uniform tabular structure, with no repeated or compound children, a generic table view is handy. We can use the XML element names as the column headers.

## Sequence as HTML Table

Here is a function which achieves this. It takes a sequence of elements and creates an HTML table, one row per node in the sequence. It uses a little introspection with the name function to get the names of the children of the first node to form the column headings. For each node, the children is accessed by node name so that there is no requirement that all elements are present or in the same order as in the first node.

## Example

Given XML with a uniform tabular structure
the following script will create the HTML table:
Execute

## Discussion

This approach is ideal if you know that the first node in a dataset has all the elements for all the columns in the table.
This approach is used in the later Database example to display computed sequences.
The following line must be added if you are using strict XHTML. This puts all the HTML tags (<table>, <htead>, <th>, <tbody>, <tr> and <td>) in the correct namespace.

## Sequence as CSV

A similar approach can be used to export the sequence as CSV.
Execute

## Discussion

To save the file directly from the browser to a named file for loading intol a spreadsheet, add :
# XQuery/Gotchas
## generalised equals

= is a sequence comparison which is true if the intersection is not empty. Thus:
and
but there are some oddities. For example
is false, as is
The operator eq is used to compare values only.

## Arithmetic operators

The minus sign needs space around it since $x-3 is a valid variable name which is not the same as $x - 3.

## Matching brackets etc

Check carefully for matching single and double quotes, round and square brackets and curly braces. The java client will show the matching bracket, but errors are often poorly diagnosed by XQuery compilers.

## Binding

The abbreviated form in which multiple binding statements can be separated by a comma:
Abbreviates to
is convenient but can lead to errors when code is amended. Consider avoiding this syntax.

## Conditional expression

The conditional expression must have the else part. Return the empty sequence if one alternative is not required:

## Sorting

'Order by' sorts numbers as text
To get it sorted as a number, you have to use the number function
or cast to a number type
or

## XML construction

You can build XML by simply starting a tag. These tags are really XQuery expression operators. However, this puts you in a lexical scope where everything is XML and curly braces then switch back to normal XQuery (and an open tag will then switch back to XML). Escape curly braces with double braces ({{ }}).
Note the toggling between XQuery and XML construction modes:

## Comments

Comments in XQuery use (: ... :) whereas comments in XML use <!-- ... -->
It is easy to use the wrong kind in the wrong context, particularly XQuery comments in constructed XML.
makes the comment the text part of an XML element.

## let

let statements are part of a FLWOR expression and can't appear alone. XQuery is a functional language and let statements are only temporary bindings of names to expressions.

## function result

return is not required in functions. It is part of a FLWOR statement and not a statement in itself (like let). So it is not required and not allowed if there is no for or let.
or
but not

## Rounding with double and floats

You might be surprised at that the result of the following:
is 6.30000000000001 This is because number casts the values to double and the double precision numbers round values using an algorithm that is statistically close when using many numbers but fails in specific test cases like this. This is not technically an error and other systems (Scala, ruby, python etc.) will also generate the same errors. The way around this is to not use the number function, but cast to an xs:decimal.
# XQuery/Graph Visualization with Graphviz

Graphviz developed by AT&T provides a package of code for generating graph images from a text definition.
The input file in 'dot' format can be generated by an XQuery script with text output.

## Motivation

You want to create a graph to visualize complex structures such as taxonomies, object hierarchies or organizational hierarchies.

## Database visualization

A graphical representation of the relationships between employee and manager in the empdept example.
This script generates the dot format file, with employees as (implicit ) nodes and arcs from employee to manager to show managed by relationships.
The output is serialised as text. Serialisation strips out all XML tags so XML can be used to structure the output and there is no need to serialise each item. The Graphviz dot format uses { } curly brackets as delimiters so these need to be escaped (doubled) in XQuery.
Generate dot file
To process dot format files with SVG, we can use a module such as this on <a href="https://github.com/KitWallace/xquery-graphviz">GitHub</>. Because this module uses the process:module, the script must run with db access rights.
SVG image
This would look more like a typical organisational chart if the graph was reversed. Graphviz provides a wide range of controls over the content and appearance of the graph.
SVG graph
Since Enames are not necessarily unique, it would be better to use the EmpNo as the node identifier and label the node with the name:
SVG graph
Similarly, the Department/Employee Hierarchy can be graphed:
SVG graph
# XQuery/Grouping Items
## Motivation

You have many items in a set of data that have a category associated with them. You want to create a report that sorts the items by a category.

## Method

We will perform the query in three steps.
* use a FLWOR statement create a sequence of the distinct categories using the distinct-values function
* for each item in the category sequence, select all items that belong to that category. This will be done by adding a predicate (where clause) to the end of our XPath selector. This takes the form of data/item[x=y] where if x=y returns true the item will be added to the sequence
* for each result set in the FLWOR statement return the category name and then all the items in that category

## Sample Query

The following XQuery will demonstrate this technique. Note that the distinct values for all the categories are stored in the $distinct-categories variable.
In the query above the statement:
reads as "get all the items from the data set that have the category element equal to the current category.
The string-join function just puts a comma and a space string between the items in the output stream for readability.

## Sample Output

| Category | Items |
| red | item #1, item #3, item #5, item #8 |
| green | item #2, item #7 |
| blue | item #4, item #6 |

## Discussion

Note that you are not restricted to having an item be in a single category. Adding multiple categories to an item will not require any changes to the script.
You can also add new categories to this list at any time without changing the program above. As long as there are range indexes for the category element the list of all categories will be created very quickly, even for millions of records.
# XQuery/Guest Registry
## Guest Registry
### Dan McCreary

I am using this book for teaching XQuery to my students. Most of my work is in the government and financial sectors. I am using XQuery with REST and XForms.

### Chris Wallace

I am using this book mainly as a repository of example programs since I use XQuery on nearly all the websites I make. Not much opportunity to teach XQuery these days. Currently working on moving the executable examples from my old university server to my own and bringing code up to date.

### Jim Fuller

I am using this book for teaching some aspects of XQuery to people I mentor professionally and also plan to use for a University course in Prague this September.

### Rajamani Marimuthu

I am using this book for creating samples and some real time applications for the users .. and also for teaching to my colleagues and learners.

### Dominique Rabeuf

I am using this book for creating XForms/XQuery samples and applications

### Chris Cargile

I am using this book for creating XQuery samples for research purposes

### Joe Wicentowski

I am using this book to capture community innovations in XQuery and develop best practices. I am using XQuery with REST and XForms.

### Esteban Arango Medina

I am using this book to learn about XQuery, I need it for a project where I'm working in my university (EAFIT University).

### Chris Misztur

I am using this book to learn eXist-db practices and to advocate XML platforms.

### Rajesh Pandian M

I am using this book for learning XQuery,Xpath as a part of my course work. The examples given are very informative.

### Carl Burnett

I am using this book to teach XML technologies in my XML Introduction and Advanced courses at the Montgomery College, Information Technology Institute in Maryland.

### Luca Guariento

I am using this book for deepening my knowledge of XQuery, which I use in many digital humanities projects.

### Raymond Lee

I am using this book as a reference for finding my way through using XQuery to develop and maintain interfaces between the web and online machine learning

### Russell Watson

I am using this book to learn XQuery in order to develop XQuery-based analyses of FileMaker databases. Wish me luck!
# XQuery/Google Geocoding
## Motivation

You have one or more geographic names and you want to create a map of these locations.

## Method

We will use a Google RESTful web service to return geographical data from a list of place names. Google provides an HTTP-based Geocoding service. This requires registration of a site for a API key and there are limitations on the usage of this API. Results can be returned in XML or JSON.

## Querying Google's API

The following script takes a location and returns the xml from the service:
If you have GoogleEarth, this should load an overlay showing multiple Bristol locations: Bristol KML

## GoogleMap

A simple way to view the generated kml is to use GoogleMaps. This script simply constructs the relevant URL to use the script above and then redirects to that URL:
Sadly this approach no longer works with GoogleMap - see support lost Bristol
An alternative approach is to use GoogleMap's JavaScript API. Note that to embed JavaScript requires doubling { so it is generally easier to put the Javascript in a separate file. This approach makes use of any existing kml overlay and is simpler, but more restricted than implementing the map using the JavaScript API

### Examples

[Setting the zoom level doesn't seem to work]

## Data to overlay

Often the locations are defined in a data file. The following script reads a local file of (a sample of ) whisky distilleries and creates a KML overlay.
Whisky overlay
and a modified version of the JavaScript can use the output to create a Whisky map
# XQuery/Graphing Triples

The RDF Validation service can be used to graph RDF, but since this expands prefixed names to full URIs the graphs can look rather un-readable as examples.
This service is for drawing simple triple graphs where each triple is defined in a local XML format in which each triple has attributes subject, property and object. [XQuery function to convert RDF to N3 needed]
Subjects and objects are drawn as nodes, triples as arcs with the property as the label. If the subject or object contains ':' or starts with 'http://', then the node is shown as an ellipse. If it starts with '_' it is a blank node and an unnamed circle is shown; otherwise the node is assumed to be a literal and is drawn in a box.

## Parameters

* url : url of triples in the xml format illustrated above
* dir : LR - left to right (default), TB - top to bottom [ rankdir in Graphviz]
* title : title for graph - default none

## Example

From page 11 of the RDF primer
dot Output
GIF Image
http://www.cems.uwe.ac.uk/~cjwallac/apps/services/dot2media-v2.php?url=http://kitwallace.co.uk/rdf/xquery/triple2dot.xq?url%3Dhttp://kitwallace.co.uk/rdf/data/triplesExample.xml

## Usage

Either save the generated gif, or use 5clicks or similar to capture the image on the screen. One way to print large GIF images is to save the image, then insert it into an Excel spreadsheet. Excel will print the image over multiple pages. Reduced in size and with page borders removed, even large graphs can be printed and then taped together.

## Source

This script would be improved by the use of an intermediate XML structure and a XSLT script to convert to dot.