content
stringlengths
7
2.61M
/* Package sll implement the simples imaginalble single-linked list, with useful methods for accessing deelply nested list (aka "trees"), and decent string representations. It's mostly inspired by Lisp's Cons data structure used to represent trees (like "abstract suntax trees" aka ASTs) like nested lists of lists, also called S-expressions. Due to both its conceptual origins and the desire for the simplest possible implementation, an "element" and a "list" are the same thing: an element is the "head" of the list starting from it. Nevertheless, this is meant to be used only as a list, so the "cons pair" behavior from the Lisp world is not supported as this can only cause confusion in a language like Go. It's `Get` is loosely inspired by Clojure's `get-in` but adapted to be more Go-idiomatic. */ package sll import ( "errors" "fmt" "strings" ) // Element represents the (head) element of a singly linked list type Element struct { Value interface{} Next *Element } // New creates a new singly linked list with the given args as values func New(vals ...interface{}) *Element { var r *Element for i := len(vals) - 1; i >= 0; i-- { r = &Element{Value: vals[i], Next: r} // fmt.Printf("r = %+v\n", r) } return r } // Len gives the lengths of a (possibly nested) lists func (e *Element) Len() int { if e == nil { return 0 } sz := 1 for p := e; p.Next != nil; p = p.Next { // fmt.Println(p.Value) sz++ if sz > 10 { break } } return sz } // String gives an S-expression style (parens and values) string representation func (e *Element) String() string { words := make([]string, 0, 3*e.Len()) for p := e; p != nil; p = p.Next { words = append(words, fmt.Sprint(p.Value)) } return "(" + strings.Join(words, " ") + ")" } // Dump returns a more debugging-friendly string representation func (e *Element) Dump() string { words := make([]string, 0, 3*e.Len()) for p := e; p != nil; p = p.Next { switch v := p.Value.(type) { case *Element: words = append(words, v.Dump()) default: words = append(words, fmt.Sprintf("%v::%T", v, v)) } } return "[" + strings.Join(words, " ") + "]" } // Get fetches an element e[ks[0]]...[ks[n]] from a (possible nested) list func (e *Element) Get(ks ...int) (interface{}, error) { if e == nil { return nil, errors.New("empty list") } v := e iMax := len(ks) - 1 for i, k := range ks { for j := 0; j < k; j++ { if v.Next == nil { return nil, fmt.Errorf("invalid index: %d (arg %d), max here is %d", k, i, j) } v = v.Next } if i < iMax { subTree, ok := v.Value.(*Element) if !ok { return nil, fmt.Errorf("invalid index: %d (arg %d), value not a sub-list", k, i) } v = subTree } } return v.Value, nil } func (e *Element) GetFrom(k int) (*Element, error) { p := e for i := 0; i < k; i++ { if p.Next == nil { return nil, fmt.Errorf("invalid index: %d, last is %d", k, i) } p = p.Next } return p, nil } func (e *Element) GetList(kss ...[]int) (*Element, error) { res := make([]interface{}, 0, len(kss)) for _, ks := range kss { r, err := e.Get(ks...) if err != nil { return nil, err } res = append(res, r) } return New(res...), nil } func Getter(ks ...int) func(*Element) (interface{}, error) { return func(e *Element) (interface{}, error) { return e.Get(ks...) } } func GenericGetter(ks ...int) func(interface{}) (interface{}, error) { return func(e interface{}) (interface{}, error) { return e.(*Element).Get(ks...) } } func GetterFrom(k int) func(*Element) (*Element, error) { return func(e *Element) (*Element, error) { return e.GetFrom(k) } } func GenericGetterFrom(k int) func(interface{}) (interface{}, error) { return func(e interface{}) (interface{}, error) { return e.(*Element).GetFrom(k) } } func ListGetter(kss ...[]int) func(*Element) (*Element, error) { return func(e *Element) (*Element, error) { return e.GetList(kss...) } } func GenericListGetter(kss ...[]int) func(interface{}) (interface{}, error) { return func(e interface{}) (interface{}, error) { return e.(*Element).GetList(kss...) } } func Cons(value interface{}, next *Element) *Element { return &Element{Value: value, Next: next} } func ConsGetter(ks1 []int, ks2 []int) func(*Element) (*Element, error) { return func(e *Element) (*Element, error) { value, err := e.Get(ks1...) if err != nil { return nil, err } next, err := e.Get(ks2...) if err != nil { return nil, err } return Cons(value, next.(*Element)), nil } } func GenericConsGetter(ks1 []int, ks2 []int) func(interface{}) (interface{}, error) { return func(e interface{}) (interface{}, error) { return ConsGetter(ks1, ks2)(e.(*Element)) } }
import java.util.HashMap; import java.util.Map; import java.util.Scanner; /** * https://codeforces.com/problemset/problem/499/B */ public class Problem499B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); //the no of words in professor lecture int m = sc.nextInt(); // the no of words in the language Map<String, String> languages = new HashMap<>(); //stores the language StringBuilder result = new StringBuilder(); String s, s1; while (m-- >= 1) { s = sc.next(); s1 = sc.next(); languages.put(s, (s.length() <= s1.length()) ? s : s1); } while (n-- >= 1) { result.append(languages.get(sc.next())); result.append(" "); } System.out.println(result.toString().trim()); } }
import * as ts from 'typescript'; import { compile, loadTsconfig, watchCompile, findTsconfig, mergeRootDirsOnWrite, } from './compiler'; /* These solutions do not support source maps */ export function buildTests(testsPath: string) { const tsconfigPath = findTsconfig(testsPath); if (!tsconfigPath) throw new Error('tsconfig.json is missing'); const tsconfig = loadTsconfig(tsconfigPath); if (!tsconfig) throw new Error(`Something went wrong while loading ${tsconfigPath}`); const options = tsconfig.options; options.noEmit = false; const compilerHost = ts.createCompilerHost(options); mergeRootDirsOnWrite(compilerHost, options); compile(tsconfig.fileNames, options, compilerHost); } export function watchTests(testsPath: string) { watchCompile(testsPath, mergeRootDirsOnWrite); }
/* Compile the regular expression regex to see if it's valid. Return * TRUE if it is, or FALSE otherwise. */ bool nregcomp(const char *regex, int eflags) { regex_t preg; const char *r = fixbounds(regex); int rc = regcomp(&preg, r, REG_EXTENDED | eflags); if (rc != 0) { size_t len = regerror(rc, &preg, NULL, 0); char *str = charalloc(len); regerror(rc, &preg, str, len); rcfile_error(N_("Bad regex \"%s\": %s"), r, str); free(str); } regfree(&preg); return (rc == 0); }
<reponame>dima-vm/private-VictoriaMetrics // Code generated by qtc from "query_response.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. //line app/vmselect/prometheus/query_response.qtpl:1 package prometheus //line app/vmselect/prometheus/query_response.qtpl:1 import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vmselect/netstorage" ) // QueryResponse generates response for /api/v1/query.See https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries //line app/vmselect/prometheus/query_response.qtpl:8 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) //line app/vmselect/prometheus/query_response.qtpl:8 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) //line app/vmselect/prometheus/query_response.qtpl:8 func StreamQueryResponse(qw422016 *qt422016.Writer, rs []netstorage.Result) { //line app/vmselect/prometheus/query_response.qtpl:8 qw422016.N().S(`{"status":"success","data":{"resultType":"vector","result":[`) //line app/vmselect/prometheus/query_response.qtpl:14 if len(rs) > 0 { //line app/vmselect/prometheus/query_response.qtpl:14 qw422016.N().S(`{"metric":`) //line app/vmselect/prometheus/query_response.qtpl:16 streammetricNameObject(qw422016, &rs[0].MetricName) //line app/vmselect/prometheus/query_response.qtpl:16 qw422016.N().S(`,"value":`) //line app/vmselect/prometheus/query_response.qtpl:17 streammetricRow(qw422016, rs[0].Timestamps[0], rs[0].Values[0]) //line app/vmselect/prometheus/query_response.qtpl:17 qw422016.N().S(`}`) //line app/vmselect/prometheus/query_response.qtpl:19 rs = rs[1:] //line app/vmselect/prometheus/query_response.qtpl:20 for i := range rs { //line app/vmselect/prometheus/query_response.qtpl:21 r := &rs[i] //line app/vmselect/prometheus/query_response.qtpl:21 qw422016.N().S(`,{"metric":`) //line app/vmselect/prometheus/query_response.qtpl:23 streammetricNameObject(qw422016, &r.MetricName) //line app/vmselect/prometheus/query_response.qtpl:23 qw422016.N().S(`,"value":`) //line app/vmselect/prometheus/query_response.qtpl:24 streammetricRow(qw422016, r.Timestamps[0], r.Values[0]) //line app/vmselect/prometheus/query_response.qtpl:24 qw422016.N().S(`}`) //line app/vmselect/prometheus/query_response.qtpl:26 } //line app/vmselect/prometheus/query_response.qtpl:27 } //line app/vmselect/prometheus/query_response.qtpl:27 qw422016.N().S(`]}}`) //line app/vmselect/prometheus/query_response.qtpl:31 } //line app/vmselect/prometheus/query_response.qtpl:31 func WriteQueryResponse(qq422016 qtio422016.Writer, rs []netstorage.Result) { //line app/vmselect/prometheus/query_response.qtpl:31 qw422016 := qt422016.AcquireWriter(qq422016) //line app/vmselect/prometheus/query_response.qtpl:31 StreamQueryResponse(qw422016, rs) //line app/vmselect/prometheus/query_response.qtpl:31 qt422016.ReleaseWriter(qw422016) //line app/vmselect/prometheus/query_response.qtpl:31 } //line app/vmselect/prometheus/query_response.qtpl:31 func QueryResponse(rs []netstorage.Result) string { //line app/vmselect/prometheus/query_response.qtpl:31 qb422016 := qt422016.AcquireByteBuffer() //line app/vmselect/prometheus/query_response.qtpl:31 WriteQueryResponse(qb422016, rs) //line app/vmselect/prometheus/query_response.qtpl:31 qs422016 := string(qb422016.B) //line app/vmselect/prometheus/query_response.qtpl:31 qt422016.ReleaseByteBuffer(qb422016) //line app/vmselect/prometheus/query_response.qtpl:31 return qs422016 //line app/vmselect/prometheus/query_response.qtpl:31 }
ANN ARBOR, MI - Referencing a 193-vehicle pile-up in January 2015 on I-94 near Hartford, Carrie Morton explained exactly how vehicle connectivity could have drastically reduced the number of cars involved in the historic crash. "With vehicle-to-vehicle and vehicle-to-infrastructure technology relaying that information to vehicles further back, in a matter of a second we could tell all of those vehicles approaching that blind snow that the vehicles in front of them were stopped, avoiding that accident," Morton said to a crowd touring Mcity, a one-of-a-kind test site for connected and automated vehicles located on the University of Michigan's North Campus Research Center. "Maybe one or two cars would have been in that accident, but we could have avoided the majority of those vehicles being involved." The anecdote provided guests during Thursday's open house with a real-world example of how the technologies being tested inside Mcity would ideally be applied in the real world. For many, the open house was the first look inside the 32-acre simulated urban and suburban environment, which features roads with intersections, traffic signs and signals, streetlights, building facades, sidewalks and construction obstacles since it opened in July. Morton, the deputy director of the University of Michigan's Mobility Transformation Center, said the simulated city allows the university's researchers and its private leadership circle partners a space to test intricate scenarios and collect data before deploying those technologies out into the real world. "We created MCity as an opportunity to test reliably, repeatedly and safely these technologies in an off-roadway environment," she said. "We can do lots of things here we can't do on the streets of Ann Arbor. But once we are confident in the technology we can take all of that learning and safely take it out onto the streets of Ann Arbor, where hopefully we'll deploy a small mobility service of automated vehicles in the near future. "Instead of looking at just the vehicle, we're looking at the vehicle and its surroundings," she added. "That's what makes it very different from typical automotive testing. All of these features are meant to be subtle tricks for the perception systems of these vehicles." A key goal of the MTC initiative and Mcity is to implement a connected and automated mobility system on the streets of southeastern Michigan by 2021. Connected vehicles anonymously and securely exchange data -- including location, speed and direction -- with other vehicles and the surrounding infrastructure via wireless communication devices. This data can warn individual drivers of traffic tie-ups or emerging dangerous situations, such as a car slipping on ice around an upcoming curve, or a car that might be likely to run a red light ahead. MTC Director Huei Peng said the goal is to eventually have 9,000 - or 10 percent - of the roughly 90,000 vehicles in the city "connected" by having them sign up to have awareness devices installed to transmit their data on Ann Arbor's roads. Making the public aware of the technologies being implemented in Mcity gives them some context to the work being done by MTC in an informal environment, he said. "We must use them in a cost-effective way and we must use them to address societal issues like safety, traffic congestion and energy consumption," he said. "It's important that we not only do our research, but keep the public aware and informed of what we do. We need to have some of our technologies deployed on volunteers' vehicles. "Some of these communications need a high penetration rate," he added. "Suppose we want to test a vehicle's need to have urgent braking and that was broadcast to the vehicle behind it. Even just by reacting a half second early, it is very significant. It can mean the different between crash and no crash." The MTC is responsible for the development of Mcity, which has seen consistent modifications to infrastructure since July. It has 18 leadership circle partners on board in public-private partnership between the university and companies including Delphi Automotive, DENSO Corp., Honda, Ford, General Motors, Toyota, Verizon, Xerox and others. A number of those partners and 43 additional affiliate partners were on hand Thursday to explain their role in helping implement the three different vehicle deployments MTC is working on through Connected Ann Arbor. Creating a connection with the public, which also was able to sign up for the Ann Arbor Connected Vehicle Test Environment, was part of the focus of the open house. Recruiting people to become connected has been more challenging since the Ann Arbor Connected Vehicle Safety Pilot Model Deployment the University of Michigan Transportation Research Institute launched in 2012 came to a close. Sponsored by the US Department of Transportation, the $31 million program of around 2,800 private cars, trucks and buses allowed wireless communication with each other and with devices in the roadway infrastructure of northeast Ann Arbor. "One of our issues in recruitment was in the first three years (of the pilot model deployment) we paid people to participate," UMTRI research specialist Mary Lynn Buonarosa said. "With the Ann Arbor Connected Vehicle Test Environment, we do not pay people, so we have greater recruiting challenges. We went from 2,800 connected vehicles to about 1,200 vehicles on the road." Buonarosa explained that the installation only takes about 45 minutes and participants must make a one-year commitment to being a connected vehicle. Installation isn't intrusive or permanent to the vehicle, she said, and consists of two antennas for GPS and dedicated short range communication and a small box stored in the trunk of the vehicle. Transmitting their vehicle's speed and latitude and longitude coordinates, Buonarosa said participants are not impacted by the technology, but provide a great deal of help to the research being done by MTC and UMTRI. "They are simply announcing their presence on the road," she said of the technology "They are participating in a way that's quiet, with no beeps or buzzers. They are just transmitting their data. Our goal is to have thousands of vehicles transmitting their data. Then we have receiver vehicles that are able to receive that information and receive warning for people potentially doing an emergency braking maneuver or if they're approaching a curve at too high a speed."
U.S. Climate Reference Network Soil Moisture Observations with Triple Redundancy: Measurement Variability Between 2009 and 2011, the U.S. Climate Reference Network (USCRN) was augmented with soil moisture/soil temperature probes and atmospheric relative humidity instruments as part of a programmatic expansion in support of the National Integrated Drought Information System (NIDIS). The 114 sites in this sparse network are well distributed across the conterminous United States in open, rural locations expected to remain unchanged in land use for many decades into the future. Soil probes are installed in triplicate redundancy, similar to the air temperature and precipitation measurements, at either five standard World Meteorological Organization (WMO) depths (5, 10, 20, 50, and 100 cm) or only two depths (5 and 10 cm) depending on the nature of the underlying materials. Stations also measure air temperature, surface skin temperature, precipitation, solar radiation, and 1.5m wind speed. In addition to sensor failure, the triplicate design of USCRN soil probes have allowed for an initial characterization of variability of soil moisture measurements. Nationwide analysis of soil moisture during earlytomid growing season in 2011 and 2012 was performed to examine the differences in response to the widespread drought of 2012. The redundancy of the network helps retain the continuity of the record over time, and also provides key insights into the variations of measurements at a single location that are related to a combination of installation effects and the impacts of soil differences at the local level. This article highlights the usefulness of deploying triplicate configurations of soil probes for detecting faulty sensors and for better understanding the nature of soil moisture measurement variability.
<reponame>hnrck/rrosace<gh_stars>0 /** * @file rrosace_cables.h * @brief RROSACE Scheduling of cyber-physical system library cables header. * @author <NAME> * @version 1.0.0 * @date 2016-06-10 * * Based on the Open Source ROSACE (Research Open-Source Avionics and Control * Engineering) case study. * Implementations of ROSACE available at: * https://svn.onera.fr/schedmcore/branches/ROSACE_CaseStudy/ * Publication of ROSACE available at: * https://oatao.univ-toulouse.fr/11522/1/Siron_11522.pdf * Publication of RROSACE available at: * https://svn.onera.fr/schedmcore/branches/ROSACE_CaseStudy/redundant/report_redundant_rosace_matlab.pdf */ #ifndef RROSACE_CABLES_H #define RROSACE_CABLES_H #include <rrosace_common.h> /** Cables default freq */ #define RROSACE_CABLES_DEFAULT_FREQ (RROSACE_DEFAULT_PHYSICAL_FREQ) #include <stddef.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** RROSACE relays states */ enum rrosace_relay_state { RROSACE_RELAY_CLOSED, /**< relay is closed, equivalent to True */ RROSACE_RELAY_OPENED /**< relay is opened, equivalent to False */ }; typedef enum rrosace_relay_state rrosace_relay_state_t; /** @struct rrosace_cables_input RROSACE cables input data from FCCs */ struct rrosace_cables_input { double delta_e_c; /**< Elevator deflection command from FCCs */ double delta_th_c; /**< Throttle command from FCCs */ rrosace_relay_state_t relay_delta_e_c; /**< Relay value for elevator deflection command */ rrosace_relay_state_t relay_delta_th_c; /**< Relay value for delta throttle command */ }; /** @typedef Alias for cables input */ typedef struct rrosace_cables_input rrosace_cables_input_t; /** @struct rrosace_cables_input RROSACE cables output data for engine and * elevator */ struct rrosace_cables_output { double delta_e_c; /**< Elevator deflection command for elevator */ double delta_th_c; /**< Delta throttle command for engine */ }; /** @typedef Alias for cables output */ typedef struct rrosace_cables_output rrosace_cables_output_t; /** * @brief cables step, consume inputs and produce output * @param[in] inputs the data from FCCs to consume * @param[in] nb_input the number of FCCs data to consume * @param[out] p_output a pointer to the data to produce to elevator and * engine * @return EXIT_SUCCESS if OK, else EXIT_FAILURE */ int rrosace_cables_step(const rrosace_cables_input_t inputs[], size_t nb_input, rrosace_cables_output_t *p_output); #ifdef __cplusplus } namespace RROSACE { /** @class Cables * @brief C++ wrapper for C-based cables, based on Model interface. */ class Cables #if __cplusplus > 199711L final #endif /* __cplusplus > 199711L */ : public Model { public: /** Alias for RROSACE cables input */ #if __cplusplus <= 199711L typedef struct rrosace_cables_input Input; #else using Input = struct rrosace_cables_input; #endif /* __cplusplus <= 199711L */ /** Alias for RROSACE cables output */ #if __cplusplus <= 199711L typedef struct rrosace_cables_output Output; #else using Output = struct rrosace_cables_output; #endif /* __cplusplus <= 199711L */ /** Relay is closed, equivalent to True */ static const int RELAY_CLOSED = RROSACE_RELAY_CLOSED; /** Relay is opened, equivalent to False */ static const int RELAY_OPENED = RROSACE_RELAY_OPENED; /** Alias for RROSACE cables relay state */ #if __cplusplus <= 199711L typedef enum rrosace_relay_state RelayState; #else using RelayState = enum rrosace_relay_state; #endif /* __cplusplus <= 199711L */ private: /** Cables first delta e commanded */ const double &r_delta_e_c_partial_1; /** Cables first delta th commanded */ const double &r_delta_th_c_partial_1; /** Cables first relay on delta e commanded */ const RelayState &r_relay_delta_e_c_1; /** Cables first relay on delta th commanded */ const RelayState &r_relay_delta_th_c_1; /** Cables second delta e commanded */ const double &r_delta_e_c_partial_2; /** Cables second delta th commanded */ const double &r_delta_th_c_partial_2; /** Cables second relay on delta e commanded */ const RelayState &r_relay_delta_e_c_2; /** Cables second relay on delta th commanded */ const RelayState &r_relay_delta_th_c_2; /** Cables delta e outputed */ double &r_delta_e_c; /** Cables delta th outputed */ double &r_delta_th_c; /** Cables period */ double m_dt; public: /** Default cables frequency */ static const int DEFAULT_FREQ = RROSACE_CABLES_DEFAULT_FREQ; /** * @brief Cables constructor * @param[in] delta_e_c_partial_1 Cables first delta e commanded * @param[in] delta_th_c_partial_1 Cables first delta th commanded * @param[in] relay_delta_e_c_1 Cables first relay on delta e commanded * @param[in] relay_delta_th_c_1 Cables first relay on delta th commanded * @param[in] delta_e_c_partial_2 Cables second delta e commanded * @param[in] delta_th_c_partial_2 Cables second delta th commanded * @param[in] relay_delta_e_c_2 Cables second relay on delta e commanded * @param[in] relay_delta_th_c_2 Cables second relay on delta th commanded * @param[out] delta_e_c Cables delta e outputed * @param[out] delta_th_c Cables delta th outputed * @param[in] dt The execution period of the cables model instance, default 1 * / DEFAULT_FREQ */ Cables(const double &delta_e_c_partial_1, const double &delta_th_c_partial_1, const RelayState &relay_delta_e_c_1, const RelayState &relay_delta_th_c_1, const double &delta_e_c_partial_2, const double &delta_th_c_partial_2, const RelayState &relay_delta_e_c_2, const RelayState &relay_delta_th_c_2, double &delta_e_c, double &delta_th_c, double dt = 1. / DEFAULT_FREQ) : r_delta_e_c_partial_1(delta_e_c_partial_1), r_delta_th_c_partial_1(delta_th_c_partial_1), r_relay_delta_e_c_1(relay_delta_e_c_1), r_relay_delta_th_c_1(relay_delta_th_c_1), r_delta_e_c_partial_2(delta_e_c_partial_2), r_delta_th_c_partial_2(delta_th_c_partial_2), r_relay_delta_e_c_2(relay_delta_e_c_2), r_relay_delta_th_c_2(relay_delta_th_c_2), r_delta_e_c(delta_e_c), r_delta_th_c(delta_th_c), m_dt(dt) {} /** * @brief Cables copy constructor * @param[in] other another cables to construct */ Cables(const Cables &other) : r_delta_e_c_partial_1(other.r_delta_e_c_partial_1), r_delta_th_c_partial_1(other.r_delta_th_c_partial_1), r_relay_delta_e_c_1(other.r_relay_delta_e_c_1), r_relay_delta_th_c_1(other.r_relay_delta_th_c_1), r_delta_e_c_partial_2(other.r_delta_e_c_partial_2), r_delta_th_c_partial_2(other.r_delta_th_c_partial_2), r_relay_delta_e_c_2(other.r_relay_delta_e_c_2), r_relay_delta_th_c_2(other.r_relay_delta_th_c_2), r_delta_e_c(other.r_delta_e_c), r_delta_th_c(other.r_delta_th_c), m_dt(other.m_dt) {} /** * @brief Cables copy assignement * @param[in] other another cables to construct */ Cables &operator=(const Cables &) { return *this; } #if __cplusplus > 199711L /** * @brief Cables move constructor * @param[in] ' ' an cables to move */ Cables(Cables &&) = default; /** * @brief Cables move assignement * @param[in] ' ' an cables to move */ Cables &operator=(Cables &&) = delete; #endif /* __cplusplus > 199711L */ /** * @brief Cables destructor */ ~Cables() {} /** * @brief Execute an cables model instance */ void step() { int ret; const Input inputs[2] = {{r_delta_e_c_partial_1, r_delta_th_c_partial_1, r_relay_delta_e_c_1, r_relay_delta_th_c_1}, {r_delta_e_c_partial_2, r_delta_th_c_partial_2, r_relay_delta_e_c_2, r_relay_delta_th_c_2}}; Output output; ret = rrosace_cables_step(inputs, 2, &output); r_delta_e_c = output.delta_e_c; r_delta_th_c = output.delta_th_c; if (ret == EXIT_FAILURE) { throw(std::runtime_error("Cables step failed.")); } } /** * @brief Get period set in model * @return period, in s */ #if __cplusplus >= 201703L [[nodiscard]] #endif double get_dt() const { return m_dt; } }; } /* namespace RROSACE */ #endif /* __cplusplus */ #endif /* RROSACE_CABLES_H */
2002 United States steel tariff The tariff The temporary tariffs of 8–30% were originally scheduled to remain in effect until 2005. They were imposed to give U.S. steel makers protection from what a U.S. probe determined was a detrimental surge in steel imports. More than 30 steel makers had declared bankruptcy in recent years. Steel producers had originally sought up to a 40% tariff. Canada and Mexico were exempt from the tariffs because of penalties the United States would face under the North American Free Trade Agreement (NAFTA). Additionally, some developing countries such as Argentina, Thailand, and Turkey were also exempt. The typical steel tariff at the time was usually between zero and one percent, making the 8–30% rates seem exceptionally high. These rates, though, are comparable to the standard permanent U.S. tariff rates on many kinds of clothes and shoes. The Bush administration justified the tariffs as an anti-dumping response, namely that the US steel industry had to be protected against sudden surges of imports of steel. Political response in the United States Both the issuing and the lifting of the tariffs caused controversy in the United States. Some of the president's political opponents, such as Democratic House Representative Dick Gephardt, criticized the plan for not going far enough. For some of the president's conservative allies, imposing the tariff was a step away from Bush's commitment to free trade. Critics also contended that the tariffs would harm consumers and U.S. businesses that relied on steel imports, and would cut more jobs than it would save in the steel industry. Supporters of the tariffs believed that U.S. steel producers were being harmed by a "surge" of steel imports endangering the viability of American steel companies. There was a widespread belief on all sides of the debate, confirmed by top Bush administration officials, that politics played a role in the decision to impose tariffs. Namely, the steel-producing swing states of Pennsylvania, Ohio and West Virginia would benefit from the tariffs. However, steel-using states, such as Tennessee and Michigan were harmed by the tariffs. The placement of the tariffs was an odd one for Bush, who had signed numerous free trade agreements during his term in office. This was widely believed to be a calculated political decision, insofar as the localities that stood to benefit were marginal ones. Both the George H. W. Bush administration and the Reagan administration also imposed import limits on steel. A 2005 study found that in coverage of the tariffs in the New York Times and Wall Street Journal, there were more sentences devoted to the negative impacts of steel tariffs than sentences on the benefits. The authors argue that this is consistent with a model whereby "more newspaper space would be devoted to the costs of steel tariffs—which are widely dispersed—than to their benefits—which are narrowly targeted." International response The tariffs ignited international controversy as well. Immediately after they were filed, the European Union announced that it would impose retaliatory tariffs on the United States, thus risking the start of a major trade war. To decide whether or not the steel tariffs were fair, a case was filed at the Dispute Settlement Body of the World Trade Organization (WTO). Japan, Korea, China, Taiwan, Switzerland, Brazil and others joined with similar cases. On November 11, 2003, the WTO came out against the steel tariffs, saying that they had not been imposed during a period of import surge—steel imports had actually dropped a bit during 2001 and 2002—and that the tariffs therefore were a violation of America's WTO tariff-rate commitments. The ruling authorized more than $2 billion in sanctions, the largest penalty ever imposed by the WTO against a member state, if the United States did not quickly remove the tariffs. After receiving the verdict, Bush declared that he would preserve the tariffs. In retaliation, the European Union threatened to counter with tariffs of its own on products ranging from Florida oranges to cars produced in Michigan, with each tariff calculated to likewise hurt the President in a key marginal state. The United States backed down and withdrew the tariffs on December 4. The early withdrawal of the tariffs also drew political criticism from steel producers and supporters of protectionism. The move was cheered by proponents of free trade and steel importers. When he lifted the tariffs, Bush said, "I took action to give the industry a chance to adjust to the surge in foreign imports and to give relief to the workers and communities that depend on steel for their jobs and livelihoods. These safeguard measures have now achieved their purpose, and as a result of changed economic circumstances it is time to lift them". Impact In September 2003, the U.S. International Trade Commission (ITC) examined the economic effects of the Bush 2002 steel tariffs. The economy-wide analysis was designed to focus on the impacts that arose from the relative price changes resulting from the imposition of the tariffs, and estimated that the impact of the tariffs on the U.S. welfare ranged between a gain of $65.6 million (0.0006% of GDP) to a loss of $110.0 million (0.0011% of GDP), "with a central estimate of a welfare loss of $41.6 million." A majority of steel-consuming businesses reported that neither continuing nor ending the tariffs would change employment, international competitiveness, or capital investment. According to a 2005 review of existing research, all studies on the tariffs "find that the costs of the Safeguard Measures outweighed their benefits in terms of aggregate GDP and employment as well as having an important redistributive impact." Steel production rose slightly during the period of the tariff. The protection of the steel industry in the United States may have had unintended consequences and perverse effects. A study from 2003 that was paid for by CITAC (Consuming Industries Trade Action Coalition), a trade association of businesses that use raw materials, found that around 200,000 jobs were lost as a result. The U.S. International Trade Commission noted that although the CITAC study did estimate the impact of changing steel prices, it did not specify how much of the impact was attributable directly to the steel tariffs. The study reported estimated impact, relying on specific assumptions made to make analysis simpler. The ITC also noted that, within the broad definition of "steel-consuming industries" used in the CITAC study, employment actually increased by almost 53,000 between March 2002 and December 2002, and that employment in the same industries had fallen by 281,000 from March to December 2001, prior to the tariffs. On the other hand, the ITC admitted that the authors of the CITAC study had controlled for changes in overall manufacturing employment, and also admitted that the CITAC study's estimate of job loss in the steel-consuming sector was only half that reported by steel-consuming firms themselves in answers to questionnaires sent by the ITC, and only one-fifth that reported by the Bureau of Labor Statistics for the sector during the same period.
Error Correction and Concealment for JPEG 2000 Video Transmitted over Wireless Networks The transmission of compressed video sequences over wireless networks represents a particularly challenging problem, since the obtained visual quality strongly depends on the characteristics of the error-prone channel and on the tools used to compress the original sequence. In this paper, we present some methods for error concealment and error correction, which can be used when JPEG 2000 is adopted as compression tool. A judicious use of the scalability properties, error correction tools supplied by this standard, and an appropriate data interleaving algorithm can provide a good performance when compared with other error recovery methods.
As self-sufficient combat systems gradually become more common and transition from the realm of sci-fi movies, Russia has unveiled the Vikhr robotic system which to a certain extent looks like the T1-8 from the film Terminator 3: Rise of the Machines. © Photo: Youtube/ TV Zvezda Warriors of Steel: Meet Russia's Robot Army (VIDEOS, PHOTOS) The 14.7-ton Vikhr is a scout-attack unit tasked with engaging ground and aerial targets, reinforcing operations, protecting strategic facilities and decreasing human losses. “This is a robotic system. It means, it can be either controlled by an operator or accomplish certain tasks autonomously. For example, it can reach a set destination without any human control and avoid obstacles on its own,” Dmitry Bogdanov, deputy CEO at the Sevastopol-based Impulse-2 Scientific and Technical Center, told Sputnik. © Sputnik / Vasiliy Raksha Russia Showcases Cutting-Edge High-Mobile Self-Propelled Howitzer Phlox (VIDEO) The Vikhr is armed with a 30mm automatic cannon 2A72 (500 shells), a coaxial 7.62mm machinegun (2,000 rounds) and six anti-tank guided missiles Kornet-M (three on each side of the turret), touted as the best in the world in their class. The vehicle can automatically detect targets and prepare to attack them. “Depending on the target, the Vikhr robotic system chooses an appropriate weapon and offers it to the operator. For example, if the robot locks on a helicopter, it may select a surface-to-air missile. But the operator can select another option, and it is the operator who makes the final decision,” Bogdanov explained to Sputnik. The Vikhr complex also includes four quadrocopters, a mobile robotic platform for special tasks and a control system. A crew of two, a commander and an operator, operate the whole complex. “The fire control system has an electro-optic aiming set including a high-resolution camera, an infrared sensor, and a laser ranger which determines the distance to a target. It is also equipped with a weather station which automatically registers and takes into account such parameters as wind speed, humidity, temperature, pressure,” the specialist elaborated. On Saturday, RIA Novosti reported that the Russian Defense Ministry expressed interest in the robot.
Mind the gap: is it time to invest in embedded researchers in regional, rural and remote health services to address health outcome discrepancies for those living in rural, remote and regional areas? Research capacity building in healthcare works to generate and apply new knowledge to improve health outcomes; it creates new career pathways, improves staff satisfaction, retention and organisational performance. While there are examples of investment and research activity in rural Australia, overall, rural research remains under-reported, undervalued and under-represented in the evidence base. This is particularly so in primary care settings. This lack of contextual knowledge generation and translation perpetuates rural-metropolitan health outcome disparities. Through greater attention to and investment in building research capacity and capability in our regional, rural and remote health services, these issues may be partially addressed. It is proposed that it is time for Australia to systematically invest in rurally focussed, sustainable, embedded research capacity building.
from . import v1alpha1
/** General purpose exception handler which takes care of exceptions thrown in any controller */ @ControllerAdvice public class ControllerAdviceExceptionHandler { private final Logger logger = LoggerFactory.getLogger(this.getClass()); /** * Responds with a proper API error when a entity * * @param e Exception thrown (when thrown in a controller it is auto-bound * @return ResponseEntity with status 404 and ApiError mapping */ @ExceptionHandler({CustomEntityNotFoundException.class}) public ResponseEntity<ApiError> numberFormatException(CustomEntityNotFoundException e) { return ResponseEntity.status(HttpStatus.NOT_FOUND) .body(new ApiError(HttpStatus.NOT_FOUND.value(), e.getType(), e.getMessage())); } @ExceptionHandler({PathIdNotMatchingEntityIdException.class}) public ResponseEntity<ApiError> pathIdNotMatchingEntityIdException( PathIdNotMatchingEntityIdException e) { return ResponseEntity.status(HttpStatus.BAD_REQUEST) .body(new ApiError(HttpStatus.BAD_REQUEST.value(), e.getType(), e.getMessage())); } @ExceptionHandler({SecurityException.class}) public ResponseEntity<ApiError> requestUserIdNotFoundException(RequestUserIdNotFoundException e) { return ResponseEntity.status(HttpStatus.UNAUTHORIZED) .body(new ApiError(HttpStatus.UNAUTHORIZED.value(), e.getType(), e.getMessage())); } @ExceptionHandler({AccessDeniedException.class}) public ResponseEntity<ApiError> accessDeniedException(AccessDeniedException e) { return ResponseEntity.status(HttpStatus.FORBIDDEN) .body(new ApiError(HttpStatus.FORBIDDEN.value(), "Access Denied", e.getMessage())); } @ExceptionHandler(MethodArgumentTypeMismatchException.class) public ResponseEntity<ApiError> methodArgumentTypeMismatchException( MethodArgumentTypeMismatchException e) { return ResponseEntity.status(HttpStatus.BAD_REQUEST) .body( new ApiError( HttpStatus.BAD_REQUEST.value(), e.getParameter() + " is invalid", e.getMessage())); } @ExceptionHandler({Exception.class}) public ResponseEntity<ApiError> unknownException(Exception e) { logger.error("Unknown Exception", e); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body( new ApiError( HttpStatus.INTERNAL_SERVER_ERROR.value(), "Internal error", e.getMessage())); } }
Provisioning IP backbone networks to support latency sensitive traffic To support latency sensitive traffic such as voice, network providers can either use service differentiation to prioritize such traffic or provision their network with enough bandwidth so that all traffic meets the most stringent delay requirements. In the context of wide-area Internet backbones, two factors make overprovisioning an attractive approach. First, the high link speeds and large volumes of traffic make service differentiation complex and potentially costly to deploy. Second, given the degree of aggregation and resulting traffic characteristics, the amount of overprovisioning necessary may not be very large. This study develops a methodology to compute the amount of overprovisioning required to support a given delay requirement. We first develop a model for backbone traffic which is needed to compute the end-to-end delay through the network. The model is validated using 331 one-hour traffic measurements collected from the Sprint IP network. We then develop a procedure which uses this model to find the amount of bandwidth needed on each link in the network so that an end-to-end delay requirement is satisfied. Applying this procedure to the Sprint network, we find that satisfying end-to-end delay requirements as low as 3 ms requires only 15% extra bandwidth above the average data rate of the traffic.
def Args(parser): resource_args.AddAwsClusterResourceArg(parser, 'to create') parser.add_argument( '--subnet-ids', required=True, type=arg_parsers.ArgList(), metavar='SUBNET_ID', help='Subnet ID of an existing VNET to use for the cluster control plane.' ) flags.AddPodAddressCidrBlocks(parser) flags.AddServiceAddressCidrBlocks(parser) flags.AddClusterVersion(parser) flags.AddRootVolumeSize(parser) flags.AddMainVolumeSize(parser) flags.AddValidateOnly(parser, 'cluster to create') flags.AddFleetProject(parser) flags.AddTags(parser, 'cluster') aws_flags.AddAwsRegion(parser) aws_flags.AddIamInstanceProfile(parser) aws_flags.AddInstanceType(parser) aws_flags.AddSshEC2KeyPair(parser) aws_flags.AddConfigEncryptionKmsKeyArn(parser) aws_flags.AddDatabaseEncryptionKmsKeyArn(parser) aws_flags.AddRoleArn(parser) aws_flags.AddRoleSessionName(parser) aws_flags.AddVpcId(parser) aws_flags.AddSecurityGroupIds(parser, 'control plane replicas') aws_flags.AddRootVolumeType(parser) aws_flags.AddRootVolumeIops(parser) aws_flags.AddRootVolumeKmsKeyArn(parser) aws_flags.AddMainVolumeType(parser) aws_flags.AddMainVolumeIops(parser) aws_flags.AddMainVolumeKmsKeyArn(parser) aws_flags.AddProxyConfig(parser) base.ASYNC_FLAG.AddToParser(parser) parser.display_info.AddFormat(clusters.CLUSTERS_FORMAT)
The Usefulness of Diffusion Tensor MRI for the Prediction of Clinical Outcome in Patients with Acute Subcortical Infarction Background: Diffusion tensor MRI (DTI) is a new imaging technique and enables us to analyze the structural damage of fiber pathways and to monitor the time course of Wallerian degeneration of the pyramidal tract in stroke patients. We used DTI to investigate structural changes of the infarct area and the associated descending corticospinal tract in patients with subcortical infarct. Methods: We examined 24 consecutive patients who presented with acute single cerebral infarct in the subcortical area and who also had undergone an MRI study within 7 days after symptom onset. Clinical outcome was assessed using the National Institutes of Health Stroke Scale ( NIHSS) at admission, 7 days, 14 days and 30 days and modified Rankin Scale (mRS) at admission and 30 days. Each of the indices was achieved by post processing the acquired DTI data and correlated with the NIHSS. Results: In infarct region, fractional anisotropy (FA) was significantly decreased compared with matched-contra- lateral regions (0.39 vs. 0.53, p<0.001). In the distal to the infarct, FA was significantly decreased at internal capsule (0.62 vs. 0.64, p=0.019), not at pons (0.51 vs. 0.53, p=0.103). The decrease of anisotropy at infarct region correlated positively with the NIHSS at 7, 14 and 30 days and mRS at 30 days after stroke, but the decrease of anisotropy at internal capsule did not correlate with the NIHSS. Conclusions: This study shows the potential of DTI to detect and monitor the structural degeneration of fiber pathways and to establish the prognosis in patients with acute subcortical cerebral infarct. J Korean Neurol Assoc 24:447-451, 2006
Dapsone as a single agent is suboptimal therapy for Pneumocystis carinii pneumonia. In a prospective, noncomparative study, seven patients with mild Pneumocystis carinii pneumonia, characterized by room air arterial PO2 greater than 60 mm Hg at the time of presentation, were treated with dapsone alone at a dose of 200 mg daily. Two of the seven patients required mechanical ventilation for respiratory failure on day 5 of dapsone therapy; both died. Four patients experienced major side effects during dapsone therapy. None of the seven patients successfully completed a full course of therapy with dapsone. We conclude that high-dose, single-agent dapsone is not suitable for further study as therapy for Pneumocystis carinii pneumonia.
/* * MessageManager - Receives and distributes Dragonfly messages to/from modules * * <NAME> 10/28/2008 * <NAME> 10/14/2011 */ #include "MessageManager.h" #include "Debug.h" /* * to be moved in a more proper location */ #define VERSION "2.12.dev" /* * */ int main( int argc, char *argv[]) { try { char *options; char empty_str[] = ""; options = (argc > 1) ? argv[1] : empty_str; InitializeAbsTime(); CMessageManager MM; MM.MainLoop( options); return 0; } catch(MyCException &E) { E.AddToStack("MM WinMain- aborting"); E.ReportToFile(); return 0; } } /* * */ CMessageManager::CMessageManager( ) { m_Version = VERSION; m_NextDynamicModIdOffset = 0; // from RP3 RTMA (for timing message) #ifdef __unix__ ftime(&timebuffer); #else _ftime(&timebuffer); // C4996 #endif m_LastMessageCount = timebuffer.time; m_LastMessageCountmsec = timebuffer.millitm; for (int i = 0; i<MAX_MESSAGE_TYPES; i++) m_MessageCounts[i] = (unsigned short)0; for (int i = 0; i<MAX_MODULES; i++) m_ModulePIDs[i] = 0; } /* * */ CMessageManager::~CMessageManager( ) { } /* * */ void CMessageManager::MainLoop( char *cmd_line_options) { try { DEBUG_TEXT( "Entering Main Loop"); // Elevate process priority #ifdef _WINDOWS_C BOOL success = SetPriorityClass( GetCurrentProcess(), REALTIME_PRIORITY_CLASS); if ( success) printf("Successfully set process priority: REALTIME\n"); else printf("Failed to set process priority!\n"); success = SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); if ( success) printf("Successfully set thread priority: TIME_CRITICAL!\n"); else printf("Failed to set thread priority!\n"); #endif // Start managing messages if (strlen( cmd_line_options) > 0) { char *server_name = cmd_line_options; UPipeAutoServer::Run( server_name); } else { UPipeAutoServer::Run( DEFAULT_PIPE_SERVER_NAME_FOR_MM); } DEBUG_TEXT( "Main Loop Finished"); } catch(MyCException &E) { E.AddToStack("CMessageManager::MainLoop()"); throw E; } } /* * */ void CMessageManager::HandleData( UPipe *pSourcePipe) { SetMyPriority(THIS_MODULE_BASE_PRIORITY); DEBUG_TEXT_( "Receiving message from pipe " << pSourcePipe << "... "); CMessage M; M.Receive( pSourcePipe); DEBUG_TEXT( "Received message of type " << M.msg_type); ProcessMessage( &M, pSourcePipe); DistributeMessage( &M); SetMyPriority(NORMAL_PRIORITY_CLASS); } /* * */ void CMessageManager::HandleDisconnect( UPipe *pModulePipe) { DEBUG_TEXT_( "Pipe " << pModulePipe << " broken"); // Find module ID for( int mod_id = 0; mod_id < MAX_MODULES; mod_id++) { if( m_ConnectedModules[mod_id].pModulePipe == pModulePipe) { // Delete module record CleanUpModuleRecord( mod_id); DEBUG_TEXT_( ", disconnected module " << mod_id); break; } } DEBUG_TEXT("!"); } /* * */ void AddTimingTestTimePoint( double *time_array, double new_time) { // Put new_time in time_array at the first available slot for( int i = 0; i < MAX_TIMING_TEST_TIME_POINTS; i++) { if ( time_array[i] == 0) { time_array[i] = new_time; break; } } } /* * */ void CMessageManager::ProcessMessage( CMessage *M, UPipe *pSourcePipe) { DEBUG_TEXT_( "Processing message... "); MODULE_ID mod_id = M->src_mod_id; int prev_priority_class; //perform sanity checks before processing the message bool is_connect_message = (M->msg_type == MT_CONNECT)? 1 : 0; bool self_message = (mod_id == MID_MESSAGE_MANAGER) ? 1 : 0; bool is_valid_mod_id = ((mod_id > 0) && (mod_id < MAX_MODULES)) ? 1 : 0; bool message_from_this_host = (M->src_host_id == HID_LOCAL_HOST) ? 1 : 0; //For keeping track of message timing: (from RP3 RTMA) if (M->msg_type>0 && M->msg_type<MAX_MESSAGE_TYPES) m_MessageCounts[M->msg_type]++; #ifdef __unix__ ftime(&timebuffer); // C4996 #else _ftime(&timebuffer); // C4996 #endif time_t t = timebuffer.time; unsigned short tmsec = timebuffer.millitm; if ((t - m_LastMessageCount)>1 || (tmsec - m_LastMessageCountmsec)>900) //time to send out message with timing info { SendMessageTiming(); #ifdef __unix__ ftime(&timebuffer); // C4996 #else _ftime(&timebuffer); // C4996 #endif m_LastMessageCount = timebuffer.time; m_LastMessageCountmsec = timebuffer.millitm; } // end timing section from RP3 RTMA switch( M->msg_type) { case MT_CONNECT: MDF_CONNECT data; memset( &data, 0, sizeof(data)); M->GetData((void*) & data); prev_priority_class = GetMyPriority(); SetMyPriority(NORMAL_PRIORITY_CLASS); mod_id = ConnectModule( mod_id, pSourcePipe, data.logger_status, data.daemon_status); if (mod_id > 0) { SendAcknowledge( mod_id); SetMyPriority(prev_priority_class); } break; case MT_FORCE_DISCONNECT: MDF_FORCE_DISCONNECT data_MDF_FORCE_DISCONNECT; M->GetData( &data_MDF_FORCE_DISCONNECT); mod_id = data_MDF_FORCE_DISCONNECT.mod_id; if( (mod_id < 0) || (mod_id > MAX_MODULES) || !ModuleIsConnected(mod_id) ) { MyCString err("MM got MT_FORCE_DISCONNECT with invalid module id ["); err += (int)mod_id; err += "]"; CMessage R(MT_MM_ERROR, (void*)err.GetContent(), err.GetLen()); DispatchMessage(&R); }else{ MyCString info("MM forcing disconnect on module ["); info += (int)mod_id; info += "]"; CMessage R(MT_MM_INFO, (void*)info.GetContent(), info.GetLen()); DispatchMessage(&R); ShutdownModule(mod_id); } break; case MT_DISCONNECT: prev_priority_class = GetMyPriority(); SetMyPriority(NORMAL_PRIORITY_CLASS); DisconnectModule( mod_id); SetMyPriority(prev_priority_class); break; case MT_MODULE_READY: //store pids so that application module can kill processes later (from RP3 RTMA) MDF_MODULE_READY m; M->GetData(&m); if (mod_id >= 0 && mod_id<MAX_MODULES) m_ModulePIDs[mod_id] = m.pid; break; case MT_SUBSCRIBE: MSG_TYPE msg_type_to_subscribe; M->GetData( &msg_type_to_subscribe); AddSubscription( mod_id, msg_type_to_subscribe); DEBUG_TEXT_(" Added subscription to msg type " << msg_type_to_subscribe << " for module " << mod_id << "... "); SendAcknowledge( mod_id); break; case MT_UNSUBSCRIBE: MSG_TYPE msg_type_to_unsubscribe; M->GetData( &msg_type_to_unsubscribe); RemoveSubscription( mod_id, msg_type_to_unsubscribe); SendAcknowledge( mod_id); break; case MT_PAUSE_SUBSCRIPTION: MSG_TYPE msg_type_to_pause; M->GetData( &msg_type_to_pause); PauseSubscription( mod_id, msg_type_to_pause); SendAcknowledge( mod_id); break; case MT_RESUME_SUBSCRIPTION: MSG_TYPE msg_type_to_resume; M->GetData( &msg_type_to_resume); ResumeSubscription( mod_id, msg_type_to_resume); SendAcknowledge( mod_id); break; case MT_SHUTDOWN_DRAGONFLY: prev_priority_class = GetMyPriority(); SetMyPriority(NORMAL_PRIORITY_CLASS); DistributeMessage(M);//since we will exit the loop after that- we need to forward this message first ShutdownAllModules( ); UPipeAutoServer::_keepRunning = false; break; case MT_SHUTDOWN_APP: prev_priority_class = GetMyPriority(); SetMyPriority(NORMAL_PRIORITY_CLASS); ShutdownAllModules(0,0); //shutdown only application modules (not core modules or daemons) SetMyPriority(prev_priority_class); break; case MT_TIMING_TEST: { double upipe_recv_time = UPipeAutoServer::GetLatestRecvTime(); double mm_recv_time = GetAbsTime(); MDF_TIMING_TEST *pTimingData = (MDF_TIMING_TEST*) M->GetDataPointer(); AddTimingTestTimePoint( &(pTimingData->time[0]), upipe_recv_time); AddTimingTestTimePoint( &(pTimingData->time[0]), mm_recv_time); //for( int i = 0; i < 12; i++) printf("%.3f ", pTimingData->time[i]); //printf("\n"); break; } default: DEBUG_TEXT( "Nothing to do!"); return; } DEBUG_TEXT( "Processed!"); } /* * Should be called when forwarding a message from other modules * The given message will be forwarded to: * - all subscribed logger modules (ALWAYS) * - if the message has a destination address, and it is subscribed to by that destination * it will be forwarded only there * - if the message has no destination address, it will be forwarded to all subscribed modules */ void CMessageManager::DistributeMessage( CMessage *M) { DEBUG_TEXT( "Distributing Message..."); CSubscriberList * SL; SL = GetSubscriberList( M->msg_type); if( SL != NULL) { MODULE_ID mod_id = SL->GetFirstSubscriber(); while( mod_id > 0) { /* the order of the code in this while loop is important don't modify it unless you know what you're doing */ int send_it = 0; int has_specific_dest = ( M->dest_mod_id == 0)? 0 : 1; if(has_specific_dest) { //send only to the specific destination if(mod_id == M->dest_mod_id) send_it = 1; else send_it = 0; }else{ //no specific destination address- so should be forwarded to all subscribers for this MT send_it = 1; } //forward everything to logger modules if( m_ConnectedModules[mod_id].LoggerStatus) send_it = 1; if( SL->SubscriptionPaused()) send_it = 0; if( send_it) { DEBUG_TEXT_( "Forwarding message to module " << mod_id << "... "); try { int status = ForwardMessage(M, mod_id); if( status == 0) { LogFailedMessage( M, mod_id); DEBUG_TEXT( "Failed to Forward Message!"); } else { DEBUG_TEXT( "Forwarded!"); } } catch( UPipeClosedException &E) { DEBUG_TEXT( "Failed to Forward Message, destination module socket is closed/dead"); } } mod_id = SL->GetNextSubscriber(); } } DEBUG_TEXT( "Done distributing!"); } /* * Should be called internally in MM when sending a message to anybody that cares * The message will be sent to all subscribed modules including loggers */ void CMessageManager::DispatchMessage( CMessage *M) { CSubscriberList * SL; SL = GetSubscriberList( M->msg_type); if( SL != NULL) { // Send message to all subscribers MODULE_ID mod_id = SL->GetFirstSubscriber(); while( mod_id > 0) { SendMessage(M, mod_id); mod_id = SL->GetNextSubscriber(); } } } /* * Should be called internally in MM when sending a message to a module * The message will be sent, even if the module is not subscribed to it * The message will also be forwarded to all subscribed logger modules */ void CMessageManager::DispatchMessage( CMessage *M, MODULE_ID mod_id) { CSubscriberList * SL; //send the message to the module it is intended to, disregarding subscriptions //(enables MM to send system message to modules) SendMessage(M, mod_id); //CC all logger modules SL = GetSubscriberList( M->msg_type); if( SL != NULL) { MODULE_ID cc_mod_id = SL->GetFirstSubscriber(); while( cc_mod_id > 0) { if( m_ConnectedModules[cc_mod_id].LoggerStatus) if(cc_mod_id != mod_id)//don't send to destination module again ForwardMessage(M, cc_mod_id); cc_mod_id = SL->GetNextSubscriber(); } } } /* * Should be called internally in MM when sending a signal to a specific module * The signal will be sent, even if the module is not subscribed to it * The signal will also be forwarded to all subscribed logger modules */ void CMessageManager::DispatchSignal( MSG_TYPE sig, MODULE_ID mod_id) { CMessage R(sig); DispatchMessage(&R, mod_id); } /* * Should be called internally in MM when sending a message to all modules * The message will be sent to all connected modules, even if the module is not subscribed to it * The message will also be forwarded to all subscribed logger modules */ void CMessageManager::DispatchMessageToAll( CMessage *M) { for(int mod_id=0; mod_id<MAX_MODULES; mod_id++) { if(ModuleIsConnected(mod_id)) DispatchMessage(M, mod_id); } } /* * */ void CMessageManager::DispatchSignalToAll( MSG_TYPE sig) { CMessage R(sig); DispatchMessageToAll(&R); } /* * * overloaded function for Dragonfly_Module::SendMessage() * Sends a message to a module, specifying the MessageManager itself as the source module */ int CMessageManager::SendMessage( CMessage *M, MODULE_ID mod_id) { if( !ModuleIsConnected( mod_id)) return 0; UPipe *mod_pipe = GetModPipe( mod_id); if(mod_pipe == NULL) return 0; // Assume that msg_type, num_data_bytes, data - have been filled in M->msg_count = 0; M->send_time = GetAbsTime(); M->recv_time = 0.0; M->src_host_id = HID_LOCAL_HOST; M->src_mod_id = MID_MESSAGE_MANAGER; M->dest_mod_id = mod_id; double timeout = 0; // By default use non-blocking write so MM does not get stuck on a frozen module if( m_ConnectedModules[mod_id].LoggerStatus) timeout = -1; // Logger modules should not lose data, so use blocking write int status = M->Send( mod_pipe, timeout); return status; } /* * * Forward a message where the header is already filled in * Source module field in the header is unaltered */ int CMessageManager::ForwardMessage( CMessage *M, MODULE_ID mod_id) { if( !ModuleIsConnected( mod_id)) return 0; UPipe *mod_pipe = GetModPipe( mod_id); if(mod_pipe == NULL) return 0; double timeout = 0; // By default use non-blocking write so MM does not get stuck on a frozen module if( m_ConnectedModules[mod_id].LoggerStatus) timeout = -1; // Logger modules should not lose data, so use blocking write int status = M->Send( mod_pipe, timeout); return status; } /* * * overloaded function for Dragonfly_Module::SendSignal() * returns 0 if module is not connected, or failed to send message to it; 1 on success */ int CMessageManager::SendSignal( MSG_TYPE sig, MODULE_ID mod_id) { CMessage M(sig); return SendMessage(&M, mod_id); } /* * */ MODULE_ID CMessageManager::ConnectModule( MODULE_ID module_id, UPipe *pSourcePipe, short logger_status, short daemon_status) { if( ( module_id < MAX_MODULES) && ( module_id >= 0) && !ModuleIsConnected(module_id) ) { if( pSourcePipe != NULL) { // get the next available module ID from "dynamic" pool if (module_id == 0) module_id = GetDynamicModuleId(); if (module_id > 0) { DEBUG_TEXT( "Connecting module " << module_id << " on pipe " << pSourcePipe); m_ConnectedModules[module_id].Reset(); // Create a module record m_ConnectedModules[module_id].ModuleID = module_id; m_ConnectedModules[module_id].pModulePipe = pSourcePipe; m_ConnectedModules[module_id].LoggerStatus = logger_status; m_ConnectedModules[module_id].DaemonStatus = daemon_status; // Add default subscription to TIMER_EXPIRED if( !logger_status) AddSubscription( module_id, MT_TIMER_EXPIRED); } } } else module_id = 0; // something went wrong, don't allow the new connection return module_id; } /* * */ void CMessageManager::DisconnectModule( MODULE_ID module_id) { if( !ModuleIsConnected( module_id)) return; // Send ACK SendAcknowledge( module_id); // Close module's pipe UPipe *module_pipe = GetModPipe( module_id); UPipeAutoServer::_server->DisconnectClient( module_pipe); // Clean up module record CleanUpModuleRecord( module_id); } /* * */ void CMessageManager::CleanUpModuleRecord( MODULE_ID module_id) { RemoveSubscription( module_id, ALL_MESSAGE_TYPES); m_ConnectedModules[module_id].Reset(); } /* * */ void CMessageManager::ShutdownModule( MODULE_ID mod_id) { if( ModuleIsConnected( mod_id)) { switch(mod_id) { case MID_COMMAND_MODULE: //never shutdown Command Module break; case MID_APPLICATION_MODULE: DispatchSignal( MT_AM_EXIT, mod_id); break; case MID_STATUS_MODULE: DispatchSignal( MT_SM_EXIT, mod_id); break; case MID_QUICKLOGGER: DispatchSignal( MT_LM_EXIT, mod_id); break; default: DispatchSignal( MT_EXIT, mod_id); break; } DisconnectModule( mod_id); } } /* * */ void CMessageManager::ShutdownAllModules( int shutdown_Dragonfly, int shutdown_daemons) { int mod_id; int start_mod_id; if(shutdown_Dragonfly) { start_mod_id = MID_COMMAND_MODULE; //shutdown Dragonfly modules as well shutdown_daemons = 1; } else { start_mod_id = MAX_DRAGONFLY_MODULE_ID+1; //shutdown only application modules } for( mod_id = start_mod_id; mod_id < MAX_MODULES; mod_id++) { if( IsDaemon(mod_id)) { if( shutdown_daemons) ShutdownModule(mod_id); } else { ShutdownModule(mod_id); } } } /* * */ void CMessageManager::AddSubscription( MODULE_ID module_id, MSG_TYPE message_type) { MSG_TYPE mt; if( ((message_type < 0) || (message_type > MAX_MESSAGE_TYPES)) && (message_type != ALL_MESSAGE_TYPES) ) { //send MDF_FAIL_SUBSCRIBE instead of ACK so the module's subscribe function will fail MDF_FAIL_SUBSCRIBE data; data.mod_id = module_id; data.msg_type = message_type; CMessage R(MT_FAIL_SUBSCRIBE, (void*)&data, sizeof(data)); DispatchMessage(&R,module_id); return; } switch( message_type) { case ALL_MESSAGE_TYPES: for( mt = 0; mt < MAX_MESSAGE_TYPES; mt++) { GetSubscriberList( mt)->AddSubscriber( module_id); } break; default: CSubscriberList* list = GetSubscriberList( message_type); if (!list->IsSubscribed(module_id)) list->AddSubscriber( module_id); } } /* * */ void CMessageManager::RemoveSubscription( MODULE_ID module_id, MSG_TYPE message_type) { // Might wanna add checks here for valid module_id, connected module MSG_TYPE mt; switch( message_type) { case ALL_MESSAGE_TYPES: for( mt = 0; mt < MAX_MESSAGE_TYPES; mt++) { GetSubscriberList( mt)->RemoveSubscriber( module_id); } break; default: GetSubscriberList( message_type)->RemoveSubscriber( module_id); } } /* * */ void CMessageManager::PauseSubscription( MODULE_ID mod_id, MSG_TYPE message_type) { // Might wanna add checks here for valid module_id, connected module MSG_TYPE mt; switch( message_type) { case ALL_MESSAGE_TYPES: for( mt = 0; mt < MAX_MESSAGE_TYPES; mt++) { GetSubscriberList( mt)->PauseSubscriber( mod_id); } break; default: GetSubscriberList( message_type)->PauseSubscriber( mod_id); } } /* * */ void CMessageManager::ResumeSubscription( MODULE_ID mod_id, MSG_TYPE message_type) { // Might wanna add checks here for valid module_id, connected module MSG_TYPE mt; switch( message_type) { case ALL_MESSAGE_TYPES: for( mt = 0; mt < MAX_MESSAGE_TYPES; mt++) { GetSubscriberList( mt)->ResumeSubscriber( mod_id); } break; default: GetSubscriberList( message_type)->ResumeSubscriber( mod_id); } } /* * */ CSubscriberList * CMessageManager::GetSubscriberList( MSG_TYPE message_type) { if( message_type >= MAX_MESSAGE_TYPES || message_type < 0) return &m_EmptySubscriberList; else return &(m_SubscribersToMessageType[message_type]); } /* * */ bool CMessageManager::IsModuleSubscribed( MODULE_ID mod_id, MSG_TYPE message_type) { if( message_type >= MAX_MESSAGE_TYPES || message_type < 0 || mod_id < MID_MESSAGE_MANAGER || mod_id > MAX_MODULES ) return false; return GetSubscriberList( message_type)->IsSubscribed(mod_id); } /* * */ void CMessageManager::SendAcknowledge( MODULE_ID mod_id) { DEBUG_TEXT_( "Sending ACK to module " << mod_id << "... "); DispatchSignal( MT_ACKNOWLEDGE, mod_id); DEBUG_TEXT( "Sent!"); } /* * */ int CMessageManager::ModuleIsConnected( MODULE_ID mod_id) { if( mod_id < MID_MESSAGE_MANAGER) return 0; if( mod_id < MAX_MODULES) { if( m_ConnectedModules[mod_id].ModuleID == mod_id) { return 1; } } return 0; } /* * */ UPipe* CMessageManager::GetModPipe( MODULE_ID mod_id) { if( !ModuleIsConnected( mod_id)) return NULL; UPipe *mod_pipe = m_ConnectedModules[mod_id].pModulePipe; return mod_pipe; } /* * */ int CMessageManager::IsDaemon( MODULE_ID mod_id) { if( !ModuleIsConnected( mod_id)) return 0; if( m_ConnectedModules[mod_id].DaemonStatus) { return 1; } else { return 0; } } /* * */ void CMessageManager::LogFailedMessage( CMessage *M, MODULE_ID mod_id) { MDF_FAILED_MESSAGE data; memset( &data, 0, sizeof(data)); data.dest_mod_id = mod_id; data.time_of_failure = GetAbsTime(); memcpy( &data.msg_header, M, sizeof(DF_MSG_HEADER)); CMessage F(MT_FAILED_MESSAGE, &data, sizeof(data)); DispatchMessage(&F); m_MessageCounts[MT_FAILED_MESSAGE]++; // from RP3 RTMA (timing message) } void CMessageManager::SendMessageTiming() // from RP3 RTMA { MDF_TIMING_MESSAGE data; memset(&data, 0, sizeof(data)); data.send_time = GetAbsTime(); for (int i = 0; i<MAX_MESSAGE_TYPES; i++) { data.timing[i] = m_MessageCounts[i]; m_MessageCounts[i] = 0; } //add IsConnected stuff here: #ifdef __unix__ data.ModulePID[0] = getpid(); //MM #else data.ModulePID[0] = _getpid(); //MM #endif for (int i = 1; i<MAX_MODULES; i++) { if (ModuleIsConnected(i)) data.ModulePID[i] = m_ModulePIDs[i]; else data.ModulePID[i] = 0; } CMessage F(MT_TIMING_MESSAGE, &data, sizeof(data)); DispatchMessage(&F); }
package aggregate import ( "time" "github.com/maestre3d/dynamodb-tx-outbox/domain/event" ) type Student struct { *root StudentID string Name string SchoolID string } func NewStudent(id, name, schoolID string) *Student { s := &Student{ root: &root{events: []event.Domain{}}, StudentID: id, Name: name, SchoolID: schoolID, } s.pushDomainEvents(event.StudentRegistered{ StudentID: s.StudentID, Name: s.Name, SchoolID: s.SchoolID, RegisteredAt: time.Now().UTC().Format(time.RFC3339), }) return s }
// SPDX-License-Identifier: GPL-2.0+ /* * UniPhier Specific Glue Layer for DWC3 * * Copyright (C) 2016-2017 Socionext Inc. * Author: <NAME> <<EMAIL>> */ #include <dm.h> #include <dm/device_compat.h> #include <linux/bitops.h> #include <linux/errno.h> #include <linux/io.h> #include <linux/sizes.h> #define UNIPHIER_PRO4_DWC3_RESET 0x40 #define UNIPHIER_PRO4_DWC3_RESET_XIOMMU BIT(5) #define UNIPHIER_PRO4_DWC3_RESET_XLINK BIT(4) #define UNIPHIER_PRO4_DWC3_RESET_PHY_SS BIT(2) #define UNIPHIER_PRO5_DWC3_RESET 0x00 #define UNIPHIER_PRO5_DWC3_RESET_PHY_S1 BIT(17) #define UNIPHIER_PRO5_DWC3_RESET_PHY_S0 BIT(16) #define UNIPHIER_PRO5_DWC3_RESET_XLINK BIT(15) #define UNIPHIER_PRO5_DWC3_RESET_XIOMMU BIT(14) #define UNIPHIER_PXS2_DWC3_RESET 0x00 #define UNIPHIER_PXS2_DWC3_RESET_XLINK BIT(15) static int uniphier_pro4_dwc3_init(void __iomem *regs) { u32 tmp; tmp = readl(regs + UNIPHIER_PRO4_DWC3_RESET); tmp &= ~UNIPHIER_PRO4_DWC3_RESET_PHY_SS; tmp |= UNIPHIER_PRO4_DWC3_RESET_XIOMMU | UNIPHIER_PRO4_DWC3_RESET_XLINK; writel(tmp, regs + UNIPHIER_PRO4_DWC3_RESET); return 0; } static int uniphier_pro5_dwc3_init(void __iomem *regs) { u32 tmp; tmp = readl(regs + UNIPHIER_PRO5_DWC3_RESET); tmp &= ~(UNIPHIER_PRO5_DWC3_RESET_PHY_S1 | UNIPHIER_PRO5_DWC3_RESET_PHY_S0); tmp |= UNIPHIER_PRO5_DWC3_RESET_XLINK | UNIPHIER_PRO5_DWC3_RESET_XIOMMU; writel(tmp, regs + UNIPHIER_PRO5_DWC3_RESET); return 0; } static int uniphier_pxs2_dwc3_init(void __iomem *regs) { u32 tmp; tmp = readl(regs + UNIPHIER_PXS2_DWC3_RESET); tmp |= UNIPHIER_PXS2_DWC3_RESET_XLINK; writel(tmp, regs + UNIPHIER_PXS2_DWC3_RESET); return 0; } static int uniphier_dwc3_probe(struct udevice *dev) { fdt_addr_t base; void __iomem *regs; int (*init)(void __iomem *regs); int ret; base = dev_read_addr(dev); if (base == FDT_ADDR_T_NONE) return -EINVAL; regs = ioremap(base, SZ_32K); if (!regs) return -ENOMEM; init = (typeof(init))dev_get_driver_data(dev); ret = init(regs); if (ret) dev_err(dev, "failed to init glue layer\n"); iounmap(regs); return ret; } static const struct udevice_id uniphier_dwc3_match[] = { { .compatible = "socionext,uniphier-pro4-dwc3", .data = (ulong)uniphier_pro4_dwc3_init, }, { .compatible = "socionext,uniphier-pro5-dwc3", .data = (ulong)uniphier_pro5_dwc3_init, }, { .compatible = "socionext,uniphier-pxs2-dwc3", .data = (ulong)uniphier_pxs2_dwc3_init, }, { .compatible = "socionext,uniphier-ld20-dwc3", .data = (ulong)uniphier_pxs2_dwc3_init, }, { .compatible = "socionext,uniphier-pxs3-dwc3", .data = (ulong)uniphier_pxs2_dwc3_init, }, { /* sentinel */ } }; U_BOOT_DRIVER(usb_xhci) = { .name = "uniphier-dwc3", .id = UCLASS_SIMPLE_BUS, .of_match = uniphier_dwc3_match, .probe = uniphier_dwc3_probe, };
The Trump administration's candidate to head the United Nations' migration agency has been rejected in a blow to the United States, which has held the post since 1951. "The American is out," Senegalese diplomat Youssoupha Ndiaye told The Associated Press after voting in Geneva. The American candidate, Ken Isaacs, is the vice president of an evangelical charity, with his only relevant experience being a short stint as a political appointee in charge of overseas disaster relief under former President George W. Bush. Isaacs' candidacy was called into question after his old tweets surfaced, containing messages calling Muslims violent and insisting that "Christians" be the "first priority" when it came to the Syrian refugee crisis. The race to lead the migration agency is now between Portuguese Socialist Party member Antonio Vitorino and Costa Rica's Laura Thompson, the deputy director-general of the International Organization for Migration. In 2015, after a sexually explicit, mainly online relationship with a woman ended, Rep. Joe Barton (R-Texas) threatened to report the woman to the Capitol Police, according to a recording obtained by The Washington Post. Barton had reportedly sent the woman sexually explicit photos, videos, and messages over the course of their relationship, which began on Facebook in 2011. The woman, who spoke to the Post on the condition of anonymity, recorded the 2015 conversation in which Barton confronted her about communications she had with other women connected to Barton. "I am ready if I have to, I don't want to, but I should take all this crap to the Capitol Hill Police and have them launch an investigation," he said, according to the recording.
<reponame>pangang107/sealtalk-ios // // RCDChatBackgroundCell.h // SealTalk // // Created by 孙浩 on 2019/8/8. // Copyright © 2019 RongCloud. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface RCDChatBackgroundCell : UICollectionViewCell @property (nonatomic, strong) NSString *imageName; @property (nonatomic, assign) BOOL imgHidden; @end NS_ASSUME_NONNULL_END
Meta-analysis of two genome-wide association studies identifies four genetic loci associated with thyroid function. Thyroid hormones play key roles in cellular growth, development and metabolism. Although there is a strong genetic influence on thyroid hormone levels, the genes involved are widely unknown. The levels of circulating thyroid hormones are tightly regulated by thyrotropin (TSH), which also represents the most important diagnostic marker for thyroid function. Therefore, in order to identify genetic loci associated with TSH levels, we performed a discovery meta-analysis of two genome-wide association studies including two cohorts from Germany, KORA (n = 1287) and SHIP (n = 2449), resulting in a total sample size of 3736. Four genetic loci at 5q13.3, 1p36, 16q23 and 4q31 were associated with serum TSH levels. The lead single-nucleotide polymorphisms of these four loci were located within PDE8B encoding phosphodiesterase 8B, upstream of CAPZB that encodes the -subunit of the barbed-end F-actin-binding protein, in a former 'gene desert' that was recently demonstrated to encode a functional gene (LOC440389) associated with thyroid volume, and upstream of NR3C2 encoding the mineralocorticoid receptor. The latter association for the first time suggests the modulation of thyroid function by mineral corticoids. All four loci were replicated in three additional cohorts: the HUNT study from Norway (n = 1487) and the two German studies CARLA (CARLA, n = 1357) and SHIP-TREND (n = 883). Together, these four quantitative trait loci accounted for ∼3.3% of the variance in TSH serum levels. These results contribute to our understanding of genetic factors and physiological mechanisms mediating thyroid function.
Edward Gierek Youth and early career Edward Gierek was born in Porąbka near Sosnowiec, into a coal mining family. He lost his father to a mining accident in a pit at the age of four. His mother remarried and emigrated to northern France, where he lived from the age of 10 and worked in a coal mine from the age of 13. Gierek joined the French Communist Party in 1931 and in 1934 was deported to Poland for organizing a strike. After completing compulsory military service in Stryi in southeastern Poland (1934–1936), Gierek married Stanisława Jędrusik, but was unable to find employment. The Giereks went to Belgium, where Edward worked in the coal mines of Waterschei, contracting pneumoconiosis (black lung disease) in the process. In 1939 Gierek joined the Communist Party of Belgium. During the German occupation, he participated in communist anti-Nazi Belgian resistance activities. After the war Gierek remained politically active among the Polish immigrant community. He was a co-founder of the Belgian branch of the Polish Workers' Party (PPR) and a chairman of the National Council of Poles in Belgium. Polish United Workers' Party activist Gierek, who in 1948 was 35 and had spent 22 years abroad, was directed by the PPR authorities to return to Poland, which he did with his wife and their two sons. Working in the Katowice district PPR organization, in December 1948, as a Sosnowiec delegate he participated in the PPR-PPS unification congress, which resulted in the establishment of the Polish United Workers' Party (PZPR). In 1949, he was designated for and attended a two-year higher party course in Warsaw, where he was judged to be poorly qualified for intellectual endeavors but highly motivated for party work. In 1951 Roman Zambrowski sent Gierek to a striking coal mine, charging him with restoring order. Gierek was able to resolve the situation using persuasion and a use of force was avoided. He was a member of the Sejm, Polish parliament, from 1952. During the II Congress of the PZPR (March 1954), he was elected a member of the party's Central Committee. As chief of the Central Committee's Heavy Industry Division, he worked directly under First Secretary Bolesław Bierut in Warsaw. In March 1956, when Edward Ochab became the party's first secretary, Gierek became a secretary of the Central Committee, even though he publicly expressed doubts about his own qualifications. On 28 June 1956 he was sent to Poznań, where a worker revolt was taking place. Afterwards, delegated by the Politburo, he headed the commission charged with investigating the causes and course of the Poznań events. They presented their report on 7 July, blaming a hostile anti-socialist foreign inspired conspiracy that took advantage of worker discontent in Poznań enterprises. In July Gierek became a member of the PZPR Politburo, but lasted in that position only until October, when Władysław Gomułka replaced Ochab as first secretary. Nikita Khrushchev criticized Gomułka for not retaining Gierek in the Politburo; he remained a Central Committee secretary responsible for economic affairs, however. He would return to the Politburo in March 1959, at the III Congress of the PZPR. Katowice industrial district leader In March 1957, in addition to his Central Committee duties, Gierek became first secretary of the Katowice Voivodeship PZPR organization, and he kept this job until 1970. He created a personal power base in the Katowice region and became the nationally recognized leader of the young technocrat faction of the party. On the one hand Gierek was regarded as a pragmatic, non-ideological and economic progress-oriented manager, on the other he was known for his servile attitude toward the Soviet leaders, for whom he was a source of information concerning the PZPR and its personalities. Both the industrial supremacy of Gierek's well-run Upper Silesia territory and the special relationship with the Soviets he cultivated made many believe that Gierek was a likely successor to Gomułka. Gierek may have tried to make his move during the 1968 Polish political crisis. Soon after the student rally on 8 March in Warsaw, on 14 March in Katowice he led a mass gathering of 100,000 party members from the entire province. He was the first Politburo member to speak publicly on the issue of the protests then taking place and later claimed that his motivation was to demonstrate support for Gomułka's rule, threatened by Mieczysław Moczar's intra-party conspiring. Gierek used strong language to condemn the purported "enemies of People's Poland" who were "disturbing the peaceful Silesian water". He showered them with propaganda epithets and alluded to their bones being crushed if they persevered in their attempts to turn the "nation" away from its "chosen course." Gierek was supposedly embarrassed when participants of the party conference in Warsaw on 19 March shouted his name along with that of Gomułka, as an expression of support. The 1968 events strengthened Gierek's position, also in the eyes of his sponsors in Moscow. First secretary of the PZPR When the 1970 Polish protests were violently suppressed, Gierek replaced Gomułka as first secretary of the party and had thus become the most powerful politician in Poland. In late January 1971, he put his new authority on the line and traveled to Szczecin and Gdańsk, to bargain personally with the striking workers. Consumer price increases that triggered the recent revolt were rescinded. Among Gierek's popular moves was the decision to rebuild the Royal Castle in Warsaw, destroyed during World War II and not included in the post-war restoration of the city's Old Town. State controlled media stressed his Western upbringing and his fluency in the French language. The arrival of the Gierek team meant the final generational replacement of the ruling communist elite, a process begun in 1968 under Gomułka. Many thousands of party activists, including important elder leaders with background in the prewar Communist Party of Poland, were removed from positions of responsibility and replaced with people whose careers formed after World War II. Much of the overhaul was accomplished during and after the VI Congress of the PZPR, convened in December 1971. The resulting governing class was one of the youngest in Europe. The role of the administration was expanded at the expense of the party, according to the maxim "the party leads, the government governs". Throughout the 1970s, the most highly visible member of the top leadership after Gierek was Prime Minister Piotr Jaroszewicz. From May 1971, Gierek's rival party politician Mieczysław Moczar was increasingly marginalized. According to historian Krzysztof Pomian, early in his term Gierek abandoned the regime's long-standing practice of on-and-off confrontation with the Polish Catholic Church, and opted for cooperation. The policy resulted in a privileged position of the Church and its leaders for the duration of the communist rule in Poland. The Church markedly expanded its physical infrastructure and also became a crucial political third force, often involved in mediating conflict between the authorities and opposition activists. Economic expansion and decline Since the riots that brought down Gomułka were caused primarily by economic difficulties, Gierek promised economic reform and instituted a program to modernize industry and increase the availability of consumer goods. His "reform" was based primarily on large scale foreign borrowing, not accompanied by major systemic restructuring. The need for deeper reform was obscured by the investment boom the country was enjoying in the first half of the 1970s. The first secretary's good relations with Western leaders, especially France's Valéry Giscard d'Estaing and West Germany's Helmut Schmidt, were a catalyst for his receiving Western aid and loans. Gierek is widely credited with opening Poland to political and economic influence from the West. He himself extensively traveled abroad and received important foreign guests in Poland, including three presidents of the United States. Gierek also was trusted by Leonid Brezhnev, which meant that he was able to pursue his policies (globalization of Poland's economy) without much Soviet interference. He had readily granted the Soviets concessions that his predecessor Gomułka would consider contrary to the Polish national interest. Standard of living increased markedly in Poland in the first half of the 1970s, and for a time Gierek was hailed as a miracle-worker. Poles, to an unprecedented degree, were able to purchase desired consumer items such as compact cars, travel to the West rather freely, and even a solution to the intractable housing supply problem seemed to be on the horizon. Decades later many remembered the period as the most prosperous in their lives. The economy, however, began to falter during the 1973 oil crisis, and by 1976 price increases became necessary. The June 1976 protests were forcibly suppressed, but the planned price increases were canceled. The greatest accumulation of foreign debt occurred in the late 1970s, as the regime struggled to counter the effects of the crisis. Crisis, protests, organized opposition The period of Gierek's rule is notable for the rise of organized opposition in Poland. Changes in the constitution, proposed by the regime, caused considerable controversy at the turn of 1975 and 1976. The intended amendments included formalizing the "socialist character of the state", the leading role of the PZPR and the Polish-Soviet alliance. The widely opposed alterations resulted in numerous protest letters and other actions, but were supported at the VII Congress of the PZPR in December 1975 and largely implemented by the Sejm in February 1976. Organized opposition circles developed gradually and reached 3000–4000 members by the end of the decade. Because of the deteriorating economic situation, at the end of 1975 the authorities announced that the 1971 freeze in food prices would have to be lifted. Prime Minister Jaroszewicz forced the price rises, in combination with financial compensation favoring upper income brackets; the policy ultimately was adopted despite strong objections voiced by the Soviet leadership. The increase, supported by Gierek, was announced by Jaroszewicz in the Sejm on 24 June 1976. Strikes broke out the following day, with particularly serious disturbances, brutally pacified by the police, taking place in Radom, at Warsaw's Ursus Factory and in Płock. On 26 June, Gierek engaged in the traditional party crisis-confronting mode of operation, ordering mass public gatherings in Polish cities to demonstrate people's supposed support for the party and condemn the "trouble makers". Ordered by Brezhnev not to attempt any further manipulations with prices, Gierek and his government undertook other measures to rescue the market destabilized in the summer of 1976. In August, sugar "merchandise coupons" were introduced to ration the product. The politics of "dynamic development" was over, as evidenced by such ration cards, which would remain a part of Poland's daily reality until July 1989. In the aftermath of the June 1976 protests, a major opposition group, the Workers' Defence Committee (KOR), commenced its activities in September to help the persecuted worker protest participants. Other opposition organizations were also established in 1977–79, but historically the KOR proved to be of particular importance. In 1979, Poland's ruling communists reluctantly allowed Pope John Paul II to make his first papal visit to Poland (2–10 June), despite Soviet advice to the contrary. Gierek, who had previously met Pope Paul VI at the Vatican, talked with the Pope on the occasion of his visit. Downfall Although Gierek, distressed by the 1976 price increase policy failure, was persuaded by his colleagues not to resign, divisions within his team intensified. One faction, led by Edward Babiuch and Piotr Jaroszewicz, wanted him to remain at the helm, while another, led by Stanisław Kania and Wojciech Jaruzelski, was less interested in preserving his leadership. In May 1980, after the Soviet invasion of Afghanistan and the subsequent Western boycott of the Soviet Union, Gierek arranged a meeting between Valéry Giscard d'Estaing and Leonid Brezhnev in Warsaw. As was the case with Władysław Gomułka a decade earlier, a foreign policy success created an illusion that the Polish party leader was secure in his statesman aura, while the paramount political facts were being determined by the deteriorating economic situation and the resultant labor unrest. In July Gierek went to the Crimea, his usual vacation spot. For the last time he talked there with his friend Brezhnev. He responded to Brezhnev's gloomy assessment of the situation in Poland (including the out-of-control indebtedness) with his own upbeat predictions, possibly not fully cognizant of the country's, and his own, predicament. High foreign debts, food shortages, and an outmoded industrial base were among the factors that forced a new round of economic reforms. Once again, in the summer of 1980 price increases set off protests across the country, especially in the Gdańsk and Szczecin shipyards. Unlike on previous occasions, the regime decided not to resort to force to suppress the strikes. In the Gdańsk Agreement and other accords reached with Polish workers, Gierek was forced to concede their right to strike, and the Solidarity labor union was born. Shortly thereafter, in early September 1980, he was replaced by the Central Committee's VI Plenum as party first secretary by Stanisław Kania and removed from power. A popular and trusted leader in the early 1970s, Gierek left surrounded by infamy and ridicule, deserted by most of his collaborators. The VII Plenum in December 1980 held Gierek and Jaroszewicz personally liable for the situation in the country and removed them from the Central Committee. The extraordinary IX Congress of the PZPR, in an unprecedented move, voted in July 1981 to expel Gierek and his close associates from the party, as the delegates considered them responsible for the Solidarity-related crisis in Poland, and First Secretary Kania was unable to prevent their action. The next first secretary of the PZPR, General Wojciech Jaruzelski, introduced martial law in Poland on 13 December 1981. Gierek was interned for a year from December 1981. Unlike the (also-interned) opposition activists, the internment status brought Gierek no social respect. He ended his political career as the era's main pariah. Edward Gierek died in July 2001 of the miner's lung illness in a hospital in Cieszyn, near the southern mountain resort of Ustroń where he spent his last years. From the perspective of time his rule was now seen in a more positive light and over ten thousand people attended his funeral. With his lifelong wife, Stanisława née Jędrusik, Gierek had two sons, one of whom is MEP Adam Gierek. Legacy In 1990 two books, based on extended interviews with Gierek by Janusz Rolicki, were published in Poland and became bestsellers. Polish society is divided in its assessment of Gierek. His government is fondly remembered by some for the improved living standards the Poles enjoyed in the 1970s under his rule. Uniquely among the PZPR leaders, the Polish public has shown signs of Gierek nostalgia, discernible especially after the former first secretary's death. Others emphasize that the improvements were only made possible by the unwise and unsustainable policies based on huge foreign loans, which led directly to the economic crises of the 1970s and 1980s. Judged by hindsight, the total sum of over 24 billion borrowed (in 1970s dollars) was not well-spent. Upon becoming first secretary in December 1970, Gierek promised himself that under his watch people would not be shot on streets. In 1976 the security forces did intervene in strikes, but only after giving up their firearms. In 1980, they did not use force at all. According to sociologist Maciej Gdula, the social and cultural transformation that took place in Poland in the 1970s was even more fundamental than the one which occurred in the 1990s, following the political transition. Regarding the politics of alliance of the political and later also money elites with the middle class at the expense of the working class, he said "the general idea of the relationship of forces in our society has remained the same from the 1970s, and the period of mass solidarity was an exception" ("mass solidarity" being the years 1980–81). Since the time of Gierek, Polish society has been hegemonized by cultural perceptions and norms of the (at that time emerging) middle class. Terms like management, initiative, personality, or the individualistic maxim "get educated, work hard and get ahead in life", combined with orderliness, replaced class consciousness and the socialist egalitarian concept, as workers were losing their symbolic status, to be eventually separated into a marginalized stratum.
ALLENDALE, NJ – Applebee’s Neighborhood Grill & Bar® locations in New Jersey today announced its 20th annual Breakfast with Santa fundraiser will take place on Saturday, December 8 from 8:30 – 10:30AM. The fundraiser will support the efforts of the U.S. Marines Corps Toys for Tots program, which distributes new toys to underprivileged children to provide a tangible sign of hope to as many economically disadvantaged children as possible at Christmas. Guests can enjoy breakfast compliments of Applebee’s along with goodies, raffle tickets for door prizes and the opportunity to take a photo with Santa Claus. Tickets to Breakfast with Santa can be purchased for $10 each by calling or visiting a local Applebee’s. Advanced reservations are required as seating is limited. Children under the age of 2 are admitted free of charge. Starting October 15, Applebee’s will raise additional funds by selling paper “gift tags” for $1 or $5 each, which will be displayed in the restaurants. One hundred percent of the proceeds from the Breakfast with Santa events and “gift tag” purchases will be donated directly to the U.S. Marine Corps Toys for Tots program to be distributed to local families. Heading into its 20th year, Applebee’s locations owned and operated by Doherty Enterprises, which owns more than 100 Applebee’s restaurants across New Jersey, Long Island, Florida and Georgia, have raised over $4.3 million for the Toys for Tots initiative to date, helping to spread holiday cheer to over 230,000 deserving children. "We are very pleased to continue our partnership with Doherty – Applebee’s, a national corporate sponsor of the 2018 Marine Toys for Tots Campaign," said Lieutenant General Pete Osman, USMC (Ret), President and CEO of the Marine Toys for Tots Foundation. "Their community service goals certainly align with those the Marine Corps has promoted for over 70 years through our Toys for Tots Program." Osman concluded, "With their generous support we will be able to fulfill the Christmas holiday dreams of thousands of less fortunate children who otherwise might be forgotten." In addition to Toys for Tots, Doherty-owned Applebee’s restaurants provide support for charitable causes in the communities they serve year-round under the leadership of Presidents and Chief Executive Officer Doherty. In 2017, Applebee’s raised and donated over $4.4 million for local charities through over 12,900 events and sponsorships. Just in time for the holidays, for every $50 gift card purchase, guests will receive a free bonus card valued at $10. Offer valid October 29 through January 6. Bonus cards valid from next visit through March 3, 2019. Applebee’s Breakfast with Santa events will be offered at locations owned and operated by Doherty Enterprises in New Jersey, Long Island, Florida and Georgia. In New Jersey, Applebee’s is located in Brick, Bridgewater, Butler, Clark, Clifton, East Hanover, Edison, Flemington, Garfield, Hackensack, Hackettstown, Hillsborough, Howell, Jersey City, Jersey Gardens, Kearny, Lacey, Linden, Manahawkin, Manalapan, Manchester, Middletown, Milltown, Mt. Olive, Newark, Newton, North Bergen, Northvale, Ocean, Paramus, Parsippany, Phillipsburg, Piscataway, Rockaway, Tinton Falls, Toms River, Totowa, Union, Wall and Woodbridge. Established in 1985, Doherty Enterprises, Inc. is recognized as the 68th largest privately-held business in the New York Metro area by Crain’s Business and the 15th largest franchisee in the United States as ranked in the Restaurant Finance Monitor, operating seven restaurant concepts including: Applebee’s Neighborhood Grill & Bar, Panera Bread, Chevys Fresh Mex, Quaker Steak & Lube, Noodles & Company, and two of its own concepts, The Shannon Rose Irish Pub and Spuntino Wine Bar & Italian Tapas. In 2017, Nation’s Restaurant News ranked Doherty Enterprises as the 78th largest Foodservice revenue company in the United States. To date, Doherty Enterprises owns and operates over 150 restaurants in northern, southern and central New Jersey, on Long Island, as well as locations throughout Queens, Brooklyn, Staten Island and sections of Florida and Georgia. The Doherty vision is to be the “Best Food Service Company in the Communities We Serve” and its mission is to “Wow Every Guest Every Time, Wow Our People, Wow Our Communities and Wow Our Suppliers.” (www.DohertyInc.com). Applebee's Neighborhood Grill & Bar offers a lively casual dining experience combining simple, craveable American fare with flair, classic drinks and local drafts. All Applebee's restaurants are owned and operated by entrepreneurs dedicated to serving their communities and offering quality food and drinks with genuine, neighborly service. Applebee's is one of the world's largest casual dining brands; as of March 31, 2017, there are approximately 2,000 Applebee's franchise restaurants in all 50 states, Puerto Rico, Guam and 15 other countries. Applebee's is franchised by subsidiaries of DineEquity, Inc. [NYSE: DIN], which is among the world's largest full-service restaurant companies. Toys for Tots, a 71-year national charitable program run by the U.S. Marine Corps Reserve, provides happiness and hope to disadvantaged children during each Christmas holiday season. The toys, books and other gifts collected and distributed by the Marines offer these children recognition, confidence and a positive memory for a lifetime. It is such experiences that help children become responsible citizens and caring members of their community. Last year the Marine Toys for Tots Program fulfilled the holiday hopes and dreams of 7 million less fortunate children in 800 communities nationwide. Since 1947 over 251 million children have been assisted. The Marine Toys for Tots Foundation is a not for profit organization authorized by the U.S. Marine Corps and the Department of Defense to provide fundraising and other necessary support for the annual Marine Corps Reserve Toys for Tots Program. For more information, visit www.toysfortots.org.
// NewGetWarsWarIDParamsWithHTTPClient creates a new GetWarsWarIDParams object // with the ability to set a custom HTTPClient for a request. func NewGetWarsWarIDParamsWithHTTPClient(client *http.Client) *GetWarsWarIDParams { return &GetWarsWarIDParams{ HTTPClient: client, } }
<reponame>JamesChung/get-sso-creds<filename>src/commands/ls.ts import { Command, flags } from '@oclif/command'; import { getCredProfiles, getProfileNames } from '../lib/profile-helper'; import * as inquirer from 'inquirer'; import cli from 'cli-ux'; export default class Ls extends Command { static description = 'lists profile names by file'; static examples = [ `$ gsc ls ? Select a file: (Use arrow keys) ❯ config credentials`, ]; static flags = { help: flags.help({ char: 'h', description: undefined }), }; static args = []; async run() { const { args, flags } = this.parse(Ls); try { const response = await inquirer.prompt([{ name: 'file', message: 'Select a file:', type: 'list', choices: ['config', 'credentials'] }]); if (response.file === 'config') { for (let profile of getProfileNames()) { this.log(profile); } return; } if (response.file === 'credentials') { for (let profile of getCredProfiles()) { this.log(profile); } return; } } catch (error) { cli.action.stop('failed'); this.error(error.message); } } }
UN number UN numbers (United Nations numbers) are four-digit numbers that identify hazardous materials, and articles (such as explosives, flammable liquids, oxidizers, toxic liquids, etc.) in the framework of international transport. Some hazardous substances have their own UN numbers (e.g. acrylamide has UN 2074), while sometimes groups of chemicals or products with similar properties receive a common UN number (e.g. flammable liquids, not otherwise specified, have UN 1993). A chemical in its solid state may receive a different UN number than the liquid phase if their hazardous properties differ significantly; substances with different levels of purity (or concentration in solution) may also receive different UN numbers. UN numbers range from UN 0004 to about UN 3534 (UN 0001 – UN 0003 no longer exist) and are assigned by the United Nations Committee of Experts on the Transport of Dangerous Goods. They are published as part of their Recommendations on the Transport of Dangerous Goods, also known as the Orange Book. These recommendations are adopted by the regulatory organization responsible for the different modes of transport. There is no UN number allocated to non-hazardous substances. For more details, see Lists of UN numbers. NA numbers (North America), are issued by the United States Department of Transportation and are identical to UN numbers, except that some substances without a UN number may have an NA number. These additional NA numbers use the range NA 9000 - NA 9279. There are some exceptions, for example NA 2212 is all asbestos with UN 2212 limited to Asbestos, amphibole amosite, tremolite, actinolite, anthophyllite, or crocidolite. Another exception, NA 3334, is self-defense spray, non-pressurized while UN 3334 is aviation regulated liquid, not otherwise specified. For the complete list, see NA/UN exceptions. For more details see List of NA numbers. ID numbers are a third type of identification number used for hazardous substances. Substances with an ID number are associated with proper shipping names recognized by the ICAO Technical Instructions. There is only one substance that currently has such a number: ID 8000, Consumer commodity. This substance does not have a UN or NA number, and is classed as a Class 9 hazardous material. Hazard identifiers Associated with each UN number is a hazard identifier, which encodes the general hazard class and subdivision (and, in the case of explosives, their compatibility group). If a substance poses several dangers, then subsidiary risk identifiers may be specified. It is not possible to deduce the hazard class(es) of a substance from its UN number: they have to be looked up in a table.
The present invention relates to a vehicle body structure of a rear part of a vehicle. A vehicle body structure of a rear part of a vehicle is formed into a ladder configuration in which left and right side members are extended in a front-to-rear direction of a vehicle body and cross members are then extended between the side members. A kick-up floor portion which is raised in height in a step-like fashion is formed at a rear side of a vehicle body frame. Additionally, the side members are also formed so as to be raised in height in a step-like fashion to follow the kick-up floor portion. Incidentally, on many occasions, a rear seat is disposed at the kick-up floor portion at the rear part of the vehicle for provision of a seating space for passengers. It is also currently adopted practice to dispose a fuel tank underneath the kick-up floor portion on many occasions. Due to this configuration, the kick-up floor portion needs to be restricted from being deformed to secure the passenger space and protect the fuel tank when the vehicle is involved in a rear collision. It is considered that the side members are reinforced to restrict the deformation of the kick-up floor portion. Although it is considered that the rigidity of material of the side members is enhanced or reinforcement members are added to reinforce the side members, this will call for an increase in weight of the vehicle. In addition, since the side members are raised in height at the kick-up floor portion, loadings from the rear part produce a bending moment at step portions of the side members, and therefore, the amount of reinforcement at the step portions needs to be increased, and this leads to a problem that a further increase in weight will be called for. Then, in order to reduce loadings applied to the vehicle when the vehicle is involved in a rear collision, the structure has conventionally been proposed in which a skeletal member extending to the front of a vehicle is disposed at a central portion of the vehicle and side members and the skeletal member are connected together by a frame, so that loadings applied to the side members from the rear are dispersed to the skeletal member (refer to Patent Literature 1). In the structure disclosed in Patent Literature 1, the impact loadings applied from the rear can be dispersed to the whole of the vehicle. In the technique disclosed in Patent Literature 1, however, since part of the loadings applied to the side members from the rear is received by the frame and the rigidity of the skeletal member, the loading bearing reduction effect is limited, in reality, the loading bearing reduction effect does not match the increase in weight as a result of the addition of the frame and the skeletal member. [Patent Literature 1] Japanese Patent No. 4571340
However, signing can reduce engagement in consumers who don’t identify strongly with a product or category. The findings have potential implications in the marketplace. “Although there are numerous ways in which people may present their identity to others, signing one’s name has distinct legal, social, and economic implications,” said authors Keri L Kettle and Gerald Haubl from the University of Alberta. In one experiment, consumers were asked to either sign or print their name before visiting a sporting goods store to purchase a pair of running shoes. “For consumers who closely associate their identity with running, compared to printing their name, providing their signature before entering the store caused an increase in the number of running shoes they tried on and in the amount of time they spent in the store,” said the researchers. Signing their name had the opposite effect on people who did not associate their identity with running; they spent less time in the store and tried on fewer shoes. In another study, consumers were asked to make a series of product choices after either signing or printing their names. Consumers who signed were more likely to choose an option that was popular with a social group they belong to. The tendency was stronger when consumers chose in a product category that signalled their identity to others (a jacket) than when they selected in a category that does not signal their identity (toothpaste). The study has implications for retailers and consumers, according to the researchers.
// OrdererPort returns the named port reserved for the Orderer instance. func (n *Network) OrdererPort(o *topology.Orderer, portName api.PortName) uint16 { ordererPorts := n.PortsByOrdererID[o.ID()] Expect(ordererPorts).NotTo(BeNil()) return ordererPorts[portName] }
NUMERICAL MODELING OF THE STRESS-STRAIN STATE OF THE YAKUTSK-VILYUI LARGE IGNEOUS PROVINCE FOR THE ANALYSIS OF GEOTECTONIC PROCESSES IN THE SIBERIAN CRATON Stress and strain distributions in the Yakutsk-Vilyui large igneous province (LIP) are numerically simulated under geotectonic extension. A two-dimensional model of the geological structure of a part of the Yakutsk-Vilyui LIP is developed using the geophysical data from the profile Craton-1980. However, these geophysical data can only be a source of the geometrical model and elastic properties of Earths layers. To describe non-elastic strains during the geological process, the Drucker-Prager-Nikolaevsky model of plasticity is adopted. For elastoplastic analysis of the geotectonic process, the Jelly Sandwich shear strength model for the continental lithosphere is used, which is based on the variation of the strength properties with depth. Zones of shear stress concentration and plastic strain localization are observed as a result of the extension in the Lindenskaya basin and Khapchagaiskaya reclamation complying with oil and gas deposit locations in the Yakutia region. Stress components have non-linear distributions determined by the dependence of strength properties on the depth and structural inhomogeneity of continental lithosphere. The pressure distribution obtained in the simulation can partially complement the geological information employed when analyzing the possibility of phase transitions in the rocks in different locations of the studied region.
Marriage Actualization of the Malay Indigenous Peoples of Riau Province in the Legal Perspective This research concerns the analysis and studies related to the normative legal postulates contained in the provisions of Article 18B paragraph and Article 281 paragraph of the 1945 Constitution after the Amendment, which is supported by sectoral laws related to the protection and recognition of the legal community custom. In this case, the problem written is about how the constitutionality position of the existence of customary law and customary law community alliances is. It aims to answer academic questions about the protection of the traditional rights of the Sakai Tribe legal community. The research method used is sociological juridical law research, namely; research that departs from positive legal norms and doctrines enriched with data and facts from the field. The research results are; that legally in the 1945 Constitution with sectoral laws against customary law communities, in general it has been protected. However, the implementation of policies from both the central and local governments has not been able to protect the traditional rights of the indigenous people of the Sakai Tribe. Although the area is the source of life for the Sakai people, it is rich in natural resources that are economically valuable. The absence of a Customary Regional Regulation proves that the Riau provincial government favors the Sakai Tribe customary law community. This research is descriptive analytical, namely research that will describe, examine and explain thoroughly about problems and the legal system and examine them systematically so that they can be more easily understood and concluded. are legal that have authority The primary legal materials in this study consist of: Al-Qur'an and Hadith ; b) Secondary Legal Secondary legal materials are materials that are closely related to primary legal materials such as doctrines (opinions of experts), books, legal journals, papers, and electronic media; and c) Tertiary Legal Materials, legal materials that provide instructions and explanations of primary legal materials and relevant secondary legal materials to complement the data in this study, such as general dictionaries, magazines and the internet as well as materials outside the legal field related to complete data. INTRODUCTION Indigenous peoples have their own customs, throughout history the weak respect for indigenous peoples in many cases around the world has led to social conflicts (;Ramadhani, 2019;Salinding, 2019). In Indonesia, although the rights of indigenous peoples are recognized in the 1945 Constitution, there is no specific national regulation that protects the rights of indigenous peoples. Since 2005 the idea of bringing up the Bill on the Protection of Indigenous Peoples is a national political issue for the Regional Representative Council, and President Susilo Bambang Yudhoyono on several occasions has stated the importance of legal regulations regarding the protection of the rights of indigenous and tribal peoples. The threat of globalization for indigenous and tribal peoples can deplete local cultural values (;Suhajri, 2021;Sabandiah & Wijaya, 2018). Globalization which is marked by the elimination of regional boundaries, information becomes more instant, the circulation of services, goods and money and information technology is getting faster and has a positive impact on improving the living order of the Indonesian people. The negative impact of globalization is also acknowledged to have caused conflicts, both vertically (society and government) and horizontally (community fellows) (Kamilah & Rosa, 2021;Ichsan, 2021;Ilyasa, 2020). The cultural values of society in the era of globalization will be marginalized, the marginalization situation is unavoidable. Customary law communities according to applicable law have not been recognized and protected by the government (Dahlan, 2018;;Ndaumanu, 2018). So far, customary law communities have only used the rules determined by each region. The rights of indigenous peoples and traditional rights living in customary law communities have not been recognized and protected by the government (;Atmaja & Kurnano, 2018). The Sakai tribe who lives in Riau Province are generally estimated to have existed and wandered since the end of 1300 AD. The indigenous peoples of the Sakai Tribe are the forerunners of the indigenous Malay people, who have wandered between 2500-1500 BC, namely the meeting point between the Neolithicum culture, the New Slone Era and the Megalithicum culture; the Age of Big Stone Civilization. Archaeologists found several places of flakes objects that prove that around 4000 BC on the east coast of central Sumatra has been inhabited by humans. According to the hypothesis towards the end of the Neolithicum era, new immigrants came from the Asian plains who brought a large stone culture or the Megalithicum era. The evidence is found in the Kisten Stenen object studied by Bot around the Bangko area. The first group of ancestors of the indigenous people of the Sakai tribe landed in the Indonesian archipelago, known as the Old Malays or Proto Malays, which had a very simple civilization. The second group, who came from the Dongson area, north of Vietnam, brought more sophisticated technology and skills than the first group. The second group quickly assimilated into the culture of the first group and gave birth to a new race, the Duetron-Malay (;). There are similarities in cultural and linguistic aspects of Malays with indigenous Malays in Taiwan, Easter Island, Hawaii and New Zealand. Called the Old Malays because they were the first group of Malay immigrants to come to the Malay Archipelago. This Old Malay ancestor is estimated by archaeologists and historians to have arrived around 3000-2500 BC. Those belonging to the Old Malay descent are the Talang Mamak tribe, the Sakai tribe, and the Laut tribe. The descendants of this Old Malay seem traditional, because they are very firm in holding on to their customs and traditions. Customary control holders, such as Patih, Batin, and Datuk Kaya, play a role in regulating aspects of the lives of their tribal members. The mind is still very simple and life is determined by natural factors, has led to the emergence of traditions such as the Dukun, Bomo, Pawang and Kemantan. Siak Malay marriage customs regulate the processional customs before marriage, the procession of preparation for marriage and the procession after the marriage. The customary procession before marriage explains the ideal marriage and mate restrictions, forms of marriage, conditions for marriage and how to choose a mate. Meanwhile, the marriage ceremony explained in the research of the Riau Malay customary law community which will be studied from a legal perspective, it is about the customary law of marriage. The problem to be discussed is how is the pattern of actualization of the marriage customs of the Malay customary law community in Siak? B. METHOD This research was conducted in the Siak area. The method used is a critical historical research method and qualitative research with Snowboll sampling. According to Louis Gottscholk, the historical method is the process of approaching and critically analyzing records and relics of the past. Population is all objects or all individuals or all symptoms or all events or all units to be studied. Population or Universe is all objects or all individuals or all symptoms or all events or all units to be studied. Populations are usually very large and very broad, so it is often not possible to study the entire population. In a study, it is actually not necessary to examine all objects or all individuals or all events or all of these units to be able to provide a precise and correct picture of the state of the population, so it is enough to take only part of it to be studied as a sample. The reason for choosing these 3 villages as samples is because most of the Sakai people in the village are predominantly Muslim. Then from each village five heads of families were taken as respondents. The considerations in selecting the respondents were, Sakai people who are long-standing residents, who have embraced Islam for a long time, and have used Islamic inheritance in completing their inheritance. The sampling technique used in this research is purposive sampling. Mardalis in his book suggests that the use of the purposive sampling technique has a purpose or is done intentionally, how to use this sample among the population so that the sample can represent the characteristics of the population that have been known previously. The use of this technique is always based on knowledge of certain characteristics that have been obtained from the previous population. The data used in this study is primary data. In addition, secondary data consisting of legal materials is also used, namely: a) Primary Legal Materials Primary legal materials are legal materials that have authority (authoritative). The primary legal materials in this study consist of: Al-Qur'an and Hadith ; b) Secondary Legal Materials Secondary legal materials are materials that are closely related to primary legal materials such as doctrines (opinions of experts), books, legal journals, papers, print and electronic media; and c) Tertiary Legal Materials, legal materials that provide instructions and explanations of primary legal materials and relevant secondary legal materials to complement the data in this study, such as general dictionaries, magazines and the internet as well as materials outside the legal field related to complete data. C. RESULT AND DISCUSSION The Actualization of Marriage Customs of the Malay Customary Law Community in Riau Province Marriage between bachelors and maidens can only go through the process of traditional ceremonies after an agreement has been reached between the two parties. Deliberations from the male family are held after the bachelor child conveys his intention to his mother and father that he wants to attract the girl who is his dream. The male family holds a meeting with relatives to send someone who is wise and clever to conduct a peek at the daughter who has become the choice. The procession before marriage is as follows: a. Merisik Merisik is the first step in the marriage process which aims to investigate the whereabouts of a prospective bride. Merisik is a method that is carried out secretly by a man to a girl or virgin who is his dream. In practice, the parents of the man or represented by his close family to find out about himself and the family condition of the woman, comes to the question of whether the woman in question already belongs to someone or not, if it has not been proposed by someone else, it will continue with the process of proposing where the man brings a ring as a sign that the woman has been proposed to by someone. Merisik can be done based on the wishes of the parents or at the request of the son concerned. As for those who are sent to visit and seek information, they should communicate in polite and gentle language, such as by asking whether the flower is already guarding it? If you don't have one, I have beetles. Or by stating that the purpose of his visit is to look for flower plants, and if the owner of the house answers that there are no flowers in our house or if asked what flowers he wants, then he replies that what he is looking for is not flowers around the house, but flowers near the kitchen (homeowner's daughter). b. Meminang Meminang means asking a woman to be a wife or it can also be called proposing to someone. If there has been an agreement from the man, then it is conveyed to the woman that the man will come for a proposal on the agreed date. Because there has been a notification, the woman's family prepares a traditional instrument in the form of a betel leaf, as well as the men who have to prepare an upheld traditional equipment, namely a betel leaf complete with its contents. The marriage ceremony is carried out after the men receive confirmation information from the virgin and her family that the virgin does not yet have a bond with the boy. The word Meminang is generally referred to as applying. The procedure for its implementation is different even though it is already known by many people. For the Malay procedure itself, how to propose is done in a simple form. There were only a few male delegates who came, but there were also male parents who were present directly at the virgin's residence to talk with their parents (Liani, 2021;). Before applying, the woman must be notified in advance, and the proposal is carried out at night after the Isha prayer, in this proposal there is a discussion of the timing of the delivery of shopping and the amount Men's envoys who are sent to visit the women's house are usually chosen and intelligent parents, wise, clever, straighten the crooked, resolve the tangled, good at speaking in Malay customs, can be a mouthpiece, wise in negotiating and know the customs. When the male envoy arrives at the female side's house, they are invited to enter the house and sit in the living room of the house. After sitting facing each other between the two parties, the first step from the host is to slap the reception of guests with a sincere heart. The host invites the guest to take the betel with his equipment, then the guest does the same thing, namely the male shoves his palm to the host. After the ceremonial ceremony, the handover of the betel nut from both parties, it begins with the word welcome which takes precedence with the Malay rhyme which is started by the host, for example as follows: Women The Menggantung-Gantung event is held a few days before the marriage or pairing is done. This activity is to make tents and decorations, hang stage equipment, decorate the bedroom of the bride and groom, and decorate the place where the bride and groom sit together. This activity reflects that the Riau Malay community still has a gotong royong culture. In addition to this activity, it must be carried out carefully and listened to by elders so that there is no wrong installation, wrong location, wrong use and so on. This work is done in groups from relatives and friends. This Menggantung-Gantung procession was led by Mak Adam. Assisted by young men and young women and assisted by middle-aged women. This Menggantung-Gantung work is done 5 days or 7 days before the wedding ceremony and the direct ceremony or the event where the bride and groom are side by side. Making a altar is called a large outlet and consists of several levels, usually in the past the number of levels of large outlets depended on the social level of the substitutes. For example, if the sultan's family class has 9 levels, the Tengku-tengku descendants have 7 levels, for the progenitor's son and the son of a royal person it has 5 levels while the common people only have 3 levels. This outlet serves as a place for the bride and groom as well as a place for the traditional patting of fresh flour ceremony. d. Berina Curi The process of Berinai Curi is a ceremony that gives signs by giving henna on the palms of the hands, nails, fingers and toes of the bride and groom. Henna itself is made from henna leaves that have been finely ground and then mixed with tamarind water until the color turns reddish. This procession is a symbol that the bride has just officially become a newlywed. This procession is also carried out in accordance with previous customs, so there are many conditions or rules, such as how to deliver the henna from the bride's house to the groom's house by bringing slap and plain flour is carried out. However, in practice it is rarely done, it's just that it is only attended by the family and the procession is accompanied by the singing of tambourines by women. e. Barandam Berandam is an activity that is carried out for the two prospective brides the day before marriage. This bathing activity can also be called "cutting small hair," i.e. shaving or trimming the hair on the forehead, temples, eyebrows, nape, hair and legs. The activity was carried out at ba'da Asr led by Mak Andam accompanied by the parents or closest family of the bride. Before bathing, the two brides-to-be must take a bath in lime. The bride-to-be gets the first opportunity in this activity which is accompanied by tambourine music. Only then did it take place at the residence of the male candidate. The bathing ceremony means cleaning the bride's physical (outward) with the hope that her mind is also clean and ready to face and lead a new life. The most important thing is to shave the hair because this part of the body is the location of the beauty of the crown of women. In addition, shaving and cleaning the thin hair around the face, neck, nape, beautifying the forehead, raising the face series by using betel nut and cursed spells. f. Marriage contract The marriage ceremony is a sacred religious ceremony and is prepared on a large scale at the bride's house. In general, this ceremony is held at night after the Isha prayer. Before the groom comes down from his parents' house to go to the bride's house, first at the groom's house a ceremony is held to release the departure of the groom with a plain flour event which is carried out by the relatives of the groom. After the fresh flour ceremony is finished, the groom first sits cross-legged to his parents and closest relatives to get prayers and blessings so that they are safe in facing a new life later. The mother draped a long gold chain around her son's neck, a sign that the love between the child and his father and mother will not be interrupted, for life. His father and mother did not accompany their son to the place of this marriage ceremony, he only prayed from afar that his son would be safe and carry out the marriage contract smoothly at the house of his prospective in-laws. Usually, this event is quite touching because with this event he will move from his parents' house. g. Khatam Qur'an A sakinah, mawaddah and warahmah household is a household built on a religious foundation as determined by Allah SWT. Therefore, every virgin who wants a strong household ark, she should learn and understand the science of religion itself. The Khatam Al-Qur'an procession is intended as a symbol that the child has completed his recitation / learning of his holy book, namely the Qur'an so that if there are problems in the future he is able to overcome it in ways that have been guided by his religion. This event usually takes place from 8 to 10 am after the marriage ceremony which is held at the bride's house and is attended by only women led by the Koran teacher. This process is carried out because it is limited between boys and girls which is continued again with barzanji and marhaban which is carried out by women only. This activity of khatam Al-Qur'an becomes a very important symbol for the prospective bride because it shows that the prospective bride can recite the Koran properly and correctly, because women will become mothers for their husband's children and a mother who will teach their children. their children to be pious and pious children, therefore a mother must be able to read the Qur'an as a guide and support for human life. The Qur'an khatam event was attended by scholars and women only, held at the bride's house, precisely in front of the aisle. During this event, turmeric rice and eggs were provided as a blessing to take home for those who attended the khataman event. For the khatam Qur'an itself the bride reads juz'amma from surah ad-dhuha to an-nas, alternately with relatives who accompany her, such as her cousin, sister and others. Analysis of the Marriage Customs of the Malay Customary Law Community in Riau Province The success of the implementation of marriage is very dependent on the participation of family and society. In Malay weddings before the wedding, there are many processions or traditions that must be carried out, including merisik, proposing, between engagement signs, between shopping, enforcing wards, hanging, night rituals, bathing ceremonies, ornate baths, khatam Al-Qur'an, pats, plain flour, side by side ceremony, worshiping in-laws, peaceful bathing ceremony, sleeping and sharpening teeth, then worshiping both parents and family, eating peaceful rice and visiting in-laws at night, each of which has educational values. Based on the results of the researcher's interview with the chairman of the Malay Traditional Institute (Lembaga Adat Melayu) of Bengkalis Regency, the educational values in the Malay wedding tradition are: Educational values in the Malay wedding tradition through symbols and a series of processions in it. The meaning of these educational values is only obtained after going through a process of reasoning and deep appreciation or feeling. In another sense, the educational values are implied in a series of symbols and processions of the marriage customs. Take, for example, the merisik custom, which is a procession of finding out information about a potential life partner secretly by sending someone, usually a middle-aged woman called Mak Telangkai (Sulut Achiever), to investigate matters relating to the prospective wife, especially regarding morals and character. his character. This procession when examined further instills the importance of the value of honesty. Likewise in a series of other customs. Based on observational studies and documentation, that educational values in Malay marriages include the value of faith, the value of honesty, the value of responsibility, moral values and social values. h. CONCLUSION The implementation of traditional Malay ceremonies, especially in Bengkalis district, consists of several stages of traditional ceremonies. The stages of the ceremony are divided into three parts, namely before marriage, during marriage, and after the marriage contract. Of the various processions of traditional Bengkalis Malay wedding ceremonies, not all of them are based on Islamic religious orders, but only follow the customs that have been carried out for generations by the Malay community from ancient times. Among the traditional ceremonies that apply based on Islamic orders are merisik, meminang, between shopping, consent to consent, khatam kaji, parade. Of the various traditional ceremonies above contain elements of advice in Islam to be carried out in a marriage for Muslims, it's just that the names are different. On the other hand, marriage ceremonies that are not based on Islamic religious rules are hanging, stealing, bathing, plain flour, side by side, eating face to face, bathing in garden kumbo. The various ceremonies above only follow traditional customs that have long been exemplified by Malay traditional elders from the past until now, but overall of all Bengkalis Malay traditional wedding processions have their own meanings and values so that they are still a guideline for the Malay community to be carried out in marriage.
Accelerated development of instability-induced osteoarthritis in transgenic mice overexpressing SOST. OBJECTIVE Sclerostin (SOST), acting as a Wnt antagonist, has been shown to play a key role in regulating bone homestasis, and has also been linked to osteoarthritis (OA) development. Here, we investigated whether overexpressing SOST could affect OA development after destabilization of the medial meniscus (DMM) using SOST transgenic (Tg) mice. METHODS Bone and cartilage phenotypes of SOST Tg mice at 10 weeks of age were investigated by dual x-ray absorptiometry (DXA) and histology. Subsequently, 10-week-old SOST Tg mice and their wild-type (WT) littermates were subjected to DMM or sham surgery. Knee joints were isolated to evaluate the cartilage damage and the subchondral bone plate thickness at 2 and 8 weeks post-surgery. The changes of chondrocyte anabolic and catabolic responses after IL-1 or TNF stimulation, -catenin signaling and apoptosis were also measured. RESULTS Ten-week-old SOST Tg mice were identical to their WT littermate males except that they displayed digit abnormalities and osteopenic, whereas more severe OA was observed in SOST Tg mice at 2 and 8 weeks post-DMM. In addition, DMM resulted in significantly greater subchondral bone changes compared with sham surgery in SOST Tg mice at 8 weeks post-surgery. The accelerated OA in SOST Tg mice may be associated with reduced -catenin signaling and increased chondrocyte apoptosis. CONCLUSION Overexpressing SOST led to accelerated development of instability-induced OA. Our data further highlight that cartilage homeostasis requires finely tuned Wnt signaling.
/** * Function to unsubscribe to alerts related to a component for user */ @Override public void unsubscribeAlert(Subscription subscription) { int envId = environmentDao.getEnironmentIdFromName(subscription.getEnvironmentName()); subscription.setEnvironmentId(envId); String authToken = alertSubscibeDao.getSubscriptionToken(subscription.getSubsciptionVal(), subscription.getComponentId(), envId); if (authToken == null) { throw new IllegalArgumentException("Provided Email id is not yet subscribed for this component"); } subscription.setAuthToken(authToken); if (subscription.getSubsciptionType().equals("email")) { mailSenderUtil.sendMailForSubscription(subscription, false); } else { alertSubscibeDao.deleteSububscription(subscription.getAuthToken()); } }
Ultrastructural immunolocalization of lysyl oxidase in vascular connective tissue. The localization of lysyl oxidase was examined in calf and rat aortic connective tissue at the ultrastructural level using polyclonal chicken anti-lysyl oxidase and gold conjugated rabbit anti-chicken immunoglobulin G to identify immunoreactive sites. Electron microscopy of calf aortic specimens revealed discrete gold deposits at the interface between extracellular bundles of amorphous elastin and the microfibrils circumferentially surrounding these bundles. The antibody did not react with microfibrils which were distant from the interface with elastin. There was negligible deposition of gold within the bundles of amorphous elastin and those few deposits seen at these sites appeared to be associated with strands of microfibrils. Lysyl oxidase was similarly localized in newborn rat aorta at the interface between microfibrils and nascent elastin fibers. Gold deposits were not seen in association with extracellular collagen fibers even after collagen- associated proteoglycans had been degraded by chondroitinase ABC. However, the antibody did recognize collagen-bound lysyl oxidase in collagen fibers prepared from purified collagen to which the enzyme had been added in vitro. No reaction product was seen if the anti-lysyl oxidase was preadsorbed with purified lysyl oxidase illustrating the specificity of the antibody probe. The present results are consistent with a model of elastogenesis predicting the radial growth of the elastin fiber by the deposition and crosslinking of tropoelastin units at the fiber-microfibril interface. ined in calf and rat aortic connective tissue at the ultrastructural level using polyclonal chicken anti-lysyl oxidase and gold conjugated rabbit anti-chicken immunoglobulin G to identify immunoreactive sites. Electron microscopy of calf aortic specimens revealed discrete gold deposits at the interface between extracellular bundles of amorphous elastin and the microfibrils circumferentially surrounding these bundies. The antibody did not react with microfibrils which were distant from the interface with elastin. There was negligible deposition of gold within the bundles of amorphous elastin and those few deposits seen at these sites appeared to be associated with strands of microfibrils. Lysyl oxidase was similarly localized in newborn rat aorta at the interface between microfibrils and nascent elastin fibers. Gold deposits were not seen in association with extracellular collagen fibers even after collagen-associated proteoglycans had been degraded by chondroitinase ABC. However, the antibody did recognize collagen-bound lysyl oxidase in collagen fibers prepared from purified collagen to which the enzyme had been added in vitro. No reaction product was seen if the anti-lysyl oxidase was preadsorbed with purified lysyl oxidase illustrating the specificity of the antibody probe. The present results are consistent with a model of elastogenesis predicting the radial growth of the elastin fiber by the deposition and crosslinking of tropoelastin units at the fiber-microfibril interface. YSYL oxidase plays a pivotal role in the biosynthesis of collagen and elastin by oxidizing peptidyl lysine to peptidyl a-aminoadipic-5-semialdehyde, the precursor to the covalent crosslinkages in these connective tissue proteins. The lysine-derived crosslinkages that evolve from this aldehyde stabilize the fibrous structures of elastin and collagen, thus providing anchoring points important to the tensile and/or elastic properties exhibited by these proteins. It appears likely that lysyl oxidase functions in vivo in the extracellular space and, indeed, the enzyme is secreted into the growth medium by cultured fibroblasts and smooth muscle cells. Little is known about the localization of lysyl oxidase in either the intracellular or extraceUular compartments, however. Siegel et al. had demonstrated at the level of the light microscope that the enzyme appears to be associated with extracellular fibers of collagen in fibrotic liver, using fluorescently labeled anti-lysyl oxidase as a probe. Its localization has not been probed at the ultrastructural level, however, nor has it been examined in an elastin-rich tissue. In the present report, we describe the localization of lysyl oxidase in the extracellular matrices of bovine calf aorta and in newborn and adult rat aorta using ultrastructural immunocytochemical methods and a polyclonal antibody to bovine aortic lysyl oxidase that we have recently described. Preparation and Assay of Enzyme Lysyl oxidase was isolated from 4-M urea extracts of bovine aorta by a modification of the published procedure (n). The modified procedure substitutes chromatography through Cibacron Blue-Sepharose (Pharmacia Fine Chemicals, Piscataway, NJ) for the N,N'-DEAE cellulose step originally described, thus providing a method which co-purifies the four ionic variants of lysyl oxidase normally resolved by DEAE cellulose chromatography. Prior studies had established that the peptide maps of proteolytic digests of each species were remarkably similar as were the molecular masses of each variant (32,000 D) and the substrate and inhibitor profiles ofcach. Because the four species display such structural and catalytic similarities, use of the co-purified mixture for certain immunological, catalytic, and physical studies seems warranted especially since co-purification provides larger quantities of enzyme. Preparation of Antibody Lysyl oxidase purified as described appeared homogeneous by SDS PAGE performed according to Laemmli. The enzyme was freed of possible contaminants by excising the band corresponding to iysyl oxidase from the acrylamide gel for use as the antigen. A narrow strip of the gel slab was cut out and separately stained with Coomassie Brilliant Blue and used as a guide for excising the section of the unstained gel corresponding to the electrophoretic migration position of iysyl oxidase at 32,000 D. This gelpurified antigen was then used to raise antibodies in chickens as described. Animals were bled at bi-weekly intervals and serum samples were screened for anti-lysyl oxidase activity by a modification of the dot blot procedure of Hawkes et al.. The co-purified 32,000-D lysyl oxidase antigen (5 ~tg/dot) was immobilized on nitrocellulose, the blot was then incubated with dilutions of the immune serum and then with rabbit anti-chicken antibody coupled to horseradish peroxidase (Miles-Yeda, Inc., Elkhart, IN). The blot was thoroughly washed as described by Hawkes et al. before and after incubations with the first and second antibody, respectively. Immobilized immune complexes were visualized by incubation of the blot with the peroxidase substrate, 4-chloronaphthol, to develop visible color. Freshly obtained immune serum developed a titer of 1:16,000 by this technique. Preimmune chicken serum yielded negative reactions in this procedure, as did controls from which primary antibody or the lysyl oxidase antigen had been omitted. Both anti-lysyl oxidase serum and preimmune serum were partially purified before use as ultrastructmal probes. Each serum was dialyzed against 0.02 M Tris HCI (pH 8.0) and applied to columns (1 x 1.5 cm) of DEAE-Atti-Gel Blue (Bio-Rad Laboratories, Richmond, CA). The IgG components of the sera passed through this column and were completely eluted by washing with 0.02 M "Iris HC1 (pH 8.0). Anti-lysyl oxidase activity was recovered in the IgG eluate as determined by the dot/blot titration method. Generation of Enzyme-Collagen Complexes In Vitro Type I collagen was isolated from fetal calf skin by an adaptation of the method of Monson and Bornstein as previously described. The acid extraction step was avoided to preserve the N-and C-terminal telopeptides intact. Collagen types in the neutral salt extract were separated by precipitation with specific concentrations of NaCI. The type I product was chromatograpbed over DEAE cellulose under conditions that should resolve type I tropocollagen from procollagen species and from acidic proteoglycans. The purity of the product as type I tropocollagen was established by amino acid analysis and by SDS PAGE, each of which indicated the absence of procollagens in this preparation. The product was found to be free of contamination by type BI collagen by the delayed reduction gel electrophoresis method of Sykes et al.. Fibrils of type I collagen were prepared by adding 50 ttl of a 5 mM acetic acid solution of collagen (0.57 mg mi-t) to 1.5 ml polyethylene tubes on ice and diluting to 0.5 ml with 5 mM acetic acid. To this was added 0.5 ml of a buffer composed of 30 m_M N-tris(hydroxymethyl)methyl-2-aminoethane sulfonic acid, 30 mM NazHPO4, and 135 mM NaCI (pH Z5). Fibrils were formed by incubating this mixture at 26"C for 3 h. Lysyl oxidase in 6 M urea was dialyzed against 5 raM potassium phosphate (pH 7.5) before use in these studies. Aliquots of 50 ttl containin~ 2 ttg of the dialyzed enzyme were added to tubes containing the preformed collagen fibrils, the mixtures were incubated at 37"C for 10 rain and cen-. trifuged at 10,000 g for 1.5 min. The supernatants were removed and the pellets were gently suspended in the fibril-forming buffer and reisolated by centrifugation to remove unbound enzyme. The pellet of the enzyme-collagen complex was then fixed by treatment with 4% paraformaldehyde for 2 h on ice and processed as above for electron microscopy. Immunohistochemistry Aortas of 2-wk-old calves, newborn rat pups and adult Sprague Dawley rats were freshly obtained and random pieces of aortic tissue were finely minced and fixed in 4 % paraformaldehyde in 0.1 M sodium phosphate buffer (pH 7.2) for 2 h at 0*C. The tissue was washed four times in this phosphate buffer in the absence of fixative and then processed into Lowicryl K4M using the low temperature embedding method of Carlemalm et al.. The embedded samples were polymerized by exposure to ultraviolet light and thin (60-70 nm) sections were cut and mounted on collodion-coated nickel grids. A twostep indirect immunogold procedure was used to localize antigen in the tissue specimens reacting with chicken anti-lysyl oxidase. Mounted thin sections were etched in 10% I-I202, washed in distilled deionized water, and incubated in a 1:30 dilution of normal goat serum for 30 rain. The grids were transferred directly into chicken anti-lysyl oxidnse diluted 1:1, 1:10, or undiluted and incubated in a moist chamber for 1-24 h at 4"C. The sections were then washed four times in a buffer of 0.1 M Tris and 0.1% BSA'(pH 7.2), and incubated for 1 h with a 1:6 dilution of rabbit anti-chicken IgG conjugated with 10-urn particles of colloidal gold (E. Y. Laboratories, Inc., San Mateo, CA). The grids were extensively washed in filtered Tris-BSA buffer, rinsed twice in distilled deionized water, air-dried, and stained with uranyl acetate and lead citrate. Control sections were incubated with preimmune chicken serum, chicken anti-lysyl oxidase preincubated with excess purified lysyl oxidase before addition to tissue sections or gold-conjugated rabbit anti-chicken IgG in the absence of anti-lysyl oxidase. After immunogold labeling of lysyl oxidase, some grids were stained with a 1% palladium chloride solution for 5-15 min, rinsed thoroughly, and counterstained with uranyl acetate and lead citrate before observation in the electron microscope. Enzyme Digestion To account for the possibility that proteoglycans might mask the immunoreactivity of lysyl oxidase associated with collagen fibers, freshly isolated calf aorta was finely minced and incubated with 1 U m1-1 of chundroitinase ABC (Miles Laboratories, Inc.) in 0.1 M Tris buffer (pH 8.0) containing 0.5% BSA for 1 h at 37"C. Control specimens were incubated under these conditions but in the absence of chondroitinase ABC. After incubation, the tissue preparations were each divided into two aliquots, one of which was fixed and embedded for immunolabeling as described above, while the other was stained with 1% ruthenium red in McI1vaines buffer, (pH 5.6) for 30 min at room temperature. The tissue was then fixed overnight at 4"C in a solution of 3 % glutaraldehyde and 1% ruthenium red in Mcllvaines buffer. The next day, the tissue was quickly rinsed four times with buffer containing ruthenium red, postfixed for 2 h in 1% osmium tetroxide, and then dehydrated through asoending concentrations of acetone and embedded routinely in Epon for electron microscopy. Reactivity of Antibody with Lysyl Oxidase SDS gel electrophoresis of the purified preparation of bovine aortic lysyl oxidase used as antigen in the present study demonstrated that it consisted of an apparently homogeneous protein species of 32,000 D (Fig. 1 A ). The reactivity of the chicken anti-lysyl oxidase against this protein was demonstrated by immunoprecipitation of a preparation of purified lysyl oxidase that had been radioactively labeled with usI ( Fig. 1 B). Studies in progress have demonstrated that the antibody also precipitates considerably larger isotopically labeled proteins obtained from the cell matrix of calf aortic smooth muscle cells pulsed with radioactive amino acids in culture. It is assumed that these proteins are precursors of lysyl oxidase or are otherwise related to the 32,000-D product since the immunoreactivity with these species is competitively prevented by preincubation of the chicken anti-lysyl oxidase with the unlabeled, purified 32,000-D species. The antibody is unreactive against peptides solubilized by hot oxalic acid extraction of bovine ligament elastin, is not reactive toward bovine fibronectin, and does not precipitate products which are susceptible to bacterial collagenase from cultured calf smooth muscle cells (data not shown). The assumption that the antibody is specific for forms of lysyl oxidase in cellular and tissue specimens is supported by the competing effect of the purified antigen. Immunocytochemistry Bundles of amorphous elastin in a section of calf aorta are shown in Fig. 2, A-C, with microfibrils most evident at the periphery of the bundles. Gold deposits signifying the presence of lysyl oxidase are also present at the periphery of the elastin bundle in association with microfibrils. Microfibrils that are not at the elastin interface do not bind the antibody. The distribution of lysyl oxidase is continuous around the bundles. Fig. 3, A and B, represent presumed earlier stages of elastin formation in newborn rat aorta where microfibrils predominate over amorphous elastin. In addition to apparent complexes of lysyl oxidase with microfibrils at the periphery of the developing elastin bundle (Fig. 3 A), there are linear deposits of lysyl oxidase running through the bundle in association with thin strands of microfibrils. Fig. 3 B shows a bed of microfibrils with extremely small areas of amorphous elastin. Lysyl oxidase appears in linear, seemingly periodic deposits within the microfibrillar bed. This figure gives the impression of a microfibril-lysyl oxidase template within which linear bands of elastin will ultimately develop. Adult rat aorta, reacted with anti-lysyl oxidase and goldlabeled second antibody (Fig. 4), reveals a thin ring of microfibrils delineating amorphous elastin. Microfibrils are fewer in number and much less dense than in the newborn aorta. Gold labeling of the elastin-microfibril complex is considerably less than in developing elastin, suggesting that much less lysyl oxidase is available for binding by the antibody. Gold deposits are not seen in control specimens prepared using chicken anti-lysyl oxidase that had been preadsorbed by excess purified bovine aortic lysyl oxidase before incubation with fixed tissue (Fig. 5), thus illustrating the specificity of the gold labeling patterns seen in this study. Completely negative results were also obtained with preimmune chicken serum or if the chicken anti-lysyl oxidase but not the goldlabeled second antibody was omitted from the immunolocalization protocol described in Materials and Methods. The gold deposits seen in bovine calf, rat pup, and adult rat aortae thus appear to localize epitopes found in purified 32,000-D bovine aortic lysyl oxidase. Gold deposits are not seen on the longitudinal or transverse sections of collagen fibrils in the aortic sections examined (see Fig. 2), nor were gold deposits clearly visible within cell structures in the process of secretion or transport to the extracellular microfibrillar loci. The apparent lack of gold deposits on collagen fibers was somewhat surprising since prior studies have shown that purified lysyl oxidase binds to native fibers of type I collagen in vitro. Gold deposits were also not seen on collagen fibers of tissue specimens that had been preincubated with chondroitinase ABC to remove proteoglycans associated with collagen before incubation with the first and second antibodies (data not shown). To further investigate this result, complexes of purified lysyl oxidase with native fibers of type I collagen were generated in vitro as described and examined by the anti-lysyl oxidase immunolocalization technique. As shown (Fig. 6) gold deposits are seen in association with these collagen fibers. Collagen fibers to which the enzyme had not been added in vitro did not exhibit gold deposits. D i s c u s s i o n The present report identifies immune-reactive product in association with microfibrillar material found at the periphery of elastic fibers in the extracellular space. The absence of Lysyl oxidase was precipitated from solution by incubation with chicken anti-lysyl oxidase and then with rabbit anti-chicken IgG. The immunoprecipitate was dissolved and heated at 100°C in the electrophoresis sample buffer before electrophoretic resolution on the gel. The radioactive band was visualized by autoradiography. gold deposit in specimens treated with preimmune serum, in specimens treated with immune serum that had been pretreated with the 32,000-D aortic lysyl oxidase antigen that had been purified to apparent homogeneity, and in those specimens in which the primary antibody was omitted argues in favor of the conclusion that the discrete gold deposits identify lysyl oxidase protein at these sites. The complete inhibition of the deposition of gold by preincubation of anti-lysyl oxidase with purified lysyl oxidase is consistent with the conclusion that the antibody both recognizes and is specific for lysyl oxidase. The fact that gold is not deposited on all microfibrils but is only deposited on those at the interface with elastin indicates that the antibody is not directed against microfibrils themselves or against a component common to all microfibrils. Moreover, the distribution of gold deposits is not consistent with that expected of fibronectin since collagen fibers in tissue specimens were not reactive with anti-lysyl oxidase in the present study but would be expected to react with antibodies directed against fibronectin. The presence of lysyl oxidase in association with microfibrillar material surrounding elastin fibers is of particular interest. These results suggest that elastogenesis is characterized by accumulation of microfibrillar structures adjacent to the surface of the fibrogenlc cell; lysyl oxidase associates with these microfibrils, after which elastin fibrils appear within the microfibril-lysyl oxidase aggregates. The microfibrillar material remains in association with the periphery of the elastin component but is not evident within the elastin fiber which remains structurally amorphous. A model for the morphogenesis of elastin fibers has been proposed that is consistent with the present observations. This model suggests that microfibrils are first formed in the extraceUular space.in the pericellular environment and then may serve as a scaffolding for elastin deposition (4,5,. Noting the continuing association of microfibrils with the developing elastin fiber, Cleary et al. had speculated that the microfibrillar material may be associated with lysyl oxidase. The present findings substantiate that possibility. Indeed, the present observation that lysyl oxidase is associated with microfibrillar deposits before and after the appearance of amorphous elastin within the area circumscribed by the microfibrils is consistent with the hypothesis that this complex plays an essential role in elastin fiber biosynthesis. The paucity of microfibfiUar material and gold deposits in the interstices of the amorphous elastin fiber is consistent with a model predicting the radial growth of the elastin fiber by the deposition and crosslinking of newly accreting tropoelastin precursors of elastin at the fiber-microfibril interface. It seems possible that the microfibrillar material may actively participate in this process by providing a matrix for the alignment of enzyme, tropoelastin and the preexistent elastin fiber, thus facilitating radial fiber growth. The association of lysyl oxidase with only some of the microfibrils suggests selectivity of the elastogenic process. Indeed, the linearity of the localization of lysyl oxidase on microfibrils where little amorphous elastin is visualized (Fig. 3 B) further suggests that this complex may act as a template for deposition of the elastic fiber. It is also evident that lysyl oxidase remains associated with the microfibrillar components of mature elastic bundles as revealed by the micrographs of the enzyme localization in the adult rat aorta. The persistance of enzyme in the adult tissue may signal that the synthesis and/or repair of elastin fibers continues as the animals age. It is important to note, however, that the immunological marker for lysyl oxidase does not differentiate between catalytically functional and nonfunctional enzyme. Notably, gold deposits were not found in association with extracellular collagen fibers in tissue specimens, although the enzyme was seen in association with collagen when lysyl oxidase was added to collagen fibers in vitro. In contrast with the present results, collagen fibers in the extracellular matrices of fibrotic rat liver and chick tendon were labeled in a prior study that used immunofluorescently labeled antibody directed against lysyl oxidase purified from chick cartilage. The purification method used for the isolation of the chick cartilage enzyme involved chromatography of urea extracts of cartilage on DEAE cellulose and on collagen-Sepharose columns. In contrast, the isolation of bovine aorta lysyl oxidase used as antigen in the present study employed DEAE cellulose, Cibacron Blue Sepharose and gel exclusion chromatographic steps. It has been our experience that gel exclusion chromatography in 6 M urea is required to free the enzyme product of traces of fibronectin and other high molecular weight contaminants. We had previously observed this also to be necessary with enzyme purified by DEAE cellulose and collagen-Sepharose. Because specific information was not given about the specificity of the antibody raised against the chick cartilage enzyme, it appears possible that the immunolocalization seen in the earlier study may in part reflect a reaction of the antibody with other collagen-bound macromolecules such as fibronectin. Moreover, although collagenor elastin-specific forms of lysyl oxidase have not been identified by assays of isolated enzymes in vitro, it also remains possible that the discrepancy between the immunolocalization results of the present study with those of Siegel et al. may reflect such enzyme specificity differences between the chick cartilage and bovine aortic enzymes in vivo. It is unlikely that collagen-associated proteoglycans prevented access of the antibody to lysyl oxidase since preincubation of tissue specimens with chondroitinase ABC did not alter the distribution of the antibody binding sites. It is possible, however, that the extracellular collagen fibers seen in the tissue specimens are fully crosslinked products from which bound lysyl oxidase had previously dissociated. Indeed, recent studies have noted that collagen-lysyl oxidase complexes formed in vitro do slowly dissociate. Further, although the purified enzyme used as antigen in the present study oxidizes both collagen and elastin substrates in vitro, the possibility has not been excluded that collagen-specific forms of lysyl oxidase may exist in vivo that are not recognized by the antibody directed against the bovine aortic enzyme.
A New Book on Mystical Theology DoCTOR LOUTH'S earlier book Origins of the Christian Mystical Tradition was reviewed in THE DOWNSIDE REVIEW in July 1981 (Vol. 99, pp. 230-3), and here the author reflects the concerns of that book, this time more specially on the issue of theological method. He is thinking much more freely and gives us a useful and personal survey of literature illustrating the pattern of his ideas across the whole field of method in arts and sciences. But this book is not, like the previous one, a dispassionate though sympathetic, introduction to its subject. Nor was that simply another effort in the safely enclosed world of 'spirituality' or early Christian thought; for Christian mysticism was presented as theological; and if this is the fundamental epistemological orientation of faith, and something conventional studies in theological method fail to tackle, then it seems there is something wrong with the convention. Louth feels that to confine the 'nature of theology' to the critical study of its monuments could issue in blindness beyond the professional hazard of a scholar's myopia and we are all aware of danger to the intellectual integrity of faith when theology buries itself in its own academic department privately going about its own business. Discerning the Mystery indicates precisely the intention of the book and signals what Louth sees as forgotten, Evagrius's ideal of the theologian as one who prays truly:
<filename>utils.go package hhooking import ( "crypto/ed25519" "net/http" external "github.com/bsdlp/discord-interactions-go/interactions" ) func SignatureVerify(r *http.Request, key ed25519.PublicKey) bool { verified := external.Verify(r, key) return verified }
/* * * D-Bus helper library * * Copyright (C) 2004-2011 <NAME> <<EMAIL>> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #ifndef __GDBUS_H #define __GDBUS_H #ifdef __cplusplus extern "C" { #endif #include <dbus/dbus.h> #include <glib.h> typedef struct GDBusArgInfo GDBusArgInfo; typedef struct GDBusMethodTable GDBusMethodTable; typedef struct GDBusSignalTable GDBusSignalTable; typedef struct GDBusPropertyTable GDBusPropertyTable; typedef struct GDBusSecurityTable GDBusSecurityTable; typedef void (* GDBusWatchFunction) (DBusConnection *connection, void *user_data); typedef void (* GDBusMessageFunction) (DBusConnection *connection, DBusMessage *message, void *user_data); typedef gboolean (* GDBusSignalFunction) (DBusConnection *connection, DBusMessage *message, void *user_data); DBusConnection *g_dbus_setup_bus(DBusBusType type, const char *name, DBusError *error); DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name, DBusError *error); gboolean g_dbus_request_name(DBusConnection *connection, const char *name, DBusError *error); gboolean g_dbus_set_disconnect_function(DBusConnection *connection, GDBusWatchFunction function, void *user_data, DBusFreeFunction destroy); typedef void (* GDBusDestroyFunction) (void *user_data); typedef DBusMessage * (* GDBusMethodFunction) (DBusConnection *connection, DBusMessage *message, void *user_data); typedef gboolean (*GDBusPropertyGetter)(const GDBusPropertyTable *property, DBusMessageIter *iter, void *data); typedef guint32 GDBusPendingPropertySet; typedef void (*GDBusPropertySetter)(const GDBusPropertyTable *property, DBusMessageIter *value, GDBusPendingPropertySet id, void *data); typedef gboolean (*GDBusPropertyExists)(const GDBusPropertyTable *property, void *data); typedef guint32 GDBusPendingReply; typedef void (* GDBusSecurityFunction) (DBusConnection *connection, const char *action, gboolean interaction, GDBusPendingReply pending); enum GDBusFlags { G_DBUS_FLAG_ENABLE_EXPERIMENTAL = (1 << 0), }; enum GDBusMethodFlags { G_DBUS_METHOD_FLAG_DEPRECATED = (1 << 0), G_DBUS_METHOD_FLAG_NOREPLY = (1 << 1), G_DBUS_METHOD_FLAG_ASYNC = (1 << 2), G_DBUS_METHOD_FLAG_EXPERIMENTAL = (1 << 3), }; enum GDBusSignalFlags { G_DBUS_SIGNAL_FLAG_DEPRECATED = (1 << 0), G_DBUS_SIGNAL_FLAG_EXPERIMENTAL = (1 << 1), }; enum GDBusPropertyFlags { G_DBUS_PROPERTY_FLAG_DEPRECATED = (1 << 0), G_DBUS_PROPERTY_FLAG_EXPERIMENTAL = (1 << 1), }; enum GDBusSecurityFlags { G_DBUS_SECURITY_FLAG_DEPRECATED = (1 << 0), G_DBUS_SECURITY_FLAG_BUILTIN = (1 << 1), G_DBUS_SECURITY_FLAG_ALLOW_INTERACTION = (1 << 2), }; enum GDbusPropertyChangedFlags { G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH = (1 << 0), }; typedef enum GDBusMethodFlags GDBusMethodFlags; typedef enum GDBusSignalFlags GDBusSignalFlags; typedef enum GDBusPropertyFlags GDBusPropertyFlags; typedef enum GDBusSecurityFlags GDBusSecurityFlags; typedef enum GDbusPropertyChangedFlags GDbusPropertyChangedFlags; struct GDBusArgInfo { const char *name; const char *signature; }; struct GDBusMethodTable { const char *name; GDBusMethodFunction function; GDBusMethodFlags flags; unsigned int privilege; const GDBusArgInfo *in_args; const GDBusArgInfo *out_args; }; struct GDBusSignalTable { const char *name; GDBusSignalFlags flags; const GDBusArgInfo *args; }; struct GDBusPropertyTable { const char *name; const char *type; GDBusPropertyGetter get; GDBusPropertySetter set; GDBusPropertyExists exists; GDBusPropertyFlags flags; }; struct GDBusSecurityTable { unsigned int privilege; const char *action; GDBusSecurityFlags flags; GDBusSecurityFunction function; }; #define GDBUS_ARGS(args...) (const GDBusArgInfo[]) { args, { } } #define GDBUS_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function #define GDBUS_ASYNC_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_ASYNC #define GDBUS_DEPRECATED_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_DEPRECATED #define GDBUS_DEPRECATED_ASYNC_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_DEPRECATED #define GDBUS_EXPERIMENTAL_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_EXPERIMENTAL #define GDBUS_EXPERIMENTAL_ASYNC_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_ASYNC | G_DBUS_METHOD_FLAG_EXPERIMENTAL #define GDBUS_NOREPLY_METHOD(_name, _in_args, _out_args, _function) \ .name = _name, \ .in_args = _in_args, \ .out_args = _out_args, \ .function = _function, \ .flags = G_DBUS_METHOD_FLAG_NOREPLY #define GDBUS_SIGNAL(_name, _args) \ .name = _name, \ .args = _args #define GDBUS_DEPRECATED_SIGNAL(_name, _args) \ .name = _name, \ .args = _args, \ .flags = G_DBUS_SIGNAL_FLAG_DEPRECATED #define GDBUS_EXPERIMENTAL_SIGNAL(_name, _args) \ .name = _name, \ .args = _args, \ .flags = G_DBUS_SIGNAL_FLAG_EXPERIMENTAL void g_dbus_set_flags(int flags); int g_dbus_get_flags(void); gboolean g_dbus_register_interface(DBusConnection *connection, const char *path, const char *name, const GDBusMethodTable *methods, const GDBusSignalTable *signals, const GDBusPropertyTable *properties, void *user_data, GDBusDestroyFunction destroy); gboolean g_dbus_unregister_interface(DBusConnection *connection, const char *path, const char *name); gboolean g_dbus_register_security(const GDBusSecurityTable *security); gboolean g_dbus_unregister_security(const GDBusSecurityTable *security); void g_dbus_pending_success(DBusConnection *connection, GDBusPendingReply pending); void g_dbus_pending_error(DBusConnection *connection, GDBusPendingReply pending, const char *name, const char *format, ...) __attribute__((format(printf, 4, 5))); void g_dbus_pending_error_valist(DBusConnection *connection, GDBusPendingReply pending, const char *name, const char *format, va_list args); DBusMessage *g_dbus_create_error(DBusMessage *message, const char *name, const char *format, ...) __attribute__((format(printf, 3, 4))); DBusMessage *g_dbus_create_error_valist(DBusMessage *message, const char *name, const char *format, va_list args); DBusMessage *g_dbus_create_reply(DBusMessage *message, int type, ...); DBusMessage *g_dbus_create_reply_valist(DBusMessage *message, int type, va_list args); gboolean g_dbus_send_message(DBusConnection *connection, DBusMessage *message); gboolean g_dbus_send_message_with_reply(DBusConnection *connection, DBusMessage *message, DBusPendingCall **call, int timeout); gboolean g_dbus_send_error(DBusConnection *connection, DBusMessage *message, const char *name, const char *format, ...) __attribute__((format(printf, 4, 5))); gboolean g_dbus_send_error_valist(DBusConnection *connection, DBusMessage *message, const char *name, const char *format, va_list args); gboolean g_dbus_send_reply(DBusConnection *connection, DBusMessage *message, int type, ...); gboolean g_dbus_send_reply_valist(DBusConnection *connection, DBusMessage *message, int type, va_list args); gboolean g_dbus_emit_signal(DBusConnection *connection, const char *path, const char *interface, const char *name, int type, ...); gboolean g_dbus_emit_signal_valist(DBusConnection *connection, const char *path, const char *interface, const char *name, int type, va_list args); guint g_dbus_add_service_watch(DBusConnection *connection, const char *name, GDBusWatchFunction connect, GDBusWatchFunction disconnect, void *user_data, GDBusDestroyFunction destroy); guint g_dbus_add_disconnect_watch(DBusConnection *connection, const char *name, GDBusWatchFunction function, void *user_data, GDBusDestroyFunction destroy); guint g_dbus_add_signal_watch(DBusConnection *connection, const char *sender, const char *path, const char *interface, const char *member, GDBusSignalFunction function, void *user_data, GDBusDestroyFunction destroy); guint g_dbus_add_properties_watch(DBusConnection *connection, const char *sender, const char *path, const char *interface, GDBusSignalFunction function, void *user_data, GDBusDestroyFunction destroy); gboolean g_dbus_remove_watch(DBusConnection *connection, guint tag); void g_dbus_remove_all_watches(DBusConnection *connection); void g_dbus_pending_property_success(GDBusPendingPropertySet id); void g_dbus_pending_property_error_valist(GDBusPendingReply id, const char *name, const char *format, va_list args); void g_dbus_pending_property_error(GDBusPendingReply id, const char *name, const char *format, ...); /* * Note that when multiple properties for a given object path are changed * in the same mainloop iteration, they will be grouped with the last * property changed. If this behaviour is undesired, use * g_dbus_emit_property_changed_full() with the * G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH flag, causing the signal to ignore * any grouping. */ void g_dbus_emit_property_changed(DBusConnection *connection, const char *path, const char *interface, const char *name); void g_dbus_emit_property_changed_full(DBusConnection *connection, const char *path, const char *interface, const char *name, GDbusPropertyChangedFlags flags); gboolean g_dbus_get_properties(DBusConnection *connection, const char *path, const char *interface, DBusMessageIter *iter); gboolean g_dbus_attach_object_manager(DBusConnection *connection); gboolean g_dbus_detach_object_manager(DBusConnection *connection); typedef struct GDBusClient GDBusClient; typedef struct GDBusProxy GDBusProxy; GDBusProxy *g_dbus_proxy_new(GDBusClient *client, const char *path, const char *interface); GDBusProxy *g_dbus_proxy_ref(GDBusProxy *proxy); void g_dbus_proxy_unref(GDBusProxy *proxy); const char *g_dbus_proxy_get_path(GDBusProxy *proxy); const char *g_dbus_proxy_get_interface(GDBusProxy *proxy); gboolean g_dbus_proxy_get_property(GDBusProxy *proxy, const char *name, DBusMessageIter *iter); GDBusProxy *g_dbus_proxy_lookup(GList *list, int *index, const char *path, const char *interface); char *g_dbus_proxy_path_lookup(GList *list, int *index, const char *path); gboolean g_dbus_proxy_refresh_property(GDBusProxy *proxy, const char *name); typedef void (* GDBusResultFunction) (const DBusError *error, void *user_data); gboolean g_dbus_proxy_set_property_basic(GDBusProxy *proxy, const char *name, int type, const void *value, GDBusResultFunction function, void *user_data, GDBusDestroyFunction destroy); gboolean g_dbus_proxy_set_property_array(GDBusProxy *proxy, const char *name, int type, const void *value, size_t size, GDBusResultFunction function, void *user_data, GDBusDestroyFunction destroy); void g_dbus_dict_append_entry(DBusMessageIter *dict, const char *key, int type, void *val); void g_dbus_dict_append_basic_array(DBusMessageIter *dict, int key_type, const void *key, int type, void *val, int n_elements); void g_dbus_dict_append_array(DBusMessageIter *dict, const char *key, int type, void *val, int n_elements); typedef void (* GDBusSetupFunction) (DBusMessageIter *iter, void *user_data); typedef void (* GDBusReturnFunction) (DBusMessage *message, void *user_data); gboolean g_dbus_proxy_method_call(GDBusProxy *proxy, const char *method, GDBusSetupFunction setup, GDBusReturnFunction function, void *user_data, GDBusDestroyFunction destroy); typedef void (* GDBusClientFunction) (GDBusClient *client, void *user_data); typedef void (* GDBusProxyFunction) (GDBusProxy *proxy, void *user_data); typedef void (* GDBusPropertyFunction) (GDBusProxy *proxy, const char *name, DBusMessageIter *iter, void *user_data); gboolean g_dbus_proxy_set_property_watch(GDBusProxy *proxy, GDBusPropertyFunction function, void *user_data); gboolean g_dbus_proxy_set_removed_watch(GDBusProxy *proxy, GDBusProxyFunction destroy, void *user_data); GDBusClient *g_dbus_client_new(DBusConnection *connection, const char *service, const char *path); GDBusClient *g_dbus_client_new_full(DBusConnection *connection, const char *service, const char *path, const char *root_path); GDBusClient *g_dbus_client_ref(GDBusClient *client); void g_dbus_client_unref(GDBusClient *client); gboolean g_dbus_client_set_connect_watch(GDBusClient *client, GDBusWatchFunction function, void *user_data); gboolean g_dbus_client_set_disconnect_watch(GDBusClient *client, GDBusWatchFunction function, void *user_data); gboolean g_dbus_client_set_signal_watch(GDBusClient *client, GDBusMessageFunction function, void *user_data); gboolean g_dbus_client_set_ready_watch(GDBusClient *client, GDBusClientFunction ready, void *user_data); gboolean g_dbus_client_set_proxy_handlers(GDBusClient *client, GDBusProxyFunction proxy_added, GDBusProxyFunction proxy_removed, GDBusPropertyFunction property_changed, void *user_data); extern GMainContext *Bluez_Context; #ifdef __cplusplus } #endif #endif /* __GDBUS_H */
<reponame>majolo/tempo from ..serve.pipeline import Pipeline as _Pipeline from ..serve.pipeline import PipelineModels as _PipelineModels from .mixin import _AsyncMixin from .model import Model class PipelineModels(_PipelineModels): # Use AsyncIO Model to export PipelineModels ModelExportKlass = Model class Pipeline(_AsyncMixin, _Pipeline): # type: ignore def __init__(self, *args, **kwargs): _Pipeline.__init__(self, *args, **kwargs) _AsyncMixin.__init__(self) # TODO: Do we need to convert models to async models on-the-fly? self.models = PipelineModels(**self.models.__dict__)
West Valley police are trying to trace a gun that ended up in the hands of a teenage girl who accidentally shot her friend. WEST VALLEY CITY — West Valley police are trying to trace a gun that ended up in the hands of a teenage girl who accidentally shot her friend. On Jan. 30, police were called to Jordan Valley Medical Center West Valley Campus, 3460 S. Pioneer Parkway, where a 16-year-old boy was being treated for a gunshot wound to his arm. The boy at first told police he was accidentally shot by another teen while inside a vehicle parked at Woodledge Park, 5210 W. 4310 South. But the boy later admitted that his girlfriend, who was also in the car, was the one who shot him, according to a search warrant affidavit filed in 3rd District Court. The 16-year-old girl told police that she was handed the gun by a 15-year-old boy and then accidentally shot her boyfriend "when she pulled the trigger thinking the gun was unloaded," the affidavit states. Investigators questioned the teens about where the gun came from. One told detectives he bought it from someone off Snapchat for $250, according to the warrant. Police searched the vehicle used to drive the teen the hospital, which was still in the hospital parking lot, and reported finding a Glock 9mm handgun under the front passenger seat. A background check "revealed the firearm had been reported stolen in 2014 in West Valley City. A second firearm … was also located beneath the front passenger seat," the affidavit states. The accidental shooting occurred just six days before another accidental shooting in West Valley City that resulted in the death of a 15-year-old boy. Marquez Grajeda, 15, was shot in the head from close range and killed on Feb. 5 while inside a bedroom at a house at 1347 W. 2320 South. A 14-year-old boy who claimed that the shooting was an accident has been charged with manslaughter. On March 18, Unified police were called to 5007 W. 5400 South in Kearns where Jerrad Jacobsen, 16, was shot and killed. The incident was originally thought to be an accidental shooting, but three days later, police returned to the house and arrested Jerrad's 15-year-old stepbrother.
<filename>CNTK/GeneralizedHoughTransform/blobs.py<gh_stars>0 from skimage import feature, io, filters, transform img_file = "../data/similar_objects/4.JPG" # load the image and convert it to a floating point data type image = io.imread(img_file) image = transform.rescale(image, 0.4) from matplotlib import pyplot as plt from skimage import data from skimage.feature import blob_dog, blob_log, blob_doh from math import sqrt from skimage.color import rgb2gray image_gray = rgb2gray(image) plt.imshow(image_gray) plt.show() blobs_log = blob_log(image_gray, max_sigma=30, num_sigma=10, threshold=.1) # Compute radii in the 3rd column. blobs_log[:, 2] = blobs_log[:, 2] * sqrt(2) #blobs_doh = blob_doh(image_gray, max_sigma=30, threshold=.01) blobs_list = [blobs_log] colors = ['yellow'] titles = ['Laplacian of Gaussian'] sequence = zip(blobs_list, colors, titles) fig,axes = plt.subplots(1, 2, sharex=True, sharey=True, subplot_kw={'adjustable':'box-forced'}) axes = axes.ravel() for blobs, color, title in sequence: ax = axes[0] axes = axes[1:] ax.set_title(title) ax.imshow(image, interpolation='nearest') for blob in blobs: y, x, r = blob c = plt.Circle((x, y), 2, color=color, linewidth=2, fill=False) ax.add_patch(c) plt.show()
def ali_client(): return ccc.alicloud.acs_client(alicloud_cfg='gardenlinux')
Why the right hates Detroit How the fates of two great cities, Detroit and New Orleans, symbolize what's gone wrong with America Two great American cities have now faced near-death experiences in the 21st century. While Detroit’s gradual slide into bankruptcy and the almost biblical inundation of New Orleans in 2005 look quite different on the surface, I’m more struck by the similarities. Both these tragic events were a long time coming. Only the earlier one involved a literal act of God – although the Almighty was goosed along a bit by rising carbon emissions and rising temperatures – but both could clearly have been prevented. Both tragedies were shaped by larger economic forces and historical trends that lay (or at least appeared to lie) beyond the control of individual politicians or policy makers. Then there’s the obvious but uncomfortable fact that both are cities with large black majorities, in a country where African-Americans are only about 13 percent of the population. But Detroit and New Orleans are not just cities where lots of black people happen to live. They are uniquely important and symbolic centers of African-American culture in particular and American culture in general, whose influence spread into every luxury high-rise, every suburban street and every farmhouse in the country. Both cities have been rigidly resegregated now, but at their cultural height both were places of tremendous fusion and ferment. Jazz was born from the children and grandchildren of kidnapped Africans learning to play European instruments for the dance parties of biracial French-speaking aristocrats; Berry Gordy’s great Motown recordings borrowed the Detroit Symphony’s string section to create what he called “the Sound of Young America,” driving white teenagers to shake a tail feather at sock hops across the land. Advertisement: The cultural legacy of New Orleans and Detroit is not limited by race or geography. Even before it went around the world, jazz traveled up the Mississippi on riverboats, which is how Louis Armstrong (according to legend) met an Iowa kid named Bix Beiderbecke, who would become the era’s second greatest trumpet player. Detroit produced not just the black-owned Motown empire, but also shaped the future of rock with a thriving underground scene that included the MC5, Iggy and the Stooges and the recently rediscovered proto-punk band Death (profiled in a recent documentary), a trio of African-American preacher’s kids who preferred Alice Cooper to Aretha Franklin. Detroit’s most famous rapper, by far, is a white kid from the suburbs. Is it pure coincidence that these two landmark cities, known around the world as fountainheads of the most vibrant and creative aspects of American culture, have become our two direst examples of urban failure and collapse? If so, it’s an awfully strange one. I’m tempted to propose a conspiracy theory: As centers of African-American cultural and political power and engines of a worldwide multiracial pop culture that was egalitarian, hedonistic and anti-authoritarian, these cities posed a psychic threat to the most reactionary and racist strains in American life. I mean the strain represented by Tom Buchanan in “The Great Gatsby” (imagine what he’d have to say about New Orleans jazz) or by the slightly more coded racism of Sean Hannity today. As payback for the worldwide revolution symbolized by hot jazz, Smokey Robinson dancin’ to keep from cryin’ and Eminem trading verses with Rihanna, New Orleans and Detroit had to be punished. Specifically, they had to be isolated, impoverished and almost literally destroyed, so they could be held up as examples of what happens when black people are allowed to govern themselves. Hang on, you can stop composing that all-caps comment – I don’t actually believe that what happened to Detroit and New Orleans resulted from anyone’s conscious plan. Real history is much more complicated than that. I do, however, think that narrative has some validity on a psychological level, and that some right-wingers in America are so delusional, so short-sighted and, frankly, so unpatriotic and culturally backward that they were delighted to see those cities fail and did everything possible to help them along. (I’m not exempting the Democratic political class of those cities from responsibility. Speaking broadly, those in city government there inherited an unsustainable situation in a downward-trending economy, pursued their own short-term objectives and only made things worse.) In the wake of both Hurricane Katrina and the Detroit bankruptcy, many mainstream commentators have tried, with varying degrees of subtlety, to frame these events as “black stories,” and specifically as stories of black dysfunction and black political failure. I’m willing to bet that many white Americans still believe those hysterical early post-Katrina stories about New Orleans residents shooting at aid helicopters (all were later retracted or exposed as false), or believe there was widespread rape and murder among the 20,000 refugees in the Louisiana Superdome. (There were no homicides and only one reported sexual assault, an attempted rape.) While the Detroit situation is normally described as a failure of tax-and-spend, pro-union liberal policies, the racial coding you’ll find on Fox News and elsewhere is crystal clear – and the reader comments on any Detroit-related article, on Salon as elsewhere, will curl your hair with overt racial hatred. There’s definitely more going on with these two cities than old-school racial politics. Alien scientists observing these case histories from outer space might not assume, at first, that skin color had anything to do with it. New Orleans was hit by one of the biggest storms in history, and the government response was monumentally incompetent at all levels. Detroit’s bankruptcy comes toward the end of a long, dreary history: The deindustrialization of the American economy hit our most famous industrial city especially hard; the Big Three automakers blundered and mismanaged themselves into permanent mediocrity; investment capital flowed away from the Rust Belt and into low-tax, non-union jurisdictions in the Sun Belt and around the world; racial discord and rising crime drove the white middle class into the suburbs; financial inequality and the geographical separation between rich and poor became more extreme. As evidenced so memorably in Heidi Ewing and Rachel Grady’s mesmerizing film “Detropia” -- and if you didn't catch it on first release, now is definitely the time -- Detroit is a remarkably quiet and empty city today, one that has lost two-thirds of its 1950 population of nearly 2 million, and contains an estimated 40 square miles worth of abandoned buildings and unused land, an area larger than Manhattan. If those E.T. scholars wrote academic papers describing the Detroit tragedy as an “overdetermined” event with many causes and many possible interpretations, they’d be right. (I realize I’ve made my aliens into Marxists; you go with what you know.) But for those of us down here on the planet’s surface, it is inescapably a tale told in black and white. Detroit is the poorest and blackest large city in the country, ringed by some of the whitest and richest suburbs. We’re now in the second term of our first African-American president, and the overt racial violence that polarized Detroit and the rest of the nation in the 1960s and ‘70s feels, most of the time, like a distant memory. New Orleans and Detroit are exceptional cities in a different sense; most American cities have become polyglot, immigrant-rich communities in which no one ethnic group is a majority, which will likely be true of the United States as a whole by the middle of this century. Advertisement: But the long, hot summer of 2013 – the summer of Paula Deen’s Aunt Jemima costumes and the upside-down O.J. verdict of the George Zimmerman case and the barely concealed conservative jubilation at Detroit’s demise – has reminded us that America’s ugly old-school racial narratives die hard, if they die at all. I don’t have a policy prescription for Detroit or a fixed opinion about urban-suburban consolidation or a federal bailout or some other method of patching the city's fiscal cracks. I do know that the people who live there, most of them black and poor, have already been victimized by several generations of high crime and failing services and the flight of capital, and are about to get beat up some more. Instead of trying to score short-term rhetorical points or assign blame for this mess, which are the only things people on either side of the political or pundit class ever want to do, I’d like to step back and ask a different kind of question: What in the name of Christ do we imagine that people around the world think about this disaster, when they look at us? When they see one of America’s most legendary cities, a capital of the Industrial Age and of 20th-century pop culture, reduced to poverty and decrepitude and dysfunction, compelled (in all likelihood) to strip away still more of its already minimal social services and break its promises to municipal retirees? Or when they see country-club denizens of the leafy suburbs a few miles away, most of them people who grew up in Detroit and made their fortunes there, angrily protest that they have no common interest with the inhabitants of the city and no responsibility for their plight? Does that make us look like a wise and tolerant people, a people with any understanding or reverence for our real culture and history, as opposed to the mythological version? Does it make us look confident, or intelligent, or powerful? I don’t think so. I think the collapse of Detroit makes us look the way we looked after the national humiliation of Katrina: like a bitter, miserly and dying empire where the deluded rich cling to their McMansions and mock the suffering of the poor while everyone else fights over the scraps, and where the slow-acting poison of racism continues to work its bad magic.
package com.dsktp.sora.weatherfarm.data.model.Forecast; import android.os.Parcel; import android.os.Parcelable; /** * This file created by <NAME> * and was last modified on 21/7/2018. * The name of the project is WeatherFarm and it was created as part of * UDACITY ND programm. */ /** * This class represents a Main object that is a part of the API response * when you request weather forecast data. It also implements the Parcelable * interface so we can write the object into Room Database */ public class Main implements Parcelable { private double temp; private double temp_min; private double temp_max; private double pressure; private double sea_level; private double grnd_level; private double humidity; private double temp_kf; //todo there is not such field in current weather public Main(double temp, double temp_min, double temp_max, double pressure, double sea_level, double grnd_level, double humidity) { this.temp = temp; this.temp_min = temp_min; this.temp_max = temp_max; this.pressure = pressure; this.sea_level = sea_level; this.grnd_level = grnd_level; this.humidity = humidity; } public Main() { } public double getTemp() { return temp; } private void setTemp(double temp) { this.temp = temp; } public double getTemp_min() { return temp_min; } private void setTemp_min(double temp_min) { this.temp_min = temp_min; } public double getTemp_max() { return temp_max; } private void setTemp_max(double temp_max) { this.temp_max = temp_max; } public double getPressure() { return pressure; } private void setPressure(double pressure) { this.pressure = pressure; } public double getSea_level() { return sea_level; } private void setSea_level(double sea_level) { this.sea_level = sea_level; } public double getGrnd_level() { return grnd_level; } private void setGrnd_level(double grnd_level) { this.grnd_level = grnd_level; } public double getHumidity() { return humidity; } private void setHumidity(double humidity) { this.humidity = humidity; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { //write the values to Parcel object dest.writeDouble(temp); dest.writeDouble(temp_min); dest.writeDouble(temp_max); dest.writeDouble(pressure); dest.writeDouble(sea_level); dest.writeDouble(grnd_level); dest.writeDouble(humidity); } public static final Parcelable.Creator<Main> CREATOR = new Parcelable.Creator<Main>() { public Main createFromParcel(Parcel in) { return new Main(in); } public Main[] newArray(int size) { return new Main[size]; } }; private Main(Parcel in) { //read and set the values from //the Parcel object setTemp(in.readDouble()); setTemp_min(in.readDouble()); setTemp_max(in.readDouble()); setPressure(in.readDouble()); setSea_level(in.readDouble()); setGrnd_level(in.readDouble()); setHumidity(in.readDouble()); } }
Application of the BAX for screening/genus Listeria polymerase chain reaction system for monitoring Listeria species in cold-smoked fish and in the smoked fish processing environment. The cold-smoked fish industry was used as a model for the development of a system for monitoring Listeria spp. in foods and in the food processing environment. A total of 214 samples including raw fish, fish during the cold-smoking process, finished product, and environmental samples were collected from three processing facilities over two visits to each facility. Samples were screened for Listeria spp. using the BAX for Screening/genus Listeria polymerase chain reaction system (PCR) and by culture. Listeria spp., confirmed by the API Listeria test strip or by a PCR assay targeting the L. monocytogenes hlyA gene, were isolated from a total of 89 (41.6%) samples. Of these, 80 samples also tested positive for Listeria spp. using the BAX system. Specifically, 42 (55.3%) environmental samples (n = 76), 11 (25.6%) raw materials samples (n = 43), 20 (35.1%) samples from fish in various stages of processing (n = 57), and 7 (18.4%) finished product samples (n = 38) tested positive for Listeria spp. using the BAX system. Five (4.0%) of the 125 culture-negative samples yielded BAX system-positive results. Listeria isolates from each of nine culture-positive/BAX system-negative samples yielded a positive reaction when tested in pure culture by the BAX system, suggesting that our false-negative results were likely due to the presence of low Listeria numbers in the initial enrichment as opposed to nonreacting isolates. The employment of alternative enrichment protocols, such as the two-step enrichment recommended by the manufacturer, may increase the sensitivity of the assay.
The Importance of Residual Effects When Choosing a Hypnotic: The Unique Profile of Zaleplon. BACKGROUND: Insomnia is a prevalent medical disorder that has significant effects on occupational performance, health, and quality of life. Insomnia places an enormous burden on society through increased visits to physicians, loss of productivity in the workplace, and an increased rate of accidents. An estimated sum of $100 million is spent each year on direct treatment of unresolved insomnia. Physicians need to initiate early effective treatment to prevent development of chronic insomnia and its associated morbidity. Institution of good sleep hygiene practices may be useful in some patients but may not be adequate for resolution of all sleep problems. Behavioral treatments, while effective and durable, are time consuming and not widely utilized in clinical practice. Pharmacotherapy includes benzodiazepine hypnotics, but concerns regarding adverse effects (e.g., residual sedation) prompted the search for safer options. DATA SOURCES: Published and presented studies containing clinical data on zaleplon, a new nonbenzodiazepine sleep medication, were identified via MEDLINE, Current Contents (ISI database), bibliographic reviews, and consultation with sleep specialists. RESULTS: Zaleplon effectively shortens sleep onset time and improves the quality of sleep in patients with insomnia. Whether administered at bedtime or later at night, zaleplon is devoid of residual sedative effects that impair next-day functioning. Follow-up studies evaluating the long-term efficacy and safety of zaleplon showed that decreased time to sleep onset was maintained during therapy lasting up to 52 weeks, without a withdrawal syndrome after discontinuation. CONCLUSION: Insomnia is recurrent and unpredictable in nature. Despite the long-term morbidity of this sleep disorder, research evidence and practice guidelines have not explored long-term use of hypnotics. Many patients could benefit from long-term drug therapy with a sleep medication that is devoid of residual effects and can be taken at bedtime or later as symptoms occur, rather than nightly in anticipation of a sleep problem.
// // Pure Go implementation of the Matrix arithmetic and GSL libs // draft version // unstable API // // Methods and algorithm drafts and sources // // Start point of algorithms and methods implementation. // Examples of specific algorithms for test are over here too. // package matrix_arithmetic import( // common purpose _"fmt" _ "bufio" _"os" _ "io" _ "strings" _ "strconv" // aoti and so on convertions _ "errors" // errors.New() _"math" _ "log" _"time" // "sync" ) /* // n-мерная норма // условие остановки func norma(cur, next []float64) float64 { var sumSquares float64 for i := 0; i < len(cur); i++ { sumSquares += (next[i] - cur[i])*(next[i] - cur[i]) } //fmt.Println(" norma:", sumSquares) //fmt.Println(" norma:", math.Sqrt(sumSquares)) return math.Sqrt(sumSquares) } // Метод половинного деления для нахождения минимума в градиентном спуске // dichotomia — разделение на две части func dichotomia(g func(args []float64, part float64) float64, args []float64, a0, b0, epsilon float64) float64 { // Номер шага var k int // Отклонени от середины отрезка влево, вправо var left float64 var right float64 // Величина на которую мы отклонимся от середины отрезка var deviation float64 = 0.5 * epsilon // Точка минимума var x_min float64 // Отрезок локализации минимума var ak float64 = a0 var bk float64 = b0 // Шаг 3. Вычислить grad f(x[k]). // Шаг 4. Проверить выполнение критерия окончания ||grad f(x[k])|| < epsilon1 : // а) если критерий выполнен, то x[0] = x[k], останов; // б) если критерий не выполнен, то перейти к шагу 5. // Пока длина отрезка больше заданной точности for k = 1; (bk - ak) >= epsilon; k++ { // Берем середину (ну почти середину - +\- некоторое дельта // в частности у нас deviation = 0.5 * epsilon) left = (ak + bk - deviation) / 2.0 right = (ak + bk + deviation) / 2.0 // Шаг 3. Вычислить grad f(x[k]) // Проверяем в какую часть попадает точка минимума для этого // вычисляем функцию g для точек слева и справа от разбиения // сравния их определяем полжение точки, слева или справа // и выбираем соответствующую найденную точку if g(args, left) <= g(args, right) { // Теперь правая граница отрезка локализации равна right bk = right; } else { // Теперь левая граница отрезка локализации равна left ak = left; } } //делим получившийся отрезок пополам и получаем точку минимума x_min = (ak + bk) / 2.0; return x_min; } func grad(function func (args []float64) float64, args []float64, i int, delta float64) float64 { // NOTE: delta ought to be small enough but you should remember // that too small value will drive to reducing accuracy // // df/dxi = f(x1,x2,...,xi+/\xi,...xn) - f(x1,x2,...xi-/\xi,...xn) / (2 * /\xi) // left := make([]float64, len(args)) copy(left, args) right := make([]float64, len(args)) copy(right, args) left[i] += delta right[i] -= delta return ( function(left) - function(right) ) / (2.0 * delta) } // Метод наискорейшего спуска // steepest descent method func SteepestDescent(function func(args []float64) float64, args []float64, epsilon float64) (float64,[]float64) { const MAXITERATIONS = 1000 // приближение var k int // вечина шага приближения var lambda float64 // П.1. Задают начальное приближение и точность расчёта vec x[0], epsilon // Шаг 1. Задать x[0], epsilon1 > 0, epsilon2 > 0, предельное число итераций М. // Найти градиент функции в произвольной точке. Определить частные производные функции f(x): // grad f(x) = [ df(x)/x1,...,df(x)/dxn ]T(транспонированный вектор) // Начальное приближение u[0] u_cur := make([]float64, len(args)) // Новое прилижение u[k] u_next := make([]float64, len(u_cur)) // задать начальное приближение copy(u_cur, args) fmt.Println("## Исходная точка:") for i,x := range u_cur { fmt.Printf(" %d: x[%d]:%.2f, ", k, i, x) } fmt.Println() fmt.Println() fmt.Println("## Приближения:") // Шаг 2. Положить k = 0 stop := false for k = 0; k < MAXITERATIONS && !stop ; k++ { // П.2. Рассчитывают vec x[k+1] = vec x[k] - lambda[k] * nabla F(vec x[k]), // где lambda[k]= argmin_lambda F(vec x[k] - lambda * nabla F(vec x[k])) // Шаг 3. Вычислить grad f(x[k]). // // Шаг 4. Проверить выполнение критерия окончания ||grad f(x[k])|| < epsilon1 : // а) если критерий выполнен, то x[0] = x[k], останов; // б) если критерий не выполнен, то перейти к шагу 5. // // Шаг 5. Проверить выполнение неравенства k ≥ M: // а) если неравенство выполнено, то x[0] = x[k], останов; // б) если нет, то перейти к шагу 6 // // Шаг 6. Вычислить величину шага lambda[k0](на начальном шаге, k = 0) из условия // F(lambda[k]) = f(x[k] - lambda[k] * grad f(x[k])) -> min lambda[k] // // Выберем метод дихотомии как F(lambda[k]) argmin := dichotomia g := func (args []float64, lambda float64) float64 { // Это функция g(x[k]) в методе наискорейшего (градиентного) спуска // применяемая для нахождения шага lambda[k] как минимума функции g(x[k]) // на отрезке(здес a=-10000, b=100000, методом дихотомии) temp := make([]float64, len(args)) // шаг дифференцирования delta := 0.05 //TODO: ajuset for i := 0; i < len(args); i++ { temp[i] = args[i] - lambda * grad(function, args, i, delta) } return function(temp) } // Находим lambda[k] как минимум функции g(x[k]) на отрезке -10000,100000 lambda = argmin(g, u_cur, -10000, 100000, epsilon); // Вычисляем u[k] новое прилижение // Шаг 7. Вычислить x[k+1] = x[k] - lambda[k] * grad f(x[k]) // шаг дифференцирования delta := 0.05 //TODO: ajuset fmt.Printf(" %d: ", k) for i := 0; i < len(u_cur); i++ { u_next[i] = u_cur[i] - lambda * grad(function, u_cur, i, delta) fmt.Printf(" x[%d]: %.2f, ", i, u_next[i] ) } fmt.Println() // П.3. Проверяют условие остановки: // Если |vec x[k+1] - vec x[k]| > epsilon // или |F(vec x[k+1]) - F(vec x[k])| > epsilon // или |nabla F(vec x[k+1])| > epsilon (выбирают одно из условий), // то k = k + 1 и переход к П.2. // Иначе vec x = vec x[k+1] и останов. // Шаг 8. Проверить выполнение условий ||x[k+1] - x[k]|| < epsilon2, ||f(x[k+1]) - f(x[k])|| < epsilon2: // а) если оба условия выполнены при текущем значении k и k = k - 1, то расчет окончен, x[0] = x[k+1], останов; // б) если хотя бы одно из условий не выполнено, то положить k = k + 1 и перейти к шагу 3 if k > 1 { // Проверяем условие остановки if norma(u_cur, u_next) < epsilon { // останов stop = true } } copy(u_cur, u_next) } // eof for k fmt.Println() fmt.Println("## Точка минимума epsilon:", epsilon) fmt.Println(u_cur) fmt.Printf("f(x): %f\n", function(u_cur)) // получить минимум функции return function(u_cur),u_cur } // ====================================================================== // Пример для проверки // // Собственно здесь записывается наша функция func f(x,y float64) float64 { //TODO: здеась можно задать исследуемею функцию или поиграться с этой //NOTE: если поменяете функцию не забудьте про частные производные return x*x + 2.0*x*y + 3.0*y*y - 2.0*x -3.0*y } func f2(args []float64) float64 { //fmt.Println("f2 args:", args, len(args)) return args[0]*args[0] + 2.0*args[0]*args[1] + 3.0*args[1]*args[1] - 2.0*args[0] - 3.0*args[1] } // // операция grad или nabla // // Это первая производная по dx // частная производная по х func f_dx(x, y float64) float64 { return 2.0*x + 2.0*y - 2.0 } // Это первая производная по dy // частная производная по y func f_dy(x, y float64) float64 { return 2.0*x + 6.0*y - 3.0 } // Это функция g(x[k]) в методе наискорейшего (градиентного) спуска // применяемая для нахождения шага lambda[k] как минимума функции g(x[k]) // на отрезке(здес a=-10000, b=100000) (здесь методом дихотомии) func gExample(x, y, lambda float64) float64 { //var model_f_dx float64 = f_dx(x, y) //var model_f_dy float64 = f_dy(x, y) // срединный разностный метод вычисления первой производной // numerical differentiation // NOTE: delta ought to be small enough but you should remember // that too small value will drive to reducing accuracy //var delta float64 = 0.5 //var approx_f_dx float64 = ( f(x + delta / 2.0, y) - f(x - delta / 2.0, y) ) / delta //var approx_f_dy float64 = ( f(x, y + delta / 2.0) - f(x, y - delta / 2.0) ) / delta //var args []float64 = []float64{x, y} //fmt.Println(" args before:", args) //var grad_dx = grad(f2, args, 0, 0.05) //var grad_dy = grad(f2, args, 1, 0.05) //fmt.Printf(" model x: %.5f approx1 x: %.5f grad x: %.5f\n", model_f_dx, approx_f_dx, grad_dx) //fmt.Printf(" model y: %.5f approx1 y: %.5f grad y: %.5f\n", model_f_dy, approx_f_dy, grad_dy) //fmt.Println() // Проверка дифференцирования return f(x - lambda * f_dx(x, y), y - lambda * f_dy(x, y)) //return f(x - lambda * approx_f_dx, y - lambda * approx_f_dy) //return f(x - lambda * grad(f2, args, 0, 0.05), y - lambda * grad(f2, args, 1, 0.05)) } // двумерная норма // условие остановки func normaExample(x, y float64) float64 { // fmt.Println(" normaE:", x*x + y*y) // fmt.Println(" normaE:", math.Sqrt(x*x + y*y)) return math.Sqrt(x*x + y*y) } // Метод половинного деления для нахождения минимума в градиентном спуске // dichotomia — разделение на две части func dichotomiaExample(a0, b0, epsilon, x, y float64) float64 { // Номер шага var k int // Отклонени от середины отрезка влево, вправо var left float64 var right float64 // Величина на которую мы отклонимся от середины отрезка var deviation float64 = 0.5 * epsilon // Точка минимума var x_min float64 // Отрезок локализации минимума var ak float64 = a0 var bk float64 = b0 // Шаг 3. Вычислить grad f(x[k]). // Шаг 4. Проверить выполнение критерия окончания ||grad f(x[k])|| < epsilon1 : // а) если критерий выполнен, то x[0] = x[k], останов; // б) если критерий не выполнен, то перейти к шагу 5. // Пока длина отрезка больше заданной точности for k = 1; (bk - ak) >= epsilon; k++ { // Берем середину (ну почти середину - +\- некоторое дельта // в частности у нас deviation = 0.5 * epsilon) left = (ak + bk - deviation) / 2.0 right = (ak + bk + deviation) / 2.0 // Шаг 3. Вычислить grad f(x[k]) // Проверяем в какую часть попадает точка минимума для этого // вычисляем функцию g для точек слева и справа от разбиения // сравния их определяем полжение точки, слева или справа // и выбираем соответствующую найденную точку if gExample(x, y, left) <= gExample(x, y, right) { // Теперь правая граница отрезка локализации равна right bk = right; } else { // Теперь левая граница отрезка локализации равна left ak = left; } } //делим получившийся отрезок пополам и получаем точку минимума x_min = (ak + bk) / 2.0; return x_min; } // Метод наискорейшего спуска(Пример) // steepest descent method func SteepestDescentExample(bx, by, epsilon float64) float64 { const MAXITERATIONS = 1000 var k int var x_cur float64 var y_cur float64 var x_next float64 var y_next float64 var lambda float64 // П.1. Задают начальное приближение и точность расчёта vec x[0], epsilon // Шаг 1. Задать x[0], epsilon1 > 0, epsilon2 > 0, предельное число итераций М. // Найти градиент функции в произвольной точке. Определить частные производные функции f(x): // grad f(x) = [ df(x)/x1,...,df(x)/dxn ]T(транспонированный вектор) // Начальное приближение u[0] x_cur = bx y_cur = by fmt.Println("## Исходная точка:") fmt.Printf(" x[0]: (%f, %f)\n", x_cur, y_cur) fmt.Println() fmt.Println("## Приближения:") // Шаг 2. Положить k = 0 stop := false for k = 0; k < MAXITERATIONS && !stop ; k++ { // П.2. Рассчитывают vec x[k+1] = vec x[k] - lambda[k] * nabla F(vec x[k]), // где lambda[k]= argmin_lambda F(vec x[k] - lambda * nabla F(vec x[k])) // Шаг 3. Вычислить grad f(x[k]). // // Шаг 4. Проверить выполнение критерия окончания ||grad f(x[k])|| < epsilon1 : // а) если критерий выполнен, то x[0] = x[k], останов; // б) если критерий не выполнен, то перейти к шагу 5. // // Шаг 5. Проверить выполнение неравенства k ≥ M: // а) если неравенство выполнено, то x[0] = x[k], останов; // б) если нет, то перейти к шагу 6 // // Шаг 6. Вычислить величину шага lambda[k0](на начальном шаге, k = 0) из условия // F(lambda[k]) = f(x[k] - lambda[k] * grad f(x[k])) -> min lambda[k] argmin := dichotomiaExample // Находим lambda[k] как минимум функции g(x[k]) на отрезке -10000,100000 lambda = argmin(-10000, 100000, epsilon, x_cur, y_cur); fmt.Println(" lambdaE:", lambda) // Вычисляем u[k] новое прилижение // Шаг 7. Вычислить x[k+1] = x[k] - lambda[k] * grad f(x[k]) x_next = x_cur - lambda * f_dx(x_cur, y_cur) y_next = y_cur - lambda * f_dy(x_cur, y_cur) fmt.Println() fmt.Printf(" x[%d]: (%.2f, %.2f)\n", k+1, x_next, y_next) fmt.Printf(" f(%.2f, %.2f) = %.2f\n", x_next, y_next, f(x_next, y_next)) // П.3. Проверяют условие остановки: // Если |vec x[k+1] - vec x[k]| > epsilon // или |F(vec x[k+1]) - F(vec x[k])| > epsilon // или |nabla F(vec x[k+1])| > epsilon (выбирают одно из условий), // то k = k + 1 и переход к П.2. // Иначе vec x = vec x[k+1] и останов. // Шаг 8. Проверить выполнение условий ||x[k+1] - x[k]|| < epsilon2, ||f(x[k+1]) - f(x[k])|| < epsilon2: // а) если оба условия выполнены при текущем значении k и k = k - 1, то расчет окончен, x[0] = x[k+1], останов; // б) если хотя бы одно из условий не выполнено, то положить k = k + 1 и перейти к шагу 3 if k > 1 { // Проверяем условие остановки if normaExample(x_next - x_cur, y_next - y_cur) < epsilon { // останов stop = true } } x_cur = x_next y_cur = y_next } fmt.Println() fmt.Println("## Точка минимума epsilon:", epsilon) fmt.Printf(" f(%.2f , %.2f) = %.2f\n", x_cur, y_cur, f(x_cur, y_cur)) // получить минимум фуркции return f(x_cur, y_cur) } // // ТЕСТ и заодно пример // Алгоритм моделирования одномерного стохастического процесса func Simple_stochastic_process_model() { fmt.Println("simple_stochastic_process_model") fo,_ := os.Create("./ito.csv") defer fo.Close() SRnd64(time.Now().Unix()) // "встряхиваем" генератор // a(x,t) коэффициент сноса, если a(x,t) > 0, // то процесс в среднем движется вверх(растёт) иначе вниз a := func (x, t float64) float64 { return float64(0) } // снос b := func (x, t float64) float64 { return x } // волатильность // Задаётся num = 100 значений случайного процесса x(t), // с равным шагом по времени: t = 0, step, 2*step,...,num*step // Каждый интервал между вычисляемыми значениями x разбивается // на большое число lag точек, время между которыми равно dt = step/lag step := 0.1 // шаг по времени для табуляции х num := 100 // число точек табуляции lag := 1000 // количество дроблений шага step dt := float64(step) / float64(lag) sqrt_dt := math.Sqrt(dt) // тут хранится вычисленное заначение корня // исходные var x float64 = 1 // начальное значение x var t float64 = 0 // в начальный момпент времени t fmt.Fprintf(fo, "0;%f;%f\n", t, x) // Для вычислений используется два вложенных цикла. // Внешний по k приводит к выводу x(step), x(2step),... тогда // как внутренний по j, при помощи итерационной формулы, вычисляет // промужеточные значения случайного процесса. for k := 1; k <= num; k++ { for j := 0; j < lag; j++ { // новое значение x получаемое из предыдущего x += (a(x, t) * dt + b(x, t) * RndG()*sqrt_dt) // новое значение t как приращение t += dt } fmt.Fprintf(fo, "%d;%f;%f\n", k, t, x) } } // ТЕСТ и заодно пример // Двухмерный осцилятор с затуханием, имеющий скоррелированный шум <deltaWx deltaWy> = rho dt // // /dx = (-lambda*x - omega*y)dt + sigma*deltaWx //< // \dy = (+omega*x + lambda*y)dt + sigma*deltaWy // func Two_dimensional_oscillator_with_attenuation() { // подробности на стр.252 fmt.Println("two_dimensional_oscillator_with_attenuation") fo,_ := os.Create("./ito2.csv") defer fo.Close() SRnd64(time.Now().Unix()) // "встряхиваем" генератор // Задаётся num = 100 значений случайного процесса x(t), // с равным шагом по времени: t = 0, step, 2*step,...,num*step // Каждый интервал между вычисляемыми значениями x разбивается // на большое число lag точек, время между которыми равно dt = step/lag step := 0.1 // шаг по времени для табуляции х num := 100 // число точек табуляции lag := 1000 // количество дроблений шага step w := 0.5 lm := 0.01 si := 1.0 rho := 0.1 dt := float64(step) / float64(lag) sqrt_dt := math.Sqrt(dt) // тут хранится вычисленное заначение корня rho1 := math.Sqrt(1 - rho*rho) // исходные var x_cur float64 = 1 var y_cur float64 = 1 var t float64 = 0 var x_next float64 var y_next float64 var r1 float64 var r2 float64 fmt.Fprintf(fo, "0;%f;%f;%f\n", t, x_cur, y_cur) // Для вычислений используется два вложенных цикла. // Внешний по k приводит к выводу x(step), x(2step),... тогда // как внутренний по j, при помощи итерационной формулы, вычисляет // промужеточные значения случайного процесса. for k := 1; k <= num; k++ { for j := 0; j < lag; j++ { // если это убрать, то будут две синусойды сдвинутые по фазе :) r1 = RndG() r2 = rho * r1 + rho1*RndG() // новое значение x получаемое из предыдущего x_next = x_cur + (-lm*x_cur - w*y_cur)*dt + si*r1*sqrt_dt y_next = y_cur + (-lm*y_cur + w*x_cur)*dt + si*r2*sqrt_dt x_cur = x_next y_cur = y_next // новое значение t как приращение t += dt } fmt.Fprintf(fo, "%d;%f;%f;%f\n", k, t, x_cur, y_cur) } } // ТЕСТ и заодно пример // пример множественной генерации // система следующего вида: // dxi = -xi*r*dt + deltaWi func Multi_dimensional_oscillator_with_attenuation() { fmt.Println("multi_dimensional_oscillator_with_attenuation") fo,_ := os.Create("./ito_multi.csv") defer fo.Close() SRnd64(time.Now().Unix()) // "встряхиваем" генератор // Задаётся num = 100 значений случайного процесса x(t), // с равным шагом по времени: t = 0, step, 2*step,...,num*step // Каждый интервал между вычисляемыми значениями x разбивается // на большое число lag точек, время между которыми равно dt = step/lag step := 0.1 // шаг по времени для табуляции х num := 300 // число точек табуляции lag := 1000 // количество дроблений шага step dt := float64(step) / float64(lag) sqrt_dt := math.Sqrt(dt) // тут хранится вычисленное заначение корня // число осциляторов osc_count := 200 // исходные x_cur := make([]float64, osc_count) var t float64 = 0 x_next := make([]float64, len(x_cur)) // первая строка, исходная позиция sep := "" fmt.Fprintf(fo, "%s%d", sep, 0) sep = ";" for i := 0; i < len(x_cur); i++ { fmt.Fprintf(fo, "%s%f", sep, x_cur[i]) } fmt.Fprintf(fo, "\n") // Для вычислений используется два вложенных цикла. // Внешний по k приводит к выводу x(step), x(2step),... тогда // как внутренний по j, при помощи итерационной формулы, вычисляет // промужеточные значения случайного процесса. for k := 1; k <= num; k++ { for j := 0; j < lag; j++ { var r float64 // расстояние до начала координат в n-мерной модели, здесь n=len(x_cur) for i := 0; i < len(x_cur); i++ { r += x_cur[i]*x_cur[i] } r = math.Sqrt(r) // новое значение x получаемое из предыдущего for i := 0; i < len(x_cur); i++ { x_next[i] = x_cur[i] - x_cur[i]*r*dt + RndG()*sqrt_dt } copy(x_cur,x_next) // новое значение t как приращение t += dt } // вывести текущую итераци в файл sep := "" fmt.Fprintf(fo, "%s%d", sep, k) sep = ";" for i := 0; i < len(x_cur); i++ { fmt.Fprintf(fo, "%s%f", sep, x_cur[i]) } fmt.Fprintf(fo, "\n") } } */
/************************************************************ ************************************************************/ #include "Mask_Repair.h" /************************************************************ ************************************************************/ /****************************** ******************************/ MASK_REPAIR::MASK_REPAIR() : State(STATE__REPAIRED) , DeleteSpeed(1.5) , RepairSpeed(500) , t_LastInt(0) { /******************** ********************/ NumBlocks_w = FBO_L_WIDTH / BLOCK_SIZE; if(FBO_L_WIDTH % BLOCK_SIZE) NumBlocks_w++; NumBlocks_h = FBO_L_HEIGHT / BLOCK_SIZE; if(FBO_L_HEIGHT % BLOCK_SIZE) NumBlocks_h++; NumBlocks = NumBlocks_w * NumBlocks_h; Piece.resize(NumBlocks); } /****************************** ******************************/ MASK_REPAIR::~MASK_REPAIR() { } /****************************** ******************************/ void MASK_REPAIR::exit() { } /****************************** ******************************/ void MASK_REPAIR::setup() { setup_sound(sound_Pi, "sound/Repair/pi_1.mp3", false, 0.2); setup_sound(sound_Del, "sound/Repair/decision1.mp3", false, 0.7); } /****************************** ******************************/ void MASK_REPAIR::setup_sound(ofSoundPlayer& sound, string FileName, bool b_Loop, float vol) { sound.load(FileName.c_str()); if(sound.isLoaded()){ sound.setLoop(b_Loop); sound.setMultiPlay(true); sound.setVolume(vol); }else{ printf("%s load Error\n", FileName.c_str()); fflush(stdout); } } /****************************** ******************************/ void MASK_REPAIR::update(float now) { /* printf("%d\r", State); fflush(stdout); */ switch(State){ case STATE__REPAIRED: break; case STATE__DELETING: y_ratio -= DeleteSpeed * (now - t_LastInt); if(y_ratio < 0) y_ratio = 0; if(y_ratio <= 0){ State = STATE__DELETED; if(sound_Del.isPlaying()) sound_Del.stop(); } break; case STATE__DELETED: break; case STATE__REPAIRING: { ofVec2f NextPos = Cross + dir * (RepairSpeed * (now - t_LastInt)); if(SquareDistance <= Cross_from.squareDistance(NextPos)) Cross = L_UTIL::CalBlockPos_Center(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); else Cross = NextPos; } break; case STATE__PAUSE: if(0.05 < now - t_from){ if(id == NumBlocks - 1){ State = STATE__REPAIRED; }else{ State = STATE__REPAIRING; id++; /* */ ofVec2f Target = L_UTIL::CalBlockPos_Center(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); SquareDistance = Cross.squareDistance(Target); dir = Target - Cross; dir.normalize(); Cross_from = Cross; } } break; } t_LastInt = now; } /****************************** ******************************/ void MASK_REPAIR::drawToFbo(ofFbo& fbo) { switch(State){ case STATE__REPAIRED: drawToFbo_White(fbo); break; case STATE__DELETING: drawToFbo_Deleting(fbo); break; case STATE__DELETED: drawToFbo_Black(fbo); break; case STATE__REPAIRING: drawToFbo_Repairing(fbo); break; case STATE__PAUSE: // no over draw. break; } } /****************************** ******************************/ void MASK_REPAIR::drawToFbo_Black(ofFbo& fbo) { ofDisableAlphaBlending(); fbo.begin(); ofClear(0, 0, 0, 0); /* ofSetColor(0, 0, 0, 255); ofDrawRectangle(0, 0, fbo.getWidth(), fbo.getHeight()); */ fbo.end(); } /****************************** ******************************/ void MASK_REPAIR::drawToFbo_White(ofFbo& fbo) { ofDisableAlphaBlending(); fbo.begin(); ofClear(0, 0, 0, 0); ofSetColor(255, 255, 255, 255); ofFill(); ofDrawRectangle(0, 0, fbo.getWidth(), fbo.getHeight()); fbo.end(); } /****************************** ******************************/ void MASK_REPAIR::drawToFbo_Deleting(ofFbo& fbo) { if(y_ratio < 0) y_ratio = 0; float _y = fbo.getHeight() * y_ratio; ofDisableAlphaBlending(); fbo.begin(); ofClear(0, 0, 0, 0); ofSetColor(255, 255, 255, 255); ofFill(); ofDrawRectangle(0, 0, fbo.getWidth(), _y); fbo.end(); } /****************************** ******************************/ void MASK_REPAIR::drawToFbo_Repairing(ofFbo& fbo) { ofDisableAlphaBlending(); fbo.begin(); // ofClear(0, 0, 0, 0); // no clear. if(Cross == L_UTIL::CalBlockPos_Center(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w)){ ofVec2f DispPos = L_UTIL::CalBlockPos_LeftUp(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); ofSetColor(255, 255, 255, 255); ofFill(); ofDrawRectangle(DispPos.x, DispPos.y, BLOCK_SIZE, BLOCK_SIZE); sound_Pi.play(); t_from = ofGetElapsedTimef(); State = STATE__PAUSE; } fbo.end(); } /****************************** ******************************/ void MASK_REPAIR::Delete(float now) { if(State == STATE__REPAIRED){ State = STATE__DELETING; y_ratio = 1.0; sound_Del.play(); } } /****************************** ******************************/ void MASK_REPAIR::Rapair(float now) { if(State == STATE__DELETED){ State = STATE__REPAIRING; L_UTIL::FisherYates(Piece); id = 0; Cross = L_UTIL::CalBlockPos_Center(Piece[NumBlocks - 1], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); /* */ ofVec2f Target = L_UTIL::CalBlockPos_Center(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); SquareDistance = Cross.squareDistance(Target); dir = Target - Cross; dir.normalize(); Cross_from = Cross; /* */ sound_Pi.play(); } } /****************************** ******************************/ float MASK_REPAIR::get_y_ratio() { return y_ratio; } /****************************** ******************************/ ofVec2f MASK_REPAIR::get_Cross_pos() { return Cross; } /****************************** ******************************/ ofVec2f MASK_REPAIR::get_Target_pos() { return L_UTIL::CalBlockPos_Center(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); } /****************************** ******************************/ ofVec2f MASK_REPAIR::get_Cross_pos_LeftUp() { return L_UTIL::ExchangeBlockPos_Center_to_LeftUp(Cross, ofVec2f(BLOCK_SIZE, BLOCK_SIZE)); } /****************************** ******************************/ ofVec2f MASK_REPAIR::get_Target_pos_LeftUp() { return L_UTIL::CalBlockPos_LeftUp(Piece[id], ofVec2f(BLOCK_SIZE, BLOCK_SIZE), NumBlocks_w); } /****************************** ******************************/ bool MASK_REPAIR::IsState_Deleted() { if(State == STATE__DELETED) return true; else return false; } /****************************** ******************************/ bool MASK_REPAIR::IsState_Repaired() { if(State == STATE__REPAIRED) return true; else return false; } /****************************** ******************************/ int MASK_REPAIR::get_Progress() { return id; } /****************************** ******************************/ int MASK_REPAIR::get_NumPieces() { return NumBlocks; }
<reponame>mejdi14/NestJs-Code-Wars-Server<gh_stars>0 export declare class CheckerControllerController { }
/** * Converts the {@link Document}s that are returned by a {@link MongoCursor} * using a {@link DocumentConverter} every time {@link #next()} is invoked. * * @param <T> - The type of object the Documents are converted into. */ public class ConvertingCursor<T> implements Iterator<T>, Closeable { private final Converter<T> converter; private final MongoCursor<Document> cursor; /** * Constructs an instance of {@link ConvertingCursor}. * * @param converter - Converts the {@link Document}s returned by {@code cursor}. (not null) * @param cursor - Retrieves the {@link Document}s from a Mongo DB instance. (not null) */ public ConvertingCursor(final Converter<T> converter, final MongoCursor<Document> cursor) { this.converter = requireNonNull(converter); this.cursor = requireNonNull(cursor); } @Override public boolean hasNext() { return cursor.hasNext(); } @Override public T next() { return converter.apply( cursor.next() ); } @Override public void close() throws IOException { cursor.close(); } /** * Converts a {@link Document} into some other object. * * @param <R> The type of object the Document is converted into. */ @FunctionalInterface public static interface Converter<R> extends Function<Document, R> { } }
#include "map.h" #include <engine/storage.h> #include <engine/kernel.h> bool CMap::Load(const char *pMapName, IKernel *pKernel, IStorage *pStorage) { if(!pKernel) return false; if(!pStorage) return false; if(!m_DataFile.Open(pStorage, pMapName, IStorage::TYPE_ALL)) return false; // check version CMapItemVersion *pItem = (CMapItemVersion *)m_DataFile.FindItem(MAPITEMTYPE_VERSION, 0); if(!pItem) return false; // replace compressed tile layers with uncompressed ones int GroupsStart, GroupsNum, LayersStart, LayersNum; m_DataFile.GetType(MAPITEMTYPE_GROUP, &GroupsStart, &GroupsNum); m_DataFile.GetType(MAPITEMTYPE_LAYER, &LayersStart, &LayersNum); for(int g = 0; g < GroupsNum; g++) { CMapItemGroup *pGroup = static_cast<CMapItemGroup *>(m_DataFile.GetItem(GroupsStart + g, 0, 0)); for(int l = 0; l < pGroup->m_NumLayers; l++) { CMapItemLayer *pLayer = static_cast<CMapItemLayer *>(m_DataFile.GetItem(LayersStart + pGroup->m_StartLayer + l, 0, 0)); if(pLayer->m_Type == LAYERTYPE_TILES) { CMapItemLayerTilemap *pTilemap = reinterpret_cast<CMapItemLayerTilemap *>(pLayer); if(pTilemap->m_Version > 3) { const int TilemapCount = pTilemap->m_Width * pTilemap->m_Height; const int TilemapSize = TilemapCount * sizeof(CTile); if((TilemapCount / pTilemap->m_Width != pTilemap->m_Height) || (TilemapSize / (int)sizeof(CTile) != TilemapCount)) { dbg_msg("engine", "map layer too big (%d * %d * %u causes an integer overflow)", pTilemap->m_Width, pTilemap->m_Height, unsigned(sizeof(CTile))); return false; } CTile *pTiles = static_cast<CTile *>(mem_alloc(TilemapSize, 1)); if(!pTiles) return false; // extract original tile data int i = 0; CTile *pSavedTiles = static_cast<CTile *>(m_DataFile.GetData(pTilemap->m_Data)); while(i < TilemapCount) { for(unsigned Counter = 0; Counter <= pSavedTiles->m_Skip && i < TilemapCount; Counter++) { pTiles[i] = *pSavedTiles; pTiles[i++].m_Skip = 0; } pSavedTiles++; } //m_DataFile.ReplaceData(pTilemap->m_Data, reinterpret_cast<char *>(pTiles)); } } } } return true; }
// Rmdir deletes a directory // // Returns an error if it isn't empty func (f *Fs) Rmdir(ctx context.Context, dir string) error { root := path.Join(f.root, dir) dc := f.dirCache directoryID, err := dc.FindDir(ctx, dir, false) if err != nil { return err } var trashedFiles = false found, err := f.list(ctx, []string{directoryID}, "", false, false, true, func(item *drive.File) bool { if !item.Trashed { fs.Debugf(dir, "Rmdir: contains file: %q", item.Name) return true } fs.Debugf(dir, "Rmdir: contains trashed file: %q", item.Name) trashedFiles = true return false }) if err != nil { return err } if found { return errors.Errorf("directory not empty") } if root != "" { err = f.rmdir(ctx, directoryID, trashedFiles || f.opt.UseTrash) if err != nil { return err } } f.dirCache.FlushDir(dir) if err != nil { return err } return nil }
package helpdesk.execucaofluxo.domain.tarefas; public enum EstadoTarefa { PENDENTE, ASSIGNADA, CONCLUIDA; EstadoTarefa() { } }
1975 LaGuardia Airport bombing Location Queens, New York City Date December 29, 1975 6:33 pm (local time) Target La Guardia Airport Attack type Bombing, mass murder Deaths 11 Non-fatal injuries 74 Perpetrators Unidentified Motive Unknown On December 29, 1975, a bomb was detonated near the TWA baggage reclaim terminal at LaGuardia Airport, New York City. The blast killed 11 people and seriously injured 74. The perpetrators were never identified, although investigators and historians believe that Croatian nationalists were the most likely. The attack occurred during a four-year period of heightened terrorist attacks within the United States. 1975 was especially volatile, with bombings in New York City and Washington D.C. early that year and two assassination attempts on US President Gerald Ford.[1] The LaGuardia Airport bomb, at the time, was the single most deadly attack by a non-state actor to occur on American soil since the Bath School bombings, which killed 44 people in 1927. It was the deadliest attack in New York City since the Wall Street bombing of 1920, which killed 38, until the September 11 attacks in 2001.[1][2] Attack [ edit ] The bomb exploded at approximately 6:33 p.m. in the TWA baggage claim area in the central terminal. The equivalent of 25 sticks of dynamite[2] was believed by investigators to have been placed in a coin-operated locker located next to the carousels in the baggage reclaim area. The bomb blew the lockers apart, causing shrapnel to fly across the room; the shrapnel was responsible for all 11 deaths and injuring several others.[1] Others were injured by shards of glass broken off the terminal's plate glass windows. The force of the bomb ripped a 10-by-15-foot (3.0 by 4.6 m) hole in the 8-inch (20 cm) reinforced concrete ceiling of the baggage claim area.[3] The subsequent fire in the terminal took over an hour to get under control. The death toll could have been much worse if the area had not been largely clear of passengers at the time; two flights from Cincinnati and Indianapolis had arrived at 6 p.m. and most of the passengers on these flights had already left the area.[3] Most of the dead and injured were airport employees, people waiting for transportation, and limo drivers.[4][5] I walked into the [airport] terminal maybe 15 feet. It was black and full of smoke ... A girl, a young lady in her 20s, popped out of the smoke. I said something like, 'You'll be all right' and carried her out. Her coat was smoking and she was blackened. Mike Schimmel, a businessman who had been in a limo outside when the terminal blew up and who went into the terminal shortly afterward.[5] Aftermath [ edit ] One witness, H. Patrick Callahan, a 27-year-old lawyer from Indianapolis, was with his law partner at the time of the bombing. "My law partner and I had gone outside to see where the limo was...We had just gone back and we were leaning against one of those big columns. The people who died were standing next to us." said Callahan. When Callahan awakened all he could see was dust, and he could not even see his companion, who was two feet away at the time. The blast damaged Callahan's hearing, which did not return for a week. "The bomb appeared to have been placed in the lockers directly adjacent to the carousel that the luggage was on...It was evil." said Callahan.[5] The bombing was condemned by Pope Paul VI and President Ford, who said that he was "deeply grieved at the loss of life and injuries."[6] Ford cut short his vacation in Vail, Colorado and ordered John McLucas, head of the FAA, to look into ways of tightening airport security. The Mayor of New York City Abraham Beame said that the bombing "was the work of maniacs. We will hunt them down."[6] Airports in Washington, Cleveland and St, Louis were evacuated following hoax bomb calls and several other airports around the country received similar calls.[6] Investigations [ edit ] The investigation was led by Queens Chief of Detectives Edwin Dreher.[4] Dreher was less than two miles from LaGuardia, investigating a drug-related murder in the neighborhood of Astoria, when he heard of the bombing. He immediately went to the airport and summoned by radio all available detectives from the five boroughs, launching at the time the largest criminal investigation in the NYPD's history.[4] The investigation included 120 NYPD detectives, 600 FBI agents, ATF agents and Port Authority investigators, who concluded that the bomb was made of either TNT or plastic explosives and was controlled by everyday household items such as a Westclox alarm clock and an Eveready 6-volt lantern battery.[4] One of the leads suggested was a paroled political activist who had been imprisoned for a previous bombing. The activist's brother had been arrested at LaGuardia on a fraud charge the day before the bombing. Subsequent investigations showed that the activist had an alibi and was ruled out as a suspect.[4] The investigation may have been hampered by the cleanup operation where victims and debris were removed from the scene.[4] Following the attack, telephone calls were made to several other US airports warning them of further attacks, but these were hoaxes. In addition, an anonymous caller called the news agency UPI claiming to be from the PLO and claimed responsibility for the attack. However the PLO spokesman at the United Nations denied all responsibility and condemned "the dastardly attack against the innocent people at LaGuardia." The PLO believed the call linking it to the bombing was an attempt to sabotage talks at the UN scheduled for January 12 regarding the plight of Palestinians.[3] Other suggested groups included the Mafia, the F.A.L.N. (who were responsible for the bombing of New York's Fraunces Tavern in January 1975), and the Jewish Defense League,[1] though there was nothing other than the fact that these groups had used violence in the past which could link them to the bombing.[1] The fact that there was no credible claim of responsibility led investigators to believe that the bomb had gone off at the wrong time and had been intended to go off either 12 hours earlier or later when the area would have been nearly clear of people.[4] It has also been suggested that the Yugoslav State Security Administration (UDBA or UDSA) orchestrated the bombing as a false flag as part of an ongoing effort to discredit Croatian dissidents, but the device failed and the bomb detonated at the wrong time.[7] The Air Transport Association offered a $50,000 reward for information leading to the arrest of the bombers.[8] Despite this the investigation was fruitless. As of 2016 , the crime remains officially unsolved.[9] 1976 Grand Central Terminal bomb [ edit ] On September 10, 1976, a group of Croatian nationalists led by Zvonko Bušić, his wife Julienne and two others hijacked TWA Flight 355 from LaGuardia to Chicago. Bušić delivered a note to the captain in which he informed him that the airplane was hijacked, the group had five gelignite bombs on board, and another bomb was planted in a locker in Grand Central Terminal in New York with further instructions. During the hijacking the device at Grand Central Terminal was found and taken to Rodman's Neck Firing Range where police attempted to dismantle it rather than detonate it. After setting a cutting instrument on the two wires attached to the device, the officers retreated from the pit for several minutes. They then returned to the pit to continue dismantling the device when it exploded and killed an officer, Brian Murray. Bušić and his accomplices were arrested when the plane arrived in Paris. Bušić was subsequently sentenced to life imprisonment but was eventually paroled. The similarities between the Grand Central bomb and the LaGuardia bomb led personnel involved in the investigation to believe that Bušić was responsible for the bombing or at least had some involvement.[2] However no charges for the crime were ever brought forward and Bušić vigorously denied any involvement.[2] Speaking after his release in 2008, Bušić said "to this day, have absolutely no knowledge about who did it" and "It is inconceivable to me that I would have been granted parole if there was any evidence linking me to that horrible crime."[2] See also [ edit ] References [ edit ] Coordinates:
<reponame>DarwinSPL/DarwinSPL /** * */ package de.darwinspl.feature.evolution.basic.operations; import java.util.Date; import de.darwinspl.feature.evolution.atomic.operations.AddFeatureChild; import de.darwinspl.feature.evolution.atomic.operations.DeleteFeatureChild; import de.darwinspl.feature.evolution.complex.operations.ComplexOperation; import de.darwinspl.feature.evolution.invoker.EvolutionOperation; import eu.hyvar.feature.HyFeature; import eu.hyvar.feature.HyFeatureChild; import eu.hyvar.feature.HyGroup; /** * move a whole group. */ public class MoveGroup extends ComplexOperation { private HyGroup group; private HyFeature parent; private HyFeatureChild oldFeatureChild, newFeatureChild; public MoveGroup(HyGroup group, HyFeature parent, Date timestamp) { this.group = group; this.parent = parent; this.timestamp = timestamp; } /* (non-Javadoc) * @see de.darwinspl.feature.evolution.basic.operations.ComplexOperation#execute() */ @Override public void execute() { //get the valid feature child of the group for (HyFeatureChild featureChild : group.getChildOf()) { if (featureChild.getValidUntil() == null) { this.oldFeatureChild = featureChild; break; } } DeleteFeatureChild deleteFeatureChild = new DeleteFeatureChild(oldFeatureChild, timestamp); AddFeatureChild addFeatureChild = new AddFeatureChild(parent, group, timestamp); addToComposition(deleteFeatureChild); addToComposition(addFeatureChild); for (EvolutionOperation evolutionOperation : evoOps) { evolutionOperation.execute(); } this.newFeatureChild = addFeatureChild.getFeatureChild(); } /* (non-Javadoc) * @see de.darwinspl.feature.evolution.basic.operations.ComplexOperation#undo() */ @Override public void undo() { //check if the execute method was executed, otherwise leave this method if (newFeatureChild == null) { return; } for (EvolutionOperation evolutionOperation : evoOps) { evolutionOperation.undo(); } oldFeatureChild = null; newFeatureChild = null; //remove each evo op to avoid that on a redo the evoOps list will contain the same evo op twice for (EvolutionOperation evolutionOperation : evoOps) { removeFromComposition(evolutionOperation); if (evoOps.size() == 0) { break; } } } //Getter public HyGroup getGroup() { return group; } public HyFeature getParent() { return parent; } public HyFeatureChild getNewFeatureChild() { return newFeatureChild; } }
package org.xyyh.jexcel.extension.util; import org.xyyh.jexcel.annotations.Col; import org.xyyh.jexcel.annotations.ColIgnore; import org.xyyh.jexcel.extension.core.FieldMsg; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.*; public class MyClassUtil { /** * 获取包括父类的所有字段,和对应字段的get 和set 方法 * @param clazz 要获取字段的类 * @return list<Map<key,obeject>> 对应的分别是: * 字段名-field,get字段名 -getMethod set字段名 -setMethod * */ public static List<FieldMsg> getAllFields(Class clazz){ Class superClass =clazz.getSuperclass(); List<FieldMsg> list =new ArrayList<>(); boolean flag =superClass!=null; //有父类的时候进入,获取父类的字段和方法 while (flag){ Field[] fields =superClass.getDeclaredFields(); for (int i = 0; i <fields.length ; i++) { list.add(getFieldMsg(fields[i],superClass)); } superClass =superClass.getSuperclass(); flag =superClass!=null; } Field[] fields = clazz.getDeclaredFields(); for (int i = 0; i <fields.length ; i++) { list.add(getFieldMsg(fields[i],clazz)) ; } return sortMap(list); } /** * 获取一个字段的信息,包括字段的get set方法 * */ public static FieldMsg getFieldMsg(Field field, Class clazz){ if (field==null){ return null; } FieldMsg fieldMsg =new FieldMsg(); String fieldName =field.getName(); String getMethodName ="get"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1); String setMethodName ="set"+fieldName.substring(0,1).toUpperCase()+fieldName.substring(1); Method getMethod=null; Method setMethod=null; try { getMethod = clazz.getDeclaredMethod(getMethodName,null); setMethod =clazz.getDeclaredMethod(setMethodName,field.getType()); } catch (NoSuchMethodException e) { System.out.println(fieldName+"没有get 或 set 方法,已跳过方法获取"); } Col col =field.getAnnotation(Col.class); String colFrom ="field"; if (col==null&&getMethod!=null){ col =getMethod.getAnnotation(Col.class); colFrom ="getMethod"; } if (col==null&&setMethod!=null){ col =setMethod.getAnnotation(Col.class); colFrom ="setMethod"; } ColIgnore colIgnore =field.getAnnotation(ColIgnore.class); String colIgnoreFrom ="field"; if (colIgnore==null&&getMethod!=null){ colIgnore =getMethod.getAnnotation(ColIgnore.class); colIgnoreFrom ="getMethod"; } if (colIgnore==null&&setMethod!=null){ colIgnore =setMethod.getAnnotation(ColIgnore.class); colIgnoreFrom ="setMethod"; } fieldMsg.setField(field); fieldMsg.setGetMethod(getMethod); fieldMsg.setSetMethod(setMethod); fieldMsg.setColIgnoreFrom(colIgnoreFrom); fieldMsg.setColFrom(colFrom); fieldMsg.setCol(col); fieldMsg.setColIgnore(colIgnore); return fieldMsg; } /** * 根据注解信息排序,顺便吧注解放入map * */ public static List<FieldMsg> sortMap(List<FieldMsg> list){ list.sort(new Comparator<FieldMsg>() { @Override public int compare(FieldMsg map1, FieldMsg map2) { int m =1; Col col1 =(Col)map1.getCol(); if (col1!=null){ Col col2 =(Col)map2.getCol(); if (col2!=null){ return col1.sort()-col2.sort(); } } return m; } }); return list; } }
<reponame>glowroot/glowroot-instrumentation<filename>instrumentation/redis/src/test/java/org/glowroot/instrumentation/redis/ConnectionIT.java<gh_stars>1-10 /* * Copyright 2016-2019 the original author or authors. * * 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. */ package org.glowroot.instrumentation.redis; import java.io.Serializable; import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import redis.clients.jedis.Jedis; import org.glowroot.instrumentation.test.harness.AppUnderTest; import org.glowroot.instrumentation.test.harness.Container; import org.glowroot.instrumentation.test.harness.Containers; import org.glowroot.instrumentation.test.harness.IncomingSpan; import org.glowroot.instrumentation.test.harness.TransactionMarker; import static org.glowroot.instrumentation.test.harness.util.HarnessAssertions.assertSingleOutgoingSpanMessage; public class ConnectionIT { private static Container container; @BeforeClass public static void setUp() throws Exception { container = Containers.create(); } @AfterClass public static void tearDown() throws Exception { container.close(); } @After public void afterEachTest() throws Exception { container.resetAfterEachTest(); } @Test public void shouldTraceConnect() throws Exception { // when IncomingSpan incomingSpan = container.execute(JedisConnect.class); // then assertSingleOutgoingSpanMessage(incomingSpan).matches("redis localhost:[0-9]+ CONNECT"); } @Test public void shouldTraceSet() throws Exception { // when IncomingSpan incomingSpan = container.execute(JedisSet.class); // then assertSingleOutgoingSpanMessage(incomingSpan).matches("redis localhost:[0-9]+ SET"); } @Test public void shouldTraceGet() throws Exception { // when IncomingSpan incomingSpan = container.execute(JedisGet.class); // then assertSingleOutgoingSpanMessage(incomingSpan).matches("redis localhost:[0-9]+ GET"); } @Test public void shouldTracePing() throws Exception { // when IncomingSpan incomingSpan = container.execute(JedisPing.class); // then assertSingleOutgoingSpanMessage(incomingSpan).matches("redis localhost:[0-9]+ PING"); } private abstract static class JedisBase implements AppUnderTest, TransactionMarker { private RedisMockServer redisMockServer; private Jedis jedis; @Override public void executeApp(Serializable... args) throws Exception { redisMockServer = new RedisMockServer(); jedis = new Jedis("localhost", redisMockServer.getPort()); transactionMarker(); redisMockServer.close(); } protected Jedis getJedis() { return jedis; } } public static class JedisConnect extends JedisBase implements TransactionMarker { @Override public void transactionMarker() { getJedis().connect(); } } public static class JedisSet extends JedisBase implements TransactionMarker { @Override public void transactionMarker() { getJedis().set("key", "value"); } } public static class JedisGet extends JedisBase implements TransactionMarker { @Override public void transactionMarker() { getJedis().get("key"); } } public static class JedisPing extends JedisBase implements TransactionMarker { @Override public void transactionMarker() { getJedis().ping(); } } }
Lorraine Grains has been missing since Thursday. PIC: Contributed. Shetlanders have turned out in force to search for a missing islander who has not been seen since Thursday. Lorraine Grains, 43, from the Vidlin area in the north east of the mainland, was reported missing on Thursday. Local residents have joined police, coastguard ground teams and the coastguard search for the woman. Volunteers have been asked to be careful while out searching in wet conditions. Inspector Martyn Brill said: “We would like to thank the volunteers for their support - it is very much appreciated. “I would ask if you do want to volunteer your help then make sure you are well equipped, wearing suitable clothing and prepared for the conditions. “I know everyone offering their help is doing so with the best of intentions but we do not want people to put themselves at risk. Lorraine is described as being about 5ft 2in tall and of slim build. She has long purple hair and is believed to be wearing black leggings or jeans and a long black overcoat. Inspector Brill added: “We are concerned about Lorraine’s welfare and as such I would urge anyone with information which could assist us passes this on.
Self Help books work, but there is still the application of what the book says that will take us farther. Do Self Help Books Work – The battle between theory and application I have been interested in self help books ever since I was a child, and it probably stems from the fact that I like knowing the ins and outs of a subject before I practice it. When I was young, I wanted to become a body builder, so I read books about nutrition, naturally. Nutrition books really aren’t self help books, but the fact that the nutrition books helped me understand biology, chemicals, nutrition, and their effects on the body (the “why, and how”), lead me to believe that knowing the “why”, helps you achieve the goal. This type of thinking is actually driven into us at a young age, and for an example, look at how we learn math. Learning math starts with the basics, and we build upon them. Later, we use the past knowledge we have gathered to help us answer more complicated questions, even when some aspects of our past math lessons don’t help directly, but indirectly. This type of thinking is how I have been using, and effectively utilizing, self help books. Do Self Help Books Work – Yes, but you must practice Self help books definitely work, I mean honestly, look at the market share they have in the literature world. Self help books do work, but like all things, they only work as well as you can practice what they teach. Similar to most things in life, if you practice them, you get better. If you read a self help book on happiness, and practice none of the lessons on them, then the book will be useless. Another example: Let’s say you really want to run a marathon. Good for you! You go to the store and pick out the book “How to run a marathon in 6 months”. In the book, it lists several different components that are necessary for your completion of a marathon: You must run 5 days a week, while increasing your distance You must eat a well balanced diet You must rest 8 hours a day Maybe some meditation Etc etc etc So, at first you are all excited to run that marathon, and after 6 months, you end up only running 2 days a week, eat trash food everyday, and party every night so your rest is abysmal. If you start puking within the first 10 miles of your marathon and then quit, you cannot blame the book, oh no, you can only blame yourself. This is how self help books work – you have to read them then do what they say to do. Do self help books work – Pick something you actually want to change Humans are better at things they are passionate about, and you should be passionate about whatever book you purchase, especially if you want to gain anything from it. Here is why: If you stop reading it, it won’t help you If you think the author sucks, you won’t read it If you only want to read the book, but not apply what it says, it won’t help you If you only want the book to feel good about trying to help yourself, it won’t help you. You have to do not just read. If you are passionate about the book and the subject matter it covers, you are much more likely to finish the book, apply the mechanics therein, and benefit from it. Lets take a look at Bob, who really wants to get a first date. Self help books – Bob’s Journey Bob really wants to go on a date with Jessica, however, Bob is really scared and wants to learn about being a perfect gentleman. Bob goes online and buys “Being a Gentleman – The Definitive Guide to Being Irresistible”. Bob starts to read the book, and he is extremely excited about what he is reading so far. However, he gets to chapter 5 “Ask her out”. At this point, Bob continues reading the chapter, but never actually asks Jessica out. After reading the past four chapters before this, all that help Bob become a gentleman, he now decided to not apply the lessons in chapter 5 to ask Jessica out, therefore, the purpose of the book and the benefits that it offer no longer help Bob out because he doesn’t apply what it says. While Bob may have become 4 chapters closer to being a better gentleman, he never was able to get that date. The self help book didn’t fail Bob, Bob failed himself. Self Help Books – Accountability is everything If you are like Bob, you simply cannot blame the book (and of course, his book wasn’t guaranteeing he would get the date, only that to be a gentleman, he would ask out Jessica in such and such way, increasing his odds). Remember, Bob bought the book so he could ask Jessica out, which he never ended up doing because he gave up at the last minute, so he wasn’t able to gain what the book had intended him to gain. While some books aren’t the best (and may not help you), you have to make sure that you follow through with that which is asked of you. Do self help books work? Of course! In closing, choose a subject you are passionate about (I read books on body language all the time) and practice what the book says. If you follow those guidelines, you will benefit from a self help book, because self help books do work.
<filename>tests/test_heatmapwidget.py<gh_stars>1-10 import contextlib import unittest from unittest.mock import patch import sys import pytest from PyQt5.QtWidgets import QApplication, QSpinBox, QDoubleSpinBox, QPushButton from AlgorithmParameter import get_NF, get_ILCNP, get_KN, get_NP, get_MI, get_G0 from graph.HeatMap import HeatMap from graph.PossibleGraph import PossibleGraph from gui.mainwindow import MainWindow from gui.wdg.HeatMapWidget import HeatMapWidget from gui.wdg.RangeWidget import RangeWidget from gui.wdg.SelectionWidget import SelectionWidget class Closeable: def close(self): print('closed') params = [([get_ILCNP(), get_NF()], [SelectionWidget, SelectionWidget]), ([get_NF(), get_MI()], [SelectionWidget, RangeWidget]), ([get_G0(), get_ILCNP()], [RangeWidget, SelectionWidget]), ([get_KN(), get_NP()], [RangeWidget, RangeWidget]) ] @pytest.fixture(params=params) def param_loop(request): return request.param class TestHeatMapWidget: def setup(self): self.app = QApplication(sys.argv) self.mw = MainWindow() self.mw.show() def teardown(self): with pytest.raises(SystemExit): with contextlib.closing(Closeable()): sys.exit() @patch.object(HeatMap, 'plot') @patch.object(HeatMap, '__init__') def test_plot_choose_param(self, no_init, no_plot): p_x = get_NF() # [1, 2, 3, 4] p_y = get_ILCNP() # [1, 2, 3, 4, 5, 6, 7] p_x.set_selected_values(1) p_y.set_selected_values(1) param = [p_x, p_y] obj = PossibleGraph("HEAT_MAP", param, [], []) wdg = HeatMapWidget(obj) wdg.selected_value = [[1, 2, 3, 4], [1, 2, 3, 4, 5, 6, 7]] no_init.return_value = None wdg.create_graph(lambda text: print(text), []) assert no_init.call_count == 1 args = list(no_init.call_args_list[0])[0] assert wdg.selected_value == args[-1] assert no_plot.call_count == 1, "метод heat_map.plot не был вызван" @patch.object(HeatMap, 'plot') @patch.object(HeatMap, '__init__') @patch.object(QSpinBox, 'value') @patch.object(QDoubleSpinBox, 'value') def test_plot_input_param(self, no_double_value, no_int_value, no_init, no_plot): p_x = get_KN() # 0.0, 10.0, 1.0 p_y = get_NP() # 100, 500, 100 param = [p_x, p_y] def f(): for i in [0.0, 10.0, 1.0]: yield i return None def f1(): for i in [100, 500, 100]: yield i return None x = f() y = f1() no_int_value.side_effect = y.__next__ no_double_value.side_effect = x.__next__ no_init.return_value = None obj = PossibleGraph("HEAT_MAP", param, [], []) wdg = HeatMapWidget(obj) w = wdg.get_widget() expected_axis = [[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0], [100, 200, 300, 400, 500]] wdg.create_graph(lambda text: print(text), []) assert no_init.call_count == 1 args = list(no_init.call_args_list[0])[0] assert expected_axis == args[-1] assert no_plot.call_count == 1, "метод heat_map.plot не был вызван" def test_get_widget(self, param_loop): param, expected_type = param_loop obj = PossibleGraph("HEAT_MAP", param, [], []) wdg = HeatMapWidget(obj) w = wdg.get_widget() numb_btn = 0 j = 0 for i in range(wdg.grid.count()): item = wdg.grid.itemAt(i).widget() if type(item) == QPushButton: numb_btn += 1 elif type(item) in expected_type: assert type(item) == expected_type[j] j += 1 assert numb_btn == 2 if __name__ == '__main__': unittest.main()
SAN FRANCISCO — Catching two games in one night is enough to receive a hero’s welcome in the clubhouse. But the Giants didn’t have to wait until he left the field to mob Erik Kratz on Friday. In the bottom of the 18th-inning, Kratz hit a dribbler to the right side of the infield to score Brandon Belt from third base and send the Giants home as 3-2 walk-off winners over the Rockies. The five-hour, 35-minute, 18-inning marathon matched the longest game in Oracle Park history and marked the longest since the Giants lost to the Diamondbacks in 18 innings on May 29, 2001. After falling behind 0-2 against Rockies reliever DJ Johnson, Kratz battled back to hit a fielder’s choice to Ian Desmond, who was positioned on the right side of a five-man infield after coming in from his position in center field. Desmond threw home to catcher Chris Iannetta for a force play at the plate, but Iannetta’s foot was off the base when Belt slid in to clinch the walk-off win. Friday was also the first fireworks night of the season at the stadium, but neither offense received that memo. Explosions in the sky would ultimately require a spark from the batter’s box, and for that reason, there were no fireworks on Friday because the game didn’t conclude until early Saturday morning. From the sixth through the 15th innings, Giants hitters combined to go 1-for-27 with a walk. The game remained tied thanks to a historic effort from eight San Francisco relievers who tossed 13 scoreless innings. Rookie left-hander Travis Bergen was the last pitcher standing for San Francisco and with Kratz at the plate in the 18th inning, he stood in the on-deck circle. Bergen hadn’t taken an at-bat since his senior year at Union Grove High in McDonough, Georgia, but thanks to his catcher, he left the game with his second career win instead of his first career plate appearance. As the seagulls swirled around the heads of outfielders and the various transit services announced last calls, the Giants and Rockies played until the 18th inning, when Belt just so happens to play his best baseball. Belt’s leadoff double high off the right center field fence nearly left the park, but it set the stage for a memorable ending. “I’m Mr. 18th inning,” Belt joked afterward. The largest Giants’ crowd since the team’s home opener last Friday was an energetic group of 33,616, but over the course of a five-plus hour marathon, it dwindled below the 3,000 mark as fans decided pillows and blankets were preferable to pitching and the occasional ball in play. Shortly after midnight, Giants mascot Lou Seal emerged in pajamas. When it came time for pitcher’s spot to hit in the 16thinning, Bochy couldn’t even turn to his best starter, Madison Bumgarner. The left-hander had already left the stadium to rest up for his start on Saturday afternoon. In the top of the 18th inning, Bergen recorded the team’s 22nd strikeout, setting a new single-game franchise record. The strikeout counter along the brick wall down the right field line only allowed room for 21 ‘K’ signs, so a fan held up his arms to represent the milestone. Bergen kept on chugging and a few more fans joined in as the Giants ultimately finished with 24 punchouts.
Impact of Water Cooking on Nutritive Characteristics of Justicia galeopsis Leaves Consumed in Cte dIvoire The interest in plant foods has increased following epidemiological studies relating eating habits and the prevalence of certain diseases (cancers, obesity, cardiovascular diseases). Salkeld reports that, according to epidemiologists, 25 to 60 % of cancers could be prevented by modifying eating habits. The main nutritional interest of vegetables lies in their supply of minerals, vitamins and dietary fiber. Leafy vegetables constitute essential components of human diet in Africa generally and particularly in West Africa (). They provide more minerals than other vegetables. Their daily consumption allows a satisfactory dietary balance. In addition to their nutritional International Journal of Current Microbiology and Applied Sciences ISSN: 2319-7706 Volume 9 Number 10 Journal homepage: http://www.ijcmas.com importance, leafy vegetables are considerable economic and social interest because of their relatively low cost and the ease and speed of their preparation (Gupta and Wagle, 1988). Justicia galeopsis T. Anderson ex C.B. Clarke belongs to leafy vegetables family. It has been discovered in Cte d'Ivoire by Yao et al. The Justicia galeopsis leaves are known for mainly its medicinal purpose and its high amount of total phenolics. In Abengougou Division, all the population has already consumed the leaves of this plant (). In Cte d'Ivoire, more than twenty species of leafy vegetables like Justicia galeopsis leaves are consumed by populations through confectionary soups using boiling or blanched processing like Justicia galeopsis leaves. Cooking vegetables improves digestibility by changing the structure of dietary fiber. However, it also causes a more or less marked decrease in the nutritional value, either by defusing watersoluble constituents in the cooking water, or by destruction of thermolabile and / or oxidizable substances. Losses are generally higher for leafy vegetables than for roots and tubers. They increase with the volume of water used and the duration of cooking. Several works and reports have revealed that cooking or preparation methods and period of cooking may affect the nutritional value as well as the bioavailability of many nutrients in leafy vegetables (Gupta and Bains, 2006;). However, the literature does not mention nutritional value of cooked leaves of Justicia galeopsis leaves. The aim of this work was to assess the effect of cooking on the physicochemical and nutritive properties of Justicia galeopsis leaves in order to as certain its nutritional suitability as well as health benefits. Sampling Justicia galeopsis leaves, commonly known in the local language "Agni" as Assiaploua were collected fresh and at maturity from cultivated farmlands located at Abobo. Abobo is one of thirteen communes of the district of Abidjan, Cte d'Ivoire. It is located in Abidjan north between 5°42 north latitude and -4°02 west longitude and at an altitude of105 meters above sea level (). Samples processing The fresh leaves were destalked, washed with distilled water, drained at ambient temperature. Collected leaves were divides into four lots. The first lot is that of the fresh leaves. An amount of fresh leaves was mixed with water in the proportion described by Agbemafle et al. such 40 g of leafy vegetables for 200 mL of water. Then, the mixture was lyophilized. The other three lots were cooked at 100 °C respectively during 30, 45 and 60 min by using the method of Randrianatoandro in the proportion 40 g of leafy vegetables immerged in 200 mL of boiled water. Boiled samples were cooled, ground with a laboratory crusher (Culatti, France) and also lyophilized. All lyophilized samples were ground again in fine powder and store in a clean dry air-tight bottle in a refrigerator (4°C) until required for analyses. Proximate composition analysis Moisture, ash, proteins, and lipids were determined by AOAC method. Total fiber content was determined using Weende method. The amount of carbohydrates was determined by difference using FAO method as follows: % Carbohydrates = 100 -(% moisture + % proteins + % lipids + % ash). Total sugar was determined by Dubois et al.. The amount of reducing sugars was estimated by the method of Bernfeld. The amount of vitamin C in analyzed samples was determined by titration using the method described by Pongracz et al.. About 10 g of ground fresh leaves were soaked into 40 mL metaphosphoric acid-acetic acid (2 %, w/v) for 10 min. The mixture was centrifuged at 3000 rpm for 20 min and the supernatant obtained was diluted and adjusted with 50 mL of bi-distilled water. Ten mL of this mixture was titrated with dichlorophenolindophenol (DCPIP) 0.5 g/L. Polyphenolic compounds, tannins and flavonoids determination Polyphenols were extracted and determined by the method described by Singleton et al using Folin-Ciocalteu's reagent. A quantity (1 g) of lyophilized sample was soaked in 10 mL of methanol 70 % (w/v) and centrifuged at 1000 rpm for 10 min. An aliquot (1 mL) of supernatant was oxidized with 1 mL of Folin-Ciocalteu's reagent and neutralized by 1 mL of 20 % (w/v) sodium carbonate. The reaction mixture was incubated for 30 min at ambient temperature and absorbance was measured at 745 nm by using a spectrophotometer (PG Instruments, England). The polyphenols content was obtained using a calibration curve of gallic acid (1 mg/mL) as standard. Tannins of samples were quantified according to Bainbridge et al.. In a test tube, 1 mL of the methanolic extract was mixed with 5 mL of vanillin reagent. The mixture was incubated in obscurity at ambient temperature for 30 min. There after, the absorbance was read at 500 nm by using a spectrophotometer (PG Instruments, England). Tannins content of samples was estimated using a calibration curve of tannic acid (2 mg/mL) as standard. The total flavonoids content was evaluated using the method reported by Meda et al.. In a test tube, 0.5 mL of the methanolic extract was mixed with 0.5 mL methanol, 0.5 mL of aluminium chloride (10%,w/v), 0.5 mL of potassium acetate (1 M) and 2mL of distilled water. The mixture was incubated in obscurity at ambient temperature for 30 min. Then, the absorbance was measured at415 nm by using a spectrophotometer (PG Instruments, England). The total flavonoids were determined using a calibration curve of quercetin (0.1 mg/mL) as standard. Oxalates and phytates determination Oxalates content was performed using a titration method of Day and Underwood. One g of lyophilized sample was weighed into 100 mL conical flask. A quantity of 75 mL of sulphuric acid (3 M) was added and stirred for 1 h with a magnetic stirrer. The mixture was filtered and 25 mL of the filtrate was titrated while hot against KMnO solution (0.05 M) to the end point (persistent pink). Phytates contents were determined using the Wade's reagent colorimetric method of Latta and Eskin. A quantity (1 g) of lyophilized sample was mixed with 20 mL of hydrochloric acid (0.65 N) and stirred for 12 h with a magnetic. The mixture was centrifuged at 12000 rpm for 40 min. An aliquot (0.5 mL) of supernatant was added with 3 mL of Wade's reagent. The reaction mixture was incubated for 15 min and absorbance was measured at 490 nm by using a spectrophotometer (PG Instruments, England). Phytates content was estimated using a calibration curve of sodium phytate (10 mg/mL) as standard. Determination of molar ratio of antinutrients to minerals The molar ratio between antinutrient and mineral was obtained after dividing the mole of antinutrient with the mole of mineral (). The mole of antinutrients and minerals was determined by dividing the weight of antinutrients and minerals with its atomic weight (phytate: 660 g/mol; Oxalate: 90 g/mol; Fe: 56 g/mol; Zn: 65 g/mol; Ca: 40 g/mol; mg: 24 g/mol). Cooking losses of nutrients The losses of nutrients during cooking were calculated using the following equation : Nutrient content in cooked leaves -Nutrient content in fresh leaves Cooking losses (%) = X 100 Nutrient content in fresh leaves Statistical Analysis All chemical analyses data were statistically analyzed by one-way analysis of variance (ANOVA). Means were compared by HSD test. The analyses were performed using the R statistical package (R Development Core Team, 2011). Proximate composition The results of proximate composition of uncooked and cooked Justicia galeopsis leaves are shown in Minerals and Vitamin C determination The results of minerals and vitamin C composition of raw and cooked Justicia galeopsis leaves are shown in Table 2. Cooking had significant effect on the leaves of this plant. Polyphenolic compounds, tannins and flavonoids Results obtained from the determination of polyphenolic compounds, tannins and flavonods content in Justicia galeopsis leaves showed that cooking decreased significantly these compounds (Table 3). The loss percentages increase up to42.24 % for polyphenolic compounds, 62.70 mg % for flavonoids and 58.65 % for tannins when the leaves are cooked during 60 minutes. Oxalates and phytates determination Results of antinutrient factors contents of Justicia galeopsis uncooked and cooked leaves are indicated in Table 4. These results had showed that cooking time significantly decrease oxalates and phytates levels in Justicia galeopsis leaves. The uncooked leaves and the leaves cooked during 30 minutes were presented the highest amount of oxalates (740.67 and 667.33 mg/100 g) and phytates (33.83 and 29.83 mg/100 g). The loss percentages increase up to 45.55 % for oxalates, and 33.55 % for phytates when the leaves are cooked during 60 minutes. Molar ratio of antinutrients to minerals The molar ratios between antinutrients and minerals of uncooked and cooked Justicia galeopsis leaves were showed in The quantity of protein and ash in Justicia galeopsis leaves had decrease with the increase in boiling time with high proteins and ashes contents in the leaves cooked during 30 minutes. Comparatively, J. galeopsis leaves cooked during 30, 45 and 60 min had a higher protein and ash content than the sweet potato (1.9 and 0.6 %), spinach Ceylon (1.6 and 1.5 %) edible hibiscus (3.4 and 1.1 %) and cassava (3.9 and 1.1 %) cooked leaves.This makes the leaves of this plant a good source of protein, essential for the synthesis of body tissues and regulatory substances such as enzymes and hormones (Vaughan and Judd, 2003). Lipid content of cooked leaves had reached a maximum of 2.2 %. This content was higher when compared to those cited by WHO such as the sweet potato leaves (0.7 %), spinach Ceylon (0.1 %), edible hibiscus (0.8 %) and cassava leaves (1.1 %).The fat in this plant are far better than those mentioned in animal fat such as lard, butter and beef fat (Estelle and Karen, 1999).A diet including J. galeopsis should be more palatable than that of green leafy vegetables mentioned above because dietary fats enhance palatability by absorbing and retaining flavors and by influencing the texture of foods. The crude fiber content of cooked J. galeopsis leaves was higher than that of sweet potato leaves (3 %), spinach Ceylon (3.7 %) and cassava leaves (4.6 %). This makes it a more favorable vegetable since high fiber contents in foods help in digestion, prevention of colon cancer (UICC/WHO, 2005) and in the treatment of diseases such as obesity, diabetes and gastrointestinal disorders. Phosphorus, potassium, magnesium, sodium, vitamin C contents had decreased after 30 min of cooking while those of calcium, iron and zinc increase then decrease after 45 min of cooking. The high level of these minerals was observed in leaves cooked during 30 min. Mineral losses during J. galeopsis leaves cooking could be caused by oxidation of water-soluble mineral and thermal destruction but not leaching as mentioned in Oulai et al., study on some leafy vegetables. Indeed, cooking water in this study was not discharged after cooking. The polyphenol, flavonoid and tannin contents of J. galeopsis leaves decreased with increasing cooking time with high level in the leaves cooked during 30 min. The decrease in tannins, polyphenols and flavonoids during cooking is due to thermal degradation. Contrasting results were found in the levels of polyphenols and flavonoids in white caya (Cleome gynandra) leaves (). The percent gain in the total phenols contents during cooking may be due to there lease of phenolic compounds trapped in the fibers of leafy vegetables. The oxalate and phytate contents decrease with increasing cooking time. These results are identical to those of Oulai et al., in the Hibiscus sabdariffa leaves. The reduction of the levels of oxalates and phytates in these leafy vegetables is due to their thermosensitivity. Cooking is advantageous and appears as a detoxification procedure by removing these anti-nutritional factors and improving the health status of consumers (Ekopand Eddy, 2005). Indeed, oxalates and phytates are anti-nutrients which chelate divalent cations such as calcium, magnesium, zinc and iron, thereby reducing their bioavailability.The oxalate and phytate contents of cooked Justicia galeopsis leaves are higher than those found in cooked Hibiscus sabdariffa leaves. This result is due to the cooking water of Justicia galeopsis leaves which was not discard in contrary to H. sabdariffa cooking water which fresh leaves contained more oxalates and phytates. However, the level of oxalate in J. galeopsis leaves is not major concern for a normal healthy person, as about 298-335 g of cooked leaves during 30 min would needs to be consumed to acquire 2-5 g of oxalate, which is thought to be toxic level for humans (Hassan and Umar, 2004).But also, it takes only an average of 46 g of cooked leaves to made J. galeopsis sauce for a normal person of 65 kg. (). The present of oxalate and phytate in J. galeopsis leaves don't affect t he bioavailability of calcium, iron, magnesium and zinc. In conclusion this study had evaluated the effect of cooking on the biochemical, phytochemical and mineral composition of Justicia galeopsis edible leaves. The results showed that a prolonged cooking time decreased significantly the content of nutrients such as proteins, ashes, vitamin C and antioxidant components. Therefore, the optimal cooking time for J. galeopsis leaves would be 30 min. Indeed, the content of vitamins C, polyphenolic compounds, tannins, flavonoids are acceptable. In addition, the iron, calcium, zinc and magnesium contents in the cooked leaves presented a high bioavailability. It should be noted that the anti-nutrient (phytates and oxalates) contents after this cooking time remain within the physiologically tolerable limit. In the final, the cooked leaves of J. galeopsis contain a good quantity of nutrients which could help to cover the deficit of nutrients of the populations. Also, its high iron content could be beneficial for anemic patients.
Family of Sandra Bland files lawsuit against DPS trooper The family of Sandra Bland filed a lawsuit Tuesday, Aug. 4, 2015, at a federal court in Houston against the DPS trooper they believe is responsible for the 28-year-old woman's death. The family of Sandra Bland filed a lawsuit Tuesday, Aug. 4, 2015, at a federal court in Houston against the DPS trooper they believe is responsible for the 28-year-old woman's death. Photo: Cody Duty, Houston Chronicle Photo: Cody Duty, Houston Chronicle Image 1 of / 134 Caption Close Family of Sandra Bland files lawsuit against DPS trooper 1 / 134 Back to Gallery The mother of Sandra Bland filed a federal lawsuit Tuesday against the Texas Department of Public Safety trooper and several others she deems responsible for the death of her 28-year-old daughter at the Waller County Jail in mid-July. Geneva Reed-Veal is seeking a jury trial and unspecified monetary damages in her wrongful death suit against DPS trooper Brian Encinia; Waller County jail screening officers Elsa Magnus and Oscar Prudente; Waller County; and the DPS. "What happened to Sandy Bland?" Reed-Veal told members of the press, asking the question she hopes the lawsuit can answer and echoing a hashtag that has gained traction on social media: #WhatHappenedtoSandraBland. Reed-Veal rubbed the back of her daughter Sharon Cooper as she explained that although the family still hasn't seen enough evidence to convince them that Bland's death was a suicide, they are prepared to accept whatever the truth turns out to be. Cooper emphasized that whatever the cause, Bland should not have died in jail. "What remains constant is that she should not have been there in the first place," Cooper said. The lawsuit follows weeks of national controversy surrounding the July 10 arrest of Bland, whose death has been ruled a suicide by the medical examiner. Her hanging came three days after Encinia pulled Bland over for failure to signal a lane change, and within minutes, ordered Bland out of the car, threatened her with a taser, pinned her to the ground and arrested her. Based on dashcam video, DPS officials said the arrest was overly aggressive. Encinia was assigned to on desk duty. According to the 46-page lawsuit, Encinia "demonstrated a deliberate indifference to and conscious disregard for the constitutional rights and safety of Sandra Bland." It noted that Encinia previously was reprimanded for "unprofessional conduct" and faulted Texas DPS for improper training, saying the agency should have known he "exhibited a pattern of escalating encounters with the public." In addition, the lawsuit accuses Magnus and Prudente, screening officers at the Waller County Jail, for inadequately monitoring Bland and failing to provide proper medical care when she was found injured in her cell. Waller County deserves blame, according to the lawsuit, for not providing sufficient training to jail staff for handling inmates "who are mentally disabled and/or potentially suicidal." The suit also said the jail failed to have a procedure for jailers to make face-to-face observations of all inmates at least once every hour. Waller County Judge Trey Duhon, Sheriff R. Glenn Smith and DPS officials did not immediately return a request for comment Tuesday morning. District Attorney Elton Mathis referred comment to Larry Simmons, the private attorney on contract to represent the county in civil cases. Simmons said in an emailed statement that the county "expresses its sympathy to Sandra Bland's family." "We look forward to presenting all the evidence to the Court, in the context of the applicable standards for civil liability, and intend to vigorously defend the case," read the statement. "We will be filing a response soon, and our court filings will clearly articulate the County's legal position in this matter."
Abstract 5919: Identification of a novel molecular interaction, targeted by Metformin, between breast cancer and white adipose tissue progenitors The white adipose tissue (WAT) contains a resident population of progenitors with mesenchymal- or endothelial-like phenotype, able to promote breast cancer (BC) progression (). We recently characterized a novel molecular axis underneath the interaction between BC and WAT progenitors, possibly explaining the acquisition of a cancer-associated phenotype by WAT progenitor cells and the establishment of a permissive tumor microenvironment. GM-CSF balance was identified to be the principal regulator of the transcriptional alteration occurring in WAT progenitors exposed to BC: GM-CSF, produced by BC cells, dramatically changed the secretion profile of progenitors, enhancing its own production through a positive regulatory loop and inducing the expression of several factors involved in inflammation (IL-1), ECM remodeling and angiogenesis (MMP9). IL-1 was strongly down-regulated by GM-CSF neutralization in WAT progenitors in vitro and in preclinical models. Induction of IL-1 by GM-CSF was able, in turn, to up-regulate MMP9 in the same cells. The markedly increased expression of MMP9 was already observed in BC-associated WAT progenitors, being addressed to increased local and metastatic tumor growth in obese mice. GM-CSF production was significalntly enhanced in the presence of concomitant obesity in preclinical models of BC, both in orthotopic models (MMTV-neu/ErbB2; 4T1) and in spontaneous tumor-bearing mice (MMTV-PyMT). GM-CSF neutralization in several obese syngeneic models of BC significantly reduced immunosuppressive cells in tumors and in the surrounding WAT, including T-regs (CD4+CD25brightCD127low), Granulocytic myeloid-derived suppressor cells (G-MDSCs, CD11b+Ly6C-Ly6G+), tumor-associated macrophages (TAMs, F4/80+CD206+MCHIIlow) and tumor infiltrating lymphocytes (TILs, CD8+PD1+). Different BC types produce distinct amounts of GM-CSF: triple negative BC (TNBC) expressed higher levels compared to hormone receptors positive cells, correlating GM-CSF expression to higher tumor grade. In the context of targeting WAT-BC interaction, Metformin was able to impair tumor growth, metastasis and angiogenesis in preclinical models () and affecting immune cells, including T-regs, TAMs and MDSCs. From our data, GM-CSF was identified to be a new target of Metformin in both BC and WAT progenitors, suggesting a novel inhibitory mechanism mediated by the drug. Metformin displayed the same efficacy in reducing BC growth, metastatic spread and immune system regulation, when compared to GM-CSF specific neutralization in obese syngeneic models. Taken together, these results indicate GM-CSF as a new molecular target of Metformin and support the role of this novel mechanism in BC progression. Ongoing studies also suggest that this pathway might be induced in WAT progenitors by other solid tumors, including non-Hodgkins B-lymphoma. Citation Format: Francesca Reggiani, Valentina Labanca, Patrizia Mancuso, Andrea Manconi, Francesco Bertolini. Identification of a novel molecular interaction, targeted by Metformin, between breast cancer and white adipose tissue progenitors . In: Proceedings of the American Association for Cancer Research Annual Meeting 2017; 2017 Apr 1-5; Washington, DC. Philadelphia (PA): AACR; Cancer Res 2017;77(13 Suppl):Abstract nr 5919. doi:10.1158/1538-7445.AM2017-5919
The Traumatized Veteran: A New Look at Jimmy Stewart's Post-WWII Vertigo A middle-aged man, frail and weak, hangs from a ledge, his long limbs dangling helplessly. His eyes are wide with terror, his mouth slightly ajar in silent agony. Suddenly, his grip gives way, and he plunges toward the ground below, while his eyes remain fixed above him, looking directly at us. The man is Jimmy Stewart, and the film is Rear Window. But the sequence could come from any number of Stewart films. In fact, Stewarts frequent faints and falls on the big screen echo a crucial moment in his real life as an Army Air Corps pilot in which he collapsed upon returning to base after a nearly fatal mission.1 When we take that experience into account, Stewarts roles in the fifties evoke interesting questions about what was known in the post-WWII era as combat fatigue. Jimmy Stewarts transition to darker and more troubled characters after World War II has been typically perceived as a necessary step in order to jumpstart his stalled career after the war.2 After receiving more bad reviewsthis time for the flop Magic Town in 1947Stewart remarked, I simply wasnt getting across anymore. I knew I had to toughen up.3 And toughen up he did, taking noticeably more complex roles in Westerns directed by Anthony Mann and thrillers directed by Alfred Hitchcock. However, when we consider his body of work as a whole in the postwar era, a striking continuity becomes apparent that resonates more meaningfully than pragmatic casting decisions made by studio, star, or agent. Despite the fact that after he returned from World War II he refused to play in pictures that portrayed modern combat, many of Stewarts roles seem entrenched in issues of postwar psychological trauma.4 The postwar Stewart, or what Tim Palmer describes as the second Stewart, darker and perpetually fraught, with characters in the throes of crises both physical and psychological, is reconsidered in this article as a star situated in the flux of anxieties about postwar trauma and returning veterans that characterized post-WWII America.5 Some of Stewarts films have been discussed in the context of the war, yet the cumulative weight of his roleshis star personahas not yet been adequately addressed in the context of the post-WWII era. Tracing the arc of Stewarts career before and after WWII, Palmer acknowledges Stewarts combat experience as pivotal, but Palmer focuses on Stewarts dramatic postwar reinvention as evidencing both a stars and Hollywoods capacity to change and evolve.6 As Palmer explains, Stewart was one of the first actors to break free
Spatial dependence and spatial heterogeneity in the effects of immigration on home values and native flight in Louisville, Kentucky ABSTRACT This article examines how changes in foreign-born populations are associated with home values and native flight in Louisville, the largest city in Kentucky. In particular, we use spatial autoregressive models (SAR) to explore the spillover effects of foreign-born populations beyond neighborhood boundaries and utilize geographically weighted regression (GWR) to tackle spatial heterogeneity that is complicating the immigrant/neighborhood relationship. Our findings show an insignificant role of immigrant growth in shaping median home values of Louisville, while increasing proportions of immigrants are positively associated with out-migration of non-Hispanic Whites. We also show how those relationships vary across space: the foreign-born population is a salient predictor in White flight in affluent northeastern suburban neighborhoods, compared to middle-class southern suburbs. These findings shed light on heterogeneous local responses within the metropolitan area when confronting immigrant suburbanization.
<filename>src/client/components/shared/ModalSheet.tsx<gh_stars>0 import * as React from 'react'; import { StyleSheet, css } from 'aphrodite'; import classnames from 'classnames'; import Modal from './Modal'; import { prefTypes, withThemeName } from '../../features/preferences'; import colors from '../../configs/colors'; export type ModalSheetProps = { visible: boolean; onDismiss: () => void; children: React.ReactNode; className?: string; }; type Props = ModalSheetProps & { theme: prefTypes.ThemeName; }; function ModalSheet(props: Props) { return ( <Modal visible={props.visible} onDismiss={props.onDismiss}> <div className={classnames( css(styles.modal, props.theme === 'dark' ? styles.contentDark : styles.contentLight), props.className )}> {props.onDismiss ? ( <button className={css(styles.close)} onClick={props.onDismiss} data-test-id="modal-close"> ✕ </button> ) : null} {props.children} </div> </Modal> ); } export default withThemeName(ModalSheet); const styles = StyleSheet.create({ modal: { display: 'flex', flexDirection: 'column', position: 'relative', textAlign: 'center', borderRadius: 4, boxShadow: '0 1px 4px rgba(36, 44, 58, 0.3)', }, close: { appearance: 'none', borderRadius: '1em', outline: 0, padding: 0, position: 'absolute', right: '-1em', top: '-1em', width: '2em', height: '2em', background: colors.background.dark, border: `2px solid ${colors.background.light}`, boxShadow: '0 1.5px 3px rgba(0, 0, 0, .16)', color: 'white', fontSize: '1em', fontWeight: 'bold', textAlign: 'center', }, contentLight: { backgroundColor: colors.content.light, color: colors.text.light, }, contentDark: { backgroundColor: colors.content.dark, color: colors.text.dark, border: `1px solid ${colors.border}`, }, });
Functional dysphonia: strategies to improve patient outcomes Functional dysphonia (FD) refers to a voice problem in the absence of a physical condition. It is a multifaceted voice disorder. There is no consensus with regard to its definition and inclusion criteria for diagnosis. FD has many predisposing and precipitating factors, which may include genetic susceptibility, psychological traits, and the vocal behavior itself. The assessment of voice disorders should be multidimensional. In addition to the clinical examination, auditory-perceptual, acoustic, and self-assessment analyses are very important. Self-assessment was introduced in the field of voice 25 years ago and has produced a major impact in the clinical and scientific scenario. The choice of treatment for FD is vocal rehabilitation by means of direct therapy; however, compliance has been an issue, except for cases of functional aphonia or when an intensive training is administered. Nevertheless, there are currently no controlled studies that have explored the different options of treatment regimens for these patients. Strategies to improve patient outcome involve proper multidisciplinary diagnosis in order to exclude neurological and psychiatric disorders, careful voice documentation with quantitative measurement and qualitative description of the vocal deviation for comparison after treatment, acoustic evaluation to gather data on the mechanism involved in voice production, self-assessment questionnaires to map the impact of the voice problem on the basis of the patients perspective, referral to psychological evaluation in cases of suspected clinical anxiety and/or depression, identification of dysfunctional coping strategies, self-regulation data to assist patients with their vocal load, and direct and intensive vocal rehabilitation to reduce psychological resistance and to reassure patients recovery. An international multicentric effort, involving a large population of voice-disordered patients with no physical pathology, could produce enough data for achieving a consensus regarding this complex problem. Dysphonia can be etiologically and traditionally classified into two main broad categories: organic and functional types. 2 Organic dysphonias are the consequences of aspects nonrelated to the use of voice, such as gastroesophageal reflux, vocal fold paralysis, and systemic diseases, eg, Parkinson's and amyotrophic lateral sclerosis. Functional dysphonias (FDs) are the results of phonotraumatic events (abusive behaviors or voice misuse), poor vocal technique, and/or muscle imbalance, with or without psychoemotional involvement. FD is sometimes referred to as behavioral dysphonias, since the deviated vocal gesture is at the core of this disturbance. The label "functional voice disorders" has been at the center of scientific debates since the 1960s. 3 Since then, there has been no consensus regarding its usage and concept. Particularly in the last 2 decades, American authors either avoid using the term FD or replace it with muscle tension dysphonia (MTD). When MTD is used as a synonym of FD, it can be differentiated into two types 6 : primary and secondary MTD. Primary MTD is a voice disorder in which excessive atypical or abnormal laryngeal movements are observed during phonation in the absence of any of the following: organic pathology, and psychogenic or neurologic etiology. Secondary MTD is a voice disorder in which excessive compensatory atypical or abnormal laryngeal movements are seen during phonation in the presence of organic vocal pathology, psychogenic, or neurologic problem, originated as a response to the primary etiology. In addition to MTD, the other common terms used to refer to FD are as follows: psychogenic dysphonias, hyper-, and hypo-FDs, with differentiations according to the authors. 7 Particularly for MTD cases, the situation is so complex, that three etiological subgroups can be recognized: 8 1) psychological and/or personality factors, 2) vocal misuse and abuse, and 3) compensation for the underlying disease. FD can manifest itself with different voice qualities. There is not a single vocal pattern, which characterizes these patients' voice disorder. Weak voice, strained sound, hoarse or breathy vocal qualities, and whispering phonation, as well as lack of vocal efficacy, vocal fatigue, and kinesthetic symptoms (effort during speech) can be seen. In cases of total loss of voice, vegetative sounds (coughing, throat clearing, and laughing) are frequently preserved. 9 For some authors, MTD should be regarded more as a speech problem than a voice disorder. 4,10 Vocal behavior is at the center of FD; however, the ethiopathogenesis is complex and can involve anatomofunctional predispositions, such as small glottic proportions 11 and psychological traits. 5,12,13 A deviated vocal behavior with inadequate muscle activity can produce benign mass lesions, such as vocal nodules and polyps. These cases are sometimes called organofunctional or behaviorally based dysphonias with benign mass lesions. 14 In order to suggest strategies to improve the outcomes for the FD patient, we need to understand certain aspects of its diagnosis and treatment. Voice documentation with multidimensional descriptions The assessment of a patient with a voice problem is multidimensional and will usually include the following procedures: 1) visual laryngeal examination (via nasal or oral endoscopy, to visualize the vocal folds and detect lesions and/or problems with muscle activity); 2) auditory-perceptual analysis of voice quality (to identify the degree and type of deviation); 3) acoustic/aerodynamic measures (to quantify different aspects related to the fundamental frequency, noise parameters, and maximum phonation time); and 4) self-assessment tools (to identify the perception of the patient with regard to the impact of the voice disorder on his/her life). Additionally, the identification of behavioral aspects related to the use of voice must be assessed for a thorough diagnosis. These aspects need to be carefully considered, ideally by collaboration between the physician and the speech-language pathologist/ voice specialist to properly deal with clinical requirements. A combined evaluation by these two professionals is the best option for improving diagnostic precision and patient's adherence to treatment, as well as to reduce health costs. 15 The clinical evaluation of voice that includes multiple procedures is a common practice in the field; however, during the last few decades, instruments that measure the patient's experience of living with a voice problem hold a special place in the armamentarium of assessment. The multidimensional voice evaluation can be grouped into two main categories: clinician-centered perspective and patient-centered perspective. Clinician-centered perspective This perspective usually includes laryngeal examination, auditory-perceptual analysis, and some acoustic/aerodynamic measurements. Laryngeal examination Laryngeal analysis is the focus of the medical examination in the presence of a voice symptom. Laryngeal structures, particularly the vocal folds, are assessed during breathing 245 Functional dysphonia patient outcomes and phonation. Laryngoscopy is the minimal examination required for voice diagnosis. 1 Videolaryngostroboscopy (VLS) is a well-established procedure that analyzes the vocal folds' vibration and has become the routine examination method for voice problems. 22 VLS is critical to evaluate a dysphonic patient and its use increases diagnostic accuracy in 68.3% of cases of hoarseness. 23 In case of FD, special attention is given to the glottal closure, vocal fold vibration, mucosal wave, and supraglottic activity. Even though, VLS is a useful tool for voice evaluation, it should not be the sole method used for diagnostic purposes, since there is no relationship between the clinical course and changes in stroboscopic data. 24 Recent technical advances, such as highspeed cameras, are more sensitive and offer more detailed information about phonatory function. However, they are expensive and there are many methodological challenges to overcome (such as excessive data and time-consuming analysis) before proposing it as a clinical tool for the evaluation of patients with voice problems. 23 An external examination (palpation) of laryngeal extrinsic muscles, neck, mandible and observation of facial gestures during speech can add important information particularly for the cases of FD due to MTD, 4,10 even if there is reduced information on the validity of these assessments. 10 Auditory-perceptual analysis Voice is a fundamentally perceptual phenomenon, thus perceptual evaluation is a strong candidate for the gold standard assessment of patients with voice disorders. 25 Although widely used for diagnosis, treatment outcome, follow-ups, and dismissal, reliability problems were pointed out since early studies were performed. This reliability issue is even considered as a noncontrolled effect of the human auditory processing nature. 29 Some variables, such as type of stimuli, presentation context, personal and professional experiences, and cultural influences, 26,27,29 have been repeatedly highlighted as interfering factors. These aspects can be minimized by standardizing the assessment protocol and training of listeners, but it does not solve the problem for FD cases since patients usually show instability in their voices and mixed components of roughness, breathiness, and strain. The overall degree of vocal deviation, which reflects the total amount of abnormality, has been used to reduce the reliability problem. 14 Acoustic/aerodynamic measurements Acoustic analysis aims to measure different parameters of the voice signal. It is considered as a noninvasive quantitative assessment of vocal quality, objective in nature, or at least, semiobjective since there is a lot of human interaction. Humans are involved in the process of developing the software, selecting the algorithm, recording, storing, and analyzing the signal. It is important to highlight that the acoustic analysis is only a part of the voice evaluation process. Its efficiency depends essentially on the clinician's ability to integrate the findings of perceptual, acoustic, and laryngeal imaging analyses. Among the suitability of the acoustic analysis, the main aspects are to facilitate the comprehension of voice production, generate normative data, produce vocal documentation, monitor treatment outcome, follow-up the voice development, and early detection of voice problems. The acoustic analysis represents the objective portion of the voice evaluation process. Due to its objective nature, it allows the transformation of an abstract construct into a concrete reality. Acoustic analysis gained popularity in the 1990s due to the development of inexpensive computer-based programs that allowed the average clinician to obtain data previously limited to university and hospital voice laboratories. The use of these measures in isolation is controversial. 30 However, some important information about the sound composition and production can be collected and compared to the perceptual data. Since voice has harmonic and noise components, parameters are related to each of these aspects. Fundamental frequency measurements, at least their extraction, are shown to be robust parameters. The same is not true for perturbation analysis, such as jitter and shimmer. 31 Noise parameters are considered clinically important, because the noisier the voice, the more distant it is from the normal vocal quality. Nonetheless, the reliability of noise measurements is related to many factors such as the overall deviation of vocal quality. 32 The problem with this traditional acoustic analysis is that the quantification of the voice sample is based on the assumption that the signal is nearly periodic. However, this is not often the case for dysphonic voices, and quantification of these signals can be meaningless. 32 A new approach has been recently described, the Cepstral Spectral Index of Dysphonia, 33 which is a multivariate estimate of dysphonia severity. This measure seems to be a potentially robust tool for voice disorder identification; yet, its validity as an outcome measure has been limited to few studies. 34 An alternative approach to dealing with dysphonic signals is to use nonlinear dynamical systems analysis 35 Voice-disordered quality of life is a disease-specific construct aimed to evaluate the impact of a voice problem in activity limitations and participation restrictions for a specific patient. The voice-disordered quality of life instruments were introduced in the late 1990s and have been used for clinical diagnosis, to quantify the impact of a voice problem, to help adherence, to contribute in therapeutic management, to evaluate the patient's response to different treatments, and to screen large populations. These instruments not only showed good psychometric properties but also improved clinical care. Self-assessment instruments reveal new information about the impact of dysphonia related to the quality of life that could not have been obtained by traditional approaches. Additionally, because there is a low correlation between the patient's perspective and the clinician's analysis, 73,74 this type of investigation should be mandatory. These instruments were initially developed mostly in English and were subsequently validated in several other languages in different countries ( Table 1). The validated instruments showed comparable psychometric properties to their original versions. The worldwide spread of these instruments made us understand that there is a common universal trait for patients with voice problems. Physical (organic), functional (activity and participation), and emotional (socio-emotional) aspects are shared by all instruments. Furthermore, specific scores of vocal activity limitation and participation restrictions can be obtained by using one instrument. 19 Recently, cross-cultural differences of health, illness, and disability perception have also been documented in the area of voice. 75,76 Self-assessment instruments have achieved rapid international popularity, which was not seen before with any other assessment approach, 21 regardless of some methodological problems identified in their development process. 42,77 Some reasons behind this popularity are, the global spread of the concept of health and disease by the World Health Oraganization, 78 the excellent cost-benefit ratio of using questionnaires with no need of fancy equipment, the reduction of time for completing an objective self-evaluation (up to 5 minutes), its utility for voice diagnosis, with the possibility of quantifying and qualifying the impact of a voice disorder in a person's life; and the insights produced by simply answering a list of questions. A typical clinical observation from patients is that they say they were not aware of how much their voice problem caused them losses and negative implications until they answered the instrument. No self-assessment instrument for voice disorders was specifically developed for the evaluation of a particular diagnostic category, including FD, except for the Voice Outcome Survey designed for patients with vocal fold paralysis. 79 Nevertheless, these instruments are crucial because they reveal the subjective perception of negative impacts imposed by a voice problem. This information is unique and cannot Table 1 Main self-assessment questionnaires for investigating the impact of FD, original country of development, and validation in other countries 247 Functional dysphonia patient outcomes be obtained by either laryngeal examination or perceptual and acoustic analysis. There are some differences among these instruments with regard to their conceptual development. Some of them are more focused on the perceived handicap (Voice Handicap Index), 16 some on the quality of life (Voice-Related Quality of Life), 17 some on the loss of vocal endurance (Voice Performance Questionnaire), 18 others on activity limitation and participation restriction (Voice Activity and Participation Profile), 19 and finally the other ones on combining disability and vocal symptoms (Voice Symptoms Scale). 20 Studies on specific populations with voice problems need to be performed, particularly including professional voice users with functional voice problems, both artistic (singers and actors) and nonartistic (teachers, call center operators, and sales persons). The question with the artistic professional voice users is even more complex because some vocal deviations may be part of their signature voice. In this case, it can be difficult to differentiate between a stylistic choice and a behavioral problem. There have been some attempts to develop specific tools for this population, but currently no extensive data was derived. 80,81 Professional voice users face different demands regarding voice quality and endurance to long periods of usage. It is plausible to consider that they may have a different sensibility to voice changes and also diverse ways of coping with the problem. A slight vocal problem that would do no harm to a nonprofessional voice user can severely impair the career of an elite vocal professional. Therefore, a similar degree of dysphonia for a nonprofessional voice user may be perceived differently. 81 Finally, it is important to mention that voice is a cultural construct and vocal expression has been the mirror of cultural differences throughout mankind. There is a known relationship between voice, linguistic code, and cultural behavior, 21 but unfortunately this has not yet been explored by voice clinicians. The exploration of cross-cultural differences began only recently in the voice area, both regarding self-assessment of the voice problem 76 and the manifestation of specific disorders. 82 When cultural modifications lead to qualitative changes in the voice, a voice disorder must be considered. 21 This subject deserves proper attention to better suit specific aspects, particularly if we consider a globalized world with people living in different areas of the globe. It is possible that self-assessment instruments capture a different aspect of the vocal function that cannot be derived from auditory-perceptual or acoustic analysis and laryngeal examination. It is also reasonable to say that some changes are seen because patients want to please clinicians and they know they will be assessed (Hawthorne effect). 83 Therefore, clinicians must wisely use both clinician-and patient-oriented information for diagnosis and evaluation of treatment outcome. Psychological considerations: coping and self-regulation strategies Emotional issues can be clearly seen in some but not all cases. Psychogenic factors seem to be more relevant in cases of total voice loss, functional aphonia, than in cases of variable voice deviations. 84 Using the personality traits construct, Roy et al 5 compared patients among four diagnostic categories: FD, vocal fold nodules (both of them being behavioral-based cases), spasmodic dysphonia, and vocal fold paralysis (both of them being organic types). The findings made clear that the behavioral-based dysphonias have specific psychological traits. Individuals with FD were characterized as introverted, stress reactive, alienated, and unhappy. Patients with vocal nodules are socially dominant, stress-reactive, aggressive, and impulsive. Finally, the organic-based cases and subjects without voice disorders did not present any consistent personality features. Patients with common voice disorders, including FD cases, assessed by the Hospital Anxiety and Depression Scale presented higher psychological distress. Stress and depression were more common in patients with MTD. In particular, females 12 with FD usually present multiple psychosocial problems. 86 It is not sufficient to look only at the vocal behavior; the other associated factors such as predisposition, precipitant, and maintenance factors must also be taken into consideration. 86 Predisposition factors are genetic susceptibility, constitution of the individual, occupational susceptibility, prolonged stress, laryngeal inflammatory processes, history of sexual and/or physical abuse, and perfectionism. Precipitant factors are life events, vocal load, upper airway infections, and laryngeal inflammatory processes. Finally, the potential maintenance factors are probably prolonged stress and general fatigue. 84,85 The popular conception is that voice loss is a result of unexpressed emotion and has no scientific evidence. 85 The specific role of psychogenic traits in the development of different categories of voice disorders as well as the interaction between predisposed and causal factors for FD is not completely understood. However, these factors have to be considered since FD is commonly associated with reduced treatment attendance that leads to variable treatment outcomes. 87 Two recent topics have appeared in the voice literature, the concepts of coping and self-regulation, which are already acknowledged by psychologists dealing with behaviors. Coping strategies Coping is defined as the manner with which an individual deals with a stressful situation. Once the individual faces a certain event that exceeds his/her adaptation resources, cognitive and behavioral efforts are used to manage either external or internal demands. Generally, coping strategies can be categorized as problem-focused and emotional-focused. 88 Some individuals will act directly into the stressful event using cognitive strategies to modify the situation, while others will use emotional strategies to alleviate its psychological consequences. The function of coping is to promote the adaptation of the individual to the unsettling situation. The sense of how much control the individual perceives to have over the situation will in a way define the coping to be used. Consequently, when a health problem is associated with controllable aspects, patients tend to engage practical solutions directed to the problem itself. On the other hand, when the illness is not curable and related factors cannot be controlled, people tend to utilize strategies to manage emotions. 97,98 When the mediating role of coping is taken into consideration, it becomes easier to understand the diversity of the treatment outcome of a voice problem and the importance of addressing adequately this issue during both the evaluation and intervention processes, since the expected result is the effective adaptation of the individual to the situation. Speechlanguage pathologists should help patients identify the strategies they are using to cope with their voice disorder and to assist them toward changing maladaptive strategies. 99,100 During the evaluation session, the clinician should make use of a specific coping self-assessment tool to guide them in identifying and listing the nonadequate strategies. Over the course of therapy, the patient should also be encouraged to use problem-adequate strategies. 101 The first researchers who investigated coping strategies with dysphonia looked at individuals with spasmodic dysphonia and with MTD using the Voice Disability Coping Questionnaire. 102 The results showed that individuals with spasmodic dysphonia used more emotion-focused strategies. The same questionnaire was used to investigate a Brazilian population with and without vocal complaints; overall, individuals with vocal complaints use several different strategies to cope with their voice problem, especially problem-focused strategies. 101 Teachers with and without vocal complaint that sought (FD cases) or did not seek professional help were also studied. 103 The interesting conclusion was that teachers who had a voice disorder and looked for help used more coping strategies when compared to the other two groups. In accordance with the previous Brazilian study, 101 the teachers also tended to use more problem-focused strategies. 103 An important aspect that needs to be considered when studying coping is the role of culture. Within a specific culture, certain types of coping strategies will be more or less effective in fostering emotional well-being and in addressing problems that cause stress. 104 The information about the role of culture on coping strategies can also be taken into consideration when designing interventions, especially for culturally diverse populations. The literature about the topic does not have multicentric studies that include samples from different countries; however, there are studies that compare ethnic groups within a certain society. 105,106 These studies have distinct designs and utilize diverse assessment instruments; hence the findings obtained are manifold. For this reason, the results many times cannot be compared. In the field of voice, there are no studies that compare the influence of culture on coping with voice problem. Consequently, further research should include a multicultural population in order to investigate the effect of culture on coping with voice problems. Self-regulation strategies Self-regulation, as well as coping strategies, may have been underestimated in patients with FD. Perceived control is a central construct in psychology. Present perceived control (PPC), opposed to control in the past, is the perception of having some kind of control over some current aspect of the event. 107 It is especially important when there are stressful life situations, such as a voice disorder limiting the ability to communicate socially or at work. PPC is important in adjustment to stress and to help the clinician facilitate patient's control over his/her voice. Present control is related to lower perceived distress, which also benefits the patient's improvement during vocal rehabilitation. On a large study exploring the relation among distress, stress, vocal handicap and perceived control, 108 authors concluded that vocal handicap was more related to distress among those individuals with low perceived control. The severity of distress and vocal handicap were positively correlated, and the relation between them was moderated by perceived control. The authors used PPC subscale, with eight items (from a total of 17 sentences scale). These were the items most strongly associated with outcomes, adapted to be used in the context of a voice problem. 108 The authors reinforce the fact that the present control reflects the perceived ability to control one's reaction to a stressful event and it is not the same as coping. Data from the general population on stressful events have shown that the avoidant coping could 249 Functional dysphonia patient outcomes be related to more distress, 107 but this was not investigated in dysphonic patients. If PPC is related to outcomes, it is still a question to be determined. Voice rehabilitation Vocal rehabilitation consists of direct and indirect approaches to ameliorate voice problems. Vocal rehabilitation is the primary management choice for FD treatment. An indirect approach includes education about voice and communication, vocal health information, as well as counseling regarding stress management and relaxation. On the other hand, direct therapy consists of specific exercises to control and coordinate the different aspects of the voice production, based on the large information obtained from the multidimensional evaluation. 109 A method of rehabilitation described since the 1990s is the perilaryngeal manipulation. 110 There are several different approaches of laryngeal manipulation 4,10,111 and evidence of its positive results, regardless of the type of manipulation used, particularly for MTD cases. 10 The challenge for the speech-language pathologist is to obtain the most accurate diagnosis and to select an effective program of treatment for a specific patient with FD. Even if we admit that FD patients may present with related psychodynamic issues, when FD is used as a synonym of MTD, muscle activity is the main feature that should be addressed clinically. 4,10 Before starting treatment, the first session is usually performed to confirm the diagnosis. During this session, diagnostic probes or muscular palpation are tried out. 9 The probes may include manual palpation of the extrinsic muscles of the larynx, nonspeech tasks, visual and audio instrumental feedback, inhalatory phonation, lip trills, task-specific sentences to distinguish MTD from spasmodic dysphonia, and perceptual and compensatory behavior assessments. Vocal rehabilitation is typically administered worldwide once or twice a week, in sessions of 30 minutes-45 minutes, delivered by a single clinician. 18,21 This format enhances progressive learning, favors patient-clinician rapport and seems to be ideal for sustained behavioral changes. Cognitive behavioral therapy also appears to be an additional effective approach in the treatment of FD, by reducing associated distress. 112 However, in cases of FD due to MTD, usually associated with complete aphonia or whispered phonation, voice is restored in few sessions of intensive laryngeal manipulation treatment. 4 The ultimate goal of vocal rehabilitation is to restore normal voice. There are few randomized clinical trials that investigated patients with FD. One study compared two different therapeutic programs for the treatment of behavioral voice problem (FD was referred to as a behavioral problem and not as MTD). The treatment options were the Vocal Function Exercises and the Comprehensive Program for Voice Rehabilitation. In addition to these two therapeutic methods, the authors administered a vocal hygiene session. They concluded that both options offer good results, with positive outcomes in the laryngeal visual examination, perceptual and acoustical analysis as well as in the selfassessment scales. 14 Although indirect and direct combined intervention approaches seem to be more efficient, 113,114 the method chosen to deliver voice therapy should be based on the clinician's or patient's preferences or even on the need to include global communications aspects, particularly for professional voice users. 14 A visual examination of the larynx can be used as a direct feedback tool during vocal rehabilitation, regardless of the fact that stroboscopic findings do not always correspond with voice improvement. 24 It allows patients to realize what the mechanics of voice is and how the treatment affected the laryngeal configuration and activity. 115 Vocal rehabilitation in FD is effective; 116 however, traditional voice therapy can be unsuccessful for some patients, often associated with poor compliance or lack of adherence to sessions and treatment. This fact may lead clinicians to frustration. 120 An alternative approach is to offer intensive programs, particularly in cases of recalcitrant dysphonias, with previous treatment failures. 117 The intensive regimen is based on motor learning theory, neurobiology, exercise physiology, and psychotherapy. This approach also permits customization in order to fulfill the patient's demands and to assist in the transferring of acquired skills into spontaneous speech. 121 Not only from a clinician's perception, but also from a patient's perspective, intensive treatment achieves a high level of satisfaction with vocal therapy and reduced voice handicap after treatment. 87 In addition, it has been considered as one of the best ways to improve client adherence and treatment outcomes. 87,117,119 The results achieved by intensive therapy in 1 day may correspond to a 2-week regular regimen. 117 There are no controlled studies comparing regular vs intensive approaches for FD and, of course, overdoses of exercises and training should be taken into consideration. 122 Patients are usually asked to perform exercises out of the therapy session considering that functional cortical reorganization depends on specific training. 123 Daily practice allows voice stabilization and promotes continued improvement in vocal quality, acoustic measures, self-assessment, and 109 Conventional voice therapy and laryngeal manipulation have shown a moderate treatment effect. Nonetheless, a customized approach to the patient's limitations and the lack of control groups in many studies restrict the quality of evidence. 109 There is an increasing understanding of the need to employ high-quality outcome measures in clinical research. For FD cases, the difficulty is even greater and starts with a basic problem, such as, terminology. Other problems include the need of a multidimensional approach for diagnosis, the lack of a single characteristic vocal quality related to this disorder, comprehension of differential diagnosis, and the influence of psychological aspects. The last problem would require a tailored approach to the patient's treatment. Strategies for improving patient outcome Health-related quality of life is a broad concept that refers to patient-perceived impact of the disease and treatment on physical, psychological, and social function (World Health Organization). 78 The individual's well-being is the core of this concept. Patient-related outcomes were initially defined as subjective health indicators that allow disability and illness to be assessed, based on the patient, caregiver, or physician self-reports. 124 Patients' opinion should be considered at any decision-making level, including evaluation and treatment. The main tools for comprehending and measuring the consequences of health disorders are self-rating questionnaires that reflect a direct patient-reporting method. If this is carried out with well-constructed instruments, it can become a robust platform to implement and sustain public health strategies. 125 Strategies to improve the FD patient outcome involve a series of procedures, including ( Figure 1) the following: 1) proper diagnosis to exclude neurological and psychiatric disorders that can have similar physical presentation and can require the use of vocal probes for differential diagnosis; 2) careful recording of the voice signal with quantitative measurement and qualitative description of the vocal deviation for comparison after treatment; 3) acoustic evaluation including both extraction of selected parameters and description of the spectrographic trace, to gather data on the mechanism involved in voice production; 4) self-assessment questionnaires to map the impact of the voice problem and to comprehend the dimensions involved; 5) referral to a psychological evaluation in cases of suspected anxiety and/or depression; 6) identification of coping strategies to face dysfunctional approaches; 7) self-regulation data to assist the patient regarding vocal load; and finally 8) direct and intensive vocal rehabilitation to reduce psychological resistance and to reassure patients recovery. 251 Functional dysphonia patient outcomes Disclosure The authors report no conflicts of interest in this work.
I read with dismay and disbelief the words of our mayor, David Sills, (May 20). Sills is quoted as saying, "I'm not particularly concerned or interested in municipal budgets, streets, sewer systems and the police force." These, however, are the very responsibilities that Sills accepted when he was reelected just a year ago. With out city budget increasing so dramatically over the past two years, someone on the Irvine City Council better show an interest. Words of elected officials are sometimes misquoted or taken our of context. Whether or not Sills was correctly quoted by your reporter, he owes the taxpayers of Irvine an explanation.
/** * Car Radio manager. * * This API works in conjunction with the {@link RadioManager.java} and provides * features additional to the ones provided in there. It supports: * * 1. Capability to control presets. * @hide */ @SystemApi public class CarRadioManager implements CarManagerBase { public final static boolean DBG = true; public final static String TAG = "CarRadioManager"; // Constants handled in the handler (see mHandler below). private final static int MSG_RADIO_EVENT = 0; private int mCount = 0; private final ICarRadio mService; @GuardedBy("this") private CarRadioEventListener mListener = null; @GuardedBy("this") private CarRadioEventListenerToService mListenerToService = null; private static final class EventCallbackHandler extends Handler { WeakReference<CarRadioManager> mMgr; EventCallbackHandler(CarRadioManager mgr, Looper looper) { super(looper); mMgr = new WeakReference<CarRadioManager>(mgr); } @Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_RADIO_EVENT: CarRadioManager mgr = mMgr.get(); if (mgr != null) { mgr.dispatchEventToClient((CarRadioEvent) msg.obj); } break; default: Log.e(TAG, "Event type not handled?" + msg); } } } private final Handler mHandler; private static class CarRadioEventListenerToService extends ICarRadioEventListener.Stub { private final WeakReference<CarRadioManager> mManager; public CarRadioEventListenerToService(CarRadioManager manager) { mManager = new WeakReference<CarRadioManager>(manager); } @Override public void onEvent(CarRadioEvent event) { CarRadioManager manager = mManager.get(); if (manager != null) { manager.handleEvent(event); } } } /** Listener for car radio events. */ public interface CarRadioEventListener { /** * Called when there is a preset value is reprogrammed. */ void onEvent(final CarRadioEvent event); } /** * Get an instance of the CarRadioManager. * * Should not be obtained directly by clients, use {@link Car.getCarManager()} instead. * @hide */ public CarRadioManager(IBinder service, Looper looper) throws CarNotConnectedException { mService = ICarRadio.Stub.asInterface(service); mHandler = new EventCallbackHandler(this, looper); // Populate the fixed values. try { mCount = mService.getPresetCount(); } catch (RemoteException ex) { Log.e(TAG, "Could not connect: " + ex.toString()); throw new CarNotConnectedException(ex); } } /** * Register {@link CarRadioEventListener} to get radio unit changes. */ public synchronized void registerListener(CarRadioEventListener listener) throws CarNotConnectedException { if (mListener != null) { throw new IllegalStateException("Listener already registered. Did you call " + "registerListener() twice?"); } mListener = listener; try { mListenerToService = new CarRadioEventListenerToService(this); mService.registerListener(mListenerToService); } catch (RemoteException ex) { // Do nothing. Log.e(TAG, "Could not connect: " + ex.toString()); throw new CarNotConnectedException(ex); } catch (IllegalStateException ex) { Car.checkCarNotConnectedExceptionFromCarService(ex); } } /** * Unregister {@link CarRadioEventListener}. */ public synchronized void unregisterListener() throws CarNotConnectedException { if (DBG) { Log.d(TAG, "unregisterListener"); } try { mService.unregisterListener(mListenerToService); } catch (RemoteException ex) { Log.e(TAG, "Could not connect: " + ex.toString()); throw new CarNotConnectedException(ex); } mListenerToService = null; mListener = null; } /** * Get the number of (hard) presets supported by car radio unit. * * @return: A positive value if the call succeeded, -1 if it failed. */ public int getPresetCount() { return mCount; } /** * Get preset value for a specific radio preset. * @return: a {@link CarRadioPreset} object, {@link null} if the call failed. */ public CarRadioPreset getPreset(int presetNumber) throws CarNotConnectedException { if (DBG) { Log.d(TAG, "getPreset"); } try { CarRadioPreset preset = mService.getPreset(presetNumber); return preset; } catch (RemoteException ex) { Log.e(TAG, "getPreset failed with " + ex.toString()); throw new CarNotConnectedException(ex); } } /** * Set the preset value to a specific radio preset. * * In order to ensure that the preset value indeed get updated, wait for event on the listener * registered via registerListener(). * * @return: {@link boolean} value which returns true if the request succeeded and false * otherwise. Common reasons for the failure could be: * a) Preset is invalid (the preset number is out of range from {@link getPresetCount()}. * b) Listener is not set correctly, since otherwise the user of this API cannot confirm if the * request succeeded. */ public boolean setPreset(CarRadioPreset preset) throws IllegalArgumentException, CarNotConnectedException { try { return mService.setPreset(preset); } catch (RemoteException ex) { throw new CarNotConnectedException(ex); } } private void dispatchEventToClient(CarRadioEvent event) { CarRadioEventListener listener; synchronized (this) { listener = mListener; } if (listener != null) { listener.onEvent(event); } else { Log.e(TAG, "Listener died, not dispatching event."); } } private void handleEvent(CarRadioEvent event) { mHandler.sendMessage(mHandler.obtainMessage(MSG_RADIO_EVENT, event)); } /** @hide */ @Override public synchronized void onCarDisconnected() { mListener = null; mListenerToService = null; } }
/** * Creates a CIDRMatcher from a CIDR matching regex * @param cidrMatchString The string containing the CIDR matching regex * @return The corrosponding CIDRMatcher */ public static CIDRMatcher create(String cidrMatchString) { return new CIDRMatcher(cidrMatchString) { @Override public boolean match(InetAddress inetAddress) { return super.match(inetAddress); } }; }
Online Learning as a Wind Tunnel for Improving Teaching Attempts to improve teaching through research have met with limited success. This is, in part, due to the fact that teaching is a complex cultural system that has evolved over long periods of timemultiply determined and inherently resistant to change. But it is also true that research on teaching is difficult to carry out. Using traditional educational research methodologies, testing new methods of teaching requires, first, that teachers be able to implement the method at a scale sufficient for study, that random assignment of teachers to conditions can be feasibly carried out, and that ecological validity of the treatment can be preserved. In this chapter, we propose an alternative approach that combines the affordances of online learning with the methodologies of systems improvement. Using an analogy from the development of the airplane, we discuss how online learning might be a wind tunnel for the study and improvement of teaching.
IS THE `BAD GIRL' OF MONACO FINALLY READY FOR MARRIAGE? Is the reformed bad girl of Monaco ready for marriage? Princess Stephanie had her two children baptized last month, paving the way for her to wed their father, live-in boyfriend Daniel Ducruet, according to French press reports.The principality's press office confirmed Wednesday that Louis, 21/2, and 11-month-old Pauline were baptized April 17 in a private ceremony at Monaco's Church of St. Devote. Reports of impending marriage were "more rumors, just rumors," the press office said. The event was a reconciliation of sorts between Stephanie, a rock star-turned-bathing suit designer, and her father, Prince Rainier, who reportedly never approved of his daughter's relationship with Ducruet. Ducruet met the princess while he was her bodyguard.
<filename>src/mn_serial.h<gh_stars>0 // This software is part of OpenMono, see http://developer.openmono.com // and is available under the MIT license, see LICENSE.txt #ifndef mn_serial_h #define mn_serial_h #include <Serial.h> #include "power_subsystem_interface.h" namespace mono { namespace io { /** * @brief Power / USB aware serial port class, that uses only the USB UART * * THis is the implementation of communication via USBUART. It builds upon * mbed's @ref mbed::Serial class. Because mbed ti not aware of changes power * in power and charging states, this class acts as a wrapper around the * `mbed::Serial` class. * * ## Restrictions * This Serial class will communicate with the USBUART only when the USB * power is connected. All data consumed by the class, then the USB power is * absent, is ignored. * * */ class Serial : public mbed::Serial { protected: power::IPowerSubSystem *powersystem; Serial(PinName tx, PinName rx); public: /** * @brief Create a new instance of the USB UART port * * This is the only available contructor, because the RX and TX lines * are hardwired. Ideally you should not initialize your own USB serial * port, but use the systems default I/O streams. */ Serial(); /** * @brief See the status for the Data Terminal Ready signal * @return `true` if DTR is set */ bool DTR(); /** * @brief Test if the USB is connected (powered) and mounted CDC device * is a CDC device by the host. * * Before any data can be sent via the USB Serial link, the host (computer) * must have emunerated Mono as a USB CDC device. ALso, to ensure the USB * cable is connected, the USB power is monitored. These two conditions * must be met, before this method returns `true`. * * @return `true` if USB power is on and USB is enumerated on host */ bool IsReady(); }; } } #endif /* mn_serial_h */
The look of love? How a woman's glance can tell a man if she's interested (or whether to walk away now) If she looks down and then moves her eyes in a sweeping motion across the floor it almost certainly means that she is attracted to someone But an instant stare into a man's eyes or over his head on meeting is very bad news for a suitor The secrets of a woman's mind are revealed in expert Ali Campbell's new book 'More than Just Sex' The female mind has always been a complete mystery to most men and their enigmatic thoughts and actions almost impossible to decode - until now. Finally the closely-held secret of whether a woman fancies someone has been exposed and experts have found it is all in the eyes. A new study looked at how and where women glance after a man makes initial eye contact and found this shows him all he needs to know about his chances of romance. Great news! Life coach Ali Campbell says that if a woman looks down and sweeps the floor with her eyes, left, or looks to the side and then back it is a sure sign she fancies a man What happens in the 45 seconds after meeting makes it crystal clear if love is in the air or whether the hapless male suitor will get the cold shoulder, experts have said. About turn: A woman looking sideways was often thought to be a rejection but research has found that in fact she is attracted to you Life coach Ali Campbell says in his book 'More than Just Sex' that the look men want to see is her looking down and then moving her eyes in a sweeping motion across the floor because it almost certainly means that she is attracted to you. This glance means that she is checking her internal emotions, in short, she likes you but is working out how much. 'It's the holy grail of looks,' he said. 'If a guy can pick up on that he has a sure-fire way to work out if she is interested.' And in a complete reversal the disinterested, shy or bashful look sideways a woman often gives is not the brush-off most men thought it was. It is in fact the opposite. If a woman looks away for up to 45 seconds and then stares you straight in the eye it is another sure sign that she is interested because she is thinking hard about whether you are a suitable partner. 'Most guys have the idea that if they make eye contact and she looks away she is not interested. But she will look away, that's inevitable. That's what happens when we think to ourselves and also consider our feelings,' Mr Campbell told MailOnline. 'I have interviewed literally hundreds of women and too many men concentrate on having the right car, the right watch, the right whatever. But it is rubbish, all the women I spoke to told me they are just interested in what men are like inside. 'What I am doing for guys is to make sure they know there is someone out there who is interested in you. The important thing is to show who you really are.' But of course with good news there is bad and this book has also given men the clearest indications yet about whether they have no chance of love with someone they like. If after the man makes eye contact she instantly looks over his head or stares straight back at him it is almost certainly curtains. Forget it: An aggressive stare, left, or looking up or over a man's head is not good news and experts say a man is best to turn his attention elsewhere These two 'aggressive' reactions mean the man should back off quickly and turn his attentions elsewhere to avoid further embarrassment. 'You do not want her to stare you out or look over your head. That's a bad sign,' he said. Mr Campbell's study has also found women give off other signals that men should look out for on a date or when they meet someone for the first time. Secret: The book has revealed a whole new world to men which they can use to know if a date is going well or not Whether she is right or left handed she will use her dominant wrist to point at you if she likes you.
According to the Washington Post, more than 2,000 people have been killed by police officers since the beginning of 2015. The following is a synopsis of some of the highest profile cases in which Americans have died at the hands of law enforcement dating back to 2014. On Sept. 20, 2016, police in Charlotte, North Carolina fatally shot 43-year-old Keith LaMont Scott while carrying out an unrelated search warrant. Officers say they saw Scott exit the car with a gun, and refused to comply with their commands to drop the weapon. Scott's family claims he had suffered brain damage in the past and had trouble communicating. The shooting sparked violent protests in the Charlotte area. In Nov. 2016, prosecutors declined to charge the officer who shot Scott. Terence Crutcher was shot and killed in Tulsa, Oklahoma by Officer Betty Shelby on Sept. 16, 2016. Police were called to the scene when Crutcher's vehicile was found abandoned and running in the middle of the road. After refusing to show his hands and failing to follow other police orders, Shelby felt threatend and shot Crutcher. PCP was recovered at the scene, and records show Crutcher had a history of using the drug. On May 17, 2017, a jury acquitted Betty Shelby of first-degree manslaughter. Sylville Smith of Milwaukee, Wisconsin was shot and killed after he fled a traffic stop on August 13, 2016. He was armed with a loaded handgun and was shot twice by Milwaukee Police officer Dominique Heaggan-Brown. Smith's death sparked three nights of unrest and riots throughout Milwaukee. In June 2017, Heaggan-Brown was acquitted of first-degree reckless homicide relating to Smith's death. On July 6, 2016, Philando Castile was shot and killed during a traffic stop just outside of Minneapolis, Minnesota. Before being shot, Castile informed Officer Jeronimo Yanez that he was armed with a gun. Seconds later, Yanez shot Castile when he saw him reaching toward his pocket. Castile's girlfriend, Diamond Reynolds, streamed the aftermath of the shooting on Facebook live while Reynolds' daughter sat in the back seat. In June 2017, a jury acquitted Yanez of second-degree manslaughter and dangerous discharge of a firearm. Yanez was then fired by the St. Anthony Police Department. Alton Sterling, 37, was shot and killed by police in Baton Rogue, Louisiana on July 5, 2016 while selling CDs on a street corner. A 911 caller reported to police that Sterling waved his gun and threatened him. Upon arriving on the scene, Sterling was tased and wrestled to the ground. When police officers noticed Sterling was carrying a gun, Sterling was told not to move and then shot. In May 2017, the Department of Justice said it would not charge the officers, though the state of Louisiana is still investigaitng. Ray Tensing, left, and Sam DuBose. Sandra Bland was arrested for assaulting a police officer after a heated traffic stop on July 10, 2015 in Waller, Texas. Three days later on July 13, Bland was found hanging in her jail cell. An investigation by the state of Texas and the FBI determined that police did not follow specific policies relating to inmate checks and mental health training. In addition, Bland's arresting officer was placed on administrative leave for failing to proper traffic stop procedures relating to dash cam footage. A grand jury did not charge the county sheriff or jail staff in Bland's death. After being placed under arrested for possessing an illegal switchblade on April 12, 2015, Gray suffered a spinal cord injury while being transported in a police vehicle. He was moved to a hospital and died of a spinal cord injury one week later on April 19, 2015. Gray's death sparked riots and unrest in Baltimore in the early summer months of 2015. Six seperate officers will be tried for Gray's death. Thus far, two have been found not guilty and the trial for a third officer was thrown out due to a hung jury. On Nov. 22, 2014, 12-year-old Tamir Rice was shot and killed while playing with a toy gun in a public park in Cleveland, Ohio. The 911 caller who reported seeing Rice with the toy told dispatcher that Rice was probably a minor and his gun was probably fake, but that information was never relayed to officers. A grand jury declined to bring charges against the officers. The 911 dispatcher received an eight-day suspension. Crawford was shot and killed by police at a Beavercreek, Ohio Walmart on August 5, 2014 while playing with an unpackaged toy BB gun. After other shoppers saw Crawford messing around with the gun and pretending to shoot people, the police were called. Crawford was shot shortly after police arrived. A grand jury declined to charge the officers responsible for Crawford's death (Wikimedia Commons). The New York City man died on July 17, 2014 shortly after being placed under arrest for unlawfully selling cigarettes by the New York Police Department. During a scuffle with police, Garner can be heard on video yelling, "I can't breathe" multiple times. Officer Daniel Pantaleo, the policeman who was attempting to arrest Garner, was cleared of wrongdoing by a grand jury in December 2014. The Ferguson, Missouri teenager was shot and killed by Ferguson Police Darren Wilson. Brown's death sparked riots in the community and led to a Department of Jusrice investigation into the Ferguson Police Department which found widespread problems with racism within the department. A grand jury ultimately decided not to bring charges against Wilson.
Professional Medical Associations and Divestiture from Industry: An Ethical Imperative for Pain Society Leadership. Professional medical associations (PMAs) play an essential role in maintaining and promoting the quality of medical care. They educate and set practice standards for members through certification processes, publication of medical journals, annual conferences, continuing medical education, diagnostic and treatment guidelines, and ethical codes. At the same time, they represent the public face of medicine. In the political realm, they speak for their members and for patients alike. They advocate on issues ranging from physician payment policies to national health insurance. Their agenda is so wide-ranging, involving almost all aspects of medicine, that scientific integrity, objectivity, and independence are essential. In light of this mission, one of the most
/** * A database backend utilizing SQLite with SQLite-JDBC by Xerial. * https://github.com/xerial/sqlite-jdbc * (The library is licensed Apache v2) */ public class SQLiteDatabase implements Database { // Instance variables private Connection mConnection; /** * Public constructor */ public SQLiteDatabase() { this("data.db"); } /** * Protected constructor, only for unittesting use * @param filename The filename of the database */ public SQLiteDatabase(String filename) { assert filename != null && !filename.equals(""); try { mConnection = DriverManager.getConnection("jdbc:sqlite:" + filename); Statement stmt = null; try { // Create a statement object stmt = mConnection.createStatement(); stmt.execute("PRAGMA FOREIGN_KEYS = ON;"); stmt.execute(Studies.CREATE); stmt.execute(Investigators.CREATE); stmt.execute(DataRequests.CREATE); stmt.execute(StudyParticipants.CREATE); stmt.execute(LocationSessions.CREATE); stmt.execute(LocationLog.CREATE); } catch (SQLException e) { // Something went wrong, print stacktrace e.printStackTrace(); throw new IllegalArgumentException("Database error: " + e); } finally { // Close statement to free up memory if (stmt != null) stmt.close(); } } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("Database error: " + e); } } @Override public void close() { if (isOpen()) try { mConnection.close(); } catch (SQLException e) { e.printStackTrace(); } } // (name, institution, webpage, description, purpose, procedures, risks, benefits, payment, conflicts, confidentiality, participationAndWithdrawal, rights, // verification, privkey, pubkey, keyalgo, kex, kexalgo, queue) @Override public long addStudyRequest(StudyRequest req) { assert isOpen(); assert req != null; long rv; try { // Insert the StudyRequest itself PreparedStatement stmt = mConnection.prepareStatement(Studies.INSERT, Statement.RETURN_GENERATED_KEYS); stmt.setString(1, req.name); stmt.setString(2, req.institution); stmt.setString(3, req.webpage); stmt.setString(4, req.description); stmt.setString(5, req.purpose); stmt.setString(6, req.procedures); stmt.setString(7, req.risks); stmt.setString(8, req.benefits); stmt.setString(9, req.payment); stmt.setString(10, req.conflicts); stmt.setString(11, req.confidentiality); stmt.setString(12, req.participationAndWithdrawal); stmt.setString(13, req.rights); stmt.setInt (14, req.verification); stmt.setString(15, RSA.encodeKey(req.privkey)); stmt.setString(16, RSA.encodeKey(req.pubkey)); stmt.setInt (17, 1); // TODO Change constants stmt.setBytes (18, serializeKeyPair(req.exchange.getKeypair())); stmt.setInt (19, 1); // TODO Change constants stmt.setBytes (20, req.queue); int affected_rows = stmt.executeUpdate(); // Determine the ID of the inserted column // Inserted object ID identification loosely based on http://stackoverflow.com/a/1915197/1232833 assert affected_rows > 0; ResultSet generatedKeys = stmt.getGeneratedKeys(); if (generatedKeys.next()) { rv = generatedKeys.getLong(1); } else { throw new IllegalArgumentException("Insert failed, no record created"); } stmt.close(); // Set ID on object req.id = rv; // Insert Investigators stmt = mConnection.prepareStatement(Investigators.INSERT); for (StudyRequest.Investigator inv : req.investigators) { stmt.setLong(1, rv); stmt.setString(2, inv.name); stmt.setString(3, inv.institution); stmt.setString(4, inv.group); stmt.setString(5, inv.position); affected_rows = stmt.executeUpdate(); assert affected_rows > 0; } stmt.close(); // Insert DataRequests stmt = mConnection.prepareStatement(DataRequests.INSERT); for (StudyRequest.DataRequest data : req.requests) { stmt.setLong(1, rv); stmt.setInt(2, data.type); stmt.setInt(3, data.granularity); stmt.setInt(4, data.frequency); affected_rows = stmt.executeUpdate(); assert affected_rows > 0; } stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Exception: ", e); } return rv; } @Override public void deleteStudy(StudyRequest req) { assert isOpen(); assert req != null; assert req.queue != null; long studyid = getStudyIDByQueueIdentifier(req.queue); if (studyid > 0) { try { PreparedStatement stmt = mConnection.prepareStatement(Studies.DELETE_ID); stmt.setLong(1, studyid); int rv = stmt.executeUpdate(); assert rv == 1; } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } } } @Override public StudyRequest getStudyRequestByID(long id) { assert isOpen(); assert id >= 0; StudyRequest rv; try { // Prepare query PreparedStatement stmt = mConnection.prepareStatement(Studies.SELECT_BY_ID); stmt.setLong(1, id); // Execute query ResultSet rs = stmt.executeQuery(); // We expect only one result if (!rs.next()) { // No result => ID is not in the database return null; } rv = studyRequestFromResultSet(rs); stmt.close(); rs.close(); // Retrieve Investigators rv.investigators.addAll(getInvestigatorsForStudyID(id)); // Retrieve DataRequests rv.requests.addAll(getDataRequesstsForStudyID(id)); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } @Override public long getStudyIDByQueueIdentifier(byte[] identifier) { assert isOpen(); assert identifier != null; long rv = -1; try { // Prepare statement PreparedStatement stmt = mConnection.prepareStatement(Studies.SELECT_BY_QUEUE); // Set parameters stmt.setBytes(1, identifier); // Perform query ResultSet rs = stmt.executeQuery(); // We expect only one result, as Queue Identifiers should be unique if (rs.next()) { rv = rs.getLong(1); } // Close resultset rs.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Exception: ", e); } return rv; } @Override public List<StudyRequest> getStudyRequests() { assert isOpen(); List<StudyRequest> rv = new LinkedList<>(); try { PreparedStatement stmt = mConnection.prepareStatement(Studies.SELECT_ALL); ResultSet rs = stmt.executeQuery(); while (rs.next()) { StudyRequest req = studyRequestFromResultSet(rs); req.investigators.addAll(getInvestigatorsForStudyID(req.id)); req.requests.addAll(getDataRequesstsForStudyID(req.id)); rv.add(req); } rs.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } @Override public long addParticipant(KeySet keys, long studyid) { assert isOpen(); assert keys != null; assert studyid >= 0; long rv = -1; try { // Prepare insert PreparedStatement stmt = mConnection.prepareStatement(StudyParticipants.INSERT); // Set parameters stmt.setLong(1, studyid); stmt.setBytes(2, keys.getOutboundKey()); stmt.setBytes(3, keys.getOutboundCtr()); stmt.setBytes(4, keys.getInboundKey()); stmt.setBytes(5, keys.getInboundCtr()); // Execute update int affected_rows = stmt.executeUpdate(); // Ensure update worked assert affected_rows > 0; // Retrieve ID of inserted row ResultSet generatedKeys = stmt.getGeneratedKeys(); if (generatedKeys.next()) { rv = generatedKeys.getLong(1); } else { throw new IllegalArgumentException("Insert failed, no record created"); } stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } @Override public void updateParticipant(KeySet keys) { assert isOpen(); assert keys != null; assert keys.getID() >= 0; try { PreparedStatement stmt = mConnection.prepareStatement(StudyParticipants.UPDATE_ID); // Set parameters stmt.setBytes(1, keys.getOutboundKey()); stmt.setBytes(2, keys.getOutboundCtr()); stmt.setBytes(3, keys.getInboundKey()); stmt.setBytes(4, keys.getInboundCtr()); stmt.setLong(5, keys.getID()); int affected_rows = stmt.executeUpdate(); assert affected_rows == 1; stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } } @Override public List<KeySet> getParticipants() { assert isOpen(); List<KeySet> rv = new LinkedList<>(); try { PreparedStatement stmt = mConnection.prepareStatement(StudyParticipants.SELECT_ALL); ResultSet rs = stmt.executeQuery(); while (rs.next()) { KeySet ks = keySetFromResultSet(rs); rv.add(ks); } rs.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Exception: ", e); } return rv; } @Override public List<KeySet> getParticipantsForStudy(long studyID) { assert isOpen(); assert studyID >= 0; List<KeySet> rv = new LinkedList<>(); try { PreparedStatement stmt = mConnection.prepareStatement(StudyParticipants.SELECT_PARTICIPANT_STUDY); stmt.setLong(1, studyID); ResultSet rs = stmt.executeQuery(); while (rs.next()) { KeySet ks = keySetFromResultSet(rs); rv.add(ks); } rs.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Exception: ", e); } return rv; } @Override public long getParticipantIDByKeySet(KeySet keys) { assert isOpen(); assert keys != null; long rv = -1; try { PreparedStatement stmt = mConnection.prepareStatement(StudyParticipants.SELECT_KEYS); stmt.setBytes(1, keys.getOutboundKey()); stmt.setBytes(2, keys.getOutboundCtr()); stmt.setBytes(3, keys.getInboundKey()); stmt.setBytes(4, keys.getInboundCtr()); ResultSet rs = stmt.executeQuery(); if (rs.next()) { rv = rs.getLong(1); } stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Exception: ", e); } return rv; } @Override public void addShareable(Shareable sh) { if (sh.getType() == Shareable.SHAREABLE_TRACK) { addGPSTrack((GPSTrack) sh, sh.getOwner()); } else { throw new IllegalArgumentException("Unknown shareable"); } } @Override public void addGPSTrack(GPSTrack track, long ownerid) { assert isOpen(); assert track != null; assert ownerid >= 0; try { long rv; // Prepare insert PreparedStatement stmt = mConnection.prepareStatement(LocationSessions.INSERT); // Set parameters stmt.setString(1, track.getSessionName()); stmt.setLong(2, ownerid); stmt.setLong(3, track.getTimestamp()); stmt.setLong(4, track.getTimestampEnd()); stmt.setString(5, track.getTimezone()); stmt.setFloat(6, track.getDistance()); stmt.setInt(7, track.getModeOfTransportation()); stmt.setString(8, track.getDescription()); // Execute int changed = stmt.executeUpdate(); assert changed > 0; ResultSet generatedKeys = stmt.getGeneratedKeys(); if (generatedKeys.next()) { rv = generatedKeys.getLong(1); } else { throw new IllegalArgumentException("Insert failed, no record created"); } stmt.close(); PreparedStatement innerstmt = mConnection.prepareStatement(LocationLog.INSERT); for (Location loc : track.getPosition()) { innerstmt.setLong(1, rv); innerstmt.setDouble(2, loc.getTime()); innerstmt.setDouble(3, loc.getLatitude()); innerstmt.setDouble(4, loc.getLongitude()); changed = innerstmt.executeUpdate(); assert changed > 0; } innerstmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } } @Override public List<GPSTrack> getGPSTracks() { assert isOpen(); List<GPSTrack> rv = new LinkedList<>(); try { // Query for all LocationSessions PreparedStatement stmt = mConnection.prepareStatement(LocationSessions.SELECT_ALL); // Execute query ResultSet rs = stmt.executeQuery(); // Iterate over resultset while (rs.next()) { // Parse into GPSTrack and add to return list rv.add(GPSTrackFromResultSet(rs)); } // Close ResultSet and PreparedStatement rs.close(); stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } @Override public List<GPSTrack> getGPSTracksByParticipantID(long participantID) { assert isOpen(); assert participantID >= 0; List<GPSTrack> rv = new LinkedList<>(); try { // Query for all LocationSessions PreparedStatement stmt = mConnection.prepareStatement(LocationSessions.SELECT_PARTICIPANT_ID); stmt.setLong(1, participantID); // Execute query ResultSet rs = stmt.executeQuery(); // Iterate over resultset while (rs.next()) { // Parse into GPSTrack and add to return list rv.add(GPSTrackFromResultSet(rs)); } // Close ResultSet and PreparedStatement rs.close(); stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } @Override public List<GPSTrack> getGPSTracksByStudyID(long studyID) { assert isOpen(); assert studyID >= 0; List<GPSTrack> rv = new LinkedList<>(); try { // Query for all LocationSessions PreparedStatement stmt = mConnection.prepareStatement(LocationSessions.SELECT_STUDY_ID); stmt.setLong(1, studyID); // Execute query ResultSet rs = stmt.executeQuery(); // Iterate over resultset while (rs.next()) { // Parse into GPSTrack and add to return list rv.add(GPSTrackFromResultSet(rs)); } // Close ResultSet and PreparedStatement rs.close(); stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } @Override public List<Shareable> getDataByParticipantID(long participantID) { assert isOpen(); assert participantID >= 0; List<Shareable> rv = new LinkedList<>(); rv.addAll(getGPSTracksByParticipantID(participantID)); // TODO Add further shareable types here return rv; } @Override public List<Shareable> getDataByStudyID(long studyid) { assert isOpen(); assert studyid >= 0; List<Shareable> rv = new LinkedList<>(); rv.addAll(getGPSTracksByStudyID(studyid)); // TODO Add further shareable types here return rv; } /** * Check if the underlying database is open * @return true if the database is open, false otherwise */ private boolean isOpen() { try { return mConnection != null && !mConnection.isClosed(); } catch (SQLException e) { return false; } } ///// Helper function /** * Retrieve all {@link de.velcommuta.denul.data.StudyRequest.Investigator}s for a specific study ID * @param id The Study ID * @return A List of {@link de.velcommuta.denul.data.StudyRequest.Investigator}s, or an empty List if no Investigators * are saved in the database */ private List<StudyRequest.Investigator> getInvestigatorsForStudyID(long id) { List<StudyRequest.Investigator> rv = new LinkedList<>(); try { PreparedStatement stmt = mConnection.prepareStatement(Investigators.SELECT_STUDY_ID); stmt.setLong(1, id); ResultSet rs = stmt.executeQuery(); while (rs.next()) { rv.add(investigatorFromResultSet(rs)); } rs.close(); stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } /** * Retrieve all {@link de.velcommuta.denul.data.StudyRequest.DataRequest}s for a specific study ID * @param id The Study ID * @return A List of DataRequests, or an empty List if no such requests are saved */ private List<StudyRequest.DataRequest> getDataRequesstsForStudyID(long id) { List<StudyRequest.DataRequest> rv = new LinkedList<>(); try { PreparedStatement stmt = mConnection.prepareStatement(DataRequests.SELECT_STUDY_ID); stmt.setLong(1, id); ResultSet rs = stmt.executeQuery(); while (rs.next()) { rv.add(dataRequestFromResultSet(rs)); } rs.close(); stmt.close(); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("SQL Error: ", e); } return rv; } /** * Read a {@link StudyRequest} from a {@link ResultSet} and return it. Will NOT have the investigators and requests * fields set. Will not modify the ResultSet * @param rs The ResultSet * @return A StudyRequest */ private StudyRequest studyRequestFromResultSet(ResultSet rs) { assert rs != null; // Create object StudyRequest rv = new StudyRequest(); try { rv.id = rs.getLong(Studies.COLUMN_ID); rv.name = rs.getString(Studies.COLUMN_NAME); rv.institution = rs.getString(Studies.COLUMN_INSTITUTION); rv.webpage = rs.getString(Studies.COLUMN_WEB); rv.description = rs.getString(Studies.COLUMN_DESCRIPTION); rv.purpose = rs.getString(Studies.COLUMN_PURPOSE); rv.procedures = rs.getString(Studies.COLUMN_PROCEDURES); rv.risks = rs.getString(Studies.COLUMN_RISKS); rv.benefits = rs.getString(Studies.COLUMN_BENEFITS); rv.payment = rs.getString(Studies.COLUMN_PAYMENT); rv.conflicts = rs.getString(Studies.COLUMN_CONFLICTS); rv.confidentiality = rs.getString(Studies.COLUMN_CONFIDENTIALITY); rv.participationAndWithdrawal = rs.getString(Studies.COLUMN_PARTICIPATION); rv.rights = rs.getString(Studies.COLUMN_RIGHTS); rv.verification = rs.getInt(Studies.COLUMN_VERIFICATION); rv.pubkey = RSA.decodePublicKey(rs.getString(Studies.COLUMN_PUBKEY)); rv.privkey = RSA.decodePrivateKey(rs.getString(Studies.COLUMN_PRIVKEY)); rv.exchange = new ECDHKeyExchange(deserializeKeyPair(rs.getBytes(Studies.COLUMN_KEX))); rv.queue = rs.getBytes(Studies.COLUMN_QUEUE); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException("ResultSet seems bad: ", e); } return rv; } /** * Read a KeySet from a ResultSet * @param rs The ResultSet * @return The KeySet * @throws SQLException If the ResultSet throws it */ private KeySet keySetFromResultSet(ResultSet rs) throws SQLException { assert rs != null; return new KeySet( // KeyIn, KeyOut, CtrIn, CtrOut, initiated, databaseID rs.getBytes(5), rs.getBytes(3), rs.getBytes(6), rs.getBytes(4), true, rs.getInt(1) ); } /** * Retrieve data from a ResultSet and query the database for additional data on a GPSTrack * @param rs A ResultSet containing all fields of a LocationSession query * @return A GPSTrack * @throws SQLException If the database encounters an error */ private GPSTrack GPSTrackFromResultSet(ResultSet rs) throws SQLException { assert isOpen(); PreparedStatement innerstmt = mConnection.prepareStatement(LocationLog.SELECT_ID); innerstmt.setLong(1, rs.getLong(1)); ResultSet irs = innerstmt.executeQuery(); List<Location> loclist = new LinkedList<>(); while (irs.next()) { Location loc = new Location(); loc.setTime(irs.getDouble(3)); loc.setLatitude(irs.getDouble(4)); loc.setLongitude(irs.getDouble(5)); loclist.add(loc); } GPSTrack track = new GPSTrack(loclist, // locations rs.getString(2), // Name rs.getInt(8), // Mode rs.getLong(4), // Timestamp start rs.getLong(5), // Timestamp end rs.getString(6), // Timezone rs.getFloat(7)); // Distance track.setDescription(rs.getString(9)); // Description track.setID((int) rs.getLong(1)); // ID track.setOwner(rs.getInt(3)); irs.close(); innerstmt.close(); return track; } /** * Read a {@link de.velcommuta.denul.data.StudyRequest.Investigator} from a {@link ResultSet} and return it. * Will not modify the ResultSet * @param rs The ResultSet * @return An {@link de.velcommuta.denul.data.StudyRequest.Investigator} */ private StudyRequest.Investigator investigatorFromResultSet(ResultSet rs) { // Initialize reply object StudyRequest.Investigator rv = new StudyRequest.Investigator(); try { // Set fields rv.name = rs.getString(Investigators.COLUMN_NAME); rv.institution = rs.getString(Investigators.COLUMN_INSTITUTION); rv.group = rs.getString(Investigators.COLUMN_GROUP); rv.position = rs.getString(Investigators.COLUMN_POSITION); } catch (SQLException e) { // Something is very wrong e.printStackTrace(); throw new IllegalArgumentException("ResultSet seems bad: ", e); } return rv; } /** * Read a {@link de.velcommuta.denul.data.StudyRequest.DataRequest} from a {@link ResultSet} and return it. * Will not modify the ResultSet * @param rs The ResultSet * @return A {@link de.velcommuta.denul.data.StudyRequest.DataRequest} */ private StudyRequest.DataRequest dataRequestFromResultSet(ResultSet rs) { // Initialize reply object StudyRequest.DataRequest rv = new StudyRequest.DataRequest(); try { // Set fields rv.type = rs.getInt(DataRequests.COLUMN_DATATYPE); rv.granularity = rs.getInt(DataRequests.COLUMN_GRANULARITY); rv.frequency = rs.getInt(DataRequests.COLUMN_FREQUENCY); } catch (SQLException e) { // Something is very wrong e.printStackTrace(); throw new IllegalArgumentException("ResultSet seems bad: ", e); } return rv; } /** * Serialize a Keypair * @param serialize The keypair to serialize * @return The serialized keypair */ private byte[] serializeKeyPair(KeyPair serialize) { try { ByteArrayOutputStream b = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(b); o.writeObject(serialize); byte[] res = b.toByteArray(); o.close(); b.close(); return res; } catch (IOException e) { e.printStackTrace(); return new byte[] {0x00}; } } /** * Deserialize a serialized keypair * @param serialized The serialized keypair * @return The deserialized keypair */ private KeyPair deserializeKeyPair(byte[] serialized) { try { ByteArrayInputStream bi = new ByteArrayInputStream(serialized); ObjectInputStream oi = new ObjectInputStream(bi); Object obj = oi.readObject(); oi.close(); bi.close(); assert obj instanceof KeyPair; return (KeyPair) obj; } catch (ClassNotFoundException | IOException e) { e.printStackTrace(); return null; } } }
<reponame>gavinband/bingwa // Copyright <NAME> 2008 - 2012. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef GENFILE_ONEFILEPERCHROMOSOME_SNP_DATA_SINK_HPP #define GENFILE_ONEFILEPERCHROMOSOME_SNP_DATA_SINK_HPP #include <memory> #include <map> #include <string> #include <boost/ptr_container/ptr_vector.hpp> #include <boost/tuple/tuple.hpp> #include "genfile/SNPDataSink.hpp" namespace genfile { class OneFilePerChromosomeSNPDataSink: public SNPDataSink { public: typedef std::auto_ptr< OneFilePerChromosomeSNPDataSink > UniquePtr ; static UniquePtr create( std::string const& filename, Metadata const& metadata = Metadata(), std::string const& wildcard = "#" ) ; OneFilePerChromosomeSNPDataSink( std::string const& filename, Metadata const& metadata = Metadata(), std::string const& wildcard = "#" ) ; public: operator bool() const ; void write_snp_impl( uint32_t number_of_samples, std::string SNPID, std::string RSID, Chromosome chromosome, uint32_t SNP_position, std::string first_allele, std::string second_allele, GenotypeProbabilityGetter const& get_AA_probability, GenotypeProbabilityGetter const& get_AB_probability, GenotypeProbabilityGetter const& get_BB_probability, Info const& info ) ; std::string get_spec() const ; private: boost::tuple< std::string, std::string, std::string > m_filename_template ; Metadata const m_metadata ; std::map< Chromosome, SNPDataSink* > m_sinks ; boost::ptr_vector< SNPDataSink > m_sink_storage ; std::map< Chromosome, std::string > m_filenames ; SNPDataSink& get_sink_for_chromosome( Chromosome const& chromosome ) ; } ; } #endif
package com.mcndsj.lobbyShop.items; import com.mcndsj.lobbyMoney.MoneyType; import com.mcndsj.lobbyMoney.api.LobbyMoneyApi; import org.bukkit.ChatColor; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.*; /** * Created by Matthew on 4/07/2016. */ public abstract class ShopItem { private int cost; private MoneyType costType; private ItemStack item; public ShopItem(int cost, ItemStack item, MoneyType money){ this.cost = cost; this.item = item; this.costType = money; } /* Warning , sync IOoperation Here */ public boolean canBuy(Player p){ boolean returnValue = true; if(cost != 0){ int current = LobbyMoneyApi.get().getCurrency(p.getName(),costType); int need = getCost(p); System.out.println(current + "/" + need); if(current < need) { p.sendMessage(ChatColor.AQUA + "提示 >> " + ChatColor.GRAY + "您的" + costType.toString() + "余额不足,您还需 " + (need - current) + " " + costType.toString() + "才可以购买!" ); p.closeInventory(); return false; } } returnValue = returnValue && canBuyCheck(p); return returnValue; } /** * * @param p the player who wants to buy it * @return precondition of buy method sound or not */ protected abstract boolean canBuyCheck(Player p); /** * * @param p player who buy it * @return success or fail */ public abstract boolean buy(Player p ); /** * * @param p the player showing to * @return the itemStack showing to that player */ public abstract ItemStack getItem(Player p); /** * * @param p the player who want to buy it * @return the cost for that player */ public abstract int getCost(Player p); public int getCost(){ return cost; } public MoneyType getCostType(){ return costType; } public ItemStack getItem(){ return item; } }
The designated POTA court on Monday sentenced nine people to life imprisonment in the Haren Pandya murder case. The senior Bharatiya Janata Party leader and former Gujarat home minister was shot dead in an Ahmedabad park on March 26, 2003. But Pandya's family is dissatisfied with the verdict. His widow Jagruti Pandya told rediff.com, "I have great respect for the Indian judiciary, but I cannot accept this judgment because it is based on an incomplete investigation." She revealed that the Central Bureau of Investigation neither recorded her side of the story nor asked her to appear before the POTA court. "I was perhaps the last person to speak to my husband before he was killed. He left home for his morning walk and was killed while he tried to get out of his car for his walk. Despite several pleas, I was never called to give a statement by the investigating agency. I could have provided some vital information," she said. The investigation of the case was first conducted by the Crime Branch in Ahmedabad under the supervision of D G Vanzara, the senior police officer who is currently under arrest for his alleged involvement in the Sohrabuddin Sheikh fake encounter. The Pandya murder case was later handed over to the CBI after protests from civil liberty groups. After her husband's death, Jagruti Pandya has struggled to educate her two children. She feels sad that neither the BJP government in Gujarat nor the party has done anything to keep Haren Pandya's memory alive. With the help of her husband's supporters she erected Pandya's statute at Nehru Nagar Circle in Ahmedabad. "My husband lived and died for the BJP. His Ellis Bridge constituency brought the highest percentage of BJP votes (over 73 per cent) in Gujarat," she said. Vitthalbhai Pandya, her father-in law, has run a crusade these last four years to get justice for his slain son. He told rediff.com, "Even the CBI depended on Vanzara's investigation. He interfered all the time in the CBI's functioning." After his son's death Vitthalbhai Pandya alleged that Chief Minister Narendra Modi was involved in the plot to murder Haren Pandya. But he does not have evidence to substantiate this serious allegation. When asked to furnish the evidence against Modi, Vitthalbhai Pandya alleged, "My son was a political challenger to Modi. He was capable and popular but Modi didn't give him a ticket to fight the election. He was targeted because he refused to vacate the Ellis Bridge seat for Modi." "The prime accused Asghar Ali was found in Hyderabad after 12 days. How is it possible?" asked Vitthalbhai Pandya. "Would he not run away or hide after the murder?" "I wanted the POTA court to hear me," Jagruti Pandya said. "I wanted to tell the judge that there were no bloodstains found in the car in which my husband was killed." "Dr M Narayan Reddy, head of the department of forensic medicine at the Osmania Medical College, Hyderabad, in his deposition to the POTA court testified that five out of the total seven injuries were not possible had my husband been sitting in the car." "However, the investigation did not take this into account. It was found that my husband was shot at while he was sitting in the car. He was shot from the car window, they said. My husband was injured mostly from the scrotum downwards. Experts including Dr Reddy felt this injury was not possible had he been shot from the car window," said Jagruti Pandya. "This angle was not investigated." She pointed out that Dr J K Sinha, retired joint director, ballistic division, Central Forensic Sciences Laboratory, Chandigarh, in his deposition before the POTA court had said that the 'circular gun shot wounds' as noted in the post-mortem report (authored by doctors at the V S Hospital, Ahmedabad) is an impossibility when a person is sitting inside a Maruti [Get Quote] car in the driver's seat and the assailant is standing outside the driver's door with a very narrow opening in the driver's side window. Dr Sinha and Dr Reddy's statements, Jagrui Pandya felt, gain importance because the investigation in its preliminary stage was conducted by Vanzara. She alleged that the CBI, which later took charge of the case from Vanzara, relied on him. The CBI, she claimed, admitted to the media that when they took over the case, vital clues had been lost. Jagruti Pandya told the media that "A police lookout notice for the mastermind was issued 12 days after the murder. By then he had fled. Although there was a lookout notice, his wife and family also fled to Pakistan." "How is it possible," she asked. "For two-and-a-half years," she said, "the mobile and phone records of my husband were not produced by the CBI. The CBI investigating officer admitted during his cross examination that the CBI had procured these records as early as March 30, 2003, but he admitted in open court that the CBI has no idea where the original printouts are. Where did the original phone records disappear?" "As his widow," she said, "I request the Gujarat government to please intervene and seek a re-investigation in the Haren Pandya murder case. I will soon meet the honourable chief minister and request him to seek a re-investigation in the case. A re-investigation is a must for the truth to come out."
An Enhanced Security for Online Voting System using Blockchain Technology An electoral system or voting system is a set of rules that determine how elections and referendums are conducted and how their results are determined. Election is a very important event in a modern democracy but large sections of society around the world do not trust their election system which is major concern for the democracy. Distributed ledger technology is an exciting technological advancement in the information technology world. Blockchain Technologies offer an infinite range of applications benefiting from sharing economies. In this paper the proposed system is to store the ballot information as a block node for each and every voter and transfer the voters vote hash over the internet to all other nodes. The proposed system is cost-efficient when compared to the traditional electronic voting machines.
Peter Jackson has said The Hobbit: An Unexpected Journey will be completed just two days before the New Zealand premiere. The director has been sharing behind-the-scenes footage of his crew making the first part of his trilogy since production began, with a previous eight videos about make-up, location shooting and motion capture. His latest video blog, which has been sub-titled ‘Post Production’, sees the director chronicle the frantic effort by his team to complete An Unexpected Journey and includes an insight into Howard Shore’s score for the film – you can watch the video below. The Hobbit: An Unexpected Journey gets its worldwide premiere in New Zealand on November 28 before opening in UK cinemas on December 14. You can watch the trailer at the bottom of this article.
#ifndef _NAEMON_H #define _NAEMON_H #if defined (NAEMON_COMPILATION) #error "Never include naemon/naemon.h within a file in the naemon project - it's for broker modules." #endif #define _NAEMON_H_INSIDE #include "lib/libnaemon.h" #include "broker.h" #include "checks.h" #include "checks_service.h" #include "checks_host.h" #include "commands.h" #include "comments.h" #include "common.h" #include "configuration.h" #include "defaults.h" #include "downtime.h" #include "events.h" #include "flapping.h" #include "globals.h" #include "logging.h" #include "macros.h" #include "naemon.h" #include "nebcallbacks.h" #include "neberrors.h" #include "nebmods.h" #include "nebmodules.h" #include "nebstructs.h" #include "nerd.h" #include "notifications.h" #include "objectlist.h" #include "objects.h" #include "objects_command.h" #include "objects_common.h" #include "objects_contactgroup.h" #include "objects_contact.h" #include "objects_hostdependency.h" #include "objects_hostescalation.h" #include "objects_hostgroup.h" #include "objects_host.h" #include "objects_servicedependency.h" #include "objects_serviceescalation.h" #include "objects_servicegroup.h" #include "objects_service.h" #include "objects_timeperiod.h" #include "perfdata.h" #include "query-handler.h" #include "sehandlers.h" #include "shared.h" #include "sretention.h" #include "statusdata.h" #include "utils.h" #include "workers.h" #undef _NAEMON_H_INSIDE /* * Defines below is kept purely of backward compatibility purposes. They aren't * used within the naemon project itself. * * If they should be used within the naemon project, move them to the correct * header before use. */ /************* MISC LENGTH/SIZE DEFINITIONS ***********/ /* NOTE: Plugin length is artificially capped at 8k to prevent runaway plugins from returning MBs/GBs of data back to Nagios. If you increase the 8k cap by modifying this value, make sure you also increase the value of MAX_EXTERNAL_COMMAND_LENGTH in common.h to allow for passive checks results received through the external command file. EG 10/19/07 */ #define MAX_PLUGIN_OUTPUT_LENGTH 8192 /* max length of plugin output (including perf data) */ /*********** ROUTE CHECK PROPAGATION TYPES ************/ #define PROPAGATE_TO_PARENT_HOSTS 1 #define PROPAGATE_TO_CHILD_HOSTS 2 /************ SCHEDULED DOWNTIME TYPES ****************/ #define ACTIVE_DOWNTIME 0 /* active downtime - currently in effect */ #define PENDING_DOWNTIME 1 /* pending downtime - scheduled for the future */ #endif
<filename>src/hooks/hooks.module.ts import { Module, OnModuleInit } from '@nestjs/common'; import { HooksExplorer } from './hooks-exporer'; import { HooksService } from './hooks.service'; @Module({ providers: [HooksService, HooksExplorer], exports: [HooksService], }) export class HooksModule implements OnModuleInit { constructor( private readonly hooksService: HooksService, private readonly hooksExplorer: HooksExplorer, ) {} async onModuleInit() { const { hookActions } = this.hooksExplorer.explore(); this.hooksService.register(hookActions); console.log('init'); } }
/** * Return a possibly empty sublist of XML-TOKENS such that * (a) the first token is the first occurrence of <token-name ...> in XML-TOKENS * (b) the last token is the first occurrence of </token-name ...> or <token-name .../> at or after (a) */ @LispMethod(comment = "Return a possibly empty sublist of XML-TOKENS such that\r\n(a) the first token is the first occurrence of <token-name ...> in XML-TOKENS\r\n(b) the last token is the first occurrence of </token-name ...> or <token-name .../> at or after (a)\nReturn a possibly empty sublist of XML-TOKENS such that\n(a) the first token is the first occurrence of <token-name ...> in XML-TOKENS\n(b) the last token is the first occurrence of </token-name ...> or <token-name .../> at or after (a)") public static final SubLObject xml_extract_token_sequence(SubLObject xml_tokens, SubLObject token_name) { { SubLObject sequence_start_string = cconcatenate($str_alt161$_, format_nil.format_nil_a_no_copy(token_name)); SubLObject sequence_self_end_string = $str_alt162$__; SubLObject sequence_match_end_string = cconcatenate($str_alt163$__, format_nil.format_nil_a_no_copy(token_name)); SubLObject sequence_start = com.cyc.cycjava.cycl.web_utilities.advance_xml_tokens_to(xml_tokens, sequence_start_string, UNPROVIDED); if (NIL != sequence_start) { { SubLObject start_token = sequence_start.first(); if (NIL != string_utilities.ends_with(start_token, sequence_self_end_string, UNPROVIDED)) { return list(start_token); } } { SubLObject sequence_end = com.cyc.cycjava.cycl.web_utilities.advance_xml_tokens_to(sequence_start, sequence_match_end_string, UNPROVIDED); if (NIL != sequence_end) { { SubLObject sequence_after_end = sequence_end.rest(); return ldiff(sequence_start, sequence_after_end); } } } return NIL; } } return NIL; }
There are several well accepted methods for detecting computer viruses in memory, programs, documents or other potential hosts that might harbor them. One popular method, employed in most anti-virus products, is called "scanning". A scanner searches potential hosts for a set of one or more (typically several thousand) specific patterns of code called "signatures" that are indicative of particular known viruses or virus families, or that are likely to be included in new viruses. A signature typically consists of a pattern to be matched, along with implicit or explicit auxiliary information about the nature of the match, and possibly transformations to be performed upon the input data prior to seeking a match to the pattern. The pattern could be a byte sequence to which an exact or inexact match is to be sought in the potential host. More generally, the pattern could be a regular expression. The auxiliary information might contain information about the number and/or location of allowable mismatched bytes. It might also restrict the match in various ways; for example the match might be restricted to input data representing computer programs in the .EXE format, and a further restriction might specify that matches only be declared if they occur in a region within one kilobyte on either side of the entry point. The auxiliary information may also specify transformations; for example, the input data might need to be transformed by XORing adjacent bytes together prior to scanning for the indicated byte sequence. (This permits patterns to be located in data that have been encrypted by XORing each byte with any one-byte key; a detailed description can be found in U.S. Pat. No. 5,442,699, entitled "Searching for patterns in encrypted data", issued to William C. Arnold et al. on Aug. 15, 1995.) Other examples of transformations that are in common usage today include running an emulator on the input program to encourage a polymorphic virus to (virtually) decrypt itself prior to scanning for patterns, and parsing a Microsoft Word document to unscramble the macro data prior to scanning for macro viruses. Typically, a scanner operates by first loading signature data for one or more viruses into memory, and then examining a set of potential hosts for matches to one or more signatures. If any signature is found, further action may be taken to warn the user of the likely presence of a virus, and in some cases to eradicate the virus. As the number of known computer viruses is rapidly growing beyond 10,000, the problem of storing signatures and associated information in memory is becoming increasingly acute. This is especially so for the DOS operating system, which normally allots just 640 kilobytes for all programs and data in system memory, including virus signatures, the anti-virus program code, and anti-viral Terminate and Stay Resident processes, as well as any other unrelated code and data that may have been loaded into the system memory. One possible solution to the memory shortage in DOS-based systems is for the anti-virus program to use a DOS extender, which permits programs to use more than 640 kilobytes of memory if such "extended memory" is present on the computer. However, although many of today's PCs have extended memory, DOS extenders can slow down the operation of an anti-virus program significantly. In any case, even in operating systems other than DOS, it is still desirable to minimize memory usage, provided that this can be done without significantly degrading the speed of the scanner. Detection of computer viruses is but one example of the general problem of determining whether a given data string possesses any of a given set of traits. A data string is a sequence of bytes that represent information in a computer, such as a program or document. For data strings that represent computer programs, one example of a trait is the property of being infected with the Jerusalem virus. The set of traits could pertain to all known viruses or some subset of them. A second example of a trait of computer programs is the property of having been compiled by a particular compiler. For data strings that represent text, examples of data traits include the property that the text is in a particular language, such as French, or that it contains information about a particular topic, such as "sports" or "performances of Handel oratorios". A common method for detecting data traits in data strings is to search for a set of patterns that are indicative of those traits. For computer viruses, the patterns are typically computer virus signatures as described above. The compiler used to generate a given body of machine code is a trait that can also be identified using signatures. To identify languages or subject areas, a text can be scanned for sets of keywords, and the occurrence frequencies of those keywords or of approximate matches to them may then be used to infer which if any traits of are present. Quite generally, there is a mapping from the located occurrences of the patterns to a (possibly empty) set of inferred data traits. The mapping may or may not take into account the locations of the occurrences within the data string. The mapping may be one-to-one, one-to-many, or many-to-one. For example, in computer virus applications, the mapping is approximately one-to-one, but some signatures occur in several viruses, and sometimes several signatures are used to identify a single virus. Regardless of the particulars of the application, it is often the case that efficient detection of data traits within a data string requires a simultaneous search for a large number of patterns within that data string. In such cases, the memory required to store the patterns and any auxiliary data can be significant. It is generally desirable for any detector of data traits to be as efficient in all aspects as possible, and it is especially important for the detector to use as little computer memory as possible.
AT 3AM, a thousand young men are all poring over the same page in the Babylonian Talmud tractate of Kiddushin, which deals with definitions of matrimony in ancient rabbinical law. Dressed identically in white button-down shirts and dark ties, the students of Hebron Yeshiva, founded in Lithuania in 1877 and now situated in northern Jerusalem, are observing a millennia-old tradition of learning through the night on Shavuot, which marks the day when Moses received the Torah on Mount Sinai. Get our daily newsletter Upgrade your inbox and get our Daily Dispatch and Editor's Picks. This is only slightly exceptional. Any day of the week, save for short holidays, the study-halls at any of the elite yeshivas (Torah academies) in Israel are liable to be packed with students spending as much as 18 hours a day analysing Talmudic texts. Once married, most students will graduate to kollels, smaller institutes where they live off a meagre stipend, government benefits and perhaps their wives’ modest salaries. For many religious Jews, the flourishing of Torah study in Israel is a fulfilment of the biblical prophecy in Isaiah—“for the land will be filled with the knowledge of the Lord.” For Israeli economists, however, the reluctance of ultra-Orthodox (or Haredi) men to work, coupled with their community’s high birth rate (double the national average), is a problem. A study recently completed by the finance ministry predicts that on current trends Israel’s public debt, currently 67% of GDP,will spiral to 170% over the next 50 years. The ministry says that 45.7% of Haredi men are in the labour force, far less than the national employment rate of 60.4% and lower than for any group except for Arab women (see chart). Haredi women are not expected to study: their participation rate is 71%. According to the Central Bureau of Statistics, the Haredim were just under 10% of Israel’s population in 2009; by 2059 it predicts they will be around 27%. Israel cannot afford to keep paying them not to work. At the state’s foundation in 1948, Israel’s first prime minister, David Ben-Gurion, accepted the rabbis’ request to be allowed to rebuild the yeshivas which had been destroyed in the Holocaust in Europe. A first quota of 400 yeshiva students was exempted from military service. In 1977 the first Likud government, in which Haredi parties were coalition partners, removed that cap. Successive governments have expanded funding for yeshiva stipends as well as benefits for large families. The government before the current one included no ultra-Orthodox parties. So the secular Yesh Atid party, part of that coalition, was able to push through a law criminalising draft-avoiders and cutting benefits. The new coalition formed last month by Binyamin Netanyahu as prime minister includes two Haredi parties. These have been promised a repeal of that law and the restoration of benefits to their previous level. The economics ministry, which runs employment policy, and the Knesset finance committee, which has the final say on benefits, are controlled by senior Haredi politicians. The new economics minister, Aryeh Deri, is the leader of the religious Shas party. He insists he will block any attempt to cut benefits. He blames, instead, Israeli employers who are not interested in hiring members of his community. “There is clear discrimination, even of Haredi men who have studied for law or accountancy degrees. Employers see the black kippah (skullcap), the yeshiva on their CV, and won’t hire them. That’s why so many men remain in kollel.” Moshe Friedman, a graduate of Hebron Yeshiva who went on to study for nine years in a kollel, echoes Mr Deri. A self-taught software developer, he pitched his digital video-editing startup to Israeli venture-capital funds without success. “Everyone I met immediately asked me, why didn’t I serve in the army and what does a Haredi know about technology?” Israel’s celebrated high-tech sector, he says, is “a closed ecosystem where people know each other from the army, hire their friends and help them get funding.” He now runs the Kama-Tech programme which works with Haredim on placements with leading tech companies, including the local research centres of Google and Microsoft. But he will have his work cut out: attempts by the previous governments to oblige religious schools for teenagers to teach maths, English and the sciences as well as the Torah have routinely been blocked by religious politicians.
/* * Copyright the original author or authors. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ package de.schildbach.pte; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import de.schildbach.pte.dto.Product; import de.schildbach.pte.dto.Style; import okhttp3.HttpUrl; /** * Provider implementation for the Verkehrsverbund Ost-Region (Lower Austria and Burgenland, Austria). * * @author <NAME> */ public class VorProvider extends AbstractHafasClientInterfaceProvider { private static final HttpUrl API_BASE = HttpUrl.parse("https://anachb.vor.at/bin/"); private static final Product[] PRODUCTS_MAP = { Product.HIGH_SPEED_TRAIN, Product.SUBURBAN_TRAIN, Product.SUBWAY, null, Product.TRAM, Product.REGIONAL_TRAIN, Product.BUS, Product.BUS, Product.TRAM, Product.FERRY, Product.ON_DEMAND, Product.BUS, Product.REGIONAL_TRAIN, null, null, null }; private static final String DEFAULT_API_CLIENT = "{\"id\":\"VAO\",\"l\":\"vs_anachb\",\"type\":\"AND\"}"; public VorProvider(final String apiAuthorization) { this(DEFAULT_API_CLIENT, apiAuthorization); } public VorProvider(final String apiClient, final String apiAuthorization) { super(NetworkId.VOR, API_BASE, PRODUCTS_MAP); setApiVersion("1.18"); setApiExt("VAO.9"); setApiClient(apiClient); setApiAuthorization(apiAuthorization); setStyles(STYLES); } @Override public Set<Product> defaultProducts() { return Product.ALL; } private static final Pattern P_SPLIT_NAME_ONE_COMMA = Pattern.compile("([^,]*), ([^,]{3,64})"); @Override protected String[] splitStationName(final String name) { final Matcher m = P_SPLIT_NAME_ONE_COMMA.matcher(name); if (m.matches()) return new String[] { m.group(2), m.group(1) }; return super.splitStationName(name); } @Override protected String[] splitPOI(final String poi) { final Matcher m = P_SPLIT_NAME_ONE_COMMA.matcher(poi); if (m.matches()) return new String[] { m.group(2), m.group(1) }; return super.splitPOI(poi); } @Override protected String[] splitAddress(final String address) { final Matcher m = P_SPLIT_NAME_FIRST_COMMA.matcher(address); if (m.matches()) return new String[] { m.group(1), m.group(2) }; return super.splitAddress(address); } private static final Map<String, Style> STYLES = new HashMap<>(); static { // Wien STYLES.put("SS1", new Style(Style.Shape.ROUNDED, Style.parseColor("#1e5cb3"), Style.WHITE)); STYLES.put("SS2", new Style(Style.Shape.ROUNDED, Style.parseColor("#59c594"), Style.WHITE)); STYLES.put("SS3", new Style(Style.Shape.ROUNDED, Style.parseColor("#c8154c"), Style.WHITE)); STYLES.put("SS7", new Style(Style.Shape.ROUNDED, Style.parseColor("#dc35a3"), Style.WHITE)); STYLES.put("SS40", new Style(Style.Shape.ROUNDED, Style.parseColor("#f24d3e"), Style.WHITE)); STYLES.put("SS45", new Style(Style.Shape.ROUNDED, Style.parseColor("#0f8572"), Style.WHITE)); STYLES.put("SS50", new Style(Style.Shape.ROUNDED, Style.parseColor("#34b6e5"), Style.WHITE)); STYLES.put("SS60", new Style(Style.Shape.ROUNDED, Style.parseColor("#82b429"), Style.WHITE)); STYLES.put("SS80", new Style(Style.Shape.ROUNDED, Style.parseColor("#e96619"), Style.WHITE)); STYLES.put("UU1", new Style(Style.Shape.RECT, Style.parseColor("#c6292a"), Style.WHITE)); STYLES.put("UU2", new Style(Style.Shape.RECT, Style.parseColor("#a82783"), Style.WHITE)); STYLES.put("UU3", new Style(Style.Shape.RECT, Style.parseColor("#f39315"), Style.WHITE)); STYLES.put("UU4", new Style(Style.Shape.RECT, Style.parseColor("#23a740"), Style.WHITE)); STYLES.put("UU6", new Style(Style.Shape.RECT, Style.parseColor("#be762c"), Style.WHITE)); } }
The effect of continuous monaural noise on loudness matches to tinnitus. Data from two psychophysical tasks are presented. In the first, 8 subjects with sensorineural hearing loss and tinnitus adjusted the intensity of a continuous monaural noise to mask the tinnitus. In the second, in the presence of continuous monaural noise, the same subjects adjusted the intensity of a pulsed monaural tone to match the loudness of the tinnitus. The tone was either ipsilateral or contralateral to the noise. Although the noise level required to mask the tinnitus increased substantially, as did the level of the ipsilateral matching tone, the change in the level of the contralateral matching tone was minimal. One possible explanation of these findings is related to the functioning of the peripheral auditory system.
<filename>aulas/heranca/BancoDoBarasil/src/bb/ComparadorDeContasPorToString.java package bb; import java.util.Comparator; public class ComparadorDeContasPorToString implements Comparator<ContaInterface>{ @Override public int compare(ContaInterface o1, ContaInterface o2) { return o1.toString().compareTo(o2.toString()); } }
Time to audit audit Aprime reason for including audit in the recent NHS reforms was the immense variation of clinical practice, outcome, resource utilisation, and other measures of performance among hospitals. Britain may take comfort from the fact that despite the numerous indictments of its health service, it is one of the few countries boasting anything approaching uniform health care. But diversities do occurthe management of breast cancer is one exampleand audit presented an opportunity to improve the performance of the under-performers. Two types of audit, often confused, were implied in the 1990 white paper, Working for Patients. The first, practised for many years, focused on morbidity and mortality in which deaths, complications, problems with admissions, and delays in discharge were discussed. The reforms made this type of audit compulsory for all cliniciansit is meant to happen once a month during the working day. This has resulted in the loss of one session from each clinical team every month, equivalent to closing the hospital for one day every two months to all but emergencies. Adverse events monitoring has its proponents, but one shortcoming is that lack of adverse events does not necessarily mean good practice or satisfactory outcome. Too many events are audited, no clear goals are set,
<reponame>tfheen/rkeep use std::io::Write; use std::process::{Command, Stdio}; pub fn password(cmd: &Vec<String>) -> Result<String, Box<dyn std::error::Error>> { let output = Command::new(&cmd[0]).args(&cmd[1..]).output()?; let password = String::from_utf8(output.stdout)?.trim().to_string(); Ok(password) } pub fn list( cmd: &Vec<String>, entries: &Vec<String>, ) -> Result<String, Box<dyn std::error::Error>> { let mut child = Command::new(&cmd[0]) .args(&cmd[1..]) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .spawn()?; { let stdin = child.stdin.as_mut().ok_or("Failed to open stdin.")?; stdin.write_all(entries.join("\n").as_bytes())?; } let output = child.wait_with_output()?; let entry = String::from_utf8(output.stdout)?.trim().to_string(); if entry.is_empty() { Err("None chosen.")? } Ok(entry) }
A fast Kalman filter for images degraded by both blur and noise An optimal line-by-line recursive Kalman filter is derived for restoring images which are degraded in a deterministic way by linear blur and in a stochastic way by additive white noise. To reduce the computational and storage burden imposed by this line-by-line recursive Kalman filter circulant matrix approximations are made in order to diagonalize - by means of the fast Fourier transform (FFT) - both the model matrices and the distortion matrix in the dynamical model of the total image-recording system. Then the dynamical model reduces to a set of N decoupled equations and the line-by-line recursive Kalman filter based on this model reduces to a set of N scalar Kalman filters suitable for parallel processing of the data in the Fourier domain. Finally, via an inverse FFT the filtered data is presented in the data domain. The total number of computations for an NN image reduces from the order of 0(N4) to 0(N^{2}\log_{2}N).
Q: Could a mathematical constant actually change? (Note: I have a degree in mathematics, but this question goes a bit beyond that.) Take a value like pi ($\pi$). Only a mere handful of decimals is all we could empirically verify to be "true" (measuring the roundest object we could construct, for example). What if one decimal, say the billion billion billionth one (or somewhere beyond where the current record is), actually changes with time? We could compute it with some numerical method on a computer and realize this decimal seems to differ "every" time we do the computations. Maybe a god is fiddling with it. Could there be any practical effects, and does it make any sense? What could such a discovery possibly imply? A: The question you ask is not really the question you seek. The answer to what you asked is boringly simple: "No, a mathematical constant cannot change because mathematical constants are defined to be not changing." While there are some philosophical questions about whether mathematics could indeed be the underpinnings of reality, mathematics is more commonly treated as a thing we created to make sense of the universe. If we decided that π is a constant, it indeed is a constant because we defined it thus. The more interesting question is the empirical one you are looking at. What if the mathematical relationships that are valid at one moment are sightly invalid in the next. This is a slightly more nuanced question. It's asking "If I hypothetically had a perfectly circular object, and measured the ratio of its circumference to its diameter, would it change over time?" The limit to this, of course, is our ability to make circular objects. We live in 3-space, not flatland, so maybe a sphere is a better choice: This beauty is the most spherical object we have ever created. No, not Achim Leistner's balding head -- the silicon sphere in front of him. It's part of Project Avagadro, an effort to fix the mass of the kilogram to something other than a particular lump of platinum-iridium sitting in a vault in France. Liestner is the head optician of the effort, and his spheres are incredibly spherical (a 93.6mm sphere that's 35nm out of spherical -- roughly 370 parts per billion out of spherical!) So we can see that we're not going to notice a change in a billionths place with anything we can make. We can get about 7 or 8 decimal places at the most. But what if we look bigger? It turns out that space is big. Really big. So mindbogglingly big that even mathematicians have trouble comprehending how enormously big it is. It's also really old. Really really old. In my opinion, it's not quite as mindbogglingly old as it is mindbogglingly big, but you get the idea. Small changes have... substantial implications. Consider two objects that are at rest in the same reference frame, with no forces acting on them (you counteracted gravity, somehow). You measure their distance to be exactly 1000mm apart. Don't ask me how you did it. Now go measure their distance apart again. Is it 1000mm? No. It's not. It's actually slightly larger. Why? Because of the expansion of space. If you were to assume that the "space" that we measure in is reality, you would find that that implies that space is growing at a constant rate. If you made your measurements 1 second apart, you would find the second measurement to be 1000.0000000000000022685455mm, give or take a few quintilionths. What does this imply? Lots of things. For example, energy is not precisely conserved in an expanding space like this. All your energy balances are going to be slightly off. But, if you think about it, you really don't notice these effects. They are easily dominated by other effects. A classic question is "is the expansion of space causing LA and New York to drift apart," to which the answer is no. If you fixed two points in space (one over LA and one over NY at an epoch), those points in space would drift. But these effects are much weaker than the electrostatic forces holding our planet together. LA and NY will stay put... or at least stay put as much as their tectonic plates permit. So you asked what would happen if some constant were to change slowly in the billionth decimal place or something. Would that make any sense? The answer turns out to be "Yes, it makes sense, and we have it in our reality today!" The expansion of space is a slow change in "fixed constants" that astronomers have to account for. However, practically speaking, it isn't all that important. Of course, an open question would be what if such tweaked values were actually under the control of some external entity like a deity, with intent. In such cases, it's far less clear whether this would matter or not. It's possible that that billionth digit is all the control this deity needs to shape the universe as they see fit. After all, the universe is a big place. Billions and billions of stars. Rounding errors can add up!
<filename>src/service_framework/connections/__init__.py """ Something whitty """
An NMR study on the conformation of the chromomycin-d(GGGGCCCC)2 complex. The conformation of the chromomycin-d(GGGGCCCC)2 complex in aqueous solution was studied by NMR spectroscopy. The NMR spectrum of the complex indicated that the chromomycin binds as a symmetry-related dimer to the minor groove of the central four residues of d(GGGGCCCC)2. The drastic conformational change in the central four residues of d(GGGGCCCC)2 from the B form family to the A-form was demonstrated by the characteristic NOEs and coupling patterns. The change seems to be indispensable for accommodation of the bulky chromomycin dimer in the minor groove. On the basis of the intermolecular NOEs between chromomycin and d(GGGGCCCC)2, the structure of the complex has been constructed and refined by energy minimization.
/** ** check two objects are equal. */ int aloV_equal(astate T, const atval_t* t1, const atval_t* t2) { if (ttype(t1) == ttype(t2)) { switch (ttype(t1)) { case ALO_TNIL : return true; case ALO_TBOOL : return tgetbool(t1) == tgetbool(t2); case ALO_TINT : return tgetint(t1) == tgetint(t2); case ALO_TFLOAT : return tgetflt(t1) == tgetflt(t2); case ALO_TPOINTER: return tgetptr(t1) == tgetptr(t2); case ALO_THSTRING: return aloS_hequal(tgetstr(t1), tgetstr(t2)); case ALO_TISTRING: return tgetstr(t1) == tgetstr(t2); case ALO_TTUPLE : { if (tgettup(t1) == tgettup(t2)) return true; break; } case ALO_TLIST : { if (tgetlis(t1) == tgetlis(t2)) return true; break; } case ALO_TTABLE : { if (tgettab(t1) == tgettab(t2)) return true; break; } case ALO_TRAWDATA: { if (tgetrdt(t1) == tgetrdt(t2)) return true; break; } case ALO_TLCF : return tgetlcf(t1) == tgetlcf(t2); case ALO_TCCL : return tgetclo(t1) == tgetclo(t2); case ALO_TACL : return tgetclo(t1) == tgetclo(t2); case ALO_TTHREAD : return tgetthr(t1) == tgetthr(t2); default: aloE_xassert(false); return false; } if (T == NULL) { return false; } const atval_t* meta = aloT_fastgetx(T, t1, TM_EQ); return meta && aloT_callcmp(T, meta, t1, t2); } else { if (ttisnum(t1) && ttisnum(t2)) { aint v1, v2; return aloV_toint(t1, v1) && aloV_toint(t2, v2) && v1 == v2; } return false; } }