--- layout: post date: 2012-12-04 22:53:00 +0100 title: "RC bugs" categories: Artikel tags: - debian ---
I recently worked on the following RC bugs:


I think this is a really good example of chunking because it does not use a ton of information at one time so the reader would have a better time remembering the things that they read.
http://www.aquariusrecords.org
This is a really bad example of chunking because there is so much information bunched up in 1 major area that if someone was to visit this website, they might feel overwealmed by information.
I think this is a really good example of signal-to-noise ratio because this website does not have a lot of additional things going on that could potentionally draw someones attention away from the main purpose of the website itself.
I think this is a really bad example of signal-to-noise ratio because there are a lot going of things for viewers to look at and not enought open area on this webpage.
I think this is a really good example of Ockham's Razor because it is a nice simple design that gets the job done. It is not overly done and bombarded with a lot of colors and things of that nature.
http://www.lab404.com/dreams/library.html
I think this is a really bad example of Ockham's Razor because this website has entirely too much going on. The background color is entirely too bright and it is very hard to understand the main purpose of this website.
I think this is a really good example of Golden Ratio because this website is proportionally sound. Everything on this website goes together from the width, to the height, to the margins. It looks very well put together.
I think this is a really bad example of Golden Ratio because the margins on this webpage are completely off. Different sections of this websites are at different heights and some of them are even overlapping one another.
I think this is a really good example of Hicks's Law because this website is very simple and it does not give you a ton of different things that you can click on. This makes it very easy for viewers to navigate through this webpage.
I think this is a really bad example of Hicks's Law because there are so many different things that viewers can click on. The drop down menus have a lot of different options and that can be a bit overwhelming for someone who does not like a ton of information.


Full Table of Contents¶
Overview and Getting Started:¶
Examples and Applications:¶
Fortran and Python codes:¶
- Fortran version
- Fortran Compilers
- User files required for the Fortran code
- Using OpenMP
- Python Hints
- IPython notebook examples
- Clawpack Makefiles
- Application documentation
- Specifying classic run-time parameters in setrun.py
- Sample setrun.py module for classic Clawpack
- Boundary conditions
- Output data formats
- The mapc2p function
- Checkpointing and restarting
VisClaw: Plotting and Visualization Tools¶
- Visclaw Plotting options
- Plotting options in Python
- Using setplot.py to specify the desired plots
- current_data
- Plotting examples
- Plotting hints and FAQ
- What’s the difference between make .plots and make plots ?
- How to plot a something other than a component of q?
- How to add another curve to a plot, e.g. the true solution?
- How to change the title in a plot?
- How to specify outdir, the directory to find fort.* files for plotting?
- How to specify a different outdir for some plot item?
- How to set plot parameters that are not provided as attributes of ClawPlotItem?
- How to change the size or background color of a figure?
- Specifying colormaps for pcolor or contourf plots
- How to debug setplot.py?
- GeoClaw plotting tools
- Plotting using Matlab
- Plotting with VisIt
AMRClaw: Adaptive Mesh Refinement¶
GeoClaw: For geophysical flows¶
- GeoClaw
- Cautionary Hints on using GeoClaw
- Topography data
- Python tools for working with topo and dtopo
- Specifying GeoClaw parameters in setrun.py
- Plotting routines for GeoClaw
- Quick start guide for tsunami modeling
- Earthquake sources: Fault slip and the Okada model
- Setting sealevel
- Manning friction term
- Fixed grid output
- Fixed grid monitoring
- Some sources of tsunami data
PyClaw: Python tools¶
Includes PetClaw, Using PETSc for parallel efficiency.
- Pyclaw
- PyClaw is:
- PyClaw Documentation
- PyClaw Basics
- Going Further
- Understanding Pyclaw Classes
- Information for developers
- Troubleshooting
- About PyClaw
- Future work
- Gallery of all PyClaw applications
- Building the PyClaw gallery locally
- PyClaw Modules reference documentation
- Riemann Solvers reference documentation
- Indices and tables
- Citing
SharpClaw: High-order methods¶
SharpClaw has recently been integrated into PyClaw/PetClaw along with very high order WENO reconstruction through PyWENO code generation. The pure Fortran SharpClaw code is no longer supported.


Play Sudoku online
1
2
3
4
5
6
7
8
9
generating a new grid…
Select level:
Easy
Medium
Difficult
Insane
Restart game?
yes
cancel
Help
Main symbols
make an hypothesis
validate hypothesis
rule out hypothesis
restart same grid
generate a new grid
Additional tools
Show wrong answers
Solve current grid


Id: 343
Name: Tammy Guetermann
Status: Alive
Species: Cronenberg
Type:
Gender: Female
OriginName: Earth (C-137)
OriginUrl: https://rickandmortyapi.com/api/location/1
LocationName: Earth (C-137)
LocationUrl: https://rickandmortyapi.com/api/location/1
Image: https://rickandmortyapi.com/api/character/avatar/343.jpeg
Episode: ['https://rickandmortyapi.com/api/episode/5', 'https://rickandmortyapi.com/api/episode/6']
Url: https://rickandmortyapi.com/api/character/343
Created: 2018-01-10T17:27:04.773Z


AA lawmaker in Imo defects to PDP
by The Eagle OnlineSyracuse Okoro, representing Ohaji/Egbema Constituency in the Imo State House of Assembly on the platform of the Action Alliance, has dumped the party for the ruling Peoples Democratic Party.
The Speaker of the House, Collins Chiji (PDP-Isiala Mbano), announced Okoro’s defection at the plenary session on Wednesday.
Okoro, who represents the oil-rich constituency, was quoted as citing “personal reasons” for his defection.
Meanwhile, the House has adopted a motion urging the Imo Environmental Transformation Commission to enforce sanctions on motorists and pedestrians, allegedly defacing green areas in Owerri.
The sponsor of the motion, Arthur Egwim (AA-Ideato North), said the green areas, which had added to the beauty of the state capital, had been ruined by some reckless motorists and pedestrians.
Egwim noted that there was need for the Chairman of ETRACO to invoke the prohibitive sections of the law establishing the commission to stop the unlawful practice.
He said commercial motorists and vendors now make use of green areas as parks, thereby sabotaging the efforts of the state government to improve the environment.
The lawmaker also urged the commission to re-grass areas which had been defaced and also post warning signs against further acts of defacement by motorists and pedestrians.
The motion was seconded by Johnson Duru (PDP-Ideato South) and adopted after a voice vote.
The Speaker of the House directed the clerk to write to the ENTRACO Chairman and advise him accordingly.
Previous Post
NNPC to automate its downstream facilities
Next Post
Fayemi in US: Leaders must be held accountable + video


|
|
|
The Eiffel Tower
|
|
|
|
|
|
The Eiffel Tower
|
|
The Eiffel Tower, designed by Gustave Eiffel and built in 1889, is located in Paris, France. For 41 years, it was the tallest man-made structure in the world.
|
|
|
|
The Eiffel Tower, designed by Gustave Eiffel and built in 1889, is located in Paris, France. For 41 years, it was the tallest man-made structure in the world.
|
|
|
|
|
|


This example shows how to deploy Twilio Verify and Twilio functions for serverless email verification with magic links.
Enter your email:


Ancillary Data Products from the CEERS Team
Please consider subscribing to our email list to receive updates related to released data products and alerts when future data releases are available.
Please consider subscribing to our email list to receive updates related to released data products and alerts when future data releases are available.
We provide simulated CEERS NIRCam images of the Extended Groth Strip (EGS) field in six filters. These images are constructed from IllustrisTNG100-1 and the Santa Cruz SAM, and are modified with noise from the JWST Exposure Time Calculator. Please see Rose et al. (2022) for details, and we ask that you cite this paper for any projects that make use of these images or products derived from them.
To access the images directly, visit this link. Please see the associated README describing the data. Note that the images linked below are each ~4 GB in size.
We provide simulated NIRCam observations (F200W, F356W) of IllustrisTNG50 galaxies, particularly suited for morphological studies of high-redshift galaxies (3<z<6). Please see Costantin et al. (2022) for details, and we ask that you cite this paper for any projects that make use of these images or products derived from them.


{{title }} {{ likeAmount }} Likes / {{ commentAmount }} Comments {{description }} Author: {{createdBy }} Read more


{% extends 'error_base.html' %} {% block content %}
server got pwn3d, don't worry it emailed us.
Come back by in just a bit.


Thank you for installing and using Plex Requests!
Before you get started, please head over to the admin page and create an account.
You can then configure things and get going. Some highlights of the new version can be seen below:


My initial idea is a top-view coop boss fighting game, kind of like Titan Souls. The control is kind of like The binding of Issac. And in the coop mode, the player need to avoid the attacking from both the boss and the other player.
Then we go to the idea of shape shifting. The idea is from the tale of druid. The background is the forest. The character can transform to different animals to solve the puzzle. And finally, our idea is to build a story-based adventure game and the core gameplay is transforming. But I am a little worried about the fun of our game.
I am playing Hollow Knight recently. And I am so impressed by the atomsphere and story of it. So I want to write a story with a dark kernal and maybe a bad ending.
Character
Openning
One snowy night, a girl woke up from a strange dream. She felt someone was calling her. When she went out, she found everyone except her was falling into a deep sleep and couldn’t be waken up. Then She saw a white thing disappeared at the entrance of the forest. So she stepped into the forest to see what’s going on…
Then I fulfilled the story.
Long long ago, Louhi was defeated by a hero and sealed inside the hero. Animals guarded this seal. But the seal became weaker and weaker... One snowy night, a girl woke up from a strange dream. She felt someone was calling her. When she went out, she found everyone except her was falling into a deep sleep and couldn’t be waken up. Then She saw a white thing disappeared at the entrance of the forest. So she stepped into the forest to see what’s going on… She saw some soul fragments in the forest. These soul fragments were from the death of animals. After she collected several fragments, a soul of an old huge bear appeared and told her the use of souls. Then she collected and used these fragments. Finally she was in the center of the forest and heard the whispering of the hero. The hero asked the girl to break the seal and he would seal it again. The girl broke the seal but the hero’s soul run out of power and disappeared. The girl sealed Louhi inside her.
We start developing based on a low-poly 3D game kit. And I am working on the transforming part.
The basic idea is to use another gameobject to control the transform. The player is the parent object and is used to save current position. And the different characters are the children object. When a new character is called, destroy the old character, instantiate the new character and set the position.
Bug 1: The character falls through the ground
The reason is that the collider of the character intersects with the ground. So we change the position and the size of the collider. But it doesn't work. When I change to the second character, I notice the y-position is so low. Then I change the position of the object. Problem Solved!
And we should remember that the character controller contains a capsule collider.
Bug 2: The collision between character and pick-ups
Character controller doesn't have OnCollisionEnter(). So we use OnControllerColliderHit(). But this method has another problem. It invokes several times when the character walks over a pick-up. Then we move the scripts from the character to the pick-up. And I set the pick-up's colloder as trigger. Also BE AWARE OF the capital of the function name: OnTriggerEnter(). Then everything works well.
Dialogue system
At first, I thought dialogue system was difficult. But then I found a 15 minutes youtube video that taught me how to make it. I created a mDialogue class that has NPC name, and serializable String sentences. Then I added a DialogueManager to the scene that controls the behavior. When a dialogue is triggered, the sentences was put in a queue and popped one by one to substitute the text in the dialogue UI. And the trigger is set with different conditions, like colliders or specific forms.
Then I met with a problem that the NPC had different dialogues in different conditions. So I added a int statue to the GameObject that stores the states of each NPC.
In most Metroidvania games, the player can access different parts of the same level by unlocking different abilities. It's interesting and users will be glad to find the secrets. But considering the time and difficulty to design such a level, we unlocked all the abilities after the tutorial.
I started from the player's ablitiy, charge and push. Design starts from greybox. First, I designed the path and environment of this level. Then I tried to add some puzzles on the path. I drew something on a paper. The player needed to charge to break some rocks. Then she found a small stone and pushed the stone close to a small hill. She used this hill to jump on the hill and entered the second parts of this level. In this part, the player had to push 4 objects to specific places. There were 2 small objects and a big one. The big one can break into two small objects. Then I added the objective of this level. The player should collect the red crystal in this level.


Jan-09-2019
Cao,Zhuo
This slide is hosted on https://caicairay.github.io
Li et al. 2013
What about simulation?
The most staightforward method is to find out the ridges of filaments
We use
For more information, click HERE
DBSCAN
Covariance Matrix
Variance is a measure of the variability or spread in a set of data.
$$var(X) = \frac{1}{n} \sum_{i=1}^n (X_i-E(X))^2$$
However, variance can only be used to explain the spread of the data in the directions parallel to the axes of the feature space.
Covariance is a measure of the extent to which corresponding elements from two sets of ordered data move in the same direction.
$$cov(X,Y) = \frac{1}{n} \sum_{i=1}^n (X_i-E(X)) (Y_i-E(Y))$$
$$cov(X,X) \equiv var(X)$$
$$ M= \begin{bmatrix} cov(X,X) & cov(X,Y) \\ cov(Y,X) & cov(Y,Y) \\ \end{bmatrix} $$
$$ MV=V\Lambda $$
$$ V= \begin{bmatrix} \vec{v_1} & \vec{v_2} \\ \end{bmatrix} $$
$$ \Lambda=diag(\lambda_1, \lambda_2) $$
as dimensionality reduction
as Noise Filtering
Useful for:
Hand-written digits
Face id
...
A bit MORE


The control flow is the order in which the computer executes statements in a script.
Code is executed in order from the first line in the file to the last line, unless the computer runs across the structures that change
the control flow, such as conditionals and loops.
An example might be some code that is used to gather user data from a fillout form on a website.
The script submits validated data, but if the user makes an error that is detected or accidentally leaves a required field empty, the script prompts them to fill it in.
To do this, the script uses a conditional structure or if...else, so that different code executes depending on whether the form is complete or not.
The DOM (Document Object Model) is a browsers own internal programatic representation of the web page. This means that you can go into the DOM and manipulate
the browsers representation of the HTML document to change various elements (objects) on a webpage without changing the source HTML.
An example of this might be changing the "h1" tag to a different text. This change is only be temporary and will be lost of the the page is refreshed
in the browser. You can also interact with the DOM via JavaScript, for example using the "document.getElementById(ID)" statement.
An array is a set of ordered values, or collection of data that is represented by a container of square brackets "[]"
When looking to find the position of a value within an array we can use the JavaScript console to search via arr.indexOf(). This calculates the position of a value within the array starting at 0.
An object is simply a container for properties of JavaScript data. An object is represented within curly brackets " { } ".
Data that is listed in these brackets are properties that are given values. An example for an object may be "Car".
A cars object values may be:
You can access an objects properites with either of the following two syntax
Definition:


DearDiary
This project is a cross-platform diary app accessible through website or mobile device.
Concept:We live in a crowded world which has been captured by socail networking. We seem to develop a habit to share or like. You share so you exist. So my idea is to create an app to allow users to talk to themselves, to have time to be with themselves, to keep little secrets between themselves, to really enjoy being alone.
User interfaces for the mobile platform
Click here to access the prototype for the website platform.
After users logging in, diary can be seen from the website, it's convenient for users to check their diary. And it's updated automaticly both on mobile and web.


This component will render a list of items provided through view-model and then will provide a order change mechanism.
Every time the order of the items change, the model that was provided will also update.
This component has no HTML children.


A Bootstrap style sheet dedicated to Joshua Tree, CA.
Yucca brevifolia is a plant species belonging to the genus Yucca. It is tree-like in habit, which is reflected in its common names: Joshua tree, yucca palm, tree yucca, and palm tree yucca. This monocotyledonous tree is native to the arid southwestern United States, specifically California, Arizona, Utah, and Nevada, where it is confined mostly to the Mojave Desert.
This text is important.
This text indicates success.
This text represents some information.
This text represents a warning.
This text represents danger.
This text is important.
This text indicates success.
This text represents some information.
This text represents a warning.
This text represents danger.
I have always loved the desert.  Yet through the silence something throbs, and gleams.
Antoine de Saint-Exupéry
This Jumbotron is sunburned.
Joshua Tree National Park is located in southeastern California. Declared a U.S. National Park in 1994 when the U.S. Congress passed the California Desert Protection Act (Public Law 103-433), it had been a U.S. National Monument since 1936. It is named for the Joshua trees (Yucca brevifolia) native to the park. It covers a land area of 790,636 acres — an area slightly larger than the state of Rhode Island.
The park's oldest rocks, Pinto gneiss among them, are 1.7 billion years old. They are exposed in places on the park's surface in the Cottonwood, Pinto, and Eagle mountains. Much later, from 250 to 75 million years ago, tectonic plate movements forced volcanic material toward the surface at this location and formed granites.
The bighorn sheep (Ovis canadensis) is a species of sheep native to North America named for its large horns. These horns can weigh up to 14 kg (30 lb), while the sheep themselves weigh up to 140 kg (300 lb). Recent genetic testing indicates three distinct subspecies of Ovis canadensis, one of which is endangered: O. c. sierrae. Sheep originally crossed to North America over the Bering land bridge from Siberia; the population in North America peaked in the millions, and the bighorn sheep entered into the mythology of Native Americans.
The coyote (Canis latrans) is a canid native to North America. It is smaller than its close relative, the gray wolf, and slightly smaller than its other close relatives, the eastern wolf and the red wolf. It fills much of the same ecological niche as the golden jackal does in Eurasia, though it is larger and more predatory. It is listed as least concern by the International Union for Conservation of Nature due to its wide distribution and abundance throughout North America, southwards through Mexico, and into Central America.
The black-tailed jackrabbit (Lepus californicus), also known as the American desert hare, is a common hare of the western United States and Mexico, where it is found at elevations from sea level up to 10,000 ft (3,000 m). Reaching a length around 2 ft (61 cm), and a weight from 3 to 6 lb (1.4 to 2.7 kg), the black-tailed jackrabbit is the third-largest North American hare. Black-tailed jackrabbits occupy mixed shrub-grassland terrains.
Sedgwick is one of the 26 officially recognized neighborhoods of Syracuse, New York. It borders four other Syracuse neighborhoods, with Northside to the north and west, Near Northeast to the southwest, Lincoln Park to the south, and Coyotes to the east.
University Hill is a neighborhood in Syracuse, New York, located east and southeast of downtown, on one of the larger hills in Syracuse. It is the major educational and medical district of Syracuse, as well as an important business district, with three of the top ten employers in the Syracuse region located there.
Downtown Syracuse is the economic center of Syracuse, New York, and Central New York, employing over 30,000 people, and housing over 3,250. It is also one of the 26 officially recognized neighborhoods of Syracuse.
| Flora | Common Name | Genus | Subfamily |
|---|---|---|---|
| Yucca brevifolia | Joshua Tree | Yucca | Agavoideae |
| Quercus john-tuckeri | Tucker Oak | Quercus | Fagaceae |
| Cylindropuntia | Cholla Cactus | Cylindropuntia | Opuntioideae |
| Fouquieria splendens | Ocotillo | Fouquieria | Fouquieriaceae |
| Populus fremontii | Fremont's Cottonwood | Populus | Salicaceae |
| Bromus tectorum | Cheat Grass | Bromus | Poaceae |
| Flora | Common Name | Genus | Subfamily |
|---|---|---|---|
| Yucca brevifolia | Joshua Tree | Yucca | Agavoideae |
| Quercus john-tuckeri | Tucker Oak | Quercus | Fagaceae |
| Cylindropuntia | Cholla Cactus | Cylindropuntia | Opuntioideae |
| Fouquieria splendens | Ocotillo | Fouquieria | Fouquieriaceae |
| Populus fremontii | Fremont's Cottonwood | Populus | Salicaceae |
| Bromus tectorum | Cheat Grass | Bromus | Poaceae |


|
VDPAU
|
Typedefs | |
| typedef char const * | VdpGetErrorString(VdpStatus status) |
| Retrieve a string describing an error code. More... | |
| typedef char const* VdpGetErrorString(VdpStatus status) |
Retrieve a string describing an error code.
| [in] | status | The error code. |
| enum VdpStatus |
The set of all possible error codes.
| Enumerator | |
|---|---|
| VDP_STATUS_OK |
The operation completed successfully; no error. |
| VDP_STATUS_NO_IMPLEMENTATION |
No backend implementation could be loaded. |
| VDP_STATUS_DISPLAY_PREEMPTED |
The display was preempted, or a fatal error occurred. The application must re-initialize VDPAU. |
| VDP_STATUS_INVALID_HANDLE |
An invalid handle value was provided. Either the handle does not exist at all, or refers to an object of an incorrect type. |
| VDP_STATUS_INVALID_POINTER |
An invalid pointer was provided. Typically, this means that a NULL pointer was provided for an "output" parameter. |
| VDP_STATUS_INVALID_CHROMA_TYPE |
An invalid/unsupported VdpChromaType value was supplied. |
| VDP_STATUS_INVALID_Y_CB_CR_FORMAT |
An invalid/unsupported VdpYCbCrFormat value was supplied. |
| VDP_STATUS_INVALID_RGBA_FORMAT |
An invalid/unsupported VdpRGBAFormat value was supplied. |
| VDP_STATUS_INVALID_INDEXED_FORMAT |
An invalid/unsupported VdpIndexedFormat value was supplied. |
| VDP_STATUS_INVALID_COLOR_STANDARD |
An invalid/unsupported VdpColorStandard value was supplied. |
| VDP_STATUS_INVALID_COLOR_TABLE_FORMAT |
An invalid/unsupported VdpColorTableFormat value was supplied. |
| VDP_STATUS_INVALID_BLEND_FACTOR |
An invalid/unsupported VdpOutputSurfaceRenderBlendFactor value was supplied. |
| VDP_STATUS_INVALID_BLEND_EQUATION |
An invalid/unsupported VdpOutputSurfaceRenderBlendEquation value was supplied. |
| VDP_STATUS_INVALID_FLAG |
An invalid/unsupported flag value/combination was supplied. |
| VDP_STATUS_INVALID_DECODER_PROFILE |
An invalid/unsupported VdpDecoderProfile value was supplied. |
| VDP_STATUS_INVALID_VIDEO_MIXER_FEATURE |
An invalid/unsupported VdpVideoMixerFeature value was supplied. |
| VDP_STATUS_INVALID_VIDEO_MIXER_PARAMETER |
An invalid/unsupported VdpVideoMixerParameter value was supplied. |
| VDP_STATUS_INVALID_VIDEO_MIXER_ATTRIBUTE |
An invalid/unsupported VdpVideoMixerAttribute value was supplied. |
| VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE |
An invalid/unsupported VdpVideoMixerPictureStructure value was supplied. |
| VDP_STATUS_INVALID_FUNC_ID |
An invalid/unsupported VdpFuncId value was supplied. |
| VDP_STATUS_INVALID_SIZE |
The size of a supplied object does not match the object it is being used with. For example, a VdpVideoMixer is configured to process VdpVideoSurface objects of a specific size. If presented with a VdpVideoSurface of a different size, this error will be raised. |
| VDP_STATUS_INVALID_VALUE |
An invalid/unsupported value was supplied. This is a catch-all error code for values of type other than those with a specific error code. |
| VDP_STATUS_INVALID_STRUCT_VERSION |
An invalid/unsupported structure version was specified in a versioned structure. This implies that the implementation is older than the header file the application was built against. |
| VDP_STATUS_RESOURCES |
The system does not have enough resources to complete the requested operation at this time. |
| VDP_STATUS_HANDLE_DEVICE_MISMATCH |
The set of handles supplied are not all related to the same VdpDevice. When performing operations that operate on multiple surfaces, such as VdpOutputSurfaceRenderOutputSurface or VdpVideoMixerRender, all supplied surfaces must have been created within the context of the same VdpDevice object. This error is raised if they were not. |
| VDP_STATUS_ERROR |
A catch-all error, used when no other error code applies. |


Flexbox Grid With No modifiers
1
2
1
2
3
1
2
3
4
Flexbox Grid With Nested Grid
Nested 1
Nested 2
2
1
2
3
1
2
3
4


Copyright © 2011 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This is a Working Group Note as described in the Process Document. It has been developed by the W3C XML Query Working Group, which is part of the XML Activity.
This document incorporates a number of use cases that guided the development of XQuery Update Facility 1.0 during its design and development.
Please report errors in this document using W3C's public Bugzilla system (instructions can be found at http://www.w3.org/XML/2005/04/qt-bugzilla). If access to that system is not feasible, you may send your comments to the W3C XSLT/XPath/XQuery public comments mailing list<EMAIL_ADDRESS>It will be very helpful if you include the string “[UPDUC]” in the subject line of your report, whether made in Bugzilla or in email. Please use multiple Bugzilla entries (or, if necessary, multiple email messages) if you have more than one comment to make. Archives of the comments and responses are available at http://lists.w3.org/Archives/Public/public-qt-comments/.
Publication as a Working Group Note does not imply endorsement by the W3C Membership. At the time of publication, work on this document was considered complete and no further revisions are anticipated. It is a stable document and may be used as reference material or cited from another document. However, this document may be updated, replaced, or made obsolete by other documents at any time.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
1 Use Cases
for XQuery Updates
1.1 Use Case "R" - Updating
Relational Data
1.1.1 Description
1.1.2 Document Type Definition (DTD)
<IP_ADDRESS>
Schema for users.xml
<IP_ADDRESS>
Schema for items.xml
<IP_ADDRESS>
Schema for bids.xml
1.1.3 Input Data
1.1.4 Updates and Results
<IP_ADDRESS>
Q1
<IP_ADDRESS>
Q2
<IP_ADDRESS>
Q3
<IP_ADDRESS>
Q4
<IP_ADDRESS>
Q5
<IP_ADDRESS>
Q6
<IP_ADDRESS>
Q7
<IP_ADDRESS>
Q8
<IP_ADDRESS>
Q9
1.2 Use
Case "Address Book" - synchronizing address book entries
1.2.1 Input Data
1.2.2 Q1
1.3 Use Case
"SOAP" - processing messages
1.3.1 Input Data
1.3.2 Q1
1.4 Use Case
"Namespaces" - moving elements from one namespace to
another
1.4.1 Description
1.4.2 Schema for the grant
application
1.4.3 Input Data
1.4.4 Q1
1.5 Use case
"Parts" - modifying recursive documents
1.5.1 Input data
1.5.2 Q1
1.5.3 Q2
1.5.4 Q3
1.5.5 Q4
1.5.6 Q6
1.6 Use case
"Nil"
1.6.1 XML Schema
1.6.2 Sample input data
("employees.xml")
1.6.3 Q1
A Normative
References
B Revision Log
(Non-Normative)
B.1 Changes in
internal WD
B.2 28 Aug 2007
Publication
The use cases listed below were created by the XML Query Working Group to illustrate important applications for an XML update facility. Each use case is focused on a specific application area, and contains a Document Type Definition (DTD) and example input data. Each use case specifies a set of updates that might be applied to the input data, and the expected resulting value of the modified input for each update. Since the English description of each query is concise, the expected results form an important part of the definition of each update directive. These use cases are inspired by the W3C XQuery Update Facility Requirements document.
These use cases represent a snapshot of an ongoing work. Some important application areas and important operations are not yet adequately covered by a use case. The XML Query Working Group reserves the right to add, delete, or modify individual queries or whole use cases as the work progresses. The presence of a query in this set of use cases does not necessarily indicate that the query will be expressible in the XQuery Update Facility to be created by the XML Query Working Group.
One important use of an XML update language will be to update data stored in relational databases. This use case describes a set of such possible updates.
This use case is based on performing updates on the data used in Use Case "R" from the [XML Query Use Cases]. The sample data from this Use Case is copied below for convenience, and exactly match the data found in the XQuery 1.0 Use Cases. Instead of DTDs, we describe this data with W3C XML Schemas.
The data represents a relational database used by an online auction. The auction maintains a USERS table containing information on registered users, each identified by a unique userid, who can either offer items for sale or bid on items. An ITEMS table lists items currently or recently for sale, with the userid of the user who offered each item. A BIDS table contains all bids on record, keyed by the userid of the bidder and the item number of the item to which the bid applies.
The three tables used by the online auction are below, with their column-names indicated in parentheses.
USERS ( USERID, NAME, RATING ) ITEMS ( ITEMNO, DESCRIPTION, OFFERED_BY, START_DATE, END_DATE, RESERVE_PRICE ) BIDS ( USERID, ITEMNO, BID, BID_DATE )
This use case is based on three separate input documents named users.xml, items.xml, and bids.xml. Each of the documents represents one of the tables in the relational database described above, using the following DTDs:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="users"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="user_tuple"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="user_tuple"> <xs:complexType> <xs:sequence> <xs:element ref="userid"/> <xs:element ref="name"/> <xs:element minOccurs="0" ref="rating"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="userid" type="xs:string"/> <xs:element name="name" type="xs:string"/> <xs:element name="rating" type="xs:string"/> </xs:schema>
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="items"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="item_tuple"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="item_tuple"> <xs:complexType> <xs:sequence> <xs:element ref="itemno"/> <xs:element ref="description"/> <xs:element ref="offered_by"/> <xs:element minOccurs="0" ref="start_date"/> <xs:element minOccurs="0" ref="end_date"/> <xs:element minOccurs="0" ref="reserve_price"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="itemno" type="xs:string"/> <xs:element name="description" type="xs:string"/> <xs:element name="offered_by" type="xs:string"/> <xs:element name="start_date" type="xs:string"/> <xs:element name="end_date" type="xs:string"/> <xs:element name="reserve_price" type="xs:string"/> </xs:schema>
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="bids"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="bid_tuple"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="bid_tuple"> <xs:complexType> <xs:sequence> <xs:element ref="userid"/> <xs:element ref="itemno"/> <xs:element ref="bid"/> <xs:element ref="bid_date"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="userid" type="xs:string"/> <xs:element name="itemno" type="xs:string"/> <xs:element name="bid" type="xs:string"/> <xs:element name="bid_date" type="xs:string"/> </xs:schema>
The following data is an excerpt of the initial state for Q1. In this particular use case, each update begins with the state resulting from the prior update.
<items> <item_tuple> <itemno>1001</itemno> <description>Red Bicycle</description> <offered_by>U01</offered_by> <start_date>1999-01-05</start_date> <end_date>1999-01-20</end_date> <reserve_price>40</reserve_price> </item_tuple> ... Snip ... </items> <users> <user_tuple> <userid>U01</userid> <name>Tom Jones</name> <rating>B</rating> </user_tuple> ... Snip ... </users> <bids> <bid_tuple> <userid>U02</userid> <itemno>1001</itemno> <bid>35</bid> <bid_date>1999-01-07</bid_date> </bid_tuple> <bid_tuple> ... Snip ... </bids>
The entire data set is represented by the following tables:
| USERID | NAME | RATING |
| U01 | Tom Jones | B |
| U02 | Mary Doe | A |
| U03 | Dee Linquent | D |
| U04 | Roger Smith | C |
| U05 | Jack Sprat | B |
| U06 | Rip Van Winkle | B |
| ITEMNO | DESCRIPTION | OFFERED_BY | START_DATE | END_DATE | RESERVE_PRICE |
| 1001 | Red Bicycle | U01 | 1999-01-05 | 1999-01-20 | 40 |
| 1002 | Motorcycle | U02 | 1999-02-11 | 1999-03-15 | 500 |
| 1003 | Old Bicycle | U02 | 1999-01-10 | 1999-02-20 | 25 |
| 1004 | Tricycle | U01 | 1999-02-25 | 1999-03-08 | 15 |
| 1005 | Tennis Racket | U03 | 1999-03-19 | 1999-04-30 | 20 |
| 1006 | Helicopter | U03 | 1999-05-05 | 1999-05-25 | 50000 |
| 1007 | Racing Bicycle | U04 | 1999-01-20 | 1999-02-20 | 200 |
| 1008 | Broken Bicycle | U01 | 1999-02-05 | 1999-03-06 | 25 |
| USERID | ITEMNO | BID | BID_DATE |
| U02 | 1001 | 35 | 1999-01-07 |
| U04 | 1001 | 40 | 1999-01-08 |
| U02 | 1001 | 45 | 1999-01-11 |
| U04 | 1001 | 50 | 1999-01-13 |
| U02 | 1001 | 55 | 1999-01-15 |
| U01 | 1002 | 400 | 1999-02-14 |
| U02 | 1002 | 600 | 1999-02-16 |
| U03 | 1002 | 800 | 1999-02-17 |
| U04 | 1002 | 1000 | 1999-02-25 |
| U02 | 1002 | 1200 | 1999-03-02 |
| U04 | 1003 | 15 | 1999-01-22 |
| U05 | 1003 | 20 | 1999-02-03 |
| U01 | 1004 | 40 | 1999-03-05 |
| U03 | 1007 | 175 | 1999-01-25 |
| U05 | 1007 | 200 | 1999-02-08 |
| U04 | 1007 | 225 | 1999-02-12 |
The underlying database system has the following referential integrity constraints:
A foreign key on the BIDS table requires that BIDS.USERID contains a value that is found in USERS.USERID
A foreign key on the BIDS table requires that BIDS.ITEMNO contains a value that is found in ITEMS.ITEMNO
Add a new user (with no rating) to the users.xml view.
Solution in the XQuery Update Facility:
insert nodes <user_tuple> <userid>U07</userid> <name>Annabel Lee</name> </user_tuple> into doc("users.xml")/users
Expected resulting content of users.xml:
<users> <user_tuple> <userid>U01</userid> <name>Tom Jones</name> <rating>B</rating> </user_tuple> <user_tuple> <userid>U02</userid> <name>Mary Doe</name> <rating>A</rating> </user_tuple> ... Snip ... <user_tuple> <userid>U06</userid> <name>Rip Van Winkle</name> <rating>B</rating> </user_tuple> <user_tuple> <userid>U07</userid> <name>Annabel Lee</name> </user_tuple> </users>
Enter a bid for user Annabel Lee on February 1st, 1999 for 60 dollars on item 1001.
Solution in the XQuery Update Facility:
let $uid := doc("users.xml")/users/user_tuple[name="Annabel Lee"]/userid return insert nodes <bid_tuple> <userid>{data($uid)}</userid> <itemno>1001</itemno> <bid>60</bid> <bid_date>1999-02-01</bid_date> </bid_tuple> into doc("bids.xml")/bids
Expected resulting content of bids.xml:
<bids> <bid_tuple> <userid>U02</userid> <itemno>1001</itemno> <bid>35</bid> <bid_date>1999-01-07</bid_date> </bid_tuple> <bid_tuple> <userid>U04</userid> <itemno>1001</itemno> <bid>40</bid> <bid_date>1999-01-08</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U01</userid> <itemno>1002</itemno> <bid>400</bid> <bid_date>1999-02-14</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U04</userid> <itemno>1007</itemno> <bid>225</bid> <bid_date>1999-02-12</bid_date> </bid_tuple> <bid_tuple> <userid>U07</userid> <itemno>1001</itemno> <bid>60</bid> <bid_date>1999-02-01</bid_date> </bid_tuple> </bids>
Insert a new bid for Annabel Lee on item 1002, adding 10% to the best bid received so far for this item.
Solution in the XQuery Update Facility:
let $uid := doc("users.xml")/users/user_tuple[name="Annabel Lee"]/userid let $topbid := max(doc("bids.xml")/bids/bid_tuple[itemno=1002]/bid) return insert nodes <bid_tuple> <userid>{data($uid)}</userid> <itemno>1002</itemno> <bid>{$topbid*1.1}</bid> <bid_date>1999-02-01</bid_date> </bid_tuple> into doc("bids.xml")/bids
Expected resulting content of bids.xml:
<bids> <bid_tuple> <userid>U02</userid> <itemno>1001</itemno> <bid>35</bid> <bid_date>1999-01-07</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U01</userid> <itemno>1002</itemno> <bid>400</bid> <bid_date>1999-02-14</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U04</userid> <itemno>1007</itemno> <bid>225</bid> <bid_date>1999-02-12</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U07</userid> <itemno>1002</itemno> <bid>1320</bid> <bid_date>1999-03-05</bid_date> </bid_tuple> </bids>
The best bid for item 1002 had been at 1200, thus Annabel's bid is at 1320.
Set Annabel Lee's rating to B.
Solution in the XQuery Update Facility:
let $user := doc("users.xml")/users/user_tuple[name="Annabel Lee"] return if ($user/rating) then replace value of node $user/rating with "B" else insert node <rating>B</rating> into $user
Expected resulting content of users.xml:
<users> <user_tuple> <userid>U01</userid> <name>Tom Jones</name> <rating>B</rating> </user_tuple> <user_tuple> <userid>U02</userid> <name>Mary Doe</name> <rating>A</rating> </user_tuple> ... Snip ... <user_tuple> <userid>U06</userid> <name>Rip Van Winkle</name> <rating>B</rating> </user_tuple> <user_tuple> <userid>U07</userid> <name>Annabel Lee</name> <rating>B</rating> </user_tuple> </users>
Place a bid for Annabel Lee on item 1007, adding 10% to the best bid received so far on that item, but only if the bid amount does not exceed a given limit. The first query illustrates the desired behavior if the limit is exceeded.
Solution in the XQuery Update Facility:
let $uid := doc("users.xml")/users/user_tuple[name="Annabel Lee"]/userid let $topbid := max(doc("bids.xml")/bids/bid_tuple[itemno=1007]/bid) where $topbid*1.1 <= 200 return insert nodes <bid_tuple> <userid>{data($uid)}</userid> <itemno>1007</itemno> <bid>{$topbid*1.1}</bid> <bid_date>1999-02-01</bid_date> </bid_tuple> into doc("bids.xml")/bids
Expected resulting content of bids.xml:
<bids> <bid_tuple> <userid>U02</userid> <itemno>1001</itemno> <bid>35</bid> <bid_date>1999-01-07</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U04</userid> <itemno>1007</itemno> <bid>225</bid> <bid_date>1999-02-12</bid_date> </bid_tuple> </bids>
In the above, adding 10% to the best bid on item 1007 would have required a bid of 237, which is more than the allowed limit of 200. Thus, the bids.xml document does not change.
Place a bid for Annabel Lee on item 1007, adding 10% to the best bid received so far on that item, but only if the bid amount does not exceed 500. This illustrates the behavior when the resulting value is within the limit.
Solution in the XQuery Update Facility:
let $uid := doc("users.xml")/users/user_tuple[name="Annabel Lee"]/userid let $topbid := max(doc("bids.xml")/bids/bid_tuple[itemno=1007]/bid) where $topbid*1.1 <= 500 return insert nodes <bid_tuple> <userid>{data($uid)}</userid> <itemno>1007</itemno> <bid>{$topbid*1.1}</bid> <bid_date>1999-02-01</bid_date> </bid_tuple> into doc("bids.xml")/bids
Expected resulting content of bids.xml
<bids> <bid_tuple> <userid>U02</userid> <itemno>1001</itemno> <bid>35</bid> <bid_date>1999-01-07</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U04</userid> <itemno>1007</itemno> <bid>225</bid> <bid_date>1999-02-12</bid_date> </bid_tuple> <bid_tuple> <userid>U07</userid> <itemno>1007</itemno> <bid>237</bid> <bid_date>1999-04-01</bid_date> </bid_tuple> </bids>
Erase user Dee Linquent and the corresponding associated items and bids.
Solution in the XQuery Update Facility:
let $user := doc("users.xml")/users/user_tuple[name="Dee Linquent"] let $items := doc("items.xml")/items/item_tuple[offered_by=$user/userid] let $bids := doc("bids.xml")/bids/bid_tuple[userid=$user/userid] return ( delete nodes $user, delete nodes $items, delete nodes $bids )
An alternative solution is:
let $user := doc("users.xml")/users/user_tuple[name="Dee Linquent"] let $items := doc("items.xml")/items/item_tuple[offered_by=$user/userid] let $bids := doc("bids.xml")/bids/bid_tuple[userid=$user/userid] return delete nodes $user, $items, $bids
The two solutions above highlight the fact that a list of delete operations is equivalent to deleting the list of nodes obtained by concatenating the operands on which the deletes applied.
Expected resulting content of items.xml:
<items> <item_tuple> <itemno>1001</itemno> <description>Red Bicycle</description> <offered_by>U01</offered_by> <start_date>1999-01-05</start_date> <end_date>1999-01-20</end_date> <reserve_price>40</reserve_price> </item_tuple> ... Snip ... <item_tuple> <itemno>1004</itemno> <description>Tricycle</description> <offered_by>U01</offered_by> <start_date>1999-02-25</start_date> <end_date>1999-03-08</end_date> <reserve_price>15</reserve_price> </item_tuple> <item_tuple> <itemno>1007</itemno> <description>Racing bicycle</description> <offered_by>U04</offered_by> <start_date>1999-01-20</start_date> <end_date>1999-02-20</end_date> <reserve_price>200</reserve_price> </item_tuple> <item_tuple> <itemno>1008</itemno> <description>Broken bicycle</description> <offered_by>U01</offered_by> <start_date>1999-02-05</start_date> <end_date>1999-03-06</end_date> <reserve_price>25</reserve_price> </item_tuple> </items>
In the above, items 1005 and 1006, offered by user Dee Linquent, have been erased; item 1007 now directly follows item 1004. Notice that the whole subtrees rooted at the corresponding <item_tuple> elements have been erased.
Expected resulting content of users.xml:
<users> <user_tuple> <userid>U01</userid> <name>Tom Jones</name> <rating>B</rating> </user_tuple> <user_tuple> <userid>U02</userid> <name>Mary Doe</name> <rating>A</rating> </user_tuple> <user_tuple> <userid>U04</userid> <name>Roger Smith</name> <rating>C</rating> </user_tuple> ... Snip ... <user_tuple> <userid>U06</userid> <name>Rip Van Winkle</name> <rating>B</rating> </user_tuple> </users>
In the above, user Dee Linquent has been erased.
Expected resulting content of bids.xml:
<bids> <bid_tuple> <userid>U02</userid> <itemno>1001</itemno> <bid>35</bid> <bid_date>1999-01-07</bid_date> </bid_tuple> <bid_tuple> <userid>U04</userid> <itemno>1001</itemno> <bid>40</bid> <bid_date>1999-01-08</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U02</userid> <itemno>1002</itemno> <bid>600</bid> <bid_date>1999-02-16</bid_date> </bid_tuple> <bid_tuple> <userid>U04</userid> <itemno>1002</itemno> <bid>1000</bid> <bid_date>1999-02-25</bid_date> </bid_tuple> ... Snip ... <bid_tuple> <userid>U04</userid> <itemno>1007</itemno> <bid>225</bid> <bid_date>1999-02-12</bid_date> </bid_tuple> </bids>
No bids had been placed on items 1005 and 1006 offered by user Dee Linquent. However, Dee Linquent had placed a bid on item 1002; this bid has been erased.
Add the element <comment>This is a bargain !</comment> as the last child of the <item> element describing item 1002.
Solution in the XQuery Update Facility
declare revalidation strict; insert nodes <comment>This is a bargain !</comment> as last into doc("items.xml")/items/item_tuple[itemno=1002]
Expected resulting content of items.xml: The same as the original contents.
The items.xml document is unchanged and an error is raised. This update can not be applied without rendering the document invalid with respect to its schema.
Place a bid for Annabel Lee on item 1010, which does not exist in "items.xml". In this query, we assume that a referential integrity constraint in the underlying database system requires that no bid can be placed on an item unless it exists in the database.
Solution in XQuery:
let $uid := doc("users.xml")/users/user_tuple[name="Annabel Lee"]/userid return insert nodes <bid_tuple> <userid>{data($uid)}</userid> <itemno>1010</itemno> <bid>60</bid> <bid_date>2006-04-23</bid_date> </bid_tuple> into doc("bids.xml")/bids
Expected resulting content of bids.xml:the same as the original contents.
This update violates the previously-mentioned referential integrity constraint. Therefore, its execution raises a dynamic error (see Kinds of Errors in the XQuery specification).
Add a bid for Annabel Lee on item 1002, at a price 5 dollars below the current highest bid. A trigger in the underlying database ensures that a bid cannot be made at a lower price than the highest bid made so far on that item.
Solution in XQuery:
let $uid := doc("users.xml")/users/user_tuple[name="Annabel Lee"]/userid let $topbid := max(doc("bids.xml")//bid_tuple[itemno=1002]/bid) return insert nodes <bid_tuple> <userid>{data($uid)}</userid> <itemno>1002</itemno> <bid>{$topbid - 5.00}</bid> <bid_date>2006-04-23</bid_date> </bid_tuple> into doc("bids.xml")/bids
Expected resulting content of bids.xml: the same as the original contents.
This update causes the previously mentioned trigger to return an error. Therefore, its execution will raise a dynamic error (see Kinds of Errors in the XQuery specification).
In this scenario, an address book is synchronized among a central archive and two local copies. This scenario is inspired by the Unison file synchronizer. During synchronization, Address book entries with the same name element are considered to be the same entry. The order of entries is irrelevant. For simplicity, we assume that entries may be modified, but not inserted or deleted. When the two copies are synchronized, their state is saved into an archival version. Synchronization is performed as follows:
If an entry in one of the two copies is different from the archived one, but the other copy matches the archive, the modified copy is propagated to the archive and to the other copy.
If both copies differ from the archive, but they do not both modify the same element in the entry, or they modify the same element but the modified elements have the same value, then the changes from each copy are propagated to both the archive and the other copy.
If the copies have each modified the same entry, but modified it in different ways, a problem is reported in the log, and neither the archive nor the copies are changed. (For simplicity, we do not attempt to merge updates.)
The XQuery Update Facility is sufficient for the problem as scoped above. For more complex scenarios, the XQuery Scripting Extensions will simplify programming by allowing variable assignment and the ability to view the results of prior updates within a query.
This section describes the data prior to synchronization.
archive.xml: The central archive, before synchronization.
<archived-agenda> <last-synch-time>2005-10-05T10:00</last-synch-time> <entry> <name>Benjamin</name><EMAIL_ADDRESS></entry> <entry> <name>Dario</name><EMAIL_ADDRESS></entry> <entry> <name>Anthony</name><EMAIL_ADDRESS></entry> </archived-agenda>
log.xml: The central log, before synchronization.
<log> </log>
copy1.xml: The first modified copy of the address book.
In this copy, Benjamin's contact has changed from INRIA to University of Versailles, Dario has moved from University of Pisa to University of Paris Sud, and Anthony has moved from University of Toulon to the ENA.
<agenda-version> <entry> <name>Benjamin</name><EMAIL_ADDRESS></entry> <entry> <name>Dario</name><EMAIL_ADDRESS></entry> <entry> <name>Anthony</name><EMAIL_ADDRESS></entry> </agenda-version>
copy2.xml: The second modified copy of the address book.
In this copy, Benjamin has also moved to University of Versailles, Dario has not moved, and Anthony has moved to the EHESS instead of the ENA:
<agenda-version> <entry> <name>Benjamin</name><EMAIL_ADDRESS></entry> <entry> <name>Dario</name><EMAIL_ADDRESS></entry> <entry> <name>Anthony</name><EMAIL_ADDRESS></entry> </agenda-version>
Synchronize the three logs as described in the description of this use case.
Solution in the XQuery Update Facility:
for $a in doc("archive.xml")/archived-agenda/entry, $v1 in doc("copy1.xml")/agenda-version/entry, $v2 in doc("copy2.xml")/agenda-version/entry where $a/name = $v1/name and $v1/name = $v2/name return if ($a/contact = $v1/contact and $v1/contact=$v2/contact) then () else if ($v1/contact = $v2/contact) then replace value of node $a/contact with $v1/contact else if ($a/contact = $v1/contact) then ( replace value of node $a/contact with $v2/contact, replace value of node $v1/contact with $v2/contact ) else if ($a/contact = $v2/contact) then ( replace value of node $a/contact with $v1/contact, replace value of node $v2/contact with $v1/contact ) else ( insert node <fail> <arch>{ $a }</arch> <v1>{ $v1 }</v1> <v2>{ $v2 }</v2> </fail> into doc("log.xml")/log ) , replace value of node doc("archive.xml")/*/last-synch-time with current-dateTime()
Expected Results:
Expected results of the agenda synchronization: A synchronization of the two versions of the agenda made on April 23th, 2006, at noon, should have the following impact on the archive, versions, and log.
Note:
In the following XML results, the comments (shown in italic font) were not created by the update directives, and are not part of the result documents. They have been added to explain where each part of a result document comes from.
archive.xml
<archived-agenda> <last-synch-time>2006-04-23T12:00</last-synch-time> <entry> <name>Benjamin</name> copied from the modified entries<EMAIL_ADDRESS></entry> <entry> <name>Dario</name> copied from first modified version<EMAIL_ADDRESS></entry> <entry> <name>Anthony</name> unchanged due to conflict<EMAIL_ADDRESS></entry> </archived-agenda>
log.xml
<log> update failure details <fail> <arch> archived agenda version <entry> <name>Anthony</name><EMAIL_ADDRESS></entry> </arch> <v1> first modified version <entry> <name>Anthony</name><EMAIL_ADDRESS></entry> </v1> <v2> second modified version <entry> <name>Anthony</name><EMAIL_ADDRESS></entry> </v2> </fail> </log>
copy1.xml
<agenda-version> <entry> <name>Benjamin</name> kept after synchronization<EMAIL_ADDRESS></entry> <entry> kept after synchronization <name>Dario</name><EMAIL_ADDRESS></entry> <entry> kept after synchronization failure <name>Anthony</name><EMAIL_ADDRESS></entry> </agenda-version>
copy2.xml
<agenda-version> <entry> kept after synchronization <name>Benjamin</name><EMAIL_ADDRESS></entry> <entry> value taken from the other modified version <name>Dario</name><EMAIL_ADDRESS></entry> <entry> kept after synchronization failure <name>Anthony</name><EMAIL_ADDRESS></entry> </agenda-version>
This use case processes the message found in Example 1 of the [SOAP Version 1.2 Part 0:Primer] to produce the message found in Example 2. The original message is not modified, but the new message is a modified copy of the original.
The input data is taken directly from Example 1 of the [SOAP Version 1.2 Part 0:Primer].
<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Header> <m:reservation xmlns:m="http://travelcompany.example.org/reservation" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d </m:reference> <m:dateAndTime>2001-11-29T13:20:00.000-05:00 </m:dateAndTime> </m:reservation> <n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <n:name>Åke Jógvan Øyvind</n:name> </n:passenger> </env:Header> <env:Body> <p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel"> <p:departure> <p:departing>New York</p:departing> <p:arriving>Los Angeles</p:arriving> <p:departureDate>2001-12-14</p:departureDate> <p:departureTime>late afternoon</p:departureTime> <p:seatPreference>aisle</p:seatPreference> </p:departure> <p:return> <p:departing>Los Angeles</p:departing> <p:arriving>New York</p:arriving> <p:departureDate>2001-12-20</p:departureDate> <p:departureTime>mid-morning</p:departureTime> <p:seatPreference/> </p:return> </p:itinerary> <q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels"> <q:preference>none</q:preference> </q:lodging> </env:Body> </env:Envelope>
Moreover, we assume the dynamic context associates to "airports" the following sequence:
<AIRPORT><CITY>New York</CITY><CODE>JFK</CODE></AIRPORT> <AIRPORT><CITY>New York</CITY><CODE>LGA</CODE></AIRPORT> <AIRPORT><CITY>New York</CITY><CODE>EWR</CODE></AIRPORT> <AIRPORT><CITY>Los Angeles</CITY><CODE>LAX</CODE></AIRPORT> <AIRPORT><CITY>San Francisco</CITY><CODE>SFO</CODE></AIRPORT>
Check to see if the airports are unambiguously specified in the incoming message. Produce a SOAP response by transforming the incoming message, modifying the time and date to the current time, and replacing the body with a request to clarify which airport should be used for New York City.
Solution in the XQuery Update Facility:
declare namespace env="http://www.w3.org/2003/05/soap-envelope"; declare namespace m="http://travelcompany.example.org/reservation"; declare namespace n="http://mycompany.example.com/employees"; declare namespace p="http://travelcompany.example.org/reservation/travel"; (: A clarification is needed only if there are no : airports or more than one for a given city. If : there is precisely one, there is no need to : ask for information on that city. :) declare function local:airportChoices($city as xs:string) { let $airports := collection("airports")[CITY = $city] return if (count($airports) = 0) then <error> No airports found for {$city}!</error> else if (count($airports) > 1) then <airportChoices> { for $c in $airports/CODE return (string( $c ), " ") } </airportChoices> else () }; (: Make sure that each airport is unambiguous. If there is : more than one airport for a city, ask for clarification. : : The primer only shows the error condition, so it is not : clear what to do if there are no errors. Here, we simply : return the airports in the itinerary. :) declare function local:airports($in as element(env:Envelope)) { let $departureDeparting := $in//p:departure/p:departing let $departureDepartingAirports := collection("airports")[CITY = $departureDeparting] let $departureArriving := $in//p:departure/p:arriving let $departureArrivingAirports := collection("airports")[CITY = $departureArriving] let $returnDeparting := $in//p:return/p:departing let $returnDepartingAirports := collection("airports")[CITY = $returnDeparting] let $returnArriving := $in//p:return/p:arriving let $returnArrivingAirports := collection("airports")[CITY = $returnArriving] return if ( count($departureDepartingAirports)=0 or count($departureDepartingAirports)>1 or count($departureArrivingAirports)=0 or count($departureArrivingAirports)>1 or count($returnDepartingAirports)=0 or count($returnDepartingAirports)>1 or count($returnArrivingAirports)=0 or count($returnArrivingAirports)>1 ) then <p:itineraryClarification> <p:departure> <p:departing> { local:airportChoices($departureDeparting) } </p:departing> <p:arriving> { local:airportChoices($departureArriving) } </p:arriving> </p:departure> <p:return> <p:departing> { local:airportChoices($returnDeparting) } </p:departing> <p:arriving> { local:airportChoices($returnArriving) } </p:arriving> </p:return> </p:itineraryClarification> else <p:itinerary> <p:departure> <p:departing>{$departureDeparting}</p:departing> <p:arriving>{$departureArriving}</p:arriving> </p:departure> <p:return> <p:departing>{$returnDeparting}</p:departing> <p:arriving>{$returnArriving}</p:arriving> </p:return> </p:itinerary> }; declare variable $msg external; copy $out := $msg/env:Envelope modify ( replace value of node $out//m:dateAndTime with fn:current-dateTime(), replace node $out//env:Body with <env:Body> { local:airports($out) } </env:Body> ) return $out
Expected Result (from [SOAP Version 1.2 Part 0:Primer]):
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> <env:Header> <m:reservation xmlns:m="http://travelcompany.example.org/reservation" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d </m:reference> <m:dateAndTime>2001-11-29T13:35:00.000-05:00 </m:dateAndTime> </m:reservation> <n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <n:name>Åke Jógvan Øyvind</n:name> </n:passenger> </env:Header> <env:Body> <p:itineraryClarification xmlns:p="http://travelcompany.example.org/reservation/travel"> <p:departure> <p:departing> <p:airportChoices> JFK LGA EWR </p:airportChoices> </p:departing> </p:departure> <p:return> <p:arriving> <p:airportChoices> JFK LGA EWR </p:airportChoices> </p:arriving> </p:return> </p:itineraryClarification> </env:Body> </env:Envelope>
This use case shows how (parts of) the elements in a document may be moved from one namespace to another.
An agriculture company and an university research lab are making a joint proposal to the National Agricultural Research Agency. An initial proposal has been made by cut and paste out of snippets provided by the two partners. Before being submitted, the proposal has to be moved to the National Agricultural Research Agency (NARA) namespace.
The grant application document must conform to the following schema:
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' targetNamespace="http://www.anr.fr/nara" elementFormDefault="qualified"> <xsd:element name='grant'> <xsd:complexType> <xsd:sequence> <xsd:element ref='name'/> <xsd:element ref='lab' minOccurs='0' maxOccurs='unbounded'/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name='lab'> <xsd:complexType> <xsd:sequence> <xsd:element ref='address' minOccurs='0' maxOccurs='1'/> <xsd:choice minOccurs='0' maxOccurs='unbounded'> <xsd:element ref='researcher'/> <xsd:element ref='PhD'/> <xsd:element ref='engineer'/> <xsd:element ref='lab' minOccurs="0" maxOccurs="unbounded"/> </xsd:choice> </xsd:sequence> <xsd:attribute name='name' type='xsd:string' use='required'/> </xsd:complexType> </xsd:element> <xsd:element name='PhD'> <xsd:complexType> <xsd:attribute name='advisor' type='xsd:IDREF' use='required'/> </xsd:complexType> </xsd:element> <xsd:element name='researcher'> <xsd:complexType> <xsd:attribute name='rid' type='xsd:ID' use='required'/> <xsd:attribute name='name' type='xsd:string' use='required'/> <xsd:attribute name='position' type='xsd:string' use='required'/> </xsd:complexType> </xsd:element> <xsd:element name='engineer'> <xsd:complexType> <xsd:attribute name='name' type='xsd:string' use='required'/> </xsd:complexType> </xsd:element> </xsd:schema>
The initial draft produced by the participants, "grant.xml", has the following content. The use of namespaces reflects the cut-and-paste approach used to create it:
<?xml version='1.0' ?> <grant xmlns:nara="http://www.anr.fr/nara"> <nara:lab name="AgroPlus"> <nara:address>Saclay, France</nara:address> <nara:researcher rid="r1" name="Fred" position="technical staff"/> <nara:researcher rid="r2" name="Liz" position="lab assistant" /> <coop:PhD xmlns:coop="http://www.gouv.fr/univ-industry-coop/" name="Marie" advisor="r1"/> <agro:lab xmlns:agro="http://www.agroplus.com" name="Dairy Dept"> <agro:engineer name="Marc"/> </agro:lab> </nara:lab> <univ:lab xmlns:univ="http://www.education.gouv.fr" name="Food Engineering Dept, Orsay U."> <univ:address>Orsay, France</univ:address> <univ:researcher rid="r3" name="Henry" position="associate professor"/> <univ:PhD name="Robert" advisor="r3"/> <PhD name="Julia" advisor="r1"/> </univ:lab> </grant>
Move all elements into the NARA namespace ("http://www.anr.fr/nara").
Solution in the XQuery Update Facility:
declare namespace nara = "http://www.anr.fr/nara"; for $e in doc("grant.xml")//* where not (namespace-uri($e) eq "http://www.anr.fr/nara") return rename node $e as QName("http://www.anr.fr/nara", concat("nara:",local-name($e)))
Expected Result:
<nara:grant xmlns:nara="http://www.anr.fr/nara"> <nara:lab name="AgroPlus"> <nara:address>Saclay, France</nara:address> <nara:researcher rid="r1" name="Fred" position="technical staff"/> <nara:researcher rid="r2" name="Liz" position="lab assistant" /> <nara:PhD xmlns:coop="http://www.gouv.fr/univ-industry-coop/" name="Marie" advisor="r1"/> <nara:lab name="Dairy Dept"> <nara:engineer name="Marc"/> </nara:lab> </nara:lab> <nara:lab name="Food Engineering Dept, Orsay U."> <nara:address>Orsay, France</nara:address> <nara:researcher rid="r3" name="Henry" position="associate professor"/> <nara:PhD name="Robert" advisor="r3"/> <nara:PhD name="Julia" advisor="r1"/> </nara:lab> </nara:grant>
This use case illustrates modifications to documents having a recursive structure.
Each update in this use case applies on the following documents. In these examples, we assume each update is applied to a fresh copy of the original data.
Document "part-tree.xml":
<parttree> <part partid="0" name="car"> <part partid="1" name="engine"> <part partid="3" name="piston"/> </part> <part partid="2" name="door"> <part partid="4" name="window"/> <part partid="5" name="lock"/> </part> </part> <part partid="10" name="skateboard"> <part partid="11" name="board"/> <part partid="12" name="wheel"/> </part> <part partid="20" name="canoe"/> </parttree>
Document "part-list.xml":
<?xml version="1.0" encoding="ISO-8859-1"?> <partlist> <part partid="0" name="car"/> <part partid="1" partof="0" name="engine"/> <part partid="2" partof="0" name="door"/> <part partid="3" partof="1" name="piston"/> <part partid="4" partof="2" name="window"/> <part partid="5" partof="2" name="lock"/> <part partid="10" name="skateboard"/> <part partid="11" partof="10" name="board"/> <part partid="12" partof="10" name="wheel"/> <part partid="20" name="canoe"/> </partlist>
Delete all parts in "part-tree.xml".
Solution in the XQuery Update Facility:
delete nodes doc("part-tree.xml")//part
Expected resulting document "part-tree.xml":
<parttree/>
Delete all parts belonging to a car in "part-tree.xml", leaving the car itself.
Solution in the XQuery Update Facility:
delete nodes doc("part-tree.xml")//part[@name="car"]//part
Expected resulting document "part-tree.xml":
<parttree> <part partid="0" name="car"/> <part partid="10" name="skateboard"> <part partid="11" name="board"/> <part partid="12" name="wheel"/> </part> <part partid="20" name="canoe"/> </parttree>
Delete all parts belonging to a car in "part-list.xml", leaving the car itself.
Solution 1 in the XQuery Update Facility (leveraging "part-tree.xml"):
for $pt in doc("part-tree.xml")//part[@name="car"]//part, $pl in doc("part-list.xml")//part where $pt/@partid eq $pl/@partid return delete nodes $pl
Solution 2 (using a recursive updating function):
declare updating function local:delete-subtree($p as element(part)) { for $child in doc("part-list.xml")//part where $p/@partid eq $child/@partof return ( delete nodes $child, local:delete-subtree($child) ) }; for $p in doc("part-list.xml")//part[@name="car"] return local:delete-subtree($p)
Note:
Because this data is not covered by a schema, an implementation
that supports static typing will raise an error for the comparison
$p/@partid eq $child/@partof
. This can be solved by
creating a schema for the data and importing it into the query.
Expected Result:
<partlist> <part partid="0" name="car"/> <part partid="10" name="skateboard"/> <part partid="11" partof="10" name="board"/> <part partid="12" partof="10" name="wheel"/> <part partid="20" name="canoe"/> </partlist>
Add a radio to the car in "part-tree.xml", using a part number that hasn't been taken.
Solution in the XQuery Update Facility:
let $next := max(doc("part-tree.xml")//@partid) + 1 return insert nodes <part partid="{$next}" name="radio"/> into doc("part-tree.xml")//part[@partid=0 and @name="car"]
Expected Result:
<parttree> <part partid="0" name="car"> <part partid="21" name="radio"/> <part partid="1" name="engine"> <part partid="3" name="piston"/> </part> <part partid="2" name="door"> <part partid="4" name="window"/> <part partid="5" name="lock"/> </part> </part> <part partid="10" name="skateboard"> <part partid="11" name="board"/> <part partid="12" name="wheel"/> </part> <part partid="20" name="canoe"/> </parttree>
Note:The position of the new element with respect to its siblings is implementation-dependent. If position is significant, and the user wants to ensure the element appears last, for example, "as last" should be used, as in the following query:
let $next := max(doc("part-tree.xml")//@partid) + 1 return insert nodes <part partid="{$next}" name="radio"/> as last into doc("part-tree.xml")//part[@partid=0 and @name="car"]
The head office has adopted a new numbering scheme. In "part-tree.xml", add 1000 to all part numbers for cars, 2000 to all part numbers for skateboards, and 3000 to all part numbers for canoes.
Solution in the XQuery Update Facility:
for $keyword at $i in ("car", "skateboard", "canoe"), $parent in doc("part-tree.xml")//part[@name=$keyword] let $descendants := $parent//part for $p in ($parent, $descendants) return replace value of node $p/@partid with $i*1000+$p/@partid
Expected result:
<parttree> <part partid="1000" name="car"> <part partid="1021" name="radio"/> <part partid="1001" name="engine"> <part partid="1003" name="piston"/> </part> <part partid="1002" name="door"> <part partid="1004" name="window"/> <part partid="1005" name="lock"/> </part> </part> <part partid="2010" name="skateboard"> <part partid="2011" name="board"/> <part partid="2012" name="wheel"/> </part> <part partid="3020" name="canoe"/> </parttree>
This use case demonstrates transform expressions which construct modified copies of some data, which must remain valid according to the original schema. In this use case, keeping the modified copy valid requires adding an xsi:nil attribute.
A employees data set is described by the following XML Schema:
<?xml version="1.0" encoding="UTF-8" ?> <xsd:schema targetNamespace="http://www.example.com/employees" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsd:element name="employees"> <xsd:complexType> <xsd:element name="employee" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:attribute name="mgr" type="xsd:boolean" default="false"/> <xsd:attribute name="dept" type="xsd:string"/> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="salary" type="xsd:decimal" nillable="true"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:complexType> </xsd:element> </xsd:schema>
<employees> <employee mgr="true" dept="Toys"> <name>Smith</name> <salary>100000</salary> </employee> <employee dept="Toys"> <name>Jones</name> <salary>60000</salary> </employee> <employee mgr="true" dept="Shoes"> <name>Roberts</name> <salary>150000</salary> </employee> </employees>
Return all managers, omitting their salaries for confidentiality reasons. The returned document must be valid according to its XML Schema, so the query adds an xsi:nil attribute with value "true" to the salary element.
Solution in the XQuery Update Facility:
for $e in doc("employees.xml")//employee where $e/@manager = true() return copy $emp := $e modify ( replace value of node $emp/salary with "" , insert nodes (attribute xsi:nil {"true"}) into $emp/salary ) return $emp
Expected result:
<employee mgr="true" dept="Toys"> <name>Smith</name> <salary xsi:nil="true"/> </employee> <employee mgr="true" dept="Shoes"> <name>Roberts</name> <salary xsi:nil="true"/> </employee>
This log records the substantive changes that have been made to this document since the Working Draft of 8 May 2006. Minor editorial changes are not included in this log.
Clarified that the "application constraint" in <IP_ADDRESS> Q8 is a database integrity constraint, and added the constraint to the description of the data, in response to http://www.w3.org/Bugs/Public/show_bug.cgi?id=3796#add_comment.
Clarified that updates for Use Case "R" are cumulative (see http://www.w3.org/Bugs/Public/show_bug.cgi?id=3567#c1).
Fixed update conflict in Use Case "Address", and clarified that some things would be easier using updates together with the Scripting Extensions (see http://www.w3.org/Bugs/Public/show_bug.cgi?id=3578#c1).
Fixed several errors in Use Case "SOAP" (see http://www.w3.org/Bugs/Public/show_bug.cgi?id=3578#c3).
Fixed Use Case "R" Q4 so that it tests to see whether a rating already exists (see http://www.w3.org/Bugs/Public/show_bug.cgi?id=3578#c4).
Fixed Use Case "Parts" Q3, fixing several bugs, see (http://www.w3.org/Bugs/Public/show_bug.cgi?id=3578#c6).


vignettes/Cytoscape-and-iGraph.Rmd
Cytoscape-and-iGraph.Rmd
This vignette will show you how to convert networks between igraph and Cytoscape.
if(!"RCy3" %in% installed.packages()){
install.packages("BiocManager")
BiocManager::install("RCy3")
}
library(RCy3)
library(igraph)
The whole point of RCy3 is to connect with Cytoscape. You will need to install and launch Cytoscape:
The igraph package is a popular network tool among R users. With RCy3, you can easily translate igraph networks to Cytoscape networks!
Here is a basic igraph network construction from the graph_from_data_frame docs, http://igraph.org/r/doc/graph_from_data_frame.html:
actors <- data.frame(name=c("Alice", "Bob", "Cecil", "David",
"Esmeralda"),
age=c(48,33,45,34,21),
gender=c("F","M","F","M","F"))
relations <- data.frame(from=c("Bob", "Cecil", "Cecil", "David",
"David", "Esmeralda"),
to=c("Alice", "Bob", "Alice", "Alice", "Bob", "Alice"),
same.dept=c(FALSE,FALSE,TRUE,FALSE,FALSE,TRUE),
friendship=c(4,5,5,2,1,1), advice=c(4,5,5,4,2,3))
ig <- graph_from_data_frame(relations, directed=TRUE, vertices=actors)
# if function not found, then you need to install igraph. Try library(igraph)
You now have an igraph network, g. In order to translate the network together with all vertex (node) and edge attributes over to Cytoscape, simply use:
createNetworkFromIgraph(ig,"myIgraph")
Inversely, you can use createIgraphFromNetwork() in RCy3 to retrieve vertex (node) and edge data.frames to construct an igraph network.
ig2 <- createIgraphFromNetwork("myIgraph")
Compare the round-trip result for yourself…
ig
ig2
Note that a few additional attributes are present which are used by Cytoscape to support node/edge selection and network collections.
Also note: All networks in Cytoscape are implicitly modeled as directed. This means that if you start with an undirected network in igraph and then convert it round-trip (like described above), then you will end up with a directed network.


Topless Protesters Detained Ahead Of Ukraine Peace Summit In Paris
by RFE/RLTwo female activists from the Femen movement have protested topless outside the Elysee Palace in Paris ahead of the arrival of Russian President Vladimir Putin and his Ukrainian counterpart Volodymyr Zelenskiy for critical talks on ending five years of conflict in eastern Ukraine.
French police quickly whisked the women away as they shouted "Stop Putin's War" near a journalists' entrance to the palace, where the leaders were to hold bilateral talks with French President Emmanuel Macron and German Chancellor Angela Merkel before a four-way summit begins later on December 9.
The two women, who also had the slogan painted on their bodies, were detained by police, though it was not clear whether they were arrested.


--- title: The Garden is Budding with Interest date: 2014-01-14 00:00:00 -06:00 categories: - whats-blooming layout: post blog-banner: whats-blooming-now-winter.jpg post-date: January 14, 2014 post-time: 9:49 AM blog-image: wbn-default.jpg ---
Yulan Magnolia Magnolia denudata
Large and wonderfully furry winter buds decorate this centuries old cultivated tree and protect the large fragrant flowers that will emerge in spring.
Horsechestnut Aesculus hippocastanum 'Baumannii'
The shiny and attractive Horsechestnut's winter buds are protected with a sticky, viscous coating.
Yellowwood Cladrastis lutea
Next year's growth buds out from the previous year's leaf scar on this beautiful yard or street tree.
Dwarf Ginkgo Ginkgo biloba 'Mariken'
This compact Ginkgo has equally compact and adorable leaves and buds.
Loebner Magnolia Magnolia x loebneri 'Merrill'
The fuzzy buds on this Magnolia give way to an abundance of 3 inch wide, fragrant blossoms in early spring.
Nannyberry Viburnum Viburnum lentago
The end buds on this Viburnum seem to be reaching out for spring while adjacent branches hold fragrant bluish-black fruits that are beloved by birds.
Paperbark Maple Acer griseum
This Maple provides a double dose of winter interest with delicate winter buds adorned with a skirt of snowy white hairs and the trunk with colorful exfoliating bark.


--- layout: post title: joker ski mask is menacing and geeky boing boing date: '2009-03-31T00:25:24+01:00' tags: [] tumblr_url: http://backlog.robbevan.com/post/91376043/joker-ski-mask-is-menacing-and-geeky-boing-boing ---
Joker ski-mask is menacing and geeky - Boing Boing


--- layout: post title: Part III Intro & Chapter 8 date: 2009-03-30 20:17:32.000000000 -06:00 type: post published: true status: publish categories: - Vlad in progress tags: [] meta: _gcid: '56' _gcuser: Vladimir Gitlevich content_type: book _bitly_trim: http://dddcommunity.org/?p=47 _edit_last: '3110' _oembed_b6fe0ba0d92b6ab6d42f30ebcc5f1c9b: "{{unknown}}" _oembed_025bcef09990c8aee87987ff1a379fcf: "{{unknown}}" author: login: Vladimir Gitlevich email<EMAIL_ADDRESS>display_name: Vladimir Gitlevich first_name: Vladimir Gitlevich last_name: '' ---
December 2003
Notes 9, 4th Session
Guest Author: Eric Evans
Robert: The 3 issues on p.188, the qualifications for doing
domain-driven development
(mention of OO databases)
Eric: [use of OO databases is rare] Because there aren't so many people
using rich domain models.
Tracy: Isn't there also a comfort level with relational databases?
Robert: And ad-hoc reporting, etc.
John B: This is discussed in Crossing The Chasm, etc. People only
change technologies at gunpoint, figuratively speaking. But when
there's a shift, often the change is permanent (e.g. CodeWarrior
beating LightSpeed C).
Tim: Very few people believe the #2 issue, willingness to evolve and
change the model.
Eric: I really thought about this list very hard. People might have a
domain model, and the willingness to evolve and change it, but they
didn't have the knowhow for #3, the design skills. Or sometimes they
would isolate the designers from the coders.
[some notes lost to editor program failure]
(question about deep models)?
Russ: We worked on an autodialer where we made effective use of a deep
model of the problem domain. The customer was happy to find out that
our solution had lots of areas of flexibility where they were able to
ask for new features that they had not thought of before.
Tracy: We had another project where we had solved a problem with
respect to arranging some resources in memory blocks. The customer
gave us a new variation of the problem where they thought it would be
a
difficult elaboration of the previous version.
Russ: But it fell out naturally from the solution of the specific
problem we had solved previously.
Jeff M: Was this a question of a "deep model" or more a question
of
solving a general case and being able to then handle specific cases
more easily?
Russ: It was specific to the problem domain, and their "difficult
elaboration" was one that made a lot of sense in terms of the original
problem.
Jeff M: Close in concept space, then.
Russ: Yes.
Eric: Once you've experienced it, it seems real. It's the fact that
this occurs so rarely that is part of the reason I wrote this book.
(some additional discussion, mention of O-R mapping, "well-worn
glove"
metaphor of an effectively evolved domain model)
Eric: O-R mapping means you have to change a translation layer when you
change the model. It means you have to carry more along as you refine
the model, as you make changes to reflect deeper insights. Or when you
refactor away from a code smell. You still come to points where you
make a breakthrough, it's just slower.
(show of thumbs, how many people have 1,"seen a deep model?"
2, had a
"breakthrough" from better understanding a model")
Eric: Ah, interestingly more people have had the "breakthrough"
experience than the deep model.
Russ: Who broke through and didn't get to a deep model?
Tim: In your own little parts which you have freedom to change, you can
have significant breakthroughs, which don't affect the model of the
system at large. Deep but narrow, perhaps. A small enough subsystem
that I don't consider it the systems model.
Chris: Or if you start with a bad enough model, getting to a mediocre
one is quite a breakthrough.
Eric: And I think I've experienced multiple breakthroughs in the same
project.
Russ: (Looking at a chapter head chart, re the breakthrough pattern)
I
don't really get what this chart is trying to tell us. So this is time
marching along...
Eric: As you refactor again and again, and then you have little jumps
of value, and at some point, voom! You get a big jump in value.
Tracy: So maybe the vertical line should be a little diagonal?
Eric: It's at the granulation of significant steps. Imagine if the
horizontal axis is a year. So how wide would a 3-week change-over be?
Russ: So this is potential value vs. value delivered?
Eric: You're trying to read a bit too much into this picture. What I'm
trying to express is that progress in refactoring, in what you get out
of it, is like punctuated equilibrium. You have a steady practice
which takes you to a point at which things change suddenly. On really
successful products. If the refactoring is just keeping you out of
total chaos, you just keep going and going and don't get big jumps.
 The axes are kind of
vague since it's trying to express things you experience. Things that
may be difficult to measure.
Mark: So the length of the jump? The height is the amount of code you
change?
Eric: No, more the horizontal axis. The horizontal axis is either
time, or amount of refactoring. If you're keeping up, they're the same
thing.
Mark: I've often seen that in a breakthrough, you can throw away a lot
of classes and methods. The jump is in the amount of code that
changes, in my experience.
Eric: What I'm trying to express is the value of the code. The
flexibility, the ability to do more and better things.
(comment): You could express this as shortening the arcs, reducing the
cost, the distance to some new things you could get to. New features.
John: If you take the derivative of Eric's graph, you can tell what the
expression on the manager's face is.
Russ: Let me talk out of both sides of my mouth now. I think I
disagree with the notion that all programming days are the same.
Productivity-wise. When you're really where you want to be with the
model, you can accelerate in how much code you can write. Whereas when
you are trying to figure things out, you're a lot slower. When this
doesn't come early in working with the code, I feel you're more in the
realm of re-engineering then re-factoring. There are no small steps
that get you out of the hole. Now we're in the area where hopefully
there's some piece on the outside that you don't have to change, but
the stuff on the inside has to be radically changed around.
Eric: I think all these things can happen. I don't like to get too
hung up on the details. I call it refactoring because it has the same
definition -- changing the design without changing the behavior of the
system. It doesn't say how big that change is. It's good practice to
make these steps small and continuous. But sometimes you have to take
a leap across a big chasm. In a story I have later, fixing the core
stuff was quick, but fixing the stuff that depended on it took quite a
bit longer. Nowadays I might be able to figure out how to break that
design shift into smaller pieces. But three weeks was small in terms
of the total project.
Russ: For other people who have had the breakthrough experience?
Chris: For us, I've seen it where "everyone gets Friday off except
you,
you, and me." Then the change happens over the weekend, and everyone
picks up the new architecture on Monday.
Eric: There was a point at which a team I was working on got rid of the
EJBs in their system. They'd been whittling them down over time, and
at the last point, they took their last few EJBs and ripped them out
over a weekend. Sometimes you have to say hands off the code.
Chris: I find that that tends to be a property of the "aha"
story.
John B: Or if we just move one thing, suddenly everything else becomes
much easier.
Chris: I tend to think of those as "d'oh"s rather than ahas.
Tim: Sometimes you get in a stuck position where you end up getting
told, "Okay, you're not making progress, just stop and think."
Then
sometimes when you get an insight, you don't have time to work out all
the advantages by the time you have to ship.
(Chris, Eric: discussion about software architects resisting a change
that simplified the model and made the architects' job "too small")
John B: When you ask the question, "Why is this code that way",
and the
answer is someone's name. That seems to be a recurring pattern of
dysfunction.
John B: Ward Cunningham's talk, his metaphor about waiting for insight.
You don't have to wait, but if you don't it won't come. And when you
get an insight, it can be like climbing a mountain. Going down the
other side is working out the implications of your advance in
understanding on the rest of the system. You can abort a climb, you
can climb to the top and plant a flag, or you can carry out the whole
thing, climbing up and carrying it down.
Eric: Businesses keep an eye to new opportunities constantly. They
don't expect that they can predict things, that the environment will
remain stable. They look for new places where they can gain advantage,
new markets, new ways of simplifying things. You don't see this search
for opportunities in software projects, and it's rare you get the
serendipity you can get from just keeping your eyes open.
Eric: One of the things I worry about, on the highly iterative methods
of software development, especially frequent releases. It's hard to
stay agile if you have a large installed base.
Tracy: The Poppendiecks' book -- Lean Software Development. They talk
a lot about experimentation. The right amount of experimentation is
when you succeed half the time. You learn something from your
successes, but you learn a lot more from your failures.
Carol: Detail-oriented people, are they different from ambitious,
entrepreneurial types?
Eric: The people who do manage to set up their organizations in the
right balance, who allow upside potential, they will leave the others
behind.
Robert: OK, you talk about sort of a portfolio approach in business,
trying out a lot of business opportunities. But there's a difference
between software development and business opportunities.
John B: 3M does this with atoms, even. They've institutionalized a
version of what's called "playtime" in Tom DeMarco's work. When
one
company DeMarco described looked at their successes, all their
best-selling projects all came out of playtime.
Eric: And software development would be more fun AND more productive.
In squeezing out the fun, they've squeezed out their unexpected
opportunities. There are only unexpected bad things.
Robert: Evolution from a "big up-front specification and design
culture".
Russ: The large corporate culture of software really followed a
grass-roots, individual level orientation at first.
John B: Everybody knew this who was any good. That you couldn't
anticipate everything up front. That you should go through the whole
cycle of the project in miniature, early on. That you should deliver
something part-way through as a sanity check.
(comment): do people just have the wrong impression about software?
That it's like architecture or manufacturing, large fixed costs with a
heavy process?
John B: Software is nothing but metaphor. What do we have here
(indicates Apple iBook), a chunk of LCDs and a backlight?
Russ: Is software like a magazine?
Mark: Like publishing? You can cut a few things out, the quality will
suffer, but you can still read the article.
Russ: Agile software methodologies beg to differ.
Eric: A literary journal?
John B: Or a math journal? Where everything is a proof?
...
John B: And the bad metaphors for software are based on
misunderstandings of the other fields. Even manufacturing isn't like
manufacturing, as we learned from reading Lean Software Development.
Eric: Let's take a break from the metaphors for a while. Just do
software development for a while, without saying it's like anything,
and see where it takes us.
Carol: Why do people keep picking terms from other fields?
Programmers, analysts, engineers came in at some point.
Eric: For me, writing this book was like programming.
Jeff M: Did you have a breakthrough?
Eric: Yes, I did. Multiple breakthroughs. There was a point where I
realized I had to reverse the order of all the pages.
(wide ranging discussion of metaphors)
Chris: Shouldn't you write down the list of the top 10 things you hate
about software development? These things need breakthroughs.
Eric: Companies want to produce software with unskilled labor.
Russ: I was wondering, for people who have had these breakthroughs.
Can you remember anything beforehand that led to the breakthrough? I
can remember sitting and thinking, "It just can't be this hard."
So
there was one time I recall looking at two sets of client
specifications for two different projects, thinking "these are too
similar to be different."
Bob: I had a time when I was working on a project and that everything
seemed much too hard. So what I did was to step away from the
framework I was using and started by just sketching out classes. It
was a case of constantly running into something, stepping back, and
then bringing back my insight back into the system.
Chris: I've seen that "share pie" example from the other side.
("share
pie": referring to dividing up the moneys from a syndicated loan
as a
somewhat complex domain issue) The domain experts think of everything
as special cases, and when you put them together, you find out that
they are just slight variations of a strong central theme, and the
domain experts are startled.
John B: Duplication in the code that you can't quite get at, the way
it's organized. You can tell they are doing the same thing, but
there's no way to put them together.
Eric: You think there's a deeper model in there?
John B: Usually I think that it's very annoying. And when I do little
refactorings, reducing duplication, bit by bit, finally I often realize
that there's a way to fix the problem by introducing a new object,
perhaps.
Chris: It's turned out in my experience that sometimes the domain
experts don't themselves have the best understanding of the model.
Sometimes there are simplifications and unifications that can be made.
Eric: I'd draw a distinction between an expert who knows his field but
does not have an abstract thinking talent, versus someone who is only
borderline competent in the domain... I would work with someone who
knows things in detail but doesn't have a clear abstract view, but I
would try to avoid working with someone who doesn't have a firm grasp
on the field. You lose a lot by not having good give-and-take with
someone. Sometimes I turn to books about the field.
Russ: Has anyone (p.206-7) seen a better explanation than the brief
discussion here, of the nouns-as-objects vs. not discussion?
("hmmms" from around the table)
Eric: Chapter 9 has something of a discussion for dealing with the case
where the local domain expert is not so available, or not so useful to
you. Sometimes you have to become a middling expert yourself. But it's
a lot harder.
Tao: We're about halfway through this book. From Chapter 1-9. It sort
of dawned on me. I used to be in manufacturing for a while. To be a
domain expert, you have to do it yourself. You have to go down to the
shop floor, to see the products, to find out for yourself how things
are made. Was it worth it, for the shipping example, say, for a
developer to try booking a cargo, or to sit beside the people who book
the cargo?
Eric: The people who book cargo don't have a broad understanding. You
could learn what you needed from them in a few hours. I went to a port
and saw some port operations. It was valuable. I want to draw the
difference between a domain expert and a user. The user's point of
view is what you get from sitting and booking cargos.
Chris: You'll learn how it has been done, which is not necessarily how
it should be done.
Eric: I most like to work with a domain expert who has some ideas for
new ways to do things.
Chris: These seem to be on the endangered species list.
Darlene: How do you deal with a domain expert who is making mistakes
in
what he tells you?
Eric: Most of the things in this book assume that what the domain
expert says is basically true. That he's not making mistakes.
John B: Although you would catch inconsistencies pretty quickly.
Eric: Or you would look at your model, your design, and ask about where
there are seeming contradictions or difficult points in the design. So
you might go read a book to see if you could get another opinion,
another angle on things. You might hear contradictory things from two
domain experts that you could resolve in this way. Or you might have
to go back and ask for clarification in the light of each others'
assertions. So you'd hear, "Oh yeah, I made a little mistake there,
it's supposed to be like that." Or you'd hear that you were missing
some context. Or occasionally you would get a sense that one is more
reliable thn the other.
John B: It's like a Columbo episode. Eventually he'd tap his forehead
and say, "There's just one thing bothering me..."
Eric: Software development is like a Columbo episode?
Chris: Refactoring is like a Columbo episode?
Tim: How often do people end up having to deal with "users"
rather than
"experts"? So sometimes we have to reverse-engineer the domain
out of
a usage pattern from a previous generation of application.
Russ: We've more often had the experience of building the first one of
a thing, so we as developers are considered as expert as anyone else on
the team. It's a pleasant way to work.
Tim: So sometimes we've had to lead with a user interface. We walk
through them with the UI, and find out what we got wrong in our
understanding of what they wanted.
Eric: So, to do this, to do domain-driven design, you really need a
domain expert. I don't say who it is. But not all domains are so
approachable that a software developer can be their own domain expert.
(reference to a glossary entry on "domain expert")
Eric: The printed-circuit board design case, the example in the
beginning of the book. The domain experts were users. But many of the
users were narrower in their understanding of the domain. The people I
was working with had a somewhat larger vision, that the right tool
could help guide other users toward good practices in how they do their
work in PCB design. It reminds me a little of our earlier discussion,
a previous session, about writing OO code in a non-OO language.
Jeff M: What would you want first? Maybe long identifiers?
(laughter)
Jeff M: Then polymorphic dispatch?
Russ: Encapsulation first.
...
Tracy: You can go through 100 ideas in an hour and a half at the
whiteboard, at the level of concepts. If you tried to write up 100
ideas, how long would that take to run through the trial-and-errorl
Eric: Not only would I be at the whiteboard, but I would be speaking
out loud, that I would get the immediate feedback to move quickly.
Tracy: And the idea that it's OK to float 100 ideas, that that's a good
thing, that you can go through a lot of ideas to converge on a good one.
comment: One of the things that takes a lot of the fun out of
programming is that if the iterations are too slow, you don't get the
reward of the feedback, the sense of progress.
Eric: You can end up in a local minimum through iterative development.
Then you might deliberately destabilize the situation, do a few things
to see if there's a better place around.
(Russ describes annealing in metallurgy for strengthening metal, and
simulated annealing in numerical optimization)
...
Russ: (smile) Now we know that we aren't getting enough reuse in
software because this bucket doesn't show up later when we're mixing
paint.
Eric: Did anyone get into the Specification pattern?
Russ: We're supposed to read into Chapter 10.
Tracy: We're ambitious.
Eric: Specification is supposed to serve as a case study...
Russ: Do you think you might run into a case where the situation would
be too complicated to be satisfied by the simple Specification you
describe?
Russ: Next week's homework: Come in with an inappropriate metaphor for
software development.
(some discussion of the Wiki on domaindrivendesign.org and SVP's wiki).
Russ: Who's used this? John, raise your hand. ("Constraint")
(looking at the Warehouse Packer prototype)
Eric: Sometimes you get into a design logjam, where everyone is waiting
for everyone. Just any implementation of one of the subsystems allows
everyone to move forward. Even a dumb implementation of the piece that
fulfilled the contract gets things going.
comment: We had a teaching software implementation where the
"intelligent" part of the interface started out as a random
number
generator. And it was surprising how long people thought there was
something more intelligent and complex was behind it.
Russ: We've found out for things like the prototype that it can be hard
to move from the simple prototype, beyond to the more complete system.
You need more global organization and structures to support where you
need to end up.
Eric: Obviously a lot of optimization problems require global
reasoning. That just makes sense. Still, the analysis that goes into
doing a thing like having
Chris: (to Russ) When you needed to back out the constraint code to
optimize the packing, did you lose the ability to use the constraints
as pure validation? "Does this solution satisfy...?"
Eric: I think he means, how do you know you're answer is right?
Chris: Yes, the basis for your tests.
Tim: Some problems are so hard that the ability to prove it optimal is
the same level of difficulty as being able to create the optimal
solution.
John: What you'd do is set some sort of floor.
Eric: Would you have been able to go directly to the final, optimized
solution? Or would the prototype be useful for clarifying the
structure of the system?
...
Russ: We had a prototype Builder, a complex but low-risk piece of work
in full, where the prototype handed back one of three representative
structures of the types of things we wanted to work on. Having the
prototype helped the rest of the system take shape.
Tim: It helps for more than just the first pass to break the logjam.
Russ: The prototype builder actually lasted much longer than we
expected.
Tim: We had a brute-force temporary optimization module that was just
supposed to keep us developing until we signed the contract with the
optimization engine company. Which never actually happened.
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/siliconvalleypatterns/
To unsubscribe from this group, send an email to:
<EMAIL_ADDRESS>Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/


Automatically play clips when you hover over a saved clip.
Automatically mute clip previews when you open the clip manager page.
Play a subtle sound effect when clips are capture or added and when notifications are displayed.
Automatically close new tabs opened when you take a clip after the clip data has been captured.


This is the TiddlyWiki plugin library. It is not intended to be opened directly in the browser.
See https://tiddlywiki.com/ for details of how to install plugins.