content
stringlengths
7
2.61M
Characterization of Al/SiC Nanocomposite Prepared by Mechanical Alloying Process Using Artificial Neural Network Model An artificial neural network model was developed for modeling of the effects of mechanical alloying process parameters including milling time, milling speed, and ball-to-powder weight ratio on the crystallite size and lattice strain of the aluminum for Al/SiC nanocomposite powders. A Multilayer Perceptron (MLP) and Radial Basis Function (RBF) networks were used. It was found that MLP network yields better results compared to RBF network with a high correlation coefficients. The neural network model in agreement with other experimental results and theories was shown the variations of the crystallite size and lattice strain of the aluminum against the process parameters.
package com.alipay.api.domain; import java.util.Date; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 用户付款码皮肤信息 * * @author <NAME> * @since 1.0, 2021-09-23 18:00:32 */ public class UserFacePaySkinInfo extends AlipayObject { private static final long serialVersionUID = 3855134935978488424L; /** * 支持该皮肤的客户端最低版本 */ @ApiField("client_version_limit") private String clientVersionLimit; /** * 北京时间0点过期的日期(yyyy-MM-dd) 若未领取/未授权 字段为空 */ @ApiField("expire_date") private Date expireDate; /** * 皮肤名称001 */ @ApiField("name") private String name; /** * 皮肤ID */ @ApiField("skin_id") private String skinId; /** * 0-未授权时状态 1-未领取 2-已领取&未设置 3-已领取&已设置 */ @ApiField("status") private String status; /** * 缩略图 */ @ApiField("thumbnail") private String thumbnail; public String getClientVersionLimit() { return this.clientVersionLimit; } public void setClientVersionLimit(String clientVersionLimit) { this.clientVersionLimit = clientVersionLimit; } public Date getExpireDate() { return this.expireDate; } public void setExpireDate(Date expireDate) { this.expireDate = expireDate; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getSkinId() { return this.skinId; } public void setSkinId(String skinId) { this.skinId = skinId; } public String getStatus() { return this.status; } public void setStatus(String status) { this.status = status; } public String getThumbnail() { return this.thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } }
Reproducing Kernel Method for Fourth Order Singularly Perturbed Boundary Value Problem In this paper, reproducing kernel method is proposed for solving singularly perturbed fourth order boundary value problem in 5 2 W. The exact solutions are given in the form of series. By truncating the series, the app-roximate solutions is obtained. The errors of the approximate solutions are monotone decreasing with the increasing of nodal points. It is observed that our approach produce better numerical solutions in the sense that maximum absolute error | ei| is a minimum. Results of numerical examples demonstrate that the method is quite accurate and efficient for fourth order singular perturbed BVPs. Numerical illustrations are tabulated to demonstrate the practical usefulness of method.
I. Field of Invention This invention relates to the production of ammonium phosphate. In particular, this invention relates to a process for making ammonium phosphates such as mono- and di-ammonium phosphates that are substantially free of arsenic from crude phosphoric acid. II. Description of the Prior Art For many commercial applications today, it is desirable to prepare ammonium phosphates from phosphoric acid. However, the cost involved when starting with highly pure grades of phosphoric acids (e.g., thermal grade acid) is normally too high to be economically advantageous. Therefore, it is necessary to explore the possibilities of employing cheaper phosphoric acid (e.g., wet process acid) to make ammonium phosphates. However, the employment of these less expensive grades of phosphoric acid may result in the ammonium phosphate products containing more impurities. In many instances these impurities are objectionable. For example, ammonium phosphate containing dissolved arsenic such as elemental arsenic, salts containing arsenic ions, chemical complexes containing arsenic and the like cannot be used for food or industrial grade applications. Instead such arsenic-containing ammonium phosphates are limited to less commercially attractive uses such as fertilizers and the like. Thus, because of this arsenic impurity problem, effective usage of the cruder grades of phosphoric acid as a starting material for making ammonium phosphate may be hindered. A need exists in the art to develop a process for making ammonium phosphate products having relatively low levels of arsenic from these less expensive grades of phosphoric acid. The present invention provides such a process. The usual prior art process for making ammonium phosphate products from relatively pure phosphoric acid, as illustrated in U.S. Pat. No. 3,388,966, issued on June 18, 1968 to R. A. MacDonald, is to (1) ammoniate the phosphoric acid to form ammonium phosphate products and insoluble matter, (2) filter off the undesirable insoluble matter, (3) crystallize the ammonium phosphate products from the mother liquor and (4) recover these crystals. While this process is acceptable for producing arsenic-free ammonium phosphate products from relatively pure phosphoric acid, it cannot be used to produce arsenic-free ammonium phosphate from phosphoric acid containing large amounts of dissolved arsenic. Instead, this arsenic may co-crystallize with the ammonium phosphate products and prevent the latter's use as a food or industrial grade ammonium phosphates. The prior art also teaches that dissolved arsenic can be removed from crude phosphoric acid by adding barium sulfide to precipitate the arsenic. See U.S. Pat. No. 2,044,940, issued on June 23, 1936 to I. L. Haag and W. R. Devor. One of the problems with this process is that an additional filtration step is also used to remove the resulting arsenic precipitates immediately after addition of the barium sulfide. This filtration step increases the cost of the overall ammonium phosphate process because extra solids-handling steps must now be included. Also, as explained below, the employment of barium sulfide may decrease the amount of P.sub.2 O.sub.5 in the ammonium phosphate product.
<gh_stars>0 # -*- coding: utf-8 -*- """This module provides an implementation of Adam.""" import warnings from base import Minimizer from mathadapt import sqrt, ones_like, clip class Adam(Minimizer): """Adaptive moment estimation optimizer. (Adam). Adam is a method for the optimization of stochastic objective functions. The idea is to estimate the first two moments with exponentially decaying running averages. Additionally, these estimates are bias corrected which improves over the initial learning steps since both estimates are initialized with zeros. The rest of the documentation follows the original paper [adam2014]_ and is only meant as a quick primer. We refer to the original source for more details, such as results on convergence and discussion of the various hyper parameters. Let :math:`f_t'(\\theta_t)` be the derivative of the loss with respect to the parameters at time step :math:`t`. In its basic form, given a step rate :math:`\\alpha`, a decay term :math:`\\lambda`, decay terms :math:``\\beta_1`` and :math:``\\beta_2`` for the first and seconed moment estimates repsectively and an offset :math:`\\epsilon` we initialise the following quantities .. math:: m_0 & \\leftarrow 0 \\\\ v_0 & \\leftarrow 0 \\\\ t & \\leftarrow 0 \\\\ and perform the following updates: .. math:: t & \\leftarrow t + 1 \\\\ \\beta_{1, t} & \\leftarrow 1 - (1 - \\beta_1)\\lambda^{t-1} \\\\ g_t & \\leftarrow f_t'(\\theta_{t-1}) \\\\ m_t & \\leftarrow \\beta_{1,t} \cdot g_t + (1 - \\beta_{1, t}) \cdot m_{t-1} \\\\ v_t &\\leftarrow \\beta_2 \cdot g_t^2 + (1 - \\beta_2) \cdot v_{t-1} \\hat{m}_t &\\leftarrow {m_t \\over (1 - (1 - \\beta_1)^t)} \\\\ \\hat{v}_t &\\leftarrow {v_t \\over (1 - (1 - \\beta_2)^t)} \\\\ \\theta_t &\\leftarrow \\theta_{t-1} - \\alpha {\\hat{m}_t \\over (\\sqrt{\\hat{v}_t} + \\epsilon)} The quantities in the algorithm and their corresponding attributes in the optimizer object are as follows. ======================= =================== =========================================================== Symbol Attribute Meaning ======================= =================== =========================================================== :math:`t` ``n_iter`` Number of iterations, starting at 0. :math:`m_t` ``est_mom_1_b`` Biased estimate of first moment. :math:`v_t` ``est_mom_2_b`` Biased estimate of second moment. :math:`\\hat{m}_t` ``est_mom_1`` Unbiased estimate of first moment. :math:`\\hat{v}_t` ``est_mom_2`` Unbiased estimate of second moment. :math:`\\alpha` ``step_rate`` Step rate parameter. :math:`\\beta_1` ``decay_mom1`` Exponential decay parameter for first moment estimate. :math:`\\beta_2` ``decay_mom2`` Exponential decay parameter for second moment estimate. :math:`\\epsilon` ``offset`` Safety offset for division by estimate of second moment. :math:`\\lambda` ``decay`` n/a ======================= =================== =========================================================== .. [adam2014] Kingma, Diederik, and <NAME>. "Adam: A Method for Stochastic Optimization." arXiv preprint arXiv:1412.6980 (2014). """ state_fields = 'n_iter step_rate decay decay_mom1 decay_mom2 step offset est_mom1_b est_mom2_b'.split() def __init__(self, wrt, fprime, step_rate=.0002, decay=1-1e-8, decay_mom1=0.1, decay_mom2=0.001, momentum=0, offset=1e-8, args=None): """Create an Adam object. Parameters ---------- wrt : array_like Array that represents the solution. Will be operated upon in place. ``fprime`` should accept this array as a first argument. fprime : callable Callable that given a solution vector as first parameter and *args and **kwargs drawn from the iterations ``args`` returns a search direction, such as a gradient. step_rate : scalar or array_like, optional [default: 1] Value to multiply steps with before they are applied to the parameter vector. decay : float, optional [default: 1e-8] Decay parameter for the moving average. Must lie in [0, 1) where lower numbers means a shorter "memory". decay_mom1 : float, optional, [default: 0.1] Decay parameter for the exponential moving average estimate of the first moment. decay_mom2 : float, optional, [default: 0.001] Decay parameter for the exponential moving average estimate of the second moment. momentum : float or array_like, optional [default: 0] Momentum to use during optimization. Can be specified analoguously (but independent of) step rate. offset : float, optional, [default: 1e-8] Before taking the square root of the running averages, this offset is added. args : iterable Iterator over arguments which ``fprime`` will be called with. """ if not 0 < decay < 1: raise ValueError('decay has to lie in (0, 1)') if not 0 < decay_mom1 <= 1: raise ValueError('decay_mom1 has to lie in (0, 1]') if not 0 < decay_mom2 <= 1: raise ValueError('decay_mom2 has to lie in (0, 1]') if not (1 - decay_mom1 * 2) / (1 - decay_mom2) ** 0.5 < 1: warnings.warn("constraint from convergence analysis for adam not " "satisfied; check original paper to see if you " "really want to do this.") super(Adam, self).__init__(wrt, args=args) self.fprime = fprime self.step_rate = step_rate self.decay = decay self.decay_mom1 = decay_mom1 self.decay_mom2 = decay_mom2 self.offset = offset self.momentum = momentum self.est_mom1 = 0 self.est_mom2 = 0 self.est_mom1_b = 0 self.est_mom2_b = 0 self.step = 0 def _iterate(self): for args, kwargs in self.args: m = self.momentum d = self.decay dm1 = self.decay_mom1 dm2 = self.decay_mom2 o = self.offset t = self.n_iter + 1 step_m1 = self.step step1 = step_m1 * m * self.step_rate self.wrt -= step1 est_mom1_b_m1 = self.est_mom1_b est_mom2_b_m1 = self.est_mom2_b coeff1 = 1 - (1 - dm1) * d ** (t - 1) gradient = self.fprime(self.wrt, *args, **kwargs) self.est_mom1_b = coeff1 * gradient + (1 - coeff1) * est_mom1_b_m1 self.est_mom2_b = dm2 * gradient ** 2 + (1 - dm2) * est_mom2_b_m1 self.est_mom1 = self.est_mom1_b / (1 - (1 - dm1) ** t + o) self.est_mom2 = self.est_mom2_b / (1 - (1 - dm2) ** t + o) step2 = self.step_rate * self.est_mom1 / ((self.est_mom2) ** 0.5 + o) self.wrt -= step2 self.step = step1 + step2 self.n_iter += 1 yield { 'n_iter': self.n_iter, 'gradient': gradient, 'args': args, 'kwargs': kwargs, }
a=int(input()) for _ in range(a): b,c,d,e=map(int,input().split()) f=b%2+c%2+d%2+e%2 if f==0 or f==4 or f==1: print('Yes') elif f==3 and b*c*d!=0: print('Yes') else :print('No')
def widthsrc(self): return self["widthsrc"]
/*! \brief * Allocates memory for the compiler data and initializes the structure. * * \param sel Root of the selection subtree to process. */ static void init_item_compilerdata(t_selelem *sel) { t_selelem *child; snew(sel->cdata, 1); sel->cdata->evaluate = sel->evaluate; sel->cdata->flags = SEL_CDATA_STATICEVAL; if (!(sel->flags & SEL_DYNAMIC)) { sel->cdata->flags |= SEL_CDATA_STATIC; } if (sel->type == SEL_SUBEXPR) { sel->cdata->flags |= SEL_CDATA_EVALMAX; } if (sel->type == SEL_EXPRESSION || sel->type == SEL_MODIFIER) { child = sel->child; while (child) { if (!(child->flags & SEL_ATOMVAL) && child->child) { child->child->cdata->flags |= SEL_CDATA_FULLEVAL; } child = child->next; } } else if (sel->type == SEL_ROOT && sel->child->type == SEL_SUBEXPRREF) { sel->child->child->cdata->flags |= SEL_CDATA_FULLEVAL; } if (sel->type != SEL_SUBEXPRREF) { child = sel->child; while (child) { init_item_compilerdata(child); child = child->next; } } if (sel->type == SEL_BOOLEAN) { gmx_bool bEvalMax; bEvalMax = (sel->u.boolt == BOOL_AND); child = sel->child; while (child) { if (bEvalMax) { child->cdata->flags |= SEL_CDATA_EVALMAX; } else if (child->type == SEL_BOOLEAN && child->u.boolt == BOOL_NOT) { child->child->cdata->flags |= SEL_CDATA_EVALMAX; } child = child->next; } } else if (sel->type == SEL_EXPRESSION || sel->type == SEL_MODIFIER || sel->type == SEL_SUBEXPR) { child = sel->child; while (child) { child->cdata->flags |= SEL_CDATA_EVALMAX; child = child->next; } } }
House Republicans on Friday accused Treasury Secretary Jacob Lew of obstructing their investigation into the IRS’s targeting of tea party and conservative groups, and issued subpoenas for more agency documents. Oversight committee chairman Darrell Issa, California Republican, sent a scathing latter to Mr. Lew blasting him and President Obama for dismissing the GOP’s claims about IRS targeting as a “phony” scandal, saying that Mr. Lew has “attempted to thwart” his investigation. “Over two months since the committee first requested documents, the IRS has produced only a small fraction of responsive documents,” Mr. Issa said. The IRS is an agency within the Treasury Department. Mr. Issa said he’s willing to work with the agency to tailor his requests for information, but he said the IRS has unilaterally decided to revise the scope of its search of documents. The committee had asked for 81 search terms to be used to identify responsive documents, but the IRS cut that to 12, he said. In a response sent Friday to an earlier accusation by Mr. Issa and Rep. Jim Jordan, a subcommittee chairman who is also heading the investigation, the IRS bristles at accusations it was stonewalling. Daniel Werfel, the acting commissioner President Obama tapped to lead the agency, said they are working as fast as they can to produce materials, including having detailed 70 of the agency’s 1,600 lawyers to work full time on reviewing documents to see what can be turned over. “These attorneys have ramped up from training to full-time review work over the course of the last four weeks and are now fully engaged on this project,” Mr. Werfel wrote. He also defended the agency’s move to cut out some of the search terms the committee requested, saying that words such as “c3” and “election” are “generic and non-specific” and are used in many tax issues the agency handles. Also Friday, the House voted 232-185 to strip the Treasury Department and IRS of being able to enforce the new health care law. The vote saw just four Democrats side with Republicans in trying to scrap the IRS’s role. The Senate is unlikely to consider the bill. The IRS came under scrutiny when its auditor reported earlier this year that the agency had singled out groups with “tea party,” “patriot” or “9/12” in their names for special scrutiny when the groups applied for tax-exempt status. The IRS has acknowledged it asked inappropriate and intrusive questions of the conservative groups. Democrats argue that progressive groups were also targeted, though it appears not to the same inclusive level as conservatives. Republican lawmakers have argued the IRS targeting took its cue from President Obama’s policies — though there has been no evidence so far linking the president or the White House to the agency’s decision to give applications extra scrutiny. Several congressional panels are still investigating, however. Some of the delays in turning over documents appear to be massive bungles. In one instance, the committee was looking for documents from IRS employee Cindy Thomas, who turned over a disk to the agency so that the documents could be scrubbed of protected taxpayer information. But the disk was password protected, and she “was unable to provide the password,” Mr. Werfel said. He said she provided a new disk nearly a week later, when it was already too late to produce the documents ahead of her scheduled interview with the committee. The two sides are even sparring over how many documents are relevant. Mr. Issa said at one point the IRS told him there were 65 million documents that might be subject to being turned over, but the agency now says the number is less than 1 million — and likely in the range of about half a million. Still, even at that lower figure, the agency has turned over just 3 percent of those documents, according to Republicans on another panel, the House Ways and Means Committee.
<reponame>michaelmelanson/pwned-rs use std::io::{Read, BufRead, Cursor}; use reqwest; use reqwest::{Response, StatusCode}; use reqwest::header::{HeaderMap, HeaderName, HeaderValue, USER_AGENT}; use sha1::{Sha1}; use serde_json::{from_str}; use errors::*; use model::*; static MAIN_API_URL : &'static str = "https://haveibeenpwned.com/api/"; static RANGE_API_URL : &'static str = "https://api.pwnedpasswords.com/range/"; static DEFAULT_USER_AGENT : &'static str = "wisespace-io"; #[derive(Builder, Debug, PartialEq)] pub struct Pwned { #[builder(setter(into), default = "self.default_user_agent()")] pub user_agent: String } impl PwnedBuilder { fn default_user_agent(&self) -> String { if let Some(ref user_agent) = self.user_agent { format!("{}", user_agent) } else { DEFAULT_USER_AGENT.to_string() } } } impl Pwned { pub fn check_password<P>(&self, password: P) -> Result<(Password)> where P: Into<String> { let mut sha1 = Sha1::new(); sha1.update(password.into().as_bytes()); let hash = sha1.digest().to_string(); let (prefix, suffix) = hash.split_at(5); let url = format!("{}{}", RANGE_API_URL, prefix); match self.get(url) { Ok(answer) => { let cursor = Cursor::new(answer); for line in cursor.lines() { let value = line.unwrap().to_lowercase(); if value.contains(suffix) { let v: Vec<&str> = value.split(":").collect(); return Ok(Password {found: true, count: v[1].parse::<u64>().unwrap()}); } } Ok(Password {found: false, count: 0}) }, Err(e) => Err(e), } } pub fn check_email<E>(&self, email: E) -> Result<(Vec<Breach>)> where E: Into<String> { let url = format!("{}breachedaccount/{}", MAIN_API_URL, email.into()); match self.get(url) { Ok(answer) => { let breach: Vec<Breach> = from_str(answer.as_str()).unwrap(); Ok(breach) }, Err(e) => Err(e), } } fn get(&self, url: String) -> Result<String> { let mut custon_headers = HeaderMap::new(); custon_headers.insert(USER_AGENT, HeaderValue::from_str(self.user_agent.as_str())?); custon_headers.insert(HeaderName::from_static("api-version"), HeaderValue::from_static("2")); let client = reqwest::Client::new(); let response = client .get(url.as_str()) .headers(custon_headers) .send()?; self.handler(response) } fn handler(&self, mut response: Response) -> Result<(String)> { match response.status() { StatusCode::OK => { let mut body = String::new(); response.read_to_string(&mut body)?; Ok(body) }, StatusCode::NOT_FOUND => { bail!(format!("The account could not be found and has therefore not been pwned")); } status => { bail!(format!("{:?}", status)); } } } }
<reponame>zealoussnow/chromium<filename>fuchsia/engine/common/web_engine_url_loader_throttle.cc // Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "fuchsia/engine/common/web_engine_url_loader_throttle.h" #include <string> #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "fuchsia/engine/common/cors_exempt_headers.h" #include "net/base/net_errors.h" #include "services/network/public/cpp/resource_request.h" #include "url/url_constants.h" namespace { // Returnns a string representing the URL stripped of query and ref. std::string ClearUrlQueryRef(const GURL& url) { GURL::Replacements replacements; replacements.ClearQuery(); replacements.ClearRef(); return url.ReplaceComponents(replacements).spec(); } void ApplySubstituteQueryPattern( network::ResourceRequest* request, const mojom::UrlRequestRewriteSubstituteQueryPatternPtr& substitute_query_pattern) { std::string url_query = request->url.query(); base::ReplaceSubstringsAfterOffset(&url_query, 0, substitute_query_pattern->pattern, substitute_query_pattern->substitution); GURL::Replacements replacements; replacements.SetQueryStr(url_query); request->url = request->url.ReplaceComponents(replacements); } void ApplyReplaceUrl(network::ResourceRequest* request, const mojom::UrlRequestRewriteReplaceUrlPtr& replace_url) { if (!base::EndsWith(ClearUrlQueryRef(request->url), replace_url->url_ends_with, base::CompareCase::SENSITIVE)) return; GURL new_url = replace_url->new_url; if (new_url.SchemeIs(url::kDataScheme)) { request->url = new_url; return; } if (new_url.has_scheme() && new_url.scheme().compare(request->url.scheme()) != 0) { // No cross-scheme redirect allowed. return; } GURL::Replacements replacements; std::string host = new_url.host(); replacements.SetHostStr(host); std::string port = new_url.port(); replacements.SetPortStr(port); std::string path = new_url.path(); replacements.SetPathStr(path); request->url = request->url.ReplaceComponents(replacements); } void ApplyRemoveHeader( network::ResourceRequest* request, const mojom::UrlRequestRewriteRemoveHeaderPtr& remove_header) { absl::optional<std::string> query_pattern = remove_header->query_pattern; if (query_pattern && request->url.query().find(query_pattern.value()) == std::string::npos) { // Per the FIDL API, the header should be removed if there is no query // pattern or if the pattern matches. Neither is true here. return; } request->headers.RemoveHeader(remove_header->header_name); request->cors_exempt_headers.RemoveHeader(remove_header->header_name); } void ApplyAppendToQuery( network::ResourceRequest* request, const mojom::UrlRequestRewriteAppendToQueryPtr& append_to_query) { std::string url_query; if (request->url.has_query() && !request->url.query().empty()) url_query = request->url.query() + "&"; url_query += append_to_query->query; GURL::Replacements replacements; replacements.SetQueryStr(url_query); request->url = request->url.ReplaceComponents(replacements); } bool HostMatches(const base::StringPiece& url_host, const base::StringPiece& rule_host) { const base::StringPiece kWildcard("*."); if (base::StartsWith(rule_host, kWildcard, base::CompareCase::SENSITIVE)) { if (base::EndsWith(url_host, rule_host.substr(1), base::CompareCase::SENSITIVE)) { return true; } // Check |url_host| is exactly |rule_host| without the wildcard. i.e. if // |rule_host| is "*.test.xyz", check |url_host| is exactly "test.xyz". return base::CompareCaseInsensitiveASCII(url_host, rule_host.substr(2)) == 0; } return base::CompareCaseInsensitiveASCII(url_host, rule_host) == 0; } // Returns true if the host and scheme filters defined in |rule| match // |request|. bool RuleFiltersMatchRequest(network::ResourceRequest* request, const mojom::UrlRequestRulePtr& rule) { const GURL& url = request->url; if (rule->hosts_filter) { bool found = false; for (const base::StringPiece host : rule->hosts_filter.value()) { if ((found = HostMatches(url.host(), host))) break; } if (!found) return false; } if (rule->schemes_filter) { bool found = false; for (const auto& scheme : rule->schemes_filter.value()) { if (url.scheme().compare(scheme) == 0) { found = true; break; } } if (!found) return false; } return true; } // Returns true if |request| is either allowed or left unblocked by any rules. bool IsRequestAllowed(network::ResourceRequest* request, const mojom::UrlRequestRewriteRulesPtr& rules) { for (const auto& rule : rules->rules) { if (rule->actions.size() != 1) continue; if (rule->actions[0]->which() != mojom::UrlRequestAction::Tag::POLICY) continue; if (!RuleFiltersMatchRequest(request, rule)) continue; switch (rule->actions[0]->get_policy()) { case mojom::UrlRequestAccessPolicy::kAllow: return true; case mojom::UrlRequestAccessPolicy::kDeny: return false; } } return true; } } // namespace WebEngineURLLoaderThrottle::WebEngineURLLoaderThrottle( scoped_refptr<url_rewrite::UrlRequestRewriteRules> rules) : rules_(rules) { DCHECK(rules_); } WebEngineURLLoaderThrottle::~WebEngineURLLoaderThrottle() = default; void WebEngineURLLoaderThrottle::DetachFromCurrentSequence() {} void WebEngineURLLoaderThrottle::WillStartRequest( network::ResourceRequest* request, bool* defer) { if (!IsRequestAllowed(request, rules_->data)) { delegate_->CancelWithError(net::ERR_ABORTED, "Resource load blocked by embedder policy."); return; } for (const auto& rule : rules_->data->rules) ApplyRule(request, rule); *defer = false; } bool WebEngineURLLoaderThrottle::makes_unsafe_redirect() { // WillStartRequest() does not make cross-scheme redirects. return false; } void WebEngineURLLoaderThrottle::ApplyRule( network::ResourceRequest* request, const mojom::UrlRequestRulePtr& rule) { if (!RuleFiltersMatchRequest(request, rule)) return; for (const auto& rewrite : rule->actions) ApplyRewrite(request, rewrite); } void WebEngineURLLoaderThrottle::ApplyRewrite( network::ResourceRequest* request, const mojom::UrlRequestActionPtr& rewrite) { switch (rewrite->which()) { case mojom::UrlRequestAction::Tag::ADD_HEADERS: ApplyAddHeaders(request, rewrite->get_add_headers()); return; case mojom::UrlRequestAction::Tag::REMOVE_HEADER: ApplyRemoveHeader(request, rewrite->get_remove_header()); return; case mojom::UrlRequestAction::Tag::SUBSTITUTE_QUERY_PATTERN: ApplySubstituteQueryPattern(request, rewrite->get_substitute_query_pattern()); return; case mojom::UrlRequestAction::Tag::REPLACE_URL: ApplyReplaceUrl(request, rewrite->get_replace_url()); return; case mojom::UrlRequestAction::Tag::APPEND_TO_QUERY: ApplyAppendToQuery(request, rewrite->get_append_to_query()); return; case mojom::UrlRequestAction::Tag::POLICY: // "Policy" is interpreted elsewhere; it is a no-op for rewriting. return; } NOTREACHED(); // Invalid enum value. } void WebEngineURLLoaderThrottle::ApplyAddHeaders( network::ResourceRequest* request, const mojom::UrlRequestRewriteAddHeadersPtr& add_headers) { // Bucket each |header| into the regular/CORS-compliant header list or the // CORS-exempt header list. for (const auto& header : add_headers->headers) { if (request->headers.HasHeader(header->name) || request->cors_exempt_headers.HasHeader(header->name)) { // Skip headers already present in the request at this point. continue; } if (IsHeaderCorsExempt(header->name)) { request->cors_exempt_headers.SetHeader(header->name, header->value); } else { request->headers.SetHeader(header->name, header->value); } } }
<filename>src/main/java/com/jaamsim/units/Unit.java /* * JaamSim Discrete Event Simulation * Copyright (C) 2011 Ausenco Engineering Canada Inc. * Copyright (C) 2018-2019 JaamSim Software Inc. * * 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 com.jaamsim.units; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import com.jaamsim.basicsim.Entity; import com.jaamsim.basicsim.JaamSimModel; import com.jaamsim.basicsim.ObjectType; import com.jaamsim.input.Input; import com.jaamsim.input.Keyword; public abstract class Unit extends Entity { @Keyword(description = "Factor to convert from the specified unit to the System International " + "(SI) unit. The factor is entered as A / B, where A is the first entry " + "and B is the second. For example, to convert from miles per hour to " + "m/s, the first factor is 1609.344 (meters in one mile) and the second " + "factor is 3600 (seconds in one hour).", exampleList = {"1609.344 3600"}) private final SIUnitFactorInput conversionFactorToSI; { conversionFactorToSI = new SIUnitFactorInput("ConversionFactorToSI", KEY_INPUTS); this.addInput(conversionFactorToSI); } public Unit() {} private static final HashMap<Class<? extends Unit>, String> siUnit = new HashMap<>(); public static final void setSIUnit(Class<? extends Unit> unitType, String si) { siUnit.put(unitType, si); } /** * Get the SI unit for the given unit type. * @param unitType * @return a string describing the SI unit, or if one has not been defined: 'SI' */ public static final String getSIUnit(Class<? extends Unit> unitType) { String unit = siUnit.get(unitType); if (unit != null) return unit; return "SI"; } /** * Return the conversion factor to SI units */ public double getConversionFactorToSI() { return conversionFactorToSI.getSIFactor(); } /** * Return the conversion factor to the given units */ public double getConversionFactorToUnit( Unit unit ) { double f1 = this.getConversionFactorToSI(); double f2 = unit.getConversionFactorToSI(); return f1 / f2 ; } public static ArrayList<String> getUnitTypeList(JaamSimModel simModel) { ArrayList<String> list = new ArrayList<>(); for (ObjectType each: simModel.getClonesOfIterator(ObjectType.class)) { Class<? extends Entity> klass = each.getJavaClass(); if (klass == null) continue; if (Unit.class.isAssignableFrom(klass)) list.add(each.getName()); } Collections.sort(list, Input.uiSortOrder); return list; } public static <T extends Unit> ArrayList<T> getUnitList(JaamSimModel model, Class<T> ut) { ArrayList<T> ret = new ArrayList<>(); for (T u: model.getClonesOfIterator(ut)) { ret.add(u); } Collections.sort(ret, Unit.unitSortOrder); return ret; } // Sorts by increasing SI conversion factor (i.e. smallest unit first) private static class UnitSortOrder implements Comparator<Unit> { @Override public int compare(Unit u1, Unit u2) { return Double.compare(u1.getConversionFactorToSI(), u2.getConversionFactorToSI()); } } public static final UnitSortOrder unitSortOrder = new UnitSortOrder(); private static class MultPair { Class<? extends Unit> a; Class<? extends Unit> b; public MultPair(Class<? extends Unit> a, Class<? extends Unit> b) { this.a = a; this.b = b; } @Override public int hashCode() { return a.hashCode() ^ b.hashCode(); } @Override public boolean equals(Object other) { if (!(other instanceof MultPair)) return false; MultPair op = (MultPair)other; return (a == op.a && b == op.b) || (a == op.b && b == op.a); // swapped order is still equal } } private static class DivPair { Class<? extends Unit> a; Class<? extends Unit> b; public DivPair(Class<? extends Unit> a, Class<? extends Unit> b) { this.a = a; this.b = b; } @Override public int hashCode() { return a.hashCode() ^ b.hashCode(); } @Override public boolean equals(Object other) { if (!(other instanceof DivPair)) return false; DivPair op = (DivPair)other; return (a == op.a && b == op.b); } } private static HashMap<MultPair, Class<? extends Unit>> multRules; private static HashMap<DivPair, Class<? extends Unit>> divRules; static { multRules = new HashMap<>(); divRules = new HashMap<>(); // Multiplication rules addMultRule( RateUnit.class, TimeUnit.class, DimensionlessUnit.class); addMultRule( SpeedUnit.class, TimeUnit.class, DistanceUnit.class); addMultRule( AccelerationUnit.class, TimeUnit.class, SpeedUnit.class); addMultRule( MassFlowUnit.class, TimeUnit.class, MassUnit.class); addMultRule( VolumeFlowUnit.class, TimeUnit.class, VolumeUnit.class); addMultRule( AngularSpeedUnit.class, TimeUnit.class, AngleUnit.class); addMultRule( PowerUnit.class, TimeUnit.class, EnergyUnit.class); addMultRule( CostRateUnit.class, TimeUnit.class, CostUnit.class); addMultRule( ViscosityUnit.class, TimeUnit.class, LinearDensityUnit.class); addMultRule( DistanceUnit.class, RateUnit.class, SpeedUnit.class); addMultRule( SpeedUnit.class, RateUnit.class, AccelerationUnit.class); addMultRule( MassUnit.class, RateUnit.class, MassFlowUnit.class); addMultRule( VolumeUnit.class, RateUnit.class, VolumeFlowUnit.class); addMultRule( AngleUnit.class, RateUnit.class, AngularSpeedUnit.class); addMultRule( EnergyUnit.class, RateUnit.class, PowerUnit.class); addMultRule( CostUnit.class, RateUnit.class, CostRateUnit.class); addMultRule( ViscosityUnit.class, RateUnit.class, PressureUnit.class); addMultRule( DistanceUnit.class, DistanceUnit.class, AreaUnit.class); addMultRule( LinearDensityUnit.class, DistanceUnit.class, MassUnit.class); addMultRule( LinearDensityVolumeUnit.class, DistanceUnit.class, VolumeUnit.class); addMultRule( AreaUnit.class, DistanceUnit.class, VolumeUnit.class); addMultRule( SpeedUnit.class, SpeedUnit.class, SpecificEnergyUnit.class); addMultRule( LinearDensityUnit.class, SpeedUnit.class, MassFlowUnit.class); addMultRule( LinearDensityVolumeUnit.class, SpeedUnit.class, VolumeFlowUnit.class); addMultRule( AreaUnit.class, SpeedUnit.class, VolumeFlowUnit.class); addMultRule( EnergyDensityUnit.class, VolumeUnit.class, EnergyUnit.class); addMultRule( DensityUnit.class, VolumeUnit.class, MassUnit.class); addMultRule( PressureUnit.class, VolumeUnit.class, EnergyUnit.class); addMultRule( EnergyDensityUnit.class, VolumeFlowUnit.class, PowerUnit.class); addMultRule( DensityUnit.class, VolumeFlowUnit.class, MassFlowUnit.class); addMultRule( PressureUnit.class, VolumeFlowUnit.class, PowerUnit.class); } public static void addMultRule(Class<? extends Unit> a, Class<? extends Unit> b, Class<? extends Unit> product) { MultPair key = new MultPair(a, b); multRules.put(key, product); // Add the corresponding division rules addDivRule(product, a, b); addDivRule(product, b, a); } public static void addDivRule(Class<? extends Unit> num, Class<? extends Unit> denom, Class<? extends Unit> product) { DivPair key = new DivPair(num, denom); divRules.put(key, product); } // Get the new unit type resulting from multiplying two unit types public static Class<? extends Unit> getMultUnitType(Class<? extends Unit> a, Class<? extends Unit> b) { if (a == DimensionlessUnit.class) return b; if (b == DimensionlessUnit.class) return a; return multRules.get(new MultPair(a, b)); } // Get the new unit type resulting from dividing two unit types public static Class<? extends Unit> getDivUnitType(Class<? extends Unit> num, Class<? extends Unit> denom) { if (denom == DimensionlessUnit.class) return num; if (num == denom) return DimensionlessUnit.class; return divRules.get(new DivPair(num, denom)); } }
. A 21-year-old woman was diagnosed as having glaucoma associated with Axenfeld-Rieger syndrome. Her family was examined and 3 additional patients with Axenfeld-Rieger syndrome were found in three generations. All of them had glaucoma with various types of onset. Aqueous humor dynamics were studied in 5 eyes of 3 patients using fluorophotometry. The basic secretion of aqueous humor in 5 eyes was 4.18 +/- 1.13 microliter/min. Averaged uveoscleral outflow in 3 eyes with low transtrabecular outflow facility was 61% of total aqueous outflow. It appeared that uveoscleral outflow was increased to compensate for the impaired transtrabecular outflow route.
/** * Created by caizilong on 2018/1/15. */ public class NetEaseApplication extends Application { @Override public void onCreate() { super.onCreate(); // ImageLoaderConfiguration 配置类 ImageLoaderConfiguration configuration = ImageLoaderConfiguration.createDefault(this); ImageLoader.getInstance().init(configuration); } }
/* SPDX-License-Identifier: GPL-2.0 * * Copyright 2016-2018 HabanaLabs, Ltd. * All Rights Reserved. * */ /************************************ ** This is an auto-generated file ** ** DO NOT EDIT BELOW ** ************************************/ #ifndef ASIC_REG_MME_CMDQ_MASKS_H_ #define ASIC_REG_MME_CMDQ_MASKS_H_ /* ***************************************** * MME_CMDQ (Prototype: CMDQ) ***************************************** */ /* MME_CMDQ_GLBL_CFG0 */ #define MME_CMDQ_GLBL_CFG0_PQF_EN_SHIFT 0 #define MME_CMDQ_GLBL_CFG0_PQF_EN_MASK 0x1 #define MME_CMDQ_GLBL_CFG0_CQF_EN_SHIFT 1 #define MME_CMDQ_GLBL_CFG0_CQF_EN_MASK 0x2 #define MME_CMDQ_GLBL_CFG0_CP_EN_SHIFT 2 #define MME_CMDQ_GLBL_CFG0_CP_EN_MASK 0x4 #define MME_CMDQ_GLBL_CFG0_DMA_EN_SHIFT 3 #define MME_CMDQ_GLBL_CFG0_DMA_EN_MASK 0x8 /* MME_CMDQ_GLBL_CFG1 */ #define MME_CMDQ_GLBL_CFG1_PQF_STOP_SHIFT 0 #define MME_CMDQ_GLBL_CFG1_PQF_STOP_MASK 0x1 #define MME_CMDQ_GLBL_CFG1_CQF_STOP_SHIFT 1 #define MME_CMDQ_GLBL_CFG1_CQF_STOP_MASK 0x2 #define MME_CMDQ_GLBL_CFG1_CP_STOP_SHIFT 2 #define MME_CMDQ_GLBL_CFG1_CP_STOP_MASK 0x4 #define MME_CMDQ_GLBL_CFG1_DMA_STOP_SHIFT 3 #define MME_CMDQ_GLBL_CFG1_DMA_STOP_MASK 0x8 #define MME_CMDQ_GLBL_CFG1_PQF_FLUSH_SHIFT 8 #define MME_CMDQ_GLBL_CFG1_PQF_FLUSH_MASK 0x100 #define MME_CMDQ_GLBL_CFG1_CQF_FLUSH_SHIFT 9 #define MME_CMDQ_GLBL_CFG1_CQF_FLUSH_MASK 0x200 #define MME_CMDQ_GLBL_CFG1_CP_FLUSH_SHIFT 10 #define MME_CMDQ_GLBL_CFG1_CP_FLUSH_MASK 0x400 #define MME_CMDQ_GLBL_CFG1_DMA_FLUSH_SHIFT 11 #define MME_CMDQ_GLBL_CFG1_DMA_FLUSH_MASK 0x800 /* MME_CMDQ_GLBL_PROT */ #define MME_CMDQ_GLBL_PROT_PQF_PROT_SHIFT 0 #define MME_CMDQ_GLBL_PROT_PQF_PROT_MASK 0x1 #define MME_CMDQ_GLBL_PROT_CQF_PROT_SHIFT 1 #define MME_CMDQ_GLBL_PROT_CQF_PROT_MASK 0x2 #define MME_CMDQ_GLBL_PROT_CP_PROT_SHIFT 2 #define MME_CMDQ_GLBL_PROT_CP_PROT_MASK 0x4 #define MME_CMDQ_GLBL_PROT_DMA_PROT_SHIFT 3 #define MME_CMDQ_GLBL_PROT_DMA_PROT_MASK 0x8 #define MME_CMDQ_GLBL_PROT_PQF_ERR_PROT_SHIFT 4 #define MME_CMDQ_GLBL_PROT_PQF_ERR_PROT_MASK 0x10 #define MME_CMDQ_GLBL_PROT_CQF_ERR_PROT_SHIFT 5 #define MME_CMDQ_GLBL_PROT_CQF_ERR_PROT_MASK 0x20 #define MME_CMDQ_GLBL_PROT_CP_ERR_PROT_SHIFT 6 #define MME_CMDQ_GLBL_PROT_CP_ERR_PROT_MASK 0x40 #define MME_CMDQ_GLBL_PROT_DMA_ERR_PROT_SHIFT 7 #define MME_CMDQ_GLBL_PROT_DMA_ERR_PROT_MASK 0x80 /* MME_CMDQ_GLBL_ERR_CFG */ #define MME_CMDQ_GLBL_ERR_CFG_PQF_ERR_INT_EN_SHIFT 0 #define MME_CMDQ_GLBL_ERR_CFG_PQF_ERR_INT_EN_MASK 0x1 #define MME_CMDQ_GLBL_ERR_CFG_PQF_ERR_MSG_EN_SHIFT 1 #define MME_CMDQ_GLBL_ERR_CFG_PQF_ERR_MSG_EN_MASK 0x2 #define MME_CMDQ_GLBL_ERR_CFG_PQF_STOP_ON_ERR_SHIFT 2 #define MME_CMDQ_GLBL_ERR_CFG_PQF_STOP_ON_ERR_MASK 0x4 #define MME_CMDQ_GLBL_ERR_CFG_CQF_ERR_INT_EN_SHIFT 3 #define MME_CMDQ_GLBL_ERR_CFG_CQF_ERR_INT_EN_MASK 0x8 #define MME_CMDQ_GLBL_ERR_CFG_CQF_ERR_MSG_EN_SHIFT 4 #define MME_CMDQ_GLBL_ERR_CFG_CQF_ERR_MSG_EN_MASK 0x10 #define MME_CMDQ_GLBL_ERR_CFG_CQF_STOP_ON_ERR_SHIFT 5 #define MME_CMDQ_GLBL_ERR_CFG_CQF_STOP_ON_ERR_MASK 0x20 #define MME_CMDQ_GLBL_ERR_CFG_CP_ERR_INT_EN_SHIFT 6 #define MME_CMDQ_GLBL_ERR_CFG_CP_ERR_INT_EN_MASK 0x40 #define MME_CMDQ_GLBL_ERR_CFG_CP_ERR_MSG_EN_SHIFT 7 #define MME_CMDQ_GLBL_ERR_CFG_CP_ERR_MSG_EN_MASK 0x80 #define MME_CMDQ_GLBL_ERR_CFG_CP_STOP_ON_ERR_SHIFT 8 #define MME_CMDQ_GLBL_ERR_CFG_CP_STOP_ON_ERR_MASK 0x100 #define MME_CMDQ_GLBL_ERR_CFG_DMA_ERR_INT_EN_SHIFT 9 #define MME_CMDQ_GLBL_ERR_CFG_DMA_ERR_INT_EN_MASK 0x200 #define MME_CMDQ_GLBL_ERR_CFG_DMA_ERR_MSG_EN_SHIFT 10 #define MME_CMDQ_GLBL_ERR_CFG_DMA_ERR_MSG_EN_MASK 0x400 #define MME_CMDQ_GLBL_ERR_CFG_DMA_STOP_ON_ERR_SHIFT 11 #define MME_CMDQ_GLBL_ERR_CFG_DMA_STOP_ON_ERR_MASK 0x800 /* MME_CMDQ_GLBL_ERR_ADDR_LO */ #define MME_CMDQ_GLBL_ERR_ADDR_LO_VAL_SHIFT 0 #define MME_CMDQ_GLBL_ERR_ADDR_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_GLBL_ERR_ADDR_HI */ #define MME_CMDQ_GLBL_ERR_ADDR_HI_VAL_SHIFT 0 #define MME_CMDQ_GLBL_ERR_ADDR_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_GLBL_ERR_WDATA */ #define MME_CMDQ_GLBL_ERR_WDATA_VAL_SHIFT 0 #define MME_CMDQ_GLBL_ERR_WDATA_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_GLBL_SECURE_PROPS */ #define MME_CMDQ_GLBL_SECURE_PROPS_ASID_SHIFT 0 #define MME_CMDQ_GLBL_SECURE_PROPS_ASID_MASK 0x3FF #define MME_CMDQ_GLBL_SECURE_PROPS_MMBP_SHIFT 10 #define MME_CMDQ_GLBL_SECURE_PROPS_MMBP_MASK 0x400 /* MME_CMDQ_GLBL_NON_SECURE_PROPS */ #define MME_CMDQ_GLBL_NON_SECURE_PROPS_ASID_SHIFT 0 #define MME_CMDQ_GLBL_NON_SECURE_PROPS_ASID_MASK 0x3FF #define MME_CMDQ_GLBL_NON_SECURE_PROPS_MMBP_SHIFT 10 #define MME_CMDQ_GLBL_NON_SECURE_PROPS_MMBP_MASK 0x400 /* MME_CMDQ_GLBL_STS0 */ #define MME_CMDQ_GLBL_STS0_PQF_IDLE_SHIFT 0 #define MME_CMDQ_GLBL_STS0_PQF_IDLE_MASK 0x1 #define MME_CMDQ_GLBL_STS0_CQF_IDLE_SHIFT 1 #define MME_CMDQ_GLBL_STS0_CQF_IDLE_MASK 0x2 #define MME_CMDQ_GLBL_STS0_CP_IDLE_SHIFT 2 #define MME_CMDQ_GLBL_STS0_CP_IDLE_MASK 0x4 #define MME_CMDQ_GLBL_STS0_DMA_IDLE_SHIFT 3 #define MME_CMDQ_GLBL_STS0_DMA_IDLE_MASK 0x8 #define MME_CMDQ_GLBL_STS0_PQF_IS_STOP_SHIFT 4 #define MME_CMDQ_GLBL_STS0_PQF_IS_STOP_MASK 0x10 #define MME_CMDQ_GLBL_STS0_CQF_IS_STOP_SHIFT 5 #define MME_CMDQ_GLBL_STS0_CQF_IS_STOP_MASK 0x20 #define MME_CMDQ_GLBL_STS0_CP_IS_STOP_SHIFT 6 #define MME_CMDQ_GLBL_STS0_CP_IS_STOP_MASK 0x40 #define MME_CMDQ_GLBL_STS0_DMA_IS_STOP_SHIFT 7 #define MME_CMDQ_GLBL_STS0_DMA_IS_STOP_MASK 0x80 /* MME_CMDQ_GLBL_STS1 */ #define MME_CMDQ_GLBL_STS1_PQF_RD_ERR_SHIFT 0 #define MME_CMDQ_GLBL_STS1_PQF_RD_ERR_MASK 0x1 #define MME_CMDQ_GLBL_STS1_CQF_RD_ERR_SHIFT 1 #define MME_CMDQ_GLBL_STS1_CQF_RD_ERR_MASK 0x2 #define MME_CMDQ_GLBL_STS1_CP_RD_ERR_SHIFT 2 #define MME_CMDQ_GLBL_STS1_CP_RD_ERR_MASK 0x4 #define MME_CMDQ_GLBL_STS1_CP_UNDEF_CMD_ERR_SHIFT 3 #define MME_CMDQ_GLBL_STS1_CP_UNDEF_CMD_ERR_MASK 0x8 #define MME_CMDQ_GLBL_STS1_CP_STOP_OP_SHIFT 4 #define MME_CMDQ_GLBL_STS1_CP_STOP_OP_MASK 0x10 #define MME_CMDQ_GLBL_STS1_CP_MSG_WR_ERR_SHIFT 5 #define MME_CMDQ_GLBL_STS1_CP_MSG_WR_ERR_MASK 0x20 #define MME_CMDQ_GLBL_STS1_DMA_RD_ERR_SHIFT 8 #define MME_CMDQ_GLBL_STS1_DMA_RD_ERR_MASK 0x100 #define MME_CMDQ_GLBL_STS1_DMA_WR_ERR_SHIFT 9 #define MME_CMDQ_GLBL_STS1_DMA_WR_ERR_MASK 0x200 #define MME_CMDQ_GLBL_STS1_DMA_RD_MSG_ERR_SHIFT 10 #define MME_CMDQ_GLBL_STS1_DMA_RD_MSG_ERR_MASK 0x400 #define MME_CMDQ_GLBL_STS1_DMA_WR_MSG_ERR_SHIFT 11 #define MME_CMDQ_GLBL_STS1_DMA_WR_MSG_ERR_MASK 0x800 /* MME_CMDQ_CQ_CFG0 */ #define MME_CMDQ_CQ_CFG0_RESERVED_SHIFT 0 #define MME_CMDQ_CQ_CFG0_RESERVED_MASK 0x1 /* MME_CMDQ_CQ_CFG1 */ #define MME_CMDQ_CQ_CFG1_CREDIT_LIM_SHIFT 0 #define MME_CMDQ_CQ_CFG1_CREDIT_LIM_MASK 0xFFFF #define MME_CMDQ_CQ_CFG1_MAX_INFLIGHT_SHIFT 16 #define MME_CMDQ_CQ_CFG1_MAX_INFLIGHT_MASK 0xFFFF0000 /* MME_CMDQ_CQ_ARUSER */ #define MME_CMDQ_CQ_ARUSER_NOSNOOP_SHIFT 0 #define MME_CMDQ_CQ_ARUSER_NOSNOOP_MASK 0x1 #define MME_CMDQ_CQ_ARUSER_WORD_SHIFT 1 #define MME_CMDQ_CQ_ARUSER_WORD_MASK 0x2 /* MME_CMDQ_CQ_PTR_LO */ #define MME_CMDQ_CQ_PTR_LO_VAL_SHIFT 0 #define MME_CMDQ_CQ_PTR_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_PTR_HI */ #define MME_CMDQ_CQ_PTR_HI_VAL_SHIFT 0 #define MME_CMDQ_CQ_PTR_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_TSIZE */ #define MME_CMDQ_CQ_TSIZE_VAL_SHIFT 0 #define MME_CMDQ_CQ_TSIZE_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_CTL */ #define MME_CMDQ_CQ_CTL_RPT_SHIFT 0 #define MME_CMDQ_CQ_CTL_RPT_MASK 0xFFFF #define MME_CMDQ_CQ_CTL_CTL_SHIFT 16 #define MME_CMDQ_CQ_CTL_CTL_MASK 0xFFFF0000 /* MME_CMDQ_CQ_PTR_LO_STS */ #define MME_CMDQ_CQ_PTR_LO_STS_VAL_SHIFT 0 #define MME_CMDQ_CQ_PTR_LO_STS_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_PTR_HI_STS */ #define MME_CMDQ_CQ_PTR_HI_STS_VAL_SHIFT 0 #define MME_CMDQ_CQ_PTR_HI_STS_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_TSIZE_STS */ #define MME_CMDQ_CQ_TSIZE_STS_VAL_SHIFT 0 #define MME_CMDQ_CQ_TSIZE_STS_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_CTL_STS */ #define MME_CMDQ_CQ_CTL_STS_RPT_SHIFT 0 #define MME_CMDQ_CQ_CTL_STS_RPT_MASK 0xFFFF #define MME_CMDQ_CQ_CTL_STS_CTL_SHIFT 16 #define MME_CMDQ_CQ_CTL_STS_CTL_MASK 0xFFFF0000 /* MME_CMDQ_CQ_STS0 */ #define MME_CMDQ_CQ_STS0_CQ_CREDIT_CNT_SHIFT 0 #define MME_CMDQ_CQ_STS0_CQ_CREDIT_CNT_MASK 0xFFFF #define MME_CMDQ_CQ_STS0_CQ_FREE_CNT_SHIFT 16 #define MME_CMDQ_CQ_STS0_CQ_FREE_CNT_MASK 0xFFFF0000 /* MME_CMDQ_CQ_STS1 */ #define MME_CMDQ_CQ_STS1_CQ_INFLIGHT_CNT_SHIFT 0 #define MME_CMDQ_CQ_STS1_CQ_INFLIGHT_CNT_MASK 0xFFFF #define MME_CMDQ_CQ_STS1_CQ_BUF_EMPTY_SHIFT 30 #define MME_CMDQ_CQ_STS1_CQ_BUF_EMPTY_MASK 0x40000000 #define MME_CMDQ_CQ_STS1_CQ_BUSY_SHIFT 31 #define MME_CMDQ_CQ_STS1_CQ_BUSY_MASK 0x80000000 /* MME_CMDQ_CQ_RD_RATE_LIM_EN */ #define MME_CMDQ_CQ_RD_RATE_LIM_EN_VAL_SHIFT 0 #define MME_CMDQ_CQ_RD_RATE_LIM_EN_VAL_MASK 0x1 /* MME_CMDQ_CQ_RD_RATE_LIM_RST_TOKEN */ #define MME_CMDQ_CQ_RD_RATE_LIM_RST_TOKEN_VAL_SHIFT 0 #define MME_CMDQ_CQ_RD_RATE_LIM_RST_TOKEN_VAL_MASK 0xFFFF /* MME_CMDQ_CQ_RD_RATE_LIM_SAT */ #define MME_CMDQ_CQ_RD_RATE_LIM_SAT_VAL_SHIFT 0 #define MME_CMDQ_CQ_RD_RATE_LIM_SAT_VAL_MASK 0xFFFF /* MME_CMDQ_CQ_RD_RATE_LIM_TOUT */ #define MME_CMDQ_CQ_RD_RATE_LIM_TOUT_VAL_SHIFT 0 #define MME_CMDQ_CQ_RD_RATE_LIM_TOUT_VAL_MASK 0x7FFFFFFF /* MME_CMDQ_CQ_IFIFO_CNT */ #define MME_CMDQ_CQ_IFIFO_CNT_VAL_SHIFT 0 #define MME_CMDQ_CQ_IFIFO_CNT_VAL_MASK 0x3 /* MME_CMDQ_CP_MSG_BASE0_ADDR_LO */ #define MME_CMDQ_CP_MSG_BASE0_ADDR_LO_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE0_ADDR_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE0_ADDR_HI */ #define MME_CMDQ_CP_MSG_BASE0_ADDR_HI_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE0_ADDR_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE1_ADDR_LO */ #define MME_CMDQ_CP_MSG_BASE1_ADDR_LO_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE1_ADDR_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE1_ADDR_HI */ #define MME_CMDQ_CP_MSG_BASE1_ADDR_HI_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE1_ADDR_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE2_ADDR_LO */ #define MME_CMDQ_CP_MSG_BASE2_ADDR_LO_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE2_ADDR_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE2_ADDR_HI */ #define MME_CMDQ_CP_MSG_BASE2_ADDR_HI_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE2_ADDR_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE3_ADDR_LO */ #define MME_CMDQ_CP_MSG_BASE3_ADDR_LO_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE3_ADDR_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_MSG_BASE3_ADDR_HI */ #define MME_CMDQ_CP_MSG_BASE3_ADDR_HI_VAL_SHIFT 0 #define MME_CMDQ_CP_MSG_BASE3_ADDR_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_LDMA_TSIZE_OFFSET */ #define MME_CMDQ_CP_LDMA_TSIZE_OFFSET_VAL_SHIFT 0 #define MME_CMDQ_CP_LDMA_TSIZE_OFFSET_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_LDMA_SRC_BASE_LO_OFFSET */ #define MME_CMDQ_CP_LDMA_SRC_BASE_LO_OFFSET_VAL_SHIFT 0 #define MME_CMDQ_CP_LDMA_SRC_BASE_LO_OFFSET_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_LDMA_SRC_BASE_HI_OFFSET */ #define MME_CMDQ_CP_LDMA_SRC_BASE_HI_OFFSET_VAL_SHIFT 0 #define MME_CMDQ_CP_LDMA_SRC_BASE_HI_OFFSET_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_LDMA_DST_BASE_LO_OFFSET */ #define MME_CMDQ_CP_LDMA_DST_BASE_LO_OFFSET_VAL_SHIFT 0 #define MME_CMDQ_CP_LDMA_DST_BASE_LO_OFFSET_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_LDMA_DST_BASE_HI_OFFSET */ #define MME_CMDQ_CP_LDMA_DST_BASE_HI_OFFSET_VAL_SHIFT 0 #define MME_CMDQ_CP_LDMA_DST_BASE_HI_OFFSET_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_LDMA_COMMIT_OFFSET */ #define MME_CMDQ_CP_LDMA_COMMIT_OFFSET_VAL_SHIFT 0 #define MME_CMDQ_CP_LDMA_COMMIT_OFFSET_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_FENCE0_RDATA */ #define MME_CMDQ_CP_FENCE0_RDATA_INC_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE0_RDATA_INC_VAL_MASK 0xF /* MME_CMDQ_CP_FENCE1_RDATA */ #define MME_CMDQ_CP_FENCE1_RDATA_INC_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE1_RDATA_INC_VAL_MASK 0xF /* MME_CMDQ_CP_FENCE2_RDATA */ #define MME_CMDQ_CP_FENCE2_RDATA_INC_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE2_RDATA_INC_VAL_MASK 0xF /* MME_CMDQ_CP_FENCE3_RDATA */ #define MME_CMDQ_CP_FENCE3_RDATA_INC_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE3_RDATA_INC_VAL_MASK 0xF /* MME_CMDQ_CP_FENCE0_CNT */ #define MME_CMDQ_CP_FENCE0_CNT_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE0_CNT_VAL_MASK 0xFF /* MME_CMDQ_CP_FENCE1_CNT */ #define MME_CMDQ_CP_FENCE1_CNT_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE1_CNT_VAL_MASK 0xFF /* MME_CMDQ_CP_FENCE2_CNT */ #define MME_CMDQ_CP_FENCE2_CNT_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE2_CNT_VAL_MASK 0xFF /* MME_CMDQ_CP_FENCE3_CNT */ #define MME_CMDQ_CP_FENCE3_CNT_VAL_SHIFT 0 #define MME_CMDQ_CP_FENCE3_CNT_VAL_MASK 0xFF /* MME_CMDQ_CP_STS */ #define MME_CMDQ_CP_STS_MSG_INFLIGHT_CNT_SHIFT 0 #define MME_CMDQ_CP_STS_MSG_INFLIGHT_CNT_MASK 0xFFFF #define MME_CMDQ_CP_STS_ERDY_SHIFT 16 #define MME_CMDQ_CP_STS_ERDY_MASK 0x10000 #define MME_CMDQ_CP_STS_RRDY_SHIFT 17 #define MME_CMDQ_CP_STS_RRDY_MASK 0x20000 #define MME_CMDQ_CP_STS_MRDY_SHIFT 18 #define MME_CMDQ_CP_STS_MRDY_MASK 0x40000 #define MME_CMDQ_CP_STS_SW_STOP_SHIFT 19 #define MME_CMDQ_CP_STS_SW_STOP_MASK 0x80000 #define MME_CMDQ_CP_STS_FENCE_ID_SHIFT 20 #define MME_CMDQ_CP_STS_FENCE_ID_MASK 0x300000 #define MME_CMDQ_CP_STS_FENCE_IN_PROGRESS_SHIFT 22 #define MME_CMDQ_CP_STS_FENCE_IN_PROGRESS_MASK 0x400000 /* MME_CMDQ_CP_CURRENT_INST_LO */ #define MME_CMDQ_CP_CURRENT_INST_LO_VAL_SHIFT 0 #define MME_CMDQ_CP_CURRENT_INST_LO_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_CURRENT_INST_HI */ #define MME_CMDQ_CP_CURRENT_INST_HI_VAL_SHIFT 0 #define MME_CMDQ_CP_CURRENT_INST_HI_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CP_BARRIER_CFG */ #define MME_CMDQ_CP_BARRIER_CFG_EBGUARD_SHIFT 0 #define MME_CMDQ_CP_BARRIER_CFG_EBGUARD_MASK 0xFFF /* MME_CMDQ_CP_DBG_0 */ #define MME_CMDQ_CP_DBG_0_VAL_SHIFT 0 #define MME_CMDQ_CP_DBG_0_VAL_MASK 0xFF /* MME_CMDQ_CQ_BUF_ADDR */ #define MME_CMDQ_CQ_BUF_ADDR_VAL_SHIFT 0 #define MME_CMDQ_CQ_BUF_ADDR_VAL_MASK 0xFFFFFFFF /* MME_CMDQ_CQ_BUF_RDATA */ #define MME_CMDQ_CQ_BUF_RDATA_VAL_SHIFT 0 #define MME_CMDQ_CQ_BUF_RDATA_VAL_MASK 0xFFFFFFFF #endif /* ASIC_REG_MME_CMDQ_MASKS_H_ */
Marburg virus gene 4 encodes the virion membrane protein, a type I transmembrane glycoprotein Gene 4 of Marburg virus, strain Musoke, was subjected to nucleotide sequence analysis. It is 2,844 nucleotides long and extends from genome position 5821 to position 8665 (EMBL Data Library, emnew: MVREPCYC ). The gene is flanked by transcriptional signal sequences (start signal, 3'-UACUUCUUGUAAUU-5'; termination signal, 3'-UAAUUCUUUUU-5') which are conserved in all Marburg virus genes. The major open reading frame encodes a polypeptide of 681 amino acids (M(r), 74,797). After in vitro transcription and translation, as well as expression in Escherichia coli, this protein was identified by its immunoreactivity with specific antisera as the unglycosylated form of the viral membrane glycoprotein (GP). The GP is characterized by the following four different domains: (i) a hydrophobic signal peptide at the amino terminus (1 to 18), (ii) a predominantly hydrophilic external domain (19 to 643), (iii) a hydrophobic transmembrane anchor (644 to 673), and (iv) a small hydrophilic cytoplasmic tail at the carboxy terminus (674 to 681). Amino acid analysis indicated that the signal peptide is removed from the mature GP. The GP therefore has the structural features of a type I transmembrane glycoprotein. The external domain of the protein has 19 N-glycosylation sites and several clusters of hydroxyamino acids and proline residues that are likely to be the attachment sites for about 30 O-glycosidic carbohydrate chains. The region extending from positions 585 to 610 shows significant homology to a domain observed in the envelope proteins of several retroviruses and Ebola virus that has been suspected to be responsible for immunosuppressive properties of these viruses. A second open reading frame of gene 4 has the coding capacity for an unidentified polypeptide 112 amino acids long.
/* eslint-disable @typescript-eslint/no-empty-interface */ import { IDevice } from "../device"; import { IDriver } from "../driver"; /** * Base class for all Exceptions. * * @deprecated */ export interface IExceptionInstance { /** Gets the date of this exception instance. */ dateTime?: Date; /** Gets the {@link IDevice} of the {@link IExceptionInstance}. */ device: IDevice; /** Gets the Driver" /&gt; of the {@link ExceptionInstance} . */ driver: IDriver; }
//===-- asan_fake_stack_test.cpp ------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Tests for FakeStack. // This test file should be compiled w/o asan instrumentation. //===----------------------------------------------------------------------===// #include "asan_fake_stack.h" #include "asan_test_utils.h" #include "sanitizer_common/sanitizer_common.h" #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <map> namespace __asan { TEST(FakeStack, FlagsSize) { EXPECT_EQ(FakeStack::SizeRequiredForFlags(10), 1U << 5); EXPECT_EQ(FakeStack::SizeRequiredForFlags(11), 1U << 6); EXPECT_EQ(FakeStack::SizeRequiredForFlags(20), 1U << 15); } TEST(FakeStack, RequiredSize) { // for (int i = 15; i < 20; i++) { // uptr alloc_size = FakeStack::RequiredSize(i); // printf("%zdK ==> %zd\n", 1 << (i - 10), alloc_size); // } EXPECT_EQ(FakeStack::RequiredSize(15), 365568U); EXPECT_EQ(FakeStack::RequiredSize(16), 727040U); EXPECT_EQ(FakeStack::RequiredSize(17), 1449984U); EXPECT_EQ(FakeStack::RequiredSize(18), 2895872U); EXPECT_EQ(FakeStack::RequiredSize(19), 5787648U); } TEST(FakeStack, FlagsOffset) { for (uptr stack_size_log = 15; stack_size_log <= 20; stack_size_log++) { uptr stack_size = 1UL << stack_size_log; uptr offset = 0; for (uptr class_id = 0; class_id < FakeStack::kNumberOfSizeClasses; class_id++) { uptr frame_size = FakeStack::BytesInSizeClass(class_id); uptr num_flags = stack_size / frame_size; EXPECT_EQ(offset, FakeStack::FlagsOffset(stack_size_log, class_id)); // printf("%zd: %zd => %zd %zd\n", stack_size_log, class_id, offset, // FakeStack::FlagsOffset(stack_size_log, class_id)); offset += num_flags; } } } #if !defined(_WIN32) // FIXME: Fails due to OOM on Windows. TEST(FakeStack, CreateDestroy) { for (int i = 0; i < 1000; i++) { for (uptr stack_size_log = 20; stack_size_log <= 22; stack_size_log++) { FakeStack *fake_stack = FakeStack::Create(stack_size_log); fake_stack->Destroy(0); } } } #endif TEST(FakeStack, ModuloNumberOfFrames) { EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, 0), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<15)), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<10)), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<9)), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<8)), 1U<<8); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 0, (1<<15) + 1), 1U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 0), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 1<<9), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 1<<8), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 1, 1<<7), 1U<<7); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 0), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 1), 1U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 15), 15U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 16), 0U); EXPECT_EQ(FakeStack::ModuloNumberOfFrames(15, 5, 17), 1U); } TEST(FakeStack, GetFrame) { const uptr stack_size_log = 20; const uptr stack_size = 1 << stack_size_log; FakeStack *fs = FakeStack::Create(stack_size_log); u8 *base = fs->GetFrame(stack_size_log, 0, 0); EXPECT_EQ(base, reinterpret_cast<u8 *>(fs) + fs->SizeRequiredForFlags(stack_size_log) + 4096); EXPECT_EQ(base + 0*stack_size + 64 * 7, fs->GetFrame(stack_size_log, 0, 7U)); EXPECT_EQ(base + 1*stack_size + 128 * 3, fs->GetFrame(stack_size_log, 1, 3U)); EXPECT_EQ(base + 2*stack_size + 256 * 5, fs->GetFrame(stack_size_log, 2, 5U)); fs->Destroy(0); } TEST(FakeStack, Allocate) { const uptr stack_size_log = 19; FakeStack *fs = FakeStack::Create(stack_size_log); std::map<FakeFrame *, uptr> s; for (int iter = 0; iter < 2; iter++) { s.clear(); for (uptr cid = 0; cid < FakeStack::kNumberOfSizeClasses; cid++) { uptr n = FakeStack::NumberOfFrames(stack_size_log, cid); uptr bytes_in_class = FakeStack::BytesInSizeClass(cid); for (uptr j = 0; j < n; j++) { FakeFrame *ff = fs->Allocate(stack_size_log, cid, 0); uptr x = reinterpret_cast<uptr>(ff); EXPECT_TRUE(s.insert(std::make_pair(ff, cid)).second); EXPECT_EQ(x, fs->AddrIsInFakeStack(x)); EXPECT_EQ(x, fs->AddrIsInFakeStack(x + 1)); EXPECT_EQ(x, fs->AddrIsInFakeStack(x + bytes_in_class - 1)); EXPECT_NE(x, fs->AddrIsInFakeStack(x + bytes_in_class)); } // We are out of fake stack, so Allocate should return 0. EXPECT_EQ(0UL, fs->Allocate(stack_size_log, cid, 0)); } for (std::map<FakeFrame *, uptr>::iterator it = s.begin(); it != s.end(); ++it) { fs->Deallocate(reinterpret_cast<uptr>(it->first), it->second); } } fs->Destroy(0); } static void RecursiveFunction(FakeStack *fs, int depth) { uptr class_id = depth / 3; FakeFrame *ff = fs->Allocate(fs->stack_size_log(), class_id, 0); if (depth) { RecursiveFunction(fs, depth - 1); RecursiveFunction(fs, depth - 1); } fs->Deallocate(reinterpret_cast<uptr>(ff), class_id); } TEST(FakeStack, RecursiveStressTest) { const uptr stack_size_log = 16; FakeStack *fs = FakeStack::Create(stack_size_log); RecursiveFunction(fs, 22); // with 26 runs for 2-3 seconds. fs->Destroy(0); } } // namespace __asan
A renewable energy-driven water treatment system in regional Western Australia This paper presents a feasibility analysis for running a water treatment system by renewable energies in a regional town of Western Australia. The main motivation is the inadequate capacity in the electricity feeder supplying the town especially in summer. Instead of augmenting the feeder to the town to supply the electricity demand of the water treatment system, locally installed renewable energies seem to be sustainable, cost effective and attractive for the local electricity utility. This paper finds an economically attractive and technically feasible solution in the form of integrating a distributed system of rooftop solar photovoltaic systems with wind energy and existing grid to supply the energy demand of the town, as well as the new water treatment system. The proposed hybrid energy system provides electricity at a lower cost than the current energy solution, while improving the penetration of renewable energies in the region.
//======== (C) Copyright 1999, 2000 Valve, L.L.C. All rights reserved. ======== // // The copyright to the contents herein is the property of Valve, L.L.C. // The contents may be used and/or copied only with the written permission of // Valve, L.L.C., or in accordance with the terms and conditions stipulated in // the agreement/contract under which the contents have been supplied. // // Purpose: // // $Workfile: $ // $Date: $ // //----------------------------------------------------------------------------- // $Log: $ // // $NoKeywords: $ //============================================================================= #include "cbase.h" #include "c_basetempentity.h" #include "c_te_legacytempents.h" //----------------------------------------------------------------------------- // Purpose: Fizz TE //----------------------------------------------------------------------------- class C_TEFizz : public C_BaseTempEntity { public: DECLARE_CLASS( C_TEFizz, C_BaseTempEntity ); DECLARE_CLIENTCLASS(); C_TEFizz( void ); virtual ~C_TEFizz( void ); virtual void PostDataUpdate( DataUpdateType_t updateType ); public: int m_nEntity; int m_nModelIndex; int m_nDensity; }; //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- C_TEFizz::C_TEFizz( void ) { m_nEntity = 0; m_nModelIndex = 0; m_nDensity = 0; } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- C_TEFizz::~C_TEFizz( void ) { } //----------------------------------------------------------------------------- // Purpose: // Input : bool - //----------------------------------------------------------------------------- void C_TEFizz::PostDataUpdate( DataUpdateType_t updateType ) { C_BaseEntity *pEnt = cl_entitylist->GetEnt( m_nEntity ); if (pEnt != NULL) { tempents->FizzEffect(pEnt, m_nModelIndex, m_nDensity ); } } void TE_Fizz( IRecipientFilter& filter, float delay, const C_BaseEntity *ed, int modelindex, int density ) { C_BaseEntity *pEnt = (C_BaseEntity *)ed; if (pEnt != NULL) { tempents->FizzEffect(pEnt, modelindex, density ); } } IMPLEMENT_CLIENTCLASS_EVENT_DT(C_TEFizz, DT_TEFizz, CTEFizz) RecvPropInt( RECVINFO(m_nEntity)), RecvPropInt( RECVINFO(m_nModelIndex)), RecvPropInt( RECVINFO(m_nDensity)), END_RECV_TABLE()
This Thursday morning a Palestinian man was shot dead by the Israeli occupation forces in Za’tara military checkpoint, south of Nablus after the allegedly tried to stab an Israeli soldier. The Palestinian Ministry of Health identified the man who was martyred on the Za’tara checkpoint, south of Nablus, as Samer Hassan Shresa, 51 years old. According to the Jerusalem Post, the Israeli police said that the Samer “suddenly jumped out of his car at a border police position and ran at the [Israeli] forces stationed there with a knife in his hand. The [Israeli] forces responded by shooting him.”. Shresa was left bleeding on the ground. According to Palestinian sources, the IOF detained the Red Crescent ambulance from approaching the scene. Below a video from the paramedics of the Red Crescent who were prevented from approaching the scene. In a statement issued Thursday, the Palestinian Ministry of Health said 100 Palestinians, including 22 children and four women, have so far been killed by the IOF since the beginning of October 2015.
Bring your favorite stuffed animal to the library for a special sleepover. Together you will enjoy stories and bedtime activities. Then say goodbye and leave your buddy for a nighttime adventure to enjoy games, crafts, stories and more. Your buddy will come home with photos from their sleepover so you can share the fun! Ages 2-9.
That’s what Texas Congresswoman Sheila Jackson Lee says she was feeling in Dealey Plaza today as she awaited the ceremony commemorating the 50th anniversary of the assassination of President John F. Kennedy. Jackson Lee, a 13-year-old student in Jamaica, Queens when JFK was killed, said a school administrator burst into the classroom to tell the students what had happened. “Even then I could understand that something had happened that was bad and catastrophic,” Jackson Lee recalled. “This was a Harvard-trained young veteran of World War II who was the first to recognize the entirety of America, the wholeness of America,” Jackson Lee said. It has only been since JFK was killed that accounts have delved into the physical pain that JFK endured as a result of a back injury suffered when his Navy patrol boat was rammed by a Japanese destroyer in the South Pacific.
/** * Tests whether one of the strings in the given array of candidates equals * the given search string, ignoring character case. * * @param s * the string to search (not null). * @param searchFor * the string to search for in the string (not null). * @return true if the search string was found in s ignoring character case, * false if it was not found. */ public static boolean containsIgnoreCase(final String s, final String searchFor) { Check.notNull(s, "s"); Check.notNull(searchFor, "searchFor"); return s.toLowerCase().contains(searchFor.toLowerCase()); }
package com.leetcode; import junit.framework.TestCase; public class Solution_72Test extends TestCase { public void testMinDistance() { Solution_72 solution_72 = new Solution_72(); solution_72.minDistance("horse", "ros"); } }
The Missing Link of NIH Funding in Pediatric Research Training Program Restructuring * Abbreviations: NICHD : Eunice Kennedy Shriver National Institute of Child Health and Human Development NIH : National Institutes of Health The restructuring of pediatric and other academic programs is intrinsic to academia and has long been a reflection of leadership turnover. In pediatrics, department chairs turn over on average once every 5 years.1 With such leadership changes comes enthusiasm and introduction of fresh ideas that herald novel departmental directions. Yet, in the era of extremely competitive National Institutes of Health (NIH) funding, the current standards for awarding training program support make new program development challenging. As a faculty member at Yale University and Associate Chair for Research in Pediatrics, I stewarded a portfolio of departmental T32 and K12 awards that supported biomedical research training of residents, fellows, and junior faculty members in a broad array of pediatric subspecialties. When I drafted the successful Eunice Kennedy Shriver National Institute of Child Health and Human Development (NICHD) K12 Child Health Research Center Program proposal and the T32 proposal to support basic science training, the Yale program had more than 20 years of continuous K12 support. At that time, the Yale Department of Pediatrics existed for more than 100 years and had decades of success in the training of physician-scientists. Each of the T32 and K12 proposals were Address correspondence to Scott A. Rivkees, MD, Pediatrics Chairmans Office, 1600 SW Archer Rd, Room R1-118, University of Florida College of Medicine, Gainesville, FL 32610-0296. E-mail:srivkees{at}ufl.edu
package io.appactive.java.api.rule.traffic.bo; public class TransformerRule { }
Vice President Mike Pence's office confirmed March 2 that he used private email to conduct public business as governor of Indiana. During this time his personal AOL account was hacked. (Reuters) Vice President Pence used a private email account that was later compromised while he served as governor of Indiana, his office confirmed Thursday. The existence of the account was first reported by the Indy Star, which obtained copies of Pence's emails through a Freedom of Information request. The paper reported that Pence used the account to conduct government business, including corresponding about potentially sensitive issues. In one exchange, Pence communicated with his chief of staff and his top homeland security adviser, who conveyed an update about terror-related FBI arrests in the state. However, the information in those emails was reported widely in the media at the time. In a statement, Pence press secretary Marc Lotter said that his use of a personal and government email account was consistent with previous governors. “As then-Governor Pence concluded his time in office, he directed outside counsel to review all of his communications to ensure that state-related emails are being transferred and properly archived by the state, in accordance with the law, which outside counsel has done and is continuing to do,” Lotter said. “Government emails involving his state and personal accounts are being archived by the state and are being managed according to Indiana's Access to Public Records Act.” Pence had used the AOL account since the mid-1990s and continued to use it throughout his time as governor until early 2016, when the account was compromised by a hack. Hackers leveraged his contacts to launch a phishing attack against his contact lists, sending an email claiming that Pence and his wife were stranded in the Philippines and needed financial help. After the account was hacked, it was shut down and Pence began using a second AOL account, an aide said. The use of a private email account is not prohibited by law in Indiana. However, public officials cannot use state accounts for political business. Security experts noted to the Indy Star that some of Pence's emails were apparently confidential and sensitive enough that they could not be turned over in response to public records requests. “The fact that these emails are stored in a private AOL account is crazy to me,” Justin Cappos, a computer security professor at New York University's Tandon School of Engineering, told the Indy Star. “This account was used to handle these messages that are so sensitive they can’t be turned over in a records request.” According to an aide, additional security measures were taken to protect Pence's accounts after he was chosen as Trump's vice president. Emails in both accounts were preserved and are expected to be managed according to Indiana's public records laws, the aide added. Pence was a vocal critic of Democratic presidential candidate Hillary Clinton's use of a private email server as secretary of state and often criticized her for it during the presidential campaign. Lotter rejected the comparison between the two cases, arguing that Pence's use of a corporate email server was not unusual and that he did not communicate about classified information. Pence was also embroiled in a public records dispute over the release of an email that he is seeking to keep private. The email is related to Pence's decision to join a lawsuit seeking to block refugees from being resettled in Indiana.
An interactive approach to semantic modeling of indoor scenes with an RGBD camera We present an interactive approach to semantic modeling of indoor scenes with a consumer-level RGBD camera. Using our approach, the user first takes an RGBD image of an indoor scene, which is automatically segmented into a set of regions with semantic labels. If the segmentation is not satisfactory, the user can draw some strokes to guide the algorithm to achieve better results. After the segmentation is finished, the depth data of each semantic region is used to retrieve a matching 3D model from a database. Each model is then transformed according to the image depth to yield the scene. For large scenes where a single image can only cover one part of the scene, the user can take multiple images to construct other parts of the scene. The 3D models built for all images are then transformed and unified into a complete scene. We demonstrate the efficiency and robustness of our approach by modeling several real-world scenes.
Depths and surfaces: understanding the Antarctic region through the humanities and social sciences* Abstract This special issue of The Polar Journal showcases six papers from the Depths and Surfaces Antarctic humanities and social sciences conference, held in Hobart from 5 -7 July 2017. The introduction argues that while the physical continent of Antarctica is beyond the reach of most, the images and narratives that circulate in cultural discourse offer ways to experience the place from afar. Four general submissions are also included in the issue, three of which offer examinations of the far north context. First, this introduction traces the growth of Antarctic humanities and social sciences, both within the context of the Scientific Committee on Antarctic Research (SCAR), and in relation to the International Polar Year (IPY). Background information on the formation of the SCAR History Expert Group (HEG) and Humanities and Social Sciences Expert Group (HASSEG) provides context for the Depths and Surfaces conference, and sets the scene for discussions on the role of humanities in wider polar research projects. The authors argue that by integrating the likes of philosophers, anthropologists, historians and literary critics into larger research projects at the outset, and inviting them to shape the directions of research alongside their scientific counterparts, both the processes and products of research are enriched. The question of Antarctica's accessibility for artists and non-scientific researchers is considered, before each of the essays that make up the special issue is introduced. Taken together, the articles collated in this edition expand our knowledge of the polar regions and human engagement with these areas in exciting ways, and invite the reader to delve deeper into a range of disciplines. When it comes to polar humanities and social science research, there are still many depths to explore.
Sodium salicylate reduced mRNA abundance of hypoxia-associated genes in MAC-T cells Graphical Abstract Summary: It is likely that transient hypoxia occurs with rapid development of the mammary gland during lactogenesis. Overlapping transcriptional responses to inflammatory stimuli and hypoxia point to potential interactions in regulation of tissue development. In the MAC-T mammary epithelial cell line, hypoxia induced expression of glucose transporter 1 (GLUT1), whereas the anti-inflammatory drug sodium salicylate decreased mRNA abundance of GLUT1 and heterogeneous nuclear ribonucleoprotein D and tended to suppress expression of the paracrine vascular growth factor vascular endothelial growth factor A. Although interactions of hypoxia and salicylate were only detected for GLUT1 abundance, salicylate treatment generally opposed previously reported transcriptional responses to hypoxia. Overlapping transcriptional responses to inflammatory stimuli and hypoxia point to potential interactions in regulation of tissue development. In the MAC-T mammary epithelial cell line, hypoxia induced expression of glucose transporter 1 (GLUT1), whereas the anti-inflammatory drug sodium salicylate decreased mRNA abundance of GLUT1 and heterogeneous nuclear ribonucleoprotein D and tended to suppress expression of the paracrine vascular growth factor vascular endothelial growth factor A. Although interactions of hypoxia and salicylate were only detected for GLUT1 abundance, salicylate treatment generally opposed previously reported transcriptional responses to hypoxia. D uring late pregnancy, the mammary epithelium must rapidly expand to support lactation. Endocrine control on bovine mammary gland development has been extensively studied ; however, little is known about the effect of oxygen availability. Hypoxia is an oxygen deficiency commonly found in growing tissues and is speculated to occur in the mammary gland ). An increase in oxygen consumption was noted in the mammary gland of goats during late pregnancy and into lactation (Reynolds, 1967;). During lactogenesis, oxygen demands of growing mammary tissue may outpace vascular growth and blood supply, potentially causing a transient local hypoxic environment. Low oxygen concentrations can activate hypoxia-inducible factor-1 (HIF-1). This transcription factor has 2 subunits, HIF-1 and HIF-1, with the former being stabilized during hypoxic conditions and its expression highly regulated and the latter being constitutively expressed. Activation of HIF-1 increases transcription of genes involved in angiogenesis, glucose transport, and cell survival and proliferation. In mouse studies, mammary HIF-1 demonstrated an essential role in mammary gland development, as knockout resulted in smaller alveoli and impaired epithelial cell differentiation, which consequently resulted in a dramatic reduction in milk synthesis (). The effect of hypoxia on milk synthesis may be partly explained by its effect on glucose transporters and angiogenesis. Indeed, hypoxia increased mRNA abundance of glucose transporter 1 (GLUT1) in mouse mammary epithelial cells (). Likewise, MAC-T cells cultured under hypoxic conditions had a greater mRNA abundance of GLUT1 compared with cells treated with normoxia. Moreover, GLUT1 transcript abundance is greater during early to peak lactation compared with either nonlactation or late lactation in multiparous cows (;;). Lactose synthesis, which requires glucose uptake, dictates milk volume, and thus a hypoxia-induced increase in GLUT1 may be a mechanism to augment milk synthesis. Hypoxia also plays a critical role in angiogenesis by increasing transcription of vascular endothelial growth factor (VEGF), a paracrine function to increase delivery of oxygen and nutrients to growing tissues (). Thus, hypoxia-induced effects, along with shifts in hormone levels around the time of parturition, are likely important driving factors for mammary gland development. One potential mechanism behind the downstream transcriptional effects of hypoxia-associated genes is the recruitment of heterogeneous nuclear ribonucleoprotein D (HNRNPD); HNRNPD destabilizes mRNA of DNA methyltransferase 1 (DNMT1), an enzyme that catalyzes the addition of methyl groups to DNA. Destabilization of DNMT1 mRNA causes global DNA hypomethylation (;), which effectively increases expression of the aforementioned hypoxia-associated genes (). Moreover, in a cancer cell line, HNRNPD positively regulated VEGF and HIF-1 by directly binding and stabilizing Sodium salicylate reduced mRNA abundance of hypoxia-associated genes in MAC-T cells C. M. Ylioja, 1 T. H. Swartz, 1,2 L. K. Mamedova, 1,2 and B. J. Bradford 1,2 * their mRNA (Al-Khalaf and Aboussekhra, 2019). Heterogeneous nuclear ribonucleoprotein D may be a key regulator of genes associated with hypoxia and mammary gland development. Although much is known about hypoxia-induced effects on glucose transporters and angiogenesis, an emerging body of research suggests that hypoxia itself is an inflammatory stimulus. Nuclear factor kappa-light-chain-enhancer of activated B cells (NF-B) is a transcription factor that can be activated by hypoxia (Cummins and Taylor, 2005;;;), and HIF1A expression is regulated by NF-B (van ). Nuclear factor-B controls the expression of inflammatory mediators in addition to playing a critical role in cell proliferation, including mammary gland development (Cao and Karin, 2003). Elevated levels of inflammatory mediators are commonly observed in periparturient dairy cows (). However, excessive inflammation in early lactation has negative long-term effects on milk production (). Administration of sodium salicylate (SS), a nonsteroidal anti-inflammatory drug (NSAID) that inhibits NF-B activation (Kopp and Ghosh, 1994), for 7 d following parturition increased whole-lactation milk yield for cows in third or greater lactation but tended to decrease milk yield for first-parity cows (b). During the beginning of a cow's first lactation, hypoxiainduced NF-B activation is likely an important mechanism to promote mammary gland development. Thus, NSAID administration during a time of intense mammary gland development may explain the parity interaction noted in our previous study. Moreover, we recently found that SS administration increased mammary global DNA methylation (), another hint that SS could alter hypoxia-induced effects. Therefore, the objective of the present study was to investigate the effect of SS on hypoxia-induced responses in MAC-T cells. We hypothesized that SS would inhibit the activation of HIF-1, resulting in decreased transcription of downstream targets responsible for glucose transport (GLUT1) and angiogenesis (VEGFA) due to a reduction in mRNA abundance of HNRNPD, a gene involved in altering global DNA methylation patterns. Immortalized bovine mammary epithelial (MAC-T) cells were kindly donated by Wendi Cohick from Rutgers University (Brunswick, NJ). Dulbecco's modified Eagle's medium (1; ref no. 11965-092, Life Technologies) containing 10% fetal bovine serum (cat. no. A3160401, Thermo Fisher Scientific), 100 U/mL penicillin streptomycin (cat. no. 15070, Life Technologies), and 5 g/mL insulin (cat. no. I9278; Sigma Aldrich) was used for growing cells and in all experiments. Cells were cultured at 37°C with 5% atmospheric CO 2 in humidified incubators. Cell were passed at 80% confluency. Cells were first washed with Ca-and Mg-free PBS, and then TrypLE solution (cat. no. 12604013, Thermo Fisher Scientific) was added and cells were incubated for 2 to 5 min until cells were completely detached. Detached cells were resuspended in fresh medium, quantified with a Neubauer chamber, and plated at the desired cell density. For experiments, MAC-T cells (10 6 cells/well) were seeded into 12-well cell culture plates. Before treatments were applied, all cells were cultured for 24 h to reach at least 80% confluence. Afterward, cells were transfected with either HIF1A small interfering RNA (siRNA) or a scrambled siRNA negative control 48 h before treatment application. Cell were transfected in serum-and antibiotic-free Opti-MEM medium (cat. no. 11058021, Thermo Fisher Scientific) with a final concentration of 100 nM scrambled negative control (NEG) siRNA (Mission siRNA Universal Negative Control #1, cat. no. SIC001, Sigma Aldrich), HIF1A siRNA-1, or HIF1A siRNA-2 (Sigma-Aldrich) using Mirus TransIT-X2 Transfection Reagent (cat. no. MIR6000, MirusBio) according to the manufacturer's recommendations. Additionally, some wells underwent this process but without any siRNA duplex (CON). The siRNA duplex sequences were GGAUGAUGACUUCCAGUUAdTdT, UAACUGGAAGUCAUCAUCCdTdT for HIF1A siRNA-1 and CUGAUUUAGACUUGGAGAUdTdT, AUCUCCAAGUCU-AAAUCAGdTdT for HIF1A siRNA-2. After 48 h, cells were washed with PBS before fresh culture medium containing SS (100 M; cat. no. S3007, Sigma-Aldrich) or not was added just before incubation. This dose was based on the approximate mean plasma concentration of salicylate in postpartum cows treated with oral SS (unpublished data from ). A gas-tight modular incubator chamber (MIC-101, Billups-Rothenberg) was flushed for 3 min with 5% CO 2 balanced with 95% nitrogen, resulting in an oxygen concentration of approximately 1%. Treated cells were immediately placed in this chamber to induce hypoxia (1% O 2 ) or were placed outside the chamber in normoxic conditions in the incubator (5% CO 2 ), as in previous studies (;). Cells were then incubated under either hypoxic or normoxic conditions for 12 h (n = 6-7 wells per treatment combination). After the 12-h incubation, the medium was removed and cells were washed with cold PBS. Cells were harvested with 0.5 mL of Trizol containing -mercaptoethanol (1.14 L/0.5 mL of Trizol), removed using a cell scraper, and stored at −20°C until RNA was harvested. The RNA was extracted (RNeasy Lipid Tissue Mini Kit, Qiagen) according to manufacturer specifications. Concentration and purity of RNA were assessed using spectrophotometry (Take3 Micro-Volume plate, Biotek). Total RNA (mean: 45 ng) was used to synthesize cDNA in a 20-L reaction using a High-Capacity cDNA Reverse Transcription Kit (Applied Biosystems). Quantitative real-time PCR was performed in duplicate with 1 L of the cDNA product in the presence of 200 nmol/L gene-specific forward and reverse primers using SYBR Green fluorescent detection (7500 Fast Real-Time PCR System, Applied Biosystems). Primers were designed using the Primer-BLAST tool on the National Center for Biotechnology Information website (https: / / www.ncbi.nlm.nih.gov/ tools/ primer -blast/ ; Table 1). Efficiencies of PCR were determined using a 5-point dilution curve and ranged between 92 and 110% for all gene targets (Table 1), and transcript abundance was quantified using the relative expression ratio incorporating efficiency from Pfaffl. Numerous housekeeping genes were checked for stability across treatments. Potential internal control gene transcripts RPS9, RPS15, UXT, and neudesin neurotrophic factor (NENF) were evaluated for stability across treatments; NENF was selected as the most appropriate internal control because it was readily detectible in all samples, was not altered by treatment (P = 0.67), and showed greater stability across samples than the geometric mean of 3 reference genes (). Specificity of primer amplification was verified by melt curve analysis following PCR. MAC-T cells (10 6 cells/well) were seeded into a 96-well cell culture plate and were treated with SS (100 M) or control medium 160 Ylioja et al. | mRNA abundance of hypoxia-associated genes just before incubation under either hypoxic (1% O 2 ) or normoxic conditions for 12 h (n = 6 per treatment combination). AlamarBlue was incubated with MAC-T cells for 4 h, and the conversion of resazurin to resorufin was used as a proxy for cell viability (cat. no. DAL1025, Invitrogen). Absorbance was determined at 570 nm using a plate reader (Synergy HTX, BioTek Instruments Inc.) and Gen5 software (BioTek Instruments Inc.). For cell viability, a linear mixed model (PROC GLIMMIX of SAS 9.4, SAS Institute Inc.) was used with hypoxia, SS, and the interaction as fixed effects and the random effect of cell culture plate nested within hypoxia treatment. Transcript abundance of 4 target genes (HIF1A, GLUT1, VEGFA, and HNRNPD) was analyzed using a linear mixed model (PROC GLIMMIX) with the fixed effects of SS, hypoxia, siRNA, and all 2-and 3-way interaction terms and the random effect of cell culture plate nested within hypoxia treatment. To meet the assumption of normality (PROC UNIVARIATE of SAS 9.4), all mRNA abundance data required natural logarithmic transformation. Least squares means and standard errors were back-transformed according to Jrgensen and Pedersen. An outlier was defined if the observation had a studentized residual greater than 3 in absolute value, and therefore was removed from the analysis. When conducting multiple comparisons, treatment means were separated using Tukey's honestly significant difference test. Significance was declared at P ≤ 0.05 and tendencies were declared at 0.05 < P < 0.10. For cell viability, the effect of SS depended on the oxygen concentration (Figure 1; SS hypoxia, P < 0.01). Further investigation into this interaction yielded marginal effects of SS on cell viability, where SS increased cell viability under hypoxic conditions (P = 0.05) and decreased cell viability when cells were cultured in normoxia conditions (P < 0.01). In untreated cells, hypoxia marginally decreased cell viability compared with normoxia cells (P = 0.02); however, this cytotoxic effect was not found within the SS-treated cells (P = 0.97). We hypothesized that SS would reduce mRNA abundance of downstream targets associated with hypoxia through inactivation of HIF-1. Although salicylate failed to alter HIF1A mRNA, NSAID effects were more apparent in downstream targets as SS decreased GLUT1 in normoxic cells and tended to decrease VEGFA mRNA regardless of oxygen status. Hypoxia induces inflammation via NF-B, which in turn activates HIF-1 (;van ). A reduction in HIF-1 and its downstream targets is likely due to NF-B sequestration in the cytosol by SS. Numerous studies have demonstrated a protective role for HIF-1 in the gut epithelium (;;), likely to restore tissue homeostasis. These data lead us to speculate that HIF-1 exerts an anti-inflammatory effect in mammary alveolar cells, and thus the reduction in HIF-1-related targets by SS treatment likely resulted from a reduced proinflammatory status. In contrast to our hypothesis, hypoxia did not increase HIF1A mRNA abundance in MAC-T cells, although it is important to note that activation of HIF-1 activity in vivo is not necessarily dependent on enhanced HIF1A transcription. We also tested responses to 2 anti-HIF1A siRNA duplexes. Although both siRNA successfully reduced HIF1A mRNA abundance, no downstream effects were found on GLUT1, VEGFA, or HNRNPD. The lack of obvious downstream effects may be due to redundant transcription regulation of these genes by numerous transcription factors. For instance, in addition to HIF-1, VEGF (Joko and Mazurek, 2004) and GLUT1 (Kao and Fong, 2008) are controlled by the transcription factor Sp1. Salicylate in the present study reduced GLUT1 in normoxia, but no effect of SS was noted in cells cultured under hypoxic conditions. A combination of in vivo and in vitro evidence suggests that GLUT1 is the dominant glucose transporter in bovine mammary epithelial cells (Zhao and Keating, 2007), so suppression of GLUT1 transcription in early-lactation cows would likely constrain glucose availability to support milk lactose synthesis and, to a lesser extent, synthesis of other milk components. However, in our previous studies, oral SS administration reduced blood glucose concentration in multiparous cows due to impaired gluconeogenesis () but had no effect on lactose or milk yield during NSAID treatment (a), which does not align with a central role of mammary GLUT1 in SS responses in vivo. One potential mechanism behind the downstream transcriptional responses to hypoxia is epigenetics, which is the alteration of gene expression due to chemical modification of DNA or histones. One epigenetic modification is DNA methylation, which controls gene expression by hindering transcription factor binding and consequently repressing transcription (;Jaenisch and Bird, 2003). As previously mentioned, hypoxia triggers HNRNPD activation, which destabilizes mRNA of the enzyme DNMT1. This enzyme catalyzes the addition of methyl groups to CpG structures in DNA. Thus, a reduction of DNMT1 results in selective DNA hypomethylation, leading to increased expression of hypoxia-associated transcripts (). Salicylate administration in a previous study increased mammary global DNA methylation in multiparous cows (), possibly driven by a reduction in HNRNPD. Although we are unsure of how SS reduces HNRNPD transcript abundance, it may be due to its anti-inflammatory and antioxidant properties (). The unraveling of NSAID epigenetic effects in the mammary gland and on dairy cow productivity could be a fruitful area of research (). We used an in vitro approach here to allow us to narrowly investigate direct interactions between hypoxia and SS without complicating endocrine and other regulatory effects in vivo. Furthermore, we chose to use the MAC-T cell line as a well-characterized model for mammary epithelial cells. However, this cell line does not respond exactly as primary bovine mammary epithelial cells do (;Jedrzejczak and Szatkowska, 2014), and possible discrepancies between our findings and the in vivo scenario should be considered. In conclusion, salicylate reduced mRNA abundance of genes involved with mammary tissue growth and development in MAC-T cells. Future in vivo studies should examine the interactions of NSAID therapy and parity on HIF-1 abundance and its downstream targets in the mammary gland.
Design of dynamic positioning systems using hybrid CMAC-based PID controller for a ship The ship motion is a type of complicated nonlinear motion. It is very difficult to measure the precise hydrodynamic parameters when the ship is at sea. Moreover, the external disturbance forces coming from wind, waves and water current are changing at any moment. So, it is necessary to study new control techniques, with robust and adaptive properties, to implement precise position for dynamic positioning vessels. PID control law is a good robust and adaptive control law for a type of definite systems that precise modeling can be gotten in mathematics. But PID control results are not satisfactory for complex nonlinear systems such as ship motion. The neural network has self-learning and adapting ability, so we can combine the PID with neural network to build the strong robust and adaptive controller. In this paper, CMAC-based PID controller is studied. The simulation results show that the new control method is effective with strong robust and adaptive capability, and it can be applied to marine dynamic positioning systems.
import { ListDTO } from 'src/features/dto'; import { TagDTO } from './tag.dto'; export interface TagsDTO extends ListDTO { 'hydra:member': TagDTO[]; }
Alopecia Mucinosa Responding to Antileprosy Treatment: Are we Missing Something? Three cases with single lesion of Alopecia mucinosa (follicular mucinosis) were treated with antileprosy treatment and showed rapid and complete resolution of the lesions with no recurrence on extended follow-up. Two children, a boy aged 14 years and a girl aged 12 years presented themselves, each, with a single hypopigmented, hypoesthetic patch on the face. Clinically leprosy was suspected, however, skin biopsy from both patients revealed follicular mucinosis as the only pathological finding, without any granulomas. Based on clinical suspicion both were started on multi drug therapy (MDT) for leprosy with complete resolution of the lesions. The third case, male, aged 22 years presented with a single erythematous, hypoesthetic plaque on the forehead. This lesion had been diagnosed as follicular mucinosis with folliculo-tropic mycosis fungoides, in the USA. He too responded completely within 3 months with rifampicin, ofloxacin, minocycline (ROM) treatment, which was given once monthly for a total of 6 months and remains free of disease since the past 1 year. Follicular mucinosis as the only pathology may be seen in facial lesions of clinically suspected leprosy in children and young adults. Based on histological findings these cannot be diagnosed as leprosy and will be considered as Alopecia mucinosa. These lesions, however, are always single and show rapid and complete response to antileprosy treatment. The authors suggest that in regions endemic for leprosy, such as India, single lesion Alopecia mucinosa on the face in children and young adults should be given antileprosy treatment.
I'm Not Watching I'm Waiting: the Construction of Visual Codes about Womens' Role as Spectators in the Trial in Nineteenth Century England Abstract Accounts of the interface between law, gender and modernity have tended to stress the many ways in which women experienced the metropolis differently from men in the nineteenth century. Considerable attention has been paid to the notion of separate spheres and to the ways in which the public realm came to be closely associated with the masculine worlds of productive labour, politics, law and public service. Much art of the period draws our attention to the symbiotic relationship between representations of gender and prevailing notions of their place. Drawing on well known depictions of women onlookers in the trial in fine art, this essay by Linda Mulcahy explores the ways in which this genre contributed to the disciplining of women in the public sphere and encouraged them to go no further than the margins of the law court.
A woman was robbed and nearly raped in a parking lot near a housing complex, office buildings and Nassau Community College early Wednesday morning, Nassau County police said. The victim was walking in a parking lot in the vicinity of Stewart Avenue and Selfridge Avenue in East Garden City when she was attacked from behind by a man who stole her jewelry and tried to sexually assault her at 5:30 a.m., police said. The suspect then fled in an unknown direction. The victim was taken to a local hospital, where she was treated for her injuries and released. Special Victims Squad detectives said the suspect is described as a black man between 5-feet, 7-inches and 6-feet tall with a medium build wearing black pants and black shoes. Detectives request that anyone with information regarding this crime to call the Nassau County Police Crime Stoppers at 1-800-244-TIPS.
Electron transfer through molecules and assemblies at electrode surfaces. Chemically modified electrodes were first introduced to the scope of electrochemistry by Anson, Bard, Murray, Saveant, and others about three decades ago in an effort to provide selectivity to highly sensitive electrode surfaces. While electrochemical techniques had high sensitivity because of the availability of accurate current measurement techniques, the lack of any differential selectivity of electrodes for analytes over impurities complicated the analysis. A functionalized electrode however would and does give the opportunity to chemically modify the surface of an electrode, providing the means to make the surface much more chemically selective. In addition to the numerous contributions to the field of electrochemical biosensors (for example, in the field of electrochemical biosensing, the lock and key enzyme substrate relationship can be exploited by immobilizing an enzyme on the electrode surface to analyze a solution of the substrate even in the presence of impurities; major contributions in this field are presented in a recent review by Bakker and Qin), chemically modified electrodes opened up the possibility for electrochemists to be able to investigate electron transfer on electrode surfaces while side-stepping most of the mass transport problems (note that counterion diffusion and solvent rearrangement still have to take place). Once reliable techniques for modifying electrode surfaces were established, molecules with well positioned redox centers and with tunable redox potentials could be placed on electrode surfaces to be able to systematically vary and observe the effects of important parameters such as distance, and chemical environment, among others. For example, the work by Chidsey et. al describes long-range electron transfer making use of exquisite control over the placement of the redox active site relative to the electrode surface. In more recent work, Amatore et. al investigated the effects of chemical environment on electron transfer by making mixed monolayers of electroinactive alkanes with compounds with well-defined redox centers. Molecular electronics can also be dated to similar times as chemically modified electrodes. Though it has been argued that molecular electronics dates back to the days of Mulliken and his proposals of charge transfer salts, the general consensus is that the popularization of the field dates back to the cornerstone paper by Aviram and Ratner in 1974 in which they proposed a molecular structure that should act as a diode when electron transport was measured across it. They designed the molecule based on a donor-bridgeacceptor model and calculated the electron transport with a semi empirical INDO approach. A number of experimental methods have been proposed to measure conductance through molecules and molecular assemblies since then including scanned probe techniques, mercury drop electrodes, electrical or mechanical break junctions, sandwich electrodes, and others. The common concept in all of these methods is to be able to wire the molecules between two electrodes (generally metallic, though semiconductors are also employed in some rare cases) and measure current as a function of an applied potential. A third electrode (gate) coupled through an electronically insulating dielectric is generally used to modulate the electrostatics around the active material, changing, in a deliberate fashion, its electronic energy levels. If the device is immersed in an electrolyte solution, the gate electrode takes on the role of the more traditional reference electrode with identical function. In nearly all efforts related to measuring conductance across molecules and molecular assemblies, the experiments have been based on making a chemically modified electrode to establish the first electrode-molecule contact. The second electrode is then either brought into contact temporarily (scanned probe) or permanently (crossbar, sandwich) or the single electrode is broken into two (break junctions) to measure those molecules that are statistically trapped across the junction. The over three decades experience in modifying electrodes electronic and physical properties puts electrochemistry at center stage for the molecular electronics efforts along with nanofabrication. The experimental efforts on molecular electronics were pushed forward by two separate events. First, the development of scanning tunneling microscopy (STM) by Binnig and Rohrer in 1981, and second, the ever shrinking micro* To whom correspondence should be addressed. E-mail: [email protected]. Chem. Rev. 2008, 108, 27212736 2721
Banks: Bank of America, Chase Manhattan, First Bank of Greenwich, Greenwich Bank & Trust, and People's United Bank will be closed Thursday. Department of Motor Vehicles will be closed Thursday. Greenwich Library, and its Cos Cob and Byram Shubert branches, will be closed Thursday and Friday. Greenwich post office will be closed Thursday. Greenwich Public Schools will be closed Thursday and Friday. Holly Hill Transfer Station will be closed Thursday. Metro-North Railroad will operate a special Thanksgiving schedule. Call 212-532-4900 for schedule. Perrot Memorial Library will be closed Thursday and Friday. Senior Center will be closed Thursday. Town Hall offices will be closed Thursday and Friday.
<gh_stars>1-10 package com.zblservices.bigbluebank; import java.util.Properties; import java.util.logging.Logger; import com.zblservices.bigbluebank.model.AccountData; import com.zblservices.bigbluebank.model.DepositRecord; import com.zblservices.doctorbatch.io.RecordProcessor; public class ClearingBehavior implements RecordProcessor<DepositRecord,DepositRecord> { AccountManager manager = new AccountManager(); private final static Logger LOG = Logger.getLogger(ClearingBehavior.class.getSimpleName()); private final static String ERROR_CODE_CUSTOMER_MISMATCH = "30001"; @Override public int getReturnCode() { return 0; } @Override public void initialize(Properties arg0) { } @Override public void tearDown() { // TODO Auto-generated method stub } @Override public DepositRecord process(DepositRecord depositRecord) { String accountNumber = depositRecord.getAccount_No().trim(); // Fetch the account data from the account manager ... AccountData accountData = manager.fetchAccountData( accountNumber ); if ( accountData == null ) { LOG.severe( "Could not find account data for account number: " + accountNumber ); return depositRecord; } // Validate the customer id ... String customerId = depositRecord.getCustomer_Id().trim(); // The customer id should be either the primary or secondary account holder SSN if ( ! customerId.equals( accountData.getPrimaryAccountHolderSSN() ) && ! customerId.equals( accountData.getSecondaryAccountHolderSSN() ) ) { // If it doesn't match one of them ... ERROR 30001 depositRecord.setProcess_Status("E"); depositRecord.setError_Code( ERROR_CODE_CUSTOMER_MISMATCH ); } else { // Update the account balances ... accountData.setAvailableBalance( accountData.getAvailableBalance().add( // CURRENT AVAIALBLE BALANCE :PLUS depositRecord.getAmount().subtract( // TOTAL DEPOSIT AMOUNT :LESS depositRecord.getAvail_Imm() // AMOUNT ALREADY AVAILABLE ) ) ); // Persist the results manager.updateAccountBalances(accountData); depositRecord.setProcess_Status("C"); } LOG.info( "Processed deposit of " + depositRecord.getAmount() + " in account " + depositRecord.getAccount_No() + " for customer " + depositRecord.getCustomer_Id() + " status: " + depositRecord.getProcess_Status() ); return depositRecord; } }
In centrifugal or mixed-flow compressors used for rotary machines, such as an industrial compressor, a turbo refrigerator, and a small gas turbine, improvements in performance are required, and particularly, improvements in the performance of the impeller that is a key component of the compressors are required. Thus, in recent years, in order to improve the performance of an impeller, an impeller in which a recess is provided at a leading edge between tip and hub of the blades to effectively suppress secondary flow or flaking has been proposed (for example, refer to PTL 1). Additionally, there are impellers (for example, refer to PTLs 2 and 3) in which turbulence is caused in a flow along the hub surface by forming a plurality of grooves in the hub surface between blades such that a boundary layer of the flow along the hub surface is not expanded, in order to improve the performance of a centrifugal or mixed-flow impeller, and in which a plurality of small blades is provided between blades in order to prevent local concentration of a boundary layer.
U.S. Pat. No. 4,392,171 for a "Power Relay With Assisted Commutation"--issued July 5, 1983--William P. Kornrumpf, inventor and assigned to the General Electric Company, discloses an electromagnetic (EM) relay with assisted commutation wherein the load current carrying contacts of the relay are shunted by a gatable semiconductor device that assists in commutation of contact destroying arcs normally produced upon closure and opening of such contacts. This device is typical of AC power switching systems which employ a parallel-connected semiconductor device connected across a set of current interrupting power switch contacts for temporarily diverting the current being interrupted during opening or closure of the contacts. After current interruption and with the relay contacts opened, there still exists a high resistance current leakage path through the parallel connected gatable semiconductor device in its off condition due to the inherent characteristics of the semiconductor device. Underwriter Labs (U.L.) has decreed that such switching circuits are not satisfactory for use with home appliances and other similar apparatus due to the prospective danger of the high resistance current leakage paths electrically charging the home appliance or other apparatus to a high electric potential that could prove injurious or lethal or otherwise fail in a non-safe manner. U.S. Pat. No. 4,296,449, issued Oct. 20, 1981 for a "Relay Switching Apparatus"--C. W. Eichelberger--inventor, assigned to the General Electric Company, discloses an AC power switching circuit that employs a diode commutated master electromagnetic operated relay in conjunction with a pilot EM operated relay with the switch contacts of the master and pilot relays being connected in series circuit relationship between a load and an AC power source. In this arrangement, the second pilot relay is not connected in parallel with a commutation and turn-on assistance diode so that the arrangement does provide a positive circuit break in the form of an air gap between the contacts of the pilot relay between a load and an AC supply source in conformance with U.L. requirements for such switching devices. However, the system described in U.S. Pat. No. 4,296,449 is not designed to operated as a zero crossing synchronous AC switching system, and it is not known at what point in the cycle of an applied alternating current supply potential, opening or closure of the relay contacts takes place. This is due in a great measure to the slow response characteristics of electromagnetic relays generally and to the further fact that EM relays experience shifts in magnetic material characteristics, heat and age related changes, contact surface and air-gap changes and changes in the manner of movement of the relay armature resulting from the combined effect of all of the above-noted factors. Attempts to force the EM relay to obtain faster response speeds serves to increase the magnitude of these effects. An EM atuated circuit interrupter for interrupting AC currents synchronously with the passage through zero value of the AC current is described in a textbook entitled "Electrical Contacts" by G. Windred, published by MacMillan and Co., Ltd. of London, England, copyrighted 1940, see pages 194 through 197. Such a device operates to interrupt only and cannot be used for closing to initiate AC load current flow synchronously. While there may be some EM operated relays which can be used for synchronous closing of AC switch contacts, but they are not known to the inventors. Thus, zero crossing synchronous AC operation for the opening and closing with EM relay actuated switching devices is not feasible with state of the art EM relay devices. Making and breaking current flow through a set of electric load current carrying switch contacts is a relatively complex event in the microscopic world of the forces and effects occurring at the time of contact closure and/or opening as explained more fully in the textbook entitled "Vacuum Arcs--Theory and Application"--J. M. Lafferty--editor, published by John Wiley and Son--New York, N.Y. and copyrighted in 1980. Reference is made in particular to Chapter 3 entitled "Arc Ignition Processing" of the above-noted textbook which chapter was authored by George A. Farrall, a co-inventor of the invention described and claimed in this application. From this publication it is evident that contacts of a load current carrying electric switch when overloaded, or after extended operating life, are subject to the possibility of thermal run-away which can lead to contact welding and/or creation of a fire. This can occur even though the contacts are operated perfectly during use and perform only a current carrying function. Even under conditions where there is no substantial current flow across the contacts, opening and closing of the contacts under conditions where a high operating voltage exists across the contacts, causes mechanical wear and tear so that the actual gaps between the contacts at the time of current establishment and/or extinction can change due to the effects of sparking and arcing. Thus, the long term operating characteristics of the switch contacts of a EM relay operated switch such as that described in U.S. Pat. No. 4,296,449 and other similar systems which open or close switch contacts under high voltage stress, can and do change after a period of usage. Zero current synchronous AC switching circuits employing semiconductor switching devices such as SCRs, triacs, diacs and the like, have been known to the industry for a number of years. This is evidenced by prior U.S. Pat. No. 3,381,226 for "Zero Crossing Synchronous Switching Circuits for Power Semiconductors"--issued Aug. 30, 1968, Clifford M. Jones and John D. Harnden, Jr.--inventors, and U.S. Pat. No. 3,486,042 for "Zero Crossing Synchronous Switching Circuits for Power Semiconductors Supplying Non-Unity Power Factor Loads"--D. L. Watrous, inventor--issued Dec. 23, 1969, both assigned to the General Electric Company. Zero current synchronous AC switching circuits are designed to effect closure or opening of a set of load current carrying switch contacts (corresponding to rendering a semiconductor switching device conductive or non-conductive, respectively) at the point in the cyclically varying alternating current waves when either the voltage or current, or both, are passing through their zero value or as close thereto as possible. This results in greatly reducing the sparking and arc inducing current and voltage stresses occurring across the switch contacts (power semiconductor switching device) as the contacts close or open (corresponding to a power semiconductor device being gated-on or turned-off) to establish or interrupt load current flow, respectively. While such zero current synchronous AC switching circuits employing power semiconductor switching devices are suitable for many applications, they still do not meet the U.L. requirements of providing an open circuit gap between a current source and a load while in the off condition. Instead, while off, power semiconductor switching devices provide a high resistance current leakage path between a current source and a load. This is due to the inherent nature of power semiconductor switching devices. Again, their failure mechanism is non-fail safe. Additionally, it should be noted that the known prior art zero crossing synchronous AC switching circuits employing power semiconductor switching devices have response characteristics that are substantially instantaneous in that they turn-on or turn-off within a matter of microseconds after application of a turn-on or turn-off gating signal to the power semiconductor switching device. Hence, due to their fast responding nature, the known zero crossing synchronous AC switching circuits employing power semiconductor devices are unusable with mechanically opened and closed switch contact systems such as are used in the present invention.
#include "../../../src/xmlpatterns/utils/qnamespaceresolver_p.h"
Stimuli-responsive binary mixed polymer brushes and free-standing films by LbL-SIP. We report a facile approach to preparing binary mixed polymer brushes and free-standing films by combining the layer-by-layer and surface-initiated polymerization (LbL-SIP) techniques. Specifically, the grafting of mixed polymer brushes of poly(n-isopropylacrylamide) and polystyrene (pNIPAM-pSt) onto LbL-macroinitiator-modified planar substrates is described. Atom transfer radical polymerization (ATRP) and free radical polymerization (FRP) techniques were employed for the syntheses of pNIPAM and pSt, respectively, yielding pNIPAM-pSt mixed polymer brushes. The composition of the two polymers was controlled by varying the number of macroinitiator layers deposited on the substrate (i.e., LbL layers = 4, 8, 12, 16, and 20); consequently, mixed brushes of different thicknesses and composition ratios were obtained. Moreover, the switching behavior of the LbL-mixed brush films as a function of solvent and temperature was demonstrated and evaluated by water contact angle and atomic force microscopy (AFM) experiments. It was found that both the solvent and temperature stimuli responses were a function of the mixed brush composition and thickness ratio where the dominant component played a larger role in the response behavior. Furthermore, the ability to obtain free-standing films was exploited. The LbL technique provided the macroinitiator density variation necessary for the preparation of stable free-standing mixed brush films. Specifically, the free-standing films exhibited the rigidity to withstand changes in the solvent and temperature environment and at the same time were flexible enough to respond accordingly to external stimuli.
This application is based on an application No. 2001-287667 filed in Japan, the contents of which are hereby incorporated by reference. 1. Field of the Invention The present invention relates to a light-emitting unit, a light-emitting unit combination, and a lighting apparatus assembled from a plurality of light-emitting units. 2. Related Art With diversification of fashions and consumer tastes, designs of various products, both movables and immovables, are increasingly diversified in recent years. Lighting apparatuses are no exception. Attractive and functional designs which are free from conventional shapes are being proposed. One example is a lighting apparatus that is assembled by connecting a plurality of flat light-emitting units. Such a lighting apparatus comes in several different shapes depending on how the plurality of light-emitting units are combined. However, the number of shapes realized by this type of lighting apparatus is still limited, with there being only a low degree of design freedom. The first object of the present invention is to provide a novel light-emitting unit that realizes an assembly in a wide variety of shapes of both flat (two-dimensional) and solid (three-dimensional) appearances. The second object of the present invention is to provide a light-emitting unit combination that realizes an assembly in a wide variety of shapes of both flat and solid appearances. The third object of the present invention is to provide a novel lighting apparatus that is assembled from a plurality of light-emitting units. The first object can be achieved by a light-emitting unit including: a flat member which has a round shape; a light-emitting member which is provided on a main surface of the flat member; at least three sets of terminals which are provided on a periphery of the flat member so as to be apart from each other; and a wiring pattern which is provided to the flat member to connect each set of terminals with the light-emitting member. Here, xe2x80x9cproviding at least three sets of terminals on the periphery of a flat round memberxe2x80x9d does not necessarily mean these sets of terminals are positioned at the very outer edges of the flat round member. They may instead be positioned a predetermined distance inside the outer edges of the flat round member. The second object can be achieved by a light-emitting unit combination including: at least two light-emitting units, each light-emitting unit including: a flat member which has a round shape; a light-emitting member which is provided on a main surface of the flat member; at least three sets of terminals which are provided on a periphery of the flat member so as to be apart form each other; and a wiring pattern which is provided to the flat member to connect each set of terminals with the light-emitting member, wherein one set of terminals of a light-emitting unit is set facing one set of terminals of another light emitting unit, and corresponding terminals out of the facing sets of terminals are electrically connected. The third object can be achieved by a lighting apparatus including: a plurality of light-emitting units; and a feeder unit which is connected to an external power supply, wherein each light-emitting unit includes: a flat member which has a round shape; a light-emitting member which is provided on a main surface of the flat member; at least three sets of terminals which are provided on a periphery of the flat member so as to be apart from each other; and a wiring pattern which is provided to the flat member to connect each set of terminals with the light-emitting member, the feeder unit includes: a flat substrate which has a round shape; and at least three sets of feeder terminals which are provided on a periphery of the flat substrate so as to be apart from each other, corresponding feeder terminals out of the at least three sets of feeder terminals being connected in parallel, the plurality of light-emitting units and the feeder unit are joined at predetermined areas so as to form a polyhedral figure, the predetermined areas each being an area where one set of terminals of a light-emitting unit is put facing one set of terminals of another light-emitting unit or one set of feeder terminals of the feeder unit, with corresponding terminals out of the facing sets of terminals of the light-emitting units being electrically connected to each other, and the plurality of light-emitting units are each electrically connected to the feeder unit in parallel. The third object can also be achieved by a lighting apparatus that receives power from an external power supply circuit, including: a plurality of light-emitting units, each light-emitting unit including: a flat member which has a round shape; a light-emitting member which is provided on a main surface of the flat member; at least three sets of terminals which are provided on a periphery of the flat member so as to be apart from each other; and a wiring pattern which is provided to the flat member to connect each set of terminals with the light-emitting member, wherein the plurality of light-emitting units are joined at predetermined areas so as to form a polyhedral figure, the predetermined areas each being an area where one set of terminals of a light-emitting unit is put facing one set of terminals of another light-emitting unit, with corresponding terminals out of the facing sets of terminals being electrically connected to each other, and the plurality of light-emitting units are each electrically connected to the external power supply circuit in parallel.
1. Field of the Invention The present invention relates to a replaceable skate assembly, and more particularly to a replaceable skate assembly, wherein the base may be assembled on and detached from the bottom of the boot quickly, easily and conveniently, thereby facilitating the user using the replaceable skate assembly. 2. Description of the Related Art A conventional replaceable skate assembly 5 in accordance with the prior art shown in FIG. 6 comprises a boot 51, and a base 52 mounted on the bottom of the boot 51. The bottom of the boot 51 is provided with an aluminum alloy structure which is formed with two recesses 511 each protruded with an insertion tenon 512 which has a side face formed with an insertion hole 513. The base 52 is provided with two mounting seats 521 each mounted in one of the two recesses 511 of the boot 51. Each of the two mounting seats 521 is provided with a receiving chamber 522 for receiving the insertion tenon 512. The receiving chamber 522 has a side face formed with a through hole 5220 aligning with the insertion hole 513 of the insertion tenon 512. Each of the two mounting seats 521 is also provided with a catch plate 523 formed with a through hole 5230. Each of the two mounting seats 521 is also provided with a safety pin 524, a spring 525 and a bent bar 526 mounted between the receiving chamber 522 and the catch plate 523. In operation, the user may operate the bent bar 526 to move the safety pin 524, so that the safety pin 524 may be inserted into and detached from the insertion hole 513 of the insertion tenon 512 of the boot 51 by the elastic action of the spring 525. Thus, the base 52 may be mounted on or detached from the bottom of the boot 51 according to the user""s requirements. However, when the base 52 is mounted on the bottom of the boot 51, the safety pin 524 cannot align with the insertion hole 513 of the insertion tenon 512 of the boot 51 easily, so that the base 52 cannot be mounted on the bottom of the boot 51 easily and conveniently. In addition, it is necessary to additionally provide an aluminum alloy structure on the bottom of the boot 51, thereby complicating the procedure of fabrication, and thereby increasing the cost of fabrication. The present invention has arisen to mitigate and/or obviate the disadvantage of the conventional replaceable skate assembly. The primary objective of the present invention is to provide a replaceable skate assembly, wherein the base may be assembled on and detached from the bottom of the boot quickly, easily and conveniently, thereby facilitating the user using the replaceable skate assembly. Another objective of the present invention is to provide a replaceable skate assembly, wherein the bottom of the boot is integrally formed with the boot, without having to additionally provide an aluminum alloy structure on the bottom of the boot, thereby simplifying the procedure of fabrication, and thereby decreasing the cost of fabrication. In accordance with the present invention, there is provided a replaceable skate assembly, comprising a boot, a base mounted on a bottom of the boot, and a locking device mounted in the base, wherein: the bottom of the boot has a first end formed with a locking recess and a second end formed with a connecting recess, the connecting recess of the boot has a side formed with a locking cavity; the base has a first end provided with a first mounting seat and a second end provided with a second mounting seat, the first mounting seat of the base has a top provided with a locking block that may be locked in the locking recess of the boot, the second mounting seat of the base has a top provided with a mounting block that may be received in the connecting recess of the boot, the mounting block of the second mounting seat of the base has an inside formed with a closed receiving space which has a side formed with a square hole and a bottom formed with a through hole, the second mounting seat of the base has a bottom provided with a first positioning plate formed with a through hole and a second positioning plate formed with a through hole; and the locking device includes a positioning rod, a locking pawl, and a spring, wherein: the locking pawl is movably mounted in the receiving space of the mounting block of the second mounting seat of the base, and has a top end provided with a wedge-shaped catch block received in and protruded outward from the square hole of the receiving space of the mounting block of the second mounting seat of the base; and the positioning rod is in turn extended through the through hole of the first positioning plate of the second mounting seat of the base, the locking pawl, the spring, the through hole of the second positioning plate of the second mounting seat of the base, and is protruded outward from the base.
<reponame>Pimpler/alerter-v2 import {Prop, Schema, SchemaFactory} from '@nestjs/mongoose'; import {Document} from 'mongoose'; import {IOncallUser} from "../types/IOncallUser"; export type OncallUserDocument = OncallUser & Document; @Schema({collection: "oncall-users"}) export class OncallUser implements IOncallUser { @Prop({required: true}) name: string; @Prop({required: true}) slackName: string; @Prop({required: true}) email: string; @Prop({required: true}) phone: string; } export const OncallUserSchema = SchemaFactory.createForClass(OncallUser);
<gh_stars>0 /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.apache.airavata.job; import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; import org.airavata.appcatalog.cpi.AppCatalog; import org.apache.aiaravata.application.catalog.data.impl.AppCatalogFactory; import org.apache.airavata.common.utils.MonitorPublisher; import org.apache.airavata.gfac.core.monitor.MonitorID; import org.apache.airavata.gfac.monitor.impl.push.amqp.AMQPMonitor; import org.apache.airavata.gsi.ssh.api.Cluster; import org.apache.airavata.gsi.ssh.api.SSHApiException; import org.apache.airavata.gsi.ssh.api.ServerInfo; import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo; import org.apache.airavata.gsi.ssh.api.job.JobDescriptor; import org.apache.airavata.gsi.ssh.impl.PBSCluster; import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo; import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription; import org.apache.airavata.model.appcatalog.computeresource.DataMovementInterface; import org.apache.airavata.model.appcatalog.computeresource.DataMovementProtocol; import org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand; import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface; import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol; import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager; import org.apache.airavata.model.appcatalog.computeresource.ResourceJobManagerType; import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission; import org.apache.airavata.model.appcatalog.computeresource.SecurityProtocol; import org.apache.airavata.model.messaging.event.JobStatusChangeEvent; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class AMQPMonitorTest { private String myProxyUserName; private String myProxyPassword; private String certificateLocation; private String pbsFilePath; private String workingDirectory; private MonitorPublisher monitorPublisher; private BlockingQueue<MonitorID> finishQueue; private BlockingQueue<MonitorID> pushQueue; private Thread pushThread; private String proxyFilePath; private ComputeResourceDescription computeResourceDescription; @Before public void setUp() throws Exception { System.setProperty("myproxy.username", "ogce"); System.setProperty("myproxy.password", ""); System.setProperty("basedir", "/Users/lahirugunathilake/work/airavata/sandbox/gsissh"); System.setProperty("gsi.working.directory", "/home1/01437/ogce"); System.setProperty("trusted.cert.location", "/Users/lahirugunathilake/Downloads/certificates"); System.setProperty("proxy.file.path", "/Users/lahirugunathilake/Downloads/x509up_u503876"); myProxyUserName = System.getProperty("myproxy.username"); myProxyPassword = System.getProperty("myproxy.password"); workingDirectory = System.getProperty("gsi.working.directory"); certificateLocation = System.getProperty("trusted.cert.location"); proxyFilePath = System.getProperty("proxy.file.path"); System.setProperty("connection.name", "xsede"); if (myProxyUserName == null || myProxyPassword == null || workingDirectory == null) { System.out.println(">>>>>> Please run tests with my proxy user name and password. " + "E.g :- mvn clean install -Dmyproxy.user=xxx -Dmyproxy.password=<PASSWORD> -Dgsi.working.directory=/path<<<<<<<"); throw new Exception("Need my proxy user name password to run tests."); } monitorPublisher = new MonitorPublisher(new EventBus()); pushQueue = new LinkedBlockingQueue<MonitorID>(); finishQueue = new LinkedBlockingQueue<MonitorID>(); final AMQPMonitor amqpMonitor = new AMQPMonitor(monitorPublisher, pushQueue, finishQueue,proxyFilePath,"xsede", Arrays.asList("info1.dyn.teragrid.org,info2.dyn.teragrid.org".split(","))); try { (new Thread(){ public void run(){ amqpMonitor.run(); } }).start(); } catch (Exception e) { e.printStackTrace(); } computeResourceDescription = new ComputeResourceDescription("TestComputerResoruceId", "TestHostName"); computeResourceDescription.setHostName("stampede-host"); computeResourceDescription.addToIpAddresses("login1.stampede.tacc.utexas.edu"); ResourceJobManager resourceJobManager = new ResourceJobManager("1234", ResourceJobManagerType.SLURM); Map<JobManagerCommand, String> commandMap = new HashMap<JobManagerCommand, String>(); commandMap.put(JobManagerCommand.SUBMISSION, "test"); resourceJobManager.setJobManagerCommands(commandMap); resourceJobManager.setJobManagerBinPath("/usr/bin/"); resourceJobManager.setPushMonitoringEndpoint("push"); // TODO - add monitor mode SSHJobSubmission sshJobSubmission = new SSHJobSubmission("TestSSHJobSubmissionInterfaceId", SecurityProtocol.GSI, resourceJobManager); AppCatalog appCatalog = AppCatalogFactory.getAppCatalog(); String jobSubmissionID = appCatalog.getComputeResource().addSSHJobSubmission(sshJobSubmission); JobSubmissionInterface jobSubmissionInterface = new JobSubmissionInterface(jobSubmissionID, JobSubmissionProtocol.SSH, 1); computeResourceDescription.addToJobSubmissionInterfaces(jobSubmissionInterface); computeResourceDescription.addToDataMovementInterfaces(new DataMovementInterface("4532", DataMovementProtocol.SCP, 1)); } @Test public void testAMQPMonitor() throws SSHApiException { /* now have to submit a job to some machine and add that job to the queue */ //Create authentication GSIAuthenticationInfo authenticationInfo = new MyProxyAuthenticationInfo(myProxyUserName, myProxyPassword, "<PASSWORD>", 7512, 17280000, certificateLocation); // Server info ServerInfo serverInfo = new ServerInfo("ogce", "login1.stampede.tacc.utexas.edu",2222); Cluster pbsCluster = new PBSCluster(serverInfo, authenticationInfo, org.apache.airavata.gsi.ssh.util.CommonUtils.getPBSJobManager("/usr/bin/")); // Execute command System.out.println("Target PBS file path: " + workingDirectory); // constructing the job object String jobName = "GSI_SSH_SLEEP_JOB"; JobDescriptor jobDescriptor = new JobDescriptor(); jobDescriptor.setWorkingDirectory(workingDirectory); jobDescriptor.setShellName("/bin/bash"); jobDescriptor.setJobName(jobName); jobDescriptor.setExecutablePath("/bin/echo"); jobDescriptor.setAllEnvExport(true); jobDescriptor.setMailOptions("n"); jobDescriptor.setStandardOutFile(workingDirectory + File.separator + "application.out"); jobDescriptor.setStandardErrorFile(workingDirectory + File.separator + "application.err"); jobDescriptor.setNodes(1); jobDescriptor.setProcessesPerNode(1); jobDescriptor.setQueueName("normal"); jobDescriptor.setMaxWallTime("60"); jobDescriptor.setAcountString("TG-STA110014S"); List<String> inputs = new ArrayList<String>(); jobDescriptor.setOwner("ogce"); inputs.add("<NAME>"); jobDescriptor.setInputValues(inputs); //finished construction of job object System.out.println(jobDescriptor.toXML()); String jobID = pbsCluster.submitBatchJob(jobDescriptor); System.out.println(jobID); try { pushQueue.add(new MonitorID(computeResourceDescription, jobID,null,null,null, "ogce", jobName)); } catch (Exception e) { e.printStackTrace(); } try { pushThread.join(); } catch (InterruptedException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } class InnerClassAMQP{ @Subscribe private void getStatus(JobStatusChangeEvent status){ Assert.assertNotNull(status); pushThread.interrupt(); } } monitorPublisher.registerListener(new InnerClassAMQP()); // try { // pushThread.join(5000); // Iterator<MonitorID> iterator = pushQueue.iterator(); // MonitorID next = iterator.next(); // org.junit.Assert.assertNotNull(next.getStatus()); // } catch (Exception e) { // e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. // } } }
<reponame>yindaheng98/LittleProgramSet import cv2 def liangdu(frame): gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) score = gray.mean() score1 = gray.var() return [score, score1]
Multiuser detection using iterative (turbo) decoding techniques Multiuser detection has become an important technique for the third-generation wireless communications, in particular, code division multiple access (CDMA). A soft-in soft-out (SISO) multiuser detection architecture based on a cross-entropy minimization technique has been developed. Minimum cross entropy is an optimal lossless decoding algorithm but its complexity limits its practical implementation. Hence, the algorithm is implemented analogous to turbo decoding. The proposed architecture uses a conventional CDMA system followed by two cascaded logarithm maximum a posterior (log-MAP) SISO decoders. Channel information is fed into the SISO decoder, which generate the L-values and processing proceeds on an iterative manner similar to the decoding of the turbo codes. The cross-entropy minimization provides a stop criterion for the multiuser detection to prevent any unnecessary iteration when no further improvement is possible.
"I am delighted that the overwhelming majority of MEPs backed this deal. It will make trials more transparent, give hope to patients needing new and better treatments, and boost the number of skilled research jobs here in Europe", said Glenis Willmott (S&D, UK), who steered the legislation through the European Parliament. Her report was approved by 594 votes to 17, with 13 abstentions. "The new law will also offer hope to the millions of people in Europe suffering from rare diseases, by making cross-border trials much easier to conduct. There are simply not enough patients in one country alone to develop new or improved treatments for rare diseases. By working at EU level we can reduce the huge cost and burden of conducting trials across borders" she added. The legislation will streamline the rules on clinical trials across Europe, facilitating cross-border cooperation to enable larger, more reliable trials, as well as those on products for rare diseases. It simplifies reporting procedures, and empowers the European Commission to do checks. Once a clinical trial sponsor has submitted an application dossier to a member state, the member state will have to respond to it within fixed deadlines. Transparency: studies to be made publicly available In negotiations, MEPs amended the draft to improve transparency, by requiring that detailed summaries be published in a publicly-accessible EU database, including full clinical study reports to be published once a decision on marketing authorisation has been taken or the marketing authorisation application has been withdrawn. Fines would be imposed on sponsors who do not comply with these requirements. Background The Commission proposal aims to remedy the shortcomings of the existing Clinical Trials Directive by setting up a uniform framework for the authorisation of clinical trials by all the member states concerned with a given single assessment outcome. Simplified reporting procedures, and the possibility for the Commission to do checks, are among the law’s key innovations. Procedure: Co-decision (Ordinary legislative procedure), first reading agreement
via Dr. Ali Salim Raped, Killed Pregnant Woman: Deanna Ballman,23 Murdered Responding To Craigslist Ad, Continued To Abuse Corpse And Solicit Other Women To Kill : News : Mstarz. via Tundra Tabloids An Ohio man has been charged with raping and killing 23-year-old woman. Dr. Ali Salim is charged with murdering Deanna Ballman after she responded to a Craigslist ad. The Doctor allegedly injected the expecting mother with a lethal dose of heroin killing her and her unborn baby and later doing ‘inhumane’ things to her corpse. The mother of two was found dead in the backseat of her car outside of New Albany on August 1. The Pakistani born doctor was charged with two counts of murder as well as rape, felonious assault, corrupting another with drugs, kidnapping, tampering with evidence and abuse of a corpse. The 44-year-old doctor has pleaded not guilty to the charges and will be released on $1 million bail Friday. Salim had put up an ad on Craigslist looking for models to which Ballamn responded to, but told her family she was responding to a housecleaning ad. In September investigators searched the Salim’s Ohio home and confiscated his laptop, camera, and other items. Kyle Rohrer, assistant county prosecutor said Salim mistreated Ballman’s corpse “in a very inhumane way.” According to 10TV, Salim had sent a woman an offer to paint organs on her body for $300 in September and insisted that the work environment be ‘drama free,’ adding ‘I just don’t need the drama.’ Salim allegedly told the woman, “wear anything but black or brown bra, and panties are essential. I will take most shots from the back.” The coroner found Ballamn had died from a Heroin overdose and had substances such as, morphine and codeine in her system. Ballman’s urine contained morphine, monoacetylmorphine, codeine, acetylocodine and diacetylmorphine. Rohrer said, “We believe this is not an isolated incident and that he remains a threat to others in the public if he’s released.” Rohrer also claims that since Salim is a Pakistani native he has reason to flee the country and asked for his bail to be raised to $5 million. Salim’s attorney, Sam Shamansky doesn’t believe his client had reason to leave the country after living her for almost 20-years, “If he was going to flee, it would have happened,” More from CBS: Deanna Ballman Murder: Ali Salim, Ohio doctor, charged in 2012 murder of pregnant woman Licensure information from the state indicates Salim was born in Pakistan and trained there at King Edward Medical College, graduating in 1993. He told the State Medical Board of Ohio that his specialties were internal medicine, emergency medicine and psychiatry. Unrelated:
Experimental Investigation of Boundary Conditions Effects on Spontaneous Imbibition in Oil-Water and Gas-Water Systems for Tight Sandstones As potential alternative resources, tight oil and gas reservoirs are generally exploited with multistage hydraulic fracturing technology to meet the rising demand for energy in the world. Considerable production recovered by the infiltration of fracturing fluids into the rock matrix shows that spontaneous imbibition (SI) is an effective oil recovery method. Through the use of Nuclear Magnetic Resonance (NMR) detection technique, the features of SI in oil-water and gas-water systems for tight sandstones were studied. The T2 spectra of these samples were used to reflect the migration patterns of fluids in various pores under different imbibition systems. In addition, the impacts of the boundary conditions on imbibition outcomes were also determined via the variations in T2 spectra under imbibition stages. The results indicate that tight sandstone samples display the feature of complex pore structure with a wide range of pore size distribution, and the dominant types are micropores and small mesopores. With the progression of imbibition experiments, oil in micropores will be more easily displaced by wetting fluid and flow out through interconnected smaller pores due to greater capillary pressure. The majority of the production through imbibition can be attributed to the contribution made by the micropores. However, water could not enter the mesopores readily under the gas-water system if it is only driven by capillary pressure owing to the snap-off effect of gas. The boundary conditions have notable effects on the imbibition rate and ultimate recovery for the oil-water system and increasing the areas available for water imbibition helps to maintain higher imbibition rate and recovery. However, regarding the gas-water system, boundary conditions have little influence on the imbibition recovery but have a remarkable influence on the imbibition rate. The traditional scaling equations used to scale the imbibition data for both the oil-water and gas-water systems and predict imbibition recovery is acceptable if the wettability of the tight medium remains unchanged. This research aims to uncover the imbibition characteristics of fluids and the nontrivial effect of boundary conditions in tight sandstone samples, which would contribute to the successful development of tight formations.
This week's highlighted educator from Farmersville Elementary School in Mount Vernon can't stand a mess, so she keeps her classroom organized. EVANSVILLE, Ind. — The Courier & Press wants to highlight a group of people who impact the younger generations every day -- teachers. Meet Brooke Sanders, a second grade teacher at Farmersville Elementary School where she has taught since 2012. Sanders said she is a patient person, which helps because you need that as an educator. Brooke Sanders: In high school my first job was working at Burdette. Out of college my first job was at Marrs Elementary school working as a special education assistant. Sanders: Making sure they have lots of breaks and movement throughout the day. Sanders: A picture of my son, my bottle of water and tons of colorful pens! Sanders: There are so many funny things that get asked or said by students. I can't remember anything off the top of my head but what probably gets me laughing the most are some of the drawings that somehow tend to look like some inappropriate things or some of their writing where things are spelled incorrectly and again, it turns into something pretty hilarious. Like often is written as lick. That one gets me because there are always some interesting sentences! Sanders: Paper Mate Flair marker/pens...they are the best and come in awesome colors! Sanders: Whiteboard, no one has time for chalk dust. Sanders: Reading, and it's still my favorite to teach. I've always loved reading and getting to read to my class is one of my favorite things about teaching. Sanders: Probably dealing with students who really need a lot of extra love and support. Students who have difficult things going on at home and trying to do the best I can to make school a place where they want to be and finding a way to support their own individual needs when it comes to their education. Sanders: The kids! I absolutely love the students and personalities I have each year. I often say that I wish we had the time to just sit and talk with our students more. We have so much curriculum to cover that there isn't enough time for that anymore. I find that when we go on a field trip or sometimes at recess where we have some downtime, I just love getting to sit and talk to them about things they enjoy, things going on at home, etc. Sanders: Pink! Bright and happy, which I would say is like my personality, just not first thing in the morning! Sanders: I have no idea! My mom has always been in the medical field and that's not something I could ever see myself doing. I would probably enjoy something in the fashion industry. If I could deal with shoes and clothes all day, I think I'd enjoy that. I'm definitely a girly girl and enjoy planning my clothes for work each day. Sanders: Turoni's pizza...no question. It's the best! Sanders: I was going to be named Brianna, since my dad's first name is Bryan, but my mom decided on Brooke. My middle name is Suanne which is my grandmother and my mom's middle names put together. Sanders: YES! I had an overbite and had to wear headgear at night. It was terrible. Dr. Brown was my orthodontist, and he comes and presents to the 2nd graders every year. I'm proof that braces can work miracles! Sanders: Probably organization. I'm a little OCD, and I can't handle a mess, so that carries over to my classroom. I'm also a really patient person and that's definitely something you need as an educator! Sanders: I'm that person that if you're riding with me it's likely we'll skip from 90's boy-bands, to country, to rap and that's just how it works with me. I love it all, and it totally depends on what I'm in the mood for. Sanders: I hate to answer this but it's probably "Toy Story" or "Trolls" because my son watched them nonstop the entire drive to and from Florida on Spring Break. Though I couldn't see it, I heard it ... every word. Sanders: When it's raining/thundering...but only when I'm at home and able to be in bed or snuggled up with a blanket on the couch. Sanders: I used to play school all the time growing up. I feel like I just always knew that was what I wanted to do. Sanders: It's a career that can be extremely challenging, but it can be so rewarding. I've been teaching just long enough to where I'm starting to see kids in junior high and high school doing some really great things.
FANTASY PLAYS: Draft do-over … Devonta Freeman No. 1? You spent the entire summer analyzing fantasy draft prospects, poring over stats and depth charts and parsing quotes by coaches during offseason workouts in search of sound early round picks and sleepers. You entered the season absolutely convinced that you put together a formidable team, the equivalent of a confident coach after meticulous game-planning and film-room study. The reality? Your team is terrible and half of the draft picks aren’t even on your roster anymore. It’s an all-too-familiar refrain that highlights the fickle nature of fantasy football. Draft preparation means very little as injuries mount, players do not live up to offseason hype and teams exploit matchups that are not visible to people outside the coaches’ room. To illustrate the point, this week’s installment of fantasy plays consists of a draft day re-do six weeks into the season. It’s meant to not only be an entertaining window into how much things can change in a few short weeks but also to demonstrate why fantasy players should devote more time to regular season analysis. Too much time is wasted in draft prep when you really need to be glued to the RedZone channel and reading in-season NFL coverage for research. 1. LE’VEON BELL: The players who stuck to their guns and selected Bell with the first overall pick despite a two-game suspension made the right decision. Bell is an outstanding running back who seems destined for even better things as the season goes on. 2. DEVONTA FREEMAN: Just think how ridiculous it sounds to even be having a conversation about the merits of Freeman as a first or second overall pick. Freeman’s average draft position on ESPN was 112.6. Through six games, he has 10 touchdowns and 505 rushing yards. He’s been so good that you could definitely make the case for him being No. 1. 3. DeANDRE HOPKINS: You know what is really ridiculous? Hopkins is on pace for more than 1,900 yards receiving. Granted, Houston’s porous secondary has put the Texans in big holes and allowed Hopkins to clean up in garbage time, but he’s still having an amazing year, all the more impressive given the ongoing QB rotation of Ryan Mallett and Brian Hoyer. 4. JULIO JONES: At one point this season, he might have gone No. 1 overall in a redraft. His hamstring injury has clearly affected his production in recent weeks, but his 600+ rushing yards still put him in the top five in my book. 5. ANTONIO BROWN: Another player who warranted higher consideration early in the season after his torrid start. His drop-off was a direct result of Michael Vick taking over quarterback duties, and it seems safe to say that his numbers will shoot back up when Ben Roethlisberger returns from his injury (as early as this week). 6. ADRIAN PETERSON: He has only reached the end zone three times, but he still has 432 rushing yards coming off no preseason carries and virtually no action in 2014. Hard to keep him out of the top 10. 7. TODD GURLEY: He was a fifth-round pick in many leagues as owners were leery about his knee injury. But 314 yards rushing through essentially two games and suddenly he looks like a legit first-rounder. Listing him seven is probably too low. 8. CHRIS IVORY: Teammate Brandon Marshall’s bold proclamation last week that Ivory may be the best back in the league and destined for 1,500 yards caused some eyes to roll. But the numbers don’t lie. If he stays healthy on a run-first Jets team, then this will be a great year for Ivory owners. 9. ODELL BECKHAM: His numbers haven’t been dazzling, and an injury slowed him the last two weeks, but he has to be in your first round. 10. DOUG MARTIN: The Tampa Bay back apparently hates the ”Muscle Hamster” nickname, but he loves his start in 2015 after finally being free of injuries. Not bad for a guy with an average draft position of 97 on ESPN. This list is by no means scientific, but merely a conversation starter about how much the landscape has changed in less than two months. You could easily add names like Rob Gronkowski, A.J. Green, Brandon Marshall and Matt Forte to the list. But note who isn’t on there: Jamaal Charles, Eddie Lacy, Dez Bryant, Calvin Johnson and Andrew Luck. They are proof that you can do all the homework you want, but sometimes it just doesn’t work out for your vaunted first-round picks.
<filename>src/lib/prof/Struct-Tree.hpp // -*-Mode: C++;-*- // * BeginRiceCopyright ***************************************************** // // $HeadURL$ // $Id$ // // -------------------------------------------------------------------------- // Part of HPCToolkit (hpctoolkit.org) // // Information about sources of support for research and development of // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'. // -------------------------------------------------------------------------- // // Copyright ((c)) 2002-2019, Rice University // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of Rice University (RICE) nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // This software is provided by RICE and contributors "as is" and any // express or implied warranties, including, but not limited to, the // implied warranties of merchantability and fitness for a particular // purpose are disclaimed. In no event shall RICE or contributors be // liable for any direct, indirect, incidental, special, exemplary, or // consequential damages (including, but not limited to, procurement of // substitute goods or services; loss of use, data, or profits; or // business interruption) however caused and on any theory of liability, // whether in contract, strict liability, or tort (including negligence // or otherwise) arising in any way out of the use of this software, even // if advised of the possibility of such damage. // // ******************************************************* EndRiceCopyright * //*************************************************************************** // // File: // $HeadURL$ // // Purpose: // [The purpose of this file] // // Description: // [The set of functions, macros, etc. defined in the file] // //*************************************************************************** #ifndef prof_Prof_Struct_Tree_hpp #define prof_Prof_Struct_Tree_hpp //************************* System Include Files **************************** #include <iostream> #include <string> #include <list> #include <set> #include <map> #include <typeinfo> //*************************** User Include Files **************************** #include <include/uint.h> #include "Metric-IData.hpp" #include <lib/binutils/VMAInterval.hpp> #include <lib/support/diagnostics.h> #include <lib/support/FileUtil.hpp> #include <lib/support/Logic.hpp> #include <lib/support/NonUniformDegreeTree.hpp> #include <lib/support/RealPathMgr.hpp> #include <lib/support/SrcFile.hpp> using SrcFile::ln_NULL; #include <lib/support/Unique.hpp> //*************************** Forward Declarations ************************** namespace Prof { namespace Struct { class ANode; // Some possibly useful containers typedef std::list<ANode*> ANodeList; typedef std::set<ANode*> ANodeSet; } // namespace Struct } // namespace Prof //*************************** Forward Declarations ************************** namespace Prof { namespace Struct { // FIXME: move these into their respective classes... class Group; class GroupMap : public std::map<std::string, Group*> { }; class LM; class LMMap : public std::map<std::string, LM*> { }; // ProcMap: This is is a multimap because procedure names are // sometimes "generic", i.e. not qualified by types in the case of // templates, resulting in duplicate names class Proc; class ProcMap : public std::multimap<std::string, Proc*> { }; class File; class FileMap : public std::map<std::string, File*> { }; class Stmt; class StmtMap : public std::map<SrcFile::ln, Stmt*> { }; } // namespace Struct } // namespace Prof //*************************************************************************** // Tree //*************************************************************************** namespace Prof { namespace Struct { class Root; class Tree : public Unique { public: enum { // Output flags OFlg_Compressed = (1 << 1), // Write in compressed format OFlg_LeafMetricsOnly = (1 << 2), // Write metrics only at leaves OFlg_Debug = (1 << 3) // Debug: show xtra source line info }; static const std::string UnknownLMNm; static const std::string UnknownFileNm; static const std::string UnknownProcNm; static const SrcFile::ln UnknownLine; static const std::string PartialUnwindProcNm; public: // ------------------------------------------------------- // Create/Destroy // ------------------------------------------------------- Tree(const char* name, Root* root = NULL); Tree(const std::string& name, Root* root = NULL) { Tree(name.c_str(), root); } virtual ~Tree(); // ------------------------------------------------------- // Tree data // ------------------------------------------------------- Root* root() const { return m_root; } void root(Root* x) { m_root = x; } bool empty() const { return (m_root == NULL); } std::string name() const; // ------------------------------------------------------- // Write contents // ------------------------------------------------------- std::ostream& writeXML(std::ostream& os = std::cerr, uint oFlags = 0) const; // Dump contents for inspection (use flags from ANode) std::ostream& dump(std::ostream& os = std::cerr, uint oFlags = 0) const; void ddump() const; private: Root* m_root; }; // TODO: integrate with Tree::writeXML() void writeXML(std::ostream& os, const Prof::Struct::Tree& strctTree, bool prettyPrint = true); } // namespace Struct } // namespace Prof //*************************************************************************** namespace Prof { namespace Struct { //*************************************************************************** // ANode, ACodeNode. //*************************************************************************** // FIXME: It would make more sense for Group and LM to // simply be ANodes and not ACodeNodes, but the assumption that // *only* a Root is not a ACodeNode is deeply embedded and would // take a while to untangle. class ANode; // Base class for all nodes class ACodeNode; // Base class for everyone but Root class Root; class Group; class LM; class File; class Proc; class Alien; class Loop; class Stmt; class Ref; // --------------------------------------------------------- // ANode: The base node for a program scope tree // --------------------------------------------------------- class ANode: public NonUniformDegreeTreeNode, public Metric::IData { public: enum ANodeTy { TyRoot = 0, TyGroup, TyLM, TyFile, TyProc, TyAlien, TyLoop, TyStmt, TyRef, TyANY, TyNUMBER }; static const std::string& ANodeTyToName(ANodeTy tp); static const std::string& ANodeTyToXMLelement(ANodeTy tp); static ANodeTy IntToANodeTy(long i); private: static const std::string ScopeNames[TyNUMBER]; public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- ANode(ANodeTy ty, ANode* parent = NULL) : NonUniformDegreeTreeNode(parent), Metric::IData(), m_type(ty), m_visible(true) { m_id = s_nextUniqueId++; m_origId = 0; } virtual ~ANode() { DIAG_DevMsgIf(0, "~ANode::ANode: " << toString_id() << " " << std::hex << this << std::dec); } // clone: return a shallow copy, unlinked from the tree virtual ANode* clone() { return new ANode(*this); } protected: ANode(const ANode& x) { *this = x; } // deep copy of internals (but without children) ANode& operator=(const ANode& x) { if (this != &x) { NonUniformDegreeTreeNode::zeroLinks(); Metric::IData::operator=(x); m_type = x.m_type; m_id = x.m_id; m_visible = x.m_visible; m_origId = x.m_origId; } return *this; } public: // -------------------------------------------------------- // General data // -------------------------------------------------------- ANodeTy type() const { return m_type; } // id: a unique id; 0 is reserved for a NULL value uint id() const { return m_id; } static const uint Id_NULL = 0; // maxId: the maximum id of all structure nodes static uint maxId() { return s_nextUniqueId - 1; } // name: // nameQual: qualified name [built dynamically] virtual const std::string& name() const { return ANodeTyToName(type()); } virtual std::string nameQual() const { return name(); } void setInvisible() { m_visible = false; } bool isVisible() const { return m_visible == true; } // -------------------------------------------------------- // Tree navigation // -------------------------------------------------------- ANode* parent() const { return static_cast<ANode*>(NonUniformDegreeTreeNode::Parent()); } ANode* firstChild() const { return static_cast<ANode*>(NonUniformDegreeTreeNode::FirstChild()); } ANode* lastChild() const { return static_cast<ANode*>(NonUniformDegreeTreeNode::LastChild()); } ANode* nextSibling() const { // siblings are linked in a circular list if ((parent()->lastChild() != this)) { return static_cast<ANode*>(NonUniformDegreeTreeNode::NextSibling()); } return NULL; } ANode* prevSibling() const { // siblings are linked in a circular list if ((parent()->firstChild() != this)) { return static_cast<ANode*>(NonUniformDegreeTreeNode::PrevSibling()); } return NULL; } // -------------------------------------------------------- // ancestor: find first ANode in path from this to root with given type // (Note: We assume that a node *can* be an ancestor of itself.) // -------------------------------------------------------- ANode* ancestor(ANodeTy type) const; ANode* ancestor(ANodeTy ty1, ANodeTy ty2) const; ANode* ancestor(ANodeTy ty1, ANodeTy ty2, ANodeTy ty3) const; Root* ancestorRoot() const; Group* ancestorGroup() const; LM* ancestorLM() const; File* ancestorFile() const; Proc* ancestorProc() const; Alien* ancestorAlien() const; Loop* ancestorLoop() const; Stmt* ancestorStmt() const; ACodeNode* ancestorProcCtxt() const; // return ancestor(TyAlien|TyProc) ACodeNode* ACodeNodeParent() const; // -------------------------------------------------------- // Metrics (cf. CCT::ANode) // -------------------------------------------------------- // aggregates metrics from children. [mBegId, mEndId) forms an // inclusive interval for batch processing. In particular, 'raw' // metrics are independent of all other raw metrics. void aggregateMetrics(uint mBegId, uint mEndId); void aggregateMetrics(uint mBegId) { aggregateMetrics(mBegId, mBegId + 1); } // pruneByMetrics: recursively prunes all (children) of the current // node for which hasMetrics() is false. void pruneByMetrics(); public: // -------------------------------------------------------- // Paths and Merging // -------------------------------------------------------- // leastCommonAncestor: Given two ANode nodes, return the least // common ancestor (deepest nested common ancestor) or NULL. static ANode* leastCommonAncestor(ANode* n1, ANode* n2); // distance: Given two ANode nodes, a node and some ancestor, // return the distance of the path between the two. The distance // between a node and its direct ancestor is 1. If there is no path // between the two nodes, returns a negative number; if the two // nodes are equal, returns 0. static int distance(ANode* ancestor, ANode* descendent); // arePathsOverlapping: Given two nodes and their least common // ancestor, lca, returns whether the paths from the nodes to lca // overlap. // // Let d1 and d2 be two nodes descended from their least common // ancestor, lca. Furthermore, let the path p1 from d1 to lca be as // long or longer than the path p2 from d2 to lca. (Thus, d1 is // nested as deep or more deeply than d2.) If the paths p1 and p2 are // overlapping then d2 will be somewhere on the path between d1 and // lca. // // Examples: // 1. Overlapping: lca --- d2 --- ... --- d1 // // 2. Divergent: lca --- d1 // \--- d2 // // 3. Divergent: lca ---...--- d1 // \---...--- d2 static bool arePathsOverlapping(ANode* lca, ANode* desc1, ANode* desc2); // mergePaths: Given divergent paths (as defined above), merges the // path 'lca' -> 'node_src' into the path 'lca' --> 'node_dst'. If a // merge takes place returns true. static bool mergePaths(ANode* lca, ANode* node_dst, ANode* node_src); // merge: Given two nodes, 'node_src' and 'node_dst', merges the // former into the latter, if possible. If the merge takes place, // deletes 'node_src' and returns true; otherwise returns false. static bool merge(ANode* node_dst, ANode* node_src); // isMergable: Returns whether 'node_src' is capable of being merged // into 'node_dst' static bool isMergable(ANode* node_dst, ANode* node_src); // -------------------------------------------------------- // XML output // -------------------------------------------------------- std::string toStringXML(uint oFlags = 0, const char* pre = "") const; virtual std::string toXML(uint oFlags = 0) const; virtual std::ostream& writeXML(std::ostream& os = std::cout, uint oFlags = 0, const char* pre = "") const; void ddumpXML() const; // -------------------------------------------------------- // Other output // -------------------------------------------------------- void CSV_DumpSelf(const Root &root, std::ostream& os = std::cout) const; virtual void CSV_dump(const Root &root, std::ostream& os = std::cout, const char* file_name = NULL, const char* proc_name = NULL, int lLevel = 0) const; // -------------------------------------------------------- // debugging // -------------------------------------------------------- virtual std::string toString(uint oFlags = 0, const char* pre = "") const; std::string toString_id(uint oFlags = 0) const; std::string toStringMe(uint oFlags = 0, const char* pre = "") const; // dump std::ostream& dump(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; void ddump() const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; protected: bool writeXML_pre(std::ostream& os = std::cout, uint oFlags = 0, const char* prefix = "") const; void writeXML_post(std::ostream& os = std::cout, uint oFlags = 0, const char* prefix = "") const; private: void ctorCheck() const; void dtorCheck() const; static uint s_nextUniqueId; protected: ANodeTy m_type; // obsolete with typeid(), but hard to replace uint m_id; bool m_visible; public: // original node id from .hpcstruct file (for debug) uint m_origId; }; // -------------------------------------------------------------------------- // ACodeNode is a base class for all scopes other than TyRoot and TyLM. // Describes some kind of code, i.e. Files, Procedures, Loops... // -------------------------------------------------------------------------- class ACodeNode : public ANode { protected: ACodeNode(ANodeTy ty, ANode* parent = NULL, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL, VMA begVMA = 0, VMA endVMA = 0) : ANode(ty, parent), m_begLn(ln_NULL), m_endLn(ln_NULL) { m_lineno_frozen = false; setLineRange(begLn, endLn); if (!VMAInterval::empty(begVMA, endVMA)) { m_vmaSet.insert(begVMA, endVMA); } m_scope_filenm = ""; m_scope_lineno = 0; } ACodeNode(const ACodeNode& x) : ANode(x.m_type) { *this = x; } ACodeNode& operator=(const ACodeNode& x) { // shallow copy if (this != &x) { ANode::operator=(x); m_begLn = x.m_begLn; m_endLn = x.m_endLn; // m_vmaSet } return *this; } public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- virtual ~ACodeNode() { } virtual ANode* clone() { return new ACodeNode(*this); } // -------------------------------------------------------- // // -------------------------------------------------------- // Line range in source code SrcFile::ln begLine() const { return m_begLn; } void begLine(SrcFile::ln x) { m_begLn = x; } SrcFile::ln endLine() const { return m_endLn; } void endLine(SrcFile::ln x) { m_endLn = x; } void setLineRange(SrcFile::ln begLn, SrcFile::ln endLn, int propagate = 1); void expandLineRange(SrcFile::ln begLn, SrcFile::ln endLn, int propagate = 1); void linkAndSetLineRange(ACodeNode* parent); void checkLineRange(SrcFile::ln begLn, SrcFile::ln endLn) { DIAG_Assert(Logic::equiv(begLn == ln_NULL, endLn == ln_NULL), "ACodeNode::checkLineRange: b=" << begLn << " e=" << endLn); DIAG_Assert(begLn <= endLn, "ACodeNode::checkLineRange: b=" << begLn << " e=" << endLn); DIAG_Assert(Logic::equiv(m_begLn == ln_NULL, m_endLn == ln_NULL), "ACodeNode::checkLineRange: b=" << m_begLn << " e=" << m_endLn); } void freezeLine() { m_lineno_frozen = true; } void thawLine() { m_lineno_frozen = false; } // ------------------------------------------------------- // A set of *unrelocated* VMAs associated with this scope // ------------------------------------------------------- const VMAIntervalSet& vmaSet() const { return m_vmaSet; } VMAIntervalSet& vmaSet() { return m_vmaSet; } // ------------------------------------------------------- // containsLine: returns true if this scope contains line number // 'ln'. A non-zero beg_epsilon and end_epsilon allows fuzzy // matches by expanding the interval of the scope. // // containsInterval: returns true if this scope fully contains the // interval specified by [begLn...endLn]. A non-zero beg_epsilon // and end_epsilon allows fuzzy matches by expanding the interval of // the scope. // // Note: We assume that it makes no sense to compare against ln_NULL. // ------------------------------------------------------- bool containsLine(SrcFile::ln ln) const { return (m_begLn != ln_NULL && (m_begLn <= ln && ln <= m_endLn)); } bool containsLine(SrcFile::ln ln, int beg_epsilon, int end_epsilon) const; bool containsInterval(SrcFile::ln begLn, SrcFile::ln endLn) const { return (containsLine(begLn) && containsLine(endLn)); } bool containsInterval(SrcFile::ln begLn, SrcFile::ln endLn, int beg_epsilon, int end_epsilon) const { return (containsLine(begLn, beg_epsilon, end_epsilon) && containsLine(endLn, beg_epsilon, end_epsilon)); } ACodeNode* ACodeNodeWithLine(SrcFile::ln ln) const; // compare: Return negative if x < y; 0 if x == y; positive // otherwise. If x == y, break ties using VMAIntervalSet and then // by name attributes. static int compare(const ACodeNode* x, const ACodeNode* y); ACodeNode* nextSiblingNonOverlapping() const; // -------------------------------------------------------- // // -------------------------------------------------------- virtual std::string nameQual() const { return codeName(); } // returns a string representing the code name in the form: // loadmodName // [loadmodName]fileName // [loadmodName]<fileName>procName // [loadmodName]<fileName>begLn-endLn virtual std::string codeName() const; std::string lineRange() const; // -------------------------------------------------------- // XML output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual std::string XMLLineRange(uint oFlags) const; virtual std::string XMLVMAIntervals(uint oFlags) const; virtual void CSV_dump(const Root &root, std::ostream& os = std::cout, const char* file_name = NULL, const char* proc_name = NULL, int lLevel = 0) const; // -------------------------------------------------------- // debugging // -------------------------------------------------------- virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; protected: // NOTE: currently designed for PROCs void relocate(); void relocateIf() { if (parent() && type() == ANode::TyProc) { // typeid(*this) == typeid(ANode::Proc) relocate(); } } std::string codeName_LM_F() const; protected: SrcFile::ln m_begLn; SrcFile::ln m_endLn; VMAIntervalSet m_vmaSet; // -------------------------------------------------------- // Inline support -- Save the location (file name, line num) of an // alien scope (loop) node to help find the same scope in a later // InlineNode sequence inside the location manager. // -------------------------------------------------------- private: std::string m_scope_filenm; SrcFile::ln m_scope_lineno; bool m_lineno_frozen; public: void setScopeLocation(std::string &file, SrcFile::ln line) { m_scope_filenm = file; m_scope_lineno = line; } std::string & getScopeFileName() { return m_scope_filenm; } SrcFile::ln getScopeLineNum() { return m_scope_lineno; } }; //*************************************************************************** // Root, Group, LM, File, Proc, Loop, // Stmt //*************************************************************************** // -------------------------------------------------------------------------- // Root is root of the scope tree // -------------------------------------------------------------------------- class Root: public ANode { protected: Root(const Root& x) : ANode(x.m_type) { *this = x; } Root& operator=(const Root& x); public: Root(const char* nm) : ANode(TyRoot, NULL) { Ctor(nm); } Root(const std::string& nm) : ANode(TyRoot, NULL) { Ctor(nm.c_str()); } virtual ~Root() { delete groupMap; delete lmMap_realpath; delete lmMap_basename; } virtual const std::string& name() const { return m_name; } void name(const char* x) { m_name = (x) ? x : ""; } void name(const std::string& x) { m_name = x; } // -------------------------------------------------------- // // -------------------------------------------------------- // findLM: First, try to find by nm_real = realpath(nm). If that is // unsuccesful, try to find by nm_base = basename(nm_real) if // nm_base == nm_real. LM* findLM(const char* nm) const; LM* findLM(const std::string& nm) const { return findLM(nm.c_str()); } Group* findGroup(const char* nm) const { GroupMap::iterator it = groupMap->find(nm); Group* x = (it != groupMap->end()) ? it->second : NULL; return x; } Group* findGroup(const std::string& nm) const { return findGroup(nm.c_str()); } virtual ANode* clone() { return new Root(*this); } // -------------------------------------------------------- // XML output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual std::ostream& writeXML(std::ostream& os = std::cout, uint oFlags = 0, const char* pre = "") const; void CSV_TreeDump(std::ostream& os = std::cout) const; // -------------------------------------------------------- // debugging // -------------------------------------------------------- virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; protected: private: void Ctor(const char* nm); void insertGroupMap(Group* grp); void insertLMMap(LM* lm); friend class Group; friend class LM; private: std::string m_name; // the program name GroupMap* groupMap; LMMap* lmMap_realpath; // mapped by 'realpath' LMMap* lmMap_basename; #if 0 static RealPathMgr& s_realpathMgr; #endif }; // -------------------------------------------------------------------------- // Groups are children of Root's, Group's, LMs's, // File's, Proc's, Loop's // children: Group's, LM's, File's, Proc's, // Loop's, Stmts, // They may be used to describe several different types of scopes // (including user-defined ones) // -------------------------------------------------------------------------- class Group: public ACodeNode { public: Group(const char* nm, ANode* parent, int begLn = ln_NULL, int endLn = ln_NULL) : ACodeNode(TyGroup, parent, begLn, endLn, 0, 0) { Ctor(nm, parent); } Group(const std::string& nm, ANode* parent, int begLn = ln_NULL, int endLn = ln_NULL) : ACodeNode(TyGroup, parent, begLn, endLn, 0, 0) { Ctor(nm.c_str(), parent); } virtual ~Group() { } static Group* demand(Root* pgm, const std::string& nm, ANode* parent); virtual const std::string& name() const { return m_name; } // same as grpName virtual std::string codeName() const; virtual ANode* clone() { return new Group(*this); } virtual std::string toXML(uint oFlags = 0) const; // -------------------------------------------------------- // debugging // -------------------------------------------------------- virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; private: void Ctor(const char* nm, ANode* parent); private: std::string m_name; }; // -------------------------------------------------------------------------- // LMs are children of Root's or Group's // children: Group's, File's // -------------------------------------------------------------------------- class LM: public ACodeNode { protected: LM& operator=(const LM& x); public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- LM(const char* nm, ANode* parent) : ACodeNode(TyLM, parent, ln_NULL, ln_NULL, 0, 0) { Ctor(nm, parent); } LM(const std::string& nm, ANode* parent) : ACodeNode(TyLM, parent, ln_NULL, ln_NULL, 0, 0) { Ctor(nm.c_str(), parent); } virtual ~LM() { delete m_fileMap; delete m_procMap; delete m_stmtMap; } virtual ANode* clone() { return new LM(*this); } static LM* demand(Root* pgm, const std::string& lm_fnm); // -------------------------------------------------------- // // -------------------------------------------------------- virtual const std::string& name() const { return m_name; } virtual std::string codeName() const { return name(); } const char * pretty_name() const { return m_pretty_name.c_str(); } void pretty_name(const char *nm) { m_pretty_name = nm; } std::string baseName() const { return FileUtil::basename(m_name); } // -------------------------------------------------------- // search for enclosing nodes // -------------------------------------------------------- // findFile: find using RealPathMgr File* findFile(const char* nm) const; File* findFile(const std::string& nm) const { return findFile(nm.c_str()); } // -------------------------------------------------------- // search by VMA // -------------------------------------------------------- // findByVMA: find scope by *unrelocated* VMA // findProc: VMA interval -> Struct::Proc* // findStmt: VMA interval -> Struct::Stmt* // // N.B. these maps are maintained when new Struct::Proc or // Struct::Stmt are created ACodeNode* findByVMA(VMA vma) const; void computeVMAMaps() const { delete m_procMap; m_procMap = NULL; delete m_stmtMap; m_stmtMap = NULL; findProc(0); findStmt(0); } Proc* findProc(VMA vma) const; bool insertProcIf(Proc* proc) const { if (m_procMap) { insertInMap(m_procMap, proc); return true; } return false; } Stmt* findStmt(VMA vma) const; bool insertStmtIf(Stmt* stmt) const { if (m_stmtMap) { insertInMap(m_stmtMap, stmt); return true; } return false; } bool eraseStmtIf(Stmt* stmt) const { if (m_stmtMap) { eraseFromMap(m_stmtMap, stmt); return true; } return false; } // -------------------------------------------------------- // Output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual std::ostream& writeXML(std::ostream& os = std::cout, uint oFlags = 0, const char* pre = "") const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; void dumpmaps() const; bool verifyStmtMap() const; public: typedef VMAIntervalMap<Proc*> VMAToProcMap; typedef VMAIntervalMap<Stmt*> VMAToStmtRangeMap; protected: void Ctor(const char* nm, ANode* parent); void insertFileMap(File* file); template<typename T> void buildMap(VMAIntervalMap<T>*& mp, ANode::ANodeTy ty) const; template<typename T> void insertInMap(VMAIntervalMap<T>* mp, T x) const { const VMAIntervalSet& vmaset = x->vmaSet(); for (VMAIntervalSet::const_iterator it = vmaset.begin(); it != vmaset.end(); ++it) { const VMAInterval& vmaint = *it; DIAG_MsgIf(0, vmaint.toString()); mp->insert(std::make_pair(vmaint, x)); } } template<typename T> void eraseFromMap(VMAIntervalMap<T>* mp, T x) const { const VMAIntervalSet& vmaset = x->vmaSet(); for (VMAIntervalSet::const_iterator it = vmaset.begin(); it != vmaset.end(); ++it) { const VMAInterval& vmaint = *it; mp->erase(vmaint); } } template<typename T> static bool verifyMap(VMAIntervalMap<T>* mp, const char* map_nm); friend class File; private: std::string m_name; // the load module name // for pseudo module, this will be set // keep this in addition to m_name to avoid disturbing other // things that depend upon a full path std::string m_pretty_name; // maps to support fast lookups; building them does not logically // change the object FileMap* m_fileMap; // mapped by RealPathMgr mutable VMAToProcMap* m_procMap; mutable VMAToStmtRangeMap* m_stmtMap; #if 0 static RealPathMgr& s_realpathMgr; #endif }; // -------------------------------------------------------------------------- // Files are children of Root's, Group's and LM's. // children: Group's, Proc's, Loop's, or Stmt's. // Files may refer to an unreadable file // -------------------------------------------------------------------------- class File: public ACodeNode { protected: File(const File& x) : ACodeNode(x.m_type) { *this = x; } File& operator=(const File& x); public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- File(const char* filenm, ANode *parent, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyFile, parent, begLn, endLn, 0, 0) { Ctor(filenm, parent); } File(const std::string& filenm, ANode *parent, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyFile, parent, begLn, endLn, 0, 0) { Ctor(filenm.c_str(), parent); } virtual ~File() { delete m_procMap; } virtual ANode* clone() { return new File(*this); } static File* demand(LM* lm, const std::string& filenm); // -------------------------------------------------------- // // -------------------------------------------------------- virtual const std::string& name() const { return m_name; } virtual std::string codeName() const; void name(const char* fname) { m_name = fname; } void name(const std::string& fname) { m_name = fname; } std::string baseName() const { return FileUtil::basename(m_name); } // -------------------------------------------------------- // search for enclosing nodes // -------------------------------------------------------- // FindProc: Attempt to find the procedure within the multimap. If // 'lnm' is provided, require that link names match. Proc* findProc(const char* name, const char* linkname = NULL) const; Proc* findProc(const std::string& name, const std::string& linkname = "") const { return findProc(name.c_str(), linkname.c_str()); } // -------------------------------------------------------- // Output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual void CSV_dump(const Root &root, std::ostream& os = std::cout, const char* file_name = NULL, const char* proc_name = NULL, int lLevel = 0) const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; private: void Ctor(const char* filenm, ANode* parent); void insertProcMap(Proc* proc); friend class Proc; private: std::string m_name; // the file name including the path ProcMap* m_procMap; #if 0 static RealPathMgr& s_realpathMgr; #endif }; // -------------------------------------------------------------------------- // Procs are children of Group's or File's // children: Group's, Loop's, Stmt's // // (begLn == 0) <==> (endLn == 0) // (begLn != 0) <==> (endLn != 0) // -------------------------------------------------------------------------- class Proc: public ACodeNode { protected: Proc(const Proc& x) : ACodeNode(x.m_type) { *this = x; } Proc& operator=(const Proc& x); public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- Proc(const char* name, ACodeNode* parent, const char* linkname, bool hasSym, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyProc, parent, begLn, endLn, 0, 0) { Ctor(name, parent, linkname, hasSym); } Proc(const std::string& name, ACodeNode* parent, const std::string& linkname, bool hasSym, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyProc, parent, begLn, endLn, 0, 0) { Ctor(name.c_str(), parent, linkname.c_str(), hasSym); } virtual ~Proc() { delete m_stmtMap; } virtual ANode* clone() { return new Proc(*this); } // demand: if didCreate is non-NULL, it will be set to true if a new // Proc was created and false otherwise. // Note: currently sets hasSymbolic() to false on creation static Proc* demand(File* file, const std::string& name, const std::string& linkname, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL, bool* didCreate = NULL); static Proc* demand(File* file, const std::string& name) { return demand(file, name, "", ln_NULL, ln_NULL, NULL); } // -------------------------------------------------------- // // -------------------------------------------------------- virtual const std::string& name() const { return m_name; } virtual std::string codeName() const; void name(const char* x) { m_name = (x) ? x : ""; } void name(const std::string& x) { m_name = x; } const std::string& linkName() const { return m_linkname; } bool hasSymbolic() const { return m_hasSym; } void hasSymbolic(bool x) { m_hasSym = x; } // -------------------------------------------------------- // search for enclosing nodes // -------------------------------------------------------- // FIXME: confusion between native and alien statements Stmt* findStmt(SrcFile::ln begLn) { StmtMap::iterator it = m_stmtMap->find(begLn); Stmt* x = (it != m_stmtMap->end()) ? it->second : NULL; return x; } // -------------------------------------------------------- // Output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual void CSV_dump(const Root &root, std::ostream& os = std::cout, const char* file_name = NULL, const char* proc_name = NULL, int lLevel = 0) const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; private: void Ctor(const char* n, ACodeNode* parent, const char* ln, bool hasSym); void insertStmtMap(Stmt* stmt); friend class Stmt; private: std::string m_name; std::string m_linkname; bool m_hasSym; StmtMap* m_stmtMap; }; // -------------------------------------------------------------------------- // Alien: represents an alien context (e.g. inlined procedure, macro). // // Aliens are children of Group's, Alien's, Proc's // or Loop's // children: Group's, Alien's, Loop's, Stmt's // // (begLn == 0) <==> (endLn == 0) // (begLn != 0) <==> (endLn != 0) // -------------------------------------------------------------------------- class Alien: public ACodeNode { protected: Alien(const Alien& x) : ACodeNode(x.m_type) { *this = x; } Alien& operator=(const Alien& x); public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- Alien(ACodeNode* parent, const char* filenm, const char* procnm, const char* displaynm, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyAlien, parent, begLn, endLn, 0, 0) { Ctor(parent, filenm, procnm, displaynm); } Alien(ACodeNode* parent, const std::string& filenm, const std::string& procnm, const std::string& displaynm, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyAlien, parent, begLn, endLn, 0, 0) { Ctor(parent, filenm.c_str(), procnm.c_str(), displaynm.c_str()); } virtual ~Alien() { } virtual ANode* clone() { return new Alien(*this); } // -------------------------------------------------------- // // -------------------------------------------------------- const std::string& fileName() const { return m_filenm; } void fileName(const std::string& fnm) { m_filenm = fnm; } virtual const std::string& name() const { return m_name; } void name(const char* n) { m_name = n; } void name(const std::string& n) { m_name = n; } void proc(Prof::Struct::Proc *proc) { m_proc = proc; } const std::string& displayName() const { return m_displaynm; } virtual std::string codeName() const; // -------------------------------------------------------- // Output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual void CSV_dump(const Root &root, std::ostream& os = std::cout, const char* file_name = NULL, const char* proc_name = NULL, int lLevel = 0) const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; private: void Ctor(ACodeNode* parent, const char* filenm, const char* procnm, const char* displaynm); private: std::string m_filenm; std::string m_name; std::string m_displaynm; Prof::Struct::Proc *m_proc; #if 0 static RealPathMgr& s_realpathMgr; #endif }; // -------------------------------------------------------------------------- // Loops are children of Group's, File's, Proc's, // or Loop's. // children: Group's, Loop's, or Stmt's // -------------------------------------------------------------------------- class Loop: public ACodeNode { public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- Loop(ACodeNode* parent, std::string &filenm, SrcFile::ln begLn = ln_NULL, SrcFile::ln endLn = ln_NULL) : ACodeNode(TyLoop, parent, begLn, endLn, 0, 0) { ANodeTy t = (parent) ? parent->type() : TyANY; setFile(filenm); DIAG_Assert((parent == NULL) || (t == TyGroup) || (t == TyFile) || (t == TyProc) || (t == TyAlien) || (t == TyLoop), ""); } void setFile(std::string filenm); virtual ~Loop() { } virtual ANode* clone() { return new Loop(*this); } // -------------------------------------------------------- // // -------------------------------------------------------- virtual std::string codeName() const; // -------------------------------------------------------- // Output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; const std::string& fileName() const { return m_filenm; } void fileName(const std::string& fnm) { m_filenm = fnm; } private: std::string m_filenm; }; // -------------------------------------------------------------------------- // Stmts are children of Group's, File's, // Proc's, or Loop's. // children: none // -------------------------------------------------------------------------- class Stmt: public ACodeNode { public: // -------------------------------------------------------- // Create/Destroy // -------------------------------------------------------- Stmt(ACodeNode* parent, SrcFile::ln begLn, SrcFile::ln endLn, VMA begVMA = 0, VMA endVMA = 0) : ACodeNode(TyStmt, parent, begLn, endLn, begVMA, endVMA), m_sortId((int)begLn) { ANodeTy t = (parent) ? parent->type() : TyANY; DIAG_Assert((parent == NULL) || (t == TyGroup) || (t == TyFile) || (t == TyProc) || (t == TyAlien) || (t == TyLoop), ""); LM* lmStrct = NULL; Proc* pStrct = ancestorProc(); if (pStrct) { pStrct->insertStmtMap(this); lmStrct = pStrct->ancestorLM(); } if (lmStrct && begVMA) { lmStrct->insertStmtIf(this); } //DIAG_DevMsg(3, "Stmt::Stmt: " << toStringMe()); } virtual ~Stmt() { } virtual ANode* clone() { return new Stmt(*this); } // -------------------------------------------------------- // // -------------------------------------------------------- virtual std::string codeName() const; // a handle for sorting within the enclosing procedure context int sortId() { return m_sortId; } void sortId(int x) { m_sortId = x; } // -------------------------------------------------------- // Output // -------------------------------------------------------- virtual std::string toXML(uint oFlags = 0) const; virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; private: int m_sortId; }; // ---------------------------------------------------------------------- // Refs are chldren of LineScopes // They are used to describe a reference in source code. // Refs are build only iff we have preprocessing information. // ---------------------------------------------------------------------- class Ref: public ACodeNode { public: Ref(ACodeNode* parent, int _begPos, int _endPos, const char* refName); // parent->type() == TyStmt uint BegPos() const { return begPos; }; uint EndPos() const { return endPos; }; virtual const std::string& name() const { return m_name; } virtual std::string codeName() const; virtual ANode* clone() { return new Ref(*this); } virtual std::string toXML(uint oFlags = 0) const; // -------------------------------------------------------- // debugging // -------------------------------------------------------- virtual std::ostream& dumpme(std::ostream& os = std::cerr, uint oFlags = 0, const char* pre = "") const; private: void RelocateRef(); uint begPos; uint endPos; std::string m_name; }; } // namespace Struct } // namespace Prof /************************************************************************/ // Iterators /************************************************************************/ #include "Struct-TreeIterator.hpp" #endif /* prof_Prof_Struct_Tree_hpp */
package school.domain; import java.io.Serializable; import javax.persistence.Table; import javax.persistence.Id; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import java.util.*; /** * 公告domain * * @author Ghost * */ @Table(name = "notice") // 使用注解@Table,标明对应的数据库表名为:notice public class Notice implements Serializable { @Id // 使用注解@Id标明属性id为该表的主键 @GeneratedValue(strategy = GenerationType.IDENTITY) // 使用注解@GeneratedValue用于标注主键的生成策略,通过strategy属性指定 // IDENTITY:采用数据库ID自增长的方式来自增主键字段 private Integer id; private String title; private Date addtime; private String content; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public Date getAddtime() { return addtime; } public void setAddtime(Date addtime) { this.addtime = addtime; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } }
<reponame>jottenlips/typescript-cli-template import { sayHello } from '../index'; test('Should return string argument', () => { expect( sayHello({ hello: 'Hello, no commands yet', }) ).toEqual('Hello, no commands yet'); });
package com.atguigu.gmall.search.repository; import com.atguigu.gmall.search.pojo.Goods; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; /** * @Auther: 宋金城 * @Date: 2020/1/8 19:21 * @Description: */ public interface GoodsRepository extends ElasticsearchRepository<Goods,Long> { }
THE CONTENT OF POWER AND GOVERNMENT IN CENTRAL ASIAN NOMADS The article submitted for publication contains an analysis of the power-management system of Central Asian nomads. The focus of such tasks as: Analysis of military power, the cult of a warrior in the history of the evolution of the tribal power of the leader in ancient and medieval Central Asia in the context of the theory of chiefdom, neoevolutionism, aggressive and commercial theories of political genesis, evolutionary theories of the matrilinear and patrilineal development of the society; Study and analysis of the power authority of the tribal power through the system of titles and ranks in the Hunnu, Turkic, Oghuz, Karakhanid, Khitan, Seljuqid states, description and study of the terminology of Chinese texts on ranks and ranks, functions of officials and tribal chiefs, the role of a titled aristocracy in the management system nomadic polities.
<reponame>abcnews/scrollyteller import acto from '@abcnews/alternating-case-to-object'; import { selectMounts, isMount, getMountValue } from '@abcnews/mount-utils'; import { PanelDefinition, PanelAlignment } from './Panel'; import { ScrollytellerTheme } from './Scrollyteller'; const piecemeal = Symbol('piecemeal'); type PanelMeta = { [piecemeal]?: boolean; align?: PanelAlignment; }; export type ScrollytellerConfig = { theme?: ScrollytellerTheme; waypoint?: number; graphicinfront?: boolean; }; export type ScrollytellerDefinition<T extends unknown> = { mountNode: Element; panels: PanelDefinition<T>[]; config: ScrollytellerConfig; }; declare global { interface Window { __scrollytellers: { [key: string]: any; }; } } const SELECTOR_COMMON = 'scrollyteller'; function excludeScrollytellerConfig<T>(config: ScrollytellerConfig & T): T { const _config = { ...config, }; delete _config.theme; delete _config.waypoint; delete _config.graphicinfront; return _config as T; } function excludePanelMeta<T>(config: T & PanelMeta): T { const _config = { ...config, }; delete _config[piecemeal]; delete _config.align; return _config as T; } /** * Finds and grabs any nodes between #scrollyteller and #endscrollyteller * @param name The hash name for a scrollyteller (optional if there is only one on the page) * @param className The className to apply to the mount node * @param markerName The hash name for markers */ export const loadScrollyteller = <T>( name?: string, className?: string, markerName: string = 'mark' ): ScrollytellerDefinition<T> => { window.__scrollytellers = window.__scrollytellers || {}; const openingMountValuePrefix: string = `${SELECTOR_COMMON}${ name ? `NAME${name}` : '' }`; name = name || 'scrollyteller'; if (!window.__scrollytellers[name]) { const firstEl: Element | null = selectMounts(openingMountValuePrefix)[0]; className && firstEl.classList.add(className); if (!isMount(firstEl)) { throw new Error('Attempting to mount to a non-mount node'); } const config = acto( getMountValue(firstEl, openingMountValuePrefix) ) as ScrollytellerConfig & T; const els: Element[] = []; let el: Element | null = firstEl.nextElementSibling; let hasMoreContent: boolean = true; while (hasMoreContent && el) { if (isMount(el, `end${SELECTOR_COMMON}`, true)) { hasMoreContent = false; } else { els.push(el); el = el.nextElementSibling; } } window.__scrollytellers[name] = { mountNode: firstEl, config: { waypoint: config.waypoint ? config.waypoint / 100 : undefined, theme: config.theme, graphicInFront: config.graphicinfront, }, panels: loadPanels<T>( els, excludeScrollytellerConfig<T>(config), markerName ), }; } return window.__scrollytellers[name]; }; /** * Parse a list of nodes looking for anchors starting with a given name * @param nodes * @param initialMarker * @param name */ const loadPanels = <T>( nodes: Node[], initialConfig: T, name: string ): PanelDefinition<T>[] => { const panels: PanelDefinition<T>[] = []; let nextConfigAndMeta: PanelMeta & T = initialConfig; let nextNodes: Node[] = []; // Commit the current nodes to a marker function pushPanel() { if (nextNodes.length === 0) return; panels.push({ align: nextConfigAndMeta.align, data: excludePanelMeta<T>(nextConfigAndMeta), nodes: nextNodes, }); nextNodes = []; } // Check the section nodes for panels and marker content nodes.forEach((node: Node, index: number) => { if (isMount(node, name)) { // Found a new marker so we should commit the last one pushPanel(); // If marker has no config then just use the previous config const configString: string = getMountValue(node, name); if (configString) { nextConfigAndMeta = (acto(configString) as unknown) as T; } else { // Empty marks should stop the piecemeal flow nextConfigAndMeta[piecemeal] = false; } } else { // Any other nodes just get grouped for the next marker nextNodes.push(node); } // Any trailing nodes just get added as a last marker if (index === nodes.length - 1) { pushPanel(); } // If piecemeal is on/true then each node has its own box if (nextConfigAndMeta[piecemeal]) { pushPanel(); } // Remove the node from the document to keep things tidy node.parentNode && node.parentNode.removeChild(node); }); return panels; };
The price of gas in Winnipeg has shot up as much as 15 cents per litre at some stations. A number of stations in the city were posting a pump price of 117.9 cents per litre on Thursday. The majority are Esso stations, but there was the occasional Petro-Canada and Domo as well. The last time drivers in Winnipeg faced such a pain in the gas was June 2016. Just four months ago, the price was just 82 cents per litre. There are still bargains to be had right now, though. The Husky and Domo stations on Marion Street, just west of Lagimodiere Boulevard, were still posting prices at 99.3 as of Thursday morning. And a number of other stations around the city, including the odd Esso, were still between 1.01 and 1.03.
Jim and Pat Bader of 2312 Belaire St. are celebrating their 50th wedding anniversary. The former Pat Federici married Bader Oct. 3, 1953 in Washington, D.C. They have five children: Maureen Morgan of Monument, Calif.; David Bader of Northville; Susan Peterson of Fort Worth, Texas; Theresa Palmieri of Midland; and Michael Bader of Holland, Mich. They also have 10 grandchildren. Jim retired from The Dow Chemical Co. Pat is a homemaker. They celebrated with a family cruise to the Caribbean in July and a trip to Toronto on their anniversary.
#!/usr/bin/python ###################################################################### # Cloud Routes Bridge # ------------------------------------------------------------------- # Actions Module ###################################################################### import boto.ec2 import time def action(**kwargs): ''' This method is called to action a reaction ''' redata = kwargs['redata'] jdata = kwargs['jdata'] logger = kwargs['logger'] run = True # Check for Trigger if redata['trigger'] > jdata['failcount']: run = False # Check for lastrun checktime = time.time() - float(redata['lastrun']) if checktime < redata['frequency']: run = False if redata['data']['call_on'] not in jdata['check']['status']: run = False if run: return actionEC2(redata, jdata, logger) else: return None def actionEC2(redata, jdata, logger): ''' Perform EC2 Actions ''' try: conn = boto.ec2.connect_to_region( redata['data']['region'], aws_access_key_id=redata['data']['aws_access_key'], aws_secret_access_key=redata['data']['aws_secret_key']) try: instances = conn.get_only_instances( instance_ids=[redata['data']['instance_id']]) instances[0].start() return True except: return False except: line = "aws-ec2start: Could not connect to AWR for monitor %s" % jdata[ 'cid'] logger.info(line) return False
/** * Chatwork provides programmatic access to Chatwork web hooks */ public class Chatwork { private String webhookUrl; private String user; private String icon; private String url; private String action; private String space_id; private ChatworkService chatworkService = new ChatworkService(); public Chatwork(String webhookUrl) { if (isEmpty(webhookUrl)) { throw new IllegalArgumentException("Webhook url is not provided"); } this.webhookUrl = webhookUrl; } /** * Change the display name * * @param user Display name */ public Chatwork displayName(String user) { this.user = user; return this; } /** * Change the bot icon * * @param imageOrIcon Icon Image URL or emoji code from http://www.emoji-cheat-sheet.com/ */ public Chatwork icon(String imageOrIcon) { this.icon = imageOrIcon; return this; } /** * Change the url * * @param url Page url */ public Chatwork sendToUrl(String url) { this.url = url; return this; } /** * Change the action type * * @param action Action type */ public Chatwork sendToAction(String action) { this.action = action; return this; } /** * Change the Space ID * * @param space_id Space ID */ public Chatwork sendToSpaceId(String space_id) { this.space_id = space_id; return this; } /** * Publishes messages to Chatwork Webhook * * @param message Message to send * @throws IOException */ public void push(String message) throws IOException { if (message != null) { chatworkService.push(webhookUrl, message, url, action, space_id, user, icon); } } }
<gh_stars>10-100 /* * Copyright (c) 2019 Deomid "rojer" Ryabkov * All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "HAPPlatformMFiHWAuth.h" #include "HAPPlatformMFiHWAuth+Init.h" // TODO(rojer): implement this. bool HAPPlatformMFiHWAuthIsPoweredOn(HAPPlatformMFiHWAuthRef mfiHWAuth) { (void) mfiHWAuth; return false; } HAPError HAPPlatformMFiHWAuthPowerOn(HAPPlatformMFiHWAuthRef mfiHWAuth) { (void) mfiHWAuth; return kHAPError_Unknown; } void HAPPlatformMFiHWAuthPowerOff(HAPPlatformMFiHWAuthRef mfiHWAuth) { (void) mfiHWAuth; } HAPError HAPPlatformMFiHWAuthWrite(HAPPlatformMFiHWAuthRef mfiHWAuth, const void* bytes, size_t numBytes) { (void) mfiHWAuth; (void) bytes; (void) numBytes; return kHAPError_Unknown; } HAPError HAPPlatformMFiHWAuthRead( HAPPlatformMFiHWAuthRef mfiHWAuth, uint8_t registerAddress, void* bytes, size_t numBytes) { (void) mfiHWAuth; (void) registerAddress; (void) bytes; (void) numBytes; return kHAPError_Unknown; } void HAPPlatformMFiHWAuthCreate(HAPPlatformMFiHWAuthRef mfiHWAuth) { (void) mfiHWAuth; } void HAPPlatformMFiHWAuthRelease(HAPPlatformMFiHWAuthRef mfiHWAuth) { (void) mfiHWAuth; }
Volvo hopes to tackle speeding, distraction and intoxication with tech. Twelve years ago, Volvo senior technical advisor for safety Jan Ivarsson announced Vision 2020. The bold plan dreamed of a world where, by 2020, nobody would be killed or seriously hurt in a new Volvo. Where do things stand today, with 2020 less than 12 months away? At a presentation in Gothenberg, Sweden, on Wednesday, Volvo Cars CEO Håkan Samuelsson said the limiting factor in any car maker reaching that ambitious dream is bad human behavior. "We have done a lot with technical means, passive and active [safety] features in the car," he said. "But really to come down to zero [deaths] you have to tackle some issues that are much more human-related." Volvo Cars CEO Håkan Samuelsson announces plans to improve vehicle safety. In other words, all the safety tech in the world can't save you from your own bad habits. Specifically, Volvo says that speeding drivers, distracted drivers and intoxicated drivers still make roads dangerous -- and that tackling those issues requires much more advanced moves than today's safety features. Samuelsson sees the issue as a moral imperative to improve road safety. "Do we have the right to intervene, let the car intervene, depending on the ability of the driver? Maybe we even have the obligation to do so," he said. The Volvo Care Key will allow parents to set limits on their teen driver's behavior. The first plan of attack is speed. Volvo already announced its intention to limit all cars to 118 miles per hour and to allow parents to limit how fast their kids can drive. The idea is to send a signal to drivers that they need to keep to appropriate speeds -- especially, for instance, when in school zones or urban areas. "The difference between 30 and 40 kilometers per hour [18 and 25 mph] can be the difference between an accident not happening and a tragedy," said Volvo senior technical advisor for safety Jan Ivarsson. "Those small infractions seem so trivial… [but] those speed limits are in place for a reason: to protect the most vulnerable people in society." Eventually, of course, Volvo imagines that cars would automatically limit your speed in those types of areas. "Long-term, with new technology we'll probably have smarter speed limiters," said Samuelsson. Cameras in the cabin of Volvo's next-gen cars will monitor the driver's eyes to see if they're drunk or distracted. Reducing drunk driving deaths is another pole of Volvo's safety initiative, which it plans to tackle with cameras that automatically monitor if the driver is inebriated and potentially slow down the car. Again, Volvo sees it as a moral issue. "If we can stop someone driving when drunk, then I think we have a responsibility to," Samuelsson told journalists in a roundtable interview. Volvo representatives declined to entertain the possibility of equipping future models with breathalyser interlocks. Instead, they noted that the camera-based system could detect many types of intoxication aside from just alcohol: drugs, legal or not, as well as medical emergencies. "We're talking about intoxication generally," said Armin Kesedzic, Volvo product owner for vision sensors. "It doesn't have to be alcohol." That said, Volvo doesn't want to accept too much responsibility in these cases. "We will not guarantee you are sober just because [our systems] say you are," said Samuelsson. Those cameras will also watch the driver's eyes to ensure he or she is paying attention to the road rather than Instagram. With distracted driving on the rise globally, Volvo sees reducing driver distraction as an important way to reduce crashes. "Our overall aim is to reduce accidents altogether, rather than just limit the impact of accidents," said Ivarsson. "We all know that life can get you distracted … It's called life. It happens." So, how far along is Volvo in its progress toward Vision 2020? Well, first of all, the company emphasizes the "Vision" was just that: a vision that by 2020 it might be feasible to eliminate deaths and injuries. As to specific data on the target, the company will offer only vague answers. "I would say we're pretty close to the Vision 2020 by now," said Samuelsson in a prepared statement. "Sure, accidents still happen, but the consequences are much milder now."
Phase-Type Distributions and Optimal Stopping for Autoregressive Processes Autoregressive processes are intensively studied in statistics and other fields of applied stochastics. For many applications, the overshoot and the threshold time are of special interest. When the upward innovations are in the class of phase-type distributions, we determine the joint distribution of these two quantities and apply this result to problems of optimal stopping. Using a principle of continuous fit, this leads to explicit solutions.
from typing import Optional import xml.etree.ElementTree as ET from ...xml.XmlReader import XmlReader as XR from ..namespaces import API from ..namespaces import DATA from ...deserialization.create_enum import create_enum from ..dto.ProcessingResult import ProcessingResult from ..dto.InvoiceStatus import InvoiceStatus from .deserialize_business_validation_result import deserialize_business_validation_result from .deserialize_technical_validation_result import deserialize_technical_validation_result def deserialize_processing_result(element: ET.Element) -> Optional[ProcessingResult]: if element is None: return None result = ProcessingResult( index=XR.get_child_int(element, 'index', API), batch_index=XR.get_child_int(element, 'batchIndex', API), invoice_status=create_enum(InvoiceStatus, XR.get_child_text(element, 'invoiceStatus', API)), technical_validation_messages=[deserialize_technical_validation_result(e) for e in XR.find_all_child(element, 'technicalValidationMessages', API)], business_validation_messages=[deserialize_business_validation_result(e) for e in XR.find_all_child(element, 'businessValidationMessages', API)], compressed_content_indicator=XR.get_child_bool(element, 'compressedContentIndicator', API), original_request=XR.get_child_text(element, 'originalRequest', API), ) return result
def send_webhook( context: InjectionContext, topic: str, payload, *, retries: int = None ): asyncio.ensure_future( WebhookTransport.perform_send(context, topic, payload, retries) )
from __future__ import division import math import logging import random import numpy as np import pandas as pd from abc import ABCMeta, abstractmethod tree_logger = logging.getLogger('tree') evolution_logger = logging.getLogger('evolution') import tree._tree class Node(object): __metaclass__ = ABCMeta @abstractmethod def find_leaves(self, df): raise NotImplemented() @abstractmethod def prn(self, indent=None): raise NotImplemented() def predict(self, df, leaf_score_map): # A pd Series of leaf-hash values # for each row leaf_for_row = self.find_leaves(df) results = [] for leaf_hash, df_leaf in df.groupby(leaf_for_row): predict_fn = leaf_score_map.get(leaf_hash, tree._tree.MeanLeafMapper(0.5)) # The predict_fn return a np array, # so we have to convert it back to a pd Series predictions = pd.Series(predict_fn.predict(df_leaf.values), index=df_leaf.index) results.append(predictions) return pd.concat(results).loc[df.index] @abstractmethod def structure_matches(self, other): raise NotImplemented() class BranchNode(Node): def __init__(self, var_name, split, left, right): self.var_name = var_name self.split = split self.left = left self.right = right def find_leaves(self, df): idx_left = (df[self.var_name] < self.split) idx_right = (df[self.var_name] >= self.split) left_leaves = self.left.find_leaves(df.loc[idx_left]) right_leaves = self.right.find_leaves(df.loc[idx_right]) return pd.concat([left_leaves, right_leaves]).loc[df.index] def prn(self, indent=None): indent = indent or 0 if self.left: self.left.prn(indent + 1) for _ in range(indent): print '\t', print "{} {:.5f}".format(self.var_name, self.split) if self.right: self.right.prn(indent + 1) def __eq__(self, o): return isinstance(o, BranchNode) \ and self.var_name == o.var_name \ and self.split == o.split \ and self.left == o.left \ and self.right == o.right def __hash__(self): return hash((self.var_name, self.split, self.left, self.right)) def structure_matches(self, o): return isinstance(o, BranchNode) \ and self.var_name == o.var_name \ and self.split == o.split \ and self.left.structure_matches(o.left) \ and self.right.structure_matches(o.right) class LeafNode(Node): def __init__(self): self._code = random.random() def find_leaves(self, df): return pd.Series(hash(self), index=df.index) def prn(self, indent=None): indent = indent or 0 for _ in range(indent): print '\t', print "<Leaf {}>".format(hash(self)) def __eq__(self, o): return isinstance(o, LeafNode) and self._code == o._code def __hash__(self): return hash(self._code) def structure_matches(self, other): return isinstance(other, LeafNode) # # Loss Functions # def _get_leaf_prediction_builder(leaf_prediction): if isinstance(leaf_prediction, tree._tree.LeafMapperBuilder): return leaf_prediction elif leaf_prediction == 'mean': return tree._tree.MeanLeafMapperBuilder() elif leaf_prediction == 'logit': return tree._tree.LogitMapperBuilder() else: raise Exception() def get_leaf_predictor(X, y, type): builder = _get_leaf_prediction_builder(type) return builder.build(X, y) def _get_loss_function(loss): if isinstance(loss, tree._tree.LossFunction): return loss elif loss == 'cross_entropy': return tree._tree.CrossEntropyLoss() elif loss == 'error_rate': return tree._tree.ErrorRateLoss() elif loss == 'random': return tree._tree.RandomLoss() else: raise Exception() def loss(truth, predicted, type): loss_fn = _get_loss_function(type) return loss_fn.loss(truth.values, predicted.values) # # Tree Manipulation # def get_all_nodes(tree): if isinstance(tree, LeafNode): return [tree] elif isinstance(tree, BranchNode): return [tree] + [tree.left] + [tree.right] + get_all_nodes(tree.left) + get_all_nodes(tree.right) else: raise ValueError() def clone(tree): if isinstance(tree, LeafNode): return LeafNode() elif isinstance(tree, BranchNode): return BranchNode(tree.var_name, tree.split, clone(tree.left), clone(tree.right)) else: raise ValueError() def random_node(tree): return random.choice(get_all_nodes(tree)) def random_branch_node(tree): if isinstance(tree, LeafNode): raise ValueError() while True: node = random.choice(get_all_nodes(tree)) if isinstance(node, BranchNode): return node def replace_branch_split(tree, to_replace, replace_with): """ Takes a tree and a node in that tree to replace and a node to replace it with. Replace that node in a shallow or "in-place" way by replacing that node's variable and threshold but keeping it's children the same This mutates the tree in-place and returns the updated version """ if isinstance(to_replace, LeafNode): raise ValueError("Cannot call replace_branch_split on a LeafNode") tree = clone(tree) for node in get_all_nodes(tree): if node == to_replace: node.var_name = replace_with.var_name node.split = replace_with.split return tree return tree def replace_node(tree, to_replace, replace_with): """ Takes a tree and a node in that tree to replace and a node to replace it with. Replace that node in a deep way by removing the original node fro the tree and replacing it with the replacement node (including it's children). This may even replace leaf nodes, so it may alter the structure of the tree. This may mutates the tree in-place and always returns the updated version """ # Handle the case where we replace the root if tree == to_replace: return clone(replace_with) tree = clone(tree) # Otherwise, find it in the tree for node in get_all_nodes(tree): if isinstance(node, LeafNode): continue elif isinstance(node, BranchNode): if node.left == to_replace: node.left = replace_with return tree elif node.right == to_replace: node.right = replace_with return tree else: pass return tree def mate(mother, father): """ Create a child tree from two parent trees. We do this with the following algorithm: - Pick a node randomly in the mother tree - Pick a node randomly in the father tree - Replace the node in the mother tree """ num_genes = random.randint(1, 4) child = mother for gene in range(num_genes): if isinstance(child, LeafNode): return child # Do we do a full subtree replacement # or do we modify a branch node? if not isinstance(father, LeafNode) and random.choice([True, False]): to_replace = random_branch_node(child) replace_with = random_branch_node(father) child = replace_branch_split(child, to_replace, replace_with) else: to_replace = random_node(child) replace_with = random_node(father) child = replace_node(child, to_replace, replace_with) return child def mutate(tree, df, target, loss_fn, leaf_prediction_builder, mutation_rate=1.0): # Can't mutate leaf nodes if isinstance(tree, LeafNode): return tree tree = clone(tree) # Pick the number of genes to mutate based # on a poisson distribution num_genes_to_mutate = np.random.poisson(mutation_rate, 1)[0] num_genes_mutated = 0 while num_genes_mutated < num_genes_to_mutate: # How do we mutate? # - pick a node at random to mutate # - Pick a feature to mutate it to # - Make a greedy laf split to_mutate = random_branch_node(tree) new_feature = random.choice(df.columns) # Pick either a greedy split # or a random split if random.choice([True, False], ): split_val, _ = _single_variable_best_split(df, new_feature, target, loss_fn, leaf_prediction_builder) else: split_val = df[new_feature].sample(n=1).iloc[0] # Do the mutation # We do in-place because this is a child to_mutate.var_name = new_feature to_mutate.split = split_val num_genes_mutated += 1 return tree def prune(tree, max_depth=None, current_depth=0): """ Return a (possibly cloned) version of the tree that is pruned to respect the max depth given. """ if isinstance(tree, LeafNode): return tree elif max_depth is None: return tree else: tree = clone(tree) # Force all children to be leaf node if current_depth == max_depth - 1: tree.left = LeafNode() tree.right = LeafNode() return tree else: tree.left = prune(tree.left, max_depth, current_depth + 1) tree.right = prune(tree.right, max_depth, current_depth + 1) return tree # # Training # def _get_split_candidates(srs, threshold=100): if len(srs) < threshold: return list(srs) else: skip = len(srs) // 100 return list(srs[::skip]) def _single_variable_best_split(df, var, target, loss='cross_entropy', leaf_prediction='mean', candidates=None): """ Takes a DataFrame of features, a variable name, and a target Series, and finds a value of the input variable name that best splits the data according to the targets. Returns the best value to split at and the value of the loss function when splitting there. Internally, wraps a cython function """ leaf_prediction_builder = _get_leaf_prediction_builder(leaf_prediction) loss_fn = _get_loss_function(loss) np_features = df.astype(np.float32).values np_targets = target.astype(np.float32).values var_idx = list(df.columns).index(var) if candidates is None: candidates = set(_get_split_candidates(df[var].astype(np.float32))) else: candidates = set(candidates) return tree._tree.getBestSplit( np_features, var_idx, np_targets, loss_fn, leaf_prediction_builder, candidates) def get_best_split(df, target, loss='cross_entropy', leaf_prediction='mean'): """ Takes a DataFrame of features and a target Series, and find the value of the input variable name that best splits the data according to the targets. Returns the best variable to split on, the best value of that variable to split at, and the loss when splitting on that variable at that value. Internally, wraps a cython function """ leaf_prediction_builder = _get_leaf_prediction_builder(leaf_prediction) loss_fn = _get_loss_function(loss) best_var = None best_split = None best_loss = None for var in df.columns: split, loss = _single_variable_best_split(df, var, target, loss_fn, leaf_prediction_builder) if best_loss is None or loss < best_loss: best_var = var best_split = split best_loss = loss return best_var, best_split, best_loss def softmax(x): """Compute softmax values for each sets of scores in x.""" e_x = np.exp(x - np.max(x)) return e_x / e_x.sum() def train_greedy_tree(df, target, loss='cross_entropy', leaf_prediction='mean', max_depth=None, min_to_split=None, leaf_map=None, var_split_candidate_map=None, feature_sample_rate=None, row_sample_rate=None, current_depth=0): """ Returns a tree and its leaf map """ assert target.dtype == np.float32 for dtype in df.dtypes: assert dtype == np.float32 if leaf_map is None: leaf_map = {} loss_fn = _get_loss_function(loss) leaf_prediction_builder = _get_leaf_prediction_builder(leaf_prediction) predictor = leaf_prediction_builder.build(df.values, target.values) predictions = predictor.predict(df.values) current_loss = loss_fn.loss(predictions, target.values) if len(df) <= 1 or (max_depth is not None and current_depth >= max_depth) or ( min_to_split is not None and len(df) < min_to_split): tree_logger.info("Reached leaf node, or constraints force termination. Returning") leaf = LeafNode() leaf_map[hash(leaf)] = predictor return leaf, leaf_map df_for_splitting = sample(df, row_frac=row_sample_rate, col_frac=feature_sample_rate) var, split, loss = get_best_split(df_for_splitting, target.loc[df_for_splitting.index], loss_fn, leaf_prediction_builder) tree_logger.info("Training. Depth {} Current Loss: {:.4f} Best Split: {} {:.4f} {:.4f}".format( current_depth, current_loss, var, split, loss)) if loss >= current_loss: tree_logger.info("No split improves loss. Returning") leaf = LeafNode() leaf_map[hash(leaf)] = predictor return leaf, leaf_map left_criteria = df[var] < split right_criteria = df[var] >= split # Handle the (odd) case where the split # moves all nodes to one way or another if left_criteria.sum() == 0 or right_criteria.sum() == 0: tree_logger.info("No split improves loss. Returning") leaf = LeafNode() leaf_map[hash(leaf)] = leaf_prediction_builder.build(df.values, target.values) return leaf, leaf_map left_tree, left_map = train_greedy_tree(df[left_criteria], target[left_criteria], loss_fn, leaf_prediction_builder, max_depth=max_depth, min_to_split=min_to_split, leaf_map=leaf_map, var_split_candidate_map=var_split_candidate_map, current_depth=current_depth + 1) right_tree, right_map = train_greedy_tree(df[right_criteria], target[right_criteria], loss_fn, leaf_prediction_builder, max_depth=max_depth, min_to_split=min_to_split, leaf_map=leaf_map, var_split_candidate_map=var_split_candidate_map, current_depth=current_depth + 1) leaf_map.update(left_map) leaf_map.update(right_map) return BranchNode(var, split, left_tree, right_tree), leaf_map def calculate_leaf_map(tree, df, target, leaf_prediction='mean'): """ Takes a built tree structure and a features/target pair and returns a map of each leaf to the function evaluating the score at each leaf """ leaves = tree.find_leaves(df) leaf_map = {} leaf_prediction_builder = _get_leaf_prediction_builder(leaf_prediction) for leaf_hash, leaf_rows in df.groupby(leaves): leaf_targets = target.loc[leaf_rows.index] leaf_map[leaf_hash] = leaf_prediction_builder.build(leaf_rows.values, leaf_targets.values) return leaf_map def cut(x, min, max): if x < min: return min elif x > max: return max else: return x def train_random_trees(df, target, loss='cross_entropy', leaf_prediction='mean', max_depth=None, min_to_split=None, num_trees=10, num_split_candidates=50): loss_fn = _get_loss_function(loss) leaf_prediction_builder = _get_leaf_prediction_builder(leaf_prediction) df_train = df.sample(frac=0.7, replace=False, axis=0) target_train = target.loc[df_train.index] df_test = df[~df.index.isin(df_train.index)] target_test = target.loc[df_test.index] # Create and cache the possible splits var_split_candidate_map = {var: _get_split_candidates(df[var], threshold=num_split_candidates) for var in df.columns} tree_infos = [] num_grown_trees = 0 while num_grown_trees < num_trees: random_type = random.choice(['alpha', 'beta']) if random_type == 'alpha': df_alpha = sample(df_train, row_frac=0.5) target_alpha = target_train.loc[df_alpha.index] tree, _ = train_greedy_tree( df=df_alpha, target=target_alpha, loss=loss_fn, leaf_prediction=leaf_prediction_builder, max_depth=max_depth, min_to_split=min_to_split, var_split_candidate_map=var_split_candidate_map) else: tree, _ = train_greedy_tree( df=df_train, target=target_train, loss=loss_fn, leaf_prediction=leaf_prediction_builder, max_depth=max_depth, min_to_split=min_to_split, feature_sample_rate=0.5, row_sample_rate=0.5, var_split_candidate_map=var_split_candidate_map) num_grown_trees += 1 tree_info = {'tree': tree, 'random_type': random_type} # Calculate the loss on the generation loss_info = calculate_loss(tree, leaf_prediction_builder, loss_fn, df_train, target_train, df_test, target_test) tree_info.update(loss_info) tree_infos.append(tree_info) tree_infos = sorted(tree_infos, key=lambda x: x['loss_testing']) best_result = tree_infos[0] evolution_logger.info("Num Trees: {} Training Loss: {:.4f} Hold Out Loss {:.4f}\n".format( num_grown_trees, best_result['loss_training'], best_result['loss_testing'])) return best_result, tree_infos def evolve(df, target, loss='cross_entropy', leaf_prediction='mean', max_depth=None, min_to_split=None, num_generations=10, num_survivors=10, num_children=50, num_split_candidates=50, num_seed_trees=5): loss_fn = _get_loss_function(loss) leaf_prediction_builder = _get_leaf_prediction_builder(leaf_prediction) df_train = df.sample(frac=0.7, replace=False, axis=0) target_train = target.loc[df_train.index] assert 0 == pd.isnull(target_train).sum(), "Targets may not have NULL values" df_test = df[~df.index.isin(df_train.index)] target_test = target.loc[df_test.index] # Create and cache the possible splits var_split_candidate_map = {var: _get_split_candidates(df[var], threshold=num_split_candidates) for var in df.columns} generation_info = [] generation = [] # Create the alpha of this generation # Alphas are trees that are greedily trained with a sample # of the rows in the dataset for i in range(num_seed_trees): evolution_logger.debug("Growing Seed: {} of {}".format(i + 1, num_seed_trees)) df_seed = sample(df_train, row_frac=0.5) target_seed = target_train.loc[df_seed.index] tree, _ = train_greedy_tree( df=df_seed, target=target_seed, loss='cross_entropy', leaf_prediction='mean', max_depth=max_depth, min_to_split=min_to_split, var_split_candidate_map=var_split_candidate_map) generation.append({'tree': tree, 'gen': 0, 'loss_training': None, 'loss_testing': None}) for gen_idx in range(num_generations): # Get the training data for this generation evolution_logger.debug("Resplitting the data") df_gen = df_train.sample(frac=0.7, replace=False, axis=0) target_gen = target.loc[df_gen.index] # Create the children for this generation evolution_logger.debug("Mating to create {} children".format(num_children)) children = [] # Pick parents inversely proportionally to their loss # This is probably overly complicated... losses = np.array([t['loss_testing'] if t['loss_testing'] else 1.0 for t in generation]) probs = softmax(1.0 - losses / np.mean(losses)) for _ in range(num_children): mother, father = np.random.choice(generation, 2, p=probs) child = mate(mother['tree'], father['tree']) if isinstance(child, LeafNode): continue child = mutate(child, df_gen, target_gen, loss_fn, leaf_prediction_builder) child = prune(child, max_depth=max_depth) children.append({'gen': max(mother['gen'], father['gen']) + 1, 'tree': child}) generation = list(generation) + children generation = ensure_diversity(generation) # Calculate the leaf weights for this generation # and evaluate on the hold-out set evolution_logger.debug("Calculating loss functions for generation of size: {}".format(len(generation))) losses = calculate_losses(generation, leaf_prediction_builder, loss_fn, df_gen, target_gen, df_test, target_test) # Update the losses in the generation for tree, losses in zip(generation, losses): tree.update(losses) #tree['loss_training'] = losses['loss_training'] #tree['loss_testing'] = losses['loss_testing'] # Sort the trees to find the best tree next_generation = sorted(generation, key=lambda x: x['loss_testing'])[:num_survivors] best_result = next_generation[0] evolution_logger.debug( "Surviving Generation: {}".format(", ".join(['{}:{:.4f}'.format(r['gen'], r['loss_testing']) for r in next_generation]))) evolution_logger.info( "Generation {} Training Loss: {:.4f} Hold Out Loss {:.4f}\n".format( gen_idx, best_result['loss_training'], best_result['loss_testing']) ) generation = next_generation generation_info.append({'best_of_generation': best_result, 'generation': generation}) return best_result, generation_info def calculate_loss(tree, leaf_prediction_builder, loss_fn, df_train, target_train, df_test, target_test): # Calculate the leaf map on the training data and apply to training/testing leaf_map = calculate_leaf_map(tree, df_train, target_train, leaf_prediction_builder) loss_training = loss_fn.loss(tree.predict(df_train, leaf_map).values, target_train.values) loss_testing = loss_fn.loss(tree.predict(df_test, leaf_map).values, target_test.values) return { 'loss_training': loss_training, 'loss_testing': loss_testing, 'leaf_map': leaf_map } def calculate_losses(tree_infos, leaf_prediction_builder, loss_fn, df_train, target_train, df_test, target_test): results = [] for info in tree_infos: loss_info = calculate_loss(info['tree'], leaf_prediction_builder, loss_fn, df_train, target_train, df_test, target_test) results.append(loss_info) return results def ensure_diversity(trees): res = [] for tree in trees: # If a tree matches structurally an existing tree, # we skip it is_diverse = True for r in res: if tree['tree'].structure_matches(r['tree']): is_diverse = False break if is_diverse: res.append(tree) return res def sample(df, row_frac=None, col_frac=None): if len(df) == 0: return df elif row_frac is None and col_frac is None: return df elif row_frac is None: ncols = int(math.floor(len(df.columns) * col_frac)) cols = random.sample(df.columns, ncols) return df.loc[:, cols] elif col_frac is None: nrows = int(math.floor(len(df) * row_frac)) rows = random.sample(df.index, nrows) return df.loc[rows, :] else: ncols = int(math.floor(len(df.columns) * col_frac)) cols = random.sample(df.columns, ncols) nrows = int(math.floor(len(df) * row_frac)) rows = random.sample(df.index, nrows) return df.loc[rows, cols]
Impact of Thresholds and Load Patterns when Executing HPC Applications with Cloud Elasticity Elasticity is one of the most known capabilities related to cloud computing, being largely deployed reactively using thresholds. In this way, maximum and minimum limits are used to drive resource allocation and deallocation actions, leading to the following problem statements: How can cloud users set the threshold values to enable elasticity in their cloud applications? And what is the impact of the applications load pattern in the elasticity? This article tries to answer these questions for iterative high performance computing applications, showing the impact of both thresholds and load patterns on application performance and resource consumption. To accomplish this, we developed a reactive and PaaS-based elasticity model called AutoElastic and employed it over a private cloud to execute a numerical integration application. Here, we are presenting an analysis of best practices and possible optimizations regarding the elasticity and HPC pair. Considering the results, we observed that the maximum threshold influences the application time more than the minimum one. We concluded that threshold values close to 100% of CPU load are directly related to a weaker reactivity, postponing resource reconfiguration when its activation in advance could be pertinent for reducing the application runtime.
Adversarial Autoencoder for trajectory generation and maneuver classification For the development of self-driving cars, it is essential to perceive the environment as accurately as possible and to interpret the movement of the surrounding vehicles. It makes sense to draw conclusions based on the past trajectories of these vehicles, whether it is maneuver detection or, in more complex cases, maneuver or trajectory prediction. Trajectories are time series data, so it is obvious to deploy recurrent neural networks for their analysis, or 1-dimensional convolutional networks that can capture temporal patterns. The concept is presented that trajectories starting from the origin can be compressed efficiently so that the reconstructed trajectory is quite similar to the original, and the latent space code obtained by compression can be used for maneuver detection. Using a variational autoencoder, assuming a normal distribution, the latent spatial distribution can be approximated. However, in this article, the goal was to test this concept with adversarial training, so the so-called adversarial autoencoder is trained. It has been shown that this method is suitable for twelve-fold compression of trajectories, and the latent code is suitable for maneuver detection. This proves that the encoder has learned useful features about the distribution that generates trajectories.
<reponame>mami-starters/spring-boot-typescript-jquery-websockets import {Lead, LeadProvider} from "./Lead"; import jQuery = require('jquery'); export class LeadProviderAjax implements LeadProvider { get(callback: (l: Lead) => void): void { jQuery.getJSON("lead.json", (data, textStatus) => { let casted:Lead = data; callback(casted); }); } }
Advances in pharmacotherapy for the treatment of gout Introduction: Gout is a common inflammatory arthritis affecting almost 6% of US males and 2% of US females. The central cause of gout is deposition of monosodium urate crystals, and the focus of treatment is aimed at crystal dissolution using urate-lowering therapy. Areas covered: The review describes the current treatments for urate-lowering therapy including allopurinol, febuxostat, probenecid, benzbromarone and pegloticase. Anti-inflammatory treatment of acute flares and prophylaxis of flares with NSAIDs, colchicine, corticosteroids and anti-IL-1 agents is also reviewed. In addition, drugs in Phase III clinical trials for gout indications are reviewed. Expert opinion: In the last decade, there has been major progress in the pharmacotherapy of gout. Management guidelines have emphasized the importance of a therapeutic serum urate target for effective gout management. Studies have identified the safe and effective dosing strategies for old drugs such as allopurinol and colchicine. New therapeutic agents have been developed and approved for both urate-lowering therapy and anti-inflammatory treatment of acute flares. However, quality of care remains a major challenge in gout management, and strategies to ensure best practice require further focus to ensure that the progress of the last decade translates into clinical benefit for people with gout.
Let me tell you a funny story that happened today during conversation with my hubby. So, we are walking in the forest trying to figure out this little beauty of Mother nature and I was telling him "it feels like we are on an island" and I heard myself and stopped and my husband responded "We ARE on an island" and we laughed but what I was trying to say was, every time I walk in the forest or in the nature Tasmania I always think it is so untouched that it makes me feel I'm on an island where there is no civilisation. Nature is so breathtakingly beautiful and sometimes I wish when we built things we really consider our environment. And coming from a big city life back home in Turkey I finally feel connected to earth living in Hobart for almost 10 years, where nature is just in our back yard. And I really hope this stays like this. Beautiful spot and I totally agree with you.
National Republicans are going after Cindy Axne, a Democrat running for Congress who, despite touting an environmentally friendly platform, made investments in companies that contaminated drinking water. Axne is challenging GOP Rep. David Young in Iowa’s Third Congressional District. Given it is a competitive district, Democrats are eyeing the district race as a possible pickup opportunity. The Democratic Congressional Campaign Committee has added Axne to their “Red to Blue” program, prioritizing her campaign above other Democrats they deem less likely to win. Axne is running on an explicit pledge to tackle climate change, according to her campaign website. The former kindergarten and education activist has touted her past work in promoting the wind industry, and vows to bring renewable energy to Iowa. Axne — who supported an Obama-era water policy that was opposed by local farmers — received an endorsement from the League of Environmental Voters Action Fund, a liberal advocacy group based in Washington, D.C. Despite these environmental bona fides, Axne is taking heat for a slew of investments in companies that have been reprimanded for contaminating the earth. Axne’s financial disclosure forms reveal she has invested in Goldcorp Inc., Barrick Gold and Agnico Eagle Mines Limited – all Canadian mining companies that were found to have spilled toxic chemicals into the water and ground. Goldcorp released mercury, lead and arsenic into bodies of water in Honduras. Barrick Gold spilled cyanide into an Argentinian river, polluting a source of drinking water for locals. Agnico was fined $50,000 in 2017 for spilling oil into a lake in Nunavut, Canada. The National Republican Congressional Committee has begun an ad campaign, “Anti-Environmental Axne,” that hits her for the controversial investments. David Young’s campaign also reacted to the new attack ads. “Iowans deserve better representation than someone who proclaims to support renewable energy and environmental protections while personally profiting and getting rich off of big oil and foreign mining companies that have repeatedly poisoned drinking water and shot environmental activists,” Dylan Lefler, campaign manager for Young, said in a statement to The Daily Caller News Foundation. Cindy Axne’s campaign did not respond to a request for comment by TheDC in time for publication.
Clinically relevant effects of convection-enhanced delivery of AAV2-GDNF on the dopaminergic nigrostriatal pathway in aged rhesus monkeys. Growth factor therapy for Parkinson's disease offers the prospect of restoration of dopaminergic innervation and/or prevention of neurodegeneration. Safety and efficacy of an adeno-associated virus (AAV2) encoding human glial cell-derived neurotrophic factor (GDNF) was investigated in aged nonhuman primates. Positron emission tomography with 6--fluoro-l-m-tyrosine (FMT-PET) in putamen was assessed 3 months before and after AAV2 infusion. In the right putamen, monkeys received either phosphate-buffered saline or low-dose (LD) or high-dose (HD) AAV2-GDNF. Monkeys that had received putaminal phosphate-buffered saline (PBS) infusions additionally received either PBS or HD AAV2-GDNF in the right substantia nigra (SN). The convection-enhanced delivery method used for infusion of AAV2-GDNF vector resulted in robust volume of GDNF distribution within the putamen. AAV2-GDNF increased FMT-PET uptake in the ipsilateral putamen as well as enhancing locomotor activity. Within the putamen and caudate, the HD gene transfer mediated intense GDNF fiber and extracellular immunoreactivity (IR). Retrograde and anterograde transport of GDNF to other brain regions was observed. AAV2-GDNF did not significantly affect dopamine in the ipsilateral putamen or caudate, but increased dopamine turnover in HD groups. HD putamen treatment increased the density of dopaminergic terminals in these regions. HD treatments, irrespective of the site of infusion, increased the number of nonpigmented TH-IR neurons in the SN. AAV2-GDNF gene transfer does not appear to elicit adverse effects, delivers therapeutic levels of GDNF within target brain areas, and enhances utilization of striatal dopamine and dopaminergic nigrostriatal innervation.
Cessna Aircraft will offer high-speed Internet as a factory option on board its Citation XLS+, Citation Sovereign and Citation X business jets beginning with aircraft delivering in the second quarter of 2010, the company reports. Cessna signed an agreement with Aircell, a provider of airborne communications. The system will allow passengers to use their own Wi-Fi enabled devices, such as laptops, tablet PCs, smartphones and PDAs to surf the Web, send and receive e-mail and access corporate Virtual Private Networks.
<reponame>onap/dcaegen2-platform-inventory-api /*- * ============LICENSE_START======================================================= * dcae-inventory * ================================================================================ * Copyright (C) 2020 Nokia. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= */ package io.swagger.api.impl; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.onap.dcae.inventory.daos.InventoryDataAccessManager; import org.onap.dcae.inventory.dbthings.mappers.DCAEServiceTypeObjectMapper; import org.onap.dcae.inventory.dbthings.models.DCAEServiceTypeObject; import org.skife.jdbi.v2.Handle; import org.skife.jdbi.v2.Query; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; import java.util.function.Consumer; class DcaeServiceTypeObjectRepository { private static final Logger metricsLogger = LoggerFactory.getLogger("metricsLogger"); private final InventoryDataAccessManager instance; public DcaeServiceTypeObjectRepository(InventoryDataAccessManager instance) { this.instance = instance; } List<DCAEServiceTypeObject> fetch(String typeName, Boolean onlyLatest, Boolean onlyActive, String vnfType, String serviceId, String serviceLocation, String asdcServiceId, String asdcResourceId, String application, String component, String owner) { List<DCAEServiceTypeObject> serviceTypeObjects; // TODO: Make this variable also a URL parameter. DateTime createdCutoff = DateTime.now(DateTimeZone.UTC); try (Handle jdbiHandle = instance.getHandle()) { final String queryStatement = DcaeServiceTypesQueryStatement.create(typeName, onlyLatest, onlyActive, vnfType, serviceId, serviceLocation, asdcServiceId, asdcResourceId, owner, application, component); metricsLogger.info("Query created as: {}." + queryStatement); Query<DCAEServiceTypeObject> query = getQuery(jdbiHandle, queryStatement); if (typeName != null){ typeName = resolveTypeName(typeName); } ifNotNullBind(typeName, it -> query.bind("typeName", it)); ifNotNullBind(vnfType, it -> query.bind("vnfType", it)); ifNotNullBind(serviceId, it -> query.bind("serviceId", it)); ifNotNullBind(serviceLocation, it -> query.bind("serviceLocation", it)); ifNotNoneBind(asdcServiceId, it -> query.bind("asdcServiceId", it)); ifNotNoneBind(asdcResourceId, it -> query.bind("asdcResourceId", it)); ifNotNullBind(application, it -> query.bind("application", it)); ifNotNullBind(component, it -> query.bind("component", it)); ifNotNullBind(owner, it -> query.bind("owner", it)); bindCreatedCutoff(createdCutoff, query); serviceTypeObjects = query.list(); } return serviceTypeObjects; } private void ifNotNullBind(String value, Consumer<String> bind) { if (value != null) { bind.accept(value); } } private void ifNotNoneBind(String value, Consumer<String> bind) { if (value != null && !"NONE".equalsIgnoreCase(value)) { bind.accept(value); } } void bindCreatedCutoff(DateTime createdCutoff, Query<DCAEServiceTypeObject> query) { query.bind("createdCutoff", createdCutoff); } Query<DCAEServiceTypeObject> getQuery(Handle jdbiHandle, String queryStatement) { return jdbiHandle.createQuery(queryStatement).map(new DCAEServiceTypeObjectMapper()); } static String resolveTypeName(String typeName){ if (typeName.contains("*")) { return typeName.replaceAll("\\*", "%"); } return typeName; } }
QoS Swarm Bee Routing Protocol for Vehicular Ad Hoc Networks Research and industries are recently more interesting and attracting to the Vehicular Ad hoc Networks (VANETs) development domain. They contribute to safer and more efficient roads by providing timely and accuracy information to drivers and authorities. Thus, the definition of a quality of service routing protocol for VANETs is one of their challenges. In this paper, we propose QoSBeeVanet, a new multipath quality of service routing protocol adapted for the vehicular ad hoc networks. It is based on ideas of the autonomic bee communication. Simulation results taken with NS2 in realist urban settings were shown that QoSBeeVanet outperforms DSDV and AODV two of the current state-of-the-art protocols, in terms of end-to-end delay, normalized overhead load and packet delivery ratio.
a, b, c, d = map(int, input().split()) arr = [a, b, c] arr.sort() a = arr[0] b = arr[1] c = arr[2] d1 = b - a d2 = c - b t1 = max(0, d - d1) t2 = max(0, d - d2) ans = t1 + t2 print(ans)
import uuid from chantilly import create_app from chantilly import storage import pytest def pytest_addoption(parser): parser.addoption('--redis', action='store_true', help='redis storage backend') def pytest_generate_tests(metafunc): backends = ['shelve'] if metafunc.config.getoption('redis'): backends.append('redis') if 'app' in metafunc.fixturenames: metafunc.parametrize('app', backends, indirect=True) @pytest.fixture def app(request): if request.param == 'shelve': config = { 'TESTING': True, 'SHELVE_PATH': str(uuid.uuid4()) } elif request.param == 'redis': config = { 'SECRET_KEY': 'dev', 'STORAGE_BACKEND': 'redis', 'REDIS_HOST': 'localhost', 'REDIS_PORT': 6379, 'REDIS_DB': 0 } app = create_app(config) yield app with app.app_context(): storage.drop_db() @pytest.fixture def client(app): return app.test_client() @pytest.fixture def runner(app): return app.test_cli_runner()
extern crate rock_paper_scissors; use rock_paper_scissors::game::{play, player}; use rock_paper_scissors::util::{input, output}; enum Result<'a> { WIN(&'a mut player::Player), DRAW, } fn main() { println!("Welcome to RockPaperScissors!"); output::print_flush("How many games would you like to play? "); let mut games: usize = input::read_line().parse().unwrap(); while games % 2 == 0 { output::print_flush("The number must be odd! How many games would you like to play? "); games = input::read_line().parse().unwrap(); } //V is mutable to have the variables so let mut computer: player::Player = player::Player::new("Computer"); let mut user: player::Player = player::Player::new("You"); for x in 0..games { println!("--------------- [ ROUND {} ] ---------------", x+1); loop { let user_play: play::Type = parse_play(); let computer_play: play::Type = play::random_play(); let mut result: Result = get_result(play::Play { choice: user_play, player: &mut user }, play::Play { choice: computer_play, player: &mut computer }); match result { Result::DRAW => { println!("It's a tie!"); continue }, Result::WIN(ref mut player) => { player.increment_score(); println!("{} win{}!", &player.name, if &player.name != "You" { "s" } else { "" }); break } } } } println!(); println!("You had {} {}", user.score, output::format_count("win".to_string(), user.score)); println!("The computer had {} {}", computer.score, output::format_count("win".to_string(), computer.score)); let winner: player::Player = if user.score > computer.score { user } else { computer }; println!("Overall, {} win{}", &winner.name, if &winner.name != "You" { "s" } else { "" }); } fn parse_play() -> play::Type { output::print_flush("What play do you want to make? (rock, paper, scissors) "); match play::parse_type(input::read_line()) { Some(x) => x, None => { println!("Invalid value."); parse_play() } } } fn get_result<'a>(play_one: play::Play<'a>, play_two: play::Play<'a>) -> Result<'a> { let user_beats = play_one.choice.get_beats(); let computer_beats = play_two.choice.get_beats(); if user_beats.contains(&play_two.choice) { Result::WIN(play_one.player) } else if computer_beats.contains(&play_one.choice) { Result::WIN(play_two.player) } else { Result::DRAW } }
<gh_stars>0 package main import ( "context" "time" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) // StreamServiceLogger 流式调用logger. func StreamServiceLogger() grpc.StreamServerInterceptor { return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { return nil } } // StreamClientLogger 客户单流式调用logger. func StreamClientLogger() grpc.StreamClientInterceptor { return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) { cCtx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() md := metadata.Pairs("Authorization", "zxz.axs.dss", "k1", "v2", "k2", "v3") cCtx = metadata.NewOutgoingContext(cCtx, md) return streamer(cCtx, desc, cc, method, opts...) } } // UnaryServiceLogger 服务端UNARY模式下的logger。 func UnaryServiceLogger() grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { return handler(ctx, req) } } func UnaryClientLogger() grpc.UnaryClientInterceptor { return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { return invoker(ctx, method, req, reply, cc, opts...) } }
<filename>src/automoji.py import nextcord from nextcord.ext import commands class Automoji(commands.Bot): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.logger = kwargs["logger"] self.conn = kwargs["conn"] self.cur = kwargs["cur"] self.robot_emoji = "\U0001F916" ###################################################################### # Overridden commands ###################################################################### async def on_command_error(self, ctx, error): if isinstance(error, commands.CommandNotFound): await ctx.send( "I couldn't recognize that command. Please see '!help' for a list of commands." ) async def on_guild_join(self, guild: nextcord.Guild): # Inserts the guild ID into the quote table. self.cur.execute("INSERT INTO quote_channels VALUES (?, NULL);", (guild.id,)) # Inserts the guild ID and user IDs into the emojis table. for m in guild.members: if not m.bot: self.cur.execute( "INSERT INTO emojis VALUES (?, ?, NULL);", (guild.id, m.id) ) self.conn.commit() async def on_guild_remove(self, guild: nextcord.Guild): # Deletes the row containing the guild ID from the quote table. self.cur.execute("DELETE FROM quote_channels WHERE guild=?;", (guild.id,)) # Deletes rows contains the guild ID from the emojis table. self.cur.execute("DELETE FROM emojis WHERE guild=?;", (guild.id,)) self.conn.commit() async def on_member_join(self, member: nextcord.Member): # Inserts the member ID into the emojis table. if not member.bot: self.cur.execute( "INSERT INTO emojis VALUES (?, ?, NULL);", (member.guild.id, member.id) ) self.conn.commit() async def on_member_remove(self, member: nextcord.Member): # Deletes the row containing the member ID from the emojis table. if not member.bot: self.cur.execute( "DELETE FROM emojis WHERE guild=? AND user=?;", (member.guild.id, member.id), ) self.conn.commit() async def on_message(self, message: nextcord.Message): # Avoids the bot recursing through its own messages. if message.author.id == self.user.id or message.author.bot: return # Reacts to the user's message with their emoji. await self.react_user_emoji(message) await self.process_commands(message) async def on_ready(self): print("Automoji is now online!") ###################################################################### # End overridden commands ###################################################################### # Reacts to a message using the robot emoji. async def bot_react(self, message: nextcord.Message): try: await message.add_reaction(self.robot_emoji) except nextcord.DiscordException as e: self.logger.warning(e) # Reacts to a user's message with their emoji. async def react_user_emoji(self, message: nextcord.Message): # Gets the user's emoji. self.cur.execute( "SELECT emoji FROM emojis WHERE guild=? AND user=?;", (message.guild.id, message.author.id), ) if (em := self.cur.fetchone()[0]) is not None: # Reacts to the user's message with their emoji. try: await message.add_reaction(em) except nextcord.DiscordException as e: self.logger.warning(e)
export class Endorsement { endorsementId: string; endorsementName: string; applicationTypeId: string; applicationTypeName: string; }
Perceived Benefits and Barriers to Exercise for Recently Treated Adults With Acute Leukemia PURPOSE/OBJECTIVES To explore perceived exercise benefits and barriers in adults with acute leukemia who recently completed an inpatient exercise intervention during induction therapy.. RESEARCH APPROACH Descriptive, exploratory design using semistructured interviews.. SETTING Inpatient hematology/oncology unit at North Carolina Cancer Hospital in Chapel Hill.. PARTICIPANTS 6 adults with acute leukemia aged 35-67 years.. METHODOLOGIC APPROACH Content analyses of semistructured interviews that were conducted with each participant prior to hospital discharge.. FINDINGS Most participants were not meeting the recommended physical activity levels of 150 minutes of moderate-intensity exercise per week before their diagnosis. Patients were highly pleased with the exercise intervention and the overall program. Common barriers to exercise were anxiety and aches and pains.. INTERPRETATION Overall, participants experienced physical and psychological benefits with the exercise intervention with no adverse events from exercising regularly during induction chemotherapy. Referrals for cancer rehabilitation management will lead to prolonged recovery benefits.. IMPLICATIONS FOR NURSING Findings inform the nurses' role in encouraging and supporting adults with acute leukemia to exercise and be physically active during their hospitalization. Nurses should also be responsible for assisting patients with physical function activities to increase mobility and enhance overall health-related quality of life.
The announcement will reportedly take place after a meeting between Trump and the community leaders earlier in the day. An event is scheduled for 1 p.m. ADVERTISEMENT The campaign has not released the names of the religious leaders who are set to endorse Trump. The backing of the black community leaders comes after a series of racially charged controversies involving Trump. The business mogul drew condemnation earlier this week after tweeting a graphic that overstated the number of black-on-white homicides this year. In addition, Trump caused waves after a physical confrontation between a Black Lives Matter protester and several white attendees at a Saturday campaign rally. Trump said Sunday of the protester: "Maybe he should have been roughed up because it was absolutely disgusting what he was doing." The campaign clarified that it “does not condone” the behavior of the crowd.
If you ever read Laurie Garrett’s book, The Coming Plague or saw the Hollywood movie, Hot Zone, you are already familiar with the potential horrors of highly infectious and deadly disease pandemics in our interconnected 21st century world. Scientists like Ms. Garrett have been warning us for a few decades that we are losing the war on infectious diseases and to illustrate her point she includes a detailed discussion of the Ebola virus, one of the scarier microbes out there. If you have also been paying attention to recent news reports, you are well aware that the deadliest outbreak of the notorious Ebola virus is unfolding right now in Africa. Yesterday, the World Health Organization (WHO) released the most up-to-date body count – and tragically, it nears 900. The outbreak is so out-of-control that people across West Africa are starting to panic and tempers are flaring. A couple weeks ago, Monrovia resident Edward Deline set fire to Liberia’s Health Ministry in protest over the death of his 14-year-old brother, who recently succumbed to the virus. Part of the reason why tempers are so hot and hysteria rampant is that there is great mistrust by many West Africans of not only foreigners (especially from the West) but also of their own local government. With threadbare trust intermingling with the stench of death, rumors and conspiracy theories are running amok through city streets and village networks, according to reports. So much so, that many people are refusing to abide by the potentially life-saving edicts of government authorities and foreign health workers. For example, health workers are imploring people to not treat Ebola victims at home, but instead get them to the hospital or local clinic to help stem the spread of this very contagious disease. But, many people abhor the idea of surrendering sick loved ones, especially in their time of great need. Media reports abound of families refusing to hand over the ill and deceased to officials, of violent roadblocks staged by communities to halt ambulances and of spontaneous protests being held outside hospitals and clinics. Marc Poncin, emergency coordinator for medical charity Medecins Sans Frontieres in Guinea, told Reuters, “We are seeing a lot of mistrust, intimidation and hostility from part of the population.” While this might seem nonsensical to those of us with access to excellent medical care and a reasonable trust in authorities, in West Africa on the heels of colonialism, multiple civil wars and government corruption, their decision to hide those fallen ill makes a lot of sense. First, most clinics and even hospitals in West Africa are woefully understaffed and lacking in basic supplies, so many people have more faith in shamans and community healers than in institutionalized medicine. As Susan Shepler, a professor at American University who conducts field work in the region writes: Hospitals in this part of the world have notoriously poor service. Families routinely have to prepare meals and bring them to patients. Families have to go to local pharmacies to buy drugs and even gloves or needles from India or Nigeria because hospital storerooms are routinely not stocked. People’s apprehensions about the failings of the healthcare system come from experience, not from ignorance. Second, as Professor Shepler reasonably points out: When someone has the symptoms—fever, vomiting, diarrhea—they are supposed to report to the health center, where they will be taken away from family, and if they die, be buried by men in protective gear with no family present. You can see why people might be loath to turn over their loved ones. Really who among us would want to turn a sick loved one over to a hospital staffed with foreigners, knowing we might never see them again? Even patients who are admitted to a health facility are sometimes later freed by anxious relatives. On Facebook, Sierra Leone’s special assistant to the President, Dr. Slyvia Blyden, describes one such case: Esteemed members of SIERRA LEONE ISSUES… Tonight, credible reports are that a suspected Ebola patient has escaped from Isolation at PCMH Cottage [Hospital], Fourah Bay Rd. in Freetown with help of her friends and family. She was reportedly admitted in isolation whilst waiting for her test results from Ebola lab in Kenema. Well, to cut a long story short, she was forcibly removed from the Isolation room and then, was put onboard an okada motorbike and whisked off to her residence somewhere in Freetown. One of the nurses on duty was seriously slapped for attempting to stop the escape. Indeed, this reaction is completely understandable based on the fact that the Ebola victims taken away by outsiders are rarely seen again alive – or even dead. No body is returned to the family for customary burial due to the virulent nature of the disease. Loved ones just disappear. Not surprisingly, when people just disappear, rumors and conspiracy theories rapidly appear. It certainly does not help that those escorting (sometimes forcefully) loved ones away are often foreigners and covered head-to-toe in otherworldly space gear. Recently, an angry mob numbering thousands gathered outside one of the the main Ebola treatment hospitals in Sierra Leone, threatening to burn it down and remove the patients. According to Reuters, “the protest was sparked by a former nurse who had told a crowd at a nearby fish market that Ebola was unreal and a gimmick aimed at carrying out cannibalistic rituals.” Police were forced to use tear gas to disperse the crowds. Relatives of the ill think they are doing the right thing and it is extremely difficult to tell them otherwise. Especially, when rumors like cannibalism are spreading faster than the virus itself. However, trying to treat a relative stricken by the Ebola virus is like Russian roulette – you may or may not come out alive. This is one reason why the disease is spreading so fast. Professor Shepler says it is not just the uneducated who mistrust their government and health care workers. She describes a conspiracy theory she heard from an educated friend in Sierra Leone: A friend recounted a story that in one of the poor neighborhoods some group was giving vaccinations against Ebola (“But there is no vaccine,” I protest. “Doesn’t matter. People don’t know that,” he replies.) He says two babies died almost immediately after receiving the shots, and the medical team vanished afterwards, now no one knows who gave the shots. “Someone must have been poisoning the children to make it look like more Ebola deaths!” This is an unsubstantiated rumor, but the important thing is how the rumor was spread by average, even well educated, people like my friend. He said that people think it is someone in or near the government who is getting rich off of the money that is coming into the country to battle the epidemic, and wants the situation to continue to look dire. When I sounded doubtful, my friend gave further evidence. He told me that the Chief Accountant at the Ministry of Health was preparing to make a report to the donors of how all the Ebola response money given to the government had been spent so far. The evening before the presentation he was badly beaten by thugs, and they took all the paperwork away from him and nothing else. Clearly, my friend argued, someone has something to hide! Government officials getting rich off the aid pouring in from around the world is just one of the theories circulating among West African communities. Other rumors and conspiracy theories include: Jon Lee, author of “An Epidemic of Rumors: How Stories Shape Our Perception of Disease” studies the folklore, rumors and conspiracy theories that rage along side various disease outbreaks. He examines not only at the affected groups but also how the news media narrates the story. He argues that these rumors do not start maliciously in an effort to spread the disease or undermine outsiders, yet the rumors can easily exacerbate the situation. Benjamin Radford elaborates on Discover Online: “they [the stories] emerge from people trying to make sense of the death that’s going on around them – and a misunderstanding of science. Standard Western medical procedures designed to stop the spread of the virus — something as simple as strangers sealing a deceased victim’s body in plastic and taking it away to be examined or buried in isolation – conflict with traditional customs and practices.” And are also very scary. Consequently, managing Ebola only from a medical perspective will only go so far. As any Medical Anthropology student knows, local rumors and conspiracy theories must be addressed in a deadly outbreak such as this, regardless of how outlandish and outrageous as they might be. Arguably, one of the best ways to do so, is to treat people with the respect they deserve, whether rural or urban, educated or uneducated – and to understand that many of the rumors do often embody a thread of truth. Furthermore, contempt is not easily disguised and the current discourse inside and outside of West Africa is that ignorant rural people are the biggest part of the problem. International aid agencies along with local government agencies must see the people of West Africa as intelligent partners, not ignorant enemies, in combating this deadly disease. CDC spokesman Stephan Monroe admits that ”there’s a fair amount of distrust in the government in general and of the messages that are being delivered. What we’re focusing on now is trying to identify in each one of the communities that are affected by this outbreak the trusted source — whether it be a village elder or a religious leader — somebody who we can work with to teach them first what the appropriate messages are, so that people can then accept the messages.” Melissa Leach, who has spent a good part of her career in West Africa, says this is the right approach, “Education is important, but needs to be undertaken sensitively and involving trusted local figures. The cultural practices that outbreak control teams try to modify — especially those involved with funerals and burial — lie at the heart of local social life. Challenges to these practices are also challenges to local society and authority — so, understandably resented.” Hopefully, now that West African governments along with international aid teams have done some soul-seaching about what they have done wrong in spite of trying to do right during the past four months of this pandemic, they can partner with the very people being most ravaged and together claim victory not only over fear and mistrust, but also most importantly, the virus itself. * Photo above of Dr. Kent Brantly treating an Ebola patient was taken by Samaritan’s Purse, one of the international aid groups on the front lines. A few weeks after this photo was taken of Dr. Brantly, he came down with the disease himself. He is currently fighting for his own life as the virus rages on in West Africa.
<filename>core/settings/project.py<gh_stars>10-100 # noqa # -*- coding: utf-8 -*- from __future__ import absolute_import import os import dj_database_url import dramatiq from dramatiq.brokers.redis import RedisBroker from .base import * from .contrib import * from .utils import ABS_PATH from hdx.hdx_configuration import Configuration # Project apps INSTALLED_APPS += ( 'jobs', 'tasks', 'api', 'ui', 'utils', ) dramatiq.set_broker(RedisBroker(host="localhost", port=6379)) DATABASES = {} DATABASES['default'] = dj_database_url.config(default='postgis:///exports', conn_max_age=500) TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['api/templates/', 'ui/templates', 'ui/static/ui/js'], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.i18n', 'django.template.context_processors.media', 'django.contrib.messages.context_processors.messages', 'social_django.context_processors.backends', 'social_django.context_processors.login_redirect', ], 'debug': DEBUG }, }, ] LOGIN_URL = '/login/' # where exports are staged for processing EXPORT_STAGING_ROOT = os.getenv('EXPORT_STAGING_ROOT',ABS_PATH('../export_staging/')) # where exports are stored for public download EXPORT_DOWNLOAD_ROOT = os.getenv('EXPORT_DOWNLOAD_ROOT',ABS_PATH('../export_downloads/')) # the root url for export downloads EXPORT_MEDIA_ROOT = '/downloads/' OSMAND_MAP_CREATOR_DIR = os.getenv('OSMAND_MAP_CREATOR_DIR', '/usr/local/OsmAndMapCreator') GARMIN_SPLITTER = os.getenv('GARMIN_SPLITTER', '/usr/local/splitter/splitter.jar') GARMIN_MKGMAP = os.getenv('GARMIN_MKGMAP', '/usr/local/mkgmap/mkgmap.jar') # url to overpass api endpoint OVERPASS_API_URL = os.getenv('OVERPASS_API_URL', 'http://overpass-api.de/api/') GENERATE_MWM = os.getenv('GENERATE_MWM','/usr/local/bin/generate_mwm.sh') GENERATOR_TOOL = os.getenv('GENERATOR_TOOL','/usr/local/bin/generator_tool') PLANET_FILE = os.getenv('PLANET_FILE','') """ Maximum extent of a Job max of (latmax-latmin) * (lonmax-lonmin) """ JOB_MAX_EXTENT = 2500000 # default export max extent in sq km HOSTNAME = os.getenv('HOSTNAME', 'export.hotosm.org') # Comment if you are not running behind proxy USE_X_FORWARDED_HOST = bool(os.getenv('USE_X_FORWARDED_HOST')) SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') # Hosts/domain names that are valid for this site # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts ALLOWED_HOSTS = ['exports-prod.hotosm.org', HOSTNAME] """ Overpass Element limit Sets the max ram allowed for overpass query http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Element_limit_.28maxsize.29 """ OVERPASS_MAX_SIZE = 2147483648 # 2GB """ Overpass timeout setting Sets request timeout for overpass queries. http://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#timeout """ OVERPASS_TIMEOUT = 1600 # query timeout in seconds if os.getenv('DJANGO_ENV') == 'development': INSTALLED_APPS += ( 'django_extensions', ) EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' LOGGING_OUTPUT_ENABLED = DEBUG LOGGING_LOG_SQL = DEBUG LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format': "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", 'datefmt': "%d/%b/%Y %H:%M:%S" }, 'simple': { 'format': '%(levelname)s %(message)s' }, }, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'formatter': 'simple', 'level': os.getenv('LOG_LEVEL', 'DEBUG'), } }, 'loggers': { 'django': { 'handlers': ['console'], 'propagate': True, 'level': os.getenv('DJANGO_LOG_LEVEL', 'ERROR'), }, 'api': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'api.tests': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'tasks.tests': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'tasks': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'jobs': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'jobs.tests': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'utils': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'utils.tests': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'hot_exports': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, 'hdx_exports': { 'handlers': ['console'], 'propagate': True, 'level': 'DEBUG', }, } } EMAIL_HOST = os.getenv('EMAIL_HOST') EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER') EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD') EMAIL_PORT = os.getenv('EMAIL_PORT',587) EMAIL_USE_TLS = bool(os.getenv('EMAIL_USE_TLS',True)) REPLY_TO_EMAIL = os.getenv('REPLY_TO_EMAIL') SPATIALITE_LIBRARY_PATH = 'mod_spatialite' SYNC_TO_HDX = bool(os.getenv('SYNC_TO_HDX')) HDX_API_KEY = os.getenv('HDX_API_KEY') HDX_NOTIFICATION_EMAIL = os.getenv('HDX_NOTIFICATION_EMAIL') HDX_SITE = os.getenv('HDX_SITE', 'demo') GEONAMES_API_URL = os.getenv('GEONAMES_API_URL', 'http://api.geonames.org/searchJSON') NOMINATIM_API_URL = os.getenv('NOMINATIM_API_URL', 'https://nominatim.openstreetmap.org/search.php') MATOMO_URL = os.getenv('MATOMO_URL') MATOMO_SITEID = os.getenv('MATOMO_SITEID') HDX_URL_PREFIX = Configuration.create( hdx_site=os.getenv('HDX_SITE', 'demo'), hdx_key=os.getenv('HDX_API_KEY'), user_agent="HOT Export Tool" )
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_PASSWORD_CHECKUP_LAUNCHER_HELPER_H_ #define CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_PASSWORD_CHECKUP_LAUNCHER_HELPER_H_ #include "base/android/jni_android.h" #include "base/android/jni_string.h" // Helper class used to access the methods of the java class // PasswordCheckupLauncher from multiple native side locations class PasswordCheckupLauncherHelper { public: // Launch the bulk password check in the Google Account static void LaunchCheckupInAccountWithWindowAndroid( JNIEnv* env, const base::android::JavaRef<jstring>& checkupUrl, const base::android::JavaRef<jobject>& windowAndroid); // Launch the bulk password check locally static void LaunchLocalCheckup( JNIEnv* env, const base::android::JavaRef<jobject>& windowAndroid); // Launch the bulk password check in the Google Account using an activity // rather than a WindowAndroid static void LaunchCheckupInAccountWithActivity( JNIEnv* env, const base::android::JavaRef<jstring>& checkupUrl, const base::android::JavaRef<jobject>& activity); }; #endif // CHROME_BROWSER_PASSWORD_MANAGER_ANDROID_PASSWORD_CHECKUP_LAUNCHER_HELPER_H_
Genetic susceptibility in thyroid autoimmunity. The autoimmune thyroid diseases (AITD) include Graves' disease (GD) which manifests in hyperthyroidism and Hashimoto's thyroiditis (HT), manifesting as hypothyroidism. Genetic susceptibility in combination with external factors (e.g. dietary iodine) are believed to initiate the autoimmune response to thyroid antigens in AITD. Indeed, there is solid epidemiological data to support a strong genetic influence on the etiology of AITD including family and twin studies. Recently, there has been significant progress toward the identification of the AITD susceptibility genes. Several loci (genetic regions) that are linked with AITD have been mapped and in some of these loci putative AITD susceptibility genes have been identified. Some of these loci predispose to a single phenotype (GD or HT), while other loci are common to both diseases, indicating that there is a shared genetic susceptibility to GD and HT. The putative GD and HT susceptibility genes include both immune modifying genes (e.g. HLA, CTLA-4) and thyroid specific genes (e.g. TSHR, Tg) and it is likely that the final disease phenotype is a result of an interaction between these loci, as well as environmental influences.
/** * */ package eu.diachron.qualitymetrics.intrinsic.semanticaccuracy.helper; import java.io.Serializable; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.sparql.core.Quad; import eu.diachron.qualitymetrics.utilities.SerialisableTriple; /** * @author <NAME> * */ public class PredicateProbability implements Serializable { private static final long serialVersionUID = -220634839564654372L; private Set<SerialisableTriple> triples = new HashSet<SerialisableTriple>(); private Map<String, Double> subjectColumn = new HashMap<String,Double>(); // type, #instances (which will change to probability counter) private Map<String, Double> objectColumn = new HashMap<String,Double>(); // type, #instances (which will change to probability counter) private Set<String> subjects = new HashSet<String>(); private Set<String> objects = new HashSet<String>(); private String predicate = ""; public PredicateProbability(Quad q){ this.addQuad(q); this.predicate = q.getPredicate().getURI(); } public void addQuad(Quad q){ SerialisableTriple t = new SerialisableTriple(q.asTriple()); if (!triples.contains(t)) this.triples.add(t); subjects.add(q.getSubject().getURI()); objects.add(q.getObject().getURI()); } public void addTriple(Triple t){ this.addQuad(new Quad(null,t)); } public void addToSubjectColumn(String uri, String resourceURI){ if (subjects.contains(resourceURI)){ Double counter = 0.0d; if (this.subjectColumn.containsKey(uri)) counter = this.subjectColumn.get(uri); counter++; this.subjectColumn.put(uri, counter); } } public void addToObjectColumn(String uri, String resourceURI){ if (objects.contains(resourceURI)){ Double counter = 0.0d; if (this.objectColumn.containsKey(uri)) counter = this.objectColumn.get(uri); counter++; this.objectColumn.put(uri, counter); } } public void deriveStatisticalDistribution(){ for(String s : subjectColumn.keySet()){ Double cnt = subjectColumn.get(s); subjectColumn.put(s, (cnt/(double)triples.size())); } for(String s : objectColumn.keySet()){ Double cnt = objectColumn.get(s); objectColumn.put(s, (cnt/(double)triples.size())); } } public String getString(){ StringBuilder sb = new StringBuilder(); sb.append(this.predicate); sb.append(System.getProperty("line.separator")); sb.append("\t| Subjects\t| Objects"); sb.append(System.getProperty("line.separator")); for (String s : subjectColumn.keySet()){ sb.append(s+"|\t"+subjectColumn.get(s)+"\t|"); if (objectColumn.containsKey(s)) sb.append(objectColumn.get(s)); else sb.append("0.0"); sb.append(System.getProperty("line.separator")); } for (String s : objectColumn.keySet()){ if (subjectColumn.containsKey(s)) continue; else { sb.append(s+"|\t0.0\t|"+objectColumn.get(s)); } sb.append(System.getProperty("line.separator")); } return sb.toString(); } @Override public int hashCode() { return predicate.hashCode(); } @Override public boolean equals(Object obj) { if (obj instanceof PredicateProbability){ PredicateProbability other = (PredicateProbability)obj; return this.predicate.equals(other.predicate); } return false; } }
The regulation of mitochondrial NO synthase activity under nitroglycerine application in rat heart and liver mitochondria Nitroglycerine (NG) affords cardioprotection via NO formation, but the impact of NG application on reactive nitrogen species (RNS) metabolism remains little studied yet. Mitochondrial NO synthase (mtNOS) is an important endogenous source of RNS. Our aim was to study the effect of NG application on mtNOS activity and RNS production in rat heart and liver mitochondria. Different regulation of mtNOS activity in the heart and liver under NG treatment was found. While in heart mitochondria it increased dose-dependently, in liver mitochondria only moderate elevation and bell-shaped dose dependence of mtNOS activity on NG was observed. Nitrite and nitrate, which are the end products of L-arginine transformation by NOS, showed similar dose dependence on NG. To find an explanation for the observed dependences, we studied the effects of NG administration on the activity of arginase which competes with NOS for physiological substrate, Larginine. A strong reciprocal dependence between mtNOS and arginase activities was found. As we observed, the arginase activity increased under NG application. However, while in heart mitochondria high mtNOS activity agreed with moderate arginase activation, in liver mitochondria high arginase activity coincided with suppression of mtNOS activity at high doses of NG. Low arginase and high mtNOS activities observed in heart mitochondria were consistent with high NO2 − and NO3 − production and low hydroperoxide (H2O2) formation, whereas high arginase activity in liver mitochondria was accompanied by the reduction of NO2− /NO3− formation and simultaneous elevation of H2O2 production. A linear correlation between the arginase activity and hydroperoxide formation was found. We came to the conclusion that under NG administration arginase activation resulted in reciprocal regulation of RNS and ROS production in mitochondria, dependent on the proportion of mtNOS to arginase activity. Suppression of RNS metabolism could be the cause of ROS overproduction caused by high arginase and low mtNOS activity.
Improving protein structure prediction with model-based search MOTIVATION De novo protein structure prediction can be formulated as search in a high-dimensional space. One of the most frequently used computational tools to solve such search problems is the Monte Carlo method. We present a novel search technique, called model-based search. This method samples the high-dimensional search space to build an approximate model of the underlying function. This model is incrementally refined in areas of interest, whereas areas that are not of interest are excluded from further exploration. Model-based search derives its efficiency from the fact that the information obtained during the exploration of the search space is used to guide further exploration. In contrast, Monte Carlo-based techniques lack memory and exploration is performed based on random walks, ignoring the information obtained in previous steps. RESULTS Model-based search is applied to protein structure prediction, where search is employed to find the global minimum of the protein's energy landscape. We show that model-based search uses computational resources more efficiently to find lower-energy conformations of proteins than one of the leading protein structure prediction methods, which relies on a tailored Monte Carlo method to perform a search. The performance improvements become more pronounced as the dimensionality of the search problem increases. We argue that model-based search will enable more accurate protein structure prediction than was previously possible. Furthermore, we believe that similar performance improvements can be expected in other problems that are currently solved using Monte Carlo-based search methods. AVAILABILITY An implementation of model-based search can be obtained by contacting the authors.
Q: Is quoting a thread post on my blog "personal use"? Several questions: Does my situation fall under "Personal Use"? I know the Stack Exchange ToS states that any usage whatsoever must be for personal use. And usually that's a pretty clear term for me. However, here I'm not sure if this falls under that term's meaning. What I want to do is quote a couple posts from a particular thread on Stack Overflow in my professional blog. I mean, it's may be a professional blog, but only in the sense that I use it to showcase my skills to other people. I don't make any money off it. Assuming it falls under "Personal Use": Would I have to black out the usernames of each thread post? Assuming it falls under "Personal Use": Would I have to black out the timestamps of each thread post? Assuming it falls under "Personal Use": Any other information I should know? A: The term "for personal use" in the TOS applies only to the content created by Stack Exchange, Inc.: (other than Content posted by Subscriber (“Subscriber Content”)) the actual questions and answers are governed by the CC-Wiki license, which allows usage for any purpose, including commercial, as long as attribution guidelines are observed. A: My reading of this is a definite yes - read through cc by-sa 3.0 (linked at the bottom of every page) and you'll see that personal use and fair use are both allowed in this context, and remember to always provide attribution and links back to the question/answer in point. You do not need to black out names or timestamps (it is public, after all) but your attribution does need to be in writing, not just an href. I have done this in various places, on my own blogs and as comments on other people's blogs etc.
Numerical Analysis and Applications of Differential Equations The last two years (19981999) have been a period of consolidation and hard work towards our goals. The NA group works with very close ties to center of excellence, has been a significant catalyst for the amalgamation and profiling of research areas. It is now in the final year of its Phase II, 19972000. The Psci projects are all carried out in collaboration with industry. They focus on present applications with short to medium time duration. This makes the TFR Basic Program grant on Numerical and Mathematical Study of Continuum Mechanics to the NA-group instrumental in its support for more basic research with long-term goals. The SSF support to the NA-group comes through a new program on Multi-Phase Flows, the National Network in Applied Mathematics, and the National Graduate School in Scientific Computing. The National Council for High-Performance Computers was discontinued in 1998 and its role in the financing of PDC taken over by NFR. The EC projects cover applications of computational electromagnetics and non-linear conservation laws. Our traditional research areas with applications to fluid mechanics and wave propagation are now complemented by Stochastic Differential Equations with applications to porous media flows and financial mathematics. Parallelization techniques for field problems are currently converging to spatial domain composition and standard message passing libraries, and Software for parallel architectures has become an important theme which is developed in most projects, such as CFD and CEM. The KTH International Master's Program Scientific Computing hosted by the department since fall '98 has a lively interaction with the research groups. The students carry out examination projects, and the researchers are strongly involved in curriculum development and as teachers. The NA-group members have also been active " technology providers " in the EC Technology Transfer Node Network projects coordinated by PDC. Models for flow of paper pulp, airfoil shape optimization by CFD, and high-performance simulation tools for building industry have fit well into ongoing research in the NA-group.
<reponame>zhiyong0804/xio<filename>src/ev/ev_select.h<gh_stars>1-10 /* Copyright (c) 2013-2014 <NAME>. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _H_PROXYIO_EV_SELECT_ #define _H_PROXYIO_EV_SELECT_ /* According to POSIX.1-2001 */ #include <sys/select.h> /* According to earlier standards */ #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <utils/list.h> struct fdd { struct list_head item; int fd; int events; int ready_events; }; struct eventpoll { struct list_head fds; }; #define walk_fdd_s(pos, tmp, head) \ walk_each_entry_s (pos, tmp, head, struct fdd, item) #endif
/** * Created by TobiasAndre on 24/07/2017. */ public class UpdateWidgetService extends RemoteViewsService { private int mQtScheduling = 0; private int mQtConfirmations = 0; @Nullable @Override public IBinder onBind(Intent intent) { return null; } @Override public RemoteViewsFactory onGetViewFactory(Intent intent) { return new StackRemoteViewsFactory(this.getApplicationContext(), intent); } @Override public int onStartCommand(Intent intent, int flags, int startId) { DecimalFormat formato = new DecimalFormat("00"); RemoteViews view = new RemoteViews(getPackageName(), R.layout.widget_layout); Uri contentUri = GoEsteticaContract.ScheduleEntry.CONTENT_URI; DecimalFormat decimalFormat = new DecimalFormat("00"); try { String selection = GoEsteticaContract.ScheduleEntry.COLUMN_SCHEDULE_DATE + " between '" + Util.getStringDate().replace("/", "-").trim() + "' and '" + decimalFormat.format(Calendar.getInstance().DAY_OF_MONTH) + "-" + decimalFormat.format(Calendar.getInstance().MONTH + 1) + "-" + Calendar.getInstance().YEAR + "'"; String[] selectionArguments = new String[]{String.valueOf("")}; Cursor c = getBaseContext().getContentResolver().query(contentUri, null, selection, selectionArguments, null); if (c != null) { while (c.moveToNext()) { mQtScheduling++; } c.close(); } }catch (Exception error){ System.out.println(error.getMessage()); } view.setTextViewText(R.id.id_qt_schedule, formato.format(mQtScheduling)); view.setTextViewText(R.id.id_qt_confirmations,formato.format(mQtConfirmations)); ComponentName theWidget = new ComponentName(this, GoEsteticaWidgetProvider.class); AppWidgetManager manager = AppWidgetManager.getInstance(this); manager.updateAppWidget(theWidget, view); return super.onStartCommand(intent, flags, startId); } }
<reponame>IrinaNag/conversions package com.testattenti.conversions.manager; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; public class HelperBase { protected WebDriver driver; public HelperBase(WebDriver driver) { this.driver = driver; } protected void type(By locator, String text) { click(locator); clear(locator); sendKeys(locator, text); } protected void sendKeys(By locator, String text) { if (text != null) { driver.findElement(locator).sendKeys(text); } } protected void clear(By locator) { driver.findElement(locator).clear(); } protected void click(By locator) { driver.findElement(locator).click(); } protected String getText(By locator) { return driver.findElement(locator).getText(); } }