content
stringlengths 7
2.61M
|
---|
Qamar Javed Bajwa +
NEW DELHI: Pakistan's Lieutenant General Qamar Javed Bajwa was on Saturday appointed as the country's Army chief, replacing the hawkish General Raheel Sharif., who was commissioned in the 16 Baloch Regiment in October 1980, is currently serving as the Inspector General of Training and Evaluation, Dawn said in a profile. He is from the infantry's Baloch Regiment, which has had three officers become Pakistan army chief.Bajwa has commanded the Pakistan Army's largest force, the 10 Corps, which oversees the areas along the Line of Control. He is a veteran in handling affairs in the troubled Pakistan-occupied-Kashmir (PoK) and in the northern regions of the country. Bajwa has also held the position of Force Commander Gilgit-Baltistan as a Major General.Despite Bajwa's extensive involvement in PoK, it is said that he considers extremism a bigger threat to his country over India, Dawn said. He is also said to be an apolitical person without any biases. His military colleagues say he is not attention-seeking and remains well connected with his troops."He is extremely professional, but very easy-going and full of compassion," an officer who had served under him told Dawn.Bajwa has been posted at several operational and staff positions in the army. He has previously held the post of instructor at the Infantry School, as well as at the Command and Staff College in Quetta He's also a former chief of the Force Command Northern Areas and has served with a UN mission in Congo alongside former Indian army chief General Bikram Singh, who was there in his capacity as a division commander.A report published in Pakistan's Tribune said Bajwa is a graduate of the Canadian Forces Command and Staff College in Toronto, The Naval Post Graduate University, California and the National Defence Univesity, Islamabad.Bajwa will take command as Pakistan's Chief of Army Staff on November 29, the day Sharif retires from his post. |
Shapable bulk agarosegelatinehydroxyapatiteminocycline nanocomposite fabricated using a mineralizing system aided with electrophoresis for bone tissue regeneration To develop a shapable bulk antibacterial nanocomposite biomaterial for bone regeneration. A bulk agarosegelatine hydrogel was mineralized using a hydrogel mineralizing system aided with electrophoresis, and the mineralized hydrogel was loaded with minocycline to obtain the agarosegelatinehydroxyapatiteminocycline nanocomposite. The nanocomposite had a large BrunauerEmmettTeller surface area of 44.4518 m2 g−1 and a high porosity of 76.9%. Hydroxyapatite crystals were well developed in the hydrogel matrix and exhibited a hybrid structure of microscale and nanoscale motifs. The addition of minocycline resulted in a continuous antibiotic release, inhibiting the growth of Staphylococcus aureus over 2 weeks in vitro. Exposed to rabbit bone marrow mesenchymal stem cells, the nanocomposite revealed good cytocompatibility in vitro. Furthermore, the biomaterial could effectively enhance the bone regeneration in a critical-size rabbit cranial defect model in vivo. These findings depicted that the nanocomposite, with good biocompatibility and good antibacterial property, is a promising candidate for future clinical application in bone tissue engineering or as a prospective bone replacement biomaterial. |
package com.challenge.repository;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import com.challenge.entity.Acceleration;
// Responsável pela persistência
public interface AccelerationRepository extends CrudRepository<Acceleration, Long> {
@Query(value = "select ac.* from ACCELERATION ac " +
"INNER JOIN CANDIDATE ca " +
"ON ac.id = ca.acceleration_id " +
"INNER JOIN COMPANY co " +
"ON ca.company_id = co.id " +
"where co.id = :companyId", nativeQuery = true)
List<Acceleration> findByCompanyId(@Param("companyId") Long companyId);
}
|
<filename>protbot/auth-config.py
{'config-search-paths': ['{:user-config-path}/protbot/config.yaml',],
'auth-variables':
{'log-path': {'default': '{:user-log-path}/sparcur',
'environment-variables': 'PROTBOT_LOG_PATH LOG_PATH'},
'hypothesis-api-key': {'environment-variables': 'PROTBOT_HYP_API_KEY HYP_API_KEY HYP_API_TOKEN'},
'hypothesis-group': {'environment-variables': 'PROTBOT_HYP_GROUP HYP_GROUP'},
'hypothesis-user': {'environment-variables': 'PROTBOT_HYP_USER HYP_USER'},}}
|
def _setting_key_to_address(key):
key_parts = key.split('.', maxsplit=_SETTING_MAX_KEY_PARTS - 1)
addr_parts = [_setting_short_hash(byte_str=x.encode()) for x in key_parts]
addr_parts.extend(
[_SETTING_ADDRESS_PADDING] * (_SETTING_MAX_KEY_PARTS - len(addr_parts))
)
return _SETTING_NAMESPACE + ''.join(addr_parts) |
Clayton Ferreira Cruz
Football career
Clayton was born in São João do Paraíso, Minas Gerais. After a solid career in native Brazil, mainly with Clube Atlético Mineiro, he moved to Portugal in 1999, joining Azores' C.D. Santa Clara.
In December 1999, Clayton signed for fellow Primeira Liga club FC Porto, and went on to become an important attacking element. On 25 May of the following year, in the replay match of the final of the Taça de Portugal, he was directly involved in both of his team's goals in a 2–0 win over Sporting CP.
On 17 October 2001, in the season's UEFA Champions League, Clayton scored a brace against Celtic in a 3–0 home triumph. He was also a part of the UEFA Cup-winning side in 2002–03, although he did not play in the final against the same opponent.
For 2003–04, Clayton moved to Sporting. After appearing scarcely throughout the campaign he was loaned to lowly F.C. Penafiel, representing Vitória S.C. subsequently.
After another Brazil spell with Sport Club do Recife, and another season at Penafiel (now in the Portuguese second level), Clayton moved to Cyprus. Starting 2007–08 with Alki Larnaca FC, he joined AC Omonia in the following January transfer window.
In January 2009, Clayton moved teams in the same country, signing with AEL Limassol. He returned to Brazil aged 35, playing the remainder of his career in amateur football. |
Wave-resistance sleeper with locally resonant phononic crystals: Bandgap property and vibration reduction mechanism As an artificially engineered metamaterial, locally resonant phononic crystals (LRPCs) exhibit great potential for the vibration reduction of urban rail transit due to their capability to prohibit the propagation of elastic waves with long wavelengths. This study proposes a wave-resistance sleeper with negative dynamic mass density by periodically embedding LRPCs into the concrete sleeper and provides new approaches to improve its bandgap property. Furthermore, the vibration reduction effect of the wave-resistance sleeper applied in a slab track was evaluated with a three-dimensional half-track model. The results show that the wave-resistance sleeper has two bandgaps below the frequency of 2000 Hz and can effectively prohibit the vibration within the bandwidth from transmitting to the track bed. Setting intervals in the rubber coating and increasing the void fraction can significantly reduce boundary frequencies of the first bandgap, whereas the second bandgap attenuates completely as the vibration can no longer be localized in the discontinuous rubber coating. A larger metal core is beneficial for obtaining a wider bandgap in the low-frequency range, whereas a thicker rubber coating can be used to obtain a wider bandgap in the medium-frequency range. To obtain wider bandgaps, the steel tube used should be as thin as possible and the use of an oval metal core should be avoided. It is hoped that the research results can provide a useful reference for the vibration reduction of track in rail transit. |
<reponame>indiependente/shrtnr
package service
var (
lettersMap = map[rune]bool{
'a': true,
'b': true,
'c': true,
'd': true,
'e': true,
'f': true,
'g': true,
'h': true,
'i': true,
'j': true,
'k': true,
'l': true,
'm': true,
'n': true,
'o': true,
'p': true,
'q': true,
'r': true,
's': true,
't': true,
'u': true,
'v': true,
'w': true,
'x': true,
'y': true,
'z': true,
}
)
|
The University of Dayton men’s club lacrosse team and Western Michigan found an interesting way to settle a scrimmage Saturday.
The game was tied and cancelled by lightning, so the teams used a best-of-three game of rock, paper, scissors to determine a winner. The Broncos won 2-0. Adam Wissman, a junior midfielder from Fishers, Ind., represented Dayton in the rock, paper, scissors game.
The teams play in the Central Collegiate Lacrosse Association in the Men’s Collegiate Lacrosse Association. This is their fall practice season. The official season starts in the spring. |
Ireland's lush green fields could soon become a thing of the past if the latest projections on the country’s climate changes are to be believed.
According to Met Eireann, the Irish Meteorological Service, summers In Ireland will become considerably drier because of climate change, with up to a 20 percent decrease in precipitation.
But don't think there's a good trade off for the hot weather, because in a just-released report titled Ireland’s Climate: The Road Ahead, Met Eireann says that winters will become wetter with precipitation increases of up to 14 percent.
That projection could see Ireland's legendary green fields lose their lushness throughout spring and summer months. A foretaste of what could lie ahead for the country was already delivered this year as grasslands across much of Ireland turned brown and dusty through lack of rainfall.
Meanwhile more rain in winter could lead to greater flooding, which has already become a seasonal problem in many areas.
Met Eireann's latest report warns of a generally warming trend in Ireland, with mean annual temperatures rising by approximately 1.44 Fahrenheit over the 1900 to 2012 period leading to a marked increase in the number of warm days when temperatures exceed 68 Fahrenheit and a decrease in the number of frost days per year.
This upward trend will likely accelerate in the years ahead Met Eireann said. Warming is likely to be particularly marked in the north of the country.
According to the AP both people and wildlife will have to struggle to adapt to a more volatile future climate in Ireland. |
<reponame>ChengUU/pangolin
package com.mcoding.pangolin.server.manager.func;
import com.mcoding.pangolin.server.context.PangolinChannelContext;
import io.netty.channel.Channel;
import java.util.function.Function;
/**
* @author wzt on 2019/7/16.
* @version 1.0
*/
public class CloseInactiveChannelFunc implements Function<Void, String> {
@Override
public String apply(Void aVoid) {
PangolinChannelContext.getAllPublicNetworkChannel().stream()
.filter(channel -> !channel.isActive())
.forEach(Channel::close);
PangolinChannelContext.getAllIntranetProxyChannel().stream()
.filter(channel -> !channel.isActive())
.forEach(Channel::close);
return "close success";
}
}
|
Search pattern training for evaluation of central venous catheter positioning on chest radiographs Abstract. The goal of this research was to examine whether search pattern training for central line positioning on chest radiographs (CXRs) improves the ability of healthcare trainees and practitioners to identify malpositioned central venous catheters. Two sets of CXRs with central catheters were shown; half of the images contained catheters that were appropriately positioned, half that were malpositioned. Subjects were asked to: mark the tip of the catheter using the simulated radiology workstations, indicate their confidence in tip localization, and state whether the catheter was appropriately positioned or malpositioned. Subjects were also given a survey assessing their thoughts about the usefulness of search pattern training and the simulated radiology workstation. There was a significant improvement in subjects ability to classify a catheter as malpositioned after training, p-value = 0.03. There was no significant difference in localization of the catheter tips or in the confidence for tip localization. Subjects responses to the questionnaire were significantly positive for all statements, indicating that they felt search pattern training using a simulated radiology workstation had a positive impact on their education. These results suggest that our knowledge of medical image perception may be useful for developing rational educational tools for image interpretation, and that simulated radiology workstations may be a helpful means of deploying these tools. |
Transport devices of this type make it possible to move workpieces to and from multiple processing stations disposed along the magnetic track system. The magnetic track system includes both linear and curved regions and frequently forms a closed path. Linear motors, whose primary parts are located inside a rotor, are used as drives. Multiple rotors may share the secondary part, which is arranged as a magnetic track with magnets that are lined up next to each other in a regular pattern, and can be moved independently of each other.
U.S. Pat. No. 5,642,013 describes a linear motor, which is well-suited for a transport device of the type described herein because of its especially low cogging forces. The primary part of this linear motor consists of an iron core having straight tooth faces, around which coils are wound. The secondary part includes magnets of alternating polarity, which are placed next to each other in a regular pattern. FIG. 4 of U.S. Pat. No. 5,642,013 shows this linear motor especially clearly.
PCT International Published Patent Application No. WO 2008/087130 describes a device, in which a multitude of linear primary parts is movable along magnetic tracks arranged in the form of a circular path. While the primary parts in the rotors have a straight configuration, like in a linear motor, the magnets on the circular path have a radial alignment in order to obtain a regular magnetic period along the circular path. Moreover, the placement of the magnets must be adapted for each required radius of a circular path, which involves considerable expense.
German Published Patent Application No. 10 2009 002 606 describes a transport device, which has linear as well as curved regions and whose transport path is closed on itself. The transport path includes the primary part having regularly positioned coil elements, while the rotors have magnets of alternating polarity. In this particular case, the problem of the coil placement in the linear and curved regions is addressed by providing two paths, the inner of the two paths having coil elements aligned in parallel in the linear regions, and the outer of the two paths having coil elements that have a radial alignment in the direction of the radius of curvature in the curved regions. Accordingly, a rotor has magnets that have a parallel alignment as well as magnets that have a radial alignment. However, because of the radial alignment of the magnets in the rotors, a radius of curvature is fixedly specified. The transport path with its two different tracks is also relatively complex in its manufacture.
In the essay “A Cost Effective Direct Drive Option for the Thirty Meter Telescope,” Proc. SPIE, Vol. 6273, 627335 (2006); DOI:10.1117/12.672204, a transport device based on standard components of a linear motor is described, by which a telescope having a large diameter is positioned on a circular path. Linear sections of the secondary part are sequentially placed at an angle with respect to each other, so that the sections approximate a circular path. The polarity of the magnets of the secondary part reverses itself from magnet to magnet across the sections as well. This causes interference in the periodicity of the magnetic field of the secondary part at the transitions from one section to the next, and higher cogging forces are produced in comparison with the linear scenario. |
<reponame>wduminy/junder
package org.junder.ui.model;
import java.util.Observable;
import java.util.Optional;
import org.junder.structure.JavaPackage;
import org.junder.structure.ProgramStructure;
import org.junder.widgets.model.CellInfoModel;
import org.junder.widgets.model.CellPoint;
import org.junder.widgets.model.Direction;
import org.junder.widgets.model.MatrixSelection;
/**
* An observer receives instance of {@link ModelEvent}
*/
public class Document extends Observable implements MatrixSelection, CellInfoModel {
private AdjacencyModel model;
private Optional<CellPoint> selectedCell = Optional.empty();
public AdjacencyModel getModel() {
return model;
}
public void setStructure(ProgramStructure s) {
model = new AdjacencyModel(this,s.getPackages());
notifyChange(ModelEvent.MatrixLoaded);
setSelectedCell(CellPoint.Origin);
}
private void notifyChange(ModelEvent e) {
setChanged();
notifyObservers(e);
}
@Override
public Optional<CellPoint> getSelectedCell() {
return selectedCell;
}
@Override
public void setSelectedCell(CellPoint v) {
if (v.inRange(model.getColumnCount()-1,model.getRowCount()-1)) {
selectedCell = Optional.of(v);
notifyChange(ModelEvent.SelectionChanged);
}
}
@Override
public JavaPackage infoFrom() {
return model.getPackage(selectedCell.get().row);
}
@Override
public JavaPackage infoTo() {
return model.getPackage(selectedCell.get().col);
}
@Override
public boolean hasInfo() {
return selectedCell.isPresent();
}
public String statusText() {
if (model == null)
return "";
else {
int v = model.cycleUsingCount();
if (v > 0)
return Integer.toString(v) + " usings in cycles";
else
return "";
}
}
public void select(Direction d) {
CellPoint oldCell = getSelectedCell().orElse(CellPoint.Origin);
switch (d) {
case Left:
setSelectedCell(oldCell.left());
break;
case Right:
setSelectedCell(oldCell.right(model.getColumnCount()-1));
break;
case Up:
setSelectedCell(oldCell.up());
break;
case Down:
setSelectedCell(oldCell.down(model.getRowCount()-1));
break;
case Next:
setSelectedCell(nextWithValue(oldCell));
break;
case Previous:
setSelectedCell(previousWithValue(oldCell));
break;
}
}
private CellPoint nextWithValue(CellPoint from) {
final CellPoint last = new CellPoint(model.getColumnCount()-1, model.getRowCount()-1);
CellPoint at = from.next(last.col,last.row);
while (!at.equals(last)) {
if (model.getCellValue(at.col, at.row) > 0)
return at;
at = at.next(last.col,last.row);
}
return at;
}
private CellPoint previousWithValue(CellPoint from) {
final int lastColumn = model.getColumnCount()-1;
CellPoint at = from.previous(lastColumn);
while (!at.equals(CellPoint.Origin)) {
if (model.getCellValue(at.col, at.row) > 0)
return at;
at = at.previous(lastColumn);
}
return at;
}
public void makeRowMatrix() {
createChildMatrix(getSelectedCell().get().row);
}
public void makeColumnMatrix() {
createChildMatrix(getSelectedCell().get().col);
}
private void createChildMatrix(int index) {
JavaPackage p = model.getPackage(index);
model = new AdjacencyModel(this,getModel().linkedPackages(p),model);
selectedCell = Optional.empty();
notifyChange(ModelEvent.MatrixLoaded);
}
public void gotoParentMatrix() {
model = getModel().getParent().get();
selectedCell = Optional.empty();
notifyChange(ModelEvent.MatrixLoaded);
}
}
|
<gh_stars>1-10
#include "InferredEvidence.hpp"
#include <string>
#include <sstream>
namespace rete {
std::string ptostr(const void* ptr)
{
std::stringstream stream;
stream << ptr;
return stream.str();
}
InferredEvidence::InferredEvidence(const Token::Ptr& token, const Production::Ptr& production)
: Evidence(InferredEvidence::TypeId), token_(token), production_(production)
{
}
bool InferredEvidence::operator==(const Evidence& other) const
{
if (this->type() != other.type()) return false;
auto o = static_cast<const InferredEvidence*>(&other);
// we get away with a ptr-check here, because these are exactly the pointer as propagated through the rete network
return token_ == o->token_ && production_ == o->production_;
}
bool InferredEvidence::operator<(const Evidence& other) const
{
if (this->type() != other.type()) return this->type() < other.type();
// types are equal, so just use static_cast!
auto o = static_cast<const InferredEvidence*>(&other);
// compare by token and production
if (production_ < o->production_) return true;
if (production_ == o->production_)
{
// just pointer comparison!
return token_ < o->token_;
}
return false;
}
std::string InferredEvidence::toString() const
{
return "[" + ptostr(this) + "] Inferred by [" + ptostr(production_.get()) + "] " + production_->getName() + " from [" + ptostr(token_.get()) + "] " + token_->toString();
}
Token::Ptr InferredEvidence::token() const
{
return token_;
}
Production::Ptr InferredEvidence::production() const
{
return production_;
}
} /* rete */
|
In vitro adventitious roots: a non-disruptive technology for the production of phytoconstituents on the industrial scale Abstract The current trends of consumer-driven demands for natural therapeutics and the availability of evidence-based phytopharmaceuticals from traditional knowledge has once again brought the medicinal plants into forefront of health. In 2019, World Health Organization global report on traditional and complementary medicine has also substantiated the revival of herbal medicine including its convergence with conventional medicine for the management and prevention of diseases. It means these industries need plenty of plant materials to meet the unprecedented demands of herbal formulations. However, it is pertinent to mention here that around 7080% medicinal plants are sourced from the wild and most of such highly acclaimed plants are listed under Rare, Endangered and Threatened species by IUCN. Additionally, over 30% traditional health formulations are based on underground plant parts, which lead to the uprooting of plants. Overharvesting from limited plant populations, meager conventional cultivation and a rising fondness for natural products exerting enormous pressure on natural habitats. Therefore, the nondestructive means of phytochemical production employing biotechnological tools could be used for sustainable production and consumption patterns. In recent years, a number of reports described the use of adventitious roots induced under in vitro conditions for the extraction of phytochemicals on a sustainable basis. In this article, efforts are made to review recent developments in this area as well as understand the induction mechanisms of adventitious roots, their in vitro cultivation, probable factors that affect the growth and metabolite production, and assess the possibility of industrial scale production to meet the rising demands of natural herbs. |
<filename>src/main/java/com/appdynamics/monitors/hanadb/config/Globals.java
package com.appdynamics.monitors.hanadb.config;
public class Globals {
public static final String METRIC_SEPARATOR = "|";
public static final String defaultMetricPrefix = "Custom Metrics|HanaDBMonitor|";
public static final String configFile = "config-file";
public static final String queries = "queries";
public static final String password = "password";
public static final String encryptionKey = "encryption-key";
public static final String passwordEncrypted = "<PASSWORD>";
public static final String connectionString = "connectionString";
public static final String userName = "username";
public static final String statement = "statement";
public static final String columns = "columns";
public static final String type = "type";
public static final String name = "name";
public static final String convertFrom = "convertFrom";
public static final String convertTo = "convertTo";
public static final String metric = "metric";
public static final String clusters = "clusters";
public static String jdbcDriverClass = "com.sap.db.jdbc.Driver";
public static final String driver = "driver";
}
|
def one_hot_encode_labels(
X_train: np.ndarray, X_test: np.ndarray, y_train: np.ndarray, y_test: np.ndarray
) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
y_train = to_categorical(y_train)
y_test = to_categorical(y_test)
return X_train, X_test, y_train, y_test |
package us.ihmc.commonWalkingControlModules.momentumBasedController.feedbackController.jointspace;
import us.ihmc.commonWalkingControlModules.controllerCore.command.inverseDynamics.JointspaceAccelerationCommand;
import us.ihmc.commonWalkingControlModules.momentumBasedController.feedbackController.FeedbackControllerInterface;
import us.ihmc.robotics.MathTools;
import us.ihmc.robotics.controllers.PDGainsInterface;
import us.ihmc.robotics.dataStructures.registry.YoVariableRegistry;
import us.ihmc.robotics.dataStructures.variable.BooleanYoVariable;
import us.ihmc.robotics.dataStructures.variable.DoubleYoVariable;
import us.ihmc.robotics.math.filters.RateLimitedYoVariable;
import us.ihmc.robotics.screwTheory.OneDoFJoint;
public class OneDoFJointFeedbackController implements FeedbackControllerInterface
{
private final JointspaceAccelerationCommand output = new JointspaceAccelerationCommand();
private final OneDoFJoint joint;
private final BooleanYoVariable isEnabled;
private final DoubleYoVariable qCurrent;
private final DoubleYoVariable qDCurrent;
private final DoubleYoVariable qDesired;
private final DoubleYoVariable qDDesired;
private final DoubleYoVariable qDDFeedforward;
private final DoubleYoVariable qError;
private final DoubleYoVariable qDError;
private final DoubleYoVariable maxFeedbackAcceleration;
private final DoubleYoVariable maxFeedbackJerk;
private final DoubleYoVariable qDDFeedback;
private final RateLimitedYoVariable qDDFeedbackRateLimited;
private final DoubleYoVariable qDDDesired;
private final DoubleYoVariable qDDAchieved;
private final DoubleYoVariable kp;
private final DoubleYoVariable kd;
private final DoubleYoVariable weightForSolver;
public OneDoFJointFeedbackController(OneDoFJoint joint, double dt, YoVariableRegistry parentRegistry)
{
String jointName = joint.getName();
YoVariableRegistry registry = new YoVariableRegistry(jointName + "PDController");
this.joint = joint;
isEnabled = new BooleanYoVariable("control_enabled_" + jointName, registry);
isEnabled.set(false);
qCurrent = new DoubleYoVariable("q_" + jointName, registry);
qDCurrent = new DoubleYoVariable("qd_" + jointName, registry);
qDesired = new DoubleYoVariable("q_d_" + jointName, registry);
qDDesired = new DoubleYoVariable("qd_d_" + jointName, registry);
qDDFeedforward = new DoubleYoVariable("qdd_ff_" + jointName, registry);
qError = new DoubleYoVariable("q_err_" + jointName, registry);
qDError = new DoubleYoVariable("qd_err_" + jointName, registry);
maxFeedbackAcceleration = new DoubleYoVariable("qdd_max_fb_" + jointName, registry);
maxFeedbackJerk = new DoubleYoVariable("qddd_fb_max_" + jointName, registry);
qDDFeedback = new DoubleYoVariable("qdd_fb_" + jointName, registry);
qDDFeedbackRateLimited = new RateLimitedYoVariable("qdd_fb_rl_" + jointName, registry, maxFeedbackJerk, qDDFeedback, dt);
qDDDesired = new DoubleYoVariable("qdd_d_" + jointName, registry);
qDDAchieved = new DoubleYoVariable("qdd_achieved_" + jointName, registry);
kp = new DoubleYoVariable("kp_" + jointName, registry);
kd = new DoubleYoVariable("kd_" + jointName, registry);
weightForSolver = new DoubleYoVariable("weight_" + jointName, registry);
weightForSolver.set(Double.POSITIVE_INFINITY);
output.addJoint(joint, Double.NaN);
parentRegistry.addChild(registry);
}
@Override
public void initialize()
{
qDDFeedbackRateLimited.reset();
}
@Override
public void setEnabled(boolean isEnabled)
{
this.isEnabled.set(isEnabled);
}
public void setDesireds(double q_d, double qd_d, double qdd_feedforward)
{
qDesired.set(q_d);
qDDesired.set(qd_d);
qDDFeedforward.set(qdd_feedforward);
}
public void setGains(PDGainsInterface gains)
{
kp.set(gains.getKp());
kd.set(gains.getKd());
maxFeedbackAcceleration.set(gains.getMaximumFeedback());
maxFeedbackJerk.set(gains.getMaximumFeedbackRate());
}
public void setWeightForSolver(double weightForSolver)
{
this.weightForSolver.set(weightForSolver);
output.setWeight(weightForSolver);
}
@Override
public void compute()
{
if (!isEnabled.getBooleanValue())
return;
qCurrent.set(joint.getQ());
qDCurrent.set(joint.getQd());
qError.set(qDesired.getDoubleValue() - qCurrent.getDoubleValue());
qDError.set(qDDesired.getDoubleValue() - qDCurrent.getDoubleValue());
double qdd_fb = kp.getDoubleValue() * qError.getDoubleValue() + kd.getDoubleValue() * qDError.getDoubleValue();
qdd_fb = MathTools.clipToMinMax(qdd_fb, maxFeedbackAcceleration.getDoubleValue());
qDDFeedback.set(qdd_fb);
qDDFeedbackRateLimited.update();
qDDDesired.set(qDDFeedforward.getDoubleValue() + qDDFeedbackRateLimited.getDoubleValue());
output.setOneDoFJointDesiredAcceleration(0, qDDDesired.getDoubleValue());
}
@Override
public void computeAchievedAcceleration()
{
qDDAchieved.set(joint.getQddDesired());
}
public OneDoFJoint getJoint()
{
return joint;
}
public double getJointDesiredAcceleration()
{
return qDDDesired.getDoubleValue();
}
@Override
public boolean isEnabled()
{
return isEnabled.getBooleanValue();
}
@Override
public JointspaceAccelerationCommand getOutput()
{
if (!isEnabled())
throw new RuntimeException("This controller is disabled.");
return output;
}
}
|
import { Auth } from '@auth/store/auth.state';
import { ShoppingList } from '@app/shopping-list/store/shopping-list.state';
export interface AppState {
readonly auth: Auth;
readonly shoppingList: ShoppingList;
}
|
<filename>swiftlets/sys_jms/src/main/java/com/swiftmq/impl/jms/standard/v600/InboundReader.java
/*
* Copyright 2019 IIT Software GmbH
*
* IIT Software GmbH 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 com.swiftmq.impl.jms.standard.v600;
import com.swiftmq.jms.smqp.v600.SMQPBulkRequest;
import com.swiftmq.jms.smqp.v600.SMQPFactory;
import com.swiftmq.swiftlet.SwiftletManager;
import com.swiftmq.swiftlet.log.LogSwiftlet;
import com.swiftmq.swiftlet.net.Connection;
import com.swiftmq.swiftlet.net.InboundHandler;
import com.swiftmq.swiftlet.net.NetworkSwiftlet;
import com.swiftmq.swiftlet.timer.event.TimerListener;
import com.swiftmq.swiftlet.trace.TraceSpace;
import com.swiftmq.swiftlet.trace.TraceSwiftlet;
import com.swiftmq.tools.dump.Dumpable;
import com.swiftmq.tools.dump.DumpableFactory;
import com.swiftmq.tools.dump.Dumpalizer;
import com.swiftmq.tools.requestreply.Request;
import com.swiftmq.tools.requestreply.RequestServiceRegistry;
import com.swiftmq.tools.util.DataStreamInputStream;
import java.io.IOException;
import java.io.InputStream;
public class InboundReader extends RequestServiceRegistry
implements InboundHandler, TimerListener {
static final DumpableFactory dumpableFactory = new SMQPFactory();
LogSwiftlet logSwiftlet = null;
NetworkSwiftlet networkSwiftlet = null;
TraceSwiftlet traceSwiftlet = null;
TraceSpace traceSpace = null;
String tracePrefix;
Connection connection = null;
DataStreamInputStream dis = new DataStreamInputStream();
volatile boolean closed = false;
volatile int keepaliveCount = 5;
InboundReader(String tracePrefix, Connection connection) {
this.tracePrefix = tracePrefix;
this.tracePrefix += "/InboundReader";
this.connection = connection;
logSwiftlet = (LogSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$log");
networkSwiftlet = (NetworkSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$net");
traceSwiftlet = (TraceSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$trace");
traceSpace = traceSwiftlet.getTraceSpace(TraceSwiftlet.SPACE_PROTOCOL);
}
public void performTimeAction() {
keepaliveCount--;
if (traceSpace.enabled)
traceSpace.trace("smqp", tracePrefix + ": decrementing keepaliveCount to: " + keepaliveCount);
if (keepaliveCount == 0) {
if (traceSpace.enabled) traceSpace.trace("smqp", tracePrefix + ": keepalive counter reaching 0, exiting!");
logSwiftlet.logWarning("smqp", tracePrefix + ": keepalive counter reaching 0, exiting!");
networkSwiftlet.getConnectionManager().removeConnection(connection); // closes the connection
}
}
public void setClosed(boolean closed) {
this.closed = closed;
}
protected boolean isSendExceptionEnabled() {
return !closed;
}
private void resetKeepaliveCount() {
keepaliveCount = 5;
if (traceSpace.enabled)
traceSpace.trace("smqp", tracePrefix + ": setting keepaliveCount to: " + keepaliveCount);
}
public void dataAvailable(Connection connection, InputStream inputStream)
throws IOException {
dis.setInputStream(inputStream);
Dumpable obj = Dumpalizer.construct(dis, dumpableFactory);
if (traceSpace.enabled) traceSpace.trace("smqp", "read object: " + obj);
if (obj.getDumpId() != SMQPFactory.DID_KEEPALIVE_REQ) {
if (obj.getDumpId() == SMQPFactory.DID_BULK_REQ) {
SMQPBulkRequest bulkRequest = (SMQPBulkRequest) obj;
for (int i = 0; i < bulkRequest.len; i++) {
Request req = (Request) bulkRequest.dumpables[i];
if (req.getDumpId() != SMQPFactory.DID_KEEPALIVE_REQ)
dispatch(req);
else
resetKeepaliveCount();
}
} else
dispatch((Request) obj);
} else
resetKeepaliveCount();
}
}
|
// Pop just removes and returns the top of stack.
func (m *Machine) Pop() *Value {
switch l := len(m.stack); l {
case 0:
return nil
case 1:
i := m.stack[0]
m.stack = nil
return i
default:
i := m.stack[l-1]
m.stack = m.stack[:l-1]
return i
}
} |
An Approach to Classify Thumbnail Images on Video Sites by the Number of Accesses In recent years, YouTube and other video sites have become wildly popular, and many Internet users spend a lot of time watching them every day. Since popular sites have sponsors, and the amount of income depends on the number of accesses, each channel operator is devising various methods. On the other hand, viewers often choose videos based on the thumbnail images, and the key to gaining access is how to attract them with the thumbnail images. In this paper, we use machine learning to classify thumbnail images on video sites and find the trends of thumbnail images that are expected to attract a lot of traffic. In our experiments, we use YouTube as the video site and Google Teachable Machine as the classifier. As a result, it was found that there is a certain trend between thumbnail images and the number of accesses. |
package com.newt.java8;
import org.junit.Test;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
/**
* @Description Lambda进阶之路
* @Author newt
* @Date 18/08/22
*/
public class LambdaTester {
String title = "newt的进阶之路";
final static String salutation = "Hello";
//类型声明
MathOperation addition = (int a, int b) -> a + b;
// 不用类型声明
MathOperation subtraction = (a, b) -> a - b;
// 大括号中的返回语句
MathOperation multiplication = (int a, int b) -> { return a * b; };
// 没有大括号及返回语句
MathOperation division = (int a, int b) -> a / b;
/**
* lambda表达式
*
* lambda主要用来定义行内执行方法接口。
* lambda免去了使用匿名方法的麻烦,java变得简单且拥有强大的函数化的编程能力
*
*/
@Test
public void lambdaTest1(){
LambdaTester LambdaTester = new LambdaTester();
System.out.println(LambdaTester.operate(5,5,addition));
System.out.println(LambdaTester.operate(5,5,subtraction));
System.out.println(LambdaTester.operate(5,5,multiplication));
System.out.println(LambdaTester.operate(5,5,division));
//不需要括号
GreetingService greetingService = message -> System.out.println(message);
greetingService.sayMessage("我是谁!");
//you括号
GreetingService greetingService2 = (message) -> {
System.out.println(message);
};
greetingService2.sayMessage("我bu是谁!");
}
/**
* lambda变量作用域
* lambda表达式的局部变量可以不用声明为final,但是不可被后面的代码修改,否则编译会报错(隐性的final定义)。
* lambda不允许声明与局部变量同名的变量,否则编译会报错。
*/
@Test
public void lambdaTest2(){
int num = 1;
//Converter<Integer, String> s = (param) -> System.out.println(String.valueOf(param + num));
//s.convert(2);
num = 5;
String first = "";
//Comparator<String> comparator = (first, second) -> Integer.compare(first.length(), second.length()); //编译会出错
}
interface MathOperation {
int operation(int a, int b);
}
interface GreetingService {
void sayMessage(String message);
}
public interface Converter<T1, T2> {
void convert(int i);
}
private int operate(int a, int b, MathOperation mathOperation){
return mathOperation.operation(a, b);
}
/**
* Lambda案例
*/
@Test
public void lambdaTest3(){
String[] strList = {"skr","呦","freestyle","嘻哈"};
//foreach循环
List<String> strings = Arrays.asList(strList);
for (String string :strings) {
System.out.println(string);
}
//Lambda循环
strings.forEach(str -> System.out.print(str + "--"));
System.out.println();
//使用Lambda的【::】操作符,一种简写
strings.forEach(System.out::println);
}
/**
* Lambda实现Runable接口
*
*/
@Test
public void lambdaTest4(){
new Thread(new Runnable() {
@Override
public void run() {
System.out.println("普通匿名内部类");
}
}).start();
new Thread(() -> System.out.println("Lambda")).start();
}
/**
* Comparator 类被用来排序集合
*
*/
@Test
public void lambdaTest5(){
String[] names = {"Nick","Lou","Channing","Burgess","Keith",
"Pag","Mamie","Sally","Bing","Lisa",
"Wendy","Ethel","Vita","Angelo","Troy"};
//匿名内部类
Arrays.sort(names, new Comparator<String>() {
@Override
public int compare(String n1, String n2) {
return (n1.compareTo(n2));
}
});
//Lambda排序
Comparator<String> sortByName = (String n1, String n2) -> (n1.compareTo(n2));
Arrays.sort(names, sortByName);
Arrays.sort(names, (String n1, String n2) -> (n1.compareTo(n2)));
}
}
|
import numpy as np
from qutip.qip.compiler import Instruction
from qutip.qip.compiler import GateCompiler
import matplotlib.pyplot as plt
#define gauss block shape
def gauss_block(t,sigma,amplitude,duration):
if t<2*sigma:
return amplitude*np.exp(-0.5*((t-2*sigma)/sigma)**2)
elif t>duration-2*sigma:
return amplitude*np.exp(-0.5*((t+2*sigma-duration)/sigma)**2)
else:
return amplitude
gauss_block=np.vectorize(gauss_block)
# define modulated gauss block shape
def gauss_block_modulated(t,sigma,amplitude,duration,omega,phase):
return gauss_block(t,sigma,amplitude,duration)*np.cos(omega*t+phase)
#define gauss_block shape modulated which used for qubit XY plane rotation, mostly used
def gauss_block_modulated_XY_rotate_compiler(gate,args):
"""
Compiler for the X-axis_Rotate gate, with gaussian block shape
"""
targets = gate.targets # target qubit
parameters = args["params"]
#set pulse strength (rabi frequency)
Omega=gate.arg_value.get('Omega',parameters["Omega"])*np.pi*2
#set pulse raising time (sigma)
gate_sigma=gate.arg_value.get('sigma',0.01)
#the detuning of the frequency of the driving field
detuning=gate.arg_value.get('detuning',0)*2*np.pi
#rotate direction of the qubit, 0 means X, np.pi/2 means Y axis
rotate_direction=gate.arg_value.get('rotate_direction',0)
#set pulse duration
duration=gate.arg_value['duration']
time_step=3e-3
tlist = np.linspace(0, duration, int(duration/time_step))
coeff1 = gauss_block_modulated(tlist, gate_sigma, Omega, duration,detuning, rotate_direction)
coeff2 = gauss_block_modulated(tlist, gate_sigma, Omega, duration,detuning, rotate_direction+np.pi/2)
pulse_info =[ ("X-axis_R", coeff1),("Y-axis_R",coeff2) ]# save the information in a tuple (pulse_name, coeff)
return [Instruction(gate, tlist, pulse_info)]
def gauss_rx_rz_compiler(gate, args):
"""
Compiler for the XY-plane_Rotate gate, with a changable frequency shift.
The propose of this gate is using probing qubit at certain interaction place (frequency),
to separate state preparation and probing part, for better state preparation
"""
targets = gate.targets # target qubit
parameters = args["params"]
#set pulse strength (rabi frequency)
Omega=gate.arg_value.get('Omega',parameters["Omega"])*np.pi*2
#set pulse raising time (sigma)
gate_sigma=gate.arg_value.get('sigma',0.01)
#the detuning of the frequency of the driving field
detuning=gate.arg_value.get('detuning',0)*2*np.pi
#rotate direction of the qubit, 0 means X, np.pi/2 means Y axis
rotate_direction=gate.arg_value.get('rotate_direction',0)
#set pulse duration
duration=gate.arg_value['duration']
sigma_starkshift=gate.arg_value.get('sigma_starkshift',0.01)
amplitude_starkshift=gate.arg_value.get('amplitude_starkshift',0)*np.pi*2
time_step=3e-3
tlist = np.linspace(0, duration, int(duration/time_step))
coeff1 = gauss_block_modulated(tlist, gate_sigma, Omega, duration,detuning, rotate_direction)
coeff2 = gauss_block_modulated(tlist, gate_sigma, Omega, duration,detuning, rotate_direction+np.pi/2)
coeff3 = gauss_block(tlist,sigma_starkshift,amplitude_starkshift,duration)
pulse_info =[ ("X-axis_R", coeff1),("Y-axis_R",coeff2),("Z-axis_R",coeff3) ]# save the information in a tuple (pulse_name, coeff)
return [Instruction(gate, tlist, pulse_info)]
def swap_phonon_compiler(gate, args):
"""
Compiler for the z-axis_Rotate gate
"""
targets = gate.targets # target qubit
parameters = args["params"]
g= parameters["g"] [targets[-1]-1] # find the coupling strength for the target qubit
gate_sigma =0.01
amplitude =parameters['phonon_omega_z'][targets[1]-1]
duration = 1/g/4*2*np.pi
tlist = np.linspace(0, duration, 1000)
coeff = gauss_block(tlist,gate_sigma, amplitude, duration)
pulse_info =[ ("Z-axis_R", coeff) ]# save the information in a tuple (pulse_name, coeff)
return [Instruction(gate, tlist, pulse_info)]
#define sigma_z gaussian block shape pulse
def starkshift_compiler(gate, args):
"""
Compiler for the X-axis_Rotate gate
"""
targets = gate.targets # target qubit
parameters = args["params"]
g= parameters["g"] # find the coupling strength for the target qubit
gate_sigma =0.02
duration=gate.arg_value['duration']
detuning=gate.arg_value.get('detuning',0)
amplitude=parameters['phonon_omega_z'][targets[1]-1]+detuning*2*np.pi
time_step=3e-3
tlist = np.linspace(0, duration, int(duration/time_step))
coeff = gauss_block(tlist,gate_sigma, amplitude, duration)
pulse_info =[ ("Z-axis_R", coeff) ]# save the information in a tuple (pulse_name, coeff)
return [Instruction(gate, tlist, pulse_info)]
#define gauss shape
def gauss_dist(t, sigma, amplitude, duration,omega,phase):
#gaussian shape pulse
return amplitude*np.exp(-0.5*((t-duration/2)/sigma)**2)*np.cos(omega*t+phase)
#define gaussian shape x rotation, normally for quick pulse
def gauss_rx_compiler(gate, args):
"""
Compiler for the X-axis_Rotate gate
"""
targets = gate.targets # target qubit
if not gate.arg_value:
gate.arg_value={}
parameters = args["params"]
# rabi frequency of the qubit operation
Omega=gate.arg_value.get('Omega',parameters["Omega"])*np.pi*2
# the phase want to rotate, correspond to amplitude and time of pulse
rotate_phase=gate.arg_value.get('rotate_phase',np.pi)
#the ratio we need to change the amplitude based on phase we want to rotate
amp_ratio=rotate_phase/(np.pi)
#the detuning of the frequency of the driving field
detuning=gate.arg_value.get('detuning',0) *2*np.pi
#rotate direction of the qubit, 0 means X, np.pi/2 means Y axis
rotate_direction=gate.arg_value.get('rotate_direction',0)
gate_sigma = 1/Omega
amplitude = Omega/2.49986*np.pi/2*amp_ratio # 2.49986 is just used to compensate the finite pulse duration so that the total area is fixed
duration = 4 * gate_sigma
tlist = np.linspace(0, duration, 300)
coeff1 = gauss_dist(tlist, gate_sigma, amplitude, duration,detuning,rotate_direction)
coeff2 = gauss_dist(tlist, gate_sigma, amplitude, duration,detuning,rotate_direction+np.pi/2)
pulse_info =[ ("X-axis_R", coeff1),("Y-axis_R", coeff2) ]# save the information in a tuple (pulse_name, coeff)
return [Instruction(gate, tlist, pulse_info)]
#define waiting pulse
def wait_complier(gate,args):
targets = gate.targets # target qubit
parameters = args["params"]
time_step=3e-3 #assume T1 at least 1us for each part of the system
duration=gate.arg_value
tlist=np.linspace(0,duration,int(duration/time_step))
coeff=0*tlist
pulse_info =[ ("Wait_T", coeff) ]# save the information in a tuple (pulse_name, coeff)
return [Instruction(gate, tlist, pulse_info)]
class HBAR_Compiler(GateCompiler): # compiler class
def __init__(self, num_qubits, params, pulse_dict):
super(HBAR_Compiler, self).__init__(
num_qubits, params=params, pulse_dict=pulse_dict)
# pass our compiler function as a compiler for RX (rotation around X) gate.
self.gate_compiler["X_R"] = gauss_rx_compiler
self.gate_compiler["Wait"]=wait_complier
self.gate_compiler["swap"]=swap_phonon_compiler
self.gate_compiler['Z_R_GB']=starkshift_compiler
self.gate_compiler['XY_R_GB']= gauss_block_modulated_XY_rotate_compiler
self.gate_compiler['XYZ_R_GB']=gauss_rx_rz_compiler
self.args.update({"params": params}) |
<filename>src/plp/programebrincando/Programa.java
package plp.programebrincando;
import plp.programebrincando.command.Comando;
import plp.programebrincando.exception.IdentificadorJaDeclaradoException;
import plp.programebrincando.exception.IdentificadorNaoDeclaradoException;
import plp.programebrincando.memory.AmbienteCompilacao;
import plp.programebrincando.memory.AmbienteExecucao;
public class Programa {
private Comando comando;
public Programa(Comando comando){
this.comando = comando;
}
public Comando getComando() {
return comando;
}
public void setComando(Comando comando) {
this.comando = comando;
}
public boolean checaTipo(AmbienteCompilacao ambiente){
boolean valido = false;
try {
valido = comando.checaTipo(ambiente);
} catch (IdentificadorJaDeclaradoException | IdentificadorNaoDeclaradoException e) {
e.printStackTrace();
}
return valido;
}
public void executar(AmbienteExecucao ambiente) {
try {
comando.executar(ambiente);
} catch (IdentificadorJaDeclaradoException | IdentificadorNaoDeclaradoException e) {
e.printStackTrace();
}
}
} |
Multimedia Processing in Concurrent Engineering Many types of information that traditionally were considered to be analog, such as images and sound, are now processed and utilized in digital form. These developments require the integration of storage, communication, analysis, and presentation mechanisms for diverse types of data, including still images, graphics, audio, video, and text. Scientific visualization enables engineers and scientists to examine large amounts of data efficiently and with a greater degree of comprehension In the recent years, visualization has become an important component of the scientific discovery process. Concurrent engineering refers to the methodology used by a team for simultaneously designing the entire life cycle of a product from product specification and design, through manufacturing and assembly, to shipping and disposal. |
<reponame>vdesai429/pathways2
import { Injectable } from '@angular/core';
import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import {KinveyService } from './kinvey.service';
@Injectable({
providedIn: 'root'
})
export class AuthGuard implements CanActivate {
constructor(private kinveyservice: KinveyService) {
}
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
console.log('authenticating')
return this.kinveyservice.isAdminAuth();
}
}
|
/*
* dbgtrace.h
*/
/*
* Copyright (C) 2006-2011 K.Takata
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
*/
#ifndef DBGTRACE_H_
#define DBGTRACE_H_
/*** Debugging Routines ***/
#if defined(__cplusplus) || defined(_MSC_VER)
#ifdef __cplusplus
inline
#else /* __cplusplus */
__inline
#endif /* __cplusplus */
void TRACEx_(LPCTSTR msg, ...)
{
TCHAR buf_[1024];
va_list ap;
va_start(ap, msg);
wvsprintf(buf_, msg, ap);
va_end(ap);
OutputDebugString(buf_);
}
#endif /* __cplusplus || _MSC_VER */
#pragma comment(lib, "user32.lib")
#if defined(_DEBUG) || defined(DEBUG)
#include <stdarg.h>
#define TRACE0(msg) OutputDebugString(msg)
#define TRACE1(msg, p1) \
do { \
TCHAR buf_[1024]; wsprintf(buf_, msg, p1); \
OutputDebugString(buf_); \
} while(0)
#define TRACE2(msg, p1, p2) \
do { \
TCHAR buf_[1024]; wsprintf(buf_, msg, p1, p2); \
OutputDebugString(buf_); \
} while(0)
#define TRACE3(msg, p1, p2, p3) \
do { \
TCHAR buf_[1024]; wsprintf(buf_, msg, p1, p2, p3); \
OutputDebugString(buf_); \
} while(0)
#define TRACE4(msg, p1, p2, p3, p4) \
do { \
TCHAR buf_[1024]; wsprintf(buf_, msg, p1, p2, p3, p4); \
OutputDebugString(buf_); \
} while(0)
#if defined(__cplusplus) || defined(_MSC_VER)
#define TRACE TRACEx_
#endif /* __cplusplus || _MSC_VER */
/*
#define ASSERT(x) \
do { \
if (!(x)) { \
TRACE2(TEXT("Assertion failed! in %s (%d)\n"), __FILE__, __LINE__); \
DebugBreak(); \
} \
} while(0)
#define VERIFY(x) ASSERT(x)
*/
#else /*_DEBUG */
#define TRACE0(msg)
#define TRACE1(msg, p1)
#define TRACE2(msg, p1, p2)
#define TRACE3(msg, p1, p2, p3)
#define TRACE4(msg, p1, p2, p3, p4)
#if defined(__cplusplus) || defined(_MSC_VER)
#define TRACE 1 ? (void) 0 : TRACEx_
#endif /* __cplusplus || _MSC_VER */
/*
#define ASSERT(x) ((void) 0)
#define VERIFY(x) ((void) x)
*/
#endif /* _DEBUG */
/*
#ifdef _DEBUG
#define DEBUG_CLIENTBLOCK new(_CLIENT_BLOCK, __FILE__, __LINE__)
#else
#define DEBUG_CLIENTBLOCK
#endif // _DEBUG
*/
#ifdef _DEBUG
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#else
#define DEBUG_NEW new
#endif
#endif /* DBGTRACE_H_ */
|
Kotara High School
Description
Kotara High School has four main buildings, named A, B, C and D "blocks" respectively. Other major buildings include the Administration building (built in 2018) which houses administrative staff as well as the senior leadership team, and the multi-purpose centre used for assemblies, performance, and sporting activities. In the centre of the school is the quadrangle with a COLA structure used for shade at one end. The school also features two basketball/netball courts, a field, and a canteen building equipped with facilities to play net sports as well as change rooms and shower amenities. The school's colours are green, black, yellow and white.
School organisation
The school is divided in to eight main academic faculties. These are English, Science, Mathematics, Human Society and Its Environment, Technology and Applied Sciences, Personal Development and Health, Support Unit, and the Language, Art and Music faculty. Each faculty is led by a Head Teacher, there is also a Head Teacher of Administration, and a Head Teacher of Teaching & Learning. Until recently, the school had a Social Science faculty and a History faculty, however these have now been merged.
The school is led by the Principal and two Deputy Principals. Student representation is an important aspect of the school's culture. The Student Representative Council (SRC) is the main body through which students are able to have an input in to the leadership of the school. Kotara High's SRC consists of three elected members from each year group from year 8 to year 10, and six elected members from year 11. The SRC is led by its executive year 12 members who consist of one male and one female Captain, one male and one female Vice Captain, and a President.
Curriculum
The school delivers the mandated curriculum developed by the New South Wales Education Standards Authority. Students in the junior school (years 7-10) study the core subjects of English, mathematics, science, history, geography, language, music, visual art, metalwork, woodwork, cooking, textiles, physical education and health.
From year 8, students are able to select a certain number of their subjects based on their personal interests and aspirations. Examples of subject choices include Commerce, Photography, Drama, Multi-media and Film, Conspiracies in History, Law and You, Travel and Tourism, Architectural Design, Japanese Language, French Language, Timber Technology, Engineering, Electronics, Aboriginal Studies, Drama, Life and the Universe, Metal Technology, Child Studies, Marine and Aquaculture Technology, and European Language and Culture.
In the senior school, students work towards a Higher School Certificate, and other vocational qualifications to suit their post-school aspirations.
School events
Highlights of the school calendar include annual swimming, athletics, cross country carnivals and more recently, the "Big Day Out". The Big Day Out is an event in which performing arts students from the school showcase a mini concert. |
Thermal neutron scattering cross sections of 238U and 235U in the phase The development of metallic, low-enrichment uranium fuels requires accurate prediction of their neutron transport properties and reactivity parameters, which in turn require thermal neutron scattering data. Accurate prediction of thermal neutron scattering data, including thermal cross sections, requires knowledge of the phonon scattering properties of the medium, but such matrix binding effects in next-generation fuels such as UMo, UZr, and USi are typically neglected because these effects are often difficult to measure or calculate. Using molecular dynamics simulations with previously published interatomic potentials, we calculate the phonon dispersion relations and phonon densities of states for 235U and 238U in the and phases. The performance of these potentials was evaluated using published ab initio simulation data and inelastic neutron scattering data. The phonon densities of states obtained by each potential were then utilized to calculate the thermal neutron scattering cross sections of 235U and 238U at 1113 K using the NJOY program. The resulting thermal neutron scattering cross sections are assessed by comparison to data obtained from available experimental densities of states. The cross sections generated show how the addition of binding effects decreases the cross section by up to a factor of six over the free-atom model. A definite effect on reactivity is also demonstrated by the use of these thermal libraries on a simple core model. As a consequence, the cross sections generated in this work provide a better description of the true cross section than the free-atom data currently available. We also discuss the sensitivity of the thermal scattering cross sections to the phonon density of states. |
Improvement of Ionic Bonding Strength and Electrochemical Corrosion Resistance of Hydroxyapatite- Calcium Phosphate Pulsed Electrochemically Deposited In-Situ Coating Through Hydroxyl Ion Treatment Hydroxyl ion treatment of different hydroxyapatite-calcium hydrogen phosphate composite in-situ coatings synthesized through pulsed electro-deposition with varying amount of hydroxyapatite phase and degree of crystallinity were carried out with the help of highly basic solution in order to achieve a more chemically stable and corrosion resistance performance under contact with body fluid. The coatings exhibit altogether completely different behaviour in terms of bond formation, surface topography generation, phase transformation and corrosion behaviour. Detailed characterizations of formed top surface layer were carried out with the help of XRD, SEM and FTIR in order to correlate the results with their base surface characteristics. Transformation of <020> and <121> surface parallel planes of calcium hydrogen phosphate in to <002> and <112> planes of hydroxyapatite took place in all the coatings along with formation of nano-crystalline structure. Calcium-rich porous hydroxyapatite scaffold formation takes place in low current density coating which in general exhibits low stability in terms of chemical bonding strength vis--vis corrosion protection performance. 10 mA/cm2 coating, which come with optimum presence of hydroxyapatite phase and crystallinity post electro-deposition, showed significant improvement in terms of increasing hydroxyl and phosphate bond polarization strength of hydroxyapatite phase and the same lead to improvement in the overall corrosion resistance performance of the coating by two times. Despite of formation of highest amount of hydroxyapatite phase during hydroxyl ion treatment in 20 mA/cm2 coatings, the corrosion protection performance results are negative on account of dilution of mostly low bonding amorphous phases with high internal residual stress. |
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Helpers
// Filename : public.sdk/source/vst/hosting/processdata.cpp
// Created by : Steinberg, 10/2005
// Description : VST Hosting Utilities
//
//-----------------------------------------------------------------------------
// LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, 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 the Steinberg Media Technologies 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT OWNER 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.
//-----------------------------------------------------------------------------
#include "processdata.h"
//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {
//------------------------------------------------------------------------
// HostProcessData
//------------------------------------------------------------------------
HostProcessData::~HostProcessData ()
{
unprepare ();
}
//------------------------------------------------------------------------
bool HostProcessData::prepare (IComponent& component, int32 bufferSamples,
int32 _symbolicSampleSize)
{
if (checkIfReallocationNeeded (component, bufferSamples, _symbolicSampleSize))
{
unprepare ();
symbolicSampleSize = _symbolicSampleSize;
channelBufferOwner = bufferSamples > 0;
numInputs = createBuffers (component, inputs, kInput, bufferSamples);
numOutputs = createBuffers (component, outputs, kOutput, bufferSamples);
}
else
{
// reset silence flags
for (int32 i = 0; i < numInputs; i++)
{
inputs[i].silenceFlags = 0;
}
for (int32 i = 0; i < numOutputs; i++)
{
outputs[i].silenceFlags = 0;
}
}
return true;
}
//------------------------------------------------------------------------
void HostProcessData::unprepare ()
{
destroyBuffers (inputs, numInputs);
destroyBuffers (outputs, numOutputs);
channelBufferOwner = false;
}
//------------------------------------------------------------------------
bool HostProcessData::checkIfReallocationNeeded (IComponent& component, int32 bufferSamples,
int32 _symbolicSampleSize)
{
if (channelBufferOwner != (bufferSamples > 0))
return true;
if (symbolicSampleSize != _symbolicSampleSize)
return true;
int32 inBusCount = component.getBusCount (kAudio, kInput);
if (inBusCount != numInputs)
return true;
int32 outBusCount = component.getBusCount (kAudio, kOutput);
if (outBusCount != numOutputs)
return true;
for (int32 i = 0; i < inBusCount; i++)
{
BusInfo busInfo = {};
if (component.getBusInfo (kAudio, kInput, i, busInfo) == kResultTrue)
{
if (inputs[i].numChannels != busInfo.channelCount)
return true;
}
}
for (int32 i = 0; i < outBusCount; i++)
{
BusInfo busInfo = {};
if (component.getBusInfo (kAudio, kOutput, i, busInfo) == kResultTrue)
{
if (outputs[i].numChannels != busInfo.channelCount)
return true;
}
}
return false;
}
//-----------------------------------------------------------------------------
int32 HostProcessData::createBuffers (IComponent& component, AudioBusBuffers*& buffers,
BusDirection dir, int32 bufferSamples)
{
int32 busCount = component.getBusCount (kAudio, dir);
if (busCount > 0)
{
buffers = new AudioBusBuffers[busCount];
for (int32 i = 0; i < busCount; i++)
{
BusInfo busInfo = {};
if (component.getBusInfo (kAudio, dir, i, busInfo) == kResultTrue)
{
buffers[i].numChannels = busInfo.channelCount;
// allocate for each channel
if (busInfo.channelCount > 0)
{
if (symbolicSampleSize == kSample64)
buffers[i].channelBuffers64 = new Sample64*[busInfo.channelCount];
else
buffers[i].channelBuffers32 = new Sample32*[busInfo.channelCount];
for (int32 j = 0; j < busInfo.channelCount; j++)
{
if (symbolicSampleSize == kSample64)
{
if (bufferSamples > 0)
buffers[i].channelBuffers64[j] = new Sample64[bufferSamples];
else
buffers[i].channelBuffers64[j] = nullptr;
}
else
{
if (bufferSamples > 0)
buffers[i].channelBuffers32[j] = new Sample32[bufferSamples];
else
buffers[i].channelBuffers32[j] = nullptr;
}
}
}
}
}
}
return busCount;
}
//-----------------------------------------------------------------------------
void HostProcessData::destroyBuffers (AudioBusBuffers*& buffers, int32& busCount)
{
if (buffers)
{
for (int32 i = 0; i < busCount; i++)
{
if (channelBufferOwner)
{
for (int32 j = 0; j < buffers[i].numChannels; j++)
{
if (symbolicSampleSize == kSample64)
{
if (buffers[i].channelBuffers64[j])
delete[] buffers[i].channelBuffers64[j];
}
else
{
if (buffers[i].channelBuffers32[j])
delete[] buffers[i].channelBuffers32[j];
}
}
}
if (symbolicSampleSize == kSample64)
{
if (buffers[i].channelBuffers64)
delete[] buffers[i].channelBuffers64;
}
else
{
if (buffers[i].channelBuffers32)
delete[] buffers[i].channelBuffers32;
}
}
delete[] buffers;
buffers = nullptr;
}
busCount = 0;
}
//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg
|
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define bs ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define sqr(a) ((a)*(a))
#define int ll
#define y2 y222221
#define endl '\n'
using namespace std;
const int N=200001;
const int inf=1000000000;
const int md=1000000007;
const double eps=0.00000001;
int n,a[N],sm;
int suf[N];
map<int,int> kol1;
map<int,int> kol2;
main()
{
bs;
cin>>n;
for(int i=1;i<=n;++i)cin>>a[i];
for(int i=n;i>=1;i--)suf[i]=suf[i+1]+a[i];
for(int i=1;i<=n;++i)kol1[a[i]]++;
for(int i=0;i<=n;++i)
{
if(i!=0)
kol1[a[i]]--;
if(i!=0)
kol2[a[i]]++;
sm+=a[i];
if(sm==suf[i+1])
{
cout<<"YES";
return 0;
}else
if(sm<suf[i+1])
{
if((suf[i+1]-sm)%2==0)
if(kol1[(suf[i+1]-sm)/2]>0)
{
cout<<"YES";
return 0;
}
}else
{
if((sm-suf[i+1])%2==0)
{
if(kol2[(sm-suf[i+1])/2]>0)
{
cout<<"YES";
return 0;
}
}
}
}
cout<<"NO";
}
|
<filename>cryptopass/encrypt.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 25 15:43:04 2018
@author: f2a
"""
import base64
import os
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
import time
from time import gmtime, strftime
def get_random_salt():
return base64.b64encode(os.urandom(32)).decode('utf-8')
def get_key(password, salt):
kdf = PBKDF2HMAC(
algorithm=hashes.SHA256(),
length=32,
salt=salt.encode(),
iterations=100000,
backend=default_backend())
key = base64.urlsafe_b64encode(kdf.derive(password.encode()))
return key
def get_token(key):
return Fernet(key)
def encrypt_str(key, str_in):
token = get_token(key)
return token.encrypt(str_in.encode()).decode()
def decrypt_str(key, str_in, print_messages=False):
token = get_token(key)
try:
str_out = token.decrypt(str_in.encode()).decode()
return str_out
except:
if print_messages: print('wrong password!')
return ''
def encrypt_data(data, key):
crypto_data = {'cryptopass_user': encrypt_str(key,data['cryptopass_user']),
'label': encrypt_str(key,data['label']),
'user': encrypt_str(key,data['user']),
'password': encrypt_str(key,data['password']),
'url': encrypt_str(key,data['url']),
'date_time': encrypt_str(key,strftime("%Y-%m-%d-%H:%M:%S", gmtime())),
'hint': encrypt_str(key,data['hint']),
'notes': encrypt_str(key,data['notes'])}
return crypto_data
def decrypt_data(crypto_data, key):
data = {'cryptopass_user': decrypt_str(key,crypto_data['cryptopass_user']),
'label': decrypt_str(key,crypto_data['label']),
'user': decrypt_str(key,crypto_data['user']),
'password': decrypt_str(key,crypto_data['password']),
'url': decrypt_str(key,crypto_data['url']),
'date_time': decrypt_str(key,crypto_data['date_time']),
'hint': decrypt_str(key,crypto_data['hint']),
'notes': decrypt_str(key,crypto_data['notes'])}
return data
def get_password_performance_time(password, test_str='testing <PASSWORD>'):
print("\t Next values are computed with this computer's performace: ")
time_ini = time.time()
x = 2+2
time_end = time.time()
sum_time = time_end-time_ini
print('\t sum of 2+2={} needs = {}[us]'.format(x,sum_time*pow(10,6)))
time_ini = time.time()
salt = get_random_salt()
time_end = time.time()
salt_time = time_end-time_ini
print('\t SALT generation time = {}[s]'.format(salt_time))
time_ini = time.time()
key = get_key(password, salt)
time_end = time.time()
key_time = time_end-time_ini
print('\t KEY generation time = {}[s]'.format(key_time))
time_ini = time.time()
token = get_token(key)
time_end = time.time()
token_time = time_end-time_ini
print('\t TOKEN generation time = {}[s]'.format(token_time))
str_in = test_str.encode()
print('\t String to be encrypted: {}'.format(str_in))
time_ini = time.time()
str_encrypted = token.encrypt(str_in)
time_end = time.time()
encryption_time = time_end-time_ini
print('\t ENCRYPTION time = {}[s]'.format(encryption_time))
time_ini = time.time()
str_decrypted = token.decrypt(str_encrypted)
time_end = time.time()
decryption_time = time_end-time_ini
print('\t DECRYPTION time = {}[s]'.format(decryption_time))
if str_in == str_decrypted:
print('\t encription-decription chain OK!')
else:
print('\t encription-decription chain FAIL!')
pass_length = len(password)
all_pass_time = pow((26+26+10),pass_length)*(key_time+decryption_time)
print('\t Time to probe all password with {} characters (A..Z,a..z,0..9) = ' \
.format(pass_length))
print('\t\t {}[seconds]'.format(all_pass_time))
print('\t\t {}[hours]'.format(all_pass_time/(60*60)))
print('\t\t {}[days]'.format(all_pass_time/(60*60*24)))
print('\t\t {}[years]'.format(all_pass_time/(60*60*24*365)))
return
|
<gh_stars>0
import { Component, HostBinding, Input, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'm-error-page',
templateUrl: './error-page.component.html',
styleUrls: ['./error-page.component.scss']
})
export class ErrorPageComponent implements OnInit {
@HostBinding('class') classes: string = 'm-grid m-grid--hor m-grid--root m-page';
@Input() errorType: number;
constructor(private route: ActivatedRoute) {
}
ngOnInit() {
this.errorType = +this.route.snapshot.paramMap.get('type');
if (!this.errorType) {
this.errorType = Math.floor((Math.random() * 6) + 1);
}
}
}
|
/*
* Copyright 2016 Google 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.google.googlejavaformat;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import com.google.common.collect.ImmutableList;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** {@link Newlines}Test */
@RunWith(JUnit4.class)
public class NewlinesTest {
@Test
public void offsets() {
assertThat(ImmutableList.copyOf(Newlines.lineOffsetIterator("foo\nbar\n")))
.containsExactly(0, 4, 8);
assertThat(ImmutableList.copyOf(Newlines.lineOffsetIterator("foo\nbar"))).containsExactly(0, 4);
assertThat(ImmutableList.copyOf(Newlines.lineOffsetIterator("foo\rbar\r")))
.containsExactly(0, 4, 8);
assertThat(ImmutableList.copyOf(Newlines.lineOffsetIterator("foo\rbar"))).containsExactly(0, 4);
assertThat(ImmutableList.copyOf(Newlines.lineOffsetIterator("foo\r\nbar\r\n")))
.containsExactly(0, 5, 10);
assertThat(ImmutableList.copyOf(Newlines.lineOffsetIterator("foo\r\nbar")))
.containsExactly(0, 5);
}
@Test
public void lines() {
assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\nbar\n")))
.containsExactly("foo\n", "bar\n");
assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\nbar")))
.containsExactly("foo\n", "bar");
assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\rbar\r")))
.containsExactly("foo\r", "bar\r");
assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\rbar")))
.containsExactly("foo\r", "bar");
assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\r\nbar\r\n")))
.containsExactly("foo\r\n", "bar\r\n");
assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\r\nbar")))
.containsExactly("foo\r\n", "bar");
}
@Test
public void terminalOffset() {
Iterator<Integer> it = Newlines.lineOffsetIterator("foo\nbar\n");
it.next();
it.next();
it.next();
try {
it.next();
fail();
} catch (NoSuchElementException e) {
// expected
}
it = Newlines.lineOffsetIterator("foo\nbar");
it.next();
it.next();
try {
it.next();
fail();
} catch (NoSuchElementException e) {
// expected
}
}
@Test
public void terminalLine() {
Iterator<String> it = Newlines.lineIterator("foo\nbar\n");
it.next();
it.next();
try {
it.next();
fail();
} catch (NoSuchElementException e) {
// expected
}
it = Newlines.lineIterator("foo\nbar");
it.next();
it.next();
try {
it.next();
fail();
} catch (NoSuchElementException e) {
// expected
}
}
}
|
import math
a,b,c,d=map(int,input().split())
def gcd(a,b):
m=a*b
while(b):
a,b=b,a%b
return(m//a)
q=a
w=b
e=c
r=d
c1=gcd(a,c)
mbf=c1/a
b=b*mbf
mdf=c1/c
d=d*mdf
up1=b-d
do1=b
ch1=up1/do1
a=q
b=w
c=e
d=r
c2=gcd(b,d)
#print(c2)
maf=c2/b
##print(maf)
a=a*maf
mdf=c2/d
c=c*mdf
up2=a-c
do2=a
#print(a,c,up2)
ch2=up2/do2
if(ch1<0):
ch1=999999999999999
if(ch2<0):
ch2=999999999999999
if(up1==0):
do1=1
if(up2==0):
do2=1
#print(a,b,c,d,up1,do1,up2,do2,ch1,ch2)
if(ch1<ch2):
i=2
while(i<=int(min(up1,do1))+1):
if(up1%i==0 and do1%i==0):
up1=up1//i
do1=do1//i
else:
i=i+1
print(int(up1),"/",int(do1),sep="")
else:
i=2
while(i<=int(min(up2,do2))+1):
#print(up2%i,do2%i,"kihfdhu")
if(up2%i==0 and do2%i==0):
up2=up2//i
do2=do2//i
#print(i,up2,do2,"popi")
else:
i=i+1
print(int(up2),"/",int(do2),sep="")
|
def conduit_lengths(
target,
throat_endpoints='throat.endpoints',
throat_length='throat.length',
throat_centroid='throat.centroid'
):
network = target.project.network
throats = network.map_throats(throats=target.Ts, origin=target)
cn = network['throat.conns'][throats]
C1 = network['pore.coords'][cn[:, 0]]
C2 = network['pore.coords'][cn[:, 1]]
EP1 = network[throat_endpoints + '.head'][throats]
EP2 = network[throat_endpoints + '.tail'][throats]
try:
Lt = network[throat_length][throats]
except KeyError:
Lt = piecewise(target, throat_endpoints, throat_centroid)
L1 = _norm(C1 - EP1, axis=1)
L2 = _norm(C2 - EP2, axis=1)
Lt = _np.maximum(Lt, 1e-15)
return {'pore1': L1, 'throat': Lt, 'pore2': L2} |
<filename>readmac/xiaomi_readmac.c
/*
* Copyright (C) 2016 The CyanogenMod Project
* 2017 The LineageOS Project
*
* 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.
*/
#define LOG_TAG "xiaomi_readmac"
#define LOG_NDEBUG 0
#include <cutils/log.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
#define MAC_ADDR_SIZE 6
#define WLAN_MAC_BIN "/persist/wlan_mac.bin"
#define LIB_QMINVAPI "libqminvapi.so"
static const char xiaomi_mac_prefix[] = { 0x34, 0x80, 0xb3 };
typedef int (*qmi_nv_read_wlan_mac_t)(char** mac);
static int check_wlan_mac_bin_file() {
char content[1024];
FILE* fp;
fp = fopen(WLAN_MAC_BIN, "r");
if (fp == NULL)
return 0;
memset(content, 0, sizeof(content));
fread(content, 1, sizeof(content) - 1, fp);
fclose(fp);
if (strstr(content, "Intf0MacAddress") == NULL) {
ALOGV("%s is missing Intf0MacAddress entry value", WLAN_MAC_BIN);
return 0;
}
if (strstr(content, "Intf1MacAddress") == NULL) {
ALOGV("%s is missing Intf1MacAddress entry value", WLAN_MAC_BIN);
return 0;
}
return 1;
}
static int write_wlan_mac_bin_file(unsigned char wlan_addr[]) {
FILE* fp;
fp = fopen(WLAN_MAC_BIN, "w");
if (fp == NULL)
return 0;
fprintf(fp, "Intf0MacAddress=%02X%02X%02X%02X%02X%02X\n", wlan_addr[0], wlan_addr[1],
wlan_addr[2], wlan_addr[3], wlan_addr[4], wlan_addr[5]);
fprintf(fp, "Intf1MacAddress=%02X%02X%02X%02X%02X%02X\n", wlan_addr[0], wlan_addr[1],
wlan_addr[2], wlan_addr[3], wlan_addr[4], (unsigned char)(wlan_addr[5] + 1));
fprintf(fp, "END\n");
fclose(fp);
return 1;
}
int main() {
unsigned char wlan_addr[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
char* nv_wlan_mac = NULL;
int ret, i;
// Store WLAN MAC address in the persist file, if needed
if (check_wlan_mac_bin_file()) {
ALOGV("%s already exists and is valid", WLAN_MAC_BIN);
return 0;
}
void* handle = dlopen(LIB_QMINVAPI, RTLD_NOW);
if (!handle) {
ALOGE("%s", dlerror());
goto generate_random;
}
qmi_nv_read_wlan_mac_t qmi_nv_read_wlan_mac =
(qmi_nv_read_wlan_mac_t)dlsym(handle, "qmi_nv_read_wlan_mac");
if (!qmi_nv_read_wlan_mac) {
ALOGE("%s", dlerror());
goto generate_random;
}
// Read WLAN MAC address from modem NV
ret = qmi_nv_read_wlan_mac(&nv_wlan_mac);
if (!nv_wlan_mac) {
ALOGE("qmi_nv_read_wlan_mac error %d", ret);
goto generate_random;
}
for (i = 0; i < MAC_ADDR_SIZE; i++) {
wlan_addr[i] = nv_wlan_mac[i];
}
goto out;
generate_random:
memcpy(wlan_addr, xiaomi_mac_prefix, sizeof(xiaomi_mac_prefix));
// We don't need strong randomness, and if the NV is corrupted
// any hardware values are suspect, so just seed it with the
// current time
srand(time(NULL));
for (i = sizeof(xiaomi_mac_prefix) / sizeof(xiaomi_mac_prefix[0]); i < MAC_ADDR_SIZE; i++) {
wlan_addr[i] = rand() % 255;
}
ALOGI("Using randomized MAC address");
out:
if (handle)
dlclose(handle);
if (!write_wlan_mac_bin_file(wlan_addr)) {
ALOGE("Failed to write %s", WLAN_MAC_BIN);
return 1;
}
ALOGV("%s was successfully generated", WLAN_MAC_BIN);
return 0;
}
|
import java.util.Scanner;
import java.lang.Math;
public class problem7 {
public static void main(String[] args) {
//System.out.println("Enter Numbers");
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int min;
int c;
int a[] = new int[n + 1];
for (int i = 1; i <= n; i++) {
a[i] = sc.nextInt();
}
int c1 = 0;
int c2 = 0;
int c3 = 0;
for (int i = 1; i <= n; i++) {
if (a[i] == 1) {
c1++;
} else if (a[i] == 2) {
c2++;
} else if (a[i] == 3) {
c3++;
}
}
if (c1 == 0 || c2 == 0 || c3 == 0) {
System.out.println(0);
} else {
c = Math.min(c1, c2);
min = Math.min(c, c3);
System.out.println(min);
// int j = 1, m = 1, l = 1;
// for (int k = 1; k <= min; k++) {
// for (int j = 1; j <= n; j++) {
// for (int m = 1; m <= n; m++) {
// for (int l = 1; l <= n; l++) {
// if (a[j] == 3 && a[m] == 2 && a[l] == 1) {
// System.out.println(l + " " + m + " " + j);
// a[j] = a[m] = a[l] = 0;
// }
// }
// }
// }
// // while (j <= n && m <= n && l <= n) {
// // if (a[j] == 3 && a[m] == 2 && a[l] == 1) {
// // System.out.println(l + " " + m + " " + j);
// // a[j] = a[m] = a[l] = 0;
// // }
// // j++;
// // m++;
// // l++;
// // }
// }
int x = 1, y = 1, z = 1;
int a1[] = new int[c1 + 1];
int a2[] = new int[c2 + 1];
int a3[] = new int[c3 + 1];
for (int j = 1; j <= n; j++) {
if (a[j] == 1) {
a1[x++] = j;
} else if (a[j] == 2) {
a2[y++] = j;
} else if (a[j] == 3) {
a3[z++] = j;
}
}
for (int p = 1; p <= min; p++) {
System.out.println(a1[p] + " " + a2[p] + " " + a3[p]);
}
}
}
}
|
The Defense Civilian Intelligence Personnel System (DCIPS) incorporates all DoD intelligence positions under a single, performance-based, mission-focused personnel management system. DCIPS serves as the common Defense Intelligence Enterprise system that helps to attract, retain, and reward the workforce needed to successfully carry out critical national security missions. It supports consistency and transparency across the Defense Intelligence Enterprise while simultaneously providing the flexibilities to embrace the individual cultures of the DoD Components with DCIPS positions.
DCIPS is the human resource management system for the Department of Defense (DoD) Intelligence Community (DOD IC). DCIPS was authorized by Congress to provide the Department of Defense Intelligence Components (IC) with independent personnel authorities necessary to perform both the Defense and National Intelligence missions. At the heart of DCIPS is the ability to be rewarded for the contributions you make to your organization's vital mission.
Several opportunities are available for DoD employees, including DCIPS employees, to continue their training, education and professional development within the Intelligence and Security field. Employees may learn more about professional development initiatives and take advantage of learning opportunities by way of the following sites. Note, these sites may require DoD credentials for access.
The DoD Intelligence Training and Education Board (DITEB) is the community of practice for the DoD Intelligence training and education enterprise.
The Intelligence Fundamentals Professional Certification (IFPC) program was developed to accomplish the goal set forth by the Under Secretary of Defense for Intelligence (USD(I)) to professionalize the defense intelligence workforce. The IFPC program has established a common standard of the fundamental knowledge and skills expected of all who currently serve in and support, and those who hope to serve in and support, the DoD Intelligence Enterprise (DIE).
The National Intelligence University (NIU) is the Intelligence Community's degree granting institution with a far-reaching mission to educate and prepare intelligence officers to meet current and future challenges to the national security of the United States. Students may obtain a Bachelor or Masters of Science in Intelligence. |
Wearable device maker Fitbit rang the opening bell on the New York Stock Exchange on Thursday to celebrate its IPO.
Co-founders James Park and Eric Friedman as well as members of Fitbit's management team were there for the occasion, along with fitness trainer Harley Pasternak and celebrity client Jordana Brewster, according to the exchange.
Fitbit shares trade under the ticker "FIT."
Fitbit signs and traders at the NYSE during their IPO, June 18, 2015.
It is one of the first companies focused on wearable devices to be publicly traded, but it competes with the likes of Apple, Garmin and a number of devices that run on Google's Android Wear operating system. |
Supervised learning approach for recognizing magnetic skyrmion phases We propose and apply simple machine learning approaches for recognition and classification of complex noncollinear magnetic structures in two-dimensional materials. The first approach is based on the implementation of the single-hidden-layer neural network that only relies on the $z$ projections of the spins. In this setup, one needs a limited set of magnetic configurations to distinguish ferromagnetic, skyrmion, and spin spiral phases, as well as their different combinations in transitional areas of the phase diagram. The network trained on the configurations for the square-lattice Heisenberg model with Dzyaloshinskii-Moriya interaction can classify the magnetic structures obtained from Monte Carlo calculations for a triangular lattice and vice versa. The second approach we apply, a minimum distance method, performs a fast and cheap classification in cases when a particular configuration is to be assigned to only one magnetic phase. The methods we propose are also easy to use for analysis of the numerous experimental data collected with spin-polarized scanning tunneling microscopy and Lorentz transmission electron microscopy experiments. |
Wulfric Spot
Family
He was one of the three known children of the noblewoman Wulfrun, after whom Wolverhampton is named. Wulfric's family was linked with the Wulfsige the Black to whom King Edmund granted land in Staffordshire. As much of Wulfric the Black's estate was granted to Wolverhampton by Wulfrun, and other parts, including lands around modern Abbots Bromley passed to Wulfric, it is possible that Wulfric the Black was this Wulfric's maternal grandfather. The family was related to the Wulfgeat who is a witness to charters in the reign of King Edgar and received lands in Staffordshire and Gloucestershire from the king. Of Wulfric's father and his paternal kin nothing is known.
Wulfric's brother was Ælfhelm, Ealdorman of York or Northumbria from 993 until he was killed in 1006. Ælfhelm was the father of King Cnut's first wife Ælfgifu of Northampton, mother of Svein and King Harold Harefoot. He also had two sons, Wulfheah and Ufegeat, who were blinded when he was killed. Their sister was Ælfthryth whose daughter Ealdgyth married Morcar, killed in 1015 along with his brother Sigeferth on the orders of King Æthelred. Ælfthryth appears to have died before Wulfric's will was written.
Wulfric's byname, Spot, while it may have the same sense as in modern English, that is that it referred to some form of mark on his face, could also indicate a short, fat person. It is not found in contemporary sources, but first appeared in the 13th century.
Career
The Burton Abbey chronicle describes Wulfric as consul ac comes Merciorum, that is consul and 'count' of the Mercians, perhaps suggesting that he was an ealdorman. More contemporary sources disagree and he is generally described as a minister, that is a thegn, although his position may have been more like that of a hold in more Scandinavianised districts of England, somewhere between that of a thegn and an ealdorman.
Little is known of Wulfric's life, but his will, approved while he was still living or shortly after his death by King Æthelred, shows him to have been exceptionally wealthy. He owned lands in ten counties of the English midlands, as well as further lands in the unshired lands between the River Ribble and the River Mersey. The lands which he had owned "between Ribble and Mersey" alone were assessed as having been worth 145 pounds in 1066 by the compilers of the Domesday Book.
Offspring and patronage
Wulfric appears to have had no sons, or none who survived him, as his will does not name any. His daughter, whose name is unknown, was left lands around Tamworth. Sawyer notes that Wulfric had special rights over these lands, "not to be subject to any service nor to any man born", rights which his daughter inherited. His god-daughter, his brother, nephews and niece were also beneficiaries of his will. King Æthelred, in line with custom, received lands, monies, weapons and horses. Large sums of money were given to the archbishops, bishops, abbots and abbesses of England. A monastery at Tamworth received land. The principal beneficiary of Wulfric's will, however, was the abbey of Byrtun, modern Burton on Trent.
There was said to have been a monastic foundation at Burton in earlier times, with which the 7th-century Saint Modwenna is associated. This appears, along with many others, to have disappeared in the Viking Age, and the monastery there was probably reestablished by Wulfric. The new abbey was dedicated to Saint Benedict of Nursia and followed the Rule of Saint Benedict. According to the cartulary of Burton, which may not be reliable, Wulfric left the abbey all of the lands he inherited from his father. As well as the substantial lands he left to Burton in his will, Wulfric, like many noble founders of monasteries, had written into it other clauses to ensure that the new abbey, which was to pray for his soul and for that of his mother, would be provided with powerful friends. He left additional lands to Ælfric of Abingdon, the Archbishop of Canterbury, with the understanding that Ælfric would be a friend and ally to the monks. Wulfric also sought to involve the king in his new foundation, giving over his proprietarial rights to Æthelred, who in turn agreed that he would be lord and protector of Burton Abbey.
Death
Although some late sources places Wulfric's death as late as 1010, and John of Worcester's chronicle has been read as suggesting that he died at the battle of Ringmere in that year, he probably died between 1002, when his will was begun, and 1004, when King Æthelred issued his charter approving it. He was buried in the cloister of Burton alongside his wife. In later times Burton Abbey marked the occasion of his death on 22 October. |
Fuzzy model predictive control for 2-DOF robotic arms Purpose Robotic arm control is challenging due to the intrinsic nonlinearity. Proportional-integral-derivative (PID) controllers prevail in many robotic arm applications. However, it is usually nontrivial to tune the parameters in a PID controller. This paper aims to propose a model-based control strategy of robotic arms. Design/methodology/approach A TakagiSugeno (T-S) fuzzy model, which is capable of approximating nonlinear systems, is used to describe the dynamics of a robotic arm. Model predictive control (MPC) based on the T-S fuzzy model is considered, which optimizes system performance with respect to a user-defined cost function. Findings The control gains are optimized online according to the real-time system state. Furthermore, the proposed method takes into account the input constraints. Simulations demonstrate the effectiveness of the fuzzy MPC approach. It is shown that asymptotic stability is achieved for the closed-loop control system. Originality/value The T-S fuzzy model is discussed in the modeling of robotic arm dynamics. Fuzzy MPC is used for robotic arm control, which can optimize the transient performance with respect to a user-defined criteria. |
Thin basement membrane nephropathy cannot be diagnosed reliably in deparaffinized, formalin-fixed tissue. In diagnostic renal pathology, electron microscopy is ideally performed on glutaraldehyde-fixed, plastic resin-embedded tissue (EM-G). When no glomeruli are present in the portion of the biopsy fixed in glutaraldehyde, formalin-fixed, paraffin-embedded tissue can be reprocessed for electron microscopy (EM-F). The usefulness of this salvage technique for the diagnosis of thin basement membrane nephropathy (TBMN) has not been studied systematically. Here we compare the glomerular basement membrane (GBM) thickness by EM-G vs EM-F in 21 renal biopsies, including TBMN (eight patients), normals (two patients), minimal change disease (MCD) (six patients) and diabetic nephropathy (DN) (five patients). There was significant reduction of the GBM thickness by EM-F compared with EM-G across all diagnostic categories in all 21 cases. The mean percentage reduction in GBM thickness was 23% for the TBMN cases, 40% for the normal/MCD cases and 34% for the DN cases. Four patients with MCD had a mean GBM thickness by EM-F that fell below the defining threshold for diagnosis of TBMN. For the TBMN cases, the 99th percentile for GBM thickness by EM-F was 194 nm, suggesting that the diagnosis of TBMN by EM-F can be excluded with confidence if the GBM thickness is above 200 nm. No clear criteria could be established to diagnose TBMN by EM-F. Renal pathologists should be aware that reprocessing of paraffin tissue for EM causes artifactual GBM thinning that precludes accurate diagnosis of TBMN. |
// Once the program has terminated, prints out all the branch predictor results
// and statistics.
void Finished(int code, void *v) {
*out << endl << "Done! Results:" << endl << endl;
for (bp::Predictor *bp : bps) {
bp->PrintStatistics(out);
}
} |
Porokeratosis of Mibelli with mutilation: a case report. Porokeratosis is a rare keratinization disorder of the skin characterized by annular plaques with an atrophic center surrounded by a raised keratotic wall that spreads centrifugally. We report a case of porokeratosis of Mibelli with mutilation. A 30-year-old woman presented with atrophic plaques on the index fingers of both hands with a keratotic ridge in some margins of the plaques. There was loss of the distal phalanx of the left index finger. In the right hand, shortening of the right distal phalanx and flexion contracture of the distal interphalangeal joint were noted in the index finger. |
Cancer Biomarker Discovery: Lectin-Based Strategies Targeting Glycoproteins Biomarker discovery can identify molecular markers in various cancers that can be used for detection, screening, diagnosis, and monitoring of disease progression. Lectin-affinity is a technique that can be used for the enrichment of glycoproteins from a complex sample, facilitating the discovery of novel cancer biomarkers associated with a disease state. Cancer biomarker discovery A biomarker, as defined by the National Institute of Health, is "a characteristic that is objectively measured and evaluated as an indicator of normal biologic processes, pathogenic processes or pharmacologic responses to a therapeutic intervention", thus summarizing the role they can play in identifying the occurrence or progression of a pathogenic disease. With this in mind, discovery of biomarkers related to cancer would be beneficial in the scope of detection, diagnosis, screening, and monitoring disease progression. Development of cancer biomarkers is a challenging process, best described as occurring in five consecutive phases: Preclinical exploratory studies, clinical assay for development for clinical disease, retrospective longitudinal repository studies, prospective screening studies, and cancer control studies. Biomarkers related to cancer may also be used to direct drug therapy, serving to explain clinical results in response to chemotherapy treatment. Such biomarkers, termed predictive biomarkers, may be used not only to direct which agent of combination of agents should be used in treating a disease state, but also identify the population of patients who may show the best response to treatment (as well as identify those who may show adverse effects). In clinical trials requiring longterm intervention strategies, which require long periods of observation and large patient groups, biomarkers can be substituted for clinical responses or clinical end points. Furthermore, incorporating a pattern-based biomarker, constructed of several single biomarkers that when evaluated together may be used in detection, risk assessment, screening, and diagnosis, may be more informative in predicting responses to individual therapeutic regimens. These biomarkers will be an important integrated component of personalized medicine strategy in cancer treatments. Sources of biomarkers can include tumor tissue, as well as bodily fluids including blood (serum and plasma), urine, sputum, saliva and cerebrospinal fluid (CSF). Development of biomarkers that can be obtained via minimal or non-invasive methods are ideal, and blood fulfills this description. Not only is blood easily accessible for sampling, but because of the network of arteries, veins, and capillaries that come in contact with organs, it can collect molecular indicators such as proteins secreted, shed, or otherwise released by tissues. The challenge in biomarker discovery using blood is that the plasma proteome is the most complex human proteome, consisting of proteins whose function is dependent on their presence in plasma and transient proteins which are secreted and shed into the bloodstream. It is this latter group where candidate biomarkers would most likely be classified, as proteins of interest would be secreted, shed, or leaked from the affected tissue. Further complicating biomarker discovery is the dynamic range of protein concentrations found in plasma, varying up to twelve orders of magnitude, wherein highly abundant proteins (i.e. albumin and IgG) compose the majority of the plasma proteome, making low-abundant proteins that may serve as biomarkers difficult to identify. One strategy to increase the identification of low abundant proteins is to deplete the serum sample of highly abundant proteins using immune-affinity, thus reducing the dynamic range. However, several drawbacks of this strategy include the loss of proteins of interest due to nonselective binding or depletion of albumin, which functions as a carrier protein to assist in the circulation and transport of other proteins. With these challenges in mind, prior to a biomarker found in plasma being considered for clinical use in a cancer setting, several criteria must be met including: release into the circulation in detectable amounts by a small, nonsymptomatic tumor, exhibit specificity for the tissue or organ of origin, and exhibit specificity for the cancer state, meaning it has no association with a noncancer disease. Of note, the target biomarker may not exist in the tumor proteome itself, but instead manifests in the tumor microenvironment as a response to the presence or progression of the tumor. There have been many studies focusing on biomarkers discovery, based on various type of biomolecules such as DNA, mRNA, ncRNA, lipids, carbohydrates, and proteins. Alterations in DNA and mRNA expression ultimately result in aberrant expression or modification of protein products, indicative of a disease state, which make proteins attractive targets in biomarker discovery. This review will focus on a sub-population of proteins, glycoproteins, as potential biomarkers and present challenges and promises of lectin-affinity based in biomarker discovery for oncology applications. Targeting glycoproteins as biomarkers Glycosylation is the most common post-translational modification (PTM) of proteins, involving the covalent attachment of a glycan, or sugar structure, to the peptide backbone. Approximately 50% of all human pro-teins are glycosylated, functioning in many biological processes, including development, immune response, cell division, inflammation, and cellular regulation. In addition to glycosylation's involvement in many cellular functions, reliant on a specific interaction that occurs with the extended glycan structure, it is also associated with proper protein folding. There are several types of glycan attachments in glycoproteins, with the two most common occurring as N-linked glycans or O-linked glycans. N-linked glycosylation involves the production of an oligosaccharide precursor and an en bloc transfer onto the side chain amide nitrogen of an asparagine residue of a newly synthesized protein in the endoplasmic reticulum (ER). O-linked glycosylation occurs at a later stage of protein processing in the Golgi apparatus, and involves the attachment of a glycan structure to a serine or threonine residue at the hydroxy oxygen of the amino acid. Targeting glycosylation in biomarker discovery can be construed as a more direct approach based on the following thoughts. Aberrant glycosylation has been associated with a cancer disease state for many years. Alterations in N-linked glycans that have a biological role in cell adhesion have been associated with cancer cell invasion and metastasis. The majority of proteins localized at the cell membrane or secreted from the cell surface are glycosylated, thus may be detectable in the blood stream. The structure of glycans, or the sites of glyco-post-translational modifications could be altered during cancer initiation and progression. Glycoproteomic studies that analyze profile comparisons, of normal and disease states, provide potential new cancer biomarkers that can be used in clinical setting in the future. In fact, the majority of the U.S. Food and Drug Administration (FDA) approved cancer biomarkers currently used in a clinical setting are glycoproteins or glycosylated (Table 1). Furthermore, targeting the differences in glycosylation, specifically alterations in the glycan structure, may provide opportunities to identify biomarkers that exhibit improved detection sensitivity and specificity. Cancer biomarkers that detect specific glycoforms of a protein, resulting in increased sensitivity and specificity, may allow for earlier detection of a disease state. Earlier detection of cancers may provide an improved therapeutic window and an increase in overall survival. Lectin-based glycoprotein biomarker development Methodologies to enrich glycoproteins have been employed previously and include the use of hydrazine chemistry, carbohydrate-reactive antibodies, and studies that focus on analysis of glycan structures after release from the associated protein. Most of these strategies incorporate mass spectrometry (MS) analysis after initial separation or enrichment to identify targeted glycoproteins or glycan structures. One methodology that has been employed extensively is the use of lectin affinity, and may hold promise in targeted glycoprotein analysis for cancer biomarker discovery. Lectins are glycan-binding proteins that bind with great specificity to selected sugar moieties, or functional groups. The first lectin recognized, ricin, was isolated almost a century ago from castor seeds and additional lectins have been discovered since that are used to isolate sugar-bound molecules in biological systems. They are found both in animal and plant systems as well as lower organisms such as viruses, which use lectins to attach to host organism cells. A current list of lectins and the glycan structures they recognize are summarized in Table 2. With the multitude of lectins available to isolate sugar-containing molecules, their use has been employed in several studies both as single reagents for purification and enrichment, as well as in combination to identify a larger profile of glycosylated molecules. More recently, protein microarrays that in-corporate lectins to serve as screening tools have also been developed. The use of multi-lectin affinity has the benefit of obtaining a global glycoproteome, as the different affinities of each lectin included will yield a wider net of captured glycoproteins. Development of multi-lectin chromatography (M-LAC) to study the plasma proteome has been detailed by one group, who developed single use agarose-bound lectin columns containing the mixture of lectins concanavalin A (Con A), jacalin (JAC), and wheat germ agglutinin (WGA). In addition to M-LAC, the authors also included depletion of albumin and IgG, two abundant plasma proteins, in an attempt to increase identification of low abundance proteins. To increase the robustness of this approach, making it more suitable to clinical studies, another group immobilized the same lectins, Con A, WGA, and JAC, onto a column. Termed high-performance multilectin affinity chromatography (HP-M-LAC), this study sought to validate the approach of M-LAC and immunodepletion, while also generating a column that would allow for good reproducibility when analyzing multiple samples. One study that has employed the use of the M-LAC platform yielded several potential candidate proteins including thrombospondin-1 and 5, Table 2 Lectins and their corresponding recognized glycan moieties Lectin (common name) Abbv. Glycan specificity /-D-Galactosy general specificity Agarius bisporous (common mushroom) ABA Gal1-3GalNAc-serine/threonine Allomyrina dichotoma (Japanese rhinoceros beetle) AlloA NeuAc2-3Gal1-4GlcNAc Artocarpus integrifolia/Jacalin (jackfruit seeds) ALL, JAC Gal1-3GalNAc, Gal1-6Gal Arachis hypogaea (peanut) PNA Gal1-3GalNAc Ricinus communis (castor bean) RCA 120 Gal1-4GalNAc Vicia villosa (hairy vetch) VVA, VVL Phaseolus vulgaris PHA-L N-linked tri-tetra-antennary leukoagglutinating (common bean) alpha-1B-glycoprotein, serum amyloid P-component, and tenascin-X from the serum of breast cancer patients to be investigated in future studies. In addition to the use of a multi-lectin affinity column,which incorporated the mixture of lectins Con A, JAC, WGA immobilized onto the column resin, the authors also employed immunodepletion, iso-electric focusing (IEF) fractionation, and LC-MS identification. Further analysis of the plasma proteome following a similar methodology, of immunodepletion of albumin and IgG followed by M-LAC established the reproducibility of this platform. GalNAc-Ser/Thr To continue with the theme of a multi-lectin approach, another study employed the use of biotinylated lectins E-PHA, AAL, and DSL incubated with ovarian tumor tissue lysate, leading to glycoprotein capture. The biotinylated lectins, bound with glycoproteins, were then removed from the tissue lysate with the aid of paramagnetic streptavidin beads, and the bound glycoproteins eluted. In a previous study, the authors identified changes in glycotransferase expression in ovarian tissue, the results of which influenced their lectin selection. In doing so, the authors were able to identify 47 potential lectin-reactive markers in ovarian tumors. An additional aspect of the previously mentioned study includes the validation of several of the identified candidate proteins in serum using a single labeled lectin as an antibody and Western Blotting. Their results indicated some of their candidate marker proteins were bound to a specific lectin, implying that it was the glycan structure, and not the protein alone, that could be used to distinguish between malignant and normal patient serum. After assessing the value of several strategies to enrich and identify glycoproteins, one group decided to perform a "double" multilectin capture approach, wherein patient serum was first passed through a multi-lectin column containing Con A, WGA, and SNA, the resulting eluate was then tryptic digested, and the digested peptides were, again, enriched using the multi-lectin column. This two stage enrichment of glycoproteins, and then glycopeptides, yielded approximately 45 proteins that were differentially expressed in the sera of breast cancer patients and non-disease patients, and when combined with ESI-LC-MS, allowed for glycosylation-site mapping of the identified proteins. Multi-lectin capture of glycoproteins allows for a global analysis of changes in glycosylation patterns of proteins between disease and non-disease states. As the previously described experiments illustrate, enrichment of glycoproteins with lectins allows for identifi-cation for putative biomarkers, especially when those methodologies employ the analysis of patient serum. All of these studies identify potential candidates that would need further validation studies, but establish a groundwork of which future studies can be based on. A single lectin enrichment approach of glycoproteins appears in greater frequency in the literature, wherein capturing glycosylated proteins of a specific moiety may allow for the identification of candidate markers that can be validate in future studies. In doing so, the resulting glycoprotein fraction is reduced in complexity compared to those derived from multi-lectin affinity. This reduction in complexity may also help for the identification of proteins expressed in low abundance that may not be detected in any other methodology. One study focused on analyzing samples from normal individual and patients with lung adenocarcinoma with the use of the lectin WGA in attempt to identify glycoprotein biomarkers. First, serum samples from normal individuals and patients with lung adenocarcinoma were screened using FITC-labeled lectin staining method, and identified the lectin WGA as exhibiting the highest specificity for bound glycoproteins in the serum samples. Glycoproteins in serum samples were then enriched using the WGA lectin, and the enriched fractions were then loaded onto 2-DE gels and analyzed via 2D DIGE to observe expression differences between the two sample groups. Interestingly, the authors noted that WGA incubation not only enriched for the glycoproteins that bound specifically, but also resulted in the removal of high abundant serum proteins, that would normally mask potential markers of disease. Using the 2-DE methodology, the study yielded the identification of 39 differentially expressed protein spots. Another study that analyzed differences in glycosylation in lung cancer used the lectin, Con A, and employed 2-DE to detect changes in protein expression. In this study, serum samples from healthy patients and lung cancer patients were enriched with Con A, and resulting glycoprotein samples separated on a 2D gel, spots excised, and analyzed via ESI-LC-MS. Several candidate proteins were identified, and again, the use of lectin affinity resulted in enrichment of glycoproteins, while also removing highly abundant serum proteins such as IgG and albumin. Analysis of colon cancer serum was attempted to reveal the potential link of -haptoglobin and colon cancer. Increased -haptoglobin expression has often been associated with various pathobiological processes, thus one group sought to determine whether altered glycosylation of -haptoglobin could serve as a disease marker in colon cancer. The lectin Aleuria aurantia (AAL) was used to compare the level of fucosylation between colon cancer patients, irritable-bowel syndrome (IBS) patients, and normal subjects, and researchers observed that increased fucosylation of haptoglobin correlates not only with a cancer state, but was also indicative of the cancer stage. To evaluate changes in glycoprotein expression in a model of breast cancer progression, one group studied the membrane fraction derived from two breast cancer cell line phenotypes: a normal, premalignant cell line and a malignant, metastatic cell line. The lectins WGA and Con A bound to agarose were individually packed into spin columns, and the membrane fraction of each cell line incubated with agarose-bound lectins, and unbound proteins washed away. The resulting bound fraction was tryptically digested and analyzed via LC-MS/MS. To quantitate the glycoprotein differences between the two cell lines, label-free spectral counting was employed, and 27 membrane glycoproteins were detected and determined to be differentially expressed. Although this study analyzed cell lines, the approach could be applied to more relevant clinical samples such as tumor tissue biopsies. An additional study that used individual, agarose-bound lectins in spin columns, examined the difference in expressed glycoproteins between normal and pancreatic cancer serum. In this study, not only were expression changes in glycoprotein analyzed and identified via LC-MS, but also the changes in expression of the glycan structures via MALDI. Interestingly, the latter aspect revealed that not only will a change in abundance of a protein relate to a disease state, but also a change in the glycosylation modification. In one study, researchers overexpressed the glycotransferase glycotransferase cosaminyltransferase V (GnT-V) in WiDr cells to mimic the conditions witnessed in colon cancer cells, and analyzed glycosylation differences between the control and experimental cell lines using the lectin phytohemagglutinin-L 4 (L-PHA). The authors also employed the mass spectrometry based technique of multiple-reaction monitoring (MRM) to quantify the glycosylation changes expressed between the control and GnT-V overexpressed cells. The two glycoproteins, TIMP1 and PTP, both of which are target proteins of GnT-V, were selected for MRM quantitation to assist in a proof-of-concept experiment that MRM quantitation could be employed, in conjunction with lectin affinity enrichment, to detect differential expression of glycosylated proteins. An interesting proof-of concept experiment developed incorporated lectin affinity enrichment combined with an immunodepletion step involving the use of antibodies raised against all proteins in the sub-proteome (derived from enriched glycosylated protein fraction) of healthy humans. This methodology, termed Tandem Affinity Depletion, employed the use of the lectin, WGA, and antibodies derived from llamas, as the authors detailed that old world camels generate antibodies containing only a heavy chain, which are more robust in terms of pH and temperature. Using a known cancer marker, CEA, spiked into the plasma sample from several colon cancer patients, the authors were able to enrich the glycoprotein by a factor of 600-800, validating their approach. The technique, in contrast to immunodepletion experiments which often serve to identify as many low abundance proteins as possible, instead focused on reducing the complexity of the plasma proteome to better differentiate between normal and disease states. The development of methodologies that allow for quantifying of glycoproteins in serum has been the focus of several recent studies. One group studied the changes of sialylation, after enrichment of sialylated glycoproteins with SNA lectin, in serum of patients with prostate cancer. Termed lectin-directed tandem labeling, distinct sample group enriched glycoproteins were isotopically labeled with either light or heavy forms of acetic anhydride, and then quantitfied via nano-ESI-LC-MS/MS. Researchers were able to determine that it was an increase in sialylation of several glycoproteins, but not the protein concentration (as determined by analysis of non-lectin enriched fractions), that correlated with a disease state. Another study attempted to identify N-linked glycoproteins associated with hepatocellular carcinoma (HCC) in plasma without extensive enrichment steps, and quantify the differences via iTRAQ labeling. Knowing that identification of glycoproteins via MS are often masked by the signal of nonglycosylated proteins, researchers generated an exclusion list of peptide masses from nonglycosylated proteins, thus training the MS instrument to acquire spectra from glycosylated peptides only. To increase the pool of potential identified glycosylated peptides, the inclusion of lectin enrichment was employed. After identifying several glycopeptides in the serum of HCC patients, iTRAQ labeling was coupled to the exclude peak list technique, to elucidate abundance differences between normal and HCC plasma samples. Two glycoproteins, vitronectin and antithrombin III, were identified via this method. Covalent attachment of lectins to magnetic beads to enrich for glycopeptides or glycoproteins was de-scribed, and the resulting bound fractions analyzed using MALDI. To facilitate a high-throughput automated procedure, one group employed the use of a single lectin coupled to magnetic beads, resulting in a one-step glycoprotein purification platform. Use of a robotic liquid handling system and 96-well plate format, three lectins, Con A, JAC, and WGA, were coupled to commercial magnetic beads individually, and the resulting pulled-down protein fractions were analyzed via 2-DE and the spot identified using MS. The benefit of this methodology is increased reproducibility as well application of a high-throughput biomarker and glycoproteomic analysis technique. Combined with bioinformatic analysis, the resulting datasets exhibit the potential to reveal and identify alterations in glycosylation profiles of disease states. Previous studies have employed the use of lectin conjugated to beads or immobilized onto a column. One study that differs in the approach of lectin affinity is the use of free lectins to bind to glycoproteins, and then recover the enriched glycoproteins by either ammonium sulfate precipitation, or the use of a membrane filter unit and centrifugation. Using a multitude of lectins individually in parallel, including Con A, WGA, Ricinus communis agglutinin (RCA 120 ), Sambucus sieboldiana lectin (SSA), and Maackia amurensis agglutinin (MAM), the two distinct methodologies were employed and evaluated. The first, which employed ammonium sulfate precipitation oligosaccharides derived from albumin, revealed that the recovered oligosaccharides moiety recovered in each lectin fraction was specific to the lectin employed. The second, incorporating free lectins incubated with tryptically digested glycopeptides from glycoprotein standard on top of a centrifugation unit membrane, showed an increase of enrichment for glycopeptides in each of the fractions, with individual lectins showing more specificity for individual, distinct proteins found in the protein standard. The results of these two methodologies illustrate that the use of a free lectin solution approach was comparable to those results obtained in other affinity chromatography experiments. Many of the previously mentioned studies require substantial amounts of sample, and in instances where sample amount is limited, one group developed a nanoscale Con A-chelating monolithic capillary. The use of this monolithic capillary would allow for complex, biological samples occurring in minute amounts to be analyzed and enriched for glycoproteins. To assess the value of their platform, urine samples from healthy individuals and bladder cancer patients were tested, using only 10 g of initial proteins. When compared to a standard lectin column, the nanoscale monolithic column resulted in the identification of more glycoproteins. As these studies indicate, use of single lectin affinity has the benefit of reducing the complexity of a proteome, in most cases the plasma, or serum, proteome, thus identifying potential candidate biomarkers. A general workflow diagram for lectin-affinity based methodologies is illustrated in Fig. 1. Single lectins appear to not only enrich for glycoproteins, but also indirectly result in an immunodepletion of highly abundant serum proteins. The multitude of studies incorporating single lectin affinity generates a lengthy list of potential biomarkers that would need further validation in larger patient groups, and the use of methodologies that emphasize a high-throughput platform may be the best approach in doing so. Several drawbacks of the lectin affinity approach are that overall, they are quite time-consuming with the multiple stages including enrichment, protein identification, and data analysis, and require a great deal of expertise regarding mass spectrometry analysis. In addition, the use of lectin affinity is based on a pull-down approach, thereby introducing the occurrence of additional proteins complexed with the lectin-target protein. Although this latter aspect has not been reported to interfere significantly with the selection of candidate proteins derived from lectin affinity experiments, it is a concern that could arise when validating potential candidate biomarkers. The development of protein microarrays incorporating lectins has also been employed to study changes in glycosylation. As noted, the use of lectin microarrays are beneficial as they are more suitable for highthroughput and systematic analysis of protein glycosylation, in contrast to more time consuming methodologies that incorporate affinity chromatography and MS analysis. In a brief communication, the development of lectin microarrays was detailed, and experimentally shown to provide a distinct, glycosylation pattern for selected protein standards, comparable to previous methods. To develop potential diagnostic tools in identifying aggressive prostate cancer, lectin microarrays were employed. First, the authors used PSA, a known glycosylated protein found in prostate cancer to evaluate their methodology, and then expanded by applying their platform to differentiate glycosylation patterns between non-aggressive prostate cancer and aggressive prostate cancer. Using lectin microarrays, the researchers were able to detect several isoforms of PSA and membrane metallo-endopeptidase (MME), both are which are highly expressed in prostate cancer. Lectin microarrays were also used to determine surface glycan structures, and thus identify potential biomarkers of breast cancer stem-cells. In attempt to generate additional cell surface markers that would be used to differentiate between cancer stem-like cells and cancer cell lines, the cell lines were analyzed with the use of lectin microarrays. The researchers revealed that the breast cancer cell line, MCF7, which can be grown under standard and sphere culture conditions, displayed distinct glycosylation patterns in response to the culture conditions. To identify differences in glycan expression between normal and tumorigenic breast cancer cell lines, researchers used lectin arrays. The inclusion of lectin arrays in the study attempted to reveal cell surface expression changes in carbohydrates between invasive and noninvasive cell lines, and in doing so, the study also revealed a glycosylation pattern that related to tissue-specific homing in metastasis. As the authors noted, the differences revealed could be functionally relevant in the development of diagnostic and therapeutic targets for detecting and treating metastasis. One study incorporated both multi-lectin affinity and lectin microarrays to analyze the glycosylation pattern in serum from patients with pancreatic cancer in an attempt to identify potential serum biomarkers. First, glycoproteins from serum were enriched using a general lectin column, and the resulting fraction was separated via reversed-phase HPLC to reduce complexity. The researchers selected lectins that exhibited a great deal of specificity to avoid non-specific protein binding, and the resulting array results indicated there were differences in the glycosylation patterns between the two sample groups. As detailed by the authors, this approach not only allowed for the identification of glycosylation pattern differences, but also allows for the identification protein glycosylation differences related to the disease state. To identify carbohydratebased tumor biomarkers, comparison of serum from patients with lung cancer and healthy individuals in a platform using lectin-coupled ProteinChip arrays was established. To reduce interference from glycosylated serum proteins, immunodepletion was used prior to enrichment of the remaining glycoproteins with the lectins JAC and SNA coupled to ProteinChip arrays. The researchers discovered the specific glycosylation site for the protein apoC-III, and two, distinct glycan structures on this protein, one of which was elevated in the serum of lung cancer patients. Concluding remarks Biomarker research has been ongoing for many years now, and although perhaps hundreds of candidate biomarkers have been suggested, only a few have been selected for clinical validation and eventually approved for use in clinical settings. There are a number of factors such as the complexity of cancer biology, the selection bias in the biomarker discovery processes, and the difficulty to conduct prospective clinical validation studies, which all contribute to this low rate of biomarker development but are beyond the scope of this review. As discouraging as that may be, the benefit of biomarkers in the field of medicine and health management is immeasurable. Specifically in cancer, biomarkers may not only lead to early detection or verify a disease state, but may also have a role in diagnosing tumor stage, and classifying cancers based on their genetic/biologic properties. It is this latter aspect, wherein cancer biomarkers could play the biggest role in the development of personalized medicine. No longer would treatment be a trial and error process, but rather a directed-therapy based on the molecular makeup of the diseased individual. With the advancement in technologies, we are now able to explore the entire molecular patterns in cells or tissues. Biomarker discoveries using these global approaches were criticized as "fishing expeditions" in the past, but now show great potential in biomarker discovery. Using proteomics, we are able to compare the proteome profile between a disease and non-disease state, revealing a treasure trove of valuable information, however, limitations of the technologies used in proteomics currently makes deep analysis of biological fluids and tissues a challenge. Deep-mining of the proteome could potentially yield clues as to changes in normal biological functions due to a disease state, and with the approaches currently in use, generation of subproteomes may be the best method to accomplish this goal. One such sub-proteome, the glycoproteome, appears to be the most beneficial to study, for the reasons previously mentioned in this review, and lectin-based techniques may prove to be a preferred approach. As multiple studies have revealed, the use of lectin-based techniques to analyze the glycoproteome has yielded several proteins of interest for various cancers from different biological sources. These lectin-based strategies can be viewed as analyzing the sub-proteome of a sub-proteome, resulting in a deep-mining of the human proteome. Identifying differences in protein profiles between normal and disease states may reveal potential biomarkers, but to determine increased expression of a protein(s) due to the disease state requires precise quantification. In this review, we discussed studies using 2D-DIGE, iTRAQ, and label-free methods to assess and quantitate relative protein expression differences, however, these methods are limited in the detection of slight protein expression differences, especially in samples with a large dynamic range. In contrast, stable isotope labeling by amino acids in cell culture (SILAC) is simple, highly sensitive, accurate in samples with a large dynamic range, and its workflow inherently reduces experimental error, allowing for the quantification of even minute protein expression differences. Surprisingly, the incorporation SILAC with lectin-affinity is rare, and may be due to many of these studies analyzing serum or tissue samples, wherein SILAC requires living organisms or autotrophic samples. One technique to address shortcoming of the SILAC methodology is super-SILAC. The super-SILAC method involves the use of several SILAC-labeled cell lines that match the tissue of interest, serving as an internal standard for quantitation of proteins derived from the tissue sample. The super-SILAC approach is sensitive and accurate, thus inclusion of this quantitation method for future biomarker discovery experiments may better re-veal subtle differences in the proteomes of normal and disease states. Although it appears many of the current lectin-based technologies are limited in their ability to be highthroughput, specific, sensitive, and reproducible, the combination of these distinct methodologies may be enough to overcome the limitations of each individual technique. The future may hold the development of a biomarker discovery/validation platform that can be applied in the detection candidate markers in many disease states. The development of such a platform would result in the transition of the identified biomarkers into clinically relevant applications. |
<reponame>mecon/factor
void init_c_io(void);
void io_error(void);
int err_no(void);
void clear_err_no(void);
DECLARE_PRIMITIVE(fopen);
DECLARE_PRIMITIVE(fgetc);
DECLARE_PRIMITIVE(fread);
DECLARE_PRIMITIVE(fputc);
DECLARE_PRIMITIVE(fwrite);
DECLARE_PRIMITIVE(fflush);
DECLARE_PRIMITIVE(fclose);
/* Platform specific primitives */
DECLARE_PRIMITIVE(open_file);
DECLARE_PRIMITIVE(existsp);
DECLARE_PRIMITIVE(read_dir);
|
<filename>__tests__/Bool/or.test.ts
import { expectType } from 'ts-expect'
import { B, pipe } from '../..'
describe('or', () => {
it('provides correct types', () => {
expectType<boolean>(B.or(true, true))
})
it('combines two booleans using OR', () => {
expect(B.or(true, true)).toEqual(true)
expect(B.or(false, false)).toEqual(false)
expect(B.or(true, false)).toEqual(true)
})
it('*', () => {
expect(B.or(true, false)).toEqual(true)
})
})
describe('or (pipe)', () => {
it('provides correct types', () => {
expectType<boolean>(pipe(true, B.or(true)))
})
it('combines two booleans using OR', () => {
expect(pipe(true, B.or(true))).toEqual(true)
expect(pipe(false, B.or(false))).toEqual(false)
expect(pipe(true, B.or(false))).toEqual(true)
})
it('*', () => {
expect(pipe(false, B.or(false))).toEqual(false)
})
})
|
<reponame>billstackpole/client
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package client
import (
"encoding/json"
"fmt"
"os"
"os/exec"
"github.com/keybase/cli"
"github.com/keybase/client/go/install"
"github.com/keybase/client/go/libcmdline"
"github.com/keybase/client/go/libkb"
)
// NewCmdUpdate are commands for supporting the updater
func NewCmdUpdate(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "update",
Usage: "The updater",
ArgumentHelp: "[arguments...]",
HideHelp: true,
Subcommands: []cli.Command{
newCmdUpdateCheck(cl, g), // Deprecated
newCmdUpdateCheckInUse(cl, g),
newCmdUpdateNotify(cl, g),
},
}
}
func newCmdUpdateCheck(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "check",
Usage: "Check for update",
Action: func(c *cli.Context) {
if libkb.IsBrewBuild {
g.Log.Errorf("\nTo update, run:\n\n\tbrew upgrade keybase")
return
}
updaterPath, err := install.UpdaterBinPath()
if err != nil {
g.Log.Errorf("Error finding updater path: %s", err)
return
}
cmd := exec.Command(updaterPath, "check")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
g.Log.Errorf("Error running %q: %s", updaterPath, err)
}
},
}
}
// newCmdUpdateCheckInUse is called by updater to see if Keybase is currently in use
func newCmdUpdateCheckInUse(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "check-in-use",
ArgumentHelp: "",
Usage: "Check if we are in use (safe for restart)",
Action: func(c *cli.Context) {
cl.SetLogForward(libcmdline.LogForwardNone)
cl.SetForkCmd(libcmdline.NoFork)
cl.ChooseCommand(newCmdUpdateCheckInUseRunner(g), "check-in-use", c)
},
}
}
type cmdUpdateCheckInUse struct {
libkb.Contextified
}
func newCmdUpdateCheckInUseRunner(g *libkb.GlobalContext) *cmdUpdateCheckInUse {
return &cmdUpdateCheckInUse{
Contextified: libkb.NewContextified(g),
}
}
func (v *cmdUpdateCheckInUse) GetUsage() libkb.Usage {
return libkb.Usage{
API: true,
Config: true,
}
}
func (v *cmdUpdateCheckInUse) ParseArgv(ctx *cli.Context) error {
return nil
}
type checkInUseResult struct {
InUse bool `json:"in_use"`
}
func (v *cmdUpdateCheckInUse) Run() error {
mountDir, err := v.G().Env.GetMountDir()
if err != nil {
return err
}
inUse := install.IsInUse(mountDir, G.Log)
result := checkInUseResult{InUse: inUse}
out, err := json.MarshalIndent(result, "", " ")
if err != nil {
return err
}
fmt.Fprintf(os.Stdout, "%s\n", out)
return nil
}
func newCmdUpdateNotify(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "notify",
ArgumentHelp: "<event>",
Usage: "Notify the service about an update event",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "f, force",
Usage: "Force action",
},
},
Action: func(c *cli.Context) {
cl.SetLogForward(libcmdline.LogForwardNone)
cl.SetForkCmd(libcmdline.NoFork)
cl.ChooseCommand(newCmdUpdateNotifyRunner(g), "notify", c)
},
}
}
type cmdUpdateNotify struct {
libkb.Contextified
force bool
event string
}
func newCmdUpdateNotifyRunner(g *libkb.GlobalContext) *cmdUpdateNotify {
return &cmdUpdateNotify{
Contextified: libkb.NewContextified(g),
}
}
func (v *cmdUpdateNotify) GetUsage() libkb.Usage {
return libkb.Usage{
API: true,
Config: true,
}
}
func (v *cmdUpdateNotify) ParseArgv(ctx *cli.Context) error {
v.force = ctx.Bool("force")
v.event = ctx.Args().First()
if v.event == "" {
return fmt.Errorf("No event specified")
}
return nil
}
func (v *cmdUpdateNotify) Run() error {
v.G().Log.Debug("Received event: %s", v.event)
switch v.event {
case "after-apply":
// Deprecated (no longer called by go-updater)
return nil
default:
return fmt.Errorf("Unrecognized event: %s", v.event)
}
}
|
<reponame>Perococco/pz-plugin<gh_stars>0
package perobobbot.pzplugin.redemption;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import perobobbot.lang.Nil;
import perobobbot.lang.Platform;
import perobobbot.lang.fp.Function1;
import perobobbot.oauth.BroadcasterIdentifier;
import perobobbot.oauth.OAuthTokenIdentifierSetter;
import perobobbot.pzplugin.RedemptionCompleter;
import perobobbot.pzplugin.rewards.ParsedRedemption;
import perobobbot.twitch.api.RewardRedemptionStatus;
import perobobbot.twitch.api.UserInfo;
import perobobbot.twitch.client.api.TwitchService;
import perobobbot.twitch.client.api.channelpoints.UpdateRedemptionStatus;
@RequiredArgsConstructor
public class RewardRedemptionHandler {
public static @NonNull Function1<ParsedRedemption, RedemptionCompleter> handler(@NonNull TwitchService twitchService, @NonNull OAuthTokenIdentifierSetter oAuthTokenIdentifierSetter) {
return r -> handle(twitchService, oAuthTokenIdentifierSetter, r);
}
public static @NonNull RedemptionCompleter handle(@NonNull TwitchService twitchService,
@NonNull OAuthTokenIdentifierSetter oAuthTokenIdentifierSetter,
@NonNull ParsedRedemption parsedRedemption) {
return new RewardRedemptionHandler(twitchService, oAuthTokenIdentifierSetter, parsedRedemption).handle();
}
private final @NonNull TwitchService twitchService;
private final @NonNull OAuthTokenIdentifierSetter oAuthTokenIdentifierSetter;
private final @NonNull ParsedRedemption parsedRedemption;
private @NonNull RedemptionCompleter handle() {
System.out.println("Perform redemption for " + parsedRedemption.getUserInfo().getName());
return new TransactionCompleter(parsedRedemption.getUserInfo(), parsedRedemption.getRewardId(), parsedRedemption.getRedemptionId());
}
@RequiredArgsConstructor
private class TransactionCompleter implements RedemptionCompleter {
private final @NonNull UserInfo userInfo;
private final @NonNull String rewardId;
private final @NonNull String redemptionId;
@Override
public void complete() {
update(RewardRedemptionStatus.FULFILLED);
}
@Override
public void reject() {
update(RewardRedemptionStatus.CANCELED);
}
private void update(@NonNull RewardRedemptionStatus status) {
System.out.println("## Complete redemption for '" + userInfo.getName() + "' with status : " + status);
oAuthTokenIdentifierSetter.wrapRun(new BroadcasterIdentifier(Platform.TWITCH, userInfo.getId()),
() -> twitchService.updateRedemptionStatus(rewardId, new String[]{redemptionId}, new UpdateRedemptionStatus(status)));
}
}
}
|
A new testing method of randomness for true random sequences In this paper, based on researches and analysis for some common testing methods of randomness, a new testing method for randomness was proposed. This new method applied theories on kolmogorov complexity and wavelet transform to the randomness testing. This new method can be used to evaluate quality of random sequences generators and security of encryption algorithms. |
At the Feb. 4, 2019 Commission Meeting, the St. Augustine Beach City Commission agreed to make April “Ban the Bag” month.
This voluntary ban on single-use plastic bags is in response to a presentation by Attorney Jane West and is supported by the North Florida Coastal Caretakers. The voluntary ban is designed to encourage all retailers and restaurants to remind their customers to BYOB — Bring Your Own Bag.
The environment of The City of St Augustine Beach is a unique coastal ecosystem. Single use plastic bags often end up on the region’s beaches, oceans, marshes, coastal hammocks and dune systems. This is not only unsightly and bad for businesses, but it also causes considerable, and sometimes irreversible, harm to wildlife.
Plastic bags can also kill sea life, like sea turtles and sharks, which mistake a plastic bag for a jellyfish and try to eat it. Fish can also ingest the bags as the plastic breaks down into smaller pieces. This plastic then gets into the animal and humans, in turn, consume it.
The April Bag Ban is a voluntary program, but its success depends on residents and retailers of The City of St Augustine Beach. |
Pharmacogenetics of toxic epidermal necrolysis Importance of the field: Toxic epidermal necrolysis (TEN) and StevensJohnson Syndrome (SJS) are two of the most severe drug-induced cutaneous reactions. Advances in genome technologies have allowed researchers to identify genetic markers associated with this drug-associated event and these have provided a potential tool for prevention. Areas covered in this review: Current updates of genetic biomarkers that have been identified as being associated with TEN/SJS induced by several drugs, and the associations of these markers in different populations, are discussed. What the reader will gain: The strong association of HLA-B*1502 and carbamazepine (CBZ)-induced TEN/SJS have been reported by several independent studies. This association was mostly observed in patients of Southeast Asian ancestry; it was not observed in populations with low HLA-B*1502 allele frequency. Studies also suggest that drugs with a similar chemical structure to CBZ might also induce TEN/SJS in patients with HLA-B*1502. In addition to CBZ, HLA-B*5801 was also found to associate with allopurinol-induced TEN/SJS. This strongly suggests that the associations of these markers with TEN/SJS are drug specific. Take home message: The strong association between CBZ and HLA-B*1502 has prompted the US Food and Drug Administration to update the label for CBZ to include genetic information and to recommend genetic testing before prescribing CBZ. Patients with Asian ancestry or who are from regions prevalent in HLA-B*1502 should be screened before CBZ treatment. |
Aspisol inhibits tumor growth and induces apoptosis in breast cancer. UNLABELLED Nonsteroidal anti-inflammatory drugs inhibit cell proliferation and induce apoptosis in various cancer cell lines, which is considered to be an important mechanism for their anti-tumor activity and cancer prevention. However, the molecular mechanisms through which these compounds induce apoptosis are not well understood. AIM to determine the effects of nonselective cyclooxygenase-2 (COX-2) inhibitor, aspisol on breast cancer cells in vitro and in vivo. METHODS The cytotoxic activity of aspisol was evaluated by MTT assay. The apoptosis index of cells was measured by flow cytometry. Immunohistochemical staining was used to detect expressions of COX-2 and caspase-3 in MDA-MB-231 cells. The expression of bcl-2 and bax was analyzed by Western blot analysis. The content of prostaglandin E2 (PGE2) in MDA-MB-231 cells was estimated by ELISA. In vivo apoptosis of the tumor cells was detected by the terminal deoxynucleotidyl transferase-mediated dUTP nick-end labeling (TUNEL). RESULTS Our results showed that aspisol reduced viability of MDA-MB-231 cells in time- and dose- dependent fashions and induced apoptosis by increase of caspase-3 and bax expressions while decrease of COX-2 and bcl-2 expression in vitro. In addition, exposure to aspisol decreased the basal release of PGE2. In vivo, aspisol also inhibited the proliferation of breast cancer cells and induced their apoptosis. CONCLUSIONS Our in vitro and in vivo data indicated that the antitumor effects of aspisol on breast cancer cells was probably mediated by the induction of apoptosis, and it could be linked to the downregulation of the COX-2 or bcl-2 expression and up-regulation of caspase-3 or bax expression. |
Early childhood sexuality education: Future educators attitudes and considerations Sexuality education is one of the most disputable health education programs as far as its inclusion in Early Childhood Education is concerned. This study was conducted in order to investigate early childhood future educators attitudes and considerations about introducing sexuality education to their future pupils. We used a qualitative research method: semi-structured interviews for two groups of students in the Department of Educational Studies in Early Childhood, University of Northern Greece. The results revealed that the students who had chosen and successfully completed a course about early childhood sexuality education were the ones who indicated the subject as one of the basic ones to be taught in the kindergarten. Furthermore, they expressed their considerations about Greek bibliographys lag in this field. Finally, they exhibited more readiness to introduce sexuality education to their future pupils than the rest of the students did. Students who had not attended a relative course referred to developmentally inappropriate subject areas, showing their inability or even riskiness to introduce sexuality to their pupils. The results suggested the students need for relevant theoretical as well as practical education. |
package authoring.editorview.enemy;
/**
*
* @author <NAME>
* @author <NAME>
*
*/
public interface EnemyAuthoringViewDelegate {
public void onUserPressedCreateEnemy ();
public void onUserPressedDeleteEnemy ();
public void onUserEnteredEnemySpeed (String enemySpeed);
public void onUserEnteredEnemyHealth (String enemyHealth);
public void onUserEnteredEnemyDamage (String enemyDamage);
public void onUserEnteredEnemyPoints (String enemyRewardPoints);
public void onUserEnteredEnemyMoney (String enemyRewardMoney);
public void onUserEnteredEnemyImagePath (String enemyImagePath);
public void onUserEnteredEnemyName (String enemyName);
public void onUserEnteredEnemySize (String enemySize);
public void onUserSelectedEnemy (int enemyID);
public void onUserPressedAddEffect ();
}
|
The Role of the Media in Corporate Governance: Do the Media Influence Managers Capital Allocation Decisions? Using 636 large acquisition attempts that are accompanied by a negative stock price reaction at their announcement (value-reducing acquisition attempts) from 1990 to 2010, we find that, in deciding whether to abandon a value-reducing acquisition attempt, managers' sensitivity to the firm's stock price reaction at the announcement is influenced by the level and the tone of media attention to the proposed transaction. We interpret the results to imply that managers have reputational capital at risk in making corporate capital allocation decisions and that the level and tone of media attention heighten the impact of a value-reducing acquisition on the managers' reputational capital. To the extent that value-reducing acquisition attempts are more likely to be abandoned, the media can play a role in aligning managers' and shareholders' interests. |
USAIN Bolt has admitted he didn't think it would be that difficult to earn his spot in an A-League squad.
A day after his parting of ways with the Central Coast Mariners was confirmed by the club, Bolt said he now knew playing professional football was "a little bit harder" than he originally expected.
Bolt quit his A-League trial on Friday, rejecting a contract offer from the Central Coast reported to be worth around $150,000 for a one-season cameo.
After Football Federation Australia opted not to contribute towards Bolt's salary and the club was unable to find a third-party backer to top up any deal, Bolt reportedly pulled the pin on his open-ended training contract.
According to reports, the Mariners were not able to offer anything near the $3 million contract value demanded by agent Ricky Simms.
Bolt's next move after parting ways with the Mariners was to attend Victoria Derby Day at Flemington on Saturday.
Bolt told The Herald Sun at the racecourse he hadn't given up on his dream of playing professional football, but conceded he had a lot of work to do.
Confusingly, Bolt also said the key to his future was about "dedication and work with the team" - the day after he walked out on his club.
"For sure (I'll stick with it)," Bolt said, according to The Herald Sun.
"We'll see what happens. I think people are still contacting my agent now about opportunities, so we'll see in which direction it goes.
"For me, I've learned that I still have it. I figure that I was improving a lot, so as you can see from the first game to the last game, I really improved and did better. I've learned that it's a little bit harder, but it's all about dedication and work with the team."
Bolt's admission comes after Aussie football commentators criticised his lack of commitment as well as his lack of skills on the pitch.
Fox Sports football commentator Simon Hill said Bolt's decision was confusing.
Usain Bolt looked much more comfortable at Flemington than he ever did in a Mariners jumper.
"It's probably a good moment for the two parties to go their separate ways," Hill told Fox Sports News.
"The Mariners have a big season to concentrate on. They don't need this. This is a distraction, quite honestly.
"Usain Bolt, if he's going to continue his football career, is going to have to go and find a contract elsewhere.
"I'm slightly mystified by how this has all developed from Bolt's point of view. He said all along that he desperately wants to be a professional footballer and he's had two opportunities now to do that.
He's had the Mariners deal and of course he was offered a contract by Valletta, a club in Malta, and he's knocked them both back.
"So I do question as to whether it's about the football or is it about the bigger contract?"
Brisbane coach John Aloisi said on Friday night that the A-League risked being seen as a gimmick competition had Bolt actually stepped onto the pitch during the A-League season.
Aloisi dismissed criticism the A-League had missed a golden marketing chance by letting Bolt go, saying the Olympic sprint great's retention might have put off genuine marquee imports coming to the country.
"I am not sure whether the crowds would have lifted or if they did lift would it be for a short period," Aloisi said of Bolt.
"And will it affect other foreign players at the top level coming to Australia because they think it is a gimmick league?"
Roar striker Adam Taggart didn't believe Bolt's departure would harm the league, and the chance to join the Mariners roster should have been given to a young gun.
"As an athlete I have all the respect in the world for him, in terms of what he has done in his sport," Taggart said of Bolt.
"But to be honest, as a footballer I would have liked to have seen the opportunity go to a young player who has worked their whole life in the football world to get their chance in the first team." |
<reponame>sudbasnet/Callbreak-Backend-Node-Typescript
import { GameRepository } from '../../repositories/GameRepository';
import { UserRepository } from '../../repositories/UserRepository';
import { RequestHandler } from 'express';
import CustomError from '../../entities/classes/CustomError';
import gameResponse from '../../helpers/game-response';
const join: RequestHandler = async (req, res, next) => {
const Game = new GameRepository();
const User = new UserRepository();
const userId = req.userId;
const userName = req.userName;
const gameId = req.params.gameId;
if (!userId || !userName) {
throw new CustomError('The user does not exist.', 404);
}
try {
const game = await Game.findById(gameId);
if (!game) {
throw new CustomError('Cannot find game.', 404);
}
const player = await User.findById(userId);
if (!player) {
throw new CustomError('Cannot find user.', 404);
}
const playerAlreadyJoined = game.playerList.map(x => x.id).includes(userId);
const gameIsFull = game.privatePlayerList.length === 4;
if (playerAlreadyJoined || gameIsFull) {
throw new CustomError('Cannot join game!', 500);
}
if (game.privatePlayerList.length <= 4) {
game.addUserToGame(player);
const savedGame = await Game.save(game);
res.status(200).json(gameResponse(userId, savedGame));
}
} catch (err) {
next(err);
}
};
export default join; |
RESTORATION PROCESS OF THE OUTER RETINAL LAYERS AFTER SURGICAL MACULAR HOLE CLOSURE Supplemental Digital Content is Available in the Text. Spectral domain optical coherence tomography revealed that, after surgical macular hole closure, the outer retinal layers were restored in the order of the external limiting membrane, outer nuclear layer, and ellipsoid zone. Restoration of each layer was essential for restoring the subsequent layer. Purpose: To investigate the interrelationship among the outer retinal layers after macular hole surgery and elucidate the restoration process. Methods: This retrospective observational study included 50 eyes of 47 consecutive patients with closed macular holes in the first vitrectomy. Optical coherence tomography was obtained before surgery; at 1, 3, and 6 months postsurgery; and at the last visit. The complete continuous layer rate and mean defect length were evaluated for the outer nuclear layer (ONL), external limiting membrane (ELM), and ellipsoid zone (EZ). Results: At all postoperative visits, the complete continuous layer rate was in the descending order of ELM, ONL, and EZ and the mean defect length was in the ascending order of ELM, ONL, and EZ. External limiting membrane was necessary for ONL restoration. External limiting membrane and ONL were necessary for EZ restoration. Hyperreflective protrusions were observed from the area lacking ELM into the subretinal space after surgery. Ellipsoid zone was not formed in coexistence with the hyperreflective protrusions. Intermediate reflective protrusions appeared under the ONL plus ELM after surgery and were eventually replaced by EZ. Conclusion: Restoration of the outer retinal layers after surgical macular hole closure occurs in the order of ELM, ONL, and EZ. |
<reponame>noexpand/automaton
package de.quinscape.automaton.runtime.filter.impl;
import de.quinscape.automaton.runtime.filter.Filter;
import de.quinscape.automaton.runtime.filter.FilterEvaluationContext;
public final class NotFilter
implements Filter
{
private final Filter filter;
public NotFilter(Filter filter)
{
this.filter = filter;
}
@Override
public Object evaluate(FilterEvaluationContext ctx)
{
return !(boolean)filter.evaluate(ctx);
}
}
|
Apple's CEO says he's dealing with a hormone imbalance and chose to spend the holiday season with his family rather than "intensely prepare" a keynote address.
Update 9:23 a.m. PST: This story was revised to clarify that Apple did not make any explicit connection between Steve Jobs' health and the decision for him not to give the Macworld keynote address.
Apple CEO Steve Jobs is lying low rather than giving his traditional Macworld keynote speech Tuesday, with health issues apparently a partial factor in the decision even as he and the company avoid an explicit statement to that effect.
For the first time in a decade, I'm getting to spend the holiday season with my family, rather than intensely preparing for a Macworld keynote.
The remedy for this nutritional problem is relatively simple and straightforward, and I've already begun treatment. But, just like I didn't lose this much weight and body mass in a week or a month, my doctors expect it will take me until late this Spring to regain it.
Throughout 2008 Apple was plagued with rumors about Jobs' health, but steadfastly refused to acknowledge that anything was behind concerns over what many believed was substantial weight loss suffered by the iconic Apple founder. Apple stunned onlookers in December with the news that Jobs would be skipping his much-anticipated Macworld keynote, but said the reason was that Apple had decided not to invest in a Macworld keynote because it would be the company's last year at the show.
Should Apple have said more, and sooner, about Steve Jobs' health?
Yes, it's pertinent company information.
Tough call; they balanced it about right.
It's possible to read between the lines and see Jobs' health as more of a factor in the Macworld decision than Apple is letting on. But the company on Monday would say only that Jobs "deserves our complete and unwavering support during his recuperation," with no mention of Macworld in its 90-word statement.
Jobs will continue as CEO while he is regaining weight in what he called a "simple and straightforward" remedy, which is expected to last until late spring, he said in the letter. "I have given more than my all to Apple for the past 11 years now. I will be the first one to step up and tell our Board of Directors if I can no longer continue to fulfill my duties as Apple's CEO."
The startling possibility that Apple and Jobs knew several weeks ago that health concerns had become his number one priority calls into question the company's handling of Jobs' absence from Macworld. There are no hard-and-fast guidelines that dictate how companies are supposed to handle health concerns, the way strict guidelines dictate the handling of material financial information.
But it's clear to anyone with a pulse in the tech industry that a health-related reason for a Jobs-less keynote would be a huge blow to Apple's stock. Apple representatives refused to answer questions about Jobs' health when the news first surfaced in December, insisting that the only reason Jobs would be absent from the keynote was because the company was done with Macworld.
There was a lot more to the story. We'll be following up on the implications of this news all day.
Updated 6:43am PT: Apple's stock has rallied on the news, once again validating my career decision to stay away from stock-picking. In the first 15 minutes of trading, the stock is up around 4 percent, which is perhaps an indication that since Jobs' health situation is not as dire as some reports had suggested last week, investors are confident he'll continue as CEO. |
def create_img_from_blender_image(blender_image):
if blender_image is None:
return None
return create_img_from_pixels(blender_image.size[0], blender_image.size[1], blender_image.pixels[:]) |
Interannual variation in the metazoan parasite communities of bigeye trevally Caranx sexfasciatus (Pisces, Carangidae) Parasite communities in Caranx sexfasciatus were characterized and analyzed to determine any interannual variations in structure and/or species composition. In total, 422 C. sexfasciatus were collected from Acapulco Bay, Mexico, between May 2016 and March 2019. Thirty-two taxa of metazoan parasites were identified: five Monogenea, thirteen Digenea, one Acanthocephala, one Cestoda, three Nematoda, seven Copepoda, and two Isopoda. Monogeneans were the most frequent and abundant parasite species in all sampling years. Parasite species richness at the component community level varied significantly from 8 (May 2016) to 25 (March 2019) and was similar to previous reports for other species of Carangidae. The component communities and infracommunities in C. sexfasciatus were characterized by low parasite species numbers, low diversity, and dominance of a single species (the monogenean Neomicrocotyle pacifica). Parasite community structure and species composition varied between sampling years and climatic seasons. Seasonal or local fluctuations in some biotic and abiotic environmental factors probably explain these variations. Introduction Parasite communities in marine fish consist of ectoparasites (monogeneans, copepods, and isopods) and endoparasites (digeneans, cestodes, nematodes, and acanthocephalans). Both types of parasite exhibit different transmission strategies to infect their hosts; for example, ectoparasites are often transmitted directly between individual hosts through contact, whereas endoparasites often use trophic transmission routes. Transmission strategies of parasites are linked to host behavior. For instance, ectoparasite populations may be more abundant on species of fish that form large schools than on solitary species, because the probability of a transmission stage (e.g., eggs, larvae) coming into contact with a host increases as host density rises. Studies of parasite communities are conducted mainly at two different hierarchical levels: component community (between locations or host populations) and infracommunity (between individual hosts). In recent years, a central theme in parasite ecology has been the identification of the factors (biotic or abiotic) determining species richness and composition in these communities. However, an understanding is also needed of how consistent parasite community richness and species composition are in space and time. For example, spatial or temporal variation in community structure may indicate how important local environmental factors (abiotic and biotic conditions) are in structuring a parasite community, particularly when disparities are found between different host species. There is still no consensus on whether marine parasite communities can exhibit temporal variations in structure and species composition. Some studies suggest that the infection levels of most parasite species do not experience significant changes over time, and that communities tend to be generally stable in species composition for long periods of time. Others indicate that even though parasite species composition may be relatively stable over time, a community can undergo substantial changes in structure due to variations in local environmental factors. The bigeye trevally, Caranx sexfasciatus Quoy & Gaimard 1825, is an economically important pelagic fish species distributed widely along the eastern coast of the Pacific Ocean from CA, USA to Ecuador and the Galapagos Islands. Bigeye trevally often form large stationary daytime schools, but usually tend to be solitary at night when feeding. Their diet consists mainly of fish, but the species also preys on squids and crustaceans. Despite its ecological and economic importance, no information is available to date on its parasite fauna along the Pacific coast of Mexico. The present study objectives were to characterize the metazoan parasite communities of C. sexfasciatus; and to evaluate possible interannual variability in its parasite communities. Materials and methods A total of 422 individuals of C. sexfasciatus were obtained from commercial fishermen over a four-year period (May 2016-March 2019) from Acapulco Bay (16°51 0 N; 99°5 2 0 W) in Guerrero, Mexico. The tropical Pacific region experiences two distinct climatic seasons: a rainy period from June to November (total precipitation % 950 mm), and a dry period from December to May (total precipitation < 70 mm). In the years 2017 and 2019, a single sampling was carried out, but in a different climatic season: August (rainy season) and March (dry season), respectively. In 2016 and 2017, two samplings were carried out per year, which included both climatic seasons: May and October in 2016, and May and November in 2018. Records of surface temperatures of the ocean waters and salinity per sampling date were obtained from other studies carried out at the same location but not yet published. Multivariate El Nio index values (MEI) for each sampling date were obtained from the National Oceanic and Atmospheric Administration (NOAA: https://www.esrl.noaa.gov/psd/enso/mei/table.html). Fish were measured and weighed at the time of collection. A complete necropsy was made for each specimen and all parasites were collected from the internal and external organs. Contents of the digestive tract were examined to identify prey items consumed by this species. Dietary items were identified to the family level when possible. Prey item analysis was carried out using the frequency of occurrence method. Parasites were identified to the lowest possible taxonomic level and vouchers of the most abundant and best-preserved specimens deposited in the Coleccion Nacional de Helmintos (CNHE), Instituto de Biologia, Universidad Nacional Autonoma de Mexico, Mexico City. Infection levels for each parasite species were described using prevalence (percent of fish infected with a particular parasite species); mean abundance (mean number of individual parasites of a particular species per examined fish), expressed as the mean ± standard deviation (SD); and intensity (number of a particular parasite species per infected fish), expressed as range (minimum-maximum). Possible differences in infection levels between sampling years and climatic seasons were identified using G-tests, and a general linear model (GLM) for abundance. The dispersion index (DI = variance to mean abundance ratio) was applied to describe parasite dispersion patterns. The infracommunity index (ICI), which describes the frequency of double and multiple infections by a single species of parasite in a distinct host (affinity level of a species of parasite; i.e. species with great tendency to join the infracommunity), was also calculated. Spearman's correlation coefficient (r s ) was used to determine possible relationships between total host length and abundance or DI values of each parasite species. Analyses were done at the levels of component community (i.e. total parasite species in all fish collected at a sampling year) and infracommunity (i.e. total parasite species in each individual fish). Component community parameters included total species richness, total number of individuals of each parasite species, the Shannon-Wiener Index (H) as a measure of diversity, species evenness (equitability), and the Berger-Parker Index (BPI) as a measure of numerical dominance. The qualitative Sorensen index and quantitative percentage of similarity (PS) index were used to evaluate similarity and difference in parasite community species composition between sampling dates. Differences between component community parameters were identified with Student t and v 2 tests. Infracommunities were described in terms of mean number of parasite species per host, mean number of individuals of each species, and the mean Brillouin Diversity Index (H 0 ) value per host. The multivariate general linear model (GLM) was used to identify possible differences in infracommunity parameters (dependent variables) between sampling years and climatic seasons (predictor variables); fish body size (total length) was used as a covariate to control for the influence of host body size. The significance of all statistical analyses was established at p < 0.05, unless stated otherwise. A multivariate analysis (principal component analysis, PCA) was applied to identify factors that influenced parasite infracommunity species richness and diversity. The predictor variables used were: Fulton's condition factor (K n ) ; host diet diversity (calculated as the diversity of items consumed by host populations at each sampled date, through the use of the Shannon-Wiener index at the family level); number of endoparasite and ectoparasite species; surface temperature; salinity; MEI values; sampling year; and climatic season. The Kaiser-Meyer-Olkin (KMO) test of sampling adequacy for each variable in the model, as well as the Bartlett sphericity test, which evaluates the possibility that there is redundancy among variables were applied. The variance maximizing rotation method was applied to produce the two ordination axes. Discriminant function analyses based on Mahalanobis distances were used to identify possible differences in parasite community structure between sampling years. The probability of correct classification expected by chance alone of fishes to any of the four sampling years was calculated using the proportional chance criterion, which is a simple method to account for differences in sample sizes between the groups being compared. Only parasite species with a prevalence >10% in at least one of the sampling years (a component species; sensu ) were included in this analysis. Species composition Thirty-two taxa of metazoan parasites (23 of helminths and nine of Crustacea) were recovered and identified (9866 individual parasites) from 422 individuals of C. sexfasciatus collected from Acapulco Bay, Mexico. Five species of Monogenea (adults), 13 Digenea (12 adults and one metacercaria), one Acanthocephala (adult), three Nematoda (one adult and two larvae), seven Copepoda, and two species of Isopoda were collected (Table 1). Species richness was highest among the digeneans, representing 37.1% of the total species, followed by copepods (20%). Based on infection site, 14 species of parasite were classified as ectoparasites and 18 as endoparasites. The numbers of species of ectoparasite varied significantly from 2.02 ± 0.90 in 2016 to 2.41 ± 1.20 in 2019 (ANOVA F 3,405 = 3.23, p < 0.05) (Fig. 1 Interannual variation in infection levels For eight of these perennial species (the exceptions were Pr. manteri, S. apharei and Ca. robustus), prevalence varied significantly between sampling years, though no clear pattern was observed in variation. For the parasites B. varicus (Table 1). Prevalence values were generally positively correlated with mean abundance values, indicating that the most prevalent species also were the most abundant (r s = 0.946, p < 0.01). Spatial dispersion The dispersion index (DI) values indicated that at least 10 species (31%) exhibited an aggregated dispersion pattern in one or more sampling years (Table 1). Higher mean aggregation values (DI > 8) occurred in several years for the monogeneans N. pacifica and Pr. manteri ( Table 1). The DI values of each parasite species correlated positively with its prevalence (r s = 0.824, p < 0.01), total number of individuals (r s = 0.878, p < 0.01), and mean abundance (r s = 0.871, p < 0.01) values, but not with host body size or sample size (p > 0.05). Host diet composition The alimentary spectrum of the fish included twelve prey items, of which smaller fish (36%), crab larvae (24.5%) and penaeid larvae (15.6%) represented the largest proportions. Additonal prey items accounted for 24% of the diet, and included amphipods, polychaetes, mollusk larvae, isopods, stomatopods, pistol crabs, and copepods. Diet composition varied between sampling years (t = 3.10, p < 0.05). For example, in May 2016 diet composition was less varied (H = 0.68, Table 2), with crab larvae being the main prey item. Feeding habits also changed with fish body size; larger individuals consumed higher percentages of fish while smaller ones fed on higher percentages of crustaceans and other prey. Component community Species richness of parasite by sampling year (Table 2) varied widely from eight (May 2016) to 25 (March 2019) (v 2 = 11.6, p < 0.05). No correlation was observed between sample size and species richness at this level, indicating that the different sample sizes used in the analyses had no effect on the results. The total number of individual parasites ranged from 670 (October 2016) to 3465 (March 2019) (v 2 = 3,997.2, p < 0.05). The only dominant species was the monogenean N. pacifica (Table 2), although its degree of dominance varied significantly between sampling years (t = 4.70, p < 0.01). Shannon-Wiener diversity index values were generally low, ranging from 0.90 (October 2016) to 1.40 (March 2019), but varied between sampling years (t = 3.68, p < 0.01). Similarity between component communities was slightly low overall (<65%, Fig. 2) and was higher at the qualitative level (mean = 64.05%) than at the quantitative level (mean = 56.15%). Infracommunity The body size of individuals of C. sexfasciatus varied from 19.0 ± 1.3 cm (October 2016) to 28.8 ± 4.5 cm (August 2017) ( Table 2), and it differed significantly between sampling years (ANOVA F 3,402 = 32.3, p < 0.01). Mean species richness of parasites ranged from 2.22 ± 1.30 to 2.96 ± 1.54, and the mean number of individual parasites per fish from 12.71 ± 11.5 to 31.50 ± 30.35 ( Table 2). The Brillouin diversity index (H 0 ) values varied from 0.53 ± 0.48 to 0.71 ± 0.58. The mean number of species (GLM; F 3,406 = 3.95, p < 0.01) and the mean number of individuals (GLM; F 3,406 = 10.72, p < 0.01) were highest in March 2019 (Table 2), although mean diversity (H 0 ) did not exhibit significant variation between sampling years (p > 0.05). Dominance of the monogenean N. pacifica at the infracommunity level was very similar to that at the component level (Table 2). Considering all samples, the mean number of species (r s = 0.368, p < 0.01), and the mean diversity (r s = 0.098, p < 0.05) exhibited negative correlations with host body size of fish, while the mean number of individual parasites was positively correlated (r s = 0.313, p < 0.01). The infracommunity index values (ICI) indicated that N. pacifica, Pr. manteri, and Ca. robustus had the highest number of double or multiple co-occurrences with other parasite species (ICI mean > 0.15) in all the sampling years (Table 1). Multivariate analyses The KMO (0.476) and the Bartlett's tests results (v 2 = 2,944.2; df = 45, p < 0.001) for the PCA, applied to identify the influence of biotic and abiotic factors on parasite infracommunity structure (Fig. 3), indicated that there is a sufficient relationship between the number of variables studied and the sample sizes, confirming the relevance of the PCA. The first three component variables generated by the model explained 61.9% of total variance, contributing 24.9% (eigenvalue = 3.74), 19.8% (eigenvalue = 2.97), and 17.2% (eigenvalue = 2.58). The first variable suggests that the richest and most diverse infracommunities among all the sampled years were characterized by a significant number of ectoparasite and endoparasite component species, with more homogeneous species abundances. The second variable indicated that both the total number of ectoparasites and the parasite load per infracommunity were highest in larger hosts with a more varied diet. The third variable associated host diet with the environmental factors that were studied (Table 3). This variable indicated that host diet was more varied during the dry season when water surface temperature was slightly cooler (as suggested by the negative correlations), which occurred mainly during the final sampling year (Tables 2 and 3). In the model constructed to identify possible interannual differences in parasite community structure, the first two discriminant variables explained 86.9% of the total variance, contributing 56.2% (eigenvalue = 0.164) and 30.6% (eigenvalue = 0.090). A significant overall group effect was observed (Wilks' lambda = 0.759, p < 0.001). Individual fish were mainly distributed along the first axis (Fig. 4). Dimensionality tests showed that the four sampling years were significantly different in both dimensions (v 2 = 110.37, df = 15, p < 0.001). Each fish was correctly assigned to one of the four sampling years with a 41.1% accuracy, more than double that achieved by chance alone (16%). Of the nine component species (i.e. prevalence > 10%), only five were accepted by the model (Table 4) based on their lower Wilks' lambda values. High abundance of the monogenean Pr. manteri and lower abundance of the digenean E. virgulus were characteristic of hosts collected in 2016. The monogenean N. pacifica and the copepod L. ilishae effectively functioned to identify hosts that were collected in 2019, while the copepods Ca. alalongae and L. ilishae effectively distinguished between hosts collected in 2017 and 2018. Parasite community species composition All the present parasite species records (23 helminths and nine crustaceans) are new geographical records for C. sexfasciatus on the Pacific coast of Mexico (Table 1). Ectoparasites (five monogeneans, seven copepods, and two isopods) numerically dominated the parasite communities, representing 92.71% of the total number of individual parasites recovered. This predominance is probably due to the monogeneans' transmission strategies (direct contact), increasing their transmission probabilities especially in gregarious fish such as C. sexfasciatus. Eight of the reported monogenean species (including N. pacifica, Pr. manteri, and Ps. selene) have been recorded in Carangidae from the Pacific coast of Mexico. Copepods are a highly diverse group that mainly parasitize marine fish ; however, this crustacean group has received limited attention in Mexico ; in the present study, they were the second most diverse group and represented 22% of the total taxa recovered (Table 1). Interannual variation in parasite infection levels At least five species of parasite (two endoparasites -B. varicus and a tetraphyllidean cestode, and three ectoparasites -N. pacifica, Ps. selene and Ca. alalongae) exhibited significant interannual differences in infection levels (Table 1). Endoparasites often are trophically transmitted, so variations in infection levels can be explained by interannual changes in host diet and availability of prey harboring infective stages. The population density and gregarious behavior (schooling behavior) of C. sexfasciatus may be a better explanation for the annual variation observed in the three species of ectoparasites. Fish that form large schools facilitate ectoparasite transmission, particularly parasites with a direct transmission cycle such as monogeneans and copepods. Dispersion pattern The DI values indicated that at least 31% of the species of parasites exhibited aggregate dispersion in one or more of the sampling years (Table 1). Aggregation is considered a typical dispersion pattern of parasites in marine fish. However, the widely variable aggregation levels of five helminth species (the monogeneans N. pacifica and Pr. manteri; the digeneans B. varicus and Ectenurus virgulus; and the nematode Anisakis sp.) suggest the existence of differences in host exposure rates to parasites. Differing exposure rates could be due to the influence of local environmental factors, or the differences in host feeding behavior revealed in the diet analysis. In contrast, some contact-transmitted parasites such as monogeneans, exhibit high host specificity and can be more abundant in larger fish that form schools, like C. sexfasciatus. Some studies also suggest that DI values can be influenced by sample size, but there was no positive correlation between DI values and sample sizes in the present analysis. Component communities The parasite communities in C. sexfasciatus exhibited similar patterns at the component and infracommunity levels: low species numbers (2.22-2.96 species on average per host), low species diversity, and dominance by a single species (the monogenean Pr. manteri, Table 2). Species richness at the component level (8-25 species, Table 2) is similar to that reported previously in other Caranx species in the Americas, such as C. hippos (19 species), C. latus (17 species), and C. caballus (18 species). However, overall parasite fauna of C. sexfasciatus included 32 species across the four sampling years. The broad geographical distribution of C. sexfasciatus may explain this greater overall richness since hosts with a broad geographical distribution are exposed to large numbers of parasite species by interaction with myriad intermediate host species throughout their distribution range. Species composition similarity between the parasite communities ( Fig. 2) was considered generally low at both levels (qualitative and quantitative levels: <65%), compared to the similarity recorded for parasite communities of other marine fish examined on the Mexican Pacific coast, such as Caranx caballus 78.5%, Oligoplites altus 85%, or Parapsettus panamensis 76%. This low similarity can be attributed to the fact that 47% (15 species: six ectoparasites and nine endoparasites) of the identified parasite species occurred only in one or two sampling years (Table 1). This suggests that annual variations in biotic (e.g. diet, body size, availability of larva-infected prey) and/or abiotic environmental factors, may have been responsible for the low similarity between the parasite communities of C. sexfasciatus observed in the present study. Infracommunities Several biotic and abiotic factors are known to strongly influence species richness and diversity in the parasite communities of marine fish over time. The PCA results (Fig. 3) indicated that infracommunity species richness and diversity depended heavily on the occurrence of a distinctive set of component species (both ectoand endoparasite species). However, these component species' frequency or abundance varied between sampling years (Table 1). Temporal variations in parasite infracommunity structure and species composition have been attributed to variations in the prevalence and/or abundance of some dominant taxa. As the ICI results suggest, the ectoparasites N. pacifica, Pr. manteri, and Ca. robustus play an important role in structuring the parasite infracommunities of C. sexfasciatus. Due to ease of transmission through direct contact, ectoparasite populations contribute substantially to the structuring of infracommunities in gregarious fish such as carangids. Fluctuations in the infection levels of some endoparasite species (e.g. B. varicus and the Tetraphyllidean cestode) can be attributed mainly to changes in C. sexfasciatus diet or foraging habitat, both between sampling years and climatic seasons (dry/rainy). Host body size was an important predictor of the total parasite load, as suggest by the global positive correlation (r = 0.633) recorded for this variable in the PCA (Table 3). In marine fish, body size has proved to be the main predictor of total parasite abundance. A large body size can facilitate parasite colonization, since larger individuals tend to ingest greater quantities of food and are older and thus have had more time to accumulate parasites than smaller individuals. However, the negative correlations registered between host body size and species richness and diversity parameters suggest that the richest and most diverse parasite infracommunities were recorded in smaller rather than larger fish. Ontogenic changes in the feeding habits of C. sexfasciatus can explain the broad dietary diversity in smaller fish (for example, October 2016 and November 2018 samples, Table 2). This would in turn raise infracommunity species richness and diversity in these individuals (Table 2), as indicated in the diet analysis. Parasites are known to be useful as biological tags in distinguishing between fish stocks of the same species, but the parasite fauna method has rarely been used to quantify possible variations in community structure and species composition over time. The discriminant analysis results (Table 4) indicated that the high variation in the infection levels of at least five parasite species (the monogeneans N. pacifica and Pr. manteri; the digenean E. virgulus; and the copepods Ca. alalongae and L. ilishae) may generate substantial changes in the parasite community structure of C. sexfasciatus over time. In other words, even though community species composition remains relatively stable, its structure may be less predictable. Overall, the parasite communities of C. sexfasciatus were characterized by high numerical dominance of ectoparasites, mainly monogenean species. Community structure and species composition varied between sampling years and climatic seasons. Despite occurrence of a distinctive set of host-specialist parasites (monogenean species), similarity between the component parasite communities was generally low. Seasonal or local variations in some biotic (e.g. feeding behavior, body size, and infected prey availability) and abiotic environmental factors are possible sources of the observed interannual variations in C. sexfasciatus parasite community structure and species composition. Acknowledgements. The authors thank the fishermen who caught the fish at each sampling date, as well as the students of the Marine Ecology Academic Unit (UAGro) for their assistance with field and laboratory work. Four anonymous reviewers provided useful comments that substantially improved this manuscript. |
IT HAS been a year to remember for Andy Murray. In July the Scot won Wimbledon for the second time, marking his third major championship in total. The next month, he became the first tennis player in history to win two Olympic gold medals in the singles tournament, after defending his title from the London games of 2012 in Rio de Janeiro. And on November 7th he claimed the top spot in the official men’s rankings as measured by the Association of Tennis Professionals (ATP)—the first time that he has done so, some seven years after he first clawed his way into second place. Mr Murray’s rise followed his victory at last week’s Paris Masters event. Novak Djokovic, who had been sitting atop the table since July 2014, endured his fourth consecutive tournament without a trophy, ensuring his demotion.
Mr Murray’s newfound lofty perch represents long-overdue recognition for a player who was already building a stealthy legacy as an all-time great. He is only the 26th man to hold the top slot since the system was introduced in 1973, and the first from Great Britain. In a sport played across six continents, on a variety of surfaces, with differing tournament sizes and formats, the ATP rankings are the one yardstick that players and fans have generally agreed upon to determine the best player in the game.
Get our daily newsletter Upgrade your inbox and get our Daily Dispatch and Editor's Picks.
Other unofficial indicators support the claim that Mr Murray is at the top of his profession. His record since mid-June has been formidable: he has lost just three matches and won seven titles. And betting markets regard him as the favourite to add to this collection at next week’s season-ending World Tour Finals in London, even though he faces more difficult preliminary-round competition than Mr Djokovic does.
But Mr Murray’s journey to the apex of the rankings has also exposed some of the flaws in the official system. The ATP awards points exclusively on the basis of the importance of a tournament and the round each player reaches. Grand Slams count for twice as much as the next tier of events, the Masters series, and winning a competition is worth two-thirds more than losing in the final. This method suffers (at least) one major weakness: it fails to account for the strength of a player’s opponents, which can vary widely over short time periods. And Mr Murray’s hot streak has coincided with a stretch of very soft competition: he has not faced a single rival from the official top five since June, when he lost the final of the French Open to Mr Djokovic. In total, the Serb has won three of their four meetings this year.
Fortunately, there is an alternative rating system available, which does factor in quality of opposition. It’s called Elo, in honour of its inventor, the Hungarian physicist Arpad Elo. Originally designed to measure the ability of chess players, it requires nothing more than a record of each competitor’s wins and losses to calculate, and has become a standard method for assessing the strength of teams or players in various sports.
Elo works by exchanging points between opponents after a contest. If you beat a much stronger rival, you take a large number of his ranking points, causing him to move down the rankings as you climb them; if you win against a weaker player, you take only a small portion of his points. As an example, Mr Djokovic gained just 0.3 Elo points for beating the low-ranked Frenchman Adrian Mannarino in the second round at Wimbledon this year—but lost 16 points to Sam Querrey when the American 28th seed beat him in the third round. The number of points swapped depends both on contestants’ Elo ratings before a match and on a parameter, derived from historical data, that measures how fast the model should adjust its estimate of a player’s strength based on new information. In tennis, this figure is fairly low, suggesting that abrupt changes in a player’s ability are rare (excluding the effect of injuries). As a result, it takes a large number of disappointing match results for Elo to conclude that a once-outstanding champion has become an underdog.
Elo ratings have proven to be better forecasters than the ATP’s. During the past 15 years, it has correctly picked the winner in 68.2% of matches, compared with 66.4% for the official rankings. And when the two systems have disagreed on who the favourite should be, Elo’s picks have prevailed 55% of the time.
Compared with the ATP rankings, Elo is both far less impressed with Mr Murray’s string of victories—he did not face a single player from inside the ATP’s top ten during his run to the title last week in Paris—and far less concerned by Mr Djokovic’s slump. Since his victory at the French Open, Mr Djokovic has triumphed in just one of six tournaments, a miserable run for a player of his ilk, and has suffered a number of upset losses. Meanwhile, Mr Murray has done his part to chip away at Mr Djokovic’s lead. But a five-month barren patch for a player who has won 12 grand slams, coinciding with a hot streak for one who has collected three, has not convinced the Elo algorithm that the two have traded places. In that time, each man has lost to Juan Martín del Potro, a hard-hitting Argentine, and to Marin Cilic, a Croat with a booming serve. Mr Djokovic was also on the receiving end of an inspired performance by Swiss slugger Stanislas Wawrinka in the final of the US Open in September.
As a result, the current Elo ratings still consider Mr Djokovic to be the world’s best player, and by a decent margin: they have him beating Mr Murray 63% of the time. That is a far cry from his advantage in March, when Mr Djokovic reached the highest score of anybody in the modern era, and would have been an 81% favourite against Mr Murray. But the magnitude of his edge even after such a decline simply confirms how stratospheric the heights that Mr Djokovic reached were when he was playing his absolute best. Despite the rough patch for Mr Djokovic, Elo still believes that the chasm between him and Mr Murray is larger than the gap between the Scot and the ageing Roger Federer, in third place. It pegs Mr Murray as a modest 60-40 favourite over the Swiss champion.
The imminent ATP World Tour Finals, which begin on November 13th, could help clarify the standings at the top. Mr Federer will miss the tournament due to injury. But with a round-robin format and a field of eight elite competitors, Mr Murray will play at least three matches against formidable opposition, giving him the chance to accumulate more high-quality victories. Mr Djokovic could simultaneously find himself struggling against players he once thrashed. It will take more instances of both to prove that the old king is dead, and that a new one has dethroned him. |
/**
* Encrypt one block, key schedule must be already processed
* @param data ... data array to be encrypted
* @param dataOffset ... start offset in data array
* @param aesRoundKeys ... scheduled keys for AES (from RoundKeysSchedule() function)
* @return true if encrypt success, false otherwise.
*/
public boolean AESEncryptBlock(byte data[], short dataOffset, byte[] aesRoundKeys) {
byte r;
byte i;
short keysOffset = 0;
for (i = 0; i < STATELEN; i++) data[(short) (i + dataOffset)] ^= aesRoundKeys[i];
for(r = 1; r < N_ROUNDS; r++) {
keysOffset += STATELEN;
for (i = 0; i < STATELEN; i++) data[(short) (i + dataOffset)] = SBox[((data[(short) (i + dataOffset)] >= 0) ? data[(short) (i + dataOffset)] : (short) (256 + data[(short) (i + dataOffset)]))] ;
ShiftRow(data, dataOffset, (byte) 0);
MixColumn(data, dataOffset);
for (i = 0; i < STATELEN; i++) data[(short) (i + dataOffset)] ^= aesRoundKeys[(short) (i + keysOffset)];
}
for (i = 0; i < STATELEN; i++) data[(short) (i + dataOffset)] = SBox[((data[(short) (i + dataOffset)] >= 0) ? data[(short) (i + dataOffset)] : (short) (256 + data[(short) (i + dataOffset)]))] ;
ShiftRow(data, dataOffset, (byte) 0);
keysOffset += STATELEN;
for (i = 0; i < STATELEN; i++) data[(short) (i + dataOffset)] ^= aesRoundKeys[(short) (i + keysOffset)];
return true;
} |
// <NAME> @ 2019
#include "CubeActor.h"
#include "UObject/ConstructorHelpers.h"
#include "Runtime/Engine/Classes/Engine/StaticMesh.h"
#include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
ACubeActor::ACubeActor() : Super()
{
FString CubeMeshPath = "StaticMesh'/Engine/BasicShapes/Cube.Cube'";
ConstructorHelpers::FObjectFinder<UStaticMesh> MeshObjFinder(*CubeMeshPath);
this->GetStaticMeshComponent()->SetStaticMesh(MeshObjFinder.Object);
}
|
Quality Improvement in a College of Engineering Instructional Program This paper summarizes one institution's efforts to develop an ongoing strategy for gathering and analyzing data from constituents for use in appraisal and improvement efforts in its instructional programs. Although a large number of different constituents were identified, for logistical reasons it was decided to focus on five groups: undergraduate students, graduate students, faculty, alumni and industry. The primary emphasis of this paper is on the results from the alumni and industry surveys. Demographics of these two groups are given and the influence of these characteristics on responses to survey questions is noted. Comparisons drawn among the two groups show that alumni and industry responses are virtually identical on the importance of specific attributes associated with newly graduated engineers. A short discussion is also given which compares the responses of all five constituent groups on certain instructional program attributes. |
#include <stdexcept>
#include <sstream>
#include "coordConv/mathUtils.h"
#include "coordConv/coordSys.h"
namespace coordConv {
NoneCoordSys::NoneCoordSys(double date)
:
OtherCoordSys("none", date)
{};
CoordSys::Ptr NoneCoordSys::clone() const {
return clone(getDate());
}
CoordSys::Ptr NoneCoordSys::clone(double date) const {
return CoordSys::Ptr(new NoneCoordSys(date));
};
std::string NoneCoordSys::__repr__() const {
return std::string("NoneCoordSys()");
}
}
|
The Application of a Rodent-Based Morris Water Maze (MWM) Protocol to an Investigation of Age-Related Differences in Human Spatial Learning The current study applied a rodent-based Morris water maze (MWM) protocol to an investigation of search performance differences between young and older adult humans. To investigate whether similar age-related decline in search performance could be seen in humans based on the rodent-based protocol, we implemented a virtual MWM (vMWM) that has characteristics similar to those of the MWM used in previous studies of spatial learning in mice. Through the use of a proximity to platform measure, robust differences were found between healthy young and older adults in search performance. After dividing older adults into good and poor performers based on a median split of their corrected cumulative proximity values, the age effects in place learning were found to be largely related to search performance differences between the young and poor-performing older adults. When compared with the young, poor-performing older adults exhibited significantly higher proximity values in 83% of 24 place trials and overall in the probe trials that assessed spatial learning in the absence of the hidden platform. In contrast, good-performing older adults exhibited patterns of search performance that were comparable with that of the younger adults in most place and probe trials. Taken together, our findings suggest that the low search accuracy in poor-performing older adults stemmed from potential differences in strategy selection, differences in assumptions or expectations of task demands, as well as possible underlying functional and/or structural changes in the brain regions involved in vMWM search performance. |
System identification of the human vestibulo-ocular reflex during head-free tracking. A method was developed to identify the linear, system level dynamics of the horizontal, angular vestibulo-ocular reflex (VOR) as it stabilized vision during head-free tracking of a visual target. Small amplitude, broad spectrum, stochastic torque perturbations were applied to the head while the subject tracked an unpredictable, moving target with active head and eye motions. Stochastic system identification techniques were used to design the torque and target inputs and to conduct the analysis such that the linear dynamics of the VOR, independently of the visual system's influence on eye motions, were determined. The linear analysis was limited to evaluating VOR dynamics from approximately 0.5 to 4.5 Hz. Nonlinearities in the head-neck system affected the low frequency response of the head to the torque perturbations, and the eye velocity sequence was affected by nonlinearities and degraded by noise at high frequencies. The VOR's gain was near 1.0 between about 0.5 and 2.5 Hz, and then decreased steadily to 0.85 as the frequency increased towards 4.0 Hz. The VOR phase angle was also frequency dependent and corresponded to VOR eye motions lagging the head's disturbance motion by less than 10 ms at frequencies greater than 1.0 Hz. |
<filename>projects/gloo/pkg/api/v1/enterprise/options/graphql/v1alpha1/graphql.pb.clone.go
// Code generated by protoc-gen-ext. DO NOT EDIT.
// source: github.com/solo-io/gloo/projects/gloo/api/v1/enterprise/options/graphql/v1alpha1/graphql.proto
package v1alpha1
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"strings"
"github.com/solo-io/protoc-gen-ext/pkg/clone"
"google.golang.org/protobuf/proto"
github_com_golang_protobuf_ptypes_struct "github.com/golang/protobuf/ptypes/struct"
github_com_golang_protobuf_ptypes_wrappers "github.com/golang/protobuf/ptypes/wrappers"
github_com_solo_io_solo_kit_pkg_api_v1_resources_core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
)
// ensure the imports are used
var (
_ = errors.New("")
_ = fmt.Print
_ = binary.LittleEndian
_ = bytes.Compare
_ = strings.Compare
_ = clone.Cloner(nil)
_ = proto.Message(nil)
)
// Clone function
func (m *RequestTemplate) Clone() proto.Message {
var target *RequestTemplate
if m == nil {
return target
}
target = &RequestTemplate{}
if m.GetHeaders() != nil {
target.Headers = make(map[string]string, len(m.GetHeaders()))
for k, v := range m.GetHeaders() {
target.Headers[k] = v
}
}
if m.GetQueryParams() != nil {
target.QueryParams = make(map[string]string, len(m.GetQueryParams()))
for k, v := range m.GetQueryParams() {
target.QueryParams[k] = v
}
}
if h, ok := interface{}(m.GetBody()).(clone.Cloner); ok {
target.Body = h.Clone().(*github_com_golang_protobuf_ptypes_struct.Value)
} else {
target.Body = proto.Clone(m.GetBody()).(*github_com_golang_protobuf_ptypes_struct.Value)
}
return target
}
// Clone function
func (m *ResponseTemplate) Clone() proto.Message {
var target *ResponseTemplate
if m == nil {
return target
}
target = &ResponseTemplate{}
target.ResultRoot = m.GetResultRoot()
if m.GetSetters() != nil {
target.Setters = make(map[string]string, len(m.GetSetters()))
for k, v := range m.GetSetters() {
target.Setters[k] = v
}
}
return target
}
// Clone function
func (m *GrpcRequestTemplate) Clone() proto.Message {
var target *GrpcRequestTemplate
if m == nil {
return target
}
target = &GrpcRequestTemplate{}
if h, ok := interface{}(m.GetOutgoingMessageJson()).(clone.Cloner); ok {
target.OutgoingMessageJson = h.Clone().(*github_com_golang_protobuf_ptypes_struct.Value)
} else {
target.OutgoingMessageJson = proto.Clone(m.GetOutgoingMessageJson()).(*github_com_golang_protobuf_ptypes_struct.Value)
}
target.ServiceName = m.GetServiceName()
target.MethodName = m.GetMethodName()
if m.GetRequestMetadata() != nil {
target.RequestMetadata = make(map[string]string, len(m.GetRequestMetadata()))
for k, v := range m.GetRequestMetadata() {
target.RequestMetadata[k] = v
}
}
return target
}
// Clone function
func (m *RESTResolver) Clone() proto.Message {
var target *RESTResolver
if m == nil {
return target
}
target = &RESTResolver{}
if h, ok := interface{}(m.GetUpstreamRef()).(clone.Cloner); ok {
target.UpstreamRef = h.Clone().(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.ResourceRef)
} else {
target.UpstreamRef = proto.Clone(m.GetUpstreamRef()).(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.ResourceRef)
}
if h, ok := interface{}(m.GetRequest()).(clone.Cloner); ok {
target.Request = h.Clone().(*RequestTemplate)
} else {
target.Request = proto.Clone(m.GetRequest()).(*RequestTemplate)
}
if h, ok := interface{}(m.GetResponse()).(clone.Cloner); ok {
target.Response = h.Clone().(*ResponseTemplate)
} else {
target.Response = proto.Clone(m.GetResponse()).(*ResponseTemplate)
}
target.SpanName = m.GetSpanName()
return target
}
// Clone function
func (m *GrpcDescriptorRegistry) Clone() proto.Message {
var target *GrpcDescriptorRegistry
if m == nil {
return target
}
target = &GrpcDescriptorRegistry{}
switch m.DescriptorSet.(type) {
case *GrpcDescriptorRegistry_ProtoDescriptor:
target.DescriptorSet = &GrpcDescriptorRegistry_ProtoDescriptor{
ProtoDescriptor: m.GetProtoDescriptor(),
}
case *GrpcDescriptorRegistry_ProtoDescriptorBin:
if m.GetProtoDescriptorBin() != nil {
newArr := make([]byte, len(m.GetProtoDescriptorBin()))
copy(newArr, m.GetProtoDescriptorBin())
target.DescriptorSet = &GrpcDescriptorRegistry_ProtoDescriptorBin{
ProtoDescriptorBin: newArr,
}
} else {
target.DescriptorSet = &GrpcDescriptorRegistry_ProtoDescriptorBin{
ProtoDescriptorBin: nil,
}
}
}
return target
}
// Clone function
func (m *GrpcResolver) Clone() proto.Message {
var target *GrpcResolver
if m == nil {
return target
}
target = &GrpcResolver{}
if h, ok := interface{}(m.GetUpstreamRef()).(clone.Cloner); ok {
target.UpstreamRef = h.Clone().(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.ResourceRef)
} else {
target.UpstreamRef = proto.Clone(m.GetUpstreamRef()).(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.ResourceRef)
}
if h, ok := interface{}(m.GetRequestTransform()).(clone.Cloner); ok {
target.RequestTransform = h.Clone().(*GrpcRequestTemplate)
} else {
target.RequestTransform = proto.Clone(m.GetRequestTransform()).(*GrpcRequestTemplate)
}
target.SpanName = m.GetSpanName()
return target
}
// Clone function
func (m *Resolution) Clone() proto.Message {
var target *Resolution
if m == nil {
return target
}
target = &Resolution{}
if h, ok := interface{}(m.GetStatPrefix()).(clone.Cloner); ok {
target.StatPrefix = h.Clone().(*github_com_golang_protobuf_ptypes_wrappers.StringValue)
} else {
target.StatPrefix = proto.Clone(m.GetStatPrefix()).(*github_com_golang_protobuf_ptypes_wrappers.StringValue)
}
switch m.Resolver.(type) {
case *Resolution_RestResolver:
if h, ok := interface{}(m.GetRestResolver()).(clone.Cloner); ok {
target.Resolver = &Resolution_RestResolver{
RestResolver: h.Clone().(*RESTResolver),
}
} else {
target.Resolver = &Resolution_RestResolver{
RestResolver: proto.Clone(m.GetRestResolver()).(*RESTResolver),
}
}
case *Resolution_GrpcResolver:
if h, ok := interface{}(m.GetGrpcResolver()).(clone.Cloner); ok {
target.Resolver = &Resolution_GrpcResolver{
GrpcResolver: h.Clone().(*GrpcResolver),
}
} else {
target.Resolver = &Resolution_GrpcResolver{
GrpcResolver: proto.Clone(m.GetGrpcResolver()).(*GrpcResolver),
}
}
}
return target
}
// Clone function
func (m *GraphQLSchema) Clone() proto.Message {
var target *GraphQLSchema
if m == nil {
return target
}
target = &GraphQLSchema{}
if h, ok := interface{}(m.GetNamespacedStatuses()).(clone.Cloner); ok {
target.NamespacedStatuses = h.Clone().(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.NamespacedStatuses)
} else {
target.NamespacedStatuses = proto.Clone(m.GetNamespacedStatuses()).(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.NamespacedStatuses)
}
if h, ok := interface{}(m.GetMetadata()).(clone.Cloner); ok {
target.Metadata = h.Clone().(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.Metadata)
} else {
target.Metadata = proto.Clone(m.GetMetadata()).(*github_com_solo_io_solo_kit_pkg_api_v1_resources_core.Metadata)
}
if h, ok := interface{}(m.GetExecutableSchema()).(clone.Cloner); ok {
target.ExecutableSchema = h.Clone().(*ExecutableSchema)
} else {
target.ExecutableSchema = proto.Clone(m.GetExecutableSchema()).(*ExecutableSchema)
}
if h, ok := interface{}(m.GetStatPrefix()).(clone.Cloner); ok {
target.StatPrefix = h.Clone().(*github_com_golang_protobuf_ptypes_wrappers.StringValue)
} else {
target.StatPrefix = proto.Clone(m.GetStatPrefix()).(*github_com_golang_protobuf_ptypes_wrappers.StringValue)
}
return target
}
// Clone function
func (m *ExecutableSchema) Clone() proto.Message {
var target *ExecutableSchema
if m == nil {
return target
}
target = &ExecutableSchema{}
target.SchemaDefinition = m.GetSchemaDefinition()
if h, ok := interface{}(m.GetExecutor()).(clone.Cloner); ok {
target.Executor = h.Clone().(*Executor)
} else {
target.Executor = proto.Clone(m.GetExecutor()).(*Executor)
}
if h, ok := interface{}(m.GetGrpcDescriptorRegistry()).(clone.Cloner); ok {
target.GrpcDescriptorRegistry = h.Clone().(*GrpcDescriptorRegistry)
} else {
target.GrpcDescriptorRegistry = proto.Clone(m.GetGrpcDescriptorRegistry()).(*GrpcDescriptorRegistry)
}
return target
}
// Clone function
func (m *Executor) Clone() proto.Message {
var target *Executor
if m == nil {
return target
}
target = &Executor{}
switch m.Executor.(type) {
case *Executor_Local_:
if h, ok := interface{}(m.GetLocal()).(clone.Cloner); ok {
target.Executor = &Executor_Local_{
Local: h.Clone().(*Executor_Local),
}
} else {
target.Executor = &Executor_Local_{
Local: proto.Clone(m.GetLocal()).(*Executor_Local),
}
}
}
return target
}
// Clone function
func (m *Executor_Local) Clone() proto.Message {
var target *Executor_Local
if m == nil {
return target
}
target = &Executor_Local{}
if m.GetResolutions() != nil {
target.Resolutions = make(map[string]*Resolution, len(m.GetResolutions()))
for k, v := range m.GetResolutions() {
if h, ok := interface{}(v).(clone.Cloner); ok {
target.Resolutions[k] = h.Clone().(*Resolution)
} else {
target.Resolutions[k] = proto.Clone(v).(*Resolution)
}
}
}
target.EnableIntrospection = m.GetEnableIntrospection()
return target
}
|
package be.kuleuven.ses.facade;// Add other animals - see README.md
public class Main {
public static void main(String[] args) {
new Zoo().attend();
}
}
|
<gh_stars>1-10
import { BoxWithText } from '../classes/BoxWithText';
import { ObjectDetection } from '../classes/ObjectDetection';
import { PredictedBox } from '../classes/PredictedBox';
import { Rect } from '../classes/Rect';
import { env } from '../env';
import { round } from '../utils';
import { drawBox } from './drawBox';
import { drawText } from './drawText';
import { getContext2dOrThrow } from './getContext2dOrThrow';
import { getDefaultDrawOptions } from './getDefaultDrawOptions';
import { resolveInput } from './resolveInput';
import { DrawDetectionOptions } from './types';
export function drawDetection(
canvasArg: string | HTMLCanvasElement,
detection: Rect | PredictedBox | ObjectDetection | BoxWithText | Array<Rect | PredictedBox | ObjectDetection | BoxWithText>,
options?: DrawDetectionOptions
) {
const { Canvas } = env.getEnv()
const canvas = resolveInput(canvasArg)
if (!(canvas instanceof Canvas)) {
throw new Error('drawDetection - expected canvas to be of type: HTMLCanvasElement')
}
const detectionArray = Array.isArray(detection)
? detection
: [detection]
detectionArray.forEach((det) => {
const {
x,
y,
width,
height
} = det instanceof ObjectDetection ? det.box : det
const drawOptions = getDefaultDrawOptions(options)
const ctx = getContext2dOrThrow(canvas)
drawBox(
ctx,
x,
y,
width,
height,
drawOptions
)
const { withScore } = drawOptions
let text = det instanceof BoxWithText
? det.text
: ((withScore && det instanceof PredictedBox)
? `${round(det.score)}`
: (det instanceof ObjectDetection
? `${det.className}${withScore ? ` (${round(det.score)})` : ''}`
: ''
)
)
if (text) {
drawText(ctx, x, y + height, text, drawOptions)
}
})
} |
With the Florida Gators now having hired the 24th head football coach in program history, Jim McElwain, OnlyGators.com remains here to keep you up to date with the latest news, notes, quotes – and yes, probably some rumors – as McElwain looks to fill out his coaching staff.
Story: Florida resolves buyout issue, announces Jim McElwain as coach
Primer: Get to know new Gators coach Jim McElwain
Breakdown: The odds and ends of Florida signing Jim McElwain
Press conference: Jim McElwain introduced as Gators head coach
Bookmark this page (Ctrl+D on PCs, Command+D on Macs) and check in daily for all the latest as Florida works through the process of replacing Will Muschamp.
Be sure to click through to links provided below to read the reports cited in each blurb.
» Tuesday, December 16 «
12:50 p.m. – According to Rivals.com‘s Mike Farrell ($), Gators defensive backs coach Travaris Robinson has an offer to stay at Florida and is inclined to remain with the program, though he is waiting to meet with new defensive coordinator Geoff Collins before making a commitment.
Sunday, December 14
8:40 p.m. – According to 247Sports.com‘s Texas A&M affiliate, head coach Kevin Sumlin has reached out to Florida defensive coordinator D.J. Durkin about taking the same position on his staff. Similarly, Scout.com‘s North Carolina affiliate reports that Durkin and UNC head coach Larry Fedora met on Sunday about his team’s opening at defensive coordinator. Durkin, who is also serving as the interim head coach for the Gators’ bowl game, has not yet been offered the position per the report. It should be noted that new Florida coach Jim McElwain is expected to strongly consider Durkin for his defensive coordinator position, and he would have little reason to leave UF for a lateral job if that ends up being the case. In fact, one report released soon after McElwain’s hiring indicated that he had already agreed to retain Durkin on his initial Gators coaching staff.
8:30 p.m. – Gators defensive backs coach Travaris Robinson has remained on the recruiting trail with new head coach Jim McElwain as rumors continue to swirl about Robinson joining Will Muschamp at Auburn for the 2015 season. SEC Network analyst Booger McFarland, who would know a thing or two about Robinson (see below), recently recanted his stance that his former teammate would remain at Florida next season, noting that Muschamp put a full-court press on Robinson on Saturday night and convinced him to return to coach the Tigers. It has become obvious that McElwain wants Robinson to remain on staff, but Auburn’s ability to match or exceed Robinson’s salary at UF, coupled with the pull of returning to his alma mater and continuing to coach under Muschamp, may be too much for the Gators to overcome.
No matter what Robinson decides, it may not be known publicly until after Florida’s bowl game as he is under contract with the Gators until that point. Then again, it is questionable as to why McElwain would bring him on the recruiting trail to tell prospects he is staying at Florida if he did not have some indication that a return was probable.
» Saturday, December 13 «
12:45 a.m. – Refuting reports that Florida defensive backs coach Travaris Robinson is “expected” to join Will Muschamp at Auburn is SEC Network analyst Booger McFarland, who (for the second time in as many days) has tweeted that Robinson plans to remain with the Gators. “T Rob is staying at Florida even though Muschamp is the new DC at Auburn #gators He loves being in Florida,” McFarland wrote on his Twitter account late Friday night. But how exactly would McFarland, an analyst and not a news reporter, know this to be the case? Robinson is likely telling him personally. The two were teammates on the Tampa Bay Buccaneers and played on the same side of the ball, with Robinson a defensive back and McFarland a defensive tackle, so chances are they are either friends or acquaintances. And despite the fact that Robinson is an renowned Auburn player, he is a Miami, Florida, native who grew up in the Sunshine State.
» Friday, December 12 «
10:45 p.m. – Will Muschamp has officially been announced as Auburn’s new defensive coordinator. He will earn a salary of $1.6 million, making him the highest-paid coordinator in the country, according to AL.com. A press conference has been scheduled for 10:30 a.m. in Auburn, Alabama.
9:45 p.m. – According to Phillip Marshall of 247Sports.com ($), former Florida head coach Will Muschamp is “on the verge” of being named Auburn’s next defensive coordinator after withdrawing his name from Houston’s head coaching search, “barring any last-minute snags.” Marshall further reports that Gators defensive backs coach Travaris Robinson is “expected” to join Muschamp with the Tigers. If the report comes to fruition, Muschamp would be in his third stint at Auburn (second as defensive coordinator) and Robinson would be returning to his alma mater. (See 3:30 p.m. for more on Robinson, who has certainly not been acting like he was planning to leave.) SI.com‘s Thayer Evans and ESPN.com‘s Brett McMurphy confirm the report.
3:30 p.m. – In a tweet sent Thursday and missed by OnlyGators.com, SEC Network analyst Booger McFarland claimed on Twitter that Florida head coach Jim McElwain has decided to retain defensive backs coach Travaris Robinson. “Great move by coach Mcelwain keeping T-Rob on his staff might be the #gators best recruiter huge win that will likely go unnoticed,” he wrote. Asked by a follower who was reporting this development, McFarland replied, “from me i have my sources.” Pictures of McElwain and Robinson recruiting together have surfaced on Twitter since Monday, though there has been no official word from McElwain on any coaches he is retaining or letting go. Robinson’s status at Florida also must remain in question until Will Muschamp takes a job, especially if Muschamp chooses to take over as Auburn’s defensive coordinator. It would be difficult for most schools to match Robinson’s $510,000 salary with the Gators without making him a defensive coordinator, and even then, it would need to be at a larger program with a budget large enough to pay him a similar salary (such as Auburn). Robinson has also, reportedly, told multiple recruits that he would be staying at Florida next season.
1:00 p.m. – A source tells Joseph Duarte of the Houston Chronicle that former Gators head coach Will Muschamp has already interviewed for the same job with the Houston Cougars. Muschamp is believed to be a top candidate for defensive coordinator positions at Auburn, South Carolina and Texas A&M. As OnlyGators.com noted on Dec. 3, it is no surprise that Muschamp is getting the opportunity to interview – and potentially being offered – lower-rung head coaching opportunities. Muschamp would also be a great hire for Houston considering his experience recruiting the state of Texas.
12:00 p.m. – A junior college offensive tackle being recruited by Florida told InsidetheGators.com‘s Blake Alderman this week ($) that Gators offensive line coach Mike Summers and head coach Jim McElwain offered him a scholarship. He also noted that McElwain said he would be retaining Summers next season, which is good news for Florida. Not only is Summers a veteran who did yeoman’s work to improve the Gators’ offensive line this season, he will be even more important in 2015 as UF is set to lose three or four starters up front. Florida also needs an offensive line coach in place to help with recruiting down the stretch as UF may be forced to rely on a number of first- and second-year players next season.
[EXPAND Click to expand and read everything else previously posted. (Please allow 30 seconds to load all of the additional content.)]
» Friday, December 5 «
1:45 p.m. – Updating the Will Muschamp item below, 247Sports.com‘s JC Shurburtt blatantly calls the report “inaccurate” with “multiple sources” at South Carolina denying it. Furthermore, Schurburtt reports that Muschamp is currently in the Dominican Republic on vacation. ESPN.com‘s Travis Haney ($) notes that Muschamp would “like to continue as a head coach somewhere” though he realizes the “defensive coordinator opportunities in front of him are better.” He does note that there is an offer from South Carolina on the table, however. “I’d say it’s more likely Muschamp would take South Carolina over [Texas A&M]. If it went well, I’m told Muschamp believes he’d be in line to replace Steve Spurrier.”
11:00 a.m. – Take it with a grain of salt right now, but… According to Scout.com, former Florida head coach Will Muschamp “will be South Carolina’s new defensive coordinator” with “the opportunity to be South Carolina’s head coach when [Steve] Spurrier retires.” Furthermore, Scout reports that Muschamp will earn $1.6-1.9 million per season and “plans to bring several of his defensive coaches from Florida.” Spurrier has already denied the report. “No, I haven’t hired Will,” he told Josh Kendall of The State. “I haven’t really talked to anybody about additions.” Furthermore, according to ESPN‘s Mark Schlabach, Muschamp is out of the country on vacation and will not make any decision until he returns.
It is worth noting that, despite the unconfirmed validity of the report, defensive line coach Brad Lawing worked at USC before leaving Spurrier for Muschamp and UF. Also, defensive backs coach Travaris Robinson was a player under Muschamp at Auburn and the two are believed to be very close. Rumors of Muschamp potentially taking a defensive coordinator job at Auburn have included Robinson returning to his alma mater. However, it is likely that Florida and new coach Jim McElwain will make a major attempt to keep Robinson, an ace recruiter who is responsible for some of the Gators’ biggest commitments over the last four years.
» Thursday, December 4 «
9:45 p.m. – Citing a source, the Orlando Sentinel‘s Edgar Thompson reports that new Florida coach Jim McElwain “does not plan to bring any members of staff at CSU with him to the Gators.” That may speak somewhat to indications that were made earlier in the week that McElwain agreed with athletic director Jeremy Foley in that it may be in the program’s best interested to retain a number of staff members, most specifically key defensive coaches and recruiters.
McElwain not bringing any of his old staff over to Florida could also benefit the Gators in another way. With UF struggling in recruiting due to its unsettled coaching situation, McElwain may be able to pull a number of coaches into the program who can recruit while the current staff is doing all of the preparation for the bowl game (under the direction of defensive coordinator D.J. Durkin, the interim coach).
10:00 a.m. – Colorado State and Florida have come to a buyout agreement and Jim McElwain will be named the next head coach of the Gators.
12:30 a.m. – Corroborating numerous reports from Tuesday and Wednesday, ESPN.com’s Brett McMurphy reported early Thursday morning that Colorado State president Tony Frank’s firm stance on not accepting less than the full $7.5 million buyout for coach Jim McElwain has completely stalled Florida’s hiring of McElwain. Furthermore, McMurphy reports that there was indeed a verbal agreement between Frank, McElwain and at least three other parties on June 6 that Frank would “reduce or eliminate the buyout if McElwain were offered a ‘once-in-a-lifetime’-type job.”
Though talks are stalled at this time, the Gators very much want McElwain to be their next head coach. However, “Florida officials are ‘pessimistic’ the deal will get done” if Frank does not negotiate terms of the buyout, unnamed sources told McMurphy. In fact, as The Gainesville Sun’s Robbie Andreu first reported late Wednesday (see below), athletic director Jeremy Foley made his final decision to fly to Fort Collins, Colorado, on Tuesday because he was “under the impression that there were provisions in McElwain’s contract that would allow him to leave for a lower buyout” and he was “led to believe the buyout could be reduced,” per McMurphy.
» Wednesday, December 3 «
9:00 p.m. – The Gainesville Sun‘s Robbie Andreu dropped a couple important nuggets of information Wednesday night. According to Andreu, Colorado State officials explicitly told Florida that the $7.5 million buyout on coach Jim McElwain‘s contract was negotiable “before [athletic director Jeremy] Foley and other members of his UAA staff flew” out to Fort Collins, Colorado, on Tuesday. Furthermore, “negotiations to possibly lower the buyout are ongoing between McElwain, his attorney and Colorado State president Tony Frank” with a compromise possible “at any time.”
8:30 p.m. – After returning to Gainesville, Florida, early Wednesday evening, the booster jet carrying the Gators’ contingent was first flown to Jacksonville, Florida, and then returned to its owner. Florida, hoping to avoid the tracking of the private jets it actually owns, has since taken a step to make both planes untrackable going forward. As pointed out by The Independent Florida Alligator‘s Richard Johnson, public tracking of the private jets was turned off by the popular website FlightAware.com “per request of the owner/operator.”
6:00 p.m. – Beat writers in Gainesville, Florida, were onsite at the airport when Gators athletic director Jeremy Foley landed in a private jet. According to the Associated Press‘ Mark Long, Foley only had a few words for the gathered masses about the coaching search. “We gave you what we gave you. that’s the end of the conversation. There’s nothing else to report,” said Foley, referring to the one-sentence tweet the program’s account sent out earlier Wednesday (see below). “We had a great conversation. We’re not there yet. Might have something more tonight.”
It is certainly interesting that Foley threw in “might have something more tonight,” almost insinuating that Florida has indeed zeroed-in McElwain and it is just a matter of time before a deal is made official. Whether that comes to fruition Wednesday night, Thursday or not at all obviously remains to be seen as this search continues.
4:55 p.m. – A source has told the Orlando Sentinel‘s Edgar Thompson that “CSU has not budged an inch on the buyout,” referring to the $7.5 million due the school if Jim McElwain is to take another job. Furthermore, Thompson reports that “CSU officials who once thought McElwain was on his way UF are unsure whether he will in fact take over as the Gators’ next coach.” 6:15 p.m. – Yahoo! Sports released a report confirming Thompson’s information that CSU will not move on the $7.5 million buyout.
4:50 p.m. – Contrary to a report that Jim McElwain had informed Colorado State’s players and staff that he was leaving to become Florida’s head coach, numerous Rams players have come out on Twitter to note that has not been the case. “People, STOP believing all these STUPID reports that we’ve been called into a team meeting,” wrote Garrett Grayson, CSU’s star quarterback and the Mountain West’s Offensive Player of the Year. “Don’t u think by now a player would have tweeted something if it was true? Good lord..”
2:55 p.m. – Florida took off from Colorado – one hour ahead of schedule – without CSU’s Jim McElwain on board per media onsite at the airport. Considering the Gators publicly mentioned McElwain in a tweet, it is likely that the school has a schedule of events laid out over the next few days, which probably includes team meetings and an official announcement. No deal has been announced, though Colorado State officials fully believe that McElwain will be the next head coach at Florida, according to the Orlando Sentinel.
2:40 p.m. – Florida’s official Twitter account sent out the following somewhat-cryptic message on Wednesday afternoon: “We’ve had very productive conversations with Coach [Jim] McElwain and his wife Karen and those continue.” It is tough to draw much from that, other than to say with the Gators’ flight scheduled to leave approximately 90 minutes after the tweet was sent, one must wonder whether McElwain will be on board, even if he has agreed to terms of a deal with Florida. Perhaps the negotiations on McElwain’s $7.5 million buyout with Colorado State are holding up the hiring process – and subsequent announcement by UF – or perhaps the Gators are preparing fans for the poaching of the Rams’ head coach. It should also be noted that flight plans can be delayed and changed, so nothing is set in stone at this time. Also a consideration:
It also would make sense that Gators are giving Jim McElwain a chance to tell his team — Mark Long (@APMarkLong) December 3, 2014
2:30 p.m. – During an interview with ESPN Radio out of Nashville, Tennessee, Ole Miss athletic director Ross Bjork said the following about the Gators’ rumored interest and potential offer to the Rebels’ Hugh Freeze. “I know Florida, and I respect Jeremy Foley. He respects us. If there was interest, he would have called. That’s how we dealt with it – was just a reality-based process.” Pressed as to whether Foley did make that phone call, Bjork declined comment. “We’ll let them handle their search how they do it,” he said. “We got our guy and we’re excited about it.”
2:10 p.m. – The booster-owned private jet that University Athletic Association officials flew out to Fort Collins, Colorado, has a scheduled flight plan to return to Gainesville, Florida at 7 p.m. EST. Unlike the initial trip, the 4 p.m. EST flight will be direct from Fort Collins Regional Airport to Gainesville Regional Airport and is expected to have Colorado State’s Jim McElwain aboard alongside Florida athletic director Jeremy Foley and other UAA staffers.
1:40 p.m. – Countering the report from The Coloradoan (see below) is the Orlando Sentinel‘s Edgar Thompson, whose source said a significant reduction of the buyout is “‘not gonna happen’ and there is substantially less wiggle room in reducing the buyout than some media have implied.” Unlike The Coloradoan, the Orlando Sentinel‘s source at CSU has been spot-on during this latter part of Florida’s coaching search.
1:00 p.m. – According to The Coloradoan, the only hurdle remaining in Florida athletic director Jeremy Foley‘s pursuit of Colorado State‘s Jim McElwain is the coach’s $7.5 million buyout with the Rams, which Foley is reportedly in the process of trying to negotiate down to $3 million. “Negotiating the buyout, but it’s a done deal,” a source told the paper Wednesday morning. It should be noted that The Coloradoan has been involved in a couple of misses already on this McElwain story, so while the story certainly sounds legitimate, anything could still happen at this point.
It should also be noted that the private jet that flew University Athletic Association staff, including Foley, to Fort Collins, Colorado, does not yet have a flight plan to return back to Gainesville, Florida. It remains out of a hanger at the airport in Fort Collins, however.
12:15 a.m. – Bruce Feldman of Fox Sports reports that the Gators and the Rams’ Jim McElwain are in the process of finalizing a deal to make him Florida’s next head coach.
» Tuesday, December 2 «
11:15 p.m. – Pictured in this – yes, creepy – paparazzi photo at the home of Colorado State’s Jim McElwain are a contingent of Florida brass including athletic director Jeremy Foley (center), sports information director Steve McClain (left) and executive associate ADs Chip Howard (behind Foley) and Mike Hill (right).
UF AD Jeremy Foley at the home of CSU Rams head coach Jim McElwain presumably discussing #Gators job @TFrei #Gators pic.twitter.com/tLc6IjXKSP — John Leyba (@Presto89) December 3, 2014
10:45 p.m. – As OnlyGators.com has reported numerous times on this page, the $7.5 million buyout on the contract of Colorado State’s Jim McElwain is seen as a non-issue by Florida, which is confident it and/or McElwain can either get the buyout reduced or eliminated altogether. The Gators have also been operating under the assumption that, if necessary, they could mitigate the buyout via a variety of methods including potentially donating a sum of money to the school, paying the Rams to come to Gainesville, Florida, for a non-conference game and the like.
Tuesday night, The Coloradoan‘s Kelly Lyell confirmed that not only is there a clause in McElwain’s contract for his buyout to be reduced or scratched (as was already known). However, he also reported that CSU president Tony Frank also agreed (seemingly verbally) to “reduce if not eliminate the breakup fee if a ‘dream job’ were to come along,” per former Colorado State athletic director Jack Graham. “With Tony verbally committing to work with Mac to reduce or eliminate the breakup fee, the work we had done [to put the buyout in place] was severely compromised if not completely unwound,” Graham continued. “It created opportunities for schools like Florida, Michigan and Nebraska — all arguably ‘dream jobs’ — to go after Mac.”
It should be noted that there is a disagreement around CSU regarding whether what Graham told Lyell for his report is completely accurate. Therefore, the following is directly from McElwain’s contract (edited for clarity). The “dream job” portion would not be and is not included as Graham indicated it was a verbal understanding.
“In the case or event of extenuating circumstances the University’s President shall have the discretion, but not the obligation, to reduce in whole or in part McElwain’s obligation to pay [a buyout fee] to the University. McElwain shall have the right to request that the Parties engage in a good faith discussion of such [buyout terms] prior to McElwain providing formal notice to the University of his decision to terminate this Agreement without cause, and in such the University agrees to engage in such discussion, although the University has no obligation to reduce in whole or in part McElwain’s obligation to pay [the buyout fee], with an understanding and acknowledgement that time will be of the essence in coming to a final decision.”
8:25 p.m. – According to Fort Collins Coloradoan writer Kelly Lyell, who is at the Fort Collins airport, it looks as if Gators athletic director Jeremy Foley will be staying overnight in Colorado. “They were looking for a spot in a hanger for [the] plane with no luck,” Lyell wrote on Twitter.
4:50 p.m. – According to FootballScoop.com‘s Scott Roussel, Florida athletic director Jeremy Foley and Colorado State’s Jim McElwain have agreed “that it would be best for Florida football to retain defensive coordinator D.J. Durkin and defensive backs coach Travaris Robinson at a minimum.” It would make sense them for the Gators to also insist that defensive line coach Brad Lawing remains on staff, and perhaps at least one coach on the offensive side of the ball as well.
4:45 p.m. –
Crowd gathering at Fort Collins-Loveland airport to greet Florida AD Jeremy Foley. #CSURams #MWfb pic.twitter.com/HUqgLpGvh7 — Kelly Lyell (@KellyLyell) December 2, 2014
4:00 p.m. – The Boston Globe‘s Ben Volin asked New England Patriots offensive coordinator Josh McDaniels about rumors that he was a candidate for the Florida opening. “I really, honestly don’t have any idea about that rumor. I mean, I heard it, but I have nothing to add to it, and my focus is solely on the Chargers and getting our team ready to go this week on offense, and trying to do the best thing I can,” he said, during a teleconference with local writers. “You’re right, it’s a time of year that this happens quite a bit, and I’ve been through it before.”
2:25 p.m. – ESPN.com‘s Brett McMurphy reports that Colorado State’s Jim McElwain is now Florida’s top target to replace Will Muschamp.
1:45 p.m. – OnlyGators.com has learned that a private jet, which is believed to be owned by a Florida booster and used by the University Athletic Association, took off from Gainesville Regional Airport (Gainesville, Florida) at 12:16 p.m. EST and is en route to the Joplin Regional Airport (Joplin, Missouri). The next destination on its manifest is Fort Collins Regional Airport (Fort Collins, Colorado), which is in the home city of Colorado State University. Rams head coach Jim McElwain has been reported to be a top target of Gators athletic director Jeremy Foley. McElwain on Tuesday was named Mountain West Coach of the Year after leading CSU to a 10-2 regular-season record.
12:30 p.m. – The Orlando Sentinel‘s Edgar Thompson, citing a “person well entrenched at CSU,” noted on Twitter that the Colorado State athletic department is “extremely nervous” that Rams’ coach Jim McElwain is a prime candidate for the Gators job.
12:15 p.m. – Bleacher Report‘s Jason Cole reported Tuesday that Florida’s coaching search “does not include either Chip Kelly or Josh McDaniels,” who are the head coach of the Philadelphia Eagles and offensive coordinator of the New England Patriots, respectively. Cole adds, in what appears to be an opinion, that Florida athletic director Jeremy Foley “is not terribly interested in NFL coaches because he feels like he’s going to have to overpay.” Furthermore, he notes that Kelly’s NCAA show-cause penalty (which expires on Dec. 25) and McDaniels’s overall lack of experience (especially as it pertains to being a head coach in college) could also be deterrents.
In addition to the notes above, it should be mentioned that Foley going after an NFL coach, at least one in playoff or Super Bowl contention, would be extremely difficult to swing. In regards to a head coach, his team would need to be eliminated from the postseason before he could seriously consider making a jump; in regards to a coordinator, one would have to potentially break his contract or leave his team in the postseason, which is a lot to ask for a professional coach. Seeing as the NFL regular season does not conclude until the end of December and the NFL Playoffs run from Jan. 3 until Super Bowl XLIX on Feb. 1, a NFL head coach or coordinator interested in making the jump may not even be available to do so until days before 2015 National Signing Day. That’s not going to work.
9:00 a.m. – Ole Miss and head coach Hugh Freeze announced that they have come to terms and agreed on a four-year extension. (See below – Monday, 6:20 p.m. – for a take on Florida saying that it neither met with nor officially offered Freeze a deal.)
2:30 a.m. – The Denver Post has confirmed a report from Pat Forde of Yahoo! Sports (see below) that Florida athletic director Jeremy Foley spoke with Colorado State’s Jim McElwain over the phone Saturday night. The Post‘s Terry Frei also reached out to CSU interim athletic director John Morris, who “declined to comment” on either McElwain’s status or whether Foley had contacted Morris seeking permission to discuss the Gators’ opening with his coach.
1:45 a.m. – Confirming multiple reports from Monday, Bruce Feldman of Fox Sports noted early Tuesday morning that “Hugh Freeze is close to agreeing to a new deal” with Ole Miss and all that is left to tie up are “loose ends.” Prior reports have Freeze receiving approximately $4 million per year as part of his extension with annual pool of money made available to Freeze for his assistants also jumping up $500,000 per year.
» Monday, December 1 «
10:25 p.m. – Late Monday night, Parrish Alford of the Northeast Mississippi Daily Journal reported that Ole Miss’s Hugh Freeze has “reached a verbal agreement to sign a contract extension that will pay him at least $4 million a year” and give Freeze an additional $500,000 for which to divvy up among his assistant coaches. Prior reports stated that Florida offered Freeze the opportunity to coach the Gators at a rate of $4.2-4.3 million per season. An Oxford, Mississippi, native, Freeze was hired by Ole Miss in 2012 and led the Rebels to a 9-3 regular-season record this year.
6:20 p.m. – During a Monday appearance on 1010 XL out of Jacksonville, Florida, The Gainesville Sun‘s Pat Dooley said he spoke directly with Gators athletic director Jeremy Foley, who told Dooley that he has not met with Ole Miss’s Hugh Freeze. “Hugh Freeze has not been offered a contract, OK? Let me just tell everybody this. Jeremy Foley has never met Hugh Freeze. Don’t you think Jeremy Foley is going to meet his head coach before he gives him an offer? He’s never done it any other way. It’s just, some of the stuff that’s out there is so ludicrous. Is Hugh Freeze in the mix? Sure, he’s in the mix. But they haven’t met, and I know that for a fact because I got that directly from Jeremy.”
As with the statement Florida released earlier Monday (see below), this is semantics. Though Foley is likely telling Dooley the truth – that he has never met with Freeze – that does not preclude Foley from telling Freeze’s agent the parameters of a potential deal and having the agent float those parameters to Freeze in order to gauge the coach’s interest. If Freeze is then interested and tells his agent that he would take the job, then Foley would meet with the coach in an attempt to make it official.
Dooley also recanted a prior comment, when he said Colorado State’s Jim McElwain was not in the mix for the Gators job because of the $7.5 million buyout in his contract. Repeating what OnlyGators.com has written multiple times on this very page (Nov. 17, 2:22 p.m. & Nov. 30, 8:25 p.m.), Dooley explained how the buyout is negotiable and there are other ways of making CSU happy outside of simply cutting the school a check.
2:55 p.m. – Reports from radio and television stations will not often be found in this ticker, but this one from CBS 3 out of Philadelphia, Pennsylvania is particularly interesting. According to Marc Farzetta, who is citing a “source with direct knowledge of the situation,” Florida athletic director Jeremy Foley will “‘kick the tires'” of Eagles coach Chip Kelly “as early as Tuesday of this week” in order to ascertain his interest in the open Gators job. Philadelphia is 19-9 since Kelly took over the team ahead of the 2013 season (9-3 this year) with the Eagles showing no signs of being disinterested in keeping Kelly long-term. Nevertheless, Kelly spent the first 22 years of his coaching career in the college ranks, and his success at Oregon cannot be overlooked. Kelly would not be a home run hire for Florida – he would be a grand slam – which makes it more than plausible that Foley will reach out to Kelly. The Gators, in an offensive lull for the last five seasons, are ripe for Kelly’s brand of coaching. Whether Kelly has any actual interest in returning to the college ranks remains to be seen.
2:50 p.m. – Multiple reports, including one from FootballScoop.com‘s Scott Roussel, are indicating that Ole Miss’s Hugh Freeze is either leaning towards or planning on staying w/ the Rebels and passing up the reported offer to coach the Gators. “Sources tell me there has been significant dialogue between Freeze and Florida, but that Ole Miss has been working with Freeze for some time on an extension. Sources I have spoken with believe Ole Miss will be in a position [Tuesday] to announce an extension with Freeze,” Roussel writes.
10:25 a.m. – FootballScoop.com‘s Scott Roussel on Monday confirmed the candidacy of Colorado State’s Jim McElwain for the Florida job but also added another name to the list, noting that current New England Patriots offensive coordinator Josh McDaniels is being vetted by the Gators and athletic director Jeremy Foley. McDaniels, while certainly intriguing as both a Nick Saban and Bill Belichick disciple who has two years of NFL head coaching experience, is an interesting name for a number of reasons.
His potential candidacy should also come with some trepidation. Though well-respected and young at 38, McDaniels has never truly coached at the collegiate level outside of spending two years on Saban’s Michigan State staff as a graduate assistant (1999-2000). Ever since, he has worked in the NFL, spending 11 full seasons (and part of a 12th) on the Patriots’ staff in some capacity. McDaniels has never recruited and appears to have his mind set on being an NFL coach one day. In fact, a potential McDaniels hire may wind up being short-term at Florida no matter what assurances he gives the Gators, just as fellow Patriots offensive coordinator Bill O’Brien left New England for the head coaching job at Penn State, only to turn around and accept an NFL gig with the Houston Texans two years later. The difference here is that O’Brien actually had more then a decade of college coaching experience, where McDaniels has none.
9:00 a.m. – Florida’s University Athletic Association on Monday responded to a report from late Sunday night that Ole Miss’s Hugh Freeze was mulling an offer to become the next head coach of the Gators (see below), denying that such an offer exists at this time: “We will have no comment on the recent multiple reports other than to say that we have made no job offers to anyone and reports claiming that are false.”
This is standard operating procedure for Florida (and many other high-profile programs), which like to claim that the person who accepts its open job is the only one that it was officially offered to. The Gators do not want the perception that they have swung and missed on anyone, even difficult-to-lure coaches from other programs. So take the UAA’s statement Monday simply as “business as usual.”
» Sunday, November 30 «
11:35 p.m. – According to SB Nation‘s Steven Godfrey, Florida as offered its head coaching job to Ole Miss’s Hugh Freeze with a “base salary in the range of $4.2 to $4.3 million annually.” Citing multiple sources, Godfrey reports that the “Rebels are attempting to compete with the Gators’ offer” in order to force Freeze to make a decision based solely off of which program he would prefer to coach, as opposed to which will pay him best.
Not accounted for in Godfrey’s report is that the state of Mississippi has an income tax rate of five percent on salaries over $10,001 per year. On a flat $4 million salary with Ole Miss, Freeze would bring home $3.8 million before U.S. income taxes, which would be nearly $500,000 less annually than a Florida offer that started at $4.3 million per year. OM would need to offer Freeze $4.53 million to meet what UF has reportedly laid out in front of Freeze. Freeze has denied speaking with the Gators directly about an opportunity but has also not snuffed out speculation that he could leave the Rebels at season’s end. Ole Miss has previously stated that it was working on a raise and contract extension for Freeze. Also, as pointed out by FootballScoop.com‘s Scott Roussel on Twitter, it is quite unlike UF to put an offer in a coach’s hands and wait for a decision.
10:20 p.m. – Pat Forde of Yahoo! Sports amended his story (see below) to note that Colorado State’s Jim McElwain spoke on the phone with Florida athletic director Jeremy Foley on Saturday night, presumably after the Gators’ regular-season finale.
8:25 p.m. – Forde, citing multiple sources, reports that Colorado State’s Jim McElwain “has emerged as a leading candidate for the Florida vacancy.” Per Forde, “Information has been gathered on McElwain by Florida officials since the school announced two weeks ago that Will Muschamp would not return as coach, sources said. It is unclear how many other candidates may be involved. Sources said Mississippi coach Hugh Freeze was among those on Florida athletic director Jeremy Foley’s radar, but McElwain’s name may be at the top of the list.”
McElwain, a former offensive coordinator at Alabama under Nick Saban, has been exceedingly successful at CSU, leading the Rams to a 10-2 record and second-place finish in the Mountain West this season. He went 4-8 in his first year and 8-6 in his second, steadily improving the program. OnlyGators.com has previously detailed the pros and cons of hiring McElwain. The biggest deterrent to McElwain being hired away from Colorado State is his $7.5 million buyout, though a sports agent source confirmed to OnlyGators.com on Sunday evening that the school has the ability to waive either a portion of the buyout or the entire thing depending on a variety of circumstances. (As an example, Florida could agree to bring CSU to Gainesville for a game or play a home-and-home series in order to avoid the buyout but still give the school a financial benefit.)
FootballScoop.com‘s Scott Roussel does not believe McElwain, a Montana native with plenty of connections out west, would be a good fit for Florida. “Mac is a very good head coach. He also is very happy where he is,” Roussel tweeted. “Staff is suited for recruiting Colorado and the surrounding area very well. Not Florida very well. Would have to build entirely new staff. There are a lot of excellent football coaches out there that just aren’t the right cultural fit. Mac is a western type guy. He loves it out there. Do see him growing within the profession but I don’t see him as the next head guy at Florida. Just don’t see it.”
12:10 a.m. – According to Sports Illustrated‘s Pete Thamel, Ole Miss’s Hugh Freeze is indeed “on the short list of Florida athletic director Jeremy Foley.” Writes Thamel: “Foley is expected to act quickly. While it’s still unknown where Freeze is in Florida’s pecking order, Ole Miss boosters and administrators are already scared enough that they’re calling around to see if they can secure enough money to keep Freeze. Expect Freeze to be much wealthier by the end of this week, but the question will be whether his paychecks are coming from Oxford or Gainesville.” Freeze on Saturday denied that the Gators have contacted him, let alone offered him the job (see below), but certainly there are other ways for Florida to make its potential interest in Freeze known. Foley said previously that he would not speak directly with a coach until the conclusion of that coach’s regular season, but he also said UF would not use back channels to secure its next coach.
» Saturday, November 29 «
10:25 p.m. – Ole Miss’s Hugh Freeze, during his post-game press conference following a 31-17 win in the 2014 Egg Bowl over Mississippi State, denied seemingly unsubstantiated reports from earlier in the week that he had been offered the Florida coaching job. “It’s amazing to me how many things that are put on the internet are now believable. I have not heard from any university except for the one I am fortunate enough to be the head coach,” he said. “Like I said earlier this week, I don’t comment on job statuses – anybody’s job status, particularly mine – whether it’s good or bad. I’m blessed to be the head football coach at the University of Mississippi, my home.” Freeze, of course, did not comment on whether he would be interested in a position with the Gators in the future.
» Friday, November 28 «
1:35 p.m. – Reports on Thursday indicated that Clemson offensive coordinator Chad Morris is planning to accept the SMU head coaching job perhaps as soon as Sunday. For those that believed Tigers’ head coach Dabo Swinney was an option for the Gators, losing Morris to SMU would certainly make him a less-attractive candidate overall. There were some whispers that Morris would wait to see whether Swinney was offered the Florida job before deciding to take a head coaching gig, but if the reports – from 247Sports.com and Fox Sports‘ Bruce Feldman – are accurate, Morris will already be elsewhere by the time the Gators make a decision on their head-coaching position. (Another angle, of course, is that Swinney has already been informed he is not in the running for the Florida job, in which case Morris’s decision was even easier.)
» Wednesday, November 26 «
2:00 p.m. – Though the reasons that Arizona’s Rich Rodriguez may not ultimately be a legitimate candidate for the Florida head coaching job have been mentioned below and detailed in OnlyGators.com‘s pros-and-cons breakdown of a number of coaches potentially up for the job, a coaching industry source told OnlyGators.com recently that Rodriguez should not be completely ruled out for the position with the Gators. It should be noted, however, that any potential hire of Rodriguez would most certainly necessitate the coach explaining what happened at Michigan, particularly when it comes to discord within the athletic department and his NCAA violations, and Foley doing enough background checks to ensure Rodriguez’s claims were factual.
OnlyGators.com has also learned that Arizona State’s Todd Graham is one coach who has recently been gaining the most traction within the industry when it comes to the Florida job. Graham, who has a reputation for bouncing from job to job, could potentially settle in with the Gators after coaching at four different institutions over the last nine seasons. The former defensive back is indeed a defensive coach, but he has the quality that Foley is looking for as being someone with head coaching experience who understands the importance of a potent offense. The Sun Devils are currently ranked 18th in the FBS in points per game (37.2) under the leadership of offensive coordinator Mike Norvell, whom Florida tried to hire for Muschamp’s staff this past offseason. Norvell, it should be noted, was considered a candidate for smaller head coaching jobs last offseason and could remain at ASU as its coach if Graham was to leave. Norvell has been a part of Graham’s staffs at three separate schools since 2007.
Interviews, offers and the like are expected to kick into gear either this or next Sunday, depending which coach Foley decides to go after first. The regular season ends on Saturday, Nov. 29, with conference title games all played on Saturday, Dec. 6.
» Tuesday, November 25 «
4:15 p.m. – Florida has not offered its coaching job to any candidate. A message board post is not a report from a news outlet. As mentioned previously, athletic director Jeremy Foley was adamant that he would not discuss the opening with potential coaches until after the conclusion of their season either this or next Saturday.
11:15 a.m. – The Gainesville Sun‘s Pat Dooley released a list of obvious names that Florida would not be pursuing for its head coaching job last week. This week, he sent a tweet with some more substance, noting that the Gators would not be going after Oklahoma’s Bob Stoops, Oklahoma State’s Mike Gundy or Notre Dame’s Brian Kelly. In a follow-up tweet, he noted that Chip Kelly of the Philadelphia Eagles is also not a candidate due to his show-cause penalty by the NCAA, which expires on Dec. 25. OnlyGators.com addressed multiple pros and cons for each of these candidates two weeks ago, and it should be noted another negative towards Chip Kelly’s candidacy is the fact that his regular season does not end until Dec. 28; athletic director Jeremy Foley said he wanted a hire in place before Christmas. OnlyGators.com has previously noted that Foley has no interest in coaches with NCAA issues, which would seemingly put Gundy, Chip Kelly and coaches like Arizona’s Rich Rodriguez out of contention. In other words, Dooley’s assertion about Chip Kelly is not a reach whatsoever, despite Kelly’s incredible success on both the college and pro levels.
As a veteran on the Florida beat, chances are Dooley has good intel for his notes about Stoops, Gundy and the Kellys. It should be noted, however, that it is still very early in the process and the Gators have not reached out to any candidates directly, contrary to some reports. Coaches not up for the Florida job now may jump into the picture as the process unfolds. To say anyone is truly eliminated, aside from a few obvious names, is a bit premature at this stage. It is also worth mentioning one reason why Stoops and Brian Kelly have always been unlikely candidates for Florida, aside from the fact that they are already well-paid coaches at top institutions: it is long-believed that the next step both men will make is to the NFL, not another college job.
» Saturday, November 22 «
8:45 p.m. – Clemson’s Dabo Swinney spoke extensively about speculation that he is interested in the Florida job. The following comes via the Twitter account of Aaron Brenner of the Charleston Post & Courier:
“I don’t pay attention to stuff like that. … It’s just a waste of time. There’s a time and place for stuff like that. And I’m not going to stand here and be one of these coaches that goes, ‘I will never leave Clemson.’ That’s not genuine. I have no idea. … But I will tell you this: I love Clemson. I love my job. I love it here. It would be very, very, very hard for me to leave Clemson. Now some people may be ready for me to pack up and leave, but my kids have grown up here. My baby was born here. They’ve gone to preschool, kindergarten, elementary, middle school, and I got two [kids] in high school. Tis isn’t just a job to me. I’m passionate about Clemson. I really feel like there’s nothing we can’t achieve here. I think we can win at the highest level. I know we can recruit at the highest level. “My goal is to make this the model program in college football. This is not some stepping-stone job. But dynamics can change – ADs, presidents – and coaches make decisions on certain things. So never say never. I don’t think that’s genuine. But I love it here. I’m fully invested here. I’ve been here 12 years. SO I know some guys take jobs and it’s kind of the next job. But I’ve never been that guy. I want to bloom where I’m planted. This has been a special place for me and my family. So when people throw names out, I just keep moving forward. It’s a credit to our program for what we’ve been able to do here. But at the end of the day, this is much more than just a job to me. I truly, truly love the people. I love my players, there’s nothing we can’t do here. Nothing. I know sometimes we want it yesterday, but we’re building something special and it’s an honor to be a part of it.”
6:45 p.m. – Citing “three sources in the coaching community,” 247Sports.com‘s Ryan Bartow reports that Oklahoma State’s Mike Gundy wants to be Florida’s next head coach and has been “letting his interest be known” through back channels. Of course, Gundy denied interest in the Gators job during his weekly press conference on Monday. “I don’t have any interest in other jobs,” he said. Gundy is set to earn between $3.0-3.5 million each season from now until 2019. He also has $600,000 contributed annually to his retirement account by the program. Should Gundy leave OSU before fulfilling the terms of his deal, he would lose much of the money in that account.
» Friday, November 21 «
5:45 p.m. – Notre Dame’s Brian Kelly was asked to address rumors that he is interested in the Florida opening, for which he decided to tease the media members posing the questions. “I’m going to Florida – in about two weeks to get some sun,” Kelly said earlier this week during the press conference. “I’m getting out of here with this weather. What are you, kidding me? So you can write that down. I’m going to Florida. Write it down now, get it out there get it on the news waves.” Kelly was asked a follow-up question about being a candidate for the job, to which he supplied another super-sarcastic reply. “Oh yeah. I’ve been interested in the Florida job. What else am I up for Anything else? Can I be up for the Notre Dame job? Because we are 7-3 right now, [and] I’m hoping to hold on to this job.” Hat tip to WNDU NBC for video of the statement.
2:33 p.m. FoxSports.com‘s Bruce Feldman threw out a name he sees as “intriguing” for Florida in Wisconsin’s Gary Andersen. “Doing well at [Wisconsin and I] heard he’s highly regarded by key [people with] #UF connections,” he wrote on Twitter. A former Utah center who has mostly served as a defensive coach, Andersen spent four years at Utah State from 2009-12), leading the Aggies to an 11-2 record in 2012. He took over the Badgers when Bret Bielema left for Arkansas and has seen some serious success in less than two full seasons. Andersen led Wisconsin to a 9-4 record in 2013 and currently has the team at 8-2 with losses to LSU and Northwestern and a win over Nebraska. Despite his defensive prowess, the Badgers are ranked 11th nationally in scoring offense (39.0 points per game) and third in scoring defense (15.3 points per game); however, Wisconsin has one of the worst passing offenses in the nation, gaining nearly three-quarters of its yard on the ground due in large part to the dominance of Heisman Trophy candidate Melvin Gordon (1,909 yards, 23 touchdowns).
10:50 a.m. You’ve heard this before. USA Today‘s Dan Wolken spoke with “several agents and others tied to the coaching search industry” to ask whether Florida is a legitimate top-four job nationally as it is often perceived. Their collective answer? No. Why? First, because of the Gators’ facilities – which are unfairly criticized, as OnlyGators.com detailed here. “It’s mind-boggling. That place should ahve the best facilities in the country. How is that allowed to happen?” one source told Wolken. Then of course, the argument about Florida fans’ “high expectations” comes into play. “Competing and winning isn’t enough, you have to be playing for championships, so there’s a lot of pressure,” another source told Wolken. This is often thrown in the Gators’ face because of how Steve Spurrier left and the health issues that Urban Meyer dealt, but the truth is that there is no coach of a major program should ever think their fans’ expectations are not championship-level high. Just ask Nick Saban what he thought when he took the job at Alabama, the team coached by Bear Bryant for 25 years.
10:45 a.m. – Though he has not been a name connected to the Florida opening from the start, Clemons’ Dabo Swinney was asked about the Gators job and felt the need to squash his interest in it during a conversation with the media late this week. “The more you sit around and talk about that kind of stuff, the more of a distraction it is,” Swinney said, according to TheBigSpur.com. “I love my job. I just signed a long-term contract because of that. And this is a place that’s special to me. And I’ve invested a lot here. My focus is 100 percent on winning here.”
» Thursday, November 20 «
3:20 p.m. – One name that has slowly built some momentum very early in the hiring process is Ole Miss’s Hugh Freeze, who despite coaching his hometown team and reportedly being in the process of working out an extension with his current program, would be a good fit on a number of levels for Florida. According to ESPN.com’s Derek Tyson, one of the areas in which Freeze and the Gators would marry well is in recruiting, as he has three assistants with ties to the state of Florida. And while no single recruit will have any say whatsoever in the ultimate hire at UF, five-star defensive end CeCe Jefferson – a long-time Florida lean – explained why he would choose Freeze to replace Muschamp. “I think he would be a great choice at UF. My visit with him at Ole Miss was great,” he told Tyson. “He’s not only a great football coach, but he’s a great man. What he can bring to the table can be pretty special if he were to go there and get the place figured out.”
» Wednesday, November 19 «
7:25 p.m. – During an appearance on ESPN Radio’s SVP & Russillo show on Monday, NFL insider Chris Mortensen discussed the Florida opening with the program’s hosts. He made a similar comment to one OnlyGators.com wrote recently on Twitter and then talked about Notre Dame’s Brian Kelly and how he could be a candidate for the Gators.
“I think Jeremy Foley always thinks big. At the same time, I also heard him say today that he would like to get a coach in place by Christmas. The name that’s going to be always thrown out there in the NFL as of right now is Chip Kelly’s name. People want to say Jim Harbaugh, Chip Kelly is not leaving the Philadelphia Eagles early to be announced as the Florida coach. … Brett McMurphy reported Brian Kelly being one of the guys. The reason Brian Kelly is an interesting name – the Notre Dame coach – I’m hearing his name in NFL circles, so I do believe he’s probably a pretty serious candidate for the Florida job if he chooses to explore that. But he’s also in-season. That’s why you have agents to do that work. But there are NFL teams that look at Brian Kelly, see him as a CEO-type, a strength on the offensive side of the football. And Notre Dame, as great the tradition and the institution that it is, still has some restrictions. … That’s a name that I think people are looking at.”
It should be noted that Kelly and Mortensen – along with a bevy of other coaching candidates – are all represented by former Florida defensive end (now high-powered sports agent) Trace Armstrong, who still resides in Gainesville. If Kelly is indeed interested in going to the NFL – or simply getting a raise from the Fighting Irish – floating his name as a candidate for the Gators could certainly help get those desires accomplished.
7:20 p.m. – You know the UF coaching search is in full swing when an Atlanta Journal-Constitution writer cites a second-hand source – a booster of the Gators who is a friend of one of his friends who “knows a lot about college football” and “used to coach it” and is “in the Hall of Fame” – as saying in September that “Florida’s next coach would be Mike Shanahan.” Nevermind that Gators athletic director Jeremy Foley wanted absolutely nothing but for Muschamp to succeed and keep his job. Nevermind that Foley was so convinced Muschamp would turn things around that sources close to the program tell OnlyGators.com he did not even decide that candidates for the job would be necessary until after the Missouri loss. A friend of a friend told a writer in Georgia, at some point while Florida was 2-1 (at worst), that Shanahan – someone who has not coached college football in three decades and failed mightily at his last NFL stop – would be the next Gators coach. Alrighty then.
12:50 p.m. – Today has been slow, so the folks over at SB Nation decided to take six Florida coaching candidates, mock them up as superstars in the WWE 2K15 video game (complete with entrances, gear, mannerisms) and have them fight it out for the Gators job in a six-man, over-the-top battle royale. Check out all the videos, GIFs and explanations by clicking here. (Yes, that’s Steve Spurrier being eliminated second.)
» Tuesday, November 18 «
12:55 p.m. – Auburn’s Gus Malzahn told reporters Tuesday that he is “totally committed to” the Tigers, calling the program “one of the best jobs in college football,” according to the Associated Press‘s John Zenor. Malzahn signed a six-year contract extension worth $3.85 million per season back in January.
12:00 p.m. – Colorado State’s Jim McElwain also addressed the Gators’ vacancy, doing so during SiriusXM‘s College Sports Nation radio program on Tuesday, though he – like most coaches – did not discuss the job directly but rather skirted around the topic. “Colorado State University is a great place. Fort Collins is a great place to live, and we’ve got great leadership here,” he said, as transcribed by CoachingSearch.com. “That’s a good thing. When things and speculation come out, one of the things I was brought here to do was to put the word of Colorado State out there. Every time there’s any kind of mention, it’s all led with ‘Colorado State University.’ You know what? That’s part of the job I was hired to do.”
9:42 a.m. – Marshall’s Doc Holliday addressed Monday night’s report and his potential interest in the Florida job when he was asked by Sports Illustrated‘s Zac Ellis on Tuesday. “The only concern I have right now is preparing this football team for the next three weeks. That’s the only concern I have,” he said.
» Monday, November 17 «
10:43 p.m. – FootballScoop.com reported late Monday night that Marshall’s Doc Holliday is “very much a candidate” for the Florida job. Holliday, UF’s assistant head coach from 2005-07 under Urban Meyer, currently has the Thundering Herd at 10-0 and is an interesting fit for the Gators for a number of reasons, all of which are detailed here.
9:51 p.m. – ESPN‘s NFL insider Adam Schefter reported during halftime of Monday Night Football that former Gators offensive coordinator and NFL head coach Mike Shanahan is not interested in coaching college. Shanahan was never a legitimate option for Florida, especially considering he has not coached at the college level in three decades.
7:00 p.m. – The Bovada sportsbook posted odds for Florida’s next coach at 2 p.m. and initially had Oklahoma State’s Mike Gundy as a 4/1 favorite to take the job. “That’s crazy,” replied Gundy when informed of this during his weekly press conference. “I don’t have any interest in other jobs,” he added. Bovada’s odds as of this update:
Bob Stoops 9/2 | Mike Gundy 9/2 | Jim McEwain 11/2 | Dan Mullen 6/1
Mike Shanahan 8/1 | Rich Rodriguez 17/2 | Hugh Freeze 10/1 | Steve Spurrier 10/1
Gary Patterson 14/1 | Gus Malzahn 14/1 | Jim Tressel 15/1 | Greg Schiano 20/1
3:16 p.m. – Ole Miss athletic director Ross Bjork told the Associated Press‘s David Brandt that the program is already in talks with Hugh Freeze about a contract extension. An Oxford, Mississippi, native, Freeze has already been extended by the Rebels twice, per the AP, and is a no-brainer for the program to lock up. “I don’t discuss my job status – good or bad,” Freeze said when asked about the Gators opening. “I don’t think anything good comes of that. My family and I are extremely happy in Oxford.”
2:22 p.m. – Colorado State’s Jim McElwain is an interesting candidate who meets many of Foley’s criteria for his next hire. But there is a big road block, a $7.5 million buyout clause in his CSU contract. As NCAA compliance blogger John Infante notes, that buyout would jump to $13.5 million if McElwain gets his program into a College Football Playoff game, though that is obviously unlikely. Nevertheless, the Gators are on the hook for $6.3 million in a Muschamp buyout and potentially $8 million total in staff payments if other assistants are not retained. Coupling that chunk of money with McElwain’s buyout would be a lot to ask, though there are ways that programs can come to mutually-beneficial agreements to either reduce or avoid buyout payments, such as negotiating terms of the buyout or scheduling games for a school to get a high-profile opponent and nice payout.
1:27 p.m. – Texas’s Charlie Strong smirked when asked early in his press conference about his interest in the Florida opening. “I have a great job here. We have a lot of work to get done here,” he said.
1:11 p.m. – Now an analyst on the SEC Network, former Auburn coach Gene Chizik praised the prestige that is coaching at UF. “In coaching circles, [Florida is a] top-three [job]. No disrespect to Miami or FSU, ‘the University of’ counts. It does.”
11:11 a.m. – Oklahoma’s Bob Stoops dismissed interest of being an option for the Gators job during his weekly press conference. “All I want to be is a candidate at Oklahoma. I’m not a candidate anywhere else,” he said. “I’m finished with that question.”
10:37 a.m. – ESPN.com‘s Brett McMurphy reported via Twitter that neither Mississippi State’s Dan Mullen nor Arizona’s Rich Rodriguez were considered candidates for the Florida opening. OnlyGators.com on Sunday detailed the specific reasons why neither Mullen nor Rodriguez are ideal options for the Gators.
» Sunday, November 16 «
2:06 p.m. – In his weekly press conference, South Carolina’s Steve Spurrier denied interest in the Gators job, reiterating a position he stated one week earlier. “I’ve already had my run at Florida. I think everybody knows that. They need to hire a coach that hopefully will be there 10 years. That’s what all athletic directors do, they hire a coach sort of going on the assumption he’s going to be there at least 10 years,” he said.[/EXPAND] |
export const achievements = [
{
id: 0,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 1,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 2,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 3,
name: "<NAME>",
type: "global",
complete: false
},
{
id: 4,
name: "The Dead Invade",
type: "global",
complete: false
},
{
id: 5,
name: "A Demon’s Errand",
type: "party",
complete: false
},
{
id: 6,
name: "City Rule: Economic",
type: "global",
complete: false
},
{
id: 7,
name: "End of the Invasion",
type: "global",
complete: false
},
{
id: 8,
name: "The Power of Enhancement",
type: "global",
complete: false
},
{
id: 9,
name: "Stonebreaker’s Censer",
type: "party",
complete: false
},
{
id: 10,
name: "The Rift Neutralized",
type: "global",
complete: false
},
{
id: 11,
name: "Artifact: Recovered",
type: "global",
complete: false
},
{
id: 12,
name: "Ancient Technology",
type: "global",
complete: false
},
{
id: 13,
name: "Through the Ruins",
type: "party",
complete: false
},
{
id: 14,
name: "The Voice’s Command",
type: "party",
complete: false
},
{
id: 15,
name: "The Drake’s Command",
type: "party",
complete: false
},
{
id: 16,
name: "Following Clues",
type: "party",
complete: false
},
{
id: 17,
name: "An Invitation",
type: "party",
complete: false
},
{
id: 18,
name: "The Edge of Darkness",
type: "global",
complete: false
},
{
id: 19,
name: "The Scepter and the Voice",
type: "party",
complete: false
},
{
id: 20,
name: "Artifact: Cleansed",
type: "global",
complete: false
},
{
id: 21,
name: "The Voice’s Treasure",
type: "party",
complete: false
},
{
id: 22,
name: "The Drake’s Treasure",
type: "party",
complete: false
},
{
id: 23,
name: "The Drake Slain",
type: "global",
complete: false
},
{
id: 24,
name: "Artifact: Lost",
type: "global",
complete: false
},
{
id: 25,
name: "City Rule: Demonic",
type: "global",
complete: false
},
{
id: 26,
name: "Through the Trench",
type: "party",
complete: false
},
{
id: 27,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 28,
name: "Across the Divide",
type: "party",
complete: false
},
{
id: 29,
name: "The Voice Freed",
type: "global",
complete: false
},
{
id: 30,
name: "The Voice Silenced",
type: "global",
complete: false
},
{
id: 31,
name: "Water-Breathing",
type: "global",
complete: false
},
{
id: 32,
name: "End of Corruption1",
type: "global",
complete: false
},
{
id: 33,
name: "Annihilation of Order",
type: "global",
complete: false
},
{
id: 34,
name: "City Rule: Militaristic",
type: "global",
complete: false
},
{
id: 35,
name: "End of Gloom",
type: "global",
complete: false
},
{
id: 36,
name: "The Poison’s Source",
type: "party",
complete: false
},
{
id: 37,
name: "Through the Nest",
type: "global",
complete: false
},
{
id: 38,
name: "End of Corruption2",
type: "global",
complete: false
},
{
id: 39,
name: "End of Corruption3",
type: "global",
complete: false
},
{
id: 40,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 41,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 42,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 43,
name: "Tremors",
type: "party",
complete: false
},
{
id: 44,
name: "<NAME>",
type: "party",
complete: false
},
{
id: 45,
name: "Sin-Ra",
type: "party",
complete: false
},
{
id: 46,
name: "The Drake Aided",
type: "global",
complete: false
}
];
export default achievements;
|
<reponame>BBVA-CIB/ZeroMQ-Framework<gh_stars>0
package com.bbva.kyof.vega.sockets;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zeromq.ZMQ;
import org.zeromq.ZMQException;
import com.bbva.kyof.vega.exception.LLZException;
/**
* Wrapper for a subscriber ZMQ socket
*
* This class is thread-safe
*/
public final class LLZSubSocket implements Runnable
{
/** Logger of the class */
private static final Logger LOGGER = LoggerFactory.getLogger(LLZSubSocket.class);
/** UTF-8 char set */
public static final Charset UTF8_CHAR_SET = Charset.forName("UTF-8");
/** The instance of the ZMQ native Socket */
private final ZMQ.Socket nativeZMQSocket;
/** Handler to process incoming messages */
private final ILLZSubSocketRcvHandler receiveHandler;
/** Lock for class access */
private final Object lock = new Object();
/** Physical transport of the subscriber socket */
private final String subTransport;
/** True if the socket should be stopped */
private volatile boolean shouldStop = false;
/** True if the socket has been stopped */
private volatile boolean stopped = false;
/**
* Create the subscriber socket and start the pooling
*
* @param context original ZMQ context
* @param subTransport transport connection string for the socket
* @param receiveHandler handler to send the received messages
* @param rateLimit receive rate limit for the socket, null to use default values
*/
public LLZSubSocket(final ZMQ.Context context,
final String subTransport,
final ILLZSubSocketRcvHandler receiveHandler,
final Long rateLimit) throws LLZException
{
LOGGER.debug("Creating ZMQ SUB socket for LLZ Subscriber and transport [{}]", subTransport);
this.subTransport = subTransport;
this.receiveHandler = receiveHandler;
try
{
// Initialization of the ZMQ Socket
this.nativeZMQSocket = context.socket(ZMQ.SUB);
// Set the reception rate limit, it will drop messages when the limit is reached
if (rateLimit == null)
{
this.nativeZMQSocket.setRcvHWM(LLZSocketConstants.DEFAULT_RATE_LIMIT);
}
else
{
this.nativeZMQSocket.setRcvHWM(rateLimit);
}
// Perform the connections
this.nativeZMQSocket.connect(subTransport);
// Subscribe to all (ZMQ API docs)
this.nativeZMQSocket.subscribe("".getBytes(UTF8_CHAR_SET));
}
catch (final ZMQException e)
{
LOGGER.error("Unexpected internal ZMQ exception creating ZMQ sub socket", e);
throw new LLZException("Internal ZMQ exception creating ZMQ sub socket", e);
}
// Start the pooling thread if there have been no errors
final Thread pollingThread = new Thread(this, "LLZ SUB SOCKET");
pollingThread.start();
}
private void processNextMsg(final ZMQ.Poller poller)
{
ByteBuffer receivedBuffer;
// Synchronize the access to the socket
synchronized (this.lock)
{
// Poll with a timeout of one millisecond
if (poller.poll(1) == -1)
{
LOGGER.error("Polling thread for subscriber [{}] interrupted", this.subTransport);
// Set the socket to stop
this.shouldStop = true;
return;
}
// Get and process the first element if there is something
if (poller.pollin(0))
{
final byte[] rcvMessage = this.nativeZMQSocket.recv(ZMQ.DONTWAIT);
receivedBuffer = ByteBuffer.wrap(rcvMessage);
}
else
{
receivedBuffer = null;
}
}
// Send the message to the listener
if (receivedBuffer != null)
{
// Send the message to the handler
this.receiveHandler.onSocketMsgReceived(receivedBuffer);
}
}
/**
* Stop the requester socket
*/
public void stop() throws InterruptedException
{
LOGGER.debug("Closing ZMQ SUB socket on transport [{}]", this.subTransport);
this.shouldStop = true;
while(!this.stopped)
{
Thread.sleep(1);
}
}
@Override
public void run()
{
LOGGER.debug("Beginning ZMQ PUB socket subscriber Thread for LLZ Subscriber");
try
{
// Create and register a poller that will try to get a single element
ZMQ.Poller poller = new ZMQ.Poller(1);
poller.register(this.nativeZMQSocket);
while(!this.shouldStop)
{
this.processNextMsg(poller);
}
}
catch (final ZMQException e)
{
LOGGER.error("Unexpected internal ZMQ exception processing ZMQ SUB socket message for LLZSubscriber", e);
}
catch (final Exception e)
{
LOGGER.error("Unexpected exception processing ZMQ SUB socket message for LLZSubscriber", e);
}
// Try to close the socket before exiting
this.internalCloseSocket();
LOGGER.debug("ZMQ PUB socket subscriber Thread for LLZ Subscriber finished");
}
/**
* Close protocol when context is closed and TERM signal sent
*/
private void internalCloseSocket()
{
LOGGER.debug("Closing ZMQ SUB socket for LLZ Subscriber and transport [{}]", this.subTransport);
synchronized (this.lock)
{
try
{
this.nativeZMQSocket.setLinger(0);
this.nativeZMQSocket.close();
}
catch (final ZMQException e)
{
LOGGER.error("Error closing subscriber socket", e);
}
this.stopped = true;
}
LOGGER.debug("ZMQ SUB socket for LLZ Subscriber and transport [{}] closed", this.subTransport);
}
}
|
/**
* Unit test for simple App.
*/
public class LoggingTest
{
protected static String loggerName = null;
protected static String logfileName = null;
@Before
public void setUp() {
}
@Test
public void basicLoggingTest()
{
ILogging logging = null;
boolean bAppend = false;
boolean bUsingConfigFile = true;
try {
loggerName = new Object(){}.getClass().getEnclosingMethod().getName();
logfileName = loggerName + ".log";
logging = Logging.getInstance();
logging.createLogger(loggerName);
try {
logging.setConfiguration("loggingtest.properties");
bUsingConfigFile = true;
} catch (LoggingException e) {
bUsingConfigFile = false;
logging.severe("Exception" + e.getMessage());
}
if (false == bUsingConfigFile) {
try { logging.addConsoleHandler(); }
catch (LoggingException e) { logging.severe("Exception" + e.getMessage()); }
try { logging.addFileHandler(logfileName, bAppend); }
catch (LoggingException e) { logging.severe("Exception" + e.getMessage()); }
logging.setLogLevelAll();
}
} catch (LoggingException e) {
logging.severe("Exception" + e.getMessage() );
}
logging.setLogLevelAll();
logging.info( "Starting Tests...");
logging.info( "LogLevel-All: INFO message IS displayed.");
logging.warning( "LogLevel-All: WARNING message IS displayed.");
logging.severe( "LogLevel-All: SEVERE message IS displayed.");
logging.flush();
pause(300);
logging.setLogLevelSevere();
logging.info( "LogLevel-Severe: INFO message NOT displayed.");
logging.warning( "LogLevel-Severe: WARNING message NOT displayed.");
logging.severe( "LogLevel-Severe: SEVERE message IS displayed.");
logging.flush();
pause(300);
logging.setLogOff();
logging.info( "LogLevel-Severe-Off: INFO message NOT displayed.");
logging.warning( "LogLevel-Severe-Off: WARNING message NOT displayed.");
logging.severe( "LogLevel-Severe-Off: SEVERE message NOT displayed.");
logging.flush();
pause(300);
logging.setLogOn();
logging.info( "LogLevel-Severe-On: INFO message NOT displayed.");
logging.warning( "LogLevel-Severe-On: WARNING message NOT displayed.");
logging.severe( "LogLevel-Severe-On: SEVERE message IS displayed.");
logging.flush();
pause(300);
logging.setLogLevelAll();
logging.info( "...Ending Tests.");
logging.flush();
pause(300);
}
public static void pause(int milliseconds) {
try { Thread.sleep(milliseconds); }
catch (InterruptedException e) {}
}
} |
<gh_stars>100-1000
/*
* Copyright (c) 2013-2014, Newcastle University, UK.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE COPYRIGHT HOLDER 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.
*/
// Data output handling functions
// <NAME>, 2013-2014
/*
General funtionality:
1) Fifo of generic packet types with pointers, flags and types.
The pointers can use a dynamic allocation scheme if needed.
2) Multiple output streams use the said fifo.
Each stream clears its flag when it consumes the data.
3) Each stream consumes the data using a common reader.
The reader known how to interpret the data including decryption.
4) If the fifo is full before all the data sinks have read the oldest
data then that data is removed as new data arrives.
5) Fifo is only used to establish the ordering to decide which
element is discarded first on overflow.
6) We can't have individual heads to a fifo since each would need a tail
and this makes it difficult to be sure when we can remove an item as
the head and tails span the end of the fifo.
*/
// Headers
#include <stdarg.h>
#include <stdio.h>
#include "HardwareProfile.h"
#include "Settings.h"
#include "Data.h"
#include "Peripherals/Rtc.h"
// Stream input/output specific headers
#include "WirelessProtocols/MCHP_API.h"
#include "Network.h"
#include "MiWiRx.h"
#include "Peripherals/Si443x.h"
#include "USB/USB_CDC_MSD.h"
#ifdef USE_FAT_FS
#include "FatFs/FatFsIo.h"
#else
#include "MDD File System/FSIO.h"
#endif
#include "TCPIPConfig.h"
#ifdef ENABLE_UDP_SERVICES
#include "TCPIP Stack/UDP services local.h"
#endif
#ifdef STACK_USE_TELNET_SERVER
#include "TCPIP Stack/TelnetLocal.h"
#endif
// Debug setting
// #define DEBUG_ON
#include "Debug.h"
// SLIP-encoded packet -- write SLIP_END bytes before and after the packet: usb_putchar(SLIP_END);
#define SLIP_END 0xC0 // End of packet indicator
#define SLIP_ESC 0xDB // Escape character, next character will be a substitution
#define SLIP_ESC_END 0xDC // Escaped sustitution for the END data byte
#define SLIP_ESC_ESC 0xDD // Escaped sustitution for the ESC data byte
// Globals
// Globals - private
volatile unsigned short nextSpace;
dataElement_t dataElementBuffer[NUMBER_OF_ELEMENTS_IN_FIFO];
#ifndef DYNAMIC_ALLOCATION
unsigned char dataElementHeap[NUMBER_OF_ELEMENTS_IN_FIFO * MAX_ELEMENT_SIZE];
#endif
// Prototypes
// Call at startup
void InitDataList(void)
{
// Assumes zero is NULL - erase all elements
DATA_IPL_shadow_t IPLshadow;
DATA_INTS_DISABLE();
memset(dataElementBuffer, 0, (NUMBER_OF_ELEMENTS_IN_FIFO * sizeof(dataElement_t)));
nextSpace = 0; // Location of next element item
DATA_INTS_ENABLE();
}
// Useful when using dynamic allocation
void ClearDataList(void)
{
unsigned short i;
DATA_IPL_shadow_t IPLshadow;
DATA_INTS_DISABLE();
for(i=0;i<NUMBER_OF_ELEMENTS_IN_FIFO;i++)
{
dataElementBuffer[i].dataType = 0;
dataElementBuffer[i].dataLen = 0;
dataElementBuffer[i].flags = 0;
#ifdef DYNAMIC_ALLOCATION
if(dataElementBuffer[i].data != NULL)
free(dataElementBuffer[i].data);
#endif
dataElementBuffer[i].data = NULL;
}
nextSpace = 0; // Reset
DATA_INTS_ENABLE();
}
// Call externally to add a data element
void AddDataElement(unsigned char type, unsigned char address, unsigned char len, unsigned short flags, void* data)
{
// Check flags
if(flags == 0) return; // No valid streams, discard
DATA_IPL_shadow_t IPLshadow;
DATA_INTS_DISABLE();
// Make an element to push into the fifo
dataElement_t element = {
.flags = flags,
.timeStamp = RtcNow(), // Time stamp it
.dataType = type,
.address = address,
.dataLen = len
};
// Get a ptr to put the data at
#ifdef DYNAMIC_ALLOCATION
// Free pointer on this location if not null
if(dataElementBuffer[nextSpace].data != NULL)
free(dataElementBuffer[nextSpace].data);
// Dynamic: Allocate new space
element.data = malloc(len);
if(element.data == NULL)
{
DBG_ERROR("Data.c: Insufficient memory");
DATA_INTS_ENABLE();
return; // FAIL
}
#else
// Static: We already know there are bytes alotted to the element
element.data = &dataElementHeap[(MAX_ELEMENT_SIZE*nextSpace)];
#endif
// Location holding raw data (clamp size)
if(len > MAX_ELEMENT_SIZE) len = MAX_ELEMENT_SIZE;
memcpy(element.data,data,len);
// Element is list holding pointer and other info
memcpy(&dataElementBuffer[nextSpace], &element, sizeof(dataElement_t));
// Increment index + wrap
nextSpace = (nextSpace+1)%NUMBER_OF_ELEMENTS_IN_FIFO;
DATA_INTS_ENABLE();
return;
}
// Call to return the flags currently set to accept data by the settings AND are operational
unsigned short GetOpenStreams(void)
{
// NOTE: The command and error flags are always enabled
// USE: (CMD_UDP_FLAG | CMD_CDC_FLAG | TXT_CMD_BATCH | TXT_ERR_FLAG)
unsigned short ret = 0;
if((settings.usb_stream == STATE_ON)&&(status.usb_state == ACTIVE))
{
if(settings.usb_stream_mode == 0) // Text
ret |= TXT_CDC_FLAG;
else if (settings.usb_stream_mode == 1) // Binary
ret |= BIN_CDC_FLAG;
}
if((settings.file_stream == STATE_ON)&&(status.file_state == ACTIVE))
{
if(settings.file_stream_mode == 0) // Text
ret |= TXT_FILE_FLAG;
else if (settings.file_stream_mode == 1) // Binary
ret |= BIN_FILE_FLAG;
}
if((settings.udp_stream == STATE_ON)&&(status.udp_state == ACTIVE))
{
if(settings.udp_stream_mode == 0) // Text
ret |= TXT_UDP_FLAG;
else if (settings.udp_stream_mode == 1) // Binary
ret |= BIN_UDP_FLAG;
}
if((settings.telnet_stream == STATE_ON)&&(status.telnet_state == ACTIVE))
{
if(settings.telnet_stream_mode == 0) // Text
ret |= TXT_TEL_FLAG;
else if (settings.telnet_stream_mode == 1) // Binary
ret |= BIN_TEL_FLAG;
}
if((settings.gsm_stream == STATE_ON)&&(status.gsm_state == ACTIVE))
{
if(settings.gsm_stream_mode == 0) // Text
ret |= TXT_GSM_FLAG;
else if (settings.gsm_stream_mode == 1) // Binary
ret |= BIN_GSM_FLAG;
}
return ret;
}
// Call externally to put all pending data sources over the flagged channels
void ReadDataElements(unsigned short flags)
{
// Read (output) data elements with matching flags to those set
DATA_IPL_shadow_t IPLshadow;
unsigned short i;
unsigned short index;
dataElement_t *element;
unsigned short activeFlags;
unsigned char elementType, elementAddress;
unsigned short firstIndexRead;
// No streams being read - exit
if(flags == 0) return;
// firstIndexRead must be an impossible index to start with
firstIndexRead = NUMBER_OF_ELEMENTS_IN_FIFO; //(outside array)
for(i=0;i<NUMBER_OF_ELEMENTS_IN_FIFO;i++)
{
unsigned char *sourceBin;
char* sourceTxt;
unsigned short lenTxt, lenBin;
// We can not allow elements to be overwritten whilst reading
DATA_INTS_DISABLE();
// Set start point, always start at the oldest item in the list
if(firstIndexRead == NUMBER_OF_ELEMENTS_IN_FIFO)
{
firstIndexRead = nextSpace; // Initialise on first call only
}
else if (firstIndexRead != nextSpace) // Extra elements added during loops
{
// If the new nextSpace <= next index -> continue
// If the new nextSpace > next index, skip to nextSpace
unsigned short added;
if(nextSpace >= firstIndexRead) added = nextSpace - firstIndexRead;
else added = NUMBER_OF_ELEMENTS_IN_FIFO + nextSpace - firstIndexRead;
if(added > i) // Written over the next space to be read with newer data
{
i = added; // The overwritten slots are lost now
// Break if all the items have been replaced
// Only items in the list on first call are read
if(i >=NUMBER_OF_ELEMENTS_IN_FIFO) break;
}
}
// Find the next index
index = (firstIndexRead+i)%NUMBER_OF_ELEMENTS_IN_FIFO;
// Get next element from this index
element = &dataElementBuffer[index];
// See if it has any of the flags we are looking to read
activeFlags = (element->flags & flags);
if(activeFlags == 0) // Not reading element on this call
{
#ifdef DYNAMIC_ALLOCATION
// Free pointer on this location if not null and no streams
if((element->data != NULL)&&(element->flags == 0))
{
free(element->data);
element->data = NULL;
}
#endif
// If not, continue
DATA_INTS_ENABLE();
continue; // No, we will skip it
}
// Now read the elements + latch type
elementType = element->dataType;
elementAddress = element->address;
// Check if there are any text streams consuming this element
if(activeFlags & TXT_STREAMS_MASK)
{
sourceTxt = ReadElementTxt(&lenTxt,element,0);
}
// Check if there are any binary streams consuming this element
if(activeFlags & BIN_STREAMS_MASK)
{
sourceBin = ReadElementBin(&lenBin,element,0);
}
// Clear the flags for the active streams
element->flags &= ~activeFlags;
// Now we have read the elements data - re-enable ints
DATA_INTS_ENABLE();
// Write out data, text and binary streams
if((activeFlags & TXT_FILE_FLAG) && (status.output_text_file))
{
// Write to text file
FILE_LED = !FILE_LED; // Flicker LED
if (FSfwrite(sourceTxt, 1, lenTxt, status.output_text_file) != lenTxt)
{
status.file_state = ERROR;
}
}
if(activeFlags & TXT_CDC_FLAG)
{
// Send over CDC
CDC_LED = !CDC_LED; // Flicker LED
usb_write(sourceTxt,lenTxt);
}
if(activeFlags & TXT_ERR_FLAG)
{
// STDERR out
//fprintf(stderr,"%s",sourceTxt);
// Write to error log file file
if(status.error_file != NULL)
{
FILE_LED = !FILE_LED; // Flicker LED
// Timestamp
const char* ptr = RtcToString(RtcNow());
unsigned char len = strlen(ptr);
FSfwrite(ptr, 1, len, status.error_file); // Time stamp
FSfwrite(",", 1, 1, status.error_file); // Comma
FSfwrite(sourceTxt, 1, lenTxt, status.error_file); // Text error
FSfclose(status.error_file); // Save
status.error_file = FSfopen(ERROR_FILE, "a"); // Re-open
}
}
#ifdef STACK_USE_TELNET_SERVER
if(activeFlags & TXT_TEL_FLAG)
{
TEL_LED = !TEL_LED; // Flicker LED
unsigned short clientMask = status.telnet_mask; // Default is all authenticated clients for non text
if(elementAddress != DATA_DEST_ALL) // Specific client(s) being spoken too
clientMask = (1ul<<elementAddress); // Data is sent to corrent recipient client
TelnetWrite(sourceTxt,lenTxt,clientMask); // Send elements over the appropriate stream
}
#endif
#ifdef ENABLE_UDP_SERVICES
if(activeFlags & TXT_UDP_FLAG)
{
TCP_LED = !TCP_LED; // LED flickers
unsigned short clientMask = status.udp_mask; // Default is all authenticated clients for non text
if(elementAddress != DATA_DEST_ALL) // Specific client(s) being spoken too
clientMask = (1ul<<elementAddress); // Data is sent to corrent recipient client
UdpWritePacket(sourceTxt,lenTxt,clientMask); // Send elements over the appropriate stream
}
#endif
// TODO
if(activeFlags & TXT_GSM_FLAG)
{
}
if((activeFlags & BIN_FILE_FLAG) && (status.output_bin_file))
{
// Write to text file
FILE_LED = !FILE_LED; // Flicker LED
if (FSfwrite(sourceBin, 1, lenBin, status.output_bin_file) != lenBin)
{
status.file_state = ERROR;
}
}
if(activeFlags & BIN_CDC_FLAG)
{
// Send over CDC
CDC_LED = !CDC_LED; // Flicker LED
usb_write(sourceBin,lenBin);
}
#ifdef STACK_USE_TELNET_SERVER
if(activeFlags & BIN_TEL_FLAG)
{
TEL_LED = !TEL_LED; // Flicker LED
unsigned short clientMask = status.telnet_mask; // Default is all authenticated clients for non text
if(elementAddress != DATA_DEST_ALL) // Specific client(s) being spoken too
clientMask = (1ul<<elementAddress); // Data is sent to corrent recipient client
TelnetWrite(sourceBin,lenBin,clientMask); // Send elements over the appropriate stream
}
#endif
#ifdef ENABLE_UDP_SERVICES
if(activeFlags & BIN_UDP_FLAG)
{
TCP_LED = !TCP_LED; // LED flickers
unsigned short clientMask = status.udp_mask; // Default is all authenticated clients for non text
if(elementAddress != DATA_DEST_ALL) // Specific client(s) being spoken too
clientMask = (1ul<<elementAddress); // Data is sent to corrent recipient client
UdpWritePacket(sourceBin,lenBin,clientMask); // Send elements over the appropriate stream
}
#endif
//TODO
if(activeFlags & BIN_GSM_FLAG)
{
}
// Commands
if(activeFlags & CMD_CDC_FLAG)
{
CDC_LED = !CDC_LED; // Flicker LED
SettingsCommand(sourceTxt, SETTINGS_CDC, 0);
}
if(activeFlags & CMD_BATCH_FLAG)
{
SettingsCommand(sourceTxt, SETTINGS_BATCH, 0);
}
if(activeFlags & CMD_TEL_FLAG)
{
// Telnet commands have a source address as well
SettingsCommand(sourceTxt, SETTINGS_TELNET, elementAddress);
}
// TODO
if(activeFlags & CMD_UDP_FLAG)
{
// Udp commands have a source address as well
SettingsCommand(sourceTxt, SETTINGS_UDP, elementAddress);
}
}// For loop for all elements
return;
}
char* ReadElementTxt(unsigned short* len, dataElement_t* element, unsigned char mode)
{
static char output[MAX_ELEMENT_TEXT_LEN + 1];
char *ptr=output;
unsigned short length, maxLen;
// Timestamp
maxLen = &output[MAX_ELEMENT_TEXT_LEN-1] - ptr;
switch (element->dataType) {
// Raw text mode
case TYPE_TEXT_ELEMENT :{
length = element->dataLen;
if(length>maxLen)length = maxLen;
memcpy(ptr, element->data, length);
ptr += length;
break;
}
// Si44 BAX radio data packet
case TYPE_BAX_PKT :{
// Timestamp
ptr+=sprintf(ptr,"BAX,%s,",RtcToString(element->timeStamp));
// Device ID
ptr+=DumpHexToChar(ptr,&element->data[0],4,TRUE); // Little endian, data[3]=='B', '42XXXXXX'
// RSSI
ptr+=sprintf(ptr,",%ddBm,",(short)RssiTodBm(element->data[4]));
// Payload
if(element->data[5] != 1) // Encryption packet
{
ptr+=DumpHexToChar(ptr,&element->data[5],(element->dataLen-5),FALSE);
*ptr++ = '\r';*ptr++ = '\n';
}
else // Data packet
{
ptr+=sprintf(ptr,"%u,%u,%d,%u,%u.%02u,",
(element->data[5]), // pktType 1
(element->data[6]), // pktId
((signed short)element->data[7]), // xmitPwr dbm
LE_READ_16(&element->data[8]), // battmv
(element->data[11]&0xff), // humidSat MSB
(((signed short)39*(element->data[10]&0xff))/100));// humidSat LSB
ptr+=sprintf(ptr,"%d,%u,%u,%u,%u\r\n",
(signed short)LE_READ_16(&element->data[12]),// tempCx10
LE_READ_16(&element->data[14]), // lightLux
LE_READ_16(&element->data[16]), // pirCounts
LE_READ_16(&element->data[18]), // pirEnergy
LE_READ_16(&element->data[20])); // swCountStat
}
break;
}
case TYPE_MIWI_PKT :{
// Back to MiWi type packet pointer type
RECEIVED_MESSAGE* pkt = (RECEIVED_MESSAGE*)(element->data);
// Cast to TEDDI type packet
dataPacket_t* payload = (dataPacket_t*)pkt->Payload;
// Timestamp
ptr+=sprintf(ptr,"TED,%s,",RtcToString(element->timeStamp));
// Device Id
ptr+=sprintf(ptr,"%u,",payload->deviceId);
// RSSI
ptr+=sprintf(ptr,"%ddBm,",MrfRssiTodBm(pkt->PacketRSSI));
// Payload dump all
ptr+=DumpHexToChar(ptr,payload,sizeof(dataPacket_t),FALSE);
*ptr++ = '\r';*ptr++ = '\n';
break;
}
// TODO
// MRF packets
// Data annotation packets
// Error reports
default : break;
}
*len = ptr - output; // Set the return len field
*(char*)ptr = '\0'; // Always null terminate string
return output;
}
unsigned char* ReadElementBin(unsigned short* len, dataElement_t* element, unsigned char mode)
{
static unsigned char output[MAX_ELEMENT_BIN_LEN];
unsigned char *ptr=output, *ptrEnd=&output[MAX_ELEMENT_BIN_LEN-1] ;
// Start the slip pkt
*ptr++ = SLIP_END;
// Add the packet time stamp
ptr += slip_encode(ptr, &element->timeStamp, sizeof(DateTime), (ptr - ptrEnd));
switch (element->dataType) {
// Raw text mode - uses strlen, not element length
case TYPE_TEXT_ELEMENT :{
ptr += slip_encode(ptr, element->data, strlen((char*)element->data), (ptr - ptrEnd));
break;
}
// Si44 radio data packet (and probably others)
case TYPE_BAX_PKT :{
ptr += slip_encode(ptr, element->data, element->dataLen, (ptr - ptrEnd));
break;
}
// TODO
// MRF packets
// Data annotation packets
// Error reports
default : break;
}
*len = ptr - output; // Set the return len field
return output;
}
// Returns bytes written or zero for insufficient space
size_t slip_encode(void *outBuffer, const void *inBuffer, size_t length, size_t outBufferSize)
{
const unsigned char *sp = (const unsigned char *)inBuffer;
unsigned char *dp = outBuffer;
while (length--)
{
if (*sp == SLIP_END)
{
if (outBufferSize < 2) { return 0; }
*dp++ = SLIP_ESC;
*dp++ = SLIP_ESC_END;
outBufferSize -= 2;
}
else if (*sp == SLIP_ESC)
{
if (outBufferSize < 2) { return 0; }
*dp++ = SLIP_ESC;
*dp++ = SLIP_ESC_ESC;
outBufferSize -= 2;
}
else
{
if (outBufferSize < 1) { return 0; }
*dp++ = *sp;
outBufferSize--;
}
++sp;
}
return (size_t)((void *)dp - (void *)outBuffer);
}
// Simple function to dump raw ascii, capitalised hex to a buffer, non-endian, no spaces, with a null.
unsigned short DumpHexToChar(char* dest, void* source, unsigned short len, unsigned char littleEndian)
{
unsigned short ret = (len*2);
unsigned char* ptr = source;
if(littleEndian) ptr += len-1; // Start at MSB
char temp;
for(;len>0;len--)
{
temp = 0x30 + (*ptr >> 4);
if(temp>'9')temp += ('A' - '9' - 1);
*dest++ = temp;
temp = 0x30 + (*ptr & 0xf);
if(temp>'9')temp += ('A' - '9' - 1);
*dest++ = temp;
if(littleEndian)ptr--;
else ptr++;
}
*dest = '\0';
return ret;
}
//EOF
|
// make new modbus handler depend on connection type
func newHandler(p *mbParams, timeout int) (handler mblib.ClientHandler) {
switch p.ReqType {
case TCP:
h := mblib.NewTCPClientHandler(p.NetAddr)
h.SlaveId = p.SlaveID
h.Timeout = time.Duration(timeout) * time.Second
handler = h
case RTU:
h := modbus.NewRTUClientHandler(p.Serial.PortName)
h.BaudRate = int(p.Serial.Speed)
h.DataBits = int(p.Serial.DataBits)
h.Parity = p.Serial.Parity
h.StopBits = int(p.Serial.StopBit)
h.SlaveId = p.SlaveID
h.Timeout = time.Duration(timeout) * time.Second
handler = h
case ASCII:
h := modbus.NewASCIIClientHandler(p.Serial.PortName)
h.BaudRate = int(p.Serial.Speed)
h.DataBits = int(p.Serial.DataBits)
h.Parity = p.Serial.Parity
h.StopBits = int(p.Serial.StopBit)
h.SlaveId = p.SlaveID
h.Timeout = time.Duration(timeout) * time.Second
handler = h
}
return handler
} |
Dolby, Dolby Digital, Dolby Digital Plus, and Dolby E are trademarks of Dolby Laboratories Licensing Corporation. Dolby Laboratories provides proprietary implementations of AC-3 and E-AC-3 known as Dolby Digital and Dolby Digital Plus, respectively.
Although the invention is not limited to use in encoding audio data in accordance with the E-AC-3 (or AC-3 or Dolby E) format, or delivering, decoding or rendering E-AC-3, AC-3, or Dolby E encoded data, for convenience it will be described in embodiments in which it encodes an audio bitstream in accordance with the E-AC-3 or AC-3 or Dolby E format, and delivers, decodes, and renders such a bitstream.
A typical stream of audio data includes both audio content (e.g., one or more channels of audio content) and metadata indicative of at least one characteristic of the audio content. For example, in an AC-3 bitstream there are several audio metadata parameters that are specifically intended for use in changing the sound of the program delivered to a listening environment.
An AC-3 or E-AC-3 encoded bitstream comprises metadata and can comprise one to six channels of audio content. The audio content is audio data that has been compressed using perceptual audio coding. Details of AC-3 coding are well known and are set forth in many published references including the following:
ATSC Standard A52/A: Digital Audio Compression Standard (AC-3), Revision A, Advanced Television Systems Committee, 20 Aug. 2001; and
U.S. Pat. Nos. 5,583,962; 5,632,005; 5,633,981; 5,727,119; and 6,021,386.
Details of Dolby Digital Plus (E-AC-3) coding are set forth in, for example, “Introduction to Dolby Digital Plus, an Enhancement to the Dolby Digital Coding System,” AES Convention Paper 6196, 117th AES Convention, Oct. 28, 2004.
Details of Dolby E coding are set forth in “Efficient Bit Allocation, Quantization, and Coding in an Audio Distribution System”, AES Preprint 5068, 107th AES Conference, August 1999 and “Professional Audio Coder Optimized for Use with Video”, AES Preprint 5033, 107th AES Conference August 1999.
Each frame of an AC-3 encoded audio bitstream contains audio content and metadata for 1536 samples of digital audio. For a sampling rate of 48 kHz, this represents 32 milliseconds of digital audio or a rate of 31.25 frames per second of audio.
Each frame of an E-AC-3 encoded audio bitstream contains audio content and metadata for 256, 512, 768 or 1536 samples of digital audio, depending on whether the frame contains one, two, three or six blocks of audio data respectively. For a sampling rate of 48 kHz, this represents 5.333, 10.667, 16 or 32 milliseconds of digital audio respectively or a rate of 189.9, 93.75, 62.5 or 31.25 frames per second of audio respectively.
As indicated in FIG. 1, each AC-3 frame is divided into sections (segments), including: a Synchronization Information (SI) section which contains (as shown in FIG. 2) a synchronization word (SW) and the first of two error correction words (CRC1); a Bitstream Information (BSI) section which contains most of the metadata; six Audio Blocks (AB0 to AB5) which contain data compressed audio content (and can also include metadata); waste bits (W) which contain any unused bits left over after the audio content is compressed; an Auxiliary (AUX) information section which may contain more metadata; and the second of two error correction words (CRC2).
As indicated in FIG. 4, each E-AC-3 frame is divided into sections (segments), including: a Synchronization Information (SI) section which contains (as shown in FIG. 2) a synchronization word (SW); a Bitstream Information (BSI) section which contains most of the metadata; between one and six Audio Blocks (AB0 to AB5) which contain data compressed audio content (and can also include metadata); waste bits (W) which contain any unused bits left over after the audio content is compressed; an Auxiliary (AUX) information section which may contain more metadata; and an error correction word (CRC).
In an AC-3 (or E-AC-3) bitstream there are several audio metadata parameters that are specifically intended for use in changing the sound of the program delivered to a listening environment. One of the metadata parameters is the DIALNORM parameter, which is included in the BSI segment.
As shown in FIG. 3, the BSI segment of an AC-3 frame (or an E-AC-3 frame) includes a five-bit parameter (“DIALNORM”) indicating the DIALNORM value for the program. A five-bit parameter (“DIALNORM2”) indicating the DIALNORM value for a second audio program carried in the same AC-3 frame is included if the audio coding mode (“acmod”) of the AC-3 frame is “0”, indicating that a dual-mono or “1+1” channel configuration is in use.
The BSI segment also includes a flag (“addbsie”) indicating the presence (or absence) of additional bit stream information following the “addbsie” bit, a parameter (“addbsil”) indicating the length of any additional bit stream information following the “addbsil” value, and up to 64 bits of additional bit stream information (“addbsi”) following the “addbsil” value.
The BSI segment includes other metadata values not specifically shown in FIG. 3.
It has been proposed to include metadata of other types in audio bitstreams. For example, methods and systems for generating, decoding, and processing audio bitstreams including metadata indicative of the processing state (e.g., the loudness processing state) and characteristics (e.g., loudness) of audio content are described in PCT International Application Publication Number WO 2012/075246 A2, having international filing date Dec. 1, 2011, and assigned to the assignee of the present application. This reference also describes adaptive processing of the audio content of the bitstreams using the metadata, and verification of validity of the loudness processing state and loudness of audio content of the bitstreams using the metadata.
Methods for generating and rendering object based audio programs are also known. During generation of such programs, it may be assumed that the loudspeakers to be employed for rendering are located in arbitrary locations in the playback environment (or that the speakers are in a symmetric configuration in a unit circle). It need not be assumed that the speakers are necessarily in a (nominally) horizontal plane or in any other predetermined arrangements known at the time of program generation. Typically, metadata included in the program indicates rendering parameters for rendering at least one object of the program at an apparent spatial location or along a trajectory (in a three dimensional volume), e.g., using a three-dimensional array of speakers. For example, an object channel of the program may have corresponding metadata indicating a three-dimensional trajectory of apparent spatial positions at which the object (indicated by the object channel) is to be rendered. The trajectory may include a sequence of “floor” locations (in the plane of a subset of speakers which are assumed to be located on the floor, or in another horizontal plane, of the playback environment), and a sequence of “above-floor” locations (each determined by driving a subset of the speakers which are assumed to be located in at least one other horizontal plane of the playback environment). Examples of rendering of object based audio programs are described, for example, in PCT International Application No. PCT/US2001/028783, published under International Publication No. WO 2011/119401 A2 on Sep. 29, 2011, and assigned to the assignee of the present application.
Above-cited U.S. Provisional Patent Application No. 61/807,922 and above-cited U.S. Provisional Patent Application No. 61/832,397 describe object based audio programs which are rendered so as to provide an immersive, personalizable perception of the program's audio content. The content may be indicative of the atmosphere at (i.e., sound occurring in or at) and/or commentary on a spectator event (e.g., a soccer or rugby game, or another sporting event). The audio content of the program may be indicative of multiple audio object channels (e.g., indicative of user-selectable objects or object sets, and typically also a default set of objects to be rendered in the absence of object selection by the user) and at least one bed of speaker channels. The bed of speaker channels may be a conventional mix (e.g., a 5.1 channel mix) of speaker channels of a type that might be included in a conventional broadcast program which does not include an object channel.
Above-cited U.S. Provisional Patent Applications No. 61/807,922 and No. 61/832,397 describe object related metadata delivered as part of an object based audio program which provides mixing interactivity on the playback side, including by allowing an end user to select a mix of audio content of the program for rendering, instead of merely allowing playback of a pre-mixed soundfield. For example, a user may select among rendering options provided by metadata of a typical embodiment of the inventive program to select a subset of available object channels for rendering, and optionally also the playback level of at least one audio object (sound source) indicated by the object channel(s) to be rendered. The spatial location at which each selected sound source is rendered may be predetermined by metadata included in the program, but in some embodiments can be selected by the user (e.g., subject to predetermined rules or constraints). In some embodiments, metadata included in the program allows user selection from among a menu of rendering options (e.g., a small number of rendering options, for example, a “home team crowd noise” object, a “home team crowd noise” and a “home team commentary” object set, an “away team crowd noise” object, and an “away team crowd noise” and “away team commentary” object set). The menu may be presented to the user by a user interface of a controller, and the controller may be coupled to a set top device (or other device) configured to decode and render (at least partially) the object based program. Metadata included in the program may otherwise allow user selection from among a set of options as to which object(s) indicated by the object channels should be rendered, and as to how the object(s) to be rendered should be configured.
U.S. Provisional Patent Applications No. 61/807,922 and No. 61/832,397 describe an object based audio program which is an encoded audio bitstream indicative of at least some of the program's audio content (e.g., a bed of speaker channels and at least some of the program's object channels) and object related metadata. At least one additional bitstream or file may be indicative of some of the program's audio content (e.g., at least some of the object channels) and/or object related metadata. In some embodiments, object related metadata provides a default mix of object content and bed (speaker channel) content, with default rendering parameters (e.g., default spatial locations of rendered objects). In some embodiments, object related metadata provides a set of selectable “preset” mixes of object channel and speaker channel content, each preset mix having a predetermined set of rendering parameters (e.g., spatial locations of rendered objects). In some embodiments, object related metadata of a program (or a preconfiguration of the playback or rendering system, not indicated by metadata delivered with the program) provides constraints or conditions on selectable mixes of object channel and speaker channel content.
U.S. Provisional Patent Applications No. 61/807,922 and No. 61/832,397 also describe an object based audio program including a set of bitstreams (sometimes referred to as “substreams”) which are generated and transmitted in parallel. Multiple decoders may be employed to decode them (e.g., if the program includes multiple E-AC-3 substreams the playback system may employ multiple E-AC-3 decoders to decode the substreams). Each substream may include synchronization words (e.g., time codes) to allow the substreams to be synchronized or time aligned with each other.
U.S. Provisional Patent Applications No. 61/807,922 and No. 61/832,397 also describe an object based audio program which is or includes at least one AC-3 (or E-AC-3) bitstream, and includes one or more data structures referred to as containers. Each container which includes object channel content (and/or object related metadata) is included in an auxdata field (e.g., the AUX segment shown in FIG. 1 or FIG. 4) at the end of a frame of the bitstream, or in a “skip fields” segment of the bitstream. Also described is an object based audio program which is or includes a Dolby E bitstream, in which the object channel content and object related metadata (e.g., each container of the program which includes object channel content and/or object related metadata) is included in bit locations of the Dolby E bitstream that conventionally do not carry useful information. U.S. Provisional Application No. 61/832,397 also describes an object based audio program including at least one set of speaker channels, at least one object channel, and metadata indicative of a layered graph (a layered “mix graph”) indicative of selectable mixes (e.g., all selectable mixes) of the speaker channels and object channel(s). The mix graph may be indicative of each rule applicable to selection of subsets of the speaker and object channels, is indicative of nodes (each of which may be indicative of a selectable channel or set of channels, or a category of selectable channels or set of channels) and connections between the nodes (e.g., control interfaces to the nodes and/or rules for selecting channels). The mix graph may indicate essential data (a “base” layer) and optional data (at least one “extension” layer), and where the mix graph is representable as a tree graph, the base layer can be a branch (or two or more branches) of the tree graph, and each extension layer can be another branch (or set of branches) of the tree graph.
As noted, it has been proposed to include, in an object based audio program, object related metadata which indicates rendering parameters for rendering at least one object (indicated by an object channel of the program) at an apparent spatial location or along an apparent trajectory (in a three dimensional volume) using an array of speakers. For example, an object channel of the program may have corresponding metadata indicating a three-dimensional trajectory of apparent spatial positions at which the corresponding object is to be rendered. The trajectory may include a sequence of “floor” locations in a “floor” plane (where the “floor” plane is a horizontal plane which nominally includes the expected positions of the listener's ears) of the playback environment, and a sequence of “above-floor” locations above the floor plane. It has been proposed to render an object of an object based program at above-floor locations, including by generating at least one speaker feed for driving at least one “above-floor” speaker (of a playback speaker array) which is assumed to be located above the floor plane in the playback environment. Such an above-floor speaker is sometimes referred to herein as a “height” speaker.
Traditionally, audio downmixing of a multi-channel audio program is performed in accordance with a predetermined formula, to collapse (downmix) a first set of channels of the program (N channels indicative of a first soundfield, where N is an integer) down to a second set of channels (M channels indicative of a downmixed soundfield, where M is an integer less than N) for playback by an available speaker array comprising M speakers (e.g., a stereo television speaker array consisting of two speakers). During playback after downmixing, the available speaker array emits sound indicative of the downmixed soundfield. Typically, traditional downmixing of this type includes in the second set of channels (i.e., the downmix) audio content of all the channels in the first set.
If no above-floor (“height”) speaker is present in the playback system speaker array, a traditional downmixing technique (of the type mentioned above) could be employed to downmix content of an object channel with content of speaker channels of the program (where the speaker channel content is intended to be played by floor speakers of the playback speaker array), so that the resulting downmixed sound is emitted only from floor speakers of the playback speaker array. However, the inventors have recognized that because the content of the above-floor object channel would be downmixed into the content of the original speaker channels, the traditional downmixing would undesirably result in cacophonous sound upon playback of the resulting downmix (e.g., the above-floor content would be perceived as interfering with original speaker channel content).
The inventors have also recognized that a traditional downmixing technique (of the above-mentioned type) has other limitations and disadvantages, not necessarily related to the presence or absence of height speakers in the playback speaker array. For example the inventors have recognized that, even in traditional 5.1 channel audio production, compromises are often made to preserve a reasonable soundfield for a stereo downmix For example, a broadcaster may want to place a commentary (or other dialog element) in the surround channels of a 5.1 channel program, but choose not to do so since a traditionally implemented stereo downmix of the desired representation does not provide a pleasing or representative experience to stereo television viewers.
Until the present invention, it had not been known how to render downmixes of selected channels (e.g., object and speaker channels) of an object based audio program, in a manner which ensures that the downmixes are compliant with predetermined downmixing constraints (e.g., one or more downmixing constraints specified by the entity which generates and broadcasts the program, or by the program content creator) based on playback speaker array configuration (e.g., to avoid cacophonous or otherwise undesirable downmixed sound upon playback). Different embodiments of the invention apply to any and all conditions where the program is indicative of more audio channels than those available in the final reproduction environment (i.e., all conditions in which the program includes more channels (object channels and/or speaker channels) than the number of speakers, of the playback speaker array, to be driven). |
Perspective view of crater with water ice - looking east.
The European Space Agency's (ESA) Mars Express has snapped an image of a modest ice lake on the Red Planet.
The frozen patch of water ice is tucked away in an unnamed impact crater. The feature is located on Vastitas Borealis, a broad plain that covers much of the far northern latitudes.
The crater is 22 miles (35 kilometers) wide and has a maximum depth of roughly 1.2 miles (2 kilometers) beneath the crater rim.
The ice patch is present all year round, as the temperature and pressure are not high enough to allow the frozen water to escape into the atmosphere.
The poles on Mars are known to contain large quantities of water ice. At the south pole, the water ice is covered by carbon dioxide ice, commonly called dry ice. There is also ample water ice beneath the surface of Mars.
But it is not so common to see isolated patches of water ice away from the poles.
Faint traces of water ice are also visible along the rim of the crater and on the crater walls, ESA officials said. The absence of ice along the north-west rim and walls may occur because this area receives more sunlight due to the Sun's orientation.
A portion of a patch of underlying dunes is visible at one edge of the ice lake.
Colors in the High Resolution Stereo Camera (HRSC) image are very close to natural, but the vertical relief is exaggerated three times, officials said.
Mars Express reached Mars and swung into orbit on Dec. 25, 2003.
Earlier this year, ESA scientists said subsurface ice they detected on Mars could provide habitats for life. But so far, there is no convincing evidence for martian biology. |
3. A Fatal Case of Poisoning by Lidocaine Overdosage Analysis of Lidocaine in Formalin-Fixed Tissues The death of a 76-year-old man with heart disease as a result of the injection of an excessive dose of lidocaine is presented. The patient was given 5 ml of 10% lidocaine hydrochloride (500 mg) intravenously instead of 2.5 ml of 2% lidocaine hydrochloride (50 mg) in order to treat repeated paroxysmal ventricular arrhythmia. Immediately following the injection the patient had tonic clonic seizures and complete cardiopulmonary arrest followed. Although resuscitation attempts once successfully restarted his pulse and spontaneous respiration, the patient died on the eighth day after the injection. Toxicological examinations were carried out on the tissues obtained at the time of autopsy and which had been fixed in formalin solution for 40 days, and lidocaine was detected in each tissue examined. The concentrations were (ng/g or ml): parietal lobe, 308.0; occipital lobe, 208.7; temporal lobe, 318.0; frontal lobe, 223.2; cerebellum 200.9; pons 285.7; liver, 109.5; kidney 52.2; skeletal muscle 127.0; and formalin solution 8.4. In an experiment on rats we determined the concentration changes of lidocaine in formalin fixed tissues. The concentrations of lidocaine in these tissues significantly decreased to 1/3-1/4 from the original. This data shows that the cause of death was poisoning by lidocaine overdose. |
Our town centre in Colchester should be abuzz with shoppers and every shop window should be filled with an eclectic mix of shops to satiate a broad audience of consumers.
Unfortunately we are still seeing stores closing down and empty shop fronts.
We cannot place the blame on Colchester Council for the decline of the high street.
The borough council can only do so much in this current economic climate.
The root of high street decline goes higher.
I’m talking about economics on a national scale that affects the economies of local towns and cities across the country and how consumers respond to these wider economic events.
Austerity has killed off our high streets.
The government can lower taxes for businesses all it likes but unless it increases consumer confidence and disposable income then consumer demand is going to be poor.
Couple this low consumer demand with the fact that earnings haven’t risen as fast as inflation and you have a recipe for disaster.
Of course, in the past few decades consumer demand was negated by things like loans, credit and spending plans, which allows people to buy more and spread the costs out over time.
However, we now live in a period where the average level of household debt is at a peak £15,400.
We are a society drowning in and enslaved by debt and this doesn’t help consumer confidence either.
How do we regain this confidence?
Firstly, we could ease the burden on the common working people by reversing austerity and investing in our country’s infrastructure.
Secondly, ease the burden of debts on UK households and fix the debt crisis.
Decrease the cost of rents and houses on the market and, lastly, never underestimate the power of small bursts of stimulus spending to raise the disposable income of low income residents and encourage spending.
Alongside wider economic reforms we need good investment in our town centre to make it a unique place to visit.
We need a London Dungeon-style attract or a Jorvik Centre or any number of creative ideas to bring people to the centre of town as well as needing devolved powers to lower business rates.
Of course, the council has arms-length companies which could be a possible avenue for providing investment for local businesses and attractions.
The way we must think about the economy is that it’s a massive ecosystem.
It’s organic, it’s collaborative. It will also work better when money isn’t so centralised in central government and when local urban centres can have more free control over their investment. |
The Premier League has announced that Anthony Fry, a businessman who sits on the BBC Trust, is to become its new chairman.
Fry's appointment is a surprise in that he has had little previous connection with football, and the 57-year-old will succeed Sir Dave Richards in July and stand down from his position as chairman of the Finance Committee of the BBC Trust.
Chelsea chairman Bruce Buck, who led the Premier League's nominations committee, said: "We have appointed an individual with the correct blend of experience, skills, attitude and demeanour to represent the best interests of the Premier League."
Buck added: "There were a number of outstanding candidates, any of whom would have made a fine Premier League chairman, but in Anthony Fry we have appointed an individual with the correct blend of experience, skills, attitude and demeanour to represent the best interests of the Premier League.
Fry himself said: "The opportunity to become chairman of the Premier League is one that appealed hugely to me for obvious reasons.
"I have a deep-seated and long-held passion for sport and believe the skills and attributes I have developed throughout all aspects of my career will serve both the Premier League clubs and the executive extremely well.
"The league is one of the country's great success stories of recent times having overseen a period of rising playing standards, substantial investment in infrastructure and development, significant growth in attendances and viewing figures as well as the marked commercial success that has benefited the English game as a whole." |
Mexican President Enrique Pena Nieto announces in a tweet that the world's most wanted drug-lord, Joaquin ''El Chapo'' Guzman, has been arrested. Gavino Garay reports.
News of Joaquin "El Chapo" Guzman's capture came via a tweet that no one expected.. Mexican President Enrique Pena Nieto announced that, six months to the day after his escape from prison, Guzman had been arrested. The tweet reads "Mission accomplished. We've got him. I want to inform the Mexican people that Joaquin Guzman Loera has been captured." The notoriuous Guzman, considered one of the world's most powerful drug kingpins, escaped from a high security prison near Mexico City via a tunnel, six months ago. El Chapo also escaped from prison in 2001 after a previous capture in 1993. This time he was reportedly arrested in a shootout in Sinaloa that lead to multiple injuries. |
Novel All-Pass Factorization, All Solutions to Rational Matrix Equation and Control Application For an arbitrary rational matrix (RM), a new descriptor realization of its all-pass factorization is presented. The coefficients of the factors are expressed explicitly in the solution of a linear matrix inequality, which is well known in control theory. Using the all-pass factorization, necessary and sufficient conditions for existence of a solution of an equation with RMs where the unknown RM has its poles in the left closed complex half plane and it can be improper are presented, as well as all solutions. As an application of the latter result, the notion of almost disturbance decoupling, i.e., when the infimum of the ${\mathscr {H}}_{\infty}$ norm of the transfer matrix from the disturbance input to the controlled output over the stabilizing controllers is zero, is generalized. The generalization is such that instead of the whole frequency axis, the frequency axis with excluded intervals of small lengths, is considered. The controller consists of output feedback plus disturbance feedforward designed independently. A necessary and sufficient solvability condition is presented, which is expressed in terms of the given data. The three main results are illustrated by an example. |
Seeing the impossible and building the likely. Young & Deregowski state that the reason for some subjects' failure to perceive 'impossible' figures as confusing is probably that they do not integrate the stimuli, even though they see elements of the figures as depicting spatial arrangements. This suggests that such subjects should also tend to build distorted models of geometrical structures. This hypothesis was tested in the course of the present experiment. The results support the hypothesis. |
1. Field of Invention
The present invention relates to context-aware systems, in particular to context-aware systems employing sensors of varying availability.
2. Discussion of Background
Context-awareness is a key technology for the next generation of smart devices. These devices will not only know where they are, by whom they are used, and what other devices are around them, they will have a broad knowledge about what a user's desires and needs are and will act accordingly. To implement that, the devices will therefore need to utilise numerous internal and external sensors for collecting enough information to derive context information reliably.
Context, as it is used in this specification is defined by Anind Dey in “Understanding and using context”, Personal and Ubiquitous computing, special issue on Situated Interaction and Ubiquitous Computing”, Vol. 5(1), 2001, page 4-7, as any information that can be used to characterise the situation of an entity. An entity is a person, place, or object that is considered relevant to the interaction between a user and an application, including the user and applications themselves. The entity for which context information is collected is furthermore addressed as focus entity.
Knowledge about a context can be used in various ways to make applications and devices much smarter by automatically incorporating this context information. Unfortunately, context is rather complex and therefore hard to handle. The complexity results from the multiplicity of different types of context potentially derived from numerous different sensors. A tourist, e.g., moving around in a foreign city is supplied by his context-aware device with an active map and additionally with information about the sights he or she is currently viewing. In this case, the context-aware device will need—among others—information about the current location of the tourist. For the tourist being outdoors, this information can be obtained by using a Global Positioning System (GPS) but indoors, this is no longer feasible because accessing GPS satellites is impossible from within buildings. Consequently, special indoor location systems are to be used for retrieving the position information indoors. Whenever a user moves into or out of a building, his or her context-aware device has to switch to another location defining system. Handling this take-over from the outdoor to the indoor location defining system and vice a versa is currently performed on the application side, which works quite well when there are only a few possible sources of information available.
As soon as a large number of different sources have to be considered, this approach becomes impracticable. The tourist of the above example might for instance not only be interested in his own position, but also wants to know if certain persons move in or out of a certain area, e.g. if his children are going to far away. For this, a system has to utilise a large number of location sensors of different types—indoor as well as outdoor—whereby the indoor location type might also differ from building to building and therefore from person to person. The context-aware device will have to deal with this, and might have to implement the access to different types of location sensors at the same time. The configuration of a context-aware device will become even more complicated, if not only location information is used, but a wide range of different information sources like for temperature, pressure or the like to create a more complex context structure.
Anind Dey discloses a Context Toolkit developed at the Georgia Institute of Technology in “Providing Architectural Support for Building Context-Aware Applications”, PhD theses, College of Computing, Georgia Institute of Technology, December 2000. The purpose of the context tool kit is to hide the process of gathering context information in the same way that X-window widgets hide the complexity of the X-windows system from an application developer. Widgets represent a certain kind of information like e.g. a location or an activity based on data provided by sensors. X-window widgets accumulate complex graphical user interface handling functionality into one component and are accessed via a uniform interface thereby hiding the details of an underlying sensor configuration. Context aggregators sum up a number of widgets to a more complex “meta-widget” providing access to more complex context information. Interpreters transform low-level context information like a location or an activity to a more abstract higher level information, like e.g. by deducing from the information that somebody is lying in a bed with a regular low pulse that this particular person is sleeping.
The Context Toolkit is the currently most popular context handling system. It is very easy to use and simplifies the implementation of context-aware applications by providing widgets and interpreters for frequently used context types. The Context Toolkit assumes that the sensor configurations are static, i.e. the application developer determines at design time which widgets, interpreters and aggregators are to be used. Because no reconfiguration of the system is supported, the inflexible structure yields the problem, that if a sensor fails the error is propagated up to the application level.
The European funded Youngster project (IST-2000-25034) develops technologies to create a new open active mobile multimedia environment that is accessible from anywhere by a wide range of devices and networks, and that supports context-aware features including location-awareness.
Within the project, a context system for a mobile platform is evaluated, proposing in principle that all requests from context clients, i.e. context-aware devices are passed to a local context service. This service tries to resolve the requests locally by either providing shortcuts to local context sources or by reusing existing connections to context servers. If a request cannot be resolved locally, it is passed to a remote context server for further processing. Context service and context server may reside on the same host. Context sources have direct access to sensors and transform the sensor data into a format that is understood by the context server. Context sources might also be located within the server accessing the sensors only remotely.
The term context client refers to an entity requesting context information, while the term context server refers to an entity providing context information. Context clients request context information from a context server by specifying the desired information, like e.g. location. The mapping of the desired information type to the available sensors is done via the context server.
A context server creates paths from a requested data type to the available sensors. If a request cannot be mapped directly to respective sensors, a data transformation via so called context interpreters is performed.
With the paths created, a context information originates from a sensor and is afterwards translated by a context source from a proprietary format into a Youngster internal format that is understood by appropriate context interpreters. The context interpreters themselves process data and are composed within a chain. In the end of the chain, data in the originally requested format are stored in a context attribute which itself is part of a bigger data structure, the aggregator. The context attribute specifies the format, the type and through the parent context aggregator also the focus entity of the stored data.
In the context system for mobile service platforms as proposed in the Youngster project, clients do not need to have knowledge about available sensors or how to put them to use, but can transfer this task completely to the context system. The mapping from the desired type and format for the requested context information to the available sensors is done by the server by automatically creating a so-called context path. The path can be implemented in form of a linear path or a more complex structure with sensor hierarchies utilising basic and abstract sensors. Abstract sensors collect data from different basic sensors and transform the data to a certain degree. The configuration of the context path shows a tree structure with the root node being a context attribute that can be accessed from a context client.
The path from a requested data type to the available sensors has to be set up manually, which means that e.g. for all desired types and formats of context attributes a chain of context interpreters and sources has to be created and connected manually. Another possibility is to have the context clients specify what context interpreters and context attributes to use and how to connect them according to rules defined by the client. Although the advantages of an automatic and on-demand creation of a context path, like keeping the constructions of context clients simple, providing flexibility both on the client as well as on the server side, and an ease of maintenance are very obvious, no mechanism for automatically creating a context path is presently available. |
from gym.envs.registration import register
register(
id='HalideBlur-v0',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 10,
'input_image': 'alfaromeo_gray_64x.png',
'max_stage_directive': 6
},
)
register(
id='HalideBlur-v1',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 10,
'input_image': 'alfaromeo_gray_16x.png',
'max_stage_directive': 6
},
)
register(
id='HalideBlur-v2',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 11,
'input_image': 'alfaromeo_gray_16x.png',
'max_stage_directive': 8
},
)
register(
id='HalideBlur-v3',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 11,
'input_image': 'alfaromeo_gray_64x.png',
'max_stage_directive': 8
},
)
register(
id='HalideBlur-v4',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 12,
'input_image': 'alfaromeo_gray_64x.png',
'max_stage_directive': 8
},
)
register(
id='HalideHarris-v0',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 20,
'input_image': 'alfaromeo_rgb_16x.png',
'max_stage_directive': 6
},
)
register(
id='HalideHarris-v1',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 21,
'input_image': 'alfaromeo_rgb_16x.png',
'max_stage_directive': 6
},
)
register(
id='HalideHarris-v2',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 22,
'input_image': 'alfaromeo_rgb_16x.png',
'max_stage_directive': 8
},
)
register(
id='HalideHarris-v3',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 22,
'input_image': 'alfaromeo_rgb_64x.png',
'max_stage_directive': 8
},
)
register(
id='HalideHarris-v4',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 23,
'input_image': 'alfaromeo_rgb_64x.png',
'max_stage_directive': 8
},
)
register(
id='HalideInterpolate-v0',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 30,
'input_image': 'alfaromeo_rgba_16x.png',
'max_stage_directive': 12
},
)
register(
id='HalideInterpolate-v1',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 31,
'input_image': 'alfaromeo_rgba_16x.png',
'max_stage_directive': 8
},
)
register(
id='HalideInterpolate-v2',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 31,
'input_image': 'alfaromeo_rgba_64x.png',
'max_stage_directive': 8
},
)
register(
id='HalideInterpolate-v3',
entry_point='gym_halide.envs:HalideEnv',
kwargs={
'algorithm_id': 32,
'input_image': 'alfaromeo_rgba_64x.png',
'max_stage_directive': 8
},
)
|
Differential Impact of Emotion on Semantic Processing of Abstract and Concrete Words: ERP and fMRI Evidence Emotional valence is known to influence word processing dependent upon concreteness. Whereas some studies point towards stronger effects of emotion on concrete words, others claim amplified emotion effects for abstract words. We investigated the interaction of emotion and concreteness by means of fMRI and EEG in a delayed lexical decision task. Behavioral data revealed a facilitating effect of high positive and negative valence on the correct processing of abstract, but not concrete words. EEG data yielded a particularly low amplitude response of the late positive component (LPC) following concrete neutral words. This presumably indicates enhanced allocation of processing resources to abstract and emotional words at late stages of word comprehension. In fMRI, interactions between concreteness and emotion were observed within the semantic processing network: the left inferior frontal gyrus (IFG) and the left middle temporal gyrus (MTG). Higher positive or negative valence appears to facilitate semantic retrieval and selection of abstract words. Surprisingly, a reversal of this effect occurred for concrete words. This points towards enhanced semantic control for emotional concrete words compared to neutral concrete words. Our findings suggest fine-tuned integration of emotional valence and concreteness. Specifically, at late processing stages, semantic control mechanisms seem to integrate emotional cues depending on the previous progress of semantic retrieval. Emotion effects. ERP and fMRI studies demonstrate that emotion affects early as well as late word processing stages (for comprehensive reviews, see Citron 29 and Kissler, Assadollahi, & Herbert 30 ). In addition to very early emotion effects (e.g. on the P2 31 ), there are two emotion-sensitive ERP components that temporally overlap with ERP concreteness effects. The N400 is thought to reflect facilitated lexico-semantic retrieval and contextual integration of emotional words. The LPC, which usually shows larger amplitudes for emotional than neutral words 18,35,36, mirrors increased allocation of capacity-limited resources for detailed stimulus evaluation and response preparation, based on task demands 29,37. fMRI studies report emotion-related activation increases in the amygdala 38,39, parahippocampal gyrus 40,41, ventral anterior cingulate cortex (ventral ACC 42,43 ), orbitofrontal cortex 44,45, and dorsolateral and medial prefrontal cortices 46,47. The functions of these regions range from automatized integration of perceptual information to higher-order, cognition-based evaluation processes. According to the grounded cognition framework 48, word processing may involve the joint activation of language and emotion areas. This is explained by the inextricable links between a concept's linguistic representation and associated emotional aspects, physiological responses and motor correlates. For instance, processing the word "bravery" may include the partial neural re-enactment of perceptual and emotional aspects of the state it refers to. Investigating interactions between emotion and other lexico-semantic variables (such as concreteness) will allow the further specification of spatial-temporal and conceptual properties of emotion's role in semantic processing. Interaction of concreteness and emotion. Orthogonal manipulations of emotion and concreteness have, to date, yielded mixed results. Two ERP studies using lexical decision tasks (LDTs) support an amplification of the concreteness effect by emotion. A hemifield go-/no-go LDT by Kanske and Kotz 18 yielded a significant effect of emotion on the LPC for concrete words only. Based on previous findings 9, this effect was attributed to the differential engagement of mental imagery by emotional concrete words. Given current knowledge, the effect may also be explained by a high level of semantic richness and the enhanced need for semantic control elicited by emotional concrete words. In an LDT with verbs, Palazova et al. 28 found an effect of emotion at 250-300 ms that occurred for concrete words only. The authors attributed this effect to a slower access of semantic information for abstract words. The absence of an interaction in the LPC time window might be explained by the experimental design -non-delayed LDTs can prevent findings in the LPC time window due to simultaneously occurring behavioral responses 18. Compared to nouns, the use of verbs more strongly triggers the automatic access of syntactic information 49, which might also affect observations in the LPC time window 50. A different theoretical approach is inspired by the grounded cognition theory 51. It states that internal representation and processing relies on the same neural mechanisms as action and perception. As abstract concepts cannot likely be embodied via sensory or motor information, internal affective experience constitutes a probable alternative. Accordingly, Vigliocco, Meteyards, Andrews, and Kousta 52 propose a preponderance of emotional features in the representation of abstract words. However, their suggestion that the rostral ACC may be involved in emotion-sensitive processing of abstract words 26 is called into question by a fully crossed factorial investigation which did not show an interaction between emotion and concreteness in this region 53. Yet, to our knowledge, a stronger involvement of emotional valence in the processing of abstract words is supported by two studies, both of which used an orthogonal design. In an ERP concreteness judgment task, Kaltwasser, Ries, Sommer, Knight, and Willems 54 reported stronger LPC emotion effects for abstract words. Secondly, an eye tracking study by Sheikh and Titone 55 showed that higher emotional valence strongly facilitated the reading of abstract rather than concrete words. The present study. The present study aims to systematically manipulate concreteness and emotion in an LDT to pursue the following aims. First, by avoiding factors that have limited previous ERP studies, we aim to broaden our understanding of the electrophysiological correlates related to emotion and concreteness. Second, the study aims at localizing the interaction of emotion and concreteness by means of a factorial, whole brain fMRI analysis -an experimental set-up that, to our knowledge, has not yet been tested. More specifically, the present study replicates Kanske and Kotz 18 in a non-hemifield design. This is important with regard to the generalizability of ERP effects. A delayed response design is employed to capture lexico-semantic processing without response interference in the LPC time window (as in Palazova et al. 28 ) or response inhibition inherent in a go/ no-go task (as in Kanske & Kotz 18 ). By utilizing implicit processing of concreteness, it is guaranteed that the observed effects do not reflect conscious decision making processes or design characteristics of a concreteness judgment task, as in Kaltwasser et al. 54. As there is substantial evidence that LDTs evoke semantic processing 56, the terms 'lexico-semantic' and 'semantic' processing will be used interchangeably to describe the processing of written word stimuli in this type of task. With regard to the interaction of emotion and concreteness, there are two competing hypotheses that may apply to behavioral as well as ERP and fMRI signal variance. Differential activation of mental imagery by concrete and abstract words will lead to an amplification of emotion effects for concrete words. Due to stronger emotional grounding 52 of abstract versus concrete words, the emotion effect will be amplified in abstract words. fMRI effects could, according to hypothesis, reflect enhanced neural activity in brain areas associated with mental imagery, for instance left parietal and occipital areas 11,12, or the left basal temporal cortex 57. According to an embodied cognition view (hypothesis ), an interaction of emotion and concreteness could emerge within areas primarily known as emotion-related, or from the IFG. The later aids in the resolving of semantic ambiguity by retrieving an appropriate semantic context 14, while also being sensitive to emotional valence 10,58. According to hypothesis, a significant ERP interaction would be expected in the LPC time-window. In the context of hypothesis, an interaction in the N400 or LPC time window is plausible. Experimental Procedures Rating and stimuli. Word stimuli were identical to those used by Kanske and Kotz 18 and based on a previous rating study 59,60. The set of words included 240 nouns, half rated as abstract, the other half as concrete. Emotion was operationalized by emotional valence. Neutral words (50% of the stimuli) were contrasted with emotional words (negative and positive, 25% each). Arousal ratings were comparable for positive and negative words, but differed between emotional and neutral words. The stimuli did not include words that describe emotions (e.g. "fear"). To allow for a fully crossed factorial design, the subsets of concrete and abstract words each contained an equal number emotional and neutral words. An analysis of variance (ANOVA) confirmed significant effects for emotional valence, arousal, and concreteness, but not for word length, frequency of usage, and familiarity (for statistical details, see Supplementary Information (SI), Paragraph 1). We chose not to control for age of word acquisition (AoA), although it is naturally higher in abstract compared to concrete words 25. AoA is highly correlated with word frequency, length, and imageability 61 and some authors thus question independent effects of AoA on word reading 62. Experiments that controlled for word length, frequency, familiarity, imageability, and AoA simultaneously yielded comparatively artificial sets of concrete and abstract words, which also differed in valence 25. We therefore chose to carefully control for word frequency and length only, opting for a more natural stimulus set at the expense of psycholinguistic purity 63. Pseudowords were created by substitution of one letter in each word of the word set. The phonological rules of German were followed in this process. For detailed information about word and pseudoword properties, see SI, paragraph 1. The same set of words was used in the electroencephalography (EEG) and the fMRI experiment. EEG-Experiment. Participants. Thirty students of the University of Leipzig participated in the study and were paid for their participation (8€/h). The sample excluded participants of the rating study and a previous study with the same stimulus material 18. Three participants of the original sample were excluded from further data analysis because rejection of artifacts had reduced the number of valid trials in at least one condition by more than one third. The final sample included 27 participants (14 women); mean age was 24.4 years (standard deviation (SD) = 2.2). All participants were right-handed according to the Edinburgh Handedness Inventory 64 and reported normal or corrected-to-normal vision. Participants for the EEG and the fMRI experiment agreed to participate in the study after providing written informed consent. The protocol for both experiments was approved by the Ethics Committee of the University of Leipzig and carried out in line with the Declaration of Helsinki. Task and procedure. The participants completed a delayed lexical decision task (LDT), indicating whether a visually presented stimulus was a word or a pseudoword by left and right button presses. Assignment of responses to keys was counterbalanced across participants. Each trial started with the presentation of a jittered fixation cross (duration: 0, 500, 1000, or 1500 ms). Afterwards, the target stimulus (lexical word or pseudoword) was presented centrally for 200 ms. It was followed by another fixation cross, which turned red after 800 ms to signal the onset of the response window. The response window ended upon the participants' response or after a maximum of 2500 ms. Subsequently, the fixation cross turned black again for 2000 ms. The overall duration of one trial varied between 3000 and 7000 ms. After arrival and application of the EEG-cap, participants were instructed and completed four practice blocks. The first practice block consisted of 10 while the last three had 20 trials each. If less than 60% of all practice trials had been answered correctly, practice was repeated until answers were correct in at least 60% of the trials. The main experiment consisted of four blocks of 120 trials each. Hence, all target stimuli were presented once. Positive and negative words were presented in separate blocks, each with an equal number of neutral counterparts. The order of the positive and negative blocks was counterbalanced across the sample. This allowed to separately investigate effects of positive and negative valence (as in Kanske & Kotz 18 ) while avoiding stimulus proportion effects in the ERPs 65,66. Notably, this kind of block design may bias reaction time (RT) comparisons between positive and negative stimuli 67,68, a trade-off we accepted as the behavioral data were of reduced informative value (due to the delayed response design) and not the focus of our analyses. The overall duration of the EEG-recording was about 40 min. The experiment was programmed and run in ERTS (Experimental Run Time System, ERTSlab, 1999). All stimuli were presented on a computer screen with a viewing distance of approximately 100 cm. With the exception of the red fixation cross that signaled the response option, all stimuli were presented in black on a light gray background. EEG Recording. 64 Ag-AgCl electrodes were applied according to the international 10-20 system of EEG recording 69,70. The ground electrode was placed at the sternum. The left mastoid served as a reference, whereas the right mastoid was recorded actively. After recording, data were re-referenced offline to the average of both mastoids. Impedances were below 5 k for all recordings. Lateral electrodes recorded horizontal electrooculograms on both eyes; vertical eye movements were measured with two electrodes above and below the right eye. The recording was done with Brain vision professional recorder software (Brain Products GmbH, Munich, Germany) and the corresponding amplifier Brainamps. Sampling rate was 500 Hz. Recorded data were filtered online with a bandpass between DC and 250 Hz. A lowpass filter (7 Hz) was applied to correct for graphical display only. Data analysis. Performance data, grand averages of EEG data and mean extracted beta values from the fMRI data set (described below) were analyzed with the SPSS software package (Statistical Package for the Social Sciences, Version 22.0, IBM Corp., Armonk, NY). Incorrect trials were excluded from RT analysis, EEG, and fMRI analyses. Univariate repeated measures ANOVAs were conducted with error rates, RTs, ERP data, and fMRI data. Behavioral data of the EEG and the fMRI sample (which followed an equivalent experimental setup, see below) were evaluated in a single analysis. The mode of data acquisition (EEG versus fMRI) was included in a mixed design ANOVA as a between subjects factor. The factor did not yield a significant main effect nor any significant interactions. A separate analysis of positive and negative words did not yield any significant main effects of emotion (positive, negative) or interactions between emotion and concreteness in the fMRI analysis and the three ERP component analyses of interest (P2, N400, LPC). Thus, to enhance statistical power, we pooled positive and negative stimuli, using a single emotional condition for all analyses reported here. Emotion (emotional, neutral) and concreteness (concrete, abstract) served as factors in the ANOVAs of the behavioral, EEG, and fMRI data. For the sake of brevity, EEG and fMRI main effects are only reported when significant. Interactions are only described if they yielded significant follow-up analyses. Follow-up analyses for main effects and interactions were carried out as simple effect analyses and pairwise comparisons. For all ANOVAs, Greenhouse-Geisser corrected F-values are provided 71. 2 is reported as a measure of effect size 72. EEG Analysis. Preprocessing of EEG data was performed with the EEP software package (Evaluation Package EEP 3.2, Copyright © Max Planck Institute for Human Cognitive and Brain Sciences, Leipzig, Germany). Quantification of ERPs was achieved by measuring mean amplitudes during an epoch of 1000 ms after stimulus onset, relative to a 200 ms pre-stimulus baseline. Trials that exceeded 30 V for the two eye channels or 40 V for CZ and PZ within a sliding window of 200 ms were automatically rejected from the analysis. Furthermore, all trials were manually checked for artifacts. The percentage of remaining trials was calculated for each participant separately. Participants were excluded from subsequent analyses if rejection of artifacts had reduced the trial number in at least one ANOVA condition by more than one third. This procedure ensured that each cell of the ANOVA included at least 40 trials per participant. Average ERPs were computed for each condition and participant, and for each condition across participants (grand average). In order to analyze the topographic distribution of the effects of interest (cf. Kanske & Kotz 18 ; Palazova et al. 28 fMRI Experiment. Participants. Twenty-one students of University of Leipzig (11 female) volunteered for this experiment and were paid for their participation (8€/h). The sample excluded participants of the rating study, the hemifield study 18, and the EEG study. Mean age of the sample was 23.3 years (SD = 1.9). All participants reported normal or corrected-to-normal vision and were strongly right-handed according to The Edinburgh Handedness Inventory 64. Task and procedure. Task and procedure closely resembled those of the EEG study. The setup was identical except for the overall trial duration. To ensure sufficient distance between stimuli, the overall length of trials in the fMRI study was fixed to 6 seconds by adapting the duration of the last fixation cross, according to the varying length of the rest of the trial. In the EEG trials, the duration of the last fixation cross was fixed at 2000 ms, leading to variations in the overall trial length. Participants stayed in the MRI scanner for about 45 minutes. They were instructed to relax and move as little as possible. The experiment was programmed and run in ERTS (Experimental Run Time System, ERTSlab, 1999). Participants viewed the stimuli on a back-projection screen with the aid of a mirror-based system; overall viewing distance was about 100 cm. www.nature.com/scientificreports www.nature.com/scientificreports/ fMRI Data acquisition. fMRI data collection was performed on a 3.0-Tesla scanner (Bruker 30/100 Medspec system, Bruker Medizintechnik GmbH, Ettlingen, Germany) at the Max Planck Institute for Human Cognitive and Brain Sciences in Leipzig (Germany). A standard birdcage head coil was used. A high-resolution whole-head 3D Modified Driven Equilibrium Fourier Transform brain scan was acquired (128 sagittal slices, 1.5-mm thickness, FOV 25:0 25:0 19:2 cm, data matrix of 256 256 voxels) in order to exclude participants with neurological anomalies. Scout spin echo sagittal scans were collected to define the anterior and posterior commissures on a midline sagittal section. Afterwards, structural and functional (echo-planar) images were obtained from 24 axial slices parallel to the plane intersecting the anterior and posterior commissures (AC-PC plane). The whole range of slices covered almost the entire brain. For functional imaging, a gradient echo planar imaging (EPI) sequence was used (repetition time: 2.0 sec, echo time: 30 msec; 3 images per trial, flip angle: 90°, acquisition bandwidth: 100 kHz). The matrix acquired contained 64 64 voxels with an FOV of 19.2 cm, resulting in an in-plane resolution of 3 3 mm. The slice thickness was 4 mm with an interslice gap of 1 mm. fMRI Data analysis. Imaging data were analyzed using SPM 8 (Statistical Parametric Mapping software, Wellcome Trust Centre for Neuroimaging, http://www.fil.ion.ucl.ac.uk/). Functional data were re-aligned, slice-time corrected, and normalized to a standard EPI template. A spatial Gaussian filter with 8-mm full-width at half-maximum was applied for smoothing. A temporal high-pass filter with a cut-off frequency of 1/100 Hz was used to remove low-frequency variations in the blood oxygen level dependent (BOLD) signal. In order to improve motion correction, first level contrasts were specified with the rWLS toolbox 73. Individual statistical parametric maps were calculated to elucidate: emotion effects (emotional vs. neutral words), concreteness effects (concrete vs. abstract words). The individual participants' data were then analyzed using a General Linear Model for BOLD signal changes due to the experimental conditions. Concreteness (concrete, abstract) and emotion (emotional, neutral) served as factors in a univariate repeated measures ANOVA. In a separate SPM analysis, a direct contrast of positive and negative stimuli yielded no significant differences, thus supporting the pooling of the two emotion conditions. Correction for multiple comparisons was accomplished by a combination of individual voxel probability thresholding and minimum cluster size thresholding in 3DClustSim (http://afni.nimh.nih.gov/pub/dist/doc/program_ help/3dClustSim.html -updated version, released August 2016). Based on Monte Carlo simulations, a minimum cluster size of k = 53 was calculated to ensure a given alpha level of false positive findings ( = 0.05, two-sided) for a given voxelwise p-value level (p = 0.001). Follow-up analyses for main effects and interactions were carried out as simple effect analyses and pairwise comparisons of mean percent BOLD signal change. Behavioral and EEG data are publicly available via the Open Science Framework (https://osf.io/hcujt/). Unthresholded 2 nd level fMRI contrasts can be retrieved via Neurovault (https://identifiers.org/neurovault.collection:5922). Results Performance data. EEG and fMRI performance data were evaluated in a single analysis, thus containing all participants from the two final samples (n = 48). When included into a mixed design ANOVA, the mode of data acquisition (EEG, fMRI) did not yield a significant main effect or significant interactions. The majority of trials were answered correctly (95.3%, SD = 4.0%). Mean RT across all trials was 388.. Error rate analysis also showed a significant interaction between emotion and concreteness (F = 6.77, P < 0.05, 2 = 0.13). The difference between emotional and neutral words was only significant for abstract (F = 15.55, P < 0.001, 2 = 0.25), but not for concrete words, with particularly high error rates in the neutral abstract condition. Means and SDs of error rates and RTs can be seen from Table 1. EEG Results. ERPs elicited by concrete and abstract words are displayed in Fig. 1 while ERPs for emotional and neutral words can be seen in Fig. 2. Figure 3 illustrates the interaction between concreteness and emotion by displaying the emotion effect separately for concrete and abstract words. A time-line analysis of 50 ms segments allowed for an overview of ERP effects -see Table 2. Descriptively, an N1 (peak around 100 ms) and a P1 (peak around 150 ms) were followed by another positive peak around 230-260 ms, an N400 (peak at 320-370 ms), and an LPC (420-550 ms). Main effects of concreteness occurred from 300-600 and 650-800 ms after stimulus onset (Fs www.nature.com/scientificreports www.nature.com/scientificreports/ concreteness and emotion was observed in the interval 450-500 ms after stimulus onset (F = 5.21, P ≤ 0.03, 2 = 0.17). Based on visual inspection of ERP developments and the time-line analysis, we decided to further explore the effect of three ERP components. Repeated measures analyses were conducted for the latency intervals of 200-300 ms (P2 component), 300-400 ms (N400 component), and 400-550 ms (LPC). Due to the central peak of the concreteness effects, we ran an identical set of analyses including the central electrodes (see SI, paragraph 3). Observing an identical patterns of results, we chose to report the set-up with larger spatial coverage and better comparability to our previous work. Supplementary Fig. 1 depicts the fMRI main effects of concreteness and emotion. In comparison to concrete words, abstract words elicited increased activity in the orbital part of the left IFG. A part of the right middle frontal gyrus was activated in response to neutral as compared to emotional words. The contrasts concrete > abstract and emotional > neutral did not yield any suprathreshold clusters. Figure 4 illustrates the interaction between concreteness and emotion. Analyses revealed a significant interaction in the pars triangularis of the left IFG and a part of the left middle MTG. In both regions, the BOLD signal emotion effect was inversed when comparing concrete with abstract words. The BOLD signal patterns indicated enhanced neural activity in response to emotional concrete and neutral abstract words as compared to neutral concrete and emotional abstract words. Pairwise post-hoc comparisons revealed that the effects of emotion were significant for concrete as well as abstract words in MTG as well as IFG (Fs ≥5.68, Ps ≤0.027, all 2 ≥ 0.22). Discussion The present study investigated the interplay of word concreteness and emotional valence in a lexical decision task. We hypothesized to observe either a stronger emotion effect on concrete words (due to the stronger involvement of mental imagery) or a stronger emotion effect on abstract words (due to the stronger emotional grounding). Error rates and MRI findings in the left IFG and left MTG support amplified emotional grounding of abstract words. However, the MRI contrasts of concrete words and the interaction in the LPC component of the EEG data cannot clearly be interpreted in favor of either hypothesis. Instead, they point towards the importance of semantic control mechanisms and the availability of semantic retrieval cues. These interpretations will be discussed in detail below. Concreteness effects. Concreteness effects in performance data, the N400 and the LPC replicate previous results 9, 18. The relation of N400/LPC amplitudes to mental imagery and lexico-semantic retrieval remains subject to discussion. From our fMRI results and the scalp distribution of the ERP results, it seems possible that the N400 and LPC concreteness effects both originate in the IFG, as described by Adorni and Proverbio 22. This would crucially challenge current interpretations of concreteness effects in the N400 (e.g. Holcomb et al. 8 ) and LPC (e.g. Kanske & Kotz 18 ). Holcomb et al. attribute the enlarged N400 response of concrete words to the increased need for semantic integration following a heightened co-activation of semantic neighbors. This contradicts a hypothetical origin of the N400 concreteness effect in the IFG, as IFG activation patterns are known to reflect a heightened need for semantic integration in abstract, but not concrete words. Further, the current literature on IFG function does not mention its involvement in mental imagery, which is fundamental to the LPC account proposed by Kanske and Kotz 18. In the current study, all ERP components displayed a comparatively early time course, with the N400 appearing at www.nature.com/scientificreports www.nature.com/scientificreports/ 300-400 ms and the LPC appearing at 400-550 ms after stimulus onset. This may be due to low task demands, the central presentation of the stimuli, and the sole recruitment of young, highly proficient students. Additionally, a significant effect of concreteness was found 650-800 ms after stimulus onset, possibly constituting a prolonged LPC concreteness effect 8,28. Occurring directly prior to the response option onset at 800 ms, it may also represent a response-locked, lateralized readiness potential 74, which varies with concreteness due to the slower processing of abstract words. Enhanced activation of the left IFG falls in line with abstract words requiring elaborated memory retrieval of semantic information 15,75,76 and top-down control of semantic selection 14,77. The peak activation was observed in the posterior part of the IFG, a region that seems to be particularly involved in top-down controlled selection between semantic information and the handling of semantic complexity 17. In summary, fMRI results confirm the importance of top-down semantic control in the processing of abstract words. Emotion effects. The often seen behavioral facilitation effect of emotional words was only significant in the error rates. The absence of an emotion effect in the RTs most likely results from a buffering of speed advantages caused by the delayed response design. The N400 and the LPC data indicate in-depth processing of emotional valence despite the absence of an RT effect. Early (P2) as well as late (N400 and LPC) ERP emotion effects replicate previous findings. They suggest that emotional words are processed with higher early selective 31,34 and sustained attention 37 as well as enhanced resources for stimulus evaluation at later semantic processing stages 78. The replication of the N400 emotion effect 79,80 emphasizes the complexity of lexico-semantic processing at this stage. It affirms van Berkum's notion 81 that a multitude of semantic factors may act as lexico-semantic retrieval cues, for instance the interpretive context and relevance signals such as emotional connotation. Additionally, a significant main effect of emotion was found at 700-750 ms. It might reflect a response-locked, lateralized readiness potentials that varies with emotional valence 82. Alternatively, it could be part of a long-lasting slow wave positivity linked to memory encoding and top-down influences on emotion evaluation 78. The fMRI data suggest that the right middle frontal gyrus, a part of the dlPFC, was selectively involved in the processing of neutral words. This area regulates inhibitory processes 83 and sustained attention 84 and is sensitive to emotional valence in cognitive tasks 85,86 with mixed polarity regarding emotional valence. That is, enhanced activation is reported in response to neutral 45 as well as emotional words 41,46. In the current study, a comparatively long and monotonous procedure may have increased the need for control of sustained attention, which could, due to their lower intrinsic salience, have been particularly high for neutral words. Interaction effects. Error rate data yielded a facilitation effect of high emotional valence on abstract, but not concrete words. This is in accordance with emotional valence playing a more pronounced role in the grounding of abstract words. Accordingly, the processing of neutral abstract words may be especially prone to errors because it can neither be based on re-enactment of perceptual nor of emotional states. Table 3. fMRI peak activations. H = hemisphere; x,y,z = MNI coordinates of peak voxel; k = cluster size (number of voxels); zmax = peak z value, BA = Brodmann area; IFG = Inferior Frontal Gyrus. www.nature.com/scientificreports www.nature.com/scientificreports/ In the current data, as well as in similar studies 18, a lack of coherence between behavioral performance and LPC amplitude differences constitutes an obstacle in interpreting interactions between emotion and concreteness. Improved performance for concrete compared to abstract words is accompanied by smaller LPC responses, whereas improved performance of emotional compared to neutral words is associated with larger LPC responses. Consequently, a conceptual explanation of the behavioral effects cannot straightforwardly relate to LPC amplitude differences. Therefore, our interpretation builds on a more resource-oriented LPC account. Regarding emotion effects, larger LPC amplitudes are associated with the increased allocation of processing resources through sustained attention 37,78. Thereby, LPC amplitude differences do not display a consistent direction in comparisons between emotional and neutral words. Most of the time, allocation of processing resources is higher for emotional than neutral stimuli 35,36. However, this effect may reverse 87, as allocation is strongly adaptive to task requirements 88. In the current data, larger LPC amplitudes for emotional words presumably originate from intensified late processing caused by their higher salience. Larger LPC amplitudes of abstract compared to concrete words, however, could be linked to amplified late semantic processing caused by slowed lexico-semantic retrieval at earlier stages. Thus, the significant LPC interaction possibly reflects sustained efforts in the processing of abstract and emotional words at late processing stages. This may result in particularly low availability of late processing resources for neutral concrete words, as reflected in a comparatively small LPC amplitude. An initially slowed retrieval of abstract semantics may be compensated for by a subsequently increased allocation of processing resources. This effect might be especially pronounced in emotional abstract words. A resource-oriented interpretation of the LPC could also incorporate the increased allocation of resources to late elaboration in mental imagery. Notably, the interaction in the current study was most pronounced at left anterior electrode sites. This would be in line with the hypothesized origin of the LPC in the IFG. In the fMRI data, no interaction occurred in a region typically involved in mental imagery or emotion processing. Rather, interactions were observed in the pars triangularis of the left IFG and in the left MTG. The left IFG and MTG are integral parts of the functional neuro-anatomical network for the semantic processing of words 17,89. The MTG is involved in storage and activation of lexical information as well as their integration with semantic context. The IFG provides strategic, top-down control of lexical-semantic retrieval (anterior IFG) and selection between competing semantic alternatives (posterior IFG) 17. Therefore, our findings presumably reflect varying activation within the semantic processing system. Similar, cross-over interactions were observed in both clusters: the emotion effect of the BOLD signal was inversed when comparing concrete and abstract words. Surprisingly, this suggests that emotional valence facilitates semantic retrieval of abstract words, but elicits a higher need for top-down semantic control in concrete words. We therefore propose that emotional valence may, under specific circumstances, lead to additional processing load in the semantic selection process. This may happen if word properties other than emotional valence provide sufficient cues for the retrieval of lexico-semantic information. In concrete words, a sufficiently high number of lexico-semantic retrieval cues is available at early processing stages. Thus, subsequent semantic retrieval triggered by emotional cues may lead to a surplus of semantic information. Top-down controlled selection between semantic competitors may then be necessary at later processing stages. Regarding MTG and IFG activation, this would be reflected by the significantly more positive BOLD signal change following emotional concrete words than neutral concrete words. In the case of abstract words, comparatively few retrieval cues are available at early stages of word processing. Therefore, retrieval cues such as emotional connotation may facilitate semantic retrieval at later stages. This would reduce the need for top-down semantic control in emotional abstract compared to neutral abstract words. Here, the effect would be reflected by the significantly less positive BOLD signal change for emotional abstract than neutral abstract words. Notably, the temporal delay in the processing of abstract words (also visible through the delayed occurrence of the early posterior negativity (EPN) 28 ) seems to play a key role in understanding this type of inverse effect of emotion. Nakic et al. 42 reported that the IFG reacts quite sensitively to variable "selection load", with negative valence influencing IFG activation dependent upon word frequency. This reinforces the notion that the amount of semantic information available early on may influence the integration of valence in semantic processing. Similar cross-over interactions between emotion and concreteness have been reported in performance of a semantic categorization task 90 and a concreteness judgement task 54. Interestingly, there also is evidence for a non-linear relationship between semantic context activation and the N400 amplitude. Abstract words elicit similar N400 amplitudes as concrete words that have a high number of semantic associates 20,21. Regarding our a priori hypotheses, the current data offer evidence in favor of grounded cognition. fMRI as well as ERP data support facilitated retrieval of emotional abstract words, especially at late, top-down controlled processing stages. This is consistent with the behavioral finding that neutral abstract words are especially prone to erroneous processing. Emotional valence may compensate for initially slowed processing of emotional abstract, but not neutral abstract words. Nevertheless, this interpretation is in need of further corroboration regarding the LPC (specifically, whether the modulation of this component indeed reflects allocation of processing resources) and the seemingly detrimental effect of emotional grounding on concrete words. It seems unlikely that the observed MRI interaction is based on differential degrees of mental imageability 9. Imageability widely differs between emotional concrete and neutral abstract words, which contradicts similar BOLD signal changes for the two types of words. Moreover, the IFG does not seem to be involved in modality-specific visual processing 91. Nevertheless, it is possible that visual semantic information is involved in emotion-dependent semantic processing. Abstract words can be represented through the building of complex visual scenes 92. It is possible that such processes facilitate the processing of emotional abstract words, e.g. through enhanced retrieval of visual semantics. Independent of focusing on verbal or sensory aspects of semantic information, a profound understanding of the observed interaction pattern requires an understanding of the apparently heightened need for semantic control following emotional concrete words. It is important to clarify whether emotional cues influence the selection between semantic competitors or evoke additional retrieval of semantic information. Given the current results, investigating the threshold of lexico-semantic information that is necessary for sufficient semantic processing provides the most sensible starting point for this undertaking. 9:14439 | https://doi.org/10.1038/s41598-019-50755-3 www.nature.com/scientificreports www.nature.com/scientificreports/ Conclusion. We have demonstrated that emotional valence significantly modulates semantic processing as a function of word concreteness. The ERP data aligne this effect to late stages of word processing, that is, stages of elaborated semantic processing. The fMRI data imply that emotion modulates semantic processing in a top-down, controlled, highly context-sensitive manner. With regard to grounded cognition theories, it would be of interest to know how this kind of cortical, higher-order modulation differs from stimulus-driven, subcortical influences (for example, amygdala activation in response to written emotional words 44 ). With respect to concreteness theories, our findings emphasize the importance of semantic control mechanisms. Current explanations of the concreteness effect 8 do not include assumptions about controlled adaptation to the wider semantic context, for example, emotional connotation. Behavioral abstractness effects 25 underline the relevance of mechanisms that potentially compensate for otherwise slowed processing of abstract words. In summary, it seems more important to ask how, and not whether, internal sensorimotor associations and affective states provide experiential grounding for a semantic concept. Our data show that the semantic system is sensitive to emotional retrieval cues as well as to word concreteness, and further, that it engages in complex higher-order semantic control when integrating both. The ways in which different kinds of sensorimotor and emotion grounding are mediated, integrated, and controlled remain subject to discussion. |
A Convergence of Psychological and Sociological Explanations of Witchcraft performs "anything in the nature of a therapeutic manipulation: this is the field of other healing experts, medicine men proper, and the shaman sometimes instructs his clients to seek treatment of this sort. Spirit possession is a means of discovering the right treatment, and not part of it" (Nadel 1946:26). As can be seen, some of the procedures undergone by at least some patients eeking recovery are handled in an empirical way by practitioners who do not deal with the supernatural. This important aspect of the medical system would by definition be excluded from a study that places emphasis entirely on the supernatural spects of curing. Ethnographic reports abound in details about beliefs in the supernatural causation of disease and about curing ceremonies, but seldom does one find detailed information about diseases not believed to be caused by supernatural agents or about the means of treating them. I am inclined to believe that such differences in reporting are due in most cases to bias towards the study of the supernatural components of the medical system-in turn conditioned by the strong influence that theories of religion have exerted upon our way of looking at native medical systems-rather than to the actual absence or relative unimportance of etiological concepts of nonsupernatural nature in the cultures tudied. The fact that in most cultures we find empirical treatments not only for nonsupernatural i lness, but also for illness believed to be supernaturally caused should make us aware of the importance of nonsupernatural elements in native medical systems. If illnesses declared to be caused supernaturally are treated empirically aswell as ritually, we should explore the possibility of the existence of nonsupernatural components in illness aid to have supernatural causation-unless we are prepared to accept that empirical treatment in such cases is conceptually groundless and superfluous. For fieldwork and analysis, I have found it convenient to use a conceptual framework similar to that put forward by Evans-Pritchard (1937:12, and chap. 4), in which a distinction is made between supernatural and nonsupernatural etiological categories, on the one hand, and immediate and ultimate causes of illness, on the other. (The labels I use here differ slighdy from Evans-Pritchard's, but the concepts are basically the same.) Supernatural etiological categories refer to those explanations that place the origin of disease in suprasensible forces, agents, or acts that cannot be directly observed. Explanations of disease such as sorcery, witchcraft, spirit intrusion, susto, evil eye, and the like fall into this category. Nonsupernatural explanations of disease are those which are based entirely on observable cause-and-effect relationships, regardless of whether or not the relationship established is mistaken because of incomplete or faulty observation. A diagnosis that attributes a person's weakness and malaise to the profuse bleeding resulting from a wound is based on an explanation of the nonsupernatural type, but so is the belief that the wounded person died because the swelling that started at the wound progressed up to his heart. The assertion that such death was caused by sorcery is an explanation from the supernatural category. Immediate causes account for disease in terms of the perceived pathogenic agent; ultimate causes explain the fundamentals that govern or condition the occurrence of disease. In Evans-Pritchard's words, immediate causes explain how diseases happen, ultimate causes why they happen (1937:71-72). In the example given above, the wound, the bleeding, and the swelling reaching a vital organ are immediate causes and sorcery is the ultimate cause. There is in thisexamplea coincidence of supernatural etiological categories and ultimate causes of illness, on the one hand, and nonsupernatural categories and immediate causes, on the other. However, this is not always the case; the relationships have to be determined for each culture on the basis of research.' In Latin America given case of illness may well be described as stomach ulcer (nonsupernatural etiological category) resulting from excessive hot-food intake (immediate cause) and attributed to God's will (ultimate cause). In this example there is no coincidence between the nonsupernatural etiological category and immediate cause, and no reference is made to supernatural etiology. In the system of scientific medicine the same ailment might be said to be cancer (nonsupernatural etiological category) caused byan as yet unisolated virus (immediate cause), without reference to either ultimate causation or supernatural etiological categories. It can be seen that the interplay of the four constructs may vary from one culture to another, and even within the same culture in different instances of illness. Careful eliciting, observation, and reporting are necessary to determine such interplay. |
Police and US Government Relations Chapter 4 discusses the strained relations between the Black Panthers and the Kansas City, Missouri, police department and the federal government. Police hostility toward Pete ONeal resulted in frequent traffic stops, constant surveillance, and other harassing tactics. A newspaper article by a Panther that applauded the death of John Edward Dacy, a local policeman, infuriated the police. The Panthers publically charged Police Chief Clarence Kelley with the sale of confiscated weapons to right-wing organizations. Black and white citizens expressed concern over the brutal beating police inflicted on four unarmed Panthers who tried to attend the police chiefs press conference. The U.S. House Committee on Internal Security conducted investigations and held hearings on the Kansas City Black Panther Party but produced no evidence of criminal activity by the Panthers. |
<reponame>ystk/debian-openmpi
/*
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef OMPI_MTL_PORTALS_REQUEST_H
#define OMPI_MTL_PORTALS_REQUEST_H
struct ompi_mtl_portals_request_t {
struct mca_mtl_request_t super;
bool free_after;
struct ompi_convertor_t *convertor;
volatile bool is_complete;
int event_count;
int (*event_callback)(ptl_event_t *ev, struct ompi_mtl_portals_request_t*);
};
typedef struct ompi_mtl_portals_request_t ompi_mtl_portals_request_t;
#endif
|
<gh_stars>1-10
package com.massivecraft.massivecore.util;
import com.google.gson.reflect.TypeToken;
import com.massivecraft.massivecore.MassiveCore;
import com.massivecraft.massivecore.SenderPresence;
import com.massivecraft.massivecore.SenderType;
import com.massivecraft.massivecore.collections.MassiveSet;
import com.massivecraft.massivecore.event.EventMassiveCorePlayerLeave;
import com.massivecraft.massivecore.event.EventMassiveCoreSenderRegister;
import com.massivecraft.massivecore.event.EventMassiveCoreSenderUnregister;
import com.massivecraft.massivecore.mixin.MixinActual;
import com.massivecraft.massivecore.mixin.MixinPlayed;
import com.massivecraft.massivecore.store.SenderEntity;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import java.io.File;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListMap;
/**
* Identification of a CommandSender can be done in 4 different ways.
*
* 1. CommandSender sender (the sender itself)
* 2. UUID senderUuid (the uuid for the sender)
* 3. String senderId (the string id for the sender)
* 4. String senderName (the name for the sender)
* (5). Object senderObject (any of the four above)
*
* This works very fine for players (instances of the Player class).
* The UUID would be the Mojang account uuid, the id would be the stringified UUID and the name would be the current player name (it's always unique even though it can be changed).
*
* Then there is the server console command sender (instance of ConsoleCommandSender).
* This one does not natively have a proper uuid, id or name.
* I have however given it some.
* It's very often practical being able to treat the console as any player.
*
* We provide the following features:
* - Lookup of all the data based on one of the unique parts.
* - Maintained sets for All, Online and Offline.
*
* Players are registered automatically.
* Console is registered with imaginary and deterministic data values.
* Non standard CommandSenders must be manually registered using the register method.
*/
public class IdUtil implements Listener, Runnable
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
// This class mostly contains static content.
// A few things needs an instantiated class though.
// Such as the event listeners.
private static IdUtil i = new IdUtil();
public static IdUtil get() { return i; }
// -------------------------------------------- //
// CONSTANTS
// -------------------------------------------- //
// Taken directly from my own imagination!
public final static String IDPREFIX = "@";
public final static String CONSOLE_ID = IDPREFIX+"console";
public final static IdData CONSOLE_DATA = new IdData(CONSOLE_ID, CONSOLE_ID);
// This is lock object is used when reading from and saving to this file.
// Useful since saving might happen async.
private final static Object CACHEFILE_LOCK = new Object();
public final static File CACHEFILE = new File(MassiveCore.get().getDataFolder(), "idnamecache.json");
public final static File CACHEFILE_TEMP = new File(MassiveCore.get().getDataFolder(), "idnamecache.json.temp");
public final static Type CACHEFILE_TYPE = new TypeToken<Set<IdData>>() {}.getType();
// -------------------------------------------- //
// DATA STORAGE
// -------------------------------------------- //
// IdData storage. Maintaining relation between name and id.
// The full set
private static Set<IdData> datas = Collections.newSetFromMap(new ConcurrentHashMap<>());
public static Set<IdData> getDatas() { return datas; }
// Id Index
private static Map<String, IdData> idToData = new ConcurrentSkipListMap<>(String.CASE_INSENSITIVE_ORDER);
public static Map<String, IdData> getIdToData() { return idToData; }
// Name Index
private static Map<String, IdData> nameToData = new ConcurrentSkipListMap<>(String.CASE_INSENSITIVE_ORDER);
public static Map<String, IdData> getNameToData() { return nameToData; }
// -------------------------------------------- //
// MAINTAINED SETS
// -------------------------------------------- //
// Used for chat tab completion, argument readers, etc.
private static SenderMap maintainedIds = new SenderMap();
public static SenderMap getMaintainedIds() { return maintainedIds; }
public static Set<String> getIds(SenderPresence presence, SenderType type)
{
return maintainedIds.getValues(presence, type);
}
private static SenderMap maintainedNames = new SenderMap();
public static SenderMap getMaintainedNames() { return maintainedNames; }
public static Set<String> getNames(SenderPresence presence, SenderType type)
{
return maintainedNames.getValues(presence, type);
}
// -------------------------------------------- //
// REGISTRY
// -------------------------------------------- //
// For registering extra custom CommandSender implementations.
// It's assumed that the getName() returns the name which is also the id.
private static Map<String, CommandSender> registryIdToSender = new ConcurrentHashMap<>();
public static Map<String, CommandSender> getRegistryIdToSender() { return Collections.unmodifiableMap(registryIdToSender); }
private static Map<CommandSender, String> registrySenderToId = new ConcurrentHashMap<>();
public static Map<CommandSender, String> getRegistrySenderToId() { return Collections.unmodifiableMap(registrySenderToId); }
public static void register(CommandSender sender)
{
if (sender == null) throw new NullPointerException("sender");
String id = getId(sender);
String name = id;
IdData data = new IdData(id, name);
registryIdToSender.put(id, sender);
registrySenderToId.put(sender, id);
// Update data before the event is ran so that data is available.
update(id, name, SenderPresence.LOCAL);
EventMassiveCoreSenderRegister event = new EventMassiveCoreSenderRegister(sender, data);
event.run();
}
public static void unregister(CommandSender sender)
{
if (sender == null) throw new NullPointerException("sender");
String id = getId(sender);
String name = id;
IdData data = new IdData(id, name);
Object removed = registryIdToSender.remove(id);
registrySenderToId.remove(sender);
if (removed == null) return;
// Update data before the event is ran so that data is available.
update(id, name, SenderPresence.OFFLINE);
EventMassiveCoreSenderUnregister event = new EventMassiveCoreSenderUnregister(sender, data);
event.run();
}
// -------------------------------------------- //
// GET ONLINE SENDERS
// -------------------------------------------- //
// Used for retrieving the full set of senders currently present on this server.
public static Set<CommandSender> getLocalSenders()
{
Set<CommandSender> ret = new MassiveSet<>();
// Add Online Players
ret.addAll(Bukkit.getOnlinePlayers());
// Add Console
ret.add(getConsole());
// Add Registered
ret.addAll(registryIdToSender.values());
return ret;
}
// -------------------------------------------- //
// UPDATE ONE
// -------------------------------------------- //
// Returns the name corresponding to the removed id.
private static String removeId(String id)
{
if (id == null) throw new NullPointerException("id");
maintainedIds.removeValueCompletely(id);
IdData data = idToData.remove(id);
if (data == null) return null;
datas.remove(data);
return data.getName();
}
// Returns the id corresponding to the removed name.
private static String removeName(String name)
{
if (name == null) throw new NullPointerException("name");
maintainedNames.removeValueCompletely(name);
IdData data = nameToData.remove(name);
if (data == null) return null;
datas.remove(data);
return data.getId();
}
private static void addData(IdData data, SenderPresence presence)
{
if (data == null) throw new NullPointerException("data");
if (presence == null) throw new NullPointerException("presence");
String id = data.getId();
String name = data.getName();
datas.add(data);
if (id != null)
{
idToData.put(id, data);
}
if (name != null)
{
nameToData.put(name, data);
}
if (id != null && name != null)
{
List<SenderPresence> presences = SenderMap.getPresences(presence);
maintainedIds.addValue(id, presences);
maintainedNames.addValue(name, presences);
}
}
public static void update(String id, String name)
{
update(id, name, null);
}
public static void update(String id, String name, long millis)
{
update(id, name, millis, null);
}
public static void update(final String id, final String name, SenderPresence presence)
{
update(id, name, System.currentTimeMillis(), presence);
}
public static void update(IdData data)
{
update(data.getId(), data.getName(), data.getMillis(), null);
}
public static void update(final String id, final String name, final long millis, SenderPresence presence)
{
// First Null Check
if (id == null && name == null) throw new NullPointerException("Either id or name must be set. They can't both be null.");
// Calculate previous millis
// The millis must be newer than the previous millis for the update to continue.
Long previousMillis = null;
Long idMillis = getMillis(id);
if (idMillis != null && (previousMillis == null || idMillis < previousMillis))
{
previousMillis = idMillis;
}
Long nameMillis = getMillis(name);
if (nameMillis != null && (previousMillis == null || nameMillis < previousMillis))
{
previousMillis = nameMillis;
}
// The previousMillis is now null or the lowest of the two.
if (previousMillis != null && previousMillis > millis) return;
// Presence Fix
if (presence == null)
{
if (id != null)
{
presence = maintainedIds.getPresence(id);
}
else if (name != null)
{
presence = maintainedNames.getPresence(name);
}
}
// Removal of previous data
removeIdAndNameRecurse(id, name);
// Adding new data
IdData data = new IdData(id, name, millis);
addData(data, presence);
}
private static void removeIdAndNameRecurse(String id, String name)
{
String otherId = null;
String otherName = null;
// Remove first
if (id != null) otherName = removeId(id);
if (name != null) otherId = removeName(name);
// If equal, then null. We shouldn't perform the same operation twice.
if (otherId != null && otherId.equals(id)) otherId = null;
if (otherName != null && otherName.equals(name)) otherName = null;
// If any isn't null. Repeat
if (otherId != null || otherName != null)
{
removeIdAndNameRecurse(otherId, otherName);
}
}
// -------------------------------------------- //
// SETUP
// -------------------------------------------- //
// This is ran as the initial setup.
// Do not call this manually.
// It should only be called on plugin enable.
@SuppressWarnings("deprecation")
public static void setup()
{
// Time: Start
long start = System.currentTimeMillis();
// Clear Datas
datas.clear();
idToData.clear();
nameToData.clear();
maintainedIds.clear();
maintainedNames.clear();
// Load Datas
loadDatas();
// Since Console initially does not exist we schedule the register.
Bukkit.getScheduler().scheduleSyncDelayedTask(MassiveCore.get(), () -> register(getConsole()));
// Cachefile
long ticks = 20*60; // 5min
Bukkit.getScheduler().scheduleAsyncRepeatingTask(MassiveCore.get(), get(), ticks, ticks);
// Register Event Listeners
Bukkit.getPluginManager().registerEvents(get(), MassiveCore.get());
// Time: End
long end = System.currentTimeMillis();
MassiveCore.get().log(Txt.parse("<i>Setup of IdUtil took <h>%d<i>ms.", end-start));
}
// -------------------------------------------- //
// LISTENER
// -------------------------------------------- //
// Here we maintain the maps continuously.
// Filling them on setup only would not work.
// When players log on/off that must be taken note of.
// We don't care if it's cancelled or not.
// We just wan't to make sure this id is known of and can be "fixed" asap.
// Online or not? We just use the mixin to get the actuall value.
@EventHandler(priority = EventPriority.LOWEST)
public void playerLoginLowest(PlayerLoginEvent event)
{
Player player = event.getPlayer();
if (MUtil.isntPlayer(player)) return;
UUID uuid = player.getUniqueId();
String id = uuid.toString();
String name = player.getName();
// Declaring Existence? Sure, whatever you were before!
// It can definitely not be local at this point.
// But online or offline is fine.
boolean online = MixinPlayed.get().isOnline(player);
update(id, name, SenderPresence.fromOnline(online));
}
// Can't be cancelled
@EventHandler(priority = EventPriority.LOWEST)
public void playerJoinLowest(PlayerJoinEvent event)
{
Player player = event.getPlayer();
if (MUtil.isntPlayer(player)) return;
UUID uuid = player.getUniqueId();
String id = uuid.toString();
String name = player.getName();
// Joining? The player must be local at this point.
update(id, name, SenderPresence.LOCAL);
}
// Can't be cancelled
@EventHandler(priority = EventPriority.HIGHEST)
public void playerLeaveMonitor(EventMassiveCorePlayerLeave event)
{
Player player = event.getPlayer();
if (MUtil.isntPlayer(player)) return;
UUID uuid = player.getUniqueId();
String id = uuid.toString();
String name = player.getName();
// Leaving? Is it an actuall leave?
SenderPresence presence;
if (MixinActual.get().isActualLeave(event))
{
// They actually left.
// They are offline.
presence = SenderPresence.OFFLINE;
}
else
{
// They didn't actually leave.
// They are online, but not local.
presence = SenderPresence.ONLINE;
}
update(id, name, presence);
}
// -------------------------------------------- //
// GET DATA
// -------------------------------------------- //
// Get data from a senderObject (any of: CommandSender, UUID, String id, String name)
// These methods avoid using the data cache if possible.
public static IdData getData(Object senderObject)
{
// Null Return
if (senderObject == null) throw new NullPointerException("senderObject");
// Already Done
if (senderObject instanceof IdData) return (IdData) senderObject;
// Console Type
if (senderObject instanceof ConsoleCommandSender) return CONSOLE_DATA;
// Console Id/Name
if (CONSOLE_ID.equals(senderObject)) return CONSOLE_DATA;
// SenderEntity Recurse
if (senderObject instanceof SenderEntity<?>)
{
SenderEntity<?> senderEntity = (SenderEntity<?>)senderObject;
return getData(senderEntity.getId());
}
// Player
// CommandSender
if (senderObject instanceof CommandSender)
{
String id = getIdFromSender((CommandSender) senderObject);
return getIdToData().get(id);
}
// OfflinePlayer (UUID recurse)
if (senderObject instanceof OfflinePlayer)
{
return getData(((OfflinePlayer) senderObject).getUniqueId());
}
// UUID
if (senderObject instanceof UUID)
{
String id = getIdFromUuid((UUID) senderObject);
return getIdToData().get(id);
}
// String
if (senderObject instanceof String)
{
IdData ret = getIdToData().get(senderObject);
if (ret != null) return ret;
return getNameToData().get(senderObject);
}
// Return Null
return null;
}
public static ConsoleCommandSender getConsole()
{
return Bukkit.getConsoleSender();
}
public static Player getPlayer(Object senderObject)
{
return getAsPlayer(getSender(senderObject));
}
public static CommandSender getSender(Object senderObject)
{
// Null Return
if (senderObject == null) throw new NullPointerException("senderObject");
// Already Done
if (senderObject instanceof CommandSender) return (CommandSender) senderObject;
// Console Type
// Handled at "Already Done"
// Console Id/Name
if (CONSOLE_ID.equals(senderObject)) return getConsole();
// SenderEntity Recurse
if (senderObject instanceof SenderEntity<?>)
{
SenderEntity<?> senderEntity = (SenderEntity<?>)senderObject;
return getSender(senderEntity.getId());
}
// Player
// Handled at "Already Done"
// CommandSender
// Handled at "Already Done"
// OfflinePlayer
if (senderObject instanceof OfflinePlayer)
{
return getSender(((OfflinePlayer) senderObject).getUniqueId());
}
// UUID
if (senderObject instanceof UUID)
{
// Attempt finding player
UUID uuid = (UUID)senderObject;
Player player = Bukkit.getPlayer(uuid);
if (player != null) return player;
// Otherwise assume registered sender
return registryIdToSender.get(uuid.toString());
}
// String
if (senderObject instanceof String)
{
// Recurse as UUID
String string = (String)senderObject;
UUID uuid = MUtil.asUuid(string);
if (uuid != null) return getSender(uuid);
// Registry
CommandSender sender = registryIdToSender.get(string);
if (sender != null) return sender;
// Bukkit API
return Bukkit.getPlayerExact(string);
}
// Return Null
return null;
}
public static UUID getUuid(Object senderObject)
{
// Null Return
if (senderObject == null) throw new NullPointerException("senderObject");
// Already Done
if (senderObject instanceof UUID) return (UUID)senderObject;
// Console Type
if (senderObject instanceof ConsoleCommandSender) return null;
// Console Id/Name
if (CONSOLE_ID.equals(senderObject)) return null;
// SenderEntity Recurse
if (senderObject instanceof SenderEntity<?>)
{
SenderEntity<?> senderEntity = (SenderEntity<?>)senderObject;
return getUuid(senderEntity.getId());
}
// Player
if (senderObject instanceof Player) return ((Player)senderObject).getUniqueId();
// CommandSender
if (senderObject instanceof CommandSender)
{
CommandSender sender = (CommandSender)senderObject;
String id = sender.getName();
return MUtil.asUuid(id);
}
// OfflinePlayer
if (senderObject instanceof OfflinePlayer) return ((OfflinePlayer) senderObject).getUniqueId();
// UUID
// Handled at "Already Done"
// String
if (senderObject instanceof String)
{
// Is UUID
String string = (String)senderObject;
UUID uuid = MUtil.asUuid(string);
if (uuid != null) return uuid;
// Is Name
// Handled at "Data"
}
// Data
IdData data = getData(senderObject);
if (data != null)
{
String id = data.getId();
if (id == null) return null;
UUID uuid = MUtil.asUuid(id);
return uuid;
}
// Return Null
return null;
}
// This method always returns null or a lower case String.
public static String getId(Object senderObject)
{
// Null Return
if (senderObject == null) throw new NullPointerException("senderObject");
// Already Done
if (senderObject instanceof String && MUtil.isUuid((String)senderObject)) return (String)senderObject;
// Console
// Handled at "Command Sender"
// Console Id/Name
if (CONSOLE_ID.equals(senderObject)) return CONSOLE_ID;
// SenderEntity Recurse
if (senderObject instanceof SenderEntity<?>)
{
SenderEntity<?> senderEntity = (SenderEntity<?>)senderObject;
return getId(senderEntity.getId());
}
// Player
// Handled at "Command Sender"
// Command Sender
if (senderObject instanceof CommandSender) return getIdFromSender((CommandSender) senderObject);
// OfflinePlayer
// Handled at "Data"
// UUID
if (senderObject instanceof UUID) return getIdFromUuid((UUID) senderObject);
// String
// Handled at "Data"
// Data
IdData data = getData(senderObject);
if (data != null)
{
return data.getId();
}
// Return Null
return null;
}
public static String getIdFromSender(CommandSender sender)
{
if (sender instanceof Player)
{
try
{
return ((Player) sender).getUniqueId().toString();
}
catch (UnsupportedOperationException e)
{
// ProtocolLib: The method getUniqueId is not supported for temporary players.
return null;
}
}
if (sender instanceof ConsoleCommandSender) return CONSOLE_ID;
// We blacklist all entities other than players.
// This is because all entities are CommandSenders since Minecraft 1.9.
// We do not want Arrows with id "arrow" in the database.
if (sender instanceof Entity) return null;
return sender.getName().toLowerCase();
}
public static String getIdFromUuid(UUID uuid)
{
return uuid.toString();
}
public static String getName(Object senderObject)
{
// Null Return
if (senderObject == null) throw new NullPointerException("senderObject");
// Already Done
// Handled at "Data" (not applicable - names can look differently)
// Console
// Handled at "Command Sender"
// Console Id/Name
if (CONSOLE_ID.equals(senderObject)) return CONSOLE_ID;
// SenderEntity Recurse
if (senderObject instanceof SenderEntity<?>)
{
SenderEntity<?> senderEntity = (SenderEntity<?>)senderObject;
return getName(senderEntity.getId());
}
// Player
// Handled at "Command Sender"
// CommandSender
if (senderObject instanceof CommandSender) return getNameFromSender((CommandSender)senderObject);
// UUID
// Handled at "Data".
// String
// Handled at "Data"
// Note: We try to use stored data to fix the capitalization!
// Data
IdData data = getData(senderObject);
if (data != null)
{
return data.getName();
}
// TryFix Behavior
// Note: We try to use stored data to fix the capitalization!
if (senderObject instanceof String) return (String)senderObject;
// Return Null
return null;
}
public static OfflinePlayer getOfflinePlayer(Object senderObject)
{
// Null Return
if (senderObject == null) throw new NullPointerException("senderObject");
// Already done
if (senderObject instanceof OfflinePlayer) return (OfflinePlayer) senderObject;
//
UUID uuid = getUuid(senderObject);
if (uuid == null) return null;
return Bukkit.getOfflinePlayer(uuid);
}
public static String getNameFromSender(CommandSender sender)
{
if (sender instanceof ConsoleCommandSender) return CONSOLE_ID;
return sender.getName();
}
public static boolean isOnline(Object senderObject)
{
if (senderObject == null) throw new NullPointerException("senderObject");
// Fix the id ...
String id = getId(senderObject);
if (id == null) return false;
// ... console is always online ...
// (this counters console being offline till the first tick due to deferred register)
if (CONSOLE_ID.equals(id)) return true;
// ... return by (case insensitive) set contains.
return IdUtil.getIds(SenderPresence.ONLINE, SenderType.ANY).contains(id);
}
public static Long getMillis(Object senderObject)
{
IdData data = getData(senderObject);
if (data == null) return null;
return data.getMillis();
}
// -------------------------------------------- //
// ID TYPE CHECKING
// -------------------------------------------- //
public static boolean isPlayerId(String string)
{
// NOTE: Assuming all custom ids isn't a valid player name or id.
return MUtil.isValidPlayerName(string) || MUtil.isUuid(string);
}
public static boolean isPlayer(Object senderObject)
{
String id = IdUtil.getId(senderObject);
if (id == null) return false;
return isPlayerId(id);
}
public static boolean isConsoleId(String string)
{
return CONSOLE_ID.equals(string);
}
public static boolean isConsole(Object senderObject)
{
String id = IdUtil.getId(senderObject);
if (id == null) return false;
return isConsoleId(id);
}
// -------------------------------------------- //
// GET AS
// -------------------------------------------- //
public static CommandSender getAsSender(Object object)
{
if (!(object instanceof CommandSender)) return null;
return (CommandSender) object;
}
public static Player getAsPlayer(Object object)
{
if (!(object instanceof Player)) return null;
return (Player) object;
}
public static ConsoleCommandSender getAsConsole(Object object)
{
if (!(object instanceof ConsoleCommandSender)) return null;
return (ConsoleCommandSender) object;
}
// -------------------------------------------- //
// CONVENIENCE GAME-MODE
// -------------------------------------------- //
public static GameMode getGameMode(Object object, GameMode def)
{
Player player = getPlayer(object);
if (player == null) return def;
return player.getGameMode();
}
public static boolean isGameMode(Object object, GameMode gm, boolean def)
{
Player player = getPlayer(object);
if (player == null) return def;
return player.getGameMode() == gm;
}
// -------------------------------------------- //
// DATAS
// -------------------------------------------- //
public static void loadDatas()
{
MassiveCore.get().log(Txt.parse("<i>Loading Cachefile datas..."));
for (IdData data : getCachefileDatas())
{
update(data.getId(), data.getName(), data.getMillis(), SenderPresence.OFFLINE);
}
MassiveCore.get().log(Txt.parse("<i>Loading Onlineplayer datas..."));
for (IdData data : getLocalPlayerDatas())
{
update(data.getId(), data.getName(), data.getMillis(), SenderPresence.LOCAL);
}
MassiveCore.get().log(Txt.parse("<i>Loading Registry datas..."));
for (String id : registryIdToSender.keySet())
{
String name = id;
update(id, name, SenderPresence.LOCAL);
}
MassiveCore.get().log(Txt.parse("<i>Saving Cachefile..."));
saveCachefileDatas();
}
// -------------------------------------------- //
// CACHEFILE DATAS
// -------------------------------------------- //
public static void saveCachefileDatas()
{
synchronized (CACHEFILE_LOCK)
{
String content = MassiveCore.gson.toJson(datas, CACHEFILE_TYPE);
DiscUtil.writeCatch(CACHEFILE_TEMP, content);
if (!CACHEFILE_TEMP.exists()) return;
CACHEFILE.delete();
CACHEFILE_TEMP.renameTo(CACHEFILE);
}
}
public static Set<IdData> getCachefileDatas()
{
synchronized (CACHEFILE_LOCK)
{
String content = DiscUtil.readCatch(CACHEFILE);
if (content == null) return new HashSet<>();
content = content.trim();
if (content.length() == 0) return new HashSet<>();
Set<IdData> ret = MassiveCore.gson.fromJson(content, CACHEFILE_TYPE);
return ret;
}
}
@Override
public void run()
{
saveCachefileDatas();
}
// -------------------------------------------- //
// ONLINEPLAYER DATAS
// -------------------------------------------- //
// This data source is simply based on the players currently online
public static Set<IdData> getLocalPlayerDatas()
{
Set<IdData> ret = new MassiveSet<>();
long millis = System.currentTimeMillis();
for (Player player : Bukkit.getOnlinePlayers())
{
String id = getId(player);
if (id == null) throw new NullPointerException("id");
String name = getName(player);
if (name == null) throw new NullPointerException("name");
IdData data = new IdData(id, name, millis);
ret.add(data);
}
return ret;
}
}
|
#pragma once
//------------------------------------------------------------------------------
/**
@class CoreGraphics::ShapeRenderer
Render shapes for debug visualizations.
(C) 2007 Radon Labs GmbH
(C) 2013-2020 Individual contributors, see AUTHORS file
*/
#if __DX11__
#include "coregraphics/d3d11/d3d11shaperenderer.h"
namespace CoreGraphics
{
class ShapeRenderer : public Direct3D11::D3D11ShapeRenderer
{
__DeclareClass(ShapeRenderer);
__DeclareSingleton(ShapeRenderer);
public:
/// constructor
ShapeRenderer();
/// destructor
virtual ~ShapeRenderer();
};
} // namespace CoreGraphics
#elif __DX9__
#include "coregraphics/d3d9/d3d9shaperenderer.h"
namespace CoreGraphics
{
class ShapeRenderer : public Direct3D9::D3D9ShapeRenderer
{
__DeclareClass(ShapeRenderer);
__DeclareSingleton(ShapeRenderer);
public:
/// constructor
ShapeRenderer();
/// destructor
virtual ~ShapeRenderer();
};
} // namespace CoreGraphics
#elif __OGL4__
#include "coregraphics/ogl4/ogl4shaperenderer.h"
namespace CoreGraphics
{
class ShapeRenderer : public OpenGL4::OGL4ShapeRenderer
{
__DeclareClass(ShapeRenderer);
__DeclareSingleton(ShapeRenderer);
public:
/// constructor
ShapeRenderer();
/// destructor
virtual ~ShapeRenderer();
};
} // namespace CoreGraphics
#elif __VULKAN__
#include "coregraphics/vk/vkshaperenderer.h"
namespace CoreGraphics
{
class ShapeRenderer : public Vulkan::VkShapeRenderer
{
__DeclareClass(ShapeRenderer);
__DeclareSingleton(ShapeRenderer);
public:
/// constructor
ShapeRenderer();
/// destructor
virtual ~ShapeRenderer();
};
} // namespace CoreGraphics
#else
#error "ShapeRenderer class not implemented on this platform!"
#endif
//------------------------------------------------------------------------------
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.