text:
# Cast of Characters

THE CURTIS HILL THEATER
presents

## THIS ONE WILD LIFE

CAST

(click photos for bios and slideshows.)

The Newf. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shamus
Hound Dog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Emmett
Supreme Ruling Cat #1 . . . . . . . . . . . . . . . . . . . . . . . . . Jackson
Supreme Ruling Cat #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Jed

Caretaker 1: The Wife . . . . . . . . . . . . . . . . . . . . . . . . Kim Clune
Caretaker 2: The Husband . . . . . . . . . . . . . . . . . . . . Tim Clune

Music by
The Backup Birds

Frankie Sinatra
Ella “Yella-Bird” Fitzgerald
and Wordsworth

NOTICE: The exit nearest to the seat you occupy is the shortest rout to the street. In the event of a fire, WALK, DO NOT RUN to that exit. – The Fire Commisioner

Management is not responsible for personal apparel or property of patrons unless properly checked with the theater attendant. Patrons are advised to take their coats and wraps with them?whenever they leave thier seats. Ladies, kindly remove your hats during the performance.


text:
You are looking at the HTML representation of the XML format.
HTML is good for debugging, but is unsuitable for application use.
Specify the format parameter to change the output format.
To see the non HTML representation of the XML format, set format=xml.
See the complete documentation, or API help for more information.
<?xml version="1.0"?>
<api>
<query>
<search>

</search>
</query>
</api>

format: plain


text:
News

# Hyundai to Invest US$6.75 Billion in Fuel Cell EV Technology December 17, 2018 by Paul Shepard Hyundai Motor Group, which includes automotive brands Hyundai Motor Company and Kia Motors Corporation, today announced its long-term roadmap ‘FCEV Vision 2030’ plan, as the group reaffirms its commitment to accelerate the development of a hydrogen society by leveraging the group’s global leadership in fuel-cell technologies. The ‘FCEV Vision 2030’ roadmap will help Hyundai Motor Group and its suppliers invest approximately KRW 7.6 trillion (US$6.75 billion) in R&D and facility expansion, which is expected to create approximately 51,000 jobs by 2030.

Aligned with the roadmap, Hyundai Motor Group (The Group) will drastically boost its annual fuel-cell systems production capacity to 700,000 units by 2030 and explore new business opportunities to supply its world-class fuel-cell systems to other transportation manufacturers of automobiles, drones, vessels, rolling stocks and forklifts. The demand for fuel-cell systems from sectors beyond transportation such as power generation and storage systems is also expected to emerge quickly.

“Hyundai Motor Group, the global pioneer of the commercial production of FCEV, is taking a bold step forward to expedite the realization of a hydrogen society,’’ said Euisun Chung, Executive Vice Chairman of Hyundai Motor Group. “We will expand our role beyond the automotive transportation sector and play a pivotal role in global society’s transition to clean energy by helping make hydrogen an economically viable energy source. We are confident that hydrogen power will transcend the transportation sector and become a leading global economic success.”

The Group plans to secure a 500,000-units-a–year FCEV production capacity by 2030, including passenger vehicles and commercial vehicles, in anticipation of high demand for global FCEVs expanding to around 2million units a year within that timeframe.

As the first step to fulfill the ‘FCEV Vision 2030’, HMG’s fuel-cell system manufacturing affiliate Hyundai Mobis Co. today held a groundbreaking ceremony for its second fuel-cell system plant in Chungju, South Korea. The second factory will help Mobis increase annual fuel-cell system output to 40,000 units by 2022, up from the current 3,000 units.

The Group’s flagship auto-making affiliate Hyundai Motor earlier this year launched NEXO, its second-generation commercialized FCEV, improving upon the acclaimed Tucson FCEV introduced in 2013. NEXO was built on Hyundai’s first dedicated fuel-cell vehicle architecture, which provides many structural benefits including lighter weight, increased cabin space and improved fuel-cell system layout.

The Group plans to further advance the fuel-cell system used in NEXO models to upgrade and diversify its fuel-cell system lineup, so it can respond to demands from various industry sectors.

Earlier this month, Hyundai Motor Group established a dedicated division to develop and support fuel-cell system businesses.

The Group’s proprietary fuel cell system combines hydrogen fuel with oxygen taken from the air to produce electricity. Without combustion, the system only emits water as a by-product whilst also purifying polluted air, making it the ultimate source of clean energy.

With high energy density and ease of stack refueling, hydrogen would help reduce the comprehensive ownership costs by about 10 percent for all possible transportation means including rolling stocks, vessels and forklifts, according to a study by McKinsey & Company. The study also estimates that approximately 5.5 million to 6.5 million fuel cell system units will be required by 2030 globally.

HMG is the only company to establish a dedicated plant for commercial production of fuel cell systems. With the construction of an additional fuel cell plant, Hyundai can quickly target market success on a global scale.


text:
Email discussion lists for the UK Education and Research communities

## CCP4BB@JISCMAIL.AC.UK

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font

#### Options

Subject:

Re: Calculating sigma value

From:

Dale Tronrud <[log in to unmask]>

Reply-To:

Dale Tronrud <[log in to unmask]>

Date:

Tue, 1 May 2018 15:55:22 -0700

Content-Type:

text/plain

Parts/Attachments:

 text/plain (367 lines)
 Dear Ian,    Clearly you have a passion for the SI. After our last discussion of this topic on the CCP4BB I downloaded "The International System of Units: NIST Special Publication 330" and actually read it. (https://dx.doi.org/10.6028/NIST.SP.330e2008) The SI is a fine system of units and this document is well written and easy to follow.    I don't believe that you and I have any serious disagreements about "units". I agree with pretty much everything you have written in your letter.    We do seem to have a difference of opinion about the style of writing appropriate for an informal venue such as the CCP4BB.    While the SI units of a "quantity density" would be "inverse cubic nanometers" the actual value would remain meaningless if the nature of the "quantity" was left unspecified. The document mentioned above makes this clear (page 22) and I'm sure you agree as well.    I think you believe that just saying "the map value is electron density" is sufficient to lead the reader to understand that the "quantity" with SI'ish units of "/Angstrom^3" is, indeed, "number of electrons", but I disagree. After all, people commonly refer to the rms normalized maps as "electron density" maps as well, so the term "electron density" has been overloaded with several meanings and is now ambiguous. In a forum where people routinely use abbreviations such as "IMHO", and "A" instead of "Angstrom", it seems to me ridiculous to say "the number density of electrons in SI units of per Angstrom cubed" when I could simply say "electrons/A^3" knowing that most readers would understand my intent.    In your post you defined electron density (in quotes) as "... or the number of electrons per unit volume". Those are pretty much exactly the words the little voice in my head utters when I read the symbols "electrons/A^3". I never said that "electrons" is an SI unit, or that I was even trying to obey the formality of the SI conventions.    I will argue with you about the idea that electron density and proton density are commensurate. I don't really know of an application where the sum of electron density and proton density makes any sense, much less the sum of electron and rabbit density. Any class library I would write would throw an exception if you attempted to calculate such a thing.    I presume your calculation is stepping toward the calculation of charge density. I would first calculate the charge density due to the electron density, using the knowledge that there is one quantum of negative charge for each electron, then calculate the charge density due to the proton density, using knowledge of the charge of a proton, and then sum the two charge densities, which are not only commensurate but identical. My code would then be ready should I run into a Xi baryon with +2 charge whereas your code would have to be completely refactored. ;-) Dale Tronrud  P.S. Before the United States Department of Commerce comes knocking on my door, I expect they would prosecute the RCSB. Do you realize that this criminal organization uses taxpayer money to store and distribute files containing calculated structure factors represented as the number of electrons per unit cell?! On 4/30/2018 3:28 AM, Ian Tickle wrote: > > Dale, > > On 19 April 2018 at 17:36, Dale Tronrud <[log in to unmask] > > wrote: > >    The meaning of the term "e/A^3" as used in Coot has nothing to do > with the charge of an electron.  The intention of its authors is to > indicate that the value being represented by the map is the density of > electrons.  It is the number of electrons per cubic Anstrom at that > point in space. > > > My intention was certainly not to imply that the unit designated 'e' in > the units of electron density used by Coot should be taken to mean > charge (in fact quite the opposite!), even though 'e' would normally be > interpreted here as the atomic unit of charge > (see https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication811e2008.pdf, > Table 8).  > >    I, generally, find it useless to say that a number is a density > (units of "per volume") without saying density of what.  This is not a > density of charge, not a density of mass, not a density of rabbits.  It > is a density of electrons. > > > First, note that (SI Guide cited above, section 7), quote: "The value of > a quantity is its magnitude expressed as the product of a number and a > unit, and the number multiplying the unit is the numerical value of the > quantity expressed in that unit".  So by stating that the electron > density is X electrons/A^3, you are claiming that the number in the > above recipe is X and that the unit is 'electrons/A^3', correct?  I just > want to be sure we are talking about the same thing when referring to a > 'unit'. > > There are numerous reasons why this terminology is inconsistent, > semantically illogical, unconventional or impermissible under the > universally accepted SI system of units(Système international d'unités), > as well as possibly unlawful in the US!  For starters, the object > 'electron' to which we are referring here is already very clear from the > definition, so it's quite unnecessary to repeat that object as a > component of its units.  Here is the definition of 'electron density': > > "Electron density is the volume number density of electrons, or the > number of electrons per unit volume".  For the definition of 'number > density' see: https://en.wikipedia.org/wiki/Number_density, > quote: "Volume number density is the number of specified objects per > unit volume : n={\frac > {N}{V}}, where /N/ is the total number of objects in a volume /V/.  > In SI >  units, > number density is measured in m^−3 , although cm^−3  is often used." > > There is of course also line number density and area number density, > such as population density, i.e. the number of people per unit area, or > area number density of people.  > See https://en.wikipedia.org/wiki/Population_density, quote: "Therefore, > the worldwide human population density is around 7,500,000,000 ÷ > 510,000,000 = 14.7 per km^2  (38 per sq. mi). If only the Earth's land > area of 150,000,000 km^2  (58,000,000 sq. mi.) is taken into account, > then human population density increases to 50 per km^2  (129 per sq. > mile)." (note that the unit 'sq. mi' is not permitted under SI !).  > Seems pretty clear from this what the units of area number density are, > and by analogy the units of volume number density. > > There doesn't seem to be any ambiguity here that what is being described > is the number density of people, and for anyone who doesn't think > Wikipedia has got it right, for an 'official' example of usage of number > density, please refer to section 6.2.6 in the SI Guide cited above, > quote:  "6.2.6 ... Example: the number density of Pb atoms is 5 ×106 /m3 > but not: the number density of Pb atoms is 5 M/m3." > > Furthermore, are you saying that, for example, the statement "the mass > of an electron is 9.10938356(11)×10^−31 kg" is not sufficiently clear > and that it should be "9.10938356(11)×10^−31 kg/electron" instead?  That > would follow logically from your claim above.  The problem with this is > that this usage is clearly not permitted under the SI system, to which > all modern scientific institutions and journals are signed up to using, > without exception.  Please see the above-mentioned SI Guide document, > under 'Check List for Reviewing Manuscripts', item 6: "Information is > not mixed with unit symbols (or names). For example, the form 'the water > content is 20 mL/kg' is used and not '20 mL H2O/kg' or '20 mL of > water/kg.' (See Sec. 7.5.)."  So mixing the object 'electron' with the > other units (A^-3 or kg) is absolutely not permissible in SI.  Note that > an 'electron' is like 'H2O' in the sense that both are instances of the > class 'Matter', and so neither can possibly be units (i.e. instances of > the class 'Units').  This makes perfect sense for several reasons: > > First, the identical unit applied to different objects is > 'commensurable', i.e. it can be compared, subtracted or added.  So if > the number density of electrons is 5 A^-3 and the number density of > protons is 10 A^-3 we can just add number densities and get the total > number density of particles or matter objects (electrons or protons, or > yes even rabbit volume density can be added to electron density!) > =  15 A^-3.  Different units are 'incommensurable', i.e. can't be > compared or equated.  Even if there were such units as 'electron', > 'proton' or 'rabbit' and if the units of number density really were > 'electrons/A^3' or 'protons/A^3' or rabbits/m^3 then these are clearly > different units so are incommensurable.  It would therefore not be > possible to calculate the total number density of matter objects - you > may as well ask what is the sum of 5 kg and 10 meters! > > Second, if you insist that every object has its own collection of units > associated with it, a vast plethora of potential units would spring into > existence!  Surely the whole point of units is to make things simple and > keep the number of units to a minimum, not to make things vastly more > complicated: the same unit can be applied to many different objects.  Or > are you saying that this exception to the rule only applies to number > densities, in which case what's the justification for making it a > special case? > > Third, we can talk about, 'length', 'mass' etc. as abstract objects > divorced from any particular hunks of matter. > > As you are located in the US, take note also that SI has the force of > law, quote from SI Guide: "In January 1991, the Department of Commerce > issued an addition to the Code of Federal Regulations entitled 'Metric > Conversion Policy for Federal Agencies,' 15 CFR 1170, which removes the > voluntary aspect of the conversion to the SI for Federal agencies and > gives in detail the policy for that conversion. Executive Order 12770, > issued in July 1991, reinforces that policy by providing Presidential > authority and direction for the use of the metric system of measurement > by Federal agencies and departments".  The important phrase here is > 'removes the voluntary aspect', which I would say means that you can't > make up your own units such as 'electron'.  So for Federal agencies and > departments it is actually unlawful to use units such as 'electron' that > are not permitted under the SI system!  Actually it's worse than that > since 'electron' is not even a unit, SI or otherwise!  Comparing or > equating different units, or worse, using something which isn't even a > unit where a unit is expected, is called a 'category mistake' > (https://en.wikipedia.org/wiki/Category_mistake > ), or in common > parlance 'comparing apples with oranges'. > > The concept of 'category mistake' will be familiar to programmers of > classed-based object-oriented languages, such as C++ and Java.  Here > 'category' = 'class', and it's a semantic error (trapped by the > compiler) to compare or equate an object instantiated from one class > with an object from a different non-inherited class, simply because it's > not semantically meaningful to do so.  It's also a category mistake to > equate the property of an object (or any part of an object) to the > object itself, and to attempt to apply a method of one class to objects > instantiated from another non-inherited class. > > The SI system (see the Guide, sections 4 & 5) consists of several tiers: > > 1. The 7 SI base units: metre, kilogram, second and 4 others. > 2. SI derived units: combinations of the base units, such as metre/second. > 3. SI coherent derived units: units such as radian with special names > and symbols. > 4. Decimal multiples and sub-multiples of all the above, such as nanometre. > > Then outside the SI system, but still acceptable for use in scientific > publications, there are: > > 5. Non-SI units accepted for use with the SI: non-SI units that are > acceptable owing to common usage, such as hour, degree, litre. > 6. Non-SI units accepted by the International Committee for Weights and > Measures, and therefore accepted into SI, such as electronvolt and dalton. > 7. Non-SI units that are part of other international standards, such as > the electronic charge 'e', being the atomic unit of charge, and the > electron rest mass m_e. > 8. Other non-SI units also accepted because of common usage in > specialised fields, such as Angstrom, rad, barn. > > Finally we have units that are not permissible in any scientific > publication: > > 9. CGS units, such as erg, dyne. > 10. Other obsolete units, such as torr, micron, inch, foot, yard, chain, > furlong, mile, pound, poundal, rod, perch, peck, bushel, etc. etc. > > Notice that the supposedly 'electron' ( or 'proton' or 'rabbit' or > anything composed of matter) units, don't even make it into the list of > impermissible units - simply because they are not even units!  The > closest units to 'electron' in the list are electronic charge 'e' and > electronvolt 'eV' (unit of energy), but as discussed above, they have > nothing to do with electron density. > > A requirement of SI is that if you use a non-SI unit for some quantity > you are _required_ to state the value of that quantity in SI units, or > the conversion factor.  See above-cited Check List for Reviewing > Manuscripts, item 2, quote: "Only SI units and those units recognized > for use with the SI are used to express the values of quantities.  > Equivalent values in other units are given in parentheses following > values in acceptable units only when deemed necessary for the intended > audience. (See Chapter 2.)".  Therefore if you believe that 'electron' > is a unit, please state the value of the 'electron' unit in the > equivalent SI units.  If you have trouble with that, try stating the > value of 1 rabbit or 1 person (for the supposed population density of > rabbits or people that incorporates 'rabbit' or 'person' in the unit > itself) in their equivalent SI units, or in any units for that matter!  > Of course this is all semantic nonsense because it's plainly a category > mistake to attempt to apply the method unitConversion in class Units to > an object instantiated from the non-inherited class Matter (e.g. > electron, proton, person, rabbit etc.). > > Let's make it simpler and drop the units of volume, and talk instead > about form factors (or structure factors), so the unit of electron > density is whatever is the unit of the form factor divided by volume (by > the usual equation for electron density).  Now a form factor is defined > as the _ratio_ of the amplitude of scattering of the specified atom at > some specified scattering angle divided by the scattering of a single > electron (for which the angle is irrelevant).  Being a ratio of two > quantities with identical dimensions, it can only be a pure > dimensionless and unitless number (just like the unitless refractive > index, being the ratio of two speeds).  It follows logically from your > claim above that the units of electron density are 'electrons/A^3', that > the units of form factors would have to be 'electrons', but this is > impossible if form factors are unitless pure numbers (and anyway > electrons are not units!). > > A 'reductio ad absurdum' (reduce to absurdity) argument can be used > here: the form factor at zero scattering angle is of course the number > of electrons in the atom or ion, so do you say 'the number of electrons > in a carbon atom is 6 electrons', or 'the number of electrons is 6'?  > The former follows logically if the units of electron density are > 'electrons/A^3', because then the units of a form factor would be > 'electrons'.  However that is a clear category mistake: it equates a > property of the 'electrons' object ('number of electrons'), which is > obviously an instance of the 'Number' class, with the object itself ('6 > electrons') a blatant commission of a category mistake.  The second > statement above is the only semantically valid one: we must equate > 'number of electrons' (a Number class variable) with '6' (a Number class > constant).  Doing anything else is 'comparing apples with oranges'! > > >    Now the calculations are pretty simple.  When the refinement program > produces a model one of its parameters is a scale factor which relates > the relative values of the observed intensity to those calculated from > the model.  This scale factor, which is usually not written out in an > obvious place since its value is not very interesting, is just a simple > number, not a function of resolution or anything like that.  It's value > is also sensitive to a number of assumptions (like you are modeling > everything in your unit cell) so it is not particularly reliable.  This > means you shouldn't take the density values of your map terribly > seriously.  The differences in density from place to place is much more > reliable. > >    This has led to the practice of converting the density values to > normalized values.  Here you calculate the rms value of the points in > the map and divide all the density points by that number.  "rms" is > simply what is says "Root of the Mean of the Squares".  Again this is > just a number, nothing fancy. > >    The only trick is deciding what region of space to sum.  The crystal > is composed of regions which are occupied by ordered molecules (One > hopes this includs the molecule you are interested in!) and regions of > bulk solvent.  You could reasonably conclude that the rms's of these > regions should be considered different properties of the map.  I'm not > aware of any software that actually tries to calculate an rms for just > the region of the map that contains ordered structure. > >    What was done in the past was to simply calculate the sum over the > region of the map presented to the program, and this was usually a > rectangular box inscribed over the molecule.  The corners of that box > would cover some amount of bulk solvent (and symmetry related molecules) > which depends on a lot of factors which shouldn't be affecting your > choice of contour levels.  This method is inconsistent and causes > confusion. > >    The conventional method today is to calculate the rms by summing > over the entire asymmetric unit.  This, at least, creates consistency, > and can be calculated from the Fourier coefficients making it an easy > number to come up with.  Many programs now use this method, including > Coot (As I understand).  It does have the drawback that a crystal with a > large amount of solvent will have a lower rms than one that is very dry, > even if the variation within the ordered structure is the same.  You > need to be aware of this when interpreting maps whose contours are based > on the rms.  Showing the contour level both as rms and electrons/A^3 is > an attempt to provide a fuller description. > >    Ian is certainly right -- the rms of a function is not a "sigma". > This confusion is a problem that is endemic in our field!  "sigma" is > shorthand for standard deviation which is a measure of the uncertainty > in our knowledge about a value.   The rms is not a measure in any way of > uncertainty -- It is simply a description of how variable the values of > the function are.  James Holton has written a very nice paper on this > topic, but I don't have the reference on hand. > >    The excuse for this confabulation is that people believe, in a Fo-Fc > style map, most of the values should represent factors other than errors > in the structural model and therefore one can estimate the uncertainty > of the map by calculating the rms over the map.  This assumption is > highly questionable and unreliable.  The major problem then arises when > the same logic is extrapolated to a 2Fo-Fc style map.  In these maps the > variability in the ordered region of the crystal is all "signal" so > calculating an rms really has nothing to do with uncertainty. > >    Describing your contours or peaks in an Fo-Fc style map by rms can > sort-of, kind-of, be justified, but it makes no sense for a 2Fo-Fc style > map.  If I want to be really serious about deciding if a peak in a map > may be missing atoms, I will leave some known atoms out of the model and > see how the heights of their difference peaks compare to the heights of > the mysterious peaks.  This method is fairly insensitive to the > systematic problems that affect both rms and electrons/A^2. > > > On all your remaining points above we are thankfully in complete agreement! > > Cheers > > -- Ian >

#### RSS Feeds and Sharing

JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice


text:
Tamed FileSystemWatcher

[Für Details siehe meinen Artikel “Gezähmte Beobachter” im Windows Developer Magazin, Sept 2015]

[Feb 21, 2018: Fixed bug in code: Filter no being applied with OrderByOldestFirst=false]
[Mar 02, 2018: Fixed existing files event argument fileName passing full path with OrderByOldestFirst=false]
[Jan 14, 2019: Fixed with IncludeSubdirectories=true path for preexisting files was SearchPath instead of subdirectory path.
Fixed IncludeSubdirectories=true was ignored with OrderByOldestFirst=false.
[Jan 18, 2019: Fixed Deleted handler not working.]

This post shares robust wrappers around the standard FileSystemWatcher (FSW)  fixing problems commonly encountered when using it to monitor the file system in real-world applications.

Buffering and Recovering FSW

Simply replace the standard FSW with my BufferingFileSystemWatcher and you no longer need to worry about InternalBufferOverflowExceptions. Use my RecoveringFileSystemWatcher to automatically recover from typical transient watch path accessibility problems. Download complete code. For a file system watcher using polling instead of file system events see my FilePoller. To process files detected in either way I recommend using TPL DataFlow ActionBlocks. They allow you to easily process files without having to spawn a Thread or create a Task yourself and allow to configure the degree of parallelism desired. For tips about handling lots of files and using contig.exe to defragment NTFS indexes see NTFS performance and large volumes of files and directories.

Typical FileSystemWatcher Problems

If used properly the standard FileSystemWatcher (FSW) is way better than its reputation. However, there are typical problems one may encounter when first using the FSW:

• Unexpected events.
• Lost events.
• InternalBufferOverflowExceptions.
• No option to report files existing before the FSW started.

The standard FileSystemWatcher:

• Reports exceptions via its Error event. Not via raising exceptions!
• Does not report files that existed before .EnableRaisingEvents =True.
• Does detect network disruptions, but does not automatically recover from them.
• Does automatically handle renames of its watch path.

Unexpected Event Floods

Some applications trigger lots of file system events for a single action. The FSW simply reports these events. Ex: Excel triggers 15 NTFS events for 4 different files when creating a single new .xlsx file and triggers 8 events for 3 different files of which none is changed event for the file changed one would naively expect:

File system event flood triggered by Excel for single actions like “Save”

If you have control over the file producer you can easily tame this event flood by renaming the files to the watched directory or watched extension only when they are totally complete. For .NET applications a file rename is an atomic operation. Your watcher now only needs to watch for a single renamed event per file. An easy way to create lots of files and file system events is repeatedly copying and pasting all files in a directory via CTRL+A, CTRL-C, CTRL-V.

Lost Events

The FSW only throws exceptions on problems when setting its properties. While watching for changes the FSW reports exceptions via its Error event only and does does not raise them. This is typical for the Event-based Asynchronous Pattern (EAP). To prevent exceptions going unnoticed one must handle the Error event. Strangely this so important FSW Error event does not show up in the Win Forms designer, my wrappers fix this. Maybe not discovering the need to implement an OnError handler and being misled by the FSW throwing exception until started is the reason for the wrongly perceived bad reliability of the FSW. The FSW minimizes usage of precious non-paged memory via its InternalBufferSize property and throws an InternalBufferOverflowException “Too many changes at once in directory …”when exceeded.

Robust File Operations

For file operations one should consider using those from the Microsoft.VisualBasic namespace because they are more robust than those in System.IO and offer more features like automatically overwriting existing files.

When working with files this is typically done in a situation where producers and consumers work concurrently. Here if/then constructs are not robust because changes can happen in between. Thus one should rely on exceptions instead.

With IOException.HResult no longer being protected since .NET 4.5 and C# 6.0 finally supporting exception filters (VB.NET always had this feature) it is now easy to handle typical exceptions like FileNotFound, FileInUse or NetworkNameNoLongerAvailable.

BufferingFileSystemWatcher

My BufferingFileSystemWatcher wraps the standard FSW:

• Buffers FSW events in a BlockingCollection. It is better to buffer in a BlockingCollection than consuming precious non-paged memory by increasing InternalBufferSize.
• Supports limiting the BlockingCollection.BoundedCapacity via the EventQueueSize property. Must be set before EnableRaisingEvents=True!
• Offers reporting existing files via a new event Existed. Existing files are reported before any ones detected by NTFS events.
• Offers sorting events by oldest (existing) file first. Gets enabled when subscribing to events Existed or All
• Offers a new event All reporting all FSW events. Real-world apps typically subscribe to all change types because the FSW change types triggered often do not correspond to the action of the producer. Ex: On saving changes Excel triggers 8 events for 3 different files with no(!) change event for the changed file, see picture above.
• Offers the Error event in Win Forms designer.
• Wraps FSW via composition not breaking its API. Thus you can simply replace your FileSystemWatcher instances with BufferingFileSystemWatcher and your InternalBufferOverflowException are gone without increasing InternalBufferSize.

The following listing shows key parts of the BufferingFileSystemWatcher in C# 6.0:

public class BufferingFileSystemWatcher : Component
{
private FileSystemWatcher _containedFSW = null;
...
public BufferingFileSystemWatcher()
{
_containedFSW = new FileSystemWatcher();
}
...
public bool EnableRaisingEvents
{
get
{
return _containedFSW.EnableRaisingEvents;
}
set
{
if (_containedFSW.EnableRaisingEvents == value) return;

StopRaisingBufferedEvents();
_cancellationTokenSource = new CancellationTokenSource();

_containedFSW.EnableRaisingEvents = value;
if (value) RaiseBufferedEventsUntilCancelled();
}
}
...
public event FileSystemEventHandler All
{
{
if (_onAllChangesHandler == null)
{
_containedFSW.Created += BufferEvent;
_containedFSW.Changed += BufferEvent;
_containedFSW.Renamed += BufferEvent;
_containedFSW.Deleted += BufferEvent;
}
_onAllChangesHandler += value;
}
...
private void BufferEvent(object _, FileSystemEventArgs e)
{
{
var ex = new EventQueueOverflowException($"Event queue size {_fileSystemEventBuffer.BoundedCapacity} events exceeded."); InvokeHandler(_onErrorHandler, new ErrorEventArgs(ex)); } } ... private void RaiseBufferedEventsUntilCancelled() { Task.Run(() =>; { try { if (_onExistedHandler != null || _onAllChangesHandler != null) NotifyExistingFiles(); foreach (FileSystemEventArgs e in _fileSystemEventBuffer.GetConsumingEnumerable(_cancellationTokenSource.Token)) { if (_onAllChangesHandler != null) InvokeHandler(_onAllChangesHandler, e); else { switch (e.ChangeType) { case WatcherChangeTypes.Created: InvokeHandler(_onCreatedHandler, e); break; case WatcherChangeTypes.Changed: InvokeHandler(_onChangedHandler, e); break; case WatcherChangeTypes.Deleted: InvokeHandler(_onDeletedHandler, e); break; case WatcherChangeTypes.Renamed: InvokeHandler(_onRenamedHandler, e as RenamedEventArgs); break; catch (OperationCanceledException) { } //ignore catch (Exception ex) { BufferingFileSystemWatcher_Error(this, new ErrorEventArgs(ex)); private void NotifyExistingFiles() { if (OrderByOldestFirst) { var searchSubDirectoriesOption = (IncludeSubdirectories) ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; var sortedFileNames = from fi in new DirectoryInfo(Path).GetFiles(Filter, searchSubDirectoriesOption) orderby fi.LastWriteTime ascending select fi.Name; foreach (var fileName in sortedFileNames) { InvokeHandler(_onExistedHandler, new FileSystemEventArgs(WatcherChangeTypes.All, Path, fileName)); InvokeHandler(_onAllChangesHandler, new FileSystemEventArgs(WatcherChangeTypes.All, Path, fileName)); } } else { foreach (var fileName in Directory.EnumerateFiles(Path)) { InvokeHandler(_onExistedHandler, new FileSystemEventArgs(WatcherChangeTypes.All, Path, fileName)); InvokeHandler(_onAllChangesHandler, new FileSystemEventArgs(WatcherChangeTypes.All, Path, fileName)); ...  RecoveringFileSystemWatcher My RecoveringFileSystemWatcher wraps the BufferingFileSystemWatcher: • Detects and reports watch path accessibility problems. Using a poll timer monitoring the watch path and the FSW Error event. For Robustness restarting from the Error event is not done directly but also done via the timer! • Automatically recovers from watch path accessibility problems. By restarting the BufferingFileSysteWatcher. New files created during the outage are reported via the Existed event. • Allows consumer to cancel auto recovery for selected exceptions using e.Handled=True. The following listing shows key parts of the RecoveringFileSystemWatcher: public class RecoveringFileSystemWatcher : BufferingFileSystemWatcher { public TimeSpan DirectoryMonitorInterval = TimeSpan.FromMinutes(5); public TimeSpan DirectoryRetryInterval = TimeSpan.FromSeconds(5); private System.Threading.Timer _monitorTimer = null; ... public new bool EnableRaisingEvents { get { return base.EnableRaisingEvents; } set { if (value == EnableRaisingEvents) return; base.EnableRaisingEvents = value; if (EnableRaisingEvents) { base.Error += BufferingFileSystemWatcher_Error; Start(); } else { base.Error -= BufferingFileSystemWatcher_Error; } private void Start() { try { _monitorTimer = new System.Threading.Timer(_monitorTimer_Elapsed); Disposed += (_, __) =>; { _monitorTimer.Dispose(); _trace.Info("Obeying cancel request"); }; ReStartIfNeccessary(TimeSpan.Zero); private void _monitorTimer_Elapsed(object state) { try { if (!Directory.Exists(Path)) { throw new DirectoryNotFoundException($"Directory not found {Path}");
}
else
{
_trace.Info($"Directory {Path} accessibility is OK."); if (!EnableRaisingEvents) { EnableRaisingEvents = true; if (_isRecovering) _trace.Warn("<== Watcher recovered"); } ReStartIfNeccessary(DirectoryMonitorInterval); } } catch (Exception ex) when ( ex is FileNotFoundException || ex is DirectoryNotFoundException) { if (ExceptionWasHandledByCaller(ex)) return; if (_isRecovering) { _trace.Warn("...retrying"); } else { _isRecovering = true; } EnableRaisingEvents = false; _isRecovering = true; ReStartIfNeccessary(DirectoryRetryInterval); } catch (Exception ex) { _trace.Error($"Unexpected error: {ex}");
throw;

private void ReStartIfNeccessary(TimeSpan delay)
{
try
{
_monitorTimer.Change(delay, Timeout.InfiniteTimeSpan);
}
catch (ObjectDisposedException)
{ } //ignore timer disposed
}

private void BufferingFileSystemWatcher_Error(object sender, ErrorEventArgs e)
{
var ex = e.GetException();
if (ExceptionWasHandledByCaller(e.GetException()))
return;

EnableRaisingEvents = false;

if (ex is InternalBufferOverflowException || ex is EventQueueOverflowException)
{
ReStartIfNeccessary(DirectoryRetryInterval);
}
else if (ex is Win32Exception && (ex.HResult == NetworkNameNoLongerAvailable | ex.HResult == AccessIsDenied))
ReStartIfNeccessary(DirectoryRetryInterval);
}

The following picture shows a console trace of the RecoveringFileSystemWatcher working and auto recovering:

RecoveringFileSystemWatcher working and auto recovering

Perpetual Traveller, IT Consultant
This entry was posted in Computers and Internet and tagged , , . Bookmark the permalink.

67 Responses to Tamed FileSystemWatcher

1. Peter,

Thanks for sharing!

I noticed that delete handler is not working, It is due to missing: _onDeletedHandler += value in delete event handler.

Regards,
Michal

2. Bart says:

Is there a chance that the dlls are going to be available via nuget?

• Peter Meinl says:

No. For that I have not tested this version good enough.

3. Joy says:

Hi Peter,
Thanks for sharing this very useful application.
I have created a filewatcher service which was failing when there were more then 40 files. This has been resolved by using your BufferingFileSystemWatcher API in my application. I have tested with more than 200 files and they all processed! But the processing time increased significantly. Is there any place in you code I may look into to improve the performance?

Thanks a lot!
Joy

• Peter Meinl says:

I doubt that your performance problems are related to my BufferingFileSystemWatcher. You might be able to optimize your performance by using a TPL DataFlow ActionBlock

• pregunton says:

did you improve performance ? tips ?

• Peter Meinl says:

What kind of performance problems do you mean?

4. Anghell says:

Hi Peter, Thanks for sharing!
Greetings from Mexico City!
Angel

5. greggman says:

Thank you for sharing. I got here in a round about way but basically watching a samba share with FileSystemWatcher, at least in my setup, Window 10 x64, share on NAS, notices single file changes but responds with

System.IO.InternalBufferOverflowException: Too many changes at once in directory:\\10.0.1.1\gregg\src.

Searching eventually led me here but even with the solution above I get the same error. I guess that is a deeper issue with .NET

Started looking through the dotcorefx code but it’s way out of my experience.

https://github.com/dotnet/corefx/blob/master/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.Win32.cs

6. D Soa says:

This looks like a very cool tool. I noticed that BufferingFileSystemWatcher.NotifyExistingFiles does not honor the Filter but returns all files if OrderByOldestFirst is false. Move the definition of searchSubDirectoriesOption out of the if and change the foreach in the else to this:

foreach (var fileName in Directory.EnumerateFiles(Path, Filter, searchSubDirectoriesOption))

Cheers!

• Peter Meinl says:

Thanks for reporting this bug and describing a solution.

7. D Soa says:

Could you explain how the ReStartIfNecessary() is restarting the BufferingFileSystemWatcher? I don’t see that the contained FileSystemWatcher is getting recreated. We have run into issues where FileSystemWatcher just stops monitoring a path. Does changing EnableRaisingEvents somehow “poke” it to tell it to look again?

Thanks!

• Peter Meinl says:

Only the RecoveringFileSystemWatcher does recover automatically from watch path accessibility problems (not the BufferingFileSystemWatcher).

You can verify the auto recovery working by using the TestConsoleApp:
– Run the .exe (don’t run it from within Visual Studio).
– Uncomment RunRecoveringWatcher();
– Uncomment watcher.DirectoryMonitorInterval = TimeSpan.FromSeconds(10);
Because the default (for real world usage) ist 5 min.

I don’t recall why I simply change EnableRaisingEvents and do not create an new instance of the contained FSW. Maybe creating a new instance cause unwanted side effects or it was simply unnecessary.

• D Soa says:

Yeah, maybe it isn’t necessary to create a new one because internally the FSW will create a new directory handle when you enable raising events again. Creating a new one would be difficult also because you’d have to re-set all the options that were set on the old one. If this works, it is much simpler!

Thanks for the quick replies.

8. Tim Meyer says:

Great work on this! I noticed that the Existing files event argument passes the full path and file name back for FullPath and Name when not sorting by oldest file. All the other events just pass the file name in the Name property. Something similar to below should remedy in NotifyExistingFiles method.
foreach (var fileName in Directory.EnumerateFiles(Path, Filter, searchSubDirectoriesOption))
{
var name = System.IO.Path.GetFileName(fileName);
InvokeHandler(_onExistedHandler, new FileSystemEventArgs(WatcherChangeTypes.All, Path, name));
InvokeHandler(_onAllChangesHandler, new FileSystemEventArgs(WatcherChangeTypes.All, Path, name));
}

Thanks again for the article and code.

• Peter Meinl says:

9. Rich says:

Hi:
Thanks for the solution and all your hard work. I usually go with polling change events by file size comparisons after creation event has been issued. I now need a solution to monitor 8 separate directories of very large log files on AWS instance and when all the files have been copied; the copied newly Rsynced files need to be copied together into a separate directory and automatically updated into a MSSQL database and then have all the file handles and garbage collection done on all open file handles resources. What do you think is the best solution for this? Since this action will run once a day and move files from 8 different directories to one directory and then upload the one file ( copied together from the 8 separate files) into an MSSQL database. Do you think it would be better to watch each separate file with a FSW or since we know that all the files will definitely be created by 12:00 A.M. E.S.T. just check if the files exist and save the file size and re-check 50 seconds later to make sure the file size hasn’t changed and then just move the files into one directory and concatenate them together ? Then have the one file which will always have the one name attribute change and that is the date the file was created and use that as a way to trigger the upload of the concatenated file. Sorry for the lengthy explanation but in short we have 8 different files rsyched to a different directories. The file names will be exactly the same with the date appended at the end. Each of these separate files will to copied together and placed into a separate upload directory and when the concatenated file has finished copying it needs to be loaded into a MSSQL database. This would be in a ASP.NET MVC 4.5 framework application running MSSQL 2008 R2. I’m just trying to decide should I go with SSIS and a .INI file in each 8 separate directories and just upload each separately or go with 8 FSW and one more in the upload directory to trigger the load event on a timed creation response from the FSW in the upload directory. Thanks so much for your time

• Peter Meinl says:

As always: keep your solution as simple as possible!

Make it robust – e.g. against:
– the producer system hanging
– producer unexpectedly completing at a different time then 12:00
– your consumer app crashing and being restarted and then processing the same imput files again

With file-based interfaces it is always good if you have control over the producer. Instead of having to test in the consumer if the producer has completed file creation one can then simply have the producer rename the file to an extension being watched by the consumer once it iscomplete – e.g. produce filexyz.TMP and when complete rename it to filxyz.LOG. Renaming in Windows is an atomic operation and once the renamed file (.LOG) exists the consumer knows it is complete.

If you can’t control the producer instead of comparing file sizes consider trying to open the file exclusively. As long as you can’t get exclusive access the file is still being written to:

__Function IsFileComplete(filePath As String) As Boolean
____Try
______Using fs As New IO.FileStream(filePath, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.None)
______End Using
______Return True
____Catch ex As IO.IOException When IsFileInUse(ex)
______Return False
____Catch
______Throw
____End Try
__End Function

__Function IsFileInUse(ByVal ex As IO.IOException) As Boolean
____’https://msdn.microsoft.com/en-us/library/ms681382%28v=VS.85%29.aspx
____Return (ex.HResult = ERROR_SHARING_VIOLATION OrElse ex.HResult = ERROR_LOCK_VIOLATION)
__End Function

I would simply check if all 8 files are complete (in case you used rename in the producer simply test for their existence) and if so do the import.
If not the next run of your consumer will get them.

Consider creating as Windows Scheduled Task or Windows Service instead of an ASP.NET MVC app.

For a scheduled task create a console app and register it with the Win Task Scheduler to run every hour or so.

For a service see my post: Windows Service Worker Options

__Do
____Check if all files are complete
____Import to SQLServer
____ ….WaitOne(TimeSpan.FromHours(1))
__Loop

You should not have to deal with file handles and garbage collection. Make use of the C# or VB.NET “using” statement and delete the input files after importing (or maybe for even better robustness delete them in the producer at the start of the resync step you mentioned).

Add a field to the database data holding a the date suffix you mentioned so you can handle the situation when running multiple times with the same input files.

Consider user MSSQL FileStream to store files in the DB. See my post Managing BLOBs using SQL Server FileStream via EF and WCF streaming

If you have control over the producer and thus can use the rename trick I mentioned you might need no code at all and could simply create an SSIS package and schedule it as periodically running SQL Server job. If all files (*.LOG) exist they are complete and will get imported. You just have to skip the import if one of the files does not exist yet.

10. Ben says:

Hello,

What an impressing piece of work on! Thanks for sharing. After struggling a long time with all FileSystemWatcher annoying drawbacks (event buffer filled, recovery,…) to watch a Samba share, it seems like I found a winner here.

I’m now testing RecoveryFileSystemWatcher (after BufferingFileSystemWatcher) and I wonder how respond to an error event, currently I get an type conversion error:

// RecoveryFileSystemWatcher version
_fswatcher.Created += new FileSystemEventHandler(event_created);
_fswatcher.Error += new ErrorEventHandler(event_error);

// OK
private void event_created(object _src, FileSystemEventArgs _arg)
{
// …
}

// Not OK: Error message in VS is “Cannot implicitly convert type System.IO.EventHandler to ‘System.EventHandler”

private void event_error(object _src, ErrorEventArgs _arg)
{
Exception _ex = _arg.GetException();
string _msg;

// … Code here
}

Could you give me a hint on how to handle errors from ‘RecoveryFileSystemWatcher’?

Plus what would be your design advice for post-detection processing (Tasks, threads,…) for a large amount of file (on Created & Existed events)?

Thanks

• Peter Meinl says:

The signature of the Error event differs between BufferingFileSystemWatcher and RecoveringFileSystemWatcher. RecoveringFileSystemWatchers event args are of type FileWatcherErrorEventArgs not ErrorEventArgs.

The TestConsoleApp in my sample code notifies errors like this:
..watcher.Error += (_, e) => { WriteLineInColor(e.Error.Message, ConsoleColor.Red); };

FileWatcherErrorEventArgs being derived from HandledEventArgs allows the consumer to suppress auto error handling by setting e.handled=true:
..watcher.Error += (_, e) =>
….{ WriteLineInColor($”Suppressing auto handling of error {e.Error.Message}”, ConsoleColor.Red); ……..// some error handling ……..e.Handled = true; ….}; I generally implement file processors as Windows services. See my posts “Windows Service Worker Options” and “Simple WCF”. How to best process your files depends on the type of processing required. If the processing is compute-bound you might want to parallelize to make full use of the processors available. A nice solution for this is using TPL Dataflow. See my post “A WebCrawler demonstrating the Beauty of TPL Dataflow”. Here a simplified example using a TPL Dataflow ActionBlock with MaxDegreeOfParallelism = Environment.ProcessorCount to process files in parallel: Sub Main() ….’Reading files sequentially and asynchronously ….Dim reader As New TransformBlock(Of String, String)( ……..Async Function(path) …………Using sr As New StreamReader(path) …………….Dim fileString = Await sr.ReadToEndAsync().ConfigureAwait(False) …………….Return fileString …………End Using ……..End Function) ….’Processing file content concurrently ….Dim totalWordCount As Integer ….Dim processor As New ActionBlock(Of String)( ……..Sub(content) …………Dim allWordsRegEx As New Regex(“\S+”) …………Dim wordCount = allWordsRegEx.Matches(content).Count …………Debug.Print(“Processing result={0}”, wordCount) …………Interlocked.Add(totalWordCount, wordCount) ……..End Sub, ……..New ExecutionDataflowBlockOptions With {.MaxDegreeOfParallelism = Environment.ProcessorCount}) ….processor.Completion.ContinueWith( ……..Sub() …………Console.WriteLine(“totalWordCount={0}”, totalWordCount) ……..End Sub) ….reader.LinkTo(processor, New DataflowLinkOptions With {.PropagateCompletion = True}) ….For Each path In Directory.EnumerateFiles(“x:\temp1\testfiles\in”, “*.txt”) ……..reader.Post(path) ….Next ….reader.Complete() ….PromptUser(“Working… Press to exit:”, ConsoleColor.White) End Sub 11. Dave Newman says: Hi Peter – Thanks for sharing this fix for a “very powerful tool” (MSDN quote) — with limitations. I haven’t done much with it yet but I am encouraged by the comments here! My question concerns the following line from your README file: June 6, 2015: Changed from .NET 4.6 to 4.5 Why the change from 4.6 to 4.5? Was this due to an issue with your code fixes or just to make it easier to use in codebases that reference 4.5? Thanks, Dave • Peter Meinl says: Sorry, but I don’t remember the reason. I assume it was “just to make it easier to use in codebases that reference 4.5”. The code does not use any “special” framework features – only C# language features that were relatively new at this time (e.g. string interpolation with {}). • Dave Newman says: Thanks fr the reply, and thanks for creating and sharing this! I was considering doing something like this so I could reliably wait on files with FileSystemWatcher, but you have saved me the effort! 12. Jaime Stuardo says: Hello… thanks for sharing this. I have a question. I am using RecoveringFileSystemWatcher and assign TimeSpan.FromSeconds(10) to DirectoryMonitorInterval property because a sample appears that way. For its name, I guess there is a timer that checks the monitored folder and if there is a file, the event will be raised. That is for assuring all files will be detected, in case the Created event is not raised when it should (situation that may occur some times). Please confirm this. On the other hand, when should EventQueueCapacity property be used? if not specified, the default of int.MaxValue is used. Thanks Jaime • Peter Meinl says: The standard FSW does only detect network disruptions, but does not automatically recover from them. My RecoveringFileSystemWatcher uses the DirectoryMonitorInterval (default 5 min, the sample uses 10 sec to make testing easier) to detect and automatically recover from all watch path accessibility problems. This is not intended to compensate for lost events. The are no lost events because FSW errors and watch path accessibility errors are handled automatically by restarting the FSW and checking for existing files. In an older version I polled for overlooked files but this proved to be unnecessary and introduced race conditions with the standard event handling. EventQueueCapacity (default int.MaxValue) exposes the upper bound of the underlying BlockingCollection used to queue FSW events. I don’t see any reason to limit it but exposed the parameter in case someone might need it. 13. Jaime Stuardo says: I am using RecoveringFileSystemWatcher and inside the created event, I have: try { using (StreamReader sr = new StreamReader(filePath)) { xml.LoadXml(sr.ReadToEnd()); sr.Close(); } } catch (Exception ex) { InfoLog.Save($”No se pudo leer el archivo XML {filePath}. Revise el log de errores.”);
ErrorLog.Save(ex);

return false;
}

Where filePath is the full path name to the file detected by the file system watcher.

The problem is that I am getting an error telling the file cannot be accessed because it is used by another process. The call stack is:

en System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
en System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
en System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
en System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
en Executor.Proceso.ProcessXML(String filePath)

What do you think about this error? the watcher keeps locked the file some times? Is there a way to avoid this?

Thanks
Jaime

14. Peter Meinl says:

Problems with files being in use by another process are typical for file-based interfaces. The standard FSW and my watchers do not keep locks on the files. Typically the producer has not finished processing the file yet.

With file-based interfaces it is always good if you have control over the producer. Instead of having to test in the consumer if the producer has completed file processing one can have the producer rename the file to an extension being watched by the consumer once it iscomplete – e.g. produce filexyz.TMP and when complete rename it to filxyz.LOG. Renaming in Windows is an atomic operation and once the renamed file (.LOG) exists the consumer knows it is complete.

If you can’t control the producer consider trying to open the file exclusively. As long as you can’t get exclusive access the file is still being written to, once you get exclusive access you can process it:

__Function IsFileComplete(filePath As String) As Boolean
____Try
______Using fs As New IO.FileStream(filePath, IO.FileMode.Open, IO.FileAccess.Read, IO.FileShare.None)
______End Using
______Return True
____Catch ex As IO.IOException When IsFileInUse(ex)
______Return False
____Catch
______Throw
____End Try
__End Function

__Function IsFileInUse(ByVal ex As IO.IOException) As Boolean
____’https://msdn.microsoft.com/en-us/library/ms681382%28v=VS.85%29.aspx
____Return (ex.HResult = ERROR_SHARING_VIOLATION OrElse ex.HResult = ERROR_LOCK_VIOLATION)
__End Function

• Jaime says:

Thanks Peter… i have finally done something like this. The problem was that. FSW throws the event immediately when a file is present, even when the file is not closed yet, so I created a method to test if file was closed and after that, to process it.

Regards
Jaiune

• Peter Meinl says:

A word of caution: The pattern “IF IsFileComplete THEN ProcessFile” is only robust in simple producer-consumer scenarios. I most real-world concurrency scenarios I prefer to process concurrent actions in a retry loop to be robust against concurrent actions happening between the resource available check (e.g. IsFileComplete) and the action (e.g. ProcessFile).

For an example see DB.DoWithRetryOnConcurrencyConflict in DB Concurrency Control with .NET – Details.
It uses a retry loop and with random exponential back-off to avoid excessive retries.

15. Chris W. says:

i am having the same issue with long list of files in folders and the issues with FSW. i am trying to implement your solution in a C# WPF app using a listbox. I am doing some testing just by adding a new wpf project to your test console app but im running into issue with an error stating the following below, but i never cancel the operation. when i added my wpf test project, i set it as the startup project. if i set the the testconsole app as the startup i do not get this error message. Last question, is it possible to use your solution to watch multiple folders?

System.OperationCanceledException occurred
HResult=-2146233029
Message=The operation was canceled.
Source=System
StackTrace:
at System.Collections.Concurrent.BlockingCollection1.TryTakeWithNoTimeValidation(T& item, Int32 millisecondsTimeout, CancellationToken cancellationToken, CancellationTokenSource combinedTokenSource)
at System.Collections.Concurrent.BlockingCollection1.d__68.MoveNext()
InnerException:

• Peter Meinl says:

I just added a WPF test app with a ListBox and it works fine. Download code here
https://1drv.ms/u/s!Anf2N-CeZxxmnJxvi8s8DWvJSOm6SA

Don’t know what is wrong in your solution. Maybe you defined your watcher at the wrong place in App.xaml.cs and it gets unintentionally disposed. When my watchers get disposed, e.g. when pressing in the TestConsoleApp window you will see an normal operation cancelled error when debugging (not when running the exe). In my test I defined in the MainWindow.

16. Daniel Schlößer says:

Hello Peter,

I like your BufferingFileSystemWatcher class! But I noticed some strange behaviour in case of using the All event in conjunction with the IncludeSubdirectories property set to true.
I will get file paths that contain the original directory to watch immediately followed by just the file name even if it is in a sub directory.
Example:

Directory to watch: “d:\Dir\”
Existing file path that should be reported: “d:\Dir\Subdir\samplefile.txt”
File that is reported by All event: “d:\Dir\samplefile.txt”

It seems the handling logic removes the “Subdir” part of the file path before notifying about it.

It seems like a bug or am I doing something wrong?

Daniel

• Peter Meinl says:

I will look into this.

• Peter Meinl says:

Thanks Daniel for reporting this. I fixed two bugs:
With IncludeSubdirectories=true path for preexisting files was SearchPath instead of subdirectory path.
IncludeSubdirectories=true was ignored with OrderByOldestFirst=false.

• Daniel Schlößer says:

Thanks, it works now. 🙂

17. youg tim says:

Hi Peter
I use this code , but it doesn’t work.

watcher.Deleted += (_, e) =>
{
WriteLineInColor($”{e.ChangeType} {e.FullPath}”, ConsoleColor.Yellow); }; • Peter Meinl says: Try if the TestConsoleApp in my solution does detect files deleted in your folder(s). Maybe your watcher object goes out of focus before it can detect anything. In the TestConsoleApp the watcher object is kept alive by PromptUser(). In a WPF or WinForms windows you could define a _watcher object scoped at window level. • youg tim says: I use TestConsoleApp and change some script. Only “watcher.Deleted” doesn’t work. using (var watcher = new RecoveringFileSystemWatcher(TestPath)) { watcher.IncludeSubdirectories = true; watcher.Deleted += (_, e) => { WriteLineInColor($”{e.ChangeType} {e.FullPath}”, ConsoleColor.Yellow);
};

watcher.Renamed += (_, e) =>
{
WriteLineInColor($”{e.ChangeType} {e.FullPath} {e.OldFullPath}”, ConsoleColor.Yellow); }; watcher.Created += (_, e) => { WriteLineInColor($”{e.ChangeType} {e.FullPath}”, ConsoleColor.Yellow);
};

watcher.Changed += (_, e) =>
{
WriteLineInColor($”{e.ChangeType} {e.FullPath}”, ConsoleColor.Yellow); }; watcher.Error += (_, e) => { WriteLineInColor(e.Error.Message, ConsoleColor.Red); }; watcher.OrderByOldestFirst = false; watcher.EnableRaisingEvents = true; PromptUser(“Processing…”); Console.WriteLine(“Stopping…”); } • youg tim says: I found a bug in BufferingFileSystemWatcher.cs public event FileSystemEventHandler Deleted { add { if (_onDeletedHandler == null) _containedFSW.Deleted += BufferEvent; _onDeletedHandler += value; // <<<<<<<<< This code didn't add } remove { _containedFSW.Deleted -= BufferEvent; _onDeletedHandler -= value; } } And thanks for sharing! 18. Peter Meinl says: Thanks for your fix Tim. I updated my downloadable code of this post accordingly. 19. Paul says: Hi Peter There seems to be a problem with the BufferingFileSystemWatcher while using it on a network share. When we copy >20 files to a network share we get the following exception: System.OperationCanceledException The exception occurs in the “RaiseBufferedEventsUntilCancelled” method in line “foreach (FileSystemEventArgs e in _fileSystemEventBuffer.GetConsumingEnumerable(_cancellationTokenSource.Token))”. Do you have any idea how to solve it? Regards Paul • Peter Meinl says: Try watching your network share with the TestConsoleApp I provided in the download. When my watchers get disposed, e.g. when pressing in the TestConsoleApp window you will see an normal, expected OperationCanceledException when debugging – not when running the exe. Maybe your watcher object goes out of focus or you unintentionally dispose it. In the TestConsoleApp the watcher object is kept alive by PromptUser(). In a WPF or WinForms windows you could define a _watcher object scoped at window level. • Paul says: Hi Peter Thanks for your reply. The error occures in the contained FSW (_containedFSW) in the BufferungFileSystemWatcher.cs file. The exception is: “Too many changes at once in directory…”, so the default behavior of FSW. BufferingFileSystemWatcher is catching and restarting, but unfortunately the action which is registered with the File-Created-Event is not executing after the restart. using (var watcher = new RecoveringFileSystemWatcher(TestPath)) { watcher.IncludeSubdirectories = false; //watcher.All += (_, e) => { WriteLineInColor($”{e.ChangeType} {e.Name}”, ConsoleColor.Yellow); };
watcher.Created += (_, e) => { DeleteFile(e.FullPath); };
watcher.Deleted += (_, e) => { WriteLineInColor($”{e.ChangeType} {e.FullPath}”, ConsoleColor.DarkYellow); }; watcher.Error += (_, e) => { WriteLineInColor(e.Error.Message, ConsoleColor.Red); }; //watcher.Error += (_, e) => // { WriteLineInColor($”Suppressing auto handling of error {e.Error.Message}”, ConsoleColor.Red);
// //…
// e.Handled = true;
// };
watcher.IncludeSubdirectories = false;
watcher.OrderByOldestFirst = true;
watcher.DirectoryMonitorInterval = TimeSpan.FromSeconds(10);
watcher.DirectoryRetryInterval = TimeSpan.FromSeconds(10);
watcher.EnableRaisingEvents = true;

PromptUser(“Processing…”);
Console.WriteLine(“Stopping…”);
}

Any ideas?

Regards
Paul

20. Peter Meinl says:

Please clarify: In your original post you talked about an OperationCanceledException. Now we are talking about an InternalBufferOverflowException “Too many changes at once…”.

Hmmm… in all my tests I was never able to produce an InternalBufferOverflowException with so few files (just 20). Your test producing this error might be caused by some specifics of the file share used (e.g. extremely long path names) or because you have no real processing (taking some time) registered for the created event – the DeleteFile immediately triggers a deleted event for the FSW to catch.

Still my RecoveringFileSystemWatcher should detect the new files after restart. Please check why NotifyExistingFiles() seems not to work.

And you may try running the EXE instead of running under the debugger. I have had many cases (in different scenarios) where strange behaviors occurred under the debugger only.

• Paul says:

Hi Peter

Yes, the framework throws an OperationCanceledException because the internal FSW throws a “Too many changes” exception.

I figured out, why the NotifyExistingFiles() did not work. I just registered the “Created” event. I had to register the “Existed” event aswell. Now it works as expected.

Regards
Paul

21. Thecury says:

Great job done. Is it possible to have a version that can run on .netcore 2.2? I intend to use this with IHostedService

• Peter Meinl says:

Sorry Thecury! currently I am not in the mood for working on this. Will let you know In case I make something like this available.

22. Paul Williams says:

I downloaded the RecoveringFileSystemWatcher, it looks quite promising. Is the FilePoller still supported? The link is broken.
I’m working on a watchdog program in an operations environment. An event-based file watcher is not suitable for this application. (no matter how robust)

Thanks,
Paul

• Peter Meinl says:

Hi Paul, I just fixed the FilePoller link.

23. Gabriel Schwartz says:

Hi
You’re implementation looks promising.
Do you have a nuget for it as otherwise I will need to run it on your website 🙂 to watch for updates.

• Peter Meinl says:

No NuGet. You can download the complete code, incl. test case, via the link in the first paragraph under the picture.

24. Russell Mellnick says:

I’m using your filewatcher with the filesystem.dll. When I run my project as a console app it works great picks up exisiting files and handles new files. When I run it as a service ( made sure the service is running under the same account as I’m logged into the computer as) when debuging the application using the attach to process I see where it dies. it will go to notifyfile then come back and die.
Is there anything special Local security policies etc? using vb.net

Private Sub _FSWatcher_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles _FSWatcher.Created
Dim detectedFileInfo As New FileDetectedEventArgs(e.FullPath, FileDetectedReason.Created, DateTime.Now)
_trace.Trace(detectedFileInfo)
_trace.Trace(“Waiting for DetecFiles={0}”, _initialDetectEvent.WaitOne(0))
_initialDetectEvent.WaitOne()
Try
NotifyFile(e.FullPath, DateTime.Now, FileDetectedReason.Created)

Catch ex As Exception
If Not IsErrorHandled(ex) Then Throw
End Try
End Sub

• Peter Meinl says:

If you implement the filewatchers Error event you should be able to see the the error details.
Private Sub _fileWatcher_Error(sender As Object, e As ErrorEventArgs) Handles _fileWatcher.[Error]
If _CT.IsCancellationRequested Then Return
_trace.Error(e.GetException)
End Sub

For a service example in VB.NET see my post Windows Service Worker Options in this blog.

• Russ Mellnick says:

Thank you for the links. I was looking at the sample windowsserviceworkersoptions and was wondering if I wanted to use the eventwork would I put my code into startworking sub. I need to manipulate the file and move it

• Peter Meinl says:

Windows Service OnStart and my StartWorking() is meant only for code to start a service, like creating a filewatcher instance. Code doing any processing does never belong there.

Your code to to manipulate and move a file belongs into the filewatcher events. In my exampe I encapsulted this in Work() and simulated some work via Thread.Sleep().

Your easiest route may be to copy my complete WindowsServiceWorkterOption example and

1. In _WinService.vb uncomment
‘— Using event driven file watcher
‘_eventWorker = New EventWorker
‘_eventWorker.StartWorking(_cts.Token)

This way in addition to production qualtity code you get a self-installing service:
WindowsServiceWorkerOptions.exe runs as console app.
WindowsServiceWorkerOptions.exe -i installs the service.
WindowsServiceWorkerOptions.exe -u uninstalls the service.

• Russ Mellnick says:

Thank you so much. Learning by doing.

• Russell Mellnick says:

Peter
Thank you so much again.
I’ve got things copied over and I put a simple file.move int he work folder but I noticed it runs twice the first time it moves then runs again and gives me an error.

38:44,245| _fileWatcher_Error: System.IO.FileNotFoundException: Could not find file ‘D:\IOS\Custom Development\IOSFileWatcher\bin\Debug\Direct Fitness Solutions.CSV’.
File name: ‘D:\IOS\Custom Development\IOSFileWatcher\bin\Debug\Direct Fitness Solutions.CSV’
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
at System.IO.File.Move(String sourceFileName, String destFileName)
at IOSFileWatcher.EventWorker.Work(FileSystemEventArgs e) in D:\IOS\Custom Development\IOSFileWatcher\EventWorker.vb:line 46
at IOSFileWatcher.EventWorker._fileWatcher_All(Object sender, FileSystemEventArgs e) in D:\IOS\Custom Development\IOSFileWatcher\EventWorker.vb:line 31
at LeanWork.IO.FileSystem.BufferingFileSystemWatcher.InvokeHandler(FileSystemEventHandler eventHandler, FileSystemEventArgs e) in D:\Users\pm\OneDrive\00_Projects\00_LeanWork\LeanWork.IO.FileSystem.Watcher\LeanWork.IO.FileSystem.Watcher\LeanWork\IO\FileSystem\BufferingFileSystemWatcher.cs:line 353
at LeanWork.IO.FileSystem.BufferingFileSystemWatcher.b__69_0() in D:\Users\pm\OneDrive\00_Projects\00_LeanWork\LeanWork.IO.FileSystem.Watcher\LeanWork.IO.FileSystem.Watcher\LeanWork\IO\FileSystem\BufferingFileSystemWatcher.cs:line 289

Sub Work(e As FileSystemEventArgs)
_trace.Debug(“->”)
Try
_workingEvent.Reset()
_trace.InfoFormat(“{0}: {1}”, e.ChangeType, e.Name)

File.Move(e.Name, “d:\temp\out\” + Path.GetFileName(e.FullPath))

Finally
_workingEvent.Set()
End Try
_trace.Debug(“<-")
End Sub

25. Russell Mellnick says:

In debuging the change type is deleted so it is running again. would you recommend filtering on the changetype or is there a way to just catch created and existing?

26. Peter Meinl says:

Working with filewatchers your code must expect event flooding i.e. handle exceptions like FileNotFound, FileInUse. Beware! if/then constructs like “If File.Exists then …” are not robust here because changes can happen between the If and your processing. Thus one should rely on exceptions raised from the processing code instead. You can ignore FileNotFound and do retreis when FileInUse. Something like this:

Dim maxRetries = 5
For i = 1 To maxTries
Try
Catch ex As FileNotFoundException
_trace.Debug($”File not found {fileName}, ignoring Catch ex As IOException When IsFileLocked(ex) If i = maxTries Then Throw _trace.Debug($”File is in use {fileName}, retrying”)
End Try
Next

Function IsFileLocked(ByVal IOexception As IOException) As Boolean
Const sharingViolation = 32, lockViolation = 33
Dim errorCode = Runtime.InteropServices.Marshal.GetHRForException(IOexception) And ((1 << 16) – 1)
Return (errorCode = sharingViolation OrElse errorCode = lockViolation)
End Function

Do not built file paths via string concatenation like "d:\temp\out\" + "…" For more robustness use Path.Combine(). instead.

My filewatchers raise specific events for Created, Changed, Renamed, Deleted.

• Russell Mellnick says:

Peter

Once again thank you. I started looking into the version \ dates of the dll and then looked at the release notes and figured out I had a old version. Updated and some of my issues where resolved.

The fixed paths where used to mock up and test, I will use the path.combine. Thank you for pointing that out.

Question : Your last statement “My filewatchers raise specific events for Created, Changed, Renamed, Deleted.”

I’m only interested in the created and existing files. what I did was create two subs such as below to handle the _filewatcher.existed and the _filewatcher.created events.
Private Sub _fileWatcher_Existed(sender As Object, e As FileSystemEventArgs) Handles _fileWatcher.Existed

Is this the correct way or is there a different way to handle the events.

27. Peter Meinl says:

You should listen only to the events you are interested in.

28. Russell Mellnick says:

Peter,
My project with your dll’s works great and really fast. It has come to my attention that the program that is creating the files I’m watching for seems to open then close the file several times during the life span of the file.
Filesystemwatcher picks it up and processes it. In your opinion what would be the best way to handle this?
Test the age of the file and not allow it to go into the queue to be processed?
Watch for a control file then look for existing items?
would the polling method work better.

Once again Thank you so much for all of your assistance.

• Peter Meinl says:

Generally polling is a good solution for some problems (see Windows Service Worker Options) but it will not solve the problem of a producer reopening a file several times. If you have control over the file producer you can change it to work in a directory or with with a file extension not watched for and rename the files to the watched directory or extension only when they are totally complete. For .NET applications a file rename is an atomic operation. Your watcher now only needs to watch for a single renamed event per file.

29. Liangjun Xie says:

I use FileSystemWatcher to watch a file in c# project. In the OnChanged event it will call a Perl script using process. the process stopped after process.start(), though I set the process.WaitForExit(TIMEOUT). After selecting the console, and clicking keyboard, it was running properly. How can I avoid manually clicking? Thank you.

private static void Run()
{
// Create a new FileSystemWatcher and set its properties.
using (FileSystemWatcher watcher = new FileSystemWatcher())
{
watcher.Path = filePathTobeMonitor;
watcher.Filter = fileNameTobeMonitor;

// Watch for changes in LastAccess and LastWrite times, and
// the renaming of files or directories.
watcher.NotifyFilter = NotifyFilters.LastWrite;
//| NotifyFilters.CreationTime;
//| NotifyFilters.LastAccess
//| NotifyFilters.FileName
//| NotifyFilters.DirectoryName;

watcher.Changed += OnChanged;
watcher.Created += OnChanged;
watcher.Deleted += OnChanged;

// Begin watching.
watcher.EnableRaisingEvents = true;
watcher.IncludeSubdirectories = false;

// Wait for the user to quit the program.
Console.WriteLine(“Press ‘q’ to quit the sample.”);
}
}

public static void OnChanged(object source, FileSystemEventArgs e)
{
CallTestPerl();
});
}

private static void CallTestPerl()
{
int TIMEOUT = 15000;
string perlScritpFileName = customizationDir + “\\FirstProj.pl”;

Console.WriteLine(“\n”);
Console.WriteLine(“Start Testing: \n”);

// call the perl script
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = “perl.exe”;
startInfo.Arguments = perlScritpFileName;

// Redirect the standard output of the perl script.
// This stream is read asynchronously using an event handler.
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;

startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
Process process = new Process();
process.Refresh();
process.StartInfo = startInfo;

try
{
process.Start();
Console.WriteLine(“Output – {0}”, output);
Console.WriteLine(“Errors – {0}”, errorout);
process.WaitForExit(TIMEOUT);

while (process.StandardOutput.EndOfStream == false)
{
}
if (!process.HasExited)
{
process.WaitForExit(TIMEOUT);
}

int ExitCode = process.ExitCode;
}
catch (Exception e)
{
Console.WriteLine(“error in :” + e.Message);
}
process.Dispose();
}

in Perl FirstProj.pl:
#!/usr/local/bin/perl
#use strict;

#print “Hello World”;
my @array=(‘a’,’b’,’c’,’d’);
print @array;


text:
# Are there any monocations with negative electron affinities known?

It is known that most dianions are unbound per se, i.e. that the corresponding monoanions have negative electron affinities, and the "dianions" we see in e.g. metal oxides can exist as such only due to the additional positive charges (on top of the "weaker" positive charges on the e.g. oxygen cores) on the countercations' stabilising effect on the dianion's electrons, rendering them bound. It is also known that most neutral molecules are electronically bound; i.e. that the corresponding monocations have positive electron affinities.

However, some monoanions do have positive electron affinities- for example, the dodecahydrido-closo-dodecaborate dianion is bound, rendering its (radical) monoanion's electron affinity being positive.

My question now follows- are there any monocations with negative electron affinities; i.e. whose neutral counterparts are electronically unbound?

• I am not aware of any atom or molecule with negative ionization energy. Probably because their bound electrons have lower energy then free electrons. Jul 20 at 6:20
• Are you asking whether there are any electronically unstable atoms prone to spontaneously lose an electron and form stable cations? In the absence of a solvent? Jul 20 at 6:30
• @BuckThorn yes. Jul 20 at 7:24
• Atoms OR neutral molecules. Jul 20 at 7:25
• Better question would be if it's possible at all, because it actually may be, even if the whole idea is way more outlandish than it may seem. Jul 20 at 17:30

A monocation with an endothermic (negative) electron affinity is the same as a neutral species with an exothermic (negative) ionization energy. Reframing it this way may turn up more information.

The neutral substance with the lowest ionization energy I know is tetrakis(hexahydropyrimidinopyrimidine) ditungsten(II), also called ditungsten tetra(hpp). With a positive ionization energy of +3.51 eV, it is still very, very far from the goal. It does not seem possible that a reasonable chemical system would manage to bring the ionization energy all the way down below 0 eV. The problem is that ionization energy/electron affinity are defined and measured in a vacuum, but opposite net charges in a vacuum are completely unscreened and attract far too strongly.

But what if you do screen the charges? In a much weaker sense, you might consider that electrides kind of fit the requirement - you can think of these as neutral compounds which, in a condensed phase (typically the solid state), spontaneously eject an electron as if it were a separate anion. The condensed phase surrounds the charges and does the job of screening them enough so that the electrons and the cations can exist as "separate" entities.

• Meh, I never liked such view on electrides. Jul 20 at 20:11

You are talking about superalkalis, which are defined as groups of atoms that have a lower ionization energy than any alkali metal atom -- that limit being about 3.9 eV for caesium. ("Pseudo-alkali" is used for iniization energies below the 5.4 eV value for lithium.)

As noted by Nicolau Saker Neto, no superalkali is known with ionization energy less than 3.5 eV, so we do not have anything that spontaneously gives off an electron to form a gas-phase superalkali electride. However, lattice-energy stabilization effects do stabilize some condensed electrides, such as the cryptand-alkali metal electrides given in Ref. [1].

Some superalkalis have a lower ionization energy than the electron affinity of atomic chlorine (which actually beats that of fluorine). Trilithium oxide, $$\ce{Li3O}$$, is one example; the species identified by Nicolau is another. For such species $$\ce{M}$$, the combination $$\ce{M^+, Cl^-}$$ would be more stable, without ion-pairing or condensation, than the neutral $$\ce{M}$$ group plus a neutral chlorine atom. This comparison does not, however, account for the bonding of chlorine in its normal state into diatomic molecules.

References

1. James L. Dye (19900). "Electrides: Ionic Salts with Electrons as the Anions". Science 247, 4993, 663-668.


text:
# For two different products of primes with rational powers, are the real number representations always unique?

So from the fundamental theorem of arithmetic we have that every $$\prod_{i=0}^{n}p_{i}^{e_{i}}$$, for some $$e_i \hspace{2px} \epsilon \hspace{2px} \mathbb{N}$$ and prime numbers $$p_i$$, gives a unique number in $$\mathbb{N}$$ and the set of all numbers generated in this way equals $$\mathbb{N}$$. This can be generalised to have a unique representation of every positive element of $$\mathbb{Q}$$ if $$e_i \hspace{2px} \epsilon \hspace{2px} \mathbb{Z}$$.

My question is can we generalise this further to have a unique representation of all elements of the set containing all $$x$$ such that $$x = \prod_{i=0}^{n}s_{i}^{e_i} ,\hspace{3px} e_i \hspace{2px} \epsilon \hspace{2px} \mathbb{Q} ,\hspace{3px} s_i \hspace{2px} \epsilon \hspace{2px} \mathbb{N}$$ using products of prime numbers with rational powers, or is there some case in which $$\prod_{i=0}^{n}p_{i}^{e_{i}} = \prod_{i=0}^{m}q_{i}^{f_{i}}$$ for some $$e_i, f_i \hspace{2px} \epsilon \hspace{2px} \mathbb{Q}$$ and primes $$p_i$$ and $$q_i$$ where not all $$e_k = f_k$$ or not all $$p_k = q_k$$? I suspect that this is the case but I can not think of a way to prove it myself.

On a side note, is the set I defined above the complete set of algebraic numbers or are there elements of the algebraic numbers that do not appear in that set? I doubt the set is the full set of algebraic numbers but it would be useful to know if they are equivalent, or if the set has a special name of some kind.

• $i$ is algebraic and it is not in your set. – user657449 Apr 19 at 5:57

If $$N$$ is the common denominator of all $$e_i$$ and $$f_i$$, we find $$\prod p_i^{Ne_i}=\left(\prod p_i^{e_i}\right)^N=\left(\prod q_i^{f_i}\right)^N=\prod q_i^{Nf_i}$$ and hence (up to permutation) $$q_i=p_i$$, $$e_i=f_i$$. In other words, the representation is still unique if we use rational exponents. At the same time we see that all representable numbers are of the form $$\sqrt[N]M$$ with $$N,M\in\Bbb N$$.


text:
TH String Theory Seminar

# The Geometry of Supersymmetric Partition Functions

## by Cyril Closset (Weizmann)

Tuesday, 1 October 2013 from to (Europe/Zurich)
at CERN ( 4-3-006 - TH Conference Room )
 Description In the first part of the talk, I will review recent advances that allow to define supersymmetric field theories on rather generic compact manifolds, with a special focus on N=1 theories in four dimensions. I will then explain how one can obtain general constrains on the parameter dependence of supersymmetric partition functions on those compact spaces. For N=1 theories, we need to consider compactifications on Hermitian four-manifolds in order to preserve one supercharge. Then, one can show that the partition function is actually independent of the Hermitian metric, while it depends holomorphically on the complex structure moduli of the underlying complex four-manifold. If times permits, I will also discuss a very interesting parallel story for 3d N=2 theories on three-manifolds. Slides


text:
# THEORETICAL INVESTIGATIONS OF THE $^{12}$C($\alpha$,$\gamma$)$^{16}$O E2 CROSS SECTION

Abstract : The E2 component of the 12C(α,γ)16O cross section is investigated in three ways: by a microscopic cluster model, by R-matrix fits and by a combination of both. The microscopic calculation leads to an estimate of the S-factor at a typical energy of 300 keV of SE2(300 keV)≈ 50 keV-b for ground-state transitions. Cascade transitions to the and excited states of 16O are also studied. Then the S-factor is analyzed in the phenomenological R-matrix theory. We show that the background term plays a crucial role, and cannot be determined without ambiguity. Consequently only an upper limit on the extrapolated S-factor can be obtained [SE2(300 keV)< 190 keV-b]. Finally, we use the microscopic Asymptotic Normalization Constant (ANC) of the level, well known to be a cluster state to constrain the R-matrix analysis. This procedure strongly reduces the uncertainties on the R-matrix fits, and we end up with a recommended value of SE2(300 keV) = 42 ± 2 keV-b.
Document type :
Conference papers

http://hal.in2p3.fr/in2p3-00353364
Contributor : Yvette Heyd <>
Submitted on : Thursday, January 15, 2009 - 2:43:15 PM
Last modification on : Friday, May 8, 2020 - 1:10:10 AM

### Citation

M. Dufour, P. Descouvemont. THEORETICAL INVESTIGATIONS OF THE $^{12}$C($\alpha$,$\gamma$)$^{16}$O E2 CROSS SECTION. First Workshop on State of the Art in Nuclear Cluster Physics, May 2008, Strasbourg, France. pp.2176 - 2181, ⟨10.1142/S0218301308011306⟩. ⟨in2p3-00353364⟩

Record views


text:
# Search by Topic

#### Resources tagged with Visualising similar to Rope Mat:

Filter by: Content type:
Stage:
Challenge level:

### A Square in a Circle

##### Stage: 2 Challenge Level:

What shape has Harry drawn on this clock face? Can you find its area? What is the largest number of square tiles that could cover this area?

### Square Corners

##### Stage: 2 Challenge Level:

What is the greatest number of counters you can place on the grid below without four of them lying at the corners of a square?

### Two Squared

##### Stage: 2 Challenge Level:

What happens to the area of a square if you double the length of the sides? Try the same thing with rectangles, diamonds and other shapes. How do the four smaller ones fit into the larger one?

### Dissect

##### Stage: 3 Challenge Level:

It is possible to dissect any square into smaller squares. What is the minimum number of squares a 13 by 13 square can be dissected into?

### Makeover

##### Stage: 1 and 2 Challenge Level:

Exchange the positions of the two sets of counters in the least possible number of moves

### Fractional Triangles

##### Stage: 2 Challenge Level:

Use the lines on this figure to show how the square can be divided into 2 halves, 3 thirds, 6 sixths and 9 ninths.

### Ten Hidden Squares

##### Stage: 2 Challenge Level:

These points all mark the vertices (corners) of ten hidden squares. Can you find the 10 hidden squares?

### Map Folding

##### Stage: 2 Challenge Level:

Take a rectangle of paper and fold it in half, and half again, to make four smaller rectangles. How many different ways can you fold it up?

### Isosceles Triangles

##### Stage: 3 Challenge Level:

Draw some isosceles triangles with an area of $9$cm$^2$ and a vertex at (20,20). If all the vertices must have whole number coordinates, how many is it possible to draw?

### World of Tan 8 - Sports Car

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of this sports car?

### Making Tangrams

##### Stage: 2 Challenge Level:

Here's a simple way to make a Tangram without any measuring or ruling lines.

### World of Tan 29 - the Telephone

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of this telephone?

### World of Tan 28 - Concentrating on Coordinates

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of Little Ming playing the board game?

##### Stage: 2 Challenge Level:

How many DIFFERENT quadrilaterals can be made by joining the dots on the 8-point circle?

### Coloured Edges

##### Stage: 3 Challenge Level:

The whole set of tiles is used to make a square. This has a green and blue border. There are no green or blue tiles anywhere in the square except on this border. How many tiles are there in the set?

### Zooming in on the Squares

##### Stage: 2 and 3

Start with a large square, join the midpoints of its sides, you'll see four right angled triangles. Remove these triangles, a second square is left. Repeat the operation. What happens?

### Nine-pin Triangles

##### Stage: 2 Challenge Level:

How many different triangles can you make on a circular pegboard that has nine pegs?

### World of Tan 9 - Animals

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of this goat and giraffe?

### World of Tan 13 - A Storm in a Tea Cup

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of these convex shapes?

### World of Tan 4 - Monday Morning

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of Wai Ping, Wah Ming and Chi Wing?

### World of Tan 11 - the Past, Present and Future

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of the telescope and microscope?

### World of Tan 12 - All in a Fluff

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of these rabbits?

### Midpoint Triangle

##### Stage: 2 Challenge Level:

Can you cut up a square in the way shown and make the pieces into a triangle?

### Green Cube, Yellow Cube

##### Stage: 2 Challenge Level:

How can you paint the faces of these eight cubes so they can be put together to make a 2 x 2 cube that is green all over AND a 2 x 2 cube that is yellow all over?

### Three Squares

##### Stage: 1 and 2 Challenge Level:

What is the greatest number of squares you can make by overlapping three squares?

### Hello Again

##### Stage: 3 Challenge Level:

Anne completes a circuit around a circular track in 40 seconds. Brenda runs in the opposite direction and meets Anne every 15 seconds. How long does it take Brenda to run around the track?

### Fence It

##### Stage: 3 Challenge Level:

If you have only 40 metres of fencing available, what is the maximum area of land you can fence off?

### World of Tan 7 - Gat Marn

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of this plaque design?

### Right Time

##### Stage: 3 Challenge Level:

At the time of writing the hour and minute hands of my clock are at right angles. How long will it be before they are at right angles again?

### World of Tan 27 - Sharing

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of Little Fung at the table?

### World of Tan 6 - Junk

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of this junk?

### World of Tan 5 - Rocket

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outline of the rocket?

### Taking Steps

##### Stage: 2 Challenge Level:

In each of the pictures the invitation is for you to: Count what you see. Identify how you think the pattern would continue.

### Jomista Mat

##### Stage: 2 Challenge Level:

Looking at the picture of this Jomista Mat, can you decribe what you see? Why not try and make one yourself?

### Dodecamagic

##### Stage: 2 Challenge Level:

Here you see the front and back views of a dodecahedron. Each vertex has been numbered so that the numbers around each pentagonal face add up to 65. Can you find all the missing numbers?

### Cubes Within Cubes

##### Stage: 2 and 3 Challenge Level:

We start with one yellow cube and build around it to make a 3x3x3 cube with red cubes. Then we build around that red cube with blue cubes and so on. How many cubes of each colour have we used?

### Redblue

##### Stage: 2 Challenge Level:

Investigate the number of paths you can take from one vertex to another in these 3D shapes. Is it possible to take an odd number and an even number of paths to the same vertex?

### Twice as Big?

##### Stage: 2 Challenge Level:

Investigate how the four L-shapes fit together to make an enlarged L-shape. You could explore this idea with other shapes too.

### Clocked

##### Stage: 3 Challenge Level:

Is it possible to rearrange the numbers 1,2......12 around a clock face in such a way that every two numbers in adjacent positions differ by any of 3, 4 or 5 hours?

### Right or Left?

##### Stage: 2 Challenge Level:

Which of these dice are right-handed and which are left-handed?

##### Stage: 2 Challenge Level:

How can the same pieces of the tangram make this bowl before and after it was chipped? Use the interactivity to try and work out what is going on!

### World of Tan 17 - Weather

##### Stage: 2 Challenge Level:

Can you fit the tangram pieces into the outlines of the watering can and man in a boat?

### Tetra Square

##### Stage: 3 Challenge Level:

ABCD is a regular tetrahedron and the points P, Q, R and S are the midpoints of the edges AB, BD, CD and CA. Prove that PQRS is a square.

### Framed

##### Stage: 3 Challenge Level:

Seven small rectangular pictures have one inch wide frames. The frames are removed and the pictures are fitted together like a jigsaw to make a rectangle of length 12 inches. Find the dimensions of. . . .

### Rolling Around

##### Stage: 3 Challenge Level:

A circle rolls around the outside edge of a square so that its circumference always touches the edge of the square. Can you describe the locus of the centre of the circle?

### Endless Noughts and Crosses

##### Stage: 2 Challenge Level:

An extension of noughts and crosses in which the grid is enlarged and the length of the winning line can to altered to 3, 4 or 5.

### Construct-o-straws

##### Stage: 2 Challenge Level:

Make a cube out of straws and have a go at this practical challenge.

### Tetrahedra Tester

##### Stage: 3 Challenge Level:

An irregular tetrahedron is composed of four different triangles. Can such a tetrahedron be constructed where the side lengths are 4, 5, 6, 7, 8 and 9 units of length?

### Trice

##### Stage: 3 Challenge Level:

ABCDEFGH is a 3 by 3 by 3 cube. Point P is 1/3 along AB (that is AP : PB = 1 : 2), point Q is 1/3 along GH and point R is 1/3 along ED. What is the area of the triangle PQR?

### Tied Up

##### Stage: 3 Challenge Level:

In a right angled triangular field, three animals are tethered to posts at the midpoint of each side. Each rope is just long enough to allow the animal to reach two adjacent vertices. Only one animal. . . .