content
stringlengths 7
2.61M
|
---|
Mechanisms of intra-dialyser granulocyte activation: a sequential dialyser elution study. INTRODUCTION During haemodialysis (HD), an early and transient white blood cell (WBC) reduction is noted in the peripheral blood, which has been attributed mainly to the sequestration of polymorphonuclear cells (PMN) in the pulmonary vasculature. However, WBC also adhere to the dialyser, as demonstrated before in an elution study performed after HD. In the present study, we investigated if intradialyser WBC sequestration contributes to the WBC nadir in the blood shortly after the start of HD and whether or not different mechanisms underlie PMN adherence in dialyser and lung. In addition, PMN degranulation was analysed not only in peripheral blood but also in dialyser eluates (DE). SUBJECTS AND METHODS Dialysers were eluted after 7 1/2 (DE-7 1/2) and 180 (DE-180) min of HD in eight patients. Blood samples were taken before HD (t0), and at t7 1/2 and t180. Besides WBC count and differentiation, PMN adhesion (CD11b and CD62L) and degranulation markers (CD63 and CD66b) were assessed by flow cytometry. RESULTS In the blood, a WBC fall was noted at t7 1/2 (from 5.8 to 4.8 x 10/l; absolute about 5 x 10 cells). DE contained 3.0 x 10 cells at t7 1/2, and 57.2 x 10 at t180 (P = 0.015). As for CD11b, at t7 1/2 both in the blood and DE an increased expression was observed, as compared to t0 (P = 0.01); CD11b expression in DE-7 1/2 was higher than in DE-180 (P = 0.025). In contrast, CD62L showed downregulation only in DE both at t7 1/2 (mean fluorescence intensity (MFI) PB 4172 and DE-7 1/2 2353, P = 0.01), and at t180 (MFI 794, P = 0.03 versus DE-7 1/2), when compared to blood at t0. As for degranulation markers, an increase was observed in blood at t7 1/2 (MFI CD63 from 357 to 506, P = 0.02; CD66b from 507 to 794, P = 0.001), in comparison with t0. Eluted PMN at t7 1/2 showed a higher expression of CD63 than PMN in blood at t7 1/2 and DE-180 (MFI in DE-7 1/2 1280 and blood 506, P = 0.003). The expression of CD66b was increased in DE-7 1/2 (MFI 1803 versus blood 794, P = 0.01), and even more in DE-180 (MFI 2763, P = 0.002), when compared to blood. CONCLUSIONS From these data it is concluded first, that intradialyser PMN sequestration does not contribute markedly to the WBC nadir in the circulation. Second, intradialyser PMN trapping appears to result primarily from non-adhesion-molecule-mediated factors, as indicated by an increased expression of CD11b at t7 1/2 on eluted PMN associated with low cell numbers in DE, and normalized CD11b expression at t180 associated with considerably higher cell numbers in DE. Third, HD-induced degranulation seems to be a complex phenomenon. After a rapid transient onset, characterized by an early upregulation of CD63 and CD66b on PMN leaving the dialyser, degranulation continues within the device as indicated by an additional rise in the expression of CD66b on PMN in DE-180. |
<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
from Parser import Parser
def main(argv):
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='')
parser.add_argument('-i', '--input', type=str, default='')
parser.add_argument('-d', '--delimiter', type=str, default=',')
parser.add_argument('-p', '--pipe', action='store_true')
args = parser.parse_args()
# Parser:
Parser(args.input, args.redis_cmd, args.delimiter, args.pipe)
if __name__ == "__main__":
main(sys.argv[1:])
<commit_msg>Add specific required-property to all arguments
<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
from Parser import Parser
def main():
# Arguments:
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--redis_cmd', type=str, default='', required=True)
parser.add_argument('-i', '--input', type=str, default='', required=False)
parser.add_argument('-d', '--delimiter', type=str, default=',', required=False)
parser.add_argument('-p', '--pipe', action='store_true', required=False)
args = parser.parse_args()
# Parser:
Parser(args.input, args.redis_cmd, args.delimiter, args.pipe)
if __name__ == "__main__":
main()
|
<reponame>frostace/firmiana<gh_stars>0
import axios from 'axios';
class Service {
url: string;
constructor() {
this.url = 'http://47.98.224.122:8888/places';
}
getAllEstates() {
return axios({
method: 'get',
url: `${this.url}`,
});
}
getSingleEstate(params: any) {
const { id } = params;
return axios({
method: 'get',
url: `${this.url}/${id}`,
});
}
putEditEstate(params: any, config?: any) {
const { id, ...data } = params;
return axios({
method: 'put',
url: `${this.url}/${id}`,
data,
});
}
postCreateNewEstate(params: any, config?: any) {
return axios({
method: 'post',
url: `${this.url}`,
data: params,
});
}
deleteSingleEstate(params: any, config?: any) {
const { id } = params;
return axios({
method: 'delete',
url: `${this.url}/${id}`,
});
}
}
export default new Service();
|
<filename>src/scene/title.c
#include "saturn_engine/_lib.h"
#include "_global.h"
#include "scene/title.h"
#include "input.h"
//static bool jumptomaptest;
static saten_menu *menu;
static saten_object bg;
void scene_title_init(void)
{
saten_key_lock(-1); // Lock all keys
saten_sprite_texturize(RES(IMG_TITLE_BACKGROUND));
int w = saten_get_text_width(RES(TEXT_TITLE_PROMPT_KEYB));
// +1 is language modifier (assumed scenario)
saten_text_posw(RES(TEXT_TITLE_PROMPT_KEYB+1), 320/2 - w/2, 200);
// saten_bgm_posw(6.3);
saten_bgmplay(RES(BGM_DEMO_TITLE));
// Menu test
menu = saten_menu_create(SATEN_MENU_MATR, SATEN_MENU_LEFT,
20, 20, SATEN_MENU_LOOP);
//saten_menu_icon_offsetw(menu, 0, 12); // Vert menu
//saten_menu_icon_offsetw(menu, 12, 0); // Hori menu
saten_menu_matrixs(menu, 3, 2);
saten_menu_pads(menu, 64, 16);
saten_menu_frames(menu, 1, 1);
saten_menu_element_add(menu, RES(TEXT_TITLE_MENU_GAME),
SATEN_MENU_TEXT);
saten_menu_element_add(menu, RES(TEXT_TITLE_MENU_SHOP),
SATEN_MENU_TEXT);
saten_menu_element_add(menu, RES(TEXT_TITLE_MENU_SCORE),
SATEN_MENU_TEXT);
saten_menu_element_add(menu, RES(TEXT_TITLE_MENU_SETTING),
SATEN_MENU_TEXT);
saten_menu_element_add(menu, RES(TEXT_TITLE_MENU_REPLAY),
SATEN_MENU_TEXT);
saten_menu_element_add(menu, RES(TEXT_TITLE_MENU_QUIT),
SATEN_MENU_TEXT);
//saten_menu_max(menu, 3);
//saten_menu_intervalw(menu, 20);
saten_menu_toggle(menu); // Turn menu on
saten_menu_element_toggle(menu, 4); // Replay turned off..
saten_object_set_sprite(&bg, RES(IMG_TITLE_BACKGROUND));
saten_scene_start(saten_scene_self());
}
void scene_title_update(bool c)
{
// unlock buttons when user stopped giving input for even a frame
if (!saten_input_check())
saten_key_unlock(-1);
// or unlock buttons after a number of frames
if (saten_scene_frame_count() >= 260)
saten_key_unlock(-1);
if (c) {
if (input(cancel) == 1) {
saten_key_lock(-1);
saten_scene_quit_from(saten_scene_self());
}
saten_menu_update(menu);
}
}
void scene_title_draw(void)
{
saten_object_draw(&bg);
saten_text_draw(RES(TEXT_TITLE_PROMPT_PAD));
saten_menu_draw(menu);
}
void scene_title_quit(void)
{
saten_bgmstop();
}
|
It has come out one of the men who died in the Mawgan Porth tragedy was a surgeon who had tried to pull others to safety.
Dad of four Stuart Calder was on holiday in Cornwall with his family when he got caught in a rip current.
Friends say it was "absolutely characteristic" of the 52 year old to try to help.
Mr Calder worked at Leeds hospital and was involved in teaching and training junior surgeons.
He and two other adults were pulled from the water on Sunday afternoon, but they could not be saved.
An off duty lifeguard from Devon has described how he gave Mr Calder CPR until emergency crews arrived.
Brendon Prince: "We ran to the first person and dragged them out of the water with one or two other people helping.
"The gentleman was a 52 year old male. Obviously we sent for a defibrillator and paramedics as soon as we could.
"We then did CPR on the male for 20 minutes before the emergency services arrived and, obviously, the air ambulance was first on the scene."
The names of a man and woman in their forties from St Austell have not yet been released.
A spokesperson for Devon and Cornwall Police said: "The deaths are not being treated as suspicious as such police are investigating on behalf of the Coroner.
"As part of this investigation police will be at Mawgan Porth Village Hall, October 28th from 11am until 2pm.
"We would encourage anyone who feels they may have information that could assist the investigation to call into the village hall and speak to officers."
The RNLI has released lifeboat footage of the search and rescue operation on Sunday afternoon. |
def on_use_this_profile(self, *args):
self.selected_config = self.interface.content.current_panel.config
self.settings_changed = True |
n = int(input())
count = [0]*(n+1)
P = map(int, (input() for _ in range(n)))
for p in P:
count[p]=count[p-1]+1
print(n - max(count)) |
In the Qur'an, the detailed tenets ranging from 21 to 38 in the Chapter, or "Surah," An-Naml comprehensively describe in terms of the time the importance of data collection, data analysis, and the use of diplomatic tools, threats and displays of power to defend the state's security and national interests. Today, however, new strategies must be pursued in conjunction with these practices to cope with emerging challenges.
According to scholars, among various new factors that directly affect the global system today, one of the most important is the steady migration of talented, ambitious individuals and innovative organizations to urban centers around the world. These new forces and actors are influencing the capabilities and international relations of the nation-states in which they take root. As a result, each state must now formulate new strategies and practices to safeguard its important national interests, and possibly even its survival.
The number of highly capable individuals migrating to major global urban centers is increasing day by day, exerting a growing influence on each national government's capabilities. Such persons take full advantage of learning opportunities, media channels, and social media, and are therefore well acquainted with global trends. Global urban migration is in fact booming, and it is estimated that by the year 2050 fully 70% of the world's population may be living in its major cities.
As individuals settle into these cities in greater and greater numbers, they become more and more engaged, influential and powerful. They establish organized networks, create economic booms, and help their cities gain global importance. Their contributions are already clear in places like Dubai, Beijing, Mumbai, New York and other mega-city centers.
Scholars believe that, if this trend continues, issues that were once only local to the cities involved will rise to the level of global significance. They will affect inter-state relations, and thereby influence a state's international policies. A recent example is the massive public demonstration in Istanbul against the construction of Gazi Park.
Given the booming trend to settlement in the world's major cities, preserving the state's national interests and even its survival are quickly becoming significant concerns. As a response to those concerns, it would seem that what is needed first is a comprehensive approach to potential internal and external challenges. Principally, focus should be placed on internal non-state actors who attempt to influence national policies. A second major concern should be actors and organizations that are prominent in international economic affairs.
(a) Coordination among national capitals, which is important because of the technical and communications facilities in these centers. Diplomatic missions in the capitals can oversee the coordination, thereby lessening the possibility of any deterioration in inter-state relations.
(b) National governments should identify individuals and organizations engaged in systematic efforts to increase their influence, cooperating with them to the extent necessary to relieve grievances and avoid miscalculations.
(c) National governments should ally themselves with actors that appear to have important influence in foreign countries and should work with them to help make that influence redound to their own benefit. Although such an approach seems counterproductive to some reasonable policy makers, it seems to me a realistic strategy for upholding the state's national interests and ensuring its survival.
(d) It will be necessary to keep a close eye on local conditions in foreign lands and to plan viable strategies accordingly.
In conclusion, I should emphasize that the most robust diplomatic efforts are required to avoid the potential debacle for state national interests and survival that can result from the systematic efforts of individuals and organizations to increase their influence, or appropriate political power, in their continuing settlement in major cities around the world. Coordination among national capitals is perhaps the best way to safeguard the national interests and survival of states while also maintaining good state-to-state relations. |
"""This file contains the code for the flask server hosting the visualizations and the event ledger."""
import functools
import logging
import flask
import itertools as it
from stellarisdashboard import datamodel
logger = logging.getLogger(__name__)
VERSION = "v2.1"
def parse_version(version: str):
main_version, _, prerelease = version.lstrip("v").partition("-")
result = []
for v in main_version.split("."):
try:
result.append(int(v))
except ValueError:
pass
if prerelease:
result.append(prerelease)
return result
def is_old_version(requested_version: str, actual_version=VERSION) -> bool:
"""Compares the requested version against the VERSION defined above."""
try:
actual_parsed = parse_version(actual_version)
requested_parsed = parse_version(requested_version)
for a, r in it.zip_longest(actual_parsed, requested_parsed):
if a is None or a < r:
return True
elif r is None or a > r:
return False
return False
except Exception:
return False
def get_most_recent_date(session):
most_recent_gs = (
session.query(datamodel.GameState)
.order_by(datamodel.GameState.date.desc())
.first()
)
if most_recent_gs is None:
most_recent_date = 0
else:
most_recent_date = most_recent_gs.date
return most_recent_date
@functools.lru_cache()
def preformat_history_url(text, game_id, a_class="textlink", **kwargs):
href = flask.url_for("history_page", game_id=game_id, **kwargs)
return f'<a class="{a_class}" href={href}>{text}</a>'
|
Fort Le Duc
Geography
The fort was located by the junction of Mineral Creek and Adobe Creek off of the Hardscrabble Trail, an old Native American trail at the foot of Greenhorn Mountain. The trail went through the Wet Mountain Valley and Sangre de Cristo Mountains.
History
Maurice LeDuc was a French Canadian who married a Ute woman. It is believed that he may have obtained money to start the fort and trading post from the Bent brothers, Charles and George Bent. LeDuc had several circumstances that helped him succeed at the site. The Mexican government licensed him to trade, he was able to purchase the moonshine Taos Lightning, and his wife had many Native American friends who traded at the post.
The fort was 144 feet (44 m) wide, made of picket lots, and had bastions at the corners. There were wooden gates on the west side of the building that led to a 48-square foot central plaza. An adobe house within the enclosure provided living quarters. The fort, with eight rooms, protected settlers from often hostile Native Americans. It was in service until 1848 or 1854, when settlements such as Hardscarabble were established in the area. There are no remains of the fort today.
A historical marker was installed in 1969 in recognition of Fort Le Duc by the Arkansas Valley Chapter of the Daughters of the American Revolution, Colorado Department of Highways, and Colorado Historical Society. It is located seven miles south of Florence. The historical marker is entitled "Hardscrabble". |
Changing face of hemolytic anemia in newborn The spectrwm of hemolytic anemia in the)lewborn has changed significantly in the li:ist 30 years. Rh hemolytic disease was the commonest cause of hemolysis in the newborn in the past. Routine anti D prophylaxis in Rh negative mothers has reduced the incidence of Rh alloimmunisation dramatically. ABO hemolytic disease and hemolysis due to minor blood group antigens have emerged as important causes. With closer collabori:ition between neonatologists and hematologists, non immune causes of hemolysis such as G6PD and pyruvate kinase deficiency are increasingly being recognized. Antenatal blood group genotyping and non invasive monitoring of fetal anemia have simplified the monitoring of 'at risk' fetuses. Newer and better postnatal theraeeutic interventions have improved the outcome of newborns with hemolytic anemia and its consequences such as hyperbilirubinemia. |
export enum WindowAction {
Minimize = "window.minimize",
Maximize = "window.maximize",
Restore = "window.restore",
Close = "window.close"
}
export interface FileSelection {
canceled: boolean;
filePaths: string[];
}
export interface OpenFileSelectorOptions {
directory?: boolean;
}
export interface OpenTerminalOptions {
command?: string;
// terminal inside machine
machine?: string;
}
export interface ProxyServiceOptions {
http?: boolean;
keepAlive?: boolean;
}
export interface GlobalUserSettings {
startApi: boolean;
minimizeToSystemTray: boolean;
path: string;
logging: {
level: string;
};
connector: {
default: string | undefined;
};
}
export interface GlobalUserSettingsOptions extends GlobalUserSettings {
program: Partial<Program>;
engine: Partial<ContainerEngine>;
}
export interface Controller {
name: string;
path?: string;
version?: string;
scope?: string;
}
export interface Program {
name: string;
path?: string;
version?: string;
title?: string;
homepage?: string;
}
export interface EngineConnectorApiSettings {
baseURL: string;
connectionString: string;
}
export interface EngineConnectorSettings {
api: EngineConnectorApiSettings;
program: Program;
controller?: Controller;
}
export interface EngineUserSettingsOptions {
id: string; // engine client instance id
settings: Partial<EngineConnectorSettings>;
}
export interface EngineApiOptions {
adapter: ContainerAdapter;
engine: ContainerEngine;
id: string; // engine client instance id
//
scope: string; // ControllerScope Name
baseURL: string;
connectionString: string;
}
export interface EngineProgramOptions {
adapter: ContainerAdapter;
engine: ContainerEngine;
id: string; // engine client instance id
//
program: Partial<Program>;
controller?: Partial<Controller>;
}
export interface SystemConnection {
Identity: string;
Name: string;
URI: string;
}
export interface ProgramOutput {
stdout?: string | null;
stderr?: string | null;
}
export interface ProgramExecutionResult {
pid: number;
success: boolean;
stdout?: string;
stderr?: string;
command: string;
code: number;
}
export interface TestResult {
subject: string;
success: boolean;
details?: any;
}
export interface ProgramTestResult extends TestResult {
program?: {
path: string;
version: string;
}
scopes?: ControllerScope[];
}
export interface Machine {
Name: string;
Active: boolean;
Running: boolean;
LastUp: string;
VMType: string;
Created: string;
}
export interface WSLDistribution {
Name: string;
State: string;
Version: string;
Default: boolean;
Current: boolean;
}
export interface LIMAInstance {
Name: string;
Status: string;
SSH: string;
Arch: string;
CPUs: string;
Memory: string;
Disk: string;
Dir: string;
}
export type ControllerScope = Machine | WSLDistribution | LIMAInstance;
export enum Platforms {
Browser = "browser",
Linux = "Linux",
Mac = "Darwin",
Windows = "Windows_NT",
Unknown = "unknown"
}
export enum ContainerAdapter {
PODMAN = "podman",
DOCKER = "docker",
}
export enum ContainerEngine {
PODMAN_NATIVE = "podman.native",
PODMAN_SUBSYSTEM_WSL = "podman.subsystem.wsl",
PODMAN_SUBSYSTEM_LIMA = "podman.subsystem.lima",
PODMAN_VIRTUALIZED = "podman.virtualized",
PODMAN_REMOTE = "podman.remote",
// Docker
DOCKER_NATIVE = "docker.native",
DOCKER_SUBSYSTEM_WSL = "docker.subsystem.wsl",
DOCKER_SUBSYSTEM_LIMA = "docker.subsystem.lima",
DOCKER_VIRTUALIZED = "docker.virtualized",
DOCKER_REMOTE = "docker.remote",
}
export interface EngineConnectorSettingsMap {
expected: EngineConnectorSettings;
user: Partial<EngineConnectorSettings>;
current: EngineConnectorSettings;
}
export interface Connector {
id: string;
adapter: ContainerAdapter;
engine: ContainerEngine;
availability: {
all: boolean;
engine: boolean;
api: boolean;
program: boolean;
controller?: boolean;
report: {
engine: string;
api: string;
program: string;
controller?: string;
}
};
settings: EngineConnectorSettingsMap;
scopes?: ControllerScope[];
}
export interface ApplicationDescriptor {
environment: string;
version: string;
osType: Platforms;
provisioned: boolean;
running: boolean;
// computed
connectors: Connector[];
currentConnector: Connector;
userSettings: GlobalUserSettings;
}
export interface ConnectOptions {
startApi: boolean;
id: string;
settings: EngineConnectorSettings;
}
export interface ContainerClientResult<T = unknown> {
success: boolean;
result: T;
warnings: any[];
}
export interface Distribution {
distribution: string;
variant: string;
version: string;
}
export interface SystemVersion {
APIVersion: string;
Built: number;
BuiltTime: string;
GitCommit: string;
GoVersion: string;
OsArch: string;
Version: string;
}
export interface SystemPlugin {}
export interface SystemPluginMap {
[key: string]: SystemPlugin;
}
export interface SystemInfoHost {
os: string;
kernel: string;
hostname: string;
distribution: Distribution;
}
export interface SystemInfoRegistries {
[key: string]: string[];
}
export interface SystemInfo {
host: SystemInfoHost;
plugins: SystemPluginMap;
registries: SystemInfoRegistries;
store: any;
version: SystemVersion;
}
export interface ContainerStats {
read: string;
preread: string;
pids_stats: any;
blkio_stats: {
io_service_bytes_recursive: any[];
io_serviced_recursive: null;
io_queue_recursive: null;
io_service_time_recursive: null;
io_wait_time_recursive: null;
io_merged_recursive: null;
io_time_recursive: null;
sectors_recursive: null;
};
num_procs: number;
storage_stats: any;
cpu_stats: {
cpu_usage: {
total_usage: number;
percpu_usage: number[];
usage_in_kernelmode: number;
usage_in_usermode: number;
};
system_cpu_usage: number;
online_cpus: number;
cpu: number;
throttling_data: {
periods: number;
throttled_periods: number;
throttled_time: number;
};
};
precpu_stats: {
cpu_usage: {
total_usage: number;
usage_in_kernelmode: number;
usage_in_usermode: number;
};
cpu: number;
throttling_data: {
periods: number;
throttled_periods: number;
throttled_time: number;
};
};
memory_stats: {
usage: number;
max_usage: number;
limit: number;
};
name: string;
Id: string;
networks: {
network: {
rx_bytes: number;
rx_packets: number;
rx_errors: number;
rx_dropped: number;
tx_bytes: number;
tx_packets: number;
tx_errors: number;
tx_dropped: number;
};
};
}
export interface ContainerInspect {
Env: string[];
}
// See libpod/define/podstate.go
export enum ContainerStateList {
CREATED = "created",
ERROR = "error",
EXITED = "exited",
PAUSED = "paused",
RUNNING = "running",
DEGRADED = "degraded",
STOPPED = "stopped",
}
export interface ContainerState {
Dead: boolean;
Error: string;
ExitCode: number;
FinishedAt: string;
Healthcheck: {
Status: string;
FailingStreak: number;
Log: any;
};
OOMKilled: boolean;
OciVersion: string;
Paused: boolean;
Pid: number;
Restarting: boolean;
Running: boolean;
StartedAt: string;
Status: ContainerStateList;
}
export interface ContainerPort {
containerPort: number;
hostPort: number;
hostIP: string;
// alternative - why ?!?
container_port: number;
host_port: number;
host_ip: string;
range: number;
protocol: string;
}
export interface ContainerPorts {
[key: string]: ContainerPort;
}
export interface ContainerNetworkSettingsPorts {
HostIp: string;
HostPort: string;
}
export interface ContainerNetworkSettingsPortsMap {
[key: string]: ContainerNetworkSettingsPorts[];
}
export interface ContainerNetworkSettings {
EndpointID: string;
Gateway: string;
IPAddress: string;
IPPrefixLen: number;
IPv6Gateway: string;
GlobalIPv6Address: string;
GlobalIPv6PrefixLen: number;
MacAddress: string;
Bridge: string;
SandboxID: string;
HairpinMode: false;
LinkLocalIPv6Address: string;
LinkLocalIPv6PrefixLen: number;
Ports: ContainerNetworkSettingsPortsMap;
SandboxKey: string;
}
export interface ContainerNetworkSettings {
EndpointID: string;
Gateway: string;
IPAddress: string;
IPPrefixLen: number;
IPv6Gateway: string;
GlobalIPv6Address: string;
GlobalIPv6PrefixLen: number;
MacAddress: string;
Bridge: string;
SandboxID: string;
HairpinMode: false;
LinkLocalIPv6Address: string;
LinkLocalIPv6PrefixLen: number;
Ports: ContainerNetworkSettingsPortsMap;
SandboxKey: string;
}
export interface ContainerConnectOptions {
id: string;
title?: string;
shell?: string;
}
export interface Container {
AutoRemove: boolean;
Command: string[];
Created: string;
CreatedAt: string;
ExitCode: number;
Exited: false;
ExitedAt: number;
Id: string;
Image: string;
ImageName?: string;
ImageID: string; // For Docker API it is prefixed by sha256:
IsInfra: boolean;
Labels: { [key: string]: string } | null;
Config: ContainerInspect;
Stats: ContainerStats | null;
Logs?: string[] | null;
Mounts: any[];
Names: string[];
Name?: string;
Namespaces: any;
Networks: any | null;
Pid: number;
Pod: string;
PodName: string;
Ports: ContainerPorts;
Size: any | null;
StartedAt: number;
State: ContainerStateList | ContainerState;
Status: string;
//
NetworkSettings?: ContainerNetworkSettings;
Kube?: string;
// Computed
Computed: {
Name?: string;
Group?: string;
NameInGroup?: string;
DecodedState: ContainerStateList;
}
}
export interface ContainerGroup {
Id: string; // uuid v4
Name?: string;
Items: Container[];
Report: { [key in ContainerStateList]: number };
}
export interface ContainerImageHistory {
id: string;
created: string;
Created: string;
CreatedBy: string;
Size: number;
Comment: string;
}
export interface ContainerImage {
Containers: number;
Created: number;
CreatedAt: string;
Digest: string;
History: ContainerImageHistory[]; // custom field
Id: string;
Labels: {
maintainer: string;
} | null;
Names: string[];
NamesHistory?: string[];
ParentId: string;
RepoTags?: string[];
SharedSize: number;
Size: number;
VirtualSize: number;
// computed
Name: string;
Tag: string;
Registry: string;
// from detail
Config: {
Cmd: string[];
Env: string[];
ExposedPorts: {
[key: string]: number;
};
StopSignal: string;
WorkDir: string;
};
// Docker specific
RepoDigests?: string[];
}
export interface SecretSpecDriverOptionsMap {
[key: string]: string;
}
export interface SecretSpecDriver {
Name: string;
Options: SecretSpecDriverOptionsMap;
}
export interface SecretSpec {
Driver: SecretSpecDriver;
Name: string;
}
export interface Secret {
ID: string;
Spec: SecretSpec;
CreatedAt: string;
UpdatedAt: string;
}
export interface Volume {
Anonymous: boolean;
CreatedAt: string;
GID: number;
UID: number;
Driver: string;
Labels: { [key: string]: string };
Mountpoint: string;
Name: string;
Options: { [key: string]: string };
Scope: string;
Status: { [key: string]: string };
}
export interface ContainerImagePortMapping {
guid: string;
container_port: number;
host_ip: string;
host_port: number;
protocol: "tcp" | "udp" | "sdp";
}
export interface ContainerImageMount {
driver: "local";
device?: string;
type: "bind" | "tmpfs" | "volume" | "image" | "devpts";
source?: string;
destination: string;
access?: "rw" | "ro";
size?: number;
}
export const MOUNT_TYPES = ["bind", "tmpfs", "volume", "image", "devpts"];
export const MOUNT_ACCESS = [
{ title: "Read only", type: "ro" },
{ title: "Read / Write", type: "rw" }
];
export enum PodStatusList {
CREATED = "Created",
ERROR = "Error",
EXITED = "Exited",
PAUSED = "Paused",
RUNNING = "Running",
DEGRADED = "Degraded",
STOPPED = "Stopped",
DEAD = "Dead",
}
export interface PodContainer {}
export interface PodProcessReport {
Processes: string[];
Titles: string[];
}
export interface Pod {
Cgroup: string;
Created: string;
Id: string;
InfraId: string;
Labels: { [key: string]: string };
Name: string;
NameSpace: string;
Networks: string[];
Status: PodStatusList;
Pid: string;
NumContainers: number;
Containers: PodContainer[];
// computed
Processes: PodProcessReport;
Kube?: string;
Logs?: ProgramOutput;
}
export interface SystemStore {
configFile: string;
containerStore: {
number: number;
paused: number;
running: number;
stopped: number;
};
}
export interface SystemPruneReport {
ContainerPruneReports: any;
ImagePruneReports: any;
PodPruneReport: any;
ReclaimedSpace: number;
VolumePruneReports: any;
}
export interface SystemResetReport {}
export interface FindProgramOptions {
engine: ContainerEngine;
id: string; // connector id
program: string;
scope?: string;
}
export interface GenerateKubeOptions {
entityId: string;
}
export interface CreateMachineOptions {}
export interface FetchMachineOptions {
Name: string; // name or id
}
export interface ContainerClientResponse<T = unknown> {
ok: boolean;
status: number;
statusText: string;
data: T;
headers: {[key: string]: string};
}
export interface ContainerClientResult<T = unknown> {
success: boolean;
result: T;
warnings: any[];
}
export interface ProxyRequest {
request: any;
baseURL: string;
socketPath: string;
engine: ContainerEngine;
adapter: ContainerAdapter;
scope?: string;
}
export interface NetworkIPAMOptions {
[key: string]: string;
}
export interface NetworkSubnetLeaseRange {
end_ip: string;
start_ip: string;
}
export interface NetworkSubnet {
gateway: string;
lease_range: NetworkSubnetLeaseRange;
subnet: string;
}
export interface Network {
created: string;
dns_enabled: boolean;
driver: string;
id: string;
internal: boolean;
ipam_options: NetworkIPAMOptions;
ipv6_enabled: boolean;
labels: { [key:string]: string};
name: string;
network_interface: string;
options: { [key:string]: string};
subnets: NetworkSubnet[];
}
export interface SecurityVulnerability {
Severity: string;
Published: string;
Description: string;
VulnerabilityID: string;
PrimaryURL: string;
// injected
guid: string;
}
export interface SecurityReportResultGroup {
Class: string;
Target: string;
Type: string;
Vulnerabilities: SecurityVulnerability[];
// injected
guid: string;
}
export interface SecurityReportResult {
Results: SecurityReportResultGroup[];
}
export interface SecurityReport {
provider: string;
status: "success" | "failure";
fault?: {
details: string;
error: string;
};
result?: SecurityReportResult;
scanner: {
database: {
DownloadedAt: string;
NextUpdate: string;
UpdatedAt: string;
Version: string;
},
name: string;
path: string;
version: string;
},
counts: {
CRITICAL: number;
HIGH: number;
MEDIUM: number;
LOW: number;
}
}
export default interface Application {
setup: () => any;
minimize: () => void;
maximize: () => void;
restore: () => void;
close: () => void;
exit: () => void;
relaunch: () => void;
openDevTools: () => void;
openFileSelector: (options?: OpenFileSelectorOptions) => Promise<FileSelection>;
openTerminal: (options?: OpenTerminalOptions) => Promise<boolean>;
getEngine: () => Promise<ContainerEngine>;
// settings
setGlobalUserSettings: (settings: Partial<GlobalUserSettings>) => Promise<GlobalUserSettings>;
getGlobalUserSettings: () => Promise<GlobalUserSettings>;
setEngineUserSettings: (id: string, settings: Partial<EngineConnectorSettings>) => Promise<EngineConnectorSettings>;
getEngineUserSettings: (id: string) => Promise<EngineConnectorSettings>;
getPodLogs: (Id: string, tail?: number) => Promise<ProgramExecutionResult>;
generateKube: (Id: string) => Promise<ProgramExecutionResult>;
getControllerScopes: () => Promise<ControllerScope[]>;
getMachines: () => Promise<Machine[]>;
connectToMachine: (Name: string) => Promise<boolean>;
restartMachine: (Name: string) => Promise<boolean>;
stopMachine: (Name: string) => Promise<boolean>;
startMachine: (Name: string) => Promise<boolean>;
removeMachine: (Name: string) => Promise<boolean>;
createMachine: (opts: any) => Promise<Machine>;
inspectMachine: (Name: string) => Promise<Machine>;
getSystemInfo: () => Promise<SystemInfo>;
connectToContainer: (item: ContainerConnectOptions) => Promise<boolean>;
testProgramReachability: (opts: EngineProgramOptions) => Promise<ProgramTestResult>;
testApiReachability: (opts: EngineApiOptions) => Promise<TestResult>;
findProgram: (opts: FindProgramOptions) => Promise<Program>;
pruneSystem: () => Promise<SystemPruneReport>;
resetSystem: () => Promise<SystemResetReport>;
// proxy
proxyHTTPRequest: <T>(request: ProxyRequest) => Promise<T>;
checkSecurity: (opts?: any) => Promise<SecurityReport>;
// startup
start: (opts?: ConnectOptions) => Promise<ApplicationDescriptor>;
};
|
A derivative of myelinassociated glycoprotein in cerebrospinal fluid of normal subjects and patients with neurological disease A procedure for quantitating the myelinassociated glycoproiein (MAG) in cerebrospinal fluid (CSF) was developed. The procedure involved immunoprecipitation with rabbit polyclonal antiMAG antiserum followed by immune staining of electroblots with the monoclonal antibody HNK1. This method could detect as little as 2 ng of MAG per ml of CSF and could accurately measure levels of 5 ng/ml or greater. No intact MAG was detected in any of the CSF samples examined, but all samples contained the 90K dalton proteolytic derivative of MAG called dMAG. Samples from normal volunteers and patients with demyelinating diseases contained levels of dMAG ranging from 2 to 13 ng/ml. There was no correlation of dMAG levels with levels of myelin basic protein or with active demyelinating disease. The relatively high levels of dMAG, even in control CSF samples, probably resulted from normal physiological turnover of MAG and could possibly obscure any additional increments of MAG or dMAG release that might occur as a result of demyelination. |
/**
* Ensures can link {@link SubSectionObject} to the {@link SectionObject}.
*/
public void testLinkSubSectionObjectToSectionObject() {
this.recordIssue("OFFICE.SECTION.SUB_SECTION.OBJECT", SectionObjectNodeImpl.class,
"Section Object OBJECT linked more than once");
this.replayMockObjects();
SubSectionObject object = this.node.addSubSection("SUB_SECTION", new NotUseSectionSource(), SECTION_LOCATION)
.getSubSectionObject("OBJECT");
SectionObject sectionObject = this.node.addSectionObject("OUTPUT", Connection.class.getName());
this.node.link(object, sectionObject);
assertObjectLink("sub section object -> section object", object, sectionObject);
this.node.link(object, this.node.addSectionObject("ANOTHER", String.class.getName()));
assertObjectLink("Can only link once", object, sectionObject);
this.verifyMockObjects();
} |
void parserTest();
void kvTest();
void loggerTest();
void network_server_test();
void network_client_test();
|
This collection of interactive maps shows credit rating for each country.
What is Credit Rating?
A credit rating estimates the credit worthiness of an individual, corporation, or even a country. A credit rating is also known as an evaluation of a potential borrower's ability to repay debt, prepared by a credit rating agency (CRA). Credit ratings are calculated from financial history and current assets and liabilities. Typically, a credit rating tells a lender or investor the probability of the subject being able to pay back a loan.
What is Credit Rating Agency (CRA)
A credit rating agency (CRA) is a company that assigns credit ratings for issuers of certain types of debt obligations as well as the debt instruments themselves. In some cases, the servicers of the underlying debt are also given ratings.
Standard & Poor's, Moody's Investor Service and Fitch Ratings are the big three credit rating agencies. Moody's and S&P each control about 40 percent of the market. Third-ranked Fitch Ratings, which has about a 14 percent market share, sometimes is used as an alternative to one of the other majors.
Updated: Jan 2012 |
Chief exec says plans deferred as company assesses prospects for the metal's price.
Oman's Sohar Aluminium, part-owned by a unit of global miner Rio Tinto, has put the second phase of its plant on hold for now as the company assesses prospects for the metal, its chief executive said on Sunday.Sohar Aluminium, a $2.4 billion joint venture located in Oman's Sohar industrial port, completed the first phase of the project in February and is operating at full production capacity of 360,000 tonnes per year.
"However with regards to our phase two expansion plans, which will add another 360,000 tonnes to our capacity, we still don't have a set timeline for that," Sohar Aluminium Chief Executive Bruce Hall told Reuters in a telephone interview. "We just started operating at full capacity a few months back so we will wait and see how the market reacts," he added.
Sohar Aluminium is a joint venture between the Oman Oil Company, the Abu Dhabi Water and Electricity Authority (ADWEA) and Rio Tinto Alcan, a unit of Rio Tinto.
Like many commodities, the price of aluminium has fallen sharply in the global downturn. Since last year prices have dropped more than 50 percent to around $1450 per tonne from $3300, Hall said.
"Let's just say we are not going to be making the amount of revenue that we would have hoped for, but we have no plans to cut our production," he added.
He said individual shareholders had told him they wanted to go ahead with phase two.
Around 60 percent of the existing plant's production is used for downstream industries, while the remaining 40 percent will be sold by Rio Tinto Alcan to markets in the Far East, Hall added.
"So we don't really have a direct relationship with the consumers. All the production is sold as part of the Rio Tinto marketing monster," he said.
Asked how the company aims to deal with new supply from within the region, Hall said: "At this point it's just going to be the survival of the fittest, and I do expect a number of companies not only in the region but on a global level to cut production." |
DES MOINES, Iowa (AP) _ Presidential candidate Mitt Romney said Wednesday he'd welcome Fred Thompson into the race for the GOP presidential nomination.
Romney said Thompson, an actor and former senator from Tennessee, would add interest to the race. Thompson served two terms in the Senate but is best known as the district attorney on NBC's drama "Law & Order."
"I'm probably not a good political pundit to know what is going to happen precisely," Romney said during the taping of an Iowa Public Television show. "I think he'll make the race more interesting. He's got good ideas and after all, he does put bad people in jail every week on 'Law and Order.'"
Romney has tried to position himself as the most conservative Republican candidate. Asked if Thompson's entry into the race would hurt his plan, Romney said, "I think everybody in the Republican field is conservative."
Earlier in the day, Romney repeated his call to add more troops, saying the Iraq war had left the nation's military seriously stressed.
The former governor of Massachusetts said he supported President Bush's decision to intervene in Iraq, but conceded that the effort has had plenty of missteps.
"I think we've made a number of mistakes," said Romney, opening a two-day campaign trip to Iowa by speaking to a business group. "We were underprepared for what developed. I don't think we had anywhere near enough troops."
Romney said he supports adding at least 100,000 troops to the military.
The idea of pulling American troops out of Iraq is "very tempting," Romney said, but doing so would lead to a larger conflict in the region.
Romney said he was willing to give the president's plan of increasing troops in Iraq time to work, potentially as long as the end of the year.
"If it's working we'll all celebrate that," said Romney.
Romney was also asked about his effort as governor to broaden health coverage. He said the Massachusetts plan could serve as a model for the nation, but as president he would be reluctant to impose solutions on the states.
"My inclination would be to let the states try their own plans," said Romney. "We're going to give them flexibility." |
/*
* Copyright (c) by Valaphee 2019.
*
* Licensed under the 4-clause BSD license (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://deploy.valaphee.com/license/BSD-4-Clause.txt
*
* THIS SOFTWARE IS PROVIDED BY VALAPHEE "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
*/
package com.valaphee.cyclone.communication.packet;
import com.valaphee.cyclone.communication.Packet;
import com.valaphee.cyclone.communication.PacketBuffer;
import java.util.UUID;
/**
* Default
*
* @author valaphee
*/
public final class ServerStopAndUnregisterPacket
implements Packet<PacketProtocolSubscriber>
{
private UUID addressee;
private UUID server;
public ServerStopAndUnregisterPacket()
{}
public ServerStopAndUnregisterPacket(final UUID addressee, final UUID server)
{
this.addressee = addressee;
this.server = server;
}
public UUID getAddressee()
{
return addressee;
}
public UUID getServer()
{
return server;
}
@Override
public void read(final PacketBuffer buffer)
{
addressee = buffer.readGUID();
server = buffer.readGUID();
}
@Override
public void write(final PacketBuffer buffer)
{
buffer.writeGUID(addressee);
buffer.writeGUID(server);
}
@Override
public void handle(final PacketProtocolSubscriber subscriber)
{
subscriber.serverStopAndUnregister(this);
}
}
|
Oral anticoagulation continuation compared with heparin bridging therapy among high risk patients undergoing implantation of cardiac rhythm devices: a meta-analysis. It was the objective of this study to systematically compare the effects of oral anticoagulation (OAC) with heparin bridging therapy among patients at high risk for thromboembolism undergoing implantation of cardiac rhythm devices. A systematic search of PubMed/MEDLINE, Ovid and Elsevier, and the Cochrane Library databases was conducted. Six trials that met our inclusion criteria were identified and included in the present study. The endpoints of this meta-analysis included pocket haematoma, severe haematoma requiring drainage/revision, thromboembolic events, and length of hospital stay. Data were expressed as odds ratios (ORs) and 95% confidence interval (CIs). There was a statistically significant reduction of pocket haematoma (OR 0.29, 95% CI: 0.17 to 0.49, p<0.00001) and haematoma drainage/revision (OR 0.15, 95%CI: 0.04 to 0.54, p=0.004), respectively, in the OAC continuation group versus the heparin bridging group. We did not detect any statistically significant differences of thromboembolic events (OR 0.48, 95%CI: 0.07 to 3.54, p=0.48) in the two groups. There was a trend that patients in bridging group had longer hospital stays. In conclusion, OAC continuation had a better risk-beneficial ratio and shorter length of hospital stay, and was more convenient to implement compared with heparin bridging therapy among patients at high risk for thromboembolism undergoing implantation of cardiac rhythm devices. |
<filename>ratelimit_test.go
package r8lmt_test
import (
"fmt"
"strconv"
"time"
"github.com/joshuanario/r8lmt"
)
func ExampleNewLimiter() {
in := make(chan interface{})
out := make(chan interface{})
t := time.Second
s := r8lmt.THROTTLE
bw := r8lmt.RESERVEFIRST
lmtr := r8lmt.NewLimiter(out, in, t, s, bw)
str := strconv.FormatBool(lmtr.Reservation.IsExtensible)
fmt.Printf("IsExtensible: %s\n", str)
str = lmtr.Reservation.Duration.String()
fmt.Printf("Duration: %s\n", str)
go func() {
time.Sleep(100 * time.Millisecond)
in <- struct {
text string
}{
text: "foobarfoobar",
}
}()
foo := <-out
stim, ok := foo.(struct {
text string
})
if !ok {
panic("Type assertion failed")
}
str = stim.text
fmt.Printf("Stimulus: %s\n", str)
// Output: IsExtensible: false
// Duration: 1s
// Stimulus: foobarfoobar
}
|
Ontario Premier Dalton McGuinty has announced a smaller cabinet, as he prepares to return to the legislature.
Dalton McGuinty will run the government of Ontario with a smaller group of cabinet ministers.
The Ontario premier released his list of cabinet appointments on Wednesday evening. There will be six fewer ministers in his new minority government - in fact the smallest cabinet in Ontario since 1998.
A government source said McGuinty had picked experienced people to lead the ministries. "It's a strong, steady group that's focused on jobs and economy growth," the source said.
Dwight Duncan will hold on to his posts as finance minister and as deputy premier, while Kathleen Wynne and Bob Chiarelli will take on double duty.
Wynne, the MPP for Don Valley West, will head two ministries - municipal affairs and housing, as well as the ministry of aboriginal affairs.
Chiarelli, from Ottawa, will head the ministry of transportation and the ministry of infrastructure.
Toronto MPP Laurel Broten was handed the always sensitive education portfolio.
Health - the ministry that eats up the largest slice of the budget pie - will continue to be handled by Deb Matthews.
Brad Duguid moves from energy to economic development. Chris Bentley, who had been attorney general, take over Duguid's former post.
Before this month's election the Ontario Liberal cabinet had 28 members - including 11 women.
The new cabinet is reduced to 22 members, along with the premier. |
. Twenty six cases of primary uterine sarcomas treated between 1980-1990 are analyzed. There were 16 cases (62%) of endometrial stromal sarcoma, 8 cases (31%) of leiomyosarcoma and 2 cases (7%) of botryoid rhabdomyosarcoma. Symptoms of uterine sarcoma are presented. In 19 patients (73%) pathological diagnosis was obtained by endometrial curettage before surgery. Stage of disease was classified according to intraoperative scale of Lewis. Median survival for the whole group treated surgically, by radiotherapy and chemotherapy was 22.2 months. Five patients (19%) in whom the disease was limited to the endometrium survived more than 5 years. Recurrences of the neoplasm and their treatment by secondary cytoreductive surgery are described. |
CNT-based tapered optical fiber for ethanol remote sensing over 3-km optical fiber Certain organic liquids like ethanol in water are considered hazardous and have an enormous environmental impact since it is toxic and classified as class I flammable liquids. Remote sensing with complex sensors is a common technique for detecting and tracking spillages of hazardous spillages. Most of the applied remote sensing methods suffer from location and control issues that force the user to be at the exact sensing spot during operation. The present work introduces a simple and highly sensitive tapered multimode optical fiber (TMOF) sensor coated with carbon nanotubes (CNT) for flammable liquids remote sensing applications. The new proposed sensor ability to transfer signals to a remote data collection center of about 3 km from the sensor location was investigated. Ethanol was utilized as the index solution to be tested in the present work. The proposed sensor was attached to 3 km multimode silica optical fiber and characterized towards different concentrations of ethanol in de-ionized water at room temperature. Various characterization techniques have investigated the detailed structural properties of the sensing layer. The experimental results demonstrated that the proposed remote sensor exhibits rapid response with recovery times of 8.7 s and 18 s, respectively, and relative absorbance of 26% upon exposure to 100% ethanol. The sensor attains an overall sensitivity of 1.3/vol% towards low ethanol concentrations in water (0.01e0.5%). Besides, the optical sensor manifests outstanding repeatability when exposed to another cycle of ethanol with concentrations of 20% and 40% in de-ionized water. The proposed optical remote sensors superior performance via low cost and simple techniques indicates its high efficiency for ethanol detection in various industrial applications. © 2021 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). nuc.edu.iq (A.L. Khalaf). by Elsevier B.V. This is an open access article under the CC BY license (http:// j o u r n a l o f m a t e r i a l s r e s e a r c h and t e c hno l o g y 2 0 2 1 ; 1 2 : 1 7 3 8e1 7 4 6 1739 Introduction Ethanol is a clear, colorless, flammable, and one of the typical volatile organic compounds used in many applications directly attached to daily human activities, including fuel, beverage, food, and pharmaceutical industries. Recently, ethanol production has risen substantially due to the rise in demand for hand sanitizers due to Coronavirus's ongoing pandemic. This growing demand for ethanol production will raise concerns regarding possible misusing practices by individuals and industrial facilities, causing massive spillage and pollution challenges in the near future. Standard ethanol sensors are electrically based and widely reported in the chemical sensing literature . For example, an electrical-based ethanol sensor was reported using two Au electrodes coated with SnO 2 as a sensing layer prepared by a facile hydrothermal method. The sensor showed a response of 24.9 with rapid response and recovery times of 3 s and 24 s, respectively, toward 100 ppm of ethanol at 230 C operating working temperature. Kuchi and co-workers introduced an electrochemical ethanol sensor based on a different ratio of PbS: SnS 2 nanocomposite was investigated at room temperature. They showed that the reported sensor's response was 45.64e100.3% upon exposure to 60e1600 ppm of ethanol. On the other hand, Dimitrov and his team introduced an electrochemical sensor using two plane-parallel electrodes coated with ZnO and ZnO doped with copper (Cu) thin films. Even though these sensors are considered as an economically feasible solution to the ethanol detection problem, but they still suffer from several drawbacks that restrict their use in practical applications, for instance, no remote sensing facility, high operating temperature, low selectivity, and prone to electromagnetic interference that can be addressed by an optical sensor. Many of the mentioned drawbacks associated with the electrical-based sensors are addressed using chemical sensing aided by optical fibers. Optical fibers chemical sensors attracted much attention in the past few years due to their low manufacturing and operation costs, compact size, ability to work in a harsh environment, and remote and distributed sensing . The main concept of optical fiber remote chemical sensing is to continuously detect, observe and verify the behavior of target chemical from a central station located away from the sensor's critical site without the need for electrical power feeds in the remote locations. Thus, it allows instant hazard detection compared with the currently used electrical remote sensor, which suffers from complexity and slow response times. Manipulating the optical fiber structure can further improve the sensing performance by increasing the light travels in the fiber core and/or having a long interaction length. Therefore, many configurations have been reported, for example, uncladded, tapered, and side-polished optical fibers. Among these configurations, tapered optical fiber is gaining more attention in the sensor designs due to its simplicity of fabrication and ability to operate without a complex setup. Moreover, the tapered fiber small waist diameter can improve the sensor performance by promoting the interaction of evanescent waves with the external medium. Besides, the loss of light propagation is minimal due to its uniform cylindrical structure. Thus, tapered optical fiber sensors represent a suitable candidate for a seamless sensing system solution with exceptional performance. Nanomaterials have proven their efficacy in improving the performance of optical sensors for chemical and biological molecules . Several reports have found that coating TMOF with nanomaterials may dramatically enhance the sensor's efficiency . The optical sensors show significant sensing performance regarding response time and sensitivity due to the alteration in the chemical, physical, and optical features resulting from the interaction between the active layer coated on the tapered optical fiber and the analyte molecules. Table 1 summarized some of the recently published results of an in-site optical fiber sensor using different optical fiber structures coated with various nanomaterials as a sensing layer to detect ethanol in water. The comparison between the sensor's performance shows that the sensors exhibited good optical performance using simple in-site preparation toward high ethanol concentrations only (5e100%). Despite that, all the listed results are insitu optical fiber sensors. The limit of detection (LOD) and shelf life for most of the devices reported in the table were not mentioned. Despite all the distinguished advances and continuous developments reported in remote sensing using optical fibers j o u r n a l o f m a t e r i a l s r e s e a r c h a n d t e c h n o l o g y 2 0 2 1 ; 1 2 : 1 7 3 8 e1 7 4 6, kilometers-based sensors are still not well investigated. An ethanol TMOF sensor over 3 km optical fiber will be introduced and experimentally investigated in the present work. The 3 km optical fiber will be integrated into an TMOF coated with CNT to detect low ethanol concentrations in water via a simple experimental setup. TMOF preparation In this work, a standard multimode optical fiber (62.5 mm core and 125 mm cladding) was tapered via the heat and pull principle using Vytran (Glass Processing System, Model: GPX-3000, USA) optical glass processing workstation. This machine is supported with a real-time system that provides users complete control over the uniformity of the tapers and dimension to obtain a waist diameter and length of 30 mm and 20 mm, respectively, with fixed up and down taper of 2 mm, as illustrated in Fig. 1(a). Concisely, the bare fiber's protective coating was first removed using a fiber stripper for several centimeters and then cleaned with alcohol to eliminate any residuals. The fiber was then placed on the Vytran machine where the area to be tapered just above the filament, and the two ends of the optical fiber fixed to the fiber holding stage. After softening the fiber by the filament heat, the holding stage begins to pull the fiber ends. The power of the filament heater and pulling speed were kept constant at 38 W and 1 mm/s, respectively, to ensure the reproducibility of the tapers. Fig. 1(b) shows the scanning electron microscope (SEM) image of the proposed TMOF. The obtained tapered fiber was kept in a dry cabinet secured onto a sample holder with the tapered area hovering in the middle of the sample holder. Preparation and deposition of CNT sensing layer To formulate carbon nanotubes (CNTs), Pristine Multi-walled carbon nanotubes (MWCNTs) (purchased from Hangzhou Company, China) were chemically treated by sulfuric acid (H 2 SO 4 ). The formulated CNTs contain different carbolic acid groups (COOH) contents attached to the surface and the ends of the CNTs, making them ideal for molecular bonding with other materials. Chemically treated CNTs were dispersed in ethanol using ultrasonication for 1 h at room temperature. Before starting with the coating process, the fiber was heated in a 70 C oven for 15 min, and then the tapered area was mounted on a hot plate with a temperature of 50 C to ensure homogeneous distribution and formation of the CNT sensing layer. CNT solution of 2 ml with a concentration of 0.25 mg/ml was sprayed onto the tapered area via a simple airbrush kit. The sensor was then returned to the oven for 1 h at 70 C and kept in a closed environment at room temperature for 24 h to dry before usage. CNT micro-nano characterization Field emission scanning electron microscope (FESEM), energydispersive X-ray spectroscopy (EDX), atomic force microscope (AFM), Raman spectroscopy analysis (WITec, Alpha 300 R) using a laser excitation source with l 532 nm), transmission electron microscopy (TEM), and High-Resolution Transmission Electron Microscopy (HRTEM) were all employed to characterize the CNT coating. The CNT sensing layer's roughness was also investigated via AFM by covering a portion of the tapered area with aluminum tape during the spray coating process to distinguish between the coated and uncoated area TMOF. 3. Result and discussion Fig. 3 shows the FESEM characterization of the proposed optical sensor. Fig.3(a) indicates that the CNT successfully adhered to the surface of the TMOF with no defects, thereby confirming the effective deposition of the sensing layer onto the proposed optical fiber. From Fig. 3(b), it can be observed that the CNTs appear as long, densely, and tangled nanotubes formed into bundles with high porosity. Therefore, the active layer has a high surface area and provides more sites for the ethanol molecules. CNT characterization results To better understand the deposited material's elemental compositions of the proposed CNT sensing layer deposited onto TMOF, EDX analysis was performed. The inset figure (Fig. 3(b)) reveals the existence of Carbon (C) and Oxygen (O) peaks, which affirms that there is no damage or contamination to the sample. Fig. 4(a) shows that the coating's average roughness was found to be 60.85 nm, and the thickness of the proposed sensing layer was approximately 1.8 ± 0.32 mm. On the other hand, Fig. 4(b) depicts the proposed sensing layer's Raman spectrum, which shows the strong characterization peaks (D, G, and G) of CNT. The D-band located at 1349 cm 1 proves defects on the CNT sidewalls; thus, the nanotubes exhibited a certain degree of disorder. The G-band, which is located at 1588 cm 1, corresponds to the stretching mode of the eCCe bond in the graphitic nature of the synthesized sample and indicates that the C atoms are well-ordered. Furthermore, this band is typically the most intense peak in the CNT Raman spectrum. Another peak was observed around 2700 cm 1. This peak is the G band, which is the overtone of the defect-induced D band resulting from double resonant Raman scattering with two-photon emission. The well-defined intensity of G and D bands indicates that the CNT exhibited a well-ordered stacking of layers. Fig. 5 shows that the CNT's inner and outer diameters were in the range of 9.5 and 26 nm, respectively, and the number of walls was 24, as shown in Fig. 5(b). The outcomes confirm that the CNT was pure with no impurities and that it was long, cylindrical in shape, entangled with different bends and curvatures due to its long structural length and hollow in the middle of the tube. Conclusively, the characterization results show that the formulated CNT completely coated the optical fiber, remained undamaged, and retained its properties after the coating and annealing processes as well as during the tests. Fig. 6 e Absorbance vs wavelength of the CNT based TMOF remote sensor exposed to different aqueous ethanol concentrations ranging from 0 to 100% at room temperature. 3.2. TMOF sensor performance Fig. 6 shows the absorbance versus wavelength of the CNTbased TMOF remote sensor upon exposure to different concentrations of ethanol diluted in DI water ranging from 0 to 100% at room temperature (25e26 C). The results show that the absorbance decreases significantly as the ethanol concentration increases over the wavelength range between 500 and 800 nm. A noticeable dip occurred in the absorbance spectrum of the CNT coating in the range of 721 nme774 nm. This can be attributed to the changes in the refractive index of the proposed coating. The TMOF remote sensor's dynamic response was achieved by integrating the absorbance change over a wavelength between 500 and 800 nm. From Fig. 7(a), the absorbance change increased correspondingly with ethanol concentration, which is believed to be due to the combination tone of OeH stretched absorption and the transition of the overtone. In chemical sensing applications, it is essential to calculate the response and recovery times where response time is defined as the duration for the sensor response to rise 90% of the maximum absorbance when target chemical is pumped into the customized testing chamber, whereas recovery time is described as the duration the sensor takes to recover from the maximum absorbance value to 10% above its baseline. For 100% ethanol in water, the proposed sensor has response and recovery times of 8.7 s and 18 s, respectively, while its relative absorbance was 26%. The CNT based remote sensor exhibits good repeatability when exposed to ethanol concentrations of 20% and 40% as an additional cycle (C 2 ). Fig. 7(b) demonstrates the dynamic response of the uncoated (blank) TMOF integrated with 3-km optical fiber when exposed to different ethanol concentrations over a wavelength ranging from 500 to 800 nm at room temperature. However, the remote sensor shows high sensitivity towards ethanol, the response between different concentrations cannot be differentiated. It is expected that the uncoated TMOF's response towards ethanol was only due to the change of the ethanol refractive index. The sensitivity of the coated and uncoated TMOF remote sensors was approximately 0.23/vol% and 0.1/vol%, with slope linearity of 98% and 27%, respectively, as demonstrated in Fig. 7(c). The CNT coated TMOF remote sensor achieved higher sensitivity than that of the uncoated one and the in-situ tapered fiber tip coated with CNT reported in. It is believed that the superior sensor performance is due to the CNT high surface area and porous structure, which gives a better opportunity for the analyte molecules to diffuse into or out of the sensing layer easily. Besides, TMOF provides a long interaction region between the altitude evanescent field waves, CNT, and ethanol molecules. To further investigate the proposed remote sensor's performance, Fig. 8(a) demonstrates the overall normalized optical response of the TMOF sensor exposed to low ethanol concentrations of 0.5%, 0.1%, 0.05%, and 0.01% at room temperature. LOD of the developed sensor was found to be 0.01% ethanol concentration. The absorbance response change was approximately 4.91% for low ethanol concentration of 0.01%, with regard to the baseline of the developed TMOF sensor over 3-km optical fiber. Fig.8(b) shows enlarged view of the absorbance response towards ethanol concentrations of 0.01 and 0.05% in water. It can be noticed that the proposed sensor demonstrates a small change in its absorbance that result in a detectable increment in the output signal. The optical remote sensor's overall sensitivity was approximately 1.3/vol% towards low ethanol concentrations ranging from 0.01 to 0.5% (Fig. 8(c)). To investigate the fabricated sensor's shelf life, the CNTbased TMOF sensor's sensing response was evaluated every week for three months. The sensor was stored in a sealed container at 23 C in a dry cabinet to prevent contamination of the sensor surface. The sensing findings are well demonstrated in Fig. 9. The CNT based TMOF sensor showed degradation in sensitivity of approximately 1.56% after three months. Thus, the developed TMOF sensor based on nanomaterials can retain a long shelf life due to the high chemical stability of the CNT that do not deteriorate over a long period. It is believed that the physical sensing mechanism of the CNT coating is mainly based on the interaction that occurred between ethanol molecules and the proposed CNT sensing layer. TMOF provides a strong interaction between the evanescent field and the light-sensing material with the chemical analytes. Fig. 10 illustrates the direct interaction between the evanescent field and the CNT coating with ethanol molecules. Thus, different ethanol concentrations cause variation of the measures optical signal. The suggested chemical sensing mechanism of the CNT sensing layer is as follows (see Fig. 10): a. The carbolic acid groups attached to the CNT coating surface can be produced by treating raw CNT with nitric acid used as oxidizing agents. b. The OH groups of ethanol molecules interact with the COOH bound connected to the CNT surface. c. As a result of the hydrogen bonding of the dipoleedipole interactions among the chemical analyte molecules and the polar groups on the coating surface, the proposed sensor's sensitivity towards ethanol molecules is enhanced. Conclusions In summary, this work reports a simple and efficient optical fiber sensor based on CNT sensing layer coated onto TMOF operates at room temperature for the detection of ethanol remotely over 3 km optical fiber. A reproducible and straightforward tapering process was utilized to fabricate the TMOF sensing area. The optical sensor is integrated with the CNT sensing layer via the spray-coating deposition technique. The sensor's sensing performance is not only comparable to the studies listed in Table 1; it also achieved the lowest LOD at 0.01% with rapid response and recovery times. The experimental results revealed that the TMOF sensor coated with CNT exhibited high sensitivity and rapid response and recovery times of approximately 0.23/vol%, 8.7 s, and 18 s, Fig. 9 e Sensitivity of the proposed TMOF sensor-based CNT for 12 weeks. Fig. 10 e Schematic representation of the proposed interaction mechanism between ethanol molecules and CNT sensing layer. j o u r n a l o f m a t e r i a l s r e s e a r c h a n d t e c h n o l o g y 2 0 2 1 ; 1 2 : 1 7 3 8 e1 7 4 6 respectively, which endows the proposed remote sensor the ability of precision and fast detection. This can be ascribed to the CNT high surface area and excellent porosity in addition to the exceptional affinity of CNT coating to ethanol molecules. The sensor resolution was calculated to be 0.01% ethanol, with an overall sensitivity of 1.3/vol% towards low ethanol concentrations (0.01e0.5%) in water. The shelf life was also investigated for 12 weeks. The significant performance obtained from the CNT based TMOF remote sensor over 3 km optical fiber distance at room temperature indicates its enormous potential to be employed in real-world applications to ensure safety standards in the industrial sectors. Declaration of Competing Interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. |
<gh_stars>0
package it.unicam.quasylab.sibilla.view.gui;
import it.unicam.quasylab.sibilla.core.runtime.CommandExecutionException;
import it.unicam.quasylab.sibilla.view.controller.BasicSettings;
import it.unicam.quasylab.sibilla.view.controller.GUIController;
import it.unicam.quasylab.sibilla.view.controller.Settings;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.DirectoryChooser;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import javafx.util.Callback;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import static it.unicam.quasylab.sibilla.view.controller.GUIController.*;
public class MainView implements Initializable {
private GUIController guiController;
private Documentation documentation;
private NewFile newFileController;
private NewDirectoryView newDirectoryView;
private ChartsView chartsViewController;
private AddedModuleView addedModuleView;
private final Image folderIcon = new Image(getClass().getResourceAsStream("/view/icon/folder.png"));
private final Image sibillaFolder = new Image(getClass().getResourceAsStream("/view/icon/sibillaFolder.png"));
private final Image fileIcon = new Image(getClass().getResourceAsStream("/view/icon/file.png"));
//main
@FXML private VBox main;
//File Menu
@FXML private MenuBar mainMenuBar;
@FXML private MenuItem newDirectoryItem;
@FXML private MenuItem newFileItem;
@FXML private MenuItem saveItem;
@FXML private MenuItem saveAsItem;
@FXML private MenuItem closeAndSaveItem;
@FXML private MenuItem closeItem;
@FXML private MenuItem exitItem;
//Edit Menu
@FXML private MenuItem copyItem;
@FXML private MenuItem deleteItem;
//ToolBar
@FXML private Button buildButton;
@FXML private Button chartsButton;
//Tree View Models
@FXML private TreeView<File> treeViewModels;
@FXML private Menu newMenuContext;
@FXML private MenuItem buildContext;
@FXML private MenuItem copyContext;
@FXML private MenuItem deleteModContext;
@FXML private MenuItem chartsContext;
//Tree View Simulation Cases
@FXML private TreeView<String> treeViewSimulationCases;
@FXML private MenuItem simulateContext;
@FXML private MenuItem deleteSimContext;
//Central Monitor Tab Pane
@FXML private TabPane monitorTabPane;
//Settings Scroll Pane
@FXML private ScrollPane settingsScrollPane;
@FXML private TextField settingsLabel;
@FXML private TableView<ParametersRawTableView> parametersTable;
@FXML private TableColumn<ParametersRawTableView, String> parameterColumn;
@FXML private TableColumn<ParametersRawTableView, String> valueColumn;
@FXML private TextField deadline;
@FXML private TextField dt;
@FXML private TextField replica;
@FXML private ListView<String> allMeasures;
@FXML private ListView<String> addedMeasures;
@FXML private Label errorSettingsLabel;
//Bottom Component
@FXML private TextArea infoTextArea;
@FXML private TextArea terminal;
@Override
public void initialize(URL location, ResourceBundle resources) {
documentation = new Documentation();
guiController = GUIController.getInstance();
newFileController = new NewFile();
newDirectoryView = new NewDirectoryView();
chartsViewController = new ChartsView();
addedModuleView = new AddedModuleView();
settingsScrollPane.setDisable(true);
main.addEventFilter(MouseEvent.ANY, event -> {
Tab monitorTab = monitorTabPane.getSelectionModel().getSelectedItem();
if (!monitorTabPane.getTabs().isEmpty()) {
if(guiController.isPmFile(monitorTab.getText())) {
buildButton.setDisable(false);
chartsButton.setDisable(true);
}else if(guiController.isCsvFile(monitorTab.getText())){
buildButton.setDisable(true);
chartsButton.setDisable(false);
}
} else{
buildButton.setDisable(true);
chartsButton.setDisable(true);
}
}
);
treeViewModels.setCellFactory(new Callback<>() {
public TreeCell<File> call(TreeView<File> tv) {
return new TreeCell<>() {
@Override
protected void updateItem(File item, boolean empty) {
super.updateItem(item, empty);
setText((empty || item == null) ? "" : item.getName());
setGraphic((empty || item == null) ? null : new ImageView(fileIcon));
if(item!=null&&item.isDirectory()&&!item.getName().endsWith(".sibilla")) setGraphic(new ImageView(folderIcon));
if(item!=null&&item.isDirectory()&&item.getName().endsWith(".sibilla")) setGraphic(new ImageView(sibillaFolder));
if (item!=null && treeViewModels.getRoot().getValue() != null) {
if (treeViewModels.getRoot().getValue().equals(item)) setText(item.getName() + " (" + item.getPath() + ")");
}
}};}});
this.appendTextOnTerminal(this.guiController.getTimeString() + INFO + CREATION_MESSAGE);
try {
guiController.loadOpenedFile();
this.guiController.loadSettings();
if (guiController.isProjectLoaded()) updateTreeViewModels(this.guiController.getOpenedProject(), null);
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal("ERROR: Loading Problems!");
}
}
@FXML
public void refreshButtonPressed(){
if(guiController.getOpenedProject()!=null) this.updateTreeViewModels(guiController.getOpenedProject(),null);
}
@FXML
void buildButtonPressed(){
Tab tab = monitorTabPane.getSelectionModel().getSelectedItem();
if (tab.getText() != null) {
try {
for (Path path : this.guiController.getAllFiles(this.guiController.getOpenedProject().getPath())) {
if (path.toFile().getName().equals(tab.getText())) {
this.guiController.saveAll(this.guiController.getOpenedProject().getPath());
if (guiController.isPmFile(path.toFile().getName())) {
if (guiController.getBuildableFilesList().stream().anyMatch(p->p.getFile().equals(path.toFile()))) {
this.clearAllSettings();
this.guiController.build(path.toFile());
this.settingsScrollPane.setDisable(false);
this.updateTreeViewSimulationCases(this.guiController.getBuiltFile(), this.guiController.getSettings(this.guiController.getBuiltFile()));
this.parametersTable.getItems().clear();
this.setParametersView();
this.infoTextArea.clear();
this.infoTextArea.appendText("-) File Built: " + this.guiController.getBuiltFile().getName() + "\n\n");
this.appendTextOnTerminal(this.guiController.getTimeString() + INFO + String.format(CODE_MESSAGE, tab.getText()));
}else{
addedModuleView.showTheStage(path.toFile());
buildButtonPressed();
}
}
}
}
} catch (IOException | CommandExecutionException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Building File Problems");
}
} else {
this.appendTextOnTerminal("File not selected.\n\n" +
"Select a file!");
}
}
@FXML
public void chartsButtonPressed() {
Tab tab = monitorTabPane.getSelectionModel().getSelectedItem();
try {
for (Path path : this.guiController.getAllFiles(this.guiController.getOpenedProject().getPath())) {
if (path.toFile().getName().equals(tab.getText())) {
chartsViewController.showTheStage(path.toFile());
}
}
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Charts File Problems");
}
}
@FXML
public void modelsContextMenuShown(){
if(!treeViewModels.getSelectionModel().getSelectedItems().isEmpty()){
if(treeViewModels.getSelectionModel().getSelectedItem().getValue().isFile()) {
if (guiController.isPmFile(treeViewModels.getSelectionModel().getSelectedItem().getValue().getName())) {
newMenuContext.setDisable(true);
buildContext.setDisable(false);
chartsContext.setDisable(true);
copyContext.setDisable(false);
deleteModContext.setDisable(false);
chartsContext.setDisable(true);
}else if(guiController.isCsvFile(treeViewModels.getSelectionModel().getSelectedItem().getValue().getName())){
newMenuContext.setDisable(true);
buildContext.setDisable(true);
copyContext.setDisable(false);
deleteModContext.setDisable(false);
chartsContext.setDisable(false);
}
}else{
newMenuContext.setDisable(false);
buildContext.setDisable(true);
chartsContext.setDisable(true);
copyContext.setDisable(false);
deleteModContext.setDisable(false);
}
}else{
newMenuContext.setDisable(true);
buildContext.setDisable(true);
chartsContext.setDisable(true);
copyContext.setDisable(true);
deleteModContext.setDisable(true);
}
}
@FXML
public void simulationContextMenuShown(){
if(!treeViewSimulationCases.getSelectionModel().getSelectedItems().isEmpty()){
if(!treeViewSimulationCases.getRoot().getValue().equals(treeViewSimulationCases.getSelectionModel().getSelectedItem().getValue())){
simulateContext.setDisable(false);
deleteSimContext.setDisable(false);
}
}else{
simulateContext.setDisable(true);
deleteSimContext.setDisable(true);
}
}
@FXML
void deleteSimContextPressed() {
if (!treeViewSimulationCases.getSelectionModel().getSelectedItem().getValue().isEmpty()) {
String settingsLabel = treeViewSimulationCases.getSelectionModel().getSelectedItem().getValue();
if(questionAlertMessage("Deleting","Are you sure you want to deleted " + settingsLabel + "?")){
try {
this.guiController.getSettings(this.guiController.getBuiltFile()).removeIf(settings -> settings.getLabel().equals(settingsLabel));
updateTreeViewSimulationCases(this.guiController.getBuiltFile(), this.guiController.getSettings(this.guiController.getBuiltFile()));
this.guiController.saveSettings();
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Delete Simulation Case Problems!");
}
}
}
}
@FXML
void buildContextPressed() {
try {
this.guiController.saveAll(this.guiController.getOpenedProject().getPath());
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Save Environment Problems!");
}
if (guiController.isPmFile(treeViewModels.getSelectionModel().getSelectedItem().getValue().getName())) {
try {
this.guiController.build(treeViewModels.getSelectionModel().getSelectedItem().getValue());
this.settingsScrollPane.setDisable(false);
this.updateTreeViewSimulationCases(this.guiController.getBuiltFile(), this.guiController.getSettings(this.guiController.getBuiltFile()));
this.parametersTable.getItems().clear();
this.setParametersView();
this.infoTextArea.clear();
this.infoTextArea.appendText("-) File Built: "+this.guiController.getBuiltFile().getName()+"\n\n");
} catch (CommandExecutionException | IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Building File Problems!");
}
}
this.appendTextOnTerminal(this.guiController.getTimeString() + INFO + String.format(CODE_MESSAGE, treeViewModels.getSelectionModel().getSelectedItem().getValue().getName()));
}
@FXML
void chartsContextPressed() {
chartsViewController.showTheStage(treeViewModels.getSelectionModel().getSelectedItem().getValue());
}
@FXML
void closeAndSaveItemPressed() {
this.saveItemPressed();
this.closeItemPressed();
}
@FXML
void closeItemPressed() {
String projectName = this.guiController.getOpenedProject().getName();
this.guiController.closeProject();
this.clearAllSettings();
this.settingsScrollPane.setDisable(true);
this.infoTextArea.clear();
treeViewModels.setRoot(null);
treeViewSimulationCases.setRoot(null);
monitorTabPane.getTabs().clear();
this.clearAllSettings();
this.appendTextOnTerminal(this.guiController.getTimeString() + INFO + String.format(CLOSE_PROJECT, projectName));
}
@FXML
void copyItemPressed() {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Copy");
Stage window = new Stage();
fileChooser.setInitialFileName(treeViewModels.getSelectionModel().getSelectedItem().getValue().getName());
File dir = fileChooser.showSaveDialog(window);
try {
if(treeViewModels.getSelectionModel().getSelectedItem().getValue().isDirectory()){
FileUtils.copyDirectory(treeViewModels.getSelectionModel().getSelectedItem().getValue(), dir);
}else {
FileUtils.copyFile(treeViewModels.getSelectionModel().getSelectedItem().getValue(),dir);
}
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Coping File Problems");
}
}
@FXML
void deleteItemPressed() {
try {
if (!treeViewModels.getSelectionModel().isEmpty()) {
File file = treeViewModels.getSelectionModel().getSelectedItem().getValue();
if (questionAlertMessage("Deleting", "Are you sure you want to deleted " + file.getName() + "?")) {
monitorTabPane.getTabs().removeIf(tab -> tab.getText().equals(file.getName()));
FileUtils.deleteQuietly(file);
guiController.refreshPersistenceFile();
if (this.guiController.getBuiltFile() != null && !this.guiController.getBuiltFile().exists()) {
this.treeViewSimulationCases.setRoot(null);
this.clearAllSettings();
this.settingsScrollPane.setDisable(true);
this.infoTextArea.clear();
}
this.guiController.getModifiedFile().remove(file);
this.guiController.getReadOnlyFile().remove(file);
this.updateTreeViewModels(this.guiController.getOpenedProject(), null);
this.appendTextOnTerminal(this.guiController.getTimeString() + INFO + String.format(DELETED_FILE_MESSAGE, file.getName()));
}
}
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal("ERROR: Deleting Error!");
}
}
@FXML
public void doubleClickModelsPressed() {
treeViewModels.setOnMouseClicked(click -> {
if (click.getClickCount() == 2 && click.getButton().equals(MouseButton.PRIMARY)) {
if(!treeViewModels.getSelectionModel().isEmpty()) {
File file = treeViewModels.getSelectionModel().getSelectedItem().getValue();
if (guiController.isPmFile(file.getName()) || guiController.isSibFile(file.getName())) {
if (!this.guiController.getModifiedFile().containsKey(file) && file.isFile()) {//!modifiedFile.containsKey(file)
addMonitorTab(file);
}
}else if(guiController.isCsvFile(file.getName())){
if (!this.guiController.getReadOnlyFile().containsKey(file) && file.isFile()) {
addReadOnlyTab(file);
}
}
}
}
});
}
@FXML
public void doubleClickCasesPressed() {
treeViewSimulationCases.setOnMouseClicked(click -> {
if (click.getClickCount() == 2 && click.getButton().equals(MouseButton.PRIMARY)) {
if(!treeViewSimulationCases.getSelectionModel().isEmpty()) {
for (Settings settings : this.guiController.getSettings(this.guiController.getBuiltFile())) {
if (settings.getLabel().equals(treeViewSimulationCases.getSelectionModel().getSelectedItem().getValue())) {
this.settingsLabel.setText(settings.getLabel());
this.deadline.setText(String.valueOf(settings.getDeadline()));
this.replica.setText(String.valueOf(settings.getReplica()));
this.dt.setText(String.valueOf(settings.getDt()));
/*for(CheckBox checkBox:measuresMap.keySet()){
if(settings.getMeasures().containsKey(checkBox.getText())) {
if (settings.getMeasures().get(measuresMap.get(checkBox)).equals(true)) {
checkBox.setSelected(true);
} else checkBox.setSelected(false);
}else checkBox.setSelected(false);
}*/
allMeasures.getItems().clear();
addedMeasures.getItems().clear();
for(String measure:this.guiController.getSibillaRuntime().getMeasures()){
if(settings.getMeasures().containsKey(measure)) {
if (settings.getMeasures().get(measure).equals(true)) {
addedMeasures.getItems().add(measure);
} else allMeasures.getItems().add(measure);
}else allMeasures.getItems().add(measure);
}
}
}
}
}
}
);
}
private void addMonitorTab(File file) {
TextArea monitor = new TextArea();
monitor.setFont(Font.font("Verdana", 14));
Tab tab = new Tab(file.getName(), monitor);
tab.setOnClosed(event -> {
this.guiController.getModifiedFile().get(file).clear();
this.guiController.getModifiedFile().remove(file);
}
);
monitorTabPane.getTabs().add(tab);
monitorTabPane.getSelectionModel().select(tab);
this.guiController.getModifiedFile().put(file, monitor);
try {
Scanner sc = new Scanner(file);
while (sc.hasNextLine()) {
this.guiController.getModifiedFile().get(file).appendText(sc.nextLine() + "\n");
}
} catch (FileNotFoundException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: File Not Found Exception!");
}
}
private void addReadOnlyTab(File file) {
TableView<TableViewRow> tableView = new TableView<>();
TableColumn<TableViewRow, String> value = new TableColumn<>("");
TableColumn<TableViewRow, String> mean = new TableColumn<>("Mean");
TableColumn<TableViewRow, String> variance = new TableColumn<>("Variance");
TableColumn<TableViewRow, String> standardDeviation = new TableColumn<>("Standard Deviation");
value.setMaxWidth(600);
value.setStyle("-fx-font-weight: bold");
mean.setStyle( "-fx-alignment: CENTER");
variance.setStyle( "-fx-alignment: CENTER");
standardDeviation.setStyle( "-fx-alignment: CENTER");
ObservableList<TableViewRow> data = FXCollections.observableArrayList();
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tableView.setSortPolicy(param -> false);
try {
Scanner sc = new Scanner(file);
while (sc.hasNextLine()) {
String a = sc.nextLine();
String[] b = a.split(";");
data.add(new TableViewRow(b[0], b[1], b[2], b[3]));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: File Not Found Exception!");
}
value.setCellValueFactory(new PropertyValueFactory<>("value"));
mean.setCellValueFactory(new PropertyValueFactory<>("mean"));
variance.setCellValueFactory(new PropertyValueFactory<>("variance"));
standardDeviation.setCellValueFactory(new PropertyValueFactory<>("standardDeviation"));
tableView.getItems().addAll(data);
tableView.getColumns().add(value);
tableView.getColumns().add(mean);
tableView.getColumns().add(variance);
tableView.getColumns().add(standardDeviation);
Tab tab = new Tab(file.getName(), tableView);
tab.setOnClosed(event -> this.guiController.getReadOnlyFile().remove(file));
monitorTabPane.getTabs().add(tab);
monitorTabPane.getSelectionModel().select(tab);
this.guiController.getReadOnlyFile().put(file, tableView);
}
@FXML
public void fileMenuPressed(){
if(this.guiController.isProjectLoaded()){
saveItem.setDisable(false);
saveAsItem.setDisable(false);
closeAndSaveItem.setDisable(false);
closeItem.setDisable(false);
newFileItem.setDisable(false);
newDirectoryItem.setDisable(false);
if(!treeViewModels.getSelectionModel().isEmpty()){
if (treeViewModels.getRoot().getValue().equals(treeViewModels.getSelectionModel().getSelectedItem().getValue())){
newFileItem.setDisable(true);
}else newFileItem.setDisable(false);
}else newFileItem.setDisable(true);
}else{
buildButton.setDisable(true);
closeItem.setDisable(true);
saveItem.setDisable(true);
closeAndSaveItem.setDisable(true);
saveAsItem.setDisable(true);
newFileItem.setDisable(true);
newDirectoryItem.setDisable(true);
}
}
@FXML
void editMenuPressed() {
if (!treeViewModels.getSelectionModel().isEmpty()) {
if (treeViewModels.getRoot().getValue().equals(treeViewModels.getSelectionModel().getSelectedItem().getValue())) {
copyItem.setDisable(false);
deleteItem.setDisable(true);
} else {
copyItem.setDisable(false);
deleteItem.setDisable(false);
}
}else {
copyItem.setDisable(true);
deleteItem.setDisable(true);
}
}
@FXML
void exitItemPressed() {
Stage window = (Stage) mainMenuBar.getScene().getWindow();
try {
if(questionAlertMessage("Quit", "Are you sure you want to quit?")){
window.close();
this.guiController.saveOpenedProject();
this.guiController.closeProject();
}
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Exit Failed!");
}
}
@FXML
void helpItemPressed() {
documentation.showHelpFile();
}
@FXML
void newDirectoryItemPressed() {
if(!treeViewModels.getSelectionModel().isEmpty()) {
if (treeViewModels.getSelectionModel().getSelectedItem().getValue().isDirectory()) {
newDirectoryView.showTheStage(this.treeViewModels.getSelectionModel().getSelectedItem().getValue());
} else
newDirectoryView.showTheStage(this.treeViewModels.getSelectionModel().getSelectedItem().getValue().getParentFile());
}else newDirectoryView.showTheStage(this.treeViewModels.getRoot().getValue());
updateTreeViewModels(this.guiController.getOpenedProject(), null);
}
@FXML
void newFileItemPressed() {
if(treeViewModels.getSelectionModel().getSelectedItem().getValue().isDirectory()) {
newFileController.showTheStage(this.treeViewModels.getSelectionModel().getSelectedItem().getValue());
}else newFileController.showTheStage(this.treeViewModels.getSelectionModel().getSelectedItem().getValue().getParentFile());
updateTreeViewModels(this.guiController.getOpenedProject(), null);
}
@FXML
void newProjectItemPressed() {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Save");
Stage window = new Stage();
File dir = fileChooser.showSaveDialog(window);
if (dir != null) {
try {
infoTextArea.clear();
terminal.clear();
this.clearAllSettings();
settingsScrollPane.setDisable(true);
File sibilla = new File(dir + "/.sibilla");
this.guiController.createNewDirectory(dir);
this.guiController.createNewDirectory(sibilla);
this.guiController.createNewPersistenceFile(sibilla, "settings");
newDirectoryView.showTheStage(dir);
updateTreeViewModels(dir, null);
this.treeViewSimulationCases.setRoot(null);
this.guiController.setOpenedProject(dir);
monitorTabPane.getTabs().clear();
} catch(IOException e){
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString() + "ERROR: Creation Of a New Project Failed");
}
}
}
@FXML
void openItemPressed() {
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle("Open project");
Stage directoryStage = new Stage();
File file = directoryChooser.showDialog(directoryStage);
if (file != null) {
try {
this.guiController.getModifiedFile().clear();
this.guiController.getReadOnlyFile().clear();
monitorTabPane.getTabs().clear();
infoTextArea.clear();
terminal.clear();
this.clearAllSettings();
settingsScrollPane.setDisable(true);
if(this.guiController.getAllFiles(file.getPath()).stream().noneMatch(p->p.toFile().getName().endsWith(".sibilla"))){
File sibilla = new File(file + "/.sibilla");
this.guiController.createNewDirectory(sibilla);
this.guiController.createNewPersistenceFile(sibilla, "settings");
}
this.guiController.setOpenedProject(file);
updateTreeViewModels(file, null);
this.treeViewSimulationCases.setRoot(null);
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Persistence File Problem!");
}
} else {
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Open Failed!");
}
}
@FXML
void saveAsItemPressed() {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Save");
Stage window = new Stage();
fileChooser.setInitialFileName(this.guiController.getOpenedProject().getName());
File dir = fileChooser.showSaveDialog(window);
try {
this.guiController.saveAs(dir);
updateTreeViewModels(dir, null);
monitorTabPane.getTabs().clear();
if(this.guiController.isFileBuilt()) {
this.monitorTabPane.getTabs().removeIf(p->!p.getText().equals(guiController.getBuiltFile().getName()));
updateTreeViewSimulationCases(this.guiController.getBuiltFile(), this.guiController.getSettings(this.guiController.getBuiltFile()));
}else{
this.clearAllSettings();
this.settingsScrollPane.setDisable(true);
this.treeViewSimulationCases.setRoot(null);
this.monitorTabPane.getTabs().clear();
}
this.appendTextOnTerminal(guiController.getTimeString()+INFO+String.format(SAVE_MESSAGE, dir.getPath()));
} catch (IOException | CommandExecutionException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Save Failed");
}
}
@FXML
void saveItemPressed() {
try {
this.guiController.saveAll(this.guiController.getOpenedProject().getPath());
this.appendTextOnTerminal(this.guiController.getTimeString() +INFO+String.format(SAVE_MESSAGE, this.guiController.getOpenedProject().getPath()));
} catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Save Failed");
}
}
@FXML
public void addMeasure(){
if(!allMeasures.getSelectionModel().isEmpty()){
addedMeasures.getItems().add(allMeasures.getSelectionModel().getSelectedItem());
allMeasures.getItems().remove(allMeasures.getSelectionModel().getSelectedItem());
allMeasures.getSelectionModel().clearSelection();
}
}
@FXML
public void removeMeasure(){
if(!addedMeasures.getSelectionModel().isEmpty()){
allMeasures.getItems().add(addedMeasures.getSelectionModel().getSelectedItem());
addedMeasures.getItems().remove(addedMeasures.getSelectionModel().getSelectedItem());
addedMeasures.getSelectionModel().clearSelection();
}
}
@FXML
public void addAllMeasures(){
addedMeasures.getItems().addAll(allMeasures.getItems());
allMeasures.getItems().clear();
}
@FXML
public void removeAllMeasures(){
allMeasures.getItems().addAll(addedMeasures.getItems());
addedMeasures.getItems().clear();
}
@FXML
public void saveSettingsButtonPressed(){
if(checkSettings()) {
try {
if (this.guiController.getSettings(this.guiController.getBuiltFile()).stream().noneMatch(p -> p.getLabel().equals(getSettings().getLabel()))) {
saveSettings();
} else {
if (this.overwriteAlertMessage("Overwrite Results", "Are you sure you want to overwrite the simulation settings?", "Then change the label name")) {
saveSettings();
}
}
}catch (IOException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Save Failed");
}
}
}
private void saveSettings() throws IOException {
this.guiController.getSettings(this.guiController.getBuiltFile()).removeIf(settings -> settings.getLabel().equals(getSettings().getLabel()));
this.guiController.getSettings(this.guiController.getBuiltFile()).add(getSettings());
updateTreeViewSimulationCases(this.guiController.getBuiltFile(), this.guiController.getSettings(this.guiController.getBuiltFile()));
this.guiController.saveSettings();
}
@FXML
public void simulateButtonPressed() {
if(checkSettings()){
try {
if (this.guiController.getAllFiles(this.guiController.getOpenedProject().getPath()).stream().anyMatch(p -> p.toFile().getName().equals("results ("+this.getSettings().getLabel()+")"))){
if(this.overwriteAlertMessage("Overwrite Results", "Are you sure you want to overwrite the results?", "Then change the label name")){
this.simulate();
}
}else this.simulate();
this.appendTextOnTerminal(this.guiController.getTimeString() +INFO+SIMULATION_SUCCESSFUL);
} catch (IOException | CommandExecutionException e) {
e.printStackTrace();
this.appendTextOnTerminal(guiController.getTimeString()+"ERROR: Simulation Failed");
}
}
}
private void simulate() throws IOException, CommandExecutionException {
this.guiController.simulate(Objects.requireNonNull(getSettings()));
this.infoTextArea.appendText("------------------------------------------------------------------------------------------------------------\n");
this.infoTextArea.appendText("-) File Loaded: " + this.guiController.getBuiltFile().getName() + "\n\n");
this.infoTextArea.appendText("-) Parameters Loaded: " + this.guiController.getLastSimulatedSettings().getParameters() + "\n\n");
this.infoTextArea.appendText("-) Deadline Value: " + this.guiController.getLastSimulatedSettings().getDeadline() + "\n\n");
this.infoTextArea.appendText("-) Dt Value: " + this.guiController.getLastSimulatedSettings().getDt() + "\n\n");
this.infoTextArea.appendText("-) Replica Value: " + this.guiController.getLastSimulatedSettings().getReplica() + "\n\n");
this.infoTextArea.appendText("-) MeasuresValue: " + this.guiController.getLastSimulatedSettings().getMeasures() + "\n\n");
this.infoTextArea.appendText("\n");
if (this.guiController.getAllFiles(this.guiController.getBuiltFile().getParent()).stream().noneMatch(p -> p.toFile().getName().equals("results (" + this.getSettings().getLabel() + ")"))) {
Path results = Paths.get(this.guiController.getBuiltFile().getParent() + "/results (" + this.getSettings().getLabel() + ")");
Files.createDirectory(results);
}else{
for(Path path:this.guiController.getAllFiles(this.guiController.getBuiltFile().getParent() + "/results (" + this.getSettings().getLabel() + ")")){
if(path.toFile().isFile()) Files.delete(path);
}
}
this.guiController.getSibillaRuntime().save(this.guiController.getBuiltFile().getParent() + "/results (" + this.getSettings().getLabel() + ")", this.getSettings().getLabel(), "__");
updateTreeViewModels(this.guiController.getOpenedProject(), null);
this.guiController.saveAll(this.guiController.getOpenedProject().getPath());
}
@FXML
public void clearSettingsButtonPressed(){
if(this.guiController.isFileBuilt()) this.guiController.getSibillaRuntime().reset();
this.settingsLabel.clear();
this.deadline.clear();
this.dt.clear();
this.replica.clear();
addedMeasures.getItems().clear();
allMeasures.getItems().clear();
errorSettingsLabel.setText("");
}
public void clearAllSettings(){
this.clearSettingsButtonPressed();
parametersTable.getItems().clear();
}
private BasicSettings getSettings() {
BasicSettings settings = new BasicSettings(this.guiController.getBuiltFile(), settingsLabel.getText());
settings.setDeadline(Double.parseDouble(deadline.getText()));
settings.setReplica(Integer.parseInt(replica.getText()));
settings.setDt(Double.parseDouble(dt.getText()));
for (String key : this.guiController.getSibillaRuntime().getParameters()) {
settings.getParameters().put(key, this.guiController.getSibillaRuntime().getParameter(key));
}
for(String measure:allMeasures.getItems()) settings.getMeasures().put(measure,false);
for(String measure:addedMeasures.getItems()) settings.getMeasures().put(measure,true);
return settings;
}
public static class TableViewRow{
private final SimpleStringProperty value;
private final SimpleStringProperty mean;
private final SimpleStringProperty variance;
private final SimpleStringProperty standardDeviation;
private TableViewRow(String value, String mean, String variance, String standardDeviation) {
this.value = new SimpleStringProperty(value);
this.mean = new SimpleStringProperty(mean);
this.variance = new SimpleStringProperty(variance);
this.standardDeviation = new SimpleStringProperty(standardDeviation);
}
public String getValue() {
return value.get();
}
public void setValue(String value) {
this.value.set(value);
}
public String getMean() {
return mean.get();
}
public void setMean(String mean) {
this.mean.set(mean);
}
public String getVariance() {
return variance.get();
}
public void setVariance(String variance) {
this.variance.set(variance);
}
public String getStandardDeviation() {
return standardDeviation.get();
}
public void setStandardDeviation(String standardDeviation) {
this.standardDeviation.set(standardDeviation);
}
}
public static class ParametersRawTableView{
private final SimpleStringProperty parameter;
private final SimpleStringProperty value;
private ParametersRawTableView(String parameter, String value) {
this.parameter=new SimpleStringProperty(parameter);
this.value = new SimpleStringProperty(value);
}
public String getParameter() {
return parameter.get();
}
public void setParameter(String parameter) {
this.parameter.set(parameter);
}
public String getValue() {
return value.get();
}
public void setValue(String value) {
this.value.set(value);
}
}
private void appendTextOnTerminal(String text){
this.terminal.appendText(text+"\n");
}
private void updateTreeViewModels(File dir, TreeItem<File> parent) {
TreeItem<File> root = new TreeItem<>(dir);
File[] files = dir.listFiles();
assert files != null;
for (File file : files) {
if (file.isDirectory()) {
updateTreeViewModels(file, root);
} else if(this.guiController.isPmFile(file.getName())||this.guiController.isCsvFile(file.getName())||this.guiController.isJsonFile(file.getName())){
root.getChildren().add(new TreeItem<>(file));
}
}
if (parent == null) {
treeViewModels.setRoot(root);
root.setExpanded(true);
} else {
parent.getChildren().add(root);
}
}
private void updateTreeViewSimulationCases(File builtFile, List<BasicSettings> settingsList) throws IOException {
TreeItem<String> root = new TreeItem<>(builtFile.getName(), new ImageView(folderIcon));
for (Settings settings : settingsList) {
root.getChildren().add(new TreeItem<>(settings.getLabel(), new ImageView(fileIcon)));
}
this.treeViewSimulationCases.setRoot(root);
root.setExpanded(true);
}
private void setParametersView(){
if(this.guiController.isFileBuilt()){
//parameters table settings
ObservableList<ParametersRawTableView> parametersTableData = FXCollections.observableArrayList();
for(String key:this.guiController.getSibillaRuntime().getParameters()) {
parametersTableData.add(new ParametersRawTableView(key, String.valueOf(this.guiController.getSibillaRuntime().getParameter(key))));
}
parameterColumn.setCellValueFactory(new PropertyValueFactory<>("parameter"));
valueColumn.setCellValueFactory(new PropertyValueFactory<>("value"));
parametersTable.getItems().addAll(parametersTableData);
//measures settings
allMeasures.getItems().clear();
addedMeasures.getItems().clear();
allMeasures.getItems().addAll(this.guiController.getSibillaRuntime().getMeasures());
}
}
public boolean checkSettings(){
if(!this.settingsLabel.getText().isEmpty()) {
if (!deadline.getText().isEmpty()) {
if (!dt.getText().isEmpty()) {
if (!replica.getText().isEmpty()) {
if(!addedMeasures.getItems().isEmpty()){
errorSettingsLabel.setText("");
return true;
} else errorSettingsLabel.setText("ERROR: there are no measures to simulate");
} else errorSettingsLabel.setText("ERROR: replica value is missing");
} else errorSettingsLabel.setText("ERROR: dt value is missing");
} else errorSettingsLabel.setText("ERROR: deadline value is missing");
} else errorSettingsLabel.setText("ERROR: settings name is missing");
return false;
}
private boolean questionAlertMessage(String title, String message){
Alert alert = new Alert(Alert.AlertType.CONFIRMATION, message, ButtonType.YES, ButtonType.CANCEL);
alert.setTitle(title);
Optional<ButtonType> answer = alert.showAndWait();
if (answer.isPresent()&&answer.get() == ButtonType.YES) {
return true;
}
return false;
}
private boolean overwriteAlertMessage(String title, String yesMessage, String noMessage){
Alert alert = new Alert(Alert.AlertType.CONFIRMATION, yesMessage, ButtonType.YES, ButtonType.NO, ButtonType.CANCEL);
alert.setTitle(title);
Optional<ButtonType> answer = alert.showAndWait();
if (answer.isPresent()&&answer.get() == ButtonType.YES) {
return true;
}else if(answer.isPresent()&&answer.get() == ButtonType.NO){
Alert alert2 = new Alert(Alert.AlertType.INFORMATION, noMessage, ButtonType.OK);
alert2.showAndWait();
}
return false;
}
}
|
How do financial (dis)incentives influence health behaviour and costs? Protocol for a systematic literature review of randomised controlled trials Introduction In this era of rising healthcare costs, there is a growing interest in understanding how funding policies can be used to improve health and healthcare efficiency. Financial incentives (eg, vouchers or access to health insurance) or disincentives (eg, fines or out-of-pocket costs) affect behaviours. To date, reviews have explored the effects of financial (dis)incentives on patient health and behaviour by focusing on specific behaviours or geographical areas. The objective of this systematic review is to provide a comprehensive overview on the use of financial (dis)incentives as a means of influencing health-related behaviour and costs in randomised trials. Methods and analysis We will search electronic databases, clinical trial registries and websites of health economic organisations for randomised controlled trials. The initial searches, which were conducted on 13 January 2018, will be updated every 12 months until the completion of data analysis. The reference lists of included studies will be manually screened to identify additional eligible studies. Two researchers will independently review titles, abstracts and full texts to determine eligibility according to a set of predetermined inclusion criteria. Data will be extracted from included studies using a form developed and piloted by the research team. Discrepancies will be resolved through discussion with a third reviewer. Risk of bias will be assessed using the Cochrane Collaboration tool. Ethics and dissemination Ethics approval is not required since this is a review of published data. Results will be disseminated through publication in peer-reviewed journals and presentations at relevant conferences. PROSPERO registration number CRD42018097140 Introduction In this era of rising healthcare costs, there is a growing interest in understanding how funding policies can be used to improve health and healthcare efficiency. Financial incentives (eg, vouchers or access to health insurance) or disincentives (eg, fines or out-of-pocket costs) affect behaviours. To date, reviews have explored the effects of financial (dis)incentives on patient health and behaviour by focusing on specific behaviours or geographical areas. The objective of this systematic review is to provide a comprehensive overview on the use of financial (dis)incentives as a means of influencing healthrelated behaviour and costs in randomised trials. Methods and analysis We will search electronic databases, clinical trial registries and websites of health economic organisations for randomised controlled trials. The initial searches, which were conducted on 13 January 2018, will be updated every 12 months until the completion of data analysis. The reference lists of included studies will be manually screened to identify additional eligible studies. Two researchers will independently review titles, abstracts and full texts to determine eligibility according to a set of predetermined inclusion criteria. Data will be extracted from included studies using a form developed and piloted by the research team. Discrepancies will be resolved through discussion with a third reviewer. Risk of bias will be assessed using the Cochrane Collaboration tool. Ethics and dissemination Ethics approval is not required since this is a review of published data. Results will be disseminated through publication in peer-reviewed journals and presentations at relevant conferences. PrOsPErO registration number CRD42018097140 IntrOduCtIOn In this era of rising healthcare costs, 1 2 there is a growing interest in understanding how funding policies can be used to support effective, efficient, affordable and accessible care. 3 Funding policies have the potential to influence the health-related behaviours and outcomes of individuals and costs. The costs borne by individuals may affect what services they will seek out or use, which have important implications not only on their health but also on the overall sustainability of the healthcare system. There are two types of financial mechanisms that can be used in funding policies directed towards patients. Financial incentives, such as vouchers, cash transfers, free health services and increased health insurance benefits, are positive monetary benefits that encourage a behaviour. 9 In contrast, financial disincentives, including fines, fees and out-of-pocket costs, are negative monetary penalties that discourage a behaviour. 9 Both types of incentives can have an impact on direct measures of behaviour change (eg, patient behaviours) and indirect measures of behaviour change (eg, patient outcomes or healthcare resource use). For example, observational studies indicate that financial incentives, such as increased health insurance, are associated with a higher use of health services and better health outcomes. Conversely, financial disincentives, such as out-of-pocket costs, have been shown to be associated with medication non-adherence. 13 14 Despite a wealth of evidence, critics argue that a causal relationship between financial (dis)incentives and an individual's behaviour within a given healthcare system strengths and limitations of this study ► This protocol presents a transparent methodology for conducting a systematic review of published evidence on health policy randomised controlled trials. ► Our mixed-method analysis will go beyond a summary of studies to frame them within the current context of research on health policy trials, thus bridging a crucial gap between research and policy making. ► Since there is no established vocabulary for this broad topic of research, the search strategy was designed to maximise sensitivity. ► We included only studies published in English. Open access can only be established through a randomised experimental design (sometimes referred to as a health policy trial). 15 A patient's access to financial incentives, such as health insurance, can be influenced by numerous demographic, social and environmental factors. 16 Consider the impact of geographical location, level of education, 20 income 21-23 and employment status 24 on behaviour. As a result, observational studies might not determine if any observed differences in behaviour or health outcomes are in fact caused by the financial (dis)incentives experienced by the patient. Several reviews have explored the effects of financial incentives on patient-related health and behaviour. These reviews are restricted in scope, focusing on specific behaviours or geographical regions 30 31 rather than on an individual's interaction with a healthcare system. In addition, some reviews include studies with an observational design, 28 29 which makes it difficult to isolate the effect of financial (dis)incentives on patients' health and health-related behaviours. A recent review published by Newhouse and Normand acknowledges how trials on financial incentives, such as the RAND Health Insurance Experiment 32 and the Oregon Health Insurance Experiment, 33 have influenced health policy in the USA. 34 Despite their relevance to health policy decision-making, we do not have a comprehensive understanding of the research that has been conducted on patient-targeted financial (dis)incentives in a randomised experimental environment. The objective of this review is to describe the evidence landscape on the use of patient-targeted financial (dis)incentives as a means of influencing patient behaviour in randomised controlled trials (RCTs). The impact of these (dis)incentives will be assessed through both direct and indirect outcomes. MEthOds study design This systematic review will be conducted according to Preferred Reporting Items for Systematic Reviews and Meta-Analysis Protocol guidelines. 35 Eligibility criteria The research question guiding this review is: how do financial incentives and/or disincentives influence patient behaviour within the context of RCTs? Studies will be included if they meet the following criteria: ► The study includes human subjects. ► The language of publication is English. ► The study design is an RCT. ► The population consists of patients. ► The intervention is a patient-targeted financial incentive or disincentive provided within a healthcare system. Given the broad scope of this review, no comparators or outcomes are specified a priori. Reviews, editorials, books, abstracts and commentaries will be excluded. There are no restrictions in terms of date of publication. Information sources We will search the following electronic databases for eligible studies: MEDLINE (via Ovid), Embase (via Ovid), Econlit (via EbscoHost) and The Cochrane Library. Additionally, we will conduct a targeted search of various grey literature sources, including clinical trial registries and the websites of relevant health economic organisations and conferences. The reference lists of included studies will also be screened to identify additional eligible studies. search strategy The search strategy was developed through a collaborative process that involved researchers with expertise in health economics and the methodology of systematic literature reviews, as well as an academic librarian. The strategy is based on concepts related to financial (dis) incentives (eg, insurance coverage, out-of-pocket costs, cost sharing, fines or cash transfers) and direct and indirect measures of behaviour (eg, patient behaviours, health outcomes and healthcare resource use). These concepts were operationalised using controlled vocabulary (Medical Subject Heading terms), keywords and synonyms. The initial strategy was designed in MEDLINE (via Ovid) and then adapted to the electronic databases. All search strategies are available in online supplementary appendix 1. The initial searches, conducted on 13 January 2018, will be updated every 12 months until the completion of data extraction and analysis. data management All references will be imported into EndNote V.X8.2 (Clarivate Analytics, 2016) to remove duplicates. Data will be maintained in a Microsoft Excel workbook V. 16.10. selection process Study eligibility will be assessed first at the title and abstract level followed by a full text review. Two reviewers will independently scan the titles and abstracts of all references identified in the literature search according to a screening form, which operationalises the study inclusion criteria. The same two reviewers will independently review the full text of all relevant studies. Any discrepancies in study eligibility will be resolved by discussion, with a third reviewer providing arbitration as necessary. data collection A data extraction form was developed by the research team. Two reviewers, working independently and in duplicate, will extract data on the trial, patient and outcome characteristics. Further details are available in online supplementary appendix 2. Prior to commencing the full data extraction, two reviewers will pilot test the data extraction form to evaluate consistency, accuracy and completeness. 36 If additional categories are identified during this process, the form will be amended accordingly and rationales for changes will be documented. If information required to complete data extraction is missing or unclear, the study's corresponding author will be contacted by e-mail. At the end of the data extraction process, the two reviewers' data will be compared to ensure accuracy. Any discrepancies will be documented and resolved by discussion between the two reviewers. risk of bias We will conduct a critical appraisal of eligible studies using the risk of bias tool developed by the Cochrane Collaboration. 37 All studies, regardless of their considered quality, will be included in this systematic review. data synthesis Given the expected heterogeneity between health policy trials, we do not anticipate conducting a meta-analysis. Instead, we will take a convergent mixed-method approach to analyse the data from included studies (see figure 1 for details). The purpose of a convergent design is to obtain different but complementary data on the same topic. 38 First, we will conduct a quantitative analysis of the extracted data using descriptive statistics (eg, frequency counts and percentages) to describe general study (eg, country, population of interest and sample size) and intervention-specific characteristics (eg, type of intervention and magnitude of financial incentive). A qualitative content analysis of the full texts will follow. Content analysis entails the search for Open access and the identification of categories (or themes) across data. 39 This method is particularly suited for health policy trials 40 because the depth of the analysis allows for a more comprehensive understanding of complex social and context-dependent interventions. For this analysis, two reviewers will independently analyse a sample of the full texts of included studies, taking an inductive approach to identify emerging themes. Attention will be paid to language and content in order to identify common issues, controversies, and shared discourses from this body of literature on health policy trials. Passages will be coded as emerging themes are identified. The findings will be compared and discussed among the research team until consensus on a coding scheme is reached. The two reviewers will then code the remaining texts with the objective of highlighting similarities, differences, and outliers among included studies. 41 Finally, the quantitative and qualitative data will be integrated using methods of triangulation. In this final analysis, two researchers will cross-tabulate the qualitatively derived themes with the quantitative variables to explore to what extent the results from both data sets relate to each other in order to obtain a better understanding of the evidence landscape. The intent is to link the quantitative findings to their context and the environment in which they were produced. The number of studies identified and selected for inclusion in the systematic review will be recorded, and a flowchart will be used to illustrate the selection process. We will report the findings from the quantitative analysis using tables to summarise the general study and intervention-specific characteristics of included studies. A narrative summary will provide an overview of the qualitative component of the analysis, as well as the integration of qualitative and quantitative data. 42 Patient and public involvement Patients and public partners were not involved in the design of the protocol for this systematic review. dIsCussIOn When used as policy instruments, patient-targeted financial (dis)incentives have the potential to improve health outcomes and health care efficiency. However, in order to inform policy, it must first be understood what has been done in an experimental environment. This protocol presents a comprehensive, robust and transparent methodology for the conduct of a systematic review of published RCTs investigating the use of financial (dis)incentives as a means of influencing patient health-related behaviours, both directly or indirectly. Limitations We acknowledge that there are limitations. First, there is no established vocabulary for this broad topic of research. Studies on financial (dis)incentives could pertain to 'fines', 'vouchers', 'insurance', 'out-of-pocket costs' and so on. As a result, the search strategy was designed to maximise sensitivity. This improves our ability to capture all relevant studies but reduces the overall precision of the search strategy, which may identify a large number of irrelevant references. Second, we included only studies published in English. The decision was made in consideration of the time and costs required to translate articles published in other languages. It could result in language bias if the studies identified in our search strategy are not representative of existing evidence. However, a study on the use of English-language restrictions within the context of reviews failed to find evidence of a systematic bias from the use of language restrictions. 43 Third, we acknowledge that the scope of this review is limited to patient-targeted financial (dis)incentives that are a positive spur to behaviour change, such as vouchers or increased insurance benefits. However, given the complexity of healthcare systems, there are a multitude of mechanisms for change. For example, future work may more comprehensively evaluate financial mechanisms that remove barriers to patient behaviour change (eg, transport assistance or childcare) or that are directed towards different payers (eg, clinicians or government). Implication of findings Evidence-based policy making is becoming increasingly important, given the pressures faced by healthcare systems around the globe. There are a number of important policy issues that remain unresolved, including the debate over single versus multiple payer health insurance systems in the USA, 44 45 the National Health Service financial crisis in the UK, 46 the implementation of Pharmacare in Canada 47 and the lack of access to healthcare in developing countries. 48 49 The consequences of misinformed or uninformed policy decisions could be tremendous in terms of costs but also population health. A comprehensive understanding of available experimental evidence is essential to support efficient and valid policy decision-making. There is a need to not only identify 'what works' but also understand why a given intervention is successful. Mixed-method approaches, which integrate quantitative and qualitative findings, are well suited for this purpose. Our analysis will go beyond a summary of studies to frame them within the current context of research on health policy trials, thus bridging a crucial gap between research and policy making. Moving forward, there is the potential for embedding healthcare policy trials directly into existing healthcare systems. The established administrative structures of these otherwise routine processes are an ideal means by which we may enhance data collection and achieve longterm follow-up. 53 Author affiliations |
Self-Virtualized I/O: High Performance, Scalable I/O Virtualization in Multi-core Systems Virtualizing I/O subsystems and peripheral devices is an integral part of system virtualization. This paper advocates the notion of self-virtualized I/O (SV-IO). Specifically, it proposes a hypervisor-level abstraction that permits guest virtual machines to efficiently exploit the multi-core nature of futureion that permits guest virtual machines to efficiently exploit the multi-core nature of future machines when interacting with virtualized I/O. The concrete instance of SV-IO developed and evaluated herein provides virtual interfaces to an underlying physical device, the network interface, and manages the way in which the devices physical resources are used by guest operating systems. The performance of this instance differs markedly depending on design choices that include (a) how the SVIO abstraction is mapped to the underlying hostvs. device-resident resources, (b) the manner and extent to which it interacts with the HV, and (c) its ability to flexibly leverage the multi-core nature of modern computing platforms. A device-centric SV-IO realization yields a self-virtualized network device (SV-NIC) that provides high performance network access to guest virtual machines. Specific performance results show that for high-end network hardware using an IXP2400-based board, a virtual network interface (VIF) from the device-centric SV-IO realization provides ∼77% more throughput and ∼53% less latency compared to the VIF from a host-centric SV-IO realization. For 8 VIFs, the aggregate throughput (latency) for device-centric version is 103% more (39% less) compared to the host-centric version. The aggregate throughput and latency of the VIFs scales with guest VMs, ultimately limited by the amount of physical computing resources available on the host platform and device, such as number of cores. The paper also discusses architectural considerations for implementing self-virtualized devices in future multi-core systems. |
"""Model for SetFee pseudo-transaction type."""
from dataclasses import dataclass, field
from typing import Optional
from xrpl.models.required import REQUIRED
from xrpl.models.transactions.pseudo_transactions.pseudo_transaction import (
PseudoTransaction,
)
from xrpl.models.transactions.types import PseudoTransactionType
from xrpl.models.utils import require_kwargs_on_init
@require_kwargs_on_init
@dataclass(frozen=True)
class SetFee(PseudoTransaction):
"""
A SetFee pseudo-transaction marks a change in `transaction cost
<https://xrpl.org/transaction-cost.html>`_ or `reserve requirements
<https://xrpl.org/reserves.html>`_ as a result of `Fee Voting
<https://xrpl.org/fee-voting.html>`_.
"""
#: The charge, in drops of XRP, for the reference transaction, as hex. (This is the
#: transaction cost before scaling for load.)
base_fee: str = REQUIRED # type: ignore
#: The cost, in fee units, of the reference transaction
reference_fee_units: int = REQUIRED # type: ignore
#: The base reserve, in drops
reserve_base: int = REQUIRED # type: ignore
#: The incremental reserve, in drops
reserve_increment: int = REQUIRED # type: ignore
#: The index of the ledger version where this pseudo-transaction appears. This
#: distinguishes the pseudo-transaction from other occurrences of the same change.
#: This field is omitted for some historical SetFee pseudo-transactions.
ledger_sequence: Optional[int] = None
transaction_type: PseudoTransactionType = field(
default=PseudoTransactionType.SET_FEE,
init=False,
)
|
<gh_stars>0
import {FC} from 'react'
import './RadialProgressIndicator.scss'
type RPIProps = {
percentage: number
radius: number
strokeWidth: number
textColor?: string
strokeColor?: string
backgroundColor?: string
trackColor?: string
fontSize?: number
}
const RadialProgressIndicator: FC<RPIProps> = ({
percentage,
radius,
backgroundColor,
textColor,
strokeWidth,
strokeColor,
trackColor,
fontSize
}) => {
const internalRadius = radius - strokeWidth / 3
const circumference = Math.floor(2 * Math.PI * internalRadius)
return (
<div className='progress-indicator' style={{height: 2 * radius, width: 2 * radius}}>
<div
className='progress-indicator-background'
style={backgroundColor ? {backgroundColor} : {}}
/>
<svg height={2 * radius} width={2 * radius}>
<circle
className='progress-indicator-track'
fill='transparent'
strokeWidth={strokeWidth}
cy={radius}
cx={radius}
r={internalRadius}
// breaks the circle stroke into dashes and gaps
strokeDasharray={`${circumference} ${circumference}`}
strokeLinecap='round'
style={trackColor ? {stroke: trackColor} : {}}
/>
<circle
className='progress-indicator-line'
fill='transparent'
strokeWidth={strokeWidth}
cy={radius}
cx={radius}
r={internalRadius}
strokeDasharray={`${circumference} ${circumference}`}
// shifts the stroke dashes by certain amount
strokeDashoffset={Math.floor(circumference * (1 - percentage))}
strokeLinecap='round'
style={strokeColor ? {stroke: strokeColor} : {}}
/>
</svg>
<p
className={'progress-indicator-text'}
style={{
fontSize: fontSize ? fontSize : 0.65 * radius,
color: textColor ? textColor : undefined
}}
>
<span>
{Math.round(percentage * 100)}
<sup>%</sup>
</span>
</p>
</div>
)
}
export default RadialProgressIndicator
|
#define INTBITS 15
#define FRACBITS 17
|
Cardiovascular effects of the new cardiotonic agent 1,2-dihydro-6-methyl-2-oxo-5-(imidazopyridin-6-yl)-3-pyridine carbonitrile hydrochloride monohydrate. 2nd communication: studies in dogs. The cardiovascular effects of 1,2-dihydro-6-methyl-2-oxo-5-(imidazopyridin-6-yl)-3-pyridine carbonitrile hydrochloride monohydrate (E-1020), a new nonglycoside, noncatechol cardiotonic agent, were investigated in dogs. In anesthetized dogs, E-1020 (10-100 micrograms/kg i.v.) dose-relatedly increased cardiac contractility (LV dP/dtmax), enhanced cardiac index and decreased systemic vascular resistance accompanying relatively small reduction in mean aortic pressure and a mild increase in heart rate. Coronary and femoral arterial blood flow were increased by either systemic intravenous or topical administration of E-1020. The degree of increase in myocardial oxygen consumption was only slight (10% at 30 micrograms/kg i.v.). The inotropic effect of E-1020 was not markedly affected by pretreatment with beta-adrenoceptor blockade, reserpine or other cardiotonic agents such as dobutamine or ouabain. In two experimental heart failure models induced by an excessive dose of propranolol or by coronary occlusion following volume-loading, E-1020 (30 micrograms/kg i.v.) rapidly reversed the cardiac depression. In chronically instrumented conscious dogs, E-1020 (30-100 micrograms/kg i.v. or 0.3-10 mg/kg p.o.) produced dose-dependent increases in LV dP/dtmax with minor increases in heart rate. E-1020 did not exacerbate arrhythmias of several experimental models in anesthetized dogs even at high dose of 100 micrograms/kg i.v. These results indicate that E-1020 is an intravenously and orally effective cardiotonic agent with vasodilating property, and that it may be beneficial in the treatment of acute and chronic congestive heart failure. |
Obama’s mid-term approval ratings are similar to other presidents who went on to re-election.
— Tim Kaine on Sunday, January 2nd, 2011 in a TV interview.
By Warren Fiske on Monday, January 10th, 2011 at 10:00 a.m.
With Democrats woozy from their shellacking in November’s congressional elections, political junkies are riveted on 2012 and whether President Barack Obama will win a second term.
No one is putting a better spin on Obama’s fortunes than Tim Kaine, chairman of the Democratic National Committee. He wrote an end-of-the year column for Politico, a Washington news organization, saying Obama’s "list of achievements already dwarfs that of many presidents."
Kaine, a former Virginia governor, encountered skepticism during a TV interview last Sunday. Ed Henry, CNN’s senior White House corespondent, noted Obama’s approval rating from voters dropped 6 percentage points in 2010.
"You made your case but it seems like the American people aren’t buying it, sir," Henry said.
Kaine replied, "Relatively, if you look at the president’s mid-term numbers compared to other presidents in their mid-term, he’s fine."
We decided to take a closer look. Kaine was responding to a Gallup poll conducted in the final week of December that showed 47 percent of adult Americans approved of Obama’s job performance, 45 percent disapproved and 8 percent were undecided.
First, we asked for clarification of what Kaine meant when he said Obama is "fine."
Alec Gerlach, a DNC press secretary, said Kaine meant Obama’s mid-term poll numbers "are in the neighborhood of other presidents who got re-elected, including Reagan and Clinton." So for this fact-check we will focus on whether Obama's ratings are indeed similar to presidents who got re-elected.
Then we researched polls by Gallup because it has the longest record of tracking presidential popularity, dating to 1937 when Franklin Roosevelt was beginning his second term. We compared Obama’s numbers to the approval ratings other presidents received at the start of the year after mid-term congressional elections.
To keep the comparison consistent, we turned to the first Gallup poll on Obama completely conducted in 2011. A survey from Jan. 2 to Jan. 4 found the president had 49 percent approval, 45 percent disapproval and 6 percent were undecided on his job perfromance.
The average mid-term mark for presidents -- from Roosevelt in 1939 through Obama in 2011 -- is 53.5 percent approval, 36 percent disapproval and 10.5 percent undecided. Obama seems to be in the neighborhood, but not on the best street.
Let’s look at the presidents who got reelected in that time span. Their average mid-term approval was 57 percent and disapproval was 35 percent. Obama is not in that school district. But neither were Ronald Reagan nor Bill Clinton midway through their first terms. Then they moved up quickly.
Reagan was the least popular mid-term president. At the start of 1983, with the nation emerging from recession, he had 37 percent approval and 54 percent disapproval. Less than two years later, Reagan carried all but one state in a landslide reelection.
Bill Clinton’s numbers at the start of 1995 were similar to Obama’s today. Clinton had 47 percent approval, 45 percent disapproval. In 1996, he was easily reelected.
In contrast, George H.W. Bush had a robust 59 percent approval rating in early 1991 only to lose reelection the next year.
All told, we were able to find the last 19 mid-term presidential polls by Gallup. Obama’s approval rating is the 11th highest. Of the eight presidents below him, four times their party retained the White House in the next election, and four times it didn’t.
Larry Sabato, a University of Virginia political scientist, says mid-term polls are a horrible gauge of coming elections because a president’s popularity can soar or plummet with events.
"They don’t say a thing," he said. "The numbers that matter are the votes of people and, considering the beating Democrats took on Nov. 7, the president is by no means OK, assured of a successful term or a second one."
Kaine, with his spokesman’s elaboration, said Obama’s mid-term polling popularity is "fine" compared to other presidents who went on to re-election.
Kaine is correct in saying that Obama’s numbers compare favorably to Reagan and Clinton. But the president’s mid-term approval rating -- gauged by the first poll completely conducted in the new mid-term year -- is 8 percentage points below the average of re-elected presidents since 1939. His disapproval rating is 10 percentage points above the average.
We know those numbers can change in an instant. But when a politician is down by 8 or 10 percentage points, we say he’s behind but within striking distance.
We rate Kaine’s statement Half True.
Published: Monday, January 10th, 2011 at 10:00 a.m.
Tim Kaine interview, CNN’s State of the Union, Jan. 2, 2011.
Politico, The president’s progress, Dec. 31, 2010.
Interview with Alec Gerlach, regional press secretary for Democratic National Committee, Jan. 5, 2011.
Roper Center, presidential approval ratings.
Gallup, presidential approval rating for Jan. 2-4, 2011.
Interview with Larry Sabato, University of Virginia political scientist, Jan. 4, 2011. |
Random message arrivals in a gaussian cognitive radio We study the impact of random message arrivals in a two user Gaussian interference channel with one-way co-operation, also called as cognitive radio. In this model, one user (labeled cognitive user) has information about the message of the other user (labeled primary user). Specifically, we quantify the reduction in queuing delay for both the primary and cognitive users when the cognitive user has either non-causal or causal information about primary users data. Surprisingly, we find that the delay for the primary user also reduces even though the cognitive user does not use any of its transmission power to relay the information of the primary user. |
Prince Harry’s fiancee declared that the press’s early focus on her mixed race background was “disheartening” Monday, according to the Associated Press.
Meghan Markle, an actress of African American and Caucasian descent, struggled with how the press focused on her mixed-race background in the beginning stages of her and the prince’s relationship, the Associated Press reported.
“Of course it’s disheartening” Markle said about the press’ interest in her racial heritage. Various media outlets have played up Markle’s background, either by highlighting her ethnic background in their headlines or focusing on how her race breaks down barriers.
Harry and Markle announced their engagement Monday and plan to get married in 2018, according to an announcement from the royal family.
“Prince Harry has informed Her Majesty The Queen and other close members of his family. Prince Harry has also sought and received the blessing of Ms. Markle’s parents,” the royals said in a statement. |
MiR-103a-3p promotes tumour glycolysis in colorectal cancer via hippo/YAP1/HIF1A axis Background Glycolysis plays an essential role in the growth and metastasis of solid cancer and has received increasing attention in recent years. However, the complex regulatory mechanisms of tumour glycolysis remain elusive. This study aimed to explore the molecular effect and mechanism of the noncoding RNA miR-103a-3p on glycolysis in colorectal cancer (CRC). Methods We explored the effects of miR-103a-3p on glycolysis and the biological functions of CRC cells in vitro and in vivo. Furthermore, we investigated whether miR-103a-3p regulates HIF1A expression through the Hippo/YAP1 pathway, and evaluated the role of the miR-103a-3p-LATS2/SAV1-YAP1-HIF1A axis in promoting glycolysis and angiogenesis in CRC cells and contributed to invasion and metastasis of CRC cells. Results We found that miR-103a-3p was highly expressed in CRC tissues and cell lines compared with matched controls and the high expression of miR-103a-3p was associated with poor patient prognosis. Under hypoxic conditions, a high level of miR-103a-3p promoted the proliferation, invasion, migration, angiogenesis and glycolysis of CRC cells. Moreover, miR-103a-3p knockdown inhibited the growth, proliferation, and glycolysis of CRC cells and promoted the Hippo-YAP1 signalling pathway in nude mice in a xenograft model. Here, we demonstrated that miR-103a-3p could directly target LATS2 and SAV1. Subsequently, we verified that TEAD1, a transcriptional coactivator of Yes-associated protein 1 (YAP1), directly bound to the HIF1A promoter region and the YAP1 and TEAD1 proteins co-regulated the expression of HIF1A, thus promoting tumour glycolysis. Conclusions MiR-103a-3p, which is highly expressed in CRC cells, promotes HIF1A expression by targeting the core molecules LATS2 and SAV1 of the Hippo/YAP1 pathway, contributing to enhanced proliferation, invasion, migration, glycolysis and angiogenesis in CRC. Our study revealed the functional mechanisms of miR-103a-3p/YAP1/HIF1A axis in CRC glycolysis, which would provide potential intervention targets for molecular targeted therapy of CRC. Background Colorectal cancer (CRC) is one of the leading causes of cancer-related deaths worldwide. Due to the strong proliferation, invasion and metastatic ability of tumour cells, high energy metabolism is needed to provide the required energy. As the tumour volume increases, an anoxic state will inevitably occur in the tumour. Therefore, tumour cells have their own specific mechanism of cell metabolism, that is, a metabolic mode mainly based on glycolysis. If the glycolytic pathway of CRC cells is effectively inhibited, tumour progression can be controlled. However, at present, there is still no obvious effective drug targeting tumour cell metabolism. Therefore, studying the specific mechanism of CRC metabolism and finding effective molecular diagnostic and treatment targets is expected to prolong the survival of patients and improve prognosis. Research on the mechanism of tumour metabolic regulation is still in the preliminary exploration stage. In the hypoxic tumour microenvironment, hypoxia stimulates high expression of hypoxia-inducible factor (HIF) in cancer cells. HIF inhibits the oxidative phosphorylation pathway in cancer cells and further enhances the glycolytic pathway. This metabolic phenomenon is known as the Warburg effect. In a variety of malignant tumours, RAS, PI3K/Akt, BCR-ABL and other oncogenes all promote glycolysis and decrease mitochondrial oxidative phosphorylation. Our previous findings reported that YAP1, as an oncogene, was involved in CRC progression. YAP1 was reported to promote glycolysis in cancer. The Hippo pathway is a newly discovered evolutionarily conserved inhibitory signalling pathway. The Hippo pathway has important regulatory effects on organ size, tumourigenesis, tumour metabolism, stem cell homeostasis, and mesenchymal transition. In mammals, central to this pathway is a kinase cascade that includes the MST1, MOB1, LATS1, LATS2 and SAV1 kinases. One of the major targets of the Hippo core kinase cascade is YAP, which is phosphorylated and inhibited by activated LATS2 and SAV1. However, once the Hippo pathway is inactivated, non-phosphorylated YAP translocates into the nucleus, interacts with the transcription factor TEADs and then drives target gene expression. In recent years, research reports on the regulation of the Hippo pathway by miRNAs have gradually attracted attention. For example, it has been demonstrated that miR-135b regulates the Hippo pathway to promote lung cancer metastasis, and miR-31 inhibits the expression of LATS2 via the Hippo pathway and promotes epithelialmesenchymal transition in esophageal squamous cell carcinoma (ESCC). At present, the research of miR-NAs involved in the Hippo pathway on the regulation of metabolism is still in the primary exploration stage. Therefore, research on the function and mechanism of miRNAs affecting tumour metabolism via the Hippo pathway will open up a new field for the diagnosis and treatment of tumours. The development of CRC is a multi-step process involving multiple factors, including altered expression levels of various non-coding RNAs (ncRNAs). Increasing evidence suggests that abnormal expression of miRNAs is involved in oncogenesis, proliferation, metastasis and invasion of CRC. Among these miRNAs, studies have shown that miR-103a-3p is an oncogene and is upregulated in hepatocellular carcinoma, endometrial carcinoma and gastric cancer. In addition, miR-103a-3p was shown to promote the occurrence, proliferation, and metastasis of CRC and was associated with poor prognosis in patients with CRC, meanwhile, miR-103a-3p was reported to target LATS2, ZO1, et al.. However, the molecular mechanism by which miR-103a-3p regulates tumour metabolism via the Hippo pathway and promotes CRC invasion and metastasis remains largely unknown. We firstly proposed the hypothesis that miR-103a-3p may regulate CRC glycolysis through the Hippo pathway to promote the invasion and metastasis of CRC and then explored it. In this study, the expression of miR-103a-3p in CRC cells and tissues was confirmed to increase. MiR-103a-3p promotes YAP1/TEAD-mediated expression of HIF1A by directly targeting LATS2 and SAV1 and further promotes CRC glycolysis. Patient tissue specimens Forty paired CRC tissues and matched adjacent nontumour tissues were obtained from patients after receiving surgical resection at The First Affiliated Hospital of Zhengzhou University. None of the patients received any preoperative chemotherapy or radiotherapy. Survival was calculated by months. Overall survival (OS) was defined as the time from tumour excision to death by any cause. Pathological diagnoses of colorectal cancer were determined by three pathologists. The tumour stage was determined according to the eighth edition of the International Union Against Cancer (UICC)/American Joint Committee on Cancer (AJCC) TNM classification. All patients signed informed consent forms, and this protocol was approved by the Ethics Committee of The First Affiliated Hospital of Zhengzhou University. Cell culture, transfection and stable cell line construction HCT116 cells were obtained from iCell Bioscience Inc. (Shanghai, China) and authenticated by STR before use. SW480 cells were obtained from the Biotherapy Centre of The First Affiliated Hospital of Zhengzhou University. RNA extraction and quantitative real-time PCR Total RNA was extracted from cells and tissues with RNAiso Plus reagent (Takara, Dalian, China) according to the manufacturer's instructions. The concentration and purity of RNA were detected using a NanoDrop 2000 (Thermo Scientific, USA). First-strand cDNA was synthesized from 1 g of total RNA using the Prime Script RT Master Mix Kit (Takara), and real-time PCR was performed using GoTaq qPCR Master Mix (Vazyme, Nanjing, China) according to the manufacturer's instructions. 2 -Ct method was used to calculate relative levels of genes and miRNA expression. The primers are listed in Table S1. GAPDH or U6 was used as an endogenous control for normalization. The relative expression was calculated. Wound-healing assay The transfected HCT116 and SW480 cells were seeded in 12-well plates. After the cells were grown to 80-90% confluence, scratch wounds were generated by a 10 l plastic pipette tip, which was recorded as 0 h. Cell migration was assessed by measuring the movement of cells into the scratch wounds. Then, the scratch was imaged at 24 h, 48 h, 72 h, and 96 h. Wound width was measured with an ocular ruler to ensure that all wounds were the same width at the beginning of each experiment. Transwell assays To assess the migration and invasiveness of HCT116 and SW480 cells, we used Transwell chambers (Corning, NY, USA). Briefly, approximately 3 10 5 cells in serumfree medium were seeded in the upper chambers with 8 m pore size membranes to perform the migration assay in the absence of Matrigel (Corning, NY, USA) and the invasion assay with Matrigel. Dulbecco's modified Eagle's medium (500 l) supplemented with 10% foetal bovine serum was added to the lower chamber. After incubation in a humidified atmosphere containing 5% CO 2 at 37°C for 72 h, the migrated cells were fixed, and the other cells were wiped off. Then, the migrated cells were stained by Giemsa (Solarbio, Beijing, China). Stained cells were imaged under an IX53 inverted microscope (Nikon, Tokyo, Japan), and the Image-Pro Plus software programme (Media Cybernetics, Rockville, MD) was used to count the cells. Cell proliferation assay A total of 2 10 3 cells per well were seeded into 96-well plates. Cell proliferation was evaluated using Cell Counting Kit-8 (Dojin Laboratories, Tokyo, Japan) according to the manufacturer's instructions. We collected cell samples at 24 h, 48 h, 72 h, 96 h, and 120 h. Then, 10 l of CCK-8 solution was added to the culture medium and incubated for 2 h at 37°C. Viable cells were evaluated by measuring the absorbance at 450 nm with a reference wavelength of 570 nm. 5-Ethynyl-2-deoxyuridine assay (EdU) A total of 2 10 3 cells per well were seeded into 96-well plates, cultured overnight, washed with phosphatebuffered saline (PBS), fixed with 4% paraformaldehyde for 30 min, and incubated with 2 mg/ml glycine for 5 min. Based on the kFluor488-EdU manufacturer's instructions (RiboBio), 200 l of 1 Apollo dyeing solution was added to each well, followed by incubation at room temperature for 30 min. Next, 100 l of 0.5% Triton X-100 was used to wash the cells two to three times (10 min per wash). Following staining with Hoechst 33342 at room temperature for 30 min in darkness and one or two washes with PBS, the cells were observed using a Micro imaging system (ImageXpress, Downingtown, PA, USA). Five fields were randomly selected and imaged, and the number of EdU-positive cells was calculated. Tube formation assay Twenty-four-well plates were coated with 60 ml Matrigel (BD Biosciences, USA) at 37°C for 1 h for gel formation. 1 10 5 HUVEC were co-incubated with supernatants from each group stably transfected cells for 10 min in the pre-solidified Matrigel and allowed to start the process of forming capillary tubes and networks once seeded on Matrigel. Six hours after incubation, the plates were observed under a microscope and imaged (Nikon, Japan). The numbers of branching points generating at least three tubules were counted. Dual-luciferase reporter assay Luciferase activity assays were performed with the Dual-Luciferase Reporter Assay System (Promega, Beijing, China). Validation of miRNA targets was performed by cloning partial LATS2 (SAV1) 3-UTRs containing the sequence recognized by the miR-103a-3p seed sequence. HCT116 cells and HEK293 T cells were cotransfected with miR-103a-3p mimics, the Renilla luciferase reporter vector (Promega), and either wild-type (WT) or mutant LATS2 (SAV1) reporter constructs using Lipofectamine 2000 reagent (Life Technologies) according to the manufacturer's instructions. After 48 h of transfection, firefly and Renilla luciferase activities were measured using the Dual-Luciferase Reporter Assay System (Promega). Correction for differences in transfection efficiency was performed by normalizing firefly luciferase activity to total Renilla luciferase activity. Immunofluorescence assay HCT116 cells transfected with miR-103a-3p inhibitors were fixed by 4% paraformaldehyde and permeabilized by 0.1% Triton X-100 in PBS for 10 min. The cells were blocked with 5% BSA for 60 min at room temperature and incubated with primary antibody against YAP1 (1: 100) and HIF1A (1:500) overnight at 4°C. The next day, the cells were washed with PBS (0.1% Triton X-100) three times and then incubated with HRP conjugated secondary antibody for 60 min at room temperature, followed by nuclear staining with DAPI. Fluorescent images were acquired using an OLYMPUS FV1000 confocal microscope. Chromatin immunoprecipitation (ChIP) ChIP assays were performed as described previously. Briefly, HCT116 cells were fixed in 1% formaldehyde for 10 min at room temperature. Then the formaldehyde-fixed cells were collected, lysed and sonicated for 10 cycles of 30 s on and 10 s off to obtain chromatin fragments. 10 g chromatin fragments were incubated with 10 l antibodies against YAP1(1: 50), 10 l antibodies against TEAD1 (1:100) or 2 l antibodies against rabbit IgG (1:100) at 4°C overnight. The next day, the generated immuno-complexes were washed with lysis buffer (0.1 M NaHCO3, 1% SDS) four times and then decrosslinking was carried out for 4 h at 65°C. The associated genomic DNA was separated by SDS-PAGE. The precipitated DNA was subjected to PCR amplification. PCR was performed with HIF1A promoter-specific primers that amplified the YAP1/TEAD1 binding regions. The primers were HIF1A Forward 5-TACTCAGCACTTTTAGATGCTGTT-3 and Reverse: 5-ACGTTCAGAACTTATCCTACCAT-3. Measure the PH value in cell nutrient solution The PH value of cell nutrient solution was measured by pH Meter. The pH meter measured results in increments of 0.1 pH units, between 4.0 and 8.0. According to the manufacturer's instructions, before analysis, the pH Meter needed to be calibrated with pH 6.8 buffer solution. PH detection method is to insert the glass electrode into the cell culture medium to be measured, and then put another electrode. Between measurements, the pH sensor and container were rinsed with pure water. Seahorse assay The Seahorse XF 96 Extracellular Flux Analyzer (Agilent) was used to determine the extracellular acidification rate (ECAR). According to the manufacturer's instructions, ECAR was examined with a Seahorse XF glycolysis stress test kit. Briefly, 2 10 4 HCT116 or SW480 cells per well with different treatments were seeded into a Seahorse XF 96 cell culture plate with 15% fetal bovine serum DMEM overnight. Cells were washed and incubated with base medium with 2 mML-glutamine for 1 h at 37°C, CO2-free incubator. After 3 baseline measurements, glucose, oligomycin, and 2-DG was sequentially added d into each well at the time points specified to a final concentration of 10 mM, 10 M or 50 mM, respectively. ECAR dates were assessed by Seahorse XF 96 Wave software. Subcutaneous xenotransplantation model All mouse procedures were approved by the Institutional Animal Care and Use Committee of Zhengzhou University. All BALB/c nude mice, 6 weeks old, were acquired from Vital River Laboratory (Beijing, China). Logarithmic phase HCT116 cells (1 10 6 /100 l) were inoculated subcutaneously into the dorsal flank. After 12 days, according to the completely randomized design using a random comparison table, the mice with xenograft tumours were randomly divided into two groups, intratumoural injection of miR-103a-3p antagomir group and negative control group, to examine tumourigenicity. These mice were treated with miR-103a-3p antagomir every 3 days. The tumour size was measured by a slide calliper, and tumour volume was evaluated by the following formula: volume = (D d 2 )/2, where D was the longest diameter and d was the shortest diameter. All animals were sacrificed 32 days after inoculation, and the tumours were excised, weighed, fixed, and paraffin embedded for haematoxylin-eosin (H&E) and immunohistochemistry (IHC) staining detected under a microscope. All specimens were examined under a light microscope (Nikon, Japan). Immunohistochemistry Immunohistochemical staining was performed as previously described. Xenograft tumours for H&E and IHC were fixed in formalin, embedded in paraffin, and sectioned at 4-mm thickness after embedding. The deparaffinized sections were performed antigen retrieval in the boiling citrate buffer (0.01 M, pH 6.0) for 10 min. The sections were performed with antibodies against the following antigens (Cell Signalling Technology): P-YAP (1:1000), HK2 (1:5000), PKM1 (1:2000), PCNA (1:1000), and KI-67 (1:500) overnight at 4°C. The next day, the sections were incubated with the anti-goat IgG-HRP (Santa Cruz Biotechnology) secondary antibody at 37°C for 30 min. For immunohistochemistry, immunodetection was performed using DAB as the chromogen, and hematoxylin as nuclei counter-stain. Laser scanning confocal microscopy was used to capture images of the tumours. Statistical analysis All statistical analyses were carried out with SPSS version 18.0 (MT, USA) and GraphPad Prism 5.0 software (CA, USA). Data are expressed as the mean ± SEM. All differences between two independent groups were evaluated by a two-tailed Student's t-test. Survival curves were generated using the Kaplan-Meier method and compared using the log-rank test. The MedCalc software was used to generate the ROC curve, and the data were analyzed by twotailed t test. Pearson's coefficient was used to assess the correlation between two independent groups. The associations of miR-103a-3p expression and clinicopathologic variables were assessed by the Chi-square test or Fisher's exact test. The indicated P values (*P < 0.05 and **P < 0.01) were considered statistically significant. Results MiR-103a-3p is an oncogene in CRC and is correlated with poor prognosis in CRC patients To assess the role of miR-103a-3p in CRC, we first quantitated miR-103a-3p gene expression levels in CRC tissues and adjacent tissues using the microarray datasets GSE49246 and GSE115513 (P < 0.001; Fig. 1a). Using qRT-PCR, it was confirmed that miR-103a-3p was highly expressed in 40 paired CRC tissues and adjacent normal tissues (Fig. 1b). Moreover, among the cell lines tested, the expression level of miR-103a-3p was the highest in HCT116 cells, and the expression level of miR-103a-3p was the lowest in SW480 cells (NCM460 is a normal colon mucosal cell line) (Fig. 1c). In a cohort of 40 CRC cases, the patients were divided into low and high expression groups of miR-103a-3p. Univariate analysis showed that the high expression of miR-103a-3p was associated with distant metastasis (Tables S1). Interestingly, patients with high miR-103a-3p levels had a worse prognosis and shorter survival time than those with low miR-103a-3p expression (log-rank test, p < 0.05; Fig. 1d). These findings suggested that miR-103a-3p may play an oncogenic role in CRC. In a hypoxic environment, miR-103a-3p promotes CRC cell proliferation, invasion, migration, angiogenesis and glycolysis in vitro To investigate the physiological function of miR-103a-3p in CRC cells, the miR-103a-3p silencing and overexpression constructs were stably transfected into HCT116 and SW480 cells, respectively. The efficiency of overexpression and inhibition of miR-103a-3p was verified in colon cancer cells by qRT-PCR (Fig. 2a). Transwell and CCK-8 assays showed that miR-103a-3p silencing inhibited the invasiveness, metastasis and proliferation of HCT116 cells compared with the control group (Fig. 2b, d). In addition, knockdown or overexpression of miR-103a-3p reduced or increased the angiogenesis of HCT116 and SW480 cells, respectively, compared with those stably transfected with the corresponding empty vector (Fig. 2c). The acidity of the cell nutrient solution (i.e., the pH value) was significantly increased or decreased in SW480 or HCT116 cells with stable overexpression or knockdown of miR-103a-3p, respectively (Fig. 2e). Subsequently, we conducted the effect of miR-103a-3p overexpression and knockdown on glycolytic metabolism via seahorse assay. The result shows that the overexpression miR-103a-3p enhanced the extracellular acidification rate (ECAR), indicated that HCT116 cells transfected with miR-103a-3p mimics produced more extracellular lactate and enhanced the glycolytic metabolism compared with those transfected with mimics control (Fig. 2f). Knockdown of miR-103a-3p suppressed the ECAR of SW480 cells (Fig. 2g). Moreover, analysis using the TCGA dataset demonstrated positive associations between miR-103a-3p and HK2 and HIF1A (Fig. S1A, Supporting Information). We next examined the effect of miR-103a-3p on key molecules of glycolysis and on HIF1A by qRT-PCR. The results demonstrated that stable knockdown of miR-103a-3p decreased the transcript levels of HIF1A and its downstream glycolytic genes HK2, LDHA, and PFK1 in HCT116 cells, while the overexpression of miR-103a-3p increased the transcript levels of HIF1A and its downstream glycolytic genes HK2, LDHA, and PKM1 in SW480 cells compared with those in cells stably transfected with empty vector (Fig. 2h, i). Furthermore, we analysed the prognostic value, sensitivity and specificity of glycolytic genes in CRC patients from TCGA database. We found that higher expression of PFK1 or PKM1 was associated with lower survival probability (Fig. S1B, Supporting Information). The area under the ROC curve was used to determine the diagnostic value of glycolytic genes for CRC. The AUC of HIF1A, PKM1, LDHA, PFK1 and HK2 was 0.575, 0.928, 0.713, 0.839 and 0.713, respectively (Fig. S1C, Supporting Information). These results revealed that miR-103a-3p promotes tumour progression and glycolysis in CRC. Knockdown of miR-103a-3p suppresses CRC growth, proliferation, angiogenesis, and glycolysis in vivo To further confirm the in vitro findings, we observed the biological roles of miR-103a-3p in vivo. We injected HCT116 cells subcutaneously into the dorsal flanks of athymic nude mice to establish xenograft tumour model. One week later, the mice were randomly divided into an intratumoural injection of miR-103a-3p antagomir group and antagomir control group. The tumours were extracted after 3 weeks of drug treatment. Our results showed that the growth and weight of xenograft tumours treated with miR-103a-3p antagomir were lower than those of xenograft tumours treated with antagomir control (Fig. 3a-c). In addition, the expression levels of miR-103a-3p and the key glycolytic molecules HK2, LDHA and PFK1 in tumour tissues from miR-103a-3p antagomir group were lower than control values (Fig. 3d). Consistent with the above results, miR-103a-3p knockdown downregulated the protein expression of HK2 and LDHA. In addition, Western blot assays showed that the inhibition of miR-103a-3p decreased YAP1 expression and increased P-YAP expression, respectively (Fig. 3e). Furthermore, we observed the angiogenic ability of the two groups of tumour tissues by H&E staining. The results indicated that miR-103a-3p knockdown could inhibit tumour angiogenesis (Fig. 3f). Immunohistochemical staining revealed that the protein Fig. 2 MiR-103a-3p serve as oncogenic roles and promote glycolysis in CRC cells. a qRT-PCR assay indicating the levels of miR-103a-3p in SW480 and HCT116 cells stably transfected with miR-103a-3p mimics, mimics control, miR-103a-3p inhibitor or inhibitor control. b Transwell and d CCK-8 assays indicating the invasion, migration and proliferation ability of HCT116 cells transfected with empty vector or miR-103a-3p shRNA (sh-miR-103a-3p). c Angiogenesis ability in HCT116 and SW480 cells transfected with vector-1, sh-miR-103a-3p, vector-2, or miR-103a-3p mimics. e The acidity of the cell culture medium was detected in HCT116 and SW480 cells transfected with vector-1, sh-miR-103a-3p, vector-2, or miR-103a-3p mimics under hypoxia. f-g The ECAR and the variations of glycolysis, glycolysis capacity and glycolysis reserve of CRC cells were analyzed by Seahorse XFe 96 Extracellular Flux Analyzer. h-i qRT-PCR assay showing the expression levels of HK2, LDHA, PFK1, PKM1 and HIF1A in HCT116 and SW480 cells transfected with vector-1, sh-miR-103a-3p, vector-2, or miR-103a-3p mimics. *p < 0.05, **p < 0.01, ***p < 0.01 Fig. 3 MiR-103a-3p knockdown suppresses the growth, proliferation, angiogenesis, and glycolysis of CRC in vivo. Nude mice were subcutaneous injected with HCT116 cells transfected with antagomir control and miR-103a-3p antagomir. a MiR-103a-3p knockdown inhibited tumour growth. Tumour volume was measured every 3 d using the formula: volume = (length width 2 )/2. b The tumours weight was measured after dissecting from the nude mice at 37 d after injection. c Representative image of xenograft tumours was shown. d The level of miR-103a-3p, HK2, LDHA, and PFK1 were determined in tumour tissues from miR-103a-3p antagomir group and control group by qRT-PCR. e Western blot assays revealing the protein levels of LDHA, HK2, P-YAP and YAP1 in tumour tissues from miR-103a-3p antagomir group and control group. f Representative images showing vascular distribution and density within tumour tissues from miR-103a-3p antagomir group and control group by H&E staining (scale, 50 m). g Immunohistochemical staining showing the protein levels of HK2, PKM1, LDHA, KI-67, PCNA, and P-YAP in tumour tissues from miR-103a-3p antagomir group and control group (scale, 50 m). *p < 0.05, **p < 0.01, ***p < 0.001 expression of key glycolytic molecules HK2, LDHA, and PFK1 and the proliferation-related nuclear factors KI-67 and PCNA were downregulated in miR-103a-3p antagomir group, while the protein expression of P-YAP was significantly increased (Fig. 3g). TCGA CRC database revealed that miR-103a-3p expression positively correlated with YAP1 levels in the CRC tissues (Fig. S1D, Supporting Information). Collectively, our results suggest that miR-103a-3p silencing can restrict CRC cell growth, proliferation, glycolysis and angiogenesis in vivo. Based on overall evidences in the study, we speculate that miR-103a-3p participate in the regulation of the Hippo-YAP signalling pathway. MiR-103a-3p directly targets the core molecules LATS2 and SAV1 of the hippo pathway To verify that miR-103a-3p is involved in the Hippo pathway, we examined the effect of miR-103a-3p on the core molecules of the Hippo pathway by qRT-PCR, such as a series of upstream kinases MST1, MOB1, LATS1, LATS2 and SAV1, downstream effectors YAP and TAZ, and transcription co-activator TEAD1. The results showed that stable knockdown of miR-103a-3p increased the transcript levels of MST1, MOB1, LATS1, LATS2 and SAV1 and decreased the transcript levels of YAP1, TEAD1 and TAZ in HCT116 cells, while the overexpression of miR-103a-3p decreased the transcript levels of LATS1, LATS2 and SAV1 and increased the transcript levels of YAP1, TEAD1 and TAZ in SW480 cells compared with those stably transfected with empty vector (Fig. 4a, b). Then, to further explore the potential molecular mechanism of miR-103a-3p participating in the Hippo-YAP pathway, we predicted that LATS2 and SAV1 may be targets of miR-103a-3p based on the TargetScan, miRDB, Tarbase, and PITA databases and as demonstrated by Venn diagrams (Fig. 4c). Subsequently, we identified potential binding sites for miR-103a-3p in the 3'UTR of LATS2 (SAV1) mRNA using TargetScan (Fig. 4d). To validate whether LATS2 and SAV1 were direct targets of miR-103a-3p, a dual-luciferase reporter system containing the wild-type or mutant 3UTR of LATS2 (SAV1) was used. Cotransfecting miR-103a-3p mimics with the wild-type LATS2 (SAV1) vector induced a decrease in luciferase activity in 293 T and HCT116 cells, whereas miR-103a-3p mimic control cotransfected with the mutant LATS2 (SAV1) vector had no effect (Fig. 4e, f), suggesting that miR-103a-3p directly and specifically bound the predicted binding site in the 3 UTR of LATS2 (SAV1). In addition, in xenograft tumours, we also confirmed that the expression of LATS2 and SAV1 was upregulated in the group treated with miR-103a-3p antagomir compared with the control group (Fig. 4g). Taken together, our results revealed that LATS2 and SAV1 were direct targets of miR-103a-3p. YAP1/TEAD1 affects glycolysis and angiogenesis by promoting the transcription of HIF1A To investigate the role of HIF1A in CRC progression, a functional study of RNA overexpression and interference was performed. The acidity of the cell nutrient solution (i.e., the pH value) was significantly increased or decreased in HCT116 cells with stable overexpression or knockdown of HIF1A, respectively (Fig. 5a). We The HIF1A binding motif in HIF1A predicted from JASPAR matrix models. k Scheme of the potential binding sites of TEAD1 in the HIF1A upstream promoter region. l ChIP assays using anti-YAP1 and anti-TEAD1 antibodies were performed in HCT116 cells. *p < 0.05, **p < 0.01 predicted that HIF1A levels were positively correlated with the glycolytic genes HK2 and LDHA in CRC using the TCGA dataset (Fig. 5b). Similarly, GEPIA database also revealed that HIF1A expression positively correlated with HK2 (Fig. S2A, Supporting Information) and LDHA (Fig. S2B, Supporting Information) in colon cancer, rectal cancer and CRC, respectively. Subsequently, we verified that the protein levels of VEGFA and the glycolytic genes HK2 and LDHA were increased or decreased in HCT116 cells with stable overexpression or knockdown of HIF1A, respectively (Fig. 5c). In addition, stable knockdown or overexpression of HIF1A reduced or increased the angiogenesis of HCT116 cells, respectively, compared with those stably transfected with empty vector (Fig. 5d). These results revealed that HIF1A promoted glycolysis and angiogenesis in CRC. Meanwhile, GSEA demonstrated positive associations between YAP1 and the gene sets "reactome glycolysis" and "module 306 (description: glycolysis and TCA cycle)" (Fig. 5e). We further investigated the interplay effects between YAP1 and TEAD1 in regulating HIF1A expression. TEAD1 is a well-known transcriptional coactivator of YAP1. Analysis using the GEPIA dataset indicates that the YAP1 levels were positively correlated with TEAD1 in colon cancer, rectal cancer and CRC (Fig. S3A, Supporting Information), and surprisingly, the YAP1 and TEAD1 levels were both positively correlated with HIF1A (Fig. S3B, Supporting Information) or LDHA (Fig. S3C, Supporting Information). Furthermore, HIF1A was positively regulated by YAP1 and TEAD1 in HCT116 cells as evaluated by qRT-PCR (Fig. 5f, g) and western blotting (Fig. 5h). Cotransfecting si-YAP1A with si-TEAD1 significantly decreased the transcript levels of HIF1A in HCT116 cells (Fig. 5i). Further bioinformatics analysis (JASPAR) showed that the HIF1A promoter region might have a DNA binding motif of TEAD1 (Fig. 5j, k), suggesting a role of TEAD1 in regulating HIF1A expression. Subsequently, ChIP experiments demonstrated that both the YAP1 and TEAD1 proteins can interact with the HIF1A promoter in HCT116 cells overexpressing HIF1A (Fig. 5l). These findings suggest that YAP1 interacts with TEAD1 to co-regulate HIF1A in CRC. YAP1 participates in the regulation of the biological functions of CRC cells through HIF1A To explore whether YAP1 serves its biological functions through HIF1A, a rescue experiment was designed using YAP1, si-YAP1, HIF1A and si-HIF1A. The EdU cell proliferation assay indicated that YAP1 or HIF1A knockdown inhibited the proliferation of HCT116 cells, compared with the negative control group (Fig. 6a). Transwell migration (Fig. 6b) and wound-healing (Fig. 6c) assays indicated that YAP1 or HIF1A knockdown attenuated the migration of HCT116 cells, whereas HIF1A overexpression partially reversed the effects of YAP1 knockdown, and YAP1 overexpression partially reversed the effects of HIF1A knockdown in the assays. Together, these findings support the notion that the regulatory roles of YAP1 in CRC biological functions are HIF1Adependent. MiR-103a-3p affects glycolysis in CRC by regulating the hippo/YAP1/HIF1A axis The above results demonstrated that miR-103a-3p directly bound to LATS2 and SAV1 and suppressed their activity, and YAP1/TEAD1 could activate the transcription of HIF1A. It is known that inactivated LATS2 and SAV1 inhibit YAP1 phosphorylation and promote YAP1 entry into the nucleus. Therefore, we speculated that miR-103a-3p could promote YAP1 entry into the nucleus and affect the expression of HIF1A. Immunofluorescence assays confirmed that knockdown of miR-103a-3p markedly decreased the localization of YAP1 and HIF1A in the HCT116 cell nucleus and cytoplasm, respectively (Fig. 7a). Since the expression of HIF1A was regulated by miR-103a-3p targeting the LATS2/SAV1-YAP1 axis, whether miR-103a-3p completely or partially acts on the LATS2/SAV1-YAP1 axis remains to be determined. Therefore, we designed the corresponding rescue experiments. The knockdown of miR-103a-3p decreased the transcript level of HIF1A, whereas in the rescue experiment, the transcript level of HIF1A was reversed in HCT116 cells co-transfected with miR-103a-3p inhibitor and si-LATS2, si-SAV1 or YAP1 (Fig. 7b, c, d). Meanwhile, the overexpression miR-103a-3p increased the transcript level of HIF1A, whereas in the rescue experiment, the transcript level of HIF1A was reversed in SW480 cells co-transfected with miR-103a-3p mimics and si-YAP1 (Fig. 7e). These results indicated that miR-103a-3p regulated the expression of HIF1A through the Hippo-YAP1 axis. Furthermore, to explore whether miR-103a-3p promotes tumour glycolysis through the YAP1-HIF1A axis, we designed the rescue experiments to detect changes in glycolytic function and changes in the acidity of the extracellular medium. The overexpression of miR-103a-3p enhanced the ECAR of SW480 cells, whereas in the rescue experiment, YAP1 knockdown restored the enhanced glycolytic metabolism of miR-103a-3p overexpression (Fig. 7f). In addition, overexpression or knockdown of miR-103a-3p increased or decreased the acidity of the cell nutrient solution in SW480 and HCT116 cells, respectively (Fig. 7g, h). In rescue experiments, YAP1 or HIF1A knockdown partially restored the effect of miR-103a-3p overexpression, and YAP1 or HIF1A overexpression partially restored the effect of miR-103a-3p knockdown (Fig. 7g, h). Taken together, these results demonstrated that miR-103a-3p promotes tumour glycolysis by regulating the Hippo/ YAP1/HIF1A axis. Discussion CRC is currently one of the most common malignancies diagnosed worldwide, and its morbidity and mortality have been on the rise in China for nearly a decade. As diagnostic and therapeutic strategies progress rapidly, especially the application of immunotherapy and molecular targeted biological therapy, the overall survival rate of CRC has improved. Unfortunately, the overall prognosis of CRC remains poor, and new molecular diagnostics and therapeutic targets are urgently needed. In this study, we explored the effects of miR-103a-3p on CRC glycolysis and biological functions under hypoxic conditions by analysing clinical samples and performing experiments in vitro and in vivo. The present research confirmed that miR-103a-3p was highly expressed in CRC and its high expression was closely associated with tumour metabolism and predicted poor prognosis. Further experiments showed that miR-103a-3p inhibits the activation of the Hippo pathway via inhibiting its targets LATS2 and SAV1. The process would increase the entry of YAP1 into the nucleus to upregulate the expression of HIF1A via binding to the transcriptional coactivator TEAD1. Furthermore, we demonstrated that HIF1A promoted the transcription of VEGFA and the glycolytic enzymes HK2, LDHA, and PFK1, ultimately promoting proliferation, invasion, migration and angiogenesis of CRC cells (Fig. 7i). Intratumoural hypoxia plays a critical role in cancer progression, especially in cancer cell metabolism reprogramming. As HIF1A is a hypoxia-stimulating factor, HIF1A-mediated regulation of a variety of genes and pathways, including angiogenesis and glycolysis, is crucial to cancer progression. In addition to being regulated by hypoxic levels, HIF1A is also affected by oncogenes and tumour suppressor genes. In this study, miR-103a-3p knockdown reduced the expression of HIF1A and the key molecules of glycolysis HK2, LDHA and PFK1. In addition, the regulatory effect of HIF1A on tumour metabolism and pro-angiogenic effects were demonstrated by bioinformatics analysis and cytology experiments. We hypothesized that miR-103a-3p regulates tumour metabolism and biological functions through HIF1A. Previous evidence has demonstrated that hypoxia promotes the growth, glycolysis and stem cell potential of various tumours through the YAP/HIF1A signalling pathway. It is well known that YAP1 is a transcriptional coactivator of the Hippo pathway that plays an oncogenic role in a variety of malignancies. Similarly, our research was focused on the exploration of how YAP1 regulated glycolysis in CRC. According to previous investigations and bioinformatics predictions, HIF1A could promote tumour glycolysis, and its promoter region might have a DNA binding motif for TEAD1, a transcription coactivator of YAP1. Furthermore, ChIP analysis proved that YAP1/TEAD1 could coregulate the transcription of HIF1A and further promote tumour glycolysis. A rescue experiment was utilized to confirm that YAP1 serves its biological functions in CRC cells by regulating HIF1A. Subsequently, we studied the potential molecular mechanism by which miR-103a-3p is involved in this pathway. Numerous miRNAs have been confirmed to be involved in the regulation of the Hippo pathway. For example, our previous research showed that miR-590-5p directly targets YAP1 and inhibits tumourigenesis in CRC cells. In addition, a recent study showed that miR-103a-3p inhibits the Hippo pathway and activates YAP by directly targeting LATS2, ultimately promoting hepatoma cell metastasis and EMT. LATS2 is the upstream regulator of YAP. Upon activation of the Hippo pathway, YAP is phosphorylated by activated LATS2 and subsequently confined to the cytoplasm or degraded. In this study, LATS2 and SAV1 were confirmed as targets of miR-103a-3p in CRC cells and were inhibited by miR-103a-3p. Then, we performed the corresponding rescue experiments and indicated that miR-103a-3p promoted the expression of HIF1A and CRC glycolysis via targeting the LATS2/ SAV1-YAP1-HIF1A axis. Conclusion In summary, this project investigated the interactions between ncRNAs and YAP1 and their roles in the regulation of CRC glycolysis and tumour progression. MiR-103a-3p was found to be up-regulated in CRC and served as a tumour promoter. Our findings demonstrated that the miR-103a-3p-LATS2/SAV1-YAP1-HIF1A regulatory axis contributes to a better understanding of the molecular mechanisms of glycolysis in CRC, which would lay a theoretical foundation for molecular targeted therapy of CRC. Thus, miR-103a-3p could be regarded as a promising biomarker of CRC to improve individualized treatment for patients. Additional file 1 Table S1. Association between miR-103a-3p and clinicopathological characteristics among 40 colorectal cancer patients. Table S2. Primer sequences for real-time PCR. Table S3. SiRNA sequences of related genes. Figure S1. The overall survival of glycolytic genes expression and relationship between miR-103a-3p and glycolytic genes in TCGA datasets. Figure S2. Correlation analysis of HIF1A and glycolytic genes expression levels in colon cancer, rectal cancer and CRC using GEPIA database. Figure S3. Correlation analysis of YAP1/TEAD1 and glycolysisrelated gens expression levels in colon cancer, rectal cancer and CRC using GEPIA database. Authors' contributions SZQ and ZQG designed and performed experiments, analyzed data, and drafted the manuscript; YWT, LXL and CC guided experiments and analyzed data; GYX, SB, DQ, and ZQB performed some experiments; WQS and WGX initiated and analyzed data; LJB and KQC initiated the study and organized, and reviewed manuscript. The authors read and approved the final manuscript. |
<gh_stars>0
package bootstrap
import (
"context"
"path"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/maistra/istio-operator/pkg/apis/maistra"
"github.com/maistra/istio-operator/pkg/controller/common"
)
// InstallCNI makes sure all Istio CNI resources have been created. CRDs are located from
// files in controller.HelmDir/istio-init/files
func InstallCNI(ctx context.Context, cl client.Client, config common.CNIConfig) error {
// we should run through this each reconcile to make sure it's there
return internalInstallCNI(ctx, cl, config)
}
func internalInstallCNI(ctx context.Context, cl client.Client, config common.CNIConfig) error {
log := common.LogFromContext(ctx)
log.Info("ensuring Istio CNI has been installed")
operatorNamespace := common.GetOperatorNamespace()
log.Info("rendering Istio CNI chart")
values := make(map[string]interface{})
values["enabled"] = config.Enabled
values["image_v1_0"] = common.Config.OLM.Images.V1_0.CNI
values["image_v1_1"] = common.Config.OLM.Images.V1_1.CNI
values["image_v1_2"] = common.Config.OLM.Images.V1_2.CNI
values["imagePullSecrets"] = config.ImagePullSecrets
// TODO: imagePullPolicy, resources
// always install the latest version of the CNI image
renderings, _, err := common.RenderHelmChart(path.Join(common.Options.GetChartsDir(maistra.DefaultVersion.String()), "istio_cni"), operatorNamespace, values)
if err != nil {
return err
}
controllerResources := common.ControllerResources{
Client: cl,
PatchFactory: common.NewPatchFactory(cl),
OperatorNamespace: operatorNamespace,
}
mp := common.NewManifestProcessor(controllerResources, "istio_cni", "TODO", "maistra-istio-operator", preProcessObject, postProcessObject)
if err = mp.ProcessManifests(ctx, renderings["istio_cni"], "istio_cni"); err != nil {
return err
}
return nil
}
func preProcessObject(ctx context.Context, obj *unstructured.Unstructured) error {
return nil
}
func postProcessObject(ctx context.Context, obj *unstructured.Unstructured) error {
return nil
}
|
<filename>openGaussBase/testcase/SQL/INNERFUNC/systemInfo/Opengauss_Function_Innerfunc_Has_Directory_Privilege_Case0005.py
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
"""
"""
Case Type : 功能测试
Case Name : 创建路径赋权限之后切换用户查询权限
Description :
1. 创建用户,赋予权限
2. 切换到用户,使用has_directory_privilege函数查询被赋予以及未赋予的权限
3. 删除用户及路径
Expect :
1. 创建成功,赋权成功
2. 切换成功,只具有被赋予过的权限
3. 删除成功
History :
"""
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Logger import Logger
from testcase.utils.CommonSH import CommonSH
class Function(unittest.TestCase):
def setUp(self):
self.log = Logger()
self.commonsh = CommonSH('dbuser')
self.user = Node('dbuser')
self.pwd = <PASSWORD>.COMMON_<PASSWORD>WD
self.env = macro.DB_ENV_PATH
self.log.info('''---
Opengauss_Function_Innerfunc_Has_Directory_Privilege_Case0005开始---''')
def test_privilege(self):
self.log.info('''----------------创建用户及目录------------------''')
cmd0 = f"""drop user if exists hong;
drop directory if exists dir;
create user hong password '{<PASSWORD>}';
create or replace directory dir as '/tmp/';"""
msg0 = self.commonsh.execut_db_sql(cmd0)
self.log.info(msg0)
self.assertTrue(msg0.find('CREATE ROLE') > -1)
self.assertTrue(msg0.find('CREATE DIRECTORY') > -1)
self.log.info('''-----------将directory对象的读权限赋予用户-----------''')
cmd1 = """grant read on directory dir to hong;"""
msg1 = self.commonsh.execut_db_sql(cmd1)
self.log.info(msg1)
self.assertTrue('GRANT' in msg1)
priv = ['read', 'write']
res = ['t', 'f']
self.log.info('''-------切换到上述用户并查询其对directory的权限-------''')
for i in range(2):
cmd2 = f'''source {self.env}
gsql -d {self.user.db_name} -U hong -W {self.pwd} \
-p {self.user.db_port} -c \
"select has_directory_privilege('dir','{priv[i]}');"'''
msg2 = self.user.sh(cmd2).result()
self.log.info(msg2)
result = msg2.splitlines()[-2].strip()
self.assertTrue(result == res[i])
def tearDown(self):
cmd = f"""drop user if exists hong cascade;
drop directory if exists dir;"""
self.commonsh.execut_db_sql(cmd)
self.log.info('''---
Opengauss_Function_Innerfunc_Has_Directory_Privilege_Case0005结束---''')
|
Incorporating Power Electronic Converters Reliability Into Modern Power System Reliability Analysis This article aims to incorporate the reliability model of power electronic converters into power system reliability analysis. The converter reliability has widely been explored in device- and converter-levels according to physics of failure analysis. However, optimal decision-making for design, planning, operation, and maintenance of power electronic converters require system-level reliability modeling of power electronic-based power systems. Therefore, this article proposes a procedure to evaluate the reliability of power electronic-based power systems from the device-level up to the system-level. Furthermore, the impact of converter failure rates including random chance and wear-out failures on power system performance in different applications such as wind turbine and electronic transmission lines is illustrated. Moreover, because of a high calculation burden raised by the physics of failure analysis for large-scale power electronic systems, this article explores the required accuracy for reliability modeling of converters in different applications. Numerical case studies are provided employing modified versions of the Roy Billinton Test System (RBTS). The analysis shows that the converter failures may affect the overall system performance depending on its application. Therefore, an accurate converter reliability model is, in some cases, required for reliability assessment and management in modern power systems. |
Software programmers have difficulty preparing code for hardware that has not yet completed a design stage. Debugging software coding for undeveloped hardware is nearly impossible to do with a high level of confidence that the debugged software will function properly on a prototype version of the hardware under development. Conventional approaches involve waiting to run tests against a hardware device (i.e., silicon) to see how the software operates. When the hardware is available, the tests are applied to the prototype silicon and the results are compared. If there are defects in the software code, much time is wasted in the development stage waiting for functional software to be developed after the hardware is ready.
A second conventional approach is to develop a hardware model (i.e., a field programmable gate array) of the hardware device under development with which code debugging tests are run before the silicon is ready. Such tests include sort tests, class tests, and tests using evaluation boards. The tests are generally developed blindly before the hardware is available. When the silicon version of the hardware is ready, the tests are applied to the silicon hardware.
A third conventional approach involves developing a software model (i.e., register transfer language (RTL) simulation) with which to run functional tests before a prototype of the silicon is ready. Functional tests are then applied when the silicon is ready. Following the functional tests, a simulation versus silicon analysis is performed to see if the silicon behaves in the same manner as the simulations and if the code written is functional with the prototype. If the test fails, debugging/comparing the results of the functional simulations and silicon operation can be time consuming and error prone.
Disadvantages of the conventional approaches include spending a considerable amount of time debugging software tests. Time elapses before the tests are sufficiently debugged to be helpful to the developer. The developer may have to wait until a hardware prototype is available before debugging the software. Waiting for the hardware presents a bottleneck in the silicon characterization process, delays product release and is a competitive disadvantage. Additionally, errors often arise in developing software simulations before hardware is available for comparison. Problems involved in comparing the results of the silicon and software result in delayed characterization and a long time to market for the development cycle. With conventional solutions, stepping through tests on both hardware and software models simultaneously is not possible. Comparing hardware tests with RTL simulations during functional verification and debug stages is slow and unwieldy and presents a bottleneck to the debug and correction process. |
Tunable Band Topology in Gyroscopic Lattices Gyroscopic metamaterials, mechanical structures composed of interacting spinning tops, have recently been found to support one-way topological edge waves. In these structures, the time-reversal symmetry breaking that enables their topological behavior emerges directly from the lattice geometry. Here we show that variations in the lattice geometry can give rise to more complex band topology than has been previously described. A spindle lattice (or truncated hexagonal tiling) of gyroscopes possesses both clockwise and counterclockwise edge modes distributed across several band gaps. Tuning the interaction strength or twisting the lattice structure along a Guest mode opens and closes these gaps and yields bands with Chern numbers of |C| > 1 without introducing next-nearest-neighbor interactions or staggered potentials. A deformable honeycomb structure provides a simple model for understanding the role of lattice geometry in constraining the effects of time-reversal symmetry and inversion symmetry breaking. Last, we find that topological band structure generically arises in gyroscopic networks, and a simple protocol generates lattices with topological excitations. |
Ethnic Diversity and Social Capital in Upward Mobility Systems: Problematizing The Permeability of Intra-organizational Career Boundaries Members of minority ethnic groups in contemporary society typically do not achieve equal levels of objective career success in terms of income and occupational attainment compared to similarly educated members of the dominant professionals, career patterns of cumulative disadvantage have been observed in countries such as Belgium, Germany, and the Netherlands (). Objective career success is positively influenced not only by human capital, but also by social capital (Ng & Burke, 2005). Social capital is featured in " knowing whom " (Baruch & can thus impose boundaries on careers and ultimately on objective career success for members of different social groups. Minority ethnics may be less able to translate their human capital into argues that minority ethnics in managerial positions have less access to resources through social networks, resulting in less career advancement potential than dominant ethnics. In this sense, at least one of the drivers of boundaryless careers opens up a space for career boundary creation, which Inkson et al. regard relevant for further study. One of the few studies to establish a link between minority ethnic group membership, social capital, and career outcomes over time for the general 120 population of the United States was performed by Parks-Yancy. Kenny and Briner state that further research should look into " what happens to minority ethnic employees after they join organizations ", especially for minority ethnic professionals (p. 449). The process by which a relative lack of social capital results in less objective career success over time for minority ethnic managers and professionals has rarely been conceptualized or studied (see for an exception Bielby, 2012). Following up on Lin's call for future research on the career consequences of differential access to social capital for specific social groups, we explore and model the relationship between social capital and objective career success for minority ethnics compared to dominant ethnics. We first establish a reciprocal and spiraling relationship between social capital and career success over time. Next, we describe how ethnic group membership affects this relationship, on account of the three mechanisms of the return deficit of social capital as defined by Lin. We distinguish four previously established principles of social interaction that underlie these mechanisms. We illustrate how these principles act as filters, affecting the permeability of intra-organizational career boundaries. Our explicit focus on ethnic group membership is not only based on observed |
<filename>java/java-tests/testData/refactoring/extractMethod/SuggestChangeSignatureWithGetterFolding.java
import java.util.List;
class Test {
public static void foo(List<String> args, int i) {
<selection>System.out.println("hi");</selection>
System.out.println(args.get(i));
}
} |
<gh_stars>1-10
export const vId = 'test-vid';
export default {
vId
};
|
// NewSourceIPAddressFields creates a new NewSourceIPAddressFields.
func NewSourceIPAddressFields(v4, v6 net.IP, mpl uint8) *SourceIPAddressFields {
f := &SourceIPAddressFields{Flags: 0x00}
if v4 != nil {
f.SetIPv4Flag()
f.IPv4Address = v4
}
if v6 != nil {
f.SetIPv6Flag()
f.IPv6Address = v6
}
if mpl != 0 {
f.SetMPLFlag()
f.MaskPrefixLength = mpl
}
return f
} |
Hans Henrich Maschmann
Hans Henrich Maschmann (6 May 1775 – 19 November 1860) was a Norwegian pharmacist who was central to the effort to provide the country with medicines during the Napoleonic Wars.
Hans Henrich Maschmann was born in Oslo, Norway. He was the son of Johan Heinrich Maschmann (1719-1785) who had re-located from Hamburg, Germany. From 1773, his father had been the owner-operator of the pharmaceutical firm, Elefantapoteket i Christiania. In 1786, Hans Maschmann was sent to school in Hamburg which was followed three years later with a four-year apprenticeship at a pharmacy in Halden in Østfold. Later he traveled to Kongsberg, where he attended lectures of the Danish chemist Nicolay Tychsen (1751-1804). In 1796, he took his examen pharmaceuticum. In 1797, following the death of both of his parents, Maschmann received his license to acquire and operate the pharmacy.
When Denmark-Norway was drawn into the Napoleonic wars in 1807, the resulting British naval embargo limited the supply of goods, including pharmaceuticals. Maschmann worked with other pharmaceutical wholesaler in the country to avoided medical shortages during these crisis years which extended until the Treaty of Kiel in 1814. In 1839, he turned over management of the pharmacy firm to his eldest son Carl Gustav Maschmann, who died in 1848. He managed the pharmacy until 1856 when his younger son, Bernt Sverdrup Maschmann joined the firm.
Maschmann was a member of Royal Norwegian Society of Sciences and Letters from 1825. He was appointed Knight of the Order of St. Olav in 1853 and also knighted in the Swedish Order of Vasa. |
The 12 Questions series of interviews continues this week with Leavine Family Racing’s Michael McDowell. I spoke with McDowell at Dover International Speedway. This interview is available both in podcast and written form.
1. How much of your success is based on natural ability and how much has come from working at it?
That’s hard question. For me I would say 60/40 — 60 (percent) being working at it, 40 (percent) being natural ability. Ever since I was a kid, I’ve been competitive and been able to run at a high level, but I feel like the biggest separation in my later years in my career is just working hard at it.
2. Jeff Gordon, Tony Stewart, Carl Edwards and now Dale Earnhardt Jr. have all either retired in the last couple years or will retire soon. What’s your pitch for fans of theirs to become fans of yours?
It’s funny, because I think that your fans are your fans because they like you and because they can relate to you. You hear people say, “Well I was a Tony fan and now I’m trying to figure out who to be a fan of.” Normally they’ll migrate to someone similar personality-wise, driving style-wise, something like that.
So I don’t really have a pitch. I like to think that my fans are my fans because they relate to me and because they want to be fans of Michael McDowell.
3. What is the hardest part of your job away from the racetrack?
This job’s not very hard. We get paid to drive around in circles. But there’s a lot to it. I think the hardest part is just balancing your work life and your family life. That’s probably the hardest thing just because racing requires everything you have. Even when you’re not doing it, you’re still thinking about it.
When you’re home, you’re still thinking about the next week, I’m watching video and I’m looking at data. Even when I’m not doing those things, I’m still thinking about it. The hard part is just being able to switch it off and switch it on. It’s ingrained in you, racing, so you just live and breathe it.
You sort of never get away from it in some ways.
Exactly. It feels like you never get away from it.
4. A fan spots you eating dinner in a nice restaurant. Should they come over for an autograph or no?
Yeah, for sure. I don’t have any issues with that. It doesn’t happen all the time, so for me it probably wouldn’t be that big of a deal. I feel like there’s always a time and place to do it, so timing is very critical. But for fans, they don’t know what that looks like. It’s what we signed up for, so I always just have a little extra grace knowing that they’re just excited and it’s not that big of a deal, whatever it is you’re doing.
5. What’s a story in NASCAR that doesn’t get enough coverage?
There’s lots of stories. From 15th back doesn’t get enough coverage for anybody. We’re a sport of 40 drivers compared to other sports that have hundreds and thousands of athletes, and yet we still only focus on 10 guys. So I think just telling the other stories and telling who those people are and their teams, there’s just more to it than the 10 guys that are all retiring.
6. Who is the last driver you texted?
Hold on. Let me get my phone.
Pulling it up on your nice red-orange phone case. I don’t know if that’s red or orange. Some combo of the two.
Yeah it’s bright, because I leave it everywhere, so this helps me.
The last driver — Cole Whitt. David Ragan. Those were my last two.
You have them in a group chat or something?
No. I asked David Ragan about Pocono, taking the kids to the waterpark. That’s the intense conversations you have with drivers.
7. Do you consider race car drivers to be entertainers?
Some of them are. There’s a lot of personalities in the sport. I don’t consider this to be an entertainment sport from the standpoint of us as characters. On the racetrack, I think it’s an entertainment sport. But there’s a lot of characters in our sport. There’s a lot of people who are quite entertaining that don’t always show it.
8. What is your middle finger policy on the racetrack?
I’m not a big fan of it. Over the years, I’ve kind of changed a little bit. It used to be if somebody gave me the finger, I would do everything I could to get to their bumper and hit them. Most of the time if they gave you the finger it was because you’re holding them up and they’re faster than you so usually you can’t catch them to hit them.
I know that everybody has their own thing about it, but what I’ve learned is that most of the time when I do something of retaliation, I get myself in trouble, too. So it’s usually not worth it.
Did you ever successfully catch somebody and hit them after they gave you the finger?
Yeah lots of people, and that makes them really mad. But that’s the whole idea, you know what I mean?
9. Some drivers keep a payback list in their minds. I remember you kept a payback list on the inside of your uniform at one point. Do you also have a list for drivers who have done you a favor on the track?
The races, they go in these momentums and they go in the ebbs and flows. Yes, you do remember when someone cuts you a break. And cutting somebody a break could be when you’re catching them really quickly and they just don’t hold you up. Or it could be just merging off of pit road and letting you not get pinned down on the bottom, whatever it is. So you do remember that.
As far as retaliation lists, same thing. I used to really enforce it and now it’s not that I’ve gotten soft, but it just doesn’t help anybody. If anything, it just hurts you.
AJ (Allmendinger) and I were at it at the beginning of the year, and we were just hurting ourselves, just costing ourselves spots because we were both in that red mist mindset and we weren’t going anywhere. So I was able to sit down with him after a couple of races like that and say, “Alright man, we gotta figure this out, even if it means we gotta cut each other a little bit of breaks for the next couple weeks just to get over the hump.” Because when you start losing points and you start tearing up bodies, it makes a lot of work for the guys for no reason. So heat of the moment, things happen and that’s part of it, but separating the track and off-track is important too.
10. Who is the most famous person you’ve had dinner with?
I don’t know. Famous is relative to who you think would be famous and who I think would be famous. It’d be different right?
That’s true. It could be to you, so somebody you were fascinated by.
So probably Mario Andretti. When Marco (Andretti) was really young, I did some driver coaching with him at Sebring. Just being around the Andrettis, the family, was pretty cool because I grew up an Andretti fan and a Mario fan in particular. So that was probably pretty cool.
11. What’s something about yourself you’d like to improve?
A lot. On the racetrack?
You can answer it however you want.
I don’t know how you are, but I’m constantly trying to improve, whether that’s parenting my kids or trying to be a good husband or trying to make the most of my opportunity here. So I’m constantly taking inventory of, “Alright, these are the areas that are good,” and you highlight those and, “These are the areas you still gotta work on.” I feel like probably more than anything, it’s just patience and just being slow to speak. Sometimes I get myself in trouble.
12. Typically at this point I ask a question that the last driver has given me, but I screwed up the last interview which was supposed to be with Paul Menard, so there is no question from Paul Menard. So would you like to ask yourself a question here and answer it, or would you just like to skip this part?
No, I want to ask you a question.
Oh, you want to ask me a question?
So with your job description change, how is it being an independent versus working for the big brother?
Well, it’s a lot more fun, first of all. I feel like I can do a lot more of what I want. But what I was worried about was not people like you — because you’ve always been nice to me — but some people that have more difficult PR people might not give me as many interviews and access. But for the most part people have said, “Yes,” all year, so that’s really nice. Does that surprise you?
No, it doesn’t surprise me, because this sport is still relational and you’ve spent years building those relationships. So I don’t think it matters who your work for or who you drive for, who your sponsors are. When you build good relationships, I think people care more about you than who you work for.
That’s nice of you to say. Thank you. So there will be a next interview, hopefully, but I don’t know who it’s going to be with. Do you have a question I could ask the next driver?
What are the reasons for retirement? What are the things that would cause to you say, “You know what, that’s it. I’m good.”
So when they know it’s time, what’s gonna be driving that decision?
Yeah, for sure.
If you’re interested in becoming a patron of the website or the podcast, check out my Patreon page for more information. |
Living Together in the Yidishe Gas: The Case of Antwerp ABSTRACT Interwar Antwerp was home not only to a rapidly expanding Jewish community composed predominantly of first- and second-generation newcomers, but also to growing antisemitic and right-wing tendencies amongst the general population. These tendencies contributed significantly to the fact that the racial persecution during the Second World War struck Antwerps Jewish population severely. This history would hardly lead one to envision that, before or after the war, there had been harmonious neighbourhood life where Jews and non-Jews shared public space and in some cases established friendships. However, we do read accounts of pleasant neighbourly relations. This study seeks to explore this seemingly contradictory image and to offer suggestions for bridging the gap between micro- and macro-history via the sociological concept of social identifications and proximity. By examining the lives of two particular Jewish families from a bustling, diverse neighbourhood where Jews and non-Jews lived alongside each other, we can draw a picture of these families one a religious Orthodox family, the other Dutch and fairly assimilated and their respective relationships with the larger community around them before, during and after the Second World War. The dynamics at such a micro-level allow us to process information that at a macro-level is difficult to grasp or explain. It offers examples such as where disappointed friendships were nevertheless able to remain intact after the war, where Orthodox Jews refused help from non-Jews, and where collaborators saved Jews that can be explained by social identification or its lack thereof. Proximity played a key role in social identifications and this concept helps to fill in the missing interpretational link between, on one hand, the macro-image of victims, bystanders and perpetrators and, on the other hand, the micro-level, which presents a far more tangled and unclear (sometimes even contradictory) division of these categories. |
Oskar Lange's Theory of Socialist Planning This article shows that the belief that there is an alternative to the market (for a modern economy) is based on error and gives an analysis in history of ideas to show how the error arose. The relevance of an analysis that purports to deal with socialism and central economic planning is called into question. It is shown that the new school of socialist thought does not criticize market relationships but criticizes the real world market economy for not living up to the illustrative theory of pure competition. The outcome of the socialist controversy is the vindication of market relationships. |
/*
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013 Semtech
Description: Generic SX1272 driver implementation
License: Revised BSD License, see LICENSE.TXT file include in the project
Maintainer: <NAME> and <NAME>
*/
#ifndef __SX1272_H__
#define __SX1272_H__
#include "sx1272Regs-Fsk.h"
#include "sx1272Regs-LoRa.h"
/*!
* Radio wakeup time from SLEEP mode
*/
#define RADIO_OSC_STARTUP 1 // [ms]
/*!
* Radio PLL lock and Mode Ready delay which can vary with the temperature
*/
#define RADIO_SLEEP_TO_RX 2 // [ms]
/*!
* Radio complete Wake-up Time with margin for temperature compensation
*/
#define RADIO_WAKEUP_TIME ( RADIO_OSC_STARTUP + RADIO_SLEEP_TO_RX )
/*!
* Radio FSK modem parameters
*/
typedef struct
{
int8_t Power;
uint32_t Fdev;
uint32_t Bandwidth;
uint32_t BandwidthAfc;
uint32_t Datarate;
uint16_t PreambleLen;
bool FixLen;
uint8_t PayloadLen;
bool CrcOn;
bool IqInverted;
bool RxContinuous;
uint32_t TxTimeout;
}RadioFskSettings_t;
/*!
* Radio FSK packet handler state
*/
typedef struct
{
uint8_t PreambleDetected;
uint8_t SyncWordDetected;
int8_t RssiValue;
int32_t AfcValue;
uint8_t RxGain;
uint16_t Size;
uint16_t NbBytes;
uint8_t FifoThresh;
uint8_t ChunkSize;
}RadioFskPacketHandler_t;
/*!
* Radio LoRa modem parameters
*/
typedef struct
{
int8_t Power;
uint32_t Bandwidth;
uint32_t Datarate;
bool LowDatarateOptimize;
uint8_t Coderate;
uint16_t PreambleLen;
bool FixLen;
uint8_t PayloadLen;
bool CrcOn;
bool FreqHopOn;
uint8_t HopPeriod;
bool IqInverted;
bool RxContinuous;
uint32_t TxTimeout;
}RadioLoRaSettings_t;
/*!
* Radio LoRa packet handler state
*/
typedef struct
{
int8_t SnrValue;
int16_t RssiValue;
uint8_t Size;
}RadioLoRaPacketHandler_t;
/*!
* Radio Settings
*/
typedef struct
{
RadioState_t State;
RadioModems_t Modem;
uint32_t Channel;
RadioFskSettings_t Fsk;
RadioFskPacketHandler_t FskPacketHandler;
RadioLoRaSettings_t LoRa;
RadioLoRaPacketHandler_t LoRaPacketHandler;
}RadioSettings_t;
/*!
* Radio hardware and global parameters
*/
typedef struct SX1272_s
{
Gpio_t Reset;
Gpio_t DIO0;
Gpio_t DIO1;
Gpio_t DIO2;
Gpio_t DIO3;
Gpio_t DIO4;
Gpio_t DIO5;
Spi_t Spi;
RadioSettings_t Settings;
}SX1272_t;
/*!
* Hardware IO IRQ callback function definition
*/
typedef void ( DioIrqHandler )( void );
/*!
* SX1272 definitions
*/
#define XTAL_FREQ 32000000
#define FREQ_STEP 61.03515625
#define RX_BUFFER_SIZE 256
/*!
* ============================================================================
* Public functions prototypes
* ============================================================================
*/
/*!
* \brief Initializes the radio
*
* \param [IN] events Structure containing the driver callback functions
*/
void SX1272Init( RadioEvents_t *events );
/*!
* Return current radio status
*
* \param status Radio status.[RF_IDLE, RF_RX_RUNNING, RF_TX_RUNNING]
*/
RadioState_t SX1272GetStatus( void );
/*!
* \brief Configures the radio with the given modem
*
* \param [IN] modem Modem to be used [0: FSK, 1: LoRa]
*/
void SX1272SetModem( RadioModems_t modem );
/*!
* \brief Sets the channels configuration
*
* \param [IN] freq Channel RF frequency
*/
void SX1272SetChannel( uint32_t freq );
/*!
* \brief Sets the channels configuration
*
* \param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
* \param [IN] freq Channel RF frequency
* \param [IN] rssiThresh RSSI threshold
*
* \retval isFree [true: Channel is free, false: Channel is not free]
*/
bool SX1272IsChannelFree( RadioModems_t modem, uint32_t freq, int16_t rssiThresh );
/*!
* \brief Generates a 32 bits random value based on the RSSI readings
*
* \remark This function sets the radio in LoRa modem mode and disables
* all interrupts.
* After calling this function either SX1272SetRxConfig or
* SX1272SetTxConfig functions must be called.
*
* \retval randomValue 32 bits random value
*/
uint32_t SX1272Random( void );
/*!
* \brief Sets the reception parameters
*
* \param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
* \param [IN] bandwidth Sets the bandwidth
* FSK : >= 2600 and <= 250000 Hz
* LoRa: [0: 125 kHz, 1: 250 kHz,
* 2: 500 kHz, 3: Reserved]
* \param [IN] datarate Sets the Datarate
* FSK : 600..300000 bits/s
* LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
* 10: 1024, 11: 2048, 12: 4096 chips]
* \param [IN] coderate Sets the coding rate (LoRa only)
* FSK : N/A ( set to 0 )
* LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
* \param [IN] bandwidthAfc Sets the AFC Bandwidth (FSK only)
* FSK : >= 2600 and <= 250000 Hz
* LoRa: N/A ( set to 0 )
* \param [IN] preambleLen Sets the Preamble length
* FSK : Number of bytes
* LoRa: Length in symbols (the hardware adds 4 more symbols)
* \param [IN] symbTimeout Sets the RxSingle timeout value (LoRa only)
* FSK : N/A ( set to 0 )
* LoRa: timeout in symbols
* \param [IN] fixLen Fixed length packets [0: variable, 1: fixed]
* \param [IN] payloadLen Sets payload length when fixed lenght is used
* \param [IN] crcOn Enables/Disables the CRC [0: OFF, 1: ON]
* \param [IN] FreqHopOn Enables disables the intra-packet frequency hopping
* FSK : N/A ( set to 0 )
* LoRa: [0: OFF, 1: ON]
* \param [IN] HopPeriod Number of symbols bewteen each hop
* FSK : N/A ( set to 0 )
* LoRa: Number of symbols
* \param [IN] iqInverted Inverts IQ signals (LoRa only)
* FSK : N/A ( set to 0 )
* LoRa: [0: not inverted, 1: inverted]
* \param [IN] rxContinuous Sets the reception in continuous mode
* [false: single mode, true: continuous mode]
*/
void SX1272SetRxConfig( RadioModems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate,
uint32_t bandwidthAfc, uint16_t preambleLen,
uint16_t symbTimeout, bool fixLen,
uint8_t payloadLen,
bool crcOn, bool FreqHopOn, uint8_t HopPeriod,
bool iqInverted, bool rxContinuous );
/*!
* \brief Sets the transmission parameters
*
* \param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
* \param [IN] power Sets the output power [dBm]
* \param [IN] fdev Sets the frequency deviation (FSK only)
* FSK : [Hz]
* LoRa: 0
* \param [IN] bandwidth Sets the bandwidth (LoRa only)
* FSK : 0
* LoRa: [0: 125 kHz, 1: 250 kHz,
* 2: 500 kHz, 3: Reserved]
* \param [IN] datarate Sets the Datarate
* FSK : 600..300000 bits/s
* LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
* 10: 1024, 11: 2048, 12: 4096 chips]
* \param [IN] coderate Sets the coding rate (LoRa only)
* FSK : N/A ( set to 0 )
* LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
* \param [IN] preambleLen Sets the preamble length
* FSK : Number of bytes
* LoRa: Length in symbols (the hardware adds 4 more symbols)
* \param [IN] fixLen Fixed length packets [0: variable, 1: fixed]
* \param [IN] crcOn Enables disables the CRC [0: OFF, 1: ON]
* \param [IN] FreqHopOn Enables disables the intra-packet frequency hopping
* FSK : N/A ( set to 0 )
* LoRa: [0: OFF, 1: ON]
* \param [IN] HopPeriod Number of symbols bewteen each hop
* FSK : N/A ( set to 0 )
* LoRa: Number of symbols
* \param [IN] iqInverted Inverts IQ signals (LoRa only)
* FSK : N/A ( set to 0 )
* LoRa: [0: not inverted, 1: inverted]
* \param [IN] timeout Transmission timeout [ms]
*/
void SX1272SetTxConfig( RadioModems_t modem, int8_t power, uint32_t fdev,
uint32_t bandwidth, uint32_t datarate,
uint8_t coderate, uint16_t preambleLen,
bool fixLen, bool crcOn, bool FreqHopOn,
uint8_t HopPeriod, bool iqInverted, uint32_t timeout );
/*!
* \brief Computes the packet time on air in us for the given payload
*
* \Remark Can only be called once SetRxConfig or SetTxConfig have been called
*
* \param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
* \param [IN] pktLen Packet payload length
*
* \retval airTime Computed airTime (us) for the given packet payload length
*/
uint32_t SX1272GetTimeOnAir( RadioModems_t modem, uint8_t pktLen );
/*!
* \brief Sends the buffer of size. Prepares the packet to be sent and sets
* the radio in transmission
*
* \param [IN]: buffer Buffer pointer
* \param [IN]: size Buffer size
*/
void SX1272Send( uint8_t *buffer, uint8_t size );
/*!
* \brief Sets the radio in sleep mode
*/
void SX1272SetSleep( void );
/*!
* \brief Sets the radio in standby mode
*/
void SX1272SetStby( void );
/*!
* \brief Sets the radio in reception mode for the given time
* \param [IN] timeout Reception timeout [ms] [0: continuous, others timeout]
*/
void SX1272SetRx( uint32_t timeout );
/*!
* \brief Start a Channel Activity Detection
*/
void SX1272StartCad( void );
/*!
* \brief Reads the current RSSI value
*
* \retval rssiValue Current RSSI value in [dBm]
*/
int16_t SX1272ReadRssi( RadioModems_t modem );
/*!
* \brief Writes the radio register at the specified address
*
* \param [IN]: addr Register address
* \param [IN]: data New register value
*/
void SX1272Write( uint8_t addr, uint8_t data );
/*!
* \brief Reads the radio register at the specified address
*
* \param [IN]: addr Register address
* \retval data Register value
*/
uint8_t SX1272Read( uint8_t addr );
/*!
* \brief Writes multiple radio registers starting at address
*
* \param [IN] addr First Radio register address
* \param [IN] buffer Buffer containing the new register's values
* \param [IN] size Number of registers to be written
*/
void SX1272WriteBuffer( uint8_t addr, uint8_t *buffer, uint8_t size );
/*!
* \brief Reads multiple radio registers starting at address
*
* \param [IN] addr First Radio register address
* \param [OUT] buffer Buffer where to copy the registers data
* \param [IN] size Number of registers to be read
*/
void SX1272ReadBuffer( uint8_t addr, uint8_t *buffer, uint8_t size );
/*!
* \brief Sets the maximum payload length.
*
* \param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
* \param [IN] max Maximum payload length in bytes
*/
void SX1272SetMaxPayloadLength( RadioModems_t modem, uint8_t max );
#endif // __SX1272_H__
|
<gh_stars>0
import { DefaultTreeNode, DefaultTreeElement } from "parse5";
import { getAttributeValue } from "./attributes";
import { isElement, isTextNode } from "./nodeMatchers";
const walk = (current: string, node: DefaultTreeNode): string => {
/* istanbul ignore else */
if (isElement(node)) {
if (["style", "script"].includes(node.tagName)) {
return current;
}
if (node.tagName === "img") {
const value =
getAttributeValue(node, "alt") ?? getAttributeValue(node, "src");
if (value) {
return `${current} ${value} `;
}
}
return node.childNodes.reduce<string>(walk, current);
} else if (isTextNode(node)) {
return `${current}${node.value}`;
}
/* istanbul ignore next */
return current;
};
const impliedWalk = (current: string, node: DefaultTreeNode): string => {
/* istanbul ignore else */
if (isElement(node)) {
if (["style", "script"].includes(node.tagName)) {
return current;
}
if (node.tagName === "img") {
const value = getAttributeValue(node, "alt") || "";
return `${current}${value}`;
}
return node.childNodes.reduce<string>(impliedWalk, current);
} else if (isTextNode(node)) {
return `${current}${node.value}`;
}
/* istanbul ignore next */
return current;
};
export const textContent = (node: DefaultTreeElement): string =>
node.childNodes.reduce<string>(walk, "").trim();
export const impliedTextContent = (node: DefaultTreeElement): string =>
node.childNodes.reduce<string>(impliedWalk, "").trim();
export const relTextContent = (node: DefaultTreeElement): string =>
node.childNodes.reduce<string>(impliedWalk, "");
|
Mayak
Location
The nuclear complex is located 150 km south-east of Ekaterinburg, between the towns of Kasli and Tatysh, Mayk 55.6951 N, 60.8026 E and 72 km northwest of Chelyabinsk. The closest city, Ozyorsk, is the central administrative territorial district. As part of the Russian (formerly Soviet) nuclear weapons program, Mayak was formerly known as Chelyabinsk-40 and later as Chelyabinsk-65, referring to the postal codes of the site.
Design and structure
Mayak's nuclear facility plant covers about 90 square kilometers. The site borders Ozyorsk, in which a majority of the staff of Mayak live. Mayak, itself, was not shown on Soviet public maps. The location of the site together with the plant city was chosen to minimize the effects that harmful emissions could potentially have on populated areas. Mayak is surrounded by a ~250 km² exclusion zone. Nearby is the site of the South Urals nuclear power plant.
History
Built in total secrecy between 1945 and 1948, the Mayak plant was the first reactor used to create plutonium for the Soviet atomic bomb project. In accordance with Stalinist procedure and supervised by NKVD Chief Lavrenti Beria, it was the utmost priority to produce enough weapons-grade material to match the U.S. nuclear superiority following the atomic bombings of Hiroshima and Nagasaki. Little to no consideration was paid to worker safety or responsible disposal of waste materials, and the reactors were all optimized for plutonium production, producing many tons of contaminated materials and utilizing primitive open-cycle cooling systems which directly contaminated the thousands of gallons of cooling water the reactors used every day.
Lake Kyzyltash was the largest natural lake capable of providing cooling water to the reactors; it was rapidly contaminated via the open-cycle system. The closer Lake Karachay, too small to provide sufficient cooling water, was used as a dumping ground for large quantities of high level radioactive waste too "hot" to store in the facility's underground storage vats. The original plan was to use the lake to store highly radioactive material until it could be returned to the Mayak facility's underground concrete storage vats, but this proved impossible due to the lethal levels of radioactivity. The lake was used for this purpose until the Kyshtym Disaster in 1957, in which the underground vats exploded due to a faulty cooling system. This incident caused widespread contamination of the entire Mayak area (as well as a large swath of territory to the northeast). This led to greater caution among the administration, fearing international attention, and caused the dumping grounds to be spread out over a variety of areas (including several lakes and the Techa River, along which many villages lay).
Kyshtym disaster
Working conditions at Mayak resulted in severe health hazards and many accidents. The most notable accident occurred on 29 September 1957, when the failure of the cooling system for a tank storing tens of thousands of tons of dissolved nuclear waste resulted in a chemical (non-nuclear) explosion having an energy estimated at about 75 tons of TNT (310 gigajoules). This released 740 PBq (20 MCi) of fission products, of which 74 PBq (2 MCi) drifted off the site, creating a contaminated region of 15,000–20,000 km² called the East Urals Radioactive trace. Subsequently, an estimated 49 to 55 people died of radiation-induced cancer, 66 were diagnosed with chronic radiation syndrome, 10,000 people were evacuated from their homes, and 470,000 people were exposed to radiation.
The Soviet Union did not release news of the accident and denied it happened for nearly 30 years. Residents of Chelyabinsk district in the Southern Urals reported observing "polar-lights" in the sky near the plant, and American aerial spy photos had documented the destruction caused by the disaster by 1960. This nuclear accident, the Soviet Union's worst before the Chernobyl disaster, is categorized as a Level 6 "Serious Accident" on the 0–7 International Nuclear Events Scale.
When Zhores Medvedev exposed the disaster in a 1976 article in New Scientist, some exaggerated claims circulated in the absence of any verifiable information from the Soviet Union. People "grew hysterical with fear with the incidence of unknown 'mysterious' diseases breaking out. Victims were seen with skin 'sloughing off' their faces, hands and other exposed parts of their bodies." As Zhores wrote, "Hundreds of square miles were left barren and unusable for decades and maybe centuries. Hundreds of people died, thousands were injured and surrounding areas were evacuated." Professor Leo Tumerman, former head of the Biophysics Laboratory at the Institute of Molecular Biology in Moscow, disclosed what he knew of the accident around the same time. Russian documents gradually declassified from 1989 onward show the true events were less severe than rumored.
According to Gyorgy, who invoked the Freedom of Information Act to open up the relevant Central Intelligence Agency (CIA) files, the CIA knew of the 1957 Mayak accident all along, but kept it secret to prevent adverse consequences for the fledgling USA nuclear industry. "Ralph Nader surmised that the information had not been released because of the reluctance of the CIA to highlight a nuclear accident in the USSR, that could cause concern among people living near nuclear facilities in the USA." Only in 1992, shortly after the fall of the USSR, did the Russians officially acknowledge the accident.
Later history
In December 1968, the facility was experimenting with plutonium purification techniques. Two operators were using an "unfavorable geometry vessel in an improvised and unapproved operation as a temporary vessel for storing plutonium organic solution." "Unfavorable geometry" means that the vessel was too compact, reducing the amount of plutonium needed to achieve a critical mass to less than the amount present. After most of the solution had been poured out, there was a flash of light and heat. After the complex had been evacuated, the shift supervisor and radiation control supervisor re-entered the building. The shift supervisor then entered the room of the incident, caused another, larger nuclear reaction and irradiated himself with a deadly dose of radiation. This tale has since made its way into popular culture, being found in the website DarwinAwards.com.
2017 radiation release
Abnormally high levels of radiation were reported in the area of the facility in November 2017. Simultaneously, traces of radioactive manmade isotope Ruthenium-106 spread across Europe in September and October. Such a release had not been seen on a continental scale since the Chernobyl accident. In January 2018, the French Institute of Radioprotection and Nuclear Security (IRSN) reported that the source of the contamination is located in the Volga – Southern Ural region between 25 and 28 September for a duration of less than 24 hours. The report excludes the possibility of an accidental release from a nuclear reactor, stating that it seems related with irradiated fuels processing or the production of sources from fission products solution. It points to Mayak's aborted attempt to manufacture a capsule of highly radioactive component cerium-144, for the Italian Borexino supernova detection project. For now both the Russian government and Rosatom have denied that another accidental leak took place at Mayak. The release of a cloud of ruthenium-106, is similar to the B205 reprocessing accident in Britain in 1973.
Environmental impact
In the early years of its operation, the Mayak plant directly discharged high-level nuclear waste into several small lakes near the plant, and into the Techa River, whose waters ultimately flow into the Ob River. Mayak continues to dump low-level radioactive waste directly into the Techa River today. Medium level waste is discharged into the Karachay Lake. According to the data of the Department of Natural Resources in the Ural Region, in the year 2000, more than 250 million m³ of water containing thousands of curies of tritium, strontium, and cesium-137 were discharged into the Techa River. The tritium concentration, alone, in the Techa River near the village Muslyumovo exceeds the permissible limit by 30 times.
Rosatom, a state-owned nuclear operations corporation, began to resettle residents of Muslyumovo in 2006. However, only half of the residents of the village were moved. People continue to live in the immediate area of the plant, including Ozersk and other downstream areas. Residents report no problems with their health and the health of Mayak plant workers. However, these claims lack verification, and many who worked at the plant in 1950s and 1960s subsequently died from the effects of radiation. The administration of the Mayak plant has been repeatedly criticized in recent years by Greenpeace and other environmental advocates for environmentally unsound practices.
List of accidents
The Mayak plant is associated with two other major nuclear accidents. The first occurred as a result of heavy rains causing Lake Karachay, a dried-up radioactively polluted lake (used as a dumping basin for Mayak's radioactive waste since 1951), to release radioactive material into surrounding waters. The second occurred in 1967 when wind spread dust from the bottom of Lake Karachay over parts of Ozersk; over 400,000 people were irradiated. |
def _check_matrix_symmetric_positive_definite(self, matrix):
try:
if len(matrix.shape) != 2 or matrix.shape[0] != matrix.shape[1]:
return False
np.linalg.cholesky(matrix)
return True
except np.linalg.LinAlgError:
return False |
Louisiana Highway 59
Route description
From the south, LA 59 begins at an intersection with US 190 (Florida Street) along the northern edge of the city of Mandeville. US 190 is the main highway through town and connects to the Lake Pontchartrain Causeway, a toll bridge to New Orleans. LA 59 proceeds northeast on Girod Street as an undivided two-lane highway with a center turning lane. Though technically outside the Mandeville city limits, the area continues the city's grid pattern and residential development ensconced within a pine forest. This trend continues for 0.8 miles (1.3 km) to an intersection with LA 1088, a lateral highway connecting Mandeville with I-12 on the east side of town.
LA 59 continues northeast through an area of mixed rural and newer residential development and turns due north 1.8 miles (2.9 km) later. After passing the entrances to several sprawling school campuses, LA 59 goes through a diamond interchange with I-12, which connects to Hammond on the west and Slidell on the east. North of I-12, the surroundings change from residential to an area featuring several small industrial parks as well as the St. Tammany Parish Administrative Complex. After 1.3 miles (2.1 km), LA 59 makes a curve while crossing the Tammany Trace bike trail, located along a former railroad right-of-way. The highway resumes its regular course and, 1.8 miles (2.9 km) later, enters the small town of Abita Springs at an intersection with Harrison Avenue, a local road.
LA 59 continues north, narrowing slightly as its center lane is discontinued. The surroundings become largely residential once again, though often still hidden within the dense pine trees. 3.0 miles (4.8 km) into Abita Springs, LA 59 makes a sharp curve to the east into the center of town, where it becomes known as Level Street. Shortly afterward, the highway reaches the town's main junction, a roundabout at which LA 59 intersects and begins a concurrency with LA 36. At this roundabout, eastbound LA 36 heads toward Hickory and Pearl River; Level Street continues east as a local road; and LA 36 turns north with LA 59 onto Maple Street. One block later is an intersection with LA 435 (Main Street), which heads northeast toward Talisheek.
Upon exiting the populated portion of Abita Springs, LA 36 and LA 59 curve to the northwest and cross a small bridge over the Abita River. The two highways split shortly afterward as LA 36 continues west toward Covington while LA 59 turns north onto Range Line Road. LA 59 officially crosses the town limits after 0.7 miles (1.1 km) and continues north through a thick pine forest with scattered residential development. After 2.4 miles (3.9 km), the route ends at an intersection with LA 21 (Military Road). LA 21 heads southwest into Covington and northeast through Bush en route to Bogalusa.
Route classification and data
LA 59 is classified by the Louisiana Department of Transportation and Development (La DOTD) as an urban minor arterial from the southern terminus to the second junction with LA 36 in Abita Springs. It then becomes an urban collector from there to Lowe Davis Road, where it changes to a rural minor collector for the remainder of its route. Average daily traffic volume in 2013 is reported as 17,600 vehicles between Mandeville and Abita Springs, slightly decreasing to 16,000 within Abita Springs. The section north of Abita Springs has a much lower count of 5,300 vehicles. The posted speed limit is 35 mph (55 km/h) in Mandeville, increasing to 45 mph (70 km/h) between Mandeville and Abita Springs. It then decreases to 25 mph (40 km/h) in Abita Springs before becoming 55 mph (90 km/h) through the rural section north to LA 21.
History
In the original Louisiana Highway system in use between 1921 and 1955, the modern LA 59 was part of two separate state highways. State Route 114 followed the route from the southern terminus to Abita Springs, where it turned east and continued along the present LA 36 toward Hickory. The remainder of LA 59 north of Abita Springs was formerly State Route 190. Both routes were designated by an act of the state legislature in 1928 and existed until the 1955 Louisiana Highway renumbering.
LA 59 was created in the 1955 renumbering following the north–south portion of former State Route 114 combined with the entirety of former State Route 190.
La 59—From a junction with La-US 190 at or near Mandeville through or near Abita Springs to a junction with La 21 near Waldheim.
— 1955 legislative route description
The route of LA 59 has remained the same to the present day. In August 2007, the main junction in Abita Springs, previously governed by a traffic signal, was converted to a roundabout by the state highway department. The roundabout, only the second to be constructed on a state highway in Louisiana, was designed to reduce traffic congestion at the busy intersection and improve the flow of truck traffic.
Future
La DOTD is currently engaged in a program that aims to transfer about 5,000 miles (8,000 km) of state-owned roadways to local governments over the next several years. Under this plan of "right-sizing" the state highway system, the entire route of LA 59 (with the exception of the short concurrency with LA 36) is proposed for deletion as it no longer meets a significant interurban travel function. |
package page
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"reflect"
"github.com/factly/dega-server/config"
"github.com/factly/dega-server/service/core/action/author"
"github.com/factly/dega-server/service/core/model"
"github.com/factly/dega-server/test"
"github.com/factly/dega-server/util"
"github.com/factly/x/errorx"
"github.com/factly/x/loggerx"
"github.com/factly/x/meilisearchx"
"github.com/factly/x/middlewarex"
"github.com/factly/x/renderx"
"github.com/factly/x/slugx"
"github.com/factly/x/validationx"
"gorm.io/gorm"
)
// create - Create page
// @Summary Create page
// @Description Create page
// @Tags Page
// @ID add-page
// @Consume json
// @Produce json
// @Param X-User header string true "User ID"
// @Param X-Space header string true "Space ID"
// @Param Page body page true "Page Object"
// @Success 201 {object} pageData
// @Router /core/pages [post]
func create(w http.ResponseWriter, r *http.Request) {
sID, err := middlewarex.GetSpace(r.Context())
if err != nil {
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.Unauthorized()))
return
}
uID, err := middlewarex.GetUser(r.Context())
if err != nil {
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.Unauthorized()))
return
}
page := page{}
err = json.NewDecoder(r.Body).Decode(&page)
if err != nil {
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.DecodeError()))
return
}
validationError := validationx.Check(page)
if validationError != nil {
loggerx.Error(errors.New("validation error"))
errorx.Render(w, validationError)
return
}
result := &pageData{}
result.Authors = make([]model.Author, 0)
// Get table name
stmt := &gorm.Statement{DB: config.DB}
_ = stmt.Parse(&model.Post{})
tableName := stmt.Schema.Table
var postSlug string
if page.Slug != "" && slugx.Check(page.Slug) {
postSlug = page.Slug
} else {
postSlug = slugx.Make(page.Title)
}
featuredMediumID := &page.FeaturedMediumID
if page.FeaturedMediumID == 0 {
featuredMediumID = nil
}
// Store HTML description
var description string
if len(page.Description.RawMessage) > 0 && !reflect.DeepEqual(page.Description, test.NilJsonb()) {
description, err = util.HTMLDescription(page.Description)
if err != nil {
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.GetMessage("cannot parse post description", http.StatusUnprocessableEntity)))
return
}
}
result.Post = model.Post{
Title: page.Title,
Slug: slugx.Approve(&config.DB, postSlug, sID, tableName),
Status: page.Status,
IsPage: true,
Subtitle: page.Subtitle,
Excerpt: page.Excerpt,
Description: page.Description,
HTMLDescription: description,
IsHighlighted: page.IsHighlighted,
IsSticky: page.IsSticky,
FeaturedMediumID: featuredMediumID,
FormatID: page.FormatID,
SpaceID: uint(sID),
}
if len(page.TagIDs) > 0 {
config.DB.Model(&model.Tag{}).Where(page.TagIDs).Find(&result.Post.Tags)
}
if len(page.CategoryIDs) > 0 {
config.DB.Model(&model.Category{}).Where(page.CategoryIDs).Find(&result.Post.Categories)
}
tx := config.DB.WithContext(context.WithValue(r.Context(), userContext, uID)).Begin()
err = tx.Model(&model.Post{}).Create(&result.Post).Error
if err != nil {
tx.Rollback()
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.DBError()))
return
}
tx.Model(&model.Post{}).Preload("Medium").Preload("Format").Preload("Tags").Preload("Categories").First(&result.Post)
// Adding author
authors, err := author.All(r.Context())
if err != nil {
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.InternalServerError()))
return
}
for _, id := range page.AuthorIDs {
aID := fmt.Sprint(id)
if _, found := authors[aID]; found && id != 0 {
author := model.PostAuthor{
AuthorID: id,
PostID: result.Post.ID,
}
err := tx.Model(&model.PostAuthor{}).Create(&author).Error
if err == nil {
result.Authors = append(result.Authors, authors[aID])
}
}
}
// Insert into meili index
var meiliPublishDate int64
if result.Post.Status == "publish" {
meiliPublishDate = result.Post.PublishedDate.Unix()
}
meiliObj := map[string]interface{}{
"id": result.ID,
"kind": "page",
"title": result.Title,
"subtitle": result.Subtitle,
"slug": result.Slug,
"status": result.Status,
"is_page": result.IsPage,
"excerpt": result.Excerpt,
"description": result.Description,
"is_featured": result.IsFeatured,
"is_sticky": result.IsSticky,
"is_highlighted": result.IsHighlighted,
"format_id": result.FormatID,
"published_date": meiliPublishDate,
"space_id": result.SpaceID,
"tag_ids": page.TagIDs,
"category_ids": page.CategoryIDs,
"author_ids": page.AuthorIDs,
}
err = meilisearchx.AddDocument("dega", meiliObj)
if err != nil {
tx.Rollback()
loggerx.Error(err)
errorx.Render(w, errorx.Parser(errorx.InternalServerError()))
return
}
tx.Commit()
if util.CheckNats() {
if err = util.NC.Publish("page.created", result); err != nil {
errorx.Render(w, errorx.Parser(errorx.GetMessage("not able to publish event", http.StatusInternalServerError)))
return
}
}
renderx.JSON(w, http.StatusCreated, result)
}
|
Via ProPublica. Despite a steady stream of stories indicating that BP officials were, at the very least, criminally negligent, I just don't believe this administration has the cojones to really punish these bastards. As always, happy to be proven wrong!
Officials at the Environmental Protection Agency are considering whether to bar BP from receiving government contracts, a move that would ultimately cost the company billions in revenue and could end its drilling in federally controlled oil fields.
Over the past 10 years, BP has paid tens of millions of dollars in fines and been implicated in four separate instances of criminal misconduct that could have prompted this far more serious action. Until now, the company's executives and their lawyers have fended off such a penalty by promising that BP would change its ways.
That strategy may no longer work.
Days ago, in an unannounced move, the EPA suspended negotiations with the petroleum giant over whether it would be barred from federal contracts because of the environmental crimes it committed before the spill in the Gulf of Mexico. Officials said they are putting the talks on hold until they learn more about the British company's responsibility for the plume of oil that is spreading across the Gulf.
The EPA said in a statement that, according to its regulations, it can consider banning BP from future contracts after weighing "the frequency and pattern of the incidents, corporate attitude both before and after the incidents, changes in policies, procedures, and practices."
Several former senior EPA debarment attorneys and people close to the BP investigation told ProPublica that means the agency will re-evaluate BP and examine whether the latest incident in the Gulf is evidence of an institutional problem inside BP, a precursor to the action called debarment.
Federal law allows agencies to suspend or bar from government contracts companies that engage in fraudulent, reckless or criminal conduct. The sanctions can be applied to a single facility or an entire corporation. Government agencies have the power to forbid a company to collect any benefit from the federal government in the forms of contracts, land leases, drilling rights, or loans.
The most serious, sweeping kind of suspension is called "discretionary debarment" and it is applied to an entire company. If this were imposed on BP, it would cancel not only the company's contracts to sell fuel to the military but prohibit BP from leasing or renewing drilling leases on federal land. In the worst cast, it could also lead to the cancellation of BP's existing federal leases, worth billions of dollars.
Present and former officials said the crucial question in deciding whether to impose such a sanction is assessing the offending company's culture and approach: Do its executives display an attitude of non-compliance? The law is not intended to punish actions by rogue employees and is focused on making contractor relationships work to the benefit of the government. In its negotiations with EPA officials before the Gulf spill, BP had been insisting that it had made far-reaching changes in its approach to safety and maintenance, and that environmental officials could trust its promises that it would commit no further violations of the law. |
<filename>src/main/java/me/senseiwells/essentialclient/rule/carpet/IntegerCarpetRule.java
package me.senseiwells.essentialclient.rule.carpet;
import com.google.gson.JsonElement;
import me.senseiwells.essentialclient.utils.EssentialUtils;
public class IntegerCarpetRule extends NumberCarpetRule<Integer> {
public IntegerCarpetRule(String name, String description, Integer defaultValue) {
super(name, description, defaultValue);
}
@Override
public Type getType() {
return Type.INTEGER;
}
@Override
public Integer fromJson(JsonElement element) {
return element.getAsInt();
}
@Override
public CarpetClientRule<Integer> shallowCopy() {
return new IntegerCarpetRule(this.getName(), this.getDescription(), this.getDefaultValue());
}
@Override
public Integer getValueFromString(String value) {
Integer intValue = EssentialUtils.catchAsNull(() -> Integer.parseInt(value));
if (intValue == null) {
this.logCannotSet(value);
return null;
}
return intValue;
}
}
|
Arizona Prosecutor Says Uber Not Criminally Liable In Self-Driving Car Crash The woman was walking a bicycle across the road when she was fatally struck by the SUV. The car had a human operator behind the wheel but was in computer control mode at the time of the crash.
A video still from a mounted camera captures the moment before a self-driving Uber SUV fatally struck a woman in Tempe, Ariz., last March. A Yavapai County prosecutor found that Uber is not criminally liable for the crash.
An Arizona prosecutor has determined that Uber is not criminally liable in the death of a Tempe woman who was struck by a self-driving test car last year.
"After a very thorough review of all the evidence presented, this Office has determined that there is no basis for criminal liability for the Uber corporation arising from this matter," the Yavapai County Attorney's Office wrote in a letter to the Maricopa County Attorney's Office. Tempe is in Maricopa County, but Yavapai County took the case due to a potential conflict of interest.
Elaine Herzberg, 49, was walking a bicycle across the road at night when she was fatally struck by a Volvo SUV outfitted with an Uber self-driving system in March 2018. The car had a human operator behind the wheel but was in computer control mode at the time of the crash.
In the six seconds before impact, the self-driving system classified the pedestrian as an unknown object, then as a vehicle, and then as a bicycle, a preliminary report from the National Transportation Safety Board explained. While the system identified that an emergency braking maneuver was needed to mitigate a collision, the system was set up to not activate emergency braking when under computer control.
Instead, the car's system relied on the human operator to intervene as needed. "The system is not designed to alert the operator," the report notes. The driver swerved less than a second before the crash and did not brake until after impact.
The Arizona Republic has reported that the driver, 44-year-old Rafaela Vasquez, was streaming the television show The Voice in the vehicle in the minutes before the crash. Video from a camera inside the car shows Vasquez looking down immediately before the crash, glancing up at the road from time to time.
Vasquez could face charges of manslaughter. The prosecutor's letter recommends expert analysis of the collision video that would show what the driver "would or should have seen that night given the vehicle's speed, lighting conditions, and other relevant factors."
Uber, which declined to comment for this story, could still be sued in civil court and be forced to pay damages. The government could also potentially pursue criminal charges against managers or employees of Uber.
Herzberg's family reached a settlement with the company shortly after the crash. Her husband and daughter have also sued the city of Tempe, alleging that a brick pathway that crosses the landscaping was designed for people to cross at the accident site, the Republic reports. The city has since torn out the pathway.
Bryant Walker Smith, a University of South Carolina law professor whose research focuses on automated driving systems, suggests not reading too much into the prosecutor's letter.
Smith says he hopes the NTSB's final report on the crash will illuminate more about the crash. "And I would still like to see Uber publicly apologize and explain what specifically went wrong," he says. "Companies should earn our trust in part by being candid about their failures as well as their successes." |
<reponame>dengjintao/learn_golang
package _22
/**
golang中的这种依赖管理无法解决同一台开发机器上依赖不同版本的库的问题,也就是没有版本的概念
所以,在go 1.5中,vendor目录添加到除了 GOPATH和GOROOT之外的依赖目录查找的方案
1,首先查找当前包vendor目录
2,向上级目录查找,直到找到src下的vendor目录
3,在GOPATH中找
4,在GOROOT目录下找
常用依赖管理工具
godep
glide
dep
*/ |
Publishing a funerary Stela in the Egyptian Museum in Tokyo The paper publishes of a funerary stela which is now exhibited in the Shibuya Egyptian Museum at Tokyo and registered with the inv. no. AEM1043. It is made of limestone and measure about H. 28.4 cm W. 18.0 cm H. Its provenance is the Serapium of Saqqara with unknown dating. It is a flat top stela and divided into two registers. It shows the Apis bull in the recess at the top standing in a small naos. The first register shows a kingly figure presents offerings before the enthroned Osiris, and Isis stands behind, while the second one portrays an interesting depiction of a female maid is taking care of the dead's feet. Unfortunately, the stela lacks an inscription text to facilitate recognizing for the identity, character and give a precise dating. The paper investigates its funerary scenes and figure out a precise dating through its funeral art. The paper concludes that the stela is most often relates to the deceased woman, as one of the Greek elites in Memphis during the 4 century BC. I. Introduction The stela is now exhibited in the Shibuya Egyptian Museum at Tokyo and registered with the inv. no. AEM1043. It is made of limestone, and measure about H. 28.4 cm W. 18.0 cm, its provenance is the Serapium of Saqqara with unknown dating. Saqqara has a long history stretches as far back as the start of the pharaonic period until the Roman period, and the site is considered the most important link in the chain of cemeteries belonging to the ancient city of Memphis 1. It covers an area over 6 km length, and about m 1.5 km width. Saqqara contains both royal and non-royal tombs. In the Late Period non royal tombs of high status especially from the Saite period are also recorded, furthermore, smith documented poor burials of the lower levels of the local community on the necropolis, and indicated that a large number of them appear to be flanking the Serapium and explains this seems to evidence 'the desire to be near to the path of the god Osiris-Apis on his final journey to the Sarapieion' 2. And as a result of this and the importance of Memphis the cults of Ptah, the principal god of the city, and his emanation, the Apis bull, received royal attention. The Saite and the Ptolemaic kings paid great attention to Saqqara, Pathak I (664-610 BC) constructed a court in the Ptah's valley, where the Apis would reside during its life. It is also evident from the Serapium, that the great vaults for the mummified Apis began during the same reign 34. Many funerary stelae were found in the Serapium. Labudek categorized them into five categories 5 ; the 26 th stelae are divided into the first two categories. Category one-26 th Keywords: Saqqara; the deceased; Anubis; the afterlife; classical art. 2 | P a g e https://jaauth.journals.ekb.eg/ Dynasty: consists of those that were found in the lesser vaults and that date to year twenty/twenty-one of Psamthek. Category B-26 th Dynasty: They were found in the greater vaults that date to the rest of the 26 th Dynasty. The reason for the division of the 26 th Dynasty into two categories is due to the fact they are found in different areas from within the Serapium, as well as the large numbers and the considerable incongruity in the number of stelae in each specific period of the 26 th Dynasty. Category C-27 th Dynasty, they also came from the greater vaults. Category D: their date are obscure, and their specific provenance are also unknown, they are either known to be from the Serapium but are not attributed to a particular Apis bull, or are technically from an unknown provenance but due to their iconography and content are highly unlikely to be from any other site. The first four categories are considered 'unofficial' private stelae, about a hundred and fifty-six stelae in the non-royal corpus are recorded by Labudek 6 (Figure 1). Category E: they are labelled as 'royal' and they are the surviving official stelae from the Serapium dated to the Late Period. II. Description It is a flat top stela divided into two registers (Figures 2, 3). The first one shows a small figure of the Apis bull in the recess at the top standing in a small naos, the bull is speckled in black and white, while a sun disc in reddish is before the bull. The Apis bull is the living image of Osiris. Below, a human figure in the custom of a pharaoh is paying homage to an enthroned image of Osiris accompanied by Isis standing behind him. The pharaoh wears the white crown 'hedjet' and along royal kilt 'shendite'. He is burning incense with his right hand, present the snr bowl of incense, and venerates Osiris with his raised left hand. His body and arms are painted in reddish. In between of the kingly figure and Osiris, there is a partially damaged offering table; a vase and two bread loaves which are heaped upon it. Osiris sits upon a low back throne painted in reddish. He is depicted in his traditional costume with both arms across the chest and holds his divine insignia, composing of the crook Hk3heqa and the n -nekhakha flail scepter, symbols of sovereign and authority. He wears his traditional 3tf-atef crown. Goddess Isis stands behind Osiris playing her traditional role as his counterpart; she is protecting Osiris with her raised right hand and stretching her left hand towards an altar. She is crowned with the sun disc between of the two horns, while her traditional emblem surmounts the sun disc. 3 | P a g e https://jaauth.journals.ekb.eg/ Before Isis, is an engraved rectangular shape, probably supposed to contain her name? A base or a pedestal is carrying the whole scene of the first register and acting as a border line of the second register. The lower register depicts an anonymous aristocratic woman, enthroned and attended by a young maid shown in smaller scale as well as Anubis stands before the female. The female sits up on a high stool with a cushion, its base imitates the Greek Kline 7, she wears the Greek dress / exomis 'outside shoulder' 8 as a fitted garment with folds painted in reddish, her fashionable dress extends on her left shoulder cover her right breast while her left one is still bare. She also wears the Greek hat pileus/ Pilos wig 9, and holds a Greek bowl in her right hand and puts her feet on a low pedestal. The jackal -headed Anubis wears a short kilt, and stretches his right hand grasping the stretched left hand of the female, while he is touching the head of the young girl with his left hand. The young maid is seated on the ground without a stool or a cushion. She is making foot massage and reflexology by her both hands for the left foot of the female, while her right foot rests behind the low pedestal waiting its turn for massage. The upper part of the body of the young servant girl is naked. She wears a short-tight sash skirt which covers the lower part of her body; furthermore, she wears also the same Greek style Pilos wig which is worn by the female deceased. III. Commentary This is a votive stela which shows the piety of the owners to Osiris Apis. The steal is quite unique, that it is a flat one which is unusual in Memphis, that they were normally curved stelae 12. Moreover, it shows both funerary and secular iconography, portraying the deceased in his relationship with the Egyptian deities, as well as practicing foot care in a scarce depiction of this custom during that period. The Apis bull was the single living embodiment of the deity Ptah, becoming Osiris in death, being the son of Isis due to his divinity, and strongly linked with kingship due to his physical characteristics of strength and fertility. Apis related to the myth of Osiris, he accompanied Horus in his searching for the scattered parts of the body of Osiris and carried these parts on his back to be buried at Memphis 13. Therefore, he was inscribed as the "companion of the kings", and "the helper god". As Apis was the carrier of the mummy of Osiris, the deceased as Osiris, hope that Apis could carry him to his tomb in 5 | P a g e https://jaauth.journals.ekb.eg/ a "hurried run" 14 to secure a blessed journey to his afterlife. In the funerary iconography, Apis was widely depicted transporting the deceased to his tomb. Apis is a prominent figure in 90.1% in the Serapium stelae, most often as a fully bull form 15. At Memphis, the reason for the location of these burials on the Saqqara necropolis was due to the theological understanding that the Apis bull was the emanation of the Memphite creator god Ptah 16. The location used to denote the dead figure of the Apis bull is composed of two elements, Wsir and p, while Osiris-Apis was another form of the god Osiris, whose name composed of the same two elements. He was the main god of the Memphite necropolis, particularly in the area contains the catacomb of mummified Apis bulls 17 which was known as the Domain of Osiris-Apis (Pr-Wsir-p) 18. King Nectanebo II erected a temple dedicated to Osiris-Apis and Isis the mother of Apis 19. Devauchelle argued that the syncretistic deity Osiris-Apis is normally depicted in a form like that of Osiris himself rather than in the form of a bull 20, thus, Osiris-Apis is another deity is completely different from the Apis bull. Osiris-Apis was worshipped in the whole Egypt and his name is attested in texts from a range of places throughout Egypt, while the deceased Apis is mainly local, therefore, its text and findings are scarcely found outside Memphis 21. In the lunette Steal Cairo CG 31147, Osiris-Apis is enthroned flanked by Isis and Nephthys, wearing the atef-crown and holding the crook and flail, the signs of sovereignty, while the demotic texts above and below identify him as 'Osiris-Apis, the great god' 22. Osiris-Apis (later Serapis) is the spouse of Isis, while the Apis bull is her son, therefore, in the Memphite necropolis, in the catacomb, the cows that bore the bulls could be called Isis after their death 23. During the Greco-Roman period, the Osiris-Apis, with whom Serapis is identified not the mummified Apis bull. The identification of Serapis with Osiris-Apis was more familiar among Greeks than among Egyptians 24. The Greek papyrus of Artemis from Saqqara (4 th century BC) is the oldest document which record the assimilation between Oserapis and Serapis, and it could be before the Ptolemaic rule of Egypt 25. Serapis was a fusion of the dead Apis with Osiris in the form of Osiris-Apis 26. Serapis was the consort of Isis and the main deity of Alexandria, has royal connection since the pharaoh is often assimilated to the Apis 27. On the other side, the Apis bull is depicted in Alexandria tombs of Kom el-Schukafa and Tigrain, whereas he connected with royalty and carry signs that originate within the ancient Egyptian realm 28. The association between Apis and Osiris provides a reason for the bull's depiction on this stela. The Apis depiction is mainly related to the stela's provenance, the Serapium of Saqqara, where Apis had a main cult center at Memphis associated with kingship and ruling power 29. The mummified Apis bull had a long history of burials extended until the first half of the 3 rd century AD at the latest; though the last known Apis burial dates to 170 AD 30, all the mummified Apis burials have not yet been discovered 31. As, Osiris-Apis is the Egyptian equivalent of the Greek Serapis, and regarding to the fact that Serapis and Isis were divine couple, therefore, I speculate that this stela shows the divine triad of Memphis consisting of Osiris-Apis, the enthroned human holding the crook and flail, and Isis, his spouse, stands behind him, while Apis bull, the son of Isis in Memphis, is standing above. It is noteworthy that in the Late funerary stelae from 6 | P a g e https://jaauth.journals.ekb.eg/ Saqqara, Osiris, Most of the owners' names of the late period funerary stelae from Memphis are related to Osiris-Apis, noteworthy is the appearance of Osiris, who as god of the dead was rarely adopted in names, and the individuals directly connected with the cult of Osiris Apis 32. The male pharaoh figure who venerates Osiris, most often resembles the deceased himself in the form of a king. Images of deities and kings in private tombs are meant to help the deceased in the afterlife. The kingly image acts as intercessor between the gods and his people to facilitate the deceased's journey into his hereafter 33. In the Roman Egypt, the so-called 'democratization of the afterlife' guaranteed association between Osiris and the kingly costume of the deceased, while presenting offerings are related to the concept of Maat, guaranteeing the order of the universe 34. The deceased always seek to become Osiris NN 35, and his mummy imitates the appearance of Osiris to gain eternity 36. In this stela, the deceased depicts himself as Osiris in one of his main attributes and functions as a king to facilitate his justification. In the Ptolemaic-Roman Egypt, the funerary texts and iconography still address the deceased male as 'Osiris' 37. The mummy shroud of Budapest 51211shows the deceased as a king (Figure 4), and he wears the atef crown of Osiris. His name is supposed to be written in a rectangular shape like a cartouche 38. Also, in the non-royal tomb of Kom El-Schukafa, the Roman emperor as a pharaoh paying homage to the Apis bull. The pharaohs' figure presents offerings for the benefit of the deceased 39. On the other side, wearing the crown by the deceased has its special funerary context which confirms more association with Osiris, and plays a role in the rites symbolizing ascent to the sky and rebirth 40, helping the deceased to be transformed into an inhabitant of the sky. The literary meaning hieroglyphic c w-crown means like 'arising' and crowns as well 41. The lower scene has its secular characteristic than its funerary context. The appearance of Anubis is mainly related to his role as the god of the Saqqara necropolis, who would have assisted the Apis in his journey to the beautiful west. Anubis is a major distinctive figure in the Ptolemaic-Roman stelae 42. Anubis-Hermes is the more customary choice for leading the souls of the dead into the afterlife, acting as a psych pomp for the In the Greek methodology, the Greek Pilos cap is often identifying the mythical Dioscuri twins, Castor and Pollux, their caps were supposedly the remnants of the egg from which they hatched 46. It is also appeared on the votive figurines of boys at the sanctuary of the Cabeiri 'Cabeirion' at Thebes 47. In Ancient Greece, the Pilos was famous as the main countrymen's cap, this rustic cap presumably made of wool, fur, or animal skin. It was familiar among the poor workmen especially the metalworkers and farmers to protect them from harsh weather conditions 48. Therefore, the workers and farmers in the tomb of Pet Osiris wear this distinguished cap, while in the offering sequence in the naos, people are shown wearing Greek style of wreaths of blossoms, acting some figures depicted on as crowns of justification for religious festivities and general celebrations. It is also worn by the mummy portraits to justify the victory of the deceased over death 49. On the other side, Pipili assumed that there is another type of the Pilos, it is softer, fine and taller which is completely different from this rustic one. The latter is worn as an alternative to the broad-brimmed including horsemen, hunters 50, travelers (who are upper-class citizens), gods or heroes, since the early classical period. It was also worn by some hoplites instead of a helmet 51. Therefore, the Pilos was not eliminated for rude, coarse and undignified characters in the Greek society, but also for the handsome ones favored by the gods like the ferryman Phaon who wears the Pilos in the white ground Lekythos in the National Archaeological Athens Museum 17916. He is transporting the deceased across the Styx to the Underworld with Hermes 52. Pipili concluded that in the Greek art, the workman wears the Pilos, but he is often shown nude, while if he is dressed, he often wear the exomis, the short chiton which leaves one shoulder bare to facilitate movement, or a loincloth, and significantly, they may wear the Pilos cap as well 53. In this stela, the foot washing, massage and reflexology for the deceased woman is exceptional; it was more familiar in the ancient Egyptian tombs and temples 54. The most common implements and materials used by the servants for foot washing are the ewer with spout, which is like the merge vessel, basin, curious spoon shaped can, water and natron. In Ancient Egypt, foot care and wash was mainly connected to the king in the Heb sed Festival 55, a foot-washing ritual for the dead king by the gods as in the Book of the Dead "He might washed with the sun God in the pool of Earu and then be rubbed dry by Horus and Thoth, or wash his feet in the sun-gods own silver basin which has been fashioned by Sokar" 56. Some officials of the Old Kingdom were titled 'the washer or purifier of the Legs of the king of Upper Egypt' and 'the washer or purifier of the legs of the king of Lower Egypt' 57. On the other side, there are no tools used in foot massage or reflexology but certain oils and ointments may be used as it was depicted in the other scene of massage for the other parts of the body, oblong object, special knives, meant skin scraping knives, and nail clippers 58. As there are no washings' materials in 8 | P a g e https://jaauth.journals.ekb.eg/ the scene, it is more likely that the young a maid is making a massage for the female. In the Greek mythology, there is no interaction with foot care for the deceased. There is however interaction with the whole dead body during various stages of the funeral; in the house "prosthesis", the dead body is anointed with oil and incenses, it is dressed in a shroud and then it is lied upon a bier in the house for lamentation and mourning 59. Therefore, this stela documents the first pictorial of the foot massage for a deceased dressed in a Greek costume in the ancient Egyptian funerary art, which highly suppose the great influence of the Egyptian funerary beliefs on the Greek community at Memphis. IV. Dating It is difficult to give a precise date for the stela, the absence of a text is a big obstacle to give a date as well as to figure out the name and identity of the deceased. Who is the deceased? If the pharaoh-male figure who venerates Osiris in the upper register, or the female who receives the massage in the lower register? The upper register of the stela carries a pure funerary Egyptian context, while the lower one shows Egyptian-Greek syntax of art. A big Greek community lived in Memphis since the 6 th century BC. According to Herodotus, Pharaoh Amasis (r. ca. 570-527 BC) relocated the Greek and Carian mercenaries based in the Nile Delta to Memphis 60. A special Greek quarter in the city was attested in ancient Memphis, with its own temple (the Helenian), intermarriage between Greek and Egyptian integrated the so-called "Hellenomemphites", a kind of population 61. Numbers of Carian stelae with Carian inscriptions are found in the Serapium of Saqqara, and date from the Late Period 62. The Carians involved in Egyptian culture and funerary practices. The double style and hybridization in funerary art during the Greco-Roman period was common. There was no contradiction between being Hellenistic in dress and Egyptian in religion. In Memphis, the combination of portraits, stelae and mummies indicates that those patrons experienced a culture in which Hellenistic and Egyptian cultural traditions were closely integrated. Hybrid identities emerge when two different cultures encountering each other are juxtaposed and transformed into a new third identity that represents neither the one nor the other 63. The co-existence of Egyptian and Hellenistic funerary architectural and artistic features and iconography either in the tombs or mummy cases cannot be understood to visualize the patrons' ethnics. The shared multicultural milieu and cultural makers were not determining a particularly ethnic significance. The biculturalism in funerary iconography was familiar in funerary materials in Greco-Roman period, therefore, it was common to show the deceased in classical dress, while the iconographical vocabulary relies upon Egyptian traditional themes related to Osiris and Re. Being Hellenistic in dress, and Egyptian in religion, presented a mixture of cultural traditions for a shared cultural heritage. It was common that the deceased being classical in dress and Egyptian in iconography, it could be creating a new form of bicultural context during that period. Inhabitant in Greco-Roman period exploited Egyptian traditional iconography, which highly assimilated with Osiris 64. The people in poleis and metropolis shared multicultural milieus, where classical and Egyptian cultural traditions were equally apparent 65. 9 | P a g e https://jaauth.journals.ekb.eg/ Lembke suggested that in early Ptolemaic period in Tuna El-Gebel, there was a school of artists who followed the ancient Egyptian traditional system in funerary art, but also influenced by the Greek imagery. It is quite like that existed in the cosmopolitan city of Memphis; similar works were documented as being in the 'neo-Memphite' style 66. As, this stela is one of the one hundred and fifty-six stelae in the non-royal corpus which were recorded by Labudek, about one hundred and fourteen stelae show human figures; most of them portray only one male, while the rest present two figures; only the stela of Hor 'C30' 67 shows both a male and female figures. According to the female elongated body which is imitating the late 4 th century BC Greek sculptor style of Lysippus 68. Moreover, her costume in the Greek exomis chiton and the Pilos wig style, the latter which is widely depicted among the secular scenes of laborers and craftsmen in the pronaos of the tomb of Pet Osiris at Tuna El-Gebel, farm workers, including cowherds, laboring in the field of Pet Osiris wear the Greek Pilos 69. Therefore, I suggest that this stela is most probably dates to the early Ptolemaic period from the 4 th century BC. The Greek dress influence is limited to the pronaos of Pet Osiris Tomb, while the relief decoration of the naos is confined to Egyptian style. In general, the exomis was a Greek tunic mainly used by hoplites (light infantry) and workers. The tunic largely replaced the older chitoniskos (or short chiton) as the main tunic of the hoplites during the later 5 th century BC. On the other side, the Pilos on the figure's head possibly favors his interpretation as male: the hut was often worn by adult men as well as by boys/ephebes. Most of the people listed on the Late Period stelae were individuals with a religious role and background. Most of the titles seem to indicate at least a reasonable high religious or official status figure 70. Therefore, I highly recommend that the deceased is the aristocratic female, who is receiving her massage by her a maid. She is wearing the Pilos Greek wig which is also worn by the elite in the Greek community, moreover, according to the Greek methodology, in some cases, it secures a kind for greatness, heroism and in some cases divinity for the one who wears. According to the Egyptian funerary iconography, the Pilos wig most probably acts as 'a crown of justification' derives from chapter 19 of BD as a physical manifestation of the wearer's transfiguration and justification 71. The crown is a physical manifestation of the wearer's jubilance, 'justified' state. A Carian's stela from Saqqara shows its owner as a lector priest 72. Therefore, it is most often that the deceased woman had a Carian ethnic, and portrayed herself in a kingly gesture in the upper register, and she most probably was one of the Greek elites in Memphis during the 4 th century BC 'a Carian identity'. She portrayed herself in the form of a kingly male figure to secure a blessed transfiguration in the Osiris afterlife. The stela shows its female owner in the adoption of Egyptian religion and the maintenance of her own ethnic dress. As the Carian stelae in Saqqara, are divided into two groups; the first one depicts a figure in adoration of Osiris and Isis, while the second group shows the same in the top register and additionally the Apis bull with other deities/individuals in adoration in a separate register 73. I highly argue that this stela is one of the second group of the Carians' stelae in Saqqara. 10 | P a g e https://jaauth.journals.ekb.eg/ It was a Greek tunic used by workers and light infantry. The tunic largely replaced the older Chitoniskos (or short chiton) as the main tunic of the hoplites during the later 5 th century BC. It was made of two rectangles of linen (other materials were also used), which were stitched together from the sides to form a cylinder, leaving enough space at the top for the arms. An opening at the top was also left for the head. The cylinder was gathered up at the waist with a cloth belt using a reef knot, which made the cloth fall over the belt, hiding it from view, for exomis, see, Sekunda, N. Greek Hoplite 480-323 BC. 9 The Greek (pilidion) and Latin pilleolus were smaller versions, |
import math
from typing import List
import numpy as np
from ....utils.byte_io_mdl import ByteIO
def euler_to_quat(euler):
eulerd = euler[2] * 0.5
v8 = math.sin(eulerd)
v9 = math.cos(eulerd)
eulerd = euler[1] * 0.5
v12 = math.sin(eulerd)
v10 = math.cos(eulerd)
eulerd = euler[0] * 0.5
v11 = math.sin(eulerd)
eulerd = math.cos(eulerd)
v4 = v11 * v10
v5 = eulerd * v12
x = v9 * v4 - v8 * v5
y = v4 * v8 + v5 * v9
v6 = v10 * eulerd
v7 = v11 * v12
z = v8 * v6 - v9 * v7
w = v7 * v8 + v9 * v6
quat = w, x, y, z
return quat
class SequenceFrame:
def __init__(self):
self.sequence_id = 0.0
self.unk = []
self.unk_vec = []
self.animation_per_bone_rot = np.array([])
def read(self, reader: ByteIO, bone_count):
self.sequence_id = reader.read_float()
self.unk = reader.read_fmt('11I')
self.unk_vec = reader.read_fmt('3f')
self.animation_per_bone_rot = np.frombuffer(reader.read(6 * bone_count), dtype=np.int16).astype(np.float32)
self.animation_per_bone_rot *= 0.0001745329354889691
self.animation_per_bone_rot = self.animation_per_bone_rot.reshape((-1, 3))
class StudioSequence:
def __init__(self):
self.name = ''
self.frame_count = 0
self.unk = 0
self.frame_helpers: List[SequenceFrame] = []
self.frames = []
def read(self, reader: ByteIO):
self.name = reader.read_ascii_string(32)
self.frame_count = reader.read_int32()
self.unk = reader.read_int32()
def read_anim_values(self, reader, bone_count):
for _ in range(self.frame_count):
frame = SequenceFrame()
frame.read(reader, bone_count)
self.frame_helpers.append(frame)
self.frames.append(frame.animation_per_bone_rot)
|
Cooperative Adaptive Cruise Control Cooperative adaptive cruise control (CACC) includes multiple concepts of communication-enabled vehicle following and speed control. Definitions and classifications are presented to help clarify the distinctions between types of automated vehicle-following control that are often conflated with each other. A distinction is made between vehicle-to-vehicle (V2V) CACC, based on vehiclevehicle cooperation, and infrastructure-to-vehicle CACC, in which the infrastructure provides information or guidance to the CACC system (such as the target set speed value). In V2V CACC, communication provides enhanced information so that vehicles can follow their predecessors with higher accuracy, faster response, and shorter gaps; the result would be enhanced traffic flow stability and possibly improved safety. A further distinction is made between CACC, which uses constant-time-gap vehicle following (forming CACC strings), and automated platooning, which uses tightly coupled, constant-clearance, vehicle-following strategies. Although adaptive cruise control (ACC) and CACC are examples of Level 1 automation as defined by both SAE and NHTSA, the vehicle-following performance that can be achieved under each scenario is representative of the performance that should be expected at higher levels of automation. Implementation of CACC in practice will also require consideration of more than the lowest level of vehicle-following and speed regulation performance. Because CACC requires interactions between adjacent equipped vehicles, strategies are needed such as ad hoc, local, or global coordination to cluster CACC vehicles. Some of the challenges that must be overcome to implement the clustering strategies are discussed as well as strategies for separating CACC clusters as they approach their destinations, as potential traffic improvements from CACC will be negated if the vehicles cannot disperse effectively. |
/usr/local/python3/lib/python3.7/shutil.py |
Total integrated scatter from surfaces with arbitrary roughness, correlation widths, and incident angles Abstract. Surface scatter effects from residual optical fabrication errors can severely degrade optical performance. The total integrated scatter (TIS) from a given mirror surface is determined by the ratio of the spatial frequency band-limited relevant root-mean-square surface roughness to the wavelength of light. For short-wavelength (extreme-ultraviolet/x-ray) applications, even state-of-the-art optical surfaces can scatter a significant fraction of the total reflected light. In this paper we first discuss how to calculate the band-limited relevant roughness from surface metrology data, then present parametric plots of the TIS for optical surfaces with arbitrary roughness, surface correlation widths, and incident angles. Surfaces with both Gaussian and ABC or K-correlation power spectral density functions have been modeled. These parametric TIS predictions provide insight that is useful in determining realistic optical fabrication tolerances necessary to satisfy specific optical performance requirements. |
. Acute dyspnea represents a diagnostic challenge even for the experienced physician. There are no prospectively evaluated diagnostic algorithms dealing with this frequent clinical problem. First of all, the emergency has to be assessed and life supporting measures have to be considered. In addition to a thorough medical history and clinical examination, chest X-ray, spirometry, ECG, hemoglobin measurement, BNP and D-dimer testing represent valuable diagnostic tools and are available to GP's. Most commonly, acute dyspnoea is pulmonary or cardiac in origin. Up to one third of all cases will have several causes. Functional dyspnea is difficult to diagnose but should be taken into consideration after excluding any somatic cause. Hyperventilation is found in both, organic and non organic diseases, and is therefore an inappropriate criterion to differentiate between the two. The mainstay in the management of any symptom is to primarily treat the underlying disease. A significant hypoxemia (SO2 < 90%, pO2 < 60 mmHg) ought to be corrected by supplemental oxygen. It is inappropriate to withhold oxygen from patients with COPD and severe hypoxemia just to avoid hypercapnia. Besides oxygen, opiates efficiently relief dyspnoea but harbour the risk of respiratory depression, altered mental status or aspiration. |
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define ll long long
#define M 1000000007
#define all(a) a.begin(), a.end()
int T, n, k;
int f[510];
vector<int> g[510];
bool flag;
void dfs(int t){
f[t] = 1;
for(int v : g[t]){
dfs(v);
if(f[v]){
if(f[t]) f[t]--;
else flag = 0;
}
}
}
int main(){
scanf("%d", &T);
while(T--){
scanf("%d%d", &n, &k);
for(int i = 1; i <= n; ++i) g[i].clear();
for(int i = 1; i < n; ++i){
int u;
scanf("%d", &u);
g[u].pb(i + 1);
}
if(n & 1){
printf("Alice\n");
continue;
}
if(k < n / 2 - 1){
printf("Alice\n");
continue;
}
flag = 1;
dfs(1);
printf("%s\n", flag ? "Bob" : "Alice");
}
return 0;
}
|
A jarring thought occurred to me recently: Many people who never covered a day of the Steroid Era are voting for the Hall of Fame.
Writers accrue their voting rights after holding a Baseball Writers Association of America card for 10 consecutive seasons, so the idea of considering players you didn’t cover is not new. On my first ballot, for instance, was Ken Boyer, who played his last game when I was in grade school. (Back then, players remained eligible up to 20 years after their last season, a window since reduced to 15.)
What is jarring is that the Steroid Era stands apart from any era in the game’s history. You have to understand the unique context of that era. As time passes and as veteran writers prefer the path of least resistance, which is to just pretend it didn’t exist or lazily decide “everybody was doing it,” the disgrace of the era ebbs. Newer writers didn’t cover it. Eleven of the 12 first-year writers listed on BBHOFTracker.com voted for Barry Bonds and Roger Clemens, a 91.7% support rate for two players who in four years never cracked 50% of the vote.
Four years ago, I wrote about why I would not vote for any player known to be connected to performance-enhancing drugs. Five years ago, I wrote about the insidious damage of PED use, telling the story of four righthanded pitchers around the same age and with similar ability on the 1994 Fort Myers Miracle, a Class A affiliate of the Minnesota Twins. Only one of them reached the big leagues, and it was expressly because he was the only one to use steroids: Dan Naulty.
Read both. But if your attention span won’t allow it, digest this, the money quote from Naulty:
“I was a full blown cheater and I knew it. You didn’t need a written rule. I was violating clear principals that were laid down within the rules. Whether they were explicitly stated that I shouldn’t use speed or testosterone didn’t need to be stated. I understood I was violating mainly implicit principals. “I have no idea how many guys were using testosterone. But I would assume anybody that was had some sort of conviction that this was against the rules. Look, my fastball went from 87 to 96! There’s got to be some sort of violation in that. It was not by natural cause. To say it wasn’t cheating to me was ... it’s just a fallacy. There’s just no way you could say that’s not cheating. It was a total disadvantage to play clean.”
As someone who has spent years talking to players who used steroids and players who abhorred them and now hearing revisionist history, I can explain some concepts that help me fill out a ballot.
Evidence (or Lack Thereof)
Voting for the Hall of Fame when it comes to “suspected” steroid users is akin to sitting on a jury during a civil trial, not a criminal one. No one is going to jail. The task is to decide whether “a preponderance of evidence” connects the player to PED use. Hearsay, rumor, innuendo, “eyeball tests” and the like are not evidence. I’m talking about public evidence—and I don’t disregard such evidence because the job is “too hard.” There is no way I condone, endorse or celebrate steroid use under any circumstance. That means you don’t “earn” the right to cheat the game and your fellow competitors because you are “already a Hall of Famer.”
Clean Players
I’m not just talking about the ones on the ballot; I’m talking about the hundreds of clean players who had their livelihoods compromised by steroid users. These are the voices I hear every time I fill out a Hall of Fame ballot. I know how bastardized the game was back then. The inspiration for the 2002 story I wrote on steroids in baseball, which began the public pressure that eventually led to the union dropping its iron-clad resistance to drug testing, were the many clean players who volunteered to me over the '00 and '01 seasons how the game was horribly twisted. They told me their dilemma: Either you put yourself at a disadvantage by playing the game clean, or you were forced to risk your health, conscience and legal standing to keep up with the cheats. One clean player I know competed three times with three different teams for a starting job. All three times he lost the job to a steroid user. He never made big money.
In my 2002 story, people mocked former NL MVP Ken Caminiti for suggesting that as many as half the players were on PEDs, claiming he exaggerated the problem. Many of the same people today, in order to simplify their voting, blithely say, “Ah, everybody was doing it.”
Fred McGriff
Fred McGriff is the best example of why people who didn’t cover the Steroid Era don’t understand the historical harm it caused. Here’s why McGriff is a Hall of Famer, and I’ll try to dumb it down as much as possible because I know most people have neither the time nor the awareness for nuance:
1. Only 31 players in baseball history have hit 475 home runs. Every one of them who has been on the ballot and not been connected to steroids is in the Hall of Fame except one: Fred McGriff (he has 493, good for 28th place);
2. Only 37 players in baseball history have posted an OPS+ of 129 or more over 10,000 plate appearances—a rare feat of sustained excellence over many years. Every one of them who has been on a ballot and not been connected to steroids is in the Hall of Fame except one: Fred McGriff. (He ranks 24th at 134, better than first-ballot Hall of Famers such as Tony Gwynn, Eddie Murray and Dave Winfield.)
So why has McGriff never received even 25% of the vote after seven tries? Steroids. He chose not to use them, and his numbers suffered in comparison to those who did.
Let’s play a game. Suppose that after his age-33 season, when he hit 22 homers and drove in 97 runs in 1997, McGriff went to BALCO for their cutting edge drugs and detailed doping regimen—the same age Barry Bonds was when, according to Game of Shadows, he decided to seek such help. Now let’s give McGriff’s career statistics the same BALCO boost—on a percentage basis based on McGriff’s numbers to that point—that Bonds enjoyed after age 33. Here’s the difference.
Years Home Runs Hits Average "Clean" McGriff 493 2,490 .284 "BALCO" McGriff 564 2,567 .293
With BALCO’s help, McGriff becomes one of only eight players in baseball history to hit .293 or better with 564 home runs. The others: two steroid users (Bonds and Alex Rodriguez) and five all-time greats (Hank Aaron, Willie Mays, Albert Pujols, Frank Robinson and Babe Ruth).
Now let’s really get silly and imagine that Bonds never went to BALCO. Let’s imagine that Bonds’ numbers declined after age 33 the same way they did for “Clean” McGriff—essentially a normal aging pattern. That means, for example, that Bonds’ batting average after age 33 goes down two points (not up by 26 points, as it did), his home-run rate slows (not goes up 20%) and he is done at age 40 (not 42).
Now look what happens in our bizzaro world in which McGriff goes to BALCO and Bonds does not:
Years Home Runs Hits Average "Clean" Bonds 599 2,587 .289 "BALCO" McGriff 564 2,567 .293
When it comes to Hall of Fame voting, nobody has been more harmed by the Steroid Era than McGriff.
Peak and Longevity
I generally vote for players who were among the very best in the game for roughly a decade and have major career numbers. Exceptions exist, such as someone with a Sandy Koufax-like peak. For instance, when Clayton Kershaw throws his first pitch of this season—it will mark his 10th season, the minimum for Hall eligibility—he will have earned my Hall of Fame vote.
I have withheld my vote for Edgar Martinez because I didn’t see enough longevity. His stat line has similarities to those of Will Clark and Moises Alou, for instance, both of whom fell off the ballot after a single season. But while covering Martinez, I always understood him to be one of the best pure hitters in the game, and countless opponents said so. I went back and dove into his prime again. Was it exceptional? This list, among players who are Hall eligible, provided more information.
Player Years with 140 OPS+ Career Hits Dick Allen 11 1,848 Edgar Martinez 10 2,247 Fred McGriff 9 2,490 Jeff Bagwell 9 2,314 Charlie Keller 9 1,085
Posting an adjusted OPS of 140 or better is some serious raking. Only 12 players did so last year. To have roughly a decade’s worth of elite hitting is exceptional. Note how McGriff turns up again here.
Choice
More than 400 people consider 34 players with more than 4,000 combined available spots on the ballots, and only those players named on at least 75% of the ballots get elected. Difference of opinion should be both expected and honored.
Former New York Times baseball writer Murray Chass handed in a blank ballot. Do I agree with his decision? No, but I respect his freedom of choice as a qualified voting member of the BBWAA. By the way, there's nothing new here: blank ballots were cast at least as far back as 1991, as well as in in 2003 (five), '07 (two), '09 (five) and '14 (one).
In 72 elections, the BBWAA has elected 121 players to the Hall of Fame, an average of just 1.68 per year. That’s how hard it has been to get elected to the most prestigious, most talked about Hall of Fame in all of sports.
The Today’s Game Committee's Choices
The most ridiculous new narrative is that because this committee voted Bud Selig into the Hall of Fame, now we must vote in steroid users. This is laughable on so many levels, starting with the concept of chucking your voting standards to adopt those of this committee. Do you know what percentage of Hall of Famers have been voted in by the BBWAA? Just 38.8%.
But let’s just say you do take your cues from this committee. Did you see what the 16 committee members did with admitted steroid user Mark McGwire? He got “fewer than five votes,” which is the Hall’s way of saving also-rans from the embarrassment of having their true vote total announced. It was a complete repudiation of an actual player who used steroids, not an executive. So why isn’t that the new narrative to guide a vote?
“Morality”
People who vote for steroid users like to use this word as a pejorative, as in, “We are not the morality police.” Relax. Save the overwrought comparisons to racists, drunks and sociopaths. We’re not talking about taking the measurement of how people live their life. We’re talking about the very bedrock of sports: fair play. If you don’t have an even playing field, you lose the foundation of competition. It should be my best and against your best, not my best against the best drugs you can covertly use to transform yourself.
So yes, we’re talking about integrity, but integrity as it relates only to how a player competed on the field.
“Environment”
“A flawed time.” “A loose era.” “A loosey-goosey culture.” Stop with the linguistic gymnastics and excuses. We are all a product of the choices we make. To blame the “environment” is to miss the conscious decision a player faced: Either you engaged in cheating that was so wrong you had to hide your usage and you could never admit it—and most still haven’t—or, as many did, you played the game clean.
McGwire, one of the few admitted users before testing said it best when it comes to taking ownership:
It’s a mistake that I have to live with for the rest of my life. I have to deal with never, ever getting into the Hall of Fame. I totally understand and totally respect their opinion and I will never, ever push it. That is the way it’s going to be and I can live with that. One of the hardest things I had to do this year was sit down with my nine and 10 year old boys and tell them what dad did. That was a really hard thing to do but I did it. They understood as much as a nine or 10 year old could. It’s just something, if any ball player ever came up to me, [I'd say] run away from it. It’s not good. Run away from it.
Wins Above Replacement
Like RBIs and saves, Wins Above Replacement is a semi-junk stat. Bill James has no use for it, yet some writers wield it incessantly. It is a measurement of nothing. It is an approximation, an attempt to roll everything about a player into one number. So it’s useful as a rule of thumb, like walking off the distance between two points and using your strides to “calculate” the distance. It tells you something, but I don’t want my contractor building my house like that. Yet writers are using WAR as an exact measurement, including the folly of using numbers after decimal points to split hairs. If you blindly believe in a stat that considers Bobby Abreu better than Yogi Berra, Lou Whitaker better than Reggie Jackson and Jeff Bagwell better than Joe DiMaggio, you better do some more homework. |
The Room and Power System in the Cotton Weaving Industry of North-east Lancashire and West Craven Abstract The paper discusses the room and power system which before the First World War offered an appropriate form of organisation for cotton weaving in major sections of the British industry. The system was successfully adopted in a range of local circumstances and for a variety of fabric types. Its primary advantage was the reduction of entry barriers by reconciling the very low minimum economic scale of cotton manufacture with the much larger scale required for a weaving shed and related facilities. During the years of decline, the system became less useful, not least because it reinforced the fragmentation of the industry and created obstacles to investment. |
The Philadelphia Phillies signed Cliff Lee to a big free-agent contract before the 2011 season, reasoning that they needed one more ace pitcher in addition to Roy Halladay to keep them going to the postseason.
Lee has not disappointed; Thursday night he threw his major league leading fifth shutout of the season and the Phillies won their seventh in a row, defeating the Giants 3-0.
Lee's season has been streaky; he threw three straight shutouts in June, posting a 0.21 ERA during the month and at one point throwing 34 consecutive scoreless innings. But in July, he struggled, posting a mediocre 4.91 ERA and winning just once.
August appears to have ended those troubles, at least for now; he threw 106 pitches (76 strikes) and allowed the Giants just six singles and a double, walking no one and striking out eight.
Lee joins CC Sabathia, A.J. Burnett and Dontrelle Willis as the only pitchers since 2000 to throw five shutouts in a single year. If he throws one more, he would become the 13th pitcher since 1981 to have six or more in one season; John Tudor of the Cardinals had the most in a single year since 1981, 10 in the St. Louis NL pennant year of 1985.
The Phillies, who hold the best record in baseball at 72-39, will face the Giants again Friday night in San Francisco. Lee's next start should come up next Tuesday in Los Angeles against the Dodgers. |
<reponame>voleking/ICPC
#include<stdio.h>
const int MAXN = 1000;
int n, left[MAXN], right[MAXN];
void link(int X, int Y) {
right[X] = Y; left[Y] = X;
}
int main() {
int m, X, Y;
char type[9];
scanf("%d%d", &n, &m);
for(int i = 1; i <= n; i++) {
left[i] = i-1; right[i] = i+1;
}
for(int i = 0; i < m; i++) {
scanf("%s%d%d", &type, &X, &Y);
link(left[X], right[X]);
if(type[0] == 'A') {
link(left[Y], X);
link(X, Y);
} else {
link(X, right[Y]);
link(Y, X);
}
}
for(int X = right[0]; X != n+1; X = right[X])
printf("%d ", X);
printf("\n");
return 0;
}
|
Ryan Scully
Partick Thistle
Scully joined Partick Thistle in 2008 and began playing for their under-17 squad. Before arriving at Firhill he had received no formal coaching.
Having been with Thistle for a year and a half Scully went on loan to West of Scotland Super League side Petershill for four weeks in 2009 to gain more first team experience.
In May 2010 he was part of the under–19 side who won the SFL Youth Cup. Thistle defeated Livingston 3–2 in the final with Scully making numerous saves. At the conclusion of the 2009–10 season, Scully, along with Ross McGeough and Ryan MacBeth, was promoted to the first team squad. Scully signed a new contract in September 2010 which would keep him with Thistle until May 2013.
During the 2010–11 season he appeared on the bench on several occasions before suffering a setback by dislocating a thumb ruling him out for number of weeks. After his recovery he made his senior début in the final game of the season on 7 May 2011 in a 3–0 victory against Raith Rovers in a Scottish First Division fixture where he kept a clean sheet.
Scully featured in pre-season friendly matches in advance of the 2011–12 season, the final of which was against Dumbarton in a 4–1 defeat.
He made his first appearance of the season on his nineteenth birthday keeping another clean sheet against ten-man Dundee. After Scully's impressive displays his manager Jackie McNamara admitted to having a selection dilemma with first choice keeper Scott Fox fit again following a virus. Ultimately Scully was chosen in goal for the following match against league leaders Ross County, however the match ended in 1–0 defeat for Thistle with Scully conceding his first ever competitive goal. He lost his place in the team for the ensuing match having being ruled out after incurring a concussion in training from a boot to the head. Having remained on the bench for a number of games, Scully returned to the starting line-up with Fox having sustained a hand injury. Thistle defeated Queen of the South 5–0 with Scully earning his third clean sheet in four appearances.
Scully joined Albion Rovers in the 2013 winter transfer window on a sixth month loan. After that loan spell came to an end, Scully, along with David Wilson, signed a one-year contract extension.
At the start of 2013–14 season, Scully was among three players sent out on loan to gain first team experience. He joined relegated side Dunfermline Athletic on a six-month loan deal. Upon joining Dunfermline, he vowed to become the first choice goalkeeper. After establishing himself in the first team, the loan spell with Dunfermline was extended until the end of the season; Scully expressed his "delight" and had no hesitation in extending his loan with the club. After 46 appearances for Dunfermline in all competitions, Scully was awarded the club's Player of the Year award.
After returning from a successful loan spell with Dunfermline, Scully signed a two-year contract extension, keeping him at the club until 2016. In July 2014, he returned to Dunfermline on a season-long loan.
Scully made his Premiership debut for Thistle on 24 October 2019, coming on as a substitute for injured goalkeeper Tomáš Černý in a 1–1 draw with Hamilton Accies.
Thistle were relegated via the playoffs at the end of the 2017–18 season, and following that relegation, Scully was one of many players released by the club.
Greenock Morton
After his release from Thistle, Scully signed for fellow Championship side Greenock Morton. After losing his place in the first team to Derek Gaston, he asked to be released and was given a free transfer by mutual consent in January 2019.
Dunfermline Athletic
Scully become new Dunfermline manager Stevie Crawford's first signing in January 2019, returning to East End Park after three-and-a-half years. He signed on a six-month deal, with the option to extend for a further year. |
<gh_stars>0
package com.initsrc.admin.base.service.impl;
import com.initsrc.admin.base.entity.home.dto.HomeInfoDto;
import com.initsrc.admin.base.entity.home.vo.HomeInfoVo;
import com.initsrc.admin.base.service.HomeService;
import com.initsrc.admin.system.dao.SysLogMapper;
import com.initsrc.admin.system.entity.log.vo.SysLogListVo;
import com.initsrc.common.base.Result;
import com.initsrc.common.enums.LogOperateTypeEnum;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* <p>
* 授权登录-服务实现类
* </p>
*
* @author 启源(INITSRC)
* @since 2021-05-21 15:25:48
*/
@Service
public class HomeServiceImpl implements HomeService {
@Resource
private SysLogMapper sysLogMapper;
@Override
public Result<HomeInfoVo> getHomeInfo(HomeInfoDto dto) {
List<SysLogListVo> loginList = sysLogMapper.getLogByHomeInfo(dto);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Map<String, Integer> map = new LinkedHashMap<>();
List<String> timeList = getBetweenDates(dto.getBeginTime(), dto.getEndTime());
Collections.reverse(timeList);
for (String item : timeList) {
map.put(item, 0);
}
for (SysLogListVo item : loginList) {
String date = formatter.format(item.getCreateTime());
map.put(date, map.get(date) + 1);
}
List<Integer> list = new ArrayList<>();
for (Map.Entry<String, Integer> entry : map.entrySet()) {
list.add(entry.getValue());
}
int loginCount = this.sysLogMapper.getCountByOprType(LogOperateTypeEnum.LOGIN.getOperateCode());
int editCount = this.sysLogMapper.getCountByOprType(LogOperateTypeEnum.EDIT.getOperateCode());
int addCount = this.sysLogMapper.getCountByOprType(LogOperateTypeEnum.ADD.getOperateCode());
int delCount = this.sysLogMapper.getCountByOprType(LogOperateTypeEnum.DEL.getOperateCode());
HomeInfoVo homeInfoVo = new HomeInfoVo();
homeInfoVo.setLoginList(list);
homeInfoVo.setAddCount(addCount);
homeInfoVo.setLoginCount(loginCount);
homeInfoVo.setDelCount(delCount);
homeInfoVo.setEditCount(editCount);
homeInfoVo.setTotalCount(loginCount + editCount + addCount + delCount);
return Result.success(homeInfoVo);
}
public List<String> getBetweenDates(String start, String end) {
List<String> result = new ArrayList<String>();
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date start_date = sdf.parse(start);
Date end_date = sdf.parse(end);
Calendar tempStart = Calendar.getInstance();
tempStart.setTime(start_date);
Calendar tempEnd = Calendar.getInstance();
tempEnd.setTime(end_date);
while (tempStart.before(tempEnd) || tempStart.equals(tempEnd)) {
result.add(sdf.format(tempStart.getTime()));
tempStart.add(Calendar.DAY_OF_YEAR, 1);
}
} catch (ParseException e) {
e.printStackTrace();
}
Collections.reverse(result);
return result;
}
}
|
Modelling of skew using the flux-MMF diagram The flux-MMF diagram has recently been used effectively to predict electromagnetic and cogging torque ripple in different motor types. This paper describes a simple and elegant method, based on this technique, for predicting the effect of skew on torque ripple in permanent magnet motors. While the fact that skewing minimizes torque ripple is well established, the paper clearly brings out the difference in the extent of minimization in the case of electromagnetic as well as cogging torque ripple. Further, it shows that the effect of skew on these two types of torque ripple is quite independent of each other. |
<reponame>vnaveen0/nachos
#ifndef HASH_H
#define HASH_H
#include <cmath>
#include <assert.h>
int hash_func(int tid, int core_id);
int get_tid_frm_hash_value(int hash_value);
int get_core_id_frm_hash_value(int hash_value);
#endif
|
export type {
Adapter,
Middleware,
BuildableRequest,
HttpRequest,
HttpResponse,
BodyDataType,
UploadProgressEvent,
DownloadProgressEvent,
} from "./types.js";
export { adapter, request } from "./instance.js";
export { xhrAdapter } from "./adapter/xhr.js";
export { fetchAdapter } from "./adapter/fetch.js";
export { RequestBuilder } from "./builder.js";
export {
compose,
expectType,
handleErrors,
retryFailed,
xsrf,
} from "./middleware/index.js";
export type {
HandleErrorOptions,
RetryFailedOptions,
XsrfOptions,
} from "./middleware/index.js";
export { EV_DOWNLOAD_PROGRESS, EV_UPLOAD_PROGRESS } from "./events.js";
|
A method for identifying cost-efficient practices in the treatment of thoracic empyema There is a need to identify cost-efficient practices in delivering healthcare. This study illustrates how cost-efficient practices can be identified and disseminated in treating thoracic empyema. Data envelopment analysis was used to identify the scope for reducing length of stay, and therefore costs, at inpatient spell level for thoracic empyema. The potential for length of stay reduction was identified, representing about 50% of the recorded length of stay. Significant differences in potential for length of stay reduction were also found between consultant teams and between sources of patient admission. Data envelopment analysis enables multiple conditioning factors affecting costs at inpatient spell level to be taken into account simultaneously. It enables management to identify and disseminate best practice within its own hospital. The approach can be transferred to other inpatient settings beyond thoracic empyema. |
Intraventricular interferon-alpha stops seizures in Rasmussen's encephalitis: a case report. A 3.5-year-old girl had epilepsia partialis continua of the right side. Clinical and laboratory findings were consistent with Rasmussen's encephalitis. Treatment with high-dose methylprednisolone led to temporary control of seizures, but for 2 years, the seizures remained refractory to phenobarbital, phenytoin, lorazepam, carbamazepine, valproic acid, vigabatrin, gabapentin, and lamotrigine. A 6-week course, and later a 6-month course, of intraventricular interferon-alpha almost totally suppressed the seizures. Although moderately hemiparetic, the child has reasonable neurologic function with mild speech delay. She is receiving her third course of treatment, and seizures remain completely controlled. |
/**
* Export feature container.
*
* @param generationPathApp the generation path app
* @param feature the feature
* @param container the container
*/
public void exportFeatureContainer(
Path generationPathApp, Feature feature, AbstractContainer container) {
Path contextFeaturePath =
Paths.get(
TextConverter.toLowerHyphen(feature.getContextName().getText()),
TextConverter.toLowerHyphen(feature.getFeatureName().getText()));
uiContainerHtmlExporter.exportHtml(
generationPathApp, contextFeaturePath, container, UiContainerFolderType.PAGE);
uiContainerScssExporter.exportScss(
generationPathApp, contextFeaturePath, container, UiContainerFolderType.PAGE);
uiContainerTypescriptExporter.exportTypescript(
generationPathApp, contextFeaturePath, container, UiContainerFolderType.PAGE);
uiContainerTypescriptSpecExporter.exportTypescriptSpec(
generationPathApp, contextFeaturePath, container, UiContainerFolderType.PAGE);
} |
Heuristic Algorithm Strategies to Solve Travelling salesman Problem The term heuristic is used for algorithms which find solutions among all possible ones, but they do not guarantee that the best will be found, therefore they may be considered as approximately and not accurate algorithms. These algorithms, usually find a solution close to the best one and they find it fast and easily. Sometimes these algorithms can be accurate, that is they actually find the best solution, but the algorithm is still called heuristic until this best solution is proven to be the best. The method used from a heuristic algorithm is one of the known methods, such as greediness, but in order to be easy and fast the algorithm ignores or even suppresses some of the problem's demands. |
/**
* Check for comments, trim white space. Return null if nothing left after that.
* Otherwise split on tabs and return the array.
* @param line to be split.
* @return the split line or null if a problem.
*/
static String[] splitLine(final String line) {
final int ix0 = line.indexOf('#');
final int ix = ix0 == -1 ? line.length() : ix0;
final String lessComment = line.substring(0, ix);
if (lessComment.matches("^\\s*$")) {
return null;
}
return lessComment.split("\\s+");
} |
Modern Approaches to Testing Drug Sensitivity of Patients Tumors (Review) Drug therapy is still one of the basic techniques used to treat cancers of different etiology. However, tumor resistance to drugs is a pressing problem limiting drug treatment efficacy. It is obvious for both modern fundamental and clinical oncology that there is the need for an individual approach to treating cancer taking into account the biological properties of a tumor when prescribing chemo- and targeted therapy. One of the promising strategies is to increase the antitumor therapy efficacy by developing predictive tests, which enable to evaluate the sensitivity of a particular tumor to a specific drug or a drug combination before the treatment initiation and, thus, make individual therapy selection possible. The present review considers the main approaches to drug sensitivity assessment of patients tumors: molecular genetic profiling of tumor cells, and direct efficiency testing of the drugs on tumor cells isolated from surgical or biopsy material. There were analyzed the key directions in research and clinical studies such as: the search for predictive molecular markers, the development of methods to maintain tumor cells or tissue sections viable, i.e. in a condition maximum close to their physiological state, the development of high throughput systems to assess therapy efficiency. Special attention was given to a patient-centered approach to drug therapy in colorectal cancer. Introduction Substantial advance in science in comprehending carcinogenesis mechanisms has resulted in an established opinion among oncologists that cancer therapy should be individualized. Due to the effect of numerous factors providing intra-and inter-tumor heterogeneity and high adaptive capacity of cancer cells, there are different responses of tumor cells of the same type and stage to a similar drug therapy in different patients. As a final result, it leads to insufficient therapy efficacy, side effects development, and unreasonable expenses. The first attempts to assess the tumor cells sensitivity of a certain patient to drugs in order to choose the most effective drug therapy were as early as in 1970-80-s. However, they were not introduced into clinical practice due to a number of problems. In particular, long-term culture of patients' tumor cells as cell cultures was noted to change their condition. Secondly, the cultured cancer cells can respond to chemotherapeutic drugs differently than those in a patient body. And, moreover, the post-treatment analysis of cell condition required the involvement of highly-qualified pathologists. In the past decade the problem of patient-centered drug therapy got a new lease of life. Due to the reviews technological development in molecular and cellular biology, as well as the broadening of methods range used to study structural and functional state of cells and tissues, there is the feasibility to comprehensively and relatively quickly investigate postoperative and biopsy material in vitro. Some research groups are developing the techniques for cancer cell isolation from solid tumors, maintenance of cell and tissue samples, and suggesting cultural 3D systems to establish the conditions maximum close to physiological conditions, and modeling the relationship of tumor cells and their natural microenvironment. Other research groups are concentrating their efforts on maximum informative ways to assess a therapeutic response of tumor cells. Others are searching for molecular markers for expected therapy efficiency. However, each specific tumor site requires a peculiar unique protocol, and it is due to very different biological properties of cells of different histogenesis. According to cancer morbidity structure, colorectal cancer is one of the most common worldwide, it ranks third in men and second -in women. In Russia, colorectal cancer accounts for over 11% of all cancers. Conventional chemotherapy is considered the basic technique in medical oncology of colorectal cancer. Targeted therapy in colorectal cancer is used only if there are metastases and there are no certain mutations. However, the choice of target agents for colorectal cancer therapy is limited, and their efficiency is compelling. Despite the availability of operative material, drug sensitivity of colorectal tumors is under-investigated so far. The present review is devoted to the analysis of a worldwide trend in developing the techniques to test the drug sensitivity of patients' tumors. The study systemizes the general data on medical oncology, describes the current approaches to the assessment of tumor sensitivity to chemo-and targeted therapy, as well as the basic evaluation techniques of tumor cell responses to therapeutic treatment. Special attention was paid to the implementation of a patient-centered approach in colorectal cancer therapy. Medical oncology and grounding for the necessity for treatment individualization Currently, the main cancer treatment techniques are surgery, radiotherapy, and drug therapy including hormone-, chemo-, and targeted therapy. The drug therapy selection is based on classical clinical diagnostic criteria such as: a tumor size, a histological analysis, as well as the presence or absence of standard markers in case of targeted therapy. Chemotherapy is a standard technique to treat tumors of various localizations, and based on chemotherapeutic agents administered to a patient. So far, there are several different groups of antitumor agents with different mechanisms of action: 1) alkylating antineoplastic agents -are aimed at damaging DNA molecules; 2) metabolic antagonists -inhibit a number of important biochemical processes necessary for proliferative cell function, and they result in apoptosis activation; 3) anthracycline antibiotics -inhibit DNA molecule synthesis and affect cell membrane permeability; 4) topoisomerase inhibitors -selectively damage MNA molecule structure and tumor-cell division at different mitosis stages; 5) mitotic inhibitors -inhibit mitosis and cell division. In clinical protocols of chemotherapy, antitumor agents are used either in a combination with each other or as a mono-agent pre-and postoperatively. Therapy regimen selection depends on a tumor site, the cancer stage, and other characteristics of clinical presentation. According to the recommendations, adjuvant colorectal cancer therapy includes the administration of the following agents: oxaliplatin and 5-fluorouracil (regimens: FOLFOX, FLOX) or capecitabine (XELOX regimen). Drug therapy of metastatic colorectal cancer in case of resectable metastases the same agents and regimens are recommended, as well as mono-therapy by fluoropyrimidines; in irresectable metastases -Irinotecan (FOLFOXIRI regimen) is added to oxaliplatin and 5-fluorouracil. The advent of targeted therapy has significantly changed an approach to cancer treatment enabling to administer agents relying on tumor characteristics of a particular patient, and showing the possibility of patient-centered approach. Currently, nine prognostic markers have been introduced into clinical practice, which enable to determine the sensitivity to specific treatment and administer target agents. The main types of target agents are small molecules -inhibitors of tyrosine kinase and serine/threonine kinases and monoclonal antibodies to HER2/Neu receptors, epidermal growth factor receptor (EGFR) and vascular endothelial growth factor (VEGF). In colorectal cancer therapy, appropriate target agents are administered relying on mutation analysis. According to medical oncology of rectal carcinoma, colon cancer, and recto-sigmoid junction, tumor molecular profile should be taken into consideration when administering targeted therapy and choosing a target agent. In case of the lack of mutations in KRAS and BRAF genes, anti-EGFR-agents: Cetuximab or Panitumumab -are indicated. However, targeted therapy is not a basic technique in colorectal cancer, and administered in metastatic cancer only. Despite an increased understanding of malignant cell transformation, the efficiency of most cancers is still low. One of the causes of drug therapy failure is tumor heterogeneity: a complex of characteristics presenting inter-and/or intra-tumor differences. A tumor is a complex system, heterogeneous by its cellular reviews space, a molecular profile, architecture, and spacious organization. Phenotypic, genetic, epigenetic, and other characteristics are congenial for some cells and cell populations forming an extremely complicated and heterogeneous structure. Tumor heterogeneity is a necessary condition for cancer progressing, tumor cells surviving in unfavorable conditions, including the effect of anti-tumor agents and drug resistance development. Multidrug resistance is a well known phenomenon depending on a number of nonspecific factors including high tumor plasticity and heterogeneity, and secondary genetic damages tumor cells acquire, tumor microenvironment. Drug resistance can be inherited (it is also called pre-existing or initial) and acquainted (or adaptive) arising under therapy pressure. Not infrequently, chemotherapeutic agents, which are effective for a primary tumor site, appear to fail in metastases or in recurrent tumors. The intensity of universal resistance mechanisms should be revealed before treatment, if possible. Both: classical cytotoxic chemotherapy and targeted chemotherapy are accompanied by a number of side effects. Marked side effects require drug correction. They decrease life quality and sometimes can result in therapy cessation. All the above-mentioned reasons have led to a new insight into cancer therapy, and indicate clearly the necessity for patient-centered medicine consisting in an elaborate study of patient tumor material and the selection of drugs with maximum efficiency for a particular tumor. Molecular genetic analysis to implement an individual approach Molecular factors, in particular, the presence of mutations in KRAS, NRAS, and BRAF genes associated with certain histological tumor type can be a significant prognostic criterion and determine initial or acquired sensitivity of tumor cells to some forms of treatment including radiotherapy, many types of cytostatics, some target agents, gene therapy, and certain techniques of immune therapy. These genes are key protooncogenes activated in most malignancies including colon cancer. They encode RAS proteins, which are the first members of a cascade of kinases leading to the activation of signal paths and gene transcription regulating cell differentiation and proliferation. The database of the Catalogue of Somatic Mutations in Cancer (https://cancer.sanger.ac.uk/cosmic) shows that about 34% of colon tumor samples analyzed have KRAS mutations, 10% -BRAF, and 4% -NRAS. Molecular genetic analysis of mutation status of RAScascade of KRAS, NRAS, and BRAF genes are of great prognostic and predictive importance in colorectal cancer therapy. Main mutations in RAS genes in colon tumors concentrate in exon 2, codons 12 and 13. However, there can be mutations in exon 3, codon 61, as well as in exon 4, codons 117 and 146. Mutation status of codons 12 and 13 of KRAS gene is the most familiar biomarker in targeted anti-EGFR-therapy of patients with metastatic colorectal cancer. KRAS activation due to mutation has been proved to nullify the effect of EGFR inhibition by monoclonal antibodies. Thus, the presence of mutant alleles of KRAS gene is an independent predictive marker of the efficiency of EGFR inhibitors therapy. Mutations affecting codon 61 damage hydrogen bonds between RAS and protein-inactivators result in the same effect that there is in codon 12 and codon 13 damages. Codon 146 mutations are not accompanied by significant changes of the protein activity. However, these mutations have a negative effect resulted from the accumulation of a defective protein against the background of allelic imbalance -increased abundance of a mutant gene or its transition in homozygous state. A number of clinical trials showed that patients with a wild type of KRAS and NRAS genes in a tumor would get the most out of antibody therapy combined with standard chemotherapy compared to patients without KRAS gene mutation in exon 2. BRAF gene encodes intracellular protein, which is a component of RAS-MAPK and RAS-MEK-ERK signal cascades regulating cell proliferation in response to external mitogenic stimuli. The most frequent activating mutation of BRAF gene is single nucleotide substitution, which affects codon 600 of exon 15 -V600E in 95% cases. There are conflicting data on a predictive role of BRAF V600E mutation in regard to a tumor response to anti-EGFR-therapy, and prognostic significance of disease progression ; however, patients with BRAF gene mutation in a tumor are known to be a separate group with an unfavorable clinical course. In addition, a prognosis for patients with metastases and a mutation in BRAF gene is extremely unfavorable due to aggressive tumor growth. However, determining BRAF gene status along with KRAS will enable to correctly select patients for therapy by anti-EGFR-monoclonal antibodies. Combined use of inhibitors of EGFR, BRAF, MEK genes shows promising results, and the introduction of one more biomarker along with KRAS and NRAS genes will enable to enhance a patient-centered approach in colon cancer therapy. Colon cancer carcinogenesis is characterized by mutation accumulated in genes controlling the growth and differentiation of epithelial cells resulting in their genetic instability. One of such genetic alterations is microsatellite instability, which is characterized by an impaired repair mechanism of unpaired DNA bases. It leads to the fact that mutations in a cell genome are accumulating at higher speed than normal. Microsatellite instability occurs in 15% sporadic colon tumors, and in all cases of Lynch syndrome. Impairments in DNA system repair result in insertions and/or deletions of nucleotide repeats in DNA. It is possible to reveal failed repairability of unpaired DNA bases by DNA microsatellite length reviews. There has been found the relation between BRAF gene mutation and the repair system state of unpaired DNA bases. In microsatellite instability, BRAF gene mutation frequency reaches 50%, while in microsatellite stable tumors -the gene mutations occur rarely. In addition, only in the latter case mutations in BRAF gene are associated with low survival rate at early stages of the disease. The marker is more used for disease prognosis rather than a ground for choosing some therapy. It should be noted that in case of targeted therapy, a preliminary analysis enables to determine a target but not take into account the tumor sensitivity or resistance degree. For example, even patients with no mutations in KRAS and NRAS genes were found to have a therapeutic response to anti-EGFR-agents only in 20-30% cases, and when combined with chemotherapy -65-70%. For tumor response prognosis to usual chemotherapeutical agents, there is also used an approach based on the cell genome and proteome analysis. In particular, some markers are known to be used to prognosticate the efficiency of agents widely applied in colorectal cancer: 5-fluorouracil, Irinotecan, and Oxaliplatin. Tolerance and efficiency of fluoropyrimidines largely depend on their systemic and intra-tumor metabolism. A key enzyme of 5-fluorouracil breakdown is dihydropyrimidine dehydrogenase (DPD). Some individuals have a hereditary defect, due to which both (paternal and maternal) DPD gene replicas fail to produce a normal protein. Such people accounting for about 0.1% population are characterized by marked intolerance to fluoropyrimidines: even the first administration of a standard dose of 5-fluorouracil can result in fatality. Detection of people with systemic DPD inactivation requires a complete sequencing of a corresponding gene. Another parameter influencing the outcome of the treatment by 5-fluorouracil and its derivatives is intra-tumor DPD activity. If systemic DPD deficiency determined by inherited mutation in the gene is of serious hazard, then low DPD activity in tumor tissue itself contributes to the agent accumulation within the mass lesion. Many tumors have reduced DPD expression compared to normal tissues -it is the peculiarity of carcinomas that creates a certain therapeutic window for fluoropyrimidines. Numerous studies have shown colorectal cancer with low DPD to demonstrate a more prominent response to 5-fluorouracil therapy. Another molecular factor associated with colorectal cancer sensitivity to 5-fluorouracil is thymidylate synthase (TS). The enzyme is considered the main target of 5-fluorouracil. High intra-tumor TS expression is frequently associated with tumor resistance to fluoropyrimidines. It can be explained by the fact that a therapeutic concentration of 5-fluorouracil appears to be insufficient to bind an excess amount of TS molecules. Thymidine phosphorylase (TP) is a key enzyme of synthesis and degradation of pyrimidine nucleotides. Anti-apoptotic and angiogenic effects of TP are involved in colorectal cancer growth and metastasing. Moreover, TP is a key enzyme to activate prodrugs of 5-deoxy-5fluorouridine into 5-fluorouracil. TP hyper-expression is related to a bad prognosis due to an increased infiltrating capacity, more active growth, and metastases. However, TP expression is necessary to provide a curative effect of 5-fluorouracil. Thus, regardless of the fact that TP is a marker of an unfavorable course of the disease and tumor angiogenic potential, it also serves as a marker for anti-angiogenic agents, and is a 5-fluorouracil activator. Generally, over the last years, the development of this sphere of clinical oncology has somewhat ceased. Firstly, 5-fluorouracil and its derivatives have been used rarely as a monotherapy, and correspondingly, when analyzing a tumor response to a combination of drugs it is cumbersome to reveal which component of a treatment schedule has contributed to treatment success. Secondly, most researchers prefer to use the easiest and readily available technique to determine the expression of DPD, TS, and other moleculesimmunohistochemistry, which is notable for poor intermediate precision due to the variety of antibodies used, and subjectivity when assessing staining intensity. Irinotecan -topoisomerase I inhibitor -at the time made a considerable contribution to effective colorectal cancer therapy; however, it showed significant population variability in regard to the therapy tolerance. Sub-studies revealed that one of the main parameters determining the intensity of side effects in Irinotecan administration is UGT1A1 gene polymorphism. The gene is characterized by population diversity concerning the number of dinucleotide repeats of thymidine adenine in promoter (regulatory) gene region. The overwhelming majority of researchers agree that the presence of UGT1A1 gene allelic variants are associated with high toxicity of Irinotecan. There are few research works dealing with studying sensitivity determinants of colon cancer to Irinotecan rather than the analysis of Irinotecan tolerance. In particular, a large variety of preclinical studies and clinical trials indicate that the response probability to Irinotecan can be associated with intra-tumor expression of its target -topoisomerase I. Unfortunately, few studies and dissimilarity of the techniques used to determine topoisomerase I status prevent from making final conclusions on the issue. Oxaliplatin by its efficiency is comparable with Irinotecan, and in most cases it can be its alternative in therapy planning. In Russia, Oxaliplatin is used on a somewhat more frequent basis than Irinotecan -such choice of patients and doctors is related to a lower risk of alopecia and severe diarrhea. However, the choice between Oxaliplatin and Irinotecan is a spectacular example of clinical settings when an analysis of a reviews predictive marker could be a decisive component in determining the disease management. A considerable number of articles are concerned with ERCC1 (DNA repair enzyme) expression status application prospects. Low ERCC1 is considered to be associated with higher probability of a response to therapy, since the enzyme can participate in repairing DNA-adducts formed as a result of platinum-containing agents. Nevertheless, the researchers in this field face the same difficulties as those studying the use of fluoropyrimidines. A Main approaches to testing drugs on patients' tumor cells One of the first approaches to individual therapy selection was that one based on the treatment results of laboratory animals with patient-derived xenografts (PDX). The technology was first described as early as in 1969. Its backbone is in the following: small tumor fragments derived from patients intra-operatively are transplanted to immunodeficient mice. Tumors grown in such mice are then re-engrafted to similar immunodeficient mice-recipients, which are treated by a certain chemotherapeutic agent. A therapeutic response is assessed by a standard technique -by tumor growth inhibition. It is important that PDX models, as a rule, preserve molecular characteristics, cellular and pathomorphological structure of initial patient tumors. Moreover, a cytogenetic analysis of tumor cells isolated from PDX shows substantial similarity of a genetic profile and genes expression profile in PDX and initial patient tumors. PDX models were taken for different solid tumor types. PDX drug response was proved to correlate well with a clinical response in patients. The assessment of approximately 300 cases for 13 tumor types showed a good correlation between a patient's response and PDX therapeutic response -from 70 to 100%. Although PDX models have distinct advantages, there are some limitations, which prevent from using them widely in personalizied medicine. For example, for tumor xenograft survival, a very long period of time is required, about 4-8 months, and some extra time to create daughter tumor xenografts in order to test therapeutic regimens on mice. In addition, PDX grafting frequency in mice for most cancer types usually does not exceed 50%, and for breast cancer, prostate cancer, and renal cell carcinoma the percentage is significantly lower. Highly immunodeficient mice themselves are expensive and require specific clean housing conditions, and highly qualified staff. So, despite relative success of the technique, it is one of the most costly, labor-consuming, and has a long runtime that makes it unacceptable to be used in practice. The specified situation determines an urgent need in rapid and safe alternative methods to assess patients' tumor sensitivity to drugs. In this problem, great attention is given to the development of techniques used to determine the chemosensitivity of tumor cells on in vitro material isolated from tumors. Early passage lines taken from patient's tumor are known to present better tumor properties than commercial cell lines, and therefore, they can predict accurately the chemosensitivity of a particular tumor. To derive cancer cell cultures from a tumor is an intricate problem due to frequent contamination of primary material, and more rapid growth of stromal cells compared to tumor ones. Currently, the success in cancer cells isolation from most solid tumors is achieved only in 10-40% cases. Two main ways of taking temporary tumor cultures are the direct cancer cells isolation from tumor tissues (tissue organoids or cell suspension) and a xenograft technique, when an animal organism is a primary recipient of tumor cells. The major shortfall of the latter is an undesirable selection of tumor cells in an animal body, while the information on chemosensitivity for such cells can be much different from initial population. In this regard, the most adequate assessment method for primary chemosensitivity is the direct cancer cells isolation from tumor cells. According to a direct cancer cells isolation technique, culture material is taken observing aseptic conditions by dissecting appropriate tumor fragments paying attention to the viability of cell elements. Culture tissue should have no necrotic areas, be sterile and abundant in the cells which are to be cultured. Tissue fragments are cut into small pieces, 1-3 mm in diameter in size, and put in a culture medium. One of the variants is to derive, wherever possible, homogeneous cellular suspensions from tumor tissue samples. Recently, one or several enzymes (trypsin, liberase, collagenase) are used to derive cellular suspensions, it depends on reviews a tissue type. Cellular suspension portions collected are washed to free from enzymes, and centrifuged in ficoll gradient to free from associated cell fractions. The cells purified in this way are resuspended in a culture medium and transferred into appropriate dishes in accurately measured amounts. The technique enables to derive living cell masses free from stroma. Then, obtained tumor cells are cultured in culture flasks using a standard procedure (37, 5% 2, moist atmosphere). To analyze certain characteristics, tumor cells are disseminated in culture dishes or plates. Intercellular substance is also relevant in tumor growth and its chemotherapeutic resistance. Primarily, it is collagen, as well as laminin and fibronectin. For instance, it has been shown that cell survival rate when exposed to such agents as Cisplatin, 5-fluorouracil, and Epirubicin, and when performing researches on decellularized tumor stroma is 20-60% higher than on plastics. Therefore, extracellular matrix, e.g., collagen, is introduced in test-systems to determine chemosensitivity of tumor cells. Since the 1990-s, there has been developed a new in vitro chemosensitivity test using collagen gel droplet embedded culture. The method complements a 3D tumor model using collagen as an intercellular substance. When applying a collagen gel droplet embedded culture technique, one can assess an increase/decrease of tumor spheroid size in reference to control when exposed to chemotherapeutic agents by a series of luminal images taken by a microscope. Currently, the technique is undergoing validation, including that for colorectal cancer. It is commonly known that a tumor has complex heterogeneous structure, and consists of different-type cells, which intercommunicate and interact with tumor microenvironment. Stromal cells are active participants of carcinogenesis, and contribute to the formation and manifestation of tumor distinguishing features, as well as take part in chemotherapy resistance developed in tumor cells. Therefore, an important task for personified screening is drug sensitivity analysis not only on cell cultures, but also on more complex 3D models in vitro containing cells of different types. As 3D cultures the following ones are considered: 1. Tumor organoids, which are 3D tumor cell cultures; patient-derived tumor cells being cultured as spheroids. Organoids present cell-to-cell cooperation, as well as the interaction of cells and extracellular matrix. High productive drug testing (screening) methods based on organoids are suggested, they would predict a patient tumor response to therapy. 2. Tumor tissues disintegrated by micro-dissection and maintained in cultural conditions. In this case, tissue preparation includes bioptate mechanic fragmentation, which, however, can cause local tissue damage, though preserving an immunological profile. 3. Organotypic slices of tumor tissue kept in cultural conditions. Slices are sections or of tumor tissue samples, 300-500 m thick, from the primary tumor and placed into a culture medium. Cultured slices present well tumor micro-environment; the method used to derive them is rather easy and not time-consuming, and can be applied in most solid tumors. When cultured up to 7 days, slices have been found to preserve tumor morphological properties. For breast cancer and pancreatic carcinoma there has been demonstrated the correlation of treatment results and drug testing on patient tumor slices. Recently, there has been achieved success in studying a drug effect on tumor slices derived from patient tumor xenografts grown on laboratory animals. The analysis of 3D in vitro tumor models shows that their major problem is short-term maintenance in culture due to diffuse nutritional type, no vascularization, no circulation of substances; there are necroses and hypoxia in central 3D structure. Moreover, currently, there are no standardized systems with optimally matched culture conditions, using which it could be possible to perform high producing screening of antitumor drugs on a large scale. Microfluid systems exhibit high potential in solving such problems, since they enable 3D tissue models gain efficiency. Microfluid systems, or chips, are devices to culture cells and tissues, and consist of optically transparent plastic, glass, and flexible polymers, e.g., polydimethylsiloxane (PDMS), with hollow chambers connected with a canal and pump system for perfusion, control and maintaining specified micro-environment conditions. The systems got their name 'chips' due to a manufacturing technology, which was initially used to manufacture computer microchips. Microfluid systems can be used to culture a cell monolayer, spheroids, organoids, or ex vivo tissue slices, bothseparately and in combination. More complex chips combine several cell and tissue types, which can be connected directly through a porous membrane covered by extracellular matrix components. Cell and tissue viability can be maintained within a long period of time (from weeks till months) due to checking micro-environment parameters and perfusion fluid flows (temperature, pH, nutrients and growth factors, mechanical signals resulting from pressure and fluid flows). Moreover, there has been demonstrated the possibility to line canals by human endothelial cells and substitute a cultural medium by whole blood in order to study endothelial activation, adhesion of platelets, formation of a fibrin clot in response to monoclonal antibody against CD40L designed to treat autoimmune disorders. Currently, microfluid systems are being regularly used by pharmaceutical companies and some research groups worldwide as a tool to develop antitumor drugs, study invasion and metastasis processes. Hassell et al. developed an in vitro human nonsmall-cell lung cancer model in a microfluid chip, which simulated tumor growth in the micro-environment typical for the lung, and demonstrated a response to protein reviews kinase inhibitor therapy. Earlier a response was observed only in in vivo studies. A chip had two additional side cameras to imitate physiologic respiratory movements due to cyclic resorption. The resorption rhythmically deformed flexible side walls and a horizontal membrane with tumor and epithelial cells. Using the functions of mechanical activation of the system revealed previously unknown resistance of lung cancer cells carrying two mutations EGFR (L858R and T790M) to tyrosine kinase inhibitors of the first and third generations -Erlotinib and Rociletinib. When culturing in standard static conditions, the culture exhibited high sensitivity to Rociletinib in sufficiently small concentrations (IC 50 semi-inhibitory concentration is 1 nanomolar) and low sensitivity to Erlotinib (IC 50 -100 nanomolar). In mechanical movements imitating respiratory function the same culture was resistant to both drugs. The authors concluded that such resistance related to respiratory movements was likely to be mediated by the changes in signal transmission through EGFR receptor and MET protein kinase. The findings give a potential explanation of high therapy resistance of patients with minimal residual disease in the lungs, which remain functionally aerated and mobile. Choi et al. in their work reconstructed 3D structural organization and microenvironment of breast cancer. The authors cultured breast cancer spheroids and epithelial cells of lactiferous ducts and fibroblasts in gel, which imitated epithelial and stromal compartments. On spheroid periphery there were mixed populations of actively proliferating tumor and normal epithelial cells, however, their growth was limited by epithelial compartment, not resulting in tumor cell invasion in the underlying stroma with fibroblasts. Affected by Paclitaxel, spheroid diameter remained unchanged or slightly reduced. Such system makes an opportunity for modeling and studying structural and functional association of tumor cells with other cell types in the lactiferous duct and stromal compartment, which play a crucial role in breast cancer progressing and metastasing. There are more complex models on chips containing ex vivo tissue samples. Shim et al. modeled the relations between a tumor and a lymph node to test if a model of two organs on a chip would be able to reconstruct key features of tumor-induced immunosuppression. Murine lymph node slices were cultured together with tumor and healthy slices on a chip with recirculating media, and then their capability to respond to T cell stimulation was studied. In a model 'lymph node-tumor' lymph node slices appeared to be more immunosuppressed than those in a model 'lymph node-healthy tissue' prompting suggestions that it is possible to model successfully some features of tumor and immunity interaction using microfluid systems. Cell viability in cell culture when exposed to drugs is assessed by basic standard techniques. Among these are MTT assay -a colorimetric test based on reduction of tetrazolium dye to insoluble formazan with purple staining, and a luminescent assay, which enables to assess ATP amount by luciferin-luciferase reaction behavior. These approaches require a great amount of cell material that is not always possible when working with patient-derived samples. A novel promising method to assess an early response of tumor cells to drugs has been considered recently: a metabolism analysis using fluorescent time-resolved microscopy of endogenous metabolic cofactors In US there are two commercial systems to determine the drug sensitivity of tumor cells: MiCK (DiaTech Oncology) based on apoptosis detection in cells when exposed to drugs in vitro, and ChemoFx (Precision Therapeutics) focused on determining the number of living cells using a nuclear stain DAPI at an endpoint. Clinical findings involving these test-systems are few so far, and insufficient to be recommended for usage. A drug sensitivity analysis of tumor cells isolated from patient's tumor based on several assessment criteria obtained by independent methods using one and the same sample is a promising approach to solve a problem of individualization and chemotherapy efficiency improvement. But generally, the most complicated problem in estimating a cell response to a testing drug is still to isolate from a patient's tumor the necessary amount of cells that are analyzable, and to maintain their viability within a certain period of time needed to provide treatment and develop a response to therapy. Conclusion The review of current studies showed an urgent need in developing individualization methods of drug therapy and their introduction into clinical practice. It is obvious that such methods should predict a clinical response stiffly accurately and be realized at the least cost and within a reasonable period of time. Two holistic approaches can be distinguished in the individual selection of medical oncology: 1) efficiency prognosis of chemotherapeutic agents and target agents based on a molecular and genetic tumor analysis; 2) direct testing of tumor drug sensitivity when tumor cells are exposed to an agent; tumor cells being isolated from a tumor and maintained viable under laboratory conditions (see the Figure). The first approach has already proved itself when selecting agents and their combinations, the most effective regarding a particular patient tumor considering its molecular and genetic peculiarities. Moreover, known molecular mechanisms participating reviews in tumor carcinogenesis and progressing can also be a therapeutic target for targeted therapy. The search for molecular markers reliably correlating with a therapeutic tumor response is under way now. A promising approach to a personalized therapy is the selection of drugs on the material isolated from a tumor based on the direct assessment of a therapy effect on tumor cells. The efforts of researchers worldwide are aimed at the optimization of techniques dealing with postoperative or biopsy tumor material in order to maintain the tissue or the cells isolated from it viable as long as possible, and at the same timemaximally close model and maintain the conditions of tumor microenvironment, phenotypic and genotypic characteristics of the cells under study. Isolated tumor cells or slices maintained in cultural conditions are found the most relevant subjects for such researches. A crucial task in the sphere of tumor drug sensitivity testing is also the search for cell response criteria. Numerous findings suggest high tumor heterogeneity by different parameters -from genetic to morphological ones that presumably determines a heterogeneous response of patients' tumors to the same therapy. Conventional methods used to assess cell viability, e.g., MTT assay or specific staining to determine cell death or proliferation -fail to represent heterogeneity at a cellular level. A metabolic imaging technique with fluorescent time-resolved microscopy of endogenous fluorophores is considered to be a novel method to assess a heterogeneous response to therapy. In conclusion, drug sensitivity can be most completely determined by a combined use of a molecular and genetic analysis and the direct assessment of a response of patient-derived cells on drugs included in a treatment protocol. It will enable to improve drug therapy efficiency and reduce the risk of side effects due to Principal approaches to testing drug sensitivity of patients' tumors administering to a patient the agents, which are high-active to the tumor. Study funding. The study was carried out within a framework of state task of performing an experimental development of Privolzhsky Research Medical University "Development of a test-system for determining individual drug sensitivity of patient tumors". Conflicts of interest. There are no conflicts of interest related to the present study. |
Cultural construction in gender studies in Brazil This article has the objective of discussing Gender Studies and its cultural construction in Brazil, alongside Heritage Studies. We have chosen to bring to the fore the women artisans of Jequitinhonha Valley because this case study brings essential elements about the construction of female and male local identities in a fluid point of view connected with social, cultural, historical heritage, space and craft issues. The ceramist women of the region let us notice the elastic element in identities that are not marked at all. The exchange of social and gender roles is constant, regardless of the much crystalized "community pater familias that consolidates sex as a determinant of well-marked and sectorized functions. In the case of artisan ceramist women of Jequitinhonha region, there are breakings of paradigms, boundaries, asymmetrical barriers, function, craft, and gender construction, oscillating between the paternalist traditionalism of fixed functions and the fluid and dynamic social system of the daily economic demands. |
Isolation and characterization of human papillomavirus type 6-specific T cells infiltrating genital warts The potential role of T cells in the control of human papillomavirus type 6 (HPV-6) infections is an appealing premise, but their actual role has been sparsely investigated. Since HPV-6 infections are confined to the epithelium, such an investigation should focus on the T cells present at the site of infection (i.e., the warts). Therefore, we isolated wart-infiltrating lymphocytes (WIL) from patients with clinically diagnosed anogenital warts. These WIL were characterized by their phenotype and their specificity for E7 and L1 proteins of HPV-6. The phenotype of WIL varied drastically from patient to patient, as determined by their expression of CD4, CD8, T-cell receptor alpha/beta chain (TCR alpha beta), and TCR gamma delta. Despite this heterogeneity in phenotype, HPV-6 E7 and/or L1-specific WIL, as determined by lymphoproliferation, could be isolated from more than 75% of the patients studied. Among all L1 peptides recognized by WIL, peptides 311-330 and 411-430 were the most consistently detected, with seven of nine patients for whom L1 peptide reactivity was observed responding to at least one of them. Moreover, the HPV-6 epitopic peptides recognized by WIL differed to some extent from those recognized by peripheral T cells. |
A New Dataset and Transformer for Stereoscopic Video Super-Resolution Stereo video super-resolution (SVSR) aims to enhance the spatial resolution of the low-resolution video by reconstructing the high-resolution video. The key challenges in SVSR are preserving the stereo-consistency and temporal-consistency, without which viewers may experience 3D fatigue. There are several notable works on stereoscopic image super-resolution, but there is little research on stereo video super-resolution. In this paper, we propose a novel Transformer-based model for SVSR, namely Trans-SVSR. Trans-SVSR comprises two key novel components: a spatio-temporal convolutional self-attention layer and an optical flow-based feed-forward layer that discovers the correlation across different video frames and aligns the features. The parallax attention mechanism (PAM) that uses the cross-view information to consider the significant disparities is used to fuse the stereo views. Due to the lack of a benchmark dataset suitable for the SVSR task, we collected a new stereoscopic video dataset, SVSR-Set, containing 71 full high-definition (HD) stereo videos captured using a professional stereo camera. Extensive experiments on the collected dataset, along with two other datasets, demonstrate that the Trans-SVSR can achieve competitive performance compared to the state-of-the-art methods. Project code and additional results are available at https://github.com/H-deep/Trans-SVSR/ Introduction With augmented reality (AR) and virtual reality (VR) devices, dual-lens smartphones, and autonomous robots becoming widely accepted technologies worldwide, there is an increasing demand for various stereoscopic image/video processing techniques, including stereo editing, stereo inpainting, and stereo super-resolution. Stereo superresolution is a fundamental low-level vision task that aims to enhance low-resolution (LR) stereo image/video spatial resolution by reconstructing it to the high-resolution (HR). A key challenge in stereo super-resolution is to preserve the stereo-consistency that may cause 3D fatigue to the viewers. While there are several prominent research on stereoscopic image super-resolution (Stereo ISR), minor attention has been given to stereo video super-resolution (SVSR). Compared to its image counterpart, SVSR presents an additional challenge of preserving temporal consistency. Therefore, the naive adoption of Stereo ISR to SVSR cannot achieve satisfactory performance. Recently, utilization of deep learning, especially convolutional neural network (CNN) based methods, have shown great success for improving the Stereo ISR performance. They addressed the varying parallax, information incorporation, and occlusions and boundaries issues that exist in Stereo ISR. For example, Wang et al. proposed the parallax attention module (PAM) that tackled the varying parallax problem in the parallax attention stereo SR network (PASSRnet). Ying et al. used several stereo attention modules (SAMs) with pre-trained single image SR networks and addressed the information incorporation issue. Song et al. worked on solving the occlusion issue by designing a model for stereo consistency using disparity maps regressed with parallax attention maps. More recently, Wang et al. used the intrinsic correlation within the stereo image pairs, and by using the symmetry cues, proposed a symmetric bi-directional PAM and an occlusion handling scheme to interact cross-view information. The direct extension of the stereoscopic image or conventional 2D video super-resolution methods to the stereoscopic video domain is challenging due to the need to maintain the disparity and temporal consistency simultaneously. Typically, relative object-camera motion between the neighboring frames in a (stereo) video is low. Therefore, the motion information between the consecutive frames can play a significant role in super-resolving the adjacent frames. Thus, the stereoscopic video super-resolution task can be di-vided into 1) modeling symmetry cues between two views, and 2) sequence modeling between consecutive frames. The inherent correlation between pairs of stereo frames is used for symmetry modeling. The sequence modeling task can potentially be solved using recurrent neural networks (RNN), long short term memory (LSTM), and Transformers. Among these techniques, the more promising solution to tackle a sequence modeling task such as SVSR is the Transformers network, which is well-known for its capability in parallel computing and excellent performance in modeling the dependencies between the input sequences. Transformer-based models for vision tasks such as Vision Transformers (ViT) divide a video frame into small patches and extract the global relationships among the token embeddings which represents the patches, where local information is not given much attention. These models cannot be directly applied for SVSR, in which the local and texture information is essential. Furthermore, temporal information and consistency, which are equally crucial in the SVSR task, cannot be solved by ViT. This paper proposes a novel Transformer-based model that can integrate the spatio-temporal information from the stereo views while maintaining both stereo-and temporal consistency. Specifically, after compensating the motion of previous and next frames, a Transformer network is applied to both the left and right views. We then use a CNN-based module to extract features and a modified PAM module to fuse the features from the stereo views. Finally, the output is up-sampled, and a convolutional layer generates the super-resolved target frames. The main contributions in this paper are summarized as follows: A new model, Trans-SVSR, is proposed for the SVSR task. We designed a novel Transformer network, and the related parts of the model to make the proposed model suitable for the SVSR task. Furthermore, the PAM module is modified and aligned to the SVSR. A novel optical flow-based feed-forward layer in our Transformer model that spatially align input features, by considering the correlations between all frames. A new dataset, namely SVSR-Set, is collected for the SVSR task. It contains 71 high-resolution stereo videos in different indoor and outdoor settings, and is the largest dataset for the SVSR task. Performance comparison against several 2D Video SR and Stereo ISR methods, re-implemented for SVSR on SVSR-Set and two other datasets, demonstrates that Trans-SVR achieves state-of-the-art performance for the SVSR task. Related Works Recently, 2D video super-resolution (2D-VSR) is receiv-ing increasing attention. As opposed to 2D image superresolution (2D-ISR), 2D-VSR is more challenging since it entails combining data from numerous closely related but mismatched frames in video frames. There are two types of 2D-VSR techniques: sliding-window and recurrent methods. Previous approaches such as ToFlow predicts the flow across frames, followed by a warping process. Recent techniques use a more indirect approach. To align distinct frames at the feature level, SOF-VSR uses deformable convolutions (DCNs).To provide a smooth data flow and the preservation of texture features over extended periods, RRN uses a residual mapping across layers with skip connections. BasicVSR and IconVSR utilised essential functions, e.g. propagation, alignment, aggregation, and upsampling, with efficient designs, and showed that their method can achieve good efficiency and accuracy. Traditional Stereo ISR methods mainly focused on estimating the disparity information and using this info for spatial resolution enhancement. Newer Stereo ISR methods exploit the cross-view information alongside the features from each mono-view image. For example, Jeon et al. did not calculate the disparity and used stereo images for super-resolution. They proposed a model to learn a parallax prior by training two networks and fusing the other view's spatial information by combining the left and shifted versions of the right images. Wang et al. proposed a parallax-attention stereo super-resolution network (PASSRnet) to capture the stereo correspondence with a global receptive field along the epipolar line. In another study, Song et al. proposed a self and parallax attention mechanism (SPAM) that uses mono and cross-view information for Stereo ISR. They also developed a network and efficient loss functions to maintain stereo consistency. Xu et al. used bilateral grid processing into a CNN network and proposed a bilateral stereo super-resolution network (BSSRnet) for Stereo ISR. The main idea is borrowed from image restoration. More recently, Wang et al. enhanced the Stereo ISR by proposing the symmetric bi-directional parallax attention module (biPAM). Moreover, they recommended a scheme for inline occlusion handling to interact with cross-view information efficiently. Very recently, SVSRNet employed the viewtemporal correlations for performing the SVSR task. They designed an attention module to combine the LR information from time dimension and stereo views to create HR stereo videos. Then, a fusion module is devised to fuse the information in the time dimension. They proposed a temporal and stereo views consistency loss function to enforce the consistency constraint of super-resolved stereo videos. They also developed a view-temporal attention mechanism for fusing the left and right view features. The PAM module is adopted to exploit the cross-view information further. Figure 1. The architecture of the proposed model. The input is 2n + 1 left and right frames. Then is the middle frame that super-resolves to the target frame. First, the neighboring frames are compensated for the motion computation. After position encoding, the frames are input to the Transformer with spatio-temporal architecture. Following the feature extraction using convolutional layers, PAM is used to fuse the left and right features. After feature extraction, the features are up-scaled. The super-resolved middle frames are the outputs. Proposed Model The architecture of the proposed method is shown in Figure 1. Given a batch of the consecutive stereo video frames, with the target frame to be super-resolved denoted as middle frame, we first estimate the motion between the middle (both left and right) frames and their corresponding neighbouring frames. Then, the neighbouring frames are warped to the middle frames. The middle frames and the frames compensated for motion are then passed to the Transformer for feature extraction. Next, the extracted features are passed to a 3D convolutional block to further extract more localized features. The extracted left and right features are then input to the PAM module for fusing the features from the left and right middle frame pairs. The PAM features are then concatenated with extracted features of the middle frames and passed to a convolutional block. The convolutional decoder block consists of the consecutive 2D convolutions which is used for the creation of the super-resolved frames, and we name it as the reconstruction module in 1. This module includes 8 consecutive 2D convolutional layers, all with the kernel size of 3. The number of filters for each convolution layer are 256, 512, 1024, 1024, 512, 256, 128, 3, respectively. Finally, the features are upscaled using up-convolutions and added with the up-scaled version of the middle frames, creating the super-resolved frames. We provide detailed description for each module in the following sections. Notations. Let I l LR n and I r LR n be the n-th low-resolution frames from the left and right stereo video V l LR and V r LR, respectively. Our model's inputs are I l LR n and I r LR n, and its aim is to create the high-resolution version of them as l HR n and r HR n. For each view, we select the middle frames I l LR n and I r LR n from the consecutive frames as the frames aim-ing to be super-resolved. In addition,n previous and next frames (I l LR n−n,...,I l LR n,..., I l LR n+n ) and (I r LR n−n,...,I r LR n,..., I r LR n+n ) are also selected as inputs to the model. Motion Compensation Since Spatial Pyramid Network (SPyNet) is used as baseline in optical flow computation, to warp each neighbouring frame (I l LR n−n,..., I l LR n+n ) and (I r LR n−n,..., I r LR n+n ) to the middle frame I l LR n and I r LR n by calculating the motion between the middle frame and each of the neighbouring frames. The warped frames provide different representations of the target frame. Let F be the current optical flow field. The residual flow at each k-th pyramid level f k for left frame is defined as: where u is up-sampling operator, Conv k is the k th Convnet module, and warp is the warping operator. The Convnet Conv k calculates the residual flow f k using the up-sampled flow from the previous level, F k−1, and the frames I l LR 1,k and I l LR 2,k at level k. The neighbouring frame I l LR 2,k is warped using the flow as warp(I l LR 2,k, u(F k−1 )). Finally, the flow at the k-th level F k is: The process starts with the down-sampled frames from the top level of the coarse-to-fine pyramid by calculating flow f 0, at the top pyramid level. Then, we apply up-sampling to the resulting flow u(f 0 ). Convolution, Conv 1, is applied to the resulted up-sampled flow and {I l LR 1,1, warp(I l LR 2,1, u(F 0 ))} and f 1 is computed. This process is repeated for all pyramid levels. The left and right Figure 2. The high-level design architecture of the Transformer. Convolutional layers are used to extract features from the motioncompensated frames. After position encoding, the self-attention and feed-forward optical flows modules, both with residual connections to the add and normalization blocks, between them are applied. The final convolutional blocks provide the output features of the Transformer. models shared the training parameters. We initialized the model with pre-trained weights from SPyNet and fine-tune the weights during the training. Transformer Architecture Our proposed Transformer block mainly includes a convolutional encoder, an attention layer, a feed-forward layer with skip connection, and a convolutional decoder. The high-level architecture of the Transformer is shown in Figure 2. Firstly, a 3D convolutional layer is applied to the input frame-batches to transfer the 3-channel frames which has been compensated for motion (I ). With this operation, the number of attention heads in the Transformer could be increased. Then, the residual blocks extract initial features from the input features (I l Res 64 and I r Res 64 ). The encoder of our Transformer converts the features to a sequence of continuous representations. Self-attention and Feed-forward optical flows modules, with residual connections using the add and normalization blocks between them, are applied next. These layers are repeated L times as shown in Figure 2. Finally, another residual block followed by a 3D convolutional layer is applied to the output representations. In the following sub-sections, the architecture of the sub-blocks of the transformer is explained. Convolutional Self-attention. The architecture of the self-attention layer is shown in Figure 3. Firstly we create the Query (Q), Key (K), and Value (V) tensors. With applying a 3D convolution to the input feature maps ((I l Res 64 and I r Res 64 )), we create Q (Q l 64 and Q r 64 ) and K tensors (K l 64 and K r 64 ) in order to extract the spatio-temporal features of each input feature. 64 filters with kernel size of 333 and padding of 1 are used for all three convolution layers. The Q, K, and V for the left and right channels are as: Figure 3. The architecture of the spatial-temporal convolutional self-attention module. Tensors Q, K, and V are created by passing the input features to a 3D convolutional block. Then, multiplication between Q and K, SoftMax operation, 3D convolution, and batch normalization create features to be further multiplied with V. Finally, the resulting features are added to the input features, and the output features are created. where K 1, K 2, and K 3 are three independent convolutional kernels. Then, we calculate the similarity matrix using the tensor multiplication (TP) and SoftMax operators: Following that, we feed the output features to a 3D convolutional layer with 64 filters and kernel size of 333 with padding and stride of 1, and a 3D batch normalization layer, and a ReLU activation function. The output features are then multiplied by K tensor and added with the input features to provide the output features of the attention layer: Spatial-temporal positional encoding. The original Transformer architecture is invariant to the permutation, but in super-resolution, the exact position information is important. We use the positional encoding in to encode the 3D positional information of a video and add it along with the input to the attention block. For each dimension coordinates, we use d/3 sinus and cosinus functions with different frequencies for the left and right Transformers as follows: for i=2k+1; where k is the corresponding dimension. Specifically, each dimension of the positional encoding consistent with a sinus function. It will allow the model to easily learn to attend by relative positions. pos l and pos r are the position in the corresponding dimension for left and right Transformers, respectively and w k = 1/10000 2k/(d/3). Also, d is the channel dimension size and must be divisible by 3. Flow-based Feed-Forward. The traditional fully connected feed-forward layer includes two linear layers and is applied to each token identically. With this design, the fully connected feed-forward layer may not use the correlations between tokens related to the neighbouring frames. We proposed an optical flow-based method to spatially align the input features, taking into consideration the correlations between the input frames. The architecture of our flow-based feed-forward layer is shown in Figure 4. The input feature maps from the self-attention layer namely Attn l and Attn r are used as input to this module. Firstly, we calculate the optical flow between frame number n (the middle frame) and frame number m (where m = 1,..., 5) as f low l and f low r : for m =n; f low r (m, n) = W H for m=n, spy(I r LR n, I r LR m ) for m =n; Next, we warp the input features along the forward direction, and concatenate (cat) them with the input feature maps from the self-attention layer: Then, we fuse the F F l and F F r with Attn l and Attn r. We propose a convolutional forward layer to establish the relationship between consecutive frames. Specifically, we use residual blocks and a 3D convolution layer with 111 kernel size, stride 1, and zero padding, followed by the LeakyReLU activation function, to create the output features of this layer. The output feature size is 64. The fully connected feed-forward layer is defined as the following: Modified PAM Architecture Wang et al. presented the parallax attention mechanism to estimate global matching in stereo images based on self-attention techniques. The left and right image pair's features can be efficiently merged using PAM. Figure 5 depicts the structure of the redesigned PAM. A 1 1 layer receives the previous layer's output. The features are then sent to a SoftMax block to construct the attention maps M R to L and M L to R, which are created using batch-wised matrix multiplication. Next, the sum of features is combined with previous right features at all disparity levels. To create additional features appropriate for deblurring, three 2D CNN layers are utilized, each followed by a ReLU activation function and a batch normalization layer. The first two layers, conv1 and conv2, both consist of 128 filters, but with different kernel size of 55 and 33 for conv1 and conv2, respectively. A dropout with rate of 0.5 is applied to conv2 layer, where random neurons' activity levels are forced to zero. The third layer conv3 comprises 64 33 filters. To reduce the complexity of the whole model, we did not include the valid mask generation and the fusion parts in the original PAM. Loss Functions We use three loss functions to train Trans-SVSR on SVSR-Set. The first loss function is the mean absolute error (MAE) that calculates the average of the absolute differences between the HR and super-resolved frames. It is formulated as the average MAE of the left and right views: where mae l and mae r are the MAE loss between HR and its corresponding super-resolved left and right frames, respectively. We also used photometric (photo loss ) and cycle (cycle loss ) losses as additional loss functions. The total loss function is the combination of these three losses: loss = mae loss + (photo loss + cycle loss ) where is the regularization term, empirically set as 0.01. Dataset Collection For Stereo ISR, there are several datasets such as KITTI 2012, KITTI 2015, Middlebury and Flickr1024. These datasets mostly contain stereo images that may not be useful for the SVSR task. In the following sub-sections, we will discuss the existing datasets for SVSR, along with its limitation, followed by the detailed description of SVSR-Set, the new dataset we collected for the SVSR task. Existing Datasets KITTI 2012 and KITTI 2015 datasets contain frames of videos with limited consecutive frames. Both datasets contain about 200 stereo videos with limited frames. The time difference between the consecutive frames is significantly high, making them unsuitable for stereo video-related applications. On the other hand, Scene-Flow provides a dataset containing 2, 265 training and 437 testing stereo videos. However, this dataset is synthetic. LFOVIAS3DPh2 (LFO3D) and NAMA3DS1-COSPAD1 (NAMA3D) datasets are widely used for stereoscopic video quality assessment. However, since these datasets are created originally for quality assessment purpose, many videos are distorted and of low quality. Notably, only 10 and 12 videos from Nama3D and LFO3D are in full HD resolution and suitable to be used for the SVSR task. The LFO3D videos are chosen from the RMIT3DV video dataset that includes symmetrically and asymmetrically distorted videos. All the videos in RMIT3DV dataset are captured using a Panasonic AG-3DA1 camera with full HD 19201080 resolution. The time duration of all videos in the dataset is constant, which is only 10 seconds. In summary, these datasets are too small for training a good model for the SVSR task. SVSR-Set Dataset Due to the lack of an existing real-world dataset that is sufficiently large for training a good deep neural network model for the SVSR task, we developed SVSR-Set, a new real-world dataset, which can be used for training and evaluating the SVSR methods in the future. Compared to 2D video datasets, the creation of stereo video datasets is more challenging and time-consuming. This dataset contains 71 stereo videos, collected using a professional ZED 2 stereoscopic camera. Each stereo video clip is recorded as a full high-definition (HD) (10801920) video and contains 20 seconds video capture at 30 frames per second (FPS). These videos are available in.svo and.avi containers format. The videos are recorded in various settings, including indoor and outdoor, low and high motion, low and high illumination, etc. We also provide the disparity ground truth for two consecutive frames. The SVSR-Set is made publicly available to the research community at http://shorturl.at/mpwGX. Calibration. We calibrated the camera to ensure that possible slight shifts in the camera's internal parts would not make the dataset unusable. The calibration file was created one time and used for the whole recording process. The calibration file includes details about the exact location of the left and right cameras and their optical properties. First, we turned the lights off and closed window blinds that may cause reflections on the screen and made the calibration process longer. During the calibration process, a grid window and a red dot will appear in the middle of the monitor screen. When the camera is put in front of the monitor, a blue dot will appear. The aim of the calibration is to match the blue dot with the red dot. This process is repeated several times because the dots has motion and hence, may change its location. Dataset collection. The moving objects contain people, ships, flowers, and other objects from public places. The video attributes; stimuli type, light conditions (day/night), motion strength (low/high), indoor/outdoor, and the number of stereo videos, are shown in Table 1. As seen, most of the stereo videos contain "people" stimuli. 12 videos contain the "people, tree, car, motor" objects, recorded during outdoor daytime settings, and the high motion strength, 15 videos are recorded in the indoor settings, 9 videos captured Implementation Details We trained our proposed Trans-SVSR on the developed SVSR-Set. We randomly split the stereoscopic videos in the SVSR-Set dataset to train and test sets. Our training set contains 58 stereo videos, and the testing set has 13 videos. We down-sampled the HR frames using the bicubic method to create LR images. For training, we cropped the LR frames and their corresponding HR frames to nonoverlapping patches of size 3288. We conducted experiments on 6SR and 4SR. For 6SR and 4SR videos, the size of HR training frames are 192528 and 128352. We have created 519, 390 and 1, 385, 040 training samples for 6SR and 4SR, respectively. We used a computing system with the following specifications: i9-10850K CPU 3.60 GHz, 64GB memory, NVIDIA GeForce RTX 3090 GPU with 24GB of GPU memory. The Adam optimizer with parameters 1 =0.90 and 2 =0.99, is used in our experiments. We used a batch size of 7 and 1, 385k iterations to train the proposed model. The models are implemented with PyTorch 1.8.0 library. The learning rate is initialized to 2e-4, and reduced by 50% per epoch. Results and Discussions Evaluation of our proposed method, Trans-SVSR is performed on three stereo video datasets; SVSR-Set, LFO3D, and NAMA3D. We could not compare our method with the very recently proposed SVSRNet, which is also the only SVSR method, because of unavailability of open-source code. Therefore, we compare our method with the recently published state-of-the-art Stereo ISR and 2D video SR methods. We re-implemented iPASSR, PASSRnet, SRRes+SAM, DFAM and its variants as well as two 2D video SR methods; SOF-VSR and RRN to perform testing on the three datasets. Table 3. Performance comparison of our proposed Trans-SVSR and state-of-the-art Stereo ISR methods for 4SR videos on three datasets: SVSR-Set, LFO3D, and NAMA3D. The best results are in Bold and the second-best results are underlined. Quantitative Performance Quantitative evaluation of the proposed method is considered using two measures; namely, peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) in RGB space. Table 3 compares results of our proposed Trans-SVSR method with other methods on the SVSR-Set, LFO3D, and NAMA3D datasets for 4SR videos. As shown in this table, our proposed method achieves the stateof-the-art results compared to the Stereo ISR and 2D video SR-based methods on all three datasets. The PSNR of Trans-SVSR on SVSR-Set is 31.9766, which is 2.8312 dB better than the second-best performing RRN method, and is considered a significant improvement. The SSIM value for our method is 0.9293, which again, outperformed all methods in comparison. As can be seen from the results on LFO3D dataset, all methods obtained lower PSNR and SSIM on this dataset. It shows that this dataset is more challenging for all SR methods, largely due to the small dataset size. Interestingly, for this dataset, our method again achieves state-of-the-art performance compared to the other methods. On LFO3D dataset, compared to the second best-performing methods, PSNR and SSIM for our method are improved by 2.8275 and 0.0159 dB, respectively. PSNR and SSIM for our method on NAMA3D dataset are 28.0543 and 0.8473, which are higher than all the Stereo ISR-based methods. Train and test on 6SR videos. We also trained our model with L=20 on 6SR videos in SVSR-Set training set, and tested on SVSR-Set test set, NAMA3D, and LFO3D datasets. Table 4 shows the testing results of our method on these three datasets. Stereo consistency. To measure the consistency between super-resolved frames of the output of our model and the reference stereo frames, we compute the end-point error (EPE) by calculating the Euclidean distance between the disparity of the super-resolved frames and the reference frames. From the comparison of EPE with other methods in Table 5, it can be observed that the proposed Trans-SVSR better preserves the stereo disparity on SVSR-Set dataset. Figure 6. Qualitative results. One frame from SVSR-Set dataset. We compared trans-SVSR with PASSRnet, iPASSR, RCAN-DFAM, SRCNN-DFAM, SRResNet-DFAM, VDSR-DFAM, SOF-VSR, and RRN. Qualitative Performance Qualitative results for 4SR are shown in Figure 6. From the results in the top rows, it can be observed that Stereo ISR methods tend to made the frame sharper, which indirectly resulted in more noise. Results of our method appear to be smoother, less disjointed and less halo effect as compared to some Stereo ISR results; i.e. RCAN-DFAM and SRCNN-DFAM. The reason could be that Stereo ISR methods generally use the spatial information of one view, or cross-view information for performing super-resolution, disregarding the temporal information. In contrast, our proposed method, Trans-SVR also uses the temporal information from the neighboring frames, alongside the spatial information, and hence it can create smoother results with more details. Ablation Study The ablation studies investigate the effect of removing different modules on the performance of Trans-SVSR. Effect of the temporal frames. To see the effect of the motion in the input frames on the performance of the proposed model, we trained Trans-SVSR with just the middle stereo frames as the input (Trans-SVSR-WMF). We repeated the middle frame 5 times for the left and right input stream and fed it to the model. In this way, the motion information from the stereo video is removed. The first row of Table 6 shows that without including the neighboring frames, the model performance decreases considerably. This study indicates that the adjacent frames and the motion between them are used effectively in Trans-SVSR. Influence of the Transformer. Results of removing the Transformer (Trans-SVSR-WOT) is depicted in the second row of Table 6. From the results, we can observe that the Transformer greatly influences the model performance, whereby PSNR decreases by 2.0852 dB when the Transformer is removed from both the left and right channels. Comparing with the results of other ablation study in Table 6, it is evident that Transformer plays an important role in boosting the performance of the proposed model. Effect of PAM. The PAM module helps to fuse the left and right information and cross-view information when deblurring one view. By disabling the PAM module (Trans-SVSR-PAM), the left and right channels will act like two different models, leading to decrease in performance as shown by results in the third row of Table 6. This result demonstrates that the cross-view information influences the model performance positively. Influence of the reconstruction module. To investigate the absence of the reconstruction module to the performance of our model, we removed this module from our network (Trans-SVSR-WOR). Results in the fourth row of Table 6 show that the performance drops considerably. This result shows that without the decoder block, the model lacks reconstruction capability. Impact of flow-based feed-forward layer. To show the effectiveness of the flow-based feed-forward layer of the proposed Transformer, we conducted additional experiments. The fifth row of Table 6 shows the comparison results of our model performance, which uses the flow-based feedforward layer (Trans-SVSR-WSF) with the standard feedforward layer (Trans-SVSR). As this table shows, on SVSR-Set dataset, a decrease of 1.6161 dB is resulted, which is a considerable difference. Conclusion and Future Works This paper proposed a novel stereoscopic video superresolution framework based on a spatio-temporal Transformer network. We designed the self-attention and optical flow-based feed-forward layer to make the Transformer suitable for SVSR. In addition, we collected a new SVSR-Set dataset that can also be used for both the SVSR and Stereo ISR tasks. We trained our model on the SVSR-Set dataset. Comparison with the state-of-the-art Stereo ISR methods on three datasets demonstrates that our method achieves the state-of-the-arts results. One limitation of the Trans-SVSR method is the obviously larger number of the network parameters, as shown in Table 3. However, this is probably reasonable since our method is proposed to address video super-resolution with an additional dimension as compared to the Stereo ISR task. The added temporal dimension unavoidably resulted in a more complex model. In the future, we will design loss functions that can better reflect the quality difference between HR and super-resolved video frames. To reduce complexity, model pruning can be used to minimize computational and storage requirements for model inference. |
Inflammatory Factors in Eustachian Tube Dysfunction t ion. The effusions persist for up to 2 weeks, depending on the challenge dose of bacteria, but pathologic changes per sist in the ME connective tissue for up to 28 days after in jection. Capil lary di lat ion, bleeding, and tissue edema are common findings during the first week after injection, as shown in Fig IOC. Quantitative morphologic analysis in dicates that the cellular infi l trate into the ME connective tissue is different from that induced by the bacteria and consists predominantly of polymorphonuclear neutrophils for up to two to four days after injection, but by four days, macrophages and lymphocytes become the predominant cell t ype. " Other notable changes include evidence of bone remodeling, characterized by the appearance of numerous osteoblasts along the endosteal margin and marked abnormal mucosal epithelial proliferation. Often the original epithelium and abnormally growing epitheli um formed a pocket containing MEE. Unlike the grossly purulent MEEs from the chinchillas injected w i th viable bacteria, MEEs induced by the formalin-kil led bacteria contained fewer than 1,000 cells/mm'. The cytologic pro files of the MEEs are also distinctly biphasic. Polymorpho nuclear neutrophils represented 73 % of the total WBC for up to two days after injection. By four to five days, the percentage of polymorphonuclear neutrophils declined, and macrophages increased to 74 % of the total WBC in the MEEs. |
/**
* Inserts new puzzle into the database.
*
* @param folderID Primary key of the folder in which puzzle should be saved.
* @param sudoku
* @return
*/
public long insertSudoku(long folderID, SudokuGame sudoku) {
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(SudokuColumns.DATA, sudoku.getCells().serialize());
values.put(SudokuColumns.CREATED, sudoku.getCreated());
values.put(SudokuColumns.LAST_PLAYED, sudoku.getLastPlayed());
values.put(SudokuColumns.STATE, sudoku.getState());
values.put(SudokuColumns.TIME, sudoku.getTime());
values.put(SudokuColumns.PUZZLE_NOTE, sudoku.getNote());
values.put(SudokuColumns.FOLDER_ID, folderID);
long rowId = db.insert(SUDOKU_TABLE_NAME, FolderColumns.NAME, values);
if (rowId > 0) {
return rowId;
}
throw new SQLException("Failed to insert sudoku.");
} |
Perceptions vs. evidence: therapeutic substitutes for antipsychotics in patients with dementia in long-term care ABSTRACT Objective: To compare differences between clinician perceptions of therapeutic substitutes for antipsychotics prescribed to patients with dementia in long term care (LTC) and published evidence. Methods: A mixed-methods approach that included a drug information search, online survey of 55 LTC clinicians and a comprehensive literature review was used. For 41 pharmacologic antipsychotic substitute candidates identified, LTC clinicians rated the likelihood they would substitute each for patients with dementia and identified non-pharmacologic antipsychotic substitutes. The quality of evidence supporting the most likely antipsychotic substitutes was assessed using a modified GRADE approach. Results: Among 36 (65%) of LTC clinicians responding, the pharmacologic candidates deemed likely or somewhat likely to be substituted for an antipsychotic were: valproic acid, serotonin modulator antidepressants, short-acting benzodiazepines, serotonin reuptake inhibitor antidepressants, alpha-adrenoceptor antagonist, buspirone, acetaminophen, serotonin-norepinephrine reuptake inhibitor antidepressants, memantine, and a cholinesterase inhibitor. High quality evidence supporting these substitutions existed for only memantine and cholinesterase inhibitors, while high quality evidence cautioning against this substitution existed for valproic acid. Activities and music therapy were the most commonly cited non-pharmacologic substitutes but the supporting evidence for each is sparse. Conclusion: Perceptions of LTC clinicians regarding substitutes for antipsychotics in LTC patients with dementia vary widely and are often discordant with published evidence. |
/**
* Convert the input string to a binary tree.
*
* @author Yufei Yan
* @version 0.1.1
*/
public class ToBinaryTree<T extends Comparable<? super T>> {
private T[] arr;
public ToBinaryTree(T[] input) {
arr = input;
}
/**
* Convert the input string a binary tree which has integer values.
*
* @param input the input string.
* @return the root of the binary tree.
*/
public TreeNode<T> binaryTree() {
if (null == arr || 0 == arr.length) return null;
TreeNode<T> root = new TreeNode<>(arr[0]);
Queue<TreeNode<T>> queue = new ArrayDeque<>();
TreeNode<T> cur = null;
queue.offer(root);
int len = arr.length;
int i = 1;
while (i < len) {
cur = queue.poll();
if (arr[i] != null) {
cur.left = new TreeNode<>(arr[i]);
queue.offer(cur.left);
}
++i;
if (i < len && arr[i] != null) {
cur.right = new TreeNode<>(arr[i]);
queue.offer(cur.right);
}
++i;
}
return root;
}
/**
* Tester.
*
* @param args Commnad line arguments.
*/
public static void main(String[] args) {
//String input = "[10,5,15,3,7,null,18]";
String input = "[10,5,15,3,7,13,18,1,null,6]";
Integer[] arr = ToArray.integerArray(input);
ToBinaryTree<Integer> toBT = new ToBinaryTree<>(arr);
TreeNode<Integer> root = toBT.binaryTree();
// level order traversal to show all nodes
TreeNode<Integer> cur = null;
Queue<TreeNode<Integer>> queue = new ArrayDeque<>();
queue.offer(root);
while (!queue.isEmpty()) {
cur = queue.poll();
System.out.print(cur.val + " ");
if (null != cur.left) queue.offer(cur.left);
if (null != cur.right) queue.offer(cur.right);
}
System.out.println();
}
} |
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
/*++
Module Name:
shmobjectmgr.cpp
Abstract:
Shared memory based object manager
--*/
#include "shmobjectmanager.hpp"
#include "shmobject.hpp"
#include "pal/cs.hpp"
#include "pal/thread.hpp"
#include "pal/procobj.hpp"
#include "pal/dbgmsg.h"
SET_DEFAULT_DEBUG_CHANNEL(PAL);
#include "pal/corunix.inl"
using namespace CorUnix;
IPalObjectManager * CorUnix::g_pObjectManager;
static
PAL_ERROR
CheckObjectTypeAndRights(
IPalObject *pobj,
CAllowedObjectTypes *paot,
DWORD dwRightsGranted,
DWORD dwRightsRequired
);
/*++
Function:
CSharedMemoryObjectManager::Initialize
Performs (possibly failing) startup tasks for the object manager
Parameters:
None
--*/
PAL_ERROR
CSharedMemoryObjectManager::Initialize(
void
)
{
PAL_ERROR palError = NO_ERROR;
ENTRY("CSharedMemoryObjectManager::Initialize (this=%p)\n", this);
InitializeListHead(&m_leNamedObjects);
InitializeListHead(&m_leAnonymousObjects);
InternalInitializeCriticalSection(&m_csListLock);
m_fListLockInitialized = TRUE;
palError = m_HandleManager.Initialize();
LOGEXIT("CSharedMemoryObjectManager::Initialize returns %d", palError);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::Shutdown
Cleans up the object manager. This routine will call cleanup routines
for all objects referenced by this process. After this routine is called
no attempt should be made to access an IPalObject.
Parameters:
pthr -- thread data for calling thread
--*/
PAL_ERROR
CSharedMemoryObjectManager::Shutdown(
CPalThread *pthr
)
{
PLIST_ENTRY ple;
CSharedMemoryObject *pshmobj;
_ASSERTE(NULL != pthr);
ENTRY("CSharedMemoryObjectManager::Shutdown (this=%p, pthr=%p)\n",
this,
pthr
);
InternalEnterCriticalSection(pthr, &m_csListLock);
SHMLock();
while (!IsListEmpty(&m_leAnonymousObjects))
{
ple = RemoveTailList(&m_leAnonymousObjects);
pshmobj = CSharedMemoryObject::GetObjectFromListLink(ple);
pshmobj->CleanupForProcessShutdown(pthr);
}
while (!IsListEmpty(&m_leNamedObjects))
{
ple = RemoveTailList(&m_leNamedObjects);
pshmobj = CSharedMemoryObject::GetObjectFromListLink(ple);
pshmobj->CleanupForProcessShutdown(pthr);
}
SHMRelease();
InternalLeaveCriticalSection(pthr, &m_csListLock);
LOGEXIT("CSharedMemoryObjectManager::Shutdown returns %d\n", NO_ERROR);
return NO_ERROR;
}
/*++
Function:
CSharedMemoryObjectManager::AllocateObject
Allocates a new object instance of the specified type.
Parameters:
pthr -- thread data for calling thread
pot -- type of object to allocate
poa -- attributes (name and SD) of object to allocate
ppobjNew -- on success, receives a reference to the new object
--*/
PAL_ERROR
CSharedMemoryObjectManager::AllocateObject(
CPalThread *pthr,
CObjectType *pot,
CObjectAttributes *poa,
IPalObject **ppobjNew // OUT
)
{
PAL_ERROR palError = NO_ERROR;
CSharedMemoryObject *pshmobj = NULL;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != pot);
_ASSERTE(NULL != poa);
_ASSERTE(NULL != ppobjNew);
ENTRY("CSharedMemoryObjectManager::AllocateObject "
"(this=%p, pthr=%p, pot=%p, poa=%p, ppobjNew=%p)\n",
this,
pthr,
pot,
poa,
ppobjNew
);
if (CObjectType::WaitableObject == pot->GetSynchronizationSupport())
{
pshmobj = InternalNew<CSharedMemoryWaitableObject>(pot, &m_csListLock);
}
else
{
pshmobj = InternalNew<CSharedMemoryObject>(pot, &m_csListLock);
}
if (NULL != pshmobj)
{
palError = pshmobj->Initialize(pthr, poa);
if (NO_ERROR == palError)
{
*ppobjNew = static_cast<IPalObject*>(pshmobj);
}
}
else
{
ERROR("Unable to allocate pshmobj\n");
palError = ERROR_OUTOFMEMORY;
}
LOGEXIT("CSharedMemoryObjectManager::AllocateObject returns %d\n", palError);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::RegisterObject
Registers a newly-allocated object instance. If the object to be registered
has a name, and a previously registered object has the same name the new
object will not be registered.
Distinguished return values:
ERROR_ALREADY_EXISTS -- an object of a compatible type was already registered
with the specified name
ERROR_INVALID_HANDLE -- an object of an incompatible type was already
registered with the specified name
Parameters:
pthr -- thread data for calling thread
pobjToRegister -- the object instance to register. This routine will always
call ReleaseReference on this instance
paot -- object types that are compatible with the new object instance
dwRightsRequested -- requested access rights for the returned handle (ignored)
pHandle -- on success, receives a handle to the registered object
ppobjRegistered -- on success, receives a reference to the registered object
instance.
--*/
PAL_ERROR
CSharedMemoryObjectManager::RegisterObject(
CPalThread *pthr,
IPalObject *pobjToRegister,
CAllowedObjectTypes *paot,
DWORD dwRightsRequested,
HANDLE *pHandle, // OUT
IPalObject **ppobjRegistered // OUT
)
{
PAL_ERROR palError = NO_ERROR;
CSharedMemoryObject *pshmobj = static_cast<CSharedMemoryObject*>(pobjToRegister);
SHMObjData *psmodNew = NULL;
CObjectAttributes *poa;
CObjectType *potObj;
IPalObject *pobjExisting;
BOOL fInherit = FALSE;
BOOL fShared = FALSE;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != pobjToRegister);
_ASSERTE(NULL != paot);
_ASSERTE(NULL != pHandle);
_ASSERTE(NULL != ppobjRegistered);
ENTRY("CSharedMemoryObjectManager::RegisterObject "
"(this=%p, pthr=%p, pobjToRegister=%p, paot=%p, "
"dwRightsRequested=%d, pHandle=%p, ppobjRegistered=%p)\n",
this,
pthr,
pobjToRegister,
paot,
dwRightsRequested,
pHandle,
ppobjRegistered
);
poa = pobjToRegister->GetObjectAttributes();
_ASSERTE(NULL != poa);
if (NULL != poa->pSecurityAttributes)
{
fInherit = poa->pSecurityAttributes->bInheritHandle;
}
potObj = pobjToRegister->GetObjectType();
fShared = (SharedObject == pshmobj->GetObjectDomain());
InternalEnterCriticalSection(pthr, &m_csListLock);
if (fShared)
{
//
// We only need to acquire the shared memory lock if this
// object is actually shared.
//
SHMLock();
}
if (0 != poa->sObjectName.GetStringLength())
{
SHMPTR shmObjectListHead = SHMNULL;
//
// The object must be shared
//
_ASSERTE(fShared);
//
// Check if an object by this name alredy exists
//
palError = LocateObject(
pthr,
&poa->sObjectName,
paot,
&pobjExisting
);
if (NO_ERROR == palError)
{
//
// Obtain a new handle to the existing object
//
palError = ObtainHandleForObject(
pthr,
pobjExisting,
dwRightsRequested,
fInherit,
NULL,
pHandle
);
if (NO_ERROR == palError)
{
//
// Transfer object reference to out param
//
*ppobjRegistered = pobjExisting;
palError = ERROR_ALREADY_EXISTS;
}
else
{
pobjExisting->ReleaseReference(pthr);
}
goto RegisterObjectExit;
}
else if (ERROR_INVALID_NAME != palError)
{
//
// Something different than an object not found error
// occurred. This is most likely due to a type conflict.
//
goto RegisterObjectExit;
}
//
// Insert the object on the named object lists
//
InsertTailList(&m_leNamedObjects, pshmobj->GetObjectListLink());
psmodNew = SHMPTR_TO_TYPED_PTR(SHMObjData, pshmobj->GetShmObjData());
if (NULL == psmodNew)
{
ASSERT("Failure to map shared object data\n");
palError = ERROR_INTERNAL_ERROR;
goto RegisterObjectExit;
}
shmObjectListHead = SHMGetInfo(SIID_NAMED_OBJECTS);
if (SHMNULL != shmObjectListHead)
{
SHMObjData *psmodListHead;
psmodListHead = SHMPTR_TO_TYPED_PTR(SHMObjData, shmObjectListHead);
if (NULL != psmodListHead)
{
psmodNew->shmNextObj = shmObjectListHead;
psmodListHead->shmPrevObj = pshmobj->GetShmObjData();
}
else
{
ASSERT("Failure to map shared object data\n");
palError = ERROR_INTERNAL_ERROR;
goto RegisterObjectExit;
}
}
psmodNew->fAddedToList = TRUE;
if (!SHMSetInfo(SIID_NAMED_OBJECTS, pshmobj->GetShmObjData()))
{
ASSERT("Failed to set shared named object list head\n");
palError = ERROR_INTERNAL_ERROR;
goto RegisterObjectExit;
}
}
else
{
//
// Place the object on the anonymous object list
//
InsertTailList(&m_leAnonymousObjects, pshmobj->GetObjectListLink());
}
//
// Hoist the object's immutable data (if any) into shared memory if
// the object is shared
//
if (fShared && 0 != potObj->GetImmutableDataSize())
{
VOID *pvImmutableData;
SHMObjData *psmod;
palError = pobjToRegister->GetImmutableData(&pvImmutableData);
if (NO_ERROR != palError)
{
ASSERT("Failure to obtain object immutable data\n");
goto RegisterObjectExit;
}
psmod = SHMPTR_TO_TYPED_PTR(SHMObjData, pshmobj->GetShmObjData());
if (NULL != psmod)
{
VOID *pvSharedImmutableData =
SHMPTR_TO_TYPED_PTR(VOID, psmod->shmObjImmutableData);
if (NULL != pvSharedImmutableData)
{
CopyMemory(
pvSharedImmutableData,
pvImmutableData,
potObj->GetImmutableDataSize()
);
}
else
{
ASSERT("Failure to map psmod->shmObjImmutableData\n");
palError = ERROR_INTERNAL_ERROR;
goto RegisterObjectExit;
}
}
else
{
ASSERT("Failure to map pshmobj->GetShmObjData()\n");
palError = ERROR_INTERNAL_ERROR;
goto RegisterObjectExit;
}
}
//
// Obtain a handle for the new object
//
palError = ObtainHandleForObject(
pthr,
pobjToRegister,
dwRightsRequested,
fInherit,
NULL,
pHandle
);
if (NO_ERROR == palError)
{
//
// Transfer pobjToRegister reference to out param
//
*ppobjRegistered = pobjToRegister;
pobjToRegister = NULL;
}
RegisterObjectExit:
if (fShared)
{
SHMRelease();
}
InternalLeaveCriticalSection(pthr, &m_csListLock);
if (NULL != pobjToRegister)
{
pobjToRegister->ReleaseReference(pthr);
}
LOGEXIT("CSharedMemoryObjectManager::RegisterObject return %d\n", palError);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::LocateObject
Search for a previously registered object with a give name and type
Distinguished return values:
ERROR_INVALID_NAME -- no object with the specified name was previously
registered
ERROR_INVALID_HANDLE -- an object with the specified name was previously
registered, but its type is not compatible
Parameters:
pthr -- thread data for calling thread
psObjectToLocate -- the name of the object to locate
paot -- acceptable types for the object
ppobj -- on success, receives a reference to the object instance
--*/
PAL_ERROR
CSharedMemoryObjectManager::LocateObject(
CPalThread *pthr,
CPalString *psObjectToLocate,
CAllowedObjectTypes *paot,
IPalObject **ppobj // OUT
)
{
PAL_ERROR palError = NO_ERROR;
IPalObject *pobjExisting = NULL;
SHMPTR shmSharedObjectData = SHMNULL;
SHMPTR shmObjectListEntry = SHMNULL;
SHMObjData *psmod = NULL;
LPWSTR pwsz = NULL;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != psObjectToLocate);
_ASSERTE(NULL != psObjectToLocate->GetString());
_ASSERTE(PAL_wcslen(psObjectToLocate->GetString()) == psObjectToLocate->GetStringLength());
_ASSERTE(NULL != ppobj);
ENTRY("CSharedMemoryObjectManager::LocateObject "
"(this=%p, pthr=%p, psObjectToLocate=%p, paot=%p, "
"ppobj=%p)\n",
this,
pthr,
psObjectToLocate,
paot,
ppobj
);
TRACE("Searching for object name %S\n", psObjectToLocate->GetString());
InternalEnterCriticalSection(pthr, &m_csListLock);
//
// Search the local named object list for this object
//
for (PLIST_ENTRY ple = m_leNamedObjects.Flink;
ple != &m_leNamedObjects;
ple = ple->Flink)
{
CObjectAttributes *poa;
CSharedMemoryObject *pshmobj =
CSharedMemoryObject::GetObjectFromListLink(ple);
poa = pshmobj->GetObjectAttributes();
_ASSERTE(NULL != poa);
if (poa->sObjectName.GetStringLength() != psObjectToLocate->GetStringLength())
{
continue;
}
if (0 != PAL_wcscmp(poa->sObjectName.GetString(), psObjectToLocate->GetString()))
{
continue;
}
//
// This object has the name we're looking for
//
pobjExisting = static_cast<IPalObject*>(pshmobj);
break;
}
if (NULL != pobjExisting)
{
//
// Validate the located object's type
//
if (paot->IsTypeAllowed(
pobjExisting->GetObjectType()->GetId()
))
{
TRACE("Local object exists with compatible type\n");
//
// Add a reference to the found object
//
pobjExisting->AddReference();
*ppobj = pobjExisting;
}
else
{
TRACE("Local object exists w/ incompatible type\n");
palError = ERROR_INVALID_HANDLE;
}
goto LocateObjectExit;
}
//
// Search the shared memory named object list for a matching object
//
SHMLock();
shmObjectListEntry = SHMGetInfo(SIID_NAMED_OBJECTS);
while (SHMNULL != shmObjectListEntry)
{
psmod = SHMPTR_TO_TYPED_PTR(SHMObjData, shmObjectListEntry);
if (NULL != psmod)
{
if (psmod->dwNameLength == psObjectToLocate->GetStringLength())
{
pwsz = SHMPTR_TO_TYPED_PTR(WCHAR, psmod->shmObjName);
if (NULL != pwsz)
{
if (0 == PAL_wcscmp(pwsz, psObjectToLocate->GetString()))
{
//
// This is the object we were looking for.
//
shmSharedObjectData = shmObjectListEntry;
break;
}
}
else
{
ASSERT("Unable to map psmod->shmObjName\n");
break;
}
}
shmObjectListEntry = psmod->shmNextObj;
}
else
{
ASSERT("Unable to map shmObjectListEntry\n");
break;
}
}
if (SHMNULL != shmSharedObjectData)
{
CSharedMemoryObject *pshmobj = NULL;
CObjectAttributes oa(pwsz, NULL);
//
// Check if the type is allowed
//
if (!paot->IsTypeAllowed(psmod->eTypeId))
{
TRACE("Remote object exists w/ incompatible type\n");
palError = ERROR_INVALID_HANDLE;
goto LocateObjectExitSHMRelease;
}
//
// Get the local instance of the CObjectType
//
CObjectType *pot = CObjectType::GetObjectTypeById(psmod->eTypeId);
if (NULL == pot)
{
ASSERT("Invalid object type ID in shared memory info\n");
goto LocateObjectExitSHMRelease;
}
TRACE("Remote object exists compatible type -- importing\n");
//
// Create the local state for the shared object
//
palError = ImportSharedObjectIntoProcess(
pthr,
pot,
&oa,
shmSharedObjectData,
psmod,
TRUE,
&pshmobj
);
if (NO_ERROR == palError)
{
*ppobj = static_cast<IPalObject*>(pshmobj);
}
else
{
ERROR("Failure initializing object from shared data\n");
goto LocateObjectExitSHMRelease;
}
}
else
{
//
// The object was not found
//
palError = ERROR_INVALID_NAME;
}
LocateObjectExitSHMRelease:
SHMRelease();
LocateObjectExit:
InternalLeaveCriticalSection(pthr, &m_csListLock);
LOGEXIT("CSharedMemoryObjectManager::LocateObject returns %d\n", palError);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::ObtainHandleForObject
Allocated a new handle for an object
Parameters:
pthr -- thread data for calling thread
pobj -- the object to allocate a handle for
dwRightsRequired -- the access rights to grant the handle; currently ignored
fInheritHandle -- true if the handle is inheritable; ignored for all but file
objects that represent pipes
pProcessForHandle -- the process the handle is to be used from; currently
must be NULL
pNewHandle -- on success, receives the newly allocated handle
--*/
PAL_ERROR
CSharedMemoryObjectManager::ObtainHandleForObject(
CPalThread *pthr,
IPalObject *pobj,
DWORD dwRightsRequested,
bool fInheritHandle,
IPalProcess *pProcessForHandle, // IN, OPTIONAL
HANDLE *pNewHandle // OUT
)
{
PAL_ERROR palError = NO_ERROR;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != pobj);
_ASSERTE(NULL != pNewHandle);
ENTRY("CSharedMemoryObjectManager::ObtainHandleForObject "
"(this=%p, pthr=%p, pobj=%p, dwRightsRequested=%d, "
"fInheritHandle=%p, pProcessForHandle=%p, pNewHandle=%p)\n",
this,
pthr,
pobj,
dwRightsRequested,
fInheritHandle,
pProcessForHandle,
pNewHandle
);
if (NULL != pProcessForHandle)
{
//
// Not yet supported
//
ASSERT("Caller to ObtainHandleForObject provided a process\n");
return ERROR_CALL_NOT_IMPLEMENTED;
}
palError = m_HandleManager.AllocateHandle(
pthr,
pobj,
dwRightsRequested,
fInheritHandle,
pNewHandle
);
LOGEXIT("CSharedMemoryObjectManager::ObtainHandleForObject return %d\n", palError);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::RevokeHandle
Removes a handle from the process's handle table, which in turn releases
the handle's reference on the object instance it refers to
Parameters:
pthr -- thread data for calling thread
hHandleToRevoke -- the handle to revoke
--*/
PAL_ERROR
CSharedMemoryObjectManager::RevokeHandle(
CPalThread *pthr,
HANDLE hHandleToRevoke
)
{
PAL_ERROR palError = NO_ERROR;
_ASSERTE(NULL != pthr);
ENTRY("CSharedMemoryObjectManager::RevokeHandle "
"(this=%p, pthr=%p, hHandleToRevoke=%p)\n",
this,
pthr,
hHandleToRevoke
);
palError = m_HandleManager.FreeHandle(pthr, hHandleToRevoke);
LOGEXIT("CSharedMemoryObjectManager::RevokeHandle returns %d\n", palError);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::ReferenceObjectByHandle
Returns a referenced object instance that a handle refers to
Parameters:
pthr -- thread data for calling thread
hHandleToReference -- the handle to reference
paot -- acceptable types for the underlying object
dwRightsRequired -- the access rights that the handle must have been
granted; currently ignored
ppobj -- on success, receives a reference to the object instance
--*/
PAL_ERROR
CSharedMemoryObjectManager::ReferenceObjectByHandle(
CPalThread *pthr,
HANDLE hHandleToReference,
CAllowedObjectTypes *paot,
DWORD dwRightsRequired,
IPalObject **ppobj // OUT
)
{
PAL_ERROR palError;
DWORD dwRightsGranted;
IPalObject *pobj;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != paot);
_ASSERTE(NULL != ppobj);
ENTRY("CSharedMemoryObjectManager::ReferenceObjectByHandle "
"(this=%p, pthr=%p, hHandleToReference=%p, paot=%p, "
"dwRightsRequired=%d, ppobj=%p)\n",
this,
pthr,
hHandleToReference,
paot,
dwRightsRequired,
ppobj
);
palError = m_HandleManager.GetObjectFromHandle(
pthr,
hHandleToReference,
&dwRightsGranted,
&pobj
);
if (NO_ERROR == palError)
{
palError = CheckObjectTypeAndRights(
pobj,
paot,
dwRightsGranted,
dwRightsRequired
);
if (NO_ERROR == palError)
{
//
// Transfer object reference to out parameter
//
*ppobj = pobj;
}
else
{
pobj->ReleaseReference(pthr);
}
}
LOGEXIT("CSharedMemoryObjectManager::ReferenceObjectByHandle returns %d\n",
palError
);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::ReferenceObjectByHandleArray
Returns the referenced object instances that an array of handles
refer to.
Parameters:
pthr -- thread data for calling thread
rgHandlesToReference -- the array of handles to reference
dwHandleCount -- the number of handles in the arrayu
paot -- acceptable types for the underlying objects
dwRightsRequired -- the access rights that the handles must have been
granted; currently ignored
rgpobjs -- on success, receives references to the object instances; will
be empty on failures
--*/
PAL_ERROR
CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray(
CPalThread *pthr,
HANDLE rghHandlesToReference[],
DWORD dwHandleCount,
CAllowedObjectTypes *paot,
DWORD dwRightsRequired,
IPalObject *rgpobjs[] // OUT (caller allocated)
)
{
PAL_ERROR palError = NO_ERROR;
IPalObject *pobj = NULL;
DWORD dwRightsGranted;
DWORD dw;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != rghHandlesToReference);
_ASSERTE(0 < dwHandleCount);
_ASSERTE(NULL != paot);
_ASSERTE(NULL != rgpobjs);
ENTRY("CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray "
"(this=%p, pthr=%p, rghHandlesToReference=%p, dwHandleCount=%d, "
"pAllowedTyped=%d, dwRightsRequired=%d, rgpobjs=%p)\n",
this,
pthr,
rghHandlesToReference,
dwHandleCount,
paot,
dwRightsRequired,
rgpobjs
);
m_HandleManager.Lock(pthr);
for (dw = 0; dw < dwHandleCount; dw += 1)
{
palError = m_HandleManager.GetObjectFromHandle(
pthr,
rghHandlesToReference[dw],
&dwRightsGranted,
&pobj
);
if (NO_ERROR == palError)
{
palError = CheckObjectTypeAndRights(
pobj,
paot,
dwRightsGranted,
dwRightsRequired
);
if (NO_ERROR == palError)
{
//
// Transfer reference to out array
//
rgpobjs[dw] = pobj;
pobj = NULL;
}
}
if (NO_ERROR != palError)
{
break;
}
}
//
// The handle manager lock must be released before releasing
// any object references, as ReleaseReference will acquire
// the object manager list lock (which needs to be acquired before
// the handle manager lock)
//
m_HandleManager.Unlock(pthr);
if (NO_ERROR != palError)
{
//
// dw's current value is the failing index, so we want
// to free from dw - 1.
//
while (dw > 0)
{
rgpobjs[--dw]->ReleaseReference(pthr);
}
if (NULL != pobj)
{
pobj->ReleaseReference(pthr);
}
}
LOGEXIT("CSharedMemoryObjectManager::ReferenceMultipleObjectsByHandleArray"
" returns %d\n",
palError
);
return palError;
}
/*++
Function:
CSharedMemoryObjectManager::ReferenceObjectByForeignHandle
Returns a referenced object instance that a handle belongin to
another process refers to; currently unimplemented
Parameters:
pthr -- thread data for calling thread
hForeignHandle -- the handle to reference
pForeignProcess -- the process that hForeignHandle belongs to
paot -- acceptable types for the underlying object
dwRightsRequired -- the access rights that the handle must have been
granted; currently ignored
ppobj -- on success, receives a reference to the object instance
--*/
PAL_ERROR
CSharedMemoryObjectManager::ReferenceObjectByForeignHandle(
CPalThread *pthr,
HANDLE hForeignHandle,
IPalProcess *pForeignProcess,
CAllowedObjectTypes *paot,
DWORD dwRightsRequired,
IPalObject **ppobj // OUT
)
{
//
// Not implemented for basic shared memory object manager --
// requires an IPC channel. (For the shared memory object manager
// PAL_LocalHandleToRemote and PAL_RemoteHandleToLocal must still
// be used...)
//
ASSERT("ReferenceObjectByForeignHandle not yet supported\n");
return ERROR_CALL_NOT_IMPLEMENTED;
}
/*++
Function:
CSharedMemoryObjectManager::ImportSharedObjectIntoProcess
Takes an object's shared memory data and from it creates the
necessary in-process structures for the object
Parameters:
pthr -- thread data for calling thread
pot -- the object's type
poa -- attributes for the object
shmSharedObjectData -- the shared memory pointer for the object's shared
data
psmod -- the shared memory data for the object, mapped into this process's
address space
fAddRefSharedData -- if TRUE, we need to add to the shared data reference
count
ppshmobj -- on success, receives a pointer to the newly created local
object instance
--*/
PAL_ERROR
CSharedMemoryObjectManager::ImportSharedObjectIntoProcess(
CPalThread *pthr,
CObjectType *pot,
CObjectAttributes *poa,
SHMPTR shmSharedObjectData,
SHMObjData *psmod,
bool fAddRefSharedData,
CSharedMemoryObject **ppshmobj
)
{
PAL_ERROR palError = NO_ERROR;
CSharedMemoryObject *pshmobj;
PLIST_ENTRY pleObjectList;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != pot);
_ASSERTE(NULL != poa);
_ASSERTE(SHMNULL != shmSharedObjectData);
_ASSERTE(NULL != psmod);
_ASSERTE(NULL != ppshmobj);
ENTRY("CSharedMemoryObjectManager::ImportSharedObjectIntoProcess(pthr=%p, "
"pot=%p, poa=%p, shmSharedObjectData=%p, psmod=%p, fAddRefSharedData=%d, "
"ppshmobj=%p)\n",
pthr,
pot,
poa,
shmSharedObjectData,
psmod,
fAddRefSharedData,
ppshmobj
);
if (CObjectType::WaitableObject == pot->GetSynchronizationSupport())
{
pshmobj = InternalNew<CSharedMemoryWaitableObject>(pot,
&m_csListLock,
shmSharedObjectData,
psmod,
fAddRefSharedData);
}
else
{
pshmobj = InternalNew<CSharedMemoryObject>(pot,
&m_csListLock,
shmSharedObjectData,
psmod,
fAddRefSharedData);
}
if (NULL != pshmobj)
{
palError = pshmobj->InitializeFromExistingSharedData(pthr, poa);
if (NO_ERROR == palError)
{
if (0 != psmod->dwNameLength)
{
pleObjectList = &m_leNamedObjects;
}
else
{
pleObjectList = &m_leAnonymousObjects;
}
InsertTailList(pleObjectList, pshmobj->GetObjectListLink());
}
else
{
goto ImportSharedObjectIntoProcessExit;
}
}
else
{
ERROR("Unable to alllocate new object\n");
palError = ERROR_OUTOFMEMORY;
goto ImportSharedObjectIntoProcessExit;
}
*ppshmobj = pshmobj;
ImportSharedObjectIntoProcessExit:
LOGEXIT("CSharedMemoryObjectManager::ImportSharedObjectIntoProcess returns %d\n", palError);
return palError;
}
static PalObjectTypeId RemotableObjectTypes[] =
{otiManualResetEvent, otiAutoResetEvent, otiMutex, otiProcess};
static CAllowedObjectTypes aotRemotable PAL_GLOBAL (
RemotableObjectTypes,
sizeof(RemotableObjectTypes) / sizeof(RemotableObjectTypes[0])
);
/*++
Function:
PAL_LocalHandleToRemote
Returns a "remote handle" that may be passed to another process.
Parameters:
hLocal -- the handle to generate a "remote handle" for
--*/
PALIMPORT
RHANDLE
PALAPI
PAL_LocalHandleToRemote(IN HANDLE hLocal)
{
PAL_ERROR palError = NO_ERROR;
CPalThread *pthr;
IPalObject *pobj = NULL;
CSharedMemoryObject *pshmobj;
SHMObjData *psmod = NULL;
RHANDLE hRemote = reinterpret_cast<RHANDLE>(INVALID_HANDLE_VALUE);
PERF_ENTRY(PAL_LocalHandleToRemote);
ENTRY("PAL_LocalHandleToRemote( hLocal=0x%lx )\n", hLocal);
pthr = InternalGetCurrentThread();
if (!HandleIsSpecial(hLocal))
{
palError = g_pObjectManager->ReferenceObjectByHandle(
pthr,
hLocal,
&aotRemotable,
0,
&pobj
);
if (NO_ERROR != palError)
{
goto PAL_LocalHandleToRemoteExitNoLockRelease;
}
}
else if (hPseudoCurrentProcess == hLocal)
{
pobj = g_pobjProcess;
pobj->AddReference();
}
else
{
ASSERT("Invalid special handle type passed to PAL_LocalHandleToRemote\n");
palError = ERROR_INVALID_HANDLE;
goto PAL_LocalHandleToRemoteExitNoLockRelease;
}
pshmobj = static_cast<CSharedMemoryObject*>(pobj);
//
// Make sure that the object is shared
//
palError = pshmobj->EnsureObjectIsShared(pthr);
if (NO_ERROR != palError)
{
ERROR("Failure %d promoting object\n", palError);
goto PAL_LocalHandleToRemoteExitNoLockRelease;
}
SHMLock();
psmod = SHMPTR_TO_TYPED_PTR(SHMObjData, pshmobj->GetShmObjData());
if (NULL != psmod)
{
//
// Bump up the process ref count by 1. The receiving process will not
// increase the ref count when it converts the remote handle to
// local.
//
psmod->lProcessRefCount += 1;
//
// The remote handle is simply the SHMPTR for the SHMObjData
//
hRemote = reinterpret_cast<RHANDLE>(pshmobj->GetShmObjData());
}
else
{
ASSERT("Unable to map shared object data\n");
palError = ERROR_INTERNAL_ERROR;
goto PAL_LocalHandleToRemoteExit;
}
PAL_LocalHandleToRemoteExit:
SHMRelease();
PAL_LocalHandleToRemoteExitNoLockRelease:
if (NULL != pobj)
{
pobj->ReleaseReference(pthr);
}
if (NO_ERROR != palError)
{
pthr->SetLastError(palError);
}
LOGEXIT("PAL_LocalHandleToRemote returns RHANDLE 0x%lx\n", hRemote);
PERF_EXIT(PAL_LocalHandleToRemote);
return hRemote;
}
/*++
Function:
CSharedMemoryObjectManager::ConvertRemoteHandleToLocal
Given a "remote handle" creates a local handle that refers
to the desired object. (Unlike PAL_RemoteHandleToLocal this method
needs to access internal object manager state, so it's a member function.)
Parameters:
pthr -- thread data for calling thread
rhRemote -- the remote handle
phLocal -- on success, receives the local handle
--*/
PAL_ERROR
CSharedMemoryObjectManager::ConvertRemoteHandleToLocal(
CPalThread *pthr,
RHANDLE rhRemote,
HANDLE *phLocal
)
{
PAL_ERROR palError = NO_ERROR;
SHMObjData *psmod;
CSharedMemoryObject *pshmobj = NULL;
PLIST_ENTRY pleObjectList;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != phLocal);
ENTRY("CSharedMemoryObjectManager::ConvertRemoteHandleToLocal "
"(this=%p, pthr=%p, rhRemote=%p, phLocal=%p)\n",
this,
pthr,
rhRemote,
phLocal
);
if (rhRemote == NULL || rhRemote == INVALID_HANDLE_VALUE)
{
palError = ERROR_INVALID_HANDLE;
goto ConvertRemoteHandleToLocalExitNoLockRelease;
}
InternalEnterCriticalSection(pthr, &m_csListLock);
SHMLock();
//
// The remote handle is really a shared memory pointer to the
// SHMObjData for the object.
//
psmod = SHMPTR_TO_TYPED_PTR(SHMObjData, reinterpret_cast<SHMPTR>(rhRemote));
if (NULL == psmod)
{
ERROR("Invalid remote handle\n");
palError = ERROR_INVALID_HANDLE;
goto ConvertRemoteHandleToLocalExit;
}
//
// Check to see if a local reference for this object already
// exists
//
if (0 != psmod->dwNameLength)
{
pleObjectList = &m_leNamedObjects;
}
else
{
pleObjectList = &m_leAnonymousObjects;
}
for (PLIST_ENTRY ple = pleObjectList->Flink;
ple != pleObjectList;
ple = ple->Flink)
{
pshmobj = CSharedMemoryObject::GetObjectFromListLink(ple);
if (SharedObject == pshmobj->GetObjectDomain()
&& reinterpret_cast<SHMPTR>(rhRemote) == pshmobj->GetShmObjData())
{
TRACE("Object for remote handle already present in this process\n");
//
// PAL_LocalHandleToRemote bumped up the process refcount on the
// object. Since this process already had a reference to the object
// we need to decrement that reference now...
//
psmod->lProcessRefCount -= 1;
_ASSERTE(0 < psmod->lProcessRefCount);
//
// We also need to add a reference to the object (since ReleaseReference
// gets called below)
//
pshmobj->AddReference();
break;
}
pshmobj = NULL;
}
if (NULL == pshmobj)
{
CObjectType *pot;
CObjectAttributes oa;
//
// Get the local instance of the CObjectType
//
pot = CObjectType::GetObjectTypeById(psmod->eTypeId);
if (NULL == pot)
{
ASSERT("Invalid object type ID in shared memory info\n");
goto ConvertRemoteHandleToLocalExit;
}
//
// Create the local state for the shared object
//
palError = ImportSharedObjectIntoProcess(
pthr,
pot,
&oa,
reinterpret_cast<SHMPTR>(rhRemote),
psmod,
FALSE,
&pshmobj
);
if (NO_ERROR != palError)
{
goto ConvertRemoteHandleToLocalExit;
}
}
//
// Finally, allocate a local handle for the object
//
palError = ObtainHandleForObject(
pthr,
pshmobj,
0,
FALSE,
NULL,
phLocal
);
ConvertRemoteHandleToLocalExit:
SHMRelease();
InternalLeaveCriticalSection(pthr, &m_csListLock);
ConvertRemoteHandleToLocalExitNoLockRelease:
if (NULL != pshmobj)
{
pshmobj->ReleaseReference(pthr);
}
LOGEXIT("CSharedMemoryObjectManager::ConvertRemoteHandleToLocal returns %d\n", palError);
return palError;
}
/*++
Function:
PAL_RemoteHandleToLocal
Given a "remote handle", return a local handle that refers to the
specified process. Calls
SharedMemoryObjectManager::ConvertRemoteHandleToLocal to do the actual
work
Parameters:
rhRemote -- the "remote handle" to convert to a local handle
--*/
PALIMPORT
HANDLE
PALAPI
PAL_RemoteHandleToLocal(IN RHANDLE rhRemote)
{
PAL_ERROR palError = NO_ERROR;
CPalThread *pthr;
HANDLE hLocal = INVALID_HANDLE_VALUE;
PERF_ENTRY(PAL_RemoteHandleToLocal);
ENTRY("PAL_RemoteHandleToLocal( hRemote=0x%lx )\n", rhRemote);
pthr = InternalGetCurrentThread();
palError = static_cast<CSharedMemoryObjectManager*>(g_pObjectManager)->ConvertRemoteHandleToLocal(
pthr,
rhRemote,
&hLocal
);
if (NO_ERROR != palError)
{
pthr->SetLastError(palError);
}
LOGEXIT("PAL_RemoteHandleToLocal returns HANDLE 0x%lx\n", hLocal);
PERF_EXIT(PAL_RemoteHandleToLocal);
return hLocal;
}
/*++
Function:
CheckObjectTypeAndRights
Helper routine that determines if:
1) An object instance is of a specified type
2) A set of granted access rights satisfies the required access rights
(currently ignored)
Parameters:
pobj -- the object instance whose type is to be checked
paot -- the acceptable type for the object instance
dwRightsGranted -- the granted access rights (ignored)
dwRightsRequired -- the required access rights (ignored)
--*/
static
PAL_ERROR
CheckObjectTypeAndRights(
IPalObject *pobj,
CAllowedObjectTypes *paot,
DWORD dwRightsGranted,
DWORD dwRightsRequired
)
{
PAL_ERROR palError = NO_ERROR;
_ASSERTE(NULL != pobj);
_ASSERTE(NULL != paot);
ENTRY("CheckObjectTypeAndRights (pobj=%p, paot=%p, "
"dwRightsGranted=%d, dwRightsRequired=%d)\n",
pobj,
paot,
dwRightsGranted,
dwRightsRequired
);
if (paot->IsTypeAllowed(pobj->GetObjectType()->GetId()))
{
#ifdef ENFORCE_OBJECT_ACCESS_RIGHTS
//
// This is where the access right check would occur if Win32 object
// security were supported.
//
if ((dwRightsRequired & dwRightsGranted) != dwRightsRequired)
{
palError = ERROR_ACCESS_DENIED;
}
#endif
}
else
{
palError = ERROR_INVALID_HANDLE;
}
LOGEXIT("CheckObjectTypeAndRights returns %d\n", palError);
return palError;
}
|
WASHINGTON (Reuters) - U.S Ambassador to the United Nations Nikki Haley exits President Donald Trump’s cabinet as the most high-profile female member, potentially putting her back into play as a candidate for a Republican Party struggling with women voters.
In her out-of-the-blue announcement on Tuesday, Haley, 46, pointedly tried to shut down talk that she would run for any office in 2020, including challenging Trump in his re-election bid.
But that hardly stopped Washington from playing a new round in its favourite parlour game: Who’s running for what? President, vice president and U.S. senator were all on the table.
Those who know Haley from her days as a popular governor of South Carolina believe she is in an enviable position.
“What she’s done as U.N, ambassador has not only raised her own profile, which was already high, but she also raised the profile of the job and she’s left some big shoes to fill,” said Rob Godfrey, a former political aide in South Carolina.
Haley has received high marks for her U.N. job performance. An April poll by Quinnipiac University found that 63 percent of voters approved of Haley, including 55 percent of Democrats.
Haley was vague about her reasons for quitting, citing a desire to take some time off. In her resignation letter, Haley referred to returning to the private sector.
Few people who have watched her over the years see her leaving the public arena for long.
“The most likely explanation is she wants to put some daylight between herself and Trump in advance of running for president,” said Jordan Ragusa, a political science professor at the College of Charleston in South Carolina.
Haley, who had scant experience in diplomacy before taking the U.N. job, now emerges as a dream candidate, one who figured out how to work with the voluble Trump without upstaging him, but would also buck her boss on issues that mattered to her.
She applauded women who come forward with accusations of sexual misconduct by men and said they should be heard, even if they were accusing Trump. She took a tougher stance than her boss on Russia. And in the wake violent protest by white nationalists in Charlottesville, Virginia, she called on her staff to oppose hate, a position viewed as a contrast to Trump’s response.
Haley’s departure also stoked speculation she could replace Lindsey Graham as the senator from South Carolina, a possibility that Trump played down. Talk in Washington is that should Trump replace Attorney General Jeff Sessions with Graham after the Nov. 6 congressional elections, South Carolina Governor Henry McMaster would be responsible for selecting a replacement to serve until the 2020 election. McMaster was previously Haley’s No. 2 in the state.
Despite the fine line Haley walked with Trump, speculation quickly swirled in Washington that Trump could drop Vice President Mike Pence as his 2020 running mate and choose Haley instead.
“Ambassador Haley has much political life ahead of her and perhaps as vice president and beyond,” said Karen Floyd, a former Republican Party chairwoman in South Carolina.
Trump suffers from a massive gender gap in his approval - a large majority of women disapprove of his job in office and Haley could be added in an effort to win over more women voters.
“I could certainly see a myriad of ways in which she could strengthen the ticket,” said Claire Wofford, a political science professor at College of Charleston in South Carolina.
But Republican strategist Rick Tyler called the idea of Haley replacing Pence “far fetched.” Tyler said her future is wide open but doubted she would rejoin the administration.
Even Russian U.N. Ambassador Vassily Nebenzia, with whom Haley often sparred, said she would resurface in politics.
“She’s young, she’s energetic, she’s ambitious. I think that we will see her after she has this well-deserved respite that she was referring to,” Nebenzia said. |
Even though the 2015 12-inch MacBook Air with Retina is yet to be announced, we already have a good idea what its first accessory will be, and that is the SanDisk USB Type C connector. This is known as the next-generation USB plug and should be fully supported by Apple’s next notebook.
SanDisk still does not know when Apple will release its new MacBook Air, or if it will offer support of the new USB standard, but it’s pretty obvious that it will, and so SanDisk needs to be prepared.
The release date for the 32GB SanDisk Dual USB Drive with Type C Connector is expected to be in the second quarter, so perfect timing for Apple’s next MacBook Air.
We suspect some people will get the USB Type C connector confused with the Lighting connector because it is of a smaller design. However, they are completely different, with the C connector being built by Intel — better late than never Intel.
As for the release date for the 12-inch MacBook Air, we should learn details of this on March 9th, as Apple has sent out invitations for a special event. We already know for certain that it will be geared more towards the Apple Watch, but we also expect to see the new MacBook Air as well, and no doubt not long after the third-party accessories should start to appear, such as cases, bags etc. |
The present invention relates to a variable triangular failure warning light for the third braking light provided in the rear turbulence plate of an automobile, in particular, to an "LED" (light emitted diode) third braking light device which is provided in the rear turbulence plate of an automobile which can be pulled out and folded into a triangular warning light for indicating failure of the vehicle.
Since a third braking light of an automobile can warn the other automobiles behind when braking, and the numbers of automobiles in recent years has increased and all the roads and freeways are crowded, the third braking lights have become a popular device for driving more safely, and also have become standard equipment for most automobile.
Further, a triangular warning sign of reflection type which can be put on the road behind the automobile which has a failure, is usually kept in rear trunk of an automobile. Hence, when an automobile has a failure, the driver must first park the failed automobile in a proper position, and then take the triangular warning sign from the rear trunk of the automobile, and put it on the road behind the automobile at a proper distance to warn the other automobiles behind.
The third braking lights have become necessary equipment for an automobile, while the conventional triangular failure warning signs are not convenient in use and have many disadvantages: for example, A: the sign is not easy to be seen by the drivers of the automobiles behind the failure automobile due to the fact that the triangular failed warning sign is placed low on the ground; B: the warning effect of the conventional triangular failure warning sign is poor since said sign is of a reflection type; C: when using the conventional warning sign, the driver must open the rear trunk and then take out the warning sign and fold it into triangular shape, walk a distance to put it on the ground behind the automobile, and after the use of the sign is ended, the driver must return the warning sign to the rear trunk, which will affect the willingness of the driver to use the conventional triangular sign. Hence, it is necessary to improve the conventional triangular failure sign.
The aforesaid disadvantages can be avoided by this invention. It is found that the conventional triangular failure sign is requested to be put at a distance behind the failed automobile, which is because the triangular warning sign can not be easily seen by the drivers of automobiles far away from the failed automobile; therefore it is necessary to increase the distance between the automobile and the sign, also because of the poor warning effect of the conventional warning sign of reflection type, the distance between the automobile and the sign must be increased and thus the driver must walk back and forth to put and return the warning sign, which is very troublesome and inconvenient. Hence, if height of the warning sign (i.e., being put high above the ground) and the brightness of the sign can be improved, the aforesaid disadvantages can be overcome. |
// File include/oglplus/enums/blend_equation.hpp
//
// Automatically generated file, DO NOT modify manually.
// Edit the source 'source/enums/oglplus/blend_equation.txt'
// or the 'source/enums/make_enum.py' script instead.
//
// Copyright 2010-2017 <NAME>.
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <oglplus/enumerations.hpp>
namespace oglplus {
/// Enumeration BlendEquation
/**
* @ingroup oglplus_enumerations
*/
OGLPLUS_ENUM_CLASS_BEGIN(BlendEquation, GLenum)
#include <oglplus/enums/blend_equation.ipp>
OGLPLUS_ENUM_CLASS_END(BlendEquation)
#if !OGLPLUS_NO_ENUM_VALUE_NAMES
#include <oglplus/enums/blend_equation_names.ipp>
#endif
#if !OGLPLUS_NO_ENUM_VALUE_RANGES
#include <oglplus/enums/blend_equation_range.ipp>
#endif
} // namespace oglplus
|
Hip hop pioneer DJ Afrika Bambaataa has been appointed to a three-year term as a visiting scholar at Cornell University.
The appointment announced Tuesday was made by Cornell University Library's Hip Hop Collection in conjunction with the Ivy League school's music department.
Bambaataa will visit Cornell's upstate New York campus several days each year to talk to classes, meet with student and community groups, and perform the music he helped create and expand. His first visit will be in November.
Cornell officials say the university's library contains the largest national archive on hip hop culture, documenting its birth and growth by preserving thousands of recordings, fliers, photographs and other artifacts. |
<reponame>mfkiwl/embox
/*
* @file
*
* @date 12.12.12
* @author <NAME>
*/
#ifndef ALLOCA_H_
#define ALLOCA_H_
#include <stddef.h> /* size_t in standard library */
#include <sys/cdefs.h>
__BEGIN_DECLS
#ifndef __ASSEMBLER__
extern void * alloca(size_t size);
#endif /* __ASSEMBLER__ */
#ifdef __GNUC__
# define alloca(size) __builtin_alloca (size)
#endif /* GCC. */
__END_DECLS
#endif /* ALLOCA_H_ */
|
<reponame>f4str/neural-networks-sandbox
from .elasticnet_regression import ElasticNetRegression
from .lasso_regression import LassoRegression
from .linear_regression import LinearRegression
from .logistic_regression import LogisticRegression
from .ridge_regression import RidgeRegression
__all__ = [
'ElasticNetRegression',
'LassoRegression',
'LinearRegression',
'LogisticRegression',
'RidgeRegression',
]
|
Violinist Caroline Campbell will perform in the 7-piece ensemble.
S ometimes composers save the best for last.
That’s the guiding principle behind the Winter-Mezzo concert series, which focuses on the final major works of music legends such as Franz Schubert and Anton Bruckner.
“It’s a really eclectic group of pieces,” said Curtis Pendleton, executive director of Festival Mozaic. And it’s just a taste of things to come, she added.
The festival, which officially kicks off its 40th anniversary this weekend, culminates this summer with a highly anticipated slate of concerts, lectures, guest appearances and get-togethers. First, however, there’s Winter-Mezzo.
Kacey Musgraves visited the Madonna Inn in San Luis Obispo, California, in between sets at the Coachella music festival in Indio. The Grammy Award winning country singer documented her visit on Instagram. |
package rocks.cleanstone.endpoint.minecraft.vanilla.legacy.v1_12_2.net.protocol.outbound;
import io.netty.buffer.ByteBuf;
import rocks.cleanstone.endpoint.minecraft.vanilla.net.packet.outbound.AnimationPacket;
import rocks.cleanstone.net.protocol.Codec;
import rocks.cleanstone.net.protocol.OutboundPacketCodec;
import rocks.cleanstone.net.utils.ByteBufUtils;
@Codec
public class OutAnimationCodec implements OutboundPacketCodec<AnimationPacket> {
@Override
public ByteBuf encode(ByteBuf byteBuf, AnimationPacket packet) {
ByteBufUtils.writeVarInt(byteBuf, packet.getEntityID());
byteBuf.writeByte(packet.getAnimation().getAnimationID());
return byteBuf;
}
}
|
Novel scheme for secure data transmission based on mesoscopic twin beams and photon-number-resolving detectors Quantum resources can improve the quality and security of data transmission. A novel communication protocol based on the use of mesoscopic twin-beam (TWB) states of light is proposed and discussed. The message sent by Alice to Bob is encoded in binary single-mode thermal states having two possible mean values, both smaller than the mean value of the TWB. Such thermal states are alternately superimposed to the portion of TWB sent to Bob. We demonstrate that in the presence of an eavesdropping attack that intercepts and substitutes part of the signal with a thermal noise, Bob can still successfully decrypt the message by evaluating the noise reduction factor for detected photons. The protocol opens new perspectives in the exploitation of quantum states of light for applications to Quantum Communication. www.nature.com/scientificreports/ "Discussion" section is devoted to the possible eavesdropper's attacks and to the strategy used to reveal them. Finally, in the "Conclusions" we summarize our results and outline some future perspectives. Results The protocol step-by-step. As already anticipated in the "Introduction", Alice produces mesoscopic TWB states. We assume that such states are described as the tensor product of identical (i.e. equally populated) TWB states where 2 = �n k �/(1 + �n k �) and n k is the mean number of photons in the k-th mode 17,18. The multi-mode TWB is described by the following density matrix where |n� = (n − k=1 n k ) k=1 |n k � k and n is the overall number of photons in the spatio-spectral modes that impinge on the detector, while P (n) is the multi-mode thermal distribution in which n is the mean number of photons in each arm. These states are entangled in the number of photons. To prove it, many nonclassicality criteria have been proposed during the past twenty years. Some of them are necessary and sufficient, some are only sufficient, and some others only necessary 23. In this work, we consider a nonclassicality criterion based on the noise reduction factor 24, since it can be easily accessed from the experimental point of view 25. We define the noise reduction factor as 26 where 2 (n 1 − n 2 ) is the variance of the distribution of the photon-number difference between the two parties, while �n 1 � + �n 2 � is the shot-noise-level, that is the variance of the distribution of the photon-number difference in the case of two coherent states having mean values n 1 and n 2. It can be demonstrated that the condition R < 1, meaning that signal and idler arms exhibit sub-shot-noise correlations, represents a sufficient condition for entanglement 23,24. We have already shown that R can be also written in terms of measurable quantities, such as detected photons 17, so that the nonclassicality condition can be directly applied to the experimental data In particular, for a multi-mode TWB state, �m 1 m 2 � = (1 + 1/)�m 1 ��m 2 � + √ 1 2 √ �m 1 ��m 2 �, so that the noise reduction factor can be expressed as j being the quantum efficiencies of the detectors and �m j � = j �n j � the mean values of detected photons. The equation can be further simplified by assuming �m 1 � = �m� = �n�, �m 2 � = t�m� = t�n�, t ∈ being the transmission efficiency quantifying the balancing level Now, let us assume that Alice encodes a binary message in the portion of multi-mode TWB sent to Bob by adding a small noise signal. This is given by a single-mode thermal state with two possible mean values: the higher mean value m H corresponds to the logic bit 1, while the lower mean value m L to the logic bit 0. We can assume that m H is 3 or 4 times m L, and that they represent the 20% or the 7 % of the global light, respectively. As better remarked in the following, we choose to encode the message in a single-mode thermal state because the expression of R is particularly sensitive to the presence of added thermal noise 16. The presence of this noise source modifies the statistics of light, which becomes the convolution between the multi-mode thermal distribution of the TWB and the single-mode thermal state with TH = 1 of the additional noise √ P(m)P theo (m), where P(m) and P theo (m) are the experimental and theoretical distributions, respectively, and the sum is extended up to the maximum detected-photon number, m, above which the two distributions become negligible. This demonstrates that it is really hard to discriminate the presence or not of an additional thermal noise. Nevertheless, by comparing the statistics shown in the two panels, we notice that having access to the statistics of light could be sufficient to discriminate which signal was sent. However, this operation requires a proper data sample. If the sequence is too short, the reconstructed statistics is not reliable. Moreover, in the case of an eavesdropping attack, in which part of the sent signal is intercepted and additional noise is added, the reconstruction of the statistics can no longer be used to discriminate which light signal has been sent. On the contrary, evaluating the level of nonclassicality can help since both loss and noise sources can be incorporated in the model for the noise reduction factor and extracted from the fit of the measured value of R. In particular, in the case of an ideal transmission channel, in which the signal is encoded in a single-mode thermal state with TH = 1 superimposed to the portion of TWB, the expression in Eq. modifies as where t quantifies the balancing between signal and idler arms. According to this expression, the condition R < 1 is satisfied only if the mean value of the single-mode thermal noise is properly limited, namely In the communication protocol, the two mean values of the thermal noise are chosen so that in both cases the nonclassicality condition is satisfied. The value of the bit of information can be extracted from the noise reduction factor, which is much more sensitive than the statistics, as better shown in the next Sections. In the case of an eavesdropper's attack, the expression of R is modified. Indeed, in order to intercept the message, Eve can pick up part of the signal transmitted to Bob and thus evaluate the nonclassicality level as In the meanwhile, Bob will measure To cover the effect of the attack, Eve superimposes to the light signal sent to Bob a thermal noise having the same mean value of the subtracted light, namely t(�m� + �m TH �). Thus, Bob measures www.nature.com/scientificreports/ Note that the successful implementation of the protocol relies on the value of t, which quantifies the amount of signal subtracted to Bob. If this value is small enough, Bob can still reveal sub-shot-noise correlations and also estimate the binary message encoded in the thermal noise by Alice, while Eve is not able to obtain enough information from the data, neither by evaluating the statistics nor by comparing the noise reduction factor. In addition, measured values of R larger than 1 must be interpreted as the result of an Eve's attack, thus suggesting the interruption of the communication. We also notice that Bob can use a portion of the dataset to extract the value of t by performing a fitting procedure according to Eq.. This allows him to understand if an eavesdropper's attack has occurred. A realistic example. As described in the previous Section, to perform the protocol, Alice sends to Bob the message encrypted in the thermal noise superimposed to Bob's TWB part, repeated in short sequences. The length of the sequences represents an important parameter to control. In fact, if the sequence is long enough, the message can be decoded by simply recontructing the statistics of light, so that the strategy would not be safe since an eavesdropper could intercept the communication and also modify it. To better emphasize this point, in the four panels of Fig. 2 we show the photon-number distributions of the light states given by a portion of TWB superimposed to a single-mode thermal state. The red surface corresponds to the thermal state with higher mean value, while the blue surface to the thermal state with lower mean value. In panel (a) the reconstruction has been obtained from 100 shots, in panel (b) from 1000 shots, in panel (c) from 10,000 shots, and in panel (d) from 100,000 shots. As it can be easily noticed, the mean value of the distributions changes according to the number of shots. In particular, in case (a) its evaluation is completely wrong since m H < m L, and the reconstructed distribution of detected photons is not correct. To better investigate the minimum number of data needed to properly discriminate the states, in Fig. 3 we show their mean values as a function of the number of shots. It clearly emerges that the determination of the mean value is noisy only for a number of pulses less than 1000, while, for larger values, the discrimination between the two thermal-noise values is easy. The same conclusion can be obtained by evaluating the difference between the mean value of the state calculated over N shots and that corresponding to 100,000 shots. In Fig. 4 the data corresponding to the higher mean value are shown in black, and those corresponding to the lower mean value are in red. Also this representation proves that sequences shorter than 1000 pulses do not allow for a perfect To decript the message encoded in the two single-mode thermal states, Bob measures the shot-by-shot number of photons and evaluates the noise reduction factor using Alice's measurements of her part of the TWB, which he must receive separately. Indeed, the calculation of the noise reduction factor makes it possible to distinguish between the two signals even if an eavesdropper intercepts the message and introduces a noise source with the same mean value as the subtracted signal. On the contrary, in that case the mean value is useless to decrypt the message. Also in the case or R, it is crucial to investigate which is the minimum number of shots necessary to properly discriminate the two signals. To this aim, in Fig. 5 we plot the variance of R as a function of the number of pulses, N. The data are shown as dots, while the fitting function y = a/x, a being a positive constant, is shown as magenta curve. The two panels correspond to the different mean values of the employed optical states. The two www.nature.com/scientificreports/ curves allow us to set a threshold on the minimum number of shots necessary to decrypt the message. The same result can be achieved by considering the noise reduction factor for the two states as a function of the number of shots (see Fig. 6). We can clearly see that for values of N smaller than 1000 the error in the determination of R is comparable to the difference between the mean values of the two thermal noise signals. These results prove that, in the absence of attacks, using either the mean value or the noise reduction factor is a good strategy to discriminate which signal has been sent. Discussion According to the model presented in the previous Section, here we consider the case in which the sequence of data is intercepted by Eve. In this situation, part of the signal is subtracted by the eavesdropper, thus introducing a loss, and at the same time a new signal is inserted in the communication channel. This new signal, whose mean value is equal to that of the subtracted amount, can be either a thermal signal or a coherent one. For instance, let us assume that it is a single-mode thermal state. We consider a TWB state having mean value equal to �m� = 2 and = 100 and two single-mode thermal states encoding the message with mean values �m H � = 0.3 and �m H � = 0.1, respectively. In Fig. 7 we show the theoretical behavior of the noise reduction factor measured by Bob as a function of the transmittance coefficient of the signal subtracted by Eve. We notice that for Bob it is always possible to discriminate the two states (black and red curves) with the difference between them becoming larger at increasing values of t. However, it is important to remark that non all values of t are fine for a successfull communication since for t > t * = 0.31 the values of R are larger than 1. For completeness, in Fig. 8 we also show Eve's counterpart. The main difference is that Eve is not able to properly discriminate the two signals if the transmission coefficient is too small. We compare the results obtained by Bob and Eve in the same graph to better appreciate Bob's advantage with respect to Eve in the discrimination process. The direct comparison is shown in Fig. 9, where the relative difference between the noise reduction factor in the two cases is evaluated for three different choices of mean values. Note that also in this case the results are shown as a function of the transmittance coefficient of the signal subtracted by Eve over the entire range. However, for a secure communication we must focus on the values of t smaller than t *. Moreover, we can clearly notice that in all cases Bob can discriminate the two signal better than Eve and that the larger the difference between the two mean values the easier the discrimination. Keeping this difference small is also useful to decrease the message leakage rate. This is particularly evident in the region Figure 6. Noise reduction factor as a function of the number of shots in the case of the higher mean value (black dots) and of the lower mean value (red dots). Figure 7. Noise reduction factor measured by Bob as a function of the transmittance efficiency t in the case of the higher mean value (black curve) and of the lower mean value (red curve). The quantum efficiency is set equal to 0.2, which is the typical value obtained with HPDs. The horizontal gray line at R = 1 represents the boundary between classical and nonclassical correlations. The vertical line corresponds to t = t *, that is the threshold value over which Bob measures R > 1. Conclusions In this paper, we developed a novel protocol based on mesoscopic TWB states in order to send a binary message encoded in two single-mode thermal states with different mean values. Such thermal states are alternately superimposed to the portion of TWB generated by Alice and sent to Bob. While in the ideal case, namely in the absence of an eavesdropper's attack, the state actually sent can be easily retrieved from the measurement of the mean value or from the reconstruction of the photon-number distribution, the situation is more complex in the presence of loss and noise in the communication channel. In the considered case, Eve subtracts part of the signal and substitutes it with a thermal noise source having the same mean value as that of the subtracted light. Under this condition, the evaluation of the mean value is useless, while the calculation of the noise reduction factor for detected photons can be used to decode the message, since it gives the possibility to extract information about the signals superimposed to TWB. In the work we have also discussed the minimum length the sequence of thermal state signal with a given mean value should have in order to allow a successful discrimination process. The proof of principle shown in the paper was obtained with HPD detectors, but for the practical implementation of the protocol we intend to use a different class of photon-number-resolving detectors, namely Silicon photomultipliers 27,28. Indeed, such detectors have a very good dynamic range suitable to employ more populated states and to make the difference between the TWB and the thermal state signals larger. In such a way, we can preserve nonclassicality for larger values of the transmission efficiency with which Eve subtracts part of the signal, and we can make the state discrimination operated by Bob more successful. Moreover, it could be also useful to investigate the possibility to exploit different nonclassicality criteria that could be more sensitive to loss, such as that based on the second-order field photon-number moments 21,22,29. Methods In order to investigate the feasibility of the protocol, we consider a multi-mode TWB state produced by parametric downconversion in a -Barium-Borate crystal pumped by the fourth harmonics of a Nd:YLF laser regeneratively amplified at 500 Hz. Two portions at frequency degeneracy (523 nm) are spatially and spectrally selected, focused into two multi-mode fibers having 600- m core diameter and delivered to two hybrid photodetectors. A single-mode thermal state is produced by sending the second harmonics of the laser to a rotating ground glass disk and selecting a single speckle. A half wave-plate followed by a polarizing cube beam splitter placed on the pathway is used to change the energy of the thermal state and switch from one mean value to the other. The thermal field is superimposed to one portion of TWB and detected together with it. The two detector outputs are amplified, synchronously integrated by two boxcar-gated integrators and acquired. The energy of the pump field is changed in steps by means of a half-wave plate followed by a polarizing cube beam splitter. For each mean value of the pump, 100,000 acquisitions are recorded. By exploiting the self-consistent method extensively explained in 30, each output of the detection chain, expressed in voltages, can be converted in number of detected photons. The strategy allows us to reconstruct the statistics of light and to calculate all the relevant quantities to characterize the optical states. Data availability The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request. |
<gh_stars>1-10
/*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 14, 2021 at 2:32:53 PM Mountain Standard Time
* Operating System: Version 14.4 (Build 18K802)
* Image Source: /System/Library/PrivateFrameworks/AVFCore.framework/AVFCore
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. Updated by <NAME>.
*/
#import <AVFCore/AVAssetWriterHelper.h>
@class NSArray, NSOperation;
@interface AVAssetWriterFinishWritingHelper : AVAssetWriterHelper {
NSArray* _finishWritingOperations;
NSOperation* _transitionToTerminalStatusOperation;
}
@property (nonatomic,readonly) NSOperation * transitionToTerminalStatusOperation; //@synthesize transitionToTerminalStatusOperation=_transitionToTerminalStatusOperation - In the implementation block
-(void)dealloc;
-(long long)status;
-(void)cancelWriting;
-(id)initWithConfigurationState:(id)arg1 finishWritingOperations:(id)arg2 ;
-(NSOperation *)transitionToTerminalStatusOperation;
-(void)_finishWritingOperationsDidFinish;
@end
|
#pragma once
#include "..\DxHelpres\DxHelpers.h"
#include "..\Shaders\QuadStripFltIndexVs.h"
#include "..\Shaders\Yuv420pToRgbaPS.h"
#include "..\Shaders\ColorPS.h"
#include "..\Shaders\Tex1PS.h"
#include <memory>
#include <libhelpers\Thread\critical_section.h>
class ShaderFactory {
public:
class VS {
public:
const std::shared_ptr<QuadStripFltIndexVs> &GetQuadStripFltIndexVs(ID3D11Device *dev);
private:
thread::critical_section cs;
std::shared_ptr<QuadStripFltIndexVs> quadStripFltIndexVs;
} VS;
class PS {
public:
const std::shared_ptr<Yuv420pToRgbaPS> &GetYuv420pToRgbaPS(ID3D11Device *dev);
const std::shared_ptr<ColorPS> &GetColorPS(ID3D11Device *dev);
const std::shared_ptr<Tex1PS> &GetTex1PS(ID3D11Device *dev);
private:
thread::critical_section cs;
std::shared_ptr<Yuv420pToRgbaPS> yuv420pToRgbaPS;
std::shared_ptr<ColorPS> colorPS;
std::shared_ptr<Tex1PS> tex1PS;
} PS;
}; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.