content
stringlengths 7
2.61M
|
---|
<filename>src/entity/Record.java
package entity;
/**
* Record entity. @author MyEclipse Persistence Tools
*/
public class Record implements java.io.Serializable {
// Fields
private Integer rid;
private String uid;
private String search;
// Constructors
/** default constructor */
public Record() {
}
/** full constructor */
public Record(String uid, String search) {
this.uid = uid;
this.search = search;
}
// Property accessors
public Integer getRid() {
return this.rid;
}
public void setRid(Integer rid) {
this.rid = rid;
}
public String getUid() {
return this.uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getSearch() {
return this.search;
}
public void setSearch(String search) {
this.search = search;
}
} |
Gibraltar Rock (Western Australia)
Location
Gibraltar Rock is 355 kilometres (221 mi) south of Perth, Western Australia. The rock is located in the Porongorups Range, which has thirteen total named peaks including Twin Peaks, The Devils Slide, Nancy Peak, Castle Rock, and Elephant Rock. From the peak of the rock, Albany and the Great Southern Ocean can be seen. Road access to the rock is from Bolganup Road and Scenic Drive.
Features
Gibraltar Rock is 2,100 feet (640 m) tall, and is part of a range that sits at 660 metres (2,170 ft) high. The rock is made of rough granite. Its appearance has been compared to the Rock of Gibraltar.
In the early 1990s, the Rock was yielding small amounts of gold to the "dollying" process. It shares characteristics with other terrain in the area which was successfully mined in the late 1800s. The lack of water in the area made more successful mining of the rock difficult in the early part of the twentieth century. As of 1962, the average annual rainfall in the area was roughly 32 inches (810 mm) per year.
Gibraltar Rock has been described as "an enormous hunk of rough granite that provides the longest and most serious slab climbing in WA". The first organised climb by the Climbers Association of Western Australia was done in 1974. One of the faces of the rock is called Dockyard Wall. It was originally graded 17 crux climb. Two climbing bolts were added to this route in 1992. Other routes up the mountain include Second Anniversary Waltz, Crime of Passion, Dinosaur, Apes Den, Illusions of Grandeur, Possum, Apesway, Main Street, Sucked in Ben, Moorish Steps, Europa Point, Rooster Carnage, Joint Venture, and Zeppelin.
Background
In 1928, an exhibition of the watercolor works of C. S. Bardwell Clarke was held at the artist's studio, Sheffield House, Perth. The exhibition included a work featuring Gibraltar Rock. A winery is named after the rock. |
// NewDestinationRuleManager create DestinationRuleManager by kube clientset and namespace
func NewDestinationRuleManager(si cache.SharedIndexInformer) (*DestinationRuleManager, error) {
events := make(chan watch.Event, config.Config.Buffer.DestinationRuleEvent)
rh := NewCommonResourceEventHandler(events)
si.AddEventHandler(rh)
return &DestinationRuleManager{events: events}, nil
} |
/**
* This example shows how to generate an ontology containing some inferred
* information.
*
* @throws Exception exception
*/
@Test
public void shouldCreateInferredAxioms() throws Exception {
OWLReasonerFactory reasonerFactory = new StructuralReasonerFactory();
OWLOntologyManager man = TestBase.createOWLManager();
OWLOntology ont = load(man);
OWLReasoner reasoner = reasonerFactory.createNonBufferingReasoner(ont);
reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
List<InferredAxiomGenerator<? extends OWLAxiom>> gens = new ArrayList<InferredAxiomGenerator<? extends OWLAxiom>>();
gens.add(new InferredSubClassAxiomGenerator());
OWLOntology infOnt = man.createOntology();
InferredOntologyGenerator iog = new InferredOntologyGenerator(reasoner, gens);
iog.fillOntology(man.getOWLDataFactory(), infOnt);
man.saveOntology(infOnt, new StringDocumentTarget());
} |
package ua.com.sipsoft.ui.security;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import ua.com.sipsoft.service.security.jwt.JwtTokenProvider;
import ua.com.sipsoft.ui.common.CookieUtils;
import ua.com.sipsoft.util.AppProperties;
/**
* The class AuthenticationSuccessHandler that controls the overall process in
* case of successful OAuth authentication.
*
* @author <NAME>
*/
@Component
@Slf4j
@RequiredArgsConstructor
public class CustomAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
private final JwtTokenProvider jwtTokenProvider;
private final AppProperties appProperties;
/**
* On authentication success.
*
* @param {@link HttpServletRequest} the request
* @param {@link HttpServletResponse} the response
* @param {@link Authentication} the authentication
* @throws {@link IOException} Signals that an I/O exception has occurred.
* @throws {@link ServletException} the servlet exception
*/
@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) throws IOException, ServletException {
log.debug("IN onAuthenticationSuccess - authentication successfull");
String targetUrl = determineTargetUrl(request, response, authentication);
if (response.isCommitted()) {
log.debug("IN onAuthenticationSuccess - Response has already been committed. Unable to redirect to "
+ targetUrl);
return;
}
String token = jwtTokenProvider.createToken(authentication);
log.debug("IN onAuthenticationSuccess - Add cookie '" + appProperties.getAuth().getTokenCookieName()
+ "' to HttpServletResponse");
CookieUtils.addCookie(response, appProperties.getAuth().getTokenCookieName(), token, 84000);
String redirectionUrl = UriComponentsBuilder.fromUriString("/")
.build().toUriString();
clearAuthenticationAttributes(request, response);
getRedirectStrategy().sendRedirect(request, response, redirectionUrl);
}
/**
* Clear authentication attributes.
*
* @param request the request
* @param response the response
*/
protected void clearAuthenticationAttributes(HttpServletRequest request, HttpServletResponse response) {
log.debug("IN clearAuthenticationAttributes - Clear authentication attributes");
super.clearAuthenticationAttributes(request);
}
}
|
Coordinated interference management for visible light communication systems In this paper, we consider the performance of a visible light communication (VLC) network with coordinated interference management. The VLC transmitters are allowed to coordinate their transmissions using one of two transmission schemes so as to maximize a network utility function. In the first technique, namely, orthogonal transmission, the utility function is maximized by optimally partitioning all resources. In the second technique, namely, power control, the transmitters are allowed to share the full spectrum while being allowed to control their power so as to maximize network performance. In particular, for each transmission technique, we optimize a general network utility function under the constraint of a desired illumination power for each VLC transmitter, taking into consideration the optical signal clipping effect due to the physical limitations of the VLC transmitters. For the power control transmission scheme, we develop a computationally efficient method for finding the optimal power values by deriving a computationally efficient way to obtain the achievable spectral efficiency region. Considering the summation and the proportional fairness utility functions, our simulation results show that the optimal transmission scheme depends on the location of the VLC users and the desired illumination power. Also, we show the superiority of the performance of the power control scheme over the orthogonal transmission scheme for low interference regions. |
#pragma once
#include "VertexBuffer.h"
#include "Engine/Debug/GLErrorHandle.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
namespace Renderer {
class VertexArray {
public:
VertexArray();
~VertexArray();
void AddBuffer(const VertexBuffer& vb, const VertexLayout& layout);
void Bind() const;
void Unbind() const;
private:
unsigned int rendererID;
};
}
|
/* Copyright (C) 2004, <NAME> <<EMAIL>> */
/* Define the machine-dependent type `jmp_buf'. H8/300 version. */
#ifndef _BITS_SETJMP_H
#define _BITS_SETJMP_H 1
#if !defined _SETJMP_H && !defined _PTHREAD_H
# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
#endif
#ifndef _ASM
typedef struct
{
unsigned long __regs[4]; /* save er4 - er7(sp) */
unsigned long __pc; /* the return address */
} __jmp_buf[1];
#endif /* _ASM */
#define JB_REGS 0
#define JB_PC 16
#define JB_SIZE 20
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address) \
((void *) (address) < (void *) (jmpbuf)->__regs[3])
#endif /* bits/setjmp.h */
|
<reponame>yash7raut/IoT-For-Beginners<filename>6-consumer/lessons/3-spoken-feedback/code-spoken-response/virtual-iot-device/smart-timer/app.py
import requests
import threading
import time
from azure.cognitiveservices.speech import SpeechConfig, SpeechRecognizer, SpeechSynthesizer
speech_api_key = '<key>'
location = '<location>'
language = '<language>'
recognizer_config = SpeechConfig(subscription=speech_api_key,
region=location,
speech_recognition_language=language)
recognizer = SpeechRecognizer(speech_config=recognizer_config)
def say(text):
ssml = f'<speak version=\'1.0\' xml:lang=\'{language}\'>'
ssml += f'<voice xml:lang=\'{language}\' name=\'{first_voice.short_name}\'>'
ssml += text
ssml += '</voice>'
ssml += '</speak>'
recognizer.stop_continuous_recognition()
speech_synthesizer.speak_ssml(ssml)
recognizer.start_continuous_recognition()
def announce_timer(minutes, seconds):
announcement = 'Times up on your '
if minutes > 0:
announcement += f'{minutes} minute '
if seconds > 0:
announcement += f'{seconds} second '
announcement += 'timer.'
say(announcement)
def create_timer(total_seconds):
minutes, seconds = divmod(total_seconds, 60)
threading.Timer(total_seconds, announce_timer, args=[minutes, seconds]).start()
announcement = ''
if minutes > 0:
announcement += f'{minutes} minute '
if seconds > 0:
announcement += f'{seconds} second '
announcement += 'timer started.'
say(announcement)
def get_timer_time(text):
url = '<URL>'
body = {
'text': text
}
response = requests.post(url, json=body)
if response.status_code != 200:
return 0
payload = response.json()
return payload['seconds']
def process_text(text):
print(text)
seconds = get_timer_time(text)
if seconds > 0:
create_timer(seconds)
def recognized(args):
process_text(args.result.text)
recognizer.recognized.connect(recognized)
recognizer.start_continuous_recognition()
speech_config = SpeechConfig(subscription=speech_api_key,
region=location)
speech_config.speech_synthesis_language = language
speech_synthesizer = SpeechSynthesizer(speech_config=speech_config)
voices = speech_synthesizer.get_voices_async().get().voices
first_voice = next(x for x in voices if x.locale.lower() == language.lower())
speech_config.speech_synthesis_voice_name = first_voice.short_name
while True:
time.sleep(1) |
(Reuters) - Former Federal Bureau of Investigation Director James Comey will testify on June 8 before a congressional committee investigating Russia’s alleged meddling in the 2016 U.S. presidential election.
FILE PHOTO: FBI Director James Comey testifies before the House Intelligence Committee hearing into alleged Russian meddling in the 2016 U.S. election, on Capitol Hill in Washington, U.S., March 20, 2017. REUTERS/Joshua Roberts/File Photo
Comey is expected to tell the Senate Intelligence Committee that President Donald Trump asked him to drop an investigation into former White House national security adviser Michael Flynn’s ties to Russia. Trump fired Comey on May 9.
Legal experts say that Trump could invoke a doctrine called executive privilege to try to stop Comey from testifying. But such a maneuver would draw a backlash and could be challenged in court, they said.
The following describes how executive privilege works and why it could backfire on Trump if he invokes it.
What is executive privilege?
Executive privilege is a legal doctrine that allows the president to withhold information from other government branches.
The U.S. Supreme Court ruled in 1974 in U.S. v Nixon that executive privilege can only be used in limited circumstances, such as protecting national security or preserving the confidentiality of sensitive communications within the executive branch.
How would Trump invoke the privilege to block Comey’s testimony?
Before invoking executive privilege, the president typically obtains a written memorandum justifying the decision from the Office of Legal Counsel, a division of the Department of Justice. The White House counsel is often informally involved in the decision.
After invoking the privilege, the president can direct current and former government officials to not divulge information.
Have presidents invoked executive privilege in the past?
The term was not coined until the 1950s, but most presidents have invoked some version of it, said Mark Rozell, a professor of government at George Mason University. President Barack Obama asserted the privilege in 2012 to block Congress from seeing documents relating to an investigation into Fast and Furious, a botched gunrunning operation conducted by the Bureau of Alcohol, Tobacco, Firearms and Explosives.
What are the odds that Trump would legally succeed in blocking Comey’s testimony?
Legal experts said Trump would face an uphill climb if he asserted executive privilege to stop Comey from testifying before the congressional committee.
Trump likely would argue that Comey’s testimony involves confidential conversations or matters of national security. But that claim would be undercut by the fact that the president has publicly discussed and tweeted about his conversations with Comey, said Rozell.
Trump faces another hurdle if he tries to block Comey’s testimony. If Trump pressured Comey to drop the Flynn investigation, as Comey is expected to testify, then Trump may have engaged in obstruction of justice, according to some lawyers. Executive privilege cannot be used to “cover up government misconduct,” said Andrew Wright, a professor at Savannah Law School.
If Trump invoked the privilege, could Comey disregard it?
Typically a president uses executive privilege to prevent government employees from releasing information. Comey is now a private citizen who does not have to worry about losing his job if he does not comply. Rozell said he knows of no legal sanction for ignoring an assertion of executive privilege, but that it would be “unprecedented” for an assertion of the privilege to be ignored.
Could Trump be challenged in court if he asserts executive privilege?
The president and Congress typically hammer out a compromise when they disagree about whether privilege can be asserted, said Rozell.
But there are instances of executive privilege being challenged in court. When Obama cited the privilege to block the release of documents relating to Fast and Furious, Congress sued and asked a judge to direct then-Attorney General Eric Holder to comply with its subpoena. A judge ruled last year that the Justice Department’s public disclosures about the controversy undercut the president’s executive privilege claim, saying that the Justice Department had already publicly revealed much of the information it said should be kept private.
It would be procedurally complicated to challenge a decision by Trump to block Comey’s testimony. First, Congress would have to issue a subpoena requiring Comey to testify. Then Congress would have to find Comey in contempt if he refused. Congress could then ask a federal judge to force Comey to comply with its subpoena. That litigation would lead to a ruling on whether Trump lawfully invoked executive privilege. “There is a path to judicial review, but a lot of things would have to take place,” Wright said.
What are the political risks if Trump tries to assert privilege?
Trump would surely face public criticism if he tries to stop Comey’s testimony, Rozell said. Critics could claim Trump is using privilege to thwart questions about potential ties between Russia and Flynn and Russia’s alleged influence on the election. “That’s the rub with executive privilege: It makes it look like you have something to hide,” Rozell said. |
import React from 'react';
import { render, screen } from 'spec/helpers/testing-library';
import { DndItemType } from 'src/explore/components/DndItemType';
import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel';
const defaultProps = {
name: 'Column',
accept: 'Column' as DndItemType,
onDrop: jest.fn(),
canDrop: () => false,
valuesRenderer: () => <span />,
onChange: jest.fn(),
options: { string: { column_name: 'Column' } },
};
test('renders with default props', async () => {
render(<DndSelectLabel {...defaultProps} />, { useDnd: true });
expect(await screen.findByText('Drop columns')).toBeInTheDocument();
});
test('renders ghost button when empty', async () => {
const ghostButtonText = 'Ghost button text';
render(
<DndSelectLabel {...defaultProps} ghostButtonText={ghostButtonText} />,
{ useDnd: true },
);
expect(await screen.findByText(ghostButtonText)).toBeInTheDocument();
});
test('renders values', async () => {
const values = 'Values';
const valuesRenderer = () => <span>{values}</span>;
render(<DndSelectLabel {...defaultProps} valuesRenderer={valuesRenderer} />, {
useDnd: true,
});
expect(await screen.findByText(values)).toBeInTheDocument();
});
|
<gh_stars>10-100
#define CONFIG_LAST_SUPPORTED_WCHAR 767
|
<filename>src/gpu_runtime/gpu_runtime.h<gh_stars>1-10
#pragma once
#define __global__ __attribute__((global))
#define __device__ __attribute__((device))
#define __host__ __attribute__((host))
// #include <stdlib.h>
#include <cstdlib>
#include <ostream>
#include "kernel_compile_defs.h"
class MemoryInfo
{
public:
MemoryInfo(size_t pos, size_t size) : pos(pos), size(size) {}
~MemoryInfo() {}
friend std::ostream &operator<<(std::ostream &os, const MemoryInfo &dt);
// protected:
size_t pos;
size_t size;
};
// class GPURuntime() {
// public:
// GPURuntime();
// ~GPURuntime();
// };
// class Controller;
void *gpuMalloc(uint32_t requestedBytes);
void gpuCopyToDevice(void *gpuMemPtr, const void *srcData, size_t numBytes);
void gpuCopyFromDevice(void *destData, const void *gpuMemPtr, size_t numBytes);
void gpuLaunchKernel(const void *kernelPos, uint32_t numParams, const uint32_t *const p_params);
void tick();
void gpuCreateContext();
void gpuDestroyContext();
// struct dim3
// {
// dim3(unsigned int x, unsigned y, unsigned int z) : x(x), y(y), z(z) {}
// dim3(unsigned int x, unsigned y) : x(x), y(y), z(1) {}
// dim3(unsigned int x) : x(x), y(1), z(1) {}
// dim3() : x(1), y(1), z(1) {}
// // unsigned int pad;
// unsigned int x;
// unsigned int y;
// unsigned int z;
// };
// std::ostream &operator<<(std::ostream &os, const dim3 &value);
// std::ostream &operator<<(std::ostream &os, const size_t value[3]);
// extern "C"
// {
// int cudaConfigureCall(const dim3 grid, const dim3 block, long long shared = 0, char *stream = 0);
// }
|
Epidemiology of Ebstein anomaly: Prevalence and patterns in Texas, 19992005 Ebstein anomaly is a rare but serious cardiac defect, however, little is known about the etiology of this condition. The goal of this study was to expand our limited understanding of the epidemiology of Ebstein anomaly. Data for cases with Ebstein anomaly, as well as all live births, were obtained from the Texas Birth Defects Registry (TBDR) and Center for Health Statistics for the period 19992005. Descriptive analyses and estimates of birth prevalence and crude prevalence ratios were used to characterize this defect in Texas during the study period. There were 188 definite cases of Ebstein anomaly identified in the TBDR. The overall prevalence was 0.72 per 10,000 live births. Variables associated with an increased prevalence of nonsyndromic Ebstein anomaly included: maternal age >39 years (compared to those 2024 years), maternal residence along the TexasMexico border (compared to nonborder residence), and conception in fall or winter (compared to summer). In addition, infants with Ebstein anomaly were at a greater risk of preterm birth and being small for gestational age. These findings help to define subgroups of women at increased risk of having offspring affected by Ebstein anomaly. Furthermore, our findings add to the limited body of literature on this rare but serious malformation. © 2011 WileyLiss, Inc. |
Shrine of Venus Cloacina
The Shrine of Venus Cloacina (Sacellum Cloacinae or Sacrum Cloacina) — the "Shrine of Venus of the Sewer" — was a small sanctuary on the Roman Forum, honoring the divinity of the Cloaca Maxima, the spirit of the "Great Drain" or Sewer of Rome. Cloacina, the Etruscan goddess associated with the entrance to the sewer system, was later identified with the Roman goddess Venus for unknown reasons, according to Pliny the Elder.
History and legend
The Etruscan deity Cloacina may well have been associated originally with the small brook that later became the city's Cloaca Maxima, but the Shrine of Venus Cloacina is first mentioned by the playwright Plautus in the early second century BC. It was located in the Forum in front of the Tabernae Novae ("new shops") and on the Via Sacra. The Tabernae Novae were replaced by the expanded Basilica Aemilia in the middle Republic (179 BC), but the Shrine was preserved. The round masonry Shrine probably dates from this construction (or major remodeling).
Legend, however, ascribes the origin of the Shrine to the period of the Sabine king Titus Tatius (8th century BC), during the reign of Romulus. It was also according to legend that the father of the virtuous Verginia, a butcher in one of the stalls of the Tabernae Novae, came out and stabbed his daughter rather than let her fall victim to the lecherous attentions of Appius Claudius in 449 BC. (This was said to have occurred on the future site of the Shrine.)
Description
Coins minted during the Second Triumvirate (ca. 42 BC) by a moneyer named Lucius Mussidius Longus give a fairly clear visual representation of the shrine. They show a round sacellum (small, uncovered shrine) with a metal balustrade. The scant archaeological remains uncovered between 1899 and 1901 (round travertine substructure, marble rim, diameter 2.40 meters) conform nicely to the pictures on the coins. In his Natural History (77-79 AD), Pliny the Elder refers to signa Cloacinae, which were evidently the two statues shown on the coins and perhaps some other, unidentified objects. One of the statues is holding or waving an object (possibly a flower). Each statue has a low pillar with a bird on it (flowers and birds were well known attributes of Venus). It is not known why there are two statues.
Religious significance
The Romans believed that a good sewage system was important for the future success of Rome, as a good sewer system was necessary for physical health. Romans cultivated Cloacina as the goddess of purity and the goddess of filth. Cloacina's name is probably derived the Latin verb cloare (“to purify” or “to clean”), or from cloaca (“sewer)”. |
Ag-doping regulates the cytotoxicity of TiO2 nanoparticles via oxidative stress in human cancer cells We investigated the anticancer potential of Ag-doped (0.55%) anatase TiO2 NPs. Characterization study showed that dopant Ag was well-distributed on the surface of host TiO2 NPs. Size (15nm to 9nm) and band gap energy (3.32eV to 3.15eV) of TiO2 NPs were decreases with increasing the concentration of Ag dopant. Biological studies demonstrated that Ag-doped TiO2 NP-induced cytotoxicity and apoptosis in human liver cancer (HepG2) cells. The toxic intensity of TiO2 NPs was increases with increasing the amount of Ag-doping. The Ag-doped TiO2 NPs further found to provoke reactive oxygen species (ROS) generation and antioxidants depletion. Toxicity induced by Ag-doped TiO2 NPs in HepG2 cells was efficiently abrogated by antioxidant N-acetyl-cysteine (ROS scavenger). We also found that Ag-doped TiO2 NPs induced cytotoxicity and oxidative stress in human lung (A549) and breast (MCF-7) cancer cells. Interestingly, Ag-doped TiO2 NPs did not cause much toxicity to normal cells such as primary rat hepatocytes and human lung fibroblasts. Overall, we found that Ag-doped TiO2 NPs have potential to selectively kill cancer cells while sparing normal cells. This study warranted further research on anticancer potential of Ag-doped TiO2 NPs in various types of cancer cells and in vivo models. Wide-spread application of TiO 2 nanoparticles (NPs) have been increasing due to their chemical stability, photocatalytic efficiency and low cast 1. The TiO 2 NPs are being utilized in daily life products such as sunscreens, paints and plastics 2. Due to ever increasing market demand the annual production of TiO 2 NPs is predicted to reach around 2.5 million tons by 2025 3. There is also growing interest of TiO 2 NPs in biomedical fields including drug delivery, cell imaging, photodynamic therapy and biosensor. However, investigations have shown the conflicting results regarding the biological response of TiO 2 NPs. Several studies found that TiO 2 NPs induce inflammation, cytotoxicity and genotoxicity. Contrary, several reports showed that TiO 2 NPs were not toxic or least toxic to several cell lines. Conflicting reports on toxicological response of TiO 2 NPs could be due to utilization of different physical and chemical properties of this material 2,13. In general, anatase and rutile are two crystalline forms of TiO 2. Anatase TiO 2 NPs have high photocatalytic activity and more biologically active than those of rutile one 14,15. Photocatalytic activity of TiO 2 NPs is thoroughly investigated because of their applications in solar energy, environmental remediation and photodynamic therapy (PDT) 16,17 since its breakthrough in 1980 s 18. Under light irradiation, the valence band electrons (e − ) of TiO 2 become excited and moved to conduction band leaving positive charge holes (h + ). The electrons (e − ) in conduction band and holes (h + ) in valence band have the capability to generated cellular reactive oxygen species (ROS) 19,20. Light induced ROS generation by a photosensitizer has been applied in treatment of several diseases called PDT 21,22. Potential of TiO 2 NPs to be applied in PDT for different types of cancers, such as leukemia, cervical, liver and lung cancers is already reported 23,24. Still, there are some drawbacks in the application of TiO 2 NPs for PDT. The major drawbacks of TiO 2 are wide band gap (3.2 eV for anatase) that can activate only in the ultraviolet (UV) region and high rate of electrons-holes (e − /h + ) recombination that reduce considerably the photocatalytic efficiency of TiO 2 NPs 25,26. Recent studies have now focused on the improvement of photocatalytic activity of TiO 2 NPs. Attempts to achieve this goal is depends on doping of TiO 2 NPs with metallic or non-metallic elements 27,28. Doping can reduce the band gap of TiO 2 NPs that extend their spectral response in visible wavelengths 29. For example, doping of TiO 2 NPs with noble metals such as Ag, Au or Pt can efficiently decrease the e − /h + pair's recombination to enhance the photocatalytic activity and simultaneously extend their light response towards the visible region because of their d electron configuration 30. Among these Ag-doped TiO 2 NPs has been thoroughly studied because of the dual function of Ag sites. First, Ag serves as an electron scavenging center to separate e − /h + pairs because its' Fermi level is below the conduction band of TiO 2 30,31. Second, Ag NPs have the ability to create surface plasmon resonance (SPR) effect of TiO 2 NPs, thus leading to the distinctly enhanced photocatalytic activity of TiO 2 NPs in visible region. However, application of Ag-doped TiO 2 NPs in cancer therapy is not explored yet. ROS generating potential of Ag-doped TiO 2 NPs under visible light have been recently investigated in killing of microbial communities 32,33. However, some studies have shown that Ag-doped TiO 2 can kill bacteria without any light illumination 34,35. This could be possible because Ag-doping tunes band gap (e − /h + recombination) of TiO 2 NPs that enhances the catalytic activity to generate ROS within bacterial cells without light illumination. Therefore, ROS generating potential of Ag-doped TiO 2 NPs can be applied in treatment of cancer without the illumination of any light. Manipulating intracellular ROS level by redox modulators is a possible way to harm cancer cells selectively without affecting the normal cells. Therefore, we explored the anticancer potential of Ag-doped TiO 2 NPs via ROS pathway. Using Ag-doped TiO 2 NPs without light in the treatment of cancer have some advantages over PDT 40. For example, visible light used in PDT cannot travel very far through body tissue. Therefore, PDT is used to treat to the problem on or just under the skin on the lining of some internal organs or cavities. Metastasized cancer also cannot treat with PDT due to the inability of the light source to penetrate large tumors or reach areas where cancer may have spread. Hence, Ag-doped TiO 2 NPs can have advantage of other exposure routes such as oral or intravenous injection. In this study, we investigated the cytotoxicity mechanisms of Ag-doped TiO 2 NPs in human liver cancer (HepG2) cells. To avoid cell type-specific response we have also employed human lung (A549) and breast cancer (MCF-7) cells to assess the anticancer effect of Ag-doped TiO 2 NPs. We have chosen these cancer cell lines because of the lung, liver and breast cancers are life menacing disease and the occurrence of these types of cancer are increasing rapidly worldwide. These cell lines are also well-known in vitro models and have been widely utilized in toxicology and pharmacology studies. We have also examined the benign nature of Ag-doped TiO 2 NPs on two non-cancerous normal cells; human lung fibroblasts (IMR-90) and primary rat hepatocytes. We observed that Ag-doped TiO 2 NPs selectively kill the cancer cells (HepG2, A549 & MCF-7) without much affecting the normal cells. Materials and Methods Preparation of nanoparticles. Pure and Ag-doped TiO 2 NPs were synthesized by sol-gel procedure. Titanium (IV) isopropoxide Ti 4 and silver nitrate (AgNO 3 ) were utilized as precursors. In brief, 0.1 M solution of titanium (IV) isopropoxide was prepared in absolute ethanol. Then, solution was mixed with distilled water and stirred for 2 h to get a clear and transparent TiO 2 solution. The solution was further dried at 100 °C for 48 h to obtain TiO 2 gel. After aging 24 h the TiO 2 gel was filtered and dried. Then, prepared TiO 2 samples were calcined at 400-600 °C for 24 h to get TiO 2 nanopowder. The Ag-doped TiO 2 nanopowder was synthesized by the same method as described above. The only difference was the addition of AgNO 3 into the TiO 2 solution. The dopant Ag concentrations were varied to 0.5, 2.5 and 5.0%, respectively. Characterization of nanoparticles. Crystal structure and phase purity of pure and Ag-doped TiO 2 NPs were assessed by X-ray diffraction (XRD) (PanAnalytic X'Pert Pro) using Cu-K radiation ( = 0.15405 nm, at 45 kV and 40 mA). Morphology was examined by field emmission transmission electron microscopy (FE-TEM) (JEM-2100F, JEOL Inc. Japan). Energy dispersive X-ray spectroscopy (EDS) was used to determine the elemental composition. Prepared NPs were also characterized micro-Raman spectroscopy through Horiba Raman system (IY-Horiba-T64000). UV-visible absorption spectra were obtained using a spectrometer (Shimadzu-2550, Japan). Surface composition and oxygen vacancies of the Ag-doped TiO 2 NPs were determined by X-ray photoelectron spectroscopy (XPS) (PHI-5300 ESCA PerkinElmer, Boston, MA). The peak positions were internally referenced to the C 1 s peak at 284.6 eV. Aqueous behaviour (hydrodynamic size and zeta potential) of prepared NPs was assessed in a ZetaSizer Nano-HT (Malvern Instruments, UK). Cell culture and exposure of nanoparticles. The HepG2, A549, MCF-7 & IMR-90 cell lines were bought from American Type Culture Collection (ATCC) (Manassas, VA). Primary hepatocytes were isolated from rat using collagenase perfusion method 47. The DMEM medium supplemented with 10% fetal bovine serum (FBS) and 100 U/ml penicillin-streptomycin was used to culture the MCF-7 cells at 5% CO 2 and 37 °C. At 80-90% confluence, cells were harvested sub-cultured for nanotoxicity parameters. Cells were allowed to attach on the surface of culture flask for 24 h prior to exposure of NPs. Pure and Ag-doped TiO 2 NPs were suspended in DMEM medium and diluted to different concentrations (0.5-200 g/ml). The NPs suspensions were then sonicated at room temperature for 10 min at 40 W to avoid agglomeration of NPs before exposure to cells. In some parameters, cells were pre-exposed for 1 h with N-acetyl-cysteine (NAC) (10 mM) before co-exposure with or without NPs. Hydrogen peroxide (H 2 O 2 ) (2 mM), buthionine sulphoximine (BSO) (200 M) or ZnO NPs (50 g/ml) were also used as positive controls. Assay of cytotoxicity endpoints. Cell viability against NPs exposure was assessed by MTT and NRU assays. MTT assay was performed according to the protocol of Mossman 48 with some modifications 49. MTT assay assesses the function of mitochondrial by measuring the potential of living cells to reduce colorless MTT into blue formazon. The formazan was dissolved in acidified isopropanol and absorbance was recorded at 570 nm SCIeNtIfIC REPORTS | 7: 17662 | DOI:10.1038/s41598-017-17559-9 using a microplate reader (Synergy-HT, BioTek). Lysosomal activity (NRU cell viability assay) was performed according to the method of Borenfreund and Puerner 50 with some modifications 51. Cell membrane damage after NPs exposure was examined by lactate dehydrogenase (LDH) assay. LDH is an enzyme extensively found in the cytosol that converts lactate to pyruvate. Upon cell membrane damage, LDH leaks into extracellular matrix (culture medium). LDH level in culture medium was examined using a BioVision kit (Milpitas, CA). Morphology of cells after exposure to NPs was determined by phase-contrast inverted microscope (Leica) at 10X magnification. Assay of apoptotic markers. Mitochondrial membrane potential (MMP) was measured using Rh-123 fluorescent dye according to Siddiqui et al. 46. MMP level was determined by two methods; cell imaging by fluorescent microscopy (OLYMPUS CKX 41) and quantitative assay by microplate reader (Synergy-HT, BioTek). Caspase-3 enzyme activity was determined by BioVision kit (Milpitas, CA). This assay is based on the principle that activated caspases in apoptotic cells cleave the synthetic substrates to release free chromophore p-nitroanilide (pNA) 52. Cell cycle phases were measured by a Beckman Coulter Flow cytometer (Coulter Epics XL/Xl-MCL) through a FL-4 filter (585 nm) using propiodium iodide (PI) probe 53. The data were analyzed by Coulter Epics XL/XL-MCL, System II Software. Assay of oxidative stress markers. Intracellular reactive oxygen species (ROS) generation was assessed utilizing 2,7-dichlorofluorescin diacetate (DCFH-DA) probe as reported elsewhere 54 with few changes 46. ROS level was determined by two methods; quantitative assay by a microplate reader (Synergy-HT, BioTek, USA) and cell imaging by fluorescent microscopy (OLYMPUS CKX 41). For the measurement of glutathione (GSH) level and superoxide dismutase (SOD) enzyme activity, cell extracts were prepared from the control and treated cells as described earlier 51. Intracellular GSH level was quantified by Ellman' method 55 using 5,5-dithio-bis-2-nitrobenzoic acid (DTNB). SOD enzyme activity was measured by a kit (Cayman Chemical Company, Michigan, OH). Protein estimation. Protein level was estimated by Bradford method 56 using bovine serum albumin as standard. Statistics. One-way analysis of variance followed by Dunnett's multiple comparison tests were performed for statistical analysis. Significance was ascribed at p < 0.05. Results and Discussion TEM analysis. Morphology and structural characterization of pure and Ag-doped TiO 2 NPs were assessed by field emission transmission electron microscopy (FETEM) (Fig. 1). Upper and middle panels of Fig. 1 show low magnification images of pure and Ag-doped TiO 2 NPs. The average particle size of pure TiO 2 NPs was around 15 nm while particle size of Ag-doped (5%) TiO 2 NPs was approximately 9 nm. These results indicated that Ag-doping reduces the size of host TiO 2 NPs. Generally, metal ions doping at optimal level hinders the particles growth. Effect of Ag dopant on TiO 2 NPs size reduction has been attributed to grain-boundary pinning caused by dopant ions, which limits the grain growth by the symmetry-breaking effects of the dopant at the boundary, resulting in smaller size of particles 57. Reduction in size of NPs after doping was also reported in other studies 49,57. High resolution TEM images (lower panel of Fig. 1) clearly shows that dopant Ag was well distributed and decorated on the surface of host TiO 2 NPs. High resolution TEM images also demonstrated that TiO 2 NPs has a high crystalline nature with the plane spacing of 0.353 nm, 0.350 nm, 0.532 nm 0.351 nm, which matches well with plane of anatase TiO 2. After the combination with different amount of Ag (0.5, 2.5 & 5%), spacing between two adjacent lattice places is about 0.20, 0.21 and 0.22 nm, which corresponds to the lattice distance of Ag (JCPDS: 04-0783). These lattice parameters were in agreement with the X-ray diffraction (XRD) spectra as shown in Fig. 2A. XRD analysis. XRD measurements were carried out to examine the crystallographic structure of prepared NPs. Figure Figure 2B represents the Raman spectra of pure and Ag-doped (0.5-5%) TiO 2 NPs in the range 100-1200 cm −1 at room temperature. Three peaks with strong intensities are observed around 397 (B1g), 515(A1g), and 637 (Eg) cm −1, which indicates that all samples were mostly dominated by anatase phase of TiO 2 NPs 58,59. An interesting observation was that the peak intensities increased with the deposition of Ag, while the position of the Raman signal remained the same, indicating the crystallinity becomes better, which also corresponds to the results of XRD and high resolution TEM. XPS analysis. X-ray photoelectron spectroscopy (XPS) was performed to further characterize chemical composition and elemental status of pure and Ag-doped TiO 2 NPs. Figure 3A shows the typical XPS survey spectra of Ag-doped (5%) TiO 2 NPs. Results showed that Ti, O and Ag elements exist in Ag-doped TiO 2 NPs. Peak located at binding energy of 463.75 eV corresponds to the Ti (2p1/2) and another one located at 460.12 eV is assigned to the Ti (2p3/2) (Fig. 3C). In the O1s region, highest intense peak at 529.8 eV is attributed to the lattice oxygen (Ti-O-Ti) in anatase (Fig. 3D). The Ag3d3 and Ag3d5 peaks indicated the presence of Ag in Ag-doped TiO 2 NPs (Fig. 3B). The binding energies of Ag3d3 and Ag3d5 peaks are 369.5 eV and 371.4 eV, respectively. Our results have a strong agreement with the previous studies 60, 61. The EDS data also showed that Ti and O were the main elemental species in pure TiO 2 NPs while additional Ag peaks were observed in Ag-doped TiO 2 NPs supporting XPS results (Supplementary Fig. S1). other studies 49,57. Tauc Model was employed to determine the optical band gap energy of the aggregates, according to the following equation 49 : Raman analysis. where h is the photon energy, E g is the optical band gap, A is a constant, m is equal to 1/2 for allowed direct optical transitions and is the absorption coefficient. The band gap values were determined by extrapolating the linear region of the plot to h = 0. From the Tauc plots of (h) 2 Hydrodynamic size and zeta potential. It is essential to characterize the behavior of NPs in aqueous state before their biological studies. We have assessed the zeta potential and particle size of pure and Ag-doped TiO 2 NPs in water and DMEM to get a realistic overview of NPs interaction with cells. We found that hydrodynamic size of pure and Ag-doped (0.5-5%) TiO 2 NPs was 10-15 time higher than those of sizes calculated from TEM and XRD (primary particle size) ( Table 1). We further noticed that hydrodynamic size of TiO 2 NPs was slightly increases with the incremental of Ag-doping. Higher hydrodynamic size than primary particle size was also reported in other studies 63,64. In ZetaSizer measurements higher size of NPs was because of tendency of NPs to agglomerate. We further observed little variation in hydrodynamic size of NPs dispersed in DMEM than those of deionized water. This could be due to presence of serum in the culture medium. It is known that serum could bind to NPs and form a protein corona 65. This protein corona might be responsible for size variation in water and cell culture medium 66. Protein corona presents on the surface of NPs also influences the interaction of NPs with cells. Zeta potential study suggested that pure and Ag-doped TiO 2 NPs suspended in water had positive charge on the surface, whereas in culture medium NPs had negative surface (Table 1). Differences in surface charge could be due to adsorption of negative charged proteins on the surface of NPs. Cytotoxicity. Human liver cancer (HepG2) cells were treated with different concentrations (0.5-200 g/ml) of pure and Ag-doped TiO 2 NPs for 24 h and cell viability was measured by MTT and NRU assays. Both parameters serve as sensitive and integrated tools to measure the cell integrity and cell proliferation inhibition 49,67. The MTT assay was used to evaluate the mitochondrial function while NRU assay represents the lysosomal activity. Both MTT and NRU data showed that Ag-doped TiO 2 NPs reduced the viable number of cells dose-dependently in the concentration range of 25-200 g/ml. Besides, cell viability decreases with increasing concentrations of Ag dopant ( Fig. 5A and B). On the other hand, pure TiO 2 NPs did not reduce the viability of HepG2 cells. LDH enzyme leakage in culture medium from cells is also an indicator of NPs penetration into cells 68. A plenty of studies have shown that LDH level increases in culture medium after exposure to NPs 37,69. Our results also demonstrated that Ag-doped TiO 2 NPs induced LDH leakage and incremental Ag-doping resulted in higher leakage of LDH enzyme (Fig. 5C). However, pure TiO 2 NPs did induce LDH leakage in HepG2 cells. To support LDH data we further studied the cellular uptake of pure and Ag-doped TiO 2 in HepG2 cells by IC-MS. After exposure of 100 g/ml pure and Ag-doped (0.5-5%) TiO 2 NPs for 24 h, ICP-MS analysis showed the presence of Ti and Ag elements in HepG2 cells (Supplementary Fig. S2). We further examined the morphology of HepG2 cells after exposure to Ag-doped (0.5-5%) TiO 2 NPs at a concentration of 100 g/ml for 24 h. Results demonstrated low cell density and rounding of cells after exposure to Ag-doped TiO 2 NPs as compared to the controls (Fig. 5D). Similar to cell viability and LDH leakage results, morphology data showed that cytotoxic response of TiO 2 NPs increases with increasing the amount of Ag-doping. Our previous study also reported that Zn-doped TiO 2 NPs induced cytotoxicity in human breast cancer (MCF-7) cells 49. Other studies have also shown that metal ions doping tunes the cytotoxic response of semiconductor metal oxide NPs 62,70,71. These results were according to other reports demonstrating that pure TiO 2 NPs did not induce cytotoxicity in different types of human cells 72,73. Apoptosis. Apoptosis is known as a distinct mode of programmed cell death that involves the elimination of genetically damaged cells. Apoptotic cell death occurs as a defense mechanism when cellular DNA is damaged beyond the repair 74. We studied the MMP level, caspase-3 enzyme activity and cell cycle as markers of apoptosis in HepG2 cells against pure and Ag-doped TiO 2 NPs exposure. MMP level in HepG2 cells were measured after exposure to pure and Ag-doped TiO 2 NPs at the concentration of 25-100 g/ml for 6 h. MMP level was assayed using Rh-123 fluorescent probe. Quantitative data indicated that Ag-doped TiO 2 NPs caused MMP loss in a dose-dependent manner (Fig. 6A). Fluorescence microscopy images also showed that the brightness of red intensity was decreases with increasing the concentration of Ag-doping (Fig. 6B). Caspase genes are activated during the process of cell death and are known to play critical roles in apoptotic pathway. Studies have shown that caspase-3 gene is imperative for genetic damage and programmed cell death 75. Our results demonstrated that Ag-doped TiO 2 NPs induced caspase-3 enzyme activity dose-dependently. Besides, caspase-3 enzyme activity was increases with increasing the level of Ag-doping (Fig. 6C). We further studied the cell cycle progression against pure and Ag-doped TiO 2 NPs exposure. It is known that cells with damaged DNA accumulated in gap1 (G1), DNA synthesis (S) or in gap2/mitosis (G2/M) phase. Cells with irreversible damage undergo apoptosis, giving rise to accumulation of cells in sub-G1 phase. Flow-cytometric data demonstrated the induction of apoptosis in HepG2 cells upon exposure to Ag-doped TiO 2 NPs exposure (Fig. 6D). The Ag-doped (5%) TiO 2 NPs (100 g/ ml for 24 h) resulted in the appearance of a significant 12.8% cells in the sub-G1 phase than those of 6.1% of untreated control cells. A significant decline in G2/M phase was also evident in Ag-doped TiO 2 NPs treated cells. Similar to cytotoxicity results, pure TiO 2 NPs did not induce apoptosis in HepG2 cells. Oxidative stress. Oxidative stress has been played a critical role in the cytotoxic response of a number of NPs whether by the extreme generation of oxidants (e.g. ROS) or by reduction of antioxidants (e.g. GSH) 52,64,76. Evidence are rapidly increasing that manipulation of intracellular ROS production can be utilized in killing of cancer cells without much affecting the normal cells 36,39. Our earlier studies have shown that semiconductor nanoparticles such ZnO have potential to selectively kill cancer cells via ROS generation while sparing the normal cells 37,38,52. In the present study, we further investigated the regulation of oxidative stress markers (ROS, SOD & GSH) in HepG2 cells upon exposure to 25, 50 and 100 g/ml of pure and Ag-doped TiO 2 NPs for 6 h. Intracellular ROS generation was assessed by DCFDA fluorescent probe. ROS such as superoxide anion (O 2 − ), hydroxyl radical (HO ) and hydrogen peroxide (H 2 O 2 ) elicit a variety of physiological and cellular events including DNA damage and apoptosis 76,77. Quantitative results demonstrated that ROS level was increases dose-dependently and proportional to the amount of Ag-doping in TiO 2 NPs (Fig. 7A). Fluorescence microscopy images also supporting that the brightness of green probe was higher in Ag-doped TiO 2 NPs in comparison to controls (Fig. 7B). Although, pure TiO 2 NPs did not induce ROS production in HepG2 cells. Superoxide dismutase (SOD) enzyme is acting as front liner in antioxidant defense system. This enzyme catalyses the dismutation of highly reactive superoxide (O 2 − ) anion into hydrogen peroxides (H 2 O 2 ). We observed dose-dependent reduction in SOD enzyme activity and proportional to the Ag-doping (Fig. 7C). On the other hand, pure TiO 2 NPs did not affect the activity of SOD enzyme. Higher production of intracellular ROS leads to oxidize the cellular biomolecules such as glutathione (GSH), which plays a critical role in maintaining the redox homeostasis through its antioxidant activity. We also found that Ag-doped TiO 2 NPs induced GSH depletion in dose-dependent manner and proportional to the amount of Ag-doping (Fig. 7D). Ag-doped TiO2 NPs induced cytotoxicity in HepG2 cells via oxidative stress. In this section, we explored the role of ROS and oxidative stress in cytotoxic response of Ag-doped (5%) TiO 2 NPs in HepG2 cells (Fig. 8). The HepG2 cells were treated with Ag-doped (5%) TiO 2 NPs with or without N-acetyl-cysteine (NAC) or buthionine sulphoximine (BSO). We have also used ZnO NPs or H 2 O 2 as positive controls. Results demonstrated that NAC efficiently averted the ROS generation and SOD depletion caused by Ag-doped TiO 2 NPs, or ZnO NPs ( Fig. 8A and B). BSO was used as positive control for GSH depletion. Besides, NAC exposure restored the GSH in cells treated with Ag-doped TiO 2 NPs or BSO (Fig. 8C). At last, we also found that co-exposure of NAC, effectively abolished the cytotoxicity induced Ag-doped TiO 2 NPs, ZnO NPs or H 2 O 2 (Fig. 8D). Altogether, these results suggested that oxidative stress could be one of the potential mechanisms of toxicity induced by Ag-doped TiO 2 NPs in human liver cancer (HepG2) cells.. Amount of Ag present in Ag-doped TiO 2 nano-composite did not induced toxicity alone to HepG2, A549 and MCF-7 cancer cells. Cytotoxicity was measured by MTT cell viability assay. Cells were exposed to 0.5, 2.5 and 5 g/ml of Ag NPs. This is the amount of Ag present in the 100 g/ml of Ag-doped TiO 2 NPs. Data represented are mean ± SD of three identical experiments made in three replicate. SCIeNtIfIC REPORTS | 7: 17662 | DOI:10.1038/s41598-017-17559-9 Cytotoxicity and oxidative response of Ag-doped TiO2 NPs in human lung and breast cancer cells. To avoid cell type specific response we have also employed human breast (MCF-7) and lung cancer cells to see the effect of Ag-doped (5%) TiO 2 NPs. Cytotoxicity endpoints (MTT & LDH assays) and oxidative stress markers (ROS & GSH levels) were assessed. We observed that like HepG2 cells, Ag-doped TiO 2 NPs causes reduction in cell viability (Fig. 9A), LDH leakage (Fig. 9B), higher level of ROS (Fig. 9C) and depletion of GSH (Fig. 9D) in MCF-7 and A549 cells. However, pure TiO 2 NPs did not cause toxicity to both types of ells. These results are suggesting that the potential mechanism of toxicity induced by Ag-doped TiO 2 NPs in A549 and MCFcells was comparable to HepG2 cells. Amount of Ag present in Ag-doped TiO 2 NPs did not cause cytotoxicity alone to human cancer cells. We found that pure TiO 2 NPs did not cause toxic effects to selected human cancer cell lines (HepG2, A549 & MCF-7). However, Ag-doped TiO 2 nano-complex induced toxicity to these cells. To make clear that observed toxic effect was due to exposure Ag-TiO 2 nanocomplex not by Ag alone, we examine the effect of Ag NPs alone in these cell lines. We selected the 0.5, 2.5 & 5 g/ml of Ag NPs for cytotxicity assays. These amounts of Ag present in 100 g/ml solution of Ag-doped (0.5, 2.5 & 5%) TiO 2 NPs. We exposed HepG2, A549 and MCF-7 cells with Ag NPs at the concentration of 0.5, 2.5 and 5 g/ml for time period of 24 h. After the completion of exposure time, cell viability was measured by MTT assay. Results have shown that selected concentration of Ag NPs were not able to exert cytotoxicity to all three types of cancer cells (Fig. 10). These results indicated that Ag-TiO 2 nanocomplex was responsible for cytotoxicity, apoptosis and oxidative stress in cancer cells neither Ag nor TiO 2 alone. Ag-doped TiO 2 NPs were benign to normal cells. To see the benign nature of Ag-doped TiO 2 NPs toward normal cells, we have examined the effect of Ag-doped (5%) TiO 2 NPs on human lung fibroblasts (IMR-90) and primary rat hepatocytes. Results demonstrated that Ag-doped TiO 2 NPs did induce cytotoxicity and oxidative stress in both types of normal cells (Fig. 11A and B). Other studies have also reported the benign nature of TiO 2 NPs 78-80. These results suggested that Ag-doped TiO 2 NPs have inherent selective toxicity nature towards cancer cells while posing no effect to normal cells. In previous studies, we also found that ZnO and Al-doped ZnO NPs have the inherent selective killing nature towards cancer cells without posing much effect to normal cells 37,38. These results suggested that Ag-doped TiO 2 NPs has anticancer activity. Preferential cancer cells killing ability of metal-based NPs are being explored at laboratory level 38,39,71,81,82. Conclusions We found that Ag-doped TiO 2 NPs induced toxicity in human liver cancer (HepG2) cells via oxidative stress. The toxic intensity of Ag-doped TiO 2 NPs was increases with the incremental of Ag level. This is possibly due to the tuning of size and band gap of TiO 2 NPs by Ag-doping. Furthermore, Ag-doped TiO 2 NPs were also induced toxicity to human lung (A549) and breast (MCF-7) cancer cells. On the other hand, Ag-doped TiO 2 NPs spare the normal human lung fibroblasts (IMR-90) and primary rat hepatocytes. Altogether, our data suggested that Ag-doped TiO 2 NPs selectively kill cancer cells while sparing the normal cells. This preliminary report on selective toxicity of Ag-doped TiO 2 nano-complex toward cancer cells warranted further extensive research on various types of cancer and normal cells along with in vivo models. |
<reponame>jbcurtin/astropy
from astropy.cloud.tests.pytest_utils import aws_s3_url
def test__load_headers__aws(aws_s3_url):
from astropy.cloud.fits.index.aws import load_headers
fits_headers = load_headers(aws_s3_url)
import pdb; pdb.set_trace()
import sys; sys.exit(1)
|
<reponame>da-eto-ya/trash
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import static org.junit.Assert.*;
public class MainTest {
private static final byte[][][] cases = new byte[][][]{
{{65, 13, 10, 10, 13}, {65, 10, 10, 13}},
{{65, 13, 13, 13, 10}, {65, 13, 13, 10}},
{{65, 13, 10, 13, 10}, {65, 10, 10}},
{{65, 13, 10, 13, 10, 26}, {65, 10, 10, 26}},
{{13, 10}, {10}},
{{13, 13, 13, 10, 13, 13}, {13, 13, 10, 13, 13}},
{{}, {}},
{{13}, {13}},
{{10}, {10}},
{{1}, {1}},
{{10, 13}, {10, 13}},
};
@org.junit.Test
public void testReplaceCRLN() throws Exception {
for (byte[][] c : cases) {
ByteArrayInputStream in = new ByteArrayInputStream(c[0]);
ByteArrayOutputStream out = new ByteArrayOutputStream(c[0].length);
new Main().replaceCRLN(in, out);
assertArrayEquals(c[1], out.toByteArray());
}
}
} |
A 20-year-old Hurlburt airman was found dead Sunday morning following a boating accident near the Santa Rosa Sound.
Colby Siegel�s body was found less than 30 yards from the marker his boat struck several hours before, which caused Siegel and the two other men on the vessel to be thrown off, according to Stan Kirkland, spokesman with the Florida Fish and Wildlife Conservation Commission.
The exact cause of death is still under investigation.
Kirkland said Siegel and two other men, 19-year-old Taylor Wimberly and 23-year-old Derek Richards, went out late Saturday for a fishing trip and were headed back around 3 a.m. when they hit Marker 41 near the Sound.
Siegel was initially reported missing until his body was recovered at 7:44 a.m. near Cedars condominium, according to Michele Nicholson, spokeswoman with the Okaloosa County Sheriff�s Office. Siegel was married and resided in Fort Walton Beach.
Nicholson said one of the men swam to shore to call for help. He was spotted on Miracle Strip Parkway near Tuffy�s Auto at 3:13 a.m. attempting to flag down a vehicle.
The Coast Guard, Okaloosa County Sheriff's Office dive unit and the FWC responded to the incident.
Wimberly and Richards did not suffer life-threatening injuries.
Kirkland said the 15-foot boat, which grounded itself after the accident, was registered to Siegel, but he was not operating the vessel at the time of the crash.
The accident is under investigation by the FWC. |
Somatotropins were originally discovered in pituitary gland extracts from various animals. Mammalian somatotropins are conserved molecules resulting in similar tertiary structure.
Somatotropins, including bovine somatotropins (bSt), are globular proteins comprising a single chain of about 200 amino acids with two intramolecular disulfide bonds. bSt is a growth hormone which has been extensively studied (Paladini, A. C. et al., CRC Crit. Rev. Biochem. 15:25-56 (1983)). Specifically, bSt is a globular, single chain protein containing 191 amino acids and two intramolecular disulfide bonds. The molecular weight of bSt is about 22,000 daltons.
Natural bSt extracted from pituitary glands is heterogeneous. At least six major forms of the protein have been described. The longest form has 191 amino acid residues and the sequence alanylphenylaalanine at the NH.sub.2 - terminus. The second form has 190 amino acid residues and phenylalanine at the NH.sub.2 - terminus. The third form has 187 amino acid residues and methionine at the NH.sub.2 - terminus. The remaining three forms of the bSt substitute valine for leucine at position 127. In addition to this heterogeneity, undefined heterogeneity of bovine somatotropin has also been described (Hart, I. C. et al., Biochem. J. 218:573-581 (1984); Wallace, M. and Dickson, H. B. F., Biochem. J. 100:593-600 (1965)). Undefined electrophoretic heterogeneity is seen when the native extracts are fractionated by anion exchange chromatography. It has been shown that the defined forms have different relative potency in bioassays. Also, it has been shown that other undefined species of bSt, when fractionated on ion exchange columns, have varying degrees of bioactivity in rat growth models (Hart, et al. and Wallace and Dickson, supra).
It is not known whether the undefined heterogeneity exhibiting biological variation is due to genetic variability, to in vivo post-translational modification, to differences in phosphorylation (Liberti, J. P. et al., Biochem. and Biophys. Res. Comm. 128:713-720, 1985), or to artifacts of isolation.
Bovine somatotropin produced by recombinant microorganisms (rbSt), or extracted from pituitary gland tissue, is important commercially. It increased lactation in dairy cattle and increases size and meat production in beef cattle. It is estimated that upwards to 20 mg per animal per day is needed to effect commercially acceptable improvements in production. Such a dosage will require efficient methods of administration. Improvements in the potency and stability of bSt such as described in this invention will be of benefit because of resulting reductions in the amount of drug administered to each animal per day.
Porcine somatotropin has the three-dimensional structure of a four-helical bundle protein (Abdel-Meguid, S. S., Sieh, H.-S., Smithe, W. W., Dayringer, H. E., Violand, B. N., and Bentle, L. A. (1987) Proc. Natl. Acad. Sci. USA, 84, 6434-6437). The native conformation removes many hydrophobic amino acid residues from the surface of the protein thereby increasing solubility. Hydrophobic amino acid residues (those that are least soluble in aqueous buffers) have been classified using the scale established by Eisenberg. When partially unfolded, these hydrophobic amino acids are exposed to the aqueous medium and protein precipitation may result. Precipitation of rbSt that is observed during its manufacture likely occurs partially through this mechanism. In addition, bSt produced as a heterologous protein in E. coli is initially found in an insoluble state that may also result from these mechanisms (World Patent WO 8700204 and U.S. Pat. No. 4,518,526). The insoluble form of bSt can be solubilized by addition of detergents or denaturing agents. Biological activation occurs following removal of these reagents under controlled conditions, allowing the native conformation to form (World Patent WO 8700204 and U.S. Pat. No. 4,518,526). Once the native conformation is attained, bSt is relatively soluble. In the process of further manufacturing, however, rbSt is again exposed to conditions that perturb the native conformation, frequently leading to precipitation. For example, interfacial denaturation of bSt solutions is commonly encountered and is accelerated by vortexing or vigorous shaking. As above, the resulting precipitate is biologically inactive and may cause undesirable immunological responses. In addition, rapid pH changes or heating to temperatures >75.degree. can cause considerable precipitation of bSt (Burger, H. G., Edelhoch, H., and Condliffe, P. G. (1966) J. of Biol. Chem., 241, 449-457).
Previous equilibrium folding studies of bSt have identified a stable folding intermediate that forms on partial denaturation and aggregates at elevated protein concentrations (the terms aggregation and self-association, or simply association, are used here in the same manner) (Havel, H. A., Kauffman, E. W., Plaisted, S. M., and Brems, D. N. (1986) Biochemistry, 25, 6533-6538, and Brems, D. N., Plaisted, S. M., Kauffman, E. W., and Havel, H. A. (1986) biochemistry, 25, 6539-6543). This aggregated protein species is less soluble than the native or denatured conformations (Brems, Biochemistry 1988). Procedures have been developed to selectively precipitate and quantitate the aggregated intermediate. It has been shown that the aggregated intermediate is transiently populated during the kinetic refolding of bSt at elevated protein concentrations. If refolding is conducted in solutions that do not solubilize this protein species, the majority of bSt precipitates. If refolding is conducted in solutions that solubilize the aggregated intermediate, then native protein is quantitatively obtained (Brems, D. N., Plaisted, S. M., Dougherty, J. J. Jr., and Holzman, T. F. (1987) J. Biol. Chem., 262, 2590-2596).
Kinetic studies have led to the following model to describe bSt folding: ##STR1## where, N=native rbSt, I=monomeric folding intermediate, I.sub.assoc. =associated intermediate, U=unfolded rbSt, K.sub.assoc. =equilibrium constant for self-association, and I.sub.ppt =precipitated protein.
Convenient and selective methods that quantitate aggregated intermediate have been developed. For example, near UV circular dichroism (CD) of bSt, under conditions that lead to the formation of aggregation have a unique spectral band at 300 nm. (Havel, H. A., Kauffman, E. W., Plaisted, S. M., and Brems, D. N. (1986) Biochemistry, 25, 6533-6538). The aggregation alters the CD spectrum of the single tryptophan and results in this negative ellipticity. The presence of the aggregated intermediate also alters the equilibrium denaturation transitions (Havel, H. A., Kauffman, E. W., Plaisted, S. M., and Brems, D. N. (1986) Biochemistry, 25, 6533-6538, and Brems, D. N., Plaisted, S. M., Kauffman, E. W., and Havel, H. A. (1986) Biochemistry, 25, 6539-6543)). A region of bSt spanning residues 107 to 127 forms an amphiphilic .alpha.-helix and has been identified as a critical region that participates in the formation of the aggregation intermediate. By including an excess of fragment 109-133 or 96-133 to rbSt during refolding the formation of the associated intermediate is prevented and consequently no precipitate is formed (Brems, D. N., Plaisted, S. M., Kauffman, E. W., and Havel, H. A. (1986) Biochemistry, 25, 6539-6543). If Lys 112-rbSt (i.e., bSt with a lysine residue at position 112) is changed to a leucine residue (i.e., bSt with a leucine residue at position 112) by site-directed mutagenesis, then the hydrophobic portion of the amphiphilic helix is expanded, resulting in stabilization of the aggregated intermediate and which, therefore, undergoes more precipitation via the mechanism described above.
We have undertaken to solve these problems by designing analogs of bSt and pSt which self-associate, or aggregate, to a lesser extent that the parent proteins by synthesizing analogs that are less subject to aggregation because of reduced hydrophobicity while retaining or enhancing their biological activity. In addition, we have designed analogs that contain less .alpha.-helicity between residues 109 to 127, thereby reducing the potential of this region for hydrophobic interactions or partial denaturation. |
/** A class that handles model and view creation for the clipboard suggestions. */
public class ClipboardSuggestionProcessor extends BaseSuggestionViewProcessor {
private final Supplier<LargeIconBridge> mIconBridgeSupplier;
/**
* @param context An Android context.
* @param suggestionHost A handle to the object using the suggestions.
* @param iconBridgeSupplier A {@link LargeIconBridge} supplies site favicons.
*/
public ClipboardSuggestionProcessor(Context context, SuggestionHost suggestionHost,
Supplier<LargeIconBridge> iconBridgeSupplier) {
super(context, suggestionHost);
mIconBridgeSupplier = iconBridgeSupplier;
}
@Override
public boolean doesProcessSuggestion(AutocompleteMatch suggestion, int position) {
return suggestion.getType() == OmniboxSuggestionType.CLIPBOARD_URL
|| suggestion.getType() == OmniboxSuggestionType.CLIPBOARD_TEXT
|| suggestion.getType() == OmniboxSuggestionType.CLIPBOARD_IMAGE;
}
@Override
public int getViewTypeId() {
return OmniboxSuggestionUiType.CLIPBOARD_SUGGESTION;
}
@Override
public PropertyModel createModel() {
return new PropertyModel(SuggestionViewProperties.ALL_KEYS);
}
@Override
public void populateModel(AutocompleteMatch suggestion, PropertyModel model, int position) {
super.populateModel(suggestion, model, position);
boolean isUrlSuggestion = suggestion.getType() == OmniboxSuggestionType.CLIPBOARD_URL;
model.set(SuggestionViewProperties.IS_SEARCH_SUGGESTION, !isUrlSuggestion);
model.set(SuggestionViewProperties.TEXT_LINE_1_TEXT,
new SuggestionSpannable(suggestion.getDescription()));
setupContentField(suggestion, model, /* showContent = */ false);
}
/**
* Set the content related properties for the suggestion.
* @param suggestion The current suggestion.
* @param model Model representing current suggestion.
* @param showContent Whether the contents should be shown.
*/
private void setupContentField(@NonNull AutocompleteMatch suggestion,
@NonNull PropertyModel model, boolean showContent) {
String displayText = showContent ? suggestion.getDisplayText() : "";
model.set(SuggestionViewProperties.TEXT_LINE_2_TEXT, new SuggestionSpannable(displayText));
updateSuggestionIcon(suggestion, model, showContent);
updateActionButton(suggestion, model, showContent);
}
/**
* Update the icon for the current suggestion.
* If CLIPBOARD_SUGGESTION_CONTENT_HIDDEN is enabled, the content of the clipboard suggestion
* will not be shown by default until users clicked reveal button. If
* CLIPBOARD_SUGGESTION_CONTENT_HIDDEN is not enabled, the content of the clipboard suggestion
* will be shown if it is available.
* @param suggestion The current suggestion.
* @param model Model representing current suggestion.
* @param showContent Whether the contents should be shown.
*/
private void updateSuggestionIcon(@NonNull AutocompleteMatch suggestion,
@NonNull PropertyModel model, boolean showContent) {
boolean isUrlSuggestion = suggestion.getType() == OmniboxSuggestionType.CLIPBOARD_URL;
@DrawableRes
final int icon =
isUrlSuggestion ? R.drawable.ic_globe_24dp : R.drawable.ic_suggestion_magnifier;
setSuggestionDrawableState(model,
SuggestionDrawableState.Builder.forDrawableRes(getContext(), icon)
.setAllowTint(true)
.build());
if (!showContent) {
return;
}
// Show thumbnail for image suggestion if thumbnail available.
if (suggestion.getType() == OmniboxSuggestionType.CLIPBOARD_IMAGE) {
byte[] imageData = suggestion.getClipboardImageData();
if (imageData != null && imageData.length > 0) {
Bitmap bitmap = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);
if (bitmap != null) {
// TODO(crbug.com/1090919): This is short term solution, resize need to be
// handled somewhere else.
if (bitmap.getWidth() > 0 && bitmap.getHeight() > 0
&& (bitmap.getWidth() > getDecorationImageSize()
|| bitmap.getHeight() > getDecorationImageSize())) {
float max = Math.max(bitmap.getWidth(), bitmap.getHeight());
float scale = ((float) getDecorationImageSize()) / max;
float width = bitmap.getWidth();
float height = bitmap.getHeight();
bitmap = Bitmap.createScaledBitmap(bitmap, (int) Math.round(scale * width),
(int) Math.round(scale * height), true);
}
setSuggestionDrawableState(model,
SuggestionDrawableState.Builder.forBitmap(getContext(), bitmap)
.setUseRoundedCorners(true)
.setLarge(true)
.build());
return;
}
}
}
if (isUrlSuggestion) {
// Update favicon for URL if it is available.
fetchSuggestionFavicon(model, suggestion.getUrl(), mIconBridgeSupplier.get(), null);
}
}
/**
* Update the action button for the current suggestion.
* @param suggestion The current suggestion.
* @param model Model representing current suggestion.
* @param showContent Whether the contents should be shown.
*/
private void updateActionButton(@NonNull AutocompleteMatch suggestion,
@NonNull PropertyModel model, boolean showContent) {
int icon =
showContent ? R.drawable.ic_visibility_off_black : R.drawable.ic_visibility_black;
String iconString = getContext().getResources().getString(showContent
? R.string.accessibility_omnibox_conceal_clipboard_contents
: R.string.accessibility_omnibox_reveal_clipboard_contents);
String announcementString = getContext().getResources().getString(showContent
? R.string.accessibility_omnibox_conceal_button_announcement
: R.string.accessibility_omnibox_reveal_button_announcement);
Runnable action = showContent ? ()
-> concealButtonClickHandler(suggestion, model)
: () -> revealButtonClickHandler(suggestion, model);
setCustomActions(model,
Arrays.asList(new Action(
SuggestionDrawableState.Builder.forDrawableRes(getContext(), icon)
.setLarge(true)
.setAllowTint(true)
.build(),
iconString, announcementString, action)));
}
@Override
protected void onSuggestionClicked(@NonNull AutocompleteMatch suggestion, int position) {
if (!suggestion.getUrl().isEmpty()) {
super.onSuggestionClicked(suggestion, position);
return;
}
// Retrieve suggestion content before propagating the Click event.
suggestion.updateWithClipboardContent(
() -> { super.onSuggestionClicked(suggestion, position); });
}
/**
* Handle the click event for the reveal button.
* @param suggestion Selected suggestion.
* @param model Model representing current suggestion.
*/
// TODO(crbug.com/1198295): Make revealButtonClickHandler and concealButtonClickHandler private.
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public void revealButtonClickHandler(AutocompleteMatch suggestion, PropertyModel model) {
RecordUserAction.record("Omnibox.ClipboardSuggestion.Reveal");
if (suggestion.getUrl().isEmpty()) {
suggestion.updateWithClipboardContent(
() -> setupContentField(suggestion, model, /* showContent = */ true));
return;
}
setupContentField(suggestion, model, /* showContent = */ true);
}
/**
* Handle the click event for the conceal button.
* @param suggestion Selected suggestion.
* @param model Model representing current suggestion.
*/
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
public void concealButtonClickHandler(
@NonNull AutocompleteMatch suggestion, @NonNull PropertyModel model) {
RecordUserAction.record("Omnibox.ClipboardSuggestion.Conceal");
setupContentField(suggestion, model, /* showContent = */ false);
}
} |
<reponame>nielsvanhooy/unicon.plugins<filename>src/unicon/plugins/nxos/n7k/__init__.py
__author__ = '<NAME> <<EMAIL>>'
from unicon.plugins.nxos import (
NxosServiceList, HANxosServiceList,
NxosSingleRpConnection, NxosDualRPConnection)
from .setting import Nxos7kSettings
from .connection_provider import Nxos7kSingleRpConnectionProvider, Nxos7kDualRpConnectionProvider
class Nxos7kServiceList(NxosServiceList):
def __init__(self):
super().__init__()
class HANxos7kServiceList(HANxosServiceList):
def __init__(self):
super().__init__()
class Nxos7kSingleRpConnection(NxosSingleRpConnection):
platform = 'n7k'
subcommand_list = Nxos7kServiceList
settings = Nxos7kSettings()
connection_provider_class = Nxos7kSingleRpConnectionProvider
class Nxos7kDualRPConnection(NxosDualRPConnection):
platform = 'n7k'
subcommand_list = HANxos7kServiceList
settings = Nxos7kSettings()
connection_provider_class = Nxos7kDualRpConnectionProvider
|
<reponame>VueProjectCourse/HRManagerSystem<gh_stars>0
export default {
lang: 'en-US',
title: 'HRMS',
description: 'Human Resource Management System',
base: "/HRManagerSystem",
// markdown文件设置
markdown: {
lineNumbers: true
},
themeConfig: {
// 设置文档所在的文件夹
docsDir: 'docs',
// 是否展示 可编辑文档
editLinks: true,
// 搜索插件
algolia: {
apiKey: 'c57105e511faa5558547599f120ceeba',
indexName: 'vitepress'
},
// 顶部导航
nav: [
{ text: 'Guide', link: '/', activeMatch: '^/$|^/guide/' },
{
text: 'Config Reference',
link: '/config/basics',
activeMatch: '^/config/'
}
],
// 侧边栏导航
sidebar: {
'/': getGuideSidebar()
}
}
}
function getGuideSidebar() {
return [
{
text: "前置内容",
children: [
{ text: '项目介绍', link: '/documents/introduce' }
]
}
]
}
/*
⓵
⓶
⓷
⓸
⓹
⓺
⓻
⓼
⓽
⓾
*/ |
Overall, 41 shares were trading in the green in the Nifty50 index, while 9 were trading in the red.
While Tata Motors, Cipla, Bharti Airtel, Infosys and Coal India were trading in the red.
NEW DELHI: Around 22 stocks rose to touch their 52-week highs on NSE in Tuesday's session.
Among the stocks that touched their 52-week highs were 63 moons technologies, ARSS Infrastructure Projects, AstraZeneca Pharma, Bata India and Gillette India.
Indraprastha Gas, JSW Holdings, Kajaria Ceramics, Bank of Maharashtra, Info Edge (India), Metropolis Healthcare, Polycab India, Relaxo Footwears and Rail Vikas Nigam also featured among the stocks that touched their 52-week highs on NSE.
Benchmark NSE Nifty index was trading 91.70 points up at 11,782.05 while the BSE Sensex was trading 352.33 points up at 39,258.17.
In the Nifty 50 index, ICICI Bank, Larsen & Toubro, Asian Paints, IndusInd Bank and Bharti Infratel were among the top gainers. |
Death and the American South ed. by Craig Thompson Friend, Lorri Glover (review) By the 1860s, the Danes were also educating themselves intensively, creating novel folk high schools, developing Protestant congregational and evangelical forms of worship alongside the established state church, trading openly and widely, shipping grain profitably to the United States, and developing their nascent democracy. This intricate and unique story adds measurably to the literature on national identity formation. It also helps significantly to explain why Denmark and the other Nordic nations have been ranked the globes least corrupt polities since such measures were first compiled and published in 1995. Building the Nation, especially its most engaging chapters, focus onNikolai Frederik Severin Grundtvigs massive contribution to these major accomplishments as something of a founding father. Grundtvig was a thinker, a writer, and a polemicist, as well as a Lutheran preacher and a compiler and composer of hymns, who became a member of the Danish parliament after 1849. He was also, by turns, a monarchist and a reluctant democrat, a conservative theorist, and a modernizing activist. Grundtvig wrote a number of influential books that extolled the Danish peoples Nordic heritage, articulated a growing sense of national sensibility, and helped to merge the estates into a people. This book is neither especially methodological nor intrinsically interdisciplinary, but it contains twenty-three thoughtful chapters by political scientists, political theorists, sociologists, social historians, economic historians, and theologianspredominantly Danishwho each enrich our understanding of how and why Danish exceptionalism emerged and how and why little Denmark became a paragon of governance virtue in the twenty-first century. |
class UpdateMessage:
"""Contains all the observed+unobserved data related to a user update message."""
#####################
# observed variables
uid: UIDType
"""Unique Identifier (UID) of the updater at the time of the encounter."""
old_risk_level: RiskLevelType
"""Previous quantified risk level of the updater."""
new_risk_level: RiskLevelType
"""New quantified risk level of the updater."""
encounter_time: TimestampType
"""Discretized encounter timestamp."""
update_time: TimestampType
"""Update generation timestamp.""" # TODO: this might be a 1-31 rotating day id?
#############################################
# unobserved variables (for debugging only!)
_sender_uid: typing.Optional[RealUserIDType] = None
"""Real Unique Identifier (UID) of the updater."""
_receiver_uid: typing.Optional[RealUserIDType] = None
"""Real Unique Identifier (UID) of the user receiving the message."""
_real_encounter_time: typing.Optional[TimestampType] = None
"""Real encounter timestamp."""
_real_update_time: typing.Optional[TimestampType] = None
"""Real update generation timestamp."""
_exposition_event: typing.Optional[bool] = None
"""Flags whether the original encounter corresponds to an exposition event for the receiver."""
_update_reason: typing.Optional[str] = None
"""Reason why this update message was sent (for debugging).""" |
from rq import Queue, requeue_job
from rq.queue import FailedQueue
from redis import Redis
import os
conn_redis = Redis(host=os.environ['REDIS_HOST'],
password=os.environ['REDIS_PASSWORD'])
qfailed=FailedQueue(connection=conn_redis)
fail_registry_api = []
fail_no_xtf_results = []
fail_timeout = []
fail_other = []
###for job in Queue(connection=conn_redis).jobs:
### job.timeout = 2*job.timeout
### job.save()
### print job, job.timeout
for job in qfailed.jobs:
"ConnectionError: HTTPSConnectionPool(host='registry.cdlib.org'"
if "HTTPSConnectionPool(host='registry.cdlib.org'" in job.exc_info:
fail_registry_api.append(job)
elif "ValueError: http://dsc.cdlib.org/search" in job.exc_info:
fail_no_xtf_results.append(job)
elif "Job exceeded maximum timeout value" in job.exc_info:
fail_timeout.append(job)
else:
fail_other.append(job)
print(80*'=')
print('Registry connection fails:{0}, XTF No results:{1}, Timeout:{2} Other:{3}'.format(
len(fail_registry_api),
len(fail_no_xtf_results),
len(fail_timeout),
len(fail_other)
)
)
print(80*'=')
print('\n\n')
#for job in fail_other:
# print job.exc_info
for job in fail_no_xtf_results:
print('ValueError job: {}\n\n'.format(job))#, job.exc_info))
#job.cancel()
for job in fail_other:
try:
if "26094" in job.args[1]:
print('LAPL MARC exc_info:{}'.format(job.exc_info))
except IndexError:
pass
for job in fail_registry_api:
print('Job to requeue:{}'.format(job))
#requeue_job(job.get_id(), connection=conn_redis)
for job in fail_timeout:
print('TIMEOUT Before:{} {}'.format(job.timeout, job))
job.timeout = 2*job.timeout
job.save()
print('TIMEOUT after:{} {}'.format(job.timeout, job))
#requeue_job(job.get_id(), connection=conn_redis)
n_run_ingest = n_img_harv = n_no_shown_by = 0
for job in fail_other:
if '__getitem__' in job.exc_info:
n_no_shown_by += 1
print('{} {}'.format(job, job.exc_info))
job.cancel()
if 'Image_harvest' in job.get_call_string():
n_img_harv += 1
#print('{} {}'.format(job, job.exc_info))
if 'run_ingest' in job.get_call_string():
n_run_ingest += 1
job.timeout = 2*job.timeout
job.save()
#print('REQUEUE: {}\nTIMEOUT: {}'.format(job, job.timeout))
#requeue_job(job.get_id(), connection=conn_redis)
else:
print(job.get_call_string())
print('RIngest:{} IMG:{} NOSHOWNBY:{}'.format(n_run_ingest, n_img_harv, n_no_shown_by))
#print('id {} get_call_string {}, args {}'.format(job.get_id(), job.get_call_string(), job.args))
dir_job_listing= '''
['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_args', '_data', '_dependency_id', '_func_name', '_get_status', '_id', '_instance', '_kwargs', '_result', '_set_status', '_status', '_unpickle_data', 'args', 'cancel', 'cleanup', 'connection', 'create', 'created_at', 'data', 'delete', 'dependency', 'dependents_key', 'dependents_key_for', 'description', 'dump', 'ended_at', 'enqueued_at', 'exc_info', 'exists', 'fetch', 'func', 'func_name', 'get_call_string', 'get_id', 'get_status', 'get_ttl', 'id', 'instance', 'is_failed', 'is_finished', 'is_queued', 'is_started', 'key', 'key_for', 'kwargs', 'meta', 'origin', 'perform', 'refresh', 'register_dependency', 'result', 'result_ttl', 'return_value', 'save', 'set_id', 'set_status', 'status', 'timeout']
'''
|
Impact of Modifier Oxides on Mechanical and Radiation Shielding Properties of B2O3-SrO-TeO2-RO Glasses (Where RO = TiO2, ZnO, BaO, and PbO) The influence of modifier oxides (TiO2, ZnO, BaO, and PbO) on the mechanical and radiation shielding properties of boro-tellurate glasses is investigated. Samples with a composition of B2O3-SrO-TeO2-RO (RO represents the modifier oxides) were fabricated using the melt quench method, and their physical, mechanical, and radiation attenuation parameters were reported. For this aim, Monte Carlo simulation was employed to predict the radiation attenuation parameters, while the Makishima-Mackenzie model was adopted to determine the mechanical properties. The tightly packed structure with better cross-linkage density is possessed by the Ti-containing glass (SBT-Ti) system among the titled glass batch. The higher Poisson and micro-hardness values of the SBT-Ti glass indicate its structures reduced free volume and better compactness. For the glass with PbO, the linear and mass attenuation coefficients are highly increased compared to those glasses doped with TiO2, ZnO, and BaO. The thinner half-value layer was reported at 0.015 MeV, taking values 0.006, 0.005, 0.004, and 0.002 for samples with TiO2, ZnO, BaO, and PbO, respectively. SBT-Pb sample (with PbO) has a thinner HVL compared to other fabricated glass samples. The fabricated glasses thickness (Deq) equivalent to 1 cm of lead (Pb) was reported. The results demonstrated that Deq is high at low energy and equals 11.62, 8.81, 7.61, 4.56 cm for SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb glass samples, respectively. According to the Deq results, the fabricated glasses have a shielding capacity between 30 and 43% compared to the pure Pb at gamma-ray energy of 1.5 MeV. At high energy (8 MeV), the transmission factor values for a thickness of 1 cm of the fabricated samples reach 88.68, 87.83, 85.95, and 83.11% for glasses SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. Introduction Reasoned from industrialization, a ton of energy is delivered due to the increase in nuclear power plants. Making energy requires the lower cost of each crude material engaged with the cycle. The materials utilized for radiation shielding are indispensable and, subsequently, can't think twice about quality. In this way, the best way to decrease the expense is to discover new materials that can give better wellbeing for a minimal price. This is the motivation behind why a lot of exploration is going on around the world in regard to the safeguarding properties of different materials. Nowadays, a great interest is awarded by analysts to track down an appropriate elective contender for radiation protecting implementations. They understood that the glass systems could be favorable substances to obstruct harmful radiation. The ease of fabrication of glass, the transparency for light, and the simple design make the attractive environment for researchers. Various research groups are presently exploring the optically translucent glasses that can safeguard these radioactive beams adequately. In any case, the host network's decision is vital for glass structure in attainable temperature with excellent transparency. Likewise, to have the protecting properties, it is in every case great to pick a host with heavy metal oxides (HMO). Therefore, metal oxides like SiO 2, TeO 2, PbO, BaO, ZnO, and Bi 2 O 3, etc., could be used for practical applications. The fabrication, transport, and cleaning of glasses are so easy that led to various tries for studying the effect of different constituents on glass structures. The glasses have erosion obstruction, could be financially viable and transparent, which is a one-of-a-kind trademark. They have several advantages, and they can be utilized as a protecting substance and store container for nuclear garbage. Similarly, for the reasonable treatment of the dangerous beams, it is essential to have information about the photon interaction parameters (PIP). Among the various conceivable host matrices, conditional glass former tellurite (TeO 2 ) and the conventional glass former borate (B 2 O 3 ) based glasses are alluring hosts because of their particular trademark highlights. The use of TeO 2 with B 2 O 3 led to reducing the hygroscopic properties for borate and increasing the durability of the glass matrix, and this result can be seen in the previous work. Among the few glasses framing oxides, there is a broad measure of revenue in the choice of borate-based glass as the host lattice for the radiation protecting applications due to their surprising physical, mechanical, structural, and optical properties like transparency, lower dissolving temperature, and higher dielectric constant regardless of the way that they have more considerable phonon energy. Further, it is more fascinating because of its unconventional "boron anomaly" conduct. By adding alkaline earth metals such as Ba 2+, Ca 2+ into the network, one can catalyze the alteration of trigonal borates (BO 3 ) to tetrahedron borates (BO 4 ) which enhances the quantity of non-bridging oxygens (NBOs). The NBOs enhance various structural properties of the glasses. Furthermore, different research groups show tremendous interest in TeO 2 based glasses because of their benefits, which incorporate elevated density, better transparency in the mid-infrared region, reasonable phonon energy, superior mechanical and chemical constancy, etc., which make them a possible contender for the creation of optoelectronic gadgets. Besides, the presence of Zinc oxide (ZnO) in the picked glass framework works on the mechanical potency, chemical firmness and inferior thermal expansion, hygroscopic character. ZnO is a fantastic option for giving steadiness for the borate glasses for a minimal price. Additionally, the non-toxic nature makes it an ecoaccommodating factor. The glass-forming chance may likewise be improved with the introduction of ZnO by the change of fundamental TeO 4 units. Furthermore, it is relied upon to abbreviate the ideal opportunity for hardening during the quenching process. The alkali earth ions increment the chemical soundness and diminish the most extreme phonon energy through the progressive switch of BO 3 ↔BO 4 and TeO 3 ↔TeO 4. Also, barium oxide (BaO) is utilized in glass systems as a modifier; the purpose of using BaO lies in improving density and stability for different glass systems. While titanium oxide (TiO 2 ) can protect optical efficiency for glass systems when used within percent less than 20%, this percent was applied in this work. The addition of lead oxide (PbO) to various glass formers results in an extensive glass formation range of 20-80% and an adjustable refractive index. The current work is designed to evaluate various mechanical features and the radiation shielding potency of boro-tellurate glasses by changing the modifying HMO. Glass Fabrication Seven oxides like strontium oxide (SrO), tellurium oxide (TeO 2 ), boron oxide (B 2 O 3 ), titanium oxide (TiO 2 ), zinc oxide (ZnO), barium oxide (BaO), and lead oxide (PbO) were utilized to fabricate four glass samples using the traditional melt-quench technique. The oxides were purchased from different company: SrO (99.9%), TeO 2 (98%), B 2 O 3 (98%), BaO (99%) and (PbO) Aldrich, and ZnO (99.9%) WINLAB, while TiO 2 (98%) from BDH chemical Ltd. No purification was used for these chemicals. The chemical ratios for oxides are enlisted in Table 1. The traditional melt quench method was started by weighting the oxides carefully based on the mole percent for each sample, as shown in Table 1. After that, these chemical oxides were mixed and put in an alumina crucible. The mixture was introduced in an electrical furnace at 1000 C for 30 min to perform the melting process, and the mixture was stirred periodically during the melting process. Subsequently, the crucible was poured on a steel plate inside another furnace at 400 C to form glasses. The glasses were kept inside the electrical furnace for three hours to minimize the stress and reduce the glass fracture probability; then, the furnace temperature was lowered with a cooling rate of 15 C/min. The density for current glasses was measured experimentally using Archimedes principle; the special density kit from Rad Wag company was employed for determining the sample weight in the air (A) and liquid (B) according to the next relation: Here, liq represents the water density utilized as an immersion fluid in this experiment, this method was utilized in our previous work. Mechanical Properties Calculations Makishima and Mackenzie's calculation method was adopted for evaluating the mechanical properties of the prepared samples. The following are the semi-empirical equations for estimating the dissociation energy (G t ), packing density (V t ), elastic moduli, and Poisson's ratio of the prepared glasses. Dissociation energy Packing density where in, G i = dissociation energy per unit volume and V i = packing density with the ith components calculated from the literature. Young's modulus Longitudinal modulus Poisson's ratio Hardness The elastic moduli are expressed in terms of glass composition, G t, and V t. Radiation Shielding Calculations Using Monte Carlo Simulation It is known that the Monte Carlo simulation is a non-destructive method used to predict the shielding parameters of any material. The Monte Carlo simulation is a practical, non-expensive method that can save time and protect persons from the hazards of the radioactive sources during the experimental measurements. Also, in recent years many articles reported agreement between the simulated results predicted by the Monte Carlo simulations and the experimental measurements. In the present, the Monte Carlo simulation was utilized to predict the shielding parameters in the energy range between 0.015 and 15 MeV for some tellurite-based glasses. The chemical composition and density of the fabricated glasses presented in Table 1 were utilized in the MC simulation input file to introduce the fabricated material. The input file also introduces the dimensions of the sample where it is a cylinder with a diameter of 1 cm and a thickness of 0.25 cm. The sample was pleased with a distance of 9 cm from the detector and 11 cm from the point source. Also, the sample is placed between two collimators to collimate the radiation emitted from the radioactive source and transmitted from the sample. These two collimators as well as the outer shielding material (the outer cylinder), are made of lead with dimensions illustrated in Figure 1. The detector in the present study is an F4 tally to record the detector cell's mean flux per unit volume. The simulation carried out with NPS card equal 10 6 historical, and the importance is assumed to be 1 for important cells (cells in which the photons can pass and interact) and 0 for void cells (cells in which the photons shouldn't pass). The source card is arranged in the input file to describe the radioactive source location, emission type, direction of emission, energy, probability, and distribution of the emitted particle. The simulation was performed, and the output files showed that the relative error was in the range of ± 1%. Finally, the received average track length for all samples was transferred to other linear attenuation coefficients. Appl. Sci. 2021, 11, 10904 5 of 15 tion, emission type, direction of emission, energy, probability, and distribution of the emitted particle. The simulation was performed, and the output files showed that the relative error was in the range of ± 1%. Finally, the received average track length for all samples was transferred to other linear attenuation coefficients. Material Features Study The application of glassy complexes for radiation shielding purposes is a function of its composition, which accordingly impacts the material properties of the system. Following the proposed glass's compositional layout, some physical and mechanical attributes were computed to depict the effect of various heavy metal ion modifiers incorporated in the system. From Tables 1 and 2, the variation in the measured density and molar volume values validate the effect of modifiers, and it is graphically signified in Figure 2. The figure indicates the compositional variation in density and molar volume as the additive is varied in each system and the values follow the order SBT-Pb > SBT-Ba > SBT-Zn > SBT-Ti and SBT-Ti > SBT-SBT-Pb > SBT-Ba > SBT-Zn, respectively. The behavior of molar volume is contrary to that of density in the general case. However, in the current investigation, it is unnoticed due to the formation of various structural units due to additives inclusion and non-bridging oxygens (NBOs) creation in the modifier reliant multi-component glass matrices. Material Features Study The application of glassy complexes for radiation shielding purposes is a function of its composition, which accordingly impacts the material properties of the system. Following the proposed glass's compositional layout, some physical and mechanical attributes were computed to depict the effect of various heavy metal ion modifiers incorporated in the system. From Tables 1 and 2, the variation in the measured density and molar volume values validate the effect of modifiers, and it is graphically signified in Figure 2. The figure indicates the compositional variation in density and molar volume as the additive is varied in each system and the values follow the order SBT-Pb > SBT-Ba > SBT-Zn > SBT-Ti and SBT-Ti > SBT-SBT-Pb > SBT-Ba > SBT-Zn, respectively. The behavior of molar volume is contrary to that of density in the general case. However, in the current investigation, it is unnoticed due to the formation of various structural units due to additives inclusion and non-bridging oxygens (NBOs) creation in the modifier reliant multi-component glass matrices. In the case of multi constituent glasses, each element applies its effect so that any change in the mechanical attribute can be considered as a combination of the impact of all the individual constituents. With this context, the mechanical moduli (including young, bulk, shear, and longitudinal moduli) along with Poisson's ratio, microhardness, and more features were calculated for the as-prepared glass specimens with the formulae specified in the literature and gathered in Table 2 In the case of multi constituent glasses, each element applies its effect so that any change in the mechanical attribute can be considered as a combination of the impact of all the individual constituents. With this context, the mechanical moduli (including young, bulk, shear, and longitudinal moduli) along with Poisson's ratio, microhardness, and more features were calculated for the as-prepared glass specimens with the formulae specified in the literature and gathered in Table 2. The correlation between dissociation energy and packing density is illustrated in Figure 3, which depicts the fact that among all the proposed glasses, SBT-Ti is noticed to own greater volume density of binding energy and reduced ionic volume that are essential for better radiation attenuation. The structural compactness and alteration in the geometrical arrangement in the glass complexes due to additives inclusion are apparent from the estimated elastic constants, which are graphically correlated in Figure 4. The change in the elastic moduli denotes the distinction in the nature and strength of the chemical bonds, cross-link density, which describes the glass configuration and is also related to the dissociation energy of the system. Figure 4 proves that the tightly packed structure with better cross-linkage density is possessed by the SBT-Ti glass system among the titled glass batch. The elastic moduli also rely on the shear and longitudinal velocities of the complex, which are also high for the SBT-Ti glass system, as observed in Table 2. The gradual reduction in both the velocities in the systems with different additives results from the rise in the molar volume, which leads to a loosened structure. Commonly, the Poisson's ratio of glassy complexes is affected by the alteration in its cross-link density which arises from the structural modification. If the Poisson's ratio lies in the range 0.1-0.2, the cross-link density will be high for the system with the better tightly packed structure to capture radiation. For the present proposed glasses, the Poisson's ratio lies in the range 0.268-0.278, depicting better cross-link density of the tiled glasses that signifies better shielding performance. From the table, the observed reduction in the softening temperature (SBT-Ti > SBT-Zn > SBT-Ba > SBT-Pb) denotes the rise in the production of NBOn that causes a loosely bounded glass structure with reduced lattice vibrations. The micro-hardness usually depicts the essential stress to remove the glass matrix's free volume (distortion of the system). The free volume denotes the loosely packed structure, which should be minimum for a shielding medium. Figure 5 portrays the correlation between Poisson and micro-hardness of the studied glasses that expresses higher values of the SBT-Ti glass, indicating reduced free volume and better compactness of the structure than other samples. The bond fractal connectivity is a vital feature relating the mechanical attributes of glasses to their networks. The effective dimensionality and crosslink density of glassy systems can be expressed by means of bond fractal connectivity. The evaluated values may lie in the range of 1,2,3 for the chain, layer structure, and 3D structure depending upon the complexes. It is apparent from Table 2 that the assessed values lie in the range 2.087-2.201 for the as-polished samples symbolizing their 2D layer structure. Appl. Sci. 2021, 11, x FOR PEER REVIEW 7 of 16 energy and packing density is illustrated in Figure 3, which depicts the fact that among all the proposed glasses, SBT-Ti is noticed to own greater volume density of binding energy and reduced ionic volume that are essential for better radiation attenuation. The structural compactness and alteration in the geometrical arrangement in the glass complexes due to additives inclusion are apparent from the estimated elastic constants, which are graphically correlated in Figure 4. The change in the elastic moduli denotes the distinction in the nature and strength of the chemical bonds, cross-link density, which describes the glass configuration and is also related to the dissociation energy of the system. Figure 4 proves that the tightly packed structure with better cross-linkage density is possessed by the SBT-Ti glass system among the titled glass batch. The elastic moduli also rely on the shear and longitudinal velocities of the complex, which are also high for the SBT-Ti glass system, as observed in Table 2. The gradual reduction in both the velocities in the systems with different additives results from the rise in the molar volume, which leads to a loosened structure. Commonly, the Poisson's ratio of glassy complexes is affected by the alteration in its cross-link density which arises from the structural modification. If the Poisson's ratio lies in the range 0.1-0.2, the cross-link density will be high for the system with the Radiation Attenuation Studies The mass attenuation coefficient (m, cm 2 /g) of the fabricated SBT-n glasses was calculated in an energy range varied between 0.015 and 15 MeV using the Monte Carlo simulation with a narrow beam transmission method. The achieved results were affirmed using the XCOM theoretical program calculated data for the fabricated sample. Figure 6 shows an agreement between the simulated m using MC simulation and the calculated data by the XCOM program, along with the studied energy range. Also, Figure 6 shows that the highest m values achieved at gamma-ray energy 0.015 due to the photoelectric interaction, which has a cross-section of interaction that varies inversely with the third power of energy (pe E −3.5 ). The represented values in Figure 6 showed that the m at 0.015 MeV varied in the order of 26.836, 33.419, 35.071, and 52.658 cm 2 /g for glasses SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. The high variation in the m values is related to the significant variation which occurred in the glass samples with the addition of the dopant compounds where the addition of the PbO to SBT glass causes a higher increase in the molecular weight of the fabricated glass, which has a positive effect on the density and atomic weight of the fabricated glasses. Thus, the linear and mass attenuation coefficients are highly increased compared to those glasses doped with TiO2, ZnO, and BaO. The effect of glasses' atomic weight and density appears in the low energy region (photoelectric region) because the cross-section varies directly with the fourth power of the effective atomic number of the glass sample (pe Z 4−5 ). According to the data presented in Radiation Attenuation Studies The mass attenuation coefficient (m, cm 2 /g) of the fabricated SBT-n glasses was calculated in an energy range varied between 0.015 and 15 MeV using the Monte Carlo simulation with a narrow beam transmission method. The achieved results were affirmed using the XCOM theoretical program calculated data for the fabricated sample. Figure 6 shows an agreement between the simulated m using MC simulation and the calculated data by the XCOM program, along with the studied energy range. Also, Figure 6 shows that the highest m values achieved at gamma-ray energy 0.015 due to the photoelectric interaction, which has a cross-section of interaction that varies inversely with the third power of energy ( pe E −3.5 ). The represented values in Figure 6 showed that the m at 0.015 MeV varied in the order of 26.836, 33.419, 35.071, and 52.658 cm 2 /g for glasses SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. The high variation in the m values is related to the significant variation which occurred in the glass samples with the addition of the dopant compounds where the addition of the PbO to SBT glass causes a higher increase in the molecular weight of the fabricated glass, which has a positive effect on the density and atomic weight of the fabricated glasses. Thus, the linear and mass attenuation coefficients are highly increased compared to those glasses doped with TiO 2, ZnO, and BaO. The effect of glasses' atomic weight and density appears in the low energy region (photoelectric region) because the cross-section varies directly with the fourth power of the effective atomic number of the glass sample ( pe Z 4−5 ). According to the data presented in Figure 6, another interaction region (Compton scattering) began from 0.15 MeV and extended to lower than 5 MeV. In the mentioned region, the variation of the m reduced linearly with energy. It linearly increased with the Z. The m values varied between 0.3709-0.0311, 0.3853-0.0314, 0.04784-0.0324, and 0.8982-0.0348 cm 2 /g with an average of 0.1040, 0.1060, 0.1198, 1855 cm 2 /g for samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. Also, the effect of the doping compounds in this energy hasn't a significant effect compared to the photoelectric region. In the mentioned intermediate region, the linear variation of the m values is related to the Compton scattering cross-section where CS Z/E. In the high energy region (E≥ 5 MeV), according to data presented in Figure 6, the m values began to increase with energy increase slightly. This behavior is due to the pair production interaction (PP) in which the cross-section varied with log E and Z 2. Thus, the m values are close together for all fabricated samples and they are independent on the incident gamma-ray energy. In this energy region the m values have a slight increase between 0.0296-0.0308, 0.0302-0.0318, 0.0319-0.0346, 0.0351-0.0392 cm 2 /g for the fabricated samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. Appl. Sci. 2021, 11, x FOR PEER REVIEW 10 of 16 0.3709-0.0311, 0.3853-0.0314, 0.04784-0.0324, and 0.8982-0.0348 cm 2 /g with an average of 0.1040, 0.1060, 0.1198, 1855 cm 2 /g for samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. Also, the effect of the doping compounds in this energy hasn't a significant effect compared to the photoelectric region. In the mentioned intermediate region, the linear variation of the m values is related to the Compton scattering cross-section where CS Z/E. In the high energy region (E≥ 5 MeV), according to data presented in Figure 6, the m values began to increase with energy increase slightly. This behavior is due to the pair production interaction (PP) in which the cross-section varied with log E and Z 2. Thus, the m values are close together for all fabricated samples and they are independent on the incident gamma-ray energy. In this energy region the m values have a slight increase between 0.0296-0.0308, 0.0302-0.0318, 0.0319-0.0346, 0.0351-0.0392 cm 2 /g for the fabricated samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. The relation between the half-value layer (HVL, cm) (the thickness required to reduce the incident gamma flux to half of its initial value ) and the incident gamma-ray photons was illustrated in Figure 7. The thinner HVL achieved at the lowest gamma-ray energy among the studied energy range (i.e., 0.015 MeV) takes values 0.006, 0.005, 0.004, and 0.002 for samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. This law value is due to the predominant of the PE interaction at the mentioned energy. Thus, the photon energy is absorbed in one collision with a boundary electron. Also, it is clear that the SBT-Pb has a thinner HVL compared to other fabricated glass samples. This is related to the PbO compound, which has a high density and cross-section of interaction. Hence, insertion of the PbO offers an additional resistance for passing photons, and the result is a significant reduction in the HVL values. In the low energy region in which the PE interaction is predominant, the HVL suffers a high increase with raising the photon energy. The relation between the half-value layer (HVL, cm) (the thickness required to reduce the incident gamma flux to half of its initial value ) and the incident gamma-ray photons was illustrated in Figure 7. The thinner HVL achieved at the lowest gamma-ray energy among the studied energy range (i.e., 0.015 MeV) takes values 0.006, 0.005, 0.004, and 0.002 for samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. This law value is due to the predominant of the PE interaction at the mentioned energy. Thus, the photon energy is absorbed in one collision with a boundary electron. Also, it is clear that the SBT-Pb has a thinner HVL compared to other fabricated glass samples. This is related to the PbO compound, which has a high density and cross-section of interaction. Hence, insertion of the PbO offers an additional resistance for passing photons, and the result is a significant reduction in the HVL values. In the low energy region in which the PE interaction is predominant, the HVL suffers a high increase with raising the photon energy. Increasing the energy of incident photons higher than 0.1 MeV causes a change in the interaction mode in which gamma-ray interacts with the glass atoms, where the PE decreases and CS begins to increase with raising the incident gamma photon energies. In this energy interval, the HVL increased linearly with energy. The HVL varies the range of 0.191-3.588, 0.171-3.397, 0.114-3.117, 0.054-2.717 cm with average HVL of 1.844, 1.739, 1.546, and 1.234 cm for glass samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. The HVL continued its increase with the incident energy until 5 MeV, and then it began to reverse the trend and decreased slightly with raising the incident gamma photon energy. This decrease is due to the pair production, as illustrated in the mass attenuation coefficient section. The HVL in the mentioned interval varied between 5.768-5.543, 5.340-5.078, 4.579-4.223, 3.746-3.358 cm for samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb when the incident energy varied between 8 and 15 MeV, respectively. Increasing the energy of incident photons higher than 0.1 MeV causes a change in the interaction mode in which gamma-ray interacts with the glass atoms, where the PE decreases and CS begins to increase with raising the incident gamma photon energies. In this energy interval, the HVL increased linearly with energy. The HVL varies the range of 0.191-3.588, 0.171-3.397, 0.114-3.117, 0.054-2.717 cm with average HVL of 1.844, 1.739, 1.546, and 1.234 cm for glass samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. The HVL continued its increase with the incident energy until 5 MeV, and then it began to reverse the trend and decreased slightly with raising the incident gamma photon energy. This decrease is due to the pair production, as illustrated in the mass attenuation coefficient section. The HVL in the mentioned interval varied between 5.768-5.543, 5.340-5.078, 4.579-4.223, 3.746-3.358 cm for samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb when the incident energy varied between 8 and 15 MeV, respectively. The fabricated glasses' thickness (D eq ) equivalent to 1 cm of lead (Pb) was calculated at various energies, as presented in Figure 8. For all samples except the SBT-Pb, the D eq start very high at low energy. It takes values of 11.62, 8.81, 7.61, 4.56 cm for glasses SBT-Ti, SBT-Zn, SBTBa, and SBT-Pb, respectively. This high value of D eq is related to the high linear attenuation coefficient (LAC) of the Pb standard sample, where the LAC of the fabricated glasses is low compared to the LAC of Pb. After that, a sharp drop was achieved between 0.05 and 0.08 MeV. This reduction in the D eq for all samples is related to the K absorption edges of Te, which is the glass former in all studied glasses. In this energy interval between 0.05 and 0.08 MeV the D eq takes values of 4.14, 3.73, 2.49, and 2.57 cm for samples SBT-Ti, SBT-Zn, SBTBa, and SBT-Pb. Above 0.1 MeV, the D eq began to decrease gradually with increasing the incident gamma-ray energy. This is due to the CS interaction and increases in the LAC of fabricated glasses compared to Pb in this energy region. The lowest values of D eq achieved at gamma-ray energy, 1.5 MeV, take values 3.07, 2.90, 2.66, and 2.32 cm for the fabricated glasses SBT-Ti, SBT-Zn, SBTBa, and SBT-Pb. This illustrates that the fabricated glasses have a shielding capacity varied between 30 and 43% compared to the pure Pb at gamma-ray energy of 1.5 MeV. Above 1.5 MeV, the D eq began to increase slightly due to the small increase in the LAC of Pb compared to the fabricated glass samples. Also, Figure 8 illustrates that the high values of D eq obtained for glass samples SBT-Ti while the lowest achieved for the SBT-Pb. This is related to the amount of gamma-ray passing resistance offered by TiO 2 and PbO compounds, where the mentioned resistance for PbO is higher than that of TiO 2. Thus, the linear attenuation coefficient of the glasses containing PbO is higher than that of TiO 2 glasses, and the D eq for PbO doped glasses is lower than that of TiO 2 doped glasses. gradually with increasing the incident gamma-ray energy. This is due to the CS interaction and increases in the LAC of fabricated glasses compared to Pb in this energy region. The lowest values of Deq achieved at gamma-ray energy, 1.5 MeV, take values 3.07, 2.90, 2.66, and 2.32 cm for the fabricated glasses SBT-Ti, SBT-Zn, SBTBa, and SBT-Pb. This illustrates that the fabricated glasses have a shielding capacity varied between 30 and 43% compared to the pure Pb at gamma-ray energy of 1.5 MeV. Above 1.5 MeV, the Deq began to increase slightly due to the small increase in the LAC of Pb compared to the fabricated glass samples. Also, Figure 8 illustrates that the high values of Deq obtained for glass samples SBT-Ti while the lowest achieved for the SBT-Pb. This is related to the amount of gamma-ray passing resistance offered by TiO2 and PbO compounds, where the mentioned resistance for PbO is higher than that of TiO2. Thus, the linear attenuation coefficient of the glasses containing PbO is higher than that of TiO2 glasses, and the Deq for PbO doped glasses is lower than that of TiO2 doped glasses. The transmission factor (TF, %) measures the photon numbers that can penetrate or escape from the shielding material. In contrast, the radiation protection efficiency (RPE, %) measures the number of photons that the shielding material can stop or absorb during the interaction. Both TF and RPE were investigated for the fabricated glasses and presented in Figure 9 versus the incident gamma-ray photon. Figure 9a shows that the TF The transmission factor (TF, %) measures the photon numbers that can penetrate or escape from the shielding material. In contrast, the radiation protection efficiency (RPE, %) measures the number of photons that the shielding material can stop or absorb during the interaction. Both TF and RPE were investigated for the fabricated glasses and presented in Figure 9 versus the incident gamma-ray photon. Figure 9a shows that the TF values at low gamma-ray energy up to 0.1 MeV are very small due to the photoelectric interaction, which consumes the low energy of photons totally in the interaction to produce a free electron. As a result, the photon is absorbed inside the fabricated SBT-n glasses, and the probability of scattering or escaping photons from the fabricated materials is very low. Thus, the TF values tend to be minimum values. With increasing the incident gamma-ray energy, some photons began to pass enough energy to penetrate and transmit the fabricated material. This is due to the change in the photon interaction mode where the photoelectric interaction decreases and the Compton scattering interaction begins to be the dominant interaction. Hence, the scattering and penetrated photons increase. The TF values increase gradually with increasing the CS interaction until maximum values at 8 MeV. The TF values for a thickness of 1 cm of the fabricated samples reach 88.68, 87.83, 85.95, and 83.11% for glasses SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. After that, a slight decrease in the TF values was observed when the photon energy raised above 8 MeV due to the pair production interaction in which the probability of photon annihilation increased when the photon energy increased more than 1.024 MeV. ray energy, some photons began to pass enough energy to penetrate and transmit the fabricated material. This is due to the change in the photon interaction mode where the photoelectric interaction decreases and the Compton scattering interaction begins to be the dominant interaction. Hence, the scattering and penetrated photons increase. The TF values increase gradually with increasing the CS interaction until maximum values at 8 MeV. The TF values for a thickness of 1 cm of the fabricated samples reach 88.68, 87.83, 85.95, and 83.11% for glasses SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. After that, a slight decrease in the TF values was observed when the photon energy raised above 8 MeV due to the pair production interaction in which the probability of photon annihilation increased when the photon energy increased more than 1.024 MeV. In contrast, Figure 9b illustrates the RPE variation versus the incident gamma photon energies, where the first look demonstrates that the RPE is totally opposite to the TF. The RPE at low energy is close to 100% because of the high absorption cross-section of the fabricated glasses for the low-energy photons. Thus, all photons with energy lower than 0.15 MeV are absorbed inside the glass layer and can't penetrate a thickness of 1 cm of the fabricated glass samples. Above 0.15 MeV, the scattered photons from the fabricated glass thickness increased, and the number of photons penetrating the thickness began to increase with photon energy. Thus, the RPE reduced gradually with energy until minimum RPE was achieved at 8 MeV. The minimum RPE is 11.32, 12.17, 14.05, and 16.89% for samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. In contrast, Figure 9b illustrates the RPE variation versus the incident gamma photon energies, where the first look demonstrates that the RPE is totally opposite to the TF. The RPE at low energy is close to 100% because of the high absorption cross-section of the fabricated glasses for the low-energy photons. Thus, all photons with energy lower than 0.15 MeV are absorbed inside the glass layer and can't penetrate a thickness of 1 cm of the fabricated glass samples. Above 0.15 MeV, the scattered photons from the fabricated glass thickness increased, and the number of photons penetrating the thickness began to increase with photon energy. Thus, the RPE reduced gradually with energy until minimum RPE was achieved at 8 MeV. The minimum RPE is 11.32, 12.17, 14.05, and 16.89% for samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. Figure 10 illustrates the effect of glass thickness on the TF and RPE values. It is clear that from Figure 10a, the TF decreases gradually with growing the glass thickness where the TF values reduced between 88.76 and 30.36% (for SBT-Ti), 77.74 and 28.39% (for SBT-Zn), 75.93 and 25.239% (for SBT-Ba), 72.353 and 19.819% (for SBR-Pb) when the glass thickness grow between 0.5 and 4 cm, respectively, for gamma-ray energy of 1 MeV. Raising the glass thickness increases the probability of gamma-ray interaction along their path length. Thus, the photon loses a high amount of its energies in collusions and does not have enough power to penetrate the material thickness. As a result, the TF values decrease with growing the fabricated glasses thickness. ness grow between 0.5 and 4 cm, respectively, for gamma-ray energy of 1 MeV. Raising the glass thickness increases the probability of gamma-ray interaction along their path length. Thus, the photon loses a high amount of its energies in collusions and does not have enough power to penetrate the material thickness. As a result, the TF values decrease with growing the fabricated glasses thickness. In contrast, the RPE increases gradually with growing the fabricated glass thickness, as illustrated in Figure 10b. The mentioned figure showed that the low values of RPE achieved at the thinner thicknesses are related to the TF of the gamma photons. For thinner thicknesses, the photons TF is relatively high, so a lot of photons can penetrate the shielding thickness and reach the human cells beyond the shielding. Thus, the RPE offered by this shielding thickness is relatively low. With growing the glass thickness, the TF decreases, as mentioned earlier, so the number of photons penetrating the thickness becomes small, and the RPE increases. At gamma-ray energy of 1 MeV, the RPE increases between 11.23-69.63%, 11.82-71.60%, 12.86-74.76%, and 14.93-80.17% for the fabricated glass samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. Conclusions Boro-tellurate glasses were fabricated using four various modifier oxides and investigated the influence of these oxides on both the mechanical and radiation shielding properties of the prepared samples. Monte Carlo simulation and the Makishima-Mackenzie model have been used in this work. The linear and mass attenuation coefficients for the glass with PbO are higher than the other samples. Thus, the SBT-Pb glass sample has a In contrast, the RPE increases gradually with growing the fabricated glass thickness, as illustrated in Figure 10b. The mentioned figure showed that the low values of RPE achieved at the thinner thicknesses are related to the TF of the gamma photons. For thinner thicknesses, the photons TF is relatively high, so a lot of photons can penetrate the shielding thickness and reach the human cells beyond the shielding. Thus, the RPE offered by this shielding thickness is relatively low. With growing the glass thickness, the TF decreases, as mentioned earlier, so the number of photons penetrating the thickness becomes small, and the RPE increases. At gamma-ray energy of 1 MeV, the RPE increases between 11.23-69.63%, 11.82-71.60%, 12.86-74.76%, and 14.93-80.17% for the fabricated glass samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. Conclusions Boro-tellurate glasses were fabricated using four various modifier oxides and investigated the influence of these oxides on both the mechanical and radiation shielding properties of the prepared samples. Monte Carlo simulation and the Makishima-Mackenzie model have been used in this work. The linear and mass attenuation coefficients for the glass with PbO are higher than the other samples. Thus, the SBT-Pb glass sample has a better attenuation competence than the SBT-Ti, SBT-Zn, and SBT-Ba samples. The thinner HVL achieved at the lowest gamma-ray energy among the studied energy range (i.e., 0.015 MeV) takes values 0.006, 0.005, 0.004, and 0.002 for samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. At moderate energy, the HVL varies the range of 0.191-3.588, 0.171-3.397, 0.114-3.117, 0.054-2.717 cm with average HVL of 1.844, 1.739, 1.546, and 1.234 cm for glass samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb, respectively. While the HVL in the high energy region varied between 5.768-5.543, 5.340-5.078, 4.579-4.223, 3.746-3.358 cm for samples SBT-Ti, SBT-Zn, SBT-Ba, SBT-Pb. At 1 MeV, the RPE increases between 11.23-69.63%, 11.82-71.60%, 12.86-74.76%, and 14.93-80.17% for the fabricated glass samples SBT-Ti, SBT-Zn, SBT-Ba, and SBT-Pb, respectively. The TF and RPE results reaffirm that utilization of the PbO in the prepared glasses has a considerable role in the attenuation performance for the prepared samples. |
import {
BaseEntity,
Entity,
PrimaryGeneratedColumn,
Column,
ManyToOne,
JoinColumn,
OneToMany,
OneToOne,
BeforeInsert,
BeforeUpdate,
} from 'typeorm';
import { MsgVideo } from './msg_video.entity';
import { MsgAudio } from './msg_audio.entity';
import { MsgPhoto } from './msg_photo.entity';
import { MsgSticker } from './msg_sticker.entity';
import { Client } from '../client/client.entity';
import { Room } from '../room/room.entity';
import { validate, IsNotEmpty, IsDate, IsOptional, validateOrReject } from 'class-validator';
import { BadRequestException } from '@nestjs/common';
import { MessageCreateDto } from './dto/message_create.dto';
import { MessageRecipiant } from './messag_recipiant.enum';
@Entity('message')
export class Message extends BaseEntity {
//#region COLUMNS
@PrimaryGeneratedColumn()
message_id!: number;
@Column({ nullable: true})
@IsOptional()
text?: string;
@Column({nullable: false})
@IsNotEmpty()
@IsDate()
created_at!: Date;
@Column({nullable: false})
@IsNotEmpty()
@IsDate()
updated_at!: Date;
//#endregion
//#region RELATIONS
// relation with Client (SENDER)
@ManyToOne(
type => Client,
client => client.sent_messages,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: false,
},
)
@JoinColumn({ name: 'sender_client_id'})
sender_client?: Client;
@Column()
sender_client_id: number;
// relation with Client (RECIVER)
@ManyToOne(
type => Client,
client => client.recived_messages,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: false,
},
)
@JoinColumn({ name: 'reciver_client_id'})
reciver_client?: Client;
@Column({ nullable: true })
reciver_client_id?: number;
// relation with ROOM (RECIVER)
@ManyToOne(
type => Room,
room => room.recived_messages,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: false,
},
)
@JoinColumn({ name: 'reciver_room_id'})
reciver_room?: Room;
@Column({ nullable: true })
reciver_room_id?: number;
// relation with Video
@OneToOne(
type => MsgVideo,
msgVideo => msgVideo.message,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: true,
},
)
@JoinColumn({ name: 'msg_video_id' })
msg_video?: MsgVideo;
@Column({ nullable: true })
msg_video_id?: number;
// relation with Audio
@OneToOne(
type => MsgAudio,
msgAudio => msgAudio.message,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: true,
},
)
@JoinColumn({ name: 'msg_audio_id' })
msg_audio?: MsgAudio;
@Column({ nullable: true })
msg_audio_id?: number;
// relation with Photo
@OneToOne(
type => MsgPhoto,
msgPhoto => msgPhoto.message,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: true,
},
)
@JoinColumn({ name: 'msg_photo_id' })
msg_photo?: MsgPhoto;
@Column({ nullable: true })
msg_photo_id?: number;
// relation with Sticker
@OneToOne(
type => MsgSticker,
msgSticker => msgSticker.message,
{
cascade: [ 'insert', 'update' ],
onDelete: 'CASCADE',
// only one side of relationship could be eager
eager: true,
},
)
@JoinColumn({ name: 'msg_sticker_id' })
msg_sticker?: MsgSticker;
@Column({ nullable: true })
msg_sticker_id?: number;
//#endregion
// public static of(params: Partial<Message>): Message {
public static of(params: MessageCreateDto, sender_id: number): Message {
const nMessage = new Message();
// TODO: 🎯 if message is sent to room maybe we should check if it has member of room or not?
Object.assign(nMessage, params);
nMessage.sender_client_id = sender_id;
nMessage.created_at = new Date();
nMessage.updated_at = new Date();
return nMessage;
}
@BeforeInsert()
@BeforeUpdate()
public async checkDataValidation() {
const errors = await validate(this);
if (errors.length > 0) {
// console.log('<<checkDataValidation>> errors: ', errors);
throw new BadRequestException('Validation failed!');
}
}
} |
<filename>src/sys/lib/cm_json/src/lib.rs
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
serde_json,
serde_json::Value,
std::borrow::Cow,
std::error,
std::fmt,
std::fs::File,
std::io::{self, Read},
std::path::Path,
};
#[derive(Debug)]
pub struct JsonSchema<'a> {
// Cow allows us to store either owned values when needed (as in new_from_file) or borrowed
// values when lifetimes allow (as in new).
pub name: Cow<'a, str>,
pub schema: Cow<'a, str>,
}
impl<'a> JsonSchema<'a> {
pub const fn new(name: &'a str, schema: &'a str) -> Self {
Self { name: Cow::Borrowed(name), schema: Cow::Borrowed(schema) }
}
pub fn new_from_file(file: &Path) -> Result<Self, Error> {
let mut schema_buf = String::new();
File::open(&file)?.read_to_string(&mut schema_buf)?;
Ok(JsonSchema {
name: Cow::Owned(file.to_string_lossy().into_owned()),
schema: Cow::Owned(schema_buf),
})
}
}
// Directly include schemas in the library. These are used to parse component manifests.
pub const CMX_SCHEMA: &JsonSchema<'_> =
&JsonSchema::new("cmx_schema.json", include_str!("../cmx_schema.json"));
/// The location in the file where an error was detected.
#[derive(PartialEq, Clone, Debug)]
pub struct Location {
/// One-based line number of the error.
pub line: usize,
/// One-based column number of the error.
pub column: usize,
}
/// Enum type that can represent any error encountered by a cmx operation.
#[derive(Debug)]
pub enum Error {
Io(io::Error),
Parse { err: String, location: Option<Location>, filename: Option<String> },
Validate { schema_name: Option<String>, err: String, filename: Option<String> },
}
impl error::Error for Error {}
impl Error {
pub fn parse(
err: impl fmt::Display,
location: Option<Location>,
filename: Option<&Path>,
) -> Self {
Self::Parse {
err: err.to_string(),
location,
filename: filename.map(|f| f.to_string_lossy().into_owned()),
}
}
pub fn validate(err: impl fmt::Display) -> Self {
Self::Validate { schema_name: None, err: err.to_string(), filename: None }
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match &self {
Error::Io(err) => write!(f, "IO error: {}", err),
Error::Parse { err, location, filename } => {
let mut prefix = String::new();
if let Some(filename) = filename {
prefix.push_str(&format!("{}:", filename));
}
if let Some(location) = location {
// Check for a syntax error generated by pest. These error messages have
// the line and column number embedded in them, so we don't want to
// duplicate that.
//
// TODO: If serde_json5 had an error type for json5 syntax errors, we wouldn't
// need to parse the string like this.
if !err.starts_with(" -->") {
prefix.push_str(&format!("{}:{}:", location.line, location.column));
}
}
if !prefix.is_empty() {
write!(f, "Error at {} {}", prefix, err)
} else {
write!(f, "{}", err)
}
}
Error::Validate { schema_name: _, err, filename } => {
let mut prefix = String::new();
if let Some(filename) = filename {
prefix.push_str(&format!("{}:", filename));
}
if !prefix.is_empty() {
write!(f, "Error at {} {}", prefix, err)
} else {
write!(f, "{}", err)
}
}
}
}
}
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self {
Error::Io(err)
}
}
impl From<serde_json::Error> for Error {
fn from(err: serde_json::Error) -> Self {
use serde_json::error::Category;
match err.classify() {
Category::Io | Category::Eof => Error::Io(err.into()),
Category::Syntax => {
let line = err.line();
let column = err.column();
Error::parse(err, Some(Location { line, column }), None)
}
Category::Data => Error::validate(err),
}
}
}
pub fn from_json_str(json: &str, filename: &Path) -> Result<Value, Error> {
serde_json::from_str(json).map_err(|e| {
Error::parse(
format!("Couldn't read input as JSON: {}", e),
Some(Location { line: e.line(), column: e.column() }),
Some(filename),
)
})
}
#[cfg(test)]
mod tests {
use super::*;
use anyhow::format_err;
use cm_types;
use matches::assert_matches;
#[test]
fn test_parse_error() {
let result = serde_json::from_str::<cm_types::Name>("foo").map_err(Error::from);
assert_matches!(result, Err(Error::Parse { .. }));
let result = Error::parse(format_err!("oops"), None, None);
assert_eq!(format!("{}", result), "oops");
let result = Error::parse(format_err!("oops"), Some(Location { line: 2, column: 3 }), None);
assert_eq!(format!("{}", result), "Error at 2:3: oops");
let result = Error::parse(
format_err!("oops"),
Some(Location { line: 2, column: 3 }),
Some(&Path::new("test.cml")),
);
assert_eq!(format!("{}", result), "Error at test.cml:2:3: oops");
let result = Error::parse(
format_err!(" --> pest error"),
Some(Location { line: 42, column: 42 }),
Some(&Path::new("test.cml")),
);
assert_eq!(format!("{}", result), "Error at test.cml: --> pest error");
}
#[test]
fn test_validation_error() {
let result = serde_json::from_str::<cm_types::Name>("\"foo$\"").map_err(Error::from);
assert_matches!(result, Err(Error::Validate { .. }));
let mut result = Error::validate(format_err!("oops"));
assert_eq!(format!("{}", result), "oops");
if let Error::Validate { filename, .. } = &mut result {
*filename = Some("test.cml".to_string());
}
assert_eq!(format!("{}", result), "Error at test.cml: oops");
}
}
|
The present invention relates to a new method for the effective therapeutic treatment of diseases associated with a deterioration of the macrocirculation, microcirculation and organ perfusion to achieve an improvement of the local environment and the metabolic situation and to aim at the improvement of organ function or the stabilization of organ function with imminent functional deterioration.
The present invention relates especially to a new method for the effective treatment of cardiological and systemic diseases.
In the past ophthalmological diseases like age-related maculopathy (AMD) retinal vein occlusion, diabetic retinopathy, arterial occlusion, uveal effusion syndrome, NAION, Stargardt""s-disease, uveitis, and maculopathy of different origin could not be treated with a generally accepted therapy. For example for the treatment of AM lasering treatments, radiation and operation were used. However these methods had no effect on the further development of the disease in many of the patients suffering therefrom. This principle has now been extended to cardiological diseases. Therapy refractory angina pectoris of coronary heart disease is the major disease. CHD is a severe progressive disease which occurs in the elderly. It is considered to be the most frequent cause of death in patients beyond an age of 65 years. There are more than 10 Million Americans suffering from this disease. An increasing number of patients after standard therapies such as coronary angioplasty, bypass operation and drug therapy are exhausted, demand new approaches. Extracorporeal haemorheotherapy (rheopheresis, rheo-apheresis) is a so far not considered or applied new treatment.
There is an increasing number of patients who underwent coronary angioplasty and/or coronary bypass surgery and are now again suffering from anginal pain due to the progression of the atherosclerotic disease. Even the new technique of transmyocardial laser revascularisation does not help them for more than 1-2 years. They then again depend on the conventional pharmacological therapy of coronary heart disease such as nitrates, beta-blockers and calcium antagonists, which become more and more ineffective during this stage of the disease. New types of antianginal medications are not expected to be developed during the next decade. As these patients finally have no therapeutic alternative in the very last stage of the disease, there is a great need for a new and effective therapeutic treatment of the above mentioned cardiological and systemic diseases.
In the early 90S the inventors of the present invention observed that the elimination of fibrinogen and plasma proteins of higher molecular weight led to an increase of the visual acuity of patients suffering from macular disease and uveal effusion syndrome (Brunner, Borberg et al. Acta Medica Austriaca 1991, 18, supplement 1, page 63 to 65). In this document 1 patient with uveal effusion syndrome and 16 patients with maculopathy were treated. The haematocrit was reduced by erythrocyte apheresis. Fibrinogen and plasma proteins were eliminated by plasma exchange using a solution of 5% human albumin. The visual acuity of 9 of the patients with maculopathy was significantly increased after one therapy.
In a further publication from 1991 (Brunner, Borberg et al., Dev. Ophthalmol., Karger (Public.) Basel, 1992, vol. 23, p. 275 to 284) it was studied whether clinical improvements could be obtained by plasma exchange therapy with patients suffering from intermediate uveitis using a solution of 5% human albumin. It was found out that both the haemorheological and immunomodulatory effects of this treatment could be beneficial in this disease. Human albumin as well as preserved serum were used as exchange fluids.
However, a general concept for the effective therapeutic treatment of cardiological diseases was not described in these documents.
Therefore it was the object of the invention to provide a method for the effective treatment of diseases associated with a deterioration of the macrocirculation, microcirculation and organ perfusion to achieve an improvement of the local environment and the metabolic situation and to aim at the improvement of organ function or the stabilization of organ function with imminent functional deterioration, especially for the effective treatment of cardiological and systemic diseases.
This object is solved by a method, which comprises the treatment of blood of patients by extracorporeal plasmapheresis techniques.
In a preferred embodiment the diseases are selected from the group comprising arterial occlusion, venous thrombosis, apoplexia, cerebral infarction, transitory iechasmic attack, multiple cerebral infarction syndrome, dementia, Alzheimer""s disease, diabetes mellitus, burns, Septicaemia (Sepsis), Raynaud""s syndrome, ulceration of the skin due to rheological alterations, ophthalmologic diseases especially maculopathy, retinal vein occlusion and uveal effusion syndrome, cardiologic and systemic diseases.
According to a preferred embodiment of the invention the cardiological and systemic diseases which can be treated are selected from the group comprising therapy refractory angina pectoris of patients with coronary heart disease, diseases of coronary microcirculation (xe2x80x9csmall vessel diseasexe2x80x9d, xe2x80x9csyndrome Xxe2x80x9d), disturbances of cerebral microcirculation (e.g. Morbus Binswanger), diabetic retinopathy, diabetic nephropathy, diabetic neuropathy, diabetic cardiomyopathy, pulmonary hypertension, artery occlusion, retinal vein occlusion.
In a further preferred embodiment the plasmapheresis technique is selected from the following techniques: blood cell plasma separation, plasma differential separation, plasma differential precipitation, plasma differential adsorption, plasma differential filtration.
The treatment comprises the steps of withdrawing the blood from the patient, treatment of the blood by the plasmapheresis techniques mentioned above and re-infusing the treated blood. |
<filename>Chapter 11/city_functions.py<gh_stars>1-10
#! python3
def city_country(city, country, population = 0):
"""Return a tex like a Warsaw, Poland - population 1000000"""
full_info = f"{city.title()}, {country.title()}"
if population:
full_info += f" - population {population}"
return full_info |
Covid-19 and Diabetic Retinopathy (Dr) Detection Using Ai & Deep Learning Artificial intelligence (AI), deep learning (DL), and neural networks (NN), though these words sound flashy and may leave you perplexed, represent powerful technologies that have the capabilities to transform the world. It is just now emerging how valuable these machine learning-based techniques are and how they can solve many real-world problems ranging from fraud detection, resource management to driver-less cars.One such field where the application of AI systems is progressively growing is in medical diagnosis. A lot of research is going on to enhance computer-aided diagnosis and detection of diseases. Recent world events have tested the healthcare systems all around the world. Suppose we have sophisticated deep learning systems (DLS) that could help in faster and efficient disease detection and diagnosis; how beneficial it would be to assist both medical professionals and patients.This study explores how AI and machine learning techniques could be used for disease detection, giving COVID-19 and Diabetic Retinopathy detection examples. We present two deep learning (DL) models, one to detect COVID-19 from chest x-ray image scans and the other to detect Diabetic Retinopathy at various stages of the disease from retinal fundus images. With reasonably high accuracy, >95% for the COVID-19 detection model and >80% for the Diabetic Retinopathy detection model, these results highlight AI and deep learning potential to assist general practitioners. |
__author__ = 'tony'
|
Massachusetts and seven pharmaceutical companies are expected to unveil an ambitious neuroscience consortium Wednesday aimed at improving the understanding and treatment of neurological disorders such as Alzheimer’s disease, Parkinson’s disease, and multiple sclerosis.
Participants in the Massachusetts Neuroscience Consortium include Abbott Laboratories, Biogen Idec, Inc., EMD Serono Inc., Janssen Research & Development LLC, Merck & Co., Pfizer Inc., and Sunovion Pharmaceuticals Inc. Each has pledged $250,000, for initial funding of $1.75 million. The money will go toward preclinical neuroscience at various academic and research institutions in the state.
The consortium will be formally announced by Governor Deval Patrick at the Biotechnology Industry Organization’s annual convention at the Boston Convention & Exhibition Center, where more than 15,000 attendees have gathered this week.
While the amount of money involved is relatively small — at least for now — the consortium is significant because it involves cooperation between companies that in some cases compete with each other, said Susan Windham-Bannister, chief executive of the Massachusetts Life Sciences Center.
“This kind of arrangement is out of the comfort zones of these companies, so we wanted to make it easy for them to participate,” Windham-Bannister said.
Consortium members will solicit and review proposals from academic institutions interested in conducting research. The first solicitation period is expected to open in the fall.
All Massachusetts academic and research institutions will be eligible to apply for grant money through the consortium. The Massachusetts Life Sciences Center, a quasipublic agency, will administer the funds.
Massachusetts is a center for biomedical neuroscience, with more than a dozen institutions engaged in neuroscience research, including Brandeis University, UMass Medical Center, and the Harvard NeuroDiscovery Center.
Windham-Bannister said the Massachusetts Life Sciences Center and the consortium member companies — which have been working on the project for three years — decided to focus on neuroscience because of its complexity.
The seven industry sponsors will identify common standards, and levels of validation necessary for a project’s objective to be considered complete. Research results will be shared with all participants, and companies, as well as academic researchers, will have access to any tools developed.
Richard Hargreaves, worldwide discovery head for neuroscience at drug giant Merck & Co., based in Kenilworth, N.J., said he is excited to work with Massachusetts academic institutions.
D.C. Denison can be reached at denison@globe.com. |
Q:
In the gospels, why does Jesus sometimes tell the people not to tell anyone after he has performed a miracle?
In the gospels, why does Jesus sometimes tell the people not to tell anyone after he has performed a miracle?
Matthew 9:30
There are multiple examples of this throughout the gospels.
A:
Intro
As noted by the OP, there are a number of these passage in the Gospel accounts. Collectively, this phenomenon is know as the "Messianic Secret" in academic literature. A number of explanations have been offered for the secrecy passages ranging from Jesus actually said such things for some reason (to teach the 12, to delay his death, to avoid Jewish misconceptions of the Messiah, etc.) to it's a literary device of some sort (let readers know salvation is a secret reserved for the elect) to it's an artifact of early church history (the passages were added to explain why few recognized Jesus as Messiah during his life.) For a thorough list of the options, see my post What explanations have been offered for the “messianic secret” passages? on C.SE.
Analysis
Summarizing the validity of the various options, it seems clear that historical-critical options such as that the passage arose to explain people not recognizing Jesus as Messiah during his lifetime are pretty unlikely. The reason is that in many cases the command is immediately followed by an indication that it was not followed. For example, Mark 1:43-44:
And Jesus sternly charged him and sent him away at once, and said to him, “See that you say nothing to anyone, but go, show yourself to the priest and offer for your cleansing what Moses commanded, for a proof to them.” (ESV)
is immediately followed by:
But he went out and began to talk freely about it, and to spread the news
which completely defeats the alleged purpose of explaining people's failure to recognize Jesus for who He was.
Distinguishing between literary devices and actual history is harder. In principle, most any aim detected could originate from an "acted parable" technique of Jesus or be a literary creation of the Gospel writers. However, if Mark (under a Markan priority assumption; otherwise whomever it was that wrote first) is employing a literary device, he certainly didn't make it obvious. Hence my the meaning of the passages has been so heavily debated in scholarship. That tends to suggest actual history is the more likely explanation.
Possible explanation in the text
In any case, Mark seems to give a partial explanation for the secrecy passages in 8:27-33. In this passage Jesus first asks the 12 what people are saying about him, to which they offer various ideas - John the Baptist, a prophet, etc. He then asks who they say He is and Peter replies "You are the Christ." Jesus tells them tell no one about this, and then starts teaching that he must suffer and die. Peter rebukes Jesus, to which Jesus replies:
Get behind me, Satan! For you are not setting your mind on the things of God, but on the things of man. (Mark 8:33)
This could play into several theories - the expectation of man (earthly leader) is not a "thing of God"; the disciples learned his destiny so they could later comprehend what had happened (i.e. part of a teaching scheme); when the time was right, Jesus would reveal his Messiahship and die, but that time hadn't yet arrived. For example, the Tyndale Commentary on this passage remarks:3
His destiny to die was revealed to them that they might understand the significance. The unveiling of the secret of Jesus' identity as the Messiah paved the way for the unveiling of the mystery of his destiny to die on the cross. The death of Jesus, which Peter so adamantly rejected, the church was called on the embrace.
Conclusion
It seems that the "creation" of secrecy passages by the Gospel writers would be more likely to cause problems for the church than to help it - a guy who is always telling people not to reveal his Messianic identity allows critics to say "even Jesus didn't claim to be the Messiah." Thus, by the criterion of embarrassment, I think the words most likely originate with Jesus himself. As to why Jesus said such things, "to delay His death", "to teach to disciples", and "to redefine the Messiah" all make sense, but none provide a completely satisfactory explanation. Perhaps the best explanation is all three reasons played a role.
A:
There are a variety of reasons why each gospel author may have chosen to implement what has come to be called the "messianic secret" (Messiasgeheimnis) theme (based on Wrede's watershed work).1 Most scholarly discussion of this theme is related to the gospel of Mark, which the author of the gospel ascribed to Matthew likely used as a source. Even so, the author of Matthew did not use the theme in the same way as that of Mark, having different emphases and likely a different target audience for his gospel.
According to Wrede, the author of Mark did not intend to give a historical account but rather a (post-resurrection) theological interpretation (this was a controversial idea in 1901 when Wrede first wrote his book in German). Wrede concludes this argument by stating:
[D]uring his earthly life Jesus' messiahship is absolutely a secret and is supposed to be such; no one apart from the confidants of Jesus is supposed to learn about it; with the resurrection, however, its disclosure ensues. This is in fact the crucial idea, the underlying point of Mark’s entire approach.2
While many scholars today don't agree with all of Wrede's propositions,3 the idea that the synoptic gospels are primarily theological rather than historical accounts (at least by modern historical standards) is still widely held. For the author of Mark, the unveiling of Jesus as the Messiah is a central theological motif of the gospel.4
For the gospel of Matthew, the emphasis has to do with the fulfillment of prophecy, which the author explicitly links to this theme in 12:16-21 (NRSV):
[A]nd he ordered them not to make him known. This was to fulfill what had been spoken through the prophet Isaiah:
"Here is my servant, whom I have chosen, my beloved, with whom my soul is well pleased. I will put my Spirit upon him, and he will proclaim justice to the Gentiles. He will not wrangle or cry aloud, nor will anyone hear his voice in the streets. He will not break a bruised reed or quench a smoldering wick until he brings justice to victory. And in his name the Gentiles will hope".
In summary, the answer to this question will differ depending on which gospel is being asked about, as each author has a unique theme and intent when writing their respective works. For the author of Matthew, the use of the "messianic secret" theme is linked to its fulfillment of prophecy (Isaiah 42:1-4).
Footnotes
1 William Wrede, The Messianic Secret: Das Messiasgeheimnis in den Evangelien, trans. J.C.G. Grieg (Cambridge, UK: James Clarke & Co., 1971).
2 Ibid., 68.
3 Cf. Schweitzer, The Quest for the Historical Jesus, 339; Aune, "The Problem of the Messianic Secret," 5; Stein, Mark, 24.
4 The gospel of Luke doesn't give a clear reason for using this theme so I won't elaborate on all of the theories since this question is specifically about a text in Matthew. |
Riley L. Pitts
Personal life
Riley L. Pitts was born in Fallis, Oklahoma. He attended Wichita State University and graduated in 1960 with a degree in Journalism. He married Eula Pitts and had a daughter, Stacie, and a son, Mark, while employed with the Boeing Company. Mark became an active member of the organization "Sons and Daughters In Touch" (SDIT) where he has traveled to Vietnam to memorialize his father. Pitts is buried in Hillcrest Gardens, Spencer, Oklahoma.
Military career
After being commissioned as an officer in the Army, he was sent to Vietnam in December 1966. Pitts had seven years of service in the Army.
In Vietnam, Pitts served as an information officer until he was transferred to a combat unit. As a Captain, he then served as commander of Company C, 2d Battalion, 27th Infantry. On October 31, 1967, just one month before he was to be rotated back home, his unit was called upon to reinforce another company heavily engaged against a strong enemy force.
After his company landed in an airmobile assault near Ap Dong (11.434°N 106.532°E), Binh Duong Province, several Viet Cong opened fire with automatic weapons. Captain Pitts led an assault which overran the enemy positions and was then ordered to move north to reinforce another company engaged against a strong enemy force. As his company moved forward intense fire was received from three directions, including four bunkers, two of which were within 15 meters of his position. His rifle fire proving ineffective against the enemy due to the dense foliage, Pitts picked up an M79 grenade launcher and began pinpointing the targets. Seizing a grenade taken from a captured Viet Cong's web gear, he lobbed it at a bunker to his front but it hit the foliage and rebounded. Without hesitation, Pitts threw himself on top of the grenade which, fortunately, failed to explode. He then directed the repositioning of the company to permit friendly artillery to be fired. Upon completion of the fire mission, he again led his men toward the enemy positions, personally killing at least one more Viet Cong. Displaying complete disregard for his personal safety, he maintained continuous fire, pinpointing the enemy's fortified positions, while at the same time directing and urging his men forward, until he was mortally wounded
Medal of Honor citation
Distinguishing himself by exceptional heroism while serving as company commander during an airmobile assault. Immediately after his company landed in the area, several Viet Cong opened fire with automatic weapons. Despite the enemy fire, Capt. Pitts forcefully led an assault which overran the enemy positions. Shortly thereafter, Capt. Pitts was ordered to move his unit to the north to reinforce another company heavily engaged against a strong enemy force. As Capt. Pitts' company moved forward to engage the enemy, intense fire was received from 3 directions, including fire from 4 enemy bunkers, 2 of which were within 15 meters of Capt. Pitts' position. The severity of the incoming fire prevented Capt. Pitts from maneuvering his company. His rifle fire proving ineffective against the enemy due to the dense jungle foliage, he picked up an M-79 grenade launcher and began pinpointing the targets. Seizing a Chinese Communist grenade which had been taken from a captured Viet Cong's web gear, Capt. Pitts lobbed the grenade at a bunker to his front, but it hit the dense jungle foliage and rebounded. Without hesitation, Capt. Pitts threw himself on top of the grenade which, fortunately, failed to explode. Capt. Pitts then directed the repositioning of the company to permit friendly artillery to be fired. Upon completion of the artillery fire mission, Capt. Pitts again led his men toward the enemy positions, personally killing at least 1 more Viet Cong. The jungle growth still prevented effective fire to be placed on the enemy bunkers. Capt. Pitts, displaying complete disregard for his life and personal safety, quickly moved to a position which permitted him to place effective fire on the enemy. He maintained a continuous fire, pinpointing the enemy's fortified positions, while at the same time directing and urging his men forward, until he was mortally wounded. Capt. Pitts' conspicuous gallantry, extraordinary heroism, and intrepidity at the cost of his life, above and beyond the call of duty, are in the highest traditions of the U.S. Army and reflect great credit upon himself, his unit, and the Armed Forces of his country.
Ceremony
President Lyndon B. Johnson presented the Medal of Honor to Mrs. Eula Pitts and his son and daughter on December 10, 1968. In presenting the award, Johnson declared,
What this man did in an hour of incredible courage will live in the story of America as long as America endures - as he will live in the hearts and memories of those who loved him. He was a brave man and a leader of men. No greater thing could be said of any man.
Captain Pitts' mother and father, Mr. and Mrs. Theodore H. Pitts, attended the presentation; also in attendance were Secretary of Defense Clark M. Clifford, Chairman of the Joint Chiefs of Staff General Earle Wheeler, and Secretary of the Army Stanley Rogers Resor.
Legacy
Post No. GR07 Department of France of The American Legion at Wiesbaden, Germany, is named after him. The Post was originally chartered on April 15, 1988, at Worms, Federal Republic of Germany. |
Mathematical modeling and optimization of the automated wireless charging electric transportation system In this paper, we introduce the automated wireless charging solution in the revolutionary transportation system called On-Line Electric Vehicle (OLEV). Also, we present the mathematical model and optimization method to evaluate the optimal key parameters in the automated system. The OLEV, recently developed by Korea Advanced Institute of Science and Technology (KAIST), is the transportation system utilizing the innovative wireless charging technology. The OLEV operates with an electric motor and a battery. Unlike conventional electric vehicles which rely on manual cable-plug-in operations for charging, the battery in the OLEV system is charged remotely from the power transmitters buried under the road. Also the charge can be done automatically while the vehicle is in motion. As a result, the re-charging down-time, which is the major drawback of the conventional electric vehicle, is significantly reduced and the operational efficiency is dramatically improved. The OLEV is selected as one of the 50 Best Innovations of 2010 by TIME Magazine and it is now being considered for a next generation green transportation system in several metropolitan cities in Korea. In this paper, we present an mathematical model to optimize the key parameters of the automated charging solution in the OLEV. The Mixed Integer Programming (MIP) algorithm is used for the optimization model. Numerical results are also presented. |
/**
* Mock generator of events given a physical source schema
*/
public class RelayEventGenerator implements EventProducer
{
public enum State
{
INIT, PAUSED, RUNNING, SHUTDOWN
};
public final static String MODULE = RelayEventGenerator.class.getName();
public final static Logger LOG = Logger.getLogger(MODULE);
private final SchemaRegistryService _schemaRegistryService;
private final DbusEventBufferAppendable _buffer;
private final PhysicalSourceStaticConfig _pConfig;
private final DbusEventsStatisticsCollector _statsCollector;
private final MaxSCNReaderWriter _scnReaderWriter;
private final long _eventRatePerSec;
private final HashMap<String, DataGenerator> _dataGenerators;
private final HashMap<String, byte[]> _schemaIds;
private final HashMap<String, String> _schemaKeys;
private long _scn = RngUtils.randomPositiveLong(2, 50000);
private volatile State _state = State.INIT;
boolean _shutdownRequested = false;
boolean _pauseRequested = false;
private long _restartScnOffset = 0;
Thread _worker;
private final Lock _pauseLock = new ReentrantLock();
private final Condition _pausedCondition = _pauseLock.newCondition();
public RelayEventGenerator(PhysicalSourceStaticConfig pConfig,
SchemaRegistryService schemaRegistryService,
DbusEventBufferAppendable dbusEventBuffer,
DbusEventsStatisticsCollector statsCollector,
MaxSCNReaderWriter scnReaderWriter)
{
_pConfig = pConfig;
_schemaRegistryService = schemaRegistryService;
_buffer = dbusEventBuffer;
_statsCollector = statsCollector;
_eventRatePerSec = pConfig.getEventRatePerSec();
_dataGenerators = new HashMap<String, DataGenerator>(5);
_schemaIds = new HashMap<String, byte[]>(5);
_schemaKeys = new HashMap<String, String>(5);
_scnReaderWriter = scnReaderWriter;
_restartScnOffset = pConfig.getRestartScnOffset();
for (LogicalSourceStaticConfig lconf : pConfig.getSources())
{
try
{
String schema = _schemaRegistryService
.fetchLatestSchemaBySourceName(lconf.getName());
_dataGenerators.put(lconf.getName(), new DataGenerator(schema));
_schemaIds.put(lconf.getName(),
SchemaHelper.getSchemaId(schema));
Schema eventSchema = Schema.parse(schema);
String keyColumnName = "key";
String keyNameOverride = SchemaHelper.getMetaField(eventSchema,
"pk");
if (null != keyNameOverride)
{
keyColumnName = keyNameOverride;
}
_schemaKeys.put(lconf.getName(), keyColumnName);
}
catch (NoSuchSchemaException e)
{
LOG.error("Cannot find schema for " + lconf.getName() + " " + e);
}
catch (DatabusException e)
{
LOG.error("Databus exception while attempting to find schema for "
+ lconf.getName() + " " + e);
}
}
}
@Override
public synchronized void shutdown()
{
_shutdownRequested = true;
if (_worker != null)
_worker.interrupt();
LOG.warn("Shut down request sent to thread");
}
@Override
public synchronized void waitForShutdown() throws InterruptedException,
IllegalStateException
{
if (_state != State.SHUTDOWN)
{
if (_worker != null)
_worker.join();
}
}
@Override
public synchronized void waitForShutdown(long timeout)
throws InterruptedException, IllegalStateException
{
if (_state != State.SHUTDOWN)
{
if (_worker != null)
_worker.join(timeout);
}
}
@Override
public String getName()
{
return _pConfig.getName() + ".mock";
}
@Override
public long getSCN()
{
return _scn;
}
@Override
public synchronized void start(long sinceSCN)
{
if (_state != State.RUNNING)
{
if (sinceSCN > 0)
{
_scn = sinceSCN;
}
else
{
if (_scnReaderWriter != null)
{
try
{
long scn = _scnReaderWriter.getMaxScn();
//apply the restart SCN offset
long newScn = (scn >= _restartScnOffset) ? scn - _restartScnOffset : 0;
LOG.info("Checkpoint read = " + scn + " restartScnOffset=" + _restartScnOffset + "Adjusted SCN=" + newScn);
if (newScn > 0)
{
_scn =newScn;
}
}
catch (DatabusException e)
{
LOG.warn("Could not read saved maxScn: Defaulting to random startSCN="
+ _scn);
}
}
}
LOG.info("Starting with scn=" + _scn);
_worker = new WorkerThread();
_worker.setDaemon(true);
_worker.start();
}
else
{
LOG.error("Thread already running! ");
}
}
@Override
public synchronized boolean isRunning()
{
return _state == State.RUNNING;
}
@Override
public synchronized boolean isPaused()
{
return _state == State.PAUSED;
}
@Override
public synchronized void unpause()
{
_pauseLock.lock();
try
{
_pauseRequested = false;
_pausedCondition.signalAll();
}
finally
{
_pauseLock.unlock();
}
}
@Override
public synchronized void pause()
{
_pauseLock.lock();
try
{
_pauseRequested = true;
}
finally
{
_pauseLock.unlock();
}
}
int populateEvents(String source, short id, GenericRecord record,
DbusEventKey key, byte[] schemaId,
DbusEventsStatisticsCollector statsCollector,
DbusEventBufferAppendable buffer)
{
if (record != null && key != null)
{
try
{
// Serialize the row
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Encoder encoder = new BinaryEncoder(bos);
GenericDatumWriter<GenericRecord> writer = new GenericDatumWriter<GenericRecord>(
record.getSchema());
writer.write(record, encoder);
byte[] serializedValue = bos.toByteArray();
short pPartitionId = RngUtils.randomPositiveShort();
short lPartitionId = RngUtils.randomPositiveShort();
long timeStamp = System.currentTimeMillis() * 1000000;
buffer.appendEvent(key, pPartitionId, lPartitionId, timeStamp,
id, schemaId, serializedValue, false, statsCollector);
return 1;
}
catch (IOException io)
{
LOG.error("Cannot create byte stream payload: " + source);
}
}
return 0;
}
private class WorkerThread extends Thread
{
// only one such method can exist as start() is synchronized
@Override
public void run()
{
_state = RelayEventGenerator.State.RUNNING;
_buffer.start(_scn-1);
while (!_shutdownRequested)
{
_pauseLock.lock();
if (_pauseRequested
&& _state != RelayEventGenerator.State.PAUSED)
{
_state = RelayEventGenerator.State.PAUSED;
LOG.warn("Pausing event generator");
while (_state == RelayEventGenerator.State.PAUSED
&& !_shutdownRequested
&& _pauseRequested)
{
try
{
_pausedCondition.await();
}
catch (InterruptedException e)
{
LOG.warn("Paused thread interrupted! Shutdown requested="
+ _shutdownRequested);
}
}
}
_pauseLock.unlock();
if (!_shutdownRequested)
{
_state = RelayEventGenerator.State.RUNNING;
}
if (_state == RelayEventGenerator.State.RUNNING)
{
_buffer.startEvents();
// generate events
long cycleDurationMs = _pConfig.getRetries().getInitSleep();
long numEventsToGenerate = (long) (_eventRatePerSec
* cycleDurationMs / 1000.0);
long startTime = System.currentTimeMillis();
long totalEvents = 0;
for (LogicalSourceStaticConfig lconf : _pConfig
.getSources())
{
for (long i = 0; i < numEventsToGenerate; ++i)
{
if (_pauseRequested || _shutdownRequested)
{
break;
}
DataGenerator d = _dataGenerators.get(lconf
.getName());
GenericRecord record = null;
try
{
record = d.generateRandomRecord();
}
catch (UnknownTypeException e)
{
LOG.error("Could not generate record for source: "
+ lconf.getName());
continue;
}
DbusEventKey eventKey = null;
try
{
Object key = record.get(_schemaKeys.get(lconf
.getName()));
eventKey = new DbusEventKey(key);
}
catch (UnsupportedKeyException e)
{
LOG.error("Unable to get key for "
+ lconf.getName());
}
totalEvents += populateEvents(lconf.getName(),
lconf.getId(), record, eventKey,
_schemaIds.get(lconf.getName()),
_statsCollector, _buffer);
}
}
_buffer.endEvents(_scn, _statsCollector);
long timeTaken = System.currentTimeMillis() - startTime;
LOG.debug("Time taken to populate " + totalEvents + " = "
+ timeTaken);
long timeLeft = cycleDurationMs - timeTaken;
if (timeLeft > 0 && !_pauseRequested && !_shutdownRequested)
{
try
{
Thread.sleep(timeLeft);
}
catch (InterruptedException e)
{
LOG.error("Thread interrupted from sleep: state="
+ _state);
}
}
if (_scnReaderWriter != null)
{
try
{
_scnReaderWriter.saveMaxScn(_scn);
}
catch (DatabusException e)
{
LOG.error("Cannot save scn!");
}
}
_scn += RngUtils.randomPositiveLong(1, 100000);
}
}// end of while
_state = RelayEventGenerator.State.SHUTDOWN;
} // end of run()
}// end of thread class
} |
Adhesive properties of water-washed cottonseed meal on four types of wood Abstract The interest in natural product-based wood adhesives has been steadily increasing due to the environmental and sustainable concerns of petroleum-based adhesives. In this work, we reported our research on the utilization of water-washed cottonseed meal (WCM) as wood adhesives. The adhesive strength and water resistance of WCM adhesive preparations on poplar, Douglas fir, walnut, and white oak wood veneers were tested with press temperatures of 80, 100, and 130 °C. Our data indicated that raising the hot press temperature from 80 to 100130 °C greatly increased the bonding strength and water resistance of the WCM adhesives. The general trend of the adhesive strength of WCM on the four wood species was Douglas fir > poplar ≈ white oak > walnut. The rough surface of Douglas fir with tipping features could enhance the mechanical interlocking between the wood fibers and adhesive slurry, contributing to the high adhesive strength. The dimensional swelling of the bonded wood pairs due to water soaking was in the order: thickness > width (i.e. perpendicular to the wood grain) > length (i.e. parallel to the wood grain). The greatest dimensional changes were observed in Douglas fir specimens. However, the highest decrease in adhesive strength by water soaking was with poplar wood specimens. These observations suggested that the wood dimensional changes were not dominant factors on water weakening the bonding strength of these wood pairs. |
import time
from types import FunctionType
from solver.base import BaseSolver, findPathBase
from graph.grid import GridMap
from graph.node import Node
from container.base import (
OpenBase, ClosedBase,
)
from container.open import OpenList
from container.closed import ClosedList
from utils.visualisation import drawResult
from utils.path import makePath
def simpleTest(
solver: BaseSolver,
engine: FunctionType,
grid: GridMap,
start: Node,
goal: Node,
open_list: OpenBase = OpenList,
closed_list: ClosedBase = ClosedList,
complexity: int = 0,
visualise: bool = True,
) -> dict:
stats = {
'time': None,
'found': False,
'length': None,
'created': 0,
'complex': complexity,
}
start_time = time.perf_counter()
found, last_node, closed_nodes, open_nodes = engine(
solver, grid, start, goal,
)
stats['time'] = time.perf_counter() - start_time
stats['found'] = found
stats['created'] = len(closed_nodes) + len(open_nodes)
if found:
stats['length'] = last_node.g
if visualise:
path = makePath(last_node)
drawResult(grid, start, goal, path, closed_nodes, open_nodes)
return stats |
import * as expect from "expect";
import * as _ from "lodash";
import {
DisassemblyAnnotation,
MAX_LABEL_LENGTH,
} from "../../src/disassembler/annotations";
import {
MemorySection,
MemorySectionType,
} from "../../src/disassembler/disassembly-helper";
describe("Disassembler - annotations", () => {
it("Construction works as expected", () => {
// --- Act
const dc = new DisassemblyAnnotation();
// --- Assert
expect(dc.labels.size).toBe(0);
expect(dc.comments.size).toBe(0);
expect(dc.prefixComments.size).toBe(0);
expect(dc.literals.size).toBe(0);
});
it("SetLabel does not save invalid label", () => {
// --- Arrange
const LABEL = "My$$Label$$";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.setLabel(0x1000, LABEL);
// --- Assert
expect(result).toBe(false);
expect(dc.labels.size).toBe(0);
});
it("SetLabel truncates too long label", () => {
// --- Arrange
const LABEL = "Label012345678901234567890123456789";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.setLabel(0x1000, LABEL);
// --- Assert
expect(result).toBe(true);
expect(dc.labels.size).toBe(1);
expect(dc.labels.get(0x1000)).toBe(LABEL.substring(0, MAX_LABEL_LENGTH));
});
it("SetLabel works as expected", () => {
// --- Arrange
const LABEL = "MyLabel";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.setLabel(0x1000, LABEL);
// --- Assert
expect(result).toBe(true);
expect(dc.labels.size).toBe(1);
expect(dc.labels.get(0x1000)).toBe(LABEL);
});
it("SetLabel does not duplicate label", () => {
// --- Arrange
const LABEL = "MyLabel";
const dc = new DisassemblyAnnotation();
dc.setLabel(0x1000, LABEL);
// --- Act
const result = dc.setLabel(0x1100, LABEL);
// --- Assert
expect(result).toBe(false);
expect(dc.labels.size).toBe(1);
expect(dc.labels.get(0x1000)).toBe(LABEL);
});
it("SetLabel works with multiple label", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
var dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.setLabel(0x1000, LABEL);
const result2 = dc.setLabel(0x2000, LABEL2);
// --- Assert
expect(result1).toBe(true);
expect(dc.labels.size).toBe(2);
expect(dc.labels.get(0x1000)).toBe(LABEL);
expect(result2).toBe(true);
expect(dc.labels.get(0x2000)).toBe(LABEL2);
});
it("SetLabel overrides existing label", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
var dc = new DisassemblyAnnotation();
const result = dc.setLabel(0x1000, LABEL);
// --- Act
const result2 = dc.setLabel(0x1000, LABEL2);
// --- Assert
expect(result).toBe(true);
expect(dc.labels.size).toBe(1);
expect(dc.labels.get(0x1000)).toBe(LABEL2);
});
it("SetLabel removes undefined label", () => {
// --- Arrange
const LABEL = "MyLabel";
var dc = new DisassemblyAnnotation();
dc.setLabel(0x1000, LABEL);
// --- Act
const result = dc.setLabel(0x1000, undefined);
// --- Assert
expect(result).toBe(true);
expect(dc.labels.size).toBe(0);
});
it("SetLabel removes whitespace label", () => {
// --- Arrange
const LABEL = "MyLabel";
var dc = new DisassemblyAnnotation();
dc.setLabel(0x1000, LABEL);
// --- Act
const result = dc.setLabel(0x1000, " \t\t ");
// --- Assert
expect(result).toBe(true);
expect(dc.labels.size).toBe(0);
});
it("SetLabel handles no remove", () => {
// --- Arrange
const LABEL = "MyLabel";
var dc = new DisassemblyAnnotation();
dc.setLabel(0x1000, LABEL);
// --- Act
const result = dc.setLabel(0x2000, undefined);
// --- Assert
expect(result).toBe(false);
expect(dc.labels.size).toBe(1);
});
it("SetComment works as expected", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.setComment(0x1000, COMMENT);
// --- Assert
expect(result).toBeTruthy();
expect(dc.comments.size).toBe(1);
expect(dc.comments.get(0x1000)).toBe(COMMENT);
});
it("SetComment works with multiple comments", () => {
// --- Arrange
const COMMENT = "MyComment";
const COMMENT2 = "MyComment2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.setComment(0x1000, COMMENT);
const result2 = dc.setComment(0x2000, COMMENT2);
// --- Assert
expect(dc.comments.size).toBe(2);
expect(result1).toBeTruthy();
expect(dc.comments.get(0x1000)).toBe(COMMENT);
expect(result2).toBeTruthy();
expect(dc.comments.get(0x2000)).toBe(COMMENT2);
});
it("SetComment overwites existing comment", () => {
// --- Arrange
const COMMENT = "MyComment";
const COMMENT2 = "MyComment2";
const dc = new DisassemblyAnnotation();
dc.setComment(0x1000, COMMENT);
// --- Act
const result = dc.setComment(0x1000, COMMENT2);
// --- Assert
expect(result).toBeTruthy();
expect(dc.comments.get(0x1000)).toBe(COMMENT2);
});
it("SetComment removes undefined comment", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
dc.setComment(0x1000, COMMENT);
// --- Act
const result = dc.setComment(0x1000, undefined);
// --- Assert
expect(result).toBeTruthy();
expect(dc.comments.size).toBe(0);
});
it("SetComment removes whitespace comment", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
dc.setComment(0x1000, COMMENT);
// --- Act
const result = dc.setComment(0x1000, " \t\t ");
// --- Assert
expect(result).toBeTruthy();
expect(dc.comments.size).toBe(0);
});
it("SetComment handle no remove", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
dc.setComment(0x1000, COMMENT);
// --- Act
const result = dc.setComment(0x2000, undefined);
// --- Assert
expect(result).toBeFalsy();
expect(dc.comments.size).toBe(1);
});
it("SetPrefixComment works as expected", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.setPrefixComment(0x1000, COMMENT);
// --- Assert
expect(result).toBeTruthy();
expect(dc.prefixComments.size).toBe(1);
expect(dc.prefixComments.get(0x1000)).toBe(COMMENT);
});
it("SetPrefixComment works with multiple comments", () => {
// --- Arrange
const COMMENT = "MyComment";
const COMMENT2 = "MyComment2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.setPrefixComment(0x1000, COMMENT);
const result2 = dc.setPrefixComment(0x2000, COMMENT2);
// --- Assert
expect(dc.prefixComments.size).toBe(2);
expect(result1).toBeTruthy();
expect(dc.prefixComments.get(0x1000)).toBe(COMMENT);
expect(result2).toBeTruthy();
expect(dc.prefixComments.get(0x2000)).toBe(COMMENT2);
});
it("SetPrefixComment overwites existing comment", () => {
// --- Arrange
const COMMENT = "MyComment";
const COMMENT2 = "MyComment2";
const dc = new DisassemblyAnnotation();
dc.setPrefixComment(0x1000, COMMENT);
// --- Act
const result = dc.setPrefixComment(0x1000, COMMENT2);
// --- Assert
expect(result).toBeTruthy();
expect(dc.prefixComments.get(0x1000)).toBe(COMMENT2);
});
it("SetPrefixComment removes undefined comment", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
dc.setPrefixComment(0x1000, COMMENT);
// --- Act
const result = dc.setPrefixComment(0x1000, undefined);
// --- Assert
expect(result).toBeTruthy();
expect(dc.prefixComments.size).toBe(0);
});
it("SetPrefixComment removes whitespace comment", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
dc.setPrefixComment(0x1000, COMMENT);
// --- Act
const result = dc.setPrefixComment(0x1000, " \t\t ");
// --- Assert
expect(result).toBeTruthy();
expect(dc.prefixComments.size).toBe(0);
});
it("SetPrefixComment handle no remove", () => {
// --- Arrange
const COMMENT = "MyComment";
const dc = new DisassemblyAnnotation();
dc.setPrefixComment(0x1000, COMMENT);
// --- Act
const result = dc.setPrefixComment(0x2000, undefined);
// --- Assert
expect(result).toBeFalsy();
expect(dc.prefixComments.size).toBe(1);
});
it("AddLiteral works as expected", () => {
// --- Arrange
const LABEL = "MyLabel";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.addLiteral(0x1000, LABEL);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literals.size).toBe(1);
const literals = dc.literals.get(0x1000) || [];
expect(literals.length).toBe(1);
expect(_.includes(literals, LABEL)).toBeTruthy();
});
it("AddLiteral works with multiple literals", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.addLiteral(0x1000, LABEL);
const result2 = dc.addLiteral(0x2000, LABEL2);
// --- Assert
expect(dc.literals.size).toBe(2);
expect(result1).toBeTruthy();
let literals = dc.literals.get(0x1000) || [];
expect(literals.length).toBe(1);
expect(_.includes(literals, LABEL)).toBeTruthy();
expect(result2).toBeTruthy();
literals = dc.literals.get(0x2000) || [];
expect(literals.length).toBe(1);
expect(_.includes(literals, LABEL2)).toBeTruthy();
});
it("AddLiteral works with multiple names", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.addLiteral(0x1000, LABEL);
const result2 = dc.addLiteral(0x1000, LABEL2);
// --- Assert
expect(result1).toBeTruthy();
expect(result2).toBeTruthy();
expect(dc.literals.size).toBe(1);
let literals = dc.literals.get(0x1000) || [];
expect(literals.length).toBe(2);
expect(_.includes(literals, LABEL)).toBeTruthy();
expect(_.includes(literals, LABEL2)).toBeTruthy();
});
it("AddLiteral stores distinct names", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.addLiteral(0x1000, LABEL);
const result2 = dc.addLiteral(0x1000, LABEL2);
const result3 = dc.addLiteral(0x1000, LABEL);
// --- Assert
expect(result1).toBeTruthy();
expect(result2).toBeTruthy();
expect(result3).toBeFalsy();
expect(dc.literals.size).toBe(1);
let literals = dc.literals.get(0x1000) || [];
expect(literals.length).toBe(2);
expect(_.includes(literals, LABEL)).toBeTruthy();
expect(_.includes(literals, LABEL2)).toBeTruthy();
});
it("AddLiteral does not allow different keys for the same name", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.addLiteral(0x1000, LABEL);
const result2 = dc.addLiteral(0x1000, LABEL2);
const result3 = dc.addLiteral(0x2000, LABEL);
// --- Assert
expect(result1).toBeTruthy();
expect(result2).toBeTruthy();
expect(result3).toBeFalsy();
expect(dc.literals.size).toBe(1);
let literals = dc.literals.get(0x1000) || [];
expect(literals.length).toBe(2);
expect(_.includes(literals, LABEL)).toBeTruthy();
expect(_.includes(literals, LABEL2)).toBeTruthy();
});
it("RemoveLiteral works as expected", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
dc.addLiteral(0x1000, LABEL);
// --- Act
const result = dc.removeLiteral(0x1000, LABEL);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literals.size).toBe(0);
});
it("RemoveLiteral keeps untouched names", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
dc.addLiteral(0x1000, LABEL);
dc.addLiteral(0x1000, LABEL2);
// --- Act
const result = dc.removeLiteral(0x1000, LABEL);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literals.size).toBe(1);
let literals = dc.literals.get(0x1000) || [];
expect(literals.length).toBe(1);
expect(_.includes(literals, LABEL2)).toBeTruthy();
});
it("RemoveLiteral keeps untouched keys", () => {
// --- Arrange
const LABEL = "MyLabel";
const LABEL2 = "MyLabel2";
const dc = new DisassemblyAnnotation();
dc.addLiteral(0x1000, LABEL);
dc.addLiteral(0x2000, LABEL2);
// --- Act
const result = dc.removeLiteral(0x1000, LABEL);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literals.size).toBe(1);
let literals = dc.literals.get(0x2000) || [];
expect(literals.length).toBe(1);
expect(_.includes(literals, LABEL2)).toBeTruthy();
});
it("SetLiteralReplacement works as expected", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.setLiteralReplacement(0x1000, REPLACEMENT);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literalReplacements.size).toBe(1);
expect(dc.literalReplacements.get(0x1000)).toBe(REPLACEMENT);
});
it("SetLiteralReplacement works with multiple replacements", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const REPLACEMENT2 = "MyReplacement2";
const dc = new DisassemblyAnnotation();
// --- Act
const result1 = dc.setLiteralReplacement(0x1000, REPLACEMENT);
const result2 = dc.setLiteralReplacement(0x2000, REPLACEMENT2);
// --- Assert
expect(dc.literalReplacements.size).toBe(2);
expect(result1).toBeTruthy();
expect(dc.literalReplacements.get(0x1000)).toBe(REPLACEMENT);
expect(result2).toBeTruthy();
expect(dc.literalReplacements.get(0x2000)).toBe(REPLACEMENT2);
});
it("SetLiteralReplacement overwrites existing replacement", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const REPLACEMENT2 = "MyReplacement2";
const dc = new DisassemblyAnnotation();
dc.setLiteralReplacement(0x1000, REPLACEMENT);
// --- Act
const result = dc.setLiteralReplacement(0x1000, REPLACEMENT2);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literalReplacements.size).toBe(1);
expect(dc.literalReplacements.get(0x1000)).toBe(REPLACEMENT2);
});
it("SetLiteralReplacement removes undefined replacement", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const REPLACEMENT2 = "MyReplacement2";
const dc = new DisassemblyAnnotation();
dc.setLiteralReplacement(0x1000, REPLACEMENT);
// --- Act
const result = dc.setLiteralReplacement(0x1000, undefined);
// --- Assert
expect(result).toBeTruthy();
expect(dc.literalReplacements.size).toBe(0);
});
it("SetLiteralReplacement removes whitespace replacement", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const REPLACEMENT2 = "MyReplacement2";
const dc = new DisassemblyAnnotation();
dc.setLiteralReplacement(0x1000, REPLACEMENT);
// --- Act
const result = dc.setLiteralReplacement(0x1000, " \t\t ");
// --- Assert
expect(result).toBeTruthy();
expect(dc.literalReplacements.size).toBe(0);
});
it("SetLiteralReplacement handles no remove", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const dc = new DisassemblyAnnotation();
dc.setLiteralReplacement(0x1000, REPLACEMENT);
// --- Act
const result = dc.setLiteralReplacement(0x2000, undefined);
// --- Assert
expect(result).toBeFalsy();
expect(dc.literalReplacements.size).toBe(1);
});
it("ApplyLiteral removes replacement", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const dc = new DisassemblyAnnotation();
dc.setLiteralReplacement(0x1000, REPLACEMENT);
// --- Act
const result = dc.applyLiteral(0x1000, 0x0000, undefined);
// --- Assert
expect(result).toBeFalsy();
expect(dc.literalReplacements.size).toBe(0);
});
it("ApplyLiteral creates new symbol", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const dc = new DisassemblyAnnotation();
// --- Act
const result = dc.applyLiteral(0x1000, 0x2000, REPLACEMENT);
// --- Assert
expect(result).toBeFalsy();
const literals = dc.literals.get(0x2000) || [];
expect(literals.length).toBe(1);
expect(literals[0]).toBe(REPLACEMENT);
expect(dc.literalReplacements.size).toBe(1);
expect(dc.literalReplacements.get(0x1000)).toBe(REPLACEMENT);
});
it("ApplyLiteral uses existing symbol", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const dc = new DisassemblyAnnotation();
dc.addLiteral(0x2000, REPLACEMENT);
// --- Act
const result = dc.applyLiteral(0x1000, 0x2000, REPLACEMENT);
// --- Assert
expect(result).toBeFalsy();
const literals = dc.literals.get(0x2000) || [];
expect(literals.length).toBe(1);
expect(literals[0]).toBe(REPLACEMENT);
expect(dc.literalReplacements.size).toBe(1);
expect(dc.literalReplacements.get(0x1000)).toBe(REPLACEMENT);
});
it("ApplyLiteral wrong symbol value", () => {
// --- Arrange
const REPLACEMENT = "MyReplacement";
const dc = new DisassemblyAnnotation();
dc.addLiteral(0x3000, REPLACEMENT);
// --- Act
const result = dc.applyLiteral(0x1000, 0x2000, REPLACEMENT);
// --- Assert
expect(result).toBeTruthy();
const literals = dc.literals.get(0x3000) || [];
expect(literals.length).toBe(1);
expect(literals[0]).toBe(REPLACEMENT);
expect(dc.literalReplacements.size).toBe(0);
});
it("Serialization works as expected", () => {
// --- Arrange
var dc = new DisassemblyAnnotation();
dc.setLabel(0x0100, "FirstLabel");
dc.setLabel(0x0200, "SecondLabel");
dc.setComment(0x0100, "FirstComment");
dc.setComment(0x0200, "SecondComment");
dc.setPrefixComment(0x0100, "FirstPrefixComment");
dc.setPrefixComment(0x0200, "SecondPrefixComment");
dc.addLiteral(0x0000, "Entry");
dc.addLiteral(0x0000, "Start");
dc.addLiteral(0x0028, "Calculator");
dc.memoryMap.add(new MemorySection(0x0000, 0x3bff));
dc.memoryMap.add(
new MemorySection(0x3c00, 0x3fff, MemorySectionType.ByteArray)
);
dc.setLiteralReplacement(0x100, "Entry");
dc.setLiteralReplacement(0x1000, "Calculator");
// --- Act
const serialized = dc.serialize();
const result = DisassemblyAnnotation.deserialize(serialized);
// --- Assert
expect(result).toBeTruthy();
const back = result || new DisassemblyAnnotation();
expect(dc.labels.size).toBe(back.labels.size);
for (const item of dc.labels) {
expect(back.labels.get(item[0])).toBe(item[1]);
}
expect(dc.comments.size).toBe(back.comments.size);
for (const item of dc.comments) {
expect(back.comments.get(item[0])).toBe(item[1]);
}
expect(dc.prefixComments.size).toBe(back.prefixComments.size);
for (const item of dc.prefixComments) {
expect(back.prefixComments.get(item[0])).toBe(item[1]);
}
expect(dc.literals.size).toBe(back.literals.size);
for (const item of dc.literals) {
(back.literals.get(item[0]) || []).forEach((v) =>
expect(_.includes(dc.literals.get(item[0]), v))
);
(dc.literals.get(item[0]) || []).forEach((v) =>
expect(_.includes(back.literals.get(item[0]), v))
);
}
expect(dc.literalReplacements.size).toBe(back.literalReplacements.size);
for (const item of dc.literalReplacements) {
expect(back.literalReplacements.get(item[0])).toBe(item[1]);
}
expect(dc.memoryMap.count).toBe(back.memoryMap.count);
for (let i = 0; i < dc.memoryMap.count; i++) {
expect(
dc.memoryMap.sections[i].equals(back.memoryMap.sections[i])
).toBeTruthy();
}
});
it("Merge works as expected", () => {
// --- Arrange
var dc = new DisassemblyAnnotation();
dc.setLabel(0x0100, "FirstLabel");
dc.setLabel(0x0200, "SecondLabel");
dc.setComment(0x0100, "FirstComment");
dc.setComment(0x0200, "SecondComment");
dc.setPrefixComment(0x0100, "FirstPrefixComment");
dc.setPrefixComment(0x0200, "SecondPrefixComment");
dc.addLiteral(0x0000, "Entry");
dc.addLiteral(0x0000, "Start");
dc.addLiteral(0x0028, "Calculator");
dc.memoryMap.add(new MemorySection(0x0000, 0x3bff));
dc.memoryMap.add(
new MemorySection(0x3c00, 0x3fff, MemorySectionType.ByteArray)
);
dc.setLiteralReplacement(0x100, "Entry");
dc.setLiteralReplacement(0x1000, "Calculator");
// --- Act
var odc = new DisassemblyAnnotation();
odc.setLabel(0x0200, "SecondLabelA");
odc.setLabel(0x0300, "ThirdLabel");
odc.setComment(0x0100, "FirstCommentA");
odc.setComment(0x0300, "ThirdComment");
odc.setPrefixComment(0x0200, "SecondPrefixCommentA");
odc.setPrefixComment(0x0300, "ThirdPrefixComment");
odc.addLiteral(0x0000, "Start");
odc.addLiteral(0x0028, "CalculatorA");
odc.memoryMap.add(
new MemorySection(0x3c00, 0x5bff, MemorySectionType.ByteArray)
);
odc.setLiteralReplacement(0x100, "Entry");
odc.setLiteralReplacement(0x200, "Other");
odc.setLiteralReplacement(0x1000, "CalculatorA");
dc.merge(odc);
// --- Assert
expect(dc.labels.size).toBe(3);
expect(dc.labels.get(0x100)).toBe("FirstLabel");
expect(dc.labels.get(0x200)).toBe("SecondLabelA");
expect(dc.labels.get(0x300)).toBe("ThirdLabel");
expect(dc.comments.size).toBe(3);
expect(dc.comments.get(0x100)).toBe("FirstCommentA");
expect(dc.comments.get(0x200)).toBe("SecondComment");
expect(dc.comments.get(0x300)).toBe("ThirdComment");
expect(dc.prefixComments.size).toBe(3);
expect(dc.prefixComments.get(0x100)).toBe("FirstPrefixComment");
expect(dc.prefixComments.get(0x200)).toBe("SecondPrefixCommentA");
expect(dc.prefixComments.get(0x300)).toBe("ThirdPrefixComment");
expect(dc.literals.size).toBe(2);
expect((dc.literals.get(0x0000) || []).length).toBe(2);
expect(_.includes(dc.literals.get(0x0000), "Start")).toBeTruthy();
expect(_.includes(dc.literals.get(0x0000), "Entry")).toBeTruthy();
expect((dc.literals.get(0x0028) || []).length).toBe(2);
expect(_.includes(dc.literals.get(0x0028), "Calculator")).toBeTruthy();
expect(_.includes(dc.literals.get(0x0028), "CalculatorA")).toBeTruthy();
expect(dc.memoryMap.count).toBe(2);
expect(
dc.memoryMap.sections[0].equals(new MemorySection(0x0000, 0x3bff))
).toBeTruthy();
expect(
dc.memoryMap.sections[1].equals(
new MemorySection(0x3c00, 0x5bff, MemorySectionType.ByteArray)
)
).toBeTruthy();
expect(dc.literalReplacements.size).toBe(3);
expect(dc.literalReplacements.get(0x100)).toBe("Entry");
expect(dc.literalReplacements.get(0x200)).toBe("Other");
expect(dc.literalReplacements.get(0x1000)).toBe("CalculatorA");
});
});
|
/**
* @return true if current instruction is the same as the next instruction, false otherwise
*/
@Override
public boolean hasStopped() {
if (currentAddr == null) {
return false;
}
return currentAddr.equals(nextAddr);
} |
# Generated by Django 3.2.8 on 2021-10-24 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('amcm', '0003_auto_20211024_0256'),
]
operations = [
migrations.AlterField(
model_name='cuotaevento',
name='fechaVencimiento',
field=models.DateField(verbose_name='Fecha de Vencimiento'),
),
]
|
/**
* Creates the folder for disk manager.
*
* @param readFilePath the read file path
* @return true, if successful
*/
private boolean createFolderForDiskManager(String readFilePath) {
boolean isSuccess = false;
String property1 = null;
String property2 = null;
try {
OsUserDiskManager.getInstance().createParentFolderStructure(readFilePath);
DSInstanceLock.getInstance().createLock();
isSuccess = true;
} catch (DataStudioSecurityException e) {
property1 = IMessagesConstants.ERR_TITLE_LAUNCH_DATASTUDIO;
property2 = IMessagesConstants.ERR_BL_LAUNCH_MULTIPLE_INSTANCE_DATASTUDIO;
return false;
} catch (MPPDBIDEException exception) {
property1 = IMessagesConstants.ERR_TITLE_CREATE_FILE_DIRECTORY;
property2 = IMessagesConstants.ERR_BL_CREATE_FILE_DIRECTORY;
return false;
} finally {
if (!isSuccess) {
MPPDBIDEDialogs.generateOKMessageDialog(MESSAGEDIALOGTYPE.ERROR, true,
MessageConfigLoader.getProperty(property1), MessageConfigLoader.getProperty(property2));
workbench.close();
}
}
return isSuccess;
} |
def download(args) -> None:
torrent_fp: Path = args.torrent_file
dest_fp: Path = args.destination
if not torrent_fp.exists():
print("Torrent filepath does not exist.")
raise SystemExit
if dest_fp.exists() and dest_fp.is_file():
print(f"Destination is not a directory.")
raise SystemExit
if not dest_fp.exists():
try:
print(f"Destination directory does not exist. Creating {dest_fp}")
dest_fp.mkdir(parents=True)
except Exception:
print(f"Unable to create directory {dest_fp}")
asyncio.run(_download(torrent_fp, dest_fp)) |
Modern electronic devices are susceptible to damage from transient electrostatic discharge, commonly referred to as “ESD.” ESD events often occur when a person whose body has accumulated a static charge, touches or handles the electronic device. Static charge build-up can occur from a person walking across a carpeted surface or as a result of motion of certain types of clothing or from other sources. In any case, when the electronic device is touched by a charged person or other object, the built-up charge can be suddenly discharged through the electronic device. This can result in catastrophic damage to the electronic device. Accordingly, many electronic devices include some type of internal ESD protection. This often takes the form of an auxiliary transistor or Zener diode or other non-linear semiconductor device placed between one or more of the input/output (I/O) terminals of the electronic element being protected and a reference potential or common connection. This protective device detects the sudden rise in terminal voltage produced by the ESD event and switches on or otherwise creates a relatively low impedance path to the reference connection, thereby shunting the ESD current harmlessly to ground. Such ESD protection arrangements take many forms well known in the art. They have in common the above-noted feature that they normally present comparatively high impedance to the circuit they are protecting so as not interfere with its normal operation but are triggered into activity by the rising ESD pulse. As the leading edge of the ESD pulse is sensed, they switch to a low impedance state thereby limiting the voltage rise produced by the ESD pulse, in effect, clipping the top off the ESD pulse. When the ESD transient has passed, they once-again revert to a high impedance state. While such prior at arrangements work well in connection with active devices and integrated circuits, they are generally not applicable to integrated passive components where the necessary non-linear semiconductor devices or other type of non-linear spark-arrestors are not available. Accordingly there continues to be a need for means and method for protecting integrated passive devices. As used herein, the word “integrated” is intended to include elements formed in or on a common substrate. Thin film conductors and dielectrics are commonly used in integrated passive devices.
Accordingly, it is desirable to provide an improved means and method for ESD protection of electronic devices, especially for integrated passive devices. In addition, it is desirable that the means and method for providing such protection be generally compatible with available fabrication methods for such electronic devices so as to not require substantial changes in the manufacturing process. Furthermore, other desirable features and characteristics of the present invention will become apparent from the subsequent detailed description and the appended claims, taken in conjunction with the accompanying drawings and the foregoing technical field and background. |
from rest_framework import serializers
from reviewSystem.models import Item,Category,User,Rating
# the below line for user restriction
# from django.contrib.auth.models import User
# from django.forms import widgets ??
# class RootUserSerializer(serializers.ModelSerializer):
# item_owner = serializers.PrimaryKeyRelatedField(many=True)
# class Meta:
# model = User
# fields = ('id', 'username', 'item_owner')
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
fields = ('id', 'items_type','item')
class ItemSerializer(serializers.ModelSerializer):
category_type = serializers.RelatedField(many=True)
#category_type = CategorySerializer(many=True)
class Meta:
model = Item
fields = ('id', 'item_id','item_name', 'item_rating','category_type' )
class RatingSerializer(serializers.ModelSerializer):
class Meta:
model = Rating
fields = ('id', 'item', 'ratings', 'timestamp','user')
class UserSerializer(serializers.ModelSerializer):
user_rating = serializers.RelatedField(many=True)
class Meta:
model = User
fields = ('id', 'user_id','first_name', 'last_name', 'email','tiemstamp','user_rating')
|
<gh_stars>0
/*
* Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://mindorks.com/license/apache-v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.edwiinn.project.ui.login;
import com.edwiinn.project.di.PerActivity;
import com.edwiinn.project.ui.base.MvpPresenter;
import net.openid.appauth.AuthorizationException;
import net.openid.appauth.AuthorizationResponse;
/**
* Created by janisharali on 27/01/17.
*/
@PerActivity
public interface LoginMvpPresenter<V extends LoginMvpView> extends MvpPresenter<V> {
void doSsoRequestAuth();
void doSsoRequestToken(AuthorizationResponse response, AuthorizationException error);
void loadSsoUserInfo();
void onLoadCertificate();
}
|
package com.antzuhl.zeus.config;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AutoConfiguration {
}
|
Polymorphism of the IGF2 gene, birth weight and grip strength in adult men. BACKGROUND Grip strength is a simple measure of skeletal muscle function but a powerful predictor of disability, morbidity and mortality. Recent evidence has shown that prenatal and infant growth influence grip strength in later life; this may reflect genetic influences on muscle size and function, although strong candidate genes have not been identified. IGF II has proliferative effects in adult muscle and is one of the major determinants of fetal growth; polymorphism in the IGF2 gene could therefore link early growth to adult grip strength. OBJECTIVES To determine whether polymorphism of the IGF2 gene influences adult grip strength and mediates the association between size at birth and grip strength in later life. METHODS Polymorphism of the ApaI marker in the IGF2 gene was determined for 693 Hertfordshire men and women born between 1920 and 1930 who had taken part in a study linking early growth to ageing. Grip strength was measured using isometric dynamometry. Genotyping assay development was undertaken in Southampton Genetic Epidemiology Laboratories (http://www.sgel.humgen.soton.ac.uk). RESULTS In univariate analyses, IGF2 genotype and birth weight were both significant predictors of adult grip strength in the men after adjustment for age and current height. Significant associations were not seen in the women. When IGF2 genotype and birth weight in men were studied simultaneously, both contributed significantly to grip strength after adjustment for age and adult height. CONCLUSIONS These results show that polymorphism of the IGF2 gene and birth weight have independent effects on adult grip strength in men and suggest that IGF2 polymorphism does not explain the association between size at birth and grip in later life. This study provides preliminary evidence for independent genetic and early environmental programming of adult muscle strength. |
/**************************************************************************
*
* This file is part of the ParaNut project.
*
* Copyright (C) 2020-2021 <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* Hochschule Augsburg, University of Applied Sciences
*
* Description:
* This is an example of a Wishbone slave peripheral module.
*
* --------------------- LICENSE -----------------------------------------------
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**************************************************************************/
#include "example_wb_slave.h"
#define PN_TRACE_VERBOSE 0 // EDIT HERE: Change to 1 to add extra console output
// *************************** Helpers *****************************************
// Compiled outside the ParaNut environment: Define some helper macros locally ...
#ifndef _PARANUT_PERIPHERAL_
#ifndef __SYNTHESIS__
static char *GetTraceName (sc_object *obj, const char *name, int dim, int arg1, int arg2) {
static char buf[200];
char *p;
strcpy (buf, obj->name ());
p = strrchr (buf, '.');
p = p ? p + 1 : buf;
sprintf (p, dim == 0 ? "%s" : dim == 1 ? "%s(%i)" : "%s(%i)(%i)", name, arg1, arg2);
// printf ("### %s, %i, %i, %i -> %s\n", ((sc_object *) obj)->name (), dim, arg1, arg2, buf);
return buf;
}
#define PN_TRACE(TF, OBJ) { \
if (TF) sc_trace (TF, OBJ, GetTraceName (&(OBJ), #OBJ, 0, 0, 0)); \
if (!TF || PN_TRACE_VERBOSE) cout << " " #OBJ " = '" << (OBJ).name () << "'\n"; \
}
#define PN_TRACE_BUS(TF, OBJ, N_MAX) { \
for (int n = 0; n < N_MAX; n++) { \
if (TF) sc_trace (TF, (OBJ)[n], GetTraceName (&(OBJ)[n], #OBJ, 1, n, 0)); \
if (!TF || PN_TRACE_VERBOSE) \
cout << " " #OBJ "[" << n << "] = '" << (OBJ)[n].name () << "'\n"; \
} \
}
#endif // __SYNTHESIS__
// Compiled with the ParaNut environment ...
#else // _PARANUT_PERIPHERAL_
#undef PN_TRACE_VERBOSE
#define PN_TRACE_VERBOSE pn_trace_verbose // map PN_TRACE_VERBOSE to run-time switch
#endif // _PARANUT_PERIPHERAL_
// ***************** Signal Tracing (Simulation) *******************************
#ifndef __SYNTHESIS__
void example_wb_slave::trace (sc_trace_file *tf, int level) {
if (!tf || PN_TRACE_VERBOSE) printf ("\nSignals of Module \"%s\":\n", name ());
if (!tf) return;
// WishBone Slave Ports (usually not to change) ...
if (level >= 1) {
PN_TRACE (tf, wb_clk_i);
PN_TRACE (tf, wb_rst_i);
PN_TRACE (tf, wb_cyc_i);
PN_TRACE (tf, wb_stb_i);
PN_TRACE (tf, wb_we_i);
PN_TRACE (tf, wb_cti_i);
PN_TRACE (tf, wb_bte_i);
PN_TRACE (tf, wb_sel_i);
PN_TRACE (tf, wb_adr_i);
PN_TRACE (tf, wb_dat_i);
PN_TRACE (tf, wb_dat_o);
PN_TRACE (tf, wb_ack_o);
PN_TRACE (tf, wb_rty_o);
PN_TRACE (tf, wb_err_o);
}
// User-Specific Ports and Registers ...
// EDIT HERE...
}
#endif // __SYNTHESIS__
// *************************** I/O Registers ***********************************
/* The following method(s) implement a generic WishBone slave interface.
*
* Usually, it is not necessary to make any changes here.
* The number of slave registers can be adjusted by setting 'ioregs_num_ld'.
*/
// Clocked main method (every signal/output assigned here will be a register) ...
void example_wb_slave::proc_ioregs_transition () {
// Vivado HLS pragmas (see UG902 Chapter 4)...
#pragma HLS ARRAY_PARTITION variable=ioregs_regs complete dim=1 // Make sure "ioregs_regs" will be registers not BR
// Local variables...
sc_uint<ioregs_num_ld+2> reg_idx;
sc_uint<32> wb_adr_i_var, wb_dat_i_var, wb_dat_o_var;
sc_uint<32> regs_var[ioregs_num], sel_reg;
sc_uint<4> wb_sel_i_var;
// Read inputs...
#if CFG_MEMU_BUSIF_WIDTH == 64
// This implementation assumes that either top or bottom 32 bits are read/written, never both!
bool top_word = wb_sel_i.read()(7, 4).or_reduce();
wb_adr_i_var = top_word ? wb_adr_i.read() + 4 : wb_adr_i.read();
wb_dat_i_var = top_word ? wb_dat_i.read().range(63, 32) : wb_dat_i.read().range(31, 0);
wb_sel_i_var = top_word ? wb_sel_i.read ()(7, 4) : wb_sel_i.read ()(3, 0);
#else
wb_adr_i_var = wb_adr_i.read ();
wb_dat_i_var = wb_dat_i.read ();
wb_sel_i_var = wb_sel_i.read ();
#endif
// Read registers...
for (int n = 0; n < ioregs_num; ++n)
#pragma HLS LOOP_FLATTEN
regs_var[n] = ioregs_regs[n].read ();
// Determine index of addressed register and select it...
// (Single point of read access into the array -> only one Multiplexor will be generated)
reg_idx = wb_adr_i_var (2 + ioregs_num_ld, 2);
sel_reg = regs_var[reg_idx];
// Write default to outputs...
wb_ack_o = 0;
wb_err_o = 0;
wb_rty_o = 0;
wb_dat_o_var = 0;
// Synchronous reset...
if (wb_rst_i) {
for (int n = 0; n < ioregs_num; ++n) regs_var[n] = 0;
} else {
// Handle wishbone read/write...
if (wb_stb_i == 1 && wb_cyc_i == 1) {
// Write access ...
if (wb_we_i) {
// Use sel_i for byte/half-word/word writes...
// (doesn't look super clean, but works for HLS)
for (int n = 0; n < 4; n++)
#pragma HLS LOOP_FLATTEN
if (wb_sel_i_var[n] == 1)
sel_reg = (sel_reg & ~(0x000000ff << (8 * n))) |
(wb_dat_i_var & (0x000000ff << (8 * n)));
regs_var[reg_idx] = sel_reg;
// Read access ...
} else {
wb_dat_o_var = sel_reg;
}
wb_ack_o = 1;
}
// Handle user logic...
for (int n = 0; n < ioregs_num; ++n)
#pragma HLS LOOP_FLATTEN
regs_var[n] = callback_ioregs_writeback (n, regs_var[n]);
}
// Write back registers...
for (int n = 0; n < ioregs_num; ++n)
#pragma HLS LOOP_FLATTEN
ioregs_regs[n] = regs_var[n];
// Write derived outputs...
#if WB_PORT_SIZE == 64
wb_dat_o = top_word ? (wb_dat_o_var, sc_uint<32>(0)) : (sc_uint<32>(0), wb_dat_o_var);
#else
wb_dat_o = wb_dat_o_var;
#endif
}
// *************************** User-Specific Logic *****************************
// EDIT HERE
|
Five times the lying mainstream media was caught publishing ‘fake news’
The news war was officially launched after a liberal professor created a list of fake news sites, which spread like wildfire online. It’s the beginning of the establishment’s war on independent media, disguised as a battle on fake news. To get an understanding of just how biased the fake media list actually is, the only mainstream media sites to make that list favored Bernie Sanders over Hillary Clinton for president. Of course, the real news sites wouldn’t lie or do anything crooked like their candidate of choice would. Here are five instances where news outlets published outrageous fake news, with consequences catastrophic to civilian lives.
George W. Bush’s weapons of mass destruction is a good place to start. He unleashed the full force of the U.S. military disguised as a war on terrorism following the attacks on 09/11/01. Afghanistan was chosen as a victim because of the supposed identities of the attackers. Iraq suffered the consequences following dubious claims that Saddam Hussein harbored destructive chemical and biological weapons while actively seeking stronger munitions. Judith Miller reported for The New York Times that an Iraqi scientist had seen several extensive caches of such weapons of mass destruction stored somewhere in the country. The Times spent months trying to backtrack on the story after its heavy flaws were revealed. The damage was already done though, since the story caused widespread public support for a war that nobody wanted the military to undertake.
The Gulf of Tonkin incident exemplifies the mainstream media working as an employee of the government, where anything claimed by a U.S. official is reported as fact. The Gulf of Tonkin incident was possibly one of the craziest lies made up to be used as justification for war. The New York Times reported that President Johnson had ordered retaliatory strikes against gunboats and certain supporting facilities in North Vietnam, after renewed attacks against American destroyers in the Gulf of Tonkin. All the other news outlets took the story as real and published their own. This fiction for war story claimed the lives of tens of thousands of U.S. troops and millions of Vietnamese.
CNN sent reporter Amber Lyon and a crew to Bahrain for a documentary about technology’s role in the 2011 people’s uprising known as the Arab Spring. What they encountered was a repressive and violent regime, which is what Lyon attempted to report on. However, CNN filtered and censored the truth. Many sources that had agreed to speak with CNN either hid from them or had vanished. Regime opponents who were interviewed suffered recriminations. Bahrain’s officials contacted CNN International repeatedly to complain about Lyon’s continued reporting on what she’d seen. Intimidation continued until she was laid off.
Fox News repeatedly interviewed a CIA operative, who had in fact never worked for the agency. For over a decade, Wayne Shelby Simmons made guest appearances on Fox News, supposedly to provide expert insight into various situations. The mainstream media offered up fake insight as the real deal.
Almost 40 percent of all drug arrests in 2015 were for possession of cannabis. Millions of lives were ruined by criminal convictions for possessing a healing plant. The mainstream media publishes false propaganda about cannabis to convince people that it is as dangerous as heroin or cocaine. Despite many media claims that pot is a dangerous drug, 69 percent of the population believes it to be less harmful than alcohol.
Sources:
TheDailySheeple
NewsFocus.org |
/**
* @author Pavol Loffay
*/
public class OpenTracingCDIExtension implements Extension {
public void observeBeforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager manager) {
SmallRyeLogging.log.registeringTracerCDIProducer();
bbd.addAnnotatedType(manager.createAnnotatedType(TracerProducer.class));
}
} |
/*
* Copyright 2018 JDCLOUD.COM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*
*
*
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
package com.jdcloud.sdk.service.ydsms.model;
/**
* sendOverviewVO
*/
public class SendOverviewVO implements java.io.Serializable {
private static final long serialVersionUID = 1L;
/**
* 计费量
*/
private Long billingCount;
/**
* 聚合截止时间
*/
private String endTime;
/**
* 发送量
*/
private Long sendCount;
/**
* 聚合开始时间
*/
private String startTime;
/**
* 发送成功量
*/
private Long successCount;
/**
* 成功率
*/
private String successRate;
/**
* get 计费量
*
* @return
*/
public Long getBillingCount() {
return billingCount;
}
/**
* set 计费量
*
* @param billingCount
*/
public void setBillingCount(Long billingCount) {
this.billingCount = billingCount;
}
/**
* get 聚合截止时间
*
* @return
*/
public String getEndTime() {
return endTime;
}
/**
* set 聚合截止时间
*
* @param endTime
*/
public void setEndTime(String endTime) {
this.endTime = endTime;
}
/**
* get 发送量
*
* @return
*/
public Long getSendCount() {
return sendCount;
}
/**
* set 发送量
*
* @param sendCount
*/
public void setSendCount(Long sendCount) {
this.sendCount = sendCount;
}
/**
* get 聚合开始时间
*
* @return
*/
public String getStartTime() {
return startTime;
}
/**
* set 聚合开始时间
*
* @param startTime
*/
public void setStartTime(String startTime) {
this.startTime = startTime;
}
/**
* get 发送成功量
*
* @return
*/
public Long getSuccessCount() {
return successCount;
}
/**
* set 发送成功量
*
* @param successCount
*/
public void setSuccessCount(Long successCount) {
this.successCount = successCount;
}
/**
* get 成功率
*
* @return
*/
public String getSuccessRate() {
return successRate;
}
/**
* set 成功率
*
* @param successRate
*/
public void setSuccessRate(String successRate) {
this.successRate = successRate;
}
/**
* set 计费量
*
* @param billingCount
*/
public SendOverviewVO billingCount(Long billingCount) {
this.billingCount = billingCount;
return this;
}
/**
* set 聚合截止时间
*
* @param endTime
*/
public SendOverviewVO endTime(String endTime) {
this.endTime = endTime;
return this;
}
/**
* set 发送量
*
* @param sendCount
*/
public SendOverviewVO sendCount(Long sendCount) {
this.sendCount = sendCount;
return this;
}
/**
* set 聚合开始时间
*
* @param startTime
*/
public SendOverviewVO startTime(String startTime) {
this.startTime = startTime;
return this;
}
/**
* set 发送成功量
*
* @param successCount
*/
public SendOverviewVO successCount(Long successCount) {
this.successCount = successCount;
return this;
}
/**
* set 成功率
*
* @param successRate
*/
public SendOverviewVO successRate(String successRate) {
this.successRate = successRate;
return this;
}
} |
Digital morphology analyzers in hematology: Comments on the ICSH review and recommendations Dear Editors, We read the article Digital morphology analyzers in hematology: ICSH review and recommendations by Kratz et al1 published in this journal with great interest. While publication of a review article and recommendations for such a new and exciting technology was timely, there seems to have been some misunderstandings in the article which we would like to address. While the authors stated that in their article strengths and weaknesses of digital imaging were determined, our review revealed examples where the authors seemed to have misunderstood the findings of previous research. As a result, there is a potential that the reader might get a negative view of digital morphology in general and be discouraged from its use, which we believe was not the intention of this review. In order to highlight some of our concerns, we have selected a small number of examples to support our findings. An example is the use of the word detection in the review article. The authors state Briggs et al similarly reported poor detection of immature granulocytes, eosinophils, and basophils.1 We found the use of the word detection misleading and wish to point out that Briggs et al2 did not use this word anywhere in their article. Furthermore, no statement is made on the detectability of these cell types, instead correlation between the manual and the automated differential, and preclassification accuracy is discussed. Briggs et al2 explained that lower correlation between the manual and the CellaVision® DM96 (DM96) differential results for eosinophils was potentially due to a staining issue which could be modified. Regarding basophils and immature myeloid cells, they concluded that the lower correlation was due to the low number of counted cells (implying that the reason for the low correlation was partly in the manual method) as this part of the study was performed only counting 100 cells.2 In summary, Briggs et al concluded that We have demonstrated that the differential from the DM96 is as good as that by a laboratory scientist; however, the laboratory scientist operating the DM96 must be skilled in blood cell morphology.2 Another example where the use of the word detection by Kratz et al1 is misleading is the following statement: In contrast, Park et al found that detection of basophils and band neutrophils was poor, but blast detection showed high sensitivity and specificity. Regarding band neutrophils and basophils, Park et al3 actually refer to weaker correlation between manual microscopy and using the DM96 analyzer but judged this as satisfactorynot poor; they did not make any conclusions regarding the detection of these cell types. Park et al3 referred to the term detection when they did a concordance analysis for the following six abnormalities: . The result according to Park et al was satisfactory, especially for blasts.3 The only time Park et al3 discuss low detection was in another context in relation to positive predictive value of promyelocytes. They also point out one case where two manual differential counts were completely discordant, while the suggestion of the DM96 was in agreement with one of the manual differential counts, which was determined to be correct after review by the laboratory hematologist.3 To conclude, the use of the word detection by Kratz et al1 in a context not consistent with the referenced articles may create incorrect perceptions about the capability of digital morphology analyzers. We also found statements in the review article that were not supported by scientific references. An example is The review speed may be expected to be slower in busy laboratories with large numbers of samples that have low WBC counts as well as abnormal cells,1 in which case we did not manage to locate the source(s) of this statement in the scientific literature. In fact, the above article by Briggs et al2 clearly contradicts this statement showing that the average time for the analysis of 30 blood filmsincluding samples with low WBC count and highly abnormal cellswas 1 hour 20 minutes using the DM96, while it was 2 hour 54 minutes by manual analysis. Time saving using the DM96 analyzer is also confirmed by other authors.4,5 Similarly, the authors state without reference Therefore, depending on the patient population, 10 to 20% of all slides may still require manual microscopic review. It is unclear what these numbers are based on. Some of the limitations mentioned in Table 2 of the review article (Situations in which CellaVision has limitations and for which a manual microscopic review should be considered)1 also seem to be in contradiction with references cited throughout the paper. For example, one of the limitations, Suspicion of the presence of pathological cell types, including blasts, plasma cells, and immature Dear Editors, We read the article "Digital morphology analyzers in hematology: ICSH review and recommendations" by Kratz et al 1 published in this journal with great interest. While publication of a review article and recommendations for such a new and exciting technology was timely, there seems to have been some misunderstandings in the article which we would like to address. While the authors stated that in their article "strengths and weaknesses of digital imaging were determined," our review revealed examples where the authors seemed to have misunderstood the findings of previous research. As a result, there is a potential that the reader might get a negative view of digital morphology in general and be discouraged from its use, which we believe was not the intention of this review. In order to highlight some of our concerns, we have selected a small number of examples to support our findings. An example is the use of the word "detection" in the review article. The authors state "Briggs et al similarly reported poor detection of immature granulocytes, eosinophils, and basophils." 1 We found the use of the word "detection" misleading and wish to point out that Briggs et al 2 did not use this word anywhere in their article. Furthermore, no statement is made on the detectability of these cell types, instead correlation between the manual and the automated differential, and preclassification accuracy is discussed. Briggs et al 2 explained that lower correlation between the manual and the CellaVision ® DM96 (DM96) differential results for eosinophils was potentially due to "a staining issue which could be modified." Regarding basophils and immature myeloid cells, they concluded that the lower correlation was due to the low number of counted cells (implying that the reason for the low correlation was partly in the manual method) as this part of the study was performed only counting 100 cells. 2 In summary, Briggs et al concluded that "We have demonstrated that the differential from the DM96 is as good as that by a laboratory scientist; however, the laboratory scientist operating the DM96 must be skilled in blood cell morphology. We also found statements in the review article that were not supported by scientific references. An example is "The review speed may be expected to be slower in busy laboratories with large numbers of samples that have low WBC counts as well as abnormal cells," 1 in which case we did not manage to locate the source(s) of this statement in the scientific literature. In fact, the above article by Briggs et al 2 clearly contradicts this statement showing that the average time for the analysis of 30 blood films-including samples with low WBC count and highly abnormal cells-was 1 hour 20 minutes using the DM96, while it was 2 hour 54 minutes by manual analysis. Time saving using the DM96 analyzer is also confirmed by other authors. 4,5 Similarly, the authors state without reference "Therefore, depending on the patient population, 10 to 20% of all slides may still require manual microscopic review." It is unclear what these numbers are based on. Table 2 of the review article ("Situations in which CellaVision has limitations and for which a manual microscopic review should be considered") 1 also seem to be in contradiction with references cited throughout the paper. Table 2 of the review article, "All samples from newborns and from patients with leukemia," 1 seems to conflict with the findings of Herishanu et al. 6 Furthermore, Marionneaux et al 7 found that the DM96 can be used as "a feasible, rapid and inexpensive screening tool" to subclassify patients with CLL into typical or atypical CLL subgroups. Some of the limitations mentioned in Furthermore, the recommendation "In the presence of abnormal cells or in pediatric samples of lymphocytes, the size, thickness, and color differences can lead to incorrect cell identification, often resulting in an overestimation of blast cells" 1 refers to an article by Eilertsen et al 8 ; however, our thorough review of this article did not find any statement or conclusion which supports this statement. Regarding the review article's recommendations, we found it remarkable that while the authors mention that digital morphology analyzers display only a limited number of cells, they only recommend "to always reconcile the flags of the automated analyzer with the report of the digital imaging. In the presence of any discrepancy, a manual differential with the microscope should be performed", 1 instead of the obvious first choice of examining an increased number of cells as it is recommended by the CLSI document H20-A2 standard. 9 This would limit the number of slides requiring manual microscopy to those referred to in the authors' example, where pathological cells are located exclusively in the margins of the slide. The review also sets out to propose recommendations for improvement of digital imaging; however, the standards they recommend for manufacturers to follow are mainly relevant for whole slide imaging (WSI) or other medical imaging technologies and not specific to digital morphology analyzers. While it was mentioned that these standards "are applicable to digital analyzers only in general terms and not as specific recommendations," 1 it would have been beneficial to point out specific parts of these standards the authors find applicable for digital morphology systems used in hematology. There is a considerable difference between WSI and other medical imaging technologies and digital morphology analysis in hematology which was not explained by the authors. We also found that the authors of this review article might not have fully understood how digital morphology analyzers function today. At several places in the article, the authors seem to fault the analyzer for requiring a competent user for its operation and expect it to function as a fully automated self-reporting device. As an example, the review criticizes the fact that the study written by Lee et al 10 evaluated reclassified rather than preclassified results and concluded that "Therefore, the study may be unable to test the possibility of full automation of PBS analysis." 1 While Lee et al 10 mentioned this as a limitation of their study, their stated aim was "to assess the ability of the CellaVision DM96 (DM96) system and software to classify leukocytes by comparing it with the manual PBS examination." Just like manual microscopy, the DM96 system per design includes a competent user; therefore it is not correct to expect a fully automated digital morphology system as they are not currently designed to operate in that manner. Similarly, regarding the study by Criel et al,11 the authors of the review article comment "However, evaluation of the images by an experienced observer remained necessary," suggesting that this was a negative property of the system. Finally, the comment in the review article in relation to the two tables talks about "advantages of the CellaVision systems" and "Situations in which the CellaVision has limitations." 1 While we feel honored to be regarded as a synonym for digital morphology, it would be more appropriate to use "digital morphology" in the title of both Tables. 1 There are a number of other comments we could have made regarding the review article; however, we omitted them from this letter. For those who are interested, we would be happy to share our complete list of comments. K E Y WO R DS digital imaging, laboratory hematology, laboratory standards, recommendations CO N FLI C T O F I NTE R E S T The author is an employee of CellaVision AB. |
Three people have been killed and at least seven wounded at Plaza Garibaldi in downtown Mexico City on Friday evening. Police said that three men dressed as mariachi musicians opened fire with pistols and rifles before fleeing the square on motorbikes. Plaza Garibaldi is a popular tourist spot, but borders on the neighborhood of Tepito, known for drug-related violence. |
<gh_stars>1-10
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors
// This file is consisted of the MATRIX library and part of the go-ethereum library.
//
// The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
//and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject tothe following conditions:
//
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
//WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
//OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package tests
import (
"fmt"
"math/big"
"github.com/matrix/go-matrix/common"
"github.com/matrix/go-matrix/common/math"
"github.com/matrix/go-matrix/consensus/manash"
"github.com/matrix/go-matrix/core/types"
"github.com/matrix/go-matrix/params"
)
//go:generate gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go
type DifficultyTest struct {
ParentTimestamp *big.Int `json:"parentTimestamp"`
ParentDifficulty *big.Int `json:"parentDifficulty"`
UncleHash common.Hash `json:"parentUncles"`
CurrentTimestamp *big.Int `json:"currentTimestamp"`
CurrentBlockNumber uint64 `json:"currentBlockNumber"`
CurrentDifficulty *big.Int `json:"currentDifficulty"`
}
type difficultyTestMarshaling struct {
ParentTimestamp *math.HexOrDecimal256
ParentDifficulty *math.HexOrDecimal256
CurrentTimestamp *math.HexOrDecimal256
CurrentDifficulty *math.HexOrDecimal256
UncleHash common.Hash
CurrentBlockNumber math.HexOrDecimal64
}
func (test *DifficultyTest) Run(config *params.ChainConfig) error {
parentNumber := big.NewInt(int64(test.CurrentBlockNumber - 1))
parent := &types.Header{
Difficulty: test.ParentDifficulty,
Time: test.ParentTimestamp,
Number: parentNumber,
UncleHash: test.UncleHash,
}
actual := manash.CalcDifficulty(config, test.CurrentTimestamp.Uint64(), parent)
exp := test.CurrentDifficulty
if actual.Cmp(exp) != 0 {
return fmt.Errorf("parent[time %v diff %v unclehash:%x] child[time %v number %v] diff %v != expected %v",
test.ParentTimestamp, test.ParentDifficulty, test.UncleHash,
test.CurrentTimestamp, test.CurrentBlockNumber, actual, exp)
}
return nil
}
|
To be ionized or not to be ionized: the vital role of physicochemical properties of galbanic acid derivatives in AChE assay Abstract Alzheimers disease is a progressive neurodegenerative disorder and patients suffer from memory loss, a decline in language skill and impairment in other cognitive functions. In the cholinergic hypothesis, dysfunction of cholinergic neurons especially in the hippocampus and cerebral cortex contributes to cognitive decline in patients. So agents that enhance acetylcholine concentration could improve cognitive function. AChEIs are among the most studied anti-Alzheimer agents. Galbanic acid as a natural compound with a sesquiterpene coumarin scaffold is a weak inhibitor of AChE. In the present contribution, we discussed the impact of carboxylic group ionization on inhibitory effects. We performed in vitro and in silico studies on galbanic acid, methyl and ethyl galbanates as AChE inhibitors. The order of inhibitory effect on AChE was obtained as ethyl galbanate∼methyl galbanate>galbanic acid. Our study highlights the important role of the physicochemical properties of natural lead compounds in each specific assay. Communicated by Ramaswamy H. Sarma |
/*
Copyright 2020 Cortex Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package spec
import (
"bytes"
"fmt"
"path/filepath"
"time"
"github.com/cortexlabs/cortex/pkg/consts"
"github.com/cortexlabs/cortex/pkg/lib/hash"
"github.com/cortexlabs/cortex/pkg/lib/sets/strset"
s "github.com/cortexlabs/cortex/pkg/lib/strings"
"github.com/cortexlabs/cortex/pkg/types/userconfig"
)
type API struct {
*userconfig.API
ID string `json:"id"`
SpecID string `json:"spec_id"`
PredictorID string `json:"predictor_id"`
DeploymentID string `json:"deployment_id"`
Key string `json:"key"`
PredictorKey string `json:"predictor_key"`
LastUpdated int64 `json:"last_updated"`
MetadataRoot string `json:"metadata_root"`
ProjectID string `json:"project_id"`
ProjectKey string `json:"project_key"`
LocalModelCaches []*LocalModelCache `json:"local_model_cache"` // local only
LocalProjectDir string `json:"local_project_dir"`
}
type LocalModelCache struct {
ID string `json:"id"`
HostPath string `json:"host_path"`
TargetPath string `json:"target_path"`
}
/*
APIID (uniquely identifies an api configuration for a given deployment)
* SpecID (uniquely identifies api configuration specified by user)
* PredictorID (used to determine when rolling updates need to happen)
* Resource
* Predictor
* Monitoring
* Compute
* ProjectID
* Deployment Strategy
* Autoscaling
* Networking
* APIs
* DeploymentID (used for refreshing a deployment)
*/
func GetAPISpec(apiConfig *userconfig.API, projectID string, deploymentID string, clusterName string) *API {
var buf bytes.Buffer
buf.WriteString(s.Obj(apiConfig.Resource))
buf.WriteString(s.Obj(apiConfig.Predictor))
buf.WriteString(s.Obj(apiConfig.Monitoring))
buf.WriteString(projectID)
if apiConfig.Compute != nil {
buf.WriteString(s.Obj(apiConfig.Compute.Normalized()))
}
predictorID := hash.Bytes(buf.Bytes())
buf.Reset()
buf.WriteString(predictorID)
buf.WriteString(s.Obj(apiConfig.APIs))
buf.WriteString(s.Obj(apiConfig.Networking))
buf.WriteString(s.Obj(apiConfig.Autoscaling))
buf.WriteString(s.Obj(apiConfig.UpdateStrategy))
specID := hash.Bytes(buf.Bytes())[:32]
apiID := fmt.Sprintf("%s-%s-%s", MonotonicallyDecreasingID(), deploymentID, specID) // should be up to 60 characters long
return &API{
API: apiConfig,
ID: apiID,
SpecID: specID,
PredictorID: predictorID,
Key: Key(apiConfig.Name, apiID, clusterName),
PredictorKey: PredictorKey(apiConfig.Name, predictorID, clusterName),
DeploymentID: deploymentID,
LastUpdated: time.Now().Unix(),
MetadataRoot: MetadataRoot(apiConfig.Name, clusterName),
ProjectID: projectID,
ProjectKey: ProjectKey(projectID, clusterName),
}
}
// Keep track of models in the model cache used by this API (local only)
func (api *API) LocalModelIDs() []string {
models := []string{}
if api != nil && len(api.LocalModelCaches) > 0 {
for _, localModelCache := range api.LocalModelCaches {
models = append(models, localModelCache.ID)
}
}
return models
}
func (api *API) ModelNames() []string {
names := []string{}
if api != nil && len(api.Predictor.Models) > 0 {
for _, model := range api.Predictor.Models {
names = append(names, model.Name)
}
}
return names
}
func (api *API) SubtractLocalModelIDs(apis ...*API) []string {
modelIDs := strset.FromSlice(api.LocalModelIDs())
for _, a := range apis {
modelIDs.Remove(a.LocalModelIDs()...)
}
return modelIDs.Slice()
}
func PredictorKey(apiName string, predictorID string, clusterName string) string {
return filepath.Join(
clusterName,
"apis",
apiName,
"predictor",
predictorID,
consts.CortexVersion+"-spec.json",
)
}
func Key(apiName string, apiID string, clusterName string) string {
return filepath.Join(
clusterName,
"apis",
apiName,
"api",
apiID,
consts.CortexVersion+"-spec.json",
)
}
func (api API) RawAPIKey(clusterName string) string {
return filepath.Join(
clusterName,
"apis",
api.Name,
"raw_api",
api.ID,
consts.CortexVersion+"-cortex.yaml",
)
}
func MetadataRoot(apiName string, clusterName string) string {
return filepath.Join(
clusterName,
"apis",
apiName,
"metadata",
)
}
func ProjectKey(projectID string, clusterName string) string {
return filepath.Join(
clusterName,
"projects",
projectID+".zip",
)
}
|
use crate::font::{
FONT_WIDTH, FONT_HEIGHT,
write_ascii, write_string
};
use crate::graphics::{PixelColor, PixelWriter};
use core::cell::RefCell;
const ROWS: usize = 25;
const COLUMNS: usize = 80;
pub struct Console<'a> {
buffer: [[u8; COLUMNS]; ROWS],
cursor_row: usize,
cursor_column: usize,
fg_color: PixelColor,
bg_color: PixelColor,
writer: &'a RefCell<&'a mut dyn PixelWriter>,
}
impl<'a> Console<'a> {
pub fn new(
fg_color: PixelColor,
bg_color: PixelColor,
writer: &'a RefCell<&'a mut dyn PixelWriter>,
) -> Self {
Console {
buffer: [[0; COLUMNS]; ROWS],
cursor_row: 0,
cursor_column: 0,
fg_color,
bg_color,
writer,
}
}
}
impl<'a> Console<'a> {
pub fn put_string<A: AsRef<str>>(&mut self, s: A) {
for c in s.as_ref().chars() {
if c == '\n' {
self.new_line();
} else if self.cursor_column < COLUMNS {
write_ascii(
self.writer,
FONT_WIDTH * self.cursor_column,
FONT_HEIGHT * self.cursor_row,
c,
&self.fg_color,
);
self.buffer[self.cursor_row][self.cursor_column] = c as u8;
self.cursor_column += 1;
}
}
}
fn new_line(&mut self) {
self.cursor_column = 0;
if self.cursor_row < ROWS - 1 {
self.cursor_row += 1;
} else {
for y in 0..(FONT_HEIGHT * ROWS) {
for x in 0..(FONT_WIDTH * COLUMNS) {
self.writer.borrow_mut().write(x, y, &self.bg_color);
}
}
for row in 0..(ROWS - 1) {
self.buffer.copy_within((row + 1)..(row + 2), row);
let s = unsafe {
// Initial values at the back of buffer are also
// included in string.
core::str::from_utf8_unchecked(&self.buffer[row])
};
write_string(
self.writer,
0,
FONT_HEIGHT * row,
s,
&self.fg_color
);
}
self.buffer[ROWS - 1].fill(0);
}
}
}
|
A method for carbonylating methanol with carbon monoxide in the presence of a rhodium catalyst to produce acetic acid is well known as so-called “Monsanto method”. There are two methods for the carbonylation method. One is a method in which acetic acid is used as a solvent, methanol of a raw material is added to the acetic acid, a rhodium compound as a catalyst is dissolved therein and a carbon monoxide gas is fed into the reaction mixture (homogeneous catalytic reaction). The other is a method in which a solid catalyst having a rhodium compound carried on a carrier is suspended in the reaction mixture instead of dissolving the rhodium compound into it (heterogeneous catalytic reaction). However, in both cases, an iodide compound such as methyl iodide is added into the reaction mixture as a cocatalyst (reaction promoter), so that about several tens to several hundreds of ppb (μg/kg) of the iodide compound remains in the acetic acid produced by the carbonylation method even after the acetic acid has been refined by distillation. The iodide compound remaining in the acetic acid in such a manner acts as a catalyst poison to a VAM (vinyl acetate monomer) synthetic catalyst when the acetic acid is used as a raw material of VAM for instance, and accordingly needs to be removed into a level of about several parts per billion.
There is a method for removing an iodide compound remaining in acetic acid by passing the acetic acid through a packed bed of a macroporous-type cation-exchange resin having silver ion or mercury ion exchanged and carried (Japanese Patent Publication No. H05-021031). This method is effective for efficiently removing the iodide compound from the acetic acid and decreasing the iodide concentration of outflowing acetic acid into 10 ppb or lower, but it has a problem that as the carbon number of the iodide compound increases, an adsorption rate decreases, a width of an adsorption zone is widened and a silver utilization at a breakthrough point decreases. As a result, the method can treat a small amount of acetic acid per unit resin volume, which is not favorable from the viewpoint of a treatment cost.
In order to solve the above described problem several methods have been investigated. One is a method in which an ion exchange resin having an active site only on a surface is used, which method is developed through having paid particular attention to the point that the diffusion of an iodide compound in adsorbent particles limits an adsorption rate (Japanese Patent Application Laid-Open No. H09-291058). Another one is a method in which an iodide adsorption apparatus is operated at a temperature higher than about 50° C. (Japanese Patent Application Laid-Open No. 2003-527963). However, the former method has a disadvantage that it is not easy to prepare an ion-exchange resin so as to have the active site only on the surface, and that if the inside of the ion-exchange resin particle is consequently not used effectively, an exchange capacity per unit volume of resin becomes small. On the other hand, the latter method has a disadvantage that when the apparatus is operated at a high temperature, the active site is more rapidly decomposed and released, and silver ion is also more rapidly released.
In addition, a method is proposed which starts an iodide removal operation at a low temperature, and every step of time when an iodide compound is detected in a discharged liquor due to decrease of an iodide removal rate, increases the temperature, so as to reduce the release of an active site and the release of silver ion (Japanese Patent Application Laid-Open No. H09-291059). However, the method also have a disadvantage that it is a complicated operation to increase the temperature step by step, and that the active site unavoidably decomposes and is released and silver ion is unavoidably released, because the exchange resin finally contacts with a high-temperature liquid by any means. The released active site and silver ion become impurities in a product of acetic acid, which is not preferable. |
<reponame>zuckerman-dev/geod
#include <iostream>
#include <chrono>
#include <thread>
#include <future>
#include <fstream>
#include <CLI/Error.hpp>
#include <CLI/App.hpp>
#include <CLI/Formatter.hpp>
#include <CLI/Config.hpp>
#include <zmq.hpp>
#include <zmq_addon.hpp>
#include <spdlog/spdlog.h>
std::string address{"tcp://0.0.0.0:*"};
std::string filename{"test"};
std::ofstream output;
void SubscriberThread(zmq::context_t *ctx)
{
spdlog::info("GEOC Subscribe thread start");
if(!filename.empty())
{
spdlog::info("Opening file {}", filename);
output.open(filename);
}
// Prepare our context and subscriber
zmq::socket_t subscriber(*ctx, zmq::socket_type::sub);
spdlog::info("GEOC connecting to {}", address);
subscriber.connect(address);
spdlog::info("GEOD Client is {}", (subscriber.handle() != nullptr) ? "connected" : "disconnected");
subscriber.set(zmq::sockopt::subscribe, "");
spdlog::info("GEOC subscribe");
output.precision(std::numeric_limits< double >::digits10);
while (1)
{
zmq::message_t msg;
auto result = subscriber.recv(msg, zmq::recv_flags::none);
assert(result && "recv failed");
assert(*result == 2);
double *values = msg.data<double>();
output << std::fixed << values[0] << ","
<< std::fixed << values[1] << ","
<< std::fixed << values[2] << std::endl;
std::this_thread::sleep_for(std::chrono::microseconds(20));
}
}
int main(int argc, char **argv)
{
CLI::App app{"Geophone client"};
app.add_option("-a,--address", address, "Address to listen on");
app.add_option("-o,--output", filename, "Output filename");
spdlog::info("GEOD Client start");
CLI11_PARSE(app, argc, argv);
zmq::context_t ctx;
auto thread2 = std::async(std::launch::async, SubscriberThread, &ctx);
thread2.wait();
spdlog::info("GEOD Client finishing.");
return 0;
}
|
Students perceptions of educational climate in a new dental college using the DREEM tool Aim The purpose of the study was to evaluate students perceptions of conditions prevailing in Tagore Dental College. Methods Data were collected from all students enrolled in 2013, using the Dundee Ready Education Environment Measure (DREEM) forms filled in by them. For this exercise, prior approval from the Tagore Dental College Ethics Committee was obtained. Results The global score for EC was 124 (interpretation: predominantly positive). The scores obtained in the different domains were 31.03 in Learning (interpretation: a more positive perception); 26.69 in Teachers (interpretation: moving in the right direction); 21.48 in Academics (interpretation: feeling more in the positive side); 28.23 in Atmosphere (interpretation: a more positive atmosphere); and 16.52 in Social (interpretation: acceptable), all the points indicate that the institution is moving in the right direction. The DREEM score assigned by female students was significantly greater (P=0.048) than that assigned by male students. The second-year students were more positive in their perception of EC than students of the other classes. Conclusion Overall, Tagore Dental College students felt the EC to be acceptable. Admittedly, some areas need to be revisited to make improvements. Background A realistic assessment of an intangible factor such as the educational climate (EC) of an institution on a measurable scale is difficult. It is a summation of the perceptions of individual students of the different indicators factored in the study. Such perceptions also have a bearing on the background that the students come from. The environmentrelated features of the institution, such as being competitive or passive, peaceful or stressful, motivating or indifferent, have a major impact. The endeavor to create and maintain a helpful environment for study without compromising on quality of education is continuous. This can be achieved only through students' feedback and course corrections by the institution. The World Federation of Medical Education, in 1998, highlighted the learning environment as one of the targets for the evaluation of medical education programs. 1 The effects of educational environment, both academic and clinical, are important determinants of medical students' attitudes, knowledge, skills, progression, and behaviors. 2 Evaluation of the educational environment at both academic and clinical sites is important for the delivery of high-quality education and curriculum. It is necessary to identify the gap between student expectations and their actual experience. Furthermore, there are differences between students' experiences at different stages of their medical education. In 1997, Roff et al 3 published the Dundee Ready Education Environment Measure (DREEM scale), which is a generic, international instrument, and not specific to any culture, 4 for the assessment of EC for health science students in universities and health institutions, which helps in planning improvements to the particular course. This allows the medical or dental school to evaluate the education environment of their institution. DREEM has been widely used as a tool to gather information about the educational environment in many institutions. 3, It was originally developed by Dundee and has been validated as a universal diagnostic inventory for assessing the quality of educational environment of different institutions. 2,3,35,36 The DREEM has been reported 3,4, to have a high level of internal consistency and a reliable index for EC assessment. It was found to be valid, reliable, and sensitive by a study in Pakistan. 4 Some studies 36,38,40 have reported questionable validity for the five-factor structure. Tagore Dental College is a newly established dental college, offering Bachelor of Dental Surgery (BDS) program. This college was established as per the norms of the Dental Council of India (DCI) in 2007 in the suburbs of Chennai, in South India. Students are from different financial and religious backgrounds. Moreover, a sizable number of students are from minority communities. The constant effort of the institution is to maintain high standards through good teaching practices. The purpose of this study was to learn how this wide variety of students perceived the EC in the institution. This objective was further subdivided as follows: 1. To understand the students' perceptions of the teachers and their teaching, the learning atmosphere, and the academic and social environments in the institution; 2. To identify whether there were any sex difference in students' perceptions; and 3. To assess the strengths and weaknesses of the college, as perceived by the students. Materials and methods This was a cross-sectional questionnaire study that used the data collected in the year 2013. The college offers BDS program under the auspices of The Tamil Nadu Dr MGR Medical University within the guidelines of the Dental Council of India. The BDS comprises 4 years of study and 1 year of internship, with a yearly pattern of exams. Preclinical subjects are taught during the first 2 years and clinical subjects during the next 2 years. Previous studies 5,11,12,26,27 have shown a variable rate of response ranging from 36.0%-82.8%. Therefore, it was planned to recruit all the students, and the study was conducted at the end of the academic year. After obtaining the approval of the Tagore Dental College Ethics Committee, the DREEM forms were distributed to the students to be filled and returned within half an hour in order to avoid discussion among them. Before beginning the survey, the collaborator explained briefly the study's objectives and its data-processing characteristics, giving special emphasis to the importance of voluntary participation and the anonymity of the process. Information on age, gender, and academic year of study was collected from each participant. Because it was voluntary and anonymous, a separate consent form was not collected. In the event of the return of filled questionnaire, consent was implicit. The data were handled and stored in accordance with the tenets of the Declaration of Helsinki. DrEEM questionnaire The DREEM questionnaire consists of 50 statements that can be grouped under five domains or five subscales, namely, learning, teachers, academics, atmosphere, and social environment. Each of the statements is given a score based on a Likert scale of five options: 4= strongly agree, 3= agree, 2= uncertain,1= disagree, and 0= strongly disagree. In the case of nine negative statements, the scores are reversed. D1: Students' perception of learning, consisting of 12 items, with a maximum score of 48; D2: Students' perception of teachers, consisting of 11 items, with a maximum score of 44; D3: Students' academic self-perceptions, consisting of 8 items, with a maximum score of 32; D4: Students' perceptions of the atmosphere, consisting of 12 items, with a maximum score of 48; and D5: Students' social self-perception, consisting of 7 items, with a maximum score of 28. The DREEM scale provides results for each item, for each domain (by adding up the scores of the corresponding items), and the total score for EC (adding up all the scores of all the domains). The maximum score for EC is 200. The interpretation of the overall scores is as follows: 0-50: very poor; 51-100: plenty of problems; 101-150: more positive than negative; and 151-200: excellent. Taking into account these maximum scores, the data are converted into percentages of their respective subscales. 6,41 Advances in Medical Education and Practice 2015:6 85 DrEEM tool and students' perceptions of educational climate The mean scores for the different items, domains, and EC are grouped into four ordinal categories (0-50, 51-100, 101-150, and 151-200), associated with a specific interpretation. 42 Broadly, a higher score (percentage) signifies a perception that the institution is more positive than negative in relation to the aspect being examined. Description of the study group statistical analysis The data were entered into a Microsoft Excel spreadsheet, and the mean and SD were calculated for all the items. The data in the overall assessment of the EC, for each domain and each item of the questionnaire, were expressed as averages and comparison was done between the different years of study. The data for the overall assessment of the EC and each domain were also expressed as percentages in relation to the maximum score for comparison. 3,35 Because the maximum scores for each domain or subscale were different, they were compared according to their percentages. 23 The differences in EC, as perceived by 1) male and female students, and 2) firstand final-year students were evaluated, and the significance was calculated using SPSS version 20 (IBM Corporation). P-values were calculated using Student's t-test. A score of P,0.05 was considered statistically significant. Results The overall mean score was 2.48±1.02, which is interpreted as educational aspects that could be improved; and the score was 124 (62%) out of a total maximum score of 200, which is more positive than negative. Mean values (percentage) of the EC and the domains of the DREEM questionnaire, as well as the number of students (percentage) included in each category along with an interpretation, are presented in Table 2. When the practical guide of McAleer and Roff 2,42 was used to interpret the total mean scores (Table 2), all the students taken together viewed positively, in general, learning, teaching, academic self-perception, atmosphere, and social life. The general result was that the institution is moving in the right direction, and that there are many negative aspects that need changing in all the five domains. The comparative percentage scores of the five domains for the various years of study show that the students' perception of atmosphere (58.81%) was the lowest when compared to social self-perception (59%), students' perception of teachers (60.66%), perception of learning (64.65%), and their academic self-perception (67.13%) ( Table 2). The mean score for each year of students, along with SD, was calculated for all the five domains, as shown in Table 3. The total score was lowest for the final-year students, with114.48±0.44, when compared to the score assigned by the third-year (122.18±0.44), first-year (123.13±0.45), and second-year students (136.04±0.58) ( Table 3). The difference in perception among the two sexes is summarized in Table 4. Girls seem to have a better perception of EC in the overall assessment, as well as in all the five domains. On comparing the responses between male (118/200) and female students (127/200), the girls were more positive than boys in all domains, but there was a significant difference in EC (P=0.048) and all other domains. The boys felt that the atmosphere did not motivate them as a learner and that the stress outweighed the enjoyment. They found it difficult to concentrate, and the lectures and clinical teaching were not taking place in a relaxed environment. They also found the course not well scheduled and cheating to be rampant. They felt bored and lonely and felt the need for and expected a better support system. Table 5 shows individual items in the different domains with the mean scores and SDs. Comparing the individual scores of each of the questions, most of the questions scored between 2 and 3, and only nine questions scored,2 and none.3.5. There were eight items with scores.3. The most highly rated items were that the staff are knowledgeable (Q2), teaching time was put to good use (Q24), students were encouraged to participate in class (Q1), and they have good friends in their course (Q15). The items in which the students had the greatest problems and stressed the need to improve were that the lecturers were authoritarian (Q9), teaching was too teacher oriented (Q48), more emphasis on factual learning (Q25), cheating was rampant in this course (Q17), and students irritate their teachers (Q49). Scores of $3.5 are considered to represent a positive aspect of the curriculum. Six of the questions had scores $3, showing a positive trend, and very few (only four) scored,2, which was very heartening. The highest scores were reported from the learning domain, and items with scores,2 points pertained to factual and teacher-centered learning. When comparing the scores of individual questions, there were no significant differences between the first-and finalyear students except in terms of the questions mentioned in Table 6. Discussion Recently, Soemantri et al 29 stated that analysis of EC should form part of the appropriate educational practices developed by an institution. Being a new institution, it was essential to know about the EC of the college to bring in changes at the early stages of college development to set the principles of teaching and learning. The DREEM questionnaire 3 was used because it has been the most used tool globally, in health sciences, for EC analysis. The review of literature shows its wide usage among medical students 29,30 and also in some dental schools. Moreover, the questionnaire is culturally nonspecific and reliable for all health profession courses. According to the considerations pointed out by Miles and Leinster, 18 our results were expressed in terms of mean values of the global scale, subscale, or items and also as percentage of students in each category associated with a specific interpretation. Although the data were collected anonymously, only 83.7% of the students returned the questionnaire. The students who did not submit their responses before the deadline were not included. Previous studies 5,11,12,26,27 have shown a variable rate of response ranging from 36% to 82.8%. students' perception of learning The highest scores were reported from this domain, and items with scores,2 points pertained to factual and teachercentered learning. The problem of factual learning may be 87 DrEEM tool and students' perceptions of educational climate due to the pattern of formative and summative assessments encountered by the students. A problem-based evaluation may be the key to do away with the teacher-centered and factual learning. Reorientation and retraining of the staff members on appropriate teaching and assessment methods might stimulate active learning, thereby building confidence. The learning experience in the clinics could be improved by structured and systematic clinical teaching, based on a specific set of curriculum objectives. Students were encouraged to participate in class and the teaching time was used wisely, which are welcome positive points. students' perception of teachers Items in the teachers' domain that scored,2 points pertain to authoritarian teachers, factual learning, and ridicule of students. Of the students, the final-year students reported the greatest difficulty because they spend more time with teachers in close contact during the clinical hours; it also suggests that teachers in this institution are inclined toward the traditional style of teaching and factual learning. It is important that the teachers realize that respect to students is critical to the learning process. The first-year students felt that they were unable to ask questions. This may be because they are new to the system and have their own inhibitions. On the more positive side, the students felt that the teachers are knowledgeable, they come well prepared for class, and are able to communicate well with patients and students. students' academic self-perception The academic self-perception is related to the ability to cope with the academic overload, and low scores in this domain indicate clearly the need for curriculum revision in terms of methodology and course content. The students felt burdened by the academic workload and their main problem was that they were not able to memorize everything as they would have liked to do. students' perception of atmosphere In the domain of atmosphere, which is of a low score, the areas of concern were that students irritate the teachers and cheat them and their fellow students. This could be attributed again to the work overload and stress of performance. The atmosphere is not perceived to be relaxed during lectures and clinical teaching, and a critical review of the current practice of teaching in the institution is necessary to implement contemporary learning techniques in the clinic and during lectures. students' social self-perception The social section is the domain with a comparatively lower score, and the problems were that there is poor support system for the students who get bored, tired, or stressed during their academic life. There is a serious concern that they are too tired to enjoy their course. The students reported to have good friends and do not feel lonely but do not have a good social life. Again, the schedule leaves them no time to socialize. Curriculum planners could consider ways to reduce the bulky curriculum and make it more innovative, engaging, and meaningful so as to reduce student boredom and tiredness. comparison of Ec in the different schools of dentistry The majority of the studies on EC carried out in medical schools have reported a DREEM score between 101 and 140, 2,4,5,37,43 and only a few studies in British and Swedish medical schools have obtained scores between 141 and 150. 8,22 In the field of dentistry, studies conducted by Thomas et al in Indian students (score: 116), 17 Ali et al in Pakistani students 12 (score: 115; 57%) and by Kissioni et al 15 among Greek students (score: 112; 56%) reported EC to be more positive than negative. A positive EC with a higher score has been reported from studies conducted in New Zealand, Germany, UK, and Spain, 14,16,20,26 with scores ranging from 123 to 144 (61%-72%). In accordance with the majority of these studies, the present study revealed a positive climate with a score of 124 (62%), with 92.6% of the students assigning a score of $101. Many other institutions that follow the traditional teacher-centered, discipline-based curriculum have reported similar global scores. 2,5,13,15,17,19,21 However, scores obtained from students from student-centered, integrated, problem-based curricula 10,13,14,16,22,26,39 are rated higher by the students. On comparing the responses between male (118/200) and female students (127/200), female students scored better than male students in all domains; there was a significant difference in all the domains and in EC (P=0.048). These results were similar to the findings in many other studies. 11,15,20,37,43 A few studies 5,11,13,18,26,27,32,33 have shown no difference in perception between males and females. Only in a few studies 5,28 have females reported poor EC. The present study showed significant differences in some questions between first-and final-year students, and similar results have been reported in other studies. 11,12,15,27,32,34 This could be attributed again to the work overload and stress of performance. In the individual domains, more than half of the studies on EC in medical schools 6,9,10,18,19,26,35,41 yielded results of.52% in all domains, which is interpreted as positive and acceptable. In a few studies, 8,10 some domains (Learning, Teachers, and Atmosphere) achieved scores of 77%-78%, indicating educational excellence. Thomas et al,11 in their study on Indian dental students, reported a percentage of $52% in all domains, except in the social domain. 11 In other studies among Greek, German, and Spanish dental students, 15,16,26 a percentage of $52% was detected in all domains. In agreement with these studies, the present study also reached a score of $52% in all domains, with a positive interpretation, given by 81.7% of the respondents. Among the various domains in medical schools, 6,9,10,18,35,41 the teachers domain is generally the highest rated, while the academic domain is generally the lowest. A similar pattern is noticed in dental schools in New Zealand, 14 with teachers and academic domains showing scores of 73% and 66%, respectively. In the study by Ostapczuk, 16 the best and the worst domains cataloged were social life and learning (64% and 58%, respectively). In contrast, in the study by Foster Page et al, 14 the best domains cataloged were teachers (73%) and atmosphere (73%), whereas academics was the worst (66%). As reported by Kossioni et al and Tomas et al,15,26 in this study also, the domain that showed the highest percentage value was academics (67%); however, Tomas et al reported the lowest percentage in the learning domain, with a score of 58.3%. But in our study, our lowest scoring domains were atmosphere and social life, with 58.8% and 59%, respectively. An Indian study 34 that reports a high score in academics, relative to learning and teaching, is similar to the present study. In a study in Pakistan, 37 the highest-scoring domain was academic self-perception, similar to this study, but the former reported the lowest score in learning; an Indian study 34 too reported the lowest score in learning, next only to the social life domain. Montazeri et al 33 reported highest scores in atmosphere, while our study has revealed the atmosphere to possess the lowest score next only to social life, which is a worrying factor. Some studies 11,34,37,39 also have reported social life as a problematic area. In several studies 5,9,14,16,17,23,25,26,35 on EC using the DREEM scale, the items most often considered problematic are Q3 (There is good support system for the students who get stressed), followed by Q27 (I am able to memorize all I need), Q4 (I am too tired to enjoy the course), Q9 (Teachers are authoritarian), Q25 (The teaching overemphasizes factual learning), Q42 (The enjoyment outweighs the stress of the course), and Q48 (The teaching is too teacher oriented). As in previous studies, 13 in our study also, the areas of concern are items 3, 4, 9, 25, 42, and 48. Question 17 (Cheating is a problem in the school) and Q39 (The teachers get angry in the class) are serious concerns that need to be dealt with immediately. In most studies 8,18,23,25 on EC, using the DREEM scale, the most positive points were Q2 (The teachers are knowledgeable), Q15 (I have good friends in this school), and Q46 (My accommodation is pleasant). In other studies, 15,16,26 Q19 (My social life is good) and Q33 (I feel comfortable in class socially) also have reported good scores. In this study, Q1 (I am encouraged to participate in class), Q2 (Teachers are knowledgeable), Q15 (I have good friends in the school), Q19 (My social life is good), and Q24 (The teaching time is put to good use) scored.3 and were hence very positive. Many studies 13,15,34,37,39 have reported stress, boredom, too tired to enjoy course, and dissatisfaction in social life among students. This study also reveals a similar feature. Good scores in Q2 and Q24 indicate the quality of teaching in the institution, and this institution has good dedicated teachers. Positive scores in Q15 and Q19 indicate a healthy social life, which is very important to counteract stress associated with training in health sciences. The teachers in our institution, as elsewhere, are authoritarian 11,26,34,37,39 and are inclined toward a traditional style of teaching and factual learning. 5,9,15,23,25,28,34,35 Low scores in the academic domain, which is found to be the case in most studies, 6,8,10,15,26,28 suggest that this is a universal problem, regardless of whether the curriculum is traditional or innovative. Regarding the question of good support system and the measures to counteract learning, academics, and stress, some authors 24,30 have suggested improving the educational aspect by including structured and available personal tutoring system, peer tutoring, an approachable chaplaincy service, better accessibility to school office staff, and senior-to-junior student mentoring. Regarding Q4 and Q42, Till 28,31 stated that the frequent complaints of students regarding curriculum is due principally to overload. Tomas et al 26 have suggested outcome-based curricula that lay emphasis on outcome and application of knowledge and that are student centered. Overall, the students are stressed and do not enjoy the course, and the teachers' following of the traditional pattern of teaching and behavior is disturbing; measures have to be taken to target these specific issues in an attempt to improve the education environment of this institution. Factual learning may be due to the pattern of formative and summative assessments encountered by the students. A problem-based learning and evaluation may be the key to do away with this difficulty. Reorientation and retraining of the staff members on appropriate teaching and assessment methods might stimulate active learning and may thereby build confidence. Introduction of inquiry-based pedagogy, special study units, small-group teaching, improved formative feedback, structured and available personal tutoring system, accessibility to school office staff, and peer mentoring have been suggested by previous studies 13,24,30,43 for the improvement in EC. A limitation of the study is that a standard questionnaire with predetermined choices was used, and some of the factors affecting this institution may have been left out. Informal feedback from the students indicates that the questionnaire was lengthy and that some of the questions could not be understood properly and some were overlapping. The EC is complex, a mix of various factors specific to every institution, and the results of the study in this institution may not be applicable to other institutions in India or worldwide. This is the first assessment of this institution, and this may serve as a baseline to monitor changes in the pattern of teaching and attitude of teachers, in addition to the atmospheric changes over a period of time. Conclusion In conclusion, all the students perceived the EC to be positive. There are negative aspects revealed, such as the fact of students being stressed and being too tired to enjoy the course, teachers being authoritarian, and emphasis on factual and teacher-centered learning. These need looking into. A curriculum that includes elements of problem-based learning and assessment might provide students with stimulating opportunities for learning. Furthermore, systematic clinical teaching might improve the learning environment for the students. A better support system from the staff and senior students would help to mitigate most of the deficiencies in the institution. A change in the attitudes and approach is understood to be necessary for making the learning atmosphere congenial for the students and for molding them into competent professionals. |
<filename>SYR2/Projet/Partie 3 - Filtres Audio/includes/packethelper.h
/*
SYR2 - Projet - Partie 2
<NAME>
<NAME>
*/
/* Only if not defined */
#ifndef PACKETHELPER_H_
#define PACKETHELPER_H_
// Include librairies
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <clientserver.h>
/* End of if */
#endif /*PACKETHELPER_H_*/
|
<reponame>forkkit/aresdb<filename>controller/mutators/mocks/NamespaceMutator.go
// Copyright (c) 2017-2018 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by mockery v1.0.0
package mocks
import "github.com/stretchr/testify/mock"
// NamespaceMutator is an autogenerated mock type for the NamespaceMutator type
type NamespaceMutator struct {
mock.Mock
}
// CreateNamespace provides a mock function with given fields: namespace
func (_m *NamespaceMutator) CreateNamespace(namespace string) error {
ret := _m.Called(namespace)
var r0 error
if rf, ok := ret.Get(0).(func(string) error); ok {
r0 = rf(namespace)
} else {
r0 = ret.Error(0)
}
return r0
}
// ListNamespaces provides a mock function with given fields:
func (_m *NamespaceMutator) ListNamespaces() ([]string, error) {
ret := _m.Called()
var r0 []string
if rf, ok := ret.Get(0).(func() []string); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
|
<gh_stars>0
package net.minecraft.network.protocol.game;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.Packet;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
public class ClientboundRotateHeadPacket implements Packet<ClientGamePacketListener> {
private final int entityId;
private final byte yHeadRot;
public ClientboundRotateHeadPacket(Entity pEntity, byte pYHeadRot) {
this.entityId = pEntity.getId();
this.yHeadRot = pYHeadRot;
}
public ClientboundRotateHeadPacket(FriendlyByteBuf pBuffer) {
this.entityId = pBuffer.readVarInt();
this.yHeadRot = pBuffer.readByte();
}
/**
* Writes the raw packet data to the data stream.
*/
public void write(FriendlyByteBuf pBuffer) {
pBuffer.writeVarInt(this.entityId);
pBuffer.writeByte(this.yHeadRot);
}
/**
* Passes this Packet on to the NetHandler for processing.
*/
public void handle(ClientGamePacketListener pHandler) {
pHandler.handleRotateMob(this);
}
public Entity getEntity(Level pLevel) {
return pLevel.getEntity(this.entityId);
}
public byte getYHeadRot() {
return this.yHeadRot;
}
} |
AUG 6 2017 BY MARK KANE
The U.S. automotive market of late has entered the dangerous area of decreasing sales, notching a large 7% drop year-over-year in July. In such a circumstance, any growth of plug-in vehicle sales will show an improved market share, even more so with gains.
And sure enough, in July some 15,607 plug-ins were delivered, good for a sturdy 19.4% increase in the sector – the 22nd consecutive month of gains.
Through 7 months, the full year counter for electric vehicles has moved into 6 digits, with ~104,863 sold thus far – up 35% year-over-year. See the full July sales report here.
The gains for plug-ins, and the worsening overall automotive segment in the US, meant the electric market share rose to roughly 1.1%.
We should also note this is the first time in US history that plug-in sales have exceeded 1% market share for three consecutive months (see chart below).
For the month, the best selling EV, for the very first time, was the Chevrolet Bolt EV with 1,971 units moved, about 300 units ahead of the Tesla Model X, estimated at 1,650 deliveries.
Of course in the “newcomer category”, all eyes were on the Tesla Model 3 (view launch party/full specs here), although surprisingly, the Honda Clarity Electric also went on sale and bested the Tesla in deliveries 34 to 30 … but, we suspect it won’t stay ahead in that sales race for very long.
Given the second half of the year sales gains normally seen with plug-in vehicles, the addition of the Model 3 in volume, increased Toyota Prius Prime inventory, the Chevy Bolt EV being made available nationwide this month, and the new LEAF’s introduction in December, we suspect the US market will easily be crossing the 2% mark by year’s end.
Check out all the individual sales for every plug-in model sold in July (and all-time) on our Monthly Plug-In Sales Scorecard. |
<reponame>megbedell/plot_tools
from .error_ellipse import error_ellipse |
Gas Monetization in Bolivia Bolivia is on its way to be the first natural gas hub in Southern Cone, with probable reserves of 47 tcf and exports to Brazil, Argentina, and Paraguay. Recent aggressive exploration efforts in the southern and eastern parts of the country have been so successful that Bolivia's gas reserves are now second only to those of Venezuela in South America. Discoveries have outpaced low domestic demand. Gas-fired power generation capacity is 489 MWs (55% of total). Only 55% of the population has access to electricity with 80% of the rural population without electricity, but the demand is increasing at 10% a year. Currently, about half of Bolivia's gas production is re-injected, flared, or vented rather than marketed. Most of the gas produced is exported to Brazil via the 1,432mile Bolivia-to-Brazil pipeline. Exports to Argentina have been suspended due to Argentinas increased production. During 1998, 85% of gas was consumed by the industrial sector, and plans to increase household consumption were initiated. |
The Supreme Court on Wednesday agreed to hear a plea seeking to restrain government authorities from taking any coercive action against anyone for posting alleged objectionable comments on social networking sites.
An application was filed before the apex court seeking its direction to the authorities not to take action for posting such comments during the pendency of a case before it pertaining to constitutional validity of section 66A of the Information Technology (IT) Act.
The section states that any person who sends, by means of a computer resource or communication device, any information that was grossly offensive or has a menacing character could be punished with imprisonment for a maximum term of three years, besides imposition of appropriate fine.
A bench of justices B S Chauhan and Dipak Misra will also hear the plea for release of Hyderabad-based woman activist who was arrested and sent to jail over her Facebook post in which certain "objectionable" comments were made against Tamil Nadu Governor K Rosaiah and Congress MLA Amanchi Krishna Mohan.
Jaya Vindhayal, the state general secretary of People's Union for Civil Liberties (PUCL), was remanded on May 13 in judicial custody for 12 days following her arrest the previous day under section 66A of the IT Act for the "objectionable" post.
According to the police, she had also allegedly distributed pamphlets making objectionable allegations against Rosaiah and Mohan before posting the comments online.
The matter was mentioned before the bench by law student Shreya Singhal, seeking an urgent hearing in the case, saying the police is taking action in such matters even though a PIL challenging validity of section 66A is pending before the apex court.
She had filed the PIL after two girls--Shaheen Dhada and Rinu Shrinivasan--were arrested in Palghar in Thane district under section 66A of IT Act after one of them posted a comment against the shut down in Mumbai following Shiv Sena leader Bal Thackeray's death and the other 'liked' it. |
Good news for romantic comedy heroines with a clumsy streak (i.e. all of them): scientists have found the type of coffee least likely to spill. Lattes are apparently much easier to carry incident-free than your standard drip coffee – which turns out to be aptly named.
Researchers Emilie Dressaire, from the New York University Polytechnic School of Engineering, and Alban Sauret, from the French National Centre for Scientific Research, had both noticed that foam seems to make some drinks less prone to spillage.
So they decided to test to see if they could find a scientific formula to explain this effect. They and their colleagues built a device that was made up of a narrow glass container that could be rocked back and forth or side to side. They filled this with a mix of water, dishwashing liquid, and glycerol (to make it more viscous than mere water). They also injected air at a constant flow into a small opening at the bottom of the glass, in order to create uniform layers of three millimetre bubbles.
But their experiment isn’t only a ‘huh, weird’ for the clumsy and thirsty. It has potential applications for the transport of hazardous liquids like oil and liquefied gas, and the researchers hope it will lead to finding safer ways to transport those fluids in future. |
/*!
* \brief Set this display as a clone of another display
*
* \param[in] _disp The display to set clone off
*/
void iDisplayRandR::setCloneOf(const iDisplayRandR &_disp) {
for (auto &elem : vClones_V_XRR) {
if (elem == _disp.vID_XRR) {
return;
}
}
vClones_V_XRR.push_back(_disp.vID_XRR);
} |
<gh_stars>10-100
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>.
//
#import "NSObject.h"
#import "MPAVRoutingControllerDelegate.h"
@class MPAVRoutingController, NSArray, NSMutableArray, NSObject<OS_dispatch_queue>, NSString;
@interface WFMediaRoutePicker : NSObject <MPAVRoutingControllerDelegate>
{
long long _routeType;
MPAVRoutingController *_routingController;
NSMutableArray *_observers;
NSObject<OS_dispatch_queue> *_queue;
}
@property(readonly, nonatomic) NSObject<OS_dispatch_queue> *queue; // @synthesize queue=_queue;
@property(readonly, nonatomic) NSMutableArray *observers; // @synthesize observers=_observers;
@property(retain, nonatomic) MPAVRoutingController *routingController; // @synthesize routingController=_routingController;
@property(readonly, nonatomic) long long routeType; // @synthesize routeType=_routeType;
- (void).cxx_destruct;
- (void)routingControllerAvailableRoutesDidChange:(id)arg1;
- (void)findHandoffRoutesMatchingDescriptors:(id)arg1 timeout:(double)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (void)findHandoffRouteMatchingDescriptor:(id)arg1 timeout:(double)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (void)handOffFromSourceUID:(id)arg1 toDestinationUID:(id)arg2 timeout:(double)arg3 completionHandler:(CDUnknownBlockType)arg4;
- (void)selectRoute:(id)arg1 timeout:(double)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (void)findRoutesMatchingDescriptors:(id)arg1 timeout:(double)arg2 completionHandler:(CDUnknownBlockType)arg3;
- (void)findRouteMatchingDescriptor:(id)arg1 timeout:(double)arg2 completionHandler:(CDUnknownBlockType)arg3;
@property(readonly, nonatomic) NSArray *availableRoutes;
- (void)removeAvailableRoutesObserver:(id)arg1;
- (void)addAvailableRoutesObserver:(id)arg1;
- (void)stopDiscoveringRoutes;
- (void)startDiscoveringRoutes;
- (id)initWithRouteType:(long long)arg1;
- (id)init;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
|
The invention describes a method and apparatus for improving interfacial chemical reactions in electroless depositions of metals, and more particularly for producing a through-hole-plated Printed Circuit Board (PCB).
U.S. Pat. Nos. 4,279,948, 4,265,943, and 4,209,331, which are hereby referenced in their entirety, summarize the prior art of using electroless copper to prepare non-conductive through-hole walls for electrolytic copper plating, said through-hole walls predominantly consisting of electrically insulating glass-epoxy composites.
In this application the terms process tanks, process solutions, process steps and process stations are interchangeable. The term xe2x80x9csubstratexe2x80x9d is meant to denote workpiece, panel, board, PCB, with or without through-holes, these terms being interchangeable.
Indeed, the substrate, with its through holes, has to undergo a long, intricate sequence of process steps before the hole walls are electrically conductive and electroplatable. Many of these process steps require bath temperatures weal above ambient for the desired chemical reactions to take place. In current practice, the through-hole panels enter the process solutions mostly following cold water rinses, resulting in significant heat transfer time delays before the panel/solution interface reaches the xe2x80x9cthresholdxe2x80x9d temperature, below which, the desired reaction will not take place satisfactorily.
U.S. Pat. Nos. 3,532,518 and 3,011,920 are referenced herewith to show the crucial importance of adequate catalytic preparation of the polymer hole walls for electroless copper to take place on non-conductive substrates.
Perhaps the most critical step in the PCB production process, is the electroless copper bath, known also as chemical copper. In order to achieve complete, void-free coverage of the through-hole walls, the electroless copper bath must operate at a sufficiently elevated temperature to provide the necessary xe2x80x9cactivation energyxe2x80x9d for the reduction of cupric and/or cuprous ions in solution to metallic copper. Indeed, electroless copper deposition, whether obtained via formaldehyde, or via the environmentally friendlier hypophosphite as the main reducer, is understood to be the result of a complex sequence of intermediate reactions that take place at the interface of the Pd-catalyzed non-conducting polymer hole walls and the electroless Cu solution. Excessively low interfacial temperatures will retard copper initiation to a point where coverage will be incomplete, resulting in rejects.
More importantly, significant delays in chemical copper initiation are especially harmful in hypophosphite-reduced baths, because unlike formaldehyde baths, they are not autocatalytic, and Cu deposition is understood to essentially cease after the Pc layer over the hole wall surface is coated with a continuous coating of Cu. Contamination, or poisoning, of the Pd catalytic layer on the hole wall occasioned by slow initiation of copper deposition due to low interfacial temperature in the electroless copper bath may cause deposition of poorly conductive copper oxides, areas with no deposit at all, or a combination of both. Also, while formaldehyde type electroless copper baths operate at temperatures in the range of 25xc2x0 C., the recommended operating temperature of hypophosphite-based electroless copper systems is 70xc2x0 C., perceived by both equipment manufacturers and PCB producers as restrictive and not user-friendly.
A technical document entitled xe2x80x9cProcess Operating Guide, M systemxe2x80x9d by MacDermid Inc., is referenced herewith, as indicative of the elaborate process steps required for satisfactory PCB production, with some process steps using solutions that require elevated temperatures. With some few exceptions, PCB production facilities currently use automatic plating machines, wherein a computer-programmed hoist carries panels to be plated through the various process steps, with the panels mounted on vertical jigs, also called racks. The software that directs the movement of the hoist is called timeway. The jigs, with the mounted panels, enter and exit the process solutions in a vertical position.
Relatively recently, some PCB producers have changed to horizontal, conveyorized equipment, wherein PCB panels move through the process solutions in a horizontal, as opposed to vertical mode. Horizontal machines are gaining attention, principally because of reduction in labor expenses one such horizontal PCB machine is called Uniplate LB and can be obtained from Atotech.
A central consideration behind the present invention hinges on the fact that one deals mainly with interfacial chemical reactions, as opposed to predominantly bulk reactions, when practicing Pd activation and electroless depositions on a substrate. The prior art use of large bath volumes is in most cases superfluous, such that the reduction in bath volume in the present invention results in considerable savings due to reduction in waste disposal volumes and inherent environmental problems.
Thus, the present invention provides according to a first of its aspects, an improved method for manufacturing a PCB, wherein the board to be plated is pre-heated prior to its immersion in an electroless plating solution. The pre-heating is carried out at a temperature that is needed to bring about the desired chemical reaction at the panel-solution interface, allowing the bath of that process step to operate significantly below the temperature that would have been needed if the panel had not been pre-heated, and below the solution temperature of current practice.
According to another aspect of the present invention, the electroless plating apparatus for plating a workpiece, operates in a vertical mode and it comprises a heating station, with the panel to be plated returning to the heating station as dictated by the temperature required for a given process step. Alternatively, the heating station is incorporated into the hoist system of such apparatus.
In still another aspect of the present invention, the electroless plating apparatus operates in a horizontal mode and comprises at least one heating station. The station element where the preheating is to take place is stationary and the panel to be plated can only move in a forward direction, as dictated by conveyorized, moving belt type equipment. Preheating therefore needs to be limited to the most critical process steps such as for example activation or electroless plating.
In a preferred embodiment, a workpiece to be plated is preheated in an appropriate hot chemical solution, thus entering the subsequent process tank without the usual water rinses, as accepted in the industry. By enveloping the workpiece in a desirable, compatible hot liquid layer that will preferably participate in the reaction, one can greatly enhance the desired effect of a given process. This embodiment is referred to hereinbelow as Participant Liquid Layer (PLL) technology.
Thus, the method of the present invention provides an economical approach for interfacial chemical reactions, enabling a reduction in bath volume, and therefore a reduction in waste disposal volumes, which is environmentally desirable. The method can be used with both horizontal and vertical type plating apparatuses, so that it is easily and conveniently adaptable to current manufacturing practices. Use of the PLL technology, as stated, enhances the results of the process.
Additional features and advantages of the present invention will become apparent from the following description.
The preheating of the through-hole panel to be plated can be accomplished by numerous techniques, such as for example IR, thermal laser, hot air, high pressure steam, pressurized hot water spray, microwave, etc. With tine, new technologies will be available to impart the desired temperature to the copper-clad panel with the through-holes in it. Desirably, the heating should be focused or directed into the holes, in relation to the method chosen, reducing the heat sink effect of the copper cladding. Indeed, the elevated temperature is most needed at the hole-wall/solution interface, and not at the interface of the copper cladding/solution. A recently developed new technology by IBM, known as FLUID HEAD DRYER MANIFOLD, is a potential preferred heating mode of the through-holes in the laminate. The technique is described in U.S. Pat. No. 5,289,639, referenced herewith.
The optimal surface temperature of the panel can be varied, and computer-controlled to suit the bath in a given process step. It should take into consideration the fact that the heated panel will undergo some cooling before and during its immersion in a given process bath, and therefore the surface temperature of the panel is likely to be raised considerably above the recommended bath temperature of a given process step. The upper limit of the surface temperature will be dependent on the dielectric material, to avoid degradation.
When the invention is practiced in a vertical, automatic hoist apparatus, one can envision a single heating station, with the panel to be plated returning to the heating station as dictated by the temperature required for a given process step. The circuit board to be plated will preferably be sandwiched between two rigid sliding/movable insulating polymer sheets mounted on the jig, that will minimize cooling of the heated surface to be plated, as it travels to the designated process station. As the panel to be plated enters the solution, the two insulating polymer sheets either slide/retract upwards, or they can be immersed together with the panel to be plated.
Another possibility to practice the invention involves incorporation of the heating mechanism into the hoist with the heating being done while the hoist travels between process tanks and additionally, while the racks are moving upwards vertically when exiting a given process tank, and also while moving vertically downwards to enter the next process tank, as dictated by design. Such arrangement results in greater through-put, thanks to optimal use of hoist time.
When the invention is practiced in a horizontal mode, the station/heating element where the preheating is to take place is stationary and the panel to be plated can only move in a forward direction, as dictated by conveyorized, moving belt type equipment. Preheating therefore needs to be limited to the most critical process steps, i.e. prior to electroless plating, and perhaps activation.
A further embodiment of the invention contemplates pre-heating of the workpiece to be plated in an appropriate hot chemical solution, and entering the subsequent process tank without the usual water rinses, as accepted in the prior art. By enveloping the workpiece in a desirable, compatible hot liquid layer that will preferably participate in the interfacial chemical reaction, one can greatly enhance the desired effect of a given process. Electroless deposition, whether copper or nickel, is illustrative of one such potential advantage of this invention. While the mechanism of electroless deposition is still not properly understood, its initial stages are known to be critical and will essentially determine the success or failure of the desired electroless coating. Hence, entering, by way of example, the electroless tank directly following immersion in a hot alkaline aqueous accelerator, and without the recommended water rinse, can often be beneficially practiced. Alkaline accelerators are taught by patents referenced in the background section of the application and are standard practice with hypophosphite-reduced electroless coppers. Indeed, electroless deposition reaction consumes hydroxyl ions, and supplying them in the form of a heated layer at the workpiece/electroless bath interface, will greatly increase the flexibility and parameters of the initial deposition process, also known as xe2x80x9cinitiationxe2x80x9d.
There are numerous other industrial applications where the method of the present invention will be beneficial. Specifically, the method of introducing a substrate into a process tank with a chemical layer of a solution at the appropriate temperature, thereby promoting its participation in the desired reaction, enhances the final, desired reaction result. Thus, a preferred embodiment of this invention envisions applying to a workpiece a Participant Liquid Layer (PLL). PLL is defined in this invention as a heated liquid layer that coats the workpiece as it enters a given process tank such as electroless copper, nickel and enhances the desired reaction. The temperature of that liquid layer should be at least 5xc2x0 C. above ambient, but in most cases will be significantly higher.
The practice of entering into a process tank with a preheated panel, with or without a heated PLL on the surface of said workpiece, offers many benefits, inter alia the following:
1. Maximization of initiation speed of chemical reactions at the PCB/solution interface, by eliminating or at least greatly reducing time delays due to heat transfer from the hot solution to the panel to be plated. Indeed, the invention allows the panel to enter the solution at the required temperature, which is especially beneficial for electroless deposition and also, though perhaps to a lesser degree, for adequate and speedy activation of the hole walls in the colloidal tin/palladium suspension.
2. Minimization of energy consumption, by affording solution operation at lower temperatures and making it unnecessary to keep the baths hot during idle machine time.
3. Improvement of bath stability, due to lower temperature of operation. This is especially true for formaldehyde-type electroless coppers. Indeed, because the solution can now be operated at temperatures of about 20xc2x0 C., bath decomposition and consumption due to the well-known Canizzaro reaction can be significantly lower. This is of special importance in horizontal equipment where even moderate bath decomposition requires periodic stripping of copper metal deposited on the walls and bottom of the copper tank, necessitating a complete shutdown of the line.
4. Minimization of cycle time, resulting in improved through-put.
5. Lower concentrations and reduced operating temperature of Pd-based activators are possible, because of the higher temperature at the panel/solution interface. Indeed, the tin/Pd catalyst suspensions disclosed in U.S. Pat. Nos. 3,532,518 and 3,011,920 cannot sustain prolonged heating beyond 30-35xc2x0 C., or else they will decompose. Also, it is known tat Pd prices are, as of late, cost-prohibitive. Lower Pd concentrations in working bath are contemplated by this invention, with considerable cost savings.
In addition to above improvements, additional benefits and possibilities will evolve with time, as this invention becomes available to equipment designers, PCB manufacturers, electroless platers in general, and others. |
SINGAPORE - The Singapore International Arbitration Centre (SIAC) has appointed Senior Counsel Davinder Singh as the new chairman of its board of directors, with effect from Friday (Dec 16).
Mr Singh, the chief executive of Drew & Napier LLC, takes over from Mr Lucien Wong, who was recently appointed the next Attorney-General of Singapore, SIAC said on Thursday in a statement.
During Mr Wong's term as SIAC chairman, the centre had a number of milestone achievements, including receiving a record number of cases and registering a record total sum in dispute in 2013 and again in 2015.
In its 2015 annual report released in February, SIAC said 271 new cases were filed by parties in 55 jurisdictions, a 22 per cent rise from 2014 and an increase of almost 5 per cent from the previous record of 259 new cases filed in 2013.
The centre also set a new record in terms of the total sum in dispute, which grew 24 per cent year on year to $6.23 billion from a year ago.
Mr Wong also oversaw the expansion of SIAC's operations internationally, with the establishment of overseas representative offices in Mumbai, Seoul and Shanghai.
Mr Singh, widely recognised as a leading disputes practitioner, was in the first batch of Senior Counsel appointed in Singapore. In addition to being a top litigator, he has an active international arbitration practice involving complex commercial disputes and multiple jurisdictions.
In a statement on Thursday, Mr Wong said he has "every confidence that he (Mr Singh) will steer SIAC to even greater heights".
Mr Singh said of his appointment: "It is an honour and privilege to be succeeding Lucien as chairman of SIAC. Lucien leaves a hugely impressive legacy, having achieved so much for SIAC." |
import {
ComponentOptions,
DefaultMethods,
DefaultComputed,
PropsDefinition
} from "vue/types/options"
import { Vue } from 'vue/types/vue'
interface Props {
textList: string[],
}
interface Data {
(): {
currentText: String,
}
}
declare const AutoTyping: ComponentOptions<
Vue,
Data,
DefaultMethods<Vue>,
DefaultComputed,
PropsDefinition<Props>
>
export default AutoTyping
|
MANILA, AUGUST 20, 2008 (STAR) WRY BREAD By Philip Cu-Unjieng - For those seeking ultimate Tekkie satisfaction, it may be tucked away along Building 3 of Fort Boni’s High Street, but iStudio’s newest branch has become a mecca, a beacon, a virtual paradise, for all those enamoured with the products and gizmos branded Apple and Macintosh. A store that encourages and guarantees the most interactive of introductions to their products is a godsend for most customers — and this, iStudio delivers with extreme gusto. Along with the other iStudio branches at the Gateway Mall, Shangri-La Plaza Mall and V-Mall (Yes readers, in another time and place, we knew this as Virra Mall), the Fort Boni store carries the distinction of being an Apple Premium Reseller and an Apple Authorized Service Provider.
On the day of the store’s formal opening, Patrick and Larry went all out for the assembled guests. Like manna from Heaven, a bevy of products and accessories were raffled off, with the grand raffle prizes being an iPod Touch and a MacBook Pro. Celebrities like Diether Ocampo, Zanjoe Marudo and photographer Patrick Uy could be seen eagerly trying out the displays, and I noted the avid interest a number of customers had with the Air laptop model. With the constant R&D that goes into new and improved Apple and Macintosh products, it’ll always be a treat to drop by this store. More power to Patrick and Larry.
Tales of the bizarre and extraordinary take center stage this week. Two of the novels can summarily be categorized as historical fiction with a twist; while the third, is science fiction/horror coming to us from the PC of one of the premier podcast authors, now in mainstream print for the very first time.
The Somnambulist by Jonathan Barnes (available at National Bookstore): Set in Victorian England, Jonathan Barnes gives us a very assured first novel, one that had me thinking Christopher Priest’s The Prestige, by way of Neil Gaiman and Carl Hiassen; i.e. there are elements of fantasy and black comedy thrown in for good measure. Edward Moon is a magician/conjuror who has helped solve crimes, with the help of his accomplice, a hulking mute of a brute, known as the Somnambulist. A shadowy organization known as the Directorate seems to be in control of the political, social and cultural destinies of merry old England, and it’s here that fantastical elements and characters spring to life within the pages of this wonderfully rendered story. Like a master conjuror, Barnes ups the ante with each chapter, giving us superb fantasy entertainment — do I see a film option in the works?
The Hartlepool Monkey by Sean Longley (available at Fully Booked): Longley takes a marginal historical fact, that a monkey was tried and convicted in England as a French spy in the late 18th century, and builds a wonderful story that ponders philosophical questions touching on humanity, and whether it is behavior and deportment that make the man. Three narrators, all of whom make contact with Jacques — an ape, at different stages in his life, make up this novel. First, there’s Dr. Simon Legris; not much of a medical success, he searches and finds his “golden patient,” a Duke from Breton who happens to be fascinated in the natural sciences. This leads Simon to Africa and a disastrous safari, where he finds Jacques and brings him back to France. Then there’s Claudette, a courtesan; and lastly, Warren, a bottom feeder counsel, who defends Jacques when charged with espionage. Fascinating stuff.
Infected by Scott Sigler (available at National Bookstore): This is one creepy book. Sigler is better known as the best selling author of “podcast only audiobooks” and this is his first foray into commercial print. While ostensibly your run-of-the-mill Body Snatchers story, it’s the visceral style of writing and the plot development that makes this novel work. As one reads, one can easily imagine what the character is undergoing as Sigler takes something as ordinary as an itch or rash, and turns it into something malevolent and sinister. It’s a parasite type infection that leads to extremely violent behavior; and we’re with Drew, a CIA agent, as he works with Margaret Montoya of Disease Control. On the flip side of the coin, there’s Perry, an ex-college football player, who has been infected, and we follow his descent into madness and mayhem. This should come with a Warning label: Not for reading late at night! |
An Update on the Controversies in Anemia Management in Chronic Kidney Disease: Lessons Learned and Lost Background. Erythropoietin deficiency and anemia occur in Chronic Kidney Disease (CKD) and may be treated with Erythropoietin Stimulating Agents (ESAs). The optimal hemoglobin, in non-End Stage Renal Disease CKD, is controversial. Methods. We review three recent randomized trials in anemia in CKD: CHOIR, CREATE, and TREAT. Results. CHOIR (N = 1432) was terminated early with more frequent death and cardiovascular outcomes in the higher Hb group (HR 1.34: 95% C.I. 1.031.74, P =.03). CREATE (N = 603) showed no difference in primary cardiovascular endpoints. Stroke was more common in the higher Hb group (HR 1.92; 95% C.I. 1.382.68; P <.001) in TREAT (N = 4038). Conclusions. There is no benefit to an Hb outside the 1012g/dL range in this population. To avoid transfusions and improve Quality of Life, ESAs should be used cautiously, especially in patients with Diabetes, CKD, risk factors for stroke, and ESA resistance. Introduction Anemia is an expected feature of chronic kidney disease (CKD) once the glomerular filtration rate (GFR) drops below 60 mL/minute. The World Health Organization (WHO) defines anemia as a hemoglobin (Hb) below 13 g/dL for adult males and postmenopausal women, and below 12 g/dL for premenopausal women. The anemia of CKD, due primarily to erythropoietin deficiency, is usually normochromic, normocytic, associated with shortened red blood cell survival, and some degree of iron deficiency. Prospective cohort studies suggest a 1% prevalence of anemia for a GFR of 60 mL/minute, rising to 9% below 30 mL/minute, and 33-67% for those with a GFR below 15 mL/minute. Recombinant human erythropoietin (rHU EPO) has been available for the treatment of anemia of CKD since the 1980s and supplanted the use of blood transfusions and adrogenic steroids. Improved quality of life scores was a consistent finding in early studies involving rHU EPO and CKD. Nevertheless, even early literature revealed accelerated hypertension, failure of vascular accesses, and occasionally hyperkalemia. Later, as the link between cardiovascular disease (CVD) and CKD became more evident, it became clear that anemia was an independent risk factor for developing Left Ventricular Hypertrophy and Heart Failure. Lacking the benefits of any randomized, controlled, clinical trials, use of Erythropoietin Stimulating Agents (ESAs) became widespread, and the optimal hemoglobin to limit cardiovascular events was unknown. Restoring the Hb to normal levels in patients with ESRD on hemodialysis may be associated with an improvement in quality of life and regression of LVH but possibly at the expense of serious cardiovascular outcomes, particularly among those in whom anemia is more difficult to correct. Table 1 lists various recommendations for target Hb. Until 2006, the most consistent finding seemed to be that an Hb level between 11-13 g/dL improved quality of life, without increasing CVD risk. Still, as several trials have explored higher Hb targets, outcomes such as more rapid progression of cancers and increased risk of death and serious cardiovascular events have prompted a black box warning on all ESAs. Anemia Possibly lost in all of this is the wealth of data accumulated in the 1980s and 1990s showing improved quality of life scores and increased vitality. Among ESRD patients receiving ESAs, Benz et al. showed statistically significant improvements in Maintenance of Wakefullness Testing (MWT), reductions in Arousing Periodic Limb Movements (PLMS), and interestingly, the hematocrit in these patients was normalized (mean hematocrit 42.3%). Revicki et al. in 1995 demonstrated significant improvements in assessments of energy (P <.05), physical function (P <.05), home management (P <.05), social activity (P <.05), and cognitive function (P <.05) among CKD patients assigned to receive ESA versus conservative therapy without ESAs. In this trial, 79% of ESA treated patients achieved a Hematocrit level over 36%. In 1991, 117 patients with anemia related to chronic renal failure not yet requiring dialysis were randomized to receive erythropoietin to correct anemia (hematocrit of 40% for males, 35% for females) versus placebo. Energy levels and work capacity improved significantly in the group with corrected anemia compared with the group with uncorrected anemia. Painter demonstrated improvements in exercise training with rHU EPO in patients with ESRD. Finally, Moia et al. showed a reduction in bleeding time by increasing the Hb through the use of rHU EPO. This review will focus on the three most recent clinical trials (CHOIR, CREATE, and TREAT), each of which assesses the optimal Hb in patients with CKD stages III-V and the associated cardiovascular outcomes. Table 2 outlines the characteristics of each trial. CREATE The Cardiovascular Risk Reduction by Early Anemia Treatment with Epoetin Beta trial (CREATE), published in 2006, was a randomized, controlled, clinical trial enrolling 603 patients to study the cardiovascular benefit of Epoetin Beta in anemic patients (Hb level 11-12.5 g/dL) with stages III-IV CKD (GFR 15-35 mL/minute/1.73 m 2 ). Patients were randomly assigned to a target Hb in the normal range (13-15 g/dL, n = 301) versus a subnormal level (10.5-11.5 g/dL, n = 302). The primary endpoint was a composite of 8 cardiovascular events which included time to a first cardiovascular event, sudden death, myocardial infarction, acute heart failure, stroke, transient ischemic attack, angina pectoris, or cardiac arrhythmia resulting in hospitalization, and complication of peripheral vascular disease. Secondary endpoints included death from any cause, death from cardiovascular causes, and hospitalization for any cause among others. Patients who were expected to require renal replacement therapy within six months, had advanced cardiovascular disease, were recently transfused, or had nonrenal causes of anemia were excluded. The study was powered to detect an annual reduced incidence of primary endpoint of 15%. Initial demographic data showed that the groups were largely similar with very few exceptions. The vast majority of patients in the normal Hb group received Epoietin beta (98%). In the subnormal Hb group, 32% received Epoietin Beta in year one, 52% in Table 1: Target hemoglobin in CKD/ESRD. year two, and 76% at the end of the study. At the end of study, the Hb levels between the two groups differed by 1.5 g/dL. Compared to the normal Hb group, the subnormal Hb group did not experience significantly more first cardiovascular events or decline in GFR, but time to initiation of dialysis after 18 months of the trial was significantly shorter among those treated to a normal Hb (P =.03). Nevertheless, fully 105 primary cardiovascular events occurred (58 in the higher Hb group versus 47 in the lower Hb group, P = NS). General health and physical function were significantly improved relative to the subnormal Hb group (P =.003 and P <.001, resp.). The investigators concluded that early complete correction of anemia did not reduce the risk of cardiovascular events among anemic patients with stage III-IV CKD. CHOIR The results of the Correction of Hemoglobin in Outcomes and Renal Insufficiency (CHOIR) trial were also reported in 2006. The open-label randomized, controlled, clinical trial enrolling 1432 patients with anemia (all with Hb below 11 g/dL at enrollment, and nave to ESAs) and CKD III-IV (GFR between 15-50 mL/minute/1.73 m 2 ) compared cardiovascular and renal outcomes for two groups randomized to receive Epoetin Alfa to achieve mean Hbs of 11.3 g/dL (N = 717) versus 13.5 g/dL (N = 715). The primary end point was the time to the composite of death, myocardial infarction, hospitalization for congestive heart failure (with the exclusion of renal replacement therapy), or stroke. Secondary outcomes included the time to renal replacement therapy, hospitalization for either cardiovascular causes or any cause, and quality of life. Patients with uncontrolled hypertension, active gastrointestinal bleeding, iron overload, history of frequent transfusions, refractory iron deficiency anemia, active cancer, angina pectoris, or previous ESA treatment were excluded. At baseline, patients in both groups were very similar with respect to their demographics with few exceptions. Originally, patients were to be followed for approximately 3 years and the study was powered to show a 25% reduction in the composite event rate in the higher Hb group. All 1432 patients were included in the final analysis in an intention to treat model. Median followup was 16 months. After 3 months, a difference in Hb values between the 2 groups was observed. Although the low Hb group was TREAT More recently, the Trial to Reduce cardiovascular Events with Aranesp Therapy (TREAT) was conducted to look at patients who are anemic (Hb less than 11 g/dL) and had Diabetic CKD III-IV (GFR 20-60 mL/minute/1.73 m 2 ). This randomized, controlled, clinical trial enrolled over 4000 patients and randomly assigned approximately 2000 patients to be treated with Darbepoetin Alfa to achieve an Hb of approximately 13 g/dL, and the remainder of patients received placebo and rescue Darbepoetin Alfa therapy if and when the Hb fell below 9 g/dL. The primary end points included the composite outcomes of death or cardiovascular event and a composite outcome of time to death or end-stage renal disease. Secondary endpoints included time to death, death from cardiovascular causes, rate of GFR decline, and quality of life measures. Relevant exclusion criteria included those with uncontrolled hypertension, previous cardiovascular events or kidney transplantation, chemotherapy/radiation therapy, cancer, hematologic diseases, pregnancy, and those receiving ESA therapy in the preceding 12 weeks. The demographics of the patients in Darbepoetin Alfa group (N = 2012) and the Placebo group (N = 2026) were similar in most respects with the exception of a higher percentage of patients in the Placebo group having a history of cardiovascular disease, higher creatinine at baseline, and lower glycated Hb. During this trial, the results of CHOIR were revealed to the enrolled patients, but the study was not terminated. The trial was powered to detect 20% risk reduction for the primary endpoint among those targeted to a higher Hb. Three months after the initiation of the trial, the median achieved Hb level in the Darbepoetin Alfa group differed significantly from that in the placebo group (12.5 g/dL versus 10.6 g/dL, P <.001). At the end of the trial, there were no differences in the primary cardiovascular composite endpoints (31.4% of patients in the treatment arm versus 29.7% of patients in the placebo arm reached a cardiovascular composite endpoint, P =.41). However, a significantly higher proportion of patients suffered fatal or nonfatal stroke among those treated with Darbepoetin Alfa (5% versus 2.6%, HR 1.92; 1.38-2.68, P <.001), despite no evident difference between blood pressures in each group. The renal composite endpoint was reached by 32.4% of patients in the treatment arm and 30.5% in the placebo arm (P =.29). A higher proportion of patients in the placebo group required cardiac revascularization (5.8% versus 4.2%, HR 0.71, 0.54-0.94, P =.02). Interestingly, a significantly higher proportion of patients randomized to the placebo arm required transfusions versus those in the treatment arm (24.5% versus 14.8%, HR for Aranesp 0.56; 95% confidence interval, 0.49-0.65; P <.001). There was a nonstatistically significant trend towards a higher rate of cancer deaths among those in the treated group (39 versus 25, P =.08). Conclusions These three clinical trials in anemic patients with non-ESRD CKD each showed no clear benefit to normalizing Hb in this population, while in some cases showed harm. At best, these trials do show improvements in quality of life particularly with regard to vitality, physical function, and mental health. The shorter time to dialysis seen in the CREATE trial, a higher composite rate of death, myocardial infarction, and hospitalization for CHF in the early-terminated CHOIR study, and the higher stroke risk in the TREAT trial weigh against these quality of life improvements and suggest that normalizing Hb in this population is not warranted and potentially hazardous. The lack of a difference in cardiovascular outcomes in the placebo-controlled TREAT trial, which enrolled twice as many patients as the other 2 Anemia trials combined, is compelling given the paucity of placebocontrolled trials in this population. The mean Hb among placebo-treated patients in the TREAT trial was 10.6 g/dL and was 11.3 g/dL and 11.6 g/dL in the lower Hb groups in the CHOIR and CREATE trials, respectively. Still, 46 percent of patients assigned to the placebo arm in TREAT received at least one dose of Darbepoetin alfa. Fully 76% of patients in the lower Hb group in CREATE received Epoetin beta. Among those in the CHOIR, study the mean dose of Epoetin Alfa for the lower Hb group was approximately 6000 units per week. Nevertheless, even among the more conservatively treated patients, the incidence of serious cardiovascular and renal outcomes was not negligible. In both CHOIR and CREATE, approximately 15% of those targeted to a lower Hb experienced a composite endpoint (CHOIR) or a cardiovascular endpoint (CREATE). Death or a cardiovascular endpoint occurred in nearly 30% of patients assigned to the placebo group in TREAT. The high prevalence of cardiovascular disease among CKD patients is well known, and this burden of CVD increases with the severity of the CKD. While it i reasonable to surmise that pharmacologically correcting anemia, in lieu of transfusions, to some extent, is beneficial to patients with anemia and CKD, by virtue of reducing well-known transmission of viruses, these trials offer no convincing data to establish a cutoff lower (or upper) limit for anemia management. Eckhardt et al. reviewed echocardiographic data from CREATE and concluded that complete correction of anemia exacerbated the prognosis of eccentric LVH. Weiner et al., however, concluded that amongst patients with CKD in the Atherosclerotic Risk in Communities Study, Cardiovascular Health Study, Framingham Heart Study, and Framingham Offspring Study, LVH and anemia conferred a higher risk of composite cardiovascular outcomes (HR for LVH 1.67 95% CI 1.34-2.07 and HR for Anemia 1.51 95% CI 1.27-1.81). Weiner further showed that the combination of anemia and LVH among patients with CKD conferred greater than four times the risk of these outcomes versus those without either comorbidity. Besarab's data suggests that those requiring progressively higher ESA doses to achieve a target Hb may have higher incidence of death. Even though anemia correction may have a salutary effect on LVH regression and reduction in cardiovascular outcomes, this must be weighed against the disappointing findings in TREAT, CHOIR, and CREATE. While in 2009 the K-DOQI Guidelines suggest that the target Hb "generally be in the range of 11-12 g/dL," in the absence of compelling data to the contrary, and in the spirit of doing no harm, it may be more reasonable to target the Hb as specified by the package inserts which aim for 10-12 g/dL. The highest Hb target among those targeted to a lower Hb in the three trials reviewed was 11.6 in the CREATE trial. Substantial dosage reductions should occur as the Hb approaches 12 g/dL. Furthermore, particular attention should be paid to those who respond slowly and require higher doses of ESAs, and to those with Diabetes and CKD and risk factors for stroke. Nevertheless, it would behoove the practitioner to recall the Quality of Life benefits conferred by ESAs in the studies in the 1990s and avoid the knee-jerk response of underutilization of these drugs. One more recent trial, only in abstract form at this point, CAPRIT (The Complete Correction of Post-Transplant Anemia reduces the Rate of Progression of Chronic Allograft Nephropathy) may demonstrate a benefit to a higher hemoglobin. This randomized trial of 128 patients (at least one year after renal transplant) with CKD III-IV (GFR 20-50 mL/min) sought to determine if a higher Hb would be associated with a slower progression of Chronic Allograft Nephropathy. Patients were randomized to a target Hb of 13-15 g/dL (Group A) versus 10.5-11.5 g/dL (Group B). At the end of the study, the Hb in Group A versus B was 12.9 versus 11.3 g/dL (P <.001), and after two years 4 (Group A) versus 10 patients (Group B) reached ESRD (P <.01). At one year, the respective GFRs were 35.9 ± 17.2 mL/min (Group A) versus 30.8 ± 12.1 mL/min (Group B) (P <.025). The incidence of cardiovascular events did not differ between groups. In conclusion, ESA use reduces the need for transfusions, improves quality of life and exercise tolerance, can regress LVH, and may be of benefit in retarding Chronic Allograft Nephropathy. ESA use, however, is also associated with poorer cardiovascular outcomes when used to target hemoglobins higher than the prespecified package inserts and possibly when used excessively in the setting of refactory anemia. The data strongly suggest a target Hb in the CKD population no higher than 10-12 g/dL, careful attention to underlying risks for cardiovascular disease, and thorough evaluation of correctable causes of anemia to prevent "overuse" of ESAs. |
<filename>copasetic/main.go
//
// Copyright 2021 The Sigstore Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"archive/tar"
"bytes"
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/mutate"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/cmd"
"github.com/open-policy-agent/opa/rego"
"github.com/open-policy-agent/opa/types"
"github.com/sigstore/cosign/cmd/cosign/cli/fulcio"
"github.com/sigstore/cosign/cmd/cosign/cli/options"
ociremote "github.com/sigstore/cosign/internal/oci/remote"
"github.com/sigstore/cosign/pkg/cosign"
sigs "github.com/sigstore/cosign/pkg/signature"
"github.com/sigstore/sigstore/pkg/signature"
signatureoptions "github.com/sigstore/sigstore/pkg/signature/options"
)
func main() {
fs := flag.NewFlagSet("copasetic", flag.ExitOnError)
rekorURL := fs.String("rekor-url", "https://rekor.sigstore.dev", "[EXPERIMENTAL] address of rekor STL server")
var regOpts options.RegistryOpts
options.ApplyRegistryFlags(®Opts, fs)
flag.Parse()
rego.RegisterBuiltin2(
®o.Function{
Name: "oci.manifest",
Decl: types.NewFunction(types.Args(types.S), types.A),
Memoize: true,
},
func(bctx rego.BuiltinContext, a, b *ast.Term) (*ast.Term, error) {
var tag string
if err := ast.As(a.Value, &tag); err != nil {
return nil, err
}
ref, err := name.ParseReference(tag)
if err != nil {
return nil, err
}
img, err := remote.Image(ref, regOpts.GetRegistryClientOpts(bctx.Context)...)
if err != nil {
return nil, err
}
mfst, err := img.RawManifest()
if err != nil {
return nil, err
}
v, err := ast.ValueFromReader(bytes.NewReader(mfst))
if err != nil {
return nil, err
}
return ast.NewTerm(v), nil
},
)
rego.RegisterBuiltin2(
®o.Function{
Name: "oci.file",
Decl: types.NewFunction(types.Args(types.S, types.S), types.A),
Memoize: true,
},
func(bctx rego.BuiltinContext, a, b *ast.Term) (*ast.Term, error) {
var tag, path string
if err := ast.As(a.Value, &tag); err != nil {
return nil, err
} else if err := ast.As(b.Value, &path); err != nil {
return nil, err
}
ref, err := name.ParseReference(tag)
if err != nil {
return nil, err
}
img, err := remote.Image(ref, regOpts.GetRegistryClientOpts(bctx.Context)...)
if err != nil {
return nil, err
}
fc, err := findFile(img, path)
if err != nil {
return nil, err
}
v := ast.String(string(fc))
return ast.NewTerm(v), nil
},
)
rego.RegisterBuiltin1(
®o.Function{
Name: "cosign.signatures",
Decl: types.NewFunction(types.Args(types.S), types.A),
Memoize: true,
},
func(bctx rego.BuiltinContext, a *ast.Term) (*ast.Term, error) {
var tag string
if err := ast.As(a.Value, &tag); err != nil {
return nil, err
}
ref, err := name.ParseReference(tag)
if err != nil {
return nil, err
}
registryOpts := regOpts.GetRegistryClientOpts(bctx.Context)
sps, err := cosign.FetchSignaturesForReference(bctx.Context, ref, ociremote.WithRemoteOptions(registryOpts...))
if err != nil {
return nil, err
}
b, err := json.Marshal(sps)
if err != nil {
return nil, err
}
v, err := ast.ValueFromReader(bytes.NewReader(b))
if err != nil {
return nil, err
}
return ast.NewTerm(v), nil
},
)
rego.RegisterBuiltin2(
®o.Function{
Name: "cosign.verify",
Decl: types.NewFunction(types.Args(types.S, types.S), types.A),
Memoize: true,
},
func(bctx rego.BuiltinContext, tagParam, keyParam *ast.Term) (*ast.Term, error) {
var tag string
if err := ast.As(tagParam.Value, &tag); err != nil {
return nil, err
}
var key string
if err := ast.As(keyParam.Value, &key); err != nil {
return nil, err
}
ref, err := name.ParseReference(tag)
if err != nil {
return nil, err
}
pubKey, err := sigs.LoadPublicKey(bctx.Context, key)
if err != nil {
return nil, err
}
ctxOpt := signatureoptions.WithContext(bctx.Context)
co := &cosign.CheckOpts{
SigVerifier: pubKey,
PKOpts: []signature.PublicKeyOption{ctxOpt},
ClaimVerifier: cosign.SimpleClaimVerifier,
RootCerts: fulcio.GetRoots(),
RegistryClientOpts: regOpts.ClientOpts(bctx.Context),
RekorURL: *rekorURL,
}
sps, _, err := cosign.Verify(bctx.Context, ref, co)
if err != nil {
return nil, err
}
b, err := json.Marshal(sps)
if err != nil {
return nil, err
}
v, err := ast.ValueFromReader(bytes.NewReader(b))
if err != nil {
return nil, err
}
return ast.NewTerm(v), nil
},
)
if err := cmd.RootCommand.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func findFile(img v1.Image, path string) ([]byte, error) {
rc := mutate.Extract(img)
defer rc.Close()
tr := tar.NewReader(rc)
for {
hdr, err := tr.Next()
if errors.Is(err, io.EOF) {
break // End of archive
}
if err != nil {
return nil, err
}
fp := hdr.Name
if !filepath.IsAbs(fp) {
fp = "/" + fp
}
if fp == filepath.Clean(path) {
if hdr.Typeflag == tar.TypeSymlink {
// Resolve and recurse!
dst := hdr.Linkname
if !filepath.IsAbs(hdr.Linkname) {
dst, _ = filepath.Abs(filepath.Join(filepath.Dir(fp), filepath.Clean(hdr.Linkname)))
}
return findFile(img, dst)
}
b, err := ioutil.ReadAll(tr)
if err != nil {
return nil, err
}
return b, nil
}
}
return nil, fmt.Errorf("path %s not found", path)
}
|
1. Field of the Invention
The present invention relates to a motor control method for a Motor Driven Power Steering (MDPS) system, particularly a technology that allows steering operation as smooth as possible while preventing damage to a motor due to heat.
2. Description of Related Art
Unlike a hydraulic power steering system using driving force of an engine, an MDPS system provides steering force from driving force of a motor, such that it has an advantage of reducing fuel consumption of a vehicle, but is expensive as compared with the hydraulic power steering system.
Therefore, an MDPS system using an inexpensive DC motor, not a BLAC motor, has been developed to reduce the cost of the MDPS system, however, the motor has a problem in that large amount of heat is generated and it is difficult to discharge the heat.
An MDPS system is basically provided with an Over Heat Protection (OHP) logic to prevent a motor from overheating, and the OHP logic is activated earlier when using a DC motor as described above than when using a BLAC motor.
The OHP logic is provided to restrain electric current that is supplied to the motor, such that when the OHP logic is activated, the steering force supplied from the motor is rapidly decreased and a driver feels the steering wheel heavy.
Therefore, it is the main performance of the MDPS system how long it is possible to steer a vehicle before the OHP logic is activated, which is called ‘OHP performance’ and is estimated by the number of left-right full turn of the steering wheel before the OHP logic is activated under predetermined conditions.
In order to improve the OHP performance, the method of increasing the capacity of the motor have been known in the art; however, this method are not preferable because the size and capacity of the motor, such that it is difficult to mount and dispose them in a vehicle and the cost is increased.
The information disclosed in this Background of the Invention section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art. |
// Copy creates a deep copy of a BGPPath
func (b *BGPPath) Copy() *BGPPath {
if b == nil {
return nil
}
cp := *b
cp.ASPath = make(types.ASPath, len(cp.ASPath))
copy(cp.ASPath, b.ASPath)
cp.Communities = make([]uint32, len(cp.Communities))
copy(cp.Communities, b.Communities)
cp.LargeCommunities = make([]types.LargeCommunity, len(cp.LargeCommunities))
copy(cp.LargeCommunities, b.LargeCommunities)
if b.ClusterList != nil {
cp.ClusterList = make([]uint32, len(cp.ClusterList))
copy(cp.ClusterList, b.ClusterList)
}
return &cp
} |
From more testing to smart testing: data-guided SARS-CoV-2 testing choices We present an in-depth analysis of data from drive through testing stations using rapid antigen detection tests (RDTs), RT-PCR and virus culture, to assess the ability of RDTs to detect infectious cases. We show that the detection limits of five commercially available RDTs differ considerably, impacting the translation into the detection of infectious cases. We recommend careful fit-for-purpose testing before implementation of antigen RDTs in routine testing algorithms as part of the COVID-19 response. |
<filename>Task2.c
#include "utils.h"
void descifrareCaesar()
{
int offset = 0;
scanf("%d ", &offset);
size_t bufSize = 100;
char *cod = calloc(bufSize, sizeof(char));
getline(&cod, &bufSize, stdin);
for (int i = 0; i < strlen(cod); i++)
{
if (cod[i] >= 97 && cod[i] <= 122)
{
int offset_temp = offset;
while (offset_temp > 26)
{
offset_temp -= 26;
}
int litera;
litera = cod[i] - 'a';
if (litera >= offset_temp)
{
litera = litera - offset_temp;
}
else
{
litera = 26 - (offset_temp - litera);
}
cod[i] = litera + 'a';
}
if (cod[i] >= 65 && cod[i] <= 90)
{
int offset_temp = offset;
while (offset_temp > 26)
{
offset_temp -= 26;
}
int litera;
litera = cod[i] - 'A';
if (litera >= offset_temp)
{
litera = litera - offset_temp;
}
else
{
litera = 26 - (offset_temp - litera);
}
cod[i] = litera + 'A';
}
if (cod[i] >= 48 && cod[i] <= 57)
{
int litera;
litera = cod[i] - '0';
int offset_temp = offset;
while (offset_temp > 10)
{
offset_temp -= 10;
}
if (litera >= offset_temp)
{
litera = litera - offset_temp;
}
else
{
litera = 10 - (offset_temp - litera);
}
cod[i] = litera + '0';
}
}
printf("%s", cod);
free(cod);
}
void descifrareVig()
{
size_t bufSize = 100;
char *key = calloc(bufSize, sizeof(char));
getline(&key, &bufSize, stdin);
fflush(stdin);
char *cod = calloc(bufSize, sizeof(char));
getline(&cod, &bufSize, stdin);
int pos = 0;
for (int i = 0; i < strlen(cod); i++)
{
int offset = key[pos] - 'A';
pos++;
if (key[pos] == '\n' || key[pos] == '\0')
pos = 0;
if (cod[i] >= 97 && cod[i] <= 122)
{
int offset_temp = offset;
while (offset_temp > 26)
{
offset_temp -= 26;
}
int litera;
litera = cod[i] - 'a';
if (litera >= offset_temp)
{
litera = litera - offset_temp;
}
else
{
litera = 26 - (offset_temp - litera);
}
cod[i] = litera + 'a';
}
if (cod[i] >= 65 && cod[i] <= 90)
{
int offset_temp = offset;
while (offset_temp > 26)
{
offset_temp -= 26;
}
int litera;
litera = cod[i] - 'A';
if (litera >= offset_temp)
{
litera = litera - offset_temp;
}
else
{
litera = 26 - (offset_temp - litera);
}
cod[i] = litera + 'A';
}
if (cod[i] >= 48 && cod[i] <= 57)
{
int litera;
litera = cod[i] - '0';
int offset_temp = offset;
while (offset_temp > 10)
{
offset_temp -= 10;
}
if (litera >= offset_temp)
{
litera = litera - offset_temp;
}
else
{
litera = 10 - (offset_temp - litera);
}
cod[i] = litera + '0';
}
}
printf("%s", cod);
free(cod);
free(key);
}
void decodificareNumar(char **cod, int offset)
{
for (int i = 0; i < strlen(*cod); i++)
{
if ((*cod)[i] >= 48 && (*cod)[i] <= 57)
{
int litera;
litera = (*cod)[i] - '0';
if (litera >= offset)
{
litera = litera - offset;
}
else
{
litera = 10 - (offset - litera);
}
(*cod)[i] = litera + '0';
}
}
}
void addNumbers(char *n1, char *n2)
{
char result[1000];
int cifre1 = strlen(n1);
int cifre2 = strlen(n2);
if (cifre1 > cifre2)
{
int dif = cifre1 - cifre2;
for (int i = cifre2; i >= 0; i--)
{
n2[i + dif] = n2[i];
}
for (int i = 0; i < dif; i++)
{
n2[i] = '0';
}
cifre2 = cifre1;
}
if (cifre2 > cifre1)
{
int dif = cifre2 - cifre1;
for (int i = cifre1; i >= 0; i--)
{
n1[i + dif] = n1[i];
}
for (int i = 0; i < dif; i++)
{
n1[i] = '0';
}
cifre1 = cifre2;
}
for (int i = 0; i < 1000; i++)
{
result[i] = '0';
}
result[999] = '\0';
int c = 0;
int rest = 0;
for (int i = cifre1; i >= 0; i--)
{
int suma_cifre = 0;
suma_cifre = n1[i] - '0' + n2[i] - '0' + rest;
if (suma_cifre > 9)
{
rest = 1;
suma_cifre = suma_cifre % 10;
}
else
{
rest = 0;
}
result[998 - c] = suma_cifre + '0';
c++;
if (i == 0)
{
result[998 - c] = rest + '0';
}
}
int gasit_cifra_diferita = 0;
for (int i = 0; i < 998; i++)
{
if (result[i] != '0')
{
gasit_cifra_diferita = 1;
}
if (gasit_cifra_diferita)
{
printf("%c", result[i]);
}
}
}
void descifrareAdd()
{
int offset = 0;
scanf("%d ", &offset);
size_t bufSize = 1000;
while (offset > 10)
{
offset -= 10;
}
char *cod = calloc(bufSize, sizeof(char));
scanf("%s", cod);
fflush(stdin);
char *cod2 = calloc(bufSize, sizeof(char));
scanf("%s", cod2);
decodificareNumar(&cod, offset);
decodificareNumar(&cod2, offset);
addNumbers(cod, cod2);
}
void SolveTask2()
{
fflush(stdin);
while (getchar() != '\n')
;
size_t typeSize = 20;
char *type = calloc(typeSize, sizeof(char));
getline(&type, &typeSize, stdin);
fflush(stdin);
if (!strcmp(type, "caesar") || !strcmp(type, "caesar\n"))
{
descifrareCaesar();
}
if (!strcmp(type, "vigenere") || !strcmp(type, "vigenere\n"))
{
descifrareVig();
}
if (!strcmp(type, "addition") || !strcmp(type, "addition\n"))
{
descifrareAdd();
}
free(type);
} |
package quasylab.sibilla.core.simulator;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
public class ClassBytesLoader {
public static byte[] loadClassBytes(String className) throws IOException {
int size;
byte[] classBytes;
InputStream is;
String fileSeparator = System.getProperty("file.separator");
className = className.replace('.', fileSeparator.charAt(0));
className = className + ".class";
// Search for the class in the CLASSPATH
is = ClassLoader.getSystemResourceAsStream(className);
if (is == null)
throw new FileNotFoundException(className);
size = is.available();
classBytes = new byte[size];
is.read(classBytes);
is.close();
return classBytes;
}
} |
A Study on One-Step Immobilization of Horse Immunoglobulin with Vertically Grown ZnO Nanorods Substrates This study investigated the morphological effects of vertically grown ZnO nanorods as bio-immobilized substrates for horse immunoglobulin (IgG) antigen. A simple and novel one-step process of antigen immobilization was developed. It was to apply horse antigen solution on the surface of ZnO nanorods as substrates by drying method at room temperature. The hydro-stability assessment of the immobilized antigen by FTIR spectroscopy was executed to determine its residual activity with reduced intensity. The design was to evaluate its specific functional groups of antigen in view of the absorption peak observed at a wave number of 1550 cm � 1 of water immersion time in calculation of the ratio. The results showed that the ratio of residual activity of horse antigen immobilized on ZnO nanorods substrates still presented more than 85% over the tip region in which the diameter was less than 65 nm. And it approached nearly 100% within the tip area of 28 nm in diameter on needle-like ZnO nanorods soaked in water for 2 h. V C 2011 The Electrochemical Society. All rights reserved. Biosensing devices based on immunoreactions have gained significant attention recently, due to their high selectivity in examining the complex biosamples. The features of the performance of a biosensor or biochip are multidimensional, including sensitivity, selectivity, detection limit, precision, accuracy, reproducibility, and stability. These are greatly affected by its both structure and activity of interfacial proteins as well as peptides functioned in biological recognition. 112 However, the key to effective function of biosensing device is strongly correlated to the stability of immobilization of proteins on biochips. Immobilization of biological molecules is a crucial step in biochip research, since it is directly associated with the biosensing performances. It has been clearly reported that nanostructures can enhance the sensitivity of a biosensor by 12 orders of magnitude, due to its increasing ratio of surface area to unit volume. This tends to immobilize tremendous amount of the enzyme. 1315 Another important on-going development in biosensor technology is miniaturization. Miniaturization, however, may result in low current because of the decreased amount of immobilized enzyme onto the available active area. Immobilization procedure involves the incorporation of biomolecules into carbon nanotubes (CNTs) and metal oxide nanowires. This can be achieved through various methods, such as covalent linkage, 16,17 entrapment, 1820 cross-linking with glutaraldehyde, 21,22 microencapsulation, 23 and adsorption. 2427 ZnO is a biocompatible material, 2830 and its nanotips have been proven compatible with intracellular material. 31 Nanorods structure of ZnO is therefore being actively explored for biosensor applications. 3236 Laboratory manipulations and manufactures of ZnO nanowires have been reported in our previous studies. These vertically-grown ZnO nanowires on various substrates without catalyst 3741 can be shaped in form of needle-like and ladder-like nanorods. 3842 Nevertheless, the interacting behaviors between ZnO nanostructured surfaces and biomolecules have not been extensively demonstrated. 4345 It is therefore proposed in this study to investigate the morphological effects of various types of vertically grown ZnO nanorods as bio-immobilized substrates with horse IgG antigen. In addition, a novel method in terms of one-step process of antigen immobilization was developed. Antigen buffer solution was applied on the surface of ZnO nanorods as substrates by drying method at room temperature. The hydro-stability assessment of the immobilized antigen by FTIR spectroscopy was executed to determine its residual activity with reduced intensity. Experimental |
Sen. Tom Cotton Thomas (Tom) Bryant CottonHillicon Valley: Senators urge Trump to bar Huawei products from electric grid | Ex-security officials condemn Trump emergency declaration | New malicious cyber tool found | Facebook faces questions on treatment of moderators Key senators say administration should ban Huawei tech in US electric grid Inviting Kim Jong Un to Washington MORE (R-Ark.) said the FBI's reported investigation into unverified allegations about President-elect Donald Trump Donald John TrumpREAD: Cohen testimony alleges Trump knew Stone talked with WikiLeaks about DNC emails Trump urges North Korea to denuclearize ahead of summit Venezuela's Maduro says he fears 'bad' people around Trump MORE's connections to Russia is routine.
“The FBI is our counter-intelligence agency — domestically in the United States,” he told the Washington Examiner Wednesday. "It is their long-standing custom to try to thwart those espionage efforts.”
“The FBI would not be doing its job if it was not looking into claims by a hostile foreign power that it had compromising material — that it had other kinds of efforts to coerce or intimidate decision makers,” added Cotton, who endorsed Trump during his presidential campaign.
ADVERTISEMENT
Cotton also defended the intelligence community against criticism from Trump that it has leaked information about the president-elect to the media, suggesting instead that the White House was to blame.
“I suspect these leaks are not coming from the Intelligence Community but rather are coming from the West Wing, if you look at the pattern of the leaks,” he said.
“It occurred in December and occurred last week when the report was delivered to the West Wing — and now this leak about what was briefed to Donald Trump,” added Cotton, a member of the Senate Intelligence Committee.
Cotton added BuzzFeed might have violated U.S. libel law by publishing uncorroborated accusations about Trump and Russia, contained in a 35-page dossier documenting one former British intelligence operative's research into Trump's ties to Russia. BuzzFeed is facing criticism for publishing the original document in full.
“The publication of these unsubstantiated reports is scurrilous,” said Cotton, who is an attorney.
“I think it approaches the standard for reckless disregard for the truth under American libel law as established by New York Times v. Sullivan,” Cotton added.
Cotton said BuzzFeed could be successfully sued.
BuzzFeed published the dossier late Tuesday, which alleges Russia’s government has compromising financial and personal information about Trump. It also claims people close to Trump kept in touch with Moscow during the 2016 presidential race and for years beforehand.
U.S. intelligence officials have not verified the document’s details, and the dossier appears to contain several errors. However, the FBI is reportedly looking into the claims, and a two-page summary of the dossier was added to intelligence agencies' larger classified report on Russian interference in the election, CNN first reported Tuesday.
Trump has fiercely criticized the dossier’s leak to media outlets.
“I think it was disgraceful that the intelligence agencies allowed any information that turned out to be so false and fake [to get out],” he said during a press conference at Trump Tower in New York City.
"That’s something that Nazi Germany would have done and did do," Trump added during the event, his first press conference since becoming president-elect.
FBI Director James Comey on Tuesday declined to answer questions from lawmakers about whether his agency has probed alleged links between Russia and Trump's presidential campaign.
"In a public forum, we never confirm or deny any investigation," he told the Senate Intelligence Committee. |
Enter your zip code to search used Lucerne listings in your area.
The 2011 Buick Lucerne ranking is based on its score within the 2011 Affordable Large Cars category. Currently the Buick Lucerne has a score of 8.5 out of 10 which is based on our evaluation of 103 pieces of research and data elements using various sources.
The 2011 Buick Lucerne is a middle-of-the-pack sedan that offers the quiet and smooth ride expected of most large cars, but falters in terms of driving dynamics and interior features.
When the 2011 Lucerne was new, reviewers complained about its lackluster performance. They felt that acceleration with the base V6 was only adequate, and they disliked the four-speed automatic transmission, which they felt negatively impacted and the Lucerne’s driving dynamics. Reviewers thought other 2011 large cars offered better performance, and the Lucerne’s softly-tuned suspension means that it performs best as a highway cruiser.
When it was new, reviewers thought the Lucerne’s cabin was spacious and comfortable. In particular, they liked the seats, saying that they could accommodate people of any size, even on long trips. However, the Lucerne was a tad outdated when it comes to interior tech features. Still, reviewers liked the Lucerne’s dash layout and easy-to-use controls. Standard features in the Lucerne include cloth seats, a six-speaker audio system, satellite radio, a USB port and OnStar. Available features on higher trims and in option packages include Bluetooth, a touch-screen navigation system, a Harman Kardon stereo, leather seats with front heating, dual-zone climate control and rear parking assist.
The highly-ranked 2011 Buick LaCrosse is worth a look thanks to its quiet ride and luxurious interior. The LaCrosse uses less fuel than the Lucerne and comes with excellent safety ratings.
Check out the 2011 Ford Taurus if you’re seeking a well-rounded used large car. With the Taurus, you’ll gain better performance, fuel economy, interior quality and safety ratings. Additionally, the Taurus offers one of the largest trunks in the class. The Taurus won our 2011 Best Family Sedan for the Money award.
Calculate 2011 Buick Lucerne Monthly Payment Which Cars You Can Afford? |
package bot
import (
"net/http"
"sync"
"time"
script "github.com/pojol/gobot/script/module"
lua "github.com/yuin/gopher-lua"
)
type lStatePool struct {
m sync.Mutex
saved []*botState
}
type botState struct {
L *lua.LState
httpMod *script.HttpModule
protoMod *script.ProtoModule
utilsMod *script.UtilsModule
base64Mod *script.Base64Module
mgoMod *script.MgoModule
}
func (pl *lStatePool) Get() *botState {
pl.m.Lock()
defer pl.m.Unlock()
n := len(pl.saved)
if n == 0 {
return pl.New()
}
x := pl.saved[n-1]
pl.saved = pl.saved[0 : n-1]
return x
}
func (pl *lStatePool) New() *botState {
b := &botState{
L: lua.NewState(),
httpMod: script.NewHttpModule(&http.Client{Timeout: time.Second * 120}),
protoMod: &script.ProtoModule{},
utilsMod: &script.UtilsModule{},
base64Mod: &script.Base64Module{},
mgoMod: &script.MgoModule{},
}
b.L.PreloadModule("proto", b.protoMod.Loader)
b.L.PreloadModule("http", b.httpMod.Loader)
b.L.PreloadModule("utils", b.utilsMod.Loader)
b.L.PreloadModule("base64", b.base64Mod.Loader)
b.L.PreloadModule("mgo", b.mgoMod.Loader)
return b
}
func (pl *lStatePool) Put(bs *botState) {
pl.m.Lock()
defer pl.m.Unlock()
pl.saved = append(pl.saved, bs)
}
func (pl *lStatePool) Shutdown() {
for _, bs := range pl.saved {
bs.L.Close()
}
}
// Global LState pool
var luaPool = &lStatePool{
saved: make([]*botState, 0, 64),
}
|
package com.example.comunicacaoentrefragments.views;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.example.comunicacaoentrefragments.R;
import com.example.comunicacaoentrefragments.interfaces.Comunicador;
import com.example.comunicacaoentrefragments.model.SistemaOperacional;
/**
* A simple {@link Fragment} subclass.
*/
public class PrimeiroFragment extends Fragment {
private Button buttonAndroid;
private Button buttonIos;
private Comunicador comunicador;
public PrimeiroFragment() {
// Required empty public constructor
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
//Inicializa o comunicador para identificar quem é o contexto que vai sobrescrever o meu método
try{
comunicador = (Comunicador) context;
} catch (Exception e){
e.printStackTrace();
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_primeiro, container, false);
initView(view);
buttonAndroid.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Instanciando um objeto
SistemaOperacional android = new SistemaOperacional(R.drawable.jinjer, "Android Oreo");
//Ativa a interface e passa o android para o método receberMensagem
comunicador.receberMensagem(android);
}
});
buttonIos.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SistemaOperacional ios = new SistemaOperacional(R.drawable.fatchocobo, "iOS 8");
comunicador.receberMensagem(ios);
}
});
// Inflate the layout for this fragment
return view;
}
public void initView(View view){
buttonAndroid = view.findViewById(R.id.btnAndroid);
buttonIos = view.findViewById(R.id.btnIOS);
}
}
|
If you’re an avid Hunger Games fan, you’ve probably had some major blowouts with friends who can’t seem to understand how epic the franchise is. For whatever reason, the commentary on greed, wealth, power and excessive consumerism goes over their heads. You are constantly told, that the series can’t hold a candle to Harry Potter, or even worse that Twilight is much better. (Side-eye.) It’s time to put a stop to all of the absurd things that Hunger Games haters say! Some *spoilers* ahead.
Mockingjays literally represent rebels, there isn’t a better symbol for revolution than that.
That little bow and arrow would lay you out before you could even take a step.
She’s not mean, she’s just trying to survive this horrible atrocity. Katniss doesn’t have time to be worried about likability.
Um, they tried to, which is how the Hunger Games was born.
Duh, that’s the point, while the other districts are starving and suffering, they live in excessive luxury.
Oh really? You knew that Katniss and the other tributes were going to have to return to the games? I think not.
Please let us all know where they would have gone.
Your soul is dark and full of terror.
WHAT?!!! That was the worst thing that happened in the entire franchise.
People can survive lots of things if only they have the will and ingenuity to do so.
So she should have just let Prim go to her death? That makes zero sense.
Have you never studied odds and probability? There was always a chance.
Mockingjay is a very robust book, they had to take time to tell the story properly. Plus its pretty much a standard these days.
What basis do you have for this statement?
He’s definitely a bit rough around the edges but he makes up for it tenfold!
Everything doesn’t need to be as gory as possible.
The Hunger Games will never be over!! |
The Semantics of Locatives in the Uralic Languages The present paper deals with the semantics of locatives in the Uralic languages. It is based on, where we have discussed certain general features of locatives with respect to their semantics, their morphology and their syntax. We shall first present the main claims of that theory and then focus on certain aspects with respect to the Uralic languages. It is helpful to keep in mind that we are mainly discussing the spatial uses of locative expressions. Although many other case functions derive from locative functions, we have decided not to discuss them here. The reasons are twofold: (a) we lack the competence to do so, (b) even the study of the purely spatial usage of locatives offers substantial insights into the structure of language(s) that make this study worthwhile. Additionally, we shall show that a substantial part of nonspatial usages have at least synchronically little to do with a nonstandard semantics; instead, their behaviour can be neatly explained in purely syntactic terms. The data comes mainly from Finnish and Hungarian, but we believe that the facts carry over mutatis mutandis to other Uralic languages. Finally, readers are advised to get hold of for the formal apparatus. Some of the complications have been swept under the rug here in order to be brief. The present paper has benefitted in particular from comments by Elena Skribnik. The data has been checked with Johanna Domokos and Olli Valkonen. Remaining errors are solely my own. This work has been funded through a Heisenberggrant by the Deutsche Forschungsgemeinschaft. |
The Trump corporate income tax cuts are the latest in a decades-long trend of tax reductions that have been substantially reversed mainly during times of war.
The historical evidence is revealing.
When the federal corporate income tax began in 1909, it was about as low as it could be — a rate of only 1 percent of corporate profits. Over more than 100 years, it has followed a broad hump shape, increasing for about half a century, and then decreasing for about the next 50 years.
The corporate tax rate peaked in 1968 at 52.8 percent. The Tax Cuts and Jobs Act of 2017 brought the 2018 rate down to 21 percent from 35 percent last year.
Wars provided an impetus for tax increases, with major hikes during both world wars and the Korean War. Corporate taxes remained high for more than 30 years, then dropped sharply under President Ronald Reagan and now, again, with President Trump.
That was an intellectual defense of the income tax. But more emotional issues — those of unequal sacrifice in time of war — account for the high levels to which corporate tax rates rose.
During World War I, the federal corporate income tax rose to 12 percent in 1918 from 1 percent in 1915. In addition, in 1917 a new “excess profits tax” — on profits above the payer’s prewar level — was imposed, and it ranged as high as 80 percent. The increase came amid public outcry against wartime “profiteering.” People were angry to see men who stayed at home becoming millionaires from war profits, while the soldiers overseas were fighting and, often, dying.
The excess profits tax was scrapped in 1921, but the corporation income tax remained at nearly the same level.
With World War II, rates rose further, reaching 40 percent in 1942. And once again a wartime excess profits tax was instituted, ranging up to 95 percent.
After that war, the corporate excess profits tax was eliminated, but the corporate income tax rates were not cut back for long.
The Korean War, which scared many people as being the possible beginning of what they called “World War III,” occasioned further increases. The federal corporate income tax rate rose to 52 percent, and yet another temporary excess profits tax was instituted. And again, a familiar pattern was in place: Corporate income tax rates did not decline much after the war was over.
These wartime tax increases left a lasting legacy of relatively high corporate income tax rates. Even with the Trump tax cuts, the United States is far above the rate that prevailed before World War I.
What prompted taxes to begin a long decline, starting with the Reagan presidency in the 1980s? Here, we are in the realm of speculation. Decades after the Korean War — arguably the last American war with a high degree of public unanimity — the names and feats of war heroes began to fade in memory. People may simply have returned to more individualistic, self-centered views of society and the economy.
In any case, under Reagan, the top corporate tax rate dropped from 46 percent to 34 percent. In 1993, during the Clinton administration, it increased slightly to 35 percent, where it held until last year.
Effective tax rates — actual corporate taxes paid as a percentage of pretax profits, including the effects of all deductions and accounting tricks — can’t be tracked accurately all the way back to 1909, but estimates have also shown a decline in these rates in recent decades.
What data we do have shows an unmistakable trend. Consider, for example, the United States National Income and Product Accounts, published by the Commerce Department’s Bureau of Economic Analysis. Data from that source indicates that the fraction of profits on corporate income taken by federal, state, local and foreign taxes peaked during World War II and has shown a fairly linear, steady and steep downtrend ever since.
This history provides an important perspective.
While it may be tempting to view the Reagan and Trump tax policies as anomalies, they may be seen as part of a long-term trend. It is important to recognize that Reagan’s tax decreases were not substantially reversed under subsequent administrations. And it is quite possible that President Trump’s corporate tax cuts may remain in place, even if Trump political power ebbs.
Given this history, I have to wonder: Will it take a major war — one that galvanizes the public, involves vast sacrifice and seems to truly threaten domestic survival — to raise the corporation income tax significantly? |
import { Route } from "vue-router";
import { MutationTree } from "vuex";
import RouteTagState, { Tag } from "./state";
export function add(state: RouteTagState, tag: Tag): void {
state.tagList.push(tag);
}
export function close(state: RouteTagState, tag: Tag): void {
state.tagList = state.tagList.filter(t => t.id !== tag.id);
}
export function closeCurrent(state: RouteTagState, route: Route): void {
state.tagList = state.tagList.filter(t => t.route.name !== route.name);
}
export function clear(state: RouteTagState): void {
state.tagList = [];
}
export default {
add,
close,
closeCurrent,
clear
} as MutationTree<RouteTagState>;
|
/**
* Base class for any {@link HeaderName}.
*/
abstract class HeaderParameterName<V> extends HeaderName2<V> {
/**
* Private ctor to limit sub classing.
*/
HeaderParameterName(final String name, final HeaderHandler<V> handler) {
super(name);
this.handler = handler;
}
/**
* Parameter names ending with a <code>*</code> will use encoded text as their value, rather than text or quoted text.
*/
final boolean isStarParameter() {
return this.value().endsWith(STAR.string());
}
final static CharacterConstant STAR = CharacterConstant.with('*');
/**
* Accepts text and converts it into its value.
*/
@Override
public final V parse(final String text) {
Objects.requireNonNull(text, "text");
return this.handler.parse(text, this);
}
/**
* Validates the value and casts it to its correct type.
*/
@Override
public final V check(final Object header) {
return this.handler.check(header, this);
}
final HeaderHandler<V> handler;
/**
* Gets a value wrapped in an {@link Optional} in a type safe manner.
*/
public Optional<V> parameterValue(final HeaderWithParameters<?> hasParameters) {
Objects.requireNonNull(hasParameters, "hasParameters");
return Optional.ofNullable(Cast.to(hasParameters.parameters().get(this)));
}
/**
* Retrieves the value or throws a {@link HeaderException} if absent.
*/
public V parameterValueOrFail(final HeaderWithParameters<?> hasParameters) {
final Optional<V> value = this.parameterValue(hasParameters);
if (!value.isPresent()) {
throw new HeaderException("Required value is absent for " + this);
}
return value.get();
}
} |
<gh_stars>10-100
#include <PiDxe.h>
#include <Library/LKEnvLib.h>
#include <Chipset/gsbi.h>
#include <Chipset/smem.h>
#include <Library/QcomClockLib.h>
#include <Library/QcomBoardLib.h>
#include <Library/QcomGpioTlmmLib.h>
/* Configure UART clock - based on the gsbi id */
VOID LibQcomPlatformUartDmClockConfig(UINT8 id)
{
CHAR8 gsbi_uart_clk_id[64];
CHAR8 gsbi_p_clk_id[64];
snprintf(gsbi_uart_clk_id, 64,"gsbi%u_uart_clk", id);
gClock->clk_get_set_enable(gsbi_uart_clk_id, 1843200, 1);
snprintf(gsbi_p_clk_id, 64,"gsbi%u_pclk", id);
gClock->clk_get_set_enable(gsbi_p_clk_id, 0, 1);
}
/* Configure gpio for uart - based on gsbi id */
VOID LibQcomPlatformUartDmGpioConfig(UINT8 id)
{
if(gBoard->board_platform_id() == MPQ8064)
{
switch (id) {
case GSBI_ID_5:
/* configure rx gpio */
gGpioTlmm->SetFunction(52, 2);
gGpioTlmm->SetDriveStrength(52, 8);
gGpioTlmm->SetPull(52, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(52);
/* configure tx gpio */
gGpioTlmm->SetFunction(51, 2);
gGpioTlmm->SetDriveStrength(51, 8);
gGpioTlmm->SetPull(51, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(51);
break;
default:
ASSERT(0);
}
}
else if((gBoard->board_platform_id() == APQ8064) ||
(gBoard->board_platform_id() == APQ8064AA) ||
(gBoard->board_platform_id() == APQ8064AB))
{
switch (id) {
case GSBI_ID_1:
/* configure rx gpio */
gGpioTlmm->SetFunction(19, 1);
gGpioTlmm->SetDriveStrength(19, 8);
gGpioTlmm->SetPull(19, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(19);
/* configure tx gpio */
gGpioTlmm->SetFunction(18, 1);
gGpioTlmm->SetDriveStrength(18, 8);
gGpioTlmm->SetPull(18, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(18);
break;
case GSBI_ID_7:
/* configure rx gpio */
gGpioTlmm->SetFunction(83, 1);
gGpioTlmm->SetDriveStrength(83, 8);
gGpioTlmm->SetPull(83, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(83);
/* configure tx gpio */
gGpioTlmm->SetFunction(82, 2);
gGpioTlmm->SetDriveStrength(82, 8);
gGpioTlmm->SetPull(82, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(82);
break;
default:
ASSERT(0);
}
}
else
{
switch (id) {
case GSBI_ID_3:
/* configure rx gpio */
gGpioTlmm->SetFunction(15, 1);
gGpioTlmm->SetDriveStrength(15, 8);
gGpioTlmm->SetPull(15, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(15);
/* configure tx gpio */
gGpioTlmm->SetFunction(14, 1);
gGpioTlmm->SetDriveStrength(14, 8);
gGpioTlmm->SetPull(14, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(14);
break;
case GSBI_ID_5:
/* configure rx gpio */
gGpioTlmm->SetFunction(23, 1);
gGpioTlmm->SetDriveStrength(23, 8);
gGpioTlmm->SetPull(23, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(23);
/* configure tx gpio */
gGpioTlmm->SetFunction(22, 1);
gGpioTlmm->SetDriveStrength(22, 8);
gGpioTlmm->SetPull(22, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(22);
break;
case GSBI_ID_8:
/* configure rx gpio */
gGpioTlmm->SetFunction(35, 1);
gGpioTlmm->SetDriveStrength(35, 8);
gGpioTlmm->SetPull(35, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(35);
/* configure tx gpio */
gGpioTlmm->SetFunction(34, 1);
gGpioTlmm->SetDriveStrength(34, 8);
gGpioTlmm->SetPull(34, GPIO_PULL_NONE);
gGpioTlmm->DirectionInput(34);
break;
default:
ASSERT(0);
}
}
}
|
//$Id$
//------------------------------------------------------------------------------
// TdmReadWriter
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool.
//
// Copyright (c) 2002 - 2020 United States Government as represented by the
// Administrator of The National Aeronautics and Space Administration.
// All Other Rights Reserved.
//
// Author: <NAME>
// Created: 2014/8/20
//
// Developed jointly by NASA/GSFC and Thinking Systems, Inc. under contract
// FDSS.
//
/**
* TdmReadWriter class will be used by the TdmObType class.
*/
//------------------------------------------------------------------------------
#include "TdmReadWriter.hpp"
#include "MessageInterface.hpp"
#include "xercesc/framework/LocalFileInputSource.hpp"
#include "MeasurementException.hpp"
#include "DateUtil.hpp"
//------------------------------------------------------------------------------
// Public Methods
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// TdmReadWriter()
//------------------------------------------------------------------------------
/**
* Constructor
*/
//------------------------------------------------------------------------------
TdmReadWriter::TdmReadWriter()
{
theErrorHandler = new TdmErrorHandler();
theDOMParser = NULL;
theBody = NULL;
theSegment = NULL;
theData = NULL;
theObservation = NULL;
xercesInitialized = false;
observationIndex = 0;
// Fill in the map
mapTransmitBand["S"] = 1.0;
mapTransmitBand["X"] = 2.0;
mapTransmitBand["KA"] = 3.0;
mapTransmitBand["KU"] = 4.0;
mapTransmitBand["L"] = 5.0;
}
//------------------------------------------------------------------------------
// TdmReadWriter(const TdmReadWriter &trw)
//------------------------------------------------------------------------------
/**
* Copy Constructor
*/
//------------------------------------------------------------------------------
TdmReadWriter::TdmReadWriter(const TdmReadWriter &trw)
{
theErrorHandler = NULL;
theDOMParser = NULL;
mapTransmitBand.insert(trw.mapTransmitBand.begin(), trw.mapTransmitBand.end());
*this = trw;
}
//------------------------------------------------------------------------------
// operator=(const TdmReadWriter &trw)
//------------------------------------------------------------------------------
/**
* Assignment operator
*/
//------------------------------------------------------------------------------
TdmReadWriter& TdmReadWriter::operator=(const TdmReadWriter &trw)
{
if (this != &trw)
{
TdmErrorHandler *newErrorHandler = trw.theErrorHandler;
if (theErrorHandler) // made changes by TUAN NGUYEN
{ // made changes by TUAN NGUYEN
delete theErrorHandler;
theErrorHandler = NULL; // made changes by TUAN NGUYEN
} // made changes by TUAN NGUYEN
theErrorHandler = newErrorHandler;
theDOMParser = trw.theDOMParser;;
theBody = trw.theBody;
theSegment = trw.theSegment;
theData = trw.theData;
theObservation = trw.theObservation;
xercesInitialized = trw.xercesInitialized;
observationIndex = trw.observationIndex;
mapTransmitBand.insert(trw.mapTransmitBand.begin(), trw.mapTransmitBand.end());
}
return *this;
}
//------------------------------------------------------------------------------
// ~TdmReadWriter()
//------------------------------------------------------------------------------
/**
* Destructor
*/
//------------------------------------------------------------------------------
TdmReadWriter::~TdmReadWriter()
{
if(xercesInitialized)
Finalize();
}
//------------------------------------------------------------------------------
// bool Initialize()
//------------------------------------------------------------------------------
/**
* Initializes TdmReadWriter.
*
* This method will initialize the DOM Parser, and configure it for error handling
* and Schema validation.
*
* @param none
*
* @return bool
*/
//------------------------------------------------------------------------------
bool TdmReadWriter::Initialize()
{
if (!xercesInitialized)
{
try
{
XMLPlatformUtils::Initialize();
theDOMParser = new XercesDOMParser();
theDOMParser->setErrorHandler(theErrorHandler);
theDOMParser->setValidationScheme(XercesDOMParser::Val_Auto);
theDOMParser->setDoNamespaces(true);
theDOMParser->setDoSchema(true);
theDOMParser->setValidationConstraintFatal(true);
xercesInitialized = true;
}
catch(const XMLException &xe)
{
std::string errMsg ("Xerces failed to initialize: ");
errMsg.push_back(*XMLString::transcode(xe.getMessage()));
throw MeasurementException(errMsg);
}
}
return xercesInitialized;
}
//------------------------------------------------------------------------------
// ObservationData *ProcessMetadata()
//------------------------------------------------------------------------------
/**
* Processes metadata and returns it to the caller.
*
* This method called each time a new segment is encountered, it loads the metadata
* into the ObservationData template and returns a pointer to it for use by the
* TdmObType that called the method.
*
* @param none
*
* @return ObsData pointer
*/
//------------------------------------------------------------------------------
//ObsData *TdmReadWriter::ProcessMetadata()
ObservationData *TdmReadWriter::ProcessMetadata()
{
if (theSegment != NULL)
{
// Clear observation Data if it has been filled in with data.
theTemplate.Clear();
DOMElement *pMetaData = theSegment->getFirstElementChild();
DOMNodeList *pChilds = pMetaData->getChildNodes();
for (UnsignedInt i = 0; i < pChilds->getLength(); i++)
{
DOMElement *pChild = (DOMElement *)pChilds->item(i);
if (pChild->getNodeType() == DOMNode::ELEMENT_NODE)
{
//Fill in the observation data theTemplate for each
// attributes.
switch(HashIt(pChild->getNodeName()))
{
case TIME_SYSTEM:
{
std::string strT(XMLString::transcode(pChild->getTextContent()));
if ( strT == "UTC")
theTemplate.epochSystem = TimeSystemConverter::UTCMJD;
break;
}
case PARTICIPANT_1:
case PARTICIPANT_2:
case PARTICIPANT_3:
case PARTICIPANT_4:
case PARTICIPANT_5:
{
theTemplate.participantIDs.push_back(XMLString::transcode(pChild->getTextContent()));
break;
}
case MODE:
break;
case PATH:
{
StringArray IDs;
char *pPath = XMLString::transcode(pChild->getTextContent());
char *pTok;
pTok = strtok(pPath, ",");
while (pTok != NULL)
{
IDs.push_back(theTemplate.participantIDs.at(atoi(pTok)-1));
pTok = strtok(NULL, ",");
}
theTemplate.strands.push_back(IDs);
XMLString::release(&pPath);
break;
}
case PATH_1:
break;
case PATH_2:
break;
case TRANSMIT_BAND:
{
std::string strT(XMLString::transcode(pChild->getTextContent()));
std::map<std::string, Real>::iterator it;
it = mapTransmitBand.find(strT);
if (it != mapTransmitBand.end())
theTemplate.value.push_back(it->second);
else
theTemplate.value.push_back(0.0);
theTemplate.dataMap.push_back(XMLString::transcode(pChild->getNodeName()));
break;
}
case RECEIVE_BAND:
break;
case TIMETAG_REF:
{
std::string strT(XMLString::transcode(pChild->getTextContent()));
if (strT.compare("RECEIVE") == 0 || strT.compare("receive") == 0)
theTemplate.epochAtEnd = true;
else if (strT.compare("TRANSMIT") || strT.compare("transmit") == 0)
theTemplate.epochAtEnd = false;
break;
}
// case INTEGRATION_INTERVAL:
// {
// theTemplate.data.push_back(atof(XMLString::transcode(pChild->getTextContent())));
// theTemplate.dataMap.push_back(XMLString::transcode(pChild->getNodeName()));
// }
// break;
case INTEGRATION_REF:
{
std::string strT(XMLString::transcode(pChild->getTextContent()));
if (strT.compare("END") == 0 || strT.compare("end") == 0)
theTemplate.epochAtIntegrationEnd = true;
else if (strT.compare("START") || strT.compare("start") == 0)
theTemplate.epochAtIntegrationEnd = false;
}
break;
case RANGE_MODE:
break;
case RANGE_MODULUS:
case FREQ_OFFSET:
case INTEGRATION_INTERVAL:
{
theTemplate.value.push_back(atof(XMLString::transcode(pChild->getTextContent())));
theTemplate.dataMap.push_back(XMLString::transcode(pChild->getNodeName()));
break;
}
case RANGE_UNITS:
{
theTemplate.unit = std::string(XMLString::transcode(pChild->getTextContent()));
break;
}
default:
break;
}
}
}
theData = theSegment->getLastElementChild();
DOMNodeList *pObsChilds = theData->getChildNodes();
int i = 0;
while ( ((DOMElement *)pObsChilds->item(i))->getNodeType() != DOMNode::ELEMENT_NODE)
{
i++;
}
//first observation data
theObservation = (DOMElement *)pObsChilds->item(i);
return &theTemplate;
}
return NULL;
}
//------------------------------------------------------------------------------
// bool LoadRecord()
//------------------------------------------------------------------------------
/**
* Loads Data section of XML file.
*
* This method retrieves the observation data and fills in the relevant fields in
* the ObservationData record that is passed to it, by pushing the observation data
* to the data member and the associated field tags to the dataMap in the input
* ObservationData record.
*
* @param ObsData *
*
* @return ObsData
*/
//------------------------------------------------------------------------------
//ObsData *TdmReadWriter::LoadRecord(ObsData *newData)
ObservationData *TdmReadWriter::LoadRecord(ObservationData *newData)
{
std::string strPrevEpoch;
std::string strCurrEpoch;
std::string strObs;
std::string strNodeName;
strPrevEpoch = std::string(XMLString::transcode(theObservation->getFirstElementChild()->getTextContent()));
for (UnsignedInt i = observationIndex; i < theData->getChildNodes()->getLength(); i++)
{
theObservation = (DOMElement *) theData->getChildNodes()->item(i);
if (theObservation->getNodeType() == DOMNode::ELEMENT_NODE)
{
strCurrEpoch = std::string(XMLString::transcode(theObservation->getFirstElementChild()->getTextContent()));
strObs = std::string(XMLString::transcode(theObservation->getLastElementChild()->getTextContent()));
strNodeName = std::string(XMLString::transcode(theObservation->getLastElementChild()->getNodeName()));
if (theTemplate.typeName == "")
theTemplate.typeName = newData->typeName = strNodeName;
if (strPrevEpoch != strCurrEpoch)
{
//set the index for next call
observationIndex = i;
return &theTemplate;
}
else
{
// push data into newData
newData->epoch = ParseEpoch(strPrevEpoch);
newData->value.push_back(atof(strObs.c_str()));
newData->dataMap.push_back(strNodeName);
}
strPrevEpoch = strCurrEpoch;
}
}
theSegment = theSegment->getNextElementSibling();
// reset the index back to zero
observationIndex = 0;
return (ProcessMetadata());
}
//------------------------------------------------------------------------------
// bool Validate()
//------------------------------------------------------------------------------
/**
* Validates the XML file.
*
* This method called when a new TDM file is loaded for the first data read, it uses
* Xerces to validate the data file against the TDM schema.
*
* @param TDM XML filename
*
* @return bool
*/
//------------------------------------------------------------------------------
bool TdmReadWriter::Validate(const std::string &tdmFileName)
{
LocalFileInputSource *xmlFile;
// Load the TDM XML file
try
{
xmlFile = new LocalFileInputSource(XMLString::transcode(tdmFileName.c_str()));
}
catch(const XMLException &xe)
{
std::string errMsg ("Xerces failed to load the file: ");
errMsg.push_back(*XMLString::transcode(xe.getMessage()));
throw MeasurementException(errMsg);
}
// Parse the TDM XML
if(theDOMParser != NULL)
{
theDOMParser->parse(*xmlFile);
// Check to see if the Schema Validation passed
if (theDOMParser->getErrorCount() == 0)
{
MessageInterface::ShowMessage("XML file is validated against the Schema file successfully.\n");
}
else
{
std::string errMsg ("Xerces failed validation: XML file does not conform to Schema: ");
throw MeasurementException(errMsg);
}
}
return true;
}
//------------------------------------------------------------------------------
// bool Finalize()
//------------------------------------------------------------------------------
/**
* Finalizes the TdmReadWriter object.
*
* This method cleans up the TDM file and Xerces interface if needed, and
* any other artifacts still in memory.
*
* @param none
*
* @return bool
*/
//------------------------------------------------------------------------------
bool TdmReadWriter::Finalize()
{
if (theDOMParser) // made changes by TUAN NGUYEN
{
delete theDOMParser;
theDOMParser = NULL;
}
if (theErrorHandler) // made changes by TUAN NGUYEN
{
delete theErrorHandler;
theErrorHandler = NULL;
}
xercesInitialized = false;
XMLPlatformUtils::Terminate();
return xercesInitialized;
}
//------------------------------------------------------------------------------
// bool SetBody()
//------------------------------------------------------------------------------
/**
* Reads Header section of XML file (for checking the version number),
* set the Body element and first Segment node.
*
* This method reads the header in XML file, and set the Body element.
*
*
* @param none
*
* @return bool
*/
//------------------------------------------------------------------------------
bool TdmReadWriter::SetBody()
{
DOMDocument *pDoc = theDOMParser->getDocument();
DOMElement *pTdm = pDoc->getDocumentElement();
if (pTdm->hasAttributes())
{
DOMAttr *pAttrId = pTdm->getAttributeNode(XMLString::transcode("id"));
if (!XMLString::equals(XMLString::transcode("CCSDS_TDM_VERS"),pAttrId->getValue()))
{
std::string errMsg = " CCSDS_TDM_VERS id is not correct";
throw MeasurementException(errMsg);
}
DOMAttr *pAttrVer = pTdm->getAttributeNode(XMLString::transcode("version"));
if (!XMLString::equals(XMLString::transcode("1.0"),pAttrVer->getValue()))
{
std::string errMsg = "The TDM VERSION is not correct.\n";
throw MeasurementException(errMsg);
}
}
//header
/********** No NEED to parse these.*********** /
DOMElement *pHeader = pTdm->getFirstElementChild();
DOMElement *pComments = pHeader->getFirstElementChild();
while (pComments != NULL && XMLString::equals(XMLString::transcode("COMMENT"), pComments->getTagName())) //comments
{
pComments = pComments->getNextElementSibling();
}
//whether or not there are comments or not, we get here.
DOMElement * pDate = (DOMElement *)pHeader->getElementsByTagName(XMLString::transcode("CREATION_DATE"))->item(0);
DOMElement * pOrig = (DOMElement *)pHeader->getElementsByTagName(XMLString::transcode("ORIGINATOR"))->item(0);
**********************************************/
theBody = pTdm->getLastElementChild();
theSegment = theBody->getFirstElementChild();
return true;
}
//------------------------------------------------------------------------------
// MetaData HashIt()
//------------------------------------------------------------------------------
/**
* Hashes a string name to a corresponding enum value.
*
*
* This method hashes a string to a number.
*
*
* @param char * pointing to node name
*
* @return an enumeration value
*/
//------------------------------------------------------------------------------
TdmReadWriter::MetaData TdmReadWriter::HashIt(const XMLCh *xmlNodeName)
{
std::string strN(XMLString::transcode(xmlNodeName));
if (strN == "TIME_SYSTEM")
return TIME_SYSTEM;
if (strN == "PARTICIPANT_1")
return PARTICIPANT_1;
if (strN == "PARTICIPANT_2")
return PARTICIPANT_2;
if (strN == "PARTICIPANT_3")
return PARTICIPANT_3;
if (strN == "PARTICIPANT_4")
return PARTICIPANT_4;
if (strN == "PARTICIPANT_5")
return PARTICIPANT_5;
if (strN == "MODE")
return MODE;
if (strN == "PATH")
return PATH;
if (strN == "PATH_1")
return PATH_1;
if (strN == "PATH_2")
return PATH_2;
if (strN == "TRANSMIT_BAND")
return TRANSMIT_BAND;
if (strN == "RECEIVE_BAND")
return RECEIVE_BAND;
if (strN == "TIMETAG_REF")
return TIMETAG_REF;
if (strN == "INTEGRATION_INTERVAL")
return INTEGRATION_INTERVAL;
if (strN == "INTEGRATION_REF")
return INTEGRATION_REF;
if (strN == "RANGE_MODE")
return RANGE_MODE;
if (strN == "RANGE_MODULUS")
return RANGE_MODULUS;
if (strN == "RANGE_UNITS")
return RANGE_UNITS;
if (strN == "FREQ_OFFSET")
return FREQ_OFFSET;
return NONE;
}
//------------------------------------------------------------------------------
// GmatEpoch ParseEpoch()
//------------------------------------------------------------------------------
/**
* Parse and Convert Epoch datetime string.
*
*
* This method parses and converts the Epoch datetime string
* passed in to the GmatEpoch that will be used in ObsData structure.
*
* Two datetime formats :
* 1.) YYYY-MM-DDThh:mm:ss[d->d][Z]
* 2.) YYYY-DDDThh:mm:ss[d->d][Z]
* [d->d] is an optional fraction seconds; 'Z" is an optional time code terminator.
* refer to CCSDS503.0-B-1_TDM.pdf document page 52.
*
*
* @param const std::string
*
* @return GmatEpoch
*/
//------------------------------------------------------------------------------
GmatEpoch TdmReadWriter::ParseEpoch(const std::string strEpoch)
{
Integer year = -1, doy = -1, month = -1, day = -1, hour = -1, minute = -1 ;
Real sec = -1;
GmatEpoch mjd;
// c_str() returns a const char *
char *epoch = (char *)strEpoch.c_str();
char *pch, *date, *time;
Byte i = 0;
// Start Parsing....
// break the string into date and time parts :
// using delimiter "T".
pch = strtok(epoch, "T");
while (pch != NULL)
{
if (i == 0)
date = pch;
else
time = pch;
i++;
pch = strtok(NULL, "T");
}
// parse the date part
i = 0;
pch = strtok(date, "-");
while (pch != NULL)
{
if (i == 0)
year = atoi(pch);
else if (i == 1)
doy = atoi(pch);
else if (i == 2)
{
month = doy;
day = atoi(pch);
// reset it back to -1 to distinguish between two formats
doy = -1;
}
i++;
pch = strtok(NULL, "-");
}
// parse the time part
i = 0;
pch = strtok(time, ":");
while (pch != NULL)
{
if (i == 0)
hour = atoi(pch);
else if (i == 1)
minute = atoi(pch);
else if (i == 2)
sec = atof(pch);
i++;
pch = strtok(NULL, ":");
}
// Done Parsing ....
// Start Conversion ....
if (doy != -1) // Handle the second format
ToMonthDayFromYearDOY(year, doy, month, day);
mjd = ModifiedJulianDate(year, month, day, hour, minute, sec);
return mjd;
}
|
// Copyright © 2016 <NAME> <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"math/rand"
"os"
"strconv"
"strings"
"time"
)
func checkerr(err error) {
if err != nil {
fmt.Println(err)
os.Exit(2)
}
}
func roll_dice(dice string) {
var dice_result int = 0
// This will be an array of dice
dice_array := strings.Split(dice, "d")
// use strconv to convert arrays indexes to Integers
dice_num, err := strconv.Atoi(dice_array[0])
// Check for errors.
checkerr(err)
dice_type, err := strconv.Atoi(dice_array[1])
checkerr(err)
// loop through the number of dice provided
for i := 1; i <= dice_num; i++ {
// Generate a seed to get a truely random number.
// otherwise it'll be the same number every build.
seed_number := rand.New(rand.NewSource(time.Now().UnixNano()))
// Use the seed to generate an Integer to the maximum of what the
// dice type is.
number_result := seed_number.Intn(dice_type)
// Inciment by 1 so that there are no zeros.
number_result = number_result + 1
// Display the rolls.
fmt.Println("Roll #", i, ":", number_result)
// Keep a total of the dice numbers.
dice_result = dice_result + number_result
}
fmt.Println("Total:", dice_result)
}
// rollCmd represents the roll command
var rollCmd = &cobra.Command{
Use: "roll #d#",
Short: "Roll a set of dice specified",
Long: `Roll a set of dice specified by the number
(Number of dice)d(number of sides)
This denotes the number and type of dice being rolled.`,
Run: func(cmd *cobra.Command, args []string) {
// TODO: Work your own magic here
fmt.Println("roll called")
roll_dice(args[0])
},
}
func init() {
RootCmd.AddCommand(rollCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// rollCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// rollCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
|
/**
* Creates a many-to-one association type used for a mapping a many-to-one association between entities
*
* @param entity The entity
* @param context The context
* @param property The property
* @return The ToOne instance
*/
public ToOne createManyToOne(PersistentEntity entity, MappingContext context, PropertyDescriptor property) {
return new ManyToOne<T>(entity, context, property) {
PropertyMapping<T> propertyMapping = createPropertyMapping(this, owner);
public PropertyMapping getMapping() {
return propertyMapping;
}
};
} |
“Skin disinfectants” are routinely used in professional and non-professional contexts to rapidly kill microbes. A physician has a need to disinfect his or her skin both before and after examining a patient. Prior to the performance of an invasive medical procedure, the skin of the subject must be properly cleaned to avoid post-procedure infections. In non-professional contexts, a commuter, riding public transportation, may wish to disinfect her hands before handling food; a child, playing in a park, may need to clean his hands but not have the convenience of soap and water nearby. Each of these situations require, optimally, a skin disinfectant that is effective, easy to use, and non-irritating so as to permit repeated use.
A number of skin disinfectants have been developed that use alcohol as the primary antimicrobial agent. There are two general problems associated with alcohol-based disinfectants. First, the effective concentration of alcohol, generally regarded to be greater than about 60 percent weight (hereafter, all percentages should be considered weight/volume percentages, unless specified otherwise) of ethanol, or its equivalent, is irritating to the skin, causing dryness and consequent peeling and cracking. Because chapped skin tends to be more susceptible to microbial contamination, repeated use of alcohol disinfectants can exacerbate the very problem they are intended to solve. Second, whereas alcohol can be an effective disinfectant, once it evaporates its antimicrobial activity is lost.
Alcohol-based skin disinfectants which are known in the art, some of which address the two problems mentioned above, include the following.
U.S. Pat. No. 6,107,261 by Taylor et al., issued Aug. 22, 2000, and its continuations-in-part, U.S. Pat. No. 6,204,230 by Taylor et al., issued Mar. 20, 2001 and U.S. Pat. No. 6,136,771 by Taylor et al., issued Oct. 24, 2000, disclose antibacterial compositions which contain an antibacterial agent at a percent saturation of at least 50 percent. The compositions further comprise, as solubility promoters, a surfactant and a hydric solvent, which may be an alcohol.
U.S. Pat. No. 5,776,430 by Osborne et al., issued Jul. 7, 1998, discloses a topical antimicrobial cleaner containing about 0.65-0.85 percent chlorhexidine and about 50-60 percent denatured alcohol, which is scrubbed onto and then rinsed off the skin.
European Patent Application 0604 848 discloses a gel comprising an antimicrobial agent, 40-90 percent by weight of an alcohol, and a polymer and thickening agent.
U.S. Pat. No. 4,956,170 by Lee, issued Sep. 11, 1990 relates to a high alcohol content antimicrobial gel composition which comprises various emollients and a humectant to protect the skin from the drying effects of the alcohol. In alcohol formulations, higher levels of alcohol are needed to provide instant kill against sensitive as well as resistant strains of bacteria.
Certain formulations virtually omit alcohol as a primary antimicrobial agent, such as, for example, the skin sanitizing compositions disclosed in U.S. Pat. No. 6,187,327 by Stack, issued Feb. 13, 2001, which comprises triclosan (2,4,4′-trichloro-2′-hydroxydiphenyl ether; concentration 0.1-0.35 weight percent) in a topical lotion comprised of a surfactant phase and a wax phase, which purportedly provides antimicrobial protection for 3-4 hours after application. The composition prepared according to the claims of U.S. Pat. No. 6,187,327 further comprises chlorhexidine digluconate.
U.S. Pat. No. 5,965,610 by Modak et al., issued Oct. 12, 1999, teaches skin cleaning compositions comprising antimicrobial agents and zinc salts, where zinc salts have a soothing effect on the skin. The claimed subject matter includes formulations comprising a gel formed between zinc gluconate, chlorhexidine gluconate and a solvent, to which various thickening agents, emulsifying agents and/or emollients may be added.
U.S. Pat. No. 5,985,918 by Modak et al., issued Nov. 16, 1999, relates to “Zinc-Based Anti-Irritant Creams”.
U.S. Pat. No. 5,705,532 by Modak et al., issued Jan. 6, 1998, relates to “Triple Antimicrobial Compositions” comprising less than or equal to two percent of a chlorhexidine compound, less than or equal to 0.1 percent of a quaternary ammonium compound, and less than or equal to two percent parachlorometaxylenol.
Octoxyglycerin, sold under the trade name Sensiva® SC50 (Schulke & Mayr), is a glycerol alkyl ether known to be gentle to the skin. Octoxyglycerine exhibits antimicrobial activity against a variety of Gram-positive bacteria associated with perspiration odor, such as Micrococcus luteus, Corynebacterium aquaticum, Corynebacterium flavescens, Corynebacterium callunae, and Corynebacterium nephredi, and is used in various skin deodorant preparations at concentrations between about 0.2 and 3 percent (Sensiva® product literature, Schulke & Mayr).
For example, U.S. Pat. No. 5,885,562 by Lowry et al., issued Mar. 23, 1999, relates to deodorant compositions comprising an antimicrobial agent, namely polyhexamethylene biguanide (at a concentration of between 0.01 and 0.5 percent), together with a polarity modifier such as Sensiva®SC50, at levels of typically 1-15 percent. Compositions disclosed in U.S. Pat. No. 5,885,562 may further comprise a short chain monohydric alcohol such as ethanol at a level of between 20 and 80 percent. Formulations useful as deodorants, however, would differ from those used as skin sanitizers in that skin sanitizers would optimally exhibit rapid broad spectrum activity against bacteria, fungi, and viruses, not merely gram positive odor causing bacteria.
U.S. Pat. No. 5,516,510 by Beilfuss et al., issued May 14, 1996, discloses deodorant compositions which comprise glycerin monoalkyl ethers such as octoxyglycerin (referred to therein as 2-ethyl hexyl glycerin ether, and as being the most preferred among these compounds). The deodorant compositions of U.S. Pat. No. 5,516,510 may be formulated in aqueous and/or alcoholic solutions and may further comprise additional antimicrobial compounds, including triclosan, chlorhexidine salts, alexidine salts, and phenoxyethanol, among others. Specific concentration ranges for triclosan and the biguanides are not provided. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.