text:
Sumit Singhal loves modern architecture. He comes from a family of builders who have built more than 20 projects in the last ten years near Delhi in India. He has recently started writing about the architectural projects that catch his imagination.
NW Beijing Inc. research centre and offices in China by Maxthreads Architectural Design and Visuals
November 27th, 2011 by Sumit Singhal
Article source: Maxthreads Architectural Design and Visuals
NW Beijing technology and research centre for the applications of computer technology is located at the intersection of a motorway, bordering the facilities of IT company NW tech. It consists of office buildings, laboratories and experimental energy research centre. The greatest possible degree of spatial flexibility was specified, in order to be able to incorporate new machinery and technical resources without interfering in day to day centre operations. Our primary intention was to create instantly recognizable buildings for the research centre that was vivid in its individuality, with flexibility being one of the key objectives. The architectural expression for the research centre has been inspired by the well organized computing system. As an artificial computing threading that run through the main facade.It also equip with solar tracking system to minimise the direct sun light penetration.
The urban concept strategy pursues the maximisation of open public space on the ground level of the site, both cannel walk area, open spaces and car park area. The mass of the new building is therefore raised into the first floor level. This open space is important to activate the site and the new research centre. It is also important as an appropriate take off point ( or point of termination) for the overall site area sustainable mechanics. We are proposing a generous, diagonal underpass that emerges from the site environment and grand connective gesture.
The urban intensions that are emphasized with the placement of the building volumes are further pursued and complemented with the articulation of this volume. The volume is open up between the centre of the two research centre, direction to communicate with the open public space as well as direct connection for large volume of personnel access every day.
This large, inviting opening becomes a strategy which cleared all the way through the building to connect with all site buildings. This opening communicates diagonally in both plan and section and thus accommodates to the typography. By extending the ground opening area allows the eco system to extend through the site.


183 Unit Conversion
Description
Google added a calculator to its search engine a while back. Enter "convert 50 miles to kilometers", or even just "50 mi to km", and the first "search" result will tell you that 50 miles is 80.4672 kilometers. This works for units other than length. Try "33 ml to gal", "6 hours to minutes", and"50 stones to lbs", and you'll see that Google's calculator knows a lot of different units and how to convert between them all.
Your task is to write a units converter script. The input to the script must be three arguments: the quantity, the source units, and the destination units. The first example above would be run like this:
$ ruby convert.rb 50 miles kilometers
Or, using abbreviations:
$ ruby convert.rb 50 mi km
Support as many units and categories of units (i.e. volume, length, weight, etc.) as you can, along with appropriate abbreviations for each unit.
Summary
The right way, generally, to do a task such as unit conversion is to see if someone has already done all the hard work for you. As was pointed out, there are several options in this respect:
Many thanks to Martin Boese, whose solution had to be empirically confirmed. Repeatedly.
But I'm going to look at the solution from Robert Dober. While it is limited, as posted, his data driven approach could be expanded to include more conversions.
To understand how the expression 1.0.in.to.mm will generate the string "25.4mm", I'll trace it a step at a time, looking at the relevant bits of code.
First, we have the float value 1.0, but where does the method in come from? Clearly, class Float gets something by way of extension:
class Float
 include Conversion
end
Module Conversion only defines one method that will extend Float (with the rest of Conversion being helper classes and code executed when Conversion is first evaluated). That method is method_missing:
 def method_missing unit_name
 pc = ProxyClasses[ unit_name.to_s ] || super( unit_name )
 pc::new self
 end
So we will look for ProxyClasses["in"] and, if not found, we just call to the parent class and hope it knows what to do with method call in. But in this case, we're expecting to find something in ProxyClasses… a Class, in fact, which we attempt to instantiate immediately using new. But where does we fill ProxyClasses?
Ah, that would be the code right below method_missing in his solution: the code that makes use of LineParser.
conversions = LineParser::new
File::open "units.txt" do | f |
 f.each do | line |
 conversions.parse_line line
 end
end
Robert provided a minimal units.txt data file to show how the code works. (Note that the line beginning "use SI" is part of the data file and not a mistake; see parse_line for how that is handled.)
1 in = 0.0254 m
1 l = 0.001 m3
use SI prefixes for m g l m3
It could be expanded greatly to support many more units. As each line is read, the LineParser object parses them, keeping track of the conversion rules – I'll come back to that later. What I want to look at first is what gets done with those rules:
conversions.traverse do | src_unit, tgt_unit, conversion |
 ( ProxyClasses[ src_unit ] ||= Class::new ProxyClass ).module_eval do
 define_method tgt_unit do (@value * conversion).to_s + tgt_unit end
 end
end
traverse is going to enumerate over a number of valid conversions – source units, target units, and the conversion factor. And here we see from where the ProxyClasses originate… New ProxyClass objects are created through the code Class::new ProxyClass (but only if one didn't exist already for the particular source unit… note the use of the ||= operator which only evaluates the right side and assigns left if the left was initially nil).
After ensuring that the ProxyClass corresponding to the source units exists, we call module_eval in order to add methods to the anonymous class just created. The method name will be the target units, and the method multiplies in the conversion factor, converts to a string, and appends the targets units.
So, getting back to our example 1.0.in.to.mm, we've now found the ProxyClass corresponding to 1.0.in. And we know that ProxyClass also has methods named by target units, which includes one that corresponds to the last part of the example: .mm.
If you're wondering about to, every ProxyClass defines that method to return self: essentially a useless function (in the sense that it does nothing more than 1.0.in.mm). It's existence mimics other libraries, and the point is readability. (An alternative would be a more traditional call, such as 1.0.convert(:in, :mm) or similar.)
So once these proxy classes exist, there's very little effort going on to evaluate calls such as our example. And creating the proxy classes isn't much more difficult, assuming you have a proper conversion table. Now we come back to LineParser and what happens beyond its parse_line method. (I'll skip parse_line itself, since it is a few, simple regular expressions.)
Most of units.txt that defines our conversions is going to be handled by add_conversion, which just receives as arguments each split line of the data file. The conversion table (stored in @c) is two-layered hash – a hash of hashes – and is setup with this code:
def add_conversion lhs_value, lhs_unit, equal_dummy, rhs_value, rhs_unit
 @c[ lhs_unit ][ rhs_unit ] = Float( rhs_value ) / Float( lhs_value )
 @c[ rhs_unit ][ lhs_unit ] = Float( lhs_value ) / Float( rhs_value )
end
The conversion ratio (and the inverse conversion ratio) are stored in two places based on the indexing order. By storing both ratios/orders, we can convert in "both directions". That is, for our example, not only can we convert inches to millimeters, but millimeters to inches.
The last bit of file parsing is adding appropriate metric prefixes (SI units). One line in the file indicates which units are worthy of metric prefixes. In the data file provided, we see that meters can accept metric prefixes (such as "kilo" and "milli"), but inches will not. These prefixes are handed by add_si_unit_for:
def add_si_unit_for unit
 SIUnits.each do | prefix, conversion |
 @c[ prefix + unit ][ unit ] = conversion
 @c[ unit ][ prefix + unit ] = 1 / conversion
 end
end
Here, unit is the particular unit we want to support metric prefixes. SIUnits is the hash containing the metric prefixes as characters and the corresponding orders of magnitude. For every unit and metric prefix, two more conversions are added, each the inverse of the other: conversion between the naked unit and the adorned unit (e.g. between meters and millimeters, and vice-versa).
Finally, traverse is an enumerator that will yield (via blk.call) every valid combination of units and the appropriate conversion factor. It manages this without storing every conversion (e.g. we store the inches to meters conversion, and the meters to millimeters conversion, but don't explicitly store inches to millimeters). Enumerating every possible, valid conversion is done in the private method _traverse:
def _traverse src_unit, unit_conversions, traversed_units, f=1.0, &blk
 unit_conversions.each do | new_unit, conversion |
 next if traversed_units.include? new_unit
 blk.call src_unit, new_unit, f * conversion
 _traverse src_unit, @c[ new_unit ], traversed_units + [ new_unit ], f * conversion, &blk
 end
end
The final, recursive step here is what allows us to build a transitive closure of all units. src_unit is, of course, the source unit (e.g. inches). unit_conversion contains all possible immediate conversions from the source and is the hash of units and conversion factors. And, you can see, we enumerate those into new_unit and conversion.
We skip a target unit if it's already been visited (i.e. in traversed_units). Otherwise, we yield to the caller (blk.call) and recurse, now converting the source unit to everything the target unit can also be converted, making sure to update traversed_units so as to terminate eventually.
Wednesday, February 04, 2009


Kōrero: Lizards
Whārangi 1. Appearance and life cycle
Ngā whakaahua
Skinks and geckos
New Zealand has two types of land reptile – lizards and the tuatara. Lizards are a diverse group worldwide, but in New Zealand there are only two families – skinks (Scincidae) and geckos (Gekkonidae).
There are two genera of New Zealand geckos and one genus of skink, in each of which there are many species. The gecko genera are found nowhere else, while species in the skink genus are also found on Norfolk and Lord Howe islands. Although these islands are Australian territories, their plants and animals are closely related to those in New Zealand.
Many species
It is not certain how many skink and gecko species there are in New Zealand. The last review, published in 1994, listed 62, many of which were yet to be named. Since then, species have been discovered faster than taxonomists can describe and name them. There are probably at least 80 species that are endemic (occur only in New Zealand). New Zealand has more lizard species relative to its land area than many other countries. It can be difficult to identify them, as the most up-to-date field guide, New Zealand frogs and reptiles (1996), does not include all known species.
There is only one introduced lizard species – the rainbow skink (Lampropholis delicata), which probably arrived from Australia in a ship's cargo.
Appearance
Skinks and geckos are easily distinguished:
 - Skinks are smooth-skinned, sleek and shiny, with small legs. They have small eyes and can blink.
 - Geckos have scaly skin that feels silky and looks one size too large, and stout legs. Their eyes are large and cannot blink.
Most of New Zealand's skinks and geckos are small, and the few species people usually see are dull-coloured. Until recently these lizards attracted little attention from zoologists.
Reproduction
New Zealand lizards are unusual in that only one, the egg-laying skink, lays eggs. The others are viviparous – they give birth to live young. The eggs hatch in the female's oviduct before the youngsters are born. Common skinks (Oligosoma nigriplantare) and possibly other species grow a placenta, and the developing embryo is nourished by its mother. Vivipary is thought to be an adaptation to New Zealand's cooling climate during the ice ages – most other viviparous lizards occur in colder regions of the world.
New Zealand skinks and geckos produce fewer young than most species overseas. New Zealand geckos normally have two young each time they breed. Most breed once a year, but Duvaucel's gecko (Hoplodactylus duvaucelii) and the Macraes (Central Otago) gecko (H. maculatus Macraes form) breed every second year. A Macraes gecko's pregnancy lasts 14 months, perhaps because cool temperatures slow the foetus's development. Most other New Zealand geckos mate in spring or summer and give birth in autumn or winter.
Skinks usually have between two and five young at yearly intervals.
Lifespan
New Zealand lizards have unusually long lives. One Duvaucel's gecko lived for at least 36 years, and many of the smaller common geckos live more than 20 years. Skinks do not live as long – the largest live about 10 years.
Me pēnei te tohu i te whārangi:
Kerry-Jayne Wilson, 'Lizards - Appearance and life cycle', Te Ara - the Encyclopedia of New Zealand, _URL_ (accessed 17 July 2019)
Story by Kerry-Jayne Wilson, published 24 Sep 2007, updated 1 Mar 2014


text:
We generally quote the speed accuracy as a percentage of the indicated speed. For test machines running at very slow speeds, we also add an extra accuracy tolerance based on an absolute value. These speed accuracy statements are considered to be part of the original manufacturer's specification.
- Test machine with an accuracy of ± 2% of indicated speed is set to run at 200 mm/min. The allowable speed tolerance is therefore "± 2% of 200 mm/min". This equates to ± 4mm/min. So the machine will be running between 196 – 204 mm/min.
- Test machine with an accuracy of ± 2% of indicated speed is set to run at 0.5 mm/min. The allowable speed tolerance is "± 2% of 0.5 mm/min or ±20 µ/min (whichever is greater)". This equates to = +/- 0.01mm/min (= 10 µ/min) and since 20 µ/min is greater, this will be considered as the dominant tolerance. So the machine will be running between 0.48 – 0.52 mm/min.
However, machine wear can be expected over time and may potentially adversely affect both speed and displacement measurement. Machine wear is dependent on factors such as the frequency of usage, harsh operating environments, and the types of test performed (e.g., sudden breaks of stiff materials may cause energy recoil which affects mechanical parts etc.). A full overhaul of the test frame may be required to bring the test system back to its original manufacturer's specification.

source: m-a-p/FineFineWeb


The Department of Justice (DOJ) released "Phase I" of its review of the federally-funded Legal Orientation Program (LOP) this week. The review came after Attorney General Jeff Sessions attempted to end the program in April but was forced to reverse that decision after receiving significant bipartisan pushback from Congress.
The LOP, which is managed by the Executive Office for Immigration Review (EOIR) within the Justice Department, offers legal education as well as referrals for free and low-cost legal counsel to noncitizens in immigration detention. The LOP was started in 2003 under President George W. Bush after a pilot study found that the LOP "helped DOJ ensure that all respondents had a clear understanding of their procedural rights, led to cases being completed more quickly, and increased availability of representation [to detainees] with potential meritorious claims to relief."
While it is not a substitute for legal counsel, the LOP does provide important information to individuals in detention about their rights and the removal process. There have been multiple studies conducted on the LOP by the federal government, nonprofit organizations, and outside third parties that reaffirm its usefulness. Every study has shown the LOP decreases the average length of time a person is in immigration detention, saving the government up to millions of dollars annually.
However, this new study released by DOJ attempts to undermine all previous evaluations of the program.
The study is the first phase of a three-phase review to be completed by the end of October 2018. Among other findings, it alleges that LOP participants spend more time in detention, costing the government more money; that LOP participants are less likely to get attorneys; and that their cases take longer to resolve.
The report presents these findings and overall numbers to show its methodology but unfortunately does not make their underlying data available for analysis.
The Vera Institute of Justice (Vera), the nonprofit organization who contracts with EOIR to run the LOP program, says this new study has "insurmountable methodological flaws in EOIR's analysis."
At DOJ's request, Vera has completed and will submit its own study next week. Vera reports that it has "starkly different findings that prove the efficiencies" of the program—which would be in line with all studies of the LOP conducted over the last 16 years.
Given the Attorney General's earlier attempts to unilaterally end the LOP, one could assume that the ultimate goal of these government studies is to justify ending the program. When evaluating the program, it will be important for Congress to take a critical look at these new DOJ studies and review them alongside the totality of evidence in support of the program. Without government-provided counsel, LOP is a critical resource for detained immigrants to receive due process in a complex immigration court system.
FILED UNDER:,,,,


text:
Body/Politics by John Finlay06 Aug 2020
The Body/Politics: Women as Subject and Object in the History of Art is a discursive essay which examines the history of women artists from the 16th century to the present day and explores why numerous women artists were forgotten, highlighting some of the barriers and obstacles women have had to overcome and still endure. John Finlay is a historian of French history, specialising in twentieth-century modern art. He has published several books including Art History, Picasso's World, Pop! The World of Pop Art and he is the co-author of Andy Warhol: The Mechanical Art. Finlay lives and works in Edinburgh.
Thank you to John Finlay for this compelling essay, which we have split into two parts for you to download below and read at your leisure.


text:
Semi-sparse Cholesky Factorization
Author: Ivan Šimeček
High-performance, sparse matrices, numerical algebra, Cholesky
<>The Cholesky factorization (shortly
is one of basic methods to solve systems of linear equations (shortly
task of the CHF is to compute the matrix L, such that A=LLT.
The big advantage of this method is that is
possible to solve a set of SLEs with the same matrix A, but
different right hand sides.
A matrix A is considered as dense
if it contains about n2 nonzero elements and it is sparse
In practice, a matrix is considered sparse if the ratio of nonzero
drops bellow 10%.
If a sparse matrix has the nonzero elements
occurring only around the main diagonal, it is banded.
matrices with some "peaks" are called near banded.
The process of Cholesky factorization of the
originally sparse matrix A leads to the matrix L with
elements, called fills (or fill-in's). For the minimal
fills, special process called symbolic factorization is needed.
this process significantly increases the number of required operations,
computation of the CHF for sparse matrices is a still open research
final version (in .DOC format)
author = "I.
title = "Semi-sparse
journal = "CTU Workshop",
volume = "9",
pages = "184-185",
month = mar,
year = "2005",
Address = "Prague, Czech Republic"


How To Photograph Cigarette Smoke (Step By Step)
Although we really shouldn't condone smoking due to its health implications, as artists, we have to admit that there is something really beautiful about the smoke itself. From the patterns it creates to how smoke dances in the light, there is a lot of opportunity for stunning images at the butt of a cigarette. Here is our step-by-step guide on how to take advantage of this phenomena!
Step 1: Choose the Right Lens
Everything comes down to how the final image looks! Although the camera plays a much more minor role in this specific type of photography, the lens plays a tremendous one. The optics you are using will affect perspective, field of view, and the depth of field.
First thing's first, determine how close or far away from the smoke you will be. For the most part, photographers choose standard lenses or telephoto lenses for this type of work, rather than wide angle lenses.
Wide angle lenses have a wide field of view, not really useful for something like cigarette smoke which can be fairly small!
Standard lenses range from 35mm all the way to 70mm and are amongst the easiest lenses to use because they feature no distortion (the glass is flat). Standard lenses are the closest to the human eye and what you see, which makes these millimeters popular choices for easier photography compositions. These lenses are also commonly seen with wide apertures, which is great for smoke photography because you can just focus on the smoke and blur the rest of the background away.
You may not initially consider telephoto lenses for smoke photography, but they can actually work out really great! Telephoto lenses are long lenses that can remind you a bit of a telescope. These lenses can zoom you very close to your subject! They range in millimeters from 70mm all the way to 300mm. Although commonly used by sport and animal photographers, there is something magical that happens when you use a telephoto lens for non-sporting subjects: the zoom range actually creates an optical compression when used, which creates more flattering proportions and perspective on whatever subject you capture! Plus the bonus of not needing to be near the smoke.
So needless to say, step one is determining the lens you want to use.
Step 2: Find a Good Light Source
Next, you need to find a good light source. Even when looking at smoke with the naked eye, you may have noticed that it tends to disappear in direct light and really shows its shape prominently in backlighting. As such, you need to apply these principles to your smoke photography.
Look for a light source that positions behind your subject rather than in front. As well, it's a good idea to have the light source be behind but from below so it doesn't overtake the smoke and cause it to be lost as well!
You can do this with natural, ambient light that is available at your shooting location or with an artificial light. Video lights that are continuous and don't flash work very nicely.
Step 3: Adjust Camera Settings
Now, the trickier part… camera settings. Camera settings are very dependent upon your location, the type of lighting, and the type of look you're wanting to capture. Set the camera to M (Manual) mode and focus on the exposure equation:
The ISO controls how the sensor responds to the light that hits it, whether it's sensitive to the light (because there is less of it) or not very sensitive to the light (because there is more of it).
The shutter speed is how fast your camera takes the photograph.
The aperture controls how much light does (or doesn't) hit your sensor.
For cigarette smoke photography, you'll likely want to freeze the smoke so you can capture it dancing in the air, so the priority will be your shutter speed first. The higher the shutter speed number, the more frozen the action will be (but the photograph will be darker). The lower the shutter speed number, the more motion blur your photograph will have (but the photograph will be lighter). For smoke, a minimum shutter speed of 1/300 can suffice.
Next, you'll probably want to make sure that the smoke is nicely isolated from the background and foreground. The lower the aperture number, the more light the camera lets in. The higher the aperture number, the less light the camera lets in. The lower the aperture number, the shallower the depth of field. The larger the aperture number, the deeper the depth of field. An F/2.8 is pretty excellent. Now, to go back to lens choice, the widest aperture is determined by the lensnot the camera. If you have an F/4 lens, for example, it cannot widen to F/2.8.
Then, you'll need to find an ISO that balances out the shutter speed and aperture setting. The lower the ISO number, the less sensitive the camera is to light (but the less noise the photograph has). The higher the ISO number, the more sensitive the camera is to light (but the more noise the photograph has). Noise are the obnoxious little specks you see in photographs.
As well as this, cameras can sometimes have a hard time focusing on cigarette smoke because it can be so pale and fleeting. To help with focus, set your camera to the proper autofocus mode. By default, your camera is set to One-Shot right out of the box. One-Shot achieves automatic focus on your subject for only one image, not applicable for moving smoke. As such, switch the camera over to Continuous Focus. For this, the camera's focus keeps refocusing on the subject as it moves.
Then, utilize your Autofocus Points. These points tell you (and the camera) where to focus. Each point refers to an area the camera is able to focus on. By switching to a mode such as AF Selection, you can tell the camera exactly what points you need it to use to focus on your subject!
Step 4: Compose the Shot
Composition is everything! Composition is the arrangement of everything in a shotfrom the subject, to the background, and even the foreground.
For smoke, because it is something that moves, the primary compositional rule you'll want to focus on is the sense of implied movement. Implied sense of movement means the direction that you think the movement will go in a still image. How this factors into composition is that you always want to leave more negative space in the direction of implied movement. This keeps your photograph from feeling claustrophobic or too abruptly cropped.
So if the smoke is blowing to the left, you want more negative space to the left of the frame, to give the smoke some room to go!
Step 5: Direct Your Subject and Click!
You don't want to run out of smoke before you're ready to take the shot! Direct your subject to light the cigarette and start puffing after you've done the aforementioned four steps. Then aim your camera, get the focus, and take the shot!
In closing, these five simple steps should aid you in capturing some dramatic and fun smoke shots.
Scroll to Top


+= 1
Sweet! We can run that code and get the results that follow. Note a couple things. First that they use a slightly different math than the additive smoothing we used above, so the percentage correct and confusion matrix are slightly different. They talk about the math here, but looks like there's some text formatting issues so it's a little confusing. You'll have to look at the code specifically if you want to know the math they use.
And also, the NLTK classifier has a cool function that will return the most informative features. Basically, showing which words are most indicative of a text being from a certain class. So if you see 'baby', 'wash', 'seat', etc. in the text, you're probably looking at baby.
0.9575
Most Informative Features
baby = 1 baby : tool = 49.3 : 1.0
wash = 1 baby : tool = 34.3 : 1.0
seat = 1 baby : tool = 30.3 : 1.0
child = 1 baby : tool = 29.7 : 1.0
likes = 1 baby : tool = 28.3 : 1.0
babies = 1 baby : tool = 28.3 : 1.0
led = 1 tool : baby = 27.0 : 1.0
solid = 1 tool : baby = 26.3 : 1.0
tool = 1 tool : baby = 26.2 : 1.0
toys = 1 baby : tool = 25.7 : 1.0
baby tool
baby 189 11
tool 6 194
And there you have it! Adding more classes to the NLTK classifier is really simple and quick which is the key. Using more training samples or more classes quickly increases the run time of the custom Naive Bayes code. The NLTK implementation runs much quicker, so use that for real world applications.
Final Thoughts
The key takeaway to remember here about how Naive Bayes works is thinking about the P(word | class) term, and the heuristic behind it. All we're doing here, with some math in between, is counting the frequency of occurrence of each word in the test document, compared to all the documents we've used in the training set. If the test word occurs more frequently in the test documents of one class compared to the other, the P(word | class) term will have a greater value, and make the final value for that class greater than for the other classes.
And it works! With two classes here, we're getting like 95% accuracy on classifying these reviews. That's pretty good for a computer. Using different features, adding more training reviews can all help with accuracy, but it's pretty cool what a little code can get you.
1 thought on "Practical Naive Bayes — Classification of Amazon Reviews
 1. Pingback: Classifying Amazon Reviews with Scikit-Learn — More Data is Better Turns Out | Big-Ish Data
Leave a Reply
Fill in your details below or click an icon to log in:
WordPress.com Logo
You are commenting using your WordPress.com account. Log Out / Change )
Twitter picture
You are commenting using your Twitter account. Log Out / Change )
Facebook photo
You are commenting using your Facebook account. Log Out / Change )
Connecting to %s


text:
Serving up smashing spudsNDSU researchers see great potential in colorful potatoes Among the hundreds of potato varieties that North Dakota State University researchers work with, some are certainly eye-catching.
By: Kristen Daum,
Among the hundreds of potato varieties that North Dakota State University researchers work with, some are certainly eye-catching.
Donning vibrant hues of blue, purple and red, specialty spuds stand out from more mainstream varieties like the Russets or Yukon Golds typically found in grocery store displays.
NDSU's potato breeding program began in 1930 with the goal of establishing superior varieties that meet the needs of regional producers in the potato industry.
That includes everything from growing diseaseand pest-resistant varieties to evaluating different types for use in the commercial marketplace, said Asunta "Susie" Thompson, a potato breeder and associate professor at NDSU.
Potato breeders at the university create hybrid varieties by crossing two parent versions, but there's no genetic engineering involved at this time, she said.
The color of a potato's skin and its interior flesh stems from complex genetic coding that's influenced by a specific makeup, she said.
For instance, the purple color means the potato is high in anthocyanins, which are involved in the formation of antioxidants.
Few of the specialty varieties can be found in local grocery stores because widespread availability is still increasing, Thompson said.
Instead, the unique varieties are more easily found in summertime farmer's markets or from specialty growers in the Red River Valley, she said.
The colorful potatoes can also make for festive cooking in the kitchen, no matter how they're served.
"It can really make your plate pop with color and make it fun," Thompson said.
Just don't peel and boil them, Thompson advises.
That can cause the blue or red potatoes to lose their color on the inside, and the food product could potentially turn gray. Instead, the potatoes can be steamed in the microwave to retain the color.
Potatoes are high in nutrients such as vitamin C, potassium, fiber and protein, so the vivid varieties can be helpful alternatives when trying to entice children to eat vegetables.
"It's a great vegetable to have, and kids might be more interested in eating them if they're bright and cheery and colorful," Thompson said.

source: HuggingFaceFW/fineweb-edu


text:
ISIS/Base is the successor of the DOS program ChemBase. ISIS/Base is a Methuselah of a program. The first version was developed in1989. It needs constant effort by MDL because it serves a dual purpose. It is the client for ISIS/Host, and it is a stand-alone chemical database system for the PC or Macintosh.
I once calculated that MDL would have to charge 500'000 USD for ISIS/Base, if you compare it on functionality with what was sold in 1984. Today, the industrial price is around 1000 USD and 300 USD for academic users.
ISIS/Base was formed not by MDL programmers, but by MDL users. This is the reason that ISIS/Base is one of the best programs for single user who want to manage chemical structures, reactions and data on the PC.
Its main uses are:
Field Type Definition in ISIS/Base
Fixed Text Text of a specified number of alphanumeric characters. A fixed-text field can store any number of characters up to the maximum number specified in its definition. However, no fixed-text field can contain more than 80 characters. (For example, MDL-000001 is the maximum number of characters that can be entered for a fixed-text field that has been defined to have a 10 character length.)
Variable Text Alphanumeric text of an unlimited length (limited solely by computer memory).
Integer For PC and Macintosh systems, the value of an integer may range from -_PHONE_ to +_PHONE_.
Real A real number, such as 1.50. The decimal-place precision of the number varies with computer systems.
Range A range of real-number values, such as 2.0 - 3.5. The decimal-place precision of the number varies with computer systems.
Date The date format (such as day/month/year) specified in your windowing software configuration file(s).
Sketch An ISIS/Draw sketch.
Structure A molecule (including a 3D structure, reactant, or product). You can have multiple structure fields in your database, but each field must have a unique name.
Reaction A chemical reaction. You can have multiple reaction fields in your database, but each field must have a unique name.
Parent Parent fields do not store data. Instead, parent fields point to one or more fields that store related data. For this reason, the parent field name should be representative of the types of data that the lower-level fields will store. For example, is the parent field for journal and author. ISIS/Base displays parent field names in brackets to distinguish them from other fields.
The calculated field type only applies to remote databases and cannot be selected as a field type in a local database.
You need ISIS/Draw to draw structures. ISIS/Draw is free of charge for academic and private use. Instead of drawing structures you can download structures from many sources on the Internet, or convert them to Molfiles using the conversion programs ConSystant & Chemeleon provided with ISIS/Base.
For moe information go to MDL® ISIS/Base.

source: openbmb/Ultra-FineWeb


text:
If you can believe it, there was a time in the "official" history of Long Beach when there were only three words about the city's black community: "11 percent African American."
That was in the late 1980s. No one thought much about it, except one person, Indira Hale Tucker, who said she was "flabbergasted" by this scant information about people who made up such an important part of the city's history and life.
Tucker wasn't one of those people who complain about something but do nothing about it. Tucker rolled up her sleeves and started what turned out to be a remarkable campaign to preserve and illuminate the history of the black community in Long Beach.
With her friends, Doris Topsy-Elvord, the city's first black female City Council member and harbor commissioner, and Aaron Day, a tireless author and genealogist, Tucker started collecting personal stories, newspaper stories and family photographs from black Long Beach residents.
Ironically, the group took a major step in its preservation efforts when the city in 1997 made drastic cuts in library funding which adversely affected books and materials dealing with the black community.
These cuts prompted the creation of the African American Heritage Society in May 1997 with 50 charter members working to capture, detail and preserve the history of African Americans in Long Beach.
The first founders of the Society were Tucker and Topsy-Elvord.
One of the Society's
The idea was to bring together books, videos and DVD's concerning African-American achievement, history and culture for the benefit of students, teachers, parents and residents.
Tucker wrote then about the value of the collection they were building: "Because of their oppressive history in this society, black achievement provides inspiration for Americans of ALL ages and ethnic backgrounds. Biographies about ordinary women and men activists also inspire individuals to have the courage to stand up for tolerance and humane treatment and to find a way to help others who are being oppressed unfairly and to work toward making their communities a better place."
The Burnett Resource Center has grown from a few items to more than 3,000. And the African American Heritage Society recently celebrated its 15th anniversary at the Burnett Library with many of the original board members.
Unfortunately, Indira Tucker wasn't there. She passed away last April, but her spirit was pervasive at the anniversary, which was dedicated to Indira and Emma Henderson, a longtime Burnett Library employee who also has passed away. Indira's husband, retired Judge Marcus Tucker, and her daughter, Angelique, were there.
Topsy-Elvord, "Mother Doris" to many, praised Indira as "a visionary who sought to inspire and educate our youth through reading of their past. Her legacy was to initiate and archive the history of African Americans in Long Beach to make a better place for all. For this we will be eternally grateful."
Doris said the doors to success are opened by education and that children should be taught to "read, read, read."
Aaron Day, also known as Mr. Library and Mr. Genealogist, talked about an authoritative book published in 2007 and co-edited by Day and Tucker, "The Heritage of African Americans in Long Beach: Over 100 Years."
The book is rich in detail about the black community, including many newspaper articles, personal stories and census data, more than 300 pages worth of interesting information about the black community, certainly more than the three words Indira Tucker found in the 1980s.
Day read a poem that he wrote, "What Makes a Legend." It includes these stanzas: "You could not have known that one day your legacies would have such a powerful influence on others. You are our true legends. Thanks for paving the way for us. We stand on your shoulders."
State Assemblywoman Bonnie Lowenthal said, "If we don't remember our history, then we will not succeed as a society."
Vera Mulkey, an original Society member, challenged the audience to do more.
"We need to expand our collection at Burnett," she said. "We need to recruit new and younger board members. We need to tell our story better to a new generation."
Another project spearheaded by Day involves black community leaders writing their autobiographies, including his own.
The list is a Who's Who of the black community, including Autrilla Scott, Ernest McBride, Sr., Ahmed Saafir, Doris Topsy-Elvord, Evelyn Knight, Maycie Herrington, Naomi Rainey, Jesse Johnson, Jr., Indira Hale Tucker and other charter members of the African American Heritage Society.
As I left the Burnett Library after the anniversary celebration, I noticed that the African American Resource Center, now kept vibrant by librarian Erica Lansdown, was packed with young people reading.
Indira would be proud.
If you want to volunteer to help the Heritage Society or become a member, call Aaron Day at _PHONE_.


is a JavaScript (TypeScript) NodeJS framework inspired by Angular.
It achieves something somewhat similar to what can be done with Flask-apispec.
It has an integrated dependency injection system, inspired by Angular two. It requires pre-registering the "injectables" (like all the other dependency injection systems I know), so, it adds to the verbosity and code repetition.
As the parameters are described with TypeScript types (similar to Python type hints), editor support is quite good.
But as TypeScript data is not preserved after compilation to JavaScript, it cannot rely on the types to define validation, serialization and documentation at the same time. Due to this and some design decisions, to get validation, serialization and automatic schema generation, it's needed to add decorators in many places. So, it becomes quite verbose.
It can't handle nested models very well. So, if the JSON body in the request is a JSON object that has inner fields that in turn are nested JSON objects, it cannot be properly documented and validated.
Inspired FastAPI to
Use Python types to have great editor support.
Have a powerful dependency injection system. Find a way to minimize code repetition.
Sanic
It was one of the first extremely fast Python frameworks based on asyncio. It was made to be very similar to Flask.
Technical Details
It used uvloop instead of the default Python asyncio loop. That's what made it so fast.
It still doesn't implement the ASGI spec for Python asynchronous web development, but it clearly inspired Uvicorn and Starlette, that are currently faster than Sanic in open benchmarks.
Inspired FastAPI to
Find a way to have a crazy performance.
That's why FastAPI is based on Starlette, as it is the fastest framework available (tested by third-party benchmarks).
Molten
I discovered Molten in the first stages of building FastAPI. And it has quite similar ideas:
 - Based on Python type hints.
 - Validation and documentation from these types.
 - Dependency Injection system.
It doesn't use a data validation, serialization and documentation third-party library like Pydantic, it has its own. So, these data type definitions would not be reusable as easily.
It requires a little bit more verbose configurations. And as it is based on WSGI (instead of ASGI), it is not designed to take advantage of the high-performance provided by tools like Uvicorn, Starlette and Sanic.
The dependency injection system requires pre-registration of the dependencies and the dependencies are solved based on the declared types. So, it's not possible to declare more than one "component" that provides a certain type.
Routes are declared in a single place, using functions declared in other places (instead of using decorators that can be placed right on top of the function that handles the endpoint). This is closer to how Django does it than to how Flask (and Starlette) does it. It separates in the code things that are relatively tightly coupled.
Inspired FastAPI to
Define extra validations for data types using the "default" value of model attributes. This improves editor support, and it was not available in Pydantic before.
This actually inspired updating parts of Pydantic, to support the same validation declaration style (all this functionality is now already available in Pydantic).
APIStar (<= 0.5)
Right before deciding to build FastAPI I found APIStar server. It had almost everything I was looking for and had a great design.
It was actually the first implementation of a framework using Python type hints to declare parameters and requests that I ever saw (before NestJS and Molten).
It had automatic data validation, data serialization and OpenAPI schema generation based on the same type hints in several places.
Body schema definitions didn't use the same Python type hints like Pydantic, it was a bit more similar to Marshmallow, so, editor support wouldn't be as good, but still, APIStar was the best available option.
It had the best performance benchmarks at the time (only surpassed by Starlette).
At first, it didn't have an automatic API documentation web UI, but I knew I could add Swagger UI to it.
It had a dependency injection system. It required pre-registration of components, as other tools discussed above. But still, it was a great feature.
I was never able to use it in a full project, as it didn't have security integration, so, I couldn't replace all the features I was having with the full-stack generators based on Flask-apispec. I had in my backlog of projects to create a pull request adding that functionality.
But then, the project's focus shifted.
It was no longer an API web framework, as the creator needed to focus on Starlette.
Now APIStar is a set of tools to validate OpenAPI specifications, not a web framework.
Info
APIStar was created by Tom Christie. The same guy that created:
 - Django REST Framework
 - Starlette (in which FastAPI is based)
 - Uvicorn (used by Starlette and FastAPI)
Inspired FastAPI to
Exist.
The idea of declaring multiple things (data validation, serialization and documentation) with the same Python types, that at the same time provided great editor support, was something I considered a brilliant idea.
And after searching for a long time for a similar framework and testing many different alternatives, APIStar was the best option available.
Then APIStar stopped to exist as a server and Starlette was created, and was a new better foundation for such a system. That was the final inspiration to build FastAPI.
I consider FastAPI a "spiritual successor" to APIStar, while improving and increasing the features, typing system, and other parts, based on the learnings from all these previous tools.
Used by FastAPI
Pydantic
Pydantic is a library to define data validation, serialization and documentation (using JSON Schema) based on Python type hints.
That makes it extremely intuitive.
It is comparable to Marshmallow. Although it's faster than Marshmallow in benchmarks. And as it is based on the same Python type hints, the editor support is great.
FastAPI uses it to
Handle all the data validation, data serialization and automatic model documentation (based on JSON Schema).
FastAPI then takes that JSON Schema data and puts it in OpenAPI, apart from all the other things it does.
Starlette
Starlette is a lightweight ASGI framework/toolkit, which is ideal for building high-performance asyncio services.
It is very simple and intuitive. It's designed to be easily extensible, and have modular components.
It has:
 - Seriously impressive performance.
 - WebSocket support.
 - GraphQL support.
 - In-process background tasks.
 - Startup and shutdown events.
 - Test client built on requests.
 - CORS, GZip, Static Files, Streaming responses.
 - Session and Cookie support.
 - 100% test coverage.
 - 100% type annotated codebase.
 - Zero hard dependencies.
Starlette is currently the fastest Python framework tested. Only surpassed by Uvicorn, which is not a framework, but a server.
Starlette provides all the basic web microframework functionality.
But it doesn't provide automatic data validation, serialization or documentation.
That's one of the main things that FastAPI adds on top, all based on Python type hints (using Pydantic). That, plus the dependency injection system, security utilities, OpenAPI schema generation, etc.
Technical Details
ASGI is a new "standard" being developed by Django core team members. It is still not a "Python standard" (a PEP), although they are in the process of doing that.
Nevertheless, it is already being used as a "standard" by several tools. This greatly improves interoperability, as you could switch Uvicorn for any other ASGI server (like Daphne or Hypercorn), or you could add ASGI compatible tools, like python-socketio.
FastAPI uses it to
Handle all the core web parts. Adding features on top.
The class FastAPI itself inherits directly from the class Starlette.
So, anything that you can do with Starlette, you can do it directly with FastAPI, as it is basically Starlette on steroids.
Uvicorn
Uvicorn is a lightning-fast ASGI server, built on uvloop and httptools.
It is not a web framework, but a server. For example, it doesn't provide tools for routing by paths. That's something that a framework like Starlette (or FastAPI) would provide on top.
It is the recommended server for Starlette and FastAPI.
FastAPI recommends it as
The main web server to run FastAPI applications.
You can combine it with Gunicorn, to have an asynchronous multiprocess server.
Check more details in the Deployment section.
Benchmarks and speed
To understand, compare, and see the difference between Uvicorn, Starlette and FastAPI, check the section about Benchmarks.


text:
What does ADA mean in Universities?
This page is about the meanings of the acronym/abbreviation/shorthand ADA in the Academic & Science field in general and in the Universities terminology in particular.
Find a translation for ADA in other languages:
Select another language:
What does ADA mean?
- adenosine deaminase, ADA(noun)
- an enzyme found in mammals that can catalyze the deamination of adenosine into inosine and ammonia


text:
Identification and source determination of Magnesite in the Maharlou Lake sediments
|Location||The 25 Symposium of Geosciences|
|Holding Date||03 July 2007|
Maharlou Lake, located in southwest Iran, is an intra-continental sedimentary basin. Its area is about 280 km2 with an average water depth of 1.5m during wet seasons. 13, 80 to 170 cm deep cores taken using plastic tubes, provided 102 sediment samples. The samples were analyzed sedimentologically and mineralogically by running sieve analysis, calcimetry, X- ray difractometry, optical and SEM microscopy, and C14 age dating tests as well as defining major and minor constituent elements. There is very fine lamination in the sediments but three major types of sediments consist of Carbonates, evaporites and siliciclastic was recognized. All of sediments in the center of the lake are evaporits and in the marginal zone are chemical and siliciclastic sediments. siliciclastic sediments consist of Quartz, Calcite, Dolomite, Feldspar, Muscovite and illite. Source of them are rocks of the catchments. These sediments are silt dominated, well sorted, subrounded to rounded and sub spherical to spherical shape. Chemical sediments consist of carbonate and evaporite minerals. Carbonate minerals (calcite, Dolomite, Aragonite and magnesite) precipitate at the beginning of brine evolution after that sulfate and chloride (Gypsum, Halite, Bassanite, Glauberite, polihalite and Bischofite) are precipitate. Distinctive changes in sediment laminae are indicative of Lake water table changes through the time. Where occurrence of delicate with laminea is regarded as Magnesite, a significant with horizon not only in the cores taken from marginal parts of the South of the lake but also in a core provided obtained from a zone located in North west to central parts of the lake. Magnesites in the marginal zone precipitate at the beginning of brine evolution but Source of Magnesite in the center of the lake suggests some bicarbonate type springs.


Difference between revisions of "Food"
From RimWorld Wiki
Jump to navigation Jump to search
Line 73: Line 73:
==Version History==
==Version History==
*[[Version/0.8.657|0.8.657]] - Now spoils without refrigeration
* [[Version/0.9.722|0.9.722]] - Food poisioning added. [[Skills#Cooking|Bad cooks]] are more likely to accidentally poison meals.
Latest revision as of 04:52, 25 November 2020
Basics Menus Game Creation Gameplay Pawns Plants Resources Gear Mods
Resources Menu Crafted Resources Exotic Items Food Medical Items Materials Textiles
Food is the basic source of nutrition to both humans and animals. Lack of it leads to hunger which can be tracked by a pawn's food meter known as saturation and a long excessive deprivation leads to starvation.
For a more in-depth guide to farming and producing food, see Food production.
Raw Food
For a list of raw food items, see Raw food.
Food found in its natural stage is raw, fruits can be consumed without cooking but vegetables and meat will taste better for the colonist when prepared. Raws can still be consumed without being heated but causes the Ate raw food thought with a -7 mood penalty. Eating raw food restores 0.05 saturation each. Foods cooked at an electric stove, fueled stove or campfire turn into meals, later on it can be processed at the nutrient paste dispenser as well.
Raw food can be obtained from a variety of sources:
As of Alpha 15 (August 28st, 2016), there is a message telling you when food has spoiled.
Food will be wasted if left unattended (except for beer) by two factors: exposure and high temperature.
 - Storage in temperature above 0°C will spoil over time as well, though temperatures below 10°C will slow down spoiling. A freezer room can be created by placing at least enough Coolers in proportion to its size, the bigger the storage the more coolers required. In the early game, this can pose a threat if located on warm biomes.
Note that freezing temperatures alone does not prevent deterioration of food. For example: a raider is killed and drops his/her fine meal outdoors. That meal will still decay from exposure.
Once spoiled, food will vanish and can never be recovered. However, food can be eaten at any stage before spoiling with no visible mood effect.
Food deterioration rates
Food item Deterioration rate (per day)
MeatBig.png Raw meat 6
Potatoes.png Raw fruit/vegetables 6
Beer.png Beer 0
Packaged Survival Meal.png Packaged survival meal 0.25
Pemmican.png Pemmican 2
Nutrient paste meal.png Nutrient paste meal 10
Simple meal.png Simple meal 10
Fine meal.png Fine meal 10
Lavish meal.png Lavish meal 10
Eggs.png Eggs 2
Hay.png Hay 6
Kibble.png Kibble 6
Insect jelly.png Insect jelly 6
Version History
 - 0.8.657 - Now spoils without refrigeration
 - 0.9.722 - Food poisioning added. Bad cooks are more likely to accidentally poison meals.


text:
David Howarth. The Invention of Spain: Cultural Relations between Britain and Spain, _PHONE_. Manchester: Manchester University Press, 2007. xvii + 244 pp. $85.00 (cloth), ISBN 978-0-7190-6562-0.
Reviewed by David Brown (Department of History, University of Strathclyde)
Published on H-Albion (February, 2008)
A British Face in a Spanish Mirror
This is an interesting and genuinely original view of Europe during a period of profound change. David Howarth's study ranges across politics, history, religion, literature, and art to assess the "cultural relations" between Britain and Spain, although the substance of the book is rather more one-sided than the subtitle might suggest. In chronicling the "invention of Spain," Howarth sets out, as he states in the opening to the book, primarily to identify what British perceptions and understandings of Spain reveal about the development of British politico-cultural sensibilities as imperial hegemonies gave way to a new order of international and domestic political relations. For Howarth, Spain is a prism through which to see Britain better: the book aims to reflect "a British face in a Spanish mirror" (p. xii). Howarth argues that despite sincere, if intermittent, interest in Spain, "the British never really understood the Peninsula on its own terms" (pp. ix). Spain could, therefore, be represented simultaneously as "a greenhouse" by the Holland House set where liberal nostrums too advanced for British tastes "could flourish in a hotter environment," and as a society deeply respecting of tradition and thus a bulwark, for the Tories, against Jacobinism and the dangerous legacy of the French Revolution (p. ix). The Invention of Spain, then, is a study underpinned by paradox. Nineteenth-century Spain was seen in Britain, argues Howarth, as both liberal and conservative, and as a welcome counterpoint to Catholic France, yet itself a Catholic country against which British concerns about Catholic emancipation and relations with Rome might be better understood. Spain was somehow both advanced and old-fashioned. In seeking to delineate these competing interpretations of the peninsula, Howarth's study tells us comparatively little about Spain itself, but a good deal about Britain through the study of Spain.
Howarth opens with a chapter considering how British writers came to terms with Spain's political and economic decline. Told principally through an analysis of the works of William Robertson and Adam Smith, this chapter is actually concerned largely with questions of Britishness. It is, as Howarth argues, significant that what he identifies as the most important studies of Spain in the late eighteenth century were products of the Scottish enlightenment. "Scotsmen, no sooner subjugated by English imperialism, became drawn to a study of a still greater 'tyranny'--that of Spain," he writes, alluding to the traditional alignment of Scotland with France and of England with Iberia, and in particular Portugal (p. 3). There are suggestive points here with regard to debates about what might be termed a Francophobic Britishness, explored notably by Linda Colley (Britons: Forging the Nation, _PHONE_ ). It might have been interesting had Howarth taken further his analysis of how the "invention of Spain" related to this Anglo-centric idea of Britishness being, in many respects, and to risk oversimplification, "not French." "Benighted and priest-ridden Spain had to be studied if Europe was to be understood in the age of Rationalism," says Howarth in a comment on Robertson (p. 10). So, too, in a slightly different way, did Spain offer, for Smith, "an appropriate cautionary tale to a burgeoning British economy," not least that Britain's empire "must do better than Spain had done" (pp. 23, 25). The corpse of the Spanish empire attracted Robertson and Smith "like Rembrandt's anatomists" seeking a better understanding of politics, economics, and religion (p. 27). Significantly, Howarth maintains, Spain was for these writers a case study and not a country they expected "civilized" Britons actually to visit. Taking this as his foundation, Howarth proceeds to explore questions of politics and religion.
A history of apparently constant Spanish "failure" was fertile ground for competing liberal and conservative historiographies, fought out, for example, through the pages of the Edinburgh Review and the Quarterly Review. Indeed, suggests Howarth, it was due largely to the reporting of Iberian affairs that Spain "vicariously gave birth to the Quarterly" to counter the "pernicious" views of the Whiggish Edinburgh (p. 31). Spain served many purposes: it could be used to reflect what was right or wrong in Britain and what was worse in France, and it served as a convenient distillation of the history of good versus evil. This fascination with Spain, a "Spanish fever," is observed particularly through the works of William Wordsworth, Richard Ford, and Robert Southey, and is seen to have found its first tangible political form in the diplomacy of George Canning (p. 32). Howarth suggests that through Canning's manipulation of public opinion in the 1820s, for example, the New World of Spanish America was seen as liberal, free, and English, something further underpinned by Lord Palmerston's famous Quadruple Alliance of the liberal west European powers in the 1830s. This is interesting and important, yet in laying emphasis on popular perceptions alongside the hitherto unequivocally high cultural portrayal of Spain, Howarth might have explored further the wider reception in Britain of these various constructions of Spain. Canning's populism, for example, is illustrated in purely parliamentary terms while more might have been said of the British public's apparent impression of "the Spaniard" as "primitive and savage" and somehow inferior, in the arts and manners of war, to not only Britain but also France during the wars of the 1830s (pp. 49-50).
Spain offered a similarly complicated series of lessons in terms of religion. For many Britons, Spain had the great advantage in the early nineteenth century of not being Napoleonic France, but the connection with the Iberian Peninsula was not a neat one, since Spain was also, of course, a major Catholic country. As the British political establishment argued over the rights of the Catholic population at home, Spanish Catholicism was being presented in such works as Blanco White's Letters from Spain (1822) as indivisible from Spanish corruption. Interest in Spain from a political and economic perspective, whether as a model or a warning, was thus qualified by religious priorities. As is brought into sharp relief in this section of the book, it was not always clear whether contemporaries wanted to understand Spain or simply to judge it. Howarth shows just how "the Church of Rome was often observed through the prism of Spain in the contest within Britain for emancipation and the establishment of a new hierarchy" (p. 87). Howarth's book, therefore, offers an interesting complement to recent studies of this question, such as the work of Saho Matsumoto-Best (Britain and the Papacy in the Age of Revolution, _PHONE_ ), placing this particular "British" question in its European context.
Having established the importance of Spain to contemporary self-perception, Howarth proceeds in the remaining chapters to examine the historians, painters, and art collectors who established the parameters of that understanding. In particular, Howarth's analysis of the emergence and growing popularity of the "Spanish School" is illuminating, and his tracing of the growing appreciation of Spanish art, as it emerged as something distinct from Italian, is handled well. Much attention is devoted, in particular, to the (mis)understanding of Diego Velázquez and the importance of such figures as Austen Henry Layard and Sir William Stirling in bringing his and others' work to prominence in Britain. As the final chapter, "Picturing Spain" demonstrates, the "dialogue between British artists and Spain" was just as complex and occasionally ambiguous as that between British politicians and the peninsula, but Howarth offers a careful examination of the visual representation of Spain and the importance of pictorial examinations of the theater of worship, the role of women, and ethnic stereotyping that echo the political, economic, and religious concerns of the earlier chapters in the book (p. 188). It is interesting to see how far art responded to the preformed ideas and prejudices of British audiences, and there are important comparisons pointed out here between the relative forces of literature and of painting in the history of cultural relations. Thus, as Howarth concludes: "Artists came to Spain knowing what they were looking for and they extracted a partial view of its cultural heritage. It was one selected on the basis of what a British public could make sense of. The invention of Spain was a confirmation of prejudice, never a broadening of the mind" (p. 226).
Howarth's study is a stimulating one. His interwoven analysis of politics, religion, and art offers a valuable contribution to the cultural, political, and diplomatic history of the period. In places, the book is perhaps more suggestive than exhaustive--such as in its treatment of the problematic issues of political and religious freedoms--but that is less a criticism of the work and more a reflection of its subject. In places, Howarth's analysis might have been developed further. The book is unapologetically high cultural, yet reference is made in places to public opinion and popular tastes. It would be interesting to know more about the broader reception


text:
Why is it called Taroko? In fact, Taroko is one of Taiwan indigenous tribes whose ancestor immigrated to this area in the 17th century. During Japan colonization of Taiwan (1895 to 1945), the Taroko Tribe constant fought with the Japanese government over its splendid natural resources like lumbers and gold for 18 years. In 1914, the Japanese government decided to conquer Taroko tribe for stabilizing this region. The Japanese government started constructing the road from Taroko to Hohuan (partial of Highway 14) in order to transport war supplies and economic goods. The final and famous war is called the War of Taroko between Japanese and Taroko Tribe after 18 years of fighting.
|Liwu River is along the highway which eroded and formed Taroko Gorge for millions of years.|
|One of the water falls in Taroko National Park|
|What does the rock look like? Most people think it looks like a frog. The pavilion is just like a crown sits on the frog. This pavilion is built in memory of Chiang Chingkuo's mother.|
|Cimu Bridge (Motherly Devotion Bridge) which is named by Chiang Chingkuo to in memory of all mothers.|
|After this bridge was finished, Chiang Chinnkuo refused to use his name for this bridge as politics did in Taiwan at the time.|
|The massive marble is the metamorphosis of limestone through millions of years.|
|Due to the erosion of Liwu River, these massive marbles cliffs have many different forms. According to the geologic survey, Taroko Gorge is still growing in height each year.|
|Tunnel of Nine Turns Trail (Jiuqudong): 2 KM long--This photo was taken in 2008.|
Updated on Oct 26. 2011: The park has just finished a FRP (Fiber Reinforced Polymer) walkway/canopy which can bear a 40kg rock falling from 20 meter high on the Tunnel of Nine Turns Trail. So, people can enjoy its gorgeous view and experience its dangerous atmosphere again.
According the park survey, the average frequency of rock falling is 3.6 times per day.
|Eternal Spring Shrine (Changchun Shrine)|
|The Marble Trail to the Eternal Spring Shrine: there are 380 steps to Guanyin Cave. It is cool during the Summer, a good way to escape the summer heat.|
|There was a pavilion on the right hand side of the photo. It was destroyed by a landslide.|
|Swallow Grotto : It used to have a lot of swallow around this area; however, those swallows have gone due to the heavy traffic. Their natural habitats were disturb by the intrusion of human beings.|
|The Old Highway Trail on the right and New Highway Tunnel on the left|
|Rest Area at Swallow Grotto|
|Statue of Chief Engineer Jin Heng who scarified his life during the construction|
|The famous landmark: Indian Chief on the right side at the river|
|What do you think about this sign?|
|Bulouwan Visitor Center|
Buluowan in Taroko Tribe language means Echo. It has two terraces. The terraces were Taroko tribe habitat places. But the Japanese government forced them to move to cities for monitoring and controlling them. Now the visitor center and the prehistory museum are located at the low terrace.
|Trail Conveys Upper and Lower Terraces|
|Taroko Prehistory Museum|
|An Old Taroko Tribe Woman Weaving Fabric|
|Walking Trail Next To Parking Area|
|The Sculpture in Front of Leader Hotel|
|I wish I have the opportunity to stay in the hotel to enjoy its tranquility.|


Motor Disconnecting Means NJATC code calcs 2008
The flashcards below were created by user johnbowens on FreezingBlue Flashcards.
 1. the disconnecting means for motors has 3 responsibilities. What are they? PP168
 - To safely carry the load
 - To be capable of being opened under load, and....
 - To be capable of being opened under locked rotor conditions.
 2. What indicates the locked rotor current of a disconnecting means? PP169
 Can this horsepower rating be the same as the HP rating of the motor? Under what conditions? pp176
 The horsepower rating of the disconnecting means
 Yes: only when the code letter is between A and F
 3. A design B energy efficient motor has a hi/ low starting current? PP169
 Very high
 4. The circuit breaker is/ is not allowed to be used as a disconnecting means for a motor? Why? PP 180
 Is, becuase the UL directory lists them as having been tested for 6 times the devices rating and identified for such use per 430.109
 5. The disconnecting means, versus the branch circuit rating, is rated at _______% of FLC of the motor plus heating loads? PP184
 115%, versus 125% for branch circuits plus 125% of heating.
 6. A molded case switch looks just like a molded case circuit breaker but is different how? PP 185
 No overcurrent protection is built into it
 7. For air-conditioning and refigerant equipment, the branch circuit selection current (BCSC) is always what in comparison to rated load current (RLC)? PP187
 Always bigger
 8. Section 440.32 requires the conductiors supplying a motor compressor to be 125% of the RLC or BCSC, _________. pp188
 whichever is the larger
Author
ID
59846
Card Set
Motor Disconnecting Means NJATC code calcs 2008
Description
Motor disconnecting means general rules and requirements per 2008/11 NEC
Updated
Show Answers


Data Mining using Decision Trees
levelsordΔιαχείριση Δεδομένων
20 Νοε 2013 (πριν από 3 χρόνια και 10 μήνες)
68 εμφανίσεις
Data Mining using Decision
Trees
Professor J. F. Baldwin
Decision Trees from Data Base
Ex
Att
Att
Att
Concept
Num
Size
Colour
Shape
Satisfied
1
med
blue
brick
yes
2
small
red
wedge
no
3
small
red
sphere
yes
4
large
red
wedge
no
5
large
green
pillar
yes
6
large
red
pillar
no
7
large
green
sphere
yes
Choose target : Concept satisfied
Use all attributes except Ex Num
CLS
-
Concept Learning
System
-
Hunt et al.
Parent node
Attribute
V
v1
v2
v3
Node with mixture
of +ve and
-
ve
examples
Children nodes
Tree Structure
CLS ALGORITHM
1. Initialise the tree T by setting it to consist of one
node containing all the examples, both +ve and
-
ve,
in the training set
2. If all the examples in T are +ve, create a YES node and HALT
3. If all the examples in T are
-
ve, create a NO node and HALT
4. Otherwise, select an attribute F with values v1, ..., vn
Partition T into subsets T1, ..., Tn according to the values on F.
Create branches with F as parent and T1, ..., Tn as child nodes.
5. Apply the procedure recursively to each child node
Data Base Example
Using attribute SIZE
{1, 2, 3, 4, 5, 6, 7}
SIZE
med
small
large
{1}
{2, 3}
{4, 5, 6, 7}
YES
Expand
Expand
Expanding
{1, 2, 3, 4, 5, 6, 7}
SIZE
med
small
large
{1}
{2, 3}
COLOUR
{4, 5, 6, 7}
SHAPE
YES
{2, 3}
SHAPE
wedge
sphere
{3}
{2}
no
yes
wedge
sphere
pillar
{4}
{7}
{5, 6}
COLOUR
No
Yes
red
{6}
No
green
{5}
Yes
Rules from Tree
IF (SIZE = large
AND
((SHAPE = wedge) OR (SHAPE = pillar AND
COLOUR = red) )))
OR (SIZE = small AND SHAPE = wedge)
THEN NO
IF (SIZE = large
AND
((SHAPE = pillar) AND COLOUR = green)
OR SHAPE = sphere) )
OR (SIZE = small AND SHAPE = sphere)
OR (SIZE = medium)
THEN YES
Disjunctive Normal Form
-
DNF
IF
(SIZE = medium)
OR
(SIZE = small AND SHAPE = sphere)
OR
(SIZE = large AND SHAPE = sphere)
OR
(SIZE = large AND SHAPE = pillar
AND COLOUR = green
THEN CONCEPT = satisfied
ELSE CI?ONCEPT = not satisfied
ID3
-
Quinlan
ID3 = CLS + efficient ordering of attributes
Entropy is used to order the attributes.
Attributes are chosen in any order for the CLS algorithm.
This can result in large decision trees if the ordering is not
optimal. Optimal ordering would result in smallest decision
Tree.
No method is known to determine optimal ordering.
We use a heuristic to provide efficient ordering which
will result in near optimal ordering
Entropy
For random variable V which can take values {v
1
, v
2
, …, v
n
}
with Pr(v
i
) = p
i
, all i, the entropy of V is given by
Entropy for a fair dice =
Entropy for fair dice with even score =
=
1.7917
=
1.0986
Information gain =
1.7917
-
1.0986 = 0.6931
Differences between
entropies
Attribute Expansion
A
i
T
Expand attribute A
i
-
a
i1
a
im
T
T
Pr
Pr
Equally likely unless specified
Pr(A
1
, …A
i
, …A
n
, T)
Attributes
Except
Ai
Pr(A
1
, …A
i
-
1
, A
i+1
, …A
n
, T | A
i
= a
i1
)
other
attributes
Pass probabilities corresponding to a
i1
from above and re
-
normalise
-
equally likely again if previous equally likely
Expected Entropy for an
Attribute
A
i
T
Attribute A
i
and target T
-
a
i1
a
im
T
T
S(a
i2
)
S(a
i1
)
S(a
im
)
Expected Entropy for Ai =
Pr
Pr
Pr
Pass probabilities corresponding to t
k
from above for a
i1
and re
-
normalise
Pr(T | A
i
=a
im
)
How to choose attribute and
Information gain
Determine expected entropy for each attribute
i.e. S(A
i
), all i
Choose s such that
Expand attribute A
s
By choosing attribute A
s
the information gain is
S
-
S(A
s
)
where where
Minimising expected entropy is equivalent to maximising
Information gain
Previous Example
Ex
Att
Att
Att
Concept
Num
Size
Colour
Shape
Satisfied
1
med
blue
brick
yes
1/7
2
small
red
wedge
no
1/7
3
small
red
sphere
yes
1/7
4
large
red
wedge
no
1/7
5
large
green
pillar
yes
1/7
6
large
red
pillar
no
1/7
7
large
green
sphere
yes
1/7
Pr
Concept
satisfied
yes
no
Pr
4/7
3/7
S = (4/7)Log(4/7) + (3/7)Log(3/7) = 0.99
Entropy for attribute Size
Att
Concept
Size
Satisfied
med
yes
1/7
small
no
1/7
small
yes
1/7
large
no
2/7
large
yes
2/7
Pr
Concept
Satisfied
no
1/2
yes
1/2
Pr
small
med
Concept
Satisfied
yes
1
Pr
Concept
Satisfied
no
1/2
yes
1/2
Pr
large
S(small) = 1
S(med) = 0
S(large) = 1
Pr(small) = 2/7
Pr(large) = 4/7
Pr(med) = 1/7
S(Size) = (2/7)1 + (1/7)0
+ (4/7)1 = 6/7 = 0.86
Information Gain
for Size = 0.99
-
0.86
= 0.13
First Expansion
Attribute
Information Gain
SIZE
0.13
COLOUR
0.52
SHAPE
0.7
choose
max
{1, 2, 3, 4, 5, 6, 7}
SHAPE
wedge
brick
pillar
sphere
{2, 4}
NO
{1}
YES
{5, 6}
{3, 7}
YES
Expand
Complete Decision Tree
{1, 2, 3, 4, 5, 6, 7}
SHAPE
wedge
brick
pillar
sphere
{2, 4}
NO
{1}
YES
{5, 6}
{3, 7}
YES
COLOUR
red
green
{6)
NO
{5}
YES
Rule:
IF
Shape is wedge
OR
Shape is brick
OR
Shape is pillar AND
Colour is red
OR
Shape is sphere
THEN NO
ELSE YES
A new case
Att
Att
Att
Concept
Size
Colour
Shape
Satisfied
med
red
pillar
?
SHAPE
pillar
COLOUR
red
? = NO
Post Pruning
Any Node S
N examples
in node
n cases of C
C is one of
{YES, NO
}
Let C be class
with most
examples
i.e
majority
E(S)
Suppose we terminate this node and make it a leaf with
classification C.
What will be the expected error, E(S), if we use the tree
for new cases and we reach this node.
E(S) = Pr(class of new case is a class ≠ C)
Bayes Updating for Post Pruning
Let p denote probability of class C for new case arriving at S
We do not know p. Let f(p) be a prior probability distribution
for p on [0, 1]. We can update this prior using Bayes' updating
with the information at node S.
The information at node S is
n C in S
1
0
Pr(n C in S | p) f(p)
Pr(n C in S | p) f(p)dp
f(p | n in S) =
Mathematics of Post Pruning
Assume f(p) to be uniform over [0, 1]
1
0
dp
f(p | n C in S) =
p (1
-
p)
n
N
n
p (1
-
p)
n
N
n
E(S) =
E
(1
p)
f(p | n C in S)
E(S) =
1
0
dp
p (1
-
p)
n
N
n + 1
p (1
-
p)
n
N
n
=
N
n + 1
N + 2
dp
using
Beta Functions.
The evaluation of the integral
n! (N
n + 1)!
(N + 2)!
1
0
dx
x (1
-
x)
a
b
=
using Beta Functions
Post Pruning for Binary Case
S
S1
S2
Sm
Error(S1)
Error(S2)
Error(Sm)
P1
P2
Pm
E(S)
BackUpError(S)
For any node S which is not a leaf
node we can calculate
BackUpError(S) = Pi Error(Si)
i
Error(S) =
MIN
{
}
P
i
=
Num of examples in Si
Num of examples in S
For leaf nodes S
i
Error(S
i
) = E(S
i
)
E(S)
BackUpError(S
)
Decision: Prune at S if
BackUpError(S) ≥ Error(S)
Example of Post Pruning
Before Pruning
a
[6, 4]
b
[4, 2]
c
[2, 2]
d
[1, 2]
[x, y]
means x YES cases
and y NO cases
We underline Error(Sk)
[3, 2]
0.429
[1, 0]
0.333
[1, 1]
0


text:
At Archbishop Chapelle High School in Metairie, a chain-link, 10-by-10-foot pen resembling a kennel sits outside the cafeteria.
Built by classes of juniors and seniors, under the guidance of their environmental science teacher, Joann Haydel, the pen is the start of the school's first wetlands nursery with Louisiana State University's Coastal Roots program.
Directed by LSU's College of Education, the program has reached out to south Louisiana primary and high schools to grow wetlands plants as a way to help restore the coast and to integrate hands-on awareness of coastal erosion into science education, said LSU's Pam Blanchard.
Since its debut in 2000, Coastal Roots has spawned wetlands nurseries at 35 schools in 15 parishes statewide, most of them coastal parishes, and has contributed more than 21,000 plants to the wetlands.
"We learn about the geology, the life science of the area, and what we're doing to protect and save our wetlands, " Haydel said. "We talk a lot about coastal stewardship, and the program is a way to tie it all in with something that's hands-on."
Before Hurricane Katrina, only one New Orleans school was involved in the program. After the double blows of Hurricanes Katrina and Rita obliterated 217 square miles of wetlands -- nearly half the loss researchers had projected to occur by the year 2050 -- schools began to take notice, Blanchard said. Now, 14 of them in greater New Orleans are Coastal Roots members.
"We were trying to find a better way to inform the K through 12 population of the problem (of coastal erosion), " Blanchard said. "When Katrina and Rita hit, a large number of people were severely impacted by that. (Schools) needed something their students could participate in... to give back something to the community."
Haydel used a $1,600 grant from the Brown Foundation, an organization that gives out service learning grants, to buy equipment for the nursery and will buy the smooth cordgrass the students will plant in coming weeks.
Students built the nursery structure in October, which included digging trenches and assembling PVC pipe for the irrigation system, erecting the fence and lining the pen with black matting. They will also have to install a pond for the aquatic plants, Haydel said. The class will take a field trip this fall to scout its restoration site in Bayou Sauvage National Wildlife Refuge and to obtain cuttings of plants to propagate in the nursery.
In the spring, when the grasses have matured, the class will return to Bayou Sauvage and plant them, adding a bit more vegetation to the fast-disappearing wetlands.
"We want the kids to go out into the site, so they can see what it looks like, " Blanchard said, noting the example of Fontainebleau State Park on the north shore, which is a project site for several other schools. "When our kids went out there, they stood in the middle of what used to be the forest, and the ranger told them, 'When we stood here three or four years ago, we couldn't see the sky. We would be standing in full shade.' The kids began to understand what really happened in the storm to these natural areas."
Haydel plans to make the project an annual cycle, with each class contributing to the local ecology and expanding awareness of the much larger, more troubling big picture of coastal erosion, she said.
"I knew we were losing wetlands, but I didn't know how much, " said Molly Smith, a junior.
"I didn't know it was so serious, " added her classmate, Kimberly Martinez.


text:
Recently, saving the cooling power in servers by controlling the fan speed has attracted considerable attention because of the increasing demand for high-density servers. This paper presents an optimal self-tuning proportional-integral-derivative (PID) controller, combining a PID neural network (PIDNN) with fan-power-based optimization in the transient-state temperature response in the time domain, for a server fan cooling system. Because the thermal model of the cooling system is nonlinear and complex, a server mockup system simulating a 1U rack server was constructed and a fan power model was created using a third-order nonlinear curve fit to determine the cooling power consumption by the fan speed control. PIDNN with a time domain criterion is used to tune all online and optimized PID gains. The proposed controller was validated through experiments of step response when the server operated from the low to high power state. The results show that up to 14% of a server's fan cooling power can be saved if the fan control permits a slight temperature response overshoot in the electronic components, which may provide a time-saving strategy for tuning the PID controller to control the server fan speed during low fan power consumption.
This is an open access article distributed under the Creative Commons Attribution License
which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited


text:
Precipitation gauge measurements suffer from several sources of errors which can strongly influence their accuracy. The method proposed in the paper is based on the correction of annual precipitation records for a given river basin using the water balance equation. The main advantage of the approach is in using the annual runoff records and air temperature data, which are measured more accurately than the annual precipitation amount. Two versions of the computation scheme (for a multi-year period and for an annual interval) are presented and discussed. The water balance equation taken into account in this study combines the area averaged annual measured precipitation, runoff, evapotransporation and, over an annual time scale, the change in moisture in surface and undersurface storages. The Ol'decop formula for calculation of evapotranspiration together with the improved regional formula for potential evaporation as a function of annual air temperature is used in this study. It has been determined for the annual time interval that the storage of water in a basin is strongly dependent on annual air temperature and, to a lesser extent, on precipitation. An example of the method application for two catchments situated in Northwest Russia is presented, too.
Skip Nav Destination
Research Article| August 01 2006
Method for correction of annual precipitation records using the water balance approach*
Yuri A. Salo; Method for correction of annual precipitation records using the water balance approach*. Hydrology Research 1 August 2006; 37 (4-5): 433–440. doi: _URL_
Download citation file:


text: Uremic patients undergoing chronic hemodialysis demonstrate a secondary systemic carnitine deficiency. We studied the effect of carnitine replacement with high doses ( L-carnitine, 3 g/day) similar to those used in the treatment of primary systemic carnitine deficiency. 10 uremic patients on hemodialysis were randomly selected into a control group (4 patients) treated by placebo and a treatment group (6 patients) treated by L-carnitine. Plasma lipoprotein concentration and composition as well as platelet aggregation were studied before and after treatment. Following carnitine administration, a paradoxical rise in plasma triglyceride concentration from 180 ± 66 to 219 ± 88 mg% (p < 0.05) was noted. No other significant changes in lipoprotein concentration and composition or in plasma apoprotein A-I and B concentration were observed. Carnitine treatment caused a significant rise in platelet aggregation induced by epinephrine, ADP, and thrombin. These findings suggest a harmful effect of L-carnitine replacement therapy when given in high doses, causing aggravation of uremic hypertriglyceridemia and increased platelet aggregation in patients predisposed to thromboembolic phenomena.


text:
Managing inter-object dependencies in object-oriented systems is a complex task. Changes of one object often require dependent objects to change accordingly. Making every object explicitly inform every dependent object about its state changes intertwines object interfaces and implementations, thereby hampering system evolution and maintenance. These problems can be overcome by introducing the notion of Implicit Invocation as a decoupling mechanism between objects to object-oriented systems. This paper presents the Event Notification pattern, a pattern to smoothly integrate implicit invocation mechanisms with object-oriented designs. State changes of objects, dependencies of other objects on them and the maintenance links between these objects are made explicit as first class objects. The resulting structure is highly flexible and can be used to manage inter-object dependencies in object-oriented systems efficiently.
Dirk Riehle. "The Event Notification Pattern--Integrating Implicit Invocation with Object-Orientation." Theory and Practice of Object Systems 2, 1 (1996). Page 43-52.
For the time being, a copy is available as a PDF file.
The C++ sample code from the pattern is available as events.zip. No warranties, use at your own risk.
Copyright (©) 1996 by Wiley & Sons, Inc. All rights reserved.


t\t {1} \t\t {2} \t\t {3} \t {4}", numDocs, Math.Round(sizeInMb, 3), Math.Round(sizeInMb / numDocs, 3), Math.Round(avgDuration, 3), Math.Round(mbPerSecond, 3));
 // Pausing 2 seconds to let the search service catch its breath
 Thread.Sleep(2000);
 }
 Console.WriteLine();
}
Because not all documents are the same size (although they are in this sample), we estimate the size of the data we're sending to the search service. We do this using the function below that first converts the object to json and then determines its size in bytes. This technique allows us to determine which batch sizes are most efficient in terms of MB/s indexing speeds.
// Returns size of object in MB
public static double EstimateObjectSize(object data)
{
 // converting object to byte[] to determine the size of the data
 BinaryFormatter bf = new BinaryFormatter();
 MemoryStream ms = new MemoryStream();
 byte[] Array;
 // converting data to json for more accurate sizing
 var json = JsonSerializer.Serialize(data);
 bf.Serialize(ms, json);
 Array = ms.ToArray();
 // converting from bytes to megabytes
 double sizeInMb = (double)Array.Length / _PHONE_;
 return sizeInMb;
}
The function requires a SearchClient plus the number of tries you'd like to test for each batch size. Because there might be variability in indexing times for each batch, we try each batch three times by default to make the results more statistically significant.
await TestBatchSizesAsync(searchClient, numTries: 3);
When you run the function, you should see an output like below in your console:
Output of test batch size function
Identify which batch size is most efficient and then use that batch size in the next step of the tutorial. You might see a plateau in MB/s across different batch sizes.
5 - Index data
Now that we've identified the batch size we intend to use, the next step is to begin to index the data. To index data efficiently, this sample:
 - Uses multiple threads/workers.
 - Implements an exponential backoff retry strategy.
Uncomment lines 41 through 49 and rerun and the program. On this run, the sample generates and sends batches of documents, up to 100,000 if you run the code without changing the parameters.
Use multiple threads/workers
To take full advantage of Azure AI Search's indexing speeds, use multiple threads to send batch indexing requests concurrently to the service.
Several of the key considerations previously mentioned can affect the optimal number of threads. You can modify this sample and test with different thread counts to determine the optimal thread count for your scenario. However, as long as you have several threads running concurrently, you should be able to take advantage of most of the efficiency gains.
As you ramp up the requests hitting the search service, you might encounter HTTP status codes indicating the request didn't fully succeed. During indexing, two common HTTP status codes are:
 - 503 Service Unavailable - This error means that the system is under heavy load and your request can't be processed at this time.
 - 207 Multi-Status - This error means that some documents succeeded, but at least one failed.
Implement an exponential backoff retry strategy
If a failure happens, requests should be retried using an exponential backoff retry strategy.
Azure AI Search's .NET SDK automatically retries 503s and other failed requests but you should implement your own logic to retry 207s. Open-source tools such as Polly can be useful in a retry strategy.
In this sample, we implement our own exponential backoff retry strategy. We start by defining some variables including the maxRetryAttempts and the initial delay for a failed request:
// Create batch of documents for indexing
var batch = IndexDocumentsBatch.Upload(hotels);
// Create an object to hold the result
IndexDocumentsResult result = null;
// Define parameters for exponential backoff
int attempts = 0;
TimeSpan delay = delay = TimeSpan.FromSeconds(2);
int maxRetryAttempts = 5;
The results of the indexing operation are stored in the variable IndexDocumentResult result. This variable is important because it allows you to check if any documents in the batch failed as shown below. If there's a partial failure, a new batch is created based on the failed documents' ID.
RequestFailedException exceptions should also be caught as they indicate the request failed completely and should also be retried.
// Implement exponential backoff
do
{
 try
 {
 attempts++;
 result = await searchClient.IndexDocumentsAsync(batch).ConfigureAwait(false);
 var failedDocuments = result.Results.Where(r => r.Succeeded != true).ToList();
 // handle partial failure
 if (failedDocuments.Count > 0)
 {
 if (attempts == maxRetryAttempts)
 {
 Console.WriteLine("[MAX RETRIES HIT] - Giving up on the batch starting at {0}", id);
 break;
 }
 else
 {
 Console.WriteLine("[Batch starting at doc {0} had partial failure]", id);
 Console.WriteLine("[Retrying {0} failed documents] \n", failedDocuments.Count);
 // creating a batch of failed documents to retry
 var failedDocumentKeys = failedDocuments.Select(doc => doc.Key).ToList();
 hotels = hotels.Where(h => failedDocumentKeys.Contains(h.HotelId)).ToList();
 batch = IndexDocumentsBatch.Upload(hotels);
 Task.Delay(delay).Wait();
 delay = delay * 2;
 continue;
 }
 }
 return result;
 }
 catch (RequestFailedException ex)
 {
 Console.WriteLine("[Batch starting at doc {0} failed]", id);
 Console.WriteLine("[Retrying entire batch] \n");
 if (attempts == maxRetryAttempts)
 {
 Console.WriteLine("[MAX RETRIES HIT] - Giving up on the batch starting at {0}", id);
 break;
 }
 Task.Delay(delay).Wait();
 delay = delay * 2;
 }
} while (true);
From here, we wrap the exponential backoff code into a function so it can be easily called.
Another function is then created to manage the active threads. For simplicity, that function isn't included here but can be found in ExponentialBackoff.cs. The function can be called with the following command where hotels is the data we want to upload, 1000 is the batch size, and 8 is the number of concurrent threads:
await ExponentialBackoff.IndexData(indexClient, hotels, 1000, 8);
When you run the function, you should see an output like below:
Output of index data function
When a batch of documents fails, an error is printed out indicating the failure and that the batch is being retried:
[Batch starting at doc 6000 had partial failure]
[Retrying 560 failed documents]
After the function is finished running, you can verify that all of the documents were added to the index.
6 - Explore index
You can explore the populated search index after the program has run programmatically or using the Search explorer in the portal.
Programatically
There are two main options for checking the number of documents in an index: the Count Documents API and the Get Index Statistics API. Both paths require time to process so don't be alarmed if the number of documents returned is initially lower than you expect.
Count Documents
The Count Documents operation retrieves a count of the number of documents in a search index:
long indexDocCount = await searchClient.GetDocumentCountAsync();
Get Index Statistics
The Get Index Statistics operation returns a document count for the current index, plus storage usage. Index statistics will take longer than document count to update.
var indexStats = await indexClient.GetIndexStatisticsAsync(indexName);
Azure portal
In Azure portal, from the left navigation pane, and find the optimize-indexing index in the Indexes list.
List of Azure AI Search indexes
The Document Count and Storage Size are based on Get Index Statistics API and can take several minutes to update.
Reset and rerun
In the early experimental stages of development, the most practical approach for design iteration is to delete the objects from Azure AI Search and allow your code to rebuild them. Resource names are unique. Deleting an object lets you recreate it using the same name.
The sample code for this tutorial checks for existing indexes and deletes them so that you can rerun your code.
You can also use the portal to delete indexes.
Clean up resources
When you're working in your own subscription, at the end of a project, it's a good idea to remove the resources that you no longer need. Resources left running can