content
stringlengths 7
2.61M
|
---|
<reponame>kliu/Sysmon
// Copyright 2011 <NAME>
//
// 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.palantir.opensource.sysmon.linux;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.management.JMException;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import com.palantir.opensource.sysmon.Monitor;
import com.palantir.opensource.sysmon.util.InterruptTimerTask;
import com.palantir.opensource.sysmon.util.JMXUtils;
import com.palantir.opensource.sysmon.util.PropertiesUtils;
/**
* <p>Monitors I/O statistics as reported by <a href='http://linux.die.net/man/1/iostat'>iostat</a></p>
* <p>
* This class that fires up <a href='http://linux.die.net/man/1/iostat'>iostat</a>
* in a background process, reads its output, and publishes it via JMX MBeans.
* </p>
*
* <h3>JMX Data Path</h3>
* Each device will be placed at:
* <code>sysmon.linux.beanpath:type=io-device,devicename=<devicename></code>
*
* <h3>Configuration parameters</h3>
* <em>Note that any value not set in the config file will use the default value.</em>
* <table cellspacing=5 cellpadding=5><tr><th>Config Key</th><th>Description</th><th>Default Value</th><th>Constant</th></tr>
* <tr><td>sysmon.linux.iostat.path</td>
* <td>path to <code>iostat</code> binary</td>
* <td><code>iostat</code></td>
* <td>{@link #CONFIG_KEY_IOSTAT_PATH}</td></tr>
* <tr><td>sysmon.linux.iostat.opts</td>
* <td>options passed to iostat</td>
* <td><code>-d -x -k</code></td>
* <td>{@link #CONFIG_KEY_IOSTAT_OPTIONS}</td></tr>
* <tr><td>sysmon.linux.iostat.period</td>
* <td>period, in seconds, between iostat reports</td>
* <td><code>60</code></td>
* <td>{@link #CONFIG_KEY_IOSTAT_PERIOD}</td></tr>
* </tr></table>
* @see Monitor Lifecycle documentation
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1)</a> for more information on <code>iostat</code>.
*/
public class LinuxIOStatJMXWrapper extends Thread implements Monitor {
static final Logger log = LogManager.getLogger(LinuxIOStatJMXWrapper.class);
static final String CONFIG_KEY_PREFIX = LinuxMonitor.CONFIG_KEY_PREFIX + ".iostat";
/**
* Path to iostat executable. Defaults to "iostat" (uses $PATH to find executable).
* Set this config value in the to override where to find iostat.
*
* Config key: {@value}
* @see LinuxIOStatJMXWrapper#DEFAULT_IOSTAT_PATH default value for this config parameter
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1) on your local linux box</a>
*/
public static final String CONFIG_KEY_IOSTAT_PATH = CONFIG_KEY_PREFIX + ".path";
/**
* <p>
* Options passed to <code>iostat</code> (other than period argument).
* </p>
* <p>
* Note that passing config values that
* change the format of the output from <code>iostat</code> may break this monitor. Proceed
* with caution.
* </p><p>
* Set this key in the config file to override default values.
* </p>
* Config key: {@value}
* @see LinuxIOStatJMXWrapper#DEFAULT_IOSTAT_OPTIONS default value for this config parameter
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1) on your local linux box</a>
*/
public static final String CONFIG_KEY_IOSTAT_OPTIONS = CONFIG_KEY_PREFIX + ".opts";
/**
* Period for iostat. Set this config value to override how often iostat is outputting values.
*
* Config key: {@value}
* @see LinuxIOStatJMXWrapper#DEFAULT_IOSTAT_PERIOD default value for this config parameter
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1) on your local linux box</a>
*/
public static final String CONFIG_KEY_IOSTAT_PERIOD = CONFIG_KEY_PREFIX + ".period";
/**
* Default path to iostat executable. Defaults to "iostat" (uses $PATH to find executable).
*
* Config key: {@value}
* @see LinuxIOStatJMXWrapper#CONFIG_KEY_IOSTAT_PATH instructions on overriding this value.
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1) on your local linux box</a>
*/
public static final String DEFAULT_IOSTAT_PATH = "iostat"; // let the shell figure it out
/**
* Default options passed to iostat executable.
*
* Config key: {@value}
* @see LinuxIOStatJMXWrapper#CONFIG_KEY_IOSTAT_OPTIONS instructions on overriding this value.
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1) on your local linux box</a>
*/
public static final String DEFAULT_IOSTAT_OPTIONS = "-d -x -k";
/**
* Default period between iostat output (in seconds).
*
* Config key: {@value}
* @see LinuxIOStatJMXWrapper#CONFIG_KEY_IOSTAT_PERIOD Instructions on overriding this value.
* @see <a href='http://linux.die.net/man/1/iostat'>iostat(1) on your local linux box</a>
*/
public static final Integer DEFAULT_IOSTAT_PERIOD = Integer.valueOf(60);
/**
* Relative JMX data path where this monitor publishes its data. This will have the
* individual device name appended to the end in the JMX tree.
* Path: {@value}
*/
public static final String OBJECT_NAME_PREFIX = ":type=io-device,devicename=" ;
public static final Pattern FIRST_LINE_PREFIX = Pattern.compile("^Linux (2.6|3.1).*");
/**
* iostat likes to sometimes break things across two lines. This detects that situation.
* Pattern: {@value}
*/
static final Pattern DEVICE_ONLY = Pattern.compile("^\\s*\\S+\\s*$");
/**
* regex to match version 9.x of iostat.
* {@value}
*/
static final String HEADER_V9_RE =
"^\\s*Device:\\s+rrqm/s\\s+wrqm/s\\s+r/s\\s+w/s\\s+rkB/s\\s+wkB/s\\s+avgrq-sz\\s+" +
"avgqu-sz\\s+await\\s+r_await\\s+w_await\\s+svctm\\s+%util\\s*$";
/**
* regex to match version 7.x of iostat.
* {@value}
*/
static final String HEADER_V7_RE =
"^\\s*Device:\\s+rrqm/s\\s+wrqm/s\\s+r/s\\s+w/s\\s+rkB/s\\s+wkB/s\\s+avgrq-sz\\s+" +
"avgqu-sz\\s+await\\s+svctm\\s+%util\\s*$";
/**
* regex to match version 5.x of iostat.
* Pattern: {@value}
*/
static final String HEADER_V5_RE =
"^\\s*Device:\\s+rrqm/s\\s+wrqm/s\\s+r/s\\s+w/s\\s+rsec/s\\s+wsec/s\\s+rkB/s\\s+" +
"wkB/s\\s+avgrq-sz\\s+avgqu-sz\\s+await\\s+svctm\\s+%util\\s*$";
/**
* {@link Pattern} to match version 9.x of iostat header output.
* Pattern: {@value}
*/
static final Pattern HEADER_V9_PAT = Pattern.compile(HEADER_V9_RE); /**
* {@link Pattern} to match version 7.x of iostat header output.
* Pattern: {@value}
*/
static final Pattern HEADER_V7_PAT = Pattern.compile(HEADER_V7_RE);
/**
* {@link Pattern} to match version 5.x of iostat header output.
* Pattern: {@value}
*/
static final Pattern HEADER_V5_PAT = Pattern.compile(HEADER_V5_RE);
/**
* {@link Pattern} to match version 7.x of iostat data output.
* Pattern: {@value}
*/
static final Pattern DATA_V7_PAT = buildWhitespaceDelimitedRegex(12);
/**
* Pattern for version 9 of iostat. It has two additional fields that we ignore in our
* parsing. Because of that, we don't build it programmatically, but use this specially
* rolled regex. The upshot is that it's group index compatible with the version 7 regex.
*/
static final String DATA_V9_RE = "^\\s*(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)" +
"\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)" +
"\\s+\\S+\\s+\\S+" + // skipped fields
"\\s+(\\S+)\\s+(\\S+)\\s*$";
/**
* {@link Pattern} to match version 9.x of iostat data output.
* Pattern: {@value}
*/
static final Pattern DATA_V9_PAT = Pattern.compile(DATA_V9_RE);
/**
* Pattern for version 5 of iostat. It has three additional fields that we ignore in our
* parsing. Because of that, we don't build it programmatically, but use this specially
* rolled regex. The upshot is that it's group index compatible with the version 7 regex.
*/
static final String DATA_V5_RE = "^\\s*(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)" +
"\\s+\\S+\\s+\\S+\\s+" + // skipped fields
"(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)" +
"\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s*$";
/**
* {@link Pattern} to match version 5.x of iostat data output.
* Pattern: {@value}
*/
static final Pattern DATA_V5_PAT = Pattern.compile(DATA_V5_RE);
long freshnessTimestamp = System.currentTimeMillis();
final String iostatCmd[];
final int period;
final String iostatPath;
final String beanPath;
volatile boolean shutdown = false;
Process iostat = null;
BufferedReader iostatStdout = null;
InputStream iostatStderr = null;
OutputStream iostatStdin = null;
Pattern dataPattern = null;
Pattern headerPattern = null;
final Map<String,LinuxIOStat> beans = new HashMap<String, LinuxIOStat>();
/**
* Constructs a new iostat JMX wrapper. Does not start monitoring. Call
* {@link #startMonitoring()} to start monitoring and publishing
* JMX data.
*
* @param config configuration for this service
* @see #CONFIG_KEY_IOSTAT_OPTIONS
* @see #CONFIG_KEY_IOSTAT_PATH
* @see #CONFIG_KEY_IOSTAT_PERIOD
* @throws LinuxMonitoringException upon error in setting up this service.
*/
public LinuxIOStatJMXWrapper(Properties config) throws LinuxMonitoringException {
super(LinuxIOStatJMXWrapper.class.getSimpleName());
this.setDaemon(true);
if(config == null) {
// blank one to get all the defaults
config = new Properties();
}
try {
final String beanPathPrefix = config.getProperty(LinuxMonitor.CONFIG_KEY_JMX_BEAN_PATH,
LinuxMonitor.DEFAULT_JMX_BEAN_PATH);
beanPath = beanPathPrefix + OBJECT_NAME_PREFIX;
iostatPath = config.getProperty(CONFIG_KEY_IOSTAT_PATH,DEFAULT_IOSTAT_PATH);
period = PropertiesUtils.extractInteger(config,
CONFIG_KEY_IOSTAT_PERIOD,
DEFAULT_IOSTAT_PERIOD);
String iostatOpts = config.getProperty(CONFIG_KEY_IOSTAT_OPTIONS,
DEFAULT_IOSTAT_OPTIONS);
String cmd = iostatPath + " " + iostatOpts + " " + period;
this.iostatCmd = (cmd).split("\\s+");
log.info("iostat cmd: " + cmd);
} catch (NumberFormatException e) {
throw new LinuxMonitoringException("Invalid config Parameter for " +
CONFIG_KEY_IOSTAT_PERIOD,e);
}
}
/**
* Start iostat as a background process and makes sure header output
* parses correctly. If no errors are encountered, starts this instance's Thread
* to read the data from the iotstat process in the background.
*
* @throws LinuxMonitoringException upon error with iostat startup.
*/
public void startMonitoring() throws LinuxMonitoringException {
if(shutdown){
throw new LinuxMonitoringException("Do not reuse " + getClass().getSimpleName() + " objects");
}
try {
// check that we can start iostat in the background
startIOStat();
// jump off into thread land
start();
} catch (LinuxMonitoringException e) {
cleanup();
throw e;
}
}
/**
* Fires up iostat in the background and verifies that the header data parses
* as expected.
*
* @throws LinuxMonitoringException upon error starting iostat or parsing output.
*/
private void startIOStat() throws LinuxMonitoringException {
// Convert seconds to milliseconds for setInterruptTimer.
InterruptTimerTask timer = InterruptTimerTask.setInterruptTimer(1000L * period);
try {
iostat = Runtime.getRuntime().exec(iostatCmd);
iostatStdout = new BufferedReader(new InputStreamReader(iostat.getInputStream()));
iostatStderr = iostat.getErrorStream();
iostatStdin = iostat.getOutputStream();
// first line is discarded
String firstLine = iostatStdout.readLine();
if(firstLine == null) {
throw new LinuxMonitoringException("Unexpected end of input from iostat: " +
"null first line");
}
if(!FIRST_LINE_PREFIX.matcher(firstLine).matches()) {
log.warn("iostat returned unexpected first line: " + firstLine +
". Expected something that started with: /" + FIRST_LINE_PREFIX.pattern() + "/");
} else {
log.debug("IOStat Header Line: " + firstLine);
}
String secondLine = iostatStdout.readLine();
if(secondLine == null) {
throw new LinuxMonitoringException("Unexpected end of input from iostat: " +
"null second line");
}
if(!(secondLine.trim().length() == 0)) {
throw new LinuxMonitoringException("Missing blank second line. Found this instead: " +
secondLine);
}
// make sure we're getting the fields we expect
String headerLine = iostatStdout.readLine();
if(headerLine == null) {
throw new LinuxMonitoringException("Unexpected end of input from iostat: " +
"null header line");
}
if(HEADER_V5_PAT.matcher(headerLine).matches()){
log.info("Detected iostat version 5.");
headerPattern = HEADER_V5_PAT;
dataPattern = DATA_V5_PAT;
} else if(HEADER_V7_PAT.matcher(headerLine).matches()) {
log.info("Detected iostat version 7.");
headerPattern = HEADER_V7_PAT;
dataPattern = DATA_V7_PAT;
} else if(HEADER_V9_PAT.matcher(headerLine).matches()) {
log.info("Detected iostat version 9.");
headerPattern = HEADER_V9_PAT;
dataPattern = DATA_V9_PAT;
} else {
final String msg = "Header line does match expected header! Expected: " +
HEADER_V7_PAT.pattern() + "\nGot: " + headerLine + "\n";
throw new LinuxMonitoringException(msg);
}
// ready to read data
} catch (Exception e) {
cleanup();
if(e.getMessage().matches("^.*iostat: not found.*$")) {
final String errorMsg;
// first case - absolute path
if(!iostatPath.equals(DEFAULT_IOSTAT_PATH)) {
errorMsg = "iostat not found at specified path: " + iostatPath +
". Perhaps the sysstat package needs to be installed?";
} else {
errorMsg = "iostat not found in the executable $PATH for this process." +
" Perhaps the sysstat package needs to be installed?" +
" (Try 'yum install sysstat' as root.)";
}
throw new LinuxMonitoringException(errorMsg);
}
throw new LinuxMonitoringException("Error initializing iostat",e);
} finally {
timer.cancel();
}
}
/**
* Shuts down and cleans up both background iostat process and data reading thread.
*
* @throws InterruptedException
*/
public void stopMonitoring() throws InterruptedException {
try {
this.shutdown = true;
cleanup();
this.join();
} finally {
cleanup();
}
}
@Override
public void run() {
boolean wasInterrupted = Thread.interrupted();
try {
do {
String line = null;
try{
if(iostatStdout.ready()){
line = iostatStdout.readLine();
if(DEVICE_ONLY.matcher(line).matches()) {
// we have broken lines, put them together
String remainder = iostatStdout.readLine();
if(log.isTraceEnabled()) {
log.trace("Joining '" + line + "' and '" + remainder + "'.");
}
line = line + remainder;
}
}
} catch(Exception e) {
line = null;
if(!shutdown){
log.warn("Caught exception while reading line.",e);
} else {
log.debug("Exception caused by shutdown",e);
}
}
if(line != null) {
try {
processLine(line);
continue;
} catch (LinuxMonitoringException e) {
log.error(e,e);
}
}
try {
Thread.sleep(1000L);
} catch (InterruptedException e) {
wasInterrupted = true;
}
} while(!shutdown);
} catch(Exception e){
if(!shutdown){
log.error("Caught unexpected Exception",e);
} else {
log.debug("Shutdown caused exception",e);
}
}
finally {
if (wasInterrupted) {
Thread.currentThread().interrupt();
}
cleanup();
}
}
private void checkFreshness() {
Iterator<LinuxIOStat> it = beans.values().iterator();
while(it.hasNext()) {
LinuxIOStat entry = it.next();
if(entry.timestamp < freshnessTimestamp) {
it.remove();
log.info(entry + " is now considered stale (device removed?)");
removeBean(entry);
}
}
freshnessTimestamp = System.currentTimeMillis();
}
private void removeBean(LinuxIOStat bean) {
log.info("Removing " + bean + " from MBean server");
JMXUtils.unregisterMBeanCatchAndLogExceptions(bean.objectName);
}
private void processLine(String line) throws LinuxMonitoringException {
Matcher m = null;
// header line
m = headerPattern.matcher(line);
if(m.matches()) {
log.trace("Processing header line");
// Data line
checkFreshness();
return;
}
// data line
m = dataPattern.matcher(line);
if(m.matches()) {
log.trace("Processing data line: " + line);
String objectName = m.group(1);
LinuxIOStat dataRow = new LinuxIOStat(beanPath + objectName);
dataRow.timestamp = System.currentTimeMillis();
dataRow.device = m.group(1);
dataRow.samplePeriodInSeconds = period;
dataRow.mergedReadRequestsPerSecond = parseFloat(m.group(2));
dataRow.mergedWriteRequestsPerSecond = parseFloat(m.group(3));
dataRow.readRequestsPerSecond = parseFloat(m.group(4));
dataRow.writeRequestsPerSecond = parseFloat(m.group(5));
dataRow.kilobytesReadPerSecond = parseFloat(m.group(6));
dataRow.kilobytesWrittenPerSecond = parseFloat(m.group(7));
dataRow.averageRequestSizeInSectors = parseFloat(m.group(8));
dataRow.averageQueueLengthInSectors = parseFloat(m.group(9));
dataRow.averageWaitTimeInMillis = parseFloat(m.group(10));
dataRow.averageServiceTimeInMillis = parseFloat(m.group(11));
dataRow.bandwidthUtilizationPercentage = parseFloat(m.group(12));
updateBean(dataRow);
return;
}
// blank line
if(line.trim().length() == 0) {
// ignore
log.trace("Processing blank line");
return;
}
// unexpected input
throw new LinuxMonitoringException("Found unexpected input: " + line);
}
private void updateBean(LinuxIOStat bean) throws LinuxMonitoringException {
LinuxIOStat jmxBean = beans.get(bean.objectName);
if(jmxBean == null) { // new device
try {
JMXUtils.registerMBean(bean, bean.objectName);
beans.put(bean.objectName, bean);
} catch (JMException e) {
throw new LinuxMonitoringException("Error while registering bean for " +
bean.objectName,e);
}
} else {
jmxBean.takeValues(bean);
}
}
/**
* Shuts down background iostat process and cleans up related I/O resources related to IPC
* with said process.
*/
private synchronized void cleanup() {
try {
if(iostat != null) {
iostat.destroy();
}
IOUtils.closeQuietly(iostatStdout);
iostatStdout = null;
IOUtils.closeQuietly(iostatStderr);
iostatStderr = null;
IOUtils.closeQuietly(iostatStdin);
iostatStdin = null;
iostat = null;
} catch (Exception e) {
log.warn("Encountered error while shutting down and cleaning up state",e);
}
}
private static float parseFloat(String s) {
float result = Float.parseFloat(s);
// deal with occasionally weird values coming out of iostat
if (result > 1000000000000.0f) {
result = Float.NaN;
}
return result;
}
private static final Pattern buildWhitespaceDelimitedRegex(int numFields) {
StringBuilder regex = new StringBuilder("^\\s*");
for(int i = 0; i < numFields; i++) {
regex.append("(\\S+)");
if(i < numFields - 1) {
regex.append("\\s+");
}
else {
regex.append("\\s*");
}
}
regex.append("$");
return Pattern.compile(regex.toString());
}
}
|
package com.sauzny;
import io.reactivex.Flowable;
import io.reactivex.schedulers.Schedulers;
import java.util.*;
/**
* Hello world!
*/
public class App {
private static List<PolicyConvertor.XDMOper> groupWrite(Collection<PolicyConvertor.XDMOper> group) {
List<PolicyConvertor.XDMOper> errorDatas = new ArrayList<>();
System.out.println(group);
return errorDatas;
}
public static void main(String[] args) {
PolicyConvertor policyConvertor = new PolicyConvertor();
List<Data> dataList = new ArrayList<Data>();
Data d1 = new Data();
d1.setDc("A");
d1.setValue("1,2");
Data d2 = new Data();
d2.setDc("B");
d2.setValue("3,4");
Data d3 = new Data();
d3.setDc("A");
d3.setValue("5,6");
Data d4 = new Data();
d4.setDc("C");
d4.setValue("7,8");
dataList.add(d1);
dataList.add(d2);
dataList.add(d3);
dataList.add(d4);
for (int i = 0; i < 1; i++) {
/*
Map<String, Collection<PolicyConvertor.XDMOper>> map = Flowable.fromIterable(dataList)
.parallel(8)
.runOn(Schedulers.computation())
.concatMap(txData -> Flowable.fromIterable(policyConvertor.convert(txData)))
.sequential()
.observeOn(Schedulers.computation())
.toMultimap(oper -> oper.getDc())
//+ oper.getSValue() % xdmConfig.getConnSizePerDC())
.blockingGet();
*/
Map<String, Collection<PolicyConvertor.XDMOper>> map = new HashMap<>();
dataList.forEach(txData ->
policyConvertor.convert(txData).forEach(oper -> {
String key = oper.getDc();
map.putIfAbsent(key, new ArrayList<>());
map.get(key).add(oper);
}
)
);
List<PolicyConvertor.XDMOper> errorList = Flowable.fromIterable(map.values())
.parallel(20)
.runOn(Schedulers.io())
.flatMap(datas -> Flowable.fromIterable(groupWrite(datas)))
.sequential()
.toList()
.blockingGet();
System.out.println(map);
}
}
}
|
Aspiration cytology features of the warthin tumor-like variant of papillary thyroid carcinoma. A report of two cases. BACKGROUND Warthinklike tumor of thyroid is a recently described variant of papillary thyroid carcinoma characterized histologically by a papillary architecture, oxyphilic tumor cells and extensive, chronic inflammation. CASES Fine needle aspiration was performed on solitary thyroid nodules in two females aged 19 and 35 years. Both patients complained of neck lumps, and the older one noted several months of fatigue and weight gain. The specimens were cytologically similar and were characterized by two distinct sets of features, one suggesting the tall cell or oxyphilic variant of papillary thyroid carcinoma and the other suggesting chronic lymphocytic (Hashimoto's) thyroiditis. Neoplastic follicular cell nuclei were divided into those with grooves, pseudoinclusions and hyperlobation consistent with papillary thyroid carcinoma, while other tumor nuclei exhibited a uniform, round contour; hypergranular chromatin; and relatively prominent nucleoli reminiscent of Hrthle cells. Chronic inflammation was abundant and intimately associated with neoplastic cell groups. CONCLUSION Warthinlike tumor of the thyroid possesses cytoplasmic and nuclear features with overlap with several other thyroid lesions. Although a definitive diagnosis at aspiration biopsy may be very difficult, the lesions are recognizably neoplastic and identifiable as probable or definite papillary thyroid carcinoma. |
Calcium Neutralizes Fluoride Bioavailability in a Lethal Model of Fluoride Poisoning Objectives: Acute systemic fluoride poisoning can result in systemic hypocalcemia, cardiac dysrhythmias, and cardiovascular collapse. Topical and intraarterial therapy with calcium or magnesium salts reduces dermal injury from fluoride burns. The mechanism of these therapies is to bind and inactivate the fluoride ion. The purpose of this study is to evaluate the effect of calcium and magnesium to decrease the bioavailability of fluoride in a lethal model of fluoride poisoning. Methods: In preliminary studies, we determined that fluoride 3.6 mM/kg intraperitoneally in the form of sodium fluoride was uniformly and rapidly fatal in a mouse model. Using this fluoride dose, we performed a controlled, randomized, blinded study of low-and high-dose calcium chloride (1.8 and 3.6 mM/kg intraperitoneally, respectively) and magnesium sulfate (3.6 mM/kg intraperitoneally) to decrease the bioavailability of the fluoride ion. After injection with sodium fluoride, animals were immediately treated with injections of sodium chloride (control), calcium chloride (low- or high-dose), or magnesium sulfate. The major outcome was 6-hour survival using a Cox Proportional Hazard model. Results: All untreated animals died within 60 minutes. Using a Cox Proportional Hazard model, each 1.8 mM/kg dose of calcium chloride administered reduced the risk of death by 33%. Magnesium sulfate treatment was not associated with a hazard reduction. Conclusion: Calcium chloride administered simultaneously with sodium fluoride reduces the bioavailability of fluoride poisoning in a mouse model. The equivalent dose of magnesium sulfate does not significantly decrease fluoride bioavailability. |
1. Field of the Invention
The invention is directed to an internal combustion engine with an engine breaking device that is configured to maintain an exhaust valve in an intermediate position.
2. Description of the Related Art
An internal combustion engine of the type mentioned above is described in EP 1 526 257 A2. The engine braking device in this internal combustion engine is a combination of an engine exhaust brake and a compression release brake, also known as EVB (Exhaust Valve Brake). The hydraulic valve control unit is installed on one side in a valve bridge which actuates two exhaust valves simultaneously. The supply of oil to the valve control unit is carried out by the existing oil circuit in the internal combustion engine. Separate adjustment screws are provided for compensating valve lash in the exhaust valves and are used to adjust the valve lash when assembling the engine or afterwards at regular servicing intervals. This is uneconomical. In the event that excessive valve lash is unintentionally adjusted by assembly or servicing personnel, chattering noises will result between the rocker arm and valve bridge and there is a risk that the valve train will be damaged. Further, the exhaust valves do not open sufficiently, so that a complete exchange of gas is not ensured. If insufficient valve lash is adjusted, there is a risk that the valves will not close completely in the hot state and will accordingly burn out. |
<reponame>blindsubmissions/icse19replication
/*
* This file was automatically generated by EvoSuite
* Fri Aug 24 10:10:02 GMT 2018
*/
package weka.core.stemmers;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
import weka.core.stemmers.LovinsStemmer;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class LovinsStemmer_ESTest extends LovinsStemmer_ESTest_scaffolding {
/**
//Test case number: 0
/*Coverage entropy=0.9535256601039659
*/
@Test(timeout = 4000)
public void test00() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.stem("oides");
lovinsStemmer0.stem("oid");
String string0 = lovinsStemmer0.stemString("entation");
assertEquals("ent", string0);
String string1 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string1);
String[] stringArray0 = new String[7];
stringArray0[0] = "entation";
stringArray0[1] = "";
stringArray0[2] = "oides";
stringArray0[3] = "entation";
stringArray0[4] = "entation";
stringArray0[5] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
stringArray0[6] = "ent";
LovinsStemmer.main(stringArray0);
String string2 = lovinsStemmer0.stem("journal");
assertEquals("journ", string2);
}
/**
//Test case number: 1
/*Coverage entropy=1.038552426720722
*/
@Test(timeout = 4000)
public void test01() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.stemString("ive");
lovinsStemmer0.stem("f,U;A*{3<a$d@");
String[] stringArray0 = new String[5];
stringArray0[0] = "ive";
stringArray0[1] = "f,u;a*{3<a$d@";
stringArray0[2] = "f,U;A*{3<a$d@";
stringArray0[3] = "ive";
lovinsStemmer0.globalInfo();
stringArray0[4] = "f,U;A*{3<a$d@";
LovinsStemmer.main(stringArray0);
lovinsStemmer0.stemString("[acYC2|;^mIS}'=[");
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getRevision();
lovinsStemmer0.stem("year");
lovinsStemmer0.getRevision();
lovinsStemmer0.globalInfo();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getRevision();
lovinsStemmer0.stemString("N");
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.globalInfo();
lovinsStemmer0.toString();
lovinsStemmer0.stem("HTTP");
lovinsStemmer0.toString();
lovinsStemmer0.toString();
LovinsStemmer.main(stringArray0);
lovinsStemmer0.toString();
lovinsStemmer0.stemString("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.");
lovinsStemmer0.getTechnicalInformation();
LovinsStemmer.main(stringArray0);
assertEquals(5, stringArray0.length);
}
/**
//Test case number: 2
/*Coverage entropy=0.9398473390054318
*/
@Test(timeout = 4000)
public void test02() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.toString();
String[] stringArray0 = new String[1];
lovinsStemmer0.stemString(">y?;$qb!.7]");
stringArray0[0] = "5YxZc,>%o";
LovinsStemmer.main(stringArray0);
lovinsStemmer0.stem("");
lovinsStemmer0.stem("5YxZc,>%o");
lovinsStemmer0.globalInfo();
lovinsStemmer0.getRevision();
lovinsStemmer0.stem("end");
lovinsStemmer0.stemString("5YxZc,>%o");
lovinsStemmer0.globalInfo();
lovinsStemmer0.getRevision();
LovinsStemmer.main(stringArray0);
// Undeclared exception!
try {
lovinsStemmer0.stemString((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("weka.core.stemmers.LovinsStemmer", e);
}
}
/**
//Test case number: 3
/*Coverage entropy=1.2700316752557592
*/
@Test(timeout = 4000)
public void test03() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
lovinsStemmer0.toString();
lovinsStemmer0.stemString("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.");
lovinsStemmer0.globalInfo();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
String[] stringArray0 = new String[4];
stringArray0[0] = "weka.core.stemmers.LovinsStemmer";
stringArray0[1] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
stringArray0[2] = "a stemmer bas on th lovin stemmer, describ hes:\n\njuli beth lovin (1968). developm of a stem algorithm. mechan transl and comput lingu. 11:22-31.";
stringArray0[3] = "LANGUAGE";
LovinsStemmer.main(stringArray0);
LovinsStemmer.main(stringArray0);
LovinsStemmer.main(stringArray0);
LovinsStemmer.main(stringArray0);
lovinsStemmer0.stemString("a stemmer bas on th lovin stemmer, describ hes:\n\njuli beth lovin (1968). developm of a stem algorithm. mechan transl and comput lingu. 11:22-31.");
lovinsStemmer0.stemString("weka.core.stemmers.LovinsStemmer");
LovinsStemmer.main(stringArray0);
lovinsStemmer0.toString();
lovinsStemmer0.stemString("LANGUAGE");
lovinsStemmer0.toString();
LovinsStemmer.main(stringArray0);
String string0 = lovinsStemmer0.getRevision();
assertEquals("8034", string0);
}
/**
//Test case number: 4
/*Coverage entropy=0.9780295380173829
*/
@Test(timeout = 4000)
public void test04() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.globalInfo();
lovinsStemmer0.stemString("ening");
lovinsStemmer0.stem("CROSSREF");
String[] stringArray0 = new String[8];
stringArray0[0] = "WH^|ks?<k?eF.uvOc";
stringArray0[1] = "ening";
stringArray0[2] = "ening";
stringArray0[3] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
stringArray0[4] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
stringArray0[5] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
stringArray0[6] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
stringArray0[7] = "A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.";
LovinsStemmer.main(stringArray0);
lovinsStemmer0.toString();
lovinsStemmer0.stemString("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.");
lovinsStemmer0.stemString("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.");
String string0 = lovinsStemmer0.getRevision();
lovinsStemmer0.stem("howpublished");
lovinsStemmer0.toString();
lovinsStemmer0.stemString("");
LovinsStemmer.main(stringArray0);
lovinsStemmer0.getRevision();
lovinsStemmer0.toString();
lovinsStemmer0.stemString("howpublished");
String string1 = lovinsStemmer0.toString();
assertFalse(string1.equals((Object)string0));
}
/**
//Test case number: 5
/*Coverage entropy=1.1510316764109718
*/
@Test(timeout = 4000)
public void test05() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("Zb:LGxAsiza'");
assertEquals("zb:lgxasiza'", string0);
lovinsStemmer0.toString();
String[] stringArray0 = new String[1];
stringArray0[0] = "zb:lgxasiza'";
LovinsStemmer.main(stringArray0);
String string1 = lovinsStemmer0.stemString("weka.core.stemmers.LovinsStemmer");
assertEquals("wek.cor.stemmer.lovinsstemmer", string1);
lovinsStemmer0.getRevision();
String string2 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string2);
LovinsStemmer.main(stringArray0);
lovinsStemmer0.stem("fJx|e{mDk");
LovinsStemmer.main(stringArray0);
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.stem("H;r+");
lovinsStemmer0.stemString("U=%looXX");
String string3 = lovinsStemmer0.stemString("o]Oc`AWY%:3D},>");
assertEquals("o]oc`awy%:3d},>", string3);
}
/**
//Test case number: 6
/*Coverage entropy=0.8447033993444789
*/
@Test(timeout = 4000)
public void test06() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.stemString("!lX.kj>q");
String string0 = lovinsStemmer0.stemString("ive");
assertEquals("iv", string0);
lovinsStemmer0.stem("f,U;A*{3<a$d@");
lovinsStemmer0.stem("ngu");
String[] stringArray0 = new String[5];
LovinsStemmer.main(stringArray0);
LovinsStemmer lovinsStemmer1 = new LovinsStemmer();
String string1 = lovinsStemmer1.stemString("h;r+ix");
assertEquals("h;r+ix", string1);
String string2 = lovinsStemmer0.stem("key");
assertEquals("key", string2);
}
/**
//Test case number: 7
/*Coverage entropy=1.2120994351006502
*/
@Test(timeout = 4000)
public void test07() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("Zb:LGxAsiza'");
assertEquals("zb:lgxasiza'", string0);
lovinsStemmer0.toString();
String[] stringArray0 = new String[1];
stringArray0[0] = "zb:lgxasiza'";
LovinsStemmer.main(stringArray0);
String string1 = lovinsStemmer0.stemString("weka.core.stemmers.LovinsStemmer");
assertEquals("wek.cor.stemmer.lovinsstemmer", string1);
lovinsStemmer0.getRevision();
String string2 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string2);
LovinsStemmer.main(stringArray0);
lovinsStemmer0.stem("fJx|e{mDk");
LovinsStemmer.main(stringArray0);
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.stem("H;r+");
lovinsStemmer0.stemString("U=%looXX");
LovinsStemmer lovinsStemmer1 = new LovinsStemmer();
String string3 = lovinsStemmer1.stemString("keyherpex");
assertEquals("keyherpic", string3);
String string4 = lovinsStemmer0.toString();
assertFalse(string4.equals((Object)string1));
}
/**
//Test case number: 8
/*Coverage entropy=0.8287005193558294
*/
@Test(timeout = 4000)
public void test08() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("/y9.{42-i{-qYPcP");
assertEquals("/y9.{42-i{-qypcp", string0);
lovinsStemmer0.getRevision();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
String string1 = lovinsStemmer0.stemString("Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.");
assertEquals("usu th addres of th publishes or other typ of institut. for major publish hous, van leun recommens omis th inform entir. for smal publishes, on th other hand, you can help th reader by giv th comples addres.", string1);
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getRevision();
lovinsStemmer0.toString();
String string2 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string2);
lovinsStemmer0.stem("/y9.{42-i{-qYPcP");
LovinsStemmer.main((String[]) null);
String string3 = lovinsStemmer0.getRevision();
assertEquals("8034", string3);
lovinsStemmer0.stem("A link to a PDF file.");
lovinsStemmer0.stemString("WRp");
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.toString();
String string4 = lovinsStemmer0.stemString("rud");
assertEquals("rus", string4);
}
/**
//Test case number: 9
/*Coverage entropy=0.9122324169006837
*/
@Test(timeout = 4000)
public void test09() throws Throwable {
String[] stringArray0 = new String[9];
stringArray0[0] = "HOe_%dI`";
stringArray0[1] = "HOe_%dI`";
stringArray0[2] = ".vn";
stringArray0[3] = "a-qpa4yt c(l";
stringArray0[4] = "institution";
stringArray0[5] = "key";
stringArray0[6] = "INBOOK";
stringArray0[7] = "}6";
stringArray0[8] = "CHAPTER";
LovinsStemmer.main(stringArray0);
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("otide");
assertEquals("ot", string0);
}
/**
//Test case number: 10
/*Coverage entropy=1.134432915866057
*/
@Test(timeout = 4000)
public void test10() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("47-vUh^w");
assertEquals("47-vuh^w", string0);
lovinsStemmer0.stem(")|z? -");
lovinsStemmer0.toString();
String[] stringArray0 = new String[1];
stringArray0[0] = "weka.core.stemmers.LovinsStemmer";
LovinsStemmer.main(stringArray0);
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.globalInfo();
lovinsStemmer0.stemString(")|z? -");
String string1 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string1);
LovinsStemmer.main(stringArray0);
String string2 = lovinsStemmer0.stem(")qnip>kix[dex");
assertEquals(")qnip>kix[dic", string2);
}
/**
//Test case number: 11
/*Coverage entropy=0.6670345760105317
*/
@Test(timeout = 4000)
public void test11() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("/y9.{42-i{-qYPcP");
assertEquals("/y9.{42-i{-qypcp", string0);
String string1 = lovinsStemmer0.getRevision();
assertEquals("8034", string1);
lovinsStemmer0.getTechnicalInformation();
String[] stringArray0 = new String[9];
stringArray0[0] = "/y9.{42-i{-qYPcP";
stringArray0[1] = "/y9.{42-i{-qYPcP";
stringArray0[2] = "a-qpa4yt c(l";
stringArray0[3] = "INBOOK";
stringArray0[4] = "a-qpa4yt c(l";
stringArray0[5] = "CHAPTER";
stringArray0[6] = "/y9.{42-i{-qypcp";
stringArray0[7] = "institution";
stringArray0[8] = "key";
LovinsStemmer.main(stringArray0);
LovinsStemmer lovinsStemmer1 = new LovinsStemmer();
String string2 = lovinsStemmer0.stemString("journyt");
assertEquals("journys", string2);
String string3 = lovinsStemmer1.stem("D >q}9~yfI`*Jb`i~");
assertEquals("d >q}9~yfi`*jb`i~", string3);
}
/**
//Test case number: 12
/*Coverage entropy=1.4855224546590642
*/
@Test(timeout = 4000)
public void test12() throws Throwable {
String[] stringArray0 = new String[9];
stringArray0[0] = "HOe_%dI`";
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
lovinsStemmer0.stemString("rpt");
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getRevision();
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
LovinsStemmer lovinsStemmer1 = new LovinsStemmer();
lovinsStemmer1.stem("3I0~k~{n'$fQ\"Tj");
LovinsStemmer.main((String[]) null);
lovinsStemmer1.getRevision();
lovinsStemmer0.stem("~Zn$t(2Y1");
// Undeclared exception!
try {
lovinsStemmer1.stemString((String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("weka.core.stemmers.LovinsStemmer", e);
}
}
/**
//Test case number: 13
/*Coverage entropy=0.8537447706086106
*/
@Test(timeout = 4000)
public void test13() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.toString();
String[] stringArray0 = new String[1];
lovinsStemmer0.stemString(">y?;$qb!.7]");
stringArray0[0] = "5YxZc,>%o";
lovinsStemmer0.stem("");
lovinsStemmer0.stem("5YxZc,>%o");
lovinsStemmer0.globalInfo();
lovinsStemmer0.getRevision();
lovinsStemmer0.stemString("*!PZ _+Th|088Tu");
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.globalInfo();
lovinsStemmer0.toString();
lovinsStemmer0.stem("ert");
lovinsStemmer0.toString();
lovinsStemmer0.toString();
LovinsStemmer.main(stringArray0);
lovinsStemmer0.toString();
LovinsStemmer lovinsStemmer1 = new LovinsStemmer();
lovinsStemmer1.stemString("weka.core.stemmers.LovinsStemmer");
lovinsStemmer1.getTechnicalInformation();
LovinsStemmer.main(stringArray0);
assertEquals(1, stringArray0.length);
}
/**
//Test case number: 14
/*Coverage entropy=0.9762669673451051
*/
@Test(timeout = 4000)
public void test14() throws Throwable {
String[] stringArray0 = new String[2];
stringArray0[0] = "]O9)!6ed?";
stringArray0[1] = "'>C";
LovinsStemmer.main(stringArray0);
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
String string0 = lovinsStemmer0.stemString("]O9)!6ed?");
assertEquals("]o9)!6ed?", string0);
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getRevision();
lovinsStemmer0.toString();
String string1 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string1);
lovinsStemmer0.stem("Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.");
LovinsStemmer.main(stringArray0);
lovinsStemmer0.getRevision();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.stem("ISBN-13");
String string2 = lovinsStemmer0.stemString("The organization that sponsors a conference or that publishes a manual.");
assertEquals("th organ that sponsor a confer or that publish a manu.", string2);
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.toString();
String string3 = lovinsStemmer0.stemString("th organ that sponsor a confer or that publish a manu.");
assertEquals("th organ that spons a confer or that publ a manu.", string3);
}
/**
//Test case number: 15
/*Coverage entropy=1.027539370637948
*/
@Test(timeout = 4000)
public void test15() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
String string0 = lovinsStemmer0.stemString("Zb:LGxAsiza'");
assertEquals("zb:lgxasiza'", string0);
lovinsStemmer0.toString();
String[] stringArray0 = new String[1];
lovinsStemmer0.toString();
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
lovinsStemmer0.stemString("5L5G_");
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer0.stem("5l5g_");
LovinsStemmer lovinsStemmer1 = new LovinsStemmer();
lovinsStemmer1.toString();
String string1 = lovinsStemmer1.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string1);
LovinsStemmer lovinsStemmer2 = new LovinsStemmer();
lovinsStemmer1.getRevision();
LovinsStemmer.main(stringArray0);
lovinsStemmer0.getRevision();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer1.stem("4gAy7S}7r6!");
String string2 = lovinsStemmer0.stemString("keycid");
assertEquals("keycis", string2);
lovinsStemmer1.getTechnicalInformation();
lovinsStemmer0.getTechnicalInformation();
lovinsStemmer1.toString();
String string3 = lovinsStemmer1.stemString("5l5g_");
assertEquals("5l5g_", string3);
}
/**
//Test case number: 16
/*Coverage entropy=1.9730014063936125
*/
@Test(timeout = 4000)
public void test16() throws Throwable {
String[] stringArray0 = new String[9];
stringArray0[0] = "HOe_%dI`";
stringArray0[1] = "HOe_%dI`";
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
String string0 = lovinsStemmer0.stemString("XLg1fGg;IU.Lh'");
assertEquals("xlg1fg;iu.lh'", string0);
lovinsStemmer0.globalInfo();
String string1 = lovinsStemmer0.globalInfo();
assertEquals("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.", string1);
String string2 = lovinsStemmer0.stemString("A stemmer based on the Lovins stemmer, described here:\n\n<NAME> (1968). Development of a stemming algorithm. Mechanical Translation and Computational Linguistics. 11:22-31.");
assertEquals("a stemmer bas on th lovin stemmer, describ hes:\n\njuli beth lovin (1968). developm of a stem algorithm. mechan transl and comput lingu. 11:22-31.", string2);
LovinsStemmer.main(stringArray0);
String string3 = lovinsStemmer0.stemString("KZ&V{LL1.(J?TW");
assertEquals("kz&v{ll1.(j?tw", string3);
}
/**
//Test case number: 17
/*Coverage entropy=1.0579652698996616
*/
@Test(timeout = 4000)
public void test17() throws Throwable {
LovinsStemmer lovinsStemmer0 = new LovinsStemmer();
lovinsStemmer0.toString();
String[] stringArray0 = new String[3];
stringArray0[0] = "i|,Ap";
stringArray0[1] = "weka.core.stemmers.LovinsStemmer";
stringArray0[2] = "istr";
LovinsStemmer.main(stringArray0);
LovinsStemmer.main((String[]) null);
lovinsStemmer0.stem("DK^E");
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
lovinsStemmer0.stemString("ll1ax");
lovinsStemmer0.globalInfo();
lovinsStemmer0.globalInfo();
String[] stringArray1 = new String[0];
LovinsStemmer.main(stringArray1);
assertEquals(0, stringArray1.length);
}
}
|
A million gallons of diesel fuel has spilled out of a pipeline and into a portion of California’s San Francisco Bay, media outlets reported April 29.
The spill was caused by a rupture in the pipeline owned by energy company Kinder-Morgan, which operates more than 35,000 miles of pipelines across the United States.
The fuel fell into a marshy wetland area that borders Suisun Bay, the extreme eastern arm of the San Francisco Bay, which borders Solano County on the north and Contra Costa County on the south. Both the Sacramento and San Joaquin rivers empty into the Suisun Bay, which is about 25 miles northeast of the city of San Francisco.
KPIX-TV reported that the pipeline runs from Concord to Sacramento. Kinder-Morgan told the station that the 14-inch pipe was shut down and that cleanup crews were en route.
The spill comes at a time when diesel prices in California are already the highest in the nation. This week, the federal Department of Energy said the national average price of diesel was $1.718; however, in California, it was $2.247.
Earlier this week, a group of independent truckers pulled their rigs off the road and protested the high fuel prices and low freight rates.
How the California pipeline break will affect fuel prices is not yet known. But the Phoenix pipeline break in August caused a major fuel shortage in Arizona that disrupted commerce and resulted in panic buying. That pipeline carried only 60,000 gallons a day, a fraction of what spilled in the San Francisco area.
That Kinder-Morgan pipeline ruptured again during tests later the same month. |
Effect of 6-month athletic training on motor abilities in seven-year-old schoolgirls. The effects of six-month athletic training on improving motor abilities in 7-year-old schoolgirls were assessed. Analysis of the results of 12 motor tests showed significant improvement in the study group (n = 38) in comparison with control group (n = 140) subjected to conventional physical education classes only. The improvement referred to the variables of aerobic endurance (3-min run), flexibility (forward bow), explosive strength (ball throwing and 20-m run), keeping balance (bench standing), static strength (bent arm hang), and repetitive strength (sit-ups). These are probably adaptive changes brought up by discriminant functions. The varimax factor and discriminative function correlations indicated that all four factors of changes contributed significantly to the explanation of discriminative function. An almost equally high correlation of varimax factors and discriminative function was obtained on the basis of differences in the third factor responsible for changes in the frequency of movements and in the explosive strength of the jump type; in the second factor responsible for changes in coordination with changes in the repetitive strength of the body; and in the fourth factor responsible for changes in the explosive strength of the throw and sprint types with changes and endurance. |
This week the U.S. Department of Agriculture attempted to implement a plan to collect a 15-cent-per-tree "tax" from Christmas tree growers. The money would be used to create ads promoting the use of real trees, similar to the "Got Milk" and "Beef: It's What's for Dinner" campaigns, as fake trees have reduced sales. Thankfully, Republicans saw right through President Obama's dastardly plan (that was actually cooked up before he was elected and is favored by most of the industry). The Department of Agriculture has decided to reevaluate the plan because it was attacked by several Republican lawmakers. It's a Christmas miracle! Don't forget to raise a glass of eggnog to these American heroes when you're relaxing by your foreign-made artificial tree next month. |
A Bug's Life: Competition Among Species Towards the Environment A model of different species competing for the same environment is presented, and possible explanations of peaceful coexistence or rather internecine conflicts are consequently derived. By means of a Lotka-Volterra dynamic system we describe the evolution of two populations (bees and locusts) that differently approach the management of those natural resources they contend for, and thus make a simple parable of today's societies playing the current environmental scenario. |
def login_with_google(email, oauth2_token):
return _login(API.login_with_google, email, oauth2_token) |
<filename>wdtk-datamodel/src/test/java/org/wikidata/wdtk/datamodel/json/jackson/JsonTestData.java
package org.wikidata.wdtk.datamodel.json.jackson;
/*
* #%L
* Wikidata Toolkit Data Model
* %%
* Copyright (C) 2014 Wikidata Toolkit Developers
* %%
* 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.
* #L%
*/
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.wikidata.wdtk.datamodel.helpers.Datamodel;
import org.wikidata.wdtk.datamodel.interfaces.DataObjectFactory;
import org.wikidata.wdtk.datamodel.interfaces.GlobeCoordinatesValue;
import org.wikidata.wdtk.datamodel.interfaces.ItemIdValue;
import org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue;
import org.wikidata.wdtk.datamodel.interfaces.TimeValue;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValue;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueGlobeCoordinates;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueItemId;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueMonolingualText;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValuePropertyId;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueQuantity;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueString;
import org.wikidata.wdtk.datamodel.json.jackson.datavalues.JacksonValueTime;
/**
* Class that provides objects and strings for testing the conversion between
* JSON and Java.
*
* @author <NAME>
*
*/
public class JsonTestData {
public static final DataObjectFactory JACKSON_OBJECT_FACTORY = new JacksonObjectFactory();
// TODO maybe decompose the time a bit to have fewer magic strings in it
public static final String JSON_ENTITY_TYPE_ITEM = "item";
public static final String JSON_ENTITY_TYPE_PROPERTY = "property";
// the id's used in the tests
public static final String TEST_PROPERTY_ID = "P1";
public static final String TEST_ITEM_ID = "Q1";
public static final int TEST_NUMERIC_ID = 1;
public static final String TEST_STATEMENT_ID = "statement_foobar";
public static final String JSON_RANK_NORMAL = "normal";
public static final String JSON_RANK_DEPRECATED = "deprecated";
public static final String JSON_RANK_PREFERRED = "preferred";
// stand-alone descriptions of Value-parts
public static final String JSON_STRING_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_STRING + "\",\"value\":\"foobar\"}";
public static final String JSON_ITEM_ID_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_ENTITY_ID
+ "\",\"value\":{\"entity-type\":\"" + JSON_ENTITY_TYPE_ITEM
+ "\",\"numeric-id\":" + TEST_NUMERIC_ID + "}}";
public static final String JSON_PROPERTY_ID_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_ENTITY_ID
+ "\",\"value\":{\"entity-type\":\"" + JSON_ENTITY_TYPE_PROPERTY
+ "\",\"numeric-id\":" + TEST_NUMERIC_ID + "}}";
public static final String JSON_TIME_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_TIME
+ "\", \"value\":{\"time\":\"+00000002013-10-28T00:00:00Z\",\"timezone\":0,\"before\":0,\"after\":0,\"precision\":11,\"calendarmodel\":\"http://www.wikidata.org/entity/Q1985727\"}}";
public static final String JSON_GLOBE_COORDINATES_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_GLOBE_COORDINATES
+ "\", \"value\":{\"latitude\":-90.0,\"longitude\":0.0,\"precision\":10.0,\"globe\":\"http://www.wikidata.org/entity/Q2\"}}";
public static final String JSON_QUANTITY_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_QUANTITY
+ "\",\"value\":{\"amount\":\"+1\",\"unit\":\"1\",\"upperBound\":\"+1.5\",\"lowerBound\":\"-0.5\"}}";
public static final String JSON_MONOLINGUAL_TEXT_VALUE = "{\"type\":\""
+ JacksonValue.JSON_VALUE_TYPE_MONOLINGUAL_TEXT
+ "\",\"value\":{\"language\":\"en\",\"text\":\"foobar\"}}";
// stand-alone descriptions of ItemDocument-parts
public static final String JSON_ITEM_TYPE = "\"type\":\"item\"";
public static final String JSON_TERM_MLTV = "{\"language\": \"en\", \"value\": \"foobar\"}";
public static final String JSON_SITE_LINK = "{\"site\":\"enwiki\", \"title\":\"foobar\", \"badges\":[]}";
public static final String JSON_NOVALUE_SNAK = "{\"snaktype\":\"novalue\",\"property\":\""
+ TEST_PROPERTY_ID + "\"}";
public static final String JSON_SOMEVALUE_SNAK = "{\"snaktype\":\"somevalue\",\"property\":\""
+ TEST_PROPERTY_ID + "\"}";
public static final String JSON_VALUE_SNAK_STRING = "{\"snaktype\":\"value\",\"property\":\""
+ TEST_PROPERTY_ID + "\",\"datavalue\":" + JSON_STRING_VALUE + "}";
// wrapping into item document structure for dedicated tests
public static final String JSON_WRAPPED_LABEL = "{\"id\":\""
+ TEST_ITEM_ID
+ "\",\"aliases\":{},\"descriptions\":{},\"claims\":{},\"sitelinks\":{},\"labels\":{\"en\":"
+ JSON_TERM_MLTV + "}," + JSON_ITEM_TYPE + "}";
public static final String JSON_WRAPPED_DESCRIPTIONS = "{\"id\":\""
+ TEST_ITEM_ID
+ "\",\"aliases\":{},\"labels\":{},\"claims\":{},\"sitelinks\":{},\"descriptions\":{\"en\":"
+ JSON_TERM_MLTV + "}," + JSON_ITEM_TYPE + "}";
public static final String JSON_WRAPPED_ALIASES = "{\"id\":\""
+ TEST_ITEM_ID
+ "\",\"labels\":{},\"descriptions\":{},\"claims\":{},\"sitelinks\":{},\"aliases\":{\"en\":["
+ JSON_TERM_MLTV + "]}," + JSON_ITEM_TYPE + "}";
public static final String JSON_WRAPPED_ITEMID = "{\"id\":\""
+ TEST_ITEM_ID
+ "\",\"aliases\":{},\"labels\":{},\"descriptions\":{},\"claims\":{},\"sitelinks\":{},"
+ JSON_ITEM_TYPE + "}";
public static final String JSON_WRAPPED_SITE_LINK = "{\"id\":\""
+ TEST_ITEM_ID
+ "\",\"aliases\":{},\"labels\":{},\"descriptions\":{},\"claims\":{},\"sitelinks\":{\"enwiki\":"
+ JSON_SITE_LINK + "}," + JSON_ITEM_TYPE + "}";
public static final String JSON_NOVALUE_STATEMENT = "{\"type\":\"statement\",\"id\":\""
+ TEST_STATEMENT_ID
+ "\",\"rank\":\""
+ JSON_RANK_NORMAL
+ "\",\"mainsnak\":" + JSON_NOVALUE_SNAK + "}";
// objects to test against
// should (of course) correspond to the JSON strings counterpart
public static final JacksonMonolingualTextValue TEST_MLTV_TERM_VALUE = new JacksonMonolingualTextValue(
"en", "foobar");
public static final JacksonSiteLink TEST_SITE_LINK = (JacksonSiteLink) JACKSON_OBJECT_FACTORY
.getSiteLink("foobar", "enwiki", Collections.<String> emptyList());
public static final JacksonValueString TEST_STRING_VALUE = (JacksonValueString) JACKSON_OBJECT_FACTORY
.getStringValue("foobar");
public static final JacksonValueItemId TEST_ITEM_ID_VALUE = (JacksonValueItemId) JACKSON_OBJECT_FACTORY
.getItemIdValue("Q1", Datamodel.SITE_WIKIDATA);
public static final JacksonValuePropertyId TEST_PROPERTY_ID_VALUE = (JacksonValuePropertyId) JACKSON_OBJECT_FACTORY
.getPropertyIdValue("P1", Datamodel.SITE_WIKIDATA);
public static final JacksonValueTime TEST_TIME_VALUE = (JacksonValueTime) JACKSON_OBJECT_FACTORY
.getTimeValue(2013, (byte) 10, (byte) 28, (byte) 0, (byte) 0,
(byte) 0, (byte) 11, 0, 0, 0, TimeValue.CM_GREGORIAN_PRO);
public static final JacksonValueGlobeCoordinates TEST_GLOBE_COORDINATES_VALUE = (JacksonValueGlobeCoordinates) JACKSON_OBJECT_FACTORY
.getGlobeCoordinatesValue(-90.0, 0.0, 10.0,
GlobeCoordinatesValue.GLOBE_EARTH);
public static final JacksonValueQuantity TEST_QUANTITY_VALUE = (JacksonValueQuantity) JACKSON_OBJECT_FACTORY
.getQuantityValue(new BigDecimal(1), new BigDecimal(-0.5),
new BigDecimal(1.5));
public static final JacksonValueMonolingualText TEST_MONOLINGUAL_TEXT_VALUE = (JacksonValueMonolingualText) JACKSON_OBJECT_FACTORY
.getMonolingualTextValue("foobar", "en");
public static final JacksonNoValueSnak TEST_NOVALUE_SNAK = (JacksonNoValueSnak) JACKSON_OBJECT_FACTORY
.getNoValueSnak(TEST_PROPERTY_ID_VALUE);
public static final JacksonSomeValueSnak TEST_SOMEVALUE_SNAK = (JacksonSomeValueSnak) JACKSON_OBJECT_FACTORY
.getSomeValueSnak(TEST_PROPERTY_ID_VALUE);
public static final JacksonValueSnak TEST_STRING_VALUE_SNAK = (JacksonValueSnak) JACKSON_OBJECT_FACTORY
.getValueSnak(TEST_PROPERTY_ID_VALUE, TEST_STRING_VALUE);
// TODO continue testing using stringValueSnak, timeValueSnak,
// globeCoordinateValueSnak
public static Map<String, JacksonMonolingualTextValue> getTestMltvMap() {
Map<String, JacksonMonolingualTextValue> testMltvMap = new HashMap<>();
testMltvMap.put("en", TEST_MLTV_TERM_VALUE);
return testMltvMap;
}
public static Map<String, List<JacksonMonolingualTextValue>> getTestAliases() {
Map<String, List<JacksonMonolingualTextValue>> testAliases = new HashMap<>();
List<JacksonMonolingualTextValue> enAliases = new ArrayList<>();
enAliases.add(TEST_MLTV_TERM_VALUE);
testAliases.put("en", enAliases);
return testAliases;
}
public static ItemIdValue getTestItemId() {
return Datamodel.makeWikidataItemIdValue(TEST_ITEM_ID);
}
public static PropertyIdValue getTestPropertyId() {
return Datamodel.makeWikidataPropertyIdValue(TEST_PROPERTY_ID);
}
public static Map<String, JacksonSiteLink> getTestSiteLinkMap() {
Map<String, JacksonSiteLink> testSiteLinkMap = new HashMap<>();
testSiteLinkMap.put("enwiki", TEST_SITE_LINK);
return testSiteLinkMap;
}
public static JacksonStatement getTestNoValueStatement() {
JacksonStatement result = new JacksonStatement(TEST_STATEMENT_ID,
TEST_NOVALUE_SNAK);
result.setSubject(getEmtpyTestItemDocument().getEntityId());
return result;
}
public static JacksonItemDocument getEmtpyTestItemDocument() {
JacksonItemDocument testItemDocument = new JacksonItemDocument();
testItemDocument.setJsonId(getTestItemId().getId());
testItemDocument.setSiteIri(Datamodel.SITE_WIKIDATA);
return testItemDocument;
}
public static JacksonItemDocument getTestItemDocument() {
JacksonItemDocument testItemDocument = new JacksonItemDocument();
testItemDocument.setJsonId(getTestItemId().getId());
testItemDocument.setSiteIri(Datamodel.SITE_WIKIDATA);
testItemDocument.setAliases(getTestAliases());
testItemDocument.setDescriptions(getTestMltvMap());
testItemDocument.setLabels(getTestMltvMap());
return testItemDocument;
}
}
|
Image copyright AFP Image caption Messi and his father paid €5m back to the Spanish tax authorities two years ago
Argentina and Barcelona footballer Lionel Messi and his father should stand trial on tax fraud charges, a court in Spain has ruled.
The judge in charge of the case rejected the request by prosecutors to drop the charges against the striker.
Messi and his father Jorge are accused of defrauding Spain of more than €4m (£3.1m; $5m). They deny any wrongdoing.
Lawyers acting on behalf of the tax authorities demanded 22-month jail sentences for both defendants.
Prosecutors allege that Jorge avoided paying tax on his son's earnings by using offshore companies in Belize and Uruguay in 2007-09.
Messi's lawyers had argued that the player had "never devoted a minute of his life to reading, studying or analysing" the contracts, El Pais newspaper reported earlier.
'Corrective payment'
"There are rational signs that the criminality was committed by both accused parties," wrote the judge in a court filing, according to the AFP news agency.
No date has been set for the trial of the 28-year-old footballer - the four-time World Player of the Year and one of the richest athletes in the world.
In June, the high court in Barcelona ruled that Messi should not be granted immunity for not knowing what was happening with his finances, which were being managed in part by his father.
The income related to Messi's image rights, including contracts with Banco Sabadell, Danone, Adidas, Pepsi-Cola, Procter and Gamble, and the Kuwait Food Company.
Messi and his father made a voluntary €5m "corrective payment" - equal to the alleged unpaid tax plus interest - in August 2013. |
/*
!@
MIT License
Copyright (c) 2019 Skylicht Technology CO., LTD
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This file is part of the "Skylicht Engine".
https://github.com/skylicht-lab/skylicht-engine
!#
*/
#ifdef ANDROID
#include <android/log.h>
#include "stdafx.h"
#include "CApplication.h"
#include "JavaClassDefined.h"
#include "BuildConfig/CBuildConfig.h"
extern "C" {
bool g_appRun = false;
bool g_appRelease = false;
bool g_appRestart = false;
CApplication* g_myApp = NULL;
IrrlichtDevice* g_irrDevice = NULL;
int g_width = -1;
int g_height = -1;
void applicationExitApp();
void applicationInitApp(int width, int height)
{
if (g_width == -1 || g_height == -1)
{
g_width = width;
g_height = height;
}
if (g_appRelease == true)
{
applicationExitApp();
g_appRelease = false;
}
if (g_myApp == NULL)
{
if (g_appRun == true)
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Restart Application");
}
g_myApp = new CApplication();
// create irrlicht device (fix 32 bit texture)
g_irrDevice = createDevice(irr::video::EDT_OPENGLES, core::dimension2d<u32>(g_width, g_height), 32, false, false, false, g_myApp);
if (g_irrDevice == NULL)
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Can not create Irrlicht Device");
return;
}
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Init Application");
// init application
g_myApp->initApplication(g_irrDevice);
// accelerometer
g_myApp->setAccelerometerSupport(true);
g_myApp->setAccelerometerEnable(true);
// run app
g_appRun = true;
g_appRelease = false;
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Init Application Success");
}
}
void applicationLoop()
{
// todo restart application
if (g_appRestart == true)
{
// todo need release app
g_appRelease = true;
g_appRestart = false;
// restart application
applicationInitApp(g_width, g_height);
}
if (g_irrDevice->run())
g_myApp->mainLoop();
}
void applicationRelease()
{
// notify release the app when device resume
g_appRestart = true;
}
void applicationExitApp()
{
if (g_myApp)
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Destroy Application");
g_myApp->destroyApplication();
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Destroy IrrDevice");
if (g_irrDevice)
g_irrDevice->drop();
delete g_myApp;
}
g_myApp = NULL;
g_irrDevice = NULL;
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "Native Application has exited");
}
void applicationPauseApp()
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "applicationPauseApp");
if (g_myApp)
g_myApp->pause();
}
void applicationResumeApp(int showConnecting)
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "applicationResumeApp");
if (g_myApp)
g_myApp->resume(showConnecting);
}
void applicationResizeWindow(int w, int h)
{
g_width = w;
g_height = h;
if (g_myApp)
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "notifyResizeWin");
g_myApp->notifyResizeWin(w, h);
}
else
{
__android_log_print(ANDROID_LOG_INFO, JNI_APPNAME, "do not notifyResizeWin (App is not init)");
}
}
int applicationOnBack()
{
if (g_myApp)
{
return g_myApp->back();
}
return 1;
}
void applicationUpdateAccelerometer(float x, float y, float z)
{
if (g_myApp)
g_myApp->updateAccelerometer(x, y, z);
}
void applicationSetAccelerometer(int b)
{
if (g_myApp)
g_myApp->setAccelerometerSupport(b == 1);
}
void applicationTouchDown(int touchID, int x, int y)
{
if (g_myApp)
g_myApp->updateTouch(touchID, x, y, 0);
}
void applicationTouchMove(int touchID, int x, int y)
{
if (g_myApp)
g_myApp->updateTouch(touchID, x, y, 2);
}
void applicationTouchUp(int touchID, int x, int y)
{
if (g_myApp)
g_myApp->updateTouch(touchID, x, y, 1);
}
void applicationSetAPK(const char *apkPath)
{
CBuildConfig::APKPath = apkPath;
}
void applicationSetSaveFolder(const char *savePath)
{
CBuildConfig::SaveFolder = savePath;
CBuildConfig::ProfileFolder = savePath;
}
void applicationSetDownloadFolder(const char *downloadPath)
{
CBuildConfig::SaveFolder = downloadPath;
}
void applicationSetMountFolder(const char *mountPath)
{
CBuildConfig::MountFolder = mountPath;
}
void applicationSetBundleID(const char *id)
{
CBuildConfig::BundleID = id;
}
void applicationSetDeviceID(const char *id)
{
char mac[512];
strcpy(mac, id);
for (int i = 0, n = strlen(id); i < n; i++)
{
if (mac[i] == ':')
mac[i] = '_';
}
CBuildConfig::DeviceID = mac;
}
void applicationSetAndroidDeviceInfo(const char *manu, const char *model, const char *os)
{
CBuildConfig::Factory = manu;
CBuildConfig::Model = model;
CBuildConfig::OSVersion = os;
}
}
#endif |
/**
* Process a dummy Group object for a Service Resource.
*
* @throws XmlArtifactGenerationException
* if there is no configuration defined for a member Widget of an instance group
* @throws IOException
* if the widget mappings cannot be loaded
*/
@Test
public void testInstanceGroups() throws XmlArtifactGenerationException, IOException {
new ArtifactTestUtils().loadWidgetMappings();
final String instanceGroupType = "org.openecomp.groups.ResourceInstanceGroup";
WidgetConfigurationUtil.setSupportedInstanceGroups(Collections.singletonList(instanceGroupType));
SubstitutionMappings sm = Mockito.mock(SubstitutionMappings.class);
List<Group> groups = Arrays.asList(buildGroup("group", instanceGroupType));
Mockito.when(sm.getGroups()).thenReturn(new ArrayList<Group>(groups));
NodeTemplate serviceNodeTemplate =
buildNodeTemplate("service", "org.openecomp.resource.cr.a-collection-resource");
serviceNodeTemplate.setSubMappingToscaTemplate(sm);
Resource groupResource = new Resource(WidgetType.valueOf("INSTANCE_GROUP"), true);
List<Resource> resources = new ArtifactGeneratorToscaParser(Mockito.mock(ISdcCsarHelper.class))
.processInstanceGroups(groupResource, serviceNodeTemplate);
assertThat(resources.size(), is(1));
Resource resource = resources.get(0);
assertThat(resource.getModelNameVersionId(), is(equalTo(TEST_UUID)));
} |
def read_value(file_path, name):
try:
fl = open(file_path)
except IOError as err:
raise STAPLERerror('Unable to open file:\n{0}\nReason:\n{1}'.format(file_path, err))
d = parse_table_2(fl)
fl.close()
try:
return d[name]
except KeyError:
raise STAPLERerror('The following file does not contain row name {'
'0}\n{1}'.format(name, file_path)) |
/**
* Attempts to enable 8 bits of stencil buffer on this FrameBuffer.
* Modders must call this directly to set things up.
* This is to prevent the default cause where graphics cards do not support stencil bits.
* <b>Make sure to call this on the main render thread!</b>
*/
public void enableStencil()
{
if(stencilEnabled) return;
stencilEnabled = true;
this.resize(viewWidth, viewHeight, net.minecraft.client.Minecraft.ON_OSX);
} |
/**
* Converts a byte array to the hex string.
*
* @param bin the input byte array
* @return the hex encoded string
*/
public static String bin2hex(byte[] bin) {
final int l = bin.length;
final char[] out = new char[l << 1];
for (int i = 0, j = 0; i < l; i++) {
out[j++] = DIGITS_HEX[(0xF0 & bin[i]) >>> 4];
out[j++] = DIGITS_HEX[0x0F & bin[i]];
}
return new String(out);
} |
package com.egoveris.te.base.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name="TE_REGISTRY_TRANSACTION")
public class RegistryTransaction {
@Id
@Column(name="ID")
@GeneratedValue
private Long id;
@Column(name="ID_TRANSACTION")
private String idTransaction;
@Column(name="RESPONSE_DATE")
private Date responseDate;
@Column(name="REQUEST_DATE")
private Date requestDate;
@Column(name="MESSAGE")
private String message;
@Column(name="ID_MENSSAGE")
private String idMessage;
@Column(name="RECEPTION_CODE")
private String receptionCode;
@Column(name="RECEPTION_DESCRIPTION")
private String receptionDescription;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getIdTransaction() {
return idTransaction;
}
public void setIdTransaction(String idTransaction) {
this.idTransaction = idTransaction;
}
public Date getResponseDate() {
return responseDate;
}
public void setResponseDate(Date responseDate) {
this.responseDate = responseDate;
}
public Date getRequestDate() {
return requestDate;
}
public void setRequestDate(Date requestDate) {
this.requestDate = requestDate;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getIdMessage() {
return idMessage;
}
public void setIdMessage(String idMessage) {
this.idMessage = idMessage;
}
public String getReceptionCode() {
return receptionCode;
}
public void setReceptionCode(String receptionCode) {
this.receptionCode = receptionCode;
}
public String getReceptionDescription() {
return receptionDescription;
}
public void setReceptionDescription(String receptionDescription) {
this.receptionDescription = receptionDescription;
}
}
|
def invoke(self, _name, **keywords):
if self.hooksEnabled:
for hook in self.hooks:
hook.push()
try:
method = getattr(hook, _name)
method(*(), **keywords)
finally:
hook.pop() |
Serum creatinine trajectories in real-world hospitalized patients: clinical context and short-term mortality Fluctuations in serum creatinine (SCr) during hospitalization may provide additional prognostic value beyond baseline renal function. This study aimed to identify groups of patients with distinct creatinine trajectories over hospital stay and assess them in terms of clinical characteristics and short-term mortality. This retrospective study included 35 853 unique adult admissions to a tertiary referral center between January 2012 and January 2016 with at least three SCr measurements within the first 9 days of stay. Individual SCr courses were determined using linear regression or linear-splines model and grouped into clusters. SCr trajectories were described as median SCr courses within clusters. Almost half of the patients presented with changing, mainly declining SCr concentration during hospitalization. In comparison to patients with an increase in SCr, those with a significant decline were younger, more often admitted via the emergency department, more often required a higher level of care, had fewer comorbidities and the more pronounced the fall in SCr, the greater the observed difference. Regardless of baseline renal function, an increase in SCr was related to the highest in-hospital mortality risk among compared clusters. Also, patients with normal renal function at admission followed by decreasing SCr were at higher risk of inpatient death, but lower 90-day postdischarge mortality than patients with a stable SCr. Acute changes in inpatient SCr convey important prognostic information and can only be interpreted by looking at their evolution over time. Recognizing underlying causes and providing adequate care is crucial for improving adverse prognosis. |
#include "hflog.h"
#include "hfstr.h"
#include "hfenv.h"
hflog_level_t gl_hflog_level = HFLOG_LEVEL_ERROR;
bool gl_hflog_color = false;
pthread_mutex_t gl_hflog_mutex;
__thread pid_t gl_hflog_tid;
const char* HFLOG_ENVAR_LEVEL = "HFLOG_LEVEL";
const char* HFLOG_ENVAR_COLOR = "HFLOG_COLOR";
const char* hflog_level_str[] = {
"TRACE",
"DEBUG",
"INFO",
"WARN",
"ERROR",
};
#define COLOR_RESET "\033[00m"
#define COLOR_RED "\033[31m"
#define COLOR_GREEN "\033[32m"
#define COLOR_YELLOW "\033[33m"
#define COLOR_BLUE "\033[34m"
#define COLOR_MAGENTA "\033[35m"
#define COLOR_CYAN "\033[36m"
#define COLOR_GRAY "\033[90m"
const char* hflog_color[] = {
COLOR_GRAY,
COLOR_CYAN,
COLOR_GREEN,
COLOR_YELLOW,
COLOR_RED,
};
#define HFLOG_BUFFER 1024
void hflog_init ();
hferr_t hflog_str2level (const char* str, hflog_level_t* level);
hferr_t hflog(hflog_level_t level, char* fmt, ...)
{
if (level < gl_hflog_level)
return HFERR;
char msg[HFLOG_BUFFER] = {0};
char* buf = msg;
if (gl_hflog_color)
buf += sprintf(buf, "%s", hflog_color[level]);
buf += sprintf(buf, "[ %-5s ] ", hflog_level_str[level]);
gl_hflog_tid = syscall(SYS_gettid);
buf += sprintf(buf, "%s (%06d) ", getenv("HOSTNAME"), (int) gl_hflog_tid);
if (gl_hflog_color)
buf += sprintf(buf, "%s", COLOR_RESET);
strcat(msg, fmt);
pthread_mutex_lock(&gl_hflog_mutex);
va_list ap;
va_start(ap, fmt);
vprintf(msg, ap);
va_end(ap);
pthread_mutex_unlock(&gl_hflog_mutex);
return HFOK;
}
__attribute__((constructor)) void hflog_init()
{
hferr_t err;
const char* level;
if (!(err = hfenv(HFLOG_ENVAR_LEVEL, &level, NULL)))
err = hflog_str2level(level, &gl_hflog_level);
if (err)
hfinf("[hflog] using default level configuration: %s\n",
hflog_level_str[gl_hflog_level]);
const char* color;
if (!(err = hfenv(HFLOG_ENVAR_COLOR, &color, NULL)))
err = hfstr_str2bool(color, &gl_hflog_color);
if (err)
hfinf("[hflog] using default color configuration: %s\n",
gl_hflog_color ? "ON" : "OFF");
pthread_mutex_init(&gl_hflog_mutex, NULL);
}
hferr_t hflog_str2level(const char* str, hflog_level_t* level)
{
if (strcmp(str, "TRACE") == 0)
*level = HFLOG_LEVEL_TRACE;
else if (strcmp(str, "DEBUG") == 0)
*level = HFLOG_LEVEL_DEBUG;
else if (strcmp(str, "INFO") == 0)
*level = HFLOG_LEVEL_INFO;
else if (strcmp(str, "WARNING") == 0)
*level = HFLOG_LEVEL_WARNING;
else if (strcmp(str, "ERROR") == 0)
*level = HFLOG_LEVEL_ERROR;
else if (strcmp(str, "OFF") == 0)
*level = HFLOG_LEVEL_OFF;
else {
hfwar("[hflog] invalid log level option: %s\n", str);
return HFERR;
}
return HFOK;
}
|
import sys
import json
import spacy
import time
import os
import re
from spacy.matcher import Matcher
from tqdm import tqdm
# Usage: python parse.py filename [keywords(comma-delimited)]
start_time = time.time()
nlp = spacy.load('en_core_web_lg')
print('Loading SpaCy model took', time.time() - start_time, 'seconds\n')
def parse(fname, keywords=None):
"""
Format: python parse.py filename [keywords(comma-delimited)]
"""
if not os.path.exists('./out-parse/'):
os.makedirs('./out-parse/')
in_path = './out-filtered/' + fname
out_path = './out-parse/' + fname
topic = fname.replace('-', '.').split('.')[1]
if keywords is None:
keywords = [topic]
keywords.append('suffers from')
# for keyword in [i for i in keywords]:
# keywords.append('person with ' + keyword)
pattern = []
seen = set()
for keyword in keywords:
stem = [nlp(word)[0].lemma_ for word in re.split('[ -]', keyword)]
if ' '.join(stem) not in seen:
p = []
for word in stem:
p.append({'LEMMA': word})
seen.add(' '.join(stem))
pattern.append(p)
print(pattern)
matcher = Matcher(nlp.vocab)
matcher.add(0, None, *pattern)
f_in = open(in_path, 'r')
f_out = open(out_path, 'w')
for line in tqdm(f_in):
to_write = {}
js = json.loads(line)
to_write['url'] = list(js.keys())[0]
text = list(js.values())[0]['text']
title = list(js.values())[0]['title']
doc = nlp(title + '. ' + text)
matches = matcher(doc)
# to_write['text'] = text
to_write['title'] = title
to_write['datetime'] = list(js.values())[0]['datetime']
to_write['source'] = list(js.values())[0]['source']
to_write['keyword_rank'] = js['keyword_rank']
to_write['keyword_count'] = js['keyword_count'] # could also use len(matches) for consistency (spacy over nltk)
to_write['num_tokens'] = js['num_tokens'] # total no. of tokens, excluding stop words; could also use spacy
to_write['num_sentences'] = len([0 for sent in doc.sents]) # but this looks like a better relevance metric anw
# match_vectors = []
sents = {}
keywords_used = {}
for match_id, start, end in matches:
# token = doc[start]
# this_match = {'text': token.text, 'start': start}
span = doc[start: end] # matched span
if span.text.lower() in keywords_used:
keywords_used[span.text.lower()] += 1
else:
keywords_used[span.text.lower()] = 1
sent = span.sent # sentence containing matched span
if sent.text not in sents:
# this_match['Sentence'] = sent.text
sents[sent.text] = {'keyword_count': 1}
else:
# this_match['Sentence'] = 'seen'
sents[sent.text]['keyword_count'] += 1
'''
# instead of just using direct parent/child, get all words that refer/modify the keyword somehow?
# Not used in current implementation of sentiment.py, thus low priority.
if token.dep_ != 'ROOT':
this_match['Parent'] = {'text': token.head.text, 'sentiment': token.head.sentiment}
child_vectors = []
for child in token.children:
child_vectors.append({'text': child.text, 'sentiment': child.sentiment})
this_match['Children'] = child_vectors
'''
# match_vectors.append(this_match)
to_write['num_relevant_sentences'] = len(sents)
to_write['relevant_sentences'] = sents
to_write['keywords_used'] = keywords_used
if len(sents) == 0:
continue
# to_write['matches'] = match_vectors
f_out.write(json.dumps(to_write))
f_out.write('\n')
f_in.close()
f_out.close()
if __name__ == '__main__':
if len(sys.argv) > 2:
keys = sys.argv[2].split(',')
parse(sys.argv[1], keys)
else:
parse(sys.argv[1])
|
CHAPTER 16. Essentiality, Bioavailability, and Health Benefits of -Tocopherol Stereoisomers Vitamin E is the term that describes eight structurally-related vitamers, specifically four tocopherols (-, -, -, and -) and four tocotrienols (-, -, -, and -). Although each vitamer has antioxidant activity that prevents the cyclic progression of lipid peroxidation, -tocopherol is the only form that is essential for humans because it prevents and reverses clinical deficiency of vitamin E. These vitamers also differ substantially in their bioavailability, which results in -tocopherol accumulating to the greatest extent in the circulation and tissues in humans. In nature, -tocopherol exists as a single stereoisomer (2R, 4R, 8R- or RRR--tocopherol) whereas most dietary supplements and fortified foods contain an all racemic mixture of eight -tocopherol stereoisomers. Importantly, only 50% of these stereoisomers are appreciably bioavailable, and therefore capable of contributing to dietary -tocopherol requirements in humans. This chapter will therefore focus on the bioavailability, metabolism, and trafficking of vitamin E forms along the gutliver axis. It will also discuss their structurefunction aspects concerning their ability to contribute to dietary vitamin E requirements and associated health benefits. |
MOVPE growth of AIIIBVN semiconductor compounds for photovoltaic applications The present work presents the influence of the growth parameters on the structural and optical properties of undoped GaAsN epilayers and triple quantum wells 3InGaAsN/GaAs obtained by atmospheric pressure metal organic vapour phase epitaxy APMOVPE. The structures were examined using high resolution XRay diffraction HRXRD, contactless electroreflectance CER, photocurrent PC and Raman RS spectroscopies. The influence of the growth temperature and the gas phase composition on the material quality and alloy composition of the investigated structures as well as the growth and calibration characteristics are presented and discussed. (© 2012 WILEYVCH Verlag GmbH & Co. KGaA, Weinheim) |
Miloš Bošković
Miloš Bošković (Serbian Cyrillic: Милош Бошковић; born 1985) is a politician in Serbia. He served in the National Assembly of Serbia from 2016 to 2018 as a member of the anti-establishment and reformist It's Enough – Restart association, better known in English by the name "Enough Is Enough."
Bošković is from Niš and works as a programmer. He received the fifteenth position on the "Enough Is Enough" list for the 2016 Serbian parliamentary election and was elected when the list won sixteen mandates. He served in the assembly as an opposition deputy and was a member of the environmental protection committee and a deputy member of the committee on Kosovo-Metohija and the committee on spatial planning, transport, infrastructure, and telecommunications. He also served on the parliamentary friendship groups with Austria, Croatia, and the United Kingdom.
Bošković resigned from the assembly on March 16, 2018, saying that he was unhappy with the direction of the It's Enough – Restart organization. |
Use of Complementary and Integrated Health: A Retrospective Analysis of U.S. Veterans with Chronic Musculoskeletal Pain Nationally. OBJECTIVE To partially address the opioid crisis, some complementary and integrative health (CIH) therapies are now recommended for chronic musculoskeletal pain, a common condition presented in primary care. As such, health care systems are increasingly offering CIH therapies, and the Veterans Health Administration (VHA), the nation's largest integrated health care system, has been at the forefront of this movement. However, little is known about the uptake of CIH among patients with chronic musculoskeletal pain. As such, we conducted the first study of the use of a variety of nonherbal CIH therapies among a large patient population having chronic musculoskeletal pain. MATERIALS AND METHODS We examined the frequency and predictors of CIH therapy use using administrative data for a large retrospective cohort of younger veterans with chronic musculoskeletal pain using the VHA between 2010 and 2013 (n=530,216). We conducted a 2-year effort to determine use of nine types of CIH by using both natural language processing data mining methods and administrative and CPT4 codes. We defined chronic musculoskeletal pain as: having 2+ visits with musculoskeletal diagnosis codes likely to represent chronic pain separated by 30-365 days or 2+ visits with musculoskeletal diagnosis codes within 90 days and with 2+ numeric rating scale pain scores ≥4 at 2+ visits within 90 days. RESULTS More than a quarter (27%) of younger veterans with chronic musculoskeletal pain used any CIH therapy, 15% used meditation, 7% yoga, 6% acupuncture, 5% chiropractic, 4% guided imagery, 3% biofeedback, 2% t'ai chi, 2% massage, and 0.2% hypnosis. Use of any CIH therapy was more likely among women, single patients, patients with three of the six pain conditions, or patients with any of the six pain comorbid conditions. CONCLUSIONS Patients appear willing to use CIH approaches, given that 27% used some type. However, low rates of some specific CIH suggest the potential to augment CIH use. |
from setuptools import setup, find_packages
def listify(filename):
return filter(None, open(filename,'r').read().split('\n'))
setup(
name = "jmbo-your-words",
version = "0.0.5",
url = 'http://github.com/praekelt/jmbo-your-words',
license = 'BSD',
description = 'Provides users to submit their own stories',
author = '<NAME>',
author_email = '<EMAIL>',
packages = find_packages(),
install_requires = listify('requirements.pip'),
tests_require=[
'django-setuptest',
],
test_suite="setuptest.setuptest.SetupTestSuite",
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking'
]
)
|
package com.honvay.cola.cloud.uc.client;
/**
* @author LIQIU
* @date 2018-4-1
**/
public class UcClientConstant {
/**
* 社会化登录类型 - 微信小程序
*/
public final static String SOCIAL_TYPE_WECHAT_MINIAP = "wechatMA";
}
|
<reponame>hosonokotaro/hosonokotaro-blog
import axios from 'axios';
// NOTE: dev: local, prod: cloud functions
const baseURL =
process.env.NODE_ENV === 'development'
? 'http://localhost:5001/hosonokotaro-blog/asia-northeast1/api'
: 'https://asia-northeast1-hosonokotaro-blog.cloudfunctions.net/api';
const axiosInstance = axios.create({
baseURL,
headers: { 'Content-Type': 'application/json' },
responseType: 'json',
});
export default axiosInstance;
|
The present invention relates to a multipole low-voltage circuit breaker having bus bars for connecting contact arrangements of the circuit breaker to one or more circuits, where the bus bars for the input side and the bus bars for the output side are arranged in a row each and both rows are arranged parallel to each other and at right angles to side walls of the circuit breaker.
A circuit breaker of this type has become known, for instance, from European Pat. No. EP-A-0 071 385. There, each terminal is located at a conductor section which extends horizontally backward relative to the customary use position of the circuit breaker. Provision is made by stiffening elements that the bus bars cannot be deformed by current forces.
In this design, the circuit breaker is suited, for instance, for a withdrawable arrangement, in which suitable transition pieces or parts of the break contact arrangement are attached to the bus bars. If, on the other hand, the circuit breaker is to be incorporated fixed into a switching installation, connecting bars are required which are inserted between the terminals of the circuit breaker and the stationary bus bars. It is no problem here to connect the connecting bars to the terminals of the contact arrangement before the circuit breaker is built into the switching installation; if, however, also the connection to the stationary bus bars should be possible without difficulty if the arrangement is not aligned, the length of the connecting bars must not be less than a certain value in order to ensure good accessibility especially from the front of the circuit breaker. Due to the relative length of the connecting bars, the problem arises that the connecting bars are subjected, in the case of a short circuit, to deforming forces which can under some conditions damage not only the connecting bars themselves, but also the terminals and connecting elements.
It would basically be possible to avoid such detrimental deformations by designing the connecting bars as a fixed part of the circuit breaker and by fixing them completely accordingly except for a free end provided for connection to a stationary bus bar. Such a circuit breaker, however, would not be suitable without change also for use as a plug-in circuit breaker. Furthermore, an embedment of the connecting bars would impede the heat removal in an undesirable manner. While on the other hand, a design of the connecting bars with a cross section larger than that required for electrical considerations would increase the strength in the desired manner, the weight and the costs of the connecting arrangement would be increased considerably at the same time, however. |
Exploring the role of social proof of credibility and usability for internet banking adoption through media networks Present study has offered two theoretical models which may helpful to understand the importance of social proof during internet banking (IB) adoption. The existing technology adoption model such as TAM has ignored the importance of social proof of credibility such as risk, security, and privacy. People are actively involved to take recommendations from close sources, experts, customers, and crowd opinion using social media platforms (SMPs). The purpose to gather information is to save from risk, security, and privacy issues especially when customers must share their personal and financial information during IB. It has found that conventional banks have positive word of mouth, recommendations, and reviews therefore the number of IB customers, profitability, and growth is high compared to Islamic banks. Conversely, SMPs have more negative word of mouth and stories which creates social proof regarding the uncertainty and risk in IB adoption. Findings highlights that people have social trust, confidence, and believe in their close sources and conventional banks. |
When commodity prices crashed in late 2014, oil executives could look at their mining counterparts with a sense of superiority.
Back then, the world’s biggest oil companies enjoyed relatively strong balance sheets, with little borrowing relative to the value of their assets. Miners entered the slump in a very different state and some of the world’s largest — Rio Tinto Plc, Anglo American Plc and Glencore Plc — had to reduce dividends and employ draconian spending cuts to bring their debt under control.
Two years on, you could excuse mining executives for feeling smug. As crude trades well below $50 a barrel, Exxon Mobil Corp., Royal Dutch Shell Plc and other oil giants have seen their debt double to a combined $138 billion, spurring concerns they’ll need to keep slashing capital spending and that dividend cuts may eventually be necessary.
Worse, the mountain of debt, which has grown tenfold since 2008, is likely to increase further in the third and fourth quarters, executives and analysts said.
“On the debt, it may go up before it comes back down,” Shell Chief Financial Officer Simon Henry told investors last week. “And the major factor is the oil price.”
The main concern is that companies have so far failed to stop the increase in debt load, said Harold “Skip” York, vice president of integrated energy at consulting firm Wood Mackenzie Ltd. in Houston.
“The debt traffic light is yellow,” he said. “In the absence of an oil price uptick or sizable asset sales, commitments to maintain the dividend will face even more pressure.”
The problem for Big Oil is simple: Companies are spending a lot more than they’re earning. Both West Texas Intermediate and Brent crude, the two most prominent benchmark grades, slid into bear markets this week after falling more than 20 percent since early June.
The first-half results indicate that oil companies “are likely to generate large negative free cash flows for the full year,” said Dmitry Marinchenko, an associate director at Fitch Ratings in London.
Take Chevron Corp. In the first half of the year, it generated $3.7 billion pumping crude, refining it and selling gasoline and other products. But that wasn’t enough to cover the $4 billion it paid to shareholders over the same period, let alone the $10 billion it invested in projects. Although Chevron tried to close the gap by selling $1.4 billion worth of assets, it still had to take on $6.5 billion in new debt over six months.
The imbalance explains why the debt load has grown so quickly over the last decade. Before oil prices plunged in mid-2014, Big Oil had around $71 billion in net debt, up from a low of just $13 billion in mid-2008, when oil prices hit a record high of nearly $150.
Growing Debt
Debt levels are currently rising at an annual rate of 11.5 percent, more than double the 5.1 percent witnessed between 2009 and 2014, said Virendra Chauhan, an oil analyst at consulting firm Energy Aspects Ltd. in Singapore.
“Whilst credit markets have been expansive and accessible during this time period, investor concerns about the sustainability of this trend are valid,” he said.
For some oil bosses, including Shell Chief Executive Officer Ben Van Beurden, reducing debt is now the main priority, ahead of paying shareholders dividends and investing in new projects. His company’s debt has risen especially fast after borrowing to finance the $54 billion acquisition of gas producer BG Group Plc earlier this year.
Yet, the oil companies have been able to take on more debt fairly easily because ultra-low interest rates allow added borrowing without risking credit-rating downgrades.
BP CEO Bob Dudley said the British company could “actually manage a little bit more” debt. “Money is so cheap right now,” he said.
And Exxon executives believe the company still has significant debt capacity. “We’ve got a very strong balance sheet,” Jeff Woodbury, vice president of investor relations, told analysts during a conference call. “We’re not going to forgo attractive opportunities.” |
An Adjusted Error Score Calculation for the Farnsworth-Munsell 100 Hue Test ABSTRACT The Farnsworth-Munsell 100 Hue Test, a test that measures an individuals hue discrimination ability, operates with the fundamental assumption that it is administered using a fixed, standard illuminant. This assumption is violated when the testing illuminant is changedas is common when testing color discrimination ability of an illuminantwhich likely causes a reordering of the caps in the test. To ensure that a participant is not falsely penalized for correctly responding to a hue transposition caused by the new testing light source, an adjusted error score is proposed that reconciles light sourceinduced hue transpositions and participant performance on the test. |
// FromStruct create a Data from struct
func FromStruct(s interface{}) (*StructData, error) {
data := &StructData{
ValidateTag: gOpt.ValidateTag,
fieldNames: make(map[string]int8),
fieldValues: make(map[string]reflect.Value),
}
if s == nil {
return data, ErrInvalidData
}
val := reflect.ValueOf(s)
if val.Kind() == reflect.Ptr && !val.IsNil() {
val = val.Elem()
}
typ := val.Type()
if val.Kind() != reflect.Struct || typ == timeType {
return data, ErrInvalidData
}
data.src = s
data.value = val
data.valueTpy = typ
return data, nil
} |
Esperanza Baur
Biography
Born Esperanza Díaz Ceballos, nicknamed "Chata", she appeared in a small number of Spanish language films, both in leading and supporting roles.
Esperanza met John Wayne in 1941 in Mexico City while he was vacationing there. At the time, he was still married to his first wife, Josephine Alicia Saenz but that marriage ended December 25, 1945. Esperanza and John were married on January 17, 1946, in Long Beach, California.
Their marriage was rocky and volatile from the start because she was reportedly jealous of his devotion to his work and to his four children; they had no children of their own. "Our marriage was like shaking two volatile chemicals in a jar," Wayne said. Esperanza accused Wayne of having an affair with Gail Russell, his leading lady in Angel and the Badman, which he denied. There were charges and counter-charges of unfaithfulness, drunken violence, emotional cruelty, and "clobbering." Wayne described his wife as a "drunken partygoer who would fall down and then accuse him of pushing her." Esperanza was accused of having an affair with hotel heir Nicky Hilton during divorce proceedings. They separated in May 1952, and the marriage lasted eight years, coming to an end on November 1, 1954.
Esperanza died of a heart attack in 1961. |
App allows children suffering from cancer to record their pain, which enables medical staff to analyse their illness.
Helping children suffering from cancer cope with pain can be one of the biggest challenges for medics. But now there is an iPhone app to help young victims monitor and record their pain and that, in turn, helps medical staff analyse their illness. |
Okay, let's get real. We've had a series of colossal failures--Chuck Prince at Citicorp, Stanley O'Neal at Merrill Lynch and Angelo Mozilo at Countrywide Financial. All three are losing their jobs or their companies, yet each is walking away with at least $50 million in golden parachutes.
This is pretty outrageous. These individuals have presided over the destruction of billions of dollars of shareholder wealth. Their actions, combined with the misdeeds of others, may precipitate a recession in the United States. Millions of Americans are going to lose homes or jobs or both.
So how can these boards justify the rich exit packages? It's one thing if CEOs are highly compensated for a huge success that benefits shareholders, employees and customers. There is some justice in "pay for performance."
But there's no justice in these cases. The boards should resort to "clawback" provisions that allow them to dramatically reduce these outsized parachutes. It would be far smarter to do that now rather than wait for Congress to start demanding scalps once the recession unfolds. |
The Carpet-3 multipurpose shower array for searching cosmic diffuse gamma rays with energy E > 100 TeV An experiment for measuring the flux of cosmic gamma rays with energy above 100 TeV is currently being prepared at the Baksan Neutrino Observatory of the Institute for Nuclear Research, Russian Academy of Sciences. At present the plastic scintillation counters with a total continuous area of 410 m2 are installed in the muon detector (MD) underground tunnels, and they are totally equipped with electronics. Six modules of shower detectors have been already placed on the surface of the MD absorber. In each of them 9 standard plastic scintillation counters are placed with an area of 1 m2 each. These modules are components of the ground surface part of Carpet-3 shower array. The data acquisition system for this array is almost ready. Expected flux limits for cosmic diffuse gamma rays of galactic origin in this work is close to existing experimental limits in the range lower than about 5 PeV, and with improved sensitivity of Carpet-3 one can hope to detect this flux or at least to obtain the best upper limit. Introduction Interest in searching for primary gamma rays with energy above 100 TeV noticeably increased in recent times in connection with the results of the IceCube experiment in which high-energy neutrinos of astrophysical origin were detected. It was shown in that if these neutrinos are a result of decays of charged pions in the Galaxy, there also must exist neutral pions having the same energy range from 10 14 to 510 17 eV during their decay. Diffuse gamma rays at energies E >100 TeV are searched for by the EAS method in experiments in which one can separate the showers produced by primary photons and nuclei. This separation is possible due to the fact that showers from primary photons are significantly depleted in hadrons (and, as a consequence, in muons) as compared to showers from primary nuclei. The Carpet-3 multipurpose shower array developed at the Baksan Neutrino Observatory, Institute for Nuclear Research, Russian Academy of Sciences, already has a muon detector with an area of 410 m 2, with the possibility to increase its area to 615 m 2. To increase the detection area of EAS axes, ground base modules of scintillation counters will be additionally mounted. Preliminary estimates show that the new array will have the best sensitivity to the flux of primary gamma rays with energies in the range from 100 TeV to 1 PeV. The Carpet-2 array The Carpet-2 multipurpose shower array is intended for studying the electron, muon, and hadron shower components. It is deployed at an altitude of 1700 m above sea level (depth of 840 g/cm 2 in the Earth's atmosphere). Its coordinates are 43 o 25N and 42 o 40E, the respective vertical cutoff rigidity being 5.6 GV. The frequency of such events is ~1.2 Hz. Trigger M2 is generated by a signal from the energy release in the Carpet with a threshold of 2.5 GeV. A muon detector (MD) is arranged at a distance of 48 m from the central part of the array; it is placed in an underground tunnel at a depth of 500 g/cm 2, which corresponds to the energy threshold of 1 GeV. The RC convertor is a logarithmic encoder whose operating principle is based on charging the capacitance C with a pulsed current from the PM and its exponential discharge through a resistor R. The conversion time constant is 1s. The filling of a convertor signal with 10-MHz frequency pulses ensures a 10% measurement accuracy. The measurement range of the energy release of the convertor is from 6 to 20000 MeV. Information from the counters is recorded using two triggers of the Carpet array and the intrinsic MD trigger generated by the coincidence circuit upon the actuation of any three of five MD modules. The Carpet-3 array The Carpet-3 shower array (figure 1) is designed based on the existing Carpet -2 array. Preparations for this experiment entail a gradual increase in the continuous area of the muon detector (MD), first to 410 m 2 and then up to 615 m 2. At the same time, to increase the detection area of the EAS axes, 20 additional modules with liquid scintillation counters in each module will be installed. The area of each counter is equal to 0.5 m 2. At the moment, 410 scintillation counters with a total continuous area of 410 m 2 have already been installed in the MD underground tunnels. They are fully equipped with electronics. The testing of the scintillation counter electronics is under way, and the data acquisition system for the MD configuration is being designed. Seven modules with heat insulated walls have been already mounted on the surface of the muon detector absorber. The thermal control for the module detectors will be implemented by heating them from below using flexible tape heating elements (FTHEs). The detectors will be mounted in three rows in each detector; under each of them, three heating tapes with a power of 200 W each will be placed. The total power of the heating elements for a module will be 1.8 kW. The electric circuit of the thermostat will ensure stabilization of the detector temperature at a level of 0.25 o C during the whole year, which will stabilize the signal from the detectors at a level of 0.1%. The views of the first tunnel of MD and a module with the plastic detectors are presented in figure 2, and at in figure 3, respectively. The preliminary results for diffuse gamma radiation For evaluation of the efficiency of gamma ray selection artificial showers were simulated with the help of CORSIKA code v.6720 (model QGSJET01C for high energy and Fluka 2006 for low energy). 5400 showers from primary protons within energy range (0.316-31.6) PeV were simulated, as well as 815 events of primary gamma-rays in the energy range (0.3-9) PeV. As a result of simulation made for showers from primary protons and gamma rays, the following dependencies have been obtained: Since there are no detected events in the selected region (background is absent), one can use the next formula for estimation of the flux upper limit for primary gamma rays at 90% confidence level: These results are compared with the results of other air shower arrays. The energy range for these fluxes is (0.5-5) PeV. Also presented in figure 5 are the expected limits on the flux of cosmic diffuse gamma radiation for two configuration of "Carpet-3" array and for two values of data accumulation time. As is seen, even with the MD area of 410 m 2 the new array will have the best sensitivity to the flux of primary gamma rays with energies in the range 100 TeV -1 PeV. Conclusion At present the "Carpet-3" multipurpose shower array is developed at the Baksan Neutrino Observatory, Institute for Nuclear Research, Russian Academy of Sciences, already has a muon detector with an area of 410 m 2, with the possibility to increase its area to 615 m 2. The additional modules with liquid scintillation counters in each module will be installed. These modules are to increase the detection area of the shower axes and, consequently will make it possible to increase the statistics of recorded events and to decrease the energy threshold of the primary cosmic radiation. |
POINT-OF-USE WATER FILTRATION IN RURAL HAITI: TRIHALOMETHANE PRODUCTION AND FACTORS FOR PROGRAM SUCCESS The Florida-based non-governmental organization Gift of Water, Incorporated (GWI) produces, distributes, and provides technical assistance on household water filtration systems in rural Haiti. The GWI purifier utilizes chlorine in the form of bleach for disinfection, a cotton filter for sediment removal, and a granulated activated carbon (GAC) filter for chemical removal. Because of the chlorination step, GWI is concerned with the possible production of trihalomethanes (THMs). THMs are disinfection by-products (DBPs) associated with potential human health effects. During the month of January, 2001, water sources in Haiti were visited and sampled. Raw source waters were analyzed for physical parameters, and purified finished waters were collected for analysis at MIT. Results of that analysis determined that no finished water sample was above World Health Organization (WHO) guideline values for concentrations of the four individual THMs. In addition, only one finished water sample was above the WHO guideline value and United States Environmental Protection Agency (USEPA) standard for total THM (TTHM) concentration. TTHM concentration correlated with the total usage of the carbon filter, and conductivity of the water, as shown in the following equation: TTHM (g/L) = 0.14 (Total Usage) + 21 (Conductivity) 9.6 R = 0.780 The most important variable in TTHM concentration was determined to be total usage of the GAC filter. Reliable GAC filter replacement is thus critical to maintaining low concentrations of THMs in finished waters in Haiti. In addition, critical factors that lead to GWI program success were investigated during the field visits in January. Three critical factors were determined necessary for successful implementation of the purifier program into the community: dedicated and responsible staff, planned distribution of purifiers, and purifiers as part of a larger community development initiative. |
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
#import <Quikkly/Quikkly.h>
extern NSString *QuikklyManagerErrorDomain;
@interface QuikklyManager : NSObject <RCTBridgeModule>
+ (void)configure;
@end
|
class ThermocoupleType:
"""This is an enumeration of thermocouple types and their values.
This has been added for a more straightforward way of displaying and checking the thermocouple types.
"""
PHIDGET_TEMPERATURE_SENSOR_K_TYPE = 1
PHIDGET_TEMPERATURE_SENSOR_J_TYPE = 2
PHIDGET_TEMPERATURE_SENSOR_E_TYPE = 3
PHIDGET_TEMPERATURE_SENSOR_T_TYPE = 4 |
<reponame>robertodavinci/Software_Engineering_2_Project_Medvedec_Sikora<filename>Implementation/CLup/app/src/main/java/com/example/clup/Entities/TicketState.java
package com.example.clup.Entities;
// TicketState enumeration - WAITING are the tickets that are in queue, and ACTIVE are the tickets
// that are able to enter the store but have not entered yet
// IN_STORE and EXPIRED are not used in this version since tickets get deleted as soon as they
// are validated
public enum TicketState {
WAITING,
ACTIVE;
//IN_STORE,
//EXPIRED;
}
|
<reponame>sourcecode-reloaded/Xming<gh_stars>1-10
/* $Xorg: do_char.c,v 1.3 2000/08/17 19:46:24 cpqbld Exp $ */
/*
Copyright 1989-1991, Bitstream Inc., Cambridge, MA.
You are hereby granted permission under all Bitstream propriety rights to
use, copy, modify, sublicense, sell, and redistribute the Bitstream Speedo
software and the Bitstream Charter outline font for any purpose and without
restrictions; provided, that this notice is left intact on all copies of such
software or font and that Bitstream's trademark is acknowledged as shown below
on all unmodified copies of such font.
BITSTREAM CHARTER is a registered trademark of Bitstream Inc.
BITSTREAM INC. DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. BITSTREAM SHALL NOT BE LIABLE FOR ANY DIRECT OR INDIRECT
DAMAGES, INCLUDING BUT NOT LIMITED TO LOST PROFITS, LOST DATA, OR ANY OTHER
INCIDENTAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR IN ANY WAY CONNECTED
WITH THE SPEEDO SOFTWARE OR THE BITSTREAM CHARTER OUTLINE FONT.
*/
/* $XFree86: xc/lib/font/Speedo/do_char.c,v 1.3 2001/01/17 19:43:17 dawes Exp $ */
/***************************** D O - C H A R . C *****************************
* *
* This is the top level module for processing one simple or composite *
* character.
* *
****************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "spdo_prv.h" /* General definitions for Speedo */
#define DEBUG 0
#if DEBUG
#include <stdio.h>
#define SHOW(X) printf("X = %d\n", X)
#else
#define SHOW(X)
#endif
/***** GLOBAL VARIABLES *****/
/***** GLOBAL FUNCTIONS *****/
/***** EXTERNAL VARIABLES *****/
/***** EXTERNAL FUNCTIONS *****/
/***** STATIC VARIABLES *****/
/***** STATIC FUNCTIONS *****/
static boolean sp_make_simp_char(PROTO_DECL2 ufix8 FONTFAR *pointer,ufix8 format);
static boolean sp_make_comp_char(PROTO_DECL2 ufix8 FONTFAR *pointer);
static ufix8 FONTFAR *sp_get_char_org(PROTO_DECL2 ufix16 char_index,boolean top_level);
static fix15 sp_get_posn_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format);
static fix15 sp_get_scale_arg(PROTO_DECL2 ufix8 FONTFAR *STACKFAR *ppointer,ufix8 format);
FUNCTION ufix16 get_char_id(
GDECL
ufix16 char_index) /* Index to character in char directory */
/*
* Returns character id for specified character index in currently
* selected font.
* Reports Error 10 and returns 0 if no font selected.
* Reports Error 12 and returns 0 if character data not available.
*/
{
ufix8 FONTFAR *pointer; /* Pointer to character data */
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return (ufix16)0; /* Return zero character id */
}
pointer = sp_get_char_org(char_index, TRUE); /* Get pointer to character data */
if (pointer == NULL) /* Character data not available? */
{
report_error(12); /* Report character data not avail */
return (ufix16)0; /* Return zero character id */
}
return 0xffff & NEXT_WORD(pointer); /* Return character id */
}
#if INCL_METRICS
FUNCTION fix31 get_char_width(
GDECL
ufix16 char_index) /* Index to character in char directory */
/*
* Returns character set width for specified character index in currently
* selected font in units of 1/65536 em.
* Reports Error 10 and returns 0 if no font selected.
* Reports Error 12 and returns 0 if character data not available.
*/
{
ufix8 FONTFAR *pointer; /* Pointer to character data */
fix31 set_width; /* Set width of character */
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return (fix31)0; /* Return zero character width */
}
pointer = sp_get_char_org(char_index, TRUE); /* Get pointer to character data */
if (pointer == NULL) /* Character data not available? */
{
report_error(12); /* Report character data not avail */
return (fix31)0; /* Return zero character width */
}
pointer += 2; /* Skip over character id */
set_width = (fix31)NEXT_WORD(pointer); /* Read set width and Convert units */
set_width = ((set_width << 16) + (sp_globals.metric_resolution >> 1)) / sp_globals.metric_resolution;
return set_width; /* Return in 1/65536 em units */
}
#endif
#if INCL_METRICS
FUNCTION fix15 get_track_kern(
GDECL
fix15 track, /* Track required (0 - 3) */
fix15 point_size) /* Point size (units of whole points) */
/*
* Returns inter-character spacing adjustment in units of 1/256
* points for the specified kerning track and point size.
* If the specified point size is larger than the maximum point
* size for the specified track, the adjustment for the maximum
* point size is used.
* If the specified point size is smaller than the minimum point
* size for the specified track, the adjustment for the minimum
* point size is used.
* If the specified point size is between the minimum point size
* and the maximum point size for the specified track, the
* adjustment is interpolated linearly between the minimum and
* maximum adjustments.
* Reports Error 10 and returns 0 if no font selected.
* Reports Error 13 and returns 0 if track kerning data not in font.
*/
{
ufix8 FONTFAR *pointer; /* Pointer to character data */
fix15 no_tracks; /* Number of kerning tracks in font */
ufix8 format; /* Track kerning format byte */
fix15 i; /* Track counter */
fix15 min_pt_size = 0; /* Minimum point size for track */
fix15 max_pt_size = 0; /* Maximum point size for track */
fix15 min_adj = 0; /* Adjustment for min point size */
fix15 max_adj = 0; /* Adjustment for max point size */
fix31 delta_pt_size; /* Max point size - min point size */
fix31 delta_adj; /* Min adjustment - max adjustment */
fix15 adj = 0; /* Interpolated adjustment */
if (track == 0) /* Track zero selected? */
{
return adj; /* Return zero track kerning adjustment */
}
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return adj; /* Return zero track kerning adjustment */
}
no_tracks = sp_globals.kern.no_tracks; /* Number of kerning tracks */
if (track > no_tracks) /* Required track not available? */
{
report_error(13); /* Report track kerning data not avail */
return adj; /* Return zero track kerning adjustment */
}
pointer = sp_globals.kern.tkorg; /* Point to start of track kern data */
for (i = 0; i < track; i++) /* Read until track required is read */
{
format = NEXT_BYTE(pointer); /* Read track kerning format byte */
min_pt_size = (format & BIT0)?
NEXT_WORD(pointer):
(fix15)NEXT_BYTE(pointer);
min_adj = (format & BIT1)?
NEXT_WORD(pointer):
(fix15)NEXT_BYTE(pointer);
max_pt_size = (format & BIT2)?
NEXT_WORD(pointer):
(fix15)NEXT_BYTE(pointer);
max_adj = (format & BIT3)?
NEXT_WORD(pointer):
(fix15)NEXT_BYTE(pointer);
}
if (point_size <= min_pt_size) /* Smaller than minimum point size? */
{
return min_adj; /* Return minimum adjustment (1/256 points) */
}
if (point_size >= max_pt_size) /* Larger than maximum point size? */
{
return max_adj; /* Return maximum adjustment (1/256 points) */
}
delta_pt_size = (fix31)(max_pt_size - min_pt_size);
delta_adj = (fix31)(min_adj - max_adj);
adj = (fix15)(min_adj -
(((fix31)(point_size - min_pt_size) * delta_adj +
(delta_pt_size >> 1)) / delta_pt_size));
return adj; /* Return interpolated adjustment (1/256 points) */
}
#endif
#if INCL_METRICS
FUNCTION fix31 get_pair_kern(
GDECL
ufix16 char_index1, /* Index to first character in char directory */
ufix16 char_index2) /* Index to second character in char directory */
/*
* Returns inter-character spacing adjustment in units of 1/65536 em
* for the specified pair of characters.
* Reports Error 10 and returns 0 if no font selected.
* Reports Error 14 and returns 0 if pair kerning data not in font.
*/
{
ufix8 FONTFAR *origin; /* Pointer to first kerning pair record */
ufix8 FONTFAR *pointer; /* Pointer to character data */
ufix16 tmpufix16; /* Temporary workspace */
fix15 no_pairs; /* Number of kerning pairs in font */
ufix8 format; /* Track kerning format byte */
boolean long_id; /* TRUE if 2-byte character ids */
fix15 rec_size; /* Number of bytes in kern pair record */
fix15 n; /* Number of remaining kern pairs */
fix15 nn; /* Number of kern pairs in first partition */
fix15 base; /* Index to first record in rem kern pairs */
fix15 i; /* Index to kern pair being tested */
fix31 adj = 0; /* Returned value of adjustment */
fix15 adj_base = 0; /* Adjustment base for relative adjustments */
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return adj; /* Return zero pair kerning adjustment */
}
no_pairs = sp_globals.kern.no_pairs; /* Number of kerning pairs */
if (no_pairs == 0) /* Pair kerning data not available? */
{
report_error(14); /* Report pair kerning data not avail */
return adj; /* Return zero pair kerning adjustment */
}
pointer = sp_globals.kern.pkorg; /* Point to start of pair kern data */
format = NEXT_BYTE(pointer); /* Read pair kerning format byte */
if (!(format & BIT0)) /* One-byte adjustment values? */
adj_base = NEXT_WORD(pointer); /* Read base adjustment */
origin = pointer; /* First byte of kerning pair data */
rec_size = format + 3; /* Compute kerning pair record size */
long_id = format & BIT1; /* Set flag for 2-byte char index */
n = no_pairs; /* Consider all kerning pairs */
base = 0; /* Set base at first kern pair record */
while (n != 0) /* While 1 or more kern pairs remain ... */
{
nn = n >> 1; /* Size of first partition */
i = base + nn; /* Index to record to be tested */
pointer = origin + (i * rec_size);
tmpufix16 = NEXT_CHNDX(pointer, long_id);
if (char_index1 < tmpufix16)
{
n = nn; /* Number remaining in first partition */
continue;
}
if (char_index1 > tmpufix16)
{
n -= nn + 1; /* Number remaining in second partition */
base = i + 1; /* Base index for second partition */
continue;
}
tmpufix16 = NEXT_CHNDX(pointer, long_id);
if (char_index2 < tmpufix16)
{
n = nn; /* Number remaining in first partition */
continue;
}
if (char_index2 > tmpufix16)
{
n -= nn + 1; /* Number remaining in second partition */
base = i + 1; /* Base index for second partition */
continue;
}
adj = (format & BIT0)?
(fix31)NEXT_WORD(pointer):
(fix31)(adj_base + (fix15)NEXT_BYTE(pointer));
adj = ((adj << 16) + (sp_globals.orus_per_em >> 1)) / sp_globals.orus_per_em; /* Convert units */
n = 0; /* No more to consider */
}
return adj; /* Return pair kerning adjustment */
}
#endif
#if INCL_METRICS
#ifdef old
FUNCTION boolean get_char_bbox(
GDECL
ufix16 char_index,
bbox_t *bbox)
{
/*
* returns true if character exists, false if it doesn't
* provides transformed character bounding box in 1/65536 pixels
* in the provided bbox_t structure. Bounding box may be
* conservative in the event that the transformation is not
* normal or the character is compound.
*/
ufix8 FONTFAR *pointer;
fix15 tmp;
point_t Pmin, Pmax;
#if REENTRANT_ALLOC
plaid_t plaid;
sp_globals.plaid = &plaid;
#endif
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return FALSE; /* Error return */
}
init_tcb(); /* Initialize transformation control block */
pointer = sp_get_char_org(char_index, TRUE); /* Point to start of character data */
if (pointer == NULL) /* Character data not available? */
{
report_error(12); /* Report character data not avail */
return FALSE; /* Error return */
}
pointer += 2; /* Skip over character id */
tmp = NEXT_WORD(pointer); /* Read set width */
tmp = NEXT_BYTE(pointer);
if (tmp & BIT1) /* Optional data in header? */
{
tmp = (ufix8)NEXT_BYTE(pointer); /* Read size of optional data */
pointer += tmp; /* Skip optional data */
}
pointer = plaid_tcb(pointer, tmp); /* Process plaid data */
pointer = read_bbox(pointer, &Pmin, &Pmax,(boolean)FALSE); /* Read bounding box */
bbox->xmin = (fix31)Pmin.x << sp_globals.poshift;
bbox->xmax = (fix31)Pmax.x << sp_globals.poshift;
bbox->ymin = (fix31)Pmin.y << sp_globals.poshift;
bbox->ymax = (fix31)Pmax.y << sp_globals.poshift;
return TRUE;
}
#else /* new code, 4/25/91 */
FUNCTION boolean get_char_bbox(
GDECL
ufix16 char_index,
bbox_t *bbox)
{
/*
* returns true if character exists, false if it doesn't
* provides transformed character bounding box in 1/65536 pixels
* in the provided bbox_t structure. Bounding box may be
* conservative in the event that the transformation is not
* normal or the character is compound.
*/
ufix8 FONTFAR *pointer;
fix15 tmp;
fix15 format;
ufix16 pix_adj;
point_t Pmin, Pmax;
#if REENTRANT_ALLOC
plaid_t plaid;
sp_globals.plaid = &plaid;
#endif
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return FALSE; /* Error return */
}
init_tcb(); /* Initialize transformation control block */
pointer = sp_get_char_org(char_index, TRUE); /* Point to start of character data */
if (pointer == NULL) /* Character data not available? */
{
report_error(12); /* Report character data not avail */
return FALSE; /* Error return */
}
pointer += 2; /* Skip over character id */
tmp = NEXT_WORD(pointer); /* Read set width */
format = NEXT_BYTE(pointer);
if (format & BIT1) /* Optional data in header? */
{
tmp = (ufix8)NEXT_BYTE(pointer); /* Read size of optional data */
pointer += tmp; /* Skip optional data */
}
if (format & BIT0)
{
pix_adj = sp_globals.onepix << 1; /* Allow 2 pixel expansion ... */
}
else
{
pix_adj = 0;
}
pointer = plaid_tcb(pointer, format); /* Process plaid data */
pointer = read_bbox(pointer, &Pmin, &Pmax,(boolean)FALSE); /* Read bounding box */
Pmin.x -= pix_adj; /* ... of components of ... */
Pmin.y -= pix_adj; /* ... compound ... */
Pmax.x += pix_adj; /* ... character ... */
Pmax.y += pix_adj; /* ... bounding box. */
bbox->xmin = (fix31)Pmin.x << sp_globals.poshift;
bbox->xmax = (fix31)Pmax.x << sp_globals.poshift;
bbox->ymin = (fix31)Pmin.y << sp_globals.poshift;
bbox->ymax = (fix31)Pmax.y << sp_globals.poshift;
return TRUE;
}
#endif /* new code */
#endif
#if INCL_ISW
FUNCTION boolean make_char_isw(
GDECL
ufix16 char_index,
ufix32 imported_setwidth)
{
fix15 xmin; /* Minimum X ORU value in font */
fix15 xmax; /* Maximum X ORU value in font */
fix15 ymin; /* Minimum Y ORU value in font */
fix15 ymax; /* Maximum Y ORU value in font */
ufix16 return_value;
sp_globals.import_setwidth_act = TRUE;
/* convert imported width to orus */
sp_globals.imported_width = (sp_globals.metric_resolution *
imported_setwidth) >> 16;
return_value = do_make_char(char_index);
if (sp_globals.isw_modified_constants)
{
/* reset fixed point constants */
xmin = read_word_u(sp_globals.font_org + FH_FXMIN);
ymin = read_word_u(sp_globals.font_org + FH_FYMIN);
ymax = read_word_u(sp_globals.font_org + FH_FYMAX);
sp_globals.constr.data_valid = FALSE;
xmax = read_word_u(sp_globals.font_org + FH_FXMAX);
if (!setup_consts(xmin,xmax,ymin,ymax))
{
report_error(3); /* Requested specs out of range */
return FALSE;
}
}
return (return_value);
}
FUNCTION boolean make_char(
GDECL
ufix16 char_index) /* Index to character in char directory */
{
sp_globals.import_setwidth_act = FALSE;
return (do_make_char(char_index));
}
FUNCTION static boolean do_make_char(GDECL ufix16 char_index)
#else
FUNCTION boolean make_char(GDECL ufix16 char_index)
#endif
/*
* Outputs specified character using the currently selected font and
* scaling and output specifications.
* Reports Error 10 and returns FALSE if no font specifications
* previously set.
* Reports Error 12 and returns FALSE if character data not available.
*/
{
ufix8 FONTFAR *pointer; /* Pointer to character data */
fix15 x_orus;
fix15 tmpfix15;
ufix8 format;
#if INCL_ISW
sp_globals.isw_modified_constants = FALSE;
#endif
#if REENTRANT_ALLOC
plaid_t plaid;
#if INCL_BLACK || INCL_SCREEN || INCL_2D
intercepts_t intercepts;
sp_globals.intercepts = &intercepts;
#endif
sp_globals.plaid = &plaid;
#endif
if (!sp_globals.specs_valid) /* Font specs not defined? */
{
report_error(10); /* Report font not specified */
return FALSE; /* Error return */
}
#if INCL_MULTIDEV
#if INCL_OUTLINE
if (sp_globals.output_mode == MODE_OUTLINE && !sp_globals.outline_device_set)
{
report_error(2);
return FALSE;
}
else
#endif
if (!sp_globals.bitmap_device_set)
{
report_error(2);
return FALSE;
}
#endif
init_tcb(); /* Initialize transformation control block */
pointer = sp_get_char_org(char_index, TRUE); /* Point to start of character data */
SHOW(pointer);
if (pointer == NULL) /* Character data not available? */
{
report_error(12); /* Report character data not avail */
return FALSE; /* Error return */
}
pointer += 2; /* Skip over character id */
x_orus = NEXT_WORD(pointer); /* Read set width */
#if INCL_SQUEEZING || INCL_ISW
sp_globals.setwidth_orus = x_orus;
#endif
#if INCL_ISW
if (sp_globals.import_setwidth_act)
x_orus = sp_globals.imported_width;
#endif
sp_globals.Psw.x = (fix15)((fix31)
(((fix31)x_orus * (sp_globals.specs.xxmult>>16) +
( ((fix31)x_orus * (sp_globals.specs.xxmult&0xffffL) )>>16)
) << sp_globals.pixshift) / sp_globals.metric_resolution);
sp_globals.Psw.y = (fix15)(
(fix31)(
((fix31)x_orus * (sp_globals.specs.yxmult>>16) +
( ((fix31)x_orus * (sp_globals.specs.yxmult&0xffffL) )>>16)
) << sp_globals.pixshift) / sp_globals.metric_resolution);
format = NEXT_BYTE(pointer);
if (format & BIT1) /* Optional data in header? */
{
tmpfix15 = (ufix8)NEXT_BYTE(pointer); /* Read size of optional data */
pointer += tmpfix15; /* Skip optional data */
}
if (format & BIT0)
{
return sp_make_comp_char(pointer); /* Output compound character */
}
else
{
return sp_make_simp_char(pointer, format); /* Output simple character */
}
}
FUNCTION static boolean sp_make_simp_char(
GDECL
ufix8 FONTFAR *pointer, /* Pointer to first byte of position argument */
ufix8 format) /* Character format byte */
/*
* Called by sp_make_char() to output a simple (non-compound) character.
* Returns TRUE on completion.
*/
{
point_t Pmin, Pmax; /* Transformed corners of bounding box */
#if INCL_SQUEEZING || INCL_ISW
ufix8 FONTFAR *save_pointer;
#endif
#if INCL_ISW
fix31 char_width;
fix31 isw_scale;
#endif
#if INCL_SQUEEZING
sp_globals.squeezing_compound = FALSE;
if ((sp_globals.pspecs->flags & SQUEEZE_LEFT) ||
(sp_globals.pspecs->flags & SQUEEZE_RIGHT) ||
(sp_globals.pspecs->flags & SQUEEZE_TOP) ||
(sp_globals.pspecs->flags & SQUEEZE_BOTTOM) )
{
/* get the bounding box data before processing the character */
save_pointer = pointer;
preview_bounding_box (pointer, format);
pointer = save_pointer;
}
#endif
#if (INCL_ISW)
if (sp_globals.import_setwidth_act)
{
save_pointer = pointer;
preview_bounding_box (pointer, format);
pointer = save_pointer;
/* make sure I'm not going to get fixed point overflow */
isw_scale = compute_isw_scale();
if (sp_globals.bbox_xmin_orus < 0)
char_width = SQUEEZE_MULT((sp_globals.bbox_xmax_orus - sp_globals.bbox_xmin_orus), isw_scale);
else
char_width = SQUEEZE_MULT(sp_globals.bbox_xmax_orus, isw_scale);
if (char_width >= sp_globals.isw_xmax)
if (!reset_xmax(char_width))
return FALSE;
}
#endif
pointer = plaid_tcb(pointer, format); /* Process plaid data */
pointer = read_bbox(pointer, &Pmin, &Pmax, FALSE); /* Read bounding box */
if (fn_begin_char(sp_globals.Psw, Pmin, Pmax)) /* Signal start of character output */
{
do
{
proc_outl_data(pointer); /* Process outline data */
}
while (!fn_end_char()); /* Repeat if not done */
}
return TRUE;
}
FUNCTION static boolean sp_make_comp_char(
GDECL
ufix8 FONTFAR *pointer) /* Pointer to first byte of position argument */
/*
* Called by sp_make_char() to output a compound character.
* Returns FALSE if data for any sub-character is not available.
* Returns TRUE if output completed with no error.
*/
{
point_t Pmin, Pmax; /* Transformed corners of bounding box */
point_t Pssw; /* Transformed escapement vector */
ufix8 FONTFAR *pointer_sav; /* Saved pointer to compound character data */
ufix8 FONTFAR *sub_pointer; /* Pointer to sub-character data */
ufix8 format; /* Format of DOCH instruction */
ufix16 sub_char_index; /* Index to sub-character in character directory */
fix15 x_posn; /* X position of sub-character (outline res units) */
fix15 y_posn; /* Y position of sub-character (outline res units) */
fix15 x_scale; /* X scale factor of sub-character (scale units) */
fix15 y_scale; /* Y scale factor of sub-character (scale units) */
fix15 tmpfix15; /* Temporary workspace */
fix15 x_orus; /* Set width in outline resolution units */
fix15 pix_adj; /* Pixel adjustment to compound char bounding box */
#if INCL_SQUEEZING
fix31 x_factor, x_offset, top_scale, bottom_scale;
boolean squeezed_x, squeezed_y;
#endif
#if INCL_SQUEEZING || INCL_ISW
fix15 x_offset_pix;
#endif
#if INCL_ISW
fix31 char_width;
fix31 isw_scale;
#endif
#if INCL_SQUEEZING
sp_globals.squeezing_compound = TRUE;
#endif
pointer = read_bbox(pointer, &Pmin, &Pmax, TRUE); /* Read bounding box data */
pix_adj = sp_globals.onepix << 1; /* Allow 2 pixel expansion ... */
Pmin.x -= pix_adj; /* ... of components of ... */
Pmin.y -= pix_adj; /* ... compound ... */
Pmax.x += pix_adj; /* ... character ... */
Pmax.y += pix_adj; /* ... bounding box. */
#if INCL_SQUEEZING
/* scale the bounding box if necessary before calling begin_char */
squeezed_x = calculate_x_scale(&x_factor, &x_offset, 0);
squeezed_y = calculate_y_scale(&top_scale, &bottom_scale,0,0);
if (squeezed_x)
{ /* scale the x coordinates of the bbox */
x_offset_pix = (fix15)(((x_offset >> 16) * sp_globals.tcb0.xppo)
>> sp_globals.mpshift);
if ((x_offset_pix >0) && (x_offset_pix < sp_globals.onepix))
x_offset_pix = sp_globals.onepix;
Pmin.x = SQUEEZE_MULT (x_factor, Pmin.x) + x_offset_pix - pix_adj;
Pmax.x = SQUEEZE_MULT (x_factor, Pmax.x) + x_offset_pix + pix_adj;
}
if (squeezed_y)
{ /* scale the y coordinates of the bbox */
if ((Pmin.y) < 0)
Pmin.y = SQUEEZE_MULT (bottom_scale, Pmin.y) - pix_adj;
else
Pmin.y = SQUEEZE_MULT (top_scale, Pmin.y) - pix_adj;
if ((Pmax.y) < 0)
Pmax.y = SQUEEZE_MULT (bottom_scale, Pmax.y) + pix_adj;
else
Pmax.y = SQUEEZE_MULT (top_scale, Pmax.y) + pix_adj;
}
#endif
#if (INCL_ISW)
if (sp_globals.import_setwidth_act)
{
/* make sure I'm not going to get fixed point overflow */
isw_scale = ((fix31)sp_globals.imported_width << 16)/
(fix31)sp_globals.setwidth_orus;
char_width = SQUEEZE_MULT((sp_globals.bbox_xmax_orus -
sp_globals.bbox_xmin_orus),
isw_scale);
if (char_width >= sp_globals.isw_xmax)
if (!reset_xmax(char_width))
return FALSE;
}
#endif
if (fn_begin_char(sp_globals.Psw, Pmin, Pmax)) /* Signal start of character data */
{
pointer_sav = pointer;
do
{
pointer = pointer_sav; /* Point to next DOCH or END instruction */
while ((format = NEXT_BYTE(pointer))) /* DOCH instruction? */
{
init_tcb(); /* Initialize transformation control block */
x_posn = sp_get_posn_arg(&pointer, format);
y_posn = sp_get_posn_arg(&pointer, (ufix8)(format >> 2));
x_scale = sp_get_scale_arg(&pointer, (ufix8)(format & BIT4));
y_scale = sp_get_scale_arg(&pointer, (ufix8)(format & BIT5));
scale_tcb(&sp_globals.tcb, x_posn, y_posn, x_scale, y_scale); /* Scale for sub-char */
sub_char_index = (format & BIT6)? /* Read sub-char index */
0xffff & NEXT_WORD(pointer):
0xffff & NEXT_BYTE(pointer);
sub_pointer = sp_get_char_org(sub_char_index, FALSE); /* Point to start of sub-char */
if (sub_pointer == NULL) /* Character data not available? */
{
return FALSE; /* Abort character output */
}
sub_pointer += 2; /* Skip over character id */
x_orus = NEXT_WORD(sub_pointer); /* Read set_width of sub-character */
Pssw.x = (fix15)(
(fix31)(
((fix31)x_orus * (sp_globals.specs.xxmult>>16) +
( ((fix31)x_orus * (sp_globals.specs.xxmult&0xffffL) )>>16)
) << sp_globals.pixshift) / sp_globals.metric_resolution);
Pssw.y = (fix15)(
(fix31)(
((fix31)x_orus * (sp_globals.specs.yxmult>>16) +
( ((fix31)x_orus * (sp_globals.specs.yxmult&0xffffL) )>>16)
) << sp_globals.pixshift) / sp_globals.metric_resolution);
format = NEXT_BYTE(sub_pointer); /* Read sub-character format */
if (format & BIT1) /* Optional data in header? */
{
tmpfix15 = (ufix8)NEXT_BYTE(sub_pointer); /* Read size of optional data */
sub_pointer += tmpfix15; /* Skip optional data */
}
sub_pointer = plaid_tcb(sub_pointer, format); /* Process sub-character plaid data */
sub_pointer = read_bbox(sub_pointer, &Pmin, &Pmax, FALSE); /* Read bounding box */
fn_begin_sub_char(Pssw, Pmin, Pmax); /* Signal start of sub-character data */
proc_outl_data(sub_pointer); /* Process sub-character data */
fn_end_sub_char(); /* Signal end of sub-character data */
}
}
while (!fn_end_char()); /* Signal end of character; repeat if required */
}
return TRUE;
}
#if INCL_LCD /* Dynamic load character data supported? */
FUNCTION static ufix8 FONTFAR *sp_get_char_org(
GDECL
ufix16 char_index, /* Index of character to be accessed */
boolean top_level) /* Not a compound character element */
/*
* Called by sp_get_char_id(), sp_get_char_width(), sp_make_char() and
* sp_make_comp_char() to get a pointer to the start of the character data
* for the specified character index.
* Version for configuration supporting dynamic character data loading.
* Calls load_char_data() to load character data if not already loaded
* as part of the original font buffer.
* Returns NULL if character data not available
*/
{
buff_t *pchar_data; /* Buffer descriptor requested */
ufix8 FONTFAR *pointer; /* Pointer into character directory */
ufix8 format; /* Character directory format byte */
fix31 char_offset; /* Offset of char data from start of font file */
fix31 next_char_offset; /* Offset of char data from start of font file */
fix15 no_bytes; /* Number of bytes required for char data */
if (top_level) /* Not element of compound char? */
{
if (char_index < sp_globals.first_char_idx) /* Before start of character set? */
return NULL;
char_index -= sp_globals.first_char_idx;
if (char_index >= sp_globals.no_chars_avail) /* Beyond end of character set? */
return NULL;
sp_globals.cb_offset = 0; /* Reset char buffer offset */
}
pointer = sp_globals.pchar_dir;
format = NEXT_BYTE(pointer); /* Read character directory format byte */
pointer += char_index << 1; /* Point to indexed character entry */
if (format) /* 3-byte entries in char directory? */
{
pointer += char_index; /* Adjust for 3-byte entries */
char_offset = read_long(pointer); /* Read file offset to char data */
next_char_offset = read_long(pointer + 3); /* Read offset to next char */
}
else
{
char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read file offset to char data */
next_char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read offset to next char */
}
no_bytes = next_char_offset - char_offset;
if (no_bytes == 0) /* Character not in directory? */
return NULL;
if (next_char_offset <= sp_globals.font_buff_size)/* Character data already in font buffer? */
return sp_globals.pfont->org + char_offset; /* Return pointer into font buffer */
pchar_data = load_char_data(char_offset, no_bytes, sp_globals.cb_offset); /* Request char data load */
if (pchar_data->no_bytes < no_bytes) /* Correct number of bytes loaded? */
return NULL;
if (top_level) /* Not element of compound char? */
{
sp_globals.cb_offset = no_bytes;
}
return pchar_data->org; /* Return pointer into character data buffer */
}
#endif
#if INCL_LCD
#else /* Dynamic load character data not supported? */
FUNCTION static ufix8 FONTFAR *sp_get_char_org(
GDECL
ufix16 char_index, /* Index of character to be accessed */
boolean top_level) /* Not a compound character element */
/*
* Called by sp_get_char_id(), sp_get_char_width(), sp_make_char() and
* sp_make_comp_char() to get a pointer to the start of the character data
* for the specified character index.
* Version for configuration not supporting dynamic character data loading.
* Returns NULL if character data not available
*/
{
ufix8 FONTFAR *pointer; /* Pointer into character directory */
ufix8 format; /* Character directory format byte */
fix31 char_offset; /* Offset of char data from start of font file */
fix31 next_char_offset; /* Offset of char data from start of font file */
fix15 no_bytes; /* Number of bytes required for char data */
if (top_level) /* Not element of compound char? */
{
if (char_index < sp_globals.first_char_idx) /* Before start of character set? */
return NULL;
char_index -= sp_globals.first_char_idx;
if (char_index >= sp_globals.no_chars_avail) /* Beyond end of character set? */
return NULL;
}
pointer = sp_globals.pchar_dir;
format = NEXT_BYTE(pointer); /* Read character directory format byte */
pointer += char_index << 1; /* Point to indexed character entry */
if (format) /* 3-byte entries in char directory? */
{
pointer += char_index; /* Adjust for 3-byte entries */
char_offset = read_long(pointer); /* Read file offset to char data */
next_char_offset = read_long(pointer + 3); /* Read offset to next char */
}
else
{
char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read file offset to char data */
next_char_offset = (fix31)(0xffff & NEXT_WORD(pointer)); /* Read offset to next char */
}
no_bytes = next_char_offset - char_offset;
if (no_bytes == 0) /* Character not in directory? */
return NULL;
return sp_globals.pfont->org + char_offset; /* Return pointer into font buffer */
}
#endif
FUNCTION static fix15 sp_get_posn_arg(
GDECL
ufix8 FONTFAR * STACKFAR *ppointer, /* Pointer to first byte of position argument */
ufix8 format) /* Format of DOCH arguments */
/*
* Called by sp_make_comp_char() to read a position argument from the
* specified point in the font/char buffer.
* Updates pointer to byte following position argument.
* Returns value of position argument in outline resolution units
*/
{
switch (format & 0x03)
{
case 1:
return NEXT_WORD(*ppointer);
case 2:
return (fix15)((fix7)NEXT_BYTE(*ppointer));
default:
return (fix15)0;
}
}
FUNCTION static fix15 sp_get_scale_arg(
GDECL
ufix8 FONTFAR *STACKFAR *ppointer, /* Pointer to first byte of position argument */
ufix8 format) /* Format of DOCH arguments */
/*
* Called by sp_make_comp_char() to read a scale argument from the
* specified point in the font/char buffer.
* Updates pointer to byte following scale argument.
* Returns value of scale argument in scale units (normally 1/4096)
*/
{
if (format)
return NEXT_WORD(*ppointer);
else
return (fix15)ONE_SCALE;
}
#if INCL_ISW || INCL_SQUEEZING
FUNCTION static void preview_bounding_box(
GDECL
ufix8 FONTFAR *pointer, /* Pointer to first byte of position argument */
ufix8 format) /* Character format byte */
{
point_t Pmin, Pmax; /* Transformed corners of bounding box */
sp_globals.no_X_orus = (format & BIT2)?
(fix15)NEXT_BYTE(pointer):
0;
sp_globals.no_Y_orus = (format & BIT3)?
(fix15)NEXT_BYTE(pointer):
0;
pointer = read_oru_table(pointer);
/* Skip over control zone table */
pointer = skip_control_zone(pointer,format);
/* Skip over interpolation table */
pointer = skip_interpolation_table(pointer,format);
/* get_args has a pathological need for this value to be set */
sp_globals.Y_edge_org = sp_globals.no_X_orus;
pointer = read_bbox(pointer, &Pmin, &Pmax, TRUE); /* Read bounding bo
x */
}
#endif
#if INCL_ISW
FUNCTION static boolean reset_xmax(
GDECL
fix31 xmax)
{
fix15 xmin; /* Minimum X ORU value in font */
fix15 ymin; /* Minimum Y ORU value in font */
fix15 ymax; /* Maximum Y ORU value in font */
sp_globals.isw_modified_constants = TRUE;
xmin = read_word_u(sp_globals.font_org + FH_FXMIN);
ymin = read_word_u(sp_globals.font_org + FH_FYMIN);
ymax = read_word_u(sp_globals.font_org + FH_FYMAX);
if (!setup_consts(xmin,xmax,ymin,ymax))
{
report_error(3); /* Requested specs out of range */
return FALSE;
}
sp_globals.constr.data_valid = FALSE;
/* recompute setwidth */
sp_globals.Psw.x = (fix15)((fix31)(
((fix31)sp_globals.imported_width * (sp_globals.specs.xxmult>>16) +
( ((fix31)sp_globals.imported_width *
(sp_globals.specs.xxmult&0xffffL) )>>16)
) << sp_globals.pixshift) / sp_globals.metric_resolution);
sp_globals.Psw.y = (fix15)(
(fix31)(
((fix31)sp_globals.imported_width * (sp_globals.specs.yxmult>>16) +
( ((fix31)sp_globals.imported_width * (sp_globals.specs.yxmult&0xffffL) )>>16)
) << sp_globals.pixshift) / sp_globals.metric_resolution);
return TRUE;
}
#endif
|
// ToHistoryService_RemoveTask_Args converts thrift HistoryService_RemoveTask_Args type to internal
func ToHistoryService_RemoveTask_Args(t *history.HistoryService_RemoveTask_Args) *types.HistoryService_RemoveTask_Args {
if t == nil {
return nil
}
return &types.HistoryService_RemoveTask_Args{
Request: ToRemoveTaskRequest(t.Request),
}
} |
def serialize(self, items, default_flow_style=False):
yaml = self._load_yaml()
items = dict(items)
return yaml.dump(items, default_flow_style=default_flow_style) |
The Interplay between Quality Movement, Reputation and Funding on Private Students' Choice of Universities in Uganda The current study purpose to analyse the influence of the quality movement on private students choice of universities in Uganda. First, the paper points out the fact that there is a quality movement in Ugandas higher education sub-sector. Second, it was found that quality movement have a significant relationship with the reputation of a university . Third, there was a significant relationship between reputation and funding . Fourth, there was a significant relationship between funding and choice . Fifth, there was a significant relationship between quality and choice of a university by private students . It was concluded that quality influenced students choices of universities in Uganda. |
Pediatric tracheostomy and associated complications A retrospective analysis of 123 pediatric tracheostomies reveals an overall complication rate of 33%. Immediate complications were present in 12% or 15 patients. The most frequent immediate complications were pneumomediastinum and pneumothorax. Delayed complications occurred in 24% or 30 patients. The most frequent delayed complications were subglottic stenosis, fused vocal cords, and tracheal granuloma. Four patients died because of tracheostomyrelated complications. Age, underlying disease, and prior endotracheal intubation had a high degree of correlation with complications. The use of a mechanical respirator following tracheostomy did not appear to be significantly related to complications. Fifty percent of the delayed complications in this series were regarded as being unrelated to the tracheostomy or the trachesotomy tube itself. |
The city announced that it will hold a vigil for those who were affected by the Friday morning shooting at Noblesville West Middle School.
Noblesville will hold a prayer vigil at 7 p.m. Saturday at Federal Hill Commons.
The city announced the vigil on Facebook and invited the community to "join hands and gather" to support those who have been affected by the shooting at Noblesville West Middle School. The commons are at 175 Logan St. near the Downtown Courthouse Square.
Gov. Eric Holcomb, Sen. Todd Young, Sen. Joe Donnelly and Congresswoman Susan Brooks are expected at the gathering.
On Friday morning, police said a male suspect fired gunshots in a seventh-grade science classroom, injuring a teacher and female student.
Jason Seaman, the 29-year-old teacher, was parents and students said was shot and had surgery at IU Health Methodist Hospital. The 13-year-old female student was identified in a statement by her family as Ella Whistler. They said she was in critical but stable condition late Friday night.
The announcement from the city of Noblesville came as support poured into the community.
President Donald Trump tweeted praise for Seaman, who parents and students said stopped the shooter. Closer to home, groups around Central Indiana boosted the community through prayer, reflection and a rally.
Here are more scenes of support from Saturday.
A group of 28 students from at least five different schools stood on the steps of the Indiana Statehouse on Saturday, chanting “Never again” and holding signs.
Brought together by the student group "We Live," they were there to ask for changes in gun laws, like expanding background checks and banning bump stocks and assault weapons. But they were also there to pray for the victims of Friday’s shooting at Noblesville West Middle School, Seaman and Ella.
Noblesville High School freshman Holly Golightly talked about trying to call her little sister and cousin, who were both in the school, after hearing there was a shooting. Then, about hiding in a barricaded classroom while the high school was locked down.
“It’s not OK,” she repeated to the crowd.
Before law enforcement started down the IPL 500 Festival Parade route, organizers asked for a moment of silence to honor the victims of the shooting.
Between 75 and 100 people gathered at a town church in Fishers for a prayer service Saturday morning.
Pastor Dave Sumrall and others prayed over the congregation, most of whom had their arms raised in the air as they sought healing for those involved in the shooting and wisdom for the future.
"The Bible promises that in tragedy and difficult situations, that God would intervene in such a way that would turn what the devil meant for an absolute tragedy (into) the good, to bring about some resolution," Sumrall said. |
/**
* Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.com)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.com/LICENSE.txt
*
*
* \file TriangularSolve.h
*
* Created on 2011-05-06 by <NAME>
*/
#ifndef TRIANGULARSOLVE_H_
#define TRIANGULARSOLVE_H_
#include "../Dense/Matrix.h"
namespace MathLib {
/**
* solves the \f$n \times n\f$ triangular linear system \f$L \cdot y = b\f$,
* assumes \f$L_{ii} = 1.0\f$, \f$i=1,...,n\f$, \f$b\f$ is destroyed
* @param L the lower triangular matrix
* @param b at beginning the right hand side vector, at the end the solution vector
*/
void forwardSolve (const Matrix <double> &L, double* b);
/**
* solves the \f$n \times n\f$ triangular linear system \f$U \cdot x=y\f$,
* \f$U\f$, where \f$U\f$ is a upper triangular matrix.
* @param U upper triangular matrix
* @param y at beginning the right hand side, at the end the solution
*/
void backwardSolve (const Matrix <double> &U, double* y);
// backwardSolve mat * x = y, mat ... upper triangular matrix
/**
* backward solve the system of linear equations \f$ U \cdot x = y\f$,
* where \f$U\f$ is a upper triangular matrix
* @param mat the upper triangular matrix
* @param x the solution of the system of linear equations
* @param b the right hand side
*/
void backwardSolve ( Matrix<double> const& mat, double* x, double* b);
} // end namespace MathLib
#endif /* TRIANGULARSOLVE_H_ */
|
ON FEEDBACK CONTROL OF NONLINEAR MECHANICAL SYSTEMS SUBJECT TO HOLONOMIC/NONHOLONOMIC CONSTRAINTS PRABHAKAR R. PAGILLA AND MASAYOSHI TOMIZUKA DEPARTMENT OF MECHANICAL ENGINEERING We consider the problem of feedback control of constrained nonlinear mechanical systems. The system is assumed to be acted on by both holonomic and nonholonomic constraints. Systems of this nature appear in various applications and in particular robotic systems where rolling motion is involved. A systematic procedure for reducing the dimension of the con guaration space in the presence of the constraints is derived. A compact dynamic model is obtained for control purposes. The dynamic model is used to design an adaptive controller for tracking the desired trajectories of the system in the presence of uncertainties in the model. A mobile robot is used to illustrate the theory developed and simulation results are presented for this example. |
<filename>rfiddemo/src/main/java/com/nordicid/rfiddemo/SettingsAppHidTab.java
package com.nordicid.rfiddemo;
import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.text.Editable;
import android.text.InputFilter;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.nordicid.apptemplate.AppTemplate;
import com.nordicid.nuraccessory.NurAccessoryConfig;
import com.nordicid.nuraccessory.NurAccessoryExtension;
import com.nordicid.nuraccessory.NurAccessoryVersionInfo;
import com.nordicid.nurapi.ACC_WIRELESS_CHARGE_STATUS;
import com.nordicid.nurapi.AccConfig;
import com.nordicid.nurapi.AccVersionInfo;
import com.nordicid.nurapi.AccessoryExtension;
import com.nordicid.nurapi.NurApi;
import com.nordicid.nurapi.NurApiAutoConnectTransport;
import com.nordicid.nurapi.NurApiBLEAutoConnect;
import com.nordicid.nurapi.NurApiListener;
import com.nordicid.nurapi.NurEventAutotune;
import com.nordicid.nurapi.NurEventClientInfo;
import com.nordicid.nurapi.NurEventDeviceInfo;
import com.nordicid.nurapi.NurEventEpcEnum;
import com.nordicid.nurapi.NurEventFrequencyHop;
import com.nordicid.nurapi.NurEventIOChange;
import com.nordicid.nurapi.NurEventInventory;
import com.nordicid.nurapi.NurEventNxpAlarm;
import com.nordicid.nurapi.NurEventProgrammingProgress;
import com.nordicid.nurapi.NurEventTagTrackingChange;
import com.nordicid.nurapi.NurEventTagTrackingData;
import com.nordicid.nurapi.NurEventTraceTag;
import com.nordicid.nurapi.NurEventTriggeredRead;
import com.nordicid.nurapi.NurSmartPairSupport;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.reflect.Method;
import java.util.Set;
public class SettingsAppHidTab extends Fragment {
SettingsAppTabbed mOwner;
final private String TAG = "HIDTAB";
NurApi mApi;
AccessoryExtension mExt;
BluetoothDevice device=null;
boolean mHasWirelessCharging = false;
boolean mBondFound = false;
CheckBox mHidBarcodeCheckBox;
CheckBox mHidRFIDCheckBox;
CheckBox mWirelessChargingCheckBox;
CheckBox mAllowPairingCheckBox;
LinearLayout mSpLayout;
CheckBox mSpShowUiCheckBox;
CheckBox mSpAutodisconExa51CheckBox;
CheckBox mSpSensitivityCheckBox;
TextView mWirelessChargingLabel;
Button mButtonSetPasskey;
Button mButtonBond;
Button mButtonRebootDevice;
private NurApiListener mThisClassListener = null;
public NurApiListener getNurApiListener()
{
return mThisClassListener;
}
public SettingsAppHidTab() {
mOwner = SettingsAppTabbed.getInstance();
mApi = mOwner.getNurApi();
mExt = AppTemplate.getAppTemplate().getAccessoryApi();
mThisClassListener = new NurApiListener() {
@Override
public void connectedEvent() {
if (isAdded()) {
enableItems(true);
readCurrentSetup();
}
}
@Override
public void disconnectedEvent() {
if (isAdded()) {
enableItems(false);
}
}
@Override public void logEvent(int level, String txt) {}
@Override public void bootEvent(String event) {}
@Override public void inventoryStreamEvent(NurEventInventory event) { }
@Override public void IOChangeEvent(NurEventIOChange event) {}
@Override public void traceTagEvent(NurEventTraceTag event) { }
@Override public void triggeredReadEvent(NurEventTriggeredRead event) {}
@Override public void frequencyHopEvent(NurEventFrequencyHop event) {}
@Override public void debugMessageEvent(String event) {}
@Override public void inventoryExtendedStreamEvent(NurEventInventory event) { }
@Override public void programmingProgressEvent(NurEventProgrammingProgress event) {}
@Override public void deviceSearchEvent(NurEventDeviceInfo event) {}
@Override public void clientConnectedEvent(NurEventClientInfo event) {}
@Override public void clientDisconnectedEvent(NurEventClientInfo event) {}
@Override public void nxpEasAlarmEvent(NurEventNxpAlarm event) {}
@Override public void epcEnumEvent(NurEventEpcEnum event) {}
@Override public void autotuneEvent(NurEventAutotune event) {}
@Override
public void tagTrackingScanEvent(NurEventTagTrackingData event) {
// TODO Auto-generated method stub
}
@Override
public void tagTrackingChangeEvent(NurEventTagTrackingChange event) {
// TODO Auto-generated method stub
}
};
}
public void onVisibility(boolean val)
{
if (val)
{
if (isAdded()) {
enableItems(mApi.isConnected());
if (mApi.isConnected()) {
readCurrentSetup();
}
}
}
}
void passkeyInput()
{
final AlertDialog regAlertDlg;
try {
if (mExt.getConfig().isDeviceEXA21() == false) {
Toast.makeText(getContext(), "Sorry, for EXA21 only", Toast.LENGTH_LONG).show();
return;
}
}catch (Exception e) {
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_LONG).show();
return;
}
final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle("EXA21 6-digit passkey");
final EditText input = new EditText(getContext());
input.setInputType(InputType.TYPE_CLASS_NUMBER); // | InputType.TYPE_NUMBER_VARIATION_PASSWORD);
int maxLength = 6;
input.setFilters(new InputFilter[] {new InputFilter.LengthFilter(maxLength)});
try {
input.setText(mExt.getBLEPasskey());
}catch (Exception e) {}
builder.setView(input);
builder.setPositiveButton("SET", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
mExt.setBLEPasskey(input.getText().toString());
String txt = mExt.getBLEPasskey();
Toast.makeText(getContext(), "Passkey=" + txt, Toast.LENGTH_LONG).show();
}
catch (Exception e) {
Toast.makeText(getContext(), e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
regAlertDlg = builder.create();
regAlertDlg.show();
input.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
if(s.length() == 6) {
regAlertDlg.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
}
else regAlertDlg.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
}
@Override
public void afterTextChanged(Editable s) {
}
});
}
void iterateBluetoothDevices() {
mBondFound=false;
try {
BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
NurApiAutoConnectTransport mTr = Main.getInstance().getAutoConnectTransport();
if (btAdapter != null) {
device = btAdapter.getRemoteDevice(mTr.getAddress());
Set<BluetoothDevice> pairedDevices = btAdapter.getBondedDevices();
Log.i(TAG, String.format("found %d bluetooth devices", (pairedDevices != null) ? pairedDevices.size() : 0));
if (pairedDevices.size() > 0) {
for (BluetoothDevice d : pairedDevices) {
if (mTr.getAddress().equals(d.getAddress())) {
//Bonded device found
mBondFound = true;
String btID = String.format("bluetooth device [%s] type: %s BondState=%d Addr=%s thisAddr=%s", d.getName(), d.getType(), d.getBondState(), d.getAddress(), mTr.getAddress());
Log.i(TAG, btID);
btID = String.format("bluetoothDevice [%s]", device.getAddress());
Log.i(TAG, btID);
break;
}
//Toast.makeText(this, btID, Toast.LENGTH_SHORT).show();
}
}
}
}catch (Exception ex) {
Log.e(TAG, ex.getMessage());
}
}
private void pairDevice(BluetoothDevice device) {
try {
Log.i(TAG, "Pairing...");
//waitingForBonding = true;
Method m = device.getClass().getMethod("createBond", (Class[]) null);
m.invoke(device, (Object[]) null);
Log.i(TAG, "Pairing done.");
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
private void unpairDevice(BluetoothDevice device) {
try {
Method m = device.getClass().getMethod("removeBond", (Class[]) null);
m.invoke(device, (Object[]) null);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
}
private void enableItems(boolean v) {
mHidBarcodeCheckBox.setEnabled(v);
mHidRFIDCheckBox.setEnabled(v);
mButtonSetPasskey.setEnabled(v);
mButtonBond.setEnabled(v);
mButtonRebootDevice.setEnabled(v);
mWirelessChargingCheckBox.setEnabled(v);
mAllowPairingCheckBox.setEnabled(v);
}
private String removeSpecificChars(String originalstring, String removecharacterstring)
{
char[] orgchararray=originalstring.toCharArray();
char[] removechararray=removecharacterstring.toCharArray();
int start,end=0;
//tempBoolean automatically initialized to false ,size 128 assumes ASCII
boolean[] tempBoolean = new boolean[128];
//Set flags for the character to be removed
for(start=0;start < removechararray.length;++start)
{
tempBoolean[removechararray[start]]=true;
}
//loop through all characters ,copying only if they are flagged to false
for(start=0;start < orgchararray.length;++start)
{
if(!tempBoolean[orgchararray[start]])
{
orgchararray[end++]=orgchararray[start];
}
}
return new String(orgchararray,0,end);
}
private void enableListeners(boolean enable)
{
if (enable) {
mHidBarcodeCheckBox.setOnCheckedChangeListener(mOnCheckedChangeListener);
mHidRFIDCheckBox.setOnCheckedChangeListener(mOnCheckedChangeListener);
mWirelessChargingCheckBox.setOnCheckedChangeListener(mWirelessChargingChangeListener);
mAllowPairingCheckBox.setOnCheckedChangeListener(mAllowPairingChangeListener);
mSpShowUiCheckBox.setOnCheckedChangeListener(mSpShowUiChangeListener);
mSpAutodisconExa51CheckBox.setOnCheckedChangeListener(mSpAutodisconExa51ChangeListener);
mSpSensitivityCheckBox.setOnCheckedChangeListener(mSpSensitivityChangeListener);
} else {
mHidBarcodeCheckBox.setOnCheckedChangeListener(null);
mHidRFIDCheckBox.setOnCheckedChangeListener(null);
mWirelessChargingCheckBox.setOnCheckedChangeListener(null);
mAllowPairingCheckBox.setOnCheckedChangeListener(null);
mSpShowUiCheckBox.setOnCheckedChangeListener(null);
mSpAutodisconExa51CheckBox.setOnCheckedChangeListener(null);
mSpSensitivityCheckBox.setOnCheckedChangeListener(null);
}
}
private void readCurrentSetup() {
enableListeners(false);
if (mApi.isConnected() && AppTemplate.getAppTemplate().getAccessorySupported())
{
AccConfig cfg;
try {
enableItems(true);
cfg = mExt.getConfig();
AccVersionInfo info = mExt.getFwVersion();
String appver = removeSpecificChars(info.getApplicationVersion(), ".");
int ver = Integer.parseInt(appver);
if (ver >= 221) {
mAllowPairingCheckBox.setEnabled(true);
} else {
mAllowPairingCheckBox.setEnabled(false);
}
// Disable HID from devices w/ integrated reader module
String addr = Main.getInstance().getNurAutoConnect().getAddress();
if (addr != null && addr.equals("integrated_reader")) {
mHidBarcodeCheckBox.setEnabled(false);
mHidRFIDCheckBox.setEnabled(false);
mButtonSetPasskey.setEnabled(false);
mButtonBond.setEnabled(false);
mAllowPairingCheckBox.setEnabled(false);
}
if(cfg.isDeviceEXA51()) {
mSpAutodisconExa51CheckBox.setEnabled(true);
}
else mSpAutodisconExa51CheckBox.setEnabled(false);
if(cfg.hasImagerScanner() && cfg.getAllowPairingState())
mHidBarcodeCheckBox.setChecked(cfg.getHidBarCode());
else mHidBarcodeCheckBox.setEnabled(false);
mHidRFIDCheckBox.setChecked(cfg.getHidRFID());
if(cfg.isDeviceEXA21())
mHidRFIDCheckBox.setEnabled(true); //USB is possible even if not BLE paired
if(cfg.getAllowPairingState())
{
if(cfg.isDeviceEXA21()) {
mButtonSetPasskey.setEnabled(true);
}
else
mButtonSetPasskey.setEnabled(false);
mButtonBond.setEnabled(true);
if(mBondFound){
mButtonBond.setText("Unpair");
mAllowPairingCheckBox.setEnabled(false);
}
else {
mButtonBond.setText("Pair");
mAllowPairingCheckBox.setEnabled(true);
}
}
else {
mButtonSetPasskey.setEnabled(false);
mButtonBond.setEnabled(false);
mBondFound=false;
}
mWirelessChargingCheckBox.setEnabled(cfg.hasWirelessCharging());
mAllowPairingCheckBox.setChecked(cfg.getAllowPairingState());
}
catch (Exception e) {
e.printStackTrace();
enableItems(false);
}
} else {
enableItems(false);
}
// Setup smart pair settings
SharedPreferences pref = Main.getApplicationPrefences();
mSpShowUiCheckBox.setChecked(pref.getBoolean("SmartPairShowUi", true));
try {
JSONObject settings = new JSONObject(pref.getString("SmartPairSettings", "{}"));
try {
// JSON: {"AutoDisconnectMap":{"EXA51":<true|false>}}
mSpAutodisconExa51CheckBox.setChecked(settings.getJSONObject("AutoDisconnectMap").getBoolean("EXA51"));
} catch (Exception ex) { }
try {
// JSON: {"ConnThresholdAdjust":<0|-10>}
mSpSensitivityCheckBox.setChecked(settings.getInt("ConnThresholdAdjust") == 0 ? false : true);
} catch (Exception ex) { }
} catch (JSONException e) {
e.printStackTrace();
}
// Enable listeners
mHidBarcodeCheckBox.post(new Runnable() {
@Override
public void run() {
enableListeners(true);
}
});
}
void setNewHidConfig()
{
try {
AccConfig cfg = mExt.getConfig();
cfg.setHidBarcode(mHidBarcodeCheckBox.isChecked());
cfg.setHidRFID(mHidRFIDCheckBox.isChecked());
//if(mHidRFIDCheckBox.isChecked()) {
mButtonRebootDevice.setVisibility(View.VISIBLE); //Allow user
//cfg.setAllowPairingState(true);
//mAllowPairingCheckBox.setChecked(true);
//}
mExt.setConfig(cfg);
readCurrentSetup();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(AppTemplate.getAppTemplate(),"Operation failed", Toast.LENGTH_SHORT).show();
}
}
void setNewAllowPairingConfig()
{
try {
AccConfig cfg = mExt.getConfig();
cfg.setAllowPairingState(mAllowPairingCheckBox.isChecked());
mExt.setConfig(cfg);
readCurrentSetup();
/*
if(cfg.isDeviceEXA21())
mButtonSetPasskey.setEnabled(cfg.getAllowPairingState());
else mButtonSetPasskey.setEnabled(false);
*/
//Toast.makeText(getContext(), "Rebooting device required!", Toast.LENGTH_LONG).show();
if(cfg.getAllowPairingState()==false && mBondFound) {
//device paired and now user want to disable pairing.
//Unpair and give reset
mExt.clearPairingData();
unpairDevice(device);
Toast.makeText(AppTemplate.getAppTemplate(),"Unpairing and rebooting device..", Toast.LENGTH_SHORT).show();
mBondFound=false;
}
else {
Toast.makeText(AppTemplate.getAppTemplate(), "Rebooting device..", Toast.LENGTH_SHORT).show();
}
mExt.restartBLEModule();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(AppTemplate.getAppTemplate(),"Operation failed", Toast.LENGTH_SHORT).show();
}
}
void storeSmartPairSettings()
{
SharedPreferences.Editor editor = Main.getApplicationPrefences().edit();
String settingsStr = NurSmartPairSupport.getSettingsString();
editor.putString("SmartPairSettings", settingsStr);
editor.apply();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.tab_settings_hid, container, false);
}
OnCheckedChangeListener mOnCheckedChangeListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
setNewHidConfig();
}
};
OnCheckedChangeListener mAllowPairingChangeListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
setNewAllowPairingConfig();
}
};
OnCheckedChangeListener mWirelessChargingChangeListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
try {
String msg;
ACC_WIRELESS_CHARGE_STATUS result = mExt.setWirelessCharge(mWirelessChargingCheckBox.isChecked());
Log.d("SetWirelessCharging","result " + result);
switch (result)
{
case Fail:
case Refused:
msg = "Failed to set wireless charging value";
break;
case NotSupported:
msg = "Wireless Charging not supported";
break;
default:
msg = "Wireless charging turned " + ((result == ACC_WIRELESS_CHARGE_STATUS.On) ? "On" : "Off");
break;
}
mWirelessChargingCheckBox.setOnCheckedChangeListener(null);
if(mExt.getWirelessChargeStatus() == ACC_WIRELESS_CHARGE_STATUS.On)
mWirelessChargingCheckBox.setChecked(true);
else mWirelessChargingCheckBox.setChecked(false);
Toast.makeText(AppTemplate.getAppTemplate(),msg, Toast.LENGTH_SHORT).show();
}
catch (Exception e)
{
e.printStackTrace();
Toast.makeText(AppTemplate.getAppTemplate(),"Operation failed", Toast.LENGTH_SHORT).show();
}
mWirelessChargingCheckBox.setOnCheckedChangeListener(mWirelessChargingChangeListener);
}
};
OnCheckedChangeListener mSpShowUiChangeListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
SharedPreferences.Editor editor = Main.getApplicationPrefences().edit();
editor.putBoolean("SmartPairShowUi", isChecked);
editor.apply();
}
};
OnCheckedChangeListener mSpAutodisconExa51ChangeListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
try {
// JSON: {"AutoDisconnectMap":{"EXA51":<true|false>}}
JSONObject setting = new JSONObject().put("AutoDisconnectMap", new JSONObject().put("EXA51", isChecked));
NurSmartPairSupport.setSettings(setting);
storeSmartPairSettings();
} catch (Exception e)
{
e.printStackTrace();
}
}
};
OnCheckedChangeListener mSpSensitivityChangeListener = new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
try {
// JSON: {"ConnThresholdAdjust":<rssiAdjust>}
int rssiAdjust = isChecked ? -10 : 0;
JSONObject setting = new JSONObject().put("ConnThresholdAdjust", rssiAdjust);
NurSmartPairSupport.setSettings(setting);
storeSmartPairSettings();
} catch (Exception e)
{
e.printStackTrace();
}
}
};
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mHidBarcodeCheckBox = (CheckBox)view.findViewById(R.id.hid_barcode_checkbox);
mHidRFIDCheckBox = (CheckBox)view.findViewById(R.id.hid_rfid_checkbox);
mWirelessChargingCheckBox = (CheckBox)view.findViewById(R.id.hid_wireless_charging_checkbox);
mAllowPairingCheckBox = (CheckBox)view.findViewById(R.id.allow_pairing_checkbox);
mWirelessChargingLabel = (TextView)view.findViewById(R.id.hid_wireless_charging_label);
mButtonSetPasskey = (Button)view.findViewById(R.id.buttonSetPasskey);
mButtonBond = (Button)view.findViewById(R.id.buttonBond);
mButtonRebootDevice = (Button)view.findViewById(R.id.buttonReboot);
mButtonRebootDevice.setVisibility(View.INVISIBLE);
mSpLayout = (LinearLayout) view.findViewById(R.id.sp_layout);
mSpShowUiCheckBox = (CheckBox) view.findViewById(R.id.sp_showui);
mSpAutodisconExa51CheckBox = (CheckBox) view.findViewById(R.id.sp_autodiscon_exa51);
mSpSensitivityCheckBox = (CheckBox) view.findViewById(R.id.sp_sensitivity);
if (!NurSmartPairSupport.isSupported())
mSpLayout.setVisibility(View.GONE);
iterateBluetoothDevices();
mButtonSetPasskey.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
passkeyInput();
}
});
mButtonRebootDevice.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
Toast.makeText(AppTemplate.getAppTemplate(),"Rebooting device..", Toast.LENGTH_SHORT).show();
mExt.restartBLEModule();
mButtonRebootDevice.setVisibility(View.INVISIBLE);
}
catch (Exception e) {
e.printStackTrace();
Toast.makeText(AppTemplate.getAppTemplate(),"Operation failed", Toast.LENGTH_SHORT).show();
}
}
});
mButtonBond.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(mBondFound) {
//Need to Unpair
try {
mExt.clearPairingData();
unpairDevice(device);
Toast.makeText(AppTemplate.getAppTemplate(),"Unpair success. Rebooting device..", Toast.LENGTH_LONG).show();
mBondFound=false;
mButtonBond.setText("Pair");
}catch (Exception e) {
e.printStackTrace();
Toast.makeText(AppTemplate.getAppTemplate(),"Unpair failed:" + e.getMessage(), Toast.LENGTH_LONG).show();
}
}
else {
//Try to pair device
if(device!=null) {
try {
//mExt.clearPairingData();
AccConfig cfg=mExt.getConfig();
pairDevice(device);
if(cfg.isDeviceEXA21()==false) {
Thread.sleep(3000);
iterateBluetoothDevices();
if (mBondFound) {
Toast.makeText(AppTemplate.getAppTemplate(), "Pairing success", Toast.LENGTH_LONG).show();
mButtonBond.setText("Unpair");
} else
Toast.makeText(AppTemplate.getAppTemplate(), "Pairing failed", Toast.LENGTH_LONG).show();
}
//mExt.restartBLEModule();
}catch (Exception e) {
e.printStackTrace();
Toast.makeText(AppTemplate.getAppTemplate(),"Pairing failed:" + e.getMessage(), Toast.LENGTH_LONG).show();
}
}
}
}
});
}
@Override
public void onResume() {
super.onResume();
Log.i(TAG,"Resume");
iterateBluetoothDevices();
readCurrentSetup();
}
}
|
Buildings and budgets: the overinvestment crisis. Over the last ten years, American colleges and universities have spent over $400 billion on their physical plants despite the fact that student enrollments have continued to decline. The increase in maintenance and energy costs has caused a financial strain, forcing cutbacks in vital ingredients of education: research, course offerings, student financial aid, faculty and staff support. The author draws a comparison between higher education and the health care industry and suggests that costs can be reduced by avoiding duplication of facilities and developing modes of interinstitutional cooperation. An increase in institutional efficiency will reduce the reliance of the higher education community on public subsidies for operations. This approach is seen to be particularly important during an era when every qualified student is expected to have the opportunity to obtain a university education without undue financial strain. |
<filename>netmiko/dell/dell_isilon_ssh.py
import time
import re
from netmiko.base_connection import BaseConnection
class DellIsilonSSH(BaseConnection):
def set_base_prompt(
self, pri_prompt_terminator="$", alt_prompt_terminator="#", delay_factor=1
):
"""Determine base prompt."""
return super().set_base_prompt(
pri_prompt_terminator=pri_prompt_terminator,
alt_prompt_terminator=alt_prompt_terminator,
delay_factor=delay_factor,
)
def strip_ansi_escape_codes(self, string_buffer):
"""Remove Null code"""
output = re.sub(r"\x00", "", string_buffer)
return super().strip_ansi_escape_codes(output)
def session_preparation(self):
"""Prepare the session after the connection has been established."""
self.ansi_escape_codes = True
self.zsh_mode()
self.find_prompt(delay_factor=1)
self.set_base_prompt()
# Clear the read buffer
time.sleep(0.3 * self.global_delay_factor)
self.clear_buffer()
def zsh_mode(self, delay_factor=1, prompt_terminator="$"):
"""Run zsh command to unify the environment"""
delay_factor = self.select_delay_factor(delay_factor)
self.clear_buffer()
command = self.RETURN + "zsh" + self.RETURN
self.write_channel(command)
time.sleep(1 * delay_factor)
self.set_prompt()
self.clear_buffer()
def set_prompt(self, prompt_terminator="$"):
prompt = f"PROMPT='%m{prompt_terminator}'"
command = self.RETURN + prompt + self.RETURN
self.write_channel(command)
def disable_paging(self, *args, **kwargs):
"""Isilon doesn't have paging by default."""
pass
def check_enable_mode(self, *args, **kwargs):
"""No enable mode on Isilon."""
pass
def enable(self, *args, **kwargs):
"""No enable mode on Isilon."""
pass
def exit_enable_mode(self, *args, **kwargs):
"""No enable mode on Isilon."""
pass
def check_config_mode(self, check_string="#"):
return super().check_config_mode(check_string=check_string)
def config_mode(self, config_command="sudo su"):
"""Attempt to become root."""
delay_factor = self.select_delay_factor(delay_factor=1)
output = ""
if not self.check_config_mode():
output += self.send_command_timing(
config_command, strip_prompt=False, strip_command=False
)
if "Password:" in output:
output = self.write_channel(self.normalize_cmd(self.secret))
self.set_prompt(prompt_terminator="#")
time.sleep(1 * delay_factor)
self.set_base_prompt()
if not self.check_config_mode():
raise ValueError("Failed to configuration mode")
return output
def exit_config_mode(self, exit_config="exit"):
"""Exit enable mode."""
return super().exit_config_mode(exit_config=exit_config)
|
package com.point.iot.utils;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.log4j.Logger;
public class ThreadPools {
private static AtomicInteger counter = new AtomicInteger(0);
private final static int nThreads = Runtime.getRuntime()
.availableProcessors() * 2;
private final static Logger logger = Logger.getLogger(ThreadPools.class);
private final static ExecutorService executors = new ThreadPoolExecutor(
nThreads, nThreads, 0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1000000), new ThreadFactory() {
@Override
public Thread newThread(Runnable runnable) {
int size = counter.incrementAndGet();
logger.debug("Thread size" + size);
return new ThreadPools.WorkThread(runnable, counter);
}
}, new ThreadPoolExecutor.DiscardOldestPolicy());
public static void execute(Runnable runnable) {
executors.execute(runnable);
}
static class WorkThread extends Thread {
private Runnable target;
private AtomicInteger counter;
public WorkThread(Runnable runnable, AtomicInteger counter) {
this.target = runnable;
this.counter = counter;
}
@Override
public void run() {
try {
target.run();
} finally {
counter.getAndDecrement();
}
}
}
}
|
<reponame>fluencelabs/fce
/*
* Copyright 2021 Fluence Labs Limited
*
* 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.
*/
use super::ITResolver;
use super::ptype_to_itype_checked;
use crate::default_export_api_config::*;
use crate::Result;
use marine_macro_impl::ParsedType;
use wasmer_it::interpreter::Instruction;
use wasmer_it::IType;
/// Generates IT instructions for a output type of an export function.
pub(super) trait OutputITGenerator {
fn generate_instructions_for_output_type<'a>(
&self,
it_resolver: &mut ITResolver<'a>,
) -> Result<Vec<Instruction>>;
}
impl OutputITGenerator for ParsedType {
#[rustfmt::skip]
fn generate_instructions_for_output_type<'a>(&self, it_resolver: &mut ITResolver<'a>) -> Result<Vec<Instruction>> {
let instructions = match self {
ParsedType::Boolean(_) => vec![Instruction::BoolFromI32],
ParsedType::I8(_) => vec![Instruction::S8FromI32],
ParsedType::I16(_) => vec![Instruction::S16FromI32],
ParsedType::I32(_) => vec![Instruction::S32FromI32],
ParsedType::I64(_) => vec![Instruction::S64FromI64],
ParsedType::U8(_) => vec![Instruction::U8FromI32],
ParsedType::U16(_) => vec![Instruction::U16FromI32],
ParsedType::U32(_) => vec![Instruction::U32FromI32],
ParsedType::U64(_) => vec![Instruction::U64FromI64],
ParsedType::F32(_) => vec![],
ParsedType::F64(_) => vec![],
ParsedType::Utf8Str(_) | ParsedType::Utf8String(_) => vec![
Instruction::CallCore { function_index: GET_RESULT_PTR_FUNC.id },
Instruction::CallCore { function_index: GET_RESULT_SIZE_FUNC.id },
Instruction::StringLiftMemory,
],
ParsedType::Vector(value_type, _) => {
let value_type = ptype_to_itype_checked(value_type, it_resolver)?;
if let IType::U8 = value_type {
vec![
Instruction::CallCore { function_index: GET_RESULT_PTR_FUNC.id },
Instruction::CallCore { function_index: GET_RESULT_SIZE_FUNC.id },
Instruction::ByteArrayLiftMemory,
]
} else {
vec![
Instruction::CallCore { function_index: GET_RESULT_PTR_FUNC.id },
Instruction::CallCore { function_index: GET_RESULT_SIZE_FUNC.id },
Instruction::ArrayLiftMemory { value_type },
]
}
},
ParsedType::Record(record_name, _) => {
let record_type_id = it_resolver.get_record_type_id(record_name)? as u32;
vec! [
Instruction::CallCore { function_index: GET_RESULT_PTR_FUNC.id },
Instruction::RecordLiftMemory { record_type_id },
]
},
};
Ok(instructions)
}
}
|
<filename>aliyun-api-alert/2015-08-15/include/ali_alert_get_dimensions_types.h
#ifndef ALI_ALERT_GET_DIMENSIONS_TYPESH
#define ALI_ALERT_GET_DIMENSIONS_TYPESH
#include <stdio.h>
#include <string>
#include <vector>
namespace aliyun {
struct AlertGetDimensionsRequestType {
std::string project_name;
std::string alert_name;
std::string dimensions_id;
};
struct AlertGetDimensionsResponseType {
std::string code;
std::string message;
std::string success;
std::string trace_id;
std::string result;
};
} // end namespace
#endif
|
/**
* Check that if connections cannot be created, no permits are expended.
* @throws Exception if test fails
*/
public void testConnectionsUnavailable() throws Exception {
switchableInterceptor.setOn(false);
for (int i = 0; i < maxSize; i++) {
try {
getConnection();
fail("Connections should be unavailable");
} catch (ResourceException e) {
}
}
switchableInterceptor.setOn(true);
getConnections(ConnectionReturnAction.DESTROY);
switchableInterceptor.setOn(false);
for (int i = 0; i < maxSize; i++) {
try {
getConnection();
fail("Connections should be unavailable");
} catch (ResourceException e) {
}
}
} |
This combination product containing amoxicillin and clavulanic acid belongs to the group of medications known as antibiotics. It is used to treat infections caused by certain bacteria. Amoxicillin works by killing the bacteria that is causing the infection. Clavulanic acid helps make the amoxicillin more effective. This medication is most commonly used to treat infections of the sinus, ear, lung, skin, and bladder.
Each white, oval, biconvex, film-coated tablet engraved “250-125” on one side and plain on the other, contains 250 mg amoxicillin as the trihydrate and 125 mg of clavulanic acid as the potassium salt (in a ratio of 2:1). Nonmedicinal ingredients: magnesium stearate, croscarmellose sodium, colloidal silicon dioxide, hydroxypropyl cellulose, polyethylene glycol, and titanium dioxide.
Each white, oval, biconvex, film-coated tablet scored and engraved "AC" on one side and plain on the other, contains amoxicillin 875 mg as the trihydrate and clavulanic acid 125 mg as the potassium salt (in a ratio of 7:1). Nonmedicinal ingredients: magnesium stearate, croscarmellose sodium, colloidal silicon dioxide, hydroxypropyl cellulose, polyethylene glycol, titanium dioxide, and ethylcellullose.
The recommended adult dose of amoxicillin - clavulanic acid depends on the infection being treated. The usual recommended adult doses include 500 mg every 8 or 12 hours or 875 mg every 12 hours.
The children's dose of amoxicillin - clavulanic acid is based on body weight, as prescribed by the doctor. Depending on the infection being treated, the dose will range between 20 mg and 45 mg per kilogram of body weight per day, taken in divided doses.
The medication may be taken with or without food, but taking it with food may reduce side effects such as upset stomach, nausea, diarrhea, and abdominal cramps. Amoxicillin - clavulanic acid is usually taken for a period of 7 to 10 days. In some cases, it may be necessary to take this medication for a longer period.
If using the suspension form, use an oral syringe to measure each dose to get a more accurate measurement than household teaspoons.
It is very important to take this medication exactly as prescribed by the doctor for the full duration of treatment, even though you may feel better before the medication is finished. If you miss a dose, take it as soon as possible and continue with your regular schedule. If it is almost time for your next dose, skip the missed dose and continue with your regular dosing schedule. Do not take a double dose to make up for a missed one. If you are not sure what to do after missing a dose, contact your doctor or pharmacist for advice.
Store the suspension in the refrigerator and keep it out of the reach of children.
Allergy: Amoxicillin, one of the ingredients in this medication, is a penicillin. If you have previously had an allergic reaction to antibiotics such as penicillin or cephalosporins (e.g., cephalexin, ceftriaxone), you should not take this medication. Before you take amoxicillin - clavulanic acid, inform your doctor about any previous adverse reactions you have had to medications, especially cephalosporins and penicillins.
Get immediate medical attention if you experience symptoms of a severe allergic reaction (e.g., hives; swelling of the face, tongue, or throat; trouble breathing).
Antibiotic-associated colitis: This medication, like other antibiotics, may cause a potentially dangerous condition called antibiotic-associated, or pseudomembranous, colitis. Symptoms include severe, watery diarrhea that may be bloody. If you notice these symptoms, stop taking amoxicillin - clavulanic acid and contact your doctor as soon as possible.
Aspartame: The suspension forms of this medication contain aspartame. If you have phenylketonuria, discuss with your doctor how this medication may affect your medical condition, how your medical condition may affect the dosing and effectiveness of this medication, and whether any special monitoring is needed.
Birth control: This medication may decrease the effectiveness of birth control pills. Some doctors recommend adding another method of birth control for the rest of the cycle when amoxicillin-clavulanate is taken.
Kidney Function: This medication is eliminated from the body mostly by the kidneys. If you have kidney disease or reduced kidney function, this medication may build up in your body and cause unwanted effects.
If you have kidney problems, discuss with your doctor how this medication may affect your medical condition, how your medical condition may affect the dosing and effectiveness of this medication, and whether any special monitoring is needed.
Clavulanic acid may cause a decrease in liver function. If you experience symptoms of liver problems such as fatigue, feeling unwell, loss of appetite, nausea, yellowing of the skin or whites of the eyes, dark urine, pale stools, abdominal pain or swelling, and itchy skin, contact your doctor immediately.
Mononucleosis: When amoxicillin - clavulanic acid is used by a person who has mononucleosis, a widespread rash may occur. If you have or suspect you have mononucleosis, discuss with your doctor how this medication may affect your medical condition, how your medical condition may affect the dosing and effectiveness of this medication, and whether any special monitoring is needed.
This medication should not be used by anyone who has or is suspected to have mononucleosis.
Overgrowth of organisms (super-infection): Prolonged or repeated use of this antibiotic may allow normal fungus or certain types of bacteria not killed by the antibiotic to overgrow, causing unwanted infections such as yeast infections. Contact your doctor if you notice white patches in the mouth (thrush), abnormal vaginal discharge, or itching.
Breast-feeding: Amoxicillin passes into breast milk. It is not known if clavulanic acid passes into breast milk. If you are a breast-feeding mother and are taking this medication, it may affect your baby. Talk to your doctor about whether you should continue breast-feeding. |
// SPDX-License-Identifier: MIT
package com.mercedesbenz.sechub.sharedkernel;
/**
* Log constants to use. Attention: MDC variants must be used wise! If you do
* not cleanup MDC or set always to correct values next logs can contain old MDC
* data. MDC is thread local so when threads are reused...
*
* @author <NAME>
*
*/
public class LogConstants {
public static final String MDC_SECHUB_JOB_UUID = "sechub_job_uuid";
public static final String MDC_SECHUB_PROJECT_ID = "sechub_project_id";
/**
* Log constant for MDC audit logs, reserved for audit log service only
*/
public static final String MDC_SECHUB_AUDIT_USERID = "sechub_audit_userid";
}
|
<gh_stars>10-100
package revxrsal.commands.process;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import revxrsal.commands.CommandHandler;
import revxrsal.commands.command.ArgumentStack;
import revxrsal.commands.command.CommandActor;
import revxrsal.commands.command.CommandParameter;
import revxrsal.commands.command.ExecutableCommand;
import revxrsal.commands.process.ContextResolver.ContextResolverContext;
import revxrsal.commands.process.ValueResolver.ValueResolverContext;
import java.util.List;
/**
* Represents a resolver for a {@link CommandParameter}. Instances of this
* resolver can be fetched from {@link CommandParameter#getResolver()}.
*
* @param <T> The type of the resolved argument
*/
public interface ParameterResolver<T> {
/**
* Returns whether this resolver mutates the given arguments when it
* resolves its value
*
* @return If this resolver mutates the {@link ArgumentStack}.
*/
boolean mutatesArguments();
/**
* Resolves the value of the parameter from the given context.
*
* @param context The parameter resolver context.
* @return The resolved value.
*/
@Nullable
T resolve(@NotNull ParameterResolverContext context);
/**
* Represents the resolving context of a {@link CommandParameter}. This contains
* all the relevant information about the resolving context.
*
* @see ValueResolverContext
* @see ContextResolverContext
*/
interface ParameterResolverContext {
/**
* Returns the exact input of the actor. This collection represents
* the tokenized list from the input, without it being modified
* by resolvers.
*
* @return The actor's input to the command.
*/
@NotNull @Unmodifiable List<String> input();
/**
* Returns the command actor that executed this command.
*
* @param <A> The actor type.
* @return The command actor
*/
@NotNull <A extends CommandActor> A actor();
/**
* Returns the current parameter being resolved
*
* @return The parameter being resolved
*/
@NotNull CommandParameter parameter();
/**
* Returns the command being executed
*
* @return The command being executed
*/
@NotNull ExecutableCommand command();
/**
* Returns the owning {@link CommandHandler} of this resolver.
*
* @return The command handler
*/
@NotNull CommandHandler commandHandler();
/**
* Returns the last resolved value of the given parameter type. If
* no parameter matches the given type, or if the parameter was not resolved yet,
* this will throw an {@link IllegalStateException}.
*
* @param type The parameter type to fetch for.
* @param <T> The resolved type
* @throws IllegalStateException If no parameter of this type was resolved.
* @return The last resolved value matching the given type.
*/
<T> @NotNull T getResolvedArgument(@NotNull Class<T> type);
/**
* Returns the last resolved value of the given parameter type. If
* no parameter matches the given type, or if the parameter was not resolved yet,
* this will throw an {@link IllegalStateException}.
*
* @param parameter The parameter to fetch for.
* @param <T> The resolved type
* @throws IllegalStateException If no parameter of this type was resolved.
* @return The last resolved value matching the given type.
*/
<T> @NotNull T getResolvedParameter(@NotNull CommandParameter parameter);
}
}
|
MONROVIA — While neither the La Cañada High or Monrovia baseball teams could claim they hit exceptionally well in clutch situations in Wednesday afternoon’s Rio Hondo League meeting, the Spartans walked away with two distinct advantages.
La Cañada secured just enough hits and, more importantly, notched a pivotal 3-2 road victory in the first of three meetings between the rivals.
The Spartans (9-5, 2-1) finished one for 12 with runners in scoring position with two RBI and stranded nine baserunners, while Monrovia (7-6, 2-2) was one for six in the same situation with an RBI and six runners left on the base paths.
That frustration played out in the seventh inning for both teams.
Monrovia trailed, 3-1, heading into the bottom of the seventh versus Spartans starting pitcher Justin Lewis, who coaxed a popup to start off the inning.
Wildcats catcher Jacob Ramos kept his squad’s hopes alive by doubling to center field and advanced to third on a groundout.
Monrovia then produced its first hit with runners in scoring position on an infield run-scoring single from Juan Quinonez (three for three with an RBI) that chased Lewis.
Spartans Coach Alex Valadez pulled Lewis in favor of George Steckbeck, who fanned Devin Ayala to close out the game.
Only a half inning earlier, the Spartans had a chance to put the game out of reach.
David Yoon and Jacob Yonan singled to lead off the inning and then advanced to second and third on a sacrifice bunt from Lewis that the Spartans senior beat out for a single.
With the bases loaded and no outs, though, the Spartans only plated one run on a fielder’s choice from Johnny Selsor (one for four with an RBI and double) to take a 3-1 advantage.
Selsor initially helped La Cañada jump ahead, 2-0, in the fourth when he and teammate Travis Clark led off the inning with doubles.
Clark eventually scored in the inning on a wild pitch from hurler Nick Esparza.
Prior to the fourth inning, both teams only combined for three hits.
La Cañada did have its chances, though, as the Spartans advanced a man to third in five of seven innings, while only scoring twice.
Lewis picked up the win for the Spartans, allowing two runs on six hits with six strikeouts against two walks. |
<reponame>jivesoftware/tasmo
package com.jivesoftware.os.tasmo.test;
/**
*
* @author jonathan.colt
*/
public class IdBatchConfig {
final Order order;
final int numberOfIdsInBatch;
final int numberOfBatches;
public IdBatchConfig(Order order, int numberOfIdsInBatch, int numberOfBatches) {
this.order = order;
this.numberOfIdsInBatch = numberOfIdsInBatch;
this.numberOfBatches = numberOfBatches;
}
@Override
public String toString() {
return order + " " + numberOfIdsInBatch + " " + numberOfBatches;
}
}
|
At today’s oral argument in Hernández v. Mesa, the latest chapter in a Mexican family’s effort to hold a U.S. Border Patrol agent liable for the fatal shooting, on Mexican soil, of their 15-year-old son, some of the justices appeared “sympathetic,” as Justice Stephen Breyer put it, to the family’s plight. But at the same time, even the justices who might be predisposed to support the family struggled to articulate a rule that would allow the family’s lawsuit to go forward without also permitting a wide variety of other – perhaps less sympathetic – cases, and they seemed frustrated by the family’s inability to identify such a rule. In the end, though, it’s not clear that the rule will matter, if the justices don’t agree that the Border Patrol agent can be sued in federal court at all.
Before the oral argument began, Acting Solicitor General Noel Francisco presented the new U.S. attorney general, Jefferson B. Sessions, to the court. On behalf of the justices, Chief Justice John Roberts wished Sessions “well in the discharge of the duties of your new office.” Sessions acknowledged the good wishes, but did not stay for the oral argument.
Representing the parents of Sergio Hernández, who contend that their son was playing in the culvert along the U.S.-Mexico border when he was shot, on the Mexican side of the border, by Jesus Mesa, a Border Patrol agent who was on the U.S. side, attorney Robert Hilliard argued that the dispute now before the court was “one of the simplest” cases involving the application of U.S. law outside the United States. Mesa, a civilian law enforcement officer, fired the bullet in the United States, striking Hernández, also a civilian, and depriving Hernández of his fundamental right to life. For that reason, Hilliard argued, the Fourth Amendment’s bar on the unjustified use of deadly force applied to Hernández, even if he was outside the United States when the shooting occurred.
But Chief Justice John Roberts was skeptical. He suggested that, although Hilliard’s proposed rule would “fit the exact facts” of the family’s case, it could not actually be defined so narrowly. What about a drone strike launched across the border from Nevada, for example?
Justice Stephen Breyer, whose vote the family would likely need to prevail, also repeatedly pressed Hilliard to define the family’s suggested rule more precisely. What are the words, he asked pointedly, that allow the family to win but avoid confusion and uncertainty in other cases – so that the court’s opinion in this case does not give life to lawsuits arising out of drone strikes?
Justice Samuel Alito echoed these concerns. Would it matter, he queried, if Hernández had been 19 instead of 15, if he had been armed but had his hands up, or had been 200 yards away in Mexico rather than in the culvert? “I don’t know what rule you want us to adopt,” Alito concluded, “other than you win.”
Justice Elena Kagan saw it slightly differently, but appeared similarly troubled. In her view, Hilliard had a rule: Border Patrol agents who shoot from the United States in the border area can be held liable. The harder and more salient question, she suggested, was the rationale for that rule. What makes the confluence of those factors different from other cases, she asked?
Justices Ruth Bader Ginsburg and Sonia Sotomayor were more supportive of the family. Ginsburg observed that, as a general matter, when an act outside one jurisdiction causes an injury inside another jurisdiction, the rules governing the ensuing lawsuit can come from either jurisdiction. Discussing this case specifically, she described the dispute as having the “United States written all over it.” And when attorney Randolph Ortega, representing Mesa, emphasized that the United States could prosecute Mesa in the United States for violating his orders, Sotomayor retorted that such a prosecution wouldn’t provide any compensation to Hernández’s family for the emotional distress that they had suffered.
Despite the earlier concerns voiced by Breyer and Kagan about the family’s inability to identify a clear and rational rule, the two justices seemed equally (if not more) reluctant to rule that the Fourth Amendment did not protect Hernández, at least in this scenario. Breyer repeatedly stressed that the culvert on the U.S.-Mexico border where Hernández was shot is maintained jointly by the two countries, which also have a commission to draw the border. Throw in the nearly half-million people who cross the U.S.-Mexico border each day, Mexico’s support for the application of the Fourth Amendment to cross-border shootings of its citizens by U.S. Border Patrol agents, and the general principle (noted by Ginsburg) that the law of both jurisdictions should apply, he concluded, and perhaps the Fourth Amendment should cover this case. Kagan appeared receptive to this argument, describing the case as “sui generis” and the border area where the shooting occurred as “something very different from most areas where we know whose jurisdiction it is.”
But even if Hernández’s parents can convince at least five justices that Hernández was protected by the Fourth Amendment, they still face another, potentially larger, hurdle: convincing the justices that they can bring their lawsuit at all. In 1971, in a case called Bivens v. Six Unknown Named Agents, the justices ruled that a plaintiff can bring a private federal action for damages against federal officials who allegedly violated his constitutional rights. The family did not raise this issue in their petition for review, but the justices specifically directed both sides to address the question when they agreed to take on the case.
The court’s four more liberal justices seemed inclined to rule that the family could rely on Bivens to bring their lawsuit. When Deputy Solicitor General Edwin Kneedler, arguing on behalf of the federal government, emphasized that the court had steadfastly declined in recent decades to extend Bivens to new contexts, Kagan led the charge against that argument. Those cases were different, she countered, because the court could point to some remedy that would be available to the plaintiffs, even if it wasn’t exactly what they were seeking. “Here there really is nothing,” she stressed.
Breyer questioned even the premise of the government’s argument that the court should be reluctant to “extend” Bivens. Why, he asked, are we using words like “create” or “extend”? “Extend,” he contended, assumes the answer to the question. Rather, he argued, the court in Bivens made clear that when a federal agent violates the Fourth Amendment and thereby injures someone, that person will have a remedy unless “special factors” – for example, the federal agent is in the military – are present.
But perhaps most critically for the family, Justice Anthony Kennedy seemed to be a tough sell. Issues like cross-border shootings, which involve the “most sensitive areas of foreign affairs,” he posited, should be resolved by governments, rather than by courts. And responding to Hilliard’s suggestion that families like Hernández’s should be allowed to sue Border Patrol agents because of the high number of cross-border shootings that have taken place, Kennedy drew the opposite inference. The frequency with which such shootings occur, in Kennedy’s view, simply reinforces that this is a “critical area” of foreign affairs that should be left to the executive branch.
Normally, if the court deadlocks 4-4, it leaves the lower court’s ruling (here, in favor of Mesa and against the family) in place. But with confirmation hearings for Judge Neil Gorsuch, the president’s nominee to fill the vacancy created by the 2016 death of Justice Antonin Scalia, now scheduled for mid-March, a 4-4 deadlock could prompt the justices to order new arguments if Gorsuch is confirmed. If so, we could be back here in the fall or winter to hear the newly reconstituted court debate these issues all over again.
Recommended Citation: Amy Howe, Argument analysis: A search for a rule, but is there even a remedy?, SCOTUSblog (Feb. 21, 2017, 2:27 PM), https://www.scotusblog.com/2017/02/argument-analysis-search-rule-even-remedy/ |
<reponame>cvr-dev/cvr.dev-python
import unittest
from http import HTTPStatus
from unittest.mock import patch
from cvr import Client, UnauthorizedError, InternalServerError
class TestCVRProduktionsenheder(unittest.TestCase):
def test_unauthorized(self):
""" Verifies that UnauthorizedError is raised when the client receives
HTTP status code 401.
"""
client = Client(api_key='some-api-key')
response = MockResponse(HTTPStatus.UNAUTHORIZED)
with patch.object(client._session, 'get', return_value=response):
with self.assertRaises(UnauthorizedError):
client.cvr.produktionsenheder(adresse="adresse")
def test_server_error(self):
""" Verifies that InternalServerError is raised when the client receives
HTTP status code 500.
"""
client = Client(api_key='some-api-key')
response = MockResponse(HTTPStatus.INTERNAL_SERVER_ERROR)
with patch.object(client._session, 'get', return_value=response):
with self.assertRaises(InternalServerError):
client.cvr.produktionsenheder(adresse="adresse")
def test_produktionsenhed_not_found(self):
""" Verifies that the client returns an empty list when HTTP status code
404 is received.
"""
client = Client(api_key='some-api-key')
response = MockResponse(HTTPStatus.NOT_FOUND)
with patch.object(client._session, 'get', return_value=response):
produktionsenheder = client.cvr.produktionsenheder(adresse="some adresse")
self.assertEqual(0, len(produktionsenheder))
def test_produktionsenhed_success(self):
""" Verifies that the client returns a list of Produktionsenheder and
deserializes them when HTTP status code 200 is returned.
"""
client = Client(api_key='some-api-key')
expected = [
{"pNummer": 1234},
{"pNummer": 2345},
{"pNummer": 3456},
]
response = MockResponse(
status_code=HTTPStatus.OK,
content=expected,
)
with patch.object(client._session, 'get', return_value=response):
produktionsenheder = client.cvr.produktionsenheder(adresse="some adresse")
self.assertEqual(len(expected), len(produktionsenheder))
for i, penhed in enumerate(expected):
self.assertEqual(penhed["pNummer"], produktionsenheder[i].p_nummer)
class MockResponse:
def __init__(self, status_code, content=None):
self.status_code = status_code
self._content = content
def json(self):
return self._content
|
First order phase transition in the anisotropic quantum orbital compass model We investigate the anisotropic quantum orbital compass model on an infinite square lattice by means of the infinite projected entangled-pair state algorithm. For varying values of the $J_x$ and $J_z$ coupling constants of the model, we approximate the ground state and evaluate quantities such as its expected energy and local order parameters. We also compute adiabatic time evolutions of the ground state, and show that several ground states with different local properties coexist at $J_x = J_z$. All our calculations are fully consistent with a first order quantum phase transition at this point, thus corroborating previous numerical evidence. Our results also suggest that tensor network algorithms are particularly fitted to characterize first order quantum phase transitions. Introduction.-When quantum many-body systems are cooled down close to zero temperature, important collective phenomena may occur. A good example is provided by transition-metal oxides, whose physical properties have become of increasing interest in the last few years. In these compounds the orbital degrees of freedom of the atomic electrons play a key role in determining properties such as metal-insulator transitions, high-temperature superconductivity and colossal magnetoresistance. The paradigmatic approach to these systems is based on the so-called orbital compass models, which have been the subject of many studies in the past both in the classical and quantum regimes. For these systems, Jahn-Teller effects produce an anisotropy of the pseudospin couplings which is intertwined with the orientation of the interaction bonds. The properties of these systems have attracted considerable attention since they are endowed with symmetries that effectively reduce the dimensionality of the system (the so-called dimensional reduction). Despite of their apparent simplicity, orbital compass models are relevant in a variety of contexts, such as in determining the physics of Mott insulators with orbital degrees of freedom and the implementation of protected qubits for quantum computation in Josephson junction arrays. These systems are also candidates to exhibit topological quantum order. Furthermore, it was recently shown how to simulate these models using polar molecules in optical lattices and systems of trapped ions with state-of-the-art technology. Generally speaking, the symmetries in these systems involve large degeneracies in their energy spectra, which make their numerical simulation difficult. This fact, together with the lack of exact solutions, makes it hard to elucidate their phase diagrams. In this paper we use a tensor product state (TPS) or projected entangled-pair state (PEPS) to study the twodimensional anisotropic quantum orbital compass model (AQOCM) and, in particular, to investigate whether its phase transition is of first order or second order. More specifically, we use the infinite PEPS (iPEPS) algorithm of Ref. to study the model directly in the thermodynamic limit. Our results provide abundant evidence in favor of a first order phase transition. The model.-The 2D AQOCM describes a system of spins 1/2 interacting on a square lattice with anisotropic two-body interactions as defined by the Hamiltonian For this model, Nussinov and Fradkin proved that its Hamiltonian is dual to a plaquette model proposed by Xu and Moore to describe p + ip superconducting arrays such as Sr 2 RuO 4. The influence of impurities and of diluted lattices in the model has also been investigated. In addition, finite temperature properties have been studied both in the quantum and classical versions of the model, and in both cases the existence of a low temperature ordered phase with a thermal transition lying in the 2D Ising universality class has been shown. Finally, in Ref. a 1D version of the model was shown to undergo a first order phase transition. The Hamiltonian from Eq. has also some significant properties in the context of quantum computation. For instance, the model was proven to be dual to the 2D cluster state Hamiltonian embedded in a magnetic field. It was also shown to be related to certain classes of quantum error correcting codes where the system is used to codify a qubit that is robust against external local noise. Before proceeding any further, let us sketch some of the basic symmetry properties of the Hamiltonian H in Eq. (see e.g. Refs for detailed discussions). Define the operators where P i acts on column i of the 2D lattice and Q j acts on row j. It is not difficult to check that these operators commute with H for all the values of i and j. Importantly, = 0 for any i, j, and therefore operators P i and Q j represent incompatible symmetries of H. Furthermore, notice that = 0 ∀i, i and similarly for Q j, and that any tensor product of operators corresponding to different columns (or rows) commutes with H as well. All these symmetries imply that, in the case of a system defined on an L L square lattice, every eigenstate of the Hamiltonian is at least of order O(2 L ) degenerate. Also, whenever J x = J z the system is invariant under the reflection symmetry X ↔ Z, indicating the self-duality of the model at equal couplings. The above self-duality indicates a possible phase transition in the system at J x = J z. There have been several attempts to determine the existence and order of this phase transition. On the one hand, Xu and Moore pointed towards a possible second order quantum phase transition. On the other hand, some approximate calculations seem to favor a first order transition. The nature of this phase transition is, therefore, not totally understood yet. The method.-In this paper we use the iPEPS algorithm to compute the ground state as well as adiabatic time evolutions for the AQOCM on an infinite 2D square lattice. As explained in Refs., the accuracy of the results relies on a refinement parameter that we shall refer to as D. This parameter is related to the maximum entanglement content that can be handled by the simulations. In practice, increasing the value of D leads to better descriptions of the ground state, and therefore to more accurate estimations of the different observable quantities. In our calculations we consider D = 2,..., 6 and, without loss of generality, J x, J z ≥ 0. The coupling strengths in Eq. can be restricted to the range J x, J z ∈ and written in terms of a variable s ∈ as J x = cos (s/2) and J z = sin (s/2). Let us discuss the impact that the symmetries of the system have in our simulations. As explained above, the symmetries of the AQOCM imply an infinite degeneracy of its ground state in the thermodynamic limit. For instance, different ground state wave functions can be labelled according to the different eigenvalues of operators P i in Eq.. This sort of degeneracy, however, does not play a significant role in our simulations since our representation of the quantum state by means of an iPEPS is, by construction, invariant under translations in the x and z directions. Still, our implementation of the algorithm could be sensitive to the two-fold degeneracy caused by a simultaneous flip of all the spins. In practice, however, we observe that this does not happen. The simulations spontaneously choose either a positive or negative value of X (or Z ) for all sites away from the phase transition point. Simulation results.-Our calculations are of two types. First, we have computed the ground state wave function | GS (s) of the system as a function of s and evaluated observable quantities on it such as energy and local order parameters. Second, we have simulated adiabatic time evolutions starting from the computed ground state | GS (s ini ) for a given initial parameter s ini, and adiabatically increasing or decreasing s in the Hamiltonian well beyond crossing the point s = 1/2 (J x = J z ). These evolutions define two families of states, the left |L(s) for s ini < 1/2, and the right |R(s) for s ini > 1/2. The ground state energy per lattice link (independent of i and j) is displayed in Fig.. Our results show the presence of a sharp peak at s = 1/2, which is compatible with the existence of a first order phase transition at this point. The energy per link in the adiabatically evolved states |L(s) and |R(s) is also plotted in Fig.. There we can see that the energy of e.g. |L(s) follows the ground state energy up to the transition point s = 1/2. More generally, we find that, up to numerical accuracy, the PEPS for |L(s) is the same as that for the ground state for s < 1/2 (and similarly for |R(s) in the regime s > 1/2). Therefore, Fig. we can also infer that state |L(s) no longer corresponds to the ground state of the system for s > 1/2, but rather to some higher-energy excitation (and similarly for |R(s) for s < 1/2). The simulations of |L(s) and |R(s) are robust against modifying the rate of change of the Hamiltonian during the adiabatic evolution, indicating the presence of an energy gap to the reachable excitations. At the phase transition point both states |L(1/2) and |R(1/2) have the same energy as the actual ground state | GS (1/2), indicating the presence of two possible ground states of the system at this point. Importantly, these two ground states at s = 1/2 can be shown to be locally different, for instance by computing the Ising-like order parameters which are independent of due to translation invariance. Fig. shows m x and m z as a function of s, together with analogous expected values m L x (s), m L z (s), m R x (s) and m R z (s) for the evolved states |L(s) and |R(s). We find that m x and m z are both discontinuous at s = 1/2. However, such discontinuity could originate in a lack of resolution in s. That is, perhaps by considering more points around s = 1/2, the discontinuity in the order parameters would disappear, indicating a continuous phase transition. This possibility can be ruled out by noticing that e.g. m L x (s) does not vanish to the right of the transition point (similarly, m R z (s) does not vanish to the left of the transition point). That is, the two families of states |L(s) and |R(s), which coincide with the ground state to the left (respectively right) of s = 1/2, remain locally different at the transition point, where both represent possible ground states of the system. We interpret this fact as conclusive evidence of the existence in the 2D AQOCM of a first order phase transition between the two phases characterized by vanishing and non-vanishing values of the local order parameters m x and m z. Let us now discuss the role played by the symmetries in this phase transition. Our numerical calculations using tensor networks have also shown that the ground states | GS (s) satisfy the eigenvalue relations P i | GS (s) = | GS (s) if s < 1/2 and Q j | GS (s) = | GS (s) if s > 1/2, regardless of the values of i and j. Thus, we see that the system chooses to preserve a different symmetry at each side of the phase transition point, namely, the P i symmetry for s < 1/2 and the Q j symmetry for s > 1/2. Quite naturally, the system chooses to break the symmetry which minimizes the amount of entanglement in the broken ground state, while leaving the remaining symmetry intact. In turn, this also implies that the adiabatically evolved states |L(s) and |R(s) are, respectively, eigenstates of operators P i and Q j with eigenvalue 1 for any value of s. This follows from the fact that the symmetry of the initial state is preserved all along the adiabatic time evolution since the symmetry operators commute with the Hamiltonian for any value of s. Therefore, the two possible ground states at the phase transition point |L(1/2) and |R(1/2) obtained by adiabatic evolution preserve the P i and Q j symmetries respectively. In addition, we observe that the two families of adiabatically evolved states are related to each other by a non-local transformation, namely the duality transformation of the model that switches the values of J x and J z in Eq.. More precisely, for all the computed values of s, these are related by a rotation |L(s) = W (/2)w(/2)|R(s), where W (/2) rotates the spin degrees of freedom by an angle /2 around the y-axis and w(/2) rotates the square lattice by /2. That it takes a highly non-local transformation to map |L(s) and |R(s) into each other is, again, consistent with a first order transition, where the two coexisting ground states are not expected to be connected by local perturbations. Furthermore, we have also computed the ground state fidelity-per-site diagram for this system (not shown) and have obtained results that agree with the typical behavior expected of a first order transition (see Ref. ). All the above results are compatible with those obtained using other numerical approaches. As a first check, we have verified that our simulations reproduce the results of simple series expansion calculations that we performed far away from s = 1/2. As can be seen in Fig., the present results for the energy per bond e, computed directly for an infinite system, agree in the first 4 significant digits with the value obtained through a rough extrapolation, to the thermodynamic limit, of exact diagonalization and Green's function Montecarlo results for finite systems presented in Ref.. Moreover, as shown in Fig., close to the phase transition point the present results for the order parameters m x and m z are comparable to those obtained in Ref. with mean field theory after fermionization of the Hamiltonian. The small disagreement, of the order of 1.5 %, increases with growing values of D (that is, as our results become more precise), which suggests that the iPEPS results for D = 2 are already better than those obtained by combining fermionization with mean field theory. We stress that our simulations show fast convergence of the computed observables with the refinement parameter D (see e.g. Fig. (1.(ii))). Conclusions.-In this paper we have provided fresh evidence that, contrary to what had been suggested in Ref., the phase transition in the AQOCM on a square lattice is of first order. Unlike previous approaches to this problem, we have employed an algorithm based on a TPS or PEPS for an infinite 2D lattice to numerically compute the ground state and, for the first time for an infinite 2D system, its adiabatic time evolution. We believe that our results, together with those in Ref., conclusively support the existence of a first order phase transition. |
Fully hand-drawn animated features aren’t on the menu anymore at Disney, but the studio still finds scraps of work for its few remaining paper-and-pencil adherents.
The latest gig for these veterans is the live show “Happily Ever After,” scheduled to debut May 12 at Walt Disney World’s Magic Kingdom. Besides the fireworks and pyrotechnics, the show will feature projection-mapped hand-drawn animation that will appear on Cinderella’s Castle. Disney Imagineering exec Michael Jung describes the show as a “wonderful kiss good night for our guests.”
The key animators on the project are Mark Henn, Eric Goldberg, and Randy Haycock, and they’re animating characters from Moana, Brave, Big Hero 6, Zootopia, The Little Mermaid, The Princess & The Frog, and Aladdin, among others. Disney released this clip of them discussing the project yesterday: |
import { buildLocale, preprocess, rootLocale } from '../../src/nlp/locales'
test('TEST: preprocess', () => {
expect(preprocess('es-ES', ' ÑÇáü òL·l ')).toEqual('ncau ol·l')
})
test('TEST: rootLocale', () => {
expect(rootLocale('es-ES')).toEqual('es')
expect(rootLocale('en')).toEqual('en')
})
test('TEST: buildLocale', () => {
expect(buildLocale('ES', 'es')).toEqual('es-ES')
expect(buildLocale('EN', undefined)).toEqual('en')
})
|
How does a director work? How does he start his preparations? What is the director listening for when actors read their lines? These questions and many more tumble around the mind of an aspiring director begging to be answered. As luck would have it, highly respected director turned film teacher at CalArts, Alexander Mackendrick, addresses some of these questions in an imperfect 43-minute collection of footage from his 6-hour video series on filmmaking, A Director Prepares. Click below to learn a thing or two about the craft of directing.
Mackendrick directed films such as The Man in the White Suit, Sweet Smell of Success, and The Ladykillers. After becoming unsatisfied with the studio system, he settled down at CalArts as the dean of the film school, where he taught film theory until his death in 1993.
Despite being a director, the dean of a film school, and a film educator, Mackendrick ironically says:
Film writing and directing cannot be taught, only learned, and each man or woman has to learn it through his or her own system of self-education. One of the dilemmas is that many students -- not all -- feel that there is some secret set of rules to follow, and if you follow them you get it right, and they get angry with you because you won’t give them the rules. Well, there are no rules. There never were and there never will be, because each circumstance is different and each director works entirely differently.
Knowing this, it makes perfect sense why the A Director Prepares project was abandoned by Mackendrick. According to The Sticking Place, he didn't finish the series, because he felt it lacked "coherence as an educational exercise," and the material of which was better learned actively, with a hands-on approach, by students.
But, there are some great things to learn from A Director Prepares, or what was edited together of it anyway. There's a script of the project available here for you to peruse, as well. Check out the video below:
https://www.youtube.com/watch?v=Oo_P727IeZo
If you want to save yourself years of film school, you should consider studying some material from Alexander Mackendrick. Cinephilia and Beyond has made it easy for you by compiling a list of handouts and literature, aggregated from The Sticking Place.
Also, check out his book On Film-making: An Introduction to the Craft of the Director, which has been praised by great directors, screenwriters, and theorists, like Martin Scorsese, David Mamet, and David Bordwell and Kristin Thompson respectively. It's essential reading for those wanting to learn about directing.
What do you think? What burning questions do you have about directing? What are your favorite materials to learn about directing?
Links: |
<filename>hades-quartz/src/main/java/pl/touk/hades/sql/timemonitoring/QuartzRepo.java
package pl.touk.hades.sql.timemonitoring;
import pl.touk.hades.Hades;
public interface QuartzRepo extends Repo {
State getHadesClusterState(MonitorRunLogPrefix curSyncLogPrefix,
Hades hades,
long lowerBound,
long[] measuringDurationMillis)
throws InterruptedException;
void saveHadesClusterState(MonitorRunLogPrefix curRunLogPrefix, Hades hades, State state, long runMethodStartMillis)
throws InterruptedException;
String getSchedulerInstanceHumanReadable();
}
|
Is it possible to evaluate the ecological status of a reservoir using the phytoplankton community? Abstract Aim: The present study aims to evaluate the ecological status of the Broa reservoir through the application of the ecological index Evenness E2 on phytoplankton. Methods Phytoplankton samples from surface were obtained during the dry period (June/2015) in 9 points (P1 to P9), along a longitudinal transect in the reservoir. The qualitative analysis was performed using binocular optical microscope, and the quantitative analysis was performed using the sedimentation chamber method and inverted microscope analysis. The Uniformity Index was calculated on density and richness data. The reference values used in this study were set according to the literature covering 5 classifications (High, Good, Moderate, Low and Bad) for the water quality from Evenness E2 index for phytoplankton, being 1 the maximum value. Results The values observed ranged from 0.1142 in P1 to 0.1468 in P3, being both classified as Bad, since values were less than0.21. Conclusions The result reinforces the sanitary problem of the reservoir, the occurrence of consecutive algae blooms because the amount of nutrients in the region. A massive occurrence of Cyanobacteria was observed, with emphasis on the species Aphanizomenon gracile, which may be related to the adaptive advantages that this class presents on the community in eutrophic environments. Activities in the basin can contribute effectively to the eutrophication process of the reservoir, such as agriculture, sand mining and livestock. The water quality is compromised due to the dense presence of potentially toxic species, reflects of the eutrophication process, pointing commitments for the multiple uses of the reservoir, as well as human and ecosystem health. These processes could be corroborated by the application of the index and indication of poor water quality. |
Systematic Literature Reviews in Kansei Engineering for Product DesignA Comparative Study from 1995 to 2020 Individual products and models on the market must be specifically differentiated from the rest to meet user demand. In terms of consumer purchasing behaviour, consumers increasingly base their decisions on subjective terms or the impression that the product leaves on them, both in terms of functionality, usability, safety, and price adequacy, and regarding the emotions and feelings that it triggers in them. This demand has lead both Asia and Europe to implement new methodologies to develop new products, such as emotional design or Kansei engineering. This paper presents a systematic literature review (SLR) on the most relevant methodologies based on Kansei engineering and their relevant results in the specific discipline of product design, addressing these five questions: (RQ1) How many studies on KE and emotional design are there in the Scopus and Web of Science (WoS) databases from 1995 to February 2021? (RQ2) Which research topics and types of KE are addressed? (RQ3) Who is leading the research on KE and emotional design? (RQ4) What are the benefits and drawbacks of using and applying the methodology? (RQ5) What are the limitations of the current research? We analysed 87 studies focusing on the Kansei methodology used for product design and device technologies (e.g., shape design, actuators, sensors, structure) and aesthetic aspects (e.g., Kansei words selection, the quantification of measured emotions of results, and detected shortcomings), and provided the database with all the collected information. One identified and highlighted sector in the results is the electronictechnological-device sector. Results confirm that this type of methodology has a majority and direct application in these sectors, and they are widely represented in the automotive and electronics industries. Lastly, this SLR provides researchers with a guide for comparative emotional-design work, and facilitates future designers who want to implement emotional design in their work by selecting the specific type according to the results of the SLR. Introduction These days, product design must address areas such as competition, marketing, and processes. Customers increasingly buy on the basis of subjective terms and the impression that they have of a product. In today's market, consumers value the functionality, usability, safety, and price appropriateness of products, and the emotions and feelings that they trigger. In an increasingly competitive market, a good product should meet all consumer expectations, but especially provoke a positive emotional response. Therefore, manufacturers need an instrument to predict how an item is received in the market. This demand has lead both Asia and Europe to pursue a new field of research on the translation of these subjective customer impressions into concrete products. This field is known as "emotional design". The product itself often evokes emotions in consumers with different dimensional and interactive design variables, and this is performed through various methodologies. Affective engineering or Kansei, developed in the early 1970s at Hiroshima University, aims to improve products or services by translating people's feelings or psychological needs into product parameters. It is a methodology within affective engineering. Products can provoke multiple simultaneous emotions in the user, some of which may even be contradictory. This, combined with the personal differences that each designer can bring to the development of their professional activity, makes it necessary to provide guidance on the best typology or the one most used by other professionals with more experience, if this helps to develop the work with a higher guarantee of success. Moreover, there are still many regions in the world where, despite the confirmation that KE is one of the best methodologies for designing products from an emotional viewpoint, there are still difficulties in applying it. "Kansei" refers to a concept in psychology regarding the integration of consumers' different senses (vision, hearing, smell, touch, etc.) and cognition caused by the size, colour, performance, price, and other factors of the product, i.e., product attributes. This can be applied to different areas of design, such as physical product design, web interface design, or services. The basic principles of this method are the identification of product properties and the correlation between these properties and design features. This method has three pivotal points: how to accurately understand the Kansei consumer, how to reflect and translate the understanding of Kansei into product design, and how to create a system and organisation for Kansei-orientated design. Several types of Kansei engineering were identified in various contexts. Nagamachi collected all of the applications of Kansei engineering that he had produced and grouped them according to the used tools and performed task areas. From these groups, he identified what are known as Kansei engineering types. To date, eight types of KE were classified by several researchers [9,. Figure 1 shows the Kansei engineering (KE) framework that Lokman developed to summarise the principles of applying KE. It comprises the eight types of KE classified by various researchers [9,. This list may be expanded at any point in time, as they are constantly evolving. Simon Schtte examined these types of Kansei engineering and developed a general model that covers the most relevant contents. Although emotional design promises results, evidence is needed of where it can be applied, in which areas it offers the best results, which characteristics have the most promising methodologies, and what improvements can be made to the product, always considering how to improve the user experience (UX). Each user interacts particularly with products, and the results of these interactions are captured in the user's emotions and expectations. This user experience can be identified through the emotional responses that the user experiences when using a product, and represents an evolution in users' perception of usability. To the authors' knowledge, there is only one previous study that provides a basic and non-in-depth analysis of emotional-design methodologies, where they have been applied, what improvements they have brought, whether they have been tested, and on what they are based. Therefore, this paper presents an indepth systematic literature review (SLR) with an analysis and discussion of new data on the most relevant methodologies based on emotional design and their proven results in the specific discipline of product design. The availability of this SLR provides researchers with a guide for comparative emotional design work and facilitate future designers who want to implement emotional design in their work. The rest of this paper is structured as follows: Section 2 explains the background to the research; Section 3 presents the methodology for systematically reviewing the state of the art of Kansei engineering research and emotional design; Section 4 examines and analyses the findings, and discusses the significance of the results for the academic and professional world; lastly, Section 5 presents the conclusions of this systematic review. Background Emotional design is a design approach focusing on creating products that offer positive user experiences. The importance of emotions on the human capacity to understand the world and the learning process, including information processing and decision making, is raised. To better understand these processes, a hierarchy of human needs is necessary, which is applied to human factors to propose an order of consumer needs consisting of functionality, usability, and pleasure. In recent years, much progress has been made on the basis of this proposal, and emotions are increasingly important in the field of design and engineering. Thus, new design methods were developed to generate user sensations beyond those derived from the product and its functionality, such as associating certain sensations provoked by competition or associating certain sensations triggered by products with their respective brand, leading to improvement in competition. Therefore, there is a clear link with the user experience concept, of which the main objective is to achieve an affective connection between the product or brand and the user or consumer. An understanding of this strategy must involve analysing emotional design. In this sense, specific authors such as Arhippainen and Thti defined UX as the user's sensations when interacting with a product. Before this statement, Dillon proposed a model that defined UX as a sum of three levels: Action, what the user does; Result, what the user obtains; and Emotion, what the user feels. Much more importance is thus given to the emotions that it provokes in the user. Emotional design can be applied to many areas. The most abundant research works on this topic deal with human-machine interaction (HMI), as the acceptance of the product by the user often depends on generated sensations. Applying emotional design in technological products or household appliances is widespread. In these areas, competition is very high, and purchasing one of these products can be a significant investment for the customer, so the emotion that it triggers can be the reason for the decision. There are also several research papers linking emotional design to areas of healthcare, such as physiotherapy, orthopaedics or elderly care. Emotions can be critical in patients' recovery. There are emotional design methodologies based on Kansei engineering with different adaptations, such as applying the Rasch model or big data, building QFD matrices or making use of aesthetic intelligence and some work reviewing design methodologies in general. However, no review compiles relevant methodologies based on emotional design and compares them. Methodology The research is based on a structured literature review from 1995 to February 2021, grounded in a systematic, method-based, and replicable approach. An SLR searches, assesses, synthesises, and analyses all studies relevant to a specific research field. According to Tranfield, an SLR is characterised as a scientific and transparent process that minimises bias through comprehensive literature searches and by providing an audit trail of the reviewer's procedures. There are different studies on how to perform an SLR in different fields, such as Kitchenham in software engineering, Tranfield and Nightingale in health, and vom Brocke et al. in Industry 4.0. An SLR was conducted to evaluate current methodologies based on emotional design and identify the principal methodologies that apply Kansei engineering to a product. In this paper, the SLR approach suggested by B. Kitchenham and Charters is applied. Besides achieving the above objectives, the SLR verifies success stories in product applications. An SLR is a type of scientific research that objectively and systematically integrates the results of empirical studies on a given research problem. On the basis of our baseline study, five consecutive steps are defined as follows: 1. Define research questions. The main objective of this SLR summarises methodologies based on emotional design applied to products, identifying the amount and type of research, and the available research results. On the basis of specific research questions, the aim was to arrive at the documents that best suited the purpose of this study. 2. Conduct a literature search. Primary studies are identified by using search strings in scientific databases. An excellent way to create a search string is to structure it around collection, intervention, comparison, and result. Structures are based on the research questions. 3. Selection of studies. Inclusion and exclusion criteria are used to exclude studies that are not relevant to answer the research questions. For example, while some papers applied an emotional design methodology to a product, they exclusively focused on physical parameters such as product measurements. A systematic three-stage process was followed for this selection: The title, abstract, and keywords of each document were analysed to decide whether to discard them or not according to the inclusion and exclusion criteria, which are defined in more detail in Section 3.3. The same elements of each document were evaluated to classify them according to the defined questions in this text. (c) All selected papers were carefully analysed to refine the assessment. 4. Quality assurance. The journals of the selected studies were verified to see whether they were indexed in the Journal Citation Report and in which quartile, and in other rankings such as SCImago Journal Rank and Scopus. 5. Data extraction and management. After analysing the selected documents, each article's common and differential characteristics were extracted and assessed in a table. Each of the SLR steps was then applied to the research question being addressed. Research Questions Although the general objective of this study could be summarised in the analysis of the most relevant methodologies based on emotional design applied to a product case, this objective is explained in five specific research questions to gain a more detailed understanding of the topic, as follows. The primary purpose of these research questions is to analyse the number of studies on emotional design and KE methodologies in a specific period. The secondary aim is to recognise the strengths and limitations of applying these methodologies in this field of research. To address RQ1, an extensive time period must be identified to help interpret how the application of the methodologies has evolved. Regarding RQ2, the specific topics, typologies, and key aspects that differentiate them were considered. In RQ3, individual researchers and the origin of their research that can be correlated with the application sector were identified. Regarding RQ4, the importance for this study of papers with practical conclusions and a direct application in developing the research itself are highlighted, as they contribute towards identifying the success of the selected typology in terms of the product. Lastly, regarding RQ5, we visualise the possible individual disadvantages of each KE typology in its application, comparing it with the developed or analysed product. To answer these questions, the authors searched electronic database platforms SCO-PUS and WoS-the largest citation databases of the peer-reviewed literature-from their inception until February 2021. These libraries have a broad coverage of publications in science and technology, engineering, and computer science, and index several publication catalogues (including the MDPI, IEEE, ACM, Springer, and Elsevier libraries). Data Sources and Search Strategy The search strategy was developed on the basis of the research questions and considering the keywords for each, including synonyms, to refine the search. The search string is shown below: The selected search engine was the Scopus database. Publications appearing in this library had undergone a peer-review process and were of acceptable quality. The selected journals and conferences are shown in Table 1. 1. The included studies must meet the following conditions: be studies with a design methodology or process based on KE and apply it to a product, test, or prototype. 2. The articles to be excluded must meet at least one of the following conditions: These selection criteria were dictated by the research questions described in Section 3.1 above. These issues define the main dimensions that need to be considered to implement and deploy a valid solution in the environment described above. The search string resulted in 109 publications. The full text of 87 publications was assessed for eligibility. The identification, screening, and eligibility checking of the studies were performed by the same author (i.e., Clara Murillo). As explained, a systematic three-stage process was followed for this selection: 1. Phase 1. Only the title, abstract, and keywords of each paper were analysed to establish whether to discard them or not according to the inclusion and exclusion criteria. The number of results in the search string was 109 documents. 2. Phase 2. The same elements of each document were assessed to classify them according to the issues defined in this document. After this second assessment, 22 papers were excluded, as they had met one of the exclusion requirements, namely, they were not accessible at the time of reading, were not indexed according to the requirements mentioned in this SLR, or were not available in English. 3. Phase 3. All papers were carefully analysed to refine the assessment. The total number of carefully reviewed documents was 87. Figure 2 shows the flow diagram that was used to organise the SLR. Quality Assurance To assess the quality of the obtained results, the journals to which the studies belonged were analysed to see whether they were indexed in the Journal Citation Report (JCR), SJR, and Scopus. Table 2 shows an outline with the name of the journals, whether or not they were indexed in the JCR, SJR and Scopus, in which quartile, and the impact factor, all in the category of industrial engineering. Quality Assessment The SCOPUS and WoS electronic database platforms were used to assess each SLR. The used quality criteria were based on five quality assessment questions (QAQs): QAQ1. Do they offer keywords to assess the emotions that the product triggers in the customer? QAQ2. Does the process incorporate the use of technology and/or artificial intelligence to automate it? QAQ3. Were quantitative scales identified for assessment? QAQ4. Have emotions been considered in product development? QAQ5. Is there a direct application of the methodology to test the obtained results? The evaluation system was as follows. Data Extraction and Management All selected papers were analysed for this research. This document focuses only on explaining the extracted results to facilitate their understanding (see Table 3). Development of a design support system for office chairs using 3-D graphics International Journal of Industrial Ergonomics ------ Results and Discussion In searching the highest study, quality we ensured that as many of the analysed articles as possible were indexed and had the highest possible impact index. In this case, we obtained a percentage of over 60% (Figure 3) in the articles analysed and indexed in JCR, and higher in the SCOPUS and SJR databases (Figures 4 and 5). The set of analysed papers in this study yielded a large amount of data that could be interpreted on many fronts, yielding interesting conclusions from the viewpoint of the typology of KE, the evolution over time, or the importance of carrying out a final phase of application on the product of the obtained data in the first stages of analysis. Coincidences and similarities or differences between the articles that obtain a high or maximal score according to our scoring system, explained below, are defined through quality assessment questions (QAQs). These QAQs were also weighted according to the importance proposed by the authors themselves (Table 4). Of the 109 articles obtained from the initial search, 22 were discarded as they were not available for reading and analysis, leaving 87 articles for study and analysis. These were scored in these ranges (Table 5). The papers that obtained a score equal to or higher than 0.75 out of 1.00, and those that obtained the maximal score of 1.00, were highlighted. In total, 57 articles (66%) were within this range, and 16 articles (18%) achieved the maximal score. Two of the five quality assessment questions were highlighted by weighting over the total, namely, QAQ4, which highlights the differentiation between emotions and product categories as positive; and QAQ2, which incorporates technology in the analysis of the results. QAQ2 and QAQ4 reveal that, although there are many adjectives at the beginning of the methodology (QAQ1), the differentiation of these emotions and product categories (QAQ4) and applying technology for the analysis of the results (QAQ2) are necessary to effectively and efficiently develop the process. QAQ5 was positive in each paper that obtained the maximal score. This allowed for us to interpret that the KE methodology substantially improves if the process directly ends by applying the methodology on the product to improve or carry out the necessary redesign. Moreover, there is a clear trend towards the KE typology used in the papers that yielded the highest scores, as seen in Tables 6 and 7 Figure 6. Incidence of KE typology on articles that obtained a score of P = 1. Figure 7. Incidence of KE typology on articles that obtained a score of P = 0.75 to P = 1.00. If this analysis is extended to all viewed papers, it shows which methodology the authors prefer (see Figure 8). Although with less incidence, it coincides with the predominant typology in the papers classified with a high score, Type III with 24% and Type VIII with 19%. Lastly, covered products by each analysed paper were classified into product categories. Figure 9 shows that the areas where KE is most applied are electronics and technology products, and construction and furniture, both urban and household. After knowing the most relevant product categories that apply Kansei engineering, the most widely used type of KE was analysed. Figure 10 shows that KE modelling is mostly applied to technological and electronic products. For products related to construction and household products, the most applied typology is rough set, although KE modelling also occupies a high percentage in the type of used KE (Figure 11). Conclusions Given these results, according to the analysed papers in this study, the KE modelling or rough-set typology is preferential. Neither methodology is restrictive in terms of the type of analysed product. After analysing the product categories that appear in the analysed works, it is concluded that KE is most frequently applied in technology and electronics products such as smart devices (29%) or household appliances and products related to construction and furniture (29%). Again, KE modelling (22%) and Rough Set (26%) appear as the preferred when applying KE. We can conclude that it would be a guarantee of success to use the above mentioned KE typologies when the project is developed in or for technology sectors, home electronics and furniture, and building products. If we deepen the analysis considering the analysed time horizon, from 1997 to 2021, there is a certain tendency towards the generalised use of these two typologies that gave us such satisfactory results in our analysis of the articles that had obtained high scores ( Figure 12). Specifically, KE Modelling is the one most used by the authors in the first years of our study, giving way to the absolute dominance of the Rough Set methodology from 2013 onwards. As developed by M. Nagamachi in his paper "Kansei Engineering and Rough Sets Model", it is essential to choose how to measure KE, considering there are emotions that are not linear in their growth and, therefore, it would not be correct to apply the normal distribution with linear growth. The Rough Set methodology solves this incidence by analysing nonlinear or ambiguous data by searching for upper and lower approximations. We conclude that it is critical for users of these methodologies to understand from the outset the benefits of incorporating them into their work processes, which would enable them to readily select the typology that best suits them for their product development depending on the sectors they are in. These types of methodologies are complex to apply and require guidelines or aids for their proper application. According to Reiser, instructional designers often use systematic instructional design procedures and employ various instructional media or technology to accomplish their goals. Incorporating KE methodologies or typologies into the design in the early stages of learning highlights the designer's need for guidance or experience or systematic literature reviews to help emphasise the role of emotions for better results. The design sector incorporates an increasing number of technological aspects (products packed with sensors, devices, electronic components and circuits, etc.). One of the identified and highlighted sectors in the results was the electronic-technological-device sector, which confirmed that this type of methodology has a majority and direct application in these sectors, and is widely represented in the automotive and electronics industry, besides many others. In this sense, there are countless applications integrating sensors and communication technologies where they are increasingly used, including robotics, domotics, testing and measurement, do-it-yourself (DIY) projects, Internet of Things (IoT) devices in the home or workplace, science, technology, engineering, education, and the academic world for science, technology, engineering, and mathematics (STEM) skills. This paper supports design professionals in defining the elements and components of these products, helping to establish a direct correspondence between the users' emotional response and the component. Relevant techniques were used to analyse the methodology based on, for example, multivariate analysis and artificial intelligence. Research Limitations This research has its limitations. The next step is to specify and analyse other, more specific conditioning factors. This study focused on five quality issues presented by the authors. However, other considerations were left out, such as product attributes and characteristics or other differential and significant aspects and determinants when designing products, such as price, customer purchasing power, or environmental sustainability. The authors understand the need for further research into the different KE methodologies and their direct application to the specific expressed conditioning factors, so they can also be compared with the analytical tools used by the KE typologies themselves. |
The periodontal status of removable appliances vs fixed appliances Abstract Background: Although several researchers have analyzed the dental identity of patients experience with corrective methods using fixed and removable appliances, the consequences stay debatable. This meta-analysis intended to verify whether the periodontal status of removable appliances is similar to that of the conventional fixed appliances. Methods: Relevant literature was retrieved from the database of Cochrane library, PubMed, EMBASE, and CNKI until December 2019, without time or language restrictions. Comparative clinical studies assessing periodontal conditions between removable appliances and fixed appliances were included for analysis. The data was analyzed using the Stata 12.0 software. Results: A total of 13 articles involving 598 subjects were selected for this meta-analysis. We found that the plaque index (PLI) identity of the removable appliances group was significantly lower compared to the fixed appliances group at 3 months (OR=−0.57, 95% CI: −0.98 to −0.16, P=.006) and 6 months (OR=−1.10, 95% CI: −1.60 to −0.61, P=.000). The gingival index (GI) of the removable appliances group was lower at 6 months (OR=−1.14, 95% CI: −1.95 to −0.34, P=.005), but the difference was not statistically significant at 3 months (OR=−0.20, 95% CI: −0.50 to 0.10, P=.185) when compared with that of the fixed appliances group. The sulcus probing depth (SPD) of the removable appliances group was lower compared to the fixed appliances group at 3 months (OR=−0.26, 95% CI: −0.52 to −0.01, P=.047) and 6 months (OR=−0.42, 95% CI: −0.83 to −0.01, P=.045). The shape of the funnel plot was symmetrical, indicating no obvious publication bias in the Begg test (P=.174); the Egger test also indicated no obvious publication bias (P=.1). Conclusion: Our meta-analysis demonstrated that malocclusion patients treated with the removable appliances demonstrated a better periodontal status as compared with those treated with fixed orthodontic appliances. However, the analyses of more numbers of clinical trials are warranted to confirm this conclusion. Introduction In the present age, the advancements in the design and manufacturing of dental motion materials using computer has encouraged the demand for optimized requirements in orthodontic treatment technology. In 1946, Kesling first proposed the concept of moving orthodontic appliances to move misplaced teeth. However, in the last decade, the concentrated cell method has also been a preferred treatment as it covers a range of malocclusion types. However, several researchers have successfully demonstrated how the present appliances can correct and treat almost all diseases, ranging from mild to severe malocclusion, with better periodontal status. Despite the known effectiveness of conventional methods practiced across the world, the shortcomings associated with these methods cannot be overlooked. For instance, the conventional methods in dentistry are inconvenient and even painful, often posing difficulty in cleaning. Patients are required to be cautious with the stent and are required to regularly clean the plaque collected around the wire to improve the oxidation-reduction potential. Previous studies have reported that the use of fixed orthotics can stimulate the growth of subgingival plaques, which trigger adverse reactions and increase the discomfort of patients. Therefore, the use of an alternate removable orthodontic device is expected to facilitate convenience and better healing for patients requiring urgent interventions. In the recent years, a large number of studies have been reported on times health identity of patients treated with concentrating and removable appliances. However, the inference derived from these papers remains controversial. Therefore, clinicians can only rely on their clinical experience and the low-quality evidence reported in the literature when formulating treatment plans. Accordingly, considering the situation, we hypothesized that the periodontal status of patients treated with removable appliance was better than that of patients treated with fixed appliances, and employed a meta-analysis to confirm our hypothesis. Search strategy For this meta-analysis, articles were sourced from the databases of EMBASE, Cochrane library, Medline, PubMed, CNKI, and Wanfang without time or language restrictions. All relevant studies published through to December 2019 were included. In addition, we conducted manual retrieval in the research process, mainly using the research results in the references. Relevant studies were identified using the following key terms: "removable aligners", "removable thermoplastic aligners", "clear appliances", "invisalign", "periodontal index", "periodontics", and "periodontium". Because this analyses was based on previously published studies, so there was no require for ethical approval and patient consent. Inclusion criteria This review included prospective cohort studies or randomized controlled trials (RCTs) that compared the periodontal status in patients treated with fixed appliances versus removable appliances. The subjects were patients diagnosed with malocclusion and who received orthodontic treatment for the same, who showed good oral health, no obvious periodontal disease, no systemic disease, no long-term history of taking antibiotics, among others. We focused on removable or fixed orthopedic appliances as the means of intervention. Exclusion criteria Case reports, review articles, and animal studies were excluded. Moreover, original articles whose reference literature could not be used after contact with the author were excluded. Observation index Plaque index (PLI), gingival index (GI), and the sulcus probing depth (SPD) were recorded in this study. The outcomes for the PLI, GI, and SPD at 3 and 6 months were assessed in this meta-analysis. Data collection and analysis Two investigators formed the data research object. In case of a conflict between the reports of the 2 investigators, further inspection of the measurements was made until finalization of the results. In case no agreement could be reached, a professional scholar was invited to resolve the issue. The data extracted from the references included the following: publication date, author name, country of the study, method of treatment, number of 2 methods, age, gender, patient recruitment time, the measurement period, and result measurements of different literatures. Quality assessments The quality of all research was assessed with reference to the Newcastle-Ottawa Scale (NOS). The research evaluation criteria were mainly divided into 3 aspects: measurement results, comparability, and queue selectivity. These aspects were further categorized into the number of stars, in a descending order, with grade A = 7-10 stars, grade B = 4-6 stars, and grade C = <3 stars. During this process, in case of a conflict, negotiation was made to resolve the dispute. As per the description given in Table 1, all references in the meta-analysis belonged to grade A. Therefore, it can be concluded that this study involved the analysis of high-quality literature. Statistical analysis The data from the individual studies were pooled and analyzed using the Stata 12.0 software (Stata Corporation, College Station, Texas). I 2 test and Chi-Squared-based test were applied to analyze the heterogeneity among the included articles. The range of heterogeneity was as follows: extreme = 75% to 100%; large = 50% to 75%; moderate = 25% to 50%; and low = < 25%. The fixed-effects model was generally used to evaluate the research content because I 2 was <50%. A random effect model was used whenever the value was >50%. After obtaining the results of combined odds ratio (OR) and 95% confidence interval (CI), the Z test was employed for data analysis, with P <.05 considered as statistically significant. Any publication bias was assessed by using the Begg test and the Egger test. Sensitivity analysis was applied to analyze large heterogeneity studies and to find the source of heterogeneity. Characteristics of studies According to the above-mentioned retrieval methods, 192 relevant studies were selected for the analysis. After skimming the titles, abstracts, and reviewing the full-text content, 179 studies were excluded due to the lack of available data or the non-RCT nature of the study, among other reasons. Finally, 13 studies involving 598 patients met the inclusion criteria. Among which, 297 patients were treated with removable appliances and 301 patients with fixed appliances. The flow diagram of the study selection procedure is presented in Fig. 1. The basic information of each included literature is shown in Table 2. The status of GI A total of 4 studies evaluated the GI of 2 appliances after 3 months of treatment, and 8 studies evaluated the GI of 2 appliances after 6 months of treatment. The results of heterogeneity test were as follows: P GI3 =.783, I 2 =.0% and P GI6 =.000, I 2 = 91.8%, respectively. These results demonstrated no statistical significance in GI between the removable and fixed appliances groups at 3 months (OR = 0.20, 95% CI: 0.50 to 0.10, P =.185). However, patients treated with removable appliances showed significantly lower GI status at 6 months (random effects model OR = 1.14, 95% CI: 1.95 to 0.34, P =.005), as shown in Figs. 4 and 5. The status of SPD Six researches evaluated the SPD of 2 appliances after 3 months of treatment, and 8 researches evaluated the SPD of 2 appliances Sensitivity analysis The sensitivity analysis was conducted after removing each of the included articles one by one. However, the results demonstrated no significant change in the results of the combined effect, which implied that the result of the meta-analysis was stable. Publication bias Begg test and Egger test were conducted to assess the publication bias (Fig. 8). Symmetry of the funnel plots implied no obvious publication bias (P =.174), and the results of Egger test also demonstrated no publication bias (P =.1). Discussion The removable appliances appeared as creative orthopedic appliances in the late 1990 s. The conventional orthodontic appliances were based on brackets and wires for orthodontic tooth movements. These are aesthetically pleasing, comfortable, simple, predictable, and portable devices. Because of the influence about times disease, Ristic et al put forward the GI cell slowly upgrade at 4 weeks and 3 months when taking the concentrate tool, then reached its peak at 6 months. Meanwhile, some scholars have demonstrated the the progress of gravity could reach its highest value after 5 to 6 months of use. From now on, gravity is regularly remained in the rank during the treatment period. Therefore, we partly researched the times situation in the first 6 months. Our results revealed that the GI, PLI, and SPD indexes were significantly reduced with removable orthotic devices as compared with that with conventional fixed orthotic devices (P <.05). These statistics thus signify that removable appliances are more beneficial for a healthy periodontal status. The probable reasons supporting the superiority of removable appliances are as follows: patients with removable appliances can take the appliance out of their mouth and clean it. In addition, patients can remove the appliance at the time of cleaning their teeth, which is convenient. A removable appliance helps in better flossing and hence in maintaining better oral hygiene. Removable appliances covering most of the crown area can control the force exerted on that area. Removable appliances help make the teeth www.md-journal.com move closer as an overall movement while preventing the destruction of the periodontal tissues due to the migration of the supragingival plaque to the subgingival tissues. Several studies have evaluated the influences of orthodontic appliances on the periodontal health. For instance, Miethke and Vogt reported that, at the baseline level and at 3 distinguishing development time steps, patients arranged with fixed appliances were at significantly greater PLI risks than those arranged with removable appliances. However, they discovered no statistically significant difference in the SPD between the groups of patients treated with fixed appliances versus those fixed with removable appliances. Abbate et al performed a similar initial orthodontic treatment on 50 adolescents aged 10 to 18 years and found that the adolescents wearing removable appliances had a higher periodontal status than adults using fixed appliances after the same treatment course. However, Alstad and Zachrisson found no significant difference in the PLI or GI between these 2 treatment approaches. Despite the extensive use of fixed and removable appliances, there seems to be a lack of evidence supporting any specific appliance as being more beneficial for the periodontal health. Bollen et al and Van et al reviewed the literature and inferred that orthodontic measurement by itself does not upgrade the risk of periodontal pathologies. However, several studies have reported that the choice of oral hygiene procedures have a profound effect on the periodontal health of orthodontic patients. Notably, as per a recent observation, morbidity due to periodontitis increases with the age of the patient. Many adult patients realize the importance of dental health and begin to apply orthodontic treatment for straightening their teeth. Orthodontic therapy may often lead to periodontal diseases, because the use of orthodontic appliances during the treatment may affect the oral hygiene procedures and lead to the accumulation of microbes in the mouth. However, some researchers argue that periodontal diseases are only partially related to orthodontic treatment. They state that orthodontic appliances can interfere with oral hygiene procedures to produce bacteria and induce their proliferation. [26, Some clinical and experimental trials have demonstrated that, despite maintaining good oral hygiene in patients, the use of orthodontic appliances can cause inflammation and lead to periodontal damage if the inflammation is not completely controlled, and that the attachment disappears with the accelerated development of periodontal damage. Several previous studies have reported that fixed orthodontics serve as a greenhouse for plaque to build, which can lead to the development of inflammatory manifestations, such as gingival swelling or bleeding. Currently, several studies have compared different orthodontic appliances with removable appliances and found the performance of removable appliances much superior. This is because removable appliances have been found to contribute significantly in building up oral hygiene by inhibiting the accumulation of dental plaque. In terms of clinical presentation, the therapy of removable appliances is more secure for periodontium when compared with the therapy of fixed appliances. Notably, removable appliances can help maintain the oral hygiene and thereby reduce the amount of plaque retentive surfaces. Considering these points, it can be concluded that removable appliances are a great orthodontic treatment appliance for patients with poor periodontal health. However, some scholars believe that because patients must wore removable appliances for more than 20 hours a day, if patients failed to clean their mouth in time, food residue may stay in the gap between appliances and gingival mucosa, and prevent the self-cleaning of saliva in the patient's mouth. And because the appliance is an integrated appliance, covering the gingiva in a large area may caused gingival compression and injury, or some patients may not mastered the correct method to remove and wear the appliance during the correction period which may leaded to injury to the gingival tissue too. Therefore, they believe that the removable appliances is more harmful to the periodontal health of patients than the fixed appliances. Thus, strong evidence is still needed to support our hypothesis. This meta-analysis has some limitations. First, the available research data were limited to those from China, Germany, and Italy only, and hence the conclusion may not be applicable to other countries. Second, without analyzing a large number of studies, it is difficult to conduct a comprehensive and detailed study, and some studies with a small sample size could not provide sufficient statistical power to identify the actual association. Third, the index measurements of the position and the quantity of teeth were coincidental. Some study assessed the full mouth teeth, while others measured only certain teeth, which may have resulted in a bias during the implementation. Moreover, the types of malocclusion included were not corresponding, which may have enhanced the presence of confounding factors. Conclusion This meta-analysis demonstrated that the periodontal status of patients treated with removable appliance was much superior to that with the conventional fixed appliances. Owing to the limitation in terms of both quality and quantity of the involved studies, we suggest that the inference of this review be verified further using more number of RCTs. |
# Remove nodes on root to leaf paths of length < K
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def remove_path_less_than(root, k):
return remove_path_util(root, 1, k)
def remove_path_util(root, level, k):
if root is None:
return None
root.left = remove_path_util(root.left, level+1, k)
root.right = remove_path_util(root.right, level+1, k)
if root.left is None and root.right is None and level < k:
del root
return None
return root
def in_order(root):
if root is None:
return
in_order(root.left)
print(root.data, end=' ')
in_order(root.right)
if __name__ == '__main__':
root = Node(1)
root.left = Node(2)
root.right = Node(3)
root.left.left = Node(4)
root.left.right = Node(5)
root.left.left.left = Node(7)
root.right.right = Node(6)
root.right.right.left = Node(8)
in_order(root)
print()
root = remove_path_less_than(root, 4)
in_order(root)
|
Maverick’s plans to offer a Southern take on barbecue, though not one exclusively devoted to the pepper and vinegar traditions of North Carolina.
There will be smoked pork and ribs, beef brisket, chicken, turkey, sausage and fish, with plans to pay homage to local barbecue styles with stops in Memphis and Texas along the way. The menu also will include fried chicken, collards, fried okra and macaroni and cheese and, in what may be a first for the Triangle, Memphis barbecue spaghetti.
Though the name and concept are completely different from Alivia’s, Maverick’s will still have an outdoor patio, with views of Main and Gregson streets.
The Maverick’s name already is painted on the restaurant in large white letters over red brick, though brown paper remains on the windows. Recruiting has begun for front- and back-of-the-house employees on the restaurant’s Facebook page. |
Great Teaching: Undergraduate Agricultural Economics Millennial Students The first title I thought about for this article was applying Collins' book to our profession, something like "Good to Great, How Agricultural Economics Departments Can Make the Leap." I think all of us have read that book and most of our students have. Jim Collins set the standard for what makes companies great and we have several authors attempting to set the standards for great agricultural economics departments in a transition time. Or Possibly, Collins's 2009 book How the Mighty Fall: and Why Some Companies Never Give In could be applied to agricultural economics departments attempting to achieve and sustain greatness. What many people do not know is that, driven by a relentless curiosity, Jim Collins was awarded the Distinguished Teaching award in 1992 from the Stanford Graduate School of Business. Subsequently I thought of Bob Dylan's song, "The Times They Are a Changin" and wondered if "Agricultural Economics Students They Are a Changing" would serve well. However, then I knew someone would remind me that was 1964 (at least some of you who still remember that far back). In fact, the words in Dylan's first verse, "then you better start swimming or you'll sink like a stone, for the times they are a changin," might set the tone for |
<reponame>lyu4321/Atari-Space-Invaders<gh_stars>0
def collide(obj1, obj2):
# obj1 and obj2 coordinates refer to the middle point of the mask, so we have to compute
# the coordinates of the upper-left corner of the sprite
x_offset = (obj2.x - obj2.get_width()/2) - (obj1.x - obj1.get_width()/2)
y_offset = (obj2.y - obj2.get_height()/2) - (obj1.y - obj1.get_height()/2)
return obj1.mask.overlap(obj2.mask, (x_offset, y_offset)) != None |
The Impact of Organizational Identity and Professional Norm Salience on Internal Auditors Assessments of Internal Control Weaknesses We examine whether internal auditors with a strong organizational identity, defined as a perceived close relationship between the individual and their employer, provide overly lenient assessments of identified internal control weaknesses as compared to internal auditors whose organizational identity is weak and as compared to a control group of external auditors. We also examine whether increasing the salience of professional norms, that is, increasing the prominence in the internal auditors judgment process of information about the expectations of the professional group to which they belong, reduces bias in the internal auditors assessment of internal control weaknesses when their organizational identity is strong and whether external auditors who are aware that the internal auditor is adhering to the norms of their professional organization are more willing to rely on the internal auditors work. Results indicate that internal auditors with strong organizational identity provide internal control assessments that are less severe than internal auditors whose organizational identity is low, but when professional norms are made salient, internal auditors with strong organizational identity provide the most severe ratings. In addition, we find that external auditors who are aware the internal auditor adheres to professional norms are more willing to rely on the internal auditors control assessments. Implications of our results for the debate about the benefits and costs of in-house versus out-sourced internal auditors are discussed. |
The Semantic Enterprise: Are Semantics the Future of Mashups?
And perhaps not coincidentally, there was a note in TechCrunch around the same time about Yahoo’s foray into semantics: ‘Yahoo talked about their plans to allow third parties to alter and enhance search results with structured data that may be useful to users’. These comments really stood out in my mashup-centric mind. This all sounds very similar to the everyday definition of a mashup!
Semantics and mashups have the same goal of connect-the-data-dots but have very different ways of going about this complex task. And its in the devilsh details that I have seen enterprise technologists find semantics more problematic than Berners-Lee or the folks at Yahoo. Why? Because ‘Semantic Web’ isn’t the same as ‘Semantic Enterprise’. And there's the trap.
I have been enthralled by semantics since the now-distant point in my career where I was responsible for a semantic information integration product. I even had an ex-DARPA PhD on contract to try and help me wrap my head around the not-too-simple subject. And based my experiences I must say that even I can see a myriad of potholes on the road to the Semantic Enterprise. So forgive me if I appear to be putting my foot on the semantic brakes but the pragmatic voice in the back of my head just won’t be quiet. I hate to sound like such a hater on such a great concept. I just have concerns.
Of course, even if the fundamental concepts were understood by your every-day enterprise technologist, there’s the state of the semantic technology to consider. In a lab, it is simply amazing to see the power and value of a semantic network. I am sure the folks at Yahoo would agree. In practice, however, it is simply amazing to see how hard they are to create, how complicated they can be to maintain, and how sluggish generally slow they can be in production. I heard one industry pundit remark recently that his efforts at creating semantic ontologies universally led to shouting matches and no unusable results.
Final, there's the practical differences between public, SaaS-type of world Yahoo lives in and the behind-the-firewall world of the enterprise. Practically speaking, there aren’t many Yahoo-caliber solutions available for use inside the enterprise. The best (only?) is perhaps Oracle with its early-stage semantic technologies, with a few niche vendors sprinkled in (like the list of exhibitors at the Semantic Technology Conference.) And while I expect some of these vendors might disagree, it is near impossible to find enterprise-grade semantic solutions that show scale, show adaptability and don’t require a PhD to maintain. They all still have that ‘only for the extreme early adopter’ feel.
Last, I think (actually, I know) one of the biggest potholes on the road to the Semantic Enterprise will be the enterprises themselves. Bringing semantics to the Web, a set of reasonably similar collections of knowledge that are 10-years-old at most, can be imagined through a combination of machines and community efforts (albeit a community the size of Yahoo’s). But inside the typical enterprise you have 35+ years of information and information technologies to get ‘semanticized’ and, SOA efforts not withstanding, it is siloed, often undocumented, and about as disparate in format as you could possibly imagine. And unlike Yahoo, you don’t have armies of semantic-tagging volunteers.
Sure, these issues will be worked through. But it will be a while. In a past post I asked ‘…what does an organization's [information-hungry users] do while it’s waiting for [it’s] SOA effort to reach critical mass...?’. I think the same question applies here. So here’s an attempt at a positive conclusion: Mashups can be the gap-filler between today and the Semantic Enterprise. The results can be just as powerful and, more importantly, mashups are something your enterprise could begin today. Once semantics get their enterprise-kinks worked out, they'll make a valuable source of information for enterprise mashers.
Are semantics the future of information? Of course they are. But when will they fit the world of the enterprise? 2 years? 5? 10? More? Well, that’s the real question, isn’t it? I suggest you mash while you wait. |
Plus: The case against cheeseburgers.
A worker walks next to a Boeing 737 MAX 8 airplane parked at Boeing Field on March 14 in Seattle.
It’s time for America to reconsider animal rights—including the right not to be killed and eaten. Although many still sneer at vegans, leftists are beginning to see how the consumption of animals is intertwined with their dearest causes. For one, “the U.S. meat industry is one of the largest sources of water contamination in the country, and a massive contributor to drought in the West.” It comprises 20 percent of greenhouse-gas emissions worldwide. For another, the industry is unfriendly to labor. “Slaughterhouse workers—mainly immigrants and resettled refugees—often face lifelong injuries from their jobs, and likewise are denied the sort of disposable income necessary to treat them.” Americans could begin to address problems like these in one simple way: by "eating much less meat."
Urban elites should be respectful of the social and economic challenges—and the diversity—of the country’s rural areas. |
The role of crosslinking in modification of the immune response elicited against xenogenic vascular acellular matrices. We have used detergent and enzymatic extraction of natural arteries to produce an acellular matrix vascular prosthesis (AMVP). Implanted as an allograft in a canine model, this AMVP shows excellent handling characteristics, low thromboreactivity, no evidence of aneurysm, and exceptional graft patency in the peripheral vasculature. As a first step in the development of xenograft AMVPs, we processed caprine carotid arteries to AMVP and implanted them as femoral interposition grafts in dogs. Explanted xenografts at 4 weeks showed multifocal mixed inflammatory infiltrates and focal destruction of the medial elastin in the inflammatory foci. To further study the immune response to xenogenic AMVP, we implanted canine-derived AMVPs and fresh canine arteries for 4 weeks in a Lewis rat model. Extraction to AMVP markedly reduced the circulating antibody response to the xenogenic implants; however, histological analysis revealed that both xenograft arteries and AMVPs produced a marked immune response with penetration of mononuclear cells into the media and adventitia. To modify the immune response, we applied three crosslinking techniques to the canine AMVPs: glutaraldehyde, polyglycidyl ether, and carbodiimide. All crosslinkers significantly reduced degradation and cellular infiltration of the prostheses. However, crosslinking neither eliminated the chronic inflammatory response surrounding the implants nor reduced the humoral response to the xenogenic materials. |
Head coach Gabriele Cioffi will be at Lincoln City today but purely as an observer.
And he hopes to observe 'a big heart' from the Crawley Town players and also see them bring back a point.
When asked at his first press conference what he wants to see at Lincoln, he said: "Effort, hard work. I can’t ask them anything else because I didn’t coach them.
"I would like to see what I saw in the last game. A big heart and to bring back a point."
"Then tactics and other stuff we start to talk about from Monday."
Cioffi's first gaame in charge will be on Saturday September 15 against Morecambe at the Broadfield Stadium. |
<reponame>Brunner-Kibali/test-python-52<filename>m05_flask/netapi.py
import json
from flask import Flask, request
from m02_files.l_00_inventory import get_inventory
import napalm
app = Flask(__name__)
@app.route("/inventory")
def inventory():
return json.dumps(get_inventory())
@app.route("/interface_counters")
def interface_counters():
device_name = request.args.get("device")
device_type = request.args.get("type")
port = request.args.get("port")
username = request.args.get("username")
password = request.args.get("password")
result, data = get_intf_counters(
device_name=device_name,
device_type=device_type,
credentials={"username": username, "password": password},
port=int(port),
)
if result != "success":
return data, 406
else:
return data, 200
@app.route("/device_status")
def device_status():
return "Hello, Device Status!"
def get_intf_counters(device_name, device_type, port, credentials):
if device_type == "csr":
driver = napalm.get_network_driver("ios")
else:
return "error", "getting counters supported only for CSR devices"
device = driver(
hostname=device_name,
username=credentials["username"],
password=credentials["password"],
optional_args={"port": port},
)
device.open()
counters = device.get_interfaces_counters()
return "success", json.dumps(counters)
if __name__ == "__main__":
app.run()
|
Recent progress of anion-based 2D perovskites with different halide substitutions Low-dimensional perovskites have been regarded as the heir of traditional perovskites because of their tailorable structures and the resultant optoelectronic properties as well as the higher stability under ambient conditions, giving them better potential in optoelectronic devices with long term stability. To date, most 2D perovskites are constructed from large organic cations as a spacer, sandwiched between the inorganic octahedron layers to form layered structures. Other than A-site constituent engineering, in recent years, it was reported that the perovskite layers can be divided by suitable X-site components, increasing the possibility of many different 2D perovskite structures and possibly leading to a bright future. In this review, we first digest the latest developments in low dimensional perovskites, including the different phases and the unique optoelectronic properties of 2D perovskites. Subsequently, different approaches to constructing 2D perovskites will be discussed in detail, involving the traditional way of altering A-site cations and the latest way of varying X-site anions. The basic principle of partioning 2D perovskite layers from the X-site constituents will be particularly focused on. The review is aimed at providing readers with an innovative viewpoint for fashioning 2D perovskites and possible future research directions for next generation 2D perovskites. Finally, a conclusion and outlook for future prospects in 2D perovskite structures will also be delivered. |
<filename>gtastate.h
#pragma once
#include <memory>
#include <unordered_map>
#include "json.h"
#include "util.h"
#ifndef _WINDEF_
struct HINSTANCE__; // Forward or never
typedef HINSTANCE__* HINSTANCE;
typedef HINSTANCE HMODULE;
#endif
void initGTA5State(HMODULE hInstance);
void releaseGTA5State(HMODULE hInstance);
struct GameInfo {
int time_since_player_hit_vehicle;
int time_since_player_hit_ped;
int time_since_player_drove_on_pavement;
int time_since_player_drove_against_traffic;
int dead;
Vec3f position, forward_vector;
float heading;
int on_foot, in_vehicle, on_bike, money;
};
TOJSON(GameInfo, time_since_player_hit_vehicle, time_since_player_hit_ped, time_since_player_drove_on_pavement, time_since_player_drove_against_traffic, dead, position, forward_vector, heading, on_foot, in_vehicle, on_bike, money)
// N_OBJECTS Maximum number of frames, needs to be a power of 2
#define N_OBJECTS (1<<13)
struct TrackedFrame {
enum ObjectType {
UNKNOWN = 0,
PED = 1,
VEHICLE = 2,
OBJECT = 3,
PICKUP = 4,
PLAYER = 5,
};
struct PrivateData {
virtual ~PrivateData();
};
struct Object {
uint32_t id = 0;
uint32_t age = 0;
Vec3f p;
Quaternion q;
std::shared_ptr<PrivateData> private_data;
ObjectType type() const;
uint32_t handle() const;
};
public:
friend struct Tracker;
Object objects[N_OBJECTS];
NNSearch2D<size_t> object_map;
void fetch();
public:
TrackedFrame();
GameInfo info;
//Object * operator[](uint32_t id);
//const Object * operator[](uint32_t id) const;
Object * operator()(const Vec3f & v, const Quaternion & q);
Object * operator()(const Vec3f & v, const Quaternion & q, ObjectType t);
Object * operator()(const Vec3f & v, const Quaternion & q, float D, float QD, ObjectType t);
const Object * operator()(const Vec3f & v, const Quaternion & q) const;
};
TrackedFrame * trackNextFrame();
bool stopTracker();
|
/**
* A method visitor that generates a code stub for the visited method.
* Annotations and parameters are passed as-is.
* All other code is replaced by the following:
* <pre>throw new RuntimeException("stub");</pre>
* Note that constructors rewritten this way will probably fail with the runtime bytecode
* verifier since no call to <code>super</code> is generated.
*/
public class MethodStubber extends MethodVisitor {
public MethodStubber(MethodVisitor mw,
int access, String name, String desc, String signature, String[] exceptions) {
super(Main.ASM_VERSION, mw);
}
@Override
public void visitCode() {
Label l0 = new Label();
mv.visitLabel(l0);
mv.visitLineNumber(36, l0);
mv.visitTypeInsn(Opcodes.NEW, "java/lang/RuntimeException");
mv.visitInsn(Opcodes.DUP);
mv.visitLdcInsn("stub");
mv.visitMethodInsn(
Opcodes.INVOKESPECIAL, // opcode
"java/lang/RuntimeException", // owner
"<init>", // name
"(Ljava/lang/String;)V", // desc
false);
mv.visitInsn(Opcodes.ATHROW);
// Label l1 = new Label();
// mv.visitLabel(l1);
// mv.visitLocalVariable(
// "this", // name
// "Lcom/android/mkstubs/stubber/MethodStubber;", // desc
// null, // signature
// l0, // label start
// l1, // label end
// 0); // index
mv.visitMaxs(3, 1); // maxStack, maxLocals
}
@Override
public void visitEnd() {
super.visitEnd();
}
@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
return super.visitAnnotation(desc, visible);
}
@Override
public AnnotationVisitor visitAnnotationDefault() {
return super.visitAnnotationDefault();
}
@Override
public void visitAttribute(Attribute attr) {
super.visitAttribute(attr);
}
@Override
public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean visible) {
return super.visitParameterAnnotation(parameter, desc, visible);
}
// -- stuff that gets skipped
@Override
public void visitFieldInsn(int opcode, String owner, String name, String desc) {
// skip
}
@Override
public void visitFrame(int type, int local, Object[] local2, int stack, Object[] stack2) {
// skip
}
@Override
public void visitIincInsn(int var, int increment) {
// skip
}
@Override
public void visitInsn(int opcode) {
// skip
}
@Override
public void visitIntInsn(int opcode, int operand) {
// skip
}
@Override
public void visitJumpInsn(int opcode, Label label) {
// skip
}
@Override
public void visitLabel(Label label) {
// skip
}
@Override
public void visitLdcInsn(Object cst) {
// skip
}
@Override
public void visitLineNumber(int line, Label start) {
// skip
}
@Override
public void visitLocalVariable(String name, String desc, String signature,
Label start, Label end, int index) {
// skip
}
@Override
public void visitLookupSwitchInsn(Label dflt, int[] keys, Label[] labels) {
// skip
}
@Override
public void visitMaxs(int maxStack, int maxLocals) {
// skip
}
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
// skip
}
@Override
public void visitMultiANewArrayInsn(String desc, int dims) {
// skip
}
@Override
public void visitTableSwitchInsn(int min, int max, Label dflt, Label[] labels) {
// skip
}
@Override
public void visitTryCatchBlock(Label start, Label end, Label handler, String type) {
// skip
}
@Override
public void visitTypeInsn(int opcode, String type) {
// skip
}
@Override
public void visitVarInsn(int opcode, int var) {
// skip
}
} |
<filename>src/main.cc
#include<utility>
#include<vector>
#include<locale>
#include<iostream>
#include<ChessPeices.hh>
#include<chessboard.hh>
int main(){
setlocale(LC_ALL,"");//eneble unicode support
initscr();
start_color();
WINDOW*win=newwin(26,50,3,3); //height,width,(topleft coordinate of window)
box(win,0,0);
ChessBoard c(win,3,6,COLOR_PAIR(1)); //pointer to win ,chess_cell_ht,chess_cell_wd
//---------------INITIALISING CHESS PIECES________________________
init_pair(1,COLOR_BLACK,COLOR_WHITE);//colour for white cell
init_pair(2,COLOR_RED,COLOR_BLACK);//white piece in black cell
init_pair(3,COLOR_RED,COLOR_WHITE); //white piece in white cell
init_pair(4,COLOR_BLUE,COLOR_BLACK);//black piece in black cell
init_pair(5,COLOR_BLUE,COLOR_WHITE); //black piece in white cell
knight LN(true,1,0),RN(true,6,0),ln(false,1,7),rn(false,6,7);//params:is_white,ycellindex ,xcellindex
rook LR(true,0,0),RR(true,7,0),lr(false,0,7),rr(false,7,7);
bishop LB(true,2,0),RB(true,5,0),lb(false,2,7),rb(false,5,7);
pawn *P[8],*p[8];
king K(true,3,0),k(false,4,7);
queen Q(true,4,0),q(false,3,7);
//____________________init_chess_grid_____________________________________________
std::pair<char,piece*>empty_cell=std::make_pair(' ',nullptr);
std::vector<std::vector< std::pair<char , piece*> > >chess_grid(8,std::vector<std::pair<char,piece*>>(8,empty_cell));
chess_grid[0][1]=std::make_pair('N',&LN);chess_grid[0][6]=std::make_pair('N',&RN);
chess_grid[7][1]=std::make_pair('n',&ln);chess_grid[7][6]=std::make_pair('n',&rn);
chess_grid[0][0]=std::make_pair('R',&LR);chess_grid[0][7]=std::make_pair('R',&RR);
chess_grid[7][0]=std::make_pair('r',&lr);chess_grid[7][7]=std::make_pair('r',&rr);
chess_grid[0][2]=std::make_pair('B',&LB);chess_grid[0][5]=std::make_pair('B',&RB);
chess_grid[7][2]=std::make_pair('b',&lb);chess_grid[7][5]=std::make_pair('b',&rb);
chess_grid[0][3]=std::make_pair('K',&K);chess_grid[7][4]=std::make_pair('k',&k);
chess_grid[0][4]=std::make_pair('Q',&Q);chess_grid[7][3]=std::make_pair('q',&q);
for(int i=0;i<=7;i++){
P[i]=new pawn(true,i,1);
p[i]=new pawn(false,i,6);
chess_grid[1][i]=std::make_pair('P',P[i]);
chess_grid[6][i]=std::make_pair('p',p[i]);
}
//-------------------------------------------------------------------------------
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
int attr=0;
if(chess_grid[i][j].second!=nullptr){
if((chess_grid[i][j].second)->is_white){
attr=((i+j)%2==0?COLOR_PAIR(3):COLOR_PAIR(2));
}
else{
attr=((i+j)%2==0?COLOR_PAIR(5):COLOR_PAIR(4));
}
(chess_grid[i][j].second)->print_piece(win,attr,i,j,c.chess_cell_sizey,
c.chess_cell_sizex,(chess_grid[i][j].second)->getrow());
}
std::cout<<chess_grid[i][j].first<<" ";
}
std::cout<<std::endl;
}
refresh();
wgetch(win);
endwin();
return 0;
}
|
Uttar Pradesh Minister Gayatri Prajapati is on the run as police are looking for him in a case of gangrape of a woman and molestation of her daughter. The FIR was registered after the Supreme Court ordered the UP Police to do so.
The apex court will hear the matter tomorrow. The Minister-on-the-run is expected to field a battery of lawyers in the Supreme Court to get a stay on the non-bailable warrant issued against him.
On the other hand, the UP Police are doing their homework to attach his properties if he continues to evade arrest and does not appear for questioning.
GAYATRI PRAJAPATI: A BPL CARD HOLDER TILL 2012
Gayatri Prajapati has a very interesting history in politics. His is the story of rags to riches via politics in a span of less than five years.
Till 2012, Gayatri Prajapati was a BPL card holder. He won his first Assembly election in 2012 after four unsuccessful attempts.
Gayatri Prajapati shot to fame after defeating Amita Singh of the Congress in Gandhi family's pocket-borough of Amethi. Since then he is known for his proximity with Samajwadi Party founder Mulayam Singh Yadav and brother Shivpal Yadav.
A year later, first-time MLA Prajapati was inducted into Akhilesh Yadav's ministry, apparently at the behest of Shivpal Yadav under his own tutelage as MoS for Irrigation.
Five months later in July 2013, Gayatri Prajapati was elevated as the MoS (Independent Charge) and given mining department. In January 2014, Prajapati was given another promotion and made a cabinet rank minister in-charge of mining department.
TAINT OF CORRUPTION
One year later in January 2015, Lucknow-based activist Nutan Thakur moved the Lokayukta, for the second time in two months, with documentary proof sought under the RTI Act to register complaint against Gayatri Prajapati for amassing illegal wealth.
Other complainants, who had approached the Lokayukta in December 2014, withdrew their complaints saying that they did not have proof against Prajapati. Nutan stood firm.
Incidentally, Nutan's husband Amitabh Thakur, an IPS officer, also had a run-in with the SP leadership. He accused Mulayam Singh Yadav of threatening him with dire consequences for his activism.
Nutan told the Lokayukta about a mining syndicate, which was allegedly headed by Gayatri Prajapati. Nutan Thakur also gave documentary details of companies allegedly floated by Prajapati after he became minister.
ALLAHABAD HIGH COURT ORDERS CBI PROBE
While, Lokayukta gave Gayatri Prajapati a clean chit in the case of disproportionate assets, the Allahabad High Court ordered a CBI inquiry into illegal mining which he allegedly ran.
Akhilesh dropped him from the ministry after court's order amid rising friction in his family and the Samajwadi Party. Gayatri Prajapati was branded as Prateek Yadav--Mulayam Singh's second son--loyalist in the family.
The CBI inquiry is still on against alleged irregularities in the mining department under Gayatri Prajapati.
GAYATRI PRAJAPATI'S FAMILY
Nutan Thakur informed the Lokayukta office about the properties held by Prajapati's wife Maharaji, daughters Sudha and Ankita, sons Anurag and Anil. Assets were allegedly bought in their names after October 2013.
Gayatri Prajapati's son Anil is the director of Life Cure Medical Centre - a multi-specialty hospital at Pratapgarh in Amethi. Anil also heads Shuhag Exports Limited based at Indrajeet Kheda, Amethi and Decent Constructions based out of Amethi.
Nutan also gave details of properties that Prajapati allegedly bought in the names of his staff including drivers and domestic help.
The allegations of Nutan Thakur were substantiated by the Income Tax department's reply to the Lokayukta confirming that Gayatri Prajapati's driver acquired assets of worth Rs 77 lakh in two years without filing an IT return.
Prajapati allegedly also made his sons directors of nearly a dozen companies floated by him after he became minister in the Akhilesh government.
The list of companies includes MGA Hospitality, Kahana Build Well, MGA Colonisers, MSA Infra Venture, Daya Builders Private Limited, MSGA Enterprises, MGM Agro Tech, Excel Built Tech and MSG Realtors.
NOW, THE GANGRAPE CASE
While the election campaign was in full swing in Uttar Pradesh, the Supreme Court ordered the police to file an FIR against Gayatri Prajapati and six others on the complaint of a woman.
The woman alleged that she was repeatedly gangraped and her minor daughter molested. According to her complaint, the gangrape was first committed in October 2014 and her ordeal continued till July 2016.
After the apex court order, Prajapati and six others were booked under the IPC and the Protection of Children from Sexual Offences Act on February 18.
While police have said that the UP Minister is hiding, Gayatri Prajapti cast his vote in Amethi, when it went to polls on February 27-- nine days after the rape case was registered against him.
Two days ago, the police issued an alert to all the airports asking the authorities not to let Gayatri Prajapati fly out of the country. His passport has been temporarily revoked and a non-bailable warrant has been issued against him.
ALSO READ
Gayatri Prajapati: Gangrape case witness alleges attempt to murder in hospital
Airports, exit points across country on alert for absconding rape-accused SP minister Gayatri Prajapati
Smriti Irani: Either Akhilesh is incompetent or he is protecting rape-accused minister Gayatri Prajapati
ALSO WATCH | Gangrape accused Samajwadi Party MLA Gayatri Prajapati missing since February 27 |
Spatio-temporal expression of blunt snout bream (Megalobrama amblycephala) mIgD and its immune response to Aeromonas hydrophila The function of IgD in fish and mammals has not been fully understood since its discovery. In this study, we have isolated and characterized the cDNA that encodes membrane-bound form of the immunoglobulin D heavy chain gene (mIgD) of blunt snout bream (Megalobrama amblycephala) using RT-PCR and rapid amplification of cDNA ends (RACE). The full-length cDNA of mIgD consisted of 3313 bp, encoding a putative protein of 943 amino acids. The structure of blunt snout bream mIgD is VDJ-1-1-2-3-4-5-6-7-TM. Multiple alignment and phylogenetic analyses indicated that blunt snout bream mIgD clusters with the homologues of cyprinid fish and that its highest identity is with that of C. idella (82%). The mIgD expression in early different developmental stages showed that the level of mIgD mRNA decreased dramatically from the unfertilized egg stage to the 32-cell stage, suggesting that mIgD mRNA was maternally transferred. As cell differentiation initially took place in the blastula stage, the mIgD expression increased significantly from the blastula stage to prelarva, which might be attributed to embryonic stem cell differentiation processes. Compared with juvenile fish, the expression and tissue distribution patterns of mIgD in adult individuals exhibited considerable variation. After the injection of Aeromonas hydrophila, mIgD expression was up-regulated in various tissues, reaching the peak expression at 5 d, 14 d or 21 d (depending on the tissue type). The present study provides a theoretical basis for further research of the teleost immune system. Introduction In all species that possess Igs, the only class of antibody universally found is IgM, which has been well characterized at both the protein and molecular levels and is considered to be the predominant teleost serum Ig. However, there are considerably fewer reports about the teleost homolog(s) of IgD, which was initially discovered in humans from serum of a myeloma patient. For about 30 years, IgD was considered to be a relatively recently evolved class of immunoglobulins as it had been described only in primates and rodents. However, in 1997, a new immunoglobulin H-chain gene with some homology to mammalian IgD was cloned from the channel catfish, Ictalurus punctatus L.. Since then, IgD genes, albeit with some diversity, have been identified in a large number of species, including Atlantic salmon, Salmo salar, Atlantic cod, Gadus morhua L., Japanese flounder, Paralichthys olivaceus and grass carp, Ctenopharyngodon idella. The discoveries of an IgD-like gene in teleost species have changed the evolutionary view, and suggest that the gene existed early in vertebrate evolution. The role of IgD in teleost in vertebrate immune systems is not fully understood. In channel catfish, transcripts encoding both membrane and secreted IgD have been identified. The IgD heavy chain cDNA clones existed only as the membrane form in both Atlantic salmon and Atlantic cod. In most species, the IgD-encoding gene (C) is located downstream of the IgM-encoding gene (C) and is co-expressed with IgM on the surface of the majority of mature B cells before antigenic stimulation. IgD seems to play an important role as an antigen receptor optimized for efficient recruitment of B cells into antigen-driven responses. The structures of teleost IgD genes are different from those of mammals. Human IgD has three constant domains, while there are only two constant domains in the mouse; further, both human and mouse delta constant regions have a flexible hinge region. In contrast, there is no hinge region and there are seven constant domains for both catfish and salmon IgD. The initial discovery of IgD in teleosts also found that IgD was a chimeric protein containing a C1 domain followed by a number of C domains. This chimeric structure was later found in grass carp, Atlantic salmon and Atlantic cod. Until now, no complete fish IgD heavy chain without C1 has been reported. In addition, the structure of the fish IgD gene is different in various species. For instance, a duplication of domains 2-3-4 has been reported in grass carp, salmon, halibut and catfish, but not in flounder. Further, in cod, domains 3-6 are absent, and there is a tandem duplication of domains 1 and 2. So far, the information obtained indicates that teleosts do not share a common IgD structure. To further our understanding of the immune development of teleosts, it is important to obtain more information on this gene in additional fish species from different families. Megalobrama amblycephala, commonly known as blunt snout bream or Wuchang fish, belongs to Megalobrama, Cyprinidae, Cypriniformes, Actinopterygii. As a species in Cyprinidae, the largest family of freshwater fish, M. amblycephala is closely related to the commonly known fish such as zebrafish (Danio rerio) and carp. Although the gene encoding IgD has been identified in bony fish by database mining, the biological functions of IgD is yet unknown in Megalobrama amblycephala. Therefore, the aim of the present study was to isolate and to characterize the IgD gene in blunt snout bream, Megalobrama amblycephala, which is an economically important freshwater fish species in the aquaculture industry in China. In addition, to understand the fish immune system, we examined the spatio-temporal expression of mIgD and investigated the immune response of the mIgD gene after Aeromonas hydrophila infection in M. amblycephala. Fish and sampling Healthy M. amblycephala of juvenile (body weight: 45-55 g) and adult fish (body weight: 400-500 g) were collected from the fish base of Huazhong Agricultural University (Wuhan, China). Before experiments, fish were acclimatized in quarantine plastic tanks in aerated freshwater at 24 ±2°C for two weeks. After acclimation, each fish was anesthetized with MS-222 (Sigma, USA). To avoid individual differences, tissues were extracted from 30 juvenile and 30 adult M. amblycephala. Tissue samples (including head kidney, trunk kidney, liver, spleen, gill, intestine, muscle and brain) were immediately collected and frozen in liquid nitrogen, and then stored at -80°C until the RNA was extracted. To determine the expression of the mIgD gene in different developmental stages, samples were collected from unfertilized eggs, zygotes, 2-cell embryos, 4-cell embryos, 32-cell embryos, blastula, gastrula and prelarva. Due to the vast differences in the size amongst the developmental stages, samples totaling ~100 mg from six parents were pooled for each stage for RNA isolation. All samples were flash-frozen in liquid nitrogen immediately and then stored at -80°C until RNA isolation. All the experimental procedures involving fish were approved by the Institutional Animal Care and Use Committee of Huazhong Agricultural University, Wuhan, China. Challenge experiment For the A. hydrophila challenge experiment in M. amblycephala, all the tested fishes (15 ±2 g) were inoculated by intraperitoneal injection. The bacteria A. hydrophila was isolated from diseased M. amblycephala in Dongxi Lake (Wuhan, China) by our laboratory. A single colony was cultured in LB medium at 28°C to mid-logarithmic growth. In a pre-challenge experiment prior to the challenge trial, the concentration 1 10 7 colony forming units/ ml (CFU/ml) was determined as LD 50. The treatment group was injected with 0.1 ml (1 10 7 CFU/ml) bacterial suspension per individual, while the control group was injected with the same volume of phosphate-buffered saline (PBS, pH 7.2). After the treatment, the fish were returned to tanks with water temperature of 27 ±0.5°C. Thirty injected individuals (3 pools) from treated and control groups were randomly dissected at 4 h, 1, 3, 5, 14, and 21 d post injection. Thirty without injected fishes were sampled as a blank control (0 h). Fish were euthanized by exposure to 300 mg/l of MS-222 (Sigma, USA) before dissection, and tissues (including trunk kidney, spleen, gill and liver) were sampled, frozen immediately in liquid nitrogen and then stored at -80°C until RNA extraction. RNA isolation and cDNA synthesis Samples, including different tissues and embryos of different developmental stages, were homogenized using a mortar and pestle under liquid nitrogen; total RNA was extracted using Trizol reagent (TaKaRa, Japan), according to the manufacturer's instructions. Total RNA was treated with gDNA Eraser (TaKaRa, Japan) to avoid the contamination of genomic DNA. The quantity and quality of the RNA was determined using agarose gels and a NanoDrop 2000 spectrophotometer (Thermo Fisher Scientific, USA). First strand cDNA was synthesized using PrimeScript® RT reagent Kit with gDNA Eraser (TaKaRa, Japan), according to the manufacturer's instructions. Cloning of full-length cDNA by rapid amplification of cDNA ends (RACE) To amplify partial cDNA fragments of mIgD, amplified primers (Table 1) were designed based on conserved regions of reported Cyprinidae fish IgD sequences (). Using trunk kidney cDNA as the template, the main part of mIgD cDNA was amplified via PCR reaction. The mIgD cDNA fragment amplification conditions consisted of initial denaturation at 95°C for 5 min, 30 cycles of 30 s at 95°C, 30 s at 56°C and 3 min at 72°C, and final extension at 72°C for 10 min. The PCR fragments were ligated into pMD19-T vector (TaKaRa, Japan) and transformed into Escherichia coli DH5 competent cells. The positive clones were examined by PCR and sequenced commercially. The primer pairs used for 5' RACE and 3' RACE are listed in Table 1. The 5' and 3' ends of the mIgD were amplified using the 5'-/3'-Full RACE kit (TaKaRa, Japan) following the manufacturer's protocol. Primers (Table 1) for 5'-RACE and 3'-RACE PCR were designed according to the sequence of the cDNA fragment determined as described above. The 5' and 3'-RACE products were purified and ligated into pMD19-T vector (TaKaRa, Japan); then, several random clones were selected and sequenced commercially. The full-length mIgD cDNA sequence was compiled using DNAStar software. For confirmation, the full-length open-reading frame was amplified with specific primers (ORF-F and ORF-R, Table 1). The PCR reaction was performed using the trunk kidney cDNA with LA Taq (TaKaRa, Japan), according to the manufacturer's protocol. Sequence analysis The amino acid sequence of mIgD gene was predicted using a translator program at open reading frame finder on NCBI (http://www.ncbi.nlm.nih.gov/gorf/gorf.html). The calculated molecular weight and theoretical isoelectric point from the deduced amino acid sequence were obtained by the online software ProtParam (http://www. expasy.ch/cgi-bin/protparam). The protein domains were marked according to the UniProt (http://www.uniprot.org/) and SMART (http://smart.embl-heidelberg.de/) database. Phylogenetic analysis of the putative amino acid sequence of mIgD was carried out by the neighbor-joining method using MEGA 5.0 program, and the reliability of the estimated tree was evaluated by the bootstrap method with 1000 pseudo-replications. Quantitative real-time PCR (qRT-PCR) Based on quantitative real-time PCR (qRT-PCR), expression patterns of mIgD were analyzed using cDNA from different tissues and embryos of different developmental stages of blunt snout bream. Three reference genes, 18S rRNA, EF1a (elongation factor 1) and ACTB (-actin) were selected based on expression stability, and all primer sequences were described in Table 1. Products of the qRT-PCR primers (Table 1) were sequenced to confirm specificity. To select the reference genes with the most stable expression, the relative stability measure (M) of the reference genes was calculated by GeNorm (http://medgen.ugent.be/genorm/) as described in our previous studies. The value M represents an average pairwise variation of a reference gene with all other reference genes and a lower M value corresponds to the higher expression stability. According to this rule, the most stable gene was 18S rRNA in analysis samples. In addition, PCR amplification efficiency of 18S rRNA is much closer to mIgD. The qRT-PCR was carried out in triplicate on a Rotor-Gene Q real-time PCR Detection System (QIAGEN, Dusseldorf, Germany) using the SYBR® Premix Ex TaqTM II (TaKaRa, Japan) according to the manufacturer's instructions. The total reaction volume of 20 l contained 10 l SYBR qPCR Mix, 1 l of each primer (10 M), 2 l cDNA and 6 l ddH2O. Real-time PCR conditions were as follows: initial denaturation at 94°C for 30 s, followed by 40 cycles of 10 s at 94°C, 30 s at 54°C and 30 s at 72°C. The PCR reaction carried out without DNA sample was used as a negative control. The PCR specificity was verified by a melt-curve analysis. Gene expression values were calculated as foldchange in the target gene relative to the reference gene (18S rRNA): fold change = E−CT, where CT = (Ct target gene -Ct 18S rRNA). Statistical analysis All the data obtained from the real-time PCR were expressed as mean ± standard error (M ± SE) and subjected to a One-way Analysis of Variance (ANOVA), followed by Duncan's test to determine differences among treatments. Statistical significance was set at p < 0.05, with p < 0.01 being considered highly significant. Statistical analyses were performed using SPSS 13.0. M. amblycephala mIgD is composed of one variable domain (VH), one 1 domain, seven constant domains (1−7) and one transmembrane domain (TM) (Fig. 1). Amino acid analysis of the mIgD revealed that there were 31 cysteine (Cys) residues, which might be involved for the formation of intra-domain and inter-domain disulfide bridges. In addition, 10 putative N-linked glycosylation sites (one in 4, four in 5, two in 6 and three in 7) were found in mIgD of M. amblycephala. Analysis of nucleotide and deduced amino acid sequences of mIgD The amino acid sequences of immunoglobulin from other species based on the closest homologues by running BLASTP search were taken for phylogenetic analysis. Multiple protein sequence alignment revealed that M. amblycephala mIgD was clustered with the homologues of other vertebrate species. The mIgD of M. amblycephala revealed high identity with the homologues of cyprinid fish, especially with C. idella (Fig. 2). Spatio-temporal expression of M. amblycephala mIgD In the present study, mIgD was determined in different embryo developmental stages (Fig. 3). The level of mIgD mRNA was highest in unfertilized eggs and decreased dramatically to a low point in the 2-cell through 32-cell stages. The level of mIgD mRNA then increased significantly from the blastula stage through the prelarva stage, although it never achieved the level seen in the unfertilized egg. Transcriptional levels of mIgD were detected in juvenile and adult M. amblycephala. mIgD was expressed in head kidney, trunk kidney, spleen, liver, intestine, gill, brain and muscle of both juvenile and adult fish. For juvenile individuals, the expression of mIgD was mainly detected in the head kidney, trunk kidney, spleen and liver, with low levels in other tissues (Fig. 4). For adult individuals, the mIgD expression level was the highest in the head kidney, moderate in trunk kidney and muscle, and low in other tissues (Fig. 4). Compared with juvenile individuals, the expression level of mIgD in adult individuals was higher in head kidney and muscle, and lower in all other tissues (Fig. 4). Expression of mIgD gene after A. hydrophila challenge At 4 h, 1, 3, 5, 14 and 21 d post-challenge with A. hydrophila, the mRNA expression level of mIgD in trunk kidney, spleen, gill and liver of M. amblycephala was quantified by qRT-PCR (Fig. 5). Compared with the control group, the expression pattern of the mIgD gene was found first down-regulated at 4 h, then up-regulated and reached the peak at 5 d after injection in trunk kidney of the treatment group. In the spleen, the level of mIgD mRNA was found first down-regulated at 4 h and 1 d, then increased gradually and reached the peak at 21 d in the treatment group. In gill and liver, the expression pattern of mIgD gene was up-regulated by the challenge. Expression reached a peak at 14 d in gill and 21 d in liver. Changes in peak expression relative to the control group were most dramatic in gill (~16-fold) and liver (~80-fold), and lower in trunk kidney (~4.5-fold) and spleen (~3.5-fold). In trunk kidney, spleen and gill, the expression of the mIgD gene was down-regulated at 4 h in the control group compared to the blank control group (0 h). Discussion M. amblycephala mIgD transcripts correspond to the membrane form and, just as in Japanese flounder Paralichthys olivaceus and mandarin fish, Siniperca chuatsi, are chimeric, with the inclusion of C1, seven C (C1-C2-C3-C4-C5-C6-C7) exons and TM regions. This new H-chain gene from M. amblycephala is also homologous to the previously reported delta genes from catfish and salmon, albeit with some diversity. The similarities with catfish and salmon IgD are sequence homology and the chimeric nature of its expression, as the 1 domain is spliced to the 1 domain which permits covalent association with light chains. A previous genome-wide survey of the zebrafish was helpful in identifying the gene segments encoding antibodies in this animal model. Zebrafish IgD was also identified to be a chimeric immunoglobulin, with C1 splicing to the third IgD exon. In bony fishes, the Vn-Dn-Jn-IGHZ-Dn-Jn-IGHM-IGHD pattern is present on IGH loci. Previous studies about fish IgH show that the structure of IgD is remarkably heterogeneous among fish species (with frequent C-domain duplications), while IgM and IgZ appear to be more conserved. The backbones of many bony fish delta chains are comprised of seven C domains, where a wide range of domain organization within fish lineages is observed. In the Japanese flounder (Paralichthys olivaceus) and stickleback (Gasterosteus aculeatus), the IGHD locus consists of the C1-C1-C2-C3-C4-C5-C6-C7-TM1-TM2 exons, in which the homology of domains CH2-CH5, CH3-CH6 and CH4-CH7 suggests that C2-C3-C4 duplicated to generate C5-C6-C7. In Atlantic salmon (Salmo salar) and catfish (Ictalurus punctatus), the duplications of C2-C3-C4 have also been found. C2-C3-C4 domains are repeated three times in Atlantic salmon IgHA and catfish, but four times in Atlantic salmon IgHB. However, the duplications of C2-C3-C4 have not been found in M. amblycephala mIgD. Multiple protein sequence alignment revealed that M. amblycephala mIgD showed high identity with the homologues of cyprinid fish, especially with C. idella, while the mIgD of C. idella has a structure of C1-(C2-C3-C4) 2 -C5-C6-C7-TM-UTR, with the repeat of C2-C3-C4. It indicates that diversification of IgD may be due to germline changes that are species-specific, rather than due to different splicing patterns as described for IgM. IgD was a new finding in teleosts, and it has seldom been studied with regard to its function. The distribution of IgD transcripts in teleost organs has been examined in fugu (Takifugu rubripes), Atlantic cod and rainbow trout. In fugu, IgD was found to be expressed intensely in lymphoid tissues (i.e., PBL, spleen, head kidney and kidney). In Atlantic cod, IgD producing cells were evenly distributed throughout the hematopoietic tissues in head kidney and spleen, which suggested that cod IgD was mainly expressed as a B-cell receptor akin to IgD in mammals. In rainbow trout, IgD-secreting plasma cells were found to be common in the kidney and spleen. In this study, M. amblycephala mIgD was detected mainly in head kidney, trunk kidney and spleen in both juvenile and adult fish, which was consistent with the above reports. Moreover, in both juvenile and adult fish, M. amblycephala sIgM was highly expressed in head kidney, trunk kidney and spleen in our previous study. It indicates that head kidney, trunk kidney and spleen are predominant immune organs. In adult M. amblycephala, the expression level of mIgD was the highest in head kidney, with the expression almost entirely localized in head kidney. The head kidney, having morphological and functional aspects similar to the mammalian bone marrow, is a major hematopoietic organ and site of production of antibodies and other immune cells in teleost fish. The highest expression level of mIgD in the head kidney may be attributed to the first appearance in the head kidney of mIgD positive B-cells, which may be transported to other lymphoid organs. Compared with adult fish, the expression of mIgD in juvenile fish was higher in the trunk kidney, spleen, liver, intestine, gill and brain. Thus, expression and tissue distribution patterns of M. amblycephala mIgD exhibit considerable variation between juvenile and adult fish. In the present ontogeny study, mIgD mRNA was detected in zygotes, suggesting the possibility of maternal mRNA transfer into oocytes. Indeed, it was found that In addition, the level of mIgD mRNA decreased dramatically from the unfertilized egg to zygote stage, reaching very low levels from the 2-cell to the 32-cell stages; by the prelarva stage, mIgD levels were much closer to those seen in the unfertilized egg. As such, it seems that the transcript of the mIgD gene is maternally transferred to eggs and degraded with embryonic development. Such phenomenon of maternal transfer has also been found in both sea bass (Dicentrarchus labrax) and sea bream (Sparus aurata). Cell differentiation takes place in the blastula stage and generates the embryonic stem cell, which would proceed with immune organogenesis. In the present study, the level of mIgD mRNA increased significantly from the blastula stage to prelarva, which might be attributed to the embryonic stem cell differentiation procedure. The function of IgD in fish and mammals is not fully understood. Previous research indicated that fugu IgD may play an important role in the humoral immune system, as the expression pattern of IgD is similar to IgM. In rainbow trout, the (mem)IgD(mem)(+)IgM(-) B lymphocyte subset expresses (mem)CCR7 and responds to viral hemorrhagic septicemia virus infections. IgD is typically co-expressed with IgM by alternative splicing of a long primary mRNA transcript containing the rearranged VDJ exons and the C and C exons. IgM knockout studies with mice have shown that IgD can largely substitute for IgM functions in B cells. In this study, the expression patterns of mIgD in various tissues of M. amblycephala post A. hydrophila infection were in line with that of IgM. Thus, mIgD may have an important role in the adaptive immune system, conferring protective functions against pathogens. In M. amblycephala, mIgD mRNA in different organs exhibited various responses to A. hydrophila infection. It should be noted that, in the control group, the level of mIgD mRNA was down-regulated at 4 h in trunk kidney, spleen and gill of M. amblycephala; this down-regulation immediately after the injection procedure might be due to stress on the fish from having been handled and injected. On the other hand, in the treatment group, the level of mIgD mRNA reached a peak at 5 d and 14 d post infection with A. hydrophila in trunk kidney and gill, respectively, while mIgD mRNA expression reached a peak at 21 d in spleen and liver. Clearly, activation of immune response is a complicated and time-consuming process. For instance, in sea bass, the IgM level decreased during the first month post Vibrio anguillarum immunization, which was explained as the Ig being consumed through counteracting with antigen. In our previous study, M. amblycephala MHC I transcripts were detected to decrease from 0 to 4 h after A. hydrophila injection in gill and liver. More-over, the level of sIgM mRNA was found significantly decreased at 4 h in trunk kidney, spleen and gill of M. amblycephala after A. hydrophila infection. In this study, compared with the control group, the expression pattern of M. amblycephala mIgD gene was found down-regulated at 4 h after injection in trunk kidney and spleen. The early decrease is likely to be an adaptation rather than a deficiency of the immune system. By comparison, the level of IgM mRNA significantly increased in blood cells of orange-spotted grouper after Vibrio alginolyticus challenge. Further, in fugu (Takifugu rubripes), the expression of the IgD gene was intense in peripheral blood leucocytes (PBL). In the present study, after injection of A. hydrophila, the level of mIgD mRNA reached a peak at 14 d in gill (~16-fold), and then dropped back by 1/2 one week later, which is similar to the previous study. After injection of Flavobacterium columnare, expression of IgD was significantly elevated at 1 and 2 weeks with 7.16 and 7.78-fold respectively in gill of mandarin fish, and then declined to the basal level one week later. The different expression patterns of mIgD after the infection might be caused by different fish species or different bacteria. After stimulation with inactivated A. hydrophila strain T4, Chinese soft-shelled turtle IgD gene in peak expression relative to the control group were most dramatic in blood (~25-fold). The high expression levels of mIgD in the liver of challenged M. amblycephala is intriguing. The liver's lymphocyte population is selectively enriched in natural killer and natural killer T cells, which play critical roles in first-line immune defense against invading pathogens. Further, in humans, about 30% of the total blood passes through the liver every minute, carrying about 10 8 peripheral blood lymphocytes in 24 hours. However, after Aeromonas hydrophila infection, the liver of treated M. amblycephala exhibited hepatorrhagia; thus, given the lack of identification for mIgD function, the significant increase in the level of mIgD mRNA may simply be a result of hepatorrhagia. In conclusion, the full-length cDNA of M. amblycephala mIgD heavy chain has been cloned and characterized. Moreover, the spatio-temporal expression of mIgD was examined. Compared with adult M. amblycephala, the expression and tissue distribution patterns of mIgD in juvenile fish exhibit considerable variation. Finally, the immune response of the mIgD gene to A. hydrophila in M. amblycephala was also investigated; however, further research will be required to elucidate the function of mIgD and its mechanism in the immune response for teleosts. This study is supported by the Fundamental Research Funds for the Central Universities (Grant No. 2012MBDX004). The authors declare no conflict of interest. |
<reponame>andrey-prokopyev/ReviewStateSynchronizer
package com.sdv.sync.reviewStateSynchronizer.api;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import com.atlassian.crucible.event.ReviewStateChangedEvent;
import com.atlassian.event.api.EventListener;
import com.atlassian.event.api.EventPublisher;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
public class ReviewStateEventListener implements InitializingBean, DisposableBean {
private static final Logger log = LoggerFactory.getLogger(ReviewStateEventListener.class);
private static final String propertiesFile = "ReviewStateSynchronizer.properties";
private static final String originPropertyName = "sync.webhook.origin";
@ComponentImport
private final EventPublisher eventPublisher;
@Inject
@Autowired
public ReviewStateEventListener(EventPublisher eventPublisher) {
super();
this.eventPublisher = eventPublisher;
}
@EventListener
public void onReviewStateChangedEvent(ReviewStateChangedEvent event) throws MalformedURLException, IOException, Exception {
log.info("Review " + event.getReviewId().getId() + " has changed state from '" + event.getOldState().toString() + "' to '" + event.getNewState().toString() + "'");
String origin = null;
InputStream is = getClass().getClassLoader().getResourceAsStream(propertiesFile);
if (is != null)
{
Properties p = new Properties();
p.load(is);
origin = p.getProperty(originPropertyName);
}
if (origin == null)
{
log.error(originPropertyName + " not found in " + propertiesFile);
return;
}
URL myUrl = new URL(origin + "/review/" + event.getReviewId().getId() + "/state");
String postData = "{\"old\":\"" + event.getOldState().toString() + "\", \"new\":\"" + event.getNewState().toString() + "\"} ";
HttpURLConnection conn = (HttpURLConnection) myUrl.openConnection();
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty( "Content-Type", "application/json");
conn.setRequestProperty( "charset", "utf-8");
conn.setRequestProperty( "Content-Length", Integer.toString( postData.length()));
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(postData);
wr.flush();
wr.close();
conn.connect();
int responseCode = conn.getResponseCode();
log.info("Posting request about review " + event.getReviewId().getId() + " changed state has returned response with status code " + responseCode);
}
@Override
public void destroy() throws Exception {
this.eventPublisher.unregister(this);
}
@Override
public void afterPropertiesSet() throws Exception {
this.eventPublisher.register(this);
}
}
|
IRVINE, Calif. /California Newswire/ — Lion’s Heart is thrilled to announce it has received a $10,000 corporate partner sponsorship from the esteemed Orange County law firm, Shulman Hodges & Bastian LLP. These funds will support the cultivation of age-appropriate service projects for over 10,000 empowered teen Members across the country as well as support general law and business counsel for the organization.
Over the past six years, Lion’s Heart teen Members have served over 850,000 community service hours in nearly thirty states, providing support for a wide variety of local causes–including animal care, children’s health, environmental protection, military support, senior advocacy, and so much more.
“Lion’s Heart helps teens understand the value of giving back while discovering the power they have inside themselves to contribute meaningfully to this world – now and for a lifetime,” says Terry Corwin, Lion’s Heart Founder and Executive Director.
Support teens in action by forming a Lion’s Heart chapter in your neighborhood, becoming a Member, or requesting Lion’s Heart teen volunteers to support your cause. For more information, visit https://lionsheartservice.org/ today!
To form a chapter in your neighborhood, become a Member, request volunteers for your cause, or become a corporate partner, visit https://lionsheartservice.org. |
Mount Albert Grammar School (MAGS) will contest their seventh consecutive New Zealand Secondary Schools Netball Championships (NZSS) final on Friday against Christchurch’s St Margaret’s College after sauntering through post-pool play.
The highly fancied MAGS team have been the ones to beat at Arena Manawatu in Palmerston North all week, victorious against Saint Kentigern College earlier in the day 42-30 and beating St Mary’s College in a replay of the 2013 NZSS final 46-32 to secure their finals berth.
St Margaret’s College are the only other unbeaten team all week, however they drew 28-28 with Saint Kentigern College on the opening day. Since then, the team has swept all-comers aside to book their spot in the NZSS final for the very first time. It’s a vast improvement for St Margaret’s College after finishing 11th in 2013.
It’s the first time in seven years the final will feature a team from the North Island against a team from the South Island. The last time was when Villa Maria defeated MAGS in 2008.
The Christchurch side defeated Auckland Girls’ Grammar school 33-19 earlier in the day and were forced to bring their ‘A game’ to defeat Manukura 35-25.
One of the upsets of the day was Avondale College beating St Andrew’s College 33-31, but despite the result, Avondale College will still contest the 13th/14th play-off against Newlands College at 9.00am.
St Andrew’s College will play-off for 9th/10th against Southland Girls’ High School – with the latter recording two wins on day three; 37-30 over Waimea College and 39-30 over Newlands College.
North Shore’s Westlake Girls High School showed their worth on day three with two-wins from two, defeating Avondale College 34-29 and backing that up with a 35-14 victory over South Otago High School. Westlake Girls High School will play Waimea College in the battle for 11th and 12th.
In the final round of the day, extra-time was needed to separate Wellington East Girls’ College and Saint Kentigern College after the teams’ tied 36-36 after regulation time. Neck and neck for the entire period of extra-time, Wellington East Girls’ College edged ahead in the final seconds to win 45-44.
For the full results and Friday’s draw, please click here.
Entry to Arena Manawatu is by gold coin donation. For results and the full draw for Thursday, please clickhere.
The NZ Secondary Schools Netball Championships, 2014 takes place from Tuesday 7th September to Friday 10th October at Arena Manawatu, Palmerston North.
Please click here for The NZ Secondary Schools Netball Championships 2014 media guide. |
PEDIATRIC ALLERGY Can It Be Prevented? The current paradigm of allergy pathogenesis is that allergy develops in individuals with a genetic predisposition only after they are exposed to allergens (Fig. 1). This hypothesis implies that factors in the environment can determine the initiation of allergic sensitization and can potentially influence the clinical manifestations and severity of disease. Because the prevalence of atopic diseases such as allergic rhinitis, asthma, atopic dermatitis, and food allergy have increased worldwide in the past several decades, and there is no mechanism for changes in population genetics over this short period of time, changes in the human environment are most likely responsible for these trends. From this line of reasoning, it follows that if the factors responsible for the increasing prevalence can be identified, then there would be an opportunity to develop strategies to reverse these trends. It also would be helpful to identify infants who are at risk for developing allergy, so that preventive strategies could be used most effectively. In this article, studies to determine the contributions of genetics and the environment to the development of allergic diseases in childhood are explored. In addition, progress in identifying risk factors for allergy and preventive therapies for those children at risk are also addressed. ALLERGY AND ASTHMA asthma, allergic rhinitis, food allergy, and atopic dermatitis. In addition, pathogenic factors common to allergic disorders include acute and chronic inflammation involving mast cells, basophils, allergen-specific T cells, and activated eosinophils. Many of the genes for the cytokines and receptors that regulate allergic inflammation are clustered on a short segment of chromosome 5q, and linkage of total serum IgE levels to these genes has been demonstrated in some kindreds.52 In contrast, production of IgE specific for many of the common pollen and pet allergens has been linked to certain human leukocyte antigen (HLA) Class I1 molecules located on chromosome 6.37 These data indicate that the inheritance of allergic disorders is multifactorial. Furthermore, there appear to be additional factors that influence whether a person born into an atopic family will develop allergic rhinitis, asthma, atopic dermatitis, or some combination of these disorders. For example, Dold et a1 found that families that included one parent with atopic dermatitis were more likely to have a child with atopic dermatitis (odds ratio 3.4) than were families with one parent with either asthma (OR 1.5) or allergic rhinitis (OR 1.4).14 Similar trends were observed when inheritance of asthma or atopic dermatitis was examined, and these findings suggest that there are specific genetic or environmental factors that influence which organ system(s) are affected by allergy. In support of this concept, genes within chromosome 5q and elsewhere have been linked to the development of bronchial hyperresponsiveness, a key feature of asthma.'" Cytokine Abnormalities Associated with Allergy and Asthma The atopic trait can be defined in a number of ways: total serum IgE antibody levels,5, b, 53. R7 allergen-specific antibody levels using skin tests or radio-allergosorbent tests (RAST), and most recently, by a characteristic pattern of cytokine secretion, the T helper 2 (Th-2)-like response, noted in both rodent'" M1 and human studies?, 24, 32, In this regard, the Th-1 or Th-2 paradigm of lymphocyte cytokine elaboration has received considerable attention as a marker associated with atopy and as a contributor to the pathogenesis of acute and chronic allergic inflammation. Based on original work in rodents,60 lymphocyte cytokine elaboration has been divided by many groups into a Th-1 (interleukin [ILI-2, interferon [IFNI-y, IL-12), Th-2 (IL-4, IL-5, IL-13), and most recently, a Tc-2 pattern of response. Although this paradigm has received criticism for its simplicity in terms of the overall immune cytokine netw0rk,3~ many groups have considered it as a useful starting point in unraveling the pathogenesis of allergic inflammati0n.9~ The Th-2 pattern of response has been found in tissue samples obtained at sites of allergic or parasitic inflammation, whereas the Th-1 response has been more associated with delayed hypersensitivity and response to virus infections. The Th-1 and Th-2 profiles of response appear to be reciprocally regulated. From data obtained using specific mRNA or absolute levels (IFN-y, IL-4, IL-5) or ratios (IL4/IFN-y) of Th-1 and Th-2 cytokines in various biologic tissues and fluids,", 32, Io7 it has been proposed that an imbalance, or immunologic deviation, favoring a Th-2 cytokine profile is associated with allergic disorders. Various investigators have noted that this Th-2 polarization is established during infancy and early,childhood56,'ffi; indeed, some have noted that diminished IFN-y production can be demonstrable in cord blood of infants at high risk of developing allergic disease based on parental histories of atopyS9 Perhaps most importantly, infants with this type of IFN-y profile have a significantly increased risk of going on to develop atopic diseases including both eczema and asthma. With a particular profile of Th-1 or Th-2 cytokines appearing to be characteristic of atopy, recent work has focused on how this response may be regulated, and perhaps dysfunctional, in atopic or asthmatic patients. Because IFN-y production appears to be abnormal in a number of studies,Z4, 32, 89, 92 regulation of this cytokine has been evaluated. Two cytokines, IL-12 and IL-18 (IFN-y inducing factor), are potent stimulators of IFN-y production.66, 91 Interestingly, cord blood mononuclear cells have been noted to produce less IL-12 mRNA and protein compared with adult cells, but IFN-y production in response to IL-12 was ~imilar.4~ Therefore, alterations in 1FN-y production in the developing infant and child may be a reflection, at least in part, in cytokine regulation of its production. Furthermore, it has been noted that atopic asthmatic patients have a deficient IL-12 response when whole blood cultures are stimulated with a strain of Staphylococcus uu~eus.9~ Taken together, these findings suggest that the observed decreases in IFN-y production in atopic patients may be related to abnormalities in positive regulatory signals, such as IL-12. Natural History of Allergen Sensitization The natural history of allergic diseases provide clues as to the relationship between exposure to allergens and sensitization. Food allergies tend to occur early in life, and together with atopic dermatitis, tend to be the earliest manifestation of allergy. Sensitization to respiratory allergens rarely occurs before 2 years of age, and positive skin tests for indoor allergens such as house dust mite and cat proteins usually precede the development of pollen allergy by several years. This temporal sequence suggests that prolonged contact of high concentrations of allergens with mucosal surfaces provides optimal conditions for allergen sensitization to occur, and this observation has been substantiated in animal models of allergy. Not surprisingly, patterns of allergen sensitization reflect the geographical or social climate in which the child is raised. For example, peanut allergy is common in the United States but is relatively rare in Scandinavia where per capita peanut consumption is low. The prevalence of fish allergy in children from these two different locations, following patterns of consumption, is reversed. In addition, geographic and climatic conditions are major determinants of the pattern of respiratory allergies. House dust mite allergy is common in humid coastal areas but does not occur in desert climates, where sensitization to AZternaria species is common.1n5 In contrast, cockroach allergy is common in inner city areas.Q2 Despite obvious differences in the patterns of allergen exposure, the overall prevalence of allergic rhinitis and asthma in coastal and desert regions are similar. Asthma in children is strongly linked to the development of respiratory allergy. It is estimated that up to 90% of children with asthma have respiratory allergies, especially to indoor allergens such as house dust mite, Alternoria species, cockroach, or cat.19, 2n In addition, there is a strong correlation between the number of positive skin tests in children and the severity of asthma.54, With the recognition that allergy is often a continuum that begins in early infancy, a number of studies have been conducted to determine whether environmental exposures in infancy, or even in utero, can influence the risk of developing allergic diseases and asthma. These studies are discussed in the following sections. Cytokines in the Uterine Environment The uterus provides a unique immunologic environment that must foster growth of the developing fetus while protecting it from being rejected by maternal allogeneic T-cell responses. Cytokines generated in the uterus are likely to play a major role in this protective effect. For example, it has been demonstrated in the rodent that IL-4, IL-5, and IL-10 are all produced in the uterus or amnion during pregnancylOl; similar patterns of cytokine secretion have now been reported in human placental tissue.7, 4o These cytokines may serve to regulate maternal immune responses that would otherwise be deleterious. For example, IL-4 and IL-5 are Th-2-like cytokines that could downregulate maternal I F N y and tumor necrosis factor-alpha (TNF-a), cytokines that could potentiate cytotoxic responses. IL-10, which downregulates both Th-1 and Th-2 cytokine secretion from a variety of cell types, may be even more important for the induction of immune tolerance. The intrauterine cytokine milieu, which may protect the fetus from cytotoxic immune responses, is likely to also have effects on development of the fetal immune system. High levels of Th-2-like cytokines and IL-10 could reduce secretion of IFN-y and other Th-1 cytokines from the fetus, as well as the maternal immune system. These activities could have the net effect of biasing the neonatal immune response towards the production of Th-2-like cytokines that could promote allergy. This concept is supported by studies of cytokine production from neonatal T cells, which have generally been found to produce relatively low levels of IFN-y and overproduce Th-2-like cytokines. In addition, if maternal allergy causes a further deviation of the placental immune response towards Th-2-like cytokines, this effect could explain why the risk of developing allergic disease in childhood is more closely related to maternal allergy than to paternal allergy. Maternal Diet There is experimental evidence to support the concept that allergen sensitization can occur in utero. First, several cases have been reported in which young infants have developed allergic reactions upon their first ingestion of a specific food protein. Considering that IgE does not cross the placenta, one potential explanation for this phenomenon is that sensitization in utero via traces of antigenic proteins that circulate in the maternal circulation cross the placenta and sensitize fetal lymphocytes. To test this hypothesis, several studies have been conducted to detect neonatal allergen sensitization. In support of this, Warner et a1 demonstrated allergen-specific proliferative responses in cord blood lymphocytes.99 Although the latter findings suggest that fetal lymphocytes can be activated by allergenic proteins in the maternal circulation, positive responses do not necessarily indicate allergy, and these activated lymphocytes could just as well be cells involved in tolerance. In older children, positive lymphocyte responses to allergens can be found in both allergic and nonallergic individuals and have not been found to be useful discriminators of allergy. Additional research is needed to clarify the sigruficance and predictive value of lymphocyte responses in newborns. Finally, several clinical studies have tested the hypothesis that modifying the maternal diet during pregnancy could reduce the risk for subsequent allergy in the baby. Although this hypothesis is attractive, two large prospective, randomized, and controlled studies to examine the effect of third trimester hypoallergenic diets have had disappointing results. Both studies excluded egg and cow milk proteins from the maternal diet, and follow-up evaluations of the children up to age 5 years showed no effect on the incidence of cord blood IgE, skin test results, or the incidence of atopic disease^.'^, 48, 49 Studies to evaluate restricting the postnatal diet of children and breast-feeding mothers have been more successful and are discussed later. Maternal Cigarette Smoking The effects of cigarette smoking on the fetal pulmonary development are multiple. Smoking causes lower birth weights and corresponding reductions in lung size, and small lung size has been identified as a risk factor for wheezing lower respiratory illnesses in infancy.57 In addition to decreasing lung size, in utero exposure to tobacco smoke has been shown to reduce newborn lung function. To measure this effect, techniques have been developed to measure pulmonary function during resting tidal breathing in babies and infants at a very early age. The outcome variable that has been used most often to study the effects of tobacco on infant pulmonary function is the time to peak tidal expiratory flow as a proportion of the total expiratory time (TmF:TE); this index measures slowing of expiration by the combination of glottic narrowing and diaphragmatic tone and is reduced in adults with obstructive airway disease.59 Using these techniques, mild airway obstruction has been detected in infants born to smoking mothers within 3 days of birth, strongly suggesting that smoking causes reduced pulmonary function in the developing fetus.50,85 This concept is further supported by a study of Hoo et a1,% who evaluated pulmonary function prior to discharge in 108 preterm infants, 40 of whom were born to mothers who smoked during pregnancy. In this study, decreased TpTEF:TE was associated with exposure to tobacco smoke in utero, but not birth weight or length, and this relationship persisted in the multivariate analysis. Together, these studies provide compelling evidence that maternal cigarette smoking can harm developing lungs both before and after birth, and these effects are likely to contribute to increasing the risk of developing wheezing with viral infections and chronic asthma. Diet The incidence of food allergy is highest in the first few years of life, and because allergic reactions to most foods fade over time, the prevalence of food allergy begins to decrease after 3 years of age. These demographics suggest that prevention of food allergy is attainable if diets are modified to exclude highly allergenic foods during t+e first few years of life. Furthermore, because food allergy is followed in many cases by the appearance of respiratory allergy and asthma, it is conceivable that preventing food allergy might interrupt this progression. There have been numerous studies of the effects of dietary restrictions on the prevention of allergic diseases, but the findings of many of these studies are limited by inadequate controls, length of follow-up, or sample size. Two large well-designed studies have examined the effects of combined maternal and infant dietary restrictions, and have instructive findings. Chandra et aI8 prospectively followed 109 infants with allergic siblings. The mother's diet was restricted (no milk, egg, fish, beef, and peanut) during the third trimester of pregnancy and lactation, and infants were either exclusively breast-fed for 5 to 6 months or ate an unrestricted diet. At the 1-year follow-up visit, the group of children with the restricted diet tended to have a lower prevalence of eczema, and if eczema was present, its severity was significantly reduced. In a larger prospective study by Zeiger and Heller,'Q children of atopic parents were randomly assigned into an intervention (n = 103) or control (n = 185) group and completed a 2-year evaluation; results have been published for follow-up after 7 years for most of the study subjects. The intervention consisted of maternal avoidance of milk, egg, and wheat, with limited soy and wheat intake during lactation and breast-feeding. In addition, infants in the intervention group were breast-fed or given a casein hydrolysate formula until 12 months of age. Solid foods were introduced starting at age 6 months, but egg protein was withheld until 24 months of age or older, and peanut and fish were started after 36 months of age. Children in the intervention group had less atopic dermatitis and food allergy at 1 year of age ( Fig. 2), and allergy to cow's milk was reduced through 2 years of age. By age 7, there were no group-specific differences in the period prevalence of eczema and food allergy. Because of effects before the age of 2 years, the cumulative prevalence of food allergy remained lower at age 7, suggesting that the interventions did more than just delay the onset of food allergy and actually prevented some cases. Notably, changes in the infant diet did not reduce the incidence of allergic rhinitis and asthma by the age of 7 years. Together, these studies indicate that a hypoallergenic diet during lactation and infancy can reduce the prevalence of atopic dermatitis and food allergy in the first year or two of life. Considering the fact that other studies have shown that restricting the maternal diet during pregnancy is not helpful, it is clear that the beneficial effects seen in the studies by Chandra and Zeiger were caused by modifications in the postnatal diet. Although these results are promising, the practical significance of these findings is tempered by the fact that these effects were not of long duration, and the subsequent incidence of respiratory allergy was not affected. The ability to modulate immune responses with infant formula containing nucleotides has recently been of interest-; however, its potential ability to influence the development of allergic diseases in infancy and early childhood has yet to be evaluated. Whether or not breast-feeding can prevent childhood allergy has been debated since the 1930s, when Grulee and Sanfordz2 reported that breast-fed infants were at lower risk for developing asthma compared with infants that were fed cow's milk. Although the numerous studies in the interim have so far failed to resolve this issue,e5 several points are clear. First, because of multiple beneficial effects on growth, development, and the immune system, breast milk is the ideal infant diet98 and should be advocated regardless of the allergic history of the family. Second, food proteins consumed by the mother can be detected in breast milk, and this low level (nanogram quantities) of food protein is sufficient to cause allergen sensitization and to induce allergic symptoms in a subset of allergy-prone infants. Excluding highly allergenic foods such as cow's milk and egg from maternal diet dur$g lactation can reduce the infant's risk of food allergy and eczema and provides a preventive strategy for highly allergic families. Exposure to Inhaled Allergens Several epidemiologic studies have demonstrated that season of birth influences the subsequent development of respiratory allergy: children born in the spring are at increased risk for developing birch and grass allergy, whereas those born during ragweed season have an increased risk of ragweed allergy? These observations suggest that there may be a period during the first few months of life in which the immune system is particularly susceptible to developing Th-2-like T-cell responses to certain inhaled allergenic proteins. This concept is especially intriguing when one considers the temporal sequence of this process: The early exposure to allergenic proteins initiates a process that is not clinically evident for several years because pollen allergy is rarely diagnosed until children have reached school age. These findings, along with data derived from experimental models of sensitization in animals, suggest that early exposure to inhaled proteins initiate allergen-specific T-cell responses, but additional elements in the immune system, such as dendritic cells or other antigen-presenting cells, must mature before allergy to these proteins can develop." Alternately, the initial allergen-specific T-cell responses may require repeated restimulation, and the intermittent nature of pollen exposure could explain why hay fever takes longer to develop compared with allergy to either foods or perennial inhalants. Allergy and allergen exposure are closely associated with asthma in children. Observations from the United States and many other locations worldwide documented a close epidemiologic association between allergy to house dust mite and asthma. Furthermore, environmental controls to limit exposure to house dust mite proteins were found to reduce asthma disease activity in carefully controlled studies. Finally, Sporik et a1 conducted a large prospective study in which dust mite protein levels were measured in a large cohort of homes in the United Kingdom.= In this study, the degree of exposure to house dust mite protein during infancy was to an earlier onset of symptoms in children with asthma. Together, these studies provide evidence of a close epidemiologic relationship between house dust mite exposure and childhood asthma and imply a cause and effect relationship, suggesting that if house dust mite exposure could be controlled or eliminated, there would be less asthma. Enthusiasm for this approach has been tempered, however, by subsequent studies that demonstrated comparable or greater prevalences of allergic rhinitis and asthma in humid environments, where dust mites flourish, and in desert or inner city environments, where exposure to house dust mite protein is reduced or Indoor and Outdoor Air Pollution The data linking asthma and allergic rhinitis with exposure to indoor allergens and air pollutants are convincing. The most significant pollutant of indoor air is tobacco smoke, and active or passive exposure to smoke is associated with an increased incidence of many respiratory disorders, including asthma and The effect of outdoor air pollution and asthma and allergies is more controversial. Epidemiologic evidence linking increased rates of allergy and asthma to the inner city environment, and even the proximity of the home to major highways, suggests that air pollution enhances allergic sen~itization.'~, 68 In addition to these findings, there is now experimental evidence that diesel particles, and perhaps other pollutants as well, act as adjuvants to enhance production of Th-2-like cytokines and IgE production in cell culture and in the human in vivo.13, Contrary to these findings, however, is a large study conducted in Germany shortly after reunifi~ation.9~ German schoolchildren who presumably have a very similar genetic background but live in two different environments were evaluated for allergic sensitization and respiratory diseases. One group of children resided in Munich in the former West Germany, whereas the other group was from Halle, a city in the former East Germany with high levels of air pollution because of the burning of high-sulfur in home furnaces to provide heat. Although the total incidence of respiratory disease was greatest in the group from Halle, asthma and skin test positivity were nearly three times higher in the Munich schoolchildren. This study, like others, indicates that there are factors associated with the Western lifestyle that increase the risk for developing asthma and allergy. Furthermore, pollution did not seem to be associated with greater asthma or allergy. Clearly, air pollution is a complex entity, and it seems likely that individual pollutants may have divergent effects on the risk for developing allergy. Additional information is needed to determine the effects of specific pollutants or combinations of pollutants on rates of allergen sensitization. allergic rfiitis.10, 55,105,108 Infectious Diseases There is now evidence that viral infections in early childhood may also act on the immune system to modify the subsequent risk of allergen sensitization or asthma.n For example, several studies have shown that the odds of allergen sensitization are inversely related to the number of older siblings in the family, which presumably determines the frequency of exposures to infectious diseases in early childhood. 86,87,96 In addition, data from Africa indicate that measles infection in early childhood reduces the risk of allergen sensitization.m Some bacterial infections may have similar effects: Japanese schoolchildren who develop a strong positive tuberculin skin test after Calmette-Gu6rin bacillus (BCG) vaccination, possibly signifymg exposure to tuberculosis, also have reduced rates of allergy and asthma.81 Vaccination with either BCG or measles virus, however, is not associated with a reduced risk of atopy.', 81 In contrast to the implications of these studies, data indicate that severe infections with respiratory syncytial virus (RSV) may enhance allergen sensitiza-tion and the risk of developing asthma.sz Although not all studies have found RSV infections to increase the risk of allergy? 717102 these findings suggest that the effects of infections on the subsequent risk of developing allergies or asthma may depend on which pathogen infects the host early in immune development. In infants, infection with RSV has received much attention because of its predilection to produce a pattern of symptoms termed bronchiolitis, which parallels many of the characteristics of childhood and adult asthma. RSV causes about 70% of these episodes, and it is estimated that, by 1 year of age, 50% to 65% of children will have been infected with this virus.67 Children 3 to 6 months of age are most prone to develop lower respiratory tract symptoms, suggesting that a developmental component (e.g., lung or immunologic maturation) may be involved as ~e I l. 6~ The relationship between RSV infections during the first year of life and the subsequent development of the asthmatic phenotype has been the subject of much interest as well as controversy. Variations in reporting longitudinal outcomes (e.g., recurrent wheezing, measurements of airway hyperresponsiveness, diagnosis of asthma) appear to be influenced mostly b the criteria used to symptoms (in addition to B V, viruses that may contribute to the development of bronchiolitis in this age group could be the parainfluenza virus, coronavirus, influenza virus, and rhinovirus21), the age at the time of infection, the nature and severity of symptoms required for inclusion, and finally, the characteristics of both the study population (community versus hospital based) and the study design (retrospective versus prospective). A number of long-term prospective studies of children admitted to a hospital with documented RSV-induced bronchiolitis have shown that about 75% will experience wheezing in the first 2 years after the initial illness, more than 50% will still wheeze 3 years later, and approximately 40% continue to wheeze after 5 years.=, 29, 76, loo, Although some groups have found that those children most likely to have persistent wheezing were children born to atopic n,lll others have not.61,71 Although some have found that personal atopy is not more prevalent in symptomatic children after bronchiolitis,6' others have found that documented RSV bronchiolitis significantly increases a child's chances (32% versus 9% in controls) of subsequently developing IgE antibody83 or lymphocyte proliferative responses63 to both food and aeroallergens. RSV infections may interact with immunoinflammatory mechanisms involved in immediate hypersensitivity responses in a number of ways. First, it has been suggested that viruses capable of infecting lower airway epithelium may lead to enhanced absorption of aeroallergens across the airway wall predisposing to subsequent ~ensitization.'~, Second, RSV-specific IgE antibody formation may lead to mast cell mediator release within the airway, resulting in the development of bronchospasm and the ingress of eosinophils.18, 43, n, 95, Io3, Third, similar to various allergenic proteins, the processing of RSV antigens and their subsequent presentation to lymphocyte subpopulations may provide a unique mechanism of interaction to promote a Th-2-like response in a predisposed host. RSV belongs to the family Paramyxoviridae, the genera Pneumovirus, and can be differentiated into two serologic subgroups, A and B.67 It has 10 genes, with 12 potential gene products. The G (attachment) and F (fusion) proteins are the major surface glycoproteins against which neutralizing antibody is directed. Interestingly, in both murine3 and human38 in vitro experiments, it has been noted that the G protein elicits a predominant Th-2 response, whereas the F protein produces a predominant Th-1 response. In mice, to test the activities of define bronchiolitis. These criteria include the type o Y virus producing the T cells recognizing individual RSV proteins in vivo, virus-specific T-cell lines have been produced using recombinant vaccinia viruses that express either the G or F proteins. Following passive transfer of these cell lines to naive recipients and subsequent intranasal inoculation with RSV virus, mice receiving G-specific cells have more severe illnesses characterized by lung hemorrhage, pulmonary neutrophil recruitment, and intense pulmonary eosinophilia.2 These experiments are of interest based on the adverse clinical response noted in many infants who received a formalin-inactivated RSV vaccine and subsequently became infected with RSVQ These intriguing observations regarding RSV and its influence on Th-1 or Th-2 responses have recently been expanded. Roman et al" evaluated 15 hospitalized infants (1-15 months) with an acute lower respiratory tract infection caused by RSV. Compared with control infants, the infected children had a suppression of their IFN--y production and, although IL-4 production was also decreased, the IL-4IIFN-y ratio was sigruficantly increased. Renzi et aln prospectively followed 26 infants hospitalized with bronchiolitis by obtaining blood samples at the time of illness and 5 months later. Compared with age-matched control infants, infected patients had an increased percentage of CD4 +, CD25 +, and CD23 + lymphocytes at the 5-month follow-up. Plasma IL-4 levels, although initially not different from control patients, increased significantly in the infected children 5 months later. Blood lymphocytes, obtained during the time of bronchiolitis, produced less IFN-y in response to IL-2 in children who went on to develop a pattern of recurrent wheezing. Finally, peripheral blood lymphocytes from infants who had persistent wheezing produced more IL-4 in response to Demzatopkagoides farina antigen. Unfortunately, the pattern of cytokine response these infants had prior to infection was not evaluated, again begging the question as to which of the observed results may be cause and which may be effect. Thus, current observations in this area do not provide sufficient information to deduce causality and leave a number of important questions unanswered. Does cytokine dysregulation influence the immunologic response to RSV leading to more severe disease (i.e., bronchiolitis)? Does RSV infection promote the development of cytokine dysregulation, thereby increasing the risk of developing atopic disorders? Do imprinted patterns of cytokine secretion and RSV infections interact at a critical time point to establish a particular wheezing phenotype with future infections or exposures? Additional prospective studies are needed to determine whether childhood infections can cause lasting effects on the immune system to modulate the subsequent risk of allergy and asthma. Alternately, there may be immune factors, perhaps genetically determined, that regulate both the immune response to infections and the risk of developing allergies or asthma. PREDICTING ALLERGIC DISEASES IN CHILDREN If atopy is indeed a major risk factor for the development of asthma, the ability to measure some marker associated with the atopic trait would be beneficial, particularly if asthma has its roots in infancy and interventions aimed at primary prevention can be made a reality. Clearly, family history of allergy increases the risk of subsequent allergic diseases in children, and this has been demonstrated in several long-term prospective studies conducted in the United States and in Europe.12, 27, lO8 For example, Croner and Kjellman12 conducted a large prospective study in which 1,654 Swedish children were evaluated at birth and followed until the age of 11 years. The cumulative incidence of atopic diseases was 27"/0 in the group as a whole, but this increased to 43% in children with at least one "obviously atopic" parent (positive response to questions regarding atopic dermatitis, urticaria, food allergy, asthma, or allergic rhinoconjunctivitis). In this study, there was no difference in the prevalence of atopic diseases in children of atopic mothers or fathers, although some studies have found that maternal allergy has a greater effect on cord blood IgE levelsz5,39 and the development of asthma.% Many studies have investigated the utility of measuring cord blood IgE as a predictor of allergy in neonates with a positive family history. It has been documented in a number of studies that children with elevated cord blood IgE are at increased risk of developing atopic diseases.1z, 27,108 Finding other markers of atopy, such as increased eosinophils or basophils in nasal secretions, positive skin prick tests to egg protein, or atopic skin changes in infancy is also an indicator of increased risk for the subsequent development of asthma, allergic rhinitis, or other atopic disorders.28, Io7 Unfortunately, many or most children who eventually develop allergic diseases do not have identifiable atopic markers in infancy, and the low sensitivity of these tests makes them unsuitable for screening purposes. A common clinical problem in evaluating infants with wheezing illnesses is to determine which children will go on to develop chronic asthma, and total IgE levels have also been evaluated iri this regard. Martinez et a1 reported that elevated levels of IgE antibody at 9 to 12 months of age, but not in cord blood, are associated with an increased risk of recurrent wheezing that persists beyond 3 years of Although this finding suggests that total IgE levels could be useful as a prognosticator in infants with virus-associated wheezing, other indicators that do not require sampling of blood may be just as useful. For example, a history of infantile eczema or a maternal history of atopy have about the same prognostic significance value as an increase in total IgE, and unfortunately, combining these indicators does not increase the predictive value of these measurements.58 Levels of eosinophil cationic protein (ECP) in blood or nasal secretions have been evaluated as predictors of children at risk for additional episodes of wheezing. ECP levels are increased in the serum and nasal secretions of infants with bronchiolitis, and in children with symptoms of acute asthma. Infants with elevated ECP during acute wheezing illnesses in infancy are at increased risk for developing additional episodes of wheezing in short-term follow-up. For example, Koller et al" obtained serum for ECP determinations on 33 infants with no previous history of allergic disease and found that median ECP levels were four times higher in those infants who went on to develop recurrent wheezing in the following year. Additional studies are needed to evaluate whether increased ECP is associated with persistent asthma and whether this will be useful as a screening tool. Finally, abnormalities in the pattern of cytokine responses have been noted in infants at risk for developing allergy and asthma. Low IFN-.I production has been noted in cord blood cells from infants born to allergic parents75 and also is a risk factor for development of eczema and positive prick skin tests to allergens at 1 year of In addition, low FN-y and IL-2 production from peripheral blood mononuclear cells at 9 months of age are associated with an increased risk of developing allergen-specific IgE but not increased total serum IgE at 6 years of age.% These results have led to the hypothesis that cytokine dysregulation, and IFN-y deficiency in particular, may play a critical role in the pathogenesis of allergic diseases. So far, however, the techniques required to measure these factors are confined to research laboratories, and large-scale epidemiologic studies will be required to elucidate the value of these tests in clinical practice. RECOMMENDATIONS FOR THE PREVENTION OF ALLERGY As is alluded to throughout this article, there are large gaps in the current understanding of the pathogenesis of allergic diseases in children that have hindered the development of truly effective preventive strategies. Despite these shortcomings, there are sufficient data to support certain environmental modifications that are likely to reduce the risk of subsequent allergy and asthma. First, raising children in a smoke-free environment, beginning in utero, is likely to be the single most important intervention to reduce the rate of both allergic and nonallergic respiratory disorders in children. There are a growing number of options to support smoking cessation in parents and parents-to-be, and several excellent reviews of medical and supportive strategies to stop smoking have recently been 51 Second, modifying the diets of infants from allergic families, and lactating mothers, should be considered. Changes in the prenatal diet do not affect the risk for allergy and are unnecessary. Sensible dietary modifications for babies include breast-feeding, delaying the introduction of solid foods until 6 months of age, and withholding highly allergenic foods such as cow's milk, egg, and peanut for 2 to 3 years. Several formulas in which the protein source has been hydrolyzed to reduce antigenicity are listed in Table 1. These formulas may be used in a preventive fashion if the mother decides not to breast-feedlW or as alternatives to cow's milk or soy-based formulas after cessation of breast-feeding. Changing from breastmilk to a hypoallergenic formula seems to have little additional value, however, for infants who are breast-fed for longer than 6 months6 Hypoallergenic formulas have the disadvantages of being more costly than standard infant formulas and have a strong taste that some infants find unpalatable, especially if the infant was initially fed breastmilk. In infants older than 6 months of age, alternatives to hypoallergenic formulas include vitamin D and calcium-fortified rice milk or orange juice,. and these beverages are available in many health food stores and supermarkets. Finally, reducing the exposure to environmental allergens can reduce symptoms in patients who already have respiratory allergies, and although the data are as yet incomplete, there are early indications that they could prevent or delay the onset of respiratory allergy or asthma. For example, Hide et a1 have conducted a study in which 120 infants were prospectively enrolled to determine the effects of combined dietary and environmental interventions on the development of atopic disorders.=, 31 In the active group, infants and lactating mothers were prescribed hypoallergenic diets, and house dust mite protein levels were controlled with acaricides and mattress covers. In addition to having significantly less atopic dermatitis at 1, 2, and 4 years of age, the prophylactic group had less asthma at 1 year of age and fewer children with positive skin tests at age 4 years. These results need to be independently confirmed but suggest that limiting exposure to inhalant and dietary allergens may have additive effects in the prevention of childhood allergies. Sensible guidelines for limiting exposure to indoor respiratory allergens (that were designed for patients with existing asthma) have been proposed by the National Heart Lung and Blood Institute6* and can be considered for preventive therapy. These guidelines follow: Animal danders: Do not allow furred pets in the home. House dust mite Essential: Encase mattresses and pillows in allergen-impermeable covers and wash sheets and blankets in hot (2130°C) water every 7-14 days. Desirable: Reduce indoor humidity <50%, remove carpets from the bedroom and from concrete floors, and avoid sitting on uphoIstered furniture. Cockroaches: Use poison bait or traps to control; do not leave food or garbage exposed. Indoor mold: Fix all leaks and eliminate water sources associated with mold growth; clean moldy surfaces. Consider reducing indoor humidity to <50%. |
#pragma once
#include "../RenderWindow.h"
#include "sl.h"
#include "gs.h"
#include "../Imports.h"
void PatchSl(sl::context_t* context);
void PatchGs(gs::context_t* context, const RenderWindow& window);
void ReinstateLogging(void* dll, const Imports& symbols);
void InjectTraps(const Imports& symbols);
void Patch_SysUtil(void* dll, const Imports& symbols);
void Patch_CsGame(void* dll, const Imports& symbols);
void Patch_Misc(void* dll, const Imports& symbols); |
class Solution {
public:
int specialArray(vector<int>& nums) {
sort(nums.begin(),nums.end());
int n=nums.size();
vector<int> ans;
for(int i=0;i<n;i++)
{
ans.push_back(n-i-1);
}
for(int i=1;i<=nums[n-1];i++)
{
int temp = i;
int count=0;
for(int j=0;j<n;j++)
{
if(temp<=nums[j])
count++;
}
if(count==temp)
return temp;
}
return -1;
}
};
|
ROBYN BECK via Getty Images Native Americans ride with raised fists to a sacred burial ground that was disturbed by bulldozers building the Dakota Access Pipeline (DAPL) on September 4, 2016 near Cannon Ball, North Dakota.
Did that get your attention?
While America prides itself on its all-inclusive ideals, I dare to say that none of them apply to Native Americans.
Since the beginning of the European invasion of North America, there has been a long drawn out ethnic cleansing occurring in this part of the world.
We are a country that still celebrates Columbus day, people! Columbus was no friend to First Americans.
gen·o·cide / jenəˌsīd/ noun the deliberate killing of a large group of people, especially those of a particular ethnic group or nation. synonyms: mass murder, massacre
In the old days, the “Indian” problem was taken care of with disease, soldiers and guns. Presidential orders were signed, soldiers dispatched, bounties given to militia all with the singular purpose of killing Native Americans. It didn’t matter whether those natives were armed, unarmed, elderly, women or children.
According to the government and the collective consensus, the only good Indian was a dead Indian.
Any Native American who was able to survive the slaughters, diseases, internment, starvation and forced marches were relegated to reservations. Often these lands designated for reservations were not homelands nor extremely desirable lands.
This is the moment you can choose to listen to that roar of our voices, to recognize that we are people, we belong here and our cause is valid.
I wish I could say America has recognized its fault in practically wiping out an entire ethnic group. I wish I could say that amends have been made in ensuring that Natives have the best education, medical care and work opportunities in the country. I wish I could say that as a whole Native Americans are thriving. None of that rings true generations after Wounded Knee, The Long Walk or the Trail of Tears.
For those of you who have never set foot on a reservation, I urge you to visit one and I don’t mean a casino. I mean the dirt poor areas where water doesn’t run freely from a tap. It has to be hauled in over a rutted dirt road. Electricity... perhaps if you are lucky or have a generator. Don’t even think about the luxury of wi-fi. Please excuse the suspicious nature of its inhabitants... they have reason for that.
When I was a kid, I remember how many, many people were still living in shacks covered in tar paper. This wasn’t out in the middle of nowhere. This was in one of the bigger towns on the Navajo reservation. I went with my family down to Mexico once and marveled about how much it reminded me of the reservation. People there also lived in shacks that looked like they were built with found materials. Mexico was pretty close to third-world at that time.
The reservation has changed some since then but not enough. I am ever the optimist but at times I feel resigned that it won’t change. Lately, I’m feeling that resignation dissipating with the events unfolding in South Dakota.
It fills me with extreme pride to see so many tribes united in the cause that is the Standing Rock protest. Standing Rock isn’t just about oil. Standing Rock isn’t just about water. Standing Rock is a test. There is a roar coming from North Dakota. This is the moment you can choose to listen to that roar of our voices, to recognize that we are people, we belong here and our cause is valid.
So far the mainstream media has chosen to be fairly silent in reference to Standing Rock. Apparently, spray tan and non-truths play and pay better than warpaint and ethics. Much has been done to try and silence the voices of protesters at the site. Of the mainstream coverage that has emerged sparingly, one network has painted them as violent anarchists using white biased coverage (CBS, I’m talking about you). Never mind those attack dogs set loose on a little girl. She’s not your little girl though, so why should you care?
MSNBC’s Lawrence O’Donnell has been one of very few to broach the subject and do so in a stellar manner.
Some of you might be offended by my characterization of America and feel like this doesn’t represent you. If that is the case, then I challenge you. I challenge you to do something! Recognize it, talk about it, and share it! Sign a petition, attend a protest, challenge your lawmakers, donate to the cause. Turning a blind eye or worse yet assuming it’ll work itself out only perpetuates the notion that Native Americans aren’t human, don’t belong here and should cease to exist altogether. |
Baltimore County Executive Roger B. Hayden arrives a bit later in the morning, but his workdays have been stretching into nights again.
He returned to work part time last week after brain surgery May 23 but is now working virtually full-time a week ahead of schedule and, Mr. Hayden said, he's not feeling fatigued.
"Now I feel like I did before the surgery," he said Wednesday, relaxing in his office with a can of ginger ale instead of the Coca Cola he once favored. That's one minor change his medical situation has wrought -- no more caffeine -- a habit that he acknowledges had nearly become an addiction.
Mr. Hayden has resumed attending some community meetings at night. He spoke at last Thursday night's police recruit class graduation and on Saturday opened a Dundalk campaign headquarters and attended an Edgemere parade.
After working 10 a.m. to 3 p.m. the first few days, he has found his days quickly stretching to 10 hours each, he said. On $H Monday night, he didn't quit until after a community meeting in Lansdowne that lasted until nearly 10 p.m., Mr. Hayden said.
But the 49-year old executive said things never will get as hectic as they were before the blood vessel broke in his head May 8. No more three community meetings a night, or working seven days a week.
"The big guy smiled down on me," he said of the brain surgery that successfully removed the malformed blood vessels on his brain, leaving him with just a minor right side vision loss and shorter hair.
"This has changed my life," he said, adding that he now finds it easier to concentrate on what he has, rather than what he's missing. "I just spend more time being thankful." |
/**
* Inserts an item into the list box, specifying an initial value for the
* item. Has the same effect as
*
* <pre>
* insertItem(item, null, value, index)
* </pre>
*
* @param item
* the text of the item to be inserted
* @param value
* the item's value, to be submitted if it is part of a
* {@link FormPanel}.
* @param index
* the index at which to insert it
*/
public void insertItem(String item, String value, int index) {
listBox.insertItem(item, value, index);
if (initialized) {
initializeMaterial(listBox.getElement());
}
} |
/**
* Execute commands outside of Java. Execute the commmand and it returns the
* output. Access 'lastExitVal' to determine what the exit status was.
*
* @author David Moss
* @author Miklos Maroti
* @author Matthias Woehrle
*/
public class CmdExec {
/** Logging */
private static Logger log = Logger.getLogger(CmdExec.class);
/** The exit value from the last command executed */
public static int lastExitVal = 0;
/** Capture the output stream from the running process */
private static StreamCapture outputCapture = null;
/** Capture the error stream from the running process */
private static StreamCapture errorCapture = null;
/**
* Execute a command using the default environment.
* This command will block until finished.
*
* @param cmd
* @return
* @throws IOException
*/
@SuppressWarnings("unchecked")
static public String[] runBlockingCommand(String cmd) throws IOException {
log.info(cmd);
List tokenList = new ArrayList();
String token = "";
boolean inQuote = false;
for (int i = 0; i < cmd.length(); i++) {
if (token.length() > 0
&& (i == cmd.length() || (cmd.charAt(i) == ' ' && !inQuote))) {
tokenList.add(token);
token = "";
} else {
if (token.length() != 0 || cmd.charAt(i) != ' ')
token += cmd.charAt(i);
if (cmd.charAt(i) == '"')
inQuote = !inQuote;
}
}
String[] tokens = (String[]) tokenList.toArray(new String[0]);
Process proc = Runtime.getRuntime().exec(tokens);
outputCapture = new StreamCapture(proc.getInputStream(), "Output");
errorCapture = new StreamCapture(proc.getErrorStream(), "Error");
try {
// Wait for process to terminate and catch any Exceptions.
lastExitVal = proc.waitFor();
log.debug("Exit Value: " + lastExitVal);
} catch (InterruptedException e) {
log.error("Command was interrupted");
}
log.debug("Done executing " + cmd);
return (outputCapture.getCaptured() + errorCapture.getCaptured())
.split("\n");
}
/**
* Execute a command given the environment variables to work with as well.
* This command will block until finished.
*
* @param cmd
* @param env
* @return
* @throws IOException
*/
@SuppressWarnings("unchecked")
static public String[] runBlockingCommand(String cmd, String env)
throws IOException {
log.info(cmd);
String[] tokens = properlyTokenize(cmd);
String[] envarray = createEnvironment(env);
Process proc = Runtime.getRuntime().exec(tokens, envarray);
outputCapture = new StreamCapture(proc.getInputStream(), "Output");
errorCapture = new StreamCapture(proc.getErrorStream(), "Error");
try {
// Wait for process to terminate and catch any Exceptions.
lastExitVal = proc.waitFor();
log.debug("Exit Value: " + lastExitVal);
} catch (InterruptedException e) {
log.error("Command was interrupted");
}
log.debug("Done executing " + cmd);
return (outputCapture.getCaptured() + errorCapture.getCaptured())
.split("\n");
}
/**
* Convert the output and error String[] to a String you can print to the
* screen.
*
* @param output
* @return
*/
static public String outputToString(String[] output) {
String str = "";
for (int i = 0; i < output.length; i++) {
str += output[i] + "\n";
}
return str;
}
/**
* The StringTokenizer will cut everything up, even text between quotes.
* We need to make sure that text within a quote stays intact as one single
* token to be passed as a complete argument. So we setup this method
* to properly tokenize a string that possibly contains quotes.
*
* This helps stuff work on linux.
*
* @param cmd The string to tokenize
* @return A string[] of each element, properly tokenized
*/
@SuppressWarnings("unchecked")
static private String[] properlyTokenize(String cmd) {
boolean inQuote = false;
List tokenList = new ArrayList();
String quoteToken = "";
String[] rawCmdArray = cmd.split(" ");
for (int i = 0; i < rawCmdArray.length; i++) {
if(rawCmdArray[i].length() == 0) {
// Get rid of array elements that were spaces to begin with
continue;
}
if (!inQuote && !rawCmdArray[i].startsWith("\"")) {
tokenList.add(rawCmdArray[i]);
} else {
inQuote = true;
// Remove all quotes, add a space, and add it to our quoteToken
quoteToken += rawCmdArray[i].replaceAll("\"","") + " ";
if (rawCmdArray[i].endsWith("\"")) {
inQuote = false;
tokenList.add(quoteToken);
quoteToken = "";
}
}
}
return (String[]) tokenList.toArray(new String[0]);
}
/**
* Create the environment variable from the existing environment plus
* whatever is passed in manually. This is to work on other OS's like
* mac's or ubunto
*
* @param env
* @return
*/
@SuppressWarnings("unchecked")
static private String[] createEnvironment(String env) {
List envList = new ArrayList();
Entry entry;
for(Iterator it = System.getenv().entrySet().iterator(); it.hasNext(); ) {
entry = (Entry) it.next();
envList.add((String) entry.getKey() + "=" + (String) entry.getValue());
}
if (env != null) {
envList.add(env.replaceAll("\"",""));
}
return (String[]) envList.toArray(new String[0]);
}
} |
Smokeless tobacco consumption in the South Asian population of Sydney, Australia: prevalence, correlates and availability. UNLABELLED AIM.: The aim of this study was to estimate the prevalence and identify correlates of smokeless tobacco consumption among the South Asian residents of Sydney, Australia. METHODS A cross-sectional survey was conducted using a pretested, self-administered mailed questionnaire among members of Indian, Pakistani and Bangladeshi community associations in Sydney. RESULTS Of 1600 individuals invited to participate, 419 responded (26%). Prevalence rates of ever consumption, more than 100 times consumption and current consumption were 72.1%, 65.9% and 17.1%, respectively. Men (74.3%) were more likely to ever consume than women (67.6%). Over 96% of consumers reported buying smokeless tobacco products from ethnic shops in Sydney. Current consumption of smokeless tobacco products was associated with country of birth: Indians (odds ratio 5.7, 95% confidence interval 2.3-14.5) and Pakistanis (odds ratio 3.1, 95% confidence interval 1.5-6.5) were more likely to be current consumers than Bangladeshis after adjusting for sociodemographic variables. For ever consumption, there was a positive association with age (P for trend=0.013) and male gender (odds ratio 2.1, 95% confidence interval 1.5-3.1). CONCLUSIONS Given the availability of smokeless tobacco and the high prevalence and potential adverse health consequences of consumption, smokeless tobacco consumption may produce a considerable burden of non-communicable disease in Australia. Effective control measures are needed, in particular enforcement of existing laws prohibiting the sale of these products. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.