Dataset Viewer
Auto-converted to Parquet
text
string
No. 24; Updated March 2011 Click here to download and print a PDF version of this document. Parents are usually the first to recognize that their child has a problem with emotions or behavior. Still, the decision to seek professional help can be difficult and painful for a parent. The first step is to gently try to talk to the child. An honest open talk about feelings can often help. Parents may choose to consult with the child's physicians, teachers, members of the clergy, or other adults who know the child well. These steps may resolve the problems for the child and family. Following are a few signs which may indicate that a child and adolescent psychiatric evaluation will be useful. - Marked fall in school performance - Poor grades in school despite trying very hard - Severe worry or anxiety, as shown by regular refusal to go to school, go to sleep or take part in activities that are normal for the child's age - Frequent physical complaints - Hyperactivity; fidgeting; constant movement beyond regular playing with or without difficulty paying attention - Persistent nightmares - Persistent disobedience or aggression (longer than 6 months) and provocative opposition to authority figures - Frequent, unexplainable temper tantrums - Threatens to harm or kill oneself - Marked decline in school performance - Inability to cope with problems and daily activities - Marked changes in sleeping and/or eating habits - Extreme difficulties in concentrating that get in the way at school or at home - Sexual acting out - Depression shown by sustained, prolonged negative mood and attitude, often accompanied by poor appetite, difficulty sleeping or thoughts of death - Severe mood swings - Strong worries or anxieties that get in the way of daily life, such as at school or socializing - Repeated use of alcohol and/or drugs - Intense fear of becoming obese with no relationship to actual body weight, excessive dieting, throwing up or using laxatives to loose weight - Persistent nightmares - Threats of self-harm or harm to others - Self-injury or self destructive behavior - Frequent outbursts of anger, aggression - Repeated threats to run away - Aggressive or non-aggressive consistent violation of rights of others; opposition to authority, truancy, thefts, or vandalism - Strange thoughts, beliefs, feelings, or unusual behaviors See other Facts for Families: #25 Where to Seek Help for Your Child #52 Comprehensive Psychiatric Evaluation #57 Normal Adolescent Development, Middle School, and Early High School Years #58 Normal Adolescent Development, Late High School Year and Beyond #00 Definition of a Child and Adolescent Psychiatrist The American Academy of Child and Adolescent Psychiatry (AACAP) represents over 8,500 child and adolescent psychiatrists who are physicians with at least five years of additional training beyond medical school in general (adult) and child and adolescent psychiatry. Facts for Families© information sheets are developed, owned and distributed by AACAP. Hard copies of Facts sheets may be reproduced for personal or educational use without written permission, but cannot be included in material presented for sale or profit. All Facts can be viewed and printed from the AACAP website (www.aacap.org). Facts sheets may not be reproduced, duplicated or posted on any other website without written consent from AACAP. Organizations are permitted to create links to AACAP's website and specific Facts sheets. For all questions please contact the AACAP Communications & Marketing Coordinator, ext. 154. If you need immediate assistance, please dial 911. Copyright © 2012 by the American Academy of Child and Adolescent Psychiatry.
/** \file "main/compile.cc" Converts HAC source code to an object file (pre-unrolled). This file was born from "art++2obj.cc" in earlier revision history. $Id: compile.cc,v 1.25 2010/08/05 18:25:31 fang Exp $ */ #define ENABLE_STACKTRACE 0 #include <iostream> #include <list> #include <string> #include <map> #include <cstdio> #include "common/config.hh" #include "main/compile.hh" #include "main/main_funcs.hh" #include "main/compile_options.hh" #include "main/global_options.hh" #include "lexer/file_manager.hh" #if COMPILE_USE_OPTPARSE #include "util/optparse.tcc" #endif #include "util/getopt_portable.h" #include "util/getopt_mapped.hh" #include "util/attributes.h" #include "util/stacktrace.hh" extern HAC::lexer::file_manager hackt_parse_file_manager; namespace HAC { #include "util/using_ostream.hh" using entity::module; using std::list; using std::string; using lexer::file_manager; using util::good_bool; //============================================================================= #if !COMPILE_USE_OPTPARSE /** Entry for options. */ struct compile::options_modifier_info { options_modifier op; string brief; options_modifier_info() : op(NULL), brief() { } options_modifier_info(const options_modifier o, const char* b) : op(o), brief(b) { } operator bool () const { return op; } good_bool operator () (options& o) const { NEVER_NULL(op); return (*op)(o); } }; // end struct options_modifier_info #endif //============================================================================= // class compile static initializers const char compile::name[] = "compile"; const char compile::brief_str[] = "Compiles HACKT source to object file."; #if COMPILE_USE_OPTPARSE typedef util::options_map_impl<compile_options> options_map_impl_type; typedef options_map_impl_type::opt_map_type opt_map_type; static options_map_impl_type options_map_wrapper; #else /** Options modifier map must be initialized before any registrations. */ const compile::options_modifier_map_type compile::options_modifier_map; #endif //============================================================================= static const char default_options_brief[] = "Needs description."; #if COMPILE_USE_OPTPARSE class compile::register_options_modifier { typedef options_map_impl_type::opt_entry opt_entry; typedef options_map_impl_type::opt_func modifier_type; const opt_entry& receipt; public: register_options_modifier(const string& Mode, const modifier_type COM, const string& h = default_options_brief) : receipt(options_map_wrapper.options_map[Mode] = opt_entry(COM, NULL, NULL, h)) { } register_options_modifier(const string& Mode, const modifier_type COM, const char* h) : receipt(options_map_wrapper.options_map[Mode] = opt_entry(COM, NULL, NULL, h)) { } } __ATTRIBUTE_UNUSED__ ; #else /** Options modification registration interface. */ class compile::register_options_modifier { public: register_options_modifier(const string& optname, const options_modifier om, const char* b = default_options_brief) { options_modifier_map_type& omm(const_cast<options_modifier_map_type&>( options_modifier_map)); NEVER_NULL(om); options_modifier_info& i(omm[optname]); INVARIANT(!i); i.op = om; i.brief = b; } } __ATTRIBUTE_UNUSED__; // end class register_options_modifier #endif // COMPILE_USE_OPTPARSE //============================================================================= // compile::options_modifier declarations and definitions // Texinfo documentation is below, under -f option. #if COMPILE_USE_OPTPARSE #define OPTARG const util::option_value& v, #define OPTARG_UNUSED const util::option_value&, #define OPTARG_FWD v, typedef bool optfun_return_type; #define OPTFUN_RETURN return false; #else #define OPTARG #define OPTARG_UNUSED #define OPTARG_FWD typedef good_bool optfun_return_type; #define OPTFUN_RETURN return good_bool(true); #endif using HAC::parser::parse_options; //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if COMPILE_USE_OPTPARSE #define SET_OPT(t,m,v) \ options_map_impl_type::set_member_constant<t, &compile_options::m, v> #define SET_OPT2(t1,m1,t2,m2,v) \ options_map_impl_type::set_member_member_constant< \ t1, t2, &compile_options::m1, &t1::m2, v> #define SET_BOOL_OPT(m,v) SET_OPT(bool, m, v) #define SET_BOOL_OPT2(t1,m1,t2,m2,v) SET_OPT2(t1, m1, bool, m2, v) #define SET_PARSE_OPT2(t2,m2,v) \ SET_OPT2(parse_options, parse_opts, t2, m2, v) #endif //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if COMPILE_USE_OPTPARSE #define DEFINE_OPTION(type, mem, key, val, str) \ static const compile::register_options_modifier \ compile_opt_mod_ ## mem(key, &SET_OPT(type, mem, val), str); #define DEFINE_BOOL_OPTION(mem, key, val, str) \ DEFINE_OPTION(bool, mem, key, val, str) #define DEFINE_OPTION2(type1, mem1, type2, mem2, key, val, str) \ static const compile::register_options_modifier \ compile_opt_mod_ ## mem2 ## _ ## val(key, \ &SET_OPT2(type1, mem1, type2, mem2, val), str); #define DEFINE_PARSE_OPTION2(type2, mem2, key, val, str) \ DEFINE_OPTION2(parse_options, parse_opts, \ type2, mem2, key, val, str) #define DEFINE_CREATE_OPTION2(type2, mem2, key, val, str) \ DEFINE_OPTION2(create_options, create_opts, \ type2, mem2, key, val, str) #endif //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if COMPILE_USE_OPTPARSE #define DEFINE_BOOL_OPTION_PAIR(mem, key, truestr, falsestr) \ static const compile::register_options_modifier \ compile_opt_mod_ ## mem(key, &SET_BOOL_OPT(mem, true), truestr), \ compile_opt_mod_no_## mem("no-" key, &SET_BOOL_OPT(mem, false), \ falsestr); #define DEFINE_BOOL_PARSE_OPTION_PAIR(mem, key, truestr, falsestr) \ DEFINE_PARSE_OPTION2(bool, mem, key, true, truestr) \ DEFINE_PARSE_OPTION2(bool, mem, "no-" key, false, falsestr) #else #define DEFINE_BOOL_OPTION_PAIR(mem, key, truestr, falsestr) \ static \ optfun_return_type \ __compile_ ## mem(OPTARG_UNUSED compile::options& cf) { \ cf.mem = true; \ OPTFUN_RETURN \ } \ static \ optfun_return_type \ __compile_no_ ## mem(OPTARG_UNUSED compile::options& cf) { \ cf.mem = false; \ OPTFUN_RETURN \ } \ static const compile::register_options_modifier \ compile_opt_mod_ ## mem(key, &__compile_ ## mem, truestr), \ compile_opt_mod_no_## mem("no-" key, &__compile_no_ ## mem, falsestr); #endif //----------------------------------------------------------------------------- DEFINE_BOOL_OPTION_PAIR(dump_include_paths, "dump-include-paths", "dumps -I include paths as they are processed", "suppress feedback of -I include paths") //----------------------------------------------------------------------------- DEFINE_BOOL_OPTION_PAIR(dump_object_header, "dump-object-header", "dumps persistent object header before saving", "suppress persistent object header dump") //----------------------------------------------------------------------------- // dialect flags // texinfo documentation is below under option-f DEFINE_PARSE_OPTION2(bool, export_all, "export-all", true, "treat all definitions as exported") DEFINE_PARSE_OPTION2(bool, export_all, "export-strict", false, "only export definitions that are marked as such (default, ACT)") //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // the following are create-phase options forwarded to the create phase DEFINE_CREATE_OPTION2(canonicalize_policy, canonicalize_mode, "canonical-shortest-hier", SHORTEST_HIER_NO_LENGTH, "prefer aliases by number of hierarchy levels only (default)") DEFINE_CREATE_OPTION2(canonicalize_policy, canonicalize_mode, "canonical-shortest-length", SHORTEST_HIER_MIN_LENGTH, "prefer aliases using overall length as tie-breaker") DEFINE_CREATE_OPTION2(canonicalize_policy, canonicalize_mode, "canonical-shortest-stage", SHORTEST_EMULATE_ACT, "prefer aliases using per-member length as tie-breaker (ACT, unimplemented)") //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DEFINE_BOOL_PARSE_OPTION_PAIR(namespace_instances, "namespace-instances", "allow instance management outside global namespace (default)", "forbid instance management outside global namespace (ACT)") //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DEFINE_BOOL_PARSE_OPTION_PAIR(array_internal_nodes, "array-internal-nodes", "allow implicit arrays of internal nodes in PRS (default)", "reject implicit arrays of internal nodes in PRS (ACT)") //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #if COMPILE_USE_OPTPARSE template <error_policy parse_options::*mem> static bool __set_policy_member(const util::option_value& opt, compile_options& c_opt) { const size_t s = opt.values.size(); if (s >= 1) { if (s > 1) { cerr << "Warning: extra arguments passed to \'" << opt.key << "\' option ignored." << endl; } const string& p(opt.values.front()); if (p == "ignore") { c_opt.parse_opts.*mem = OPTION_IGNORE; } else if (p == "warn") { c_opt.parse_opts.*mem = OPTION_WARN; } else if (p == "error") { c_opt.parse_opts.*mem = OPTION_ERROR; } else { cerr << "Error: error policy values for option " << opt.key << " are [ignore|warn|error]." << endl; return true; } } return false; } static const compile::register_options_modifier __compile_om_case_collision("case-collision", &__set_policy_member<&parse_options::case_collision_policy>, "handle case-insensitive collisions (= ignore|[warn]|error)"); #else static good_bool __compile_case_collision_ignore(compile::options& o) { o.parse_opts.case_collision_policy = OPTION_IGNORE; return good_bool(true); } static good_bool __compile_case_collision_warn(compile::options& o) { o.parse_opts.case_collision_policy = OPTION_WARN; return good_bool(true); } static good_bool __compile_case_collision_error(compile::options& o) { o.parse_opts.case_collision_policy = OPTION_ERROR; return good_bool(true); } // TODO: actually parse the policy argument using optparse() static const compile::register_options_modifier __compile_om_case_collision_ignore("case-collision=ignore", &__compile_case_collision_ignore, "ignore case-insensitive collisions"), __compile_om_case_collision_warn("case-collision=warn", &__compile_case_collision_warn, "warn about case-insensitive collisions (default)"), __compile_om_case_collision_error("case-collision=error", &__compile_case_collision_error, "reject case-insensitive collisions"); #endif // COMPILE_USE_OPTPARSE //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static const compile::register_options_modifier __compile_om_unknown_spec("unknown-spec", &__set_policy_member<&parse_options::unknown_spec_policy>, "handle unknown spec directives (= ignore|warn|[error])"); //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - static optfun_return_type __compile_ACT(OPTARG_UNUSED compile::options& o) { #if COMPILE_USE_OPTPARSE o.parse_opts.export_all = false; o.parse_opts.namespace_instances = false; o.parse_opts.array_internal_nodes = false; #else __compile_export_strict(o); __compile_no_namespace_instances(o); __compile_no_array_internal_nodes(o); #endif OPTFUN_RETURN } static const compile::register_options_modifier __compile_om_ACT("ACT", &__compile_ACT, "preset: all ACT-mode flags maximum compatibility"); //============================================================================= // class compile method definitions compile::compile() { } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /** The main program for compiling source to object. Also parses options and sets flags. \return negative number for non-error 'exit-now' status, 0 for success, positive number for other error. TODO: is there a way to return the number of arguments parsed, or just optind? */ int compile::make_module(int argc, char* argv[], options& opt, count_ptr<module>& ret) { STACKTRACE_VERBOSE; if (parse_command_options(argc, argv, opt)) { usage(); return 1; } argv += optind; // shift argc -= optind; const int max_args = opt.use_stdin ? 1 : 2; const int target_ind = max_args -1; if (argc > max_args || argc <= 0) { usage(); return 1; } if (!opt.use_stdin) { opt.source_file = argv[0]; // or use util::memory::excl_ptr<FILE, fclose_tag> FILE* f = open_source_file(opt.source_file.c_str()); if (!f) return 1; fclose(f); } // dependency generation setup if (!opt.have_target()) { // if not already named by -o, use next non-option argument if (argc >= max_args) { opt.target_object = argv[target_ind]; } else { // default: append 'o' to get object file name // problem: doesn't automatically strip srcdir // opt.target_object = opt.source_file + 'o'; } } // else ignore argv[1], use whatever was set before // have target by now if (opt.have_target()) { if (!check_file_writeable(opt.target_object.c_str()).good) return 1; } // parse it ret = parse_and_check( opt.use_stdin ? NULL : opt.source_file.c_str(), opt); if (!ret) { return 1; } return 0; } //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int compile::main(const int argc, char* argv[], const global_options&) { options opt; count_ptr<module> mod; const int err = make_module(argc, argv, opt, mod); if (err < 0) { return 1; } else if (err > 0) { return err; } if (!mod) { return 1; } // if (argc -optind >= 2) if (opt.have_target()) { // save_module(*mod, opt.target_object); // save_module_debug(*mod, opt.target_object); save_module_debug(*mod, opt.target_object.c_str(), opt.dump_object_header); } if (opt.dump_module) mod->dump(cerr); return 0; } //----------------------------------------------------------------------------- /** \return 0 if is ok to continue, anything else will signal early termination, an error will cause exit(1). Set global variable optind to the number of initial tokens to skip (default = 1). NOTE: the getopt option string begins with '+' to enforce POSIXLY correct termination at the first non-option argument. */ int compile::parse_command_options(const int argc, char* argv[], options& opt) { STACKTRACE_VERBOSE; static const char* optstring = "+df:hi:I:M:o:pv"; int c; while ((c = getopt(argc, argv, optstring)) != -1) { switch (c) { /*** @texinfo compile/option-d.texi @defopt -d Produces text dump of compiled module, like @command{hacobjdump} in @ref{Objdump}. @end defopt @end texinfo ***/ case 'd': opt.dump_module = true; break; // TODO: summarize ACT-compatibility in form of a table /*** @texinfo compile/option-f.texi @defopt -f optname general compile flags (repeatable) where @var{optname} is one of the following: @itemize @item @option{dump-include-paths}: dumps @option{-I} include paths as they are processed @item @option{dump-object-header}: (diagnostic) dumps persistent object header before saving @item @option{no-dump-include-paths}: suppress feedback of @option{-I} include paths @item @option{no-dump-object-header}: suppress persistent object header dump @item @option{case-collision=[ignore|warn|error]}: Set the error handling policy for case-insensitive collisions. @itemize @item @option{ignore} skips the check altogether @item @option{warn} issues a warning but continues @item @option{error} rejects and aborts compiling @end itemize @item @option{unknown-spec=[ignore|warn|error]}: Sets the error handling policy for unknown spec directives. @end itemize Dialect flags (for ACT-compatibility): @itemize @item @option{export-all}: Treat all definitions as exported, i.e. no export checking. @item @option{export-strict}: Check that definitions are exported for use outside their respective home namespaces (default, ACT). @item @option{namespace-instances} Allow instance management outside global namespace (default). Negatable with @t{no-} prefixed. ACT mode: @option{no-namespace-instances}. @item @option{array-internal-nodes} Allow implicit arrays of internal nodes in PRS (default). Negatable with @t{no-} prefixed. ACT mode: @option{no-array-internal-nodes}. @end itemize @option{ACT} is a preset that activates all ACT-mode flags for compatibility. The following options are forwarded to the create-phase of compilation by the driver. That is, they do not have any affect until the create phase. These options must be specified up-front at compile-time and cannot be overriden at create-time on the command line. @itemize @item @option{canonical-shortest-hier}: Only consider hierarchical depth (number of member-dots) for choosing canonical alias, no further tiebreaker. @item @option{canonical-shortest-length}: In addition to minimizing the hierarchy depth, also use overall string length as a tiebreaker. @item @option{canonical-shortest-stage}: (unimplemented) Considers length of identifiers stage-by-stage when hierarchical depths are equal. This is for best compatibility with ACT mode. @end itemize @end defopt @end texinfo ***/ case 'f': { #if COMPILE_USE_OPTPARSE typedef opt_map_type::const_iterator const_iterator; const opt_map_type& options_modifier_map(options_map_wrapper.options_map); const util::option_value ov(util::optparse(optarg)); const const_iterator mi(options_modifier_map.find(ov.key)); #else typedef options_modifier_map_type::mapped_type mapped_type; typedef options_modifier_map_type::const_iterator const_iterator; const const_iterator mi(options_modifier_map.find(optarg)); #endif if (mi == options_modifier_map.end() #if !COMPILE_USE_OPTPARSE || !mi->second #endif ) { cerr << "Invalid option argument: " << optarg << endl; return 1; } #if COMPILE_USE_OPTPARSE else if ((mi->second.func)(ov, opt)) #else else if (!((mi->second)(opt).good)) #endif { return 1; } break; } /*** @texinfo compile/option-h.texi @defopt -h Show usage and exit. @end defopt @end texinfo ***/ case 'h': // return 1; usage(); exit(0); break; /*** @texinfo compile/option-I-upper.texi @defopt -I path Adds include path @var{path} for importing other source files (repeatable). @end defopt @end texinfo ***/ case 'I': // no need to check validity of paths yet opt.include_paths.push_back(optarg); break; /*** @texinfo compile/option-i.texi @defopt -i file Import @var{file}(s) before processing the main top-level file (repeatable). All @option{-I} search paths take effect before any of these files are imported. @end defopt @end texinfo ***/ case 'i': // no need to check validity of paths yet opt.prepend_files.push_back(optarg); break; /*** @texinfo compile/option-M-upper.texi @defopt -M depfile Emit import dependencies in file @var{depfile} as a side-effect. Useful for automatic dynamic dependency-tracking in Makefiles. @end defopt @end texinfo ***/ case 'M': opt.make_depend = true; opt.make_depend_target = optarg; break; /*** @texinfo compile/option-o.texi @defopt -o objfile Names @var{objfile} as the output object file to save. This is an alternative to naming the object file as the second non-option argument. @end defopt @end texinfo ***/ case 'o': opt.target_object = optarg; break; /*** @texinfo compile/option-p.texi @defopt -p Expect input to be piped from stdin rather than a named file. Since the name of the input file is omitted in this case, the only non-option argument (if any) is interpreted as the name of the output object file. @end defopt @end texinfo ***/ case 'p': opt.use_stdin = true; break; /*** @texinfo compile/option-v.texi @defopt -v Show version and build information and exit. @end defopt @end texinfo ***/ case 'v': config::dump_all(cout); exit(0); break; case ':': cerr << "Expected but missing non-option argument." << endl; return 1; case '?': util::unknown_option(cerr, optopt); return 1; default: abort(); } // end switch } // end while /*** Now would be a good time to add include paths to the parser's file manager. Don't use a global file_manager, use local variables and pass as arguments, to allow these main subprograms to be re-entrant. Q: Should file_manager be a member of module? Caution: calling this function multiple times with the same options object will accumulate duplicate paths. ***/ opt.export_include_paths(hackt_parse_file_manager); return 0; } //----------------------------------------------------------------------------- /** Prints summary of options and arguments. */ void compile::usage(void) { cerr << "compile: compiles input file to module object file" << endl; cerr << "usage: compile [options] <hackt-source-file> [hackt-obj-file]" << endl; cerr << "options:" << endl; cerr << " -d: produces text dump of compiled module" << endl << " -f <opt> : general compile flags (repeatable)" << endl; { #if COMPILE_USE_OPTPARSE options_map_wrapper.help(cerr, false, false); #else typedef options_modifier_map_type::const_iterator const_iterator; const_iterator i(options_modifier_map.begin()); const const_iterator e(options_modifier_map.end()); for ( ; i!=e; ++i) { cerr << " " << i->first << ": " << i->second.brief << endl; } #endif } cerr << " -h: gives this usage message and exits" << endl << " -I <path> : adds include path (repeatable)" << endl << " -i <file> : prepends import file (repeatable)" << endl; cerr << " -M <dependfile> : produces make dependency to file" << endl; cerr << " -o <objfile> : option to name output object file" << endl; cerr << " -p : pipe in source from stdin" << endl; cerr << " -v : print version information and exit" << endl; cerr << "If no output object file is given, compiled module will not be saved." << endl; } //============================================================================= } // end namespace HAC
Previous abstract Next abstract Session 40 - The Interstellar Medium. Display session, Tuesday, June 09 Gamma Ray Burst (GRB) explosions can make kpc-size shells and holes in the interstellar media (ISM) of spiral galaxies if much of the energy heats the local gas to above 10^7 K. Disk blowout is probably the major cause for energy loss in this case, but the momentum acquired during the pressurized expansion phase can be large enough that the bubble still snowplows to a kpc diameter. This differs from the standard model for the origin of such shells by multiple supernovae, which may have problems with radiative cooling, evaporative losses, and disk blow-out. Evidence for giant shells with energies of \sim10^53 ergs are summarized. Some contain no obvious central star clusters and may be GRB remnants, although sufficiently old clusters would be hard to detect. The expected frequency of GRBs in normal galaxies can account for the number of such shells. Program listing for Tuesday
Books  Palaeontology  Palaeozoology & Extinctions  Popular Science By: WJT Mitchell(Author) 321 pages, Col and b/w photos, col and b/w illus University of Chicago Press Hardback | Oct 1998 | #84743 | ISBN: 0226532046 Availability: Usually dispatched within 4 days Details NHBS Price: £24.50 $32/€27 approx About this book For animals that have been dead millions of years, dinosaurs are extraordinarily pervasive in our everyday lives. Appearing in ads, books, movies, museums, television, toy stores, and novels, they continually fascinate both adults and children. How did they move from natural extinction to pop culture resurrection? What is the source of their powerful appeal? Until now, no one has addressed this question in a comprehensive way. In this lively and engrossing exploration of the animal's place in our lives, W.J.T. Mitchell shows why we are so attached to the myth and the reality of the "terrible lizards." Mitchell aims to trace the cultural family tree of the dinosaur, and what he discovers is a creature of striking flexibility, linked to dragons and mammoths, skyscrapers and steam engines, cowboys and Indians. In the vast territory between the cunning predators of Jurassic Park and the mawkishly sweet Barney, from political leviathans to corporate icons, from paleontology to Barnum and Bailey, Mitchell finds a cultural symbol whose plurality of meaning and often contradictory nature is emblematic of modern society itself. As a scientific entity, the dinosaur endured a near-eclipse for over a century, but as an image it is enjoying its widest circulation. And it endures, according to Mitchell, because it is uniquely malleable, a figure of both innovation and obsolescence, massive power and pathetic failure – the totem animal of modernity. Drawing unforeseen and unusual connections at every turn between dinosaurs real and imagined, The Last Dinosaur Book is the first to delve so deeply, so insightfully, and so enjoyably into our modern dino-obsession. ""[...] brilliant and truly original. It is the first serious attempt by a cultural historian to understand the extraordinarily strong hold that dinosaurs have taken on the imagination of whole sections of the population, not just children. Mitchell has wonderfully mastered the field of dinosaurs, from systematics to science fiction, and the delight of the book is in the interpretations." - Keith Thomson, Director, Oxford University Museum of Natural History 1: Reptilicus erectus 2: Big, Fierce, Extinct 3: A Stegosaurus Made of Money 4: The End of Dinosaurology 5: The Last Thunder Horse West of the Mississippi 6: Dinotopia: The Newt World Order 7: The Last Dinostory: As Told by Himself 8: Seeing Saurians 9: Sorting Species 10: Monsters and Dinomania 11: Big MacDino 12: The Totem Animal of Modernity 13: The Way of Dragons 14: Dry Bones 15: On the Evolution of Images 16: Thomas Jefferson, Paleontologist 17: Frames, Skeletons, Constitutions 18: The Victorian Dinosaur 19: Coming to America 20: Bones for Darwin's Bulldog 21: Schizosaur 22: Dinosaurs Moralized 23: Pale-Ontology, or It's Not Easy Being Green 24: Potlatch and Purity 25: Diplodocus carnegii 26: Totems and Bones 27: Indiana Jones and Barnum Bones 28: Worlds Well Lost 29: Bringing Down Baby 30: Miner's Canary or Trojan Horse? 31: The Age of Reptiles 32: The Hundred Story Beast 33: Structure, Energy, Information 34: Catastrophe, Entropy, Chaos 35: The Age of Biocybernetic Reproduction 36: Carnosaurs and Consumption 37: Why Children Hate Dinosaurs 38: Dinos R Us: Identification and Fantasy 39: Calvinosaurus: From T. rex to O. Rex 40: Transitional Objects: From Breast to Brontosaurus Paleoart 265 A: Scrotum Humanum: The True Name of the Dinosaur B: Science and Culture Selected Bibliography Write a review Bestsellers in this subject Extinct Birds Avian Evolution NHBS Price: £64.99 $84/€71 approx Discovering the Mammoth NHBS Price: £21.99 $28/€24 approx The Princeton Field Guide to Dinosaurs Pterosaurs: Natural History, Evolution, Anatomy NHBS Price: £27.95 $36/€31 approx VAT: GB 407 4846 44 NHBS Ltd is registered in England and Wales: 1875194
#ifndef CLI_DEV_PCB_H #define CLI_DEV_PCB_H #include <stdio.h> #include <sstream> #include "command/param_comple/behavior_base.h" namespace clidevt { class FileListBehavior : public ParameterBehavior { class SpecialCharEscaper { public: std::string operator()(std::string str) { std::string ret; std::string::iterator ite = str.begin(); for(; ite != str.end(); ++ite) { switch(*ite) { case ' ': ret += "\\ "; break; case '\\': ret += "\\\\"; break; case '|': ret += "\\|"; break; case '<': ret += "\\<"; break; case '>': ret += "\\>"; break; case '\"': ret += "\\\""; break; case '\'': ret += "\\\'"; break; default: ret += *ite; break; } } return ret; } }; public: enum CandidateType { DIRECTORY = 1, EXECUTABLE = 2, NON_EXECUTABLE = 4, SYMBOLIC_LINK = 8, ALL = 15 }; FileListBehavior() : candidateType_(ALL) {} virtual ~FileListBehavior() {} void setCandidatesType(int type) { candidateType_ = type; } virtual void getParamCandidates(std::vector<std::string>& inputtedList, std::string inputting, std::vector<std::string>& candidates) const; virtual void afterCompletionHook(std::vector<std::string>& candidates) const { stripParentPath(candidates); } virtual void stripParentPath(std::vector<std::string>& candidates) const; virtual void stripFile(std::vector<std::string>& candidates) const; private: int candidateType_; }; } #endif /* end of include guard */
A land whose rich cultural heritage is discovered not only from within the walls of numerous museums, galleries and churches, many of which today, as zero category monuments are included in a part of the UNESCO World Heritage List, but also in that magical place on the Mediterranean, where even the shortest stroll becomes a journey down a staircase thousands of years old, which takes one through a history that is at the same time turbulent, exciting and glorious. With as many as seven cultural phenomena- The Festivity of Saint Blaise, lace-making in Lepoglava, Hvar and Pag, the bell ringers from the Kastav region, the Hvar Procession Za Križem, (‘following the Cross’), two-part singing in the Istrian scale, in Istria and Hrvatsko Primorje, the spring procession of ‘Ljelje’ and traditional manufacture of wooden toys in the Hrvatsko zagorje region, Croatia is among the countries with the most protected intangible cultural heritage elements, recorded on the UNESCO List. The famous scientist Nikola Tesla (1856-1943), inventor of alternating current. Was born in Smiljan, Croatia, died in New York, USA. Dog breed Dalmatian originates from these areas? In a small Franciscan monastery in Zaostrog, there is a painting from 1724 which for the first time depicts a Dalmatian dog… Slavoljub Eduard Penkala In 1906, a Croat Slavoljub Eduard Penkala for the first time applied for a patent for a ballpoint (penkala) and a holder for a fountain pen. From time immemorial, the tie has been a part of the Croatian national costume, which was preserved by the Croats to the more recent times, who moved to central Europe in the 16th century. It was later taken over by the Croatian soldiers who were fighting in Europe, and a part of their uniform was assumed by the French in the 17th century. Under the leadership of the French „God of Sun" Louis XIV there was a horsemen unit, the so-called Royal cravate, who wore mostly red collar ribbons. The custom of wearing ribbons from the Croats dates back to this time, which was later expanded around Europe and the world, and today is inevitably the most important detail in men's fashion, and also an original Croatian souvenir. The word «kravata» (tie) originates from the word «Kroate»... The world traveler and explorer Marco Polo was born in 1254, most probably on the island of Korčula. Even today, there are people living on the island with the same last name.. Island of Vrnik is situated in the archipelago of the Pelješac canal in front of the east coast of Korčula island, widely known for its stone-pit of quality lime-stone (marble) from which Aia Sofia (Istanbul) and the While House (Washington) were partly built as were some palaces-town halls in Dubrovnik, Stockholm, Venice, Vienna. Visit to the fertile plains of Baranja where the grapes have been cultivated for centuries, is not complete if you do not taste the "golden drops" of Baranja's vineyards. According to the old manuscripts, vine was a usual drink at the royal court of Maria Teresa, and the ancient Romans, delighted with its bouquet and with the sun rises and sunsets of that region, called it the "Golden hill"... There is a Ulysses' cave on the island of Mljet. It was named after a story which says that a famous adventurer stranded on the nearby cliff Ogiron, where he met the nymph Calypso with whom he fell in love, and spent unforgettable moments in her company... Red-white coat of arms Recognizable all over the world, and related only to Croats - characteristic cube-shaped red-white coat of arms which is believed to originate from the Persian original homeland of Croats (red signifies south and white signifies north). That is where the name for two Croatias derives from, i.e. White in north and Red in south. When the Croats have selected Ferdinand Habsburg to be their King in Cetine in 1527, they confirmed that choice with some seals, and one of them was Croatian coat of arms, but with 64 fields, i.e. the complete chess-board. That is where the popular term „šahovnica" derives from, and Šah (chess) in Persian means the Ruler - Tsar. Did you know that there is a world rarity in the Archeological museum in Zagreb? Of course, we are talking about the Zagreb mummy. Nesi-hensu, the wife of Aher-hensu, „the divine tailor" from Thebes, is the name of a mummified woman who was wrapped in cut ribbons of Zagreb linen book which represents the longest preserved text in Etruscan language and the only preserved sample of linen book in the entire Ancient world. Top seven world getaways The American magazine "In Style" has included Croatia on its list of seven top world destinations ("Top seven world getaways"). The article authors recommend a visit to Croatia for its very rich historical-cultural heritage, natural beauties and clean sea. In addition to Croatia, the list of top seven places includes Kenya, South Africa, London, Greek island Santorini and three American destinations - Aspen, Napa Valley and Nantucket. Every day, for over hundred and ten years, the cannon fires from the top of tower Lotrščak exactly at noon in memory of an event from Zagreb history. According to the legend, exactly at noon, the Grič canon fired a discharge from Lotrščak to the Turkish camp located across Sava and blew out a rooster (or a turkey) which the cook was taking to Pasha on a platter. After this event, the Turks scattered and did not attack Zagreb...
Nuclear Energy in France Nuclear energy is the cornerstone of french energy policy. In the ‘70s France chose to develop nuclear as its base load electricity source as a response to the oil crisis and assure its energy independence. Nuclear Electricity Production: France currently counts 58 commercial nuclear reactors in operation responsible for producing 80% of French domestic electricity. As a comparison, the 104 US reactors produces 20% of US electricity.Despite scarce natural resources, France has reached an energy independence of 50% thanks to its strategic choice for nuclear energy. Environment: As well as providing safe and reliable energy, nuclear helps to reduce French greenhouse gas emissions by avoiding the release of 31 billions tones of carbon dioxide (contrary to coal or gas generation) and making France the less carbon emitting country within the OECD. As a leader in nuclear energy, France has developed clean technology for radioactive waste disposal. Reprocessing currently allows France to recover valuable elements from spent fuels and permit a significant reduction of high level waste and lead to safer and optimized containment, for final radioactive waste disposition. French nuclear power plants produces only 10 g/year/inhabitant of highly radioactive waste. International Cooperation and research: France is one of the forerunner in nuclear research and participates in numerous international cooperation programs alongside the United States such as the development of the next generation of nuclear power plants (Gen IV) and the International Thermonuclear Experimental Reactor (ITER) that will be built in Cadarache, South of France. The French Atomic Energy Commission (CEA) The French Atomic Energy Commission is a public body established in October 1945 by General de Gaulle. It constitutes a power of expertise and proposition for the authorities. A leader in research, development and innovation, the CEA is involved in three main fields: It develops and acquires the technological building blocks necessary to the development of the nuclear reactors of the future (Contribution to Generation IV and GNEP research), It contributes to reducing greenhouse gas emission with its research on hydrogen, fuel cells, biomass, energy storage…, It supports the nuclear utilities in France by optimizing the nuclear power plants of the French nuclear fleet and by optimizing the fuel cycle, It offers safe and economically viable technical solutions for managing nuclear waste, It conducts fundamental research in climate and environmental sciences, high energy physics, astrophysics, fusion, nanosciences… Information and Health technologies: It tackles micro and nano-technologies for telecommunication and nuclear medicine for radiotherapy and medical imaging, It researches programs on biotechnology, molecular labelling, biomolecular engineering and structural biology, It shares its knowledge and know-how through education and training through the National Institute for Nuclear Sciences and Technologies (INSTN), It manages over 300 priority patents and is active in the creation of clusters. Defense and National Security: It conceives, builds, maintains then dismantles the nuclear warhead of the French deterrence force, It helps to fight against nuclear, biological and chemical weapons (NRBC program). The missions of the CEA are similar to the Department of Energy in the United States. The CEA has a network of counselor or representatives in French Embassies around the world (see joint map). The French Nuclear Safety Authority (ASN) Created in 2006, from the former DSIN (Directorate for the Safety of Nuclear Facilities), the French Nuclear Safety Authority is an independent administrative authority which is tasked with regulating nuclear safety and radiation protection in order to protect workers, patients, the public and the environment from the risks involved in nuclear activities. It also contributes to informing the public. Like the Nuclear Regulatory Commission in the United States, it carries out inspections and may pronounce sanctions, up to and including suspension of operation of an installation. French Institute for Radioprotection and Nuclear Safety (IRSN) Created in 2001 by merging the Protection and Nuclear Safety Institute (IPSN) and the Ionizing radiations Protection Office (OPRI), the Institute for Radioprotection and Nuclear Safety is a public establishment of an industrial and commercial nature placed under the joint authority of the Ministries of the Environment, Health, Industry, Research and Defense. It is the expert in safety research and specialized assessments into nuclear and radiological risk serving public authorities whose work is complementary to the ASN. Its scope of activities includes: environment and response, human radiological protection, research on the prevention of major accidents, power reactor safety, fuel cycle facility safety, research installation safety, waste management safety; nuclear defense expertise. National radioactive Waste Management Agency (ANDRA) Created in 1991, the French National Agency for Radioactive Waste Management is a public industrial and commercial organization that operates independently of waste producers. It is responsible for the long-term management of radioactive waste produced in France under the supervision of the French Ministries for Energy, Research and the Environment. It can be compared to a certain extent to the Office for Nuclear Waste of the Department of Energy in the United States. Andra also pursues industrial, research, and information activities as it designs and implements disposal solutions suited to each category of radioactive waste: the collection, conditioning, disposal of radioactive waste from small producers (hospitals, research centers, industry), specification of waste packages for disposal, disposal in suited sites, monitoring of closed disposal facilities, research programs for long-lived and high level activity waste, especially through the operation of an underground research laboratory in a deep clay formation… General Directorate for Energy and Climate (DGEC) The General Directorate for Energy and Climate represents the government and is part of the Office of the Department for Ecology and Sustainable Development. It defines the French nuclear policy. The DGEC takes care of the energy supply, the security of supply, oil refining and logistics, nuclear industry, and coal and mines. Consequently, its activities include: the design and implement energy and raw material supply policy, to ensure opening of electricity and gas markets, track key energy and raw material sectors, to oversee enterprises and public institutions in energy sector, to ensure compliance with rules and regulations governing energy sector, to participate in European and international energy projects and working groups, to provide economic, environmental, and fiscal expertise on energy matters. The Rise of Nuclear Power Generation in France.
Mexican America - Introduction "Mexican America" is a sampling of objects from the collections of the National Museum of American History. The stories behind these objects reflect the history of the Mexican presence in the United States. They illustrate a fundamentally American story about the centuries-old encounter between distinct (yet sometimes overlapping) communities that have coexisted but also clashed over land, culture, and livelihood. Who, where, and what is Mexico? Over time, the definitions and boundaries of Mexico have changed. The Aztec Empire and the area where Náhautl was spoken—today the region surrounding modern Mexico City—was known as Mexico. For 300 years, the Spanish colonizers renamed it New Spain. When Mexico was reborn in 1821 as a sovereign nation, its borders stretched from California to Guatemala. It was a huge and ancient land of ethnically, linguistically, and economically diverse regions that struggled for national unity. Texas, (then part of the Mexican state of Coahuila y Tejas) was a frontier region far from the dense cities and fertile valleys of central Mexico, a place where immigrants were recruited from the United States. The immigrants in turn declared the Mexican territory an independent republic in 1836 (later a U.S. state), making the state the first cauldron of Mexican American culture. By 1853, the government of Mexico, the weaker neighbor of an expansionist United States, had lost what are today the states of California, Nevada, Utah, Arizona, New Mexico, Texas, and parts of Colorado and Wyoming. In spite of the imposition of a new border, the historical and living presence of Spaniards, Mexicans, indigenous peoples, and their mixed descendants remained a defining force in the creation of the American West. “La América Mexicana” es una muestra conformada por objetos provenientes de las distintas colecciones del Museo Nacional de Historia Americana. Estos objetos reflejan la historia de la presencia mexicana en los Estados Unidos e ilustran una crónica fundamentalmente americana acerca del encuentro centenario entre comunidades diferentes que han coexistido, pero que también se han enfrentado, en la pugna por la tierra, la cultura y el sustento. ¿Quién, dónde y qué es México? Con el transcurso del tiempo, las definiciones y los límites de México han ido cambiando. Se conocía como México al Imperio Azteca y toda el área donde se hablaba náhuatl —actualmente la región circundante a la ciudad de México. Durante 300 años los colonizadores españoles se refirieron a ella como Nueva España. Cuando en 1821 México resurgió como una nación soberana, sus fronteras se extendían desde California a Guatemala. En ese entonces era un antiguo e inmenso territorio conformado por regiones étnica, lingüística y económicamente diversas que luchaban por adquirir unidad nacional. Texas (en ese entonces parte de los estados mexicanos de Coahuila y Tejas) era una región fronteriza lejos de las densas urbes y de los fértiles valles de México central, donde se reclutaban inmigrantes de los Estados Unidos. En el año 1836 este territorio mexicano se declaró como república independiente (y más tarde, estado de EE.UU.), convirtiéndose en el primer calderón de la cultura mexicoamericana. Hacia 1853, el gobierno de México, el vecino débil de un Estados Unidos en expansión, había perdido el territorio de los actuales estados de California, Nevada, Utah, Arizona, Nuevo México, Texas y partes de Colorado y Wyoming. A pesar de la imposición de un nuevo límite fronterizo, la presencia histórica y ocupacional de los españoles, mexicanos y pueblos indígenas, junto a sus descendientes mestizos, constituiría a lo largo del tiempo una influencia determinante para el desarrollo del Oeste Americano. "Mexican America - Introduction" showing 1 items. - This print depicts American forces attacking the fortress palace of Chapultepec on Sept. 13th, 1847. General Winfield Scott, in the lower left on a white horse, led the southern division of the U.S. Army that successfully captured Mexico City during the Mexican American War. The outcome of American victory was the loss of Mexico's northern territories, from California to New Mexico, by the terms set in the Treaty of Guadalupe Hidalgo. It should be noted that the two countries ratified different versions of the same peace treaty, with the United States ultimately eliminating provisions for honoring the land titles of its newly absorbed Mexican citizens. Despite notable opposition to the war from Americans like Abraham Lincoln, John Quincy Adams, and Henry David Thoreau, the Mexican-American War proved hugely popular. The United States' victory boosted American patriotism and the country's belief in Manifest Destiny. - This large chromolithograph was first distributed in 1848 by Nathaniel Currier of Currier and Ives, who served as the "sole agent." The lithographers, Sarony & Major of New York (1846-1857) copied it from a painting by "Walker." Unfortunately, the current location of original painting is unknown, however, when the print was made the original painting was owned by a Captain B. S. Roberts of the Mounted Rifles. The original artist has previously been attributed to William Aiken Walker as well as to Henry A. Walke. William Aiken Walker (ca 1838-1921) of Charleston did indeed do work for Currier and Ives, though not until the 1880's and he would have only have been only 10 years old when this print was copyrighted. Henry Walke (1808/9-1896) was a naval combat artist during the Mexican American War who also worked with Sarony & Major and is best known for his Naval Portfolio. - Most likely the original painting was done by James Walker (1819-1889) who created the "Battle of Chapultepec" 1857-1862 for the U.S. Capitol. This image differs from the painting commissioned for the U. S. Capitol by depicting the troops in regimented battle lines with General Scott in a more prominent position in the foreground. James Walker was living in Mexico City at the outbreak of the Mexican War and joined the American forces as an interpreter. He was attached to General Worth's staff and was present at the battles of Contreras, Churubusco, and Chapultepec. The original painting's owner, Captain Roberts was assigned General Winfield Scott to assist Walker with recreating the details of the battle of Chapultepec. When the painting was complete, Roberts purchased the painting. By 1848, James Walker had returned to New York and had a studio in New York City in the same neighborhood as the print's distributor Nathaniel Currier as well as the lithographer's Napoleon Sarony and Henry B. Major. - This popular lithograph was one of several published to visually document the war while engaging the imagination of the public. Created prior to photography, these prints were meant to inform the public, while generally eliminating the portrayal of the more gory details. Historians have been able to use at least some prints of the Mexican War for study and to corroborate with the traditional literary forms of documentation. As an eyewitness, Walker could claim accuracy of detail within the narrative in his painting. The battle is presented in the grand, historic, heroic style with the brutality of war not portrayed. The print depiction is quite large for a chromo of the period. In creating the chromolithographic interpretation of the painting, Sarony & Major used at least four large stones to produce the print "in colours," making the most of their use of color. They also defined each figure with precision by outlining each in black. This print was considered by expert/collector Harry T. Peters as one of the finest ever produced by Sarony & Major. - Currently not on view - Date made - associated date - Currier, Nathaniel - Scott, Winfield - Sarony & Major - Walker, James - ID Number - catalog number - accession number - Data Source - National Museum of American History, Kenneth E. Behring Center
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ #include <string> #include <map> #include <vector> #include "base/basictypes.h" #include "base/file_path.h" #include "base/observer_list.h" #include "base/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/google_service_auth_error.h" #include "chrome/browser/profile.h" #include "chrome/browser/sync/glue/change_processor.h" #include "chrome/browser/sync/glue/model_associator.h" #include "chrome/browser/sync/glue/sync_backend_host.h" #include "chrome/browser/sync/sync_setup_wizard.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" class CommandLine; class MessageLoop; class Profile; namespace browser_sync { class UnrecoverableErrorHandler { public: // Call this when normal operation detects that the bookmark model and the // syncer model are inconsistent, or similar. The ProfileSyncService will // try to avoid doing any work to avoid crashing or corrupting things // further, and will report an error status if queried. virtual void OnUnrecoverableError() = 0; protected: virtual ~UnrecoverableErrorHandler() { } }; } // Various UI components such as the New Tab page can be driven by observing // the ProfileSyncService through this interface. class ProfileSyncServiceObserver { public: // When one of the following events occurs, OnStateChanged() is called. // Observers should query the service to determine what happened. // - We initialized successfully. // - There was an authentication error and the user needs to reauthenticate. // - The sync servers are unavailable at this time. // - Credentials are now in flight for authentication. virtual void OnStateChanged() = 0; protected: virtual ~ProfileSyncServiceObserver() { } }; // ProfileSyncService is the layer between browser subsystems like bookmarks, // and the sync backend. class ProfileSyncService : public NotificationObserver, public browser_sync::SyncFrontend, public browser_sync::UnrecoverableErrorHandler { public: typedef ProfileSyncServiceObserver Observer; typedef browser_sync::SyncBackendHost::Status Status; enum SyncEventCodes { MIN_SYNC_EVENT_CODE = 0, // Events starting the sync service. START_FROM_NTP = 1, // Sync was started from the ad in NTP START_FROM_WRENCH = 2, // Sync was started from the Wrench menu. START_FROM_OPTIONS = 3, // Sync was started from Wrench->Options. START_FROM_BOOKMARK_MANAGER = 4, // Sync was started from Bookmark manager. // Events regarding cancelation of the signon process of sync. CANCEL_FROM_SIGNON_WITHOUT_AUTH = 10, // Cancelled before submitting // username and password. CANCEL_DURING_SIGNON = 11, // Cancelled after auth. CANCEL_DURING_SIGNON_AFTER_MERGE = 12, // Cancelled during merge. // Events resulting in the stoppage of sync service. STOP_FROM_OPTIONS = 20, // Sync was stopped from Wrench->Options. // Miscellaneous events caused by sync service. MERGE_AND_SYNC_NEEDED = 30, MAX_SYNC_EVENT_CODE }; explicit ProfileSyncService(Profile* profile); virtual ~ProfileSyncService(); // Initializes the object. This should be called every time an object of this // class is constructed. void Initialize(); // Enables/disables sync for user. virtual void EnableForUser(); virtual void DisableForUser(); // Whether sync is enabled by user or not. bool HasSyncSetupCompleted() const; void SetSyncSetupCompleted(); // NotificationObserver implementation. virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details); // SyncFrontend implementation. virtual void OnBackendInitialized(); virtual void OnSyncCycleCompleted(); virtual void OnAuthError(); // Called when a user enters credentials through UI. virtual void OnUserSubmittedAuth(const std::string& username, const std::string& password, const std::string& captcha); // Called when a user decides whether to merge and sync or abort. virtual void OnUserAcceptedMergeAndSync(); // Called when a user cancels any setup dialog (login, merge and sync, etc). virtual void OnUserCancelledDialog(); // Get various information for displaying in the user interface. browser_sync::SyncBackendHost::StatusSummary QuerySyncStatusSummary(); browser_sync::SyncBackendHost::Status QueryDetailedSyncStatus(); const GoogleServiceAuthError& GetAuthError() const { return last_auth_error_; } // Displays a dialog for the user to enter GAIA credentials and attempt // re-authentication, and returns true if it actually opened the dialog. // Returns false if a dialog is already showing, an auth attempt is in // progress, the sync system is already authenticated, or some error // occurred preventing the action. We make it the duty of ProfileSyncService // to open the dialog to easily ensure only one is ever showing. bool SetupInProgress() const { return !HasSyncSetupCompleted() && WizardIsVisible(); } bool WizardIsVisible() const { return wizard_.IsVisible(); } void ShowLoginDialog(); // Pretty-printed strings for a given StatusSummary. static std::wstring BuildSyncStatusSummaryText( const browser_sync::SyncBackendHost::StatusSummary& summary); // Returns true if the SyncBackendHost has told us it's ready to accept // changes. // TODO(timsteele): What happens if the bookmark model is loaded, a change // takes place, and the backend isn't initialized yet? bool sync_initialized() const { return backend_initialized_; } bool unrecoverable_error_detected() const { return unrecoverable_error_detected_; } bool UIShouldDepictAuthInProgress() const { return is_auth_in_progress_; } // A timestamp marking the last time the service observed a transition from // the SYNCING state to the READY state. Note that this does not reflect the // last time we polled the server to see if there were any changes; the // timestamp is only snapped when syncing takes place and we download or // upload some bookmark entity. const base::Time& last_synced_time() const { return last_synced_time_; } // Returns a user-friendly string form of last synced time (in minutes). std::wstring GetLastSyncedTimeString() const; // Returns the authenticated username of the sync user, or empty if none // exists. It will only exist if the authentication service provider (e.g // GAIA) has confirmed the username is authentic. virtual string16 GetAuthenticatedUsername() const; const std::string& last_attempted_user_email() const { return last_attempted_user_email_; } // The profile we are syncing for. Profile* profile() { return profile_; } // Adds/removes an observer. ProfileSyncService does not take ownership of // the observer. void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); // Record stats on various events. static void SyncEvent(SyncEventCodes code); // Returns whether sync is enabled. Sync can be enabled/disabled both // at compile time (e.g., on a per-OS basis) or at run time (e.g., // command-line switches). static bool IsSyncEnabled(); // UnrecoverableErrorHandler implementation. virtual void OnUnrecoverableError(); browser_sync::SyncBackendHost* backend() { return backend_.get(); } protected: // Call this after any of the subsystems being synced (the bookmark // model and the sync backend) finishes its initialization. When everything // is ready, this function will bootstrap the subsystems so that they are // initially in sync, and start forwarding changes between the two models. void StartProcessingChangesIfReady(); // Returns whether processing changes is allowed. Check this before doing // any model-modifying operations. bool ShouldPushChanges(); // Starts up the backend sync components. void StartUp(); // Shuts down the backend sync components. // |sync_disabled| indicates if syncing is being disabled or not. void Shutdown(bool sync_disabled); // Methods to register and remove preferences. void RegisterPreferences(); void ClearPreferences(); // Tests need to override this. virtual void InitializeBackend(); template <class AssociatorImpl, class ChangeProcessorImpl> void InstallGlue() { model_associator_->CreateAndRegisterPerDataTypeImpl<AssociatorImpl>(); // TODO(tim): Keep a map instead of a set so we can register/unregister // data type specific ChangeProcessors, once we have more than one. STLDeleteElements(processors()); ChangeProcessorImpl* processor = new ChangeProcessorImpl(this); change_processors_.insert(processor); processor->set_model_associator( model_associator_->GetImpl<AssociatorImpl>()); } browser_sync::ModelAssociator* associator() { return model_associator_.get(); } std::set<browser_sync::ChangeProcessor*>* processors() { return &change_processors_; } // We keep track of the last auth error observed so we can cover up the first // "expected" auth failure from observers. // TODO(timsteele): Same as expecting_first_run_auth_needed_event_. Remove // this! GoogleServiceAuthError last_auth_error_; // Cache of the last name the client attempted to authenticate. std::string last_attempted_user_email_; private: friend class ProfileSyncServiceTest; friend class ProfileSyncServiceTestHarness; friend class TestModelAssociator; FRIEND_TEST(ProfileSyncServiceTest, UnrecoverableErrorSuspendsService); // Initializes the various settings from the command line. void InitSettings(); // Whether the sync merge warning should be shown. bool MergeAndSyncAcceptanceNeeded() const; // Sets the last synced time to the current time. void UpdateLastSyncedTime(); // When running inside Chrome OS, extract the LSID cookie from the cookie // store to bootstrap the authentication process. std::string GetLsidForAuthBootstraping(); // Time at which we begin an attempt a GAIA authorization. base::TimeTicks auth_start_time_; // Time at which error UI is presented for the new tab page. base::TimeTicks auth_error_time_; // The profile whose data we are synchronizing. Profile* profile_; // TODO(ncarter): Put this in a profile, once there is UI for it. // This specifies where to find the sync server. GURL sync_service_url_; // The last time we detected a successful transition from SYNCING state. // Our backend notifies us whenever we should take a new snapshot. base::Time last_synced_time_; // Our asynchronous backend to communicate with sync components living on // other threads. scoped_ptr<browser_sync::SyncBackendHost> backend_; // Model association manager instance. scoped_ptr<browser_sync::ModelAssociator> model_associator_; // The change processors that handle the different data types. std::set<browser_sync::ChangeProcessor*> change_processors_; NotificationRegistrar registrar_; // Whether the SyncBackendHost has been initialized. bool backend_initialized_; // Set to true when the user first enables sync, and we are waiting for // syncapi to give us the green light on providing credentials for the first // time. It is set back to false as soon as we get this message, and is // false all other times so we don't have to persist this value as it will // get initialized to false. // TODO(timsteele): Remove this by way of starting the wizard when enabling // sync *before* initializing the backend. syncapi will need to change, but // it means we don't have to wait for the first AuthError; if we ever get // one, it is actually an error and this bool isn't needed. bool expecting_first_run_auth_needed_event_; // Various pieces of UI query this value to determine if they should show // an "Authenticating.." type of message. We are the only central place // all auth attempts funnel through, so it makes sense to provide this. // As its name suggests, this should NOT be used for anything other than UI. bool is_auth_in_progress_; SyncSetupWizard wizard_; // True if an unrecoverable error (e.g. violation of an assumed invariant) // occurred during syncer operation. This value should be checked before // doing any work that might corrupt things further. bool unrecoverable_error_detected_; ObserverList<Observer> observers_; DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); }; #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_
// // CorrWorker.cpp // corr_client_opencl // // Created by tihmstar on 19.03.20. // Copyright © 2020 tihmstar. All rights reserved. // #include "CorrWorker.hpp" #include <netdb.h> #include <netinet/in.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <sys/types.h> #include <stdio.h> #include <signal.h> #include <arpa/inet.h> #include <unistd.h> #include "CPULoader.hpp" #include <stdlib.h> //#warning custom point_per_trace //#define NUMBER_OF_POINTS_OVERWRITE 2000 #define assure(cond) do {if (!(cond)) {printf("ERROR: CorrWorker ASSURE FAILED ON LINE=%d\n",__LINE__); throw(__LINE__); }}while (0) #define assure_(cond) do {cl_int clret = 0; if ((clret = cond)) {printf("ERROR: CorrWorker ASSURE FAILED ON LINE=%d with err=%d\n",__LINE__,clret); throw(__LINE__);}}while (0) #ifndef ntohll uint64_t ntohll(uint64_t in){ volatile uint64_t out[1] = {1}; if ((*(uint8_t*)out) == 1){ //little endian, do swap ((uint8_t*)out)[7] = (in >> 0x00) & 0xff; ((uint8_t*)out)[6] = (in >> 0x08) & 0xff; ((uint8_t*)out)[5] = (in >> 0x10) & 0xff; ((uint8_t*)out)[4] = (in >> 0x18) & 0xff; ((uint8_t*)out)[3] = (in >> 0x20) & 0xff; ((uint8_t*)out)[2] = (in >> 0x28) & 0xff; ((uint8_t*)out)[1] = (in >> 0x30) & 0xff; ((uint8_t*)out)[0] = (in >> 0x38) & 0xff; }else{ out[0] = in; } return out[0]; } #endif #define senduint32_t(num) do { uint32_t s = htonl(num);assure(write(_serverFd, &s, sizeof(s)) == sizeof(s)); }while(0) #define receiveuint32_t() [this]()->uint32_t{ uint32_t s = 0; assure(doread(_serverFd, &s, sizeof(s)) == sizeof(s)); s = htonl(s); return s;}() #define senduint64_t(num) do { uint64_t s = ntohll(num);assure(write(_serverFd, &s, sizeof(s)) == sizeof(s)); }while(0) #define receiveuint64_t() [this]()->uint64_t{ uint64_t s = 0; assure(doread(_serverFd, &s, sizeof(s)) == sizeof(s)); s = ntohll(s); return s;}() using namespace std; static ssize_t doread(int fd, void *buf, ssize_t size){ ssize_t didread = 0; do{ ssize_t curdidread = read(fd, static_cast<uint8_t*>(buf)+didread, size-didread); assure(curdidread>0); didread += curdidread; }while (didread<size); return didread; } CorrWorker::CorrWorker(std::string tracesIndir, const char *serverAddress, uint16_t port, std::vector<int> gpus, std::string kernelsource, size_t availableRamSize, float workermultiplier) : _serverFd(-1), _tracesIndir(tracesIndir), _kernelsource(kernelsource), _availableRamSize(availableRamSize), _point_per_trace(0), _workerThread(NULL), _workerShouldStop(false), _workerIsRunning(false) { struct sockaddr_in servaddr = {}; uint32_t num_of_powermodels = 0; if (_tracesIndir.c_str()[_tracesIndir.size()-1] != '/') { _tracesIndir += '/'; } printf("[CorrWorker] init\n"); assure((_serverFd = socket(AF_INET, SOCK_STREAM, 0)) != -1); // assign IP, PORT servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr = inet_addr(serverAddress); servaddr.sin_port = htons(port); printf("[CorrWorker] connecting to server=%s:%u ...\n",serverAddress,port); assure(!connect(_serverFd, (struct sockaddr *)&servaddr, sizeof(servaddr))); printf("[CorrWorker] connected!\n"); /* init sequence: --- Server -> Cient --- send point_per_trace //uint32_t send num_of_powermodels //uint32_t send power models seperated by \x00 byte [ model\x00 model\x00 ... ] --- Cient -> Server --- send num_of_gpus //uint32_t */ _point_per_trace = receiveuint32_t(); num_of_powermodels = receiveuint32_t(); #ifdef NUMBER_OF_POINTS_OVERWRITE assure(_point_per_trace == NUMBER_OF_POINTS_OVERWRITE); #endif for (int i=0; i<num_of_powermodels; i++) { char c = 0; std::string curstr; do{ read(_serverFd, &c, 1); curstr += c; }while(c); _powermodels.push_back(curstr.substr(0,curstr.size()-1)); } for (auto &m : _powermodels) { printf("[CorrWorker] Model=%s\n",m.c_str()); } printf("[CorrWorker] Got %3lu powerModels!\n",_powermodels.size()); #pragma mark init GPUS // Get platform and device information cl_platform_id platform_id = NULL; cl_uint num_platforms = 0; cl_uint num_devices = 0; assure_(clGetPlatformIDs(1, &platform_id, &num_platforms)); assure_(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, 0, NULL, &num_devices)); { cl_device_id device_ids[num_devices]; assure_(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, num_devices, device_ids, &num_devices)); for (int index : gpus) { printf("[CorrWorker] Init GPU %d!\n",index); assure(index < num_devices); _gpus.push_back(new GPUDevice(index,device_ids[index],kernelsource, _point_per_trace, _powermodels)); } } printf("[CorrWorker] All GPUs initialized\n"); uint32_t workers = (uint32_t)gpus.size(); workers *= workermultiplier; assure(workers != 0); printf("[CorrWorker] workers=%u\n",workers); senduint32_t(workers); } CorrWorker::~CorrWorker(){ _workerShouldStop = true; { int fd = _serverFd;_serverFd = -1; close(fd); } if (_workerThread) _workerThread->join(); if (!_workerIsRunning) raise(SIGINT); //sanity check if (_workerThread) { delete _workerThread; _workerThread = NULL; } } void CorrWorker::worker(uint16_t maxLoaderThreads){ _workerIsRunning = true; while (!_workerShouldStop) { uint32_t batchSize = 0; batchSize = receiveuint32_t(); printf("[CorrWorker] Got batchsize=%u\n",batchSize); std::vector<std::string> bachFilenames; for (int i=0; i<batchSize; i++) { char c = 0; std::string curstr; do{ read(_serverFd, &c, 1); curstr += c; }while(c); bachFilenames.push_back(_tracesIndir + curstr.substr(0,curstr.size()-1)); } for (auto &f : bachFilenames) { printf("[CorrWorker] Batch Filename=%s\n",f.c_str()); } senduint32_t(batchSize); #pragma mark doGPUComputation CPULoader cloader(bachFilenames, _availableRamSize, maxLoaderThreads); std::queue<std::thread *> gpuTransferThreads; #define MIN_TRANSFER_CNT 0 #define MAX_TRANSFER_CNT 25000 for (auto &gpu : _gpus) { gpuTransferThreads.push(new std::thread([&cloader](GPUDevice *gpu)->void{ LoadFile *toTransfer = NULL; while (LoadFile *file = cloader.dequeue()) { if (toTransfer) { //if we have "toTransfer" if ( toTransfer->tracesInFile() >= MIN_TRANSFER_CNT //if "toTransfer" already large enough || toTransfer->tracesInFile() + file->tracesInFile() > MAX_TRANSFER_CNT //or combination would exceed MAX limit ) { //then transfer the pendin trace gpu->transferTrace(toTransfer); delete toTransfer; toTransfer = NULL; } } if (!toTransfer) { //if we don't have a pending trace anymore, make "file" be our new pending trace toTransfer = file; file = NULL; continue; } //if we have both: "transferTrace" and "file", then we should combine them now printf("[DW-%u] combining traces (%5u + %5u = %5u)\n",gpu->deviceNum(),toTransfer->tracesInFile(), file->tracesInFile(), toTransfer->tracesInFile() + file->tracesInFile()); *toTransfer += *file; //once we combined traces, we can discard "file" if (file) { delete file; file = NULL; } } //final transfer if (toTransfer) { gpu->transferTrace(toTransfer); delete toTransfer; toTransfer = NULL; } printf("GPU %d done transfer!\n",gpu->deviceNum()); },gpu)); } printf("Waiting for gpu transfers to finish (%lu threads)!\n",gpuTransferThreads.size()); while (gpuTransferThreads.size()) { auto t = gpuTransferThreads.front(); gpuTransferThreads.pop(); t->join(); delete t; } printf("All GPU transfers finished, getting results...\n"); std::map<std::string,std::map<std::string,CPUModelResults*>> allmodelresults; for (auto &gpu : _gpus) { gpu->getResults(allmodelresults); } #pragma mark sendBackResults /* Protocol: --- Client -> Server --- send allmodelresults.size() //uint32_t send models [ modelresultcategory\x00 //terminated by zero byte [ send allmodelresults[x].size() //uint32_t modelresultname\x00 //terminated by zero byte cpumodelresultsize //uint64_t < raw data > ] .... ] send 00000000 //uint32_t */ srand((unsigned int)time(NULL) ^ rand()); uint32_t myrand = rand(); uint32_t remoteRand = 0; senduint32_t(myrand); remoteRand = receiveuint32_t(); senduint32_t(allmodelresults.size()); int allmodelresultsCounter = 0; for (auto &category : allmodelresults) { assure(allmodelresultsCounter++ < allmodelresults.size()); //don't send more than we announced assure(write(_serverFd, category.first.c_str(), category.first.size()+1) == category.first.size()+1); //modelresultcategory\x00 //terminated by zero byte senduint32_t(category.second.size()); //send allmodelresults[x].size() //uint32_t int modelresultcategorycounter = 0; for (auto &mr : category.second) { assure(modelresultcategorycounter++ < category.second.size()); //don't send more than we announced assure(write(_serverFd, mr.first.c_str(), mr.first.size()+1) == mr.first.size()+1); // modelresultname\x00 //terminated by zero byte void *data = NULL; size_t dataSize = 0; mr.second->serialize(&data, &dataSize); uint64_t dataSizeSend = (uint64_t)dataSize; assure(dataSizeSend == dataSize); //no casting issues here senduint64_t(dataSizeSend); //cpumodelresultsize //uint64_t assure(write(_serverFd, data, dataSizeSend) == dataSizeSend); // < raw data > free(data); } } senduint32_t(myrand ^ remoteRand); //final check for (auto &gpu : _gpus) { gpu->resetDevice(); } for (auto & category : allmodelresults) { for (auto &model: category.second) { delete model.second; model.second = NULL; } } } _workerIsRunning = false; } void CorrWorker::startWorker(uint16_t maxLoaderThreads){ _workerThread = new std::thread([this](uint16_t loadthreads){ worker(loadthreads); }, maxLoaderThreads); } void CorrWorker::stopWorker(){ _workerShouldStop = true; }
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #include <cstdlib> #include <fstream> #include <string> #include <vector> #include "tensorflow/core/platform/logging.h" #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/tools/command_line_flags.h" #include "tensorflow/lite/tools/evaluation/evaluation_delegate_provider.h" #include "tensorflow/lite/tools/evaluation/proto/evaluation_config.pb.h" #include "tensorflow/lite/tools/evaluation/proto/evaluation_stages.pb.h" #include "tensorflow/lite/tools/evaluation/stages/image_classification_stage.h" #include "tensorflow/lite/tools/evaluation/utils.h" namespace tflite { namespace evaluation { constexpr char kModelFileFlag[] = "model_file"; constexpr char kGroundTruthImagesPathFlag[] = "ground_truth_images_path"; constexpr char kGroundTruthLabelsFlag[] = "ground_truth_labels"; constexpr char kOutputFilePathFlag[] = "output_file_path"; constexpr char kModelOutputLabelsFlag[] = "model_output_labels"; constexpr char kBlacklistFilePathFlag[] = "blacklist_file_path"; constexpr char kNumImagesFlag[] = "num_images"; constexpr char kInterpreterThreadsFlag[] = "num_interpreter_threads"; constexpr char kDelegateFlag[] = "delegate"; template <typename T> std::vector<T> GetFirstN(const std::vector<T>& v, int n) { if (n >= v.size()) return v; std::vector<T> result(v.begin(), v.begin() + n); return result; } bool EvaluateModel(const std::string& model_file_path, const std::vector<ImageLabel>& image_labels, const std::vector<std::string>& model_labels, std::string delegate, std::string output_file_path, int num_interpreter_threads, const DelegateProviders& delegate_providers) { EvaluationStageConfig eval_config; eval_config.set_name("image_classification"); auto* classification_params = eval_config.mutable_specification() ->mutable_image_classification_params(); auto* inference_params = classification_params->mutable_inference_params(); inference_params->set_model_file_path(model_file_path); inference_params->set_num_threads(num_interpreter_threads); inference_params->set_delegate(ParseStringToDelegateType(delegate)); if (!delegate.empty() && inference_params->delegate() == TfliteInferenceParams::NONE) { LOG(WARNING) << "Unsupported TFLite delegate: " << delegate; return false; } classification_params->mutable_topk_accuracy_eval_params()->set_k(10); ImageClassificationStage eval(eval_config); eval.SetAllLabels(model_labels); if (eval.Init(&delegate_providers) != kTfLiteOk) return false; const int step = image_labels.size() / 100; for (int i = 0; i < image_labels.size(); ++i) { if (step > 1 && i % step == 0) { LOG(INFO) << "Evaluated: " << i / step << "%"; } eval.SetInputs(image_labels[i].image, image_labels[i].label); if (eval.Run() != kTfLiteOk) return false; } std::ofstream metrics_ofile; metrics_ofile.open(output_file_path, std::ios::out); metrics_ofile << eval.LatestMetrics().DebugString(); metrics_ofile.close(); return true; } int Main(int argc, char* argv[]) { // Command Line Flags. std::string model_file_path; std::string ground_truth_images_path; std::string ground_truth_labels_path; std::string model_output_labels_path; std::string blacklist_file_path; std::string output_file_path; std::string delegate; int num_images = 0; int num_interpreter_threads = 1; std::vector<tflite::Flag> flag_list = { tflite::Flag::CreateFlag(kModelFileFlag, &model_file_path, "Path to test tflite model file."), tflite::Flag::CreateFlag( kModelOutputLabelsFlag, &model_output_labels_path, "Path to labels that correspond to output of model." " E.g. in case of mobilenet, this is the path to label " "file where each label is in the same order as the output" " of the model."), tflite::Flag::CreateFlag( kGroundTruthImagesPathFlag, &ground_truth_images_path, "Path to ground truth images. These will be evaluated in " "alphabetical order of filename"), tflite::Flag::CreateFlag( kGroundTruthLabelsFlag, &ground_truth_labels_path, "Path to ground truth labels, corresponding to alphabetical ordering " "of ground truth images."), tflite::Flag::CreateFlag( kBlacklistFilePathFlag, &blacklist_file_path, "Path to blacklist file (optional) where each line is a single " "integer that is " "equal to index number of blacklisted image."), tflite::Flag::CreateFlag(kOutputFilePathFlag, &output_file_path, "File to output metrics proto to."), tflite::Flag::CreateFlag(kNumImagesFlag, &num_images, "Number of examples to evaluate, pass 0 for all " "examples. Default: 0"), tflite::Flag::CreateFlag( kInterpreterThreadsFlag, &num_interpreter_threads, "Number of interpreter threads to use for inference."), tflite::Flag::CreateFlag(kDelegateFlag, &delegate, "Delegate to use for inference, if available. " "Must be one of {'nnapi', 'gpu'}"), }; tflite::Flags::Parse(&argc, const_cast<const char**>(argv), flag_list); DelegateProviders delegate_providers; delegate_providers.InitFromCmdlineArgs(&argc, const_cast<const char**>(argv)); // Process images in filename-sorted order. std::vector<std::string> image_files, ground_truth_image_labels; TF_LITE_ENSURE_STATUS(GetSortedFileNames( StripTrailingSlashes(ground_truth_images_path), &image_files)); if (!ReadFileLines(ground_truth_labels_path, &ground_truth_image_labels)) { LOG(ERROR) << "Could not read ground truth labels file"; return EXIT_FAILURE; } if (image_files.size() != ground_truth_image_labels.size()) { LOG(ERROR) << "Number of images and ground truth labels is not same"; return EXIT_FAILURE; } std::vector<ImageLabel> image_labels; image_labels.reserve(image_files.size()); for (int i = 0; i < image_files.size(); i++) { image_labels.push_back({image_files[i], ground_truth_image_labels[i]}); } // Filter out blacklisted/unwanted images. TF_LITE_ENSURE_STATUS( FilterBlackListedImages(blacklist_file_path, &image_labels)); if (num_images > 0) { image_labels = GetFirstN(image_labels, num_images); } std::vector<std::string> model_labels; if (!ReadFileLines(model_output_labels_path, &model_labels)) { LOG(ERROR) << "Could not read model output labels file"; return EXIT_FAILURE; } if (!EvaluateModel(model_file_path, image_labels, model_labels, delegate, output_file_path, num_interpreter_threads, delegate_providers)) { LOG(ERROR) << "Could not evaluate model"; return EXIT_FAILURE; } return EXIT_SUCCESS; } } // namespace evaluation } // namespace tflite int main(int argc, char* argv[]) { return tflite::evaluation::Main(argc, argv); }
Octodon degus is generally considered endemic to west central Chile, where it inhabits the lower slopes of the Andes. Although some have argued that its range may extend north into Peru, this is not well supported. It is common in the international pet trade, however, and is often used in laboratory studies outside of its native range. (Contreras, et al., 1987; Woods and Boraker, 1975) Octodon degus inhabits a mediterranean-type semi-arid shrubland ecosystem called "matorral", which is found on the western slopes of the Andes between 28 and 35 degrees south latitude. Further north the climate becomes too arid to support this plant community, and further south it is too wet. Degus appear to be limited to elevations below 1200 meters, both by the distribution of their habitat and by their intolerance of low oxygen partial pressure. Degus are well able to inhabit lands influenced by cattle grazing, and are agricultural pests in some areas. (Contreras, et al., 1987; Fulk, 1976) Octodon degus superficially resembles a gerbil, but is much larger. Degus typically weigh between 170 and 300 g, and measure between 325 and 440 mm in length, including the tail. The fur is yellow-brown on the back and head, and the underparts and feet are cream colored. There is a pale band around the eye and, in some individuals, the neck. The tail is moderately long and conspicuously tufted. The ears are large and darkly pigmented. The fifth digit is reduced, and on the forefeet it has a nail instead of a claw. The cheekteeth are hypsodont and their biting surfaces resemble a figure of eight. Sexes are difficult to distinguish, but males tend to be about 10% larger than females. Pups are born furred and able to see, and begin exploring within hours of birth. Octodon degus can be distinguished from the two other members of the genus Octodon by slight differences in dental morphology. It is also smaller than its relatives and its tail is said to be more noticeably tufted. (Fulk, 1976; Lee, 2004) During the annual breeding season, male-male aggression temporarily increases. Males exclude other males from their burrow and monopolize the females (usually 2 to 4) who live there. Dustbathing and urine marking may be used in the defense of territory by both sexes, but these behaviors particularly increase in the male during the breeding season. Courting males often engage in mutual grooming with females, and frequently perform a courtship ritual which involves wagging of the tail and trembling of the body. The male then raises a hind leg and sprays urine onto the female. This may serve to familiarize her with his scent and perhaps make her more receptive to his advances in the future. Receptive females may sometimes enurinate males in a similar fashion. Related female degus may nurse each other's young. (Ebensperger and Caiozzi, 2002; Fulk, 1976; Kleiman, 1974; Soto-Gamboa, 2005) In the wild degus tend to breed once per year. The breeding season usually begins in late May (autumn in Chile), and the young are conceived in late winter to early spring (September to October). In wet years, degus may produce second litters. It has been suggested that degus may be induced ovulators, but this has not been established for certain. There is also some evidence that male reproductive organs may be sensitive to changes in photoperiod. The gestation period is 90 days, and litter size is typically 4-6 pups. The young are precocial. They are born with fur and teeth; their eyes are open and they are able to move about the nest on their own. Pups are weaned at 4 to 5 weeks, and become sexually mature between 12 and 16 weeks of age. Degus do not reach adult size until about 6 months of age, however, and they generally live in same-sex social groups until they are about 9 months old and their first breeding season occurs. It has been reported that pups raised in isolation in the laboratory experience severe neural and behavioral abnormalities. (Ebensperger and Hurtado, 2005; Lee, 2004; Woods and Boraker, 1975) Before conception can occur, the male degu must invest considerable energy in the defense of his territory and harem from other males. The female subsequently expends considerable energy in gestation and lactation. The pregnancy is relatively long for a rodent, and the young are born well developed. After birth, both parents protect and provision the pups. Degus nest communally, and groups of related females nurse one another's young. In the laboratory, the female remains close to the pups until two weeks after birth, and males have been observed to huddle with the young during this period without instances of infanticide. In the wild, male degus may spend as much time feeding and huddling with the young as females do. Pups begin to eat solid food at about two weeks of age, and venture out of the burrow at three weeks. Upon weaning at four to six weeks, the pups are able to live independently of the parents and form same-sex social groups until their first breeding season. (Ebensperger and Hurtado, 2005; Fulk, 1976; Lee, 2004; Woods and Boraker, 1975) In laboratory conditions, degus typically live five to eight years. Degus are social and tend to live in groups of one to two males and two to five related females. Females participate in rearing on another's young. Groups maintain territories throughout much of the year. Degus are semi-fossorial, digging extensive communal burrow systems. These burrows are often shared by Bennett's chinchilla rat (Abrocoma bennettii). Degus feed exclusively above ground, however, and have been observed climbing into the low branches of shrubs while foraging. Dustbathing is an important social behavior among degus. Groups repeatedly mark favorite wallows with urine and anal gland secretions. This may help the group identify each other by scent as well as delineating territorial boundaries. Degus are mainly diurnal, and are most active during the morning and evening. (Ebensperger, et al., 2004; Fulk, 1976; Woods and Boraker, 1975) Fulk (1976) estimated that social groups of degus occupy home areas of roughly 200 square meters, and that their density is about 75 degus per hectare. This may be an underestimate, however, due to the trapping methods used. (Fulk, 1976) Degus have well-developed sight, smell, and hearing. They are highly vocal and use various calls to communicate with one another, including alarm calls, mating calls, and communication between parents and young. Vision is very important in avoidance of predators and in foraging. It has been shown that degus are able to see ultraviolet wavelengths, and that their urine reflects in the UV range when fresh. It has therefore been suggested that degus' urine scent marks are also visual cues. These scent marks are also used as dust wallows, allowing members of a social group to identify each other by scent. (Chavez, et al., 2003; Fulk, 1976; Woods and Boraker, 1975) Degus are generalist herbivores. They feed on the leaves, bark, and seeds of shrubs and forbs. Among their favorite foods are the bark of Cestrum palqui and Mimosa cavenia, leaves and bark of Proustia cuneifolia, Atriplex repunda, and Acacia caven, annuals such as Erodium cicutarum when in season, green grasses, and thistle seeds. Degus choose food items that reduce fiber and increase nitrogen and moisture in the diet, and thus prefer young leaves and avoid woodier shrubs. Degus rely on microbial fermentation in their enlarged cecum (they are "hindgut fermenters") to digest their food. They reingest a large percentage of their feces, usually during the night. This allows them to maximize their digestion. Degus store food in the winter, and it has been reported that they occasionally eat meat in old age. (Gutierrez and Bozinovic, 1998; Kenagy, et al., 1999; Veloso and Kenagy, 2005; Woods and Boraker, 1975) Octodon degus is subject to predation by larger mammals such as culpeo foxes (Lycalopex culpaeus), and from the air by raptors such as barn owls (Tyto alba), short-eared owls (Asio flammeus), and black-chested buzzard eagles (Geranoaetus melanoleucus). Degus use vigilance and cover to avoid predators. Their pelage is also counter-shaded and matches the soil color, which reduces visibility to predators. Degus live socially and use alarm calls to warn others of danger. When a predator is spotted, they take cover in shrubby areas and may retreat to the communal burrow. (Ebensperger and Wallem, 2002; Woods and Boraker, 1975) Octodon degus affects the plant community in its habitat by selective browsing. Degus behaviorally reduce the fiber content of their diet, preferrentially eating shrubs such as Adesmia bedwellii, Baccharis paniculata, and Chenopodium petioare, which are less fibrous and less thorny than others. These species have been shown to increase their foliage area upon exclusion of degus. As degus are very common, they are themselves an important food source for their predators. (Gutierrez and Bozinovic, 1998) Degus often live in association with Bennett's chinchilla rats (Abrocoma bennettii). The two species are known to share burrow systems and have even been observed in the same chamber within a burrow. This is believed to be a mutualistic relationship, but it is not well understood. (Fulk, 1976; Woods and Boraker, 1975) Degus are frequently kept as pets, and are used extensively in laboratory research. Because they are largely diurnal, they are useful in research on circadian rhythms, and their intolerance of sugars makes them ideal models for diabetes research. (Lee, 2004) Degus are significant agricultural pests in some areas. They take advantage of cultivated prickly pear cactus, wheat, vineyards, and orchards as abundant food sources, and can do considerable damage. They are also known to host three species of parasites that can infect humans. (Fulk, 1976) Tanya Dewey (editor), Animal Diversity Web. Mary Hejna (author), University of Michigan-Ann Arbor, Phil Myers (editor, instructor), Museum of Zoology, University of Michigan-Ann Arbor. living in the southern part of the New World. In other words, Central and South America. uses sound to communicate living in landscapes dominated by human agriculture. having body symmetry such that the animal can be divided in one plane into two mirror-image halves. Animals with bilateral symmetry have dorsal and ventral sides, as well as anterior and posterior ends. Synapomorphy of the Bilateria. Found in coastal areas between 30 and 40 degrees latitude, in areas with a Mediterranean climate. Vegetation is dominated by stands of dense, spiny shrubs with tough (hard or waxy) evergreen leaves. May be maintained by periodic fire. In South America it includes the scrub ecotone between forest and paramo. uses smells or other chemicals to communicate helpers provide assistance in raising young that are not their own an animal that mainly eats the dung of other animals active at dawn and dusk having markings, coloration, shapes, or other features that cause an animal to be camouflaged in its natural environment; being difficult to see or otherwise detect. animals that use metabolically generated heat to regulate body temperature independently of ambient temperature. Endothermy is a synapomorphy of the Mammalia, although it may have arisen in a (now extinct) synapsid ancestor; the fossil record does not distinguish these possibilities. Convergent in birds. an animal that mainly eats leaves. Referring to a burrowing life-style or behavior, specialized for digging or burrowing. an animal that mainly eats seeds An animal that eats mainly plants or parts of plants. offspring are produced in more than one group (litters, clutches, etc.) and across multiple seasons (or other periods hospitable to reproduction). Iteroparous animals must, by definition, survive over multiple seasons (or periodic condition changes). having the capacity to move from one place to another. the area in which the animal is naturally found, the region in which it is endemic. the business of buying and selling animals for people to keep in their homes as pets. having more than one female as a mate at one time specialized for leaping or bounding locomotion; jumps or hops. communicates by producing scents from special gland(s) and placing them on a surface whether others can smell or taste them breeding is confined to a particular season remains in the same area reproduction that includes combining the genetic contribution of two individuals, a male and a female associates with others of its species; forms social groups. places a food item in a special place to be eaten later. Also called "hoarding" uses touch to communicate that region of the Earth between 23.5 degrees North and 60 degrees North (between the Tropic of Cancer and the Arctic Circle) and between 23.5 degrees South and 60 degrees South (between the Tropic of Capricorn and the Antarctic Circle). Living on the ground. defends an area within the home range, occupied by a single animals or group of animals of the same species and held through overt defense, display, or advertisement uses sight to communicate reproduction in which fertilization and development take place within the female body and the developing embryo derives nourishment from the female. young are relatively well-developed when born Chavez, A., F. Bozinovic, L. Peichl, A. Palacios. 2003. Retinal spectral sensitivity, fur coloration, and urine reflectance in the genus Octodon (Rodentia): implications for visual ecology. Investigative Opthalmology & Visual Science, 44/5: 2290-2296. Contreras, L., J. Torres-Mura, J. Yanez. 1987. Biogeography of Octodontid rodents: An eco-evolutionary hypothesis. Fieldiana: Zoology, New Series, 39: 401-411. Ebensperger, L., F. Bozinovic. 2000. Energetics and burrowing behaviour in the semifossorial degu Octadon degus (Rodentia: Octodontidae). Journal of Zoology, 252: 179-186. Ebensperger, L., A. Caiozzi. 2002. Male degus, Octodon degus, modify their dustbathing behavior in response to social familiarity of previous dustbathing marks. Revista Chilena de Historia Natural, 75: 157-163. Ebensperger, L., M. Hurtado. 2005. On the relationship between herbaceous cover and vigilance activity of degus (Octodon degus). Ethology, 111/6: 593-608. Ebensperger, L., M. Hurtado. 2005. Seasonal changes in the time budget of degus, Octadon degus.. Behaviour, 142: 91-112. Ebensperger, L., M. Hurtado, M. Soto-Gamboa, E. Lacey, A. Chang. 2004. Communal nesting and kinship in degus (Octodon degus). Naturwissenschaften, 91: 391-395. Ebensperger, L., P. Wallem. 2002. Grouping increases the ability of the social rodent, Octodon degus, to detect predators when using exposed microhabitats. Oikos, 98: 491-497. Fulk, G. 1976. Notes on the activity, reproduction, and social behavior of Octodon degus. Journal of Mammalogy, 57/3: 495-505. Gutierrez, J., F. Bozinovic. 1998. Diet selection in captivity by a generalist herbivorous rodent (Octodon degus) from the Chilean coastal desert. Journal of Arid Environments, 39: 601-607. Kenagy, G., R. Nespolo, R. Vasquez, F. Bozinovic. 2002. Daily and seasonal limits of time and temperature to activity of degus. Revista Chilena de Historia Natural, 75: 567-581. Kenagy, G., C. Veloso, F. Bozinovic. 1999. Daily rhythms of food intake and feces reingestion in the degu, an herbivorous Chilean rodent: optimizing digestion through coprophagy. Physiological and Biochemical Zoology, 72/1: 78-86. Kleiman, D. 1974. Patterns of behaviour in hystricomorph rodents. Symposium of the Zoological Society (London), 34: 171-209. Lee, T. 2004. Octodon degus: A diurnal, social, and long-lived rodent. ILAR Journal, 45/1: 14-24. Soto-Gamboa, M., M. Villalon, F. Bozinovic. 2005. Social cues and hormone levels in male Octadon degus (Rodentia): a field test of the Challange Hypothesis. Hormones and Behavior, 47/3: 311-318. Soto-Gamboa, M. 2005. Free and total testosterone levels in field males of Octodon degus (Rodentia, Octodontidae): accuracy of the hormonal regulation of behavior. Revista Chilena de Historia Natural, 78/2: 229-238. Tokimoto, N., K. Okanoya. 2004. Spontaneous construction of "Chines boxes" by Degus (Octodon degus): A rudiment of recursive intelligence?. Japanese Psychological Research, 46/3: 255-261. Veloso, C., G. Kenagy. 2005. Temporal dynamics of milk composition of the precocial caviomorph Octodon degus (Rodentia : Octodontidae). Revista Chilena de Historia Natural, 78/2: 247-252. Woods, C., D. Boraker. 1975. Octodon degus. Mammalian Species, 67: 1-5.
Around the South Jamaica housing projects in Queens, young men with pit bulls guard street corners and rap music blares from car stereos. But one house, on 110th Avenue, seems to openly defy its gritty surroundings. Its owner, Milford Graves, has covered it with an ornate mosaic of stones, reflective metal and hunks of discarded marble, arranged in cheery patterns. The yard is a lush garden, dense with citrus trees, herbs and exotic plants. Continue reading the main story In 1967, Mr. Graves was honored in a Down Beat magazine critics' poll as the year's bright new talent. He had offers of lucrative gigs from artists like Miles Davis and the South African singer Miriam Makeba. In his basement, he converted the heartbeats to a higher register and dissected them. Behind the basic binary thum-THUMP beat, he heard other rhythms -- more spontaneous and complex patterns in less-regular time intervals -- akin to a drummer using his four limbs independently. "A lot of it was like free jazz," Mr. Graves said one day last week in his basement. "There were rhythms I had only heard in Cuban and Nigerian music." He demonstrated by thumping a steady bum-BUM rhythm on a conga with his right hand, while delivering with his left a series of unconnected rhythms on an hourglass-shaped talking drum. Mr. Graves created computer programs to analyze the heart's rhythms and pitches, which are caused by muscle and valve movement. The pitches correspond to actual notes on the Western musical scale. Raised several octaves, the cardiac sounds became rather melodic. "When I hooked up to the four chambers of the heart, it sounded like four-part harmony," Mr. Graves said. He began composing with the sounds -- both by transcribing heartbeat melodies and by using recorded fragments. He also realized he could help detect heart problems, maybe even cure them. "A healthy heart has strong, supple walls, so the sound usually has a nice flow," he said. "You hear it and say, 'Ah, now that's hip.' But an unhealthy heart has stiff and brittle muscles. There's less compliance, and sounds can come out up to three octaves higher than normal. "You can pinpoint things by the melody. You can hear something and say, 'Ah, sounds like a problem in the right atrium."' In 2000, Mr. Graves received a grant from the John Simon Guggenheim Memorial Foundation, which he said gave him money to buy essential equipment. Dr. Baruch Krauss, who teaches pediatrics at Harvard Medical School and is an emergency physician at Boston Children's Hospital, said the medical establishment has only recently begun to appreciate the rhythmic and tonal complexities of the heartbeat and speak about it in terms of syncopation and polyrhythms. "This is what a Renaissance man looks like today," said Dr. Krauss, who studied acupuncture with Mr. Graves and follows his research. "To see this guy tinkering with stuff in a basement in Queens, you wonder how it could be legitimate. But Milford is right on the cutting edge of this stuff. He brings to it what doctors can't, because he approaches it as a musician." Dr. Ram Jadonath, director of electrophysiology at North Shore University Hospital in Manhasset, N.Y., said Mr. Graves's theories sounded plausible but should not replace a standard medical assessment from a doctor. "The heartbeat is a form of musical rhythm, and if you have a musical ear, you can hear heart problems a lot easier," he said. "Many heart rhythm disturbances are stress-related, and you have cells misfiring. It is possible to redirect or retrain them with musical therapy. They do respond to suggestion. That's the area where his biofeedback could correct those type of problems." Mr. Graves said he brings unusual strengths to his medical work. "To hear if a melody sounds right or not, you've got to look at it as an artist, not a doctor," he said. "If you're trying to listen to a musical sound with no musical ability, you're not feeling it, man." Mr. Graves claims he can help a flawed heartbeat through biofeedback. He creates what he calls a "corrected heartbeat" using an algorhythmic formula, or by old-fashioned composing, and then feeds it back to the patient, whose heart is then trained to adopt the healthy beat. The patient can listen to a recording of the corrected heartbeat, or it can be imparted directly through a speaker that vibrates a needle stuck into acupuncture points. "If they don't want that," he added, "I can give them a CD." Last week, Dennis Thomas, 49, visited Mr. Graves in his basement complaining of severe chest congestion. Mr. Thomas said his doctor had diagnosed bronchial asthma and given him medication that had not been effective. Mr. Graves said the problem might be related to Mr. Thomas's heart and recorded his heartbeat. With the help of a computer program, Mr. Graves tinkered with the rhythm and amplitude and then attempted to stimulate Mr. Thomas's heart by playing the "corrected" beat both through a speaker and through a wire stuck into an acupuncture point in his wrist. "I gave him a double shot," Mr. Graves explained. After 10 minutes of treatment, Mr. Thomas's heart rate had risen about 10 beats per minute, according to a monitor. Mr. Thomas, a city bus driver from Jamaica who used to study martial arts with Mr. Graves, said that he felt improvement afterward. "I started breathing easier and felt more relaxed," he said. In addition to his medical work, Mr. Graves analyzes the heartbeats of his music students, hoping to help them play deeper and more personal music. The idea, he said, is to find their most prevalent rhythms and pitches and incorporate them into their playing. The composer and saxophonist John Zorn called Mr. Graves "basically a 20th-century shaman." "He's taken traditional drum technique so far that there's no further place to go, so he's going to the source, his heart," Mr. Zorn said. "This culture is not equipped to appreciate someone like Milford," he said. "In Korea, he'd be a national treasure. Here, he's just some weird guy who lives in Queens." Continue reading the main story
Discover the cosmos! Each day a different image or photograph of our fascinating universe is featured, along with a brief explanation written by a professional astronomer. 2010 August 12 Explanation: Each August, as planet Earth swings through dust trailing along the orbit of periodic comet Swift-Tuttle, skygazers can enjoy the Perseid Meteor Shower. The shower should build to its peak now, best seen from later tonight after moonset, until dawn tomorrow morning when Earth moves through the denser part of the wide dust trail. But shower meteors have been spotted for many days, like this bright Perseid streaking through skies near Lake Balaton, Hungary on August 8. In the foreground is the region's Church of St. Andrew ruin, with bright Jupiter dominating the sky to its right. Two galaxies lie in the background of the wide-angle, 3 frame panorama; our own Milky Way's luminous arc, and the faint smudge of the more distant Andromeda Galaxy just above the ruin's leftmost wall. If you watch for Perseid meteors tonight, be sure and check out the early evening sky show too, featuring bright planets and a young crescent Moon near the western horizon after sunset. Authors & editors: Jerry Bonnell (UMCP) NASA Official: Phillip Newman Specific rights apply. A service of: ASD at NASA / GSFC & Michigan Tech. U.
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "modules/bluetooth/BluetoothError.h" #include "core/dom/DOMException.h" #include "core/dom/ExceptionCode.h" #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h" namespace blink { DOMException* BluetoothError::take( ScriptPromiseResolver*, int32_t webError /* Corresponds to WebBluetoothResult in web_bluetooth.mojom */) { switch (static_cast<mojom::blink::WebBluetoothResult>(webError)) { case mojom::blink::WebBluetoothResult::SUCCESS: ASSERT_NOT_REACHED(); return DOMException::create(UnknownError); #define MAP_ERROR(enumeration, name, message) \ case mojom::blink::WebBluetoothResult::enumeration: \ return DOMException::create(name, message) // InvalidModificationErrors: MAP_ERROR(GATT_INVALID_ATTRIBUTE_LENGTH, InvalidModificationError, "GATT Error: invalid attribute length."); // InvalidStateErrors: MAP_ERROR(SERVICE_NO_LONGER_EXISTS, InvalidStateError, "GATT Service no longer exists."); MAP_ERROR(CHARACTERISTIC_NO_LONGER_EXISTS, InvalidStateError, "GATT Characteristic no longer exists."); // NetworkErrors: MAP_ERROR(CONNECT_ALREADY_IN_PROGRESS, NetworkError, "Connection already in progress."); MAP_ERROR(CONNECT_ATTRIBUTE_LENGTH_INVALID, NetworkError, "Write operation exceeds the maximum length of the attribute."); MAP_ERROR(CONNECT_AUTH_CANCELED, NetworkError, "Authentication canceled."); MAP_ERROR(CONNECT_AUTH_FAILED, NetworkError, "Authentication failed."); MAP_ERROR(CONNECT_AUTH_REJECTED, NetworkError, "Authentication rejected."); MAP_ERROR(CONNECT_AUTH_TIMEOUT, NetworkError, "Authentication timeout."); MAP_ERROR(CONNECT_CONNECTION_CONGESTED, NetworkError, "Remote device connection is congested."); MAP_ERROR(CONNECT_INSUFFICIENT_ENCRYPTION, NetworkError, "Insufficient encryption for a given operation"); MAP_ERROR( CONNECT_OFFSET_INVALID, NetworkError, "Read or write operation was requested with an invalid offset."); MAP_ERROR(CONNECT_READ_NOT_PERMITTED, NetworkError, "GATT read operation is not permitted."); MAP_ERROR(CONNECT_REQUEST_NOT_SUPPORTED, NetworkError, "The given request is not supported."); MAP_ERROR(CONNECT_UNKNOWN_ERROR, NetworkError, "Unknown error when connecting to the device."); MAP_ERROR(CONNECT_UNKNOWN_FAILURE, NetworkError, "Connection failed for unknown reason."); MAP_ERROR(CONNECT_UNSUPPORTED_DEVICE, NetworkError, "Unsupported device."); MAP_ERROR(CONNECT_WRITE_NOT_PERMITTED, NetworkError, "GATT write operation is not permitted."); MAP_ERROR(DEVICE_NO_LONGER_IN_RANGE, NetworkError, "Bluetooth Device is no longer in range."); MAP_ERROR(GATT_NOT_PAIRED, NetworkError, "GATT Error: Not paired."); MAP_ERROR(GATT_OPERATION_IN_PROGRESS, NetworkError, "GATT operation already in progress."); MAP_ERROR(UNTRANSLATED_CONNECT_ERROR_CODE, NetworkError, "Unknown ConnectErrorCode."); // NotFoundErrors: MAP_ERROR(WEB_BLUETOOTH_NOT_SUPPORTED, NotFoundError, "Web Bluetooth is not supported on this platform. For a list " "of supported platforms see: https://goo.gl/J6ASzs"); MAP_ERROR(NO_BLUETOOTH_ADAPTER, NotFoundError, "Bluetooth adapter not available."); MAP_ERROR(CHOSEN_DEVICE_VANISHED, NotFoundError, "User selected a device that doesn't exist anymore."); MAP_ERROR(CHOOSER_CANCELLED, NotFoundError, "User cancelled the requestDevice() chooser."); MAP_ERROR(CHOOSER_NOT_SHOWN_API_GLOBALLY_DISABLED, NotFoundError, "Web Bluetooth API globally disabled."); MAP_ERROR(CHOOSER_NOT_SHOWN_API_LOCALLY_DISABLED, NotFoundError, "User or their enterprise policy has disabled Web Bluetooth."); MAP_ERROR( CHOOSER_NOT_SHOWN_USER_DENIED_PERMISSION_TO_SCAN, NotFoundError, "User denied the browser permission to scan for Bluetooth devices."); MAP_ERROR(SERVICE_NOT_FOUND, NotFoundError, "No Services with specified UUID found in Device."); MAP_ERROR(NO_SERVICES_FOUND, NotFoundError, "No Services found in device."); MAP_ERROR(CHARACTERISTIC_NOT_FOUND, NotFoundError, "No Characteristics with specified UUID found in Service."); MAP_ERROR(NO_CHARACTERISTICS_FOUND, NotFoundError, "No Characteristics found in service."); MAP_ERROR(BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, NotFoundError, "Bluetooth Low Energy not available."); // NotSupportedErrors: MAP_ERROR(GATT_UNKNOWN_ERROR, NotSupportedError, "GATT Error Unknown."); MAP_ERROR(GATT_UNKNOWN_FAILURE, NotSupportedError, "GATT operation failed for unknown reason."); MAP_ERROR(GATT_NOT_PERMITTED, NotSupportedError, "GATT operation not permitted."); MAP_ERROR(GATT_NOT_SUPPORTED, NotSupportedError, "GATT Error: Not supported."); MAP_ERROR(GATT_UNTRANSLATED_ERROR_CODE, NotSupportedError, "GATT Error: Unknown GattErrorCode."); // SecurityErrors: MAP_ERROR(GATT_NOT_AUTHORIZED, SecurityError, "GATT operation not authorized."); MAP_ERROR(BLOCKLISTED_CHARACTERISTIC_UUID, SecurityError, "getCharacteristic(s) called with blocklisted UUID. " "https://goo.gl/4NeimX"); MAP_ERROR(BLOCKLISTED_READ, SecurityError, "readValue() called on blocklisted object marked " "exclude-reads. https://goo.gl/4NeimX"); MAP_ERROR(BLOCKLISTED_WRITE, SecurityError, "writeValue() called on blocklisted object marked " "exclude-writes. https://goo.gl/4NeimX"); MAP_ERROR(NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, SecurityError, "Origin is not allowed to access any service. Tip: Add the " "service UUID to 'optionalServices' in requestDevice() " "options. https://goo.gl/HxfxSQ"); MAP_ERROR(NOT_ALLOWED_TO_ACCESS_SERVICE, SecurityError, "Origin is not allowed to access the service. Tip: Add the " "service UUID to 'optionalServices' in requestDevice() " "options. https://goo.gl/HxfxSQ"); MAP_ERROR(REQUEST_DEVICE_WITH_BLOCKLISTED_UUID, SecurityError, "requestDevice() called with a filter containing a blocklisted " "UUID. https://goo.gl/4NeimX"); MAP_ERROR(REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, SecurityError, "requestDevice() called from cross-origin iframe."); MAP_ERROR(REQUEST_DEVICE_WITHOUT_FRAME, SecurityError, "No window to show the requestDevice() dialog."); #undef MAP_ERROR } ASSERT_NOT_REACHED(); return DOMException::create(UnknownError); } } // namespace blink
//===- ComprehensiveBufferize.cpp - Single pass bufferization -------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "PassDetail.h" #include "mlir/Dialect/Arithmetic/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" #include "mlir/Dialect/Bufferization/IR/Bufferization.h" #include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/AffineInterfaceImpl.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/LinalgInterfaceImpl.h" #include "mlir/Dialect/Linalg/ComprehensiveBufferize/ModuleBufferization.h" #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" #include "mlir/Transforms/Passes.h" using namespace mlir; using namespace mlir::bufferization; using namespace mlir::linalg; using namespace mlir::linalg::comprehensive_bufferize; namespace { struct LinalgComprehensiveModuleBufferize : public LinalgComprehensiveModuleBufferizeBase< LinalgComprehensiveModuleBufferize> { LinalgComprehensiveModuleBufferize() = default; LinalgComprehensiveModuleBufferize( const LinalgComprehensiveModuleBufferize &p) = default; explicit LinalgComprehensiveModuleBufferize( AnalysisBufferizationOptions options) : options(options) {} void runOnOperation() override; void getDependentDialects(DialectRegistry &registry) const override { registry .insert<bufferization::BufferizationDialect, linalg::LinalgDialect, memref::MemRefDialect, tensor::TensorDialect, vector::VectorDialect, scf::SCFDialect, arith::ArithmeticDialect, StandardOpsDialect, AffineDialect>(); affine_ext::registerBufferizableOpInterfaceExternalModels(registry); arith::registerBufferizableOpInterfaceExternalModels(registry); linalg_ext::registerBufferizableOpInterfaceExternalModels(registry); scf::registerBufferizableOpInterfaceExternalModels(registry); std_ext::registerModuleBufferizationExternalModels(registry); tensor::registerBufferizableOpInterfaceExternalModels(registry); vector::registerBufferizableOpInterfaceExternalModels(registry); } private: llvm::Optional<AnalysisBufferizationOptions> options; }; } // namespace static void applyEnablingTransformations(ModuleOp moduleOp) { RewritePatternSet patterns(moduleOp.getContext()); patterns.add<GeneralizePadOpPattern>(moduleOp.getContext()); (void)applyPatternsAndFoldGreedily(moduleOp, std::move(patterns)); } static FailureOr<Value> allocationFnUsingAlloca(OpBuilder &b, Location loc, MemRefType type, ValueRange dynShape, unsigned int bufferAlignment) { Value allocated = b.create<memref::AllocaOp>( loc, type, dynShape, b.getI64IntegerAttr(bufferAlignment)); return allocated; } void LinalgComprehensiveModuleBufferize::runOnOperation() { AnalysisBufferizationOptions opt; if (!options) { // Make new bufferization options if none were provided when creating the // pass. if (useAlloca) { opt.allocationFn = allocationFnUsingAlloca; opt.deallocationFn = [](OpBuilder &b, Location loc, Value v) { return success(); }; } opt.allowReturnMemref = allowReturnMemref; opt.allowUnknownOps = allowUnknownOps; opt.analysisFuzzerSeed = analysisFuzzerSeed; opt.createDeallocs = createDeallocs; opt.fullyDynamicLayoutMaps = fullyDynamicLayoutMaps; opt.printConflicts = printConflicts; opt.testAnalysisOnly = testAnalysisOnly; if (initTensorElimination) { opt.addPostAnalysisStep( linalg_ext::insertSliceAnchoredInitTensorEliminationStep); } } else { opt = *options; } // Only certain scf.for ops are supported by the analysis. opt.addPostAnalysisStep(scf::assertScfForAliasingProperties); ModuleOp moduleOp = getOperation(); applyEnablingTransformations(moduleOp); if (failed(runModuleBufferize(moduleOp, opt))) { signalPassFailure(); return; } if (opt.testAnalysisOnly) return; OpPassManager cleanupPipeline("builtin.module"); cleanupPipeline.addPass(createCanonicalizerPass()); cleanupPipeline.addPass(createCSEPass()); cleanupPipeline.addPass(createLoopInvariantCodeMotionPass()); (void)runPipeline(cleanupPipeline, moduleOp); } std::unique_ptr<Pass> mlir::createLinalgComprehensiveModuleBufferizePass() { return std::make_unique<LinalgComprehensiveModuleBufferize>(); } std::unique_ptr<Pass> mlir::createLinalgComprehensiveModuleBufferizePass( const AnalysisBufferizationOptions &options) { return std::make_unique<LinalgComprehensiveModuleBufferize>(options); }
Environment in emerging and transition economies EaP GREEN: Reform of environmentally harmful subsidies Reforming environmentally harmful subsidies (EHS) is a fundamental element of green growth strategies and confers a range of benefits to countries that undertale such reforms. These include, among others, reducing the use of resource intensive inputs (e.g. energy) and subsequent decrease in pollution levels, fixing market distrortions by making resource prices reflect resource value, and polluters pay for their pollution; releasing and/or relallocating public funding to other areas, such as education, energy saving or reducing debt. Determining the environmental impact of different subsidies is often complicated because specific policy measures do not take place in isolation, but within a broad and evolving socio-economic and technological context. Due to very patchy data and information but also because of the lack of a harmonised methodology for recording and reporting subsidies, identifying and calculating the size of EHS schemes is not easy and will require the concerted efforts of many different parties in a given government. Objectives and activities 1. Develop policy guidance tools to prepare EHS reform action plans. The guidance will be based on tools and methods for identifying, measuring and evaluating subsidies that are environmentally-harmful and economically wasteful. The experience with applying these analytical tools in preparing EHS reform plans, including from the EU countries, will be presented in several regional meetings with the participation of key stakeholders from the EaP countries. 2. Implement country projects. The OECD will work in three countries to develop action plans to reform EHS in selected sectors (such as energy, agriculture or water). Each project will aim at facilitating a national-level policy dialogue to generate political support for the adoption and implementation of the actions plan proposed for the country. 3. Build capacity and political support in other EaP countries to develop action plans to reform EHS. Organisation of stakeholder meetings in the EaP countries other than those hosting the pilot projects to disseminate policy recommendations and lessons learned from other countries in the region. DID YOU KNOW? ....that there is some evidence that fossil fuel consumer subsidies in the EaP countries might be large. The International Energy Agency estimated that, in 2011, fossil fuel subsidies for consumers (oil, coal, gas, electricity) totalled about USD 2 billion in Azerbaijan (about 3% of GDP), about USD 6 billion (3.3% of GDP) in Kazakhstan and about USD 9 billion in Ukraine (about 6% of its GDP).
#ifndef __ELASTOS_IMICROSERVICE_H__ #define __ELASTOS_IMICROSERVICE_H__ #include <string> #include <vector> #include <memory> namespace elastos { class IMicroService { public: enum OperationType { OperationType_Encrypt = 0, OperationType_Decrypt, OperationType_Sign, OperationType_Verify }; class DataHandler { public: virtual std::shared_ptr<std::vector<uint8_t>> EncryptData(const std::vector<uint8_t>& data) = 0; virtual std::shared_ptr<std::vector<uint8_t>> DecryptData(const std::vector<uint8_t>& cipherData) = 0; virtual std::shared_ptr<std::vector<uint8_t>> SignData(const std::vector<uint8_t>& data) = 0; virtual bool VerifyData(const std::vector<uint8_t>& data, const std::vector<uint8_t>& signedData) = 0; }; public: virtual int Start() = 0; virtual int Stop() = 0; virtual int HandleMessage(const std::string& did, const std::string& msg) = 0; virtual std::shared_ptr<std::vector<uint8_t>> HandleData(int type, const std::vector<uint8_t>& data) = 0; virtual void SetDataHandler(std::shared_ptr<DataHandler>& handler) = 0; }; } #endif //__ELASTOS_IMICROSERVICE_H__
1. Why is extremism an issue in prisons? Extremist groups often pose special security risks in prisons. They may encourage the overthrow of the government, and prison officials can be targeted as agents of "illegal" government authority. Further, their literature often encourages ethnic hatred, promoting a violent and racially charged prison atmosphere. Since the 1980s, white supremacist organizations have spread throughout the American prison system, beginning with the growth of Aryan Brotherhood.1 Aryan Nations, although not permitting inmates to become members, has engaged in "prison outreach" since 1979. In 1987, it began publishing a "prison outreach newsletter" called The Way to facilitate recruitment. Aryan Nations also disseminates its literature and letters to inmates. The World Church of the Creator and some Identity Church groups engage in similar outreach activity, as do other racist groups, such as Nation of Islam. The situation is further complicated by the fact that nonideological criminal prison gangs are often organized based on race, which increases racial polarization. Imprisoned extremists also pose a security threat by continuing their activities while incarcerated. They recruit inmates, and teach other inmates extremist tactics. Some imprisoned extremists also have attempted to continue to influence adherents outside of prison by, for instance, publishing newsletters from the prison to maintain their outside following. Prison officials have responded in various ways, reflecting the fact that each state has its own prison system (as do cities, counties and the federal government), and that prisons have varying populations. At times, prison officials have tried to limit access to extremist literature, and these responses have occasionally given rise to litigation because they potentially impinge upon inmates' First Amendment rights. The questions are especially complicated when the censored material comes from a group that claims to be religious. 1 Aryan Brotherhood, at one time associated with Aryan Nations, began as a virulent racist and anti-Semitic prison gang, and has since developed into a crime gang associated with extortion, drug operations and prison violence. 2. Do inmates have the same First Amendment rights as everybody else? The United States Supreme Court has said that "prison walls do not form a barrier separating prison inmates from the protections of the Constitution." Nevertheless, inmates' First Amendment rights are less extensive than other citizens' and their rights can be limited due to security or other penological concerns. Because of the particular challenges administrators face running prisons, the Supreme Court has acknowledged there is a compelling government interest which warrants limiting prisoners' rights. Courts have been deferential to prison officials' assessments of security threats, and sensitive to their related regulatory decisions, even if such decisions impact inmates' First Amendment rights. A prison regulation that impinges on an inmate's constitutional rights will be upheld in court if that regulation is reasonably related to legitimate penological objectives. This means that, generally, prison officials can ban extremist materials from prisons because of concerns that the distribution of such material will undermine prison security. Extremist books, leaflets, and magazines have been forbidden to prisoners on this basis. Such material has not been allowed through the mail and has not been kept in the prison library. However, prisons have less discretion to limit inmates' religious practices than other First Amendment rights due to a new federal law. Because of the Religious Land Use and Institutionalized Persons Act (RLUIPA), prison officials' discretion in limiting access to extremist material may depend in part on whether such material is related to an inmate's religious exercise. Therefore, prison regulations that affect religious exercise, including access to religious literature, will be reviewed carefully if challenged in court. 3. What legal standard is used to determine the constitutionality of prison regulations? The Supreme Court announced the standard under which it would review the constitutionality of prison regulations in Turner v. Safley, a case involving a challenge to a complete prohibition on inmate marriage. As noted earlier, a prison regulation is constitutional if it is reasonably related to legitimate penological objectives. Under this standard, courts have upheld regulations based on the consideration of certain factors: - Is there a valid, rational connection between the prison regulation and the legitimate governmental interest put forward to justify it? - Are there alternative means of exercising the assert- ed right that remain open to inmates? - How great a negative impact will accommodating the inmates' rights have on guards, other inmates,a nd on the allocation of prison resources? Courts will consider the existence of obvious and easy alternatives to a challenged regulation as evidence of a regulation's arbitrariness. 4. Is the same legal standard used to determine the constitutionality of prison regulations that implicate an inmate's right to free exercise of religion? No, the same standard is not applicable to determining the constitutionality of prison regulations alleged to violate inmates' free exercise rights. The constitutionality of such regulations is determined under the more stringent standard set forth in RLUIPA. RLUIPA says that the government cannot impose a substantial burden on the religious exercise of an inmate, even if the inmate's religious exercise is being limited by a generally applicable rule. However, an inmate's religious practices can be limited if the prison official demonstrates that the regulations in question (i) further a compelling interest and (ii) the same interest cannot be served in a manner that is less restrictive of the inmate's free exercise rights. Since RLUIPA was enacted in September 2000, it has not yet been interpreted by the courts. Therefore, how this statute will impact prison regulations that affect inmates' religious exercise remains unclear. 5. How should prison officials evaluate whether particular material can be withheld from inmates? Generally, the First Amendment does not allow speech to be censored by the government because of the content of that speech. The government can only limit the time, place, and manner of speech. However, because inmates have more limited First Amendment rights than other citizens, some content-based discrimination is allowed for security reasons. For example, the United States Court of Appeals for the 10th Circuit upheld a prison official's decision to withhold entire issues of the magazine, Muhammad Speaks, because certain articles in the magazine created a danger of violence by advocating racial, religious, or national hatred. This decision was prior to the passage of RLUIPA, and therefore the Court's analysis might be somewhat different today. Under current law, if having the entire magazine withheld was determined to be a substantial burden on inmates' free exercise rights, the Court might require that the offending material be removed rather than the entire issue being withheld. Regulations that exclude publications from a prison because of security concerns have been found constitutional when the regulations have required individualized review of any material before it is banned, notification to inmates that the material has been denied, and the possibility of review of such decisions. Courts have tended to find prison regulations that ban all literature from particular groups unconstitutional. However, the determination of the constitutionality of a given regulation or the implementation of the regulation has tended to be very fact-specific. Courts look not only at the regulation at issue but also consider the nature of the prison (high, medium, or low security) and the particular administrative challenges faced by the prison (such as crowding and quantity of incoming mail) in determining reasonableness, or the practical existence of less restrictive alternative measures. 6. Can prison officials apply the same restrictions to outgoing prison material? The Supreme Court does not allow content regulation with respect to outgoing mail from inmates. While outgoing mail can be searched for contraband,2 content regulation of outgoing mail is also more restricted because it implicates the First Amendment rights of non-prisoner addressees.3 In addition, outgoing material does not pose a threat to internal prison security; therefore content limitations have been considered less urgent. However, regulations can limit the content of outgoing mail categorically. For example, escape plans, threats, running a business, and blackmail are categories that have been disallowed. Therefore, correspondence from prisoners to extremist groups cannot be banned outright because of its content. However, inmates can be prevented from distributing a newsletter from prison when doing so constitutes running a business. 2 Special rules exist with respect to attorney-client correspondence or mail that implicates an inmate's right to access the courts that are beyond the scope of this discussion. 3 However, prison officials can forbid all correspondence between incarcerated individuals. 7. Can extremist "missionaries" be prevented from visiting prisons? Prison officials can ban categories of prison visitors, such as former inmates or visitors who have previously broken visiting rules. An extremist "missionary" can be barred from a prison because of generally applicable rules. In addition, prisons can create procedures for requesting visiting ministers, and impose conditions on the selection of the ministers, such as sponsorship by an outside religious organization. Prison officials can also exclude prison "missionaries" if they are advocating violence or otherwise fomenting prison unrest by encouraging racial tension. However, under RLUIPA, the prison would have to show that any restrictions on visiting clergy are the least restrictive means of achieving its end. Prison officials do not have a responsibility to hire a minister for each religious denomination represented in the prison population. However, if visiting ministers of one denomination are compensated, visiting ministers of other denominations must be equally compensated. Security limitations can be placed on inmate-led prayer or services, but again, under RLUIPA, the prison would have to show that any restrictions on such gatherings is the least restrictive means of achieving its end. For example, it is more likely that the prison could limit the frequency of such meetings, the number of attendees and require supervision than that such gatherings could be banned outright. 8. Under what circumstances must prisons accommodate prisoners' religious dietary requirements? Accommodating religiously based dietary rules has become an issue when dealing with extremists because incidents have raised concern that extremists "adopt" religious practices that are not based on sincere beliefs in order to obtain special privileges, such as specialized diets. Generally, if an inmate's request for a special diet is because of a sincerely held belief and religious in nature, the inmate has a constitutionally protected interest. Under RLUIPA, a request for a special religious diet can only be refused based on a compelling prison interest and if it is the least restrictive means possible for the prison protecting that interest. Prisons may offer more limited food selection to prisoners with religious dietary limitations, such as providing only cold kosher meals rather than hot food. In the past, when determining whether a prison was required to provided a special diet for a prisoner, courts have considered whether the dietary restrictions were central to the prisoner's religious observance. Under RLUIPA, such a determination would probably not be relevant. The threshold question in evaluating the prison's obligation to accommodate a request would still be whether the inmate's dietary request arose out of sincerely held beliefs that were religious in nature.
Be prepared with our Hurricane Guide, forecasts and latest storm news Henry M: The Day One Man's Memory Died The Hartford Courant Henry M. was awake as the surgeon inserted a metal straw deep within his brain and suctioned out a piece of tissue the length of an index finger. The surgeon, William Beecher Scoville of West Hartford, talked to the 27-year-old Hartford man during the experimental operation, which he hoped would end his patient's epileptic seizures. But a reduction in seizures came at a catastrophic cost: Henry no longer could make new memories. From that summer day in 1953, Henry M. never again retained a conscious recollection of people, places or things he encountered. His intelligence remained intact, but his memory turned into a sort of Etch A Sketch, perpetually erased seconds after he turns his attention elsewhere. Today, Henry M. is by most accounts a genial old man who lives in a Hartford area nursing home, unable to recognize aides who have cared for him for years. His most recent memories date to when Eisenhower was president. His full name and residence are secrets, jealously guarded by a few neuroscientists who have dubbed him H.M. and built their careers studying his profound loss. The precisely carved hole in Henry's brain has turned out to be a treasure trove of information about the multiple facets of memory. Over the decades, dozens of scientists have made a pilgrimage to meet Henry, seeking to mine meaning from the man who lost his ability to hold a half-century of his personal history. Henry is unaware that he has become one of the most famous subjects in the history of psychology -- a textbook example of the importance of memory in the formation of identity -- or that his story still spurs questions about medical ethics and patients' rights. Dr. James Duffy, an associate professor of psychiatry at the University of Connecticut and director of psychiatric consultation services at Hartford Hospital, says he has not met Henry but suspects the man has become an afterthought in science's relentless pursuit of knowledge. ``Scientists are good at slicing off pieces of patients and manipulating them under a microscope,'' Duffy said, ``but we don't want to take responsibility for their well-being.'' Wiped Away What the world knows of Henry M. is limited mostly to lifeless prose of psychology textbooks and scientific papers, which devote many more pages to the incisions that removed most of Henry's medial temporal lobe than to his likes and dislikes, his hopes and dreams. Scientists who have worked with Henry say his memories of childhood, adolescence and young adulthood -- the only conscious memories he has -- have a brittle, worn quality to them. For Henry, the people he talks with are always strangers. And his stories are invariably the same, lacking the sinew, blood and muscle with which memory infuses experience. ``The stories he tells are incredibly similar each time he tells them,'' said John Gabrieli, a neuroscientist at Stanford University who studied Henry extensively during the 1980s. ``There is a bland, stereotyped quality to his conversations. What are you going to say when everyone is a stranger?'' Henry is a big man who has become bigger and softer after years of a sedentary lifestyle. He likes to eat. He is going bald and wears glasses. He still takes medication to control epileptic seizures, which were reduced but not eliminated by the operation. Today, he has osteoporosis and recently has had to depend on a wheelchair to get around. He will need cataract surgery soon. Apparently, Henry was always good-natured, which makes it difficult to determine just how much his gentle, agreeable demeanor is the result of his operation. Henry seldom expresses any interest in the topic of sex, but he also had no serious girlfriends before the operation. So scientists don't know if Henry's sex drive, like his memory, was a casualty of the surgery. There is little biographical information available on Henry and much of it he has supplied himself. Henry M.'s father was an electrician who migrated from Louisiana in the 1920s to Hartford, where Henry was born in 1926. The family attended church in Hartford and moved to East Hartford by the time Henry was a teenager. Later, they moved to a more rural part of Hartford County. Henry remembers roller-skating. He remembers shooting his father's gun in the woods. But unless he is coached, he doesn't remember that his parents are dead. Unofficial Guardian The person who knows as much about Henry as anyone is Suzanne Corkin, a neuroscientist at the Massachusetts Institute of Technology who has worked with Henry since 1962. Corkin acts as a sort of unofficial guardian of Henry's interests, along with Montreal scientist Brenda Milner. It was Milner who, with Scoville, in 1957 co-authored the first scientific paper describing the extent of Henry's memory loss. Corkin and Milner decided that instead of conducting tests on Henry in Montreal, it would be easier to work with Henry at MIT, closer to his Hartford home. Corkin's connection to Henry's case actually reaches back into her childhood. She was Scoville's neighbor growing up on North Steele Road in West Hartford and remains friends with the surgeon's daughter. Corkin said she and Milner decided long ago not to allow the media to interview Henry and actively discouraged efforts to write about him. She said that it would be unethical to discuss his medical records and that there are few details of his life before the surgery. Misinformation about Henry is rampant, including reports that he may suffer from depression, she added. But other scientific researchers say that when it comes to controlling information about Henry, Corkin is as zealous with them as she is with reporters. Endel Tulving, a memory researcher and retired professor of psychology at the University of Toronto, said Corkin refused to allow him to tape-record an interview with Henry. ``It's just silliness,'' said Tulving. He said he has worked with a Canadian amnesiac with a similar devastating memory loss who has been interviewed on several television shows. Corkin said more than 100 scientists have worked with Henry during the past 50 years. One fact is almost universally reported about Henry. At the age of 9, Henry was knocked unconscious after he was hit by a bicyclist. Soon after, he experienced his first minor epileptic seizures. On his 16th birthday, he suffered a grand mal seizure. James Bond In Scrubs Henry was 27 -- and having as many as 10 minor seizures a day and at least one major seizure a week -- when his case came to the attention of Dr. William Beecher Scoville, a flamboyant descendant of the illustrious Connecticut family that produced ``Uncle Tom's Cabin'' author Harriet Beecher Stowe. Scoville was a fearless -- some say reckless -- pioneer in developing surgical remedies for a variety of intractable psychological conditions. He was best known internationally for his technical improvements in the performance of lobotomies, which then were regularly conducted at Hartford Hospital and the Institute of Living, one of the world's top centers for the treatment of mental illness. He received many awards for his work. He founded an international society of brain surgeons that still gives out an annual award in his name. The University of Connecticut Health Center has an endowed chair that bears his name. No one who met Scoville forgot him. While Henry M. is genial, meek and eager to please, Scoville was a sort of James Bond in scrubs who loved fast, expensive cars and motorcycles, a demanding dynamo in the operating room, brilliant at his craft. ``Bill drove fast, lived hard and operated where angels feared to tread,'' said Dr. David Crombie, former chief of surgery at Hartford Hospital who met Scoville in the early 1960s as an intern at the hospital and became friends with his son. Scoville was an early advocate of helmets for motorcyclists, but never wore one himself, despite riding at speeds that terrified friends and colleagues, Crombie recalled. ``He said you had to wear a helmet -- unless you were keenly aware,'' Crombie said. ``He had a sense of invincibility about him.'' Scoville typically operated on people with intractable schizophrenia or severe depression. But in 1953, Scoville thought he might be able to alleviate Henry's epilepsy. Epilepsy can originate within the medial temporal lobe, a structure that extends on both sides of the brain roughly under the temples. Scoville decided to remove a greater area of brain tissue from Henry than had been removed from patients who had undergone similar surgeries. A half-century ago, doctors did not need to get a hospital's permission to try innovative operations. They were under no obligation to conduct trials before they tried new procedures on a patient. Henry and other patients did not have to sign informed-consent papers saying they knew the risks involved, although it is unlikely Henry or his working-class parents would have questioned the advice of a famous surgeon. ``In those days, the doctor's word was God,'' said Al Herzog, a psychiatrist and vice president of medical affairs at Hartford Hospital. ``In an odd way, people like Scoville helped create the ethical standards in use today. By pushing the boundaries of surgical practice, Scoville and others led hospitals to establish institutional review boards, patient protocols, things like that.'' A `Successful' Operation Late in the summer of 1953, either at Hartford Hospital or at the nearby Institute of Living in the single operating room where lobotomies were performed, Scoville took out most of Henry's medial temporal lobe, including all or parts of the hippocampus and amygdala. Scoville originally dubbed the operation a success, although Henry couldn't remember the way to the bathroom or the names of the nurses who cared for him. A few years later in a research paper, Scoville would strongly urge surgeons not to duplicate his ``experimental'' operation because of its devastating effects on Henry's memory. ``It bothered him. You could see it in his eyes,'' recalls Dr. Robert Correll, director of psychology testing services at Hartford Hospital who came to Connecticut from Iowa University in 1958 to try with Scoville to duplicate the effects of the operation in monkeys. ``Bill's goal was to be perfect. He didn't make mistakes.'' In the decades that followed, Henry often told researchers that as a child he had wanted to be a brain surgeon. Henry seems to mingle the recollection of his childhood dream and his own operation, the last memory he would ever preserve, in a sort of never-ending loop. During one interview, Henry told a researcher that he nixed the idea of becoming a surgeon because he wore glasses, ``and you could make the wrong movement then ... and that person could be dead, or paralyzed.'' He was then asked if he remembered his own operation. ``Well, I think I was, ah, well, I'm having an argument with myself right away. I'm the third or fourth person who had it, and I think that they, well, possibly didn't make the right movement at the right time, themselves. But they learned something.'' They did, indeed, the researcher told Henry, who then again brought up Henry's childhood. ``A funny part, I always thought of being a brain surgeon myself. ... And then I said no to myself. ... An attendant might move your glasses over and you would make the wrong movement.'' Do you remember who the surgeon was who did your operation, the researcher asked. ``No, I don't.'' ``Sc--,'' the researcher hinted. ``Scoville,'' Henry said. Understanding The Mind Scoville was killed in 1984, at the age of 78, when he backed up his car on the highway to get to an exit he had missed. Renowned in his time for innovative improvements to a surgical procedure now held in disrepute, the confident, perfectionist surgeon is best remembered for obliterating the memory of a young working-class Hartford man. Science's understanding of the brain changed dramatically after Scoville and Milner published their paper in 1957 describing the effects of the operation. It had been impossible for scientists to determine how specific areas of the brain created the richness of the human mind -- most often understood in abstract terms, such as Sigmund Freud's id, ego and superego. ``Freud was stuck; he couldn't make those connections,'' Herzog said. ``But with cases like H.M., the connections became more obvious. You can't run away from the importance of H.M.'' One of the first lessons Henry taught scientists was that intelligence and memory are separate entities. Henry would have flunked out of any class in which he had to learn new information because of his inability to recall new facts. Yet his IQ remained slightly above average and his ability to solve problems was unaffected by the operation. ``We now know from 30 years of animal studies that it was the most devastating surgical resection you can possibly make, but it also stopped at the border of all the important areas of the brain associated with intelligence,'' Gabrieli said. And because Henry could retain memories for very short periods of time, it became clear that different structures of the brain perform different functions in the storage and retrieval of memories. The brain structures removed by Scoville turned out to be crucial in converting experience into long-term memories, but not in storing them. ``Until H.M., memory was viewed as essentially a unitary faculty,'' said Larry Squire, a neuroscientist at the University of California at San Diego and a leading memory researcher. Scientists knew during the 1950s, for instance, that motor and muscle skill memories were processed differently than, say, how we recall that Bismarck is the capital of North Dakota. ``But that proved to be tip of the iceberg,'' Squire said. One of the major hurdles that confronted scientists studying Henry is that the medial temporal lobe contains several brain structures. In the decades since Scoville operated, scientists such as Squire have worked with animals to try to tease out the specific function of each of these individual structures. The discipline known as cognitive neuroscience emerged to describe how various parts of the brain cooperate and allow humans to accomplish complex tasks such as memorization. ``He is the most dramatic example of a patient who tragically became an experiment of nature,'' said Eric Kandel, Nobel laureate and professor of physiology and psychology at Columbia University. ``That single case enlightened a whole body of knowledge.'' Learning Vs. Remembering Scientists became so infatuated with Henry, Tulving said, that they missed evidence that other areas of the brain also contribute to memory. ``I think H.M. was a bad thing for our science. Everyone got mesmerized by H.M.,'' Tulving said. ``The whole world revolved around one case, and other cases were not followed up.'' Experiments with Henry and other amnesiacs and, more recently, various brain-imaging studies have revealed that memory is a multilayered set of processes. In some cases, such as in our recall of emotionally charged events, those processes can be at work without our conscious awareness. In one early study, Henry showed that he could learn new skills, even though he had no conscious recollection of having previously performed the task. Henry got better at copying shapes he viewed through a mirror, even though he told researchers he had never done it before. Gabrieli's research showed Henry can do the same thing with some word tasks. Gabrieli provided Henry with a list of words such as tangerine, apple and bazooka. When asked minutes later, Henry could not remember any of the words on the list. ``But when you ask him, `Can you name a weapon?' he will say, `Bazooka.' And then he says, `Why, that's an odd weapon. I wonder why I picked that one?''' Gabrieli said. Such studies have shown that different types of memory are compartmentalized in different areas -- and also that the brain has the flexibility to compensate for some deficits. For instance, Lawrence Weiskrantz of the experimental psychology department at Oxford University has studied a phenomenon he calls ``blindsight.'' Weiskrantz, who coincidentally was working at Hartford Hospital on his thesis when Scoville operated on Henry, worked with subjects who are blind because of damage in their brain. Despite the damage to their visual cortex, they can ``see'' objects. When asked to grab for flashing bars projected onto a screen, the subjects protested they could not see the bars. But, when asked to ``guess,'' they reached toward the flashing bars with great accuracy. Henry knows nothing of his legacy. Time essentially stopped for him 50 years ago. His last conscious memories are of the years before 1953, although his image in the mirror and other evidence seem to convince him that time has passed which he can't account for. Asked where he lives, Henry often gives the address of a house where he lived before the operation. Pressed to recall if he had met a visitor before, he might guess he or she was someone he knew in his youth. ``He thinks we went to high school together,'' Corkin said. Since 1980, Henry has lived in a nursing home, where he likes to do crossword puzzles. While doctors have treated Henry for a variety of ailments, Corkin said, ``there is no treatment for memory impairment.'' As Kandel said: ``It's hard for us to conceive what he really experiences.'' Waking From A Dream Henry used to travel three times a year to MIT, where scientists conducted experiments on him. But Henry has become frail enough in recent years that the scientists now come to him, Corkin said. When Henry is asked whether he is willing to participate in such studies, he invariably agrees, always saying other people may be helped by such knowledge. Where does that belief come from? ``That's puzzled me, too,'' Gabrieli said. Henry has no way of knowing that the research of the past 50 years has helped people. And such an idea couldn't be planted in his mind because he lacks the parts of his brain necessary to store and retrieve such a suggestion. Gabrieli speculates that Henry might be reaching back to one of his last memories, when Scoville or another doctor might have told him that other epileptics could benefit from the lessons learned from his surgery. So, again and again for the past half-century, Henry has agreed to be the subject of experiments, just as he did before surgery robbed him of his memory. Corkin offers a different explanation: ``I think he was just well brought up.'' Today, Henry is still the subject of experiments, although other amnesiacs with related memory deficits have been discovered and studied. New imaging technologies also have revolutionized the study of memory by allowing scientists to view the brain working in healthy subjects. Yet Henry's life continues to fascinate. ``Whenever I give a talk about H.M., the questions never stop,'' Corkin said. ``The audience asks questions; people come up and ask me questions afterwards. It happens every time. He is a national treasure.'' As the 50th anniversary of the operation approaches, Dr. James Duffy has come to believe that society, which has learned so much from Henry, owes him something more. ``What is my responsibility as a scientist? Is it to just generate knowledge, or is it something else?'' Duffy asked. ``Henry presents us with questions larger than the mechanics of the memory system. We need to understand what he has become in the absence of memory. ``Why is it that we only ask about his memory,'' Duffy said, ``not about who he has become?'' Corkin cautioned against drawing any universal conclusions from Henry's situation. ``Henry is an `n' of one,'' she said, using a mathematical symbol to stress his singularity. ``It is not clear how his experience can generalize to anyone.'' Every moment, as his past disappears into an abyss, Henry asks his own set of questions. ``Right now, I am wondering if I have done or said anything amiss,'' Henry once told a researcher. ``You see, at this moment everything looks clear to me, but what happened just before, that's what worries me. It's like waking from a dream I just don't remember.'' Copyright © 2017, Orlando Sentinel
Wikipedia sobre física de partículas Rapidinho. Me falaram que a definição de física de partículas da Wikipedia era muito ruim. E de fato, era assim: Particle physics is a branch of physics that studies the elementary particle|elementary subatomic constituents of matter and radiation, and their interactions. The field is also called high energy physics, because many elementary particles do not occur under ambient conditions on Earth. They can only be created artificially during high energy collisions with other particles in particle accelerators. Particle physics has evolved out of its parent field of nuclear physics and is typically still taught in close association with it. Scientific research in this area has produced a long list of particles. Mas hein? Partículas que só podem ser criadas em aceleradores? Física de partículas é ensinada junto com física nuclear? A pesquisa produz partículas (essa é ótima!)? Em que mundo essa pessoa vive? Reescrevi: Particle Physics is a branch of physics that studies the existence and interactions of particles, which are the constituents of what is usually referred as matter or radiation. In our current understanding, particles are excitations of quantum fields and interact following their dynamics. Most of the interest in this area is in fundamental fields, those that cannot be described as a bound state of other fields. The set of fundamental fields and their dynamics are summarized in a model called the Standard Model and, therefore, Particle Physics is largely the study of the Standard Model particle content and its possible extensions. Eu acho que ficou bem melhor. Vamos ver em quanto tempo algum editor esquentado da Wikipedia vai demorar para reverter. Atualmente está um saco participar da Wikipedia por causa dessas pessoas.
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
151