content
stringlengths 7
2.61M
|
---|
<gh_stars>1-10
import { BaseStyle, DefaultProps, mode, Sizes } from "@chakra-ui/theme-tools"
const register = {
parts: ["icon", "container"],
sizes: ["sm", "md", "lg"],
} as const
const baseStyle: BaseStyle<typeof register> = (props) => {
return {
icon: {},
container: {
borderRadius: "md",
transition: "all 0.2s",
_disabled: {
opacity: 0.4,
cursor: "not-allowed",
boxShadow: "none",
},
_hover: {
bg: mode(`blackAlpha.100`, `whiteAlpha.100`)(props),
},
_active: {
bg: mode(`blackAlpha.200`, `whiteAlpha.200`)(props),
},
_focus: {
boxShadow: "outline",
},
},
}
}
const sizes: Sizes<typeof register> = {
lg: {
container: { width: "40px", height: "40px" },
icon: { fontSize: "16px" },
},
md: {
container: { width: "32px", height: "32px" },
icon: { fontSize: "12px" },
},
sm: {
container: { width: "24px", height: "24px" },
icon: { fontSize: "10px" },
},
}
const defaultProps: DefaultProps<typeof register> = {
size: "md",
}
const closeButton = {
register,
defaultProps,
baseStyle,
sizes,
}
export default closeButton
|
Evaluation of an interprofessional multimedia musculoskeletal examination teaching resource: a qualitative study Background Interprofessional education (IPE) has been used more frequently in the last thirty years to encourage collaborative teamwork within healthcare. Objectives The aims of this study were primarily to assess the impact of multimedia instruction on musculoskeletal clinical examination (MCE) skill acquisition. Secondly, to evaluate students' perceptions of the value of IPE and multi disciplinary team (MDT) work. Method A survey was administered to a purposively sampled group of postgraduate students, comprising medical practitioners and physiotherapists (n=26). The sample was diverse in age, speciality, and MDT and IPE experience. The intervention was four sports injury assessment DVDs made by expert clinicians modelling high level interprofessional team working, made specifically for use in the study. Postintervention semi-structured interviews, conducted with a sample from the survey group (n=10) until data saturation occurred, were audio-recorded and analysed by thematic content analysis. Results An 85% survey response rate was obtained. 46% of the group described their competence in MCE as developing skills and 50% described having some experience. Attitudes towards IPE and MDT work were highly positive; overriding beliefs were that they benefited practice by affording a range of learning opportunities. Interview analysis revealed five main themes: a real time approach with expert instruction; multiple perspectives; and diversity within the cohort; changing behaviour by improving MCE technique and enhancing interactive skills. Overriding beliefs were that observing and learning from different experts' skilful examination under real time conditions was perceived as largely beneficial across the whole group. Conclusion This study provides evidence that interprofessional learning among postgraduate students can result in skill development such as advanced assessments skills. Furthermore, the DVDs improved students' appreciation of IPE, healthcare teamwork, and awareness of other disciplines. The use of DVD learning tools to teach and assist with the delivery of MCE and IPE warrants further investigation. |
Q:
Dehydrating herbs - leaves vs. stems
I use my dehydrator to dehydrate herbs such as parsley and dill. I use low temperature (95 F = 35 C) to preserve the taste. The dark-green leaves are usually completely dry after several hours, but the light-green stems remain slightly wet.
At one time, I made the mistake of putting everything together in a jar; it caught the mold in several days and I had to trash it.
I tried to cut the stems from the leaves and dehydrate them separately, but it turned out to be a very tedious task as each piece has a different length so I had to cut each piece separately.
A:
Don't dry the stems is the answer, simply discard them. I strip the leaves off the stems either before or after drying for the same reasons you describe - they don't dry well. For many herbs there isn't as much flavor in the stems as the leaves, so less value in drying them anyway.
A:
Both parsley and dill has a lot of flavour in the stems.
Freezing is good, as suggested by Joe, but maybe chopping the stems with a machine/grinder prior to drying might help the process. Discard them if the stems are really woody of course. |
<reponame>GabrielSturtevant/mage<gh_stars>1000+
package mage.client.cards;
import mage.abilities.icon.CardIconRenderSettings;
import mage.cards.MageCard;
import mage.client.MagePane;
import mage.client.dialog.PreferencesDialog;
import mage.client.plugins.impl.Plugins;
import mage.client.util.ClientDefaultSettings;
import mage.util.DebugUtil;
import mage.view.CardView;
import org.apache.log4j.Logger;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
/**
* Popup panel for dragging cards drawing
*
* @author StravantUser, JayDi85
*/
public class CardDraggerGlassPane {
private static final Logger logger = Logger.getLogger(CardDraggerGlassPane.class);
private final DragCardSource source;
private DragCardTarget currentTarget;
private MageCard draggingCard; // original card that starting the dragging (full dragging cards keeps in currentCards)
private ArrayList<CardView> currentCards;
private JComponent draggingGlassPane;
private MageCard draggingDrawView; // fake card for drawing on glass pane
// processing drag events (moving and the end)
private MouseListener draggingMouseListener;
private MouseMotionListener draggingMouseMotionListener;
private boolean isDragging;
private Dimension cardDimension;
// This should not be strictly needed, but for some reason I can't figure out getDeepestComponentAt and
// getComponentAt do not seem to work correctly for our setup if called on the root MageFrame.
private MagePane eventRootPane; // example: deck editor pane
public CardDraggerGlassPane(DragCardSource source) {
this.source = source;
}
public void handleDragStart(MageCard card, MouseEvent cardEvent) {
// Start drag
if (isDragging) {
return;
}
isDragging = true;
// Record what we are dragging on
draggingCard = card;
// Pane for dragging drawing (fake card)
JRootPane currentRoot = SwingUtilities.getRootPane(draggingCard);
draggingGlassPane = (JComponent) currentRoot.getGlassPane();
draggingGlassPane.setLayout(null);
draggingGlassPane.setOpaque(false);
draggingGlassPane.setVisible(true);
if (DebugUtil.GUI_DECK_EDITOR_DRAW_DRAGGING_PANE_BORDER) {
draggingGlassPane.setBorder(BorderFactory.createLineBorder(Color.MAGENTA));
}
// Get root mage pane to handle drag targeting in
Component rootMagePane = draggingCard;
while (rootMagePane != null && !(rootMagePane instanceof MagePane)) {
rootMagePane = rootMagePane.getParent();
}
if (rootMagePane == null) {
throw new RuntimeException("CardDraggerGlassPane::beginDrag not in a MagePane?");
} else {
eventRootPane = (MagePane) rootMagePane;
}
// ENABLE drag moving and drag ending processing
if (this.draggingMouseMotionListener == null) {
this.draggingMouseMotionListener = new MouseMotionAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
handleDragging(e);
}
};
}
if (this.draggingMouseListener == null) {
this.draggingMouseListener = new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
handleDragEnd(e);
}
};
}
draggingCard.addMouseMotionListener(this.draggingMouseMotionListener);
draggingCard.addMouseListener(this.draggingMouseListener);
// Event to local space
MouseEvent glassEvent = SwingUtilities.convertMouseEvent(draggingCard.getMainPanel(), cardEvent, draggingGlassPane);
// Get the cards to drag
currentCards = new ArrayList<>(source.dragCardList());
// make a fake card to drawing (card's top left corner under the cursor)
Rectangle rectangle = new Rectangle(glassEvent.getX(), glassEvent.getY(), getCardDimension().width, getCardDimension().height);
draggingDrawView = Plugins.instance.getMageCard(currentCards.get(0), null, new CardIconRenderSettings(), getCardDimension(), null, true, false, PreferencesDialog.getRenderMode(), true);
draggingDrawView.setCardContainerRef(null); // no feedback events
draggingDrawView.update(currentCards.get(0));
draggingDrawView.setCardBounds(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
// disable mouse events from fake card
for (MouseListener l : draggingDrawView.getMouseListeners()) {
draggingDrawView.removeMouseListener(l);
}
for (MouseMotionListener l : draggingDrawView.getMouseMotionListeners()) {
draggingDrawView.removeMouseMotionListener(l);
}
draggingGlassPane.add(draggingDrawView);
// Notify the sounce
source.dragCardBegin();
// Update the target
currentTarget = null;
MouseEvent rootEvent = SwingUtilities.convertMouseEvent(draggingGlassPane, glassEvent, eventRootPane);
updateCurrentTarget(rootEvent, false);
}
private void handleDragging(MouseEvent e) {
// redraw fake card near the cursor
MouseEvent glassEvent = SwingUtilities.convertMouseEvent(draggingCard.getMainPanel(), e, draggingGlassPane);
draggingDrawView.setCardLocation(glassEvent.getX(), glassEvent.getY());
draggingDrawView.repaint();
// Convert the event into root coords and update target
MouseEvent rootEvent = SwingUtilities.convertMouseEvent(draggingCard.getMainPanel(), e, eventRootPane);
updateCurrentTarget(rootEvent, false);
}
private void handleDragEnd(MouseEvent e) {
// No longer dragging
isDragging = false;
// Remove custom listeners
draggingCard.removeMouseListener(this.draggingMouseListener);
draggingCard.removeMouseMotionListener(this.draggingMouseMotionListener);
// Convert the event into root coords
MouseEvent rootEvent = SwingUtilities.convertMouseEvent(draggingCard.getMainPanel(), e, eventRootPane);
// Remove the drag card
draggingGlassPane.remove(draggingDrawView);
draggingGlassPane.repaint();
// Let the drag source know
source.dragCardEnd(currentTarget);
// Update the target, and do the drop
updateCurrentTarget(rootEvent, true);
}
private void updateCurrentTarget(MouseEvent rootEvent, boolean isEnding) {
// event related to eventRootPane
Component mouseOver = SwingUtilities.getDeepestComponentAt(eventRootPane, rootEvent.getX(), rootEvent.getY());
while (mouseOver != null) {
if (mouseOver instanceof DragCardTarget) {
DragCardTarget target = (DragCardTarget) mouseOver;
MouseEvent targetEvent = SwingUtilities.convertMouseEvent(eventRootPane, rootEvent, mouseOver);
if (target != currentTarget) {
if (currentTarget != null) {
MouseEvent oldTargetEvent = SwingUtilities.convertMouseEvent(eventRootPane, rootEvent, (Component) currentTarget);
currentTarget.dragCardExit(oldTargetEvent);
}
currentTarget = target;
currentTarget.dragCardEnter(targetEvent);
}
if (isEnding) {
currentTarget.dragCardExit(targetEvent);
currentTarget.dragCardDrop(targetEvent, source, currentCards);
} else {
currentTarget.dragCardMove(targetEvent);
}
return;
}
mouseOver = mouseOver.getParent();
}
if (currentTarget != null) {
MouseEvent oldTargetEvent = SwingUtilities.convertMouseEvent(eventRootPane, rootEvent, (Component) currentTarget);
currentTarget.dragCardExit(oldTargetEvent);
}
currentTarget = null;
}
protected Dimension getCardDimension() {
if (cardDimension == null) {
cardDimension = new Dimension(ClientDefaultSettings.dimensions.getFrameWidth(), ClientDefaultSettings.dimensions.getFrameHeight());
}
return cardDimension;
}
public boolean isDragging() {
return isDragging;
}
}
|
Solar Airplane Attempting To Circumnavigate The Globe Takes Off From Tulsa, Okla.
Enlarge this image toggle caption Getty Images Getty Images
Solar Impulse 2, the experimental plane attempting to circumnavigate the world using only the sun's power, has taken off from Tulsa on the latest leg of its journey.
The team says the flight to Dayton, Ohio — the 12th stage of the journey around the globe — is expected to take 18 hours, landing at approximately 11p.m. local time.
They're aiming to promote clean energy. "We have built an experimental aircraft that we use to explore not only altitudes, but also unknown territories within the realm of clean technology and creative team building," the team has said.
Time to board! #Si2 is like an old friend and each flight we do together to prove #futureisclean is magical ☀️ pic.twitter.com/pViroiclYX — André Borschberg (@andreborschberg) May 21, 2016
Swiss pilots Bertrand Piccard and Andre Borschberg alternate legs of the aircraft, with Borschberg at the controls during today's flight over the U.S. He's been tweeting during his journey, including this snapshot of the sun rising over Oklahoma.
On board of @solarimpulse enjoying sun rise over oklahoma pic.twitter.com/pssrBy5yfG — André Borschberg (@andreborschberg) May 21, 2016
Borschberg also paid tribute to the Wright Brothers – the famed aviation pioneers who hailed from today's destination, Dayton. He also notes that "today is a great day as 89 years ago, Charles Lindbergh landed in Paris Le Bourget. A very special moment for me."
.@WrightBrosNPS had the mindset to try w/o the fear of failing to make the impossible possible like we did with #Si2 pic.twitter.com/zFYGM6zFcW — André Borschberg (@andreborschberg) May 21, 2016
You can follow a live stream of the journey here:
The aircraft has a wingspan wider than a Boeing 747 but weighs no more than a mid-sized car. It doesn't handle well in gusty winds. The team says it "spent a week in Tulsa International Airport until they found a clear weather window to allow them to continue their flights across the U.S."
As The Two-Way has reported, "the fuel-free flight project started in March 2015, but it was put on hold in July after the plane's batteries developed problems during a five-day flight from Japan to Hawaii. It resumed its journey last month, completing a three-day trip from Hawaii to Mountain View, Calif." |
Fogenabled vehicular networks: A new challenge for mobility management With the increasing presence of latencycritical applications and services along with the high demand for ubiquitous connectivity, a new challenge arise in the design of the next generation of vehicular networks. The requirements of low latency services and powerful computational functionalities have decreased the performance of cloud centers, being unable to satisfy the fast growing number of vehicles on roads and road assistance based applications. Vehicular Fog Networks is an emerging network architecture that elevates the burden on the cloud and shifts Cloud services to the edge of the network. However, the integration of fogcomputing and vehicular networks raises several issues and challenges, including mobility management. In this paper, we provide insights into the latest solutions for mobility management protocols in fogenabled vehicular networks. Then, we explore related open issues and point out future research directions. |
Engineers who landed the Curiosity rover on Mars recall their early love of space.
For Jet Propulsion Laboratory (JPL) engineers, Curiosity's landing represented the culmination of many years of hard work and personal aspiration. In this video, they trace their love of space back to their childhood and express their gratitude for being given the opportunity to put a rover on Mars.
Jaime Waydo (Mobility Lead, MSL): All I've ever wanted to do since I was in eighth grade is send something to Mars.
Steve Lee (Control Systems Manager, MSL): My passion for space was ignited when Apollo 11 landed on the moon on my seventh birthday. Uh, when I was growing up I never went through the 'what do you want to be when you grow up.' I always knew it was space, space, space.
Rob Manning (Chief Engineer, MSL): I was growing up during the time of the Mercury, Gemini, and Apollo era. The future was coming true before my very eyes.
Ashwin Vasavada (Deputy Project Scientist, MSL): I think I've known that I wanted to be a planetary scientist since I was about nine or ten years old.
Daniel Limonadi (Surface Sampling Lead, MSL): I've been a space geek since probably I was four or eight years old or something like that.
Jamie Waydo (Mobility Lead, MSL): Going to Mars is like the new frontier. You know, we don't have Lewis and Clark exploration kind of events here on Earth as much anymore, and so we get to do that.
Rob Manning (Chief Engineer, MSL): When the first possibility of landing a little rover and bouncing it in airbags around the surface of Mars came up I was… oh… so excited about the idea.
Jaime Waydo (Mobility Lead, MSL): To get to send things to Mars, it's everything I've dreamed of since eighth grade.
Additional funding for "Ultimate Mars Challenge" is provided by Millicent Bell, through the Millicent and Eugene Bell Foundation. |
/**
* Joins this process to a group. Determines the coordinator and sends a
* unicast handleJoin() message to it. The coordinator returns a JoinRsp and
* then broadcasts the new view, which contains a message digest and the
* current membership (including the joiner). The joiner is then supposed to
* install the new view and the digest and starts accepting mcast messages.
* Previous mcast messages were discarded (this is done in PBCAST).
* <p>
* If successful, impl is changed to an instance of ParticipantGmsImpl.
* Otherwise, we continue trying to send join() messages to the coordinator,
* until we succeed (or there is no member in the group. In this case, we
* create our own singleton group).
* <p>
* When GMS.disable_initial_coord is set to true, then we won't become
* coordinator on receiving an initial membership of 0, but instead will
* retry (forever) until we get an initial membership of > 0.
*
* @param mbr Our own address (assigned through SET_LOCAL_ADDRESS)
*/
protected void joinInternal(Address mbr, boolean joinWithStateTransfer,boolean useFlushIfPresent) {
JoinRsp rsp=null;
Address coord=null;
long join_attempts=0;
leaving=false;
join_promise.reset();
while(!leaving) {
if(rsp == null && !join_promise.hasResult()) {
List<PingData> responses=findInitialMembers(join_promise);
if (responses == null)
throw new NullPointerException("responses returned by findInitialMembers for " + join_promise + " is null");
if(join_promise.hasResult()) {
rsp=join_promise.getResult(gms.join_timeout);
if(rsp != null)
continue;
}
if(responses.isEmpty()) {
log.trace("%s: no initial members discovered: creating cluster as first member", gms.local_addr);
becomeSingletonMember(mbr);
return;
}
log.trace("%s: initial_mbrs are %s", gms.local_addr, print(responses));
coord=determineCoord(responses);
if(coord == null) {
if(gms.handle_concurrent_startup == false) {
log.trace("handle_concurrent_startup is false; ignoring responses of initial clients");
becomeSingletonMember(mbr);
return;
}
log.trace("%s: could not determine coordinator from responses %s", gms.local_addr, responses);
SortedSet<Address> clients=new TreeSet<Address>();
clients.add(mbr);
for(PingData response: responses)
clients.add(response.getAddress());
log.trace("%s: clients to choose new coord from are: %s", gms.local_addr, clients);
Address new_coord=clients.first();
if(new_coord.equals(mbr)) {
log.trace("%s: I (%s) am the first of the clients, will become coordinator", gms.local_addr, mbr);
becomeSingletonMember(mbr);
return;
}
log.trace("%s: I (%s) am not the first of the clients, waiting for another client to become coordinator",
gms.local_addr, mbr);
Util.sleep(500);
continue;
}
log.debug("%s: sending JOIN(%s) to %s", gms.local_addr, mbr, coord);
sendJoinMessage(coord, mbr, joinWithStateTransfer, useFlushIfPresent);
}
if(rsp == null)
rsp=join_promise.getResult(gms.join_timeout);
if(rsp == null) {
join_attempts++;
log.warn("%s: JOIN(%s) sent to %s timed out (after %d ms), on try %d",
gms.local_addr, mbr, coord, gms.join_timeout, join_attempts);
if(gms.max_join_attempts != 0 && join_attempts >= gms.max_join_attempts) {
log.warn("%s: too many JOIN attempts (%d): becoming singleton", gms.local_addr, join_attempts);
becomeSingletonMember(mbr);
return;
}
continue;
}
if(!isJoinResponseValid(rsp)) {
rsp=null;
continue;
}
log.trace("%s: JOIN-RSP=%s [size=%d]\n\n", gms.local_addr, rsp.getView(), rsp.getView().size());
if(!installView(rsp.getView(), rsp.getDigest())) {
log.error("%s: view installation failed, retrying to join cluster", gms.local_addr);
rsp=null;
continue;
}
Message view_ack=new Message(coord).setFlag(Message.Flag.OOB, Message.Flag.INTERNAL)
.putHeader(gms.getId(), new GMS.GmsHeader(GMS.GmsHeader.VIEW_ACK));
gms.getDownProtocol().down(new Event(Event.MSG, view_ack));
return;
}
} |
DP-SGD vs PATE: Which Has Less Disparate Impact on GANs? Generative Adversarial Networks (GANs) are among the most popular approaches to generate synthetic data, especially images, for data sharing purposes. Given the vital importance of preserving the privacy of the individual data points in the original data, GANs are trained utilizing frameworks with robust privacy guarantees such as Differential Privacy (DP). However, these approaches remain widely unstudied beyond single performance metrics when presented with imbalanced datasets. To this end, we systematically compare GANs trained with the two best-known DP frameworks for deep learning, DP-SGD, and PATE, in different data imbalance settings from two perspectives -- the size of the classes in the generated synthetic data and their classification performance. Our analyses show that applying PATE, similarly to DP-SGD, has a disparate effect on the under/over-represented classes but in a much milder magnitude making it more robust. Interestingly, our experiments consistently show that for PATE, unlike DP-SGD, the privacy-utility trade-off is not monotonically decreasing but is much smoother and inverted U-shaped, meaning that adding a small degree of privacy actually helps generalization. However, we have also identified some settings (e.g., large imbalance) where PATE-GAN completely fails to learn some subparts of the training data. Introduction Generative machine learning models, and in particular Generative Adversarial Networks (GANs), have received increasing attention from both researchers and government organizations [5, as a promising solution to the individual-level data sharing problem. The underlying idea is to train generative models to learn the distribution of the (real) data, generate new high-quality (synthetic) samples from the trained model, and release synthetic, rather than real, data. However, recent research has shown that generative models, including GANs, may leak sensitive information about the training samples through overfitting and memorization as well as susceptibility to privacy attacks such as membership inference attacks. The state-of-the-art approach to protect against such vulnerabilities is training the models to satisfy Differential Privacy (DP). DP mechanisms protect against attempts to infer the inclusion of any record in the training data by bounding their individual contribution, usually through perturbation. In this paper, we will focus on the two most widely used DP techniques for training deep learning models -DP-SGD and PATE. Even though DP mechanisms guarantee rigorous privacy protection, they degrade the performance of the model. Furthermore, this accuracy drop is likely to be disparate, affecting the underrepresented subpopulations of the data disproportionately more. For example, in the case of deep learning classifiers empirically illustrate the disparate degradation caused by DP-SGD. However, comparisons between DP-SGD and PATE are still relatively unstudied in this light, with Uniyal et al. doing so for classifiers, and more recently, Ganev et al. demonstrating the said effects in generative models trained on imbalanced tabular data. To fill this gap, we set out to examine and compare two GAN models trained with DP guarantees (DP-WGAN and PATE-GAN) on imbalanced image data (MNIST) in several imbalance settings. Research Question. Does applying DP-SGD and PATE to GANs lead to similar disparate effects when trained on imbalanced data, or more specifically, on the minority and majority classes in terms of size and accuracy of the resulting synthetic data? Main Findings. Our experiments could be summarized to: Overall, both models exhibit disparity in terms of size and accuracy, but the effects are much smaller for PATE-GAN. Furthermore, PATE-GAN offers a much better privacy-utility trade-off and performs better even for tight privacy budgets (0.5). We believe this is due to the teacher-discriminators setup. In terms of size, the two models behave in opposite directions with increased privacy -DP-WGAN "evens" the classes while PATE-GAN increases the imbalance. In the presence of a single highly imbalanced class ("8" reduced to 10% its original size), PATE-GAN fails to learn the whole subpopulation. This is not the case for DP-WGAN. Applying some degree of privacy actually serves as regularization to PATE-GAN and helps the performance up to a point, unlike DP-WGAN, for which any privacy protection deteriorates the utility. Preliminaries In this section, we present some background on DP, GANs, and the two generative models used in our experiments. Differential Privacy (DP) A randomized algorithm A satisfies (, )-DP if and only if, for any two adjacent datasets D 1 and D 2 (differing in a single record), and all possible outputs S of A, the following holds : Put simply, one cannot distinguish whether any individual's data was part of the input dataset from observing the algorithm's output. The privacy budget denotes the level of indistinguishability while is a probability of privacy failure. We focus on the two most widely used DP techniques for deep learning -DP-SGD and PATE. Generative Adversarial Networks (GANs) A GAN is a deep learning model consisting of two neural networks, a generator, and a discriminator. They "compete" against each other in a min-max "game", the former produces synthetic data while the latter distinguishes real from generated samples until they reach equilibrium. DP-WGAN. DP-WGAN utilizes DP-SGD in place of the standard SGD during training. DP-SGD guarantees privacy by bounding the individual gradients (using clipping and perturbation) of the discriminator and relying on the moments accountant method to track the overall privacy budget. Furthermore, the model uses the WGAN architecture to improve stability during training. PATE-GAN. PATE-GAN modifies the PATE framework for training GANs. The model replaces the standard single discriminator with k teacher-discriminators, trained on disjoint partitions of the real data. In turn, the standard student model is replaced by a student-discriminator trained on noisy (real/synthetic) labels predicted by the teachers. The noisy aggregation is where DP guarantees the privacy protection. Also, the proposed model eliminates the need for publicly available data. Even though both DP-WGAN and PATE-GAN were initially proposed for tabular data given the remarkable success of GANs on images, we decided not to adjust their architectures. Experimental Evaluation In this section, we explain our evaluation methodology and discuss the experimental findings. Evaluation Methodology We run all of our experiments on MNIST and imbalance the class "8" to maintain consistency with. First, since the classes are slightly imbalanced, we get rid of all images per class exceeding 5,000. Then, we imbalance the dataset, making "8" the minority/majority class in one of the following three settings 1 : 1. Minority -undersample "8" to 10%/25% its original size while keeping the other classes balanced. 3. Mixed -turn "8" into minority/majority class by making it 25% of the largest/smallest class and randomly imbalance all other classes in a uniformly decreasing manner. We train 5 DP-WGAN and PATE-GAN models for each setting, generate 5 synthetic datasets with a size equal to the input data (per trained model) and report mean and standard deviations. We experiment with privacy budgets ( ) of 0.5, 5, 15, and infinity ("non-DP"). We measure the class distributions in the resulting synthetic datasets as well as class recall from classifiers (logistic regression similar to ) trained on the real/synthetic data and tested on put-aside test data. We also report RMSE for sizes and truncated 2 RMSE (TRMSE) for recall weighted by the real sizes in App. B. A summary of the privacy-utility trade-off for both models in all settings is plotted in Fig. 5. Last, for PATE-GAN in all settings, we also experiment with a different number of teachers -1, 10, 50, and 100. We use the same hyperparameters as the original implementations and set = 10 −5 for all experiments. Minority Class Results We observe the results in Fig. 1 and Tab. 3. Overall, PATE-GAN exhibits far better performance for both imbalances -it preserves the counts even for lower budgets, the recall drop is not so acute, and its standard deviation is much lower. DP-WGAN recall looks random for = 0.5, which means that the classifiers failed to learn anything, most likely due to bad quality of the synthetic data. Looking at the minority class "8", however, PATE-GAN fails to generate any digits for imbalance 10%. Surprisingly, this phenomenon occurs in the "non-DP" case as well. This could be because the teachers fail to pass samples "8" classified as real to the student even though when applied to classification, PATE is more robust under similar imbalance levels. While expectedly DP-WGAN's performance monotonically drops both in terms of size and recall with decreasing, PATE-GAN's performance actually increases when DP is applied, e.g., = 15 and 5 yield better results than "non-DP" in terms of size for both imbalances and in terms of recall for imbalance 10%. This is most likely due to the fact that the teacher-discriminators are exposed to different subsets of the real data, and as result, do not learn exactly the same distributions as well as the noise added to their votes, which further enables generalization. Majority Class Results The results are in Fig. 2 and Tab. 4. For DP-WGAN, there is a significant drop in recall for all undersampled digits, even for the "non-DP" case, unlike PATE-GAN, which again has a very stable behavior. In terms of size, PATE-GAN generates more imbalanced datasets by producing more "8s" and uniformly fewer other digits for all budgets but again achieves better results for = 15 than "non-DP". Unlike the minority class setting, no classes "disappear" when the imbalance is increased from 25% to 10%. For DP-WGAN, increasing the imbalance leads to much worse performance, which allows us to speculate that PATE-GAN needs smaller training data to capture the underlying distribution and is more robust to imbalance. Interestingly, some digits suffer a lot more in terms of recall than others (e.g., "2," "5," "9"), which could be explained because they are visually close to "8" but their sizes are much smaller. Mixed Class Results The results are displayed in Fig. 3 and Tab. 5. First, we note that with increased privacy PATE-GAN, again, has much lower variability/spread in terms of size and a smaller drop in terms of recall. We also clearly observe the opposing size effects the two generative models exhibit, similarly to -DP-WGAN makes the classes more uniform, i.e., large classes are reduced, and small classes are increased, while PATE-GAN further enforces the imbalance, large classes become even bigger. In terms of recall, the performance of PATE-GAN for all privacy budgets drops slightly in a uniform manner across all classes and actually exceeds the "non-DP" DP-WGAN. This observation hints that underrepresented groups do not suffer unequally under the PATE framework when the imbalance is not severe. As for DP-WGAN, the size seems to be an important factor as for = 15 smaller classes bear more considerable drop, which is in agreement with previous work. Recall for = 0.5 looks random. Number of Teacher-Discriminators Results Here, we repeat all the experiments for PATE-GAN with = 5 in the three settings (Minority, Majority, Mixed) but vary the number of teacher-discriminators. The results can be seen in Fig. 4 and Tab. 6. Overall, we observe that the best performance is achieved when we set the number of teachers to 10 or 50, with some small exceptions. This behavior is fully expected and in line with previous work as having too few/many teachers could fail to generalize or learn at all. For instance, we see that when we have a single teacher, the standard deviation is much higher across the board. One in- teresting case is the Minority setting with imbalance 10% in Fig. 4b, where increasing the number of teachers improves performance, and we get the best results for 100. This still fails to generate any "8s", unfortunately. Related Work There is a rich body of research proposing GANs trained with DP guarantees in various domains. They are predominantly GANs variants utilizing modifications of DP-SGD, e.g., DPGAN for images and Electronic Health Records (EHR), dp-GAN and DP-CGAN for images, dp-GAN-TSCD for tabular and time series data, etc. In comparison, there are only a couple of models incorporation PATE into GANs -PATE-GAN and G-PATE which ensures DP for the generator by connecting a student generator with an ensemble of teacher discriminators. Fan provides a more in-depth survey of various DP GANs. Researchers have studied the disparate effects of DP mechanisms in different contexts. Kuppam et al. and Tran et al. demonstrate that if fund allocations are based on DP statistics, smaller districts could get more resources at the expense of larger ones, compared to what they would receive without DP. Prior work has also analyzed the disparate effects of DP-SGD applied to deep neural network classifiers trained on imbalanced datasets. They empirically demonstrate that the less represented subgroups in the dataset that suffer lower accuracy to start with lose even more utility when DP is applied. For example, Farrand et al. show that even small imbalances and loose privacy guarantees could lead to disparate impacts. Uniyal et al. find that CNNs trained with PATE suffer from disparate accuracy drops as well, but less severely than with DP-SGD. There are also papers focus-ing on learning DP classifiers with fairness constraints and on analyzing the PATE framework from a fairness point of view. While these efforts consider discriminative models, we examine generative ones. Finally, analyzing the DP disparity on generative models, Cheng et al. show that training classifiers on balanced DP synthetic images could result in increased majority subgroup influence and utility degradation. Focusing on tabular data, Pereira et al. look at single-attribute subgroup fairness and overall classification while Ganev et al. analyze class as well as single/multi-attribute subgroup classification parity over a variety of imbalances and privacy budgets. They find that the disparate effects of DP could be opposing depending on the specific generative model and DP mechanism. Our work is perhaps closest in spirit to but we focus on generative models unlike the former and use image data and have a more disciplined approach to constructing the class imbalances, unlike the latter. Conclusion Through our extensive experiments and analysis, we demonstrate that applying DP methods to GANs to preserve the privacy of the data records could lead to disparate effects on class distributions in the generated synthetic data and the performance of downstream tasks. Overall, PATE exhibits a more desirable behavior than DP-SGD, better privacy-utility tradeoff, and while, unfortunately, it still disproportionately affects the minority subparts of the data, it does so to a less severe extend. A Balanced Class Results In this section, we experiment with balanced settings (i.e., we do not artificially imbalance the dataset) to serve as a baseline for the imbalanced settings. The results are displayed in Fig. 6 and 7 as well as Tab. 1 and 2. In short, yet again, PATE-GAN performs better than DP-WGAN -it manages to keep the class size balance and utility with increased privacy and has a much lower deviation. Unlike all other settings, even for the "non-DP" case, the size RMSE on synthetic data produced by PATE-GAN is smaller than DP-WGAN. Interestingly, even with no imbalance, PATE-GAN still benefits from applying a small privacy budget (e.g., = 15). Similarly to 3.3, for PATE-GAN, the classes that suffer from the biggest accuracy drop with increased privacy are the ones that are visually similar to each other, "5", "8", "9", and "2". These observations allow us to speculate that the issues and effects observed in Sec. 3 are not only due to the class imbalance but are magnified by it. Imbalance Balanced no-DP 15 Table 6: Class size RMSE and recall TRMSE summary corresponding to Sec. 3.5 and Fig. 4. |
import logging
import logging.config
import shutil
import sys
from pathlib import Path
import requests
from PIL import Image, ImageDraw, ImageFont
def download_image(survey_url, star_ra, star_dec, logger, base_image):
"""Downloads the HiPS image.
This research made use of hips2fits,
(https://alasky.u-strasbg.fr/hips-image-services/hips2fits)
a service provided by CDS."""
response = requests.get(
url="http://alasky.u-strasbg.fr/hips-image-services/hips2fits",
params={
"hips": survey_url,
"width": 1000,
"height": 1000,
"fov": 0.25,
"projection": "TAN",
"coordsys": "icrs",
"ra": star_ra,
"dec": star_dec,
"format": "jpg",
"stretch": "linear",
},
stream=True,
)
logger.debug("Tried %s", response.url)
if response.status_code < 400:
logger.debug("HTTP response: %s", response.status_code)
with open(base_image, "wb") as out_file:
shutil.copyfileobj(response.raw, out_file)
logger.info("Saved the image to %s", base_image)
del response
else:
logger.error("BAD HTTP response: %s", response.status_code)
logger.error("%s", response.json()["title"])
logger.error("Did not get the sky image. Quitting.")
sys.exit("Did not get the sky image. Quitting.")
def get_best_survey(avail_hips, wanted_surveys, star_dec):
"""This ranks the avaiable HIPS in order of preference."""
rankings = dict(zip(wanted_surveys, range(len(wanted_surveys))))
# The PanSTARRS MOC is wrong and you get blank images for stars south of -29.5.
# So make the PanSTARRS ranking really low for those stars.
if star_dec < -29.5:
rankings["CDS/P/PanSTARRS/DR1/color-z-zg-g"] = 999
best_survey_id = wanted_surveys[
min([rankings[avail_hip["ID"]] for avail_hip in avail_hips])
]
return list(filter(lambda x: x["ID"] == best_survey_id, avail_hips))[0]
def add_overlay(
base_image, secrets_dict, logger, tweet_content_dir, BEST_NAME, survey_name
):
# Necessary to force to a string here for the ImageFont bit.
font = ImageFont.truetype(
str(Path.joinpath(Path(secrets_dict["font_dir"]), "Roboto-Bold.ttf")), 40
)
try:
img_sky = Image.open(base_image)
except FileNotFoundError as e:
logger.error(e)
logger.error("Could not load the sky image. Quitting.")
sys.exit("Could not load the sky image. Quitting.")
logger.info("Adding the overlay")
draw = ImageDraw.Draw(img_sky, "RGBA")
draw.line([((500 - 80), 500), ((500 - 20), 500)], fill="white", width=5)
draw.line([(500, (500 + 80)), (500, (500 + 20))], fill="white", width=5)
draw.line(
[(815, (1000 - 70)), (815 + 1000 / 15 * 2, (1000 - 70))], fill="white", width=5
)
draw.text((30, 10), f"{BEST_NAME}", (255, 255, 255), font=font)
draw.text((30, (1000 - 60)), f"{survey_name}", (255, 255, 255), font=font)
draw.text((800, (1000 - 60)), "2 arcmin", (255, 255, 255), font=font)
overlayed_image = Path.joinpath(tweet_content_dir, "sky_image_overlay.jpg")
img_sky.save(overlayed_image)
logger.info("Saved overlayed image to %s", overlayed_image)
def get_hips_image(star_ra, star_dec, BEST_NAME, secrets_dict):
"""Main function to get a sky image for the given star."""
cwd = Path(__file__).parent
tweet_content_dir = Path.joinpath(cwd, "tweet_content")
config_file = Path.joinpath(cwd, "logging.conf")
logging.config.fileConfig(config_file)
# create logger
logger = logging.getLogger("get_images")
base_image = Path.joinpath(tweet_content_dir, "sky_image.jpg")
wanted_surveys = [
"CDS/P/DECaLS/DR5/color",
"cds/P/DES-DR1/ColorIRG",
"CDS/P/PanSTARRS/DR1/color-z-zg-g",
"CDS/P/SDSS9/color-alt",
"CDS/P/DSS2/color",
]
logger.info("Getting the list of useful HIPS")
response = requests.get(
url="http://alasky.unistra.fr/MocServer/query",
params={
"fmt": "json",
"RA": star_ra,
"DEC": star_dec,
"SR": 0.25,
"intersect": "enclosed",
# "dataproduct_subtype":"color",
"fields": ",".join(["ID", "hips_service_url", "obs_title"]),
"creator_did": ",".join([f"*{i}*" for i in wanted_surveys]),
},
)
if response.status_code < 400:
logger.debug("HTTP response: %s", response.status_code)
avail_hips = response.json()
for possible_survey in avail_hips:
logger.debug("Possible HIPS options: %s", possible_survey["ID"])
best_survey = get_best_survey(avail_hips, wanted_surveys, star_dec)
logger.info("The best ranking survey is: %s", best_survey["ID"])
download_image(
best_survey["hips_service_url"], star_ra, star_dec, logger, base_image
)
del response
else:
logger.error("BAD HTTP response: %s", response.status_code)
logger.error("%s", response.json()["title"])
logger.error("Did not get list of HIPS. Quitting.")
sys.exit("Did not get list of HIPS. Quitting.")
image_source = " ".join(best_survey["ID"].split("/")[2:])
add_overlay(
base_image, secrets_dict, logger, tweet_content_dir, BEST_NAME, image_source
)
return image_source
|
<filename>threadbase02/src/main/java/com/roily/synchronizedDemo/SynchronizedDeom01.java
package com.roily.synchronizedDemo;
/**
* descripte:
*
* @author: RoilyFish
* @date: 2022/3/15
*/
public class SynchronizedDeom01 {
//共享数据
private static Integer a = 0;
public static void main(String[] args) throws InterruptedException {
for (int i = 0; i < 100; i++) {
new Thread(()->{
for (int j = 0; j < 100; j++) {
a++;
}
}).start();
}
//保证非main线程先执行
Thread.sleep(1000);
System.out.println(a);
}
}
|
package io.parallec.core.main.http;
import io.parallec.core.FilterRegex;
import io.parallec.core.ParallecResponseHandler;
import io.parallec.core.ParallelClient;
import io.parallec.core.ParallelTask;
import io.parallec.core.ResponseOnSingleTask;
import io.parallec.core.TestBase;
import io.parallec.core.util.PcDateUtils;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.util.Asserts;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class ParallelClientHttpFromCmsAsyncTest extends TestBase {
private static ParallelClient pc;
@BeforeClass
public static void setUp() throws Exception {
pc = new ParallelClient();
}
@AfterClass
public static void shutdown() throws Exception {
pc.releaseExternalResources();
}
/**
* With CMS query; async timeout 15 seconds
* Added token
*/
@Test(timeout = 15000)
public void hitCmsQuerySinglePageWithoutTokenAsync() {
// http://ccoetech.ebay.com/cms-configuration-management-service-based-mongodb
String cmsQueryUrl = URL_CMS_QUERY_SINGLE_PAGE;
ParallelTask pt = pc.prepareHttpGet("/validateInternals.html")
.setTargetHostsFromCmsQueryUrl(cmsQueryUrl, "label")
.setConcurrency(1700).async()
.execute(new ParallecResponseHandler() {
@Override
public void onCompleted(ResponseOnSingleTask res,
Map<String, Object> responseContext) {
String cpu = new FilterRegex(
".*<td>CPU-Usage-Percent</td>\\s*<td>(.*?)</td>[\\s\\S]*")
.filter(res.getResponseContent());
String memory = new FilterRegex(
".*<td>Memory-Used-KB</td>\\s*<td>(.*?)</td>[\\s\\S]*")
.filter(res.getResponseContent());
Map<String, Object> metricMap = new HashMap<String, Object>();
metricMap.put("CpuUsage", cpu);
metricMap.put("MemoryUsage", memory);
metricMap.put("LastUpdated",
PcDateUtils.getNowDateTimeStrStandard());
metricMap.put("NodeGroupType", "OpenSource");
logger.info("cpu:" + cpu + " host: " + res.getHost());
}
});
logger.info(pt.toString());
Asserts.check(pt.getRequestNum() == 3, "fail to load all target hosts");
while (!pt.isCompleted()) {
try {
Thread.sleep(100L);
System.err.println(String.format("POLL_JOB_PROGRESS (%.5g%%)",
pt.getProgress()));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
/**
* With CMS query; async timeout 15 seconds
* Added token
*/
@Test(timeout = 15000)
public void hitCmsQuerySinglePageWithTokenAsync() {
// http://ccoetech.ebay.com/cms-configuration-management-service-based-mongodb
String cmsQueryUrl = URL_CMS_QUERY_SINGLE_PAGE;
ParallelTask pt = pc.prepareHttpGet("/validateInternals.html")
.setTargetHostsFromCmsQueryUrl(cmsQueryUrl, "label", "someToken")
.setConcurrency(1700).async()
.execute(new ParallecResponseHandler() {
@Override
public void onCompleted(ResponseOnSingleTask res,
Map<String, Object> responseContext) {
String cpu = new FilterRegex(
".*<td>CPU-Usage-Percent</td>\\s*<td>(.*?)</td>[\\s\\S]*")
.filter(res.getResponseContent());
String memory = new FilterRegex(
".*<td>Memory-Used-KB</td>\\s*<td>(.*?)</td>[\\s\\S]*")
.filter(res.getResponseContent());
Map<String, Object> metricMap = new HashMap<String, Object>();
metricMap.put("CpuUsage", cpu);
metricMap.put("MemoryUsage", memory);
metricMap.put("LastUpdated",
PcDateUtils.getNowDateTimeStrStandard());
metricMap.put("NodeGroupType", "OpenSource");
logger.info("cpu:" + cpu + " host: " + res.getHost());
}
});
logger.info(pt.toString());
Asserts.check(pt.getRequestNum() == 3, "fail to load all target hosts");
while (!pt.isCompleted()) {
try {
Thread.sleep(100L);
System.err.println(String.format("POLL_JOB_PROGRESS (%.5g%%)",
pt.getProgress()));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
/**
* With CMS(YiDB) query; async timeout 15 seconds CMS Example:
* http://ccoetech
* .ebay.com/cms-configuration-management-service-based-mongodb
*/
@Test(timeout = 15000)
public void hitCmsQueryMultiPageAsync() {
String cmsQueryUrl = URL_CMS_QUERY_MULTI_PAGE;
ParallelTask pt = pc.prepareHttpGet("/validateInternals.html")
.setTargetHostsFromCmsQueryUrl(cmsQueryUrl)
.setConcurrency(1700).async()
.execute(new ParallecResponseHandler() {
@Override
public void onCompleted(ResponseOnSingleTask res,
Map<String, Object> responseContext) {
String cpu = new FilterRegex(
".*<td>CPU-Usage-Percent</td>\\s*<td>(.*?)</td>[\\s\\S]*")
.filter(res.getResponseContent());
String memory = new FilterRegex(
".*<td>Memory-Used-KB</td>\\s*<td>(.*?)</td>[\\s\\S]*")
.filter(res.getResponseContent());
Map<String, Object> metricMap = new HashMap<String, Object>();
metricMap.put("CpuUsage", cpu);
metricMap.put("MemoryUsage", memory);
logger.info("cpu:" + cpu + " memory: " + memory
+ " host: " + res.getHost());
Double cpuDouble = Double.parseDouble(cpu);
Asserts.check(cpuDouble <= 100.0 && cpuDouble >= 0.0,
" Fail to extract cpu values");
}
});
logger.info(pt.toString());
Asserts.check(pt.getRequestNum() == 3, "fail to load all target hosts");
while (!pt.isCompleted()) {
try {
Thread.sleep(100L);
System.err.println(String.format("POLL_JOB_PROGRESS (%.5g%%)",
pt.getProgress()));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
|
data=input().strip('{').rstrip('}').split(', ')
if data!=['']:
print(len(list(set(data))))
else:
print(0) |
Potential valorisation of agro-industrial wastewater for bioenergy production Agro-industries generate a high amount of solid waste, wastewater and emissions. In Indonesias case, many small and medium-scale agro-industries have problems in treating or in valorising their wastes. Specific to wastewater, due to lack of waste treatment facilities or financial support, as well as lack of policies enforcement, many agro-industries directly disposed of the wastewater to the river bodies. Such practices can have a detrimental effect on the environment due to the accumulation of both organic and an-organic pollutants. This study aimed to investigate the potential of various agro-industrial wastewater (i.e. batik wastewater, tofu-processing wastewater and tempeh-processing wastewater) from Malang City as single feedstock for biogas production. The biochemical methane potential (BMP) test was employed under a mesophilic condition and operated for 28 days. The results indicated that anaerobic digestion (AD) of tempeh-processing wastewater produced more biogas and methane potential compared to other wastewater samples. The specific methane potential (SMP) from the AD of tempeh-processing wastewater was 0.027 m3/kgVSadded. However, the energy potential calculation indicated that using these wastewater samples was not feasible as a single feedstock for an anaerobic digestion system. Therefore, combining with other potential biomass feedstock as co-substrates is recommended for further in-depth investigation. Introduction Small-and medium scale enterprise (SME) or agroindustry, either in food and non-food sectors, plays a key role in the Indonesian economy. However, many agro-industries in Indonesia still have problems of low environmental performance due to a lack of responsiveness in treating their solid waste or wastewater. For example, according to Tegarwati et al., cheese agro-industries often directly disposed of their wastewater (also known as whey) to the environment, which may lead to water pollution. In the case of tapioca agro-industries, their wastewater remained a big problem. Similarly, tofu and tempeh industries, producing popular and favoured products (i.e. tofu and tempeh), generated a large amount of wastewater, yet have inadequate wastewater treatment facilities. In non-food agroindustry sectors, batik industry may pose an example of small-scale industries which struggle to treat the dyes-containing wastewater due to lack of support from the financial, facilities, technology, and awareness aspects. Many of these agro-industries discharge their wastewater, which contains organic and chemical pollutants, to a nearby water body, thus causing a harmful effect to the surrounding environment. Therefore, treating and valorising agro-industrial wastewater remained critical to improve the effluent quality or to transform into high-value products. Nowadays, wastewater to energy is a more favourable option as the resulted energy can be reused for processing on-site, thus saving the energy used and reducing the operational costs. Therefore, this study aimed to investigate whether batik wastewater, tofu-and tempe-processing wastewater have the potential for bioenergy generation, such as biogas. Agro-industrial wastewater and inoculum Three types of agro-industrial wastewater collected from Malang City, include batik, tofu-processing and tempe-processing wastewater, were used in this study. Batik wastewater (BW) was freshly collected from Batik Blimbing Malang SME. Tofu-processing wastewater (ToW) was collected from the tofu industry centre in Kendalsari. Tempe-processing wastewater (TeW) was collected from tempeh industrial centre in Sanan. No pre-treatment was subjected to all agro-industrial wastewater samples. All samples were directly used and analysed upon arrival at Laboratory of Bioindustry, Department of Agro-industrial Technology, Faculty of Agricultural Technology, Universitas Brawijaya. Parameters analysed for batik wastewater samples include pH, biochemical methane potential (BOD), chemical oxygen demand (COD), total suspended solids (TSS), ammonia, sulphide, phenol, oil and grease, and total Cr. While, for tofu-and tempeh-processing wastewater include pH, BOD, COD, TSS, and amonia. Inoculum was collected from a mesophilic digester treating cattle slurry at Balai Besar Pelatihan Peternakan in Batu City. The procedure and preparation of inoculum for biochemical methane potential (BMP) test was previously described in our studies. BMP test The procedure for the BMP test was according to Suhartini et al.. The ratio of inoculum to the substrate (RI/S) was 6:1, with the following samples: inoculum only, positive control with -cellulose, BW 100%, ToW 100% and TeW 100% (as seen in Table 1), and prepared in triplicate. The BMP test was carried out for 28 day at 37 o C using a controlled water bath. Changes in the internal pressure were measured using a digital manometer on daily basis. Analysis The proximate analysis includes total solids (TS), volatile solids (VS), moisture content (MC) and Ash content were analysed using the Standard Method 2540 G. The pH value was measured, at the beginning and end of the BMP test, using a digital pH meter and previously calibrated in buffer solution at pH 7 and 9.2. Theoretical methane concentration was calculated using the Buswell formula. The biogas volume was calculated by converting the pressure readings to gas volume following the at standard temperature and pressure (STP) of 273.15 K and 101.325 kPa. Specific methane production (SMP) calculated using the formula described in Strmberg et al.. Characteristics of agro-industrial wastewater Selected agro-industrial wastewater samples were found to contain high organic pollutants, as indicated by the COD and BOD values ( Table 2). For BW, it can be seen that the values for pH, sulfide, and total chromium (Cr) parameters were well within and below the standard effluent discharge for industrial wastewater. This result was in accordance with other studies reported in Aryani et al. and Hardyanti. Table 1 also shows that BW has a higher concentration of phenol, as well as fat, oil and grease (FOG). All agro-industrial wastewater samples have high BOD, COD, and TSS concentrations exceeded that of the standard effluent discharge. Sinha et al. stated that high BOD and COD values are proportional to the high amount of organic matter (pollutants) in wastewater. If the wastewater is directly discharged into the environment, it may cause the rapid depletion of dissolved oxygen in water and may present toxic constituents. These results demonstrated that BW, ToW and TeW contained high available organic material, thus the potential for transforming into bioenergy, for example. Furthermore, both ToW and TeW have low pH values of < 4.50, indicating that disposed of directly into the environment needs to be avoided and further treatments are advised. BMP test results 3.2.1. Characteristics of digestate after BMP test At the end of the BMP test, the digestate (or organic residue) after anaerobic digestion (AD) was measured for the following parameters: TS, VS, MC, and ash concentration, respectively. The results indicated that the digestate still contains a high amount of remained organic matters, as shown by the VS concentration (Table 3). The organic matters in the digestate can be further reused for composting or for soil conditioners, as well as for bio-fertilizer. This is consistent with a previous study which highlighted that digestate from AD is potential sources for soil amendment due to its organic fraction can contribute to the turnover of soil organic matter (SOM). Specific methane production The SMP was calculated by comparing the net methane volume divided by the organic fraction (VS) of the substrate, as shown in Figure 1. The concentration of methane used in the calculation was assumed as 50%. The SMP value for the control sample i.e. blank sample was 0.005 m 3 CH4/kg VS. This value was much lower than our previous study reported, which possibly due to the characteristics and poor handling of the inoculum. The positive control has SMP of m 3 CH4/kg VS. The positive control sample with the addition of pure standard -cellulose (i.e. 100% organic material) was used to investigate the microbial activity contained in the inoculum. A study by Wang et al. showed that cellulose substrates can produce methane with a value of 0.34 m 3 CH4/kgVS. The figure shows that digesting BW and ToW alone result in a small amount of both cumulative biogas and methane volume, causing a negative SMP value, with the average values of -0.06 m 3 CH4/kg VS and -0.008 m 3 CH4/kg VS. This was because the cumulative biogas and methane volume from these samples was lower than that of the inoculum. Furthermore, a high concentration of COD in BW and ToW may limit the microorganism ability in the AD system to breakdown COD into biogas or methane. However, using TeW as the main feedstock in the AD system did give slightly better biogas and methane production; with the average SMP value of 0.027 m 3 CH4/kg VS. The difference in SMP could also be influenced by the organic matter and the presence or absence of substances that are toxic to consortia of microorganisms in the AD system. The findings from this study demonstrated that agro-industrial wastewater samples, when used as a single-feedstock for AD processes, show or a combination of AD systems with adsorption technology. From the SMP values, the calculation of energy potential revealed that digesting BW or ToW alone did not provide a great electrical energy potential. While for TeW, it is estimated that the theoretical potential for electrical energy was slightly higher at a value of 0.728 kWh from 1000 L of wastewater. Alternatives approach for agro-industrial wastewater valorisation Various studies have been emphasized valorising BW, ToW and TeW for either bioenergy generation or other high-value products. For example, Fazal et al. and Wu et al. reported that BW can be used as a growth medium for microalgae for biodiesel purposes, as it contains organic matter, phosphorus and nitrogen needed for growth and fat accumulation in microalgae. While Lin et al. found that a combination of mesophilic AD with adsorption technology using granular activated carbon (GAC) was suitable for growing microalgae (i.e Scenedesmus sp.). Such a combination was effective to remove color, reduce COD content, and improve methane production of 2.07 107 kJ/day. In the case of ToW, several studies have also highlighted its potential for bioenergy production. Lay et al. stated that ToW is greatly feasible to be valorized into ethanol and energy, resulting in additional energy sources for the tofu industry by up to 3.5% of annual energy consumption. Zheng et al. also support the idea of transforming ToW into bio-hydrogen. While a study by Vistanti and Malik found that implementing a multi-stage AD system combined with recirculation can improve biogas production from ToW. Specific to TeW, Zuhri et al. and Utami reported that TeW can be used as a substrate for the production of electricity using MFC technology. While Nayono and Purwantoro found that implementing up-flow anaerobic fixed-bed reactor (UAFB) combined with natural treatment of constructed wetland (filled with natural filter media) can provide both energy from wastewater (i.e. biogas) and reduce the negative environmental impact from wastewater directly discharge to water bodies. The study also concludes that bioenergy recovered from TeW can generate an annual income of USD 11,951, which clearly evident of economic benefits from the practice. Such findings, as mentioned above, demonstrated that agro-industrial wastewater can be a great resource for bioenergy production, with further combination with other treatments. Yet, in-depth investigation should be carried out to further evaluate the feasibility of the selected and applied technology. Conclusions High COD and BOD content in agro-industrial wastewater have inhibited the AD system in producing biogas or methane. This was evident for BW and ToW samples. The energy potential calculation indicated that using these wastewater samples was not feasible as a single feedstock for an anaerobic digestion system. Therefore, using AD of agro-industrial wastewater can potentially be improved by combining other potential biomass feedstock as co-substrates or with other treatments. More investigation on these matters are essential and recommended. |
package paulevs.betaloader.mixin.client;
import modloader.ModLoader;
import modloadermp.ModLoaderMp;
import modloadermp.NetClientHandlerEntity;
import net.minecraft.client.level.ClientLevel;
import net.minecraft.entity.EntityBase;
import net.minecraft.entity.Living;
import net.minecraft.entity.projectile.Arrow;
import net.minecraft.level.Level;
import net.minecraft.network.ClientPlayNetworkHandler;
import net.minecraft.packet.play.EntitySpawn0x17S2CPacket;
import net.minecraft.packet.play.OpenContainer0x64S2CPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.lang.reflect.Field;
@Mixin(ClientPlayNetworkHandler.class)
public class ClientPlayNetworkHandlerMixin {
@Shadow
private ClientLevel level;
@Inject(method = "onEntitySpawn", at = @At(value = "HEAD"), cancellable = true)
private void betaloader_onEntitySpawn(EntitySpawn0x17S2CPacket packet, CallbackInfo info) {
final double x = packet.x / 32.0;
final double y = packet.y / 32.0;
final double z = packet.z / 32.0;
EntityBase entity = null;
final NetClientHandlerEntity handlerEntity = ModLoaderMp.HandleNetClientHandlerEntities(packet.type);
if (handlerEntity != null) {
try {
entity = handlerEntity.entityClass.getConstructor(Level.class, Double.TYPE, Double.TYPE, Double.TYPE).newInstance(this.level, x, y, z);
if (handlerEntity.entityHasOwner) {
final Field field = handlerEntity.entityClass.getField("owner");
if (!EntityBase.class.isAssignableFrom(field.getType())) {
throw new Exception(String.format("Entity's owner field must be of type Entity, but it is of type %s.", field.getType()));
}
final EntityBase entity1 = this.method_1645(packet.flag);
if (entity1 == null) {
ModLoaderMp.Log("Received spawn packet for entity with owner, but owner was not found.");
}
else {
if (!field.getType().isAssignableFrom(entity1.getClass())) {
throw new Exception(String.format("Tried to assign an entity of type %s to entity owner, which is of type %s.", entity1.getClass(), field.getType()));
}
field.set(entity, entity1);
}
}
}
catch (Exception e) {
ModLoader.getLogger().throwing("NetClientHandler", "handleVehicleSpawn", e);
ModLoader.ThrowException(String.format("Error initializing entity of type %s.", packet.type), e);
return;
}
}
if (entity != null) {
entity.clientX = packet.x;
entity.clientY = packet.y;
entity.clientZ = packet.z;
entity.yaw = 0.0f;
entity.pitch = 0.0f;
entity.entityId = packet.entityId;
this.level.method_1495(packet.entityId, entity);
if (packet.flag > 0) {
if (packet.type == 60) {
final EntityBase entity2 = this.method_1645(packet.flag);
if (entity2 instanceof Living) {
((Arrow) entity).owner = (Living) entity2;
}
}
entity.setVelocity(packet.field_1667 / 8000.0, packet.field_1668 / 8000.0, packet.field_1669 / 8000.0);
}
info.cancel();
}
}
@Inject(method = "onOpenContainer", at = @At(value = "HEAD"), cancellable = true)
private void betaloader_onOpenContainer(OpenContainer0x64S2CPacket packet, CallbackInfo info) {
int type = packet.inventoryType;
if (type < 0 || type > 3) {
ModLoaderMp.HandleGUI(packet);
info.cancel();
}
}
@Shadow
private EntityBase method_1645(int id) {
return null;
}
}
|
/**
* Decodes a MongoDB document to a FacebookMessage
*
* @param doc MongoDB document
* @return decoded FacebookMessage
*/
public MessageDocument decodeFacebookMessage(Document doc) {
try (Session session = (Session) daoFactory.initializeContext()) {
FacebookSourceDao sourceDao = daoFactory.createFacebookSourceDao(session);
MessageDocument message = new FacebookMessageDocument();
if (doc.getString("service").equals(Services.FACEBOOK.toString())) {
message.setService(Services.FACEBOOK.toString());
((FacebookMessageDocument) message).setType(doc.getString("type"));
Document sourceDoc = (Document) doc.get("source");
FacebookSource source;
try {
source = retrieveFacebookSource(sourceDoc.getString("id"), sourceDao);
((FacebookMessageDocument) message).setSource(source);
} catch (Exception ex) {
LOGGER.error("Can not decode referenced source", ex);
}
}
message.setId(doc.getString("messageId"));
message.setLabel(doc.getString("label"));
message.setContent(doc.getString("content"));
message.setTraining(doc.getBoolean("training"));
message.setCreationTime(new DateTime(doc.getDate("creationTime")));
message.setUpdateTime(new DateTime(doc.getDate("updateTime")));
List<Document> locDocs = (List<Document>) doc.get("locations");
List<Location> locations = new ArrayList();
if (locDocs != null && !locDocs.isEmpty()) {
locDocs.forEach(l -> {
Location loc = new Location();
loc.setLatitude(l.getDouble("latitude"));
loc.setLongitude(l.getDouble("longitude"));
locations.add(loc);
});
}
message.setLocations(locations);
return message;
}
} |
On a warm evening on his last Saturday in Israel, Matisyahu was hanging out with some �hippie-religious old-timers� in their backyard.
In the distance, I could hear guitar and voice over the phone before Matisyahu slipped away from the group. The get-together was the mellow wind-down after playing several shows and observing the high holidays of Rosh Hashanah and Yom Kippur during his almost monthlong trip abroad.
�Each of these holidays represents something totally different and it feels totally different,� he said. �When you are in Israel you really get the feel of it as opposed to being anywhere in America, where there is just a small community of people that are involved.
After Israel, where he played a show at Sultan�s Pool (located in �the valley of the shadow of death� from the biblical Psalms), his band played some dates in Europe. It has two shows scheduled in Canada before his Eugene date on Monday.
But for this artist, there are never shows during Shabbat. The Jewish day of rest begins at sundown Friday and lasts until three stars appear in the Saturday night sky.
Proper observance means no work. No use of technology. So when Matisyahu�s publicist scheduled an early afternoon interview, it should not have been an issue.
Except the time difference between here and the Middle East placed it a few hours into Shabbat. But no day is sacred when you are trying to get in touch with one of popular music�s more interesting figures � who happens to have a show coming up in your town.
So we spoke about 9:30 p.m. his time on a Saturday.
When I started to hear about him a few years ago, my first reaction to Matisyahu was: No comment.
The idea of a religion-curious, East Coast, jam band kid turned strict Hasidic Jew rapper and reggae artist was such a hot mess that I was glad he did not have a show scheduled here. I wouldn�t have to sort it out.
Phrases such as �cultural appropriation� are no fun to weave into a story. But because it took a while for him to arrive in Eugene, Matisyahu and the national media had time to sift through the seemingly disparate elements of his identity.
The resulting persona is one of someone who seems comfortable with himself as a human being and as an artist, and of writers who have become willing to accept him on his own terms. A tale that started out as an oddity has become strikingly American.
Matisyahu is a one-man melting pot, just please hold the bacon.
Hassidic sage Rabbi Nachman, who died in 1810, was one of the main inspirations for �Light,� Matisyahu said.
For the media storytellers, Matisyahu is someone whose biography tends to overshadow his music. But on the grass-roots level, it�s different; for his fans, he is all about music, with the cultural fusion a welcome sideshow.
If the music alone is not a commodity that people want, a big-label artist with a compelling bio will be dropped quicker than you can say Shabbat Shalom. So far, Sony has kept Matisyahu on contract.
When he debuted in 2004 with �Shake Off the Dust�... Arise,� his appearance was what you would expect from an Orthodox Jewish male � black hat, long beard, black suit.
Now, he is more laid-back in his appearance and his worldview. For instance, he still does not let female fans touch him, but he has resumed stage diving.
�I have gone to different places with it all, and it becomes apparent in the music,� he said. �I have been in a process of integration.�... It came together in my music, but also in my life.
�It became much less about being a part of one group or one path. Basically, (I) continue to see things from different perspectives.
Matisyahu is not a scholar and he is not a prophet, yet he said people often want him to be. Mothers yearn for a role model for their kids; youth group leaders want him to speak to their charges.
They look to the guy who overcame what from the outside looks like a feckless early life. He followed jam band Phish, took LSD at concerts, then emerged an international star with a spiritual aura.
Back when he was Matthew Miller, he lived in Bend for two years and worked at the Mount Bachelor ski resort. He used to play Taylor�s, the UO campus bar, with his band Soul for I.
Now, he is an entertainer with a deeply spiritual perspective, but he wants his music to carry his message. He is not a public speaker.
�I had teachers and people that I learned from, (but) no one was there for me to pave the way,� he said. �I think part of being on your individual journey through life is there is no one to hold you by the hand and lead you.
The song �One Day� shows how far Matis-yahu has come as a singer. It touches on the theme of finding one�s path.
Matisyahu said at this stage in his life, he thinks that reason is to make music.
Call Serena Markstrom at 338-2371 or e-mail her at serena .markstrom@ registerguard.com. |
/*==============================================================================
Copyright (c) 2016, 2017, 2018 <NAME>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <argot/contained.hpp>
#include <argot/concepts/same_type.hpp>
#include <argot/concepts/same_type.hpp>
#include <argot/detail/constexpr_test.hpp>
#include <argot/gen/concept_ensure.hpp>
namespace {
// TODO(mattcalabrese) Test noexcept/constexpr
enum class dummy_state { valid, moved_from };
template< class Os >
constexpr Os& operator <<( Os& os, dummy_state val )
{
switch( val )
{
case dummy_state::valid:
os << "valid";
break;
case dummy_state::moved_from:
os << "moved_from";
break;
}
return os;
}
struct dummy
{
constexpr dummy( int const value ) noexcept
: value( value ), state( dummy_state::valid ){};
constexpr dummy( dummy&& other ) noexcept
: value( other.value ), state( other.state )
{
other.state = dummy_state::moved_from;
other.value = 0;
}
constexpr dummy( const dummy& other ) noexcept
: value( other.value ), state( other.state )
{
}
int value;
dummy_state state;
};
using argot::SameType;
using argot::contained;
using argot::make_contained;
using argot::access_contained;
ARGOT_REGISTER_CONSTEXPR_TEST( test_contained_unqualified )
{
using contained_t = contained< dummy >;
dummy source( 5 );
// Test construct by copy.
contained_t object = make_contained< dummy >( source );
ARGOT_TEST_EQ( source.state, dummy_state::valid );
ARGOT_TEST_EQ( source.value, 5 );
// Test construct by move.
{
contained_t object = make_contained< dummy >( std::move( source ) );
(void)object;
ARGOT_TEST_EQ( source.state, dummy_state::moved_from );
ARGOT_TEST_EQ( source.value, 0 );
}
// lvalue
{
contained_t& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy& > );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// const lvalue
{
contained_t const& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, const dummy& > );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// rvalue
{
contained_t&& self = std::move( object );
decltype( auto ) accessed_value = access_contained( std::move( self ) );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy&& > );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// copy
{
contained_t copied_object = object;
dummy& source_value = access_contained( object );
dummy& copied_value = access_contained( copied_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::valid );
ARGOT_TEST_EQ( source_value.value, 5 );
ARGOT_TEST_EQ( copied_value.state, dummy_state::valid );
ARGOT_TEST_EQ( copied_value.value, 5 );
}
// move
{
contained_t moved_object = std::move( object );
dummy& source_value = access_contained( object );
dummy& moved_value = access_contained( moved_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::moved_from );
ARGOT_TEST_EQ( source_value.value, 0 );
ARGOT_TEST_EQ( moved_value.state, dummy_state::valid );
ARGOT_TEST_EQ( moved_value.value, 5 );
}
return 0;
}
ARGOT_REGISTER_CONSTEXPR_TEST( test_contained_const )
{
using contained_t = contained< dummy const >;
dummy source( 5 );
// Test construct by copy.
contained_t object = make_contained< dummy const >( source );
ARGOT_TEST_EQ( source.state, dummy_state::valid );
ARGOT_TEST_EQ( source.value, 5 );
// Test construct by move.
{
contained_t moved_in_object
= make_contained< dummy const >( std::move( source ) );
(void)moved_in_object; // TODO(mattcalabrese) test new value.
ARGOT_TEST_EQ( source.state, dummy_state::moved_from );
ARGOT_TEST_EQ( source.value, 0 );
}
// lvalue
{
contained_t& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, const dummy& > );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// const lvalue
{
contained_t const& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, const dummy& > );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// rvalue
{
contained_t&& self = std::move( object );
decltype( auto ) accessed_value = access_contained( std::move( self ) );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy&& > );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// copy
{
contained_t copied_object = object;
dummy const& source_value = access_contained( object );
dummy const& copied_value = access_contained( copied_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::valid );
ARGOT_TEST_EQ( source_value.value, 5 );
ARGOT_TEST_EQ( copied_value.state, dummy_state::valid );
ARGOT_TEST_EQ( copied_value.value, 5 );
}
// move
{
contained_t moved_object = std::move( object );
dummy const& source_value = access_contained( object );
dummy const& moved_value = access_contained( moved_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::moved_from );
ARGOT_TEST_EQ( source_value.value, 0 );
ARGOT_TEST_EQ( moved_value.state, dummy_state::valid );
ARGOT_TEST_EQ( moved_value.value, 5 );
}
return 0;
}
ARGOT_REGISTER_CONSTEXPR_TEST( test_contained_lvalue_reference )
{
using contained_t = contained< dummy& >;
dummy source( 5 );
// Test construct.
contained_t object = make_contained< dummy& >( source );
ARGOT_TEST_EQ( source.state, dummy_state::valid );
ARGOT_TEST_EQ( source.value, 5 );
// lvalue
{
contained_t& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy& > );
ARGOT_TEST_EQ( &accessed_value, &source );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// const lvalue
{
contained_t const& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy& > );
ARGOT_TEST_EQ( &accessed_value, &source );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// rvalue
{
contained_t&& self = std::move( object );
decltype( auto ) accessed_value = access_contained( std::move( self ) );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy& > );
ARGOT_TEST_EQ( &accessed_value, &source );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// copy
{
contained_t copied_object = object;
dummy& source_value = access_contained( object );
dummy& copied_value = access_contained( copied_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::valid );
ARGOT_TEST_EQ( source_value.value, 5 );
ARGOT_TEST_EQ( copied_value.state, dummy_state::valid );
ARGOT_TEST_EQ( copied_value.value, 5 );
}
// move
{
contained_t moved_object = std::move( object );
dummy& source_value = access_contained( object );
dummy& moved_value = access_contained( moved_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::valid );
ARGOT_TEST_EQ( source_value.value, 5 );
ARGOT_TEST_EQ( moved_value.state, dummy_state::valid );
ARGOT_TEST_EQ( moved_value.value, 5 );
}
return 0;
}
ARGOT_REGISTER_CONSTEXPR_TEST( test_contained_rvalue_reference )
{
using contained_t = contained< dummy&& >;
dummy source( 5 );
// Test construct.
contained_t object = make_contained< dummy&& >( std::move( source ) );
ARGOT_TEST_EQ( source.state, dummy_state::valid );
ARGOT_TEST_EQ( source.value, 5 );
// lvalue
{
contained_t& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy& > );
ARGOT_TEST_EQ( &accessed_value, &source );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// const lvalue
{
contained_t const& self = object;
decltype( auto ) accessed_value = access_contained( self );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy& > );
ARGOT_TEST_EQ( &accessed_value, &source );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// rvalue
{
contained_t&& self = std::move( object );
decltype( auto ) accessed_value = access_contained( std::move( self ) );
using accessed_type = decltype( accessed_value );
ARGOT_CONCEPT_ENSURE( SameType< accessed_type, dummy&& > );
ARGOT_TEST_EQ( &accessed_value, &source );
ARGOT_TEST_EQ( accessed_value.state, dummy_state::valid );
ARGOT_TEST_EQ( accessed_value.value, 5 );
}
// copy
static_assert( !std::is_copy_constructible< contained_t >::value );
// move
{
contained_t moved_object = std::move( object );
dummy& source_value = access_contained( object );
dummy& moved_value = access_contained( moved_object );
ARGOT_TEST_EQ( source_value.state, dummy_state::valid );
ARGOT_TEST_EQ( source_value.value, 5 );
ARGOT_TEST_EQ( moved_value.state, dummy_state::valid );
ARGOT_TEST_EQ( moved_value.value, 5 );
}
return 0;
}
// TODO(mattcalabrese) Test "volatile" and "volatile const"
ARGOT_EXECUTE_TESTS();
} // namespace
|
import { AnyAction } from 'redux';
import {
GridColor,
ColorBy,
} from 'reducers/interfaces';
export enum SettingsActionTypes {
SWITCH_ROTATE_ALL = 'SWITCH_ROTATE_ALL',
SWITCH_GRID = 'SWITCH_GRID',
CHANGE_GRID_SIZE = 'CHANGE_GRID_SIZE',
CHANGE_GRID_COLOR = 'CHANGE_GRID_COLOR',
CHANGE_GRID_OPACITY = 'CHANGE_GRID_OPACITY',
CHANGE_SHAPES_OPACITY = 'CHANGE_SHAPES_OPACITY',
CHANGE_SELECTED_SHAPES_OPACITY = 'CHANGE_SELECTED_SHAPES_OPACITY',
CHANGE_SHAPES_COLOR_BY = 'CHANGE_SHAPES_COLOR_BY',
CHANGE_SHAPES_BLACK_BORDERS = 'CHANGE_SHAPES_BLACK_BORDERS',
}
export function changeShapesOpacity(opacity: number): AnyAction {
return {
type: SettingsActionTypes.CHANGE_SHAPES_OPACITY,
payload: {
opacity,
},
};
}
export function changeSelectedShapesOpacity(selectedOpacity: number): AnyAction {
return {
type: SettingsActionTypes.CHANGE_SELECTED_SHAPES_OPACITY,
payload: {
selectedOpacity,
},
};
}
export function changeShapesColorBy(colorBy: ColorBy): AnyAction {
return {
type: SettingsActionTypes.CHANGE_SHAPES_COLOR_BY,
payload: {
colorBy,
},
};
}
export function changeShapesBlackBorders(blackBorders: boolean): AnyAction {
return {
type: SettingsActionTypes.CHANGE_SHAPES_BLACK_BORDERS,
payload: {
blackBorders,
},
};
}
export function switchRotateAll(rotateAll: boolean): AnyAction {
return {
type: SettingsActionTypes.SWITCH_ROTATE_ALL,
payload: {
rotateAll,
},
};
}
export function switchGrid(grid: boolean): AnyAction {
return {
type: SettingsActionTypes.SWITCH_GRID,
payload: {
grid,
},
};
}
export function changeGridSize(gridSize: number): AnyAction {
return {
type: SettingsActionTypes.CHANGE_GRID_SIZE,
payload: {
gridSize,
},
};
}
export function changeGridColor(gridColor: GridColor): AnyAction {
return {
type: SettingsActionTypes.CHANGE_GRID_COLOR,
payload: {
gridColor,
},
};
}
export function changeGridOpacity(gridOpacity: number): AnyAction {
return {
type: SettingsActionTypes.CHANGE_GRID_OPACITY,
payload: {
gridOpacity,
},
};
}
|
package game
import (
"github.com/pkg/errors"
"math"
"math/rand"
)
const maxPlanets = 1000
func GeneratePlanets(options PlanetOptions) ([]Planet, error) {
if options.NumPlanets > maxPlanets {
return nil, errors.Errorf("numPlanets '%d' higher than maximum '%d'", options.NumPlanets, maxPlanets)
}
planets := make([]Planet, options.NumPlanets)
d, err := NewDistribution(options.MinRadius, options.Radius)
if err != nil {
return nil, err
}
for i := 0; i < options.NumPlanets; i++ {
tries := 0
var newPlanet Planet
for ; tries < 100; tries++ {
newPlanet = generatePlanet(options.MinRadius, *d)
if !hasCollision(newPlanet, planets) {
break
}
}
if tries == 100 {
return nil, errors.Errorf(
"unable to find space for planet %d; increase galaxy radius", i)
}
planets[i] = newPlanet
}
return planets, nil
}
type Distribution struct {
// Starts is a monotonically-increasing list of probabilities in the range (0, 1).
Starts []float64
}
func (d Distribution) RandInt() int {
r := rand.Float64()
for i, p := range d.Starts {
if r < p {
return i
}
}
return len(d.Starts)
}
func NewDistribution(min, max int) (*Distribution, error) {
if min > max {
return nil, errors.Errorf("min radius %d greater than max radius %d", min, max)
}
var sum int
for i := min; i <= max; i++ {
sum += i
}
d := &Distribution{
Starts: make([]float64, max-min),
}
csum := 0.0
for i := min; i < max; i++ {
csum += float64(i) / float64(sum)
d.Starts[i-min] = csum
}
return d, nil
}
func hasCollision(newPlanet Planet, planets []Planet) bool {
for _, p := range planets {
if Dist(newPlanet, p) < 1 {
return true
}
}
return false
}
func generatePlanet(minRadius int, d Distribution) Planet {
radius := float64(minRadius) + float64(d.RandInt())
angle := rand.Float64() * 2 * math.Pi
return Planet{
X: radius * math.Sin(angle),
Y: radius * math.Cos(angle),
Radius: radius,
Angle: angle,
}
}
|
<gh_stars>0
// Copyright 2016 The G3N Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gui
import (
"github.com/lquesada/cavernal/lib/g3n/engine/window"
)
/***************************************
Slider
+--------------------------------+
| +--------------------------+ |
| | +----------+ | |
| | | | | |
| | | | | |
| | +----------+ | |
| +--------------------------+ |
+--------------------------------+
**/
// Slider is the GUI element for sliders and progress bars
type Slider struct {
Panel // Embedded panel
slider Panel // embedded slider panel
label *Label // optional label
horiz bool // orientation
styles *SliderStyles // pointer to styles
pos float32 // current slider position
posLast float32 // last position of the mouse cursor when dragging
pressed bool // mouse button is pressed and dragging
cursorOver bool // mouse is over slider
scaleFactor float32 // scale factor (default = 1.0)
}
// SliderStyle contains the styling of a Slider
type SliderStyle BasicStyle
// SliderStyles contains a SliderStyle for each valid GUI state
type SliderStyles struct {
Normal SliderStyle
Over SliderStyle
Focus SliderStyle
Disabled SliderStyle
}
// NewHSlider creates and returns a pointer to a new horizontal slider
// with the specified initial dimensions.
func NewHSlider(width, height float32) *Slider {
return newSlider(true, width, height)
}
// NewVSlider creates and returns a pointer to a new vertical slider
// with the specified initial dimensions.
func NewVSlider(width, height float32) *Slider {
return newSlider(false, width, height)
}
// NewSlider creates and returns a pointer to a new slider with the
// specified initial dimensions.
func newSlider(horiz bool, width, height float32) *Slider {
s := new(Slider)
s.horiz = horiz
s.styles = &StyleDefault().Slider
s.scaleFactor = 1.0
// Initialize main panel
s.Panel.Initialize(width, height)
s.Panel.Subscribe(OnMouseDown, s.onMouse)
s.Panel.Subscribe(OnMouseUp, s.onMouse)
s.Panel.Subscribe(OnCursor, s.onCursor)
s.Panel.Subscribe(OnCursorEnter, s.onCursor)
s.Panel.Subscribe(OnCursorLeave, s.onCursor)
s.Panel.Subscribe(OnScroll, s.onScroll)
s.Panel.Subscribe(OnKeyDown, s.onKey)
s.Panel.Subscribe(OnKeyRepeat, s.onKey)
s.Panel.Subscribe(OnResize, s.onResize)
s.Panel.Subscribe(OnEnable, func(evname string, ev interface{}) { s.update() })
// Initialize slider panel
s.slider.Initialize(0, 0)
s.Panel.Add(&s.slider)
s.recalc()
s.update()
return s
}
// SetStyles set the slider styles overriding the default style
func (s *Slider) SetStyles(ss *SliderStyles) *Slider {
s.styles = ss
s.update()
return s
}
// SetText sets the text of the slider optional label
func (s *Slider) SetText(text string) *Slider {
if s.label == nil {
s.label = NewLabel(text)
s.Panel.Add(s.label)
} else {
s.label.SetText(text)
}
s.update()
s.recalc()
return s
}
// SetValue sets the value of the slider considering the current scale factor
// and updates its visual appearance.
func (s *Slider) SetValue(value float32) *Slider {
pos := value / s.scaleFactor
s.setPos(pos)
return s
}
// Value returns the current value of the slider considering the current scale factor
func (s *Slider) Value() float32 {
return s.pos * s.scaleFactor
}
// SetScaleFactor set the slider scale factor (default = 1.0)
func (s *Slider) SetScaleFactor(factor float32) *Slider {
s.scaleFactor = factor
return s
}
// ScaleFactor returns the slider current scale factor (default = 1.0)
func (s *Slider) ScaleFactor() float32 {
return s.scaleFactor
}
// setPos sets the slider position from 0.0 to 1.0
// and updates its visual appearance.
func (s *Slider) setPos(pos float32) {
const eps = 0.01
if pos < 0 {
pos = 0
} else if pos > 1.0 {
pos = 1
}
if pos > (s.pos+eps) && pos < (s.pos+eps) {
return
}
s.pos = pos
s.recalc()
s.Dispatch(OnChange, nil)
}
// onMouse process subscribed mouse events over the outer panel
func (s *Slider) onMouse(evname string, ev interface{}) {
mev := ev.(*window.MouseEvent)
switch evname {
case OnMouseDown:
s.pressed = true
if s.horiz {
s.posLast = mev.Xpos
} else {
s.posLast = mev.Ypos
}
s.root.SetMouseFocus(s)
s.root.SetKeyFocus(s)
case OnMouseUp:
s.pressed = false
if !s.cursorOver {
s.root.SetCursorNormal()
}
s.root.SetMouseFocus(nil)
default:
return
}
s.root.StopPropagation(Stop3D)
}
// onCursor process subscribed cursor events
func (s *Slider) onCursor(evname string, ev interface{}) {
if evname == OnCursorEnter {
s.root.SetScrollFocus(s)
if s.horiz {
s.root.SetCursorHResize()
} else {
s.root.SetCursorVResize()
}
s.cursorOver = true
s.update()
} else if evname == OnCursorLeave {
s.root.SetScrollFocus(nil)
s.root.SetCursorNormal()
s.cursorOver = false
s.update()
} else if evname == OnCursor {
if !s.pressed {
return
}
cev := ev.(*window.CursorEvent)
var pos float32
if s.horiz {
delta := cev.Xpos - s.posLast
s.posLast = cev.Xpos
newpos := s.slider.Width() + delta
pos = newpos / s.Panel.ContentWidth()
} else {
delta := cev.Ypos - s.posLast
s.posLast = cev.Ypos
newpos := s.slider.Height() - delta
pos = newpos / s.Panel.ContentHeight()
}
s.setPos(pos)
}
s.root.StopPropagation(Stop3D)
}
// onScroll process subscribed scroll events
func (s *Slider) onScroll(evname string, ev interface{}) {
sev := ev.(*window.ScrollEvent)
v := s.pos
v += sev.Yoffset * 0.01
s.setPos(v)
s.root.StopPropagation(Stop3D)
}
// onKey process subscribed key events
func (s *Slider) onKey(evname string, ev interface{}) {
kev := ev.(*window.KeyEvent)
delta := float32(0.01)
// Horizontal slider
if s.horiz {
switch kev.Keycode {
case window.KeyLeft:
s.setPos(s.pos - delta)
case window.KeyRight:
s.setPos(s.pos + delta)
default:
return
}
// Vertical slider
} else {
switch kev.Keycode {
case window.KeyDown:
s.setPos(s.pos - delta)
case window.KeyUp:
s.setPos(s.pos + delta)
default:
return
}
}
s.root.StopPropagation(Stop3D)
}
// onResize process subscribed resize events
func (s *Slider) onResize(evname string, ev interface{}) {
s.recalc()
}
// update updates the slider visual state
func (s *Slider) update() {
if !s.Enabled() {
s.applyStyle(&s.styles.Disabled)
return
}
if s.cursorOver {
s.applyStyle(&s.styles.Over)
return
}
s.applyStyle(&s.styles.Normal)
}
// applyStyle applies the specified slider style
func (s *Slider) applyStyle(ss *SliderStyle) {
s.Panel.ApplyStyle(&ss.PanelStyle)
s.slider.SetColor4(&ss.FgColor)
}
// recalc recalculates the dimensions and positions of the internal panels.
func (s *Slider) recalc() {
if s.horiz {
if s.label != nil {
lx := (s.Panel.ContentWidth() - s.label.Width()) / 2
if s.Panel.ContentHeight() < s.label.Height() {
s.Panel.SetContentHeight(s.label.Height())
}
ly := (s.Panel.ContentHeight() - s.label.Height()) / 2
s.label.SetPosition(lx, ly)
}
width := s.Panel.ContentWidth() * s.pos
s.slider.SetSize(width, s.Panel.ContentHeight())
} else {
if s.label != nil {
if s.Panel.ContentWidth() < s.label.Width() {
s.Panel.SetContentWidth(s.label.Width())
}
lx := (s.Panel.ContentWidth() - s.label.Width()) / 2
ly := (s.Panel.ContentHeight() - s.label.Height()) / 2
s.label.SetPosition(lx, ly)
}
height := s.Panel.ContentHeight() * s.pos
s.slider.SetPositionY(s.Panel.ContentHeight() - height)
s.slider.SetSize(s.Panel.ContentWidth(), height)
}
}
|
<filename>Java frameworks web application/CurrencyConverter/src/main/java/integration/CConverterDAO.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package integration;
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import model.CurrencyRate;
/**
*
* @author Evan
*/
@Singleton
@TransactionAttribute(TransactionAttributeType.MANDATORY)
@Stateless
public class CConverterDAO {
@PersistenceContext(unitName = "cConverterPU")
private EntityManager em;
@PostConstruct
void init() {
if (findCurrencyRate("SEK") == null) {
storeCurrencyRate(new CurrencyRate("SEK", 11.3169));
}
if (findCurrencyRate("USD") == null) {
storeCurrencyRate(new CurrencyRate("USD", 1.34029));
}
if (findCurrencyRate("EUR") == null) {
storeCurrencyRate(new CurrencyRate("EUR", 1.13783));
}
if (findCurrencyRate("AUD") == null) {
storeCurrencyRate(new CurrencyRate("AUD", 1.4));
}
if (findCurrencyRate("GBP") == null) {
storeCurrencyRate(new CurrencyRate("GBP", 1));
}
}
public CurrencyRate findCurrencyRate(String currencyName) {
try {
return em.find(CurrencyRate.class, currencyName);
} catch (Exception e) {
return null;
}
}
public void storeCurrencyRate(CurrencyRate cc) {
em.persist(cc);
}
}
|
‘I was feeling really sad’. ‘Horrible anxiety attacks’. ‘Insane migraines’. Eight women open up about the side effects they experienced on the birth control pill.
Some 500 million women around the world have used the birth control pill at some point in their lives, including four out of five sexually active women in the US and seven out of 10 of all women in the UK. Since their introduction in 1950, oral contraceptives have prevented billions of unwanted pregnancies around the world. They’ve also ushered in a social and economic revolution.
But for some women, the pill has had a downside: though many users report no side effects from the pill, others have the opposite experience. Recognised potential side effects include everything from depression to blood clots like deep vein thrombosis and pulmonary embolism. Increasing attention about these risks may be part of the reason why, in the UK, the number of women taking hormonal birth control has been declining in recent years, with women turning to non-hormonal or long-acting reversible contraceptives instead.
Eight women around the globe – from the US to Nepal, Venezuela to Tanzania – tell us about how the birth control pill was for them… and why they decided to go off it. Watch the video, above, to hear what they have to say. |
// NewServices returns a new services collection for a state,
// initialized with a gateway and logger.
func NewServices(
gateway gateway.Gateway,
state *flowkit.State,
logger output.Logger,
) *Services {
return &Services{
Accounts: NewAccounts(gateway, state, logger),
Scripts: NewScripts(gateway, state, logger),
Transactions: NewTransactions(gateway, state, logger),
Keys: NewKeys(gateway, state, logger),
Events: NewEvents(gateway, state, logger),
Collections: NewCollections(gateway, state, logger),
Project: NewProject(gateway, state, logger),
Blocks: NewBlocks(gateway, state, logger),
Status: NewStatus(gateway, state, logger),
}
} |
use ash::{version::DeviceV1_0, vk};
use crate::prelude::{HasHandle, Image, ImageLayoutClearColorImage, Transparent};
use crate::resource::image::params::ImageSubresourceRangeTransparent;
impl<'a> super::recording::CommandBufferRecordingLock<'a> {
pub fn clear_color_image(
&self,
image: &Image,
layout: ImageLayoutClearColorImage,
clear_color_value: &vk::ClearColorValue,
ranges: &[ImageSubresourceRangeTransparent]
) {
// log_trace_common!(
// );
todo!();
unsafe {
self.buffer.pool().device().cmd_clear_color_image(
*self.lock,
image.handle(),
layout.into(),
clear_color_value,
Transparent::transmute_slice_twice(ranges)
)
}
}
}
|
Hidden magnetic frustration by quantum relaxation in anisotropic Nd-langasite The static and dynamic magnetic properties of the Nd$_3$Ga$_5$SiO$_{14}$ compound, which appears as the first materialization of a rare-earth kagome-type lattice, were re-examined, owing to contradictory results in the previous studies. Neutron scattering, magnetization and specific heat measurements were performed and analyzed, in particular by fully taking account of the crystal electric field effects on the Nd$^{3+}$ ions. One of the novel findings is that the peculiar temperature independent spin dynamics observed below 10 K expresses single-ion quantum processes. This would short-circuit the frustration induced cooperative dynamics, which would emerge only at very low temperature. The static and dynamic magnetic properties of the Nd3Ga5SiO14 compound, which appears as the first materialization of a rare-earth kagome-type lattice, were re-examined, owing to contradictory results in the previous studies. Neutron scattering, magnetization and specific heat measurements were performed and analyzed, in particular by fully taking account of the crystal electric field effects on the Nd 3+ ions. One of the novel findings is that the peculiar temperature independent spin dynamics observed below 10 K expresses single-ion quantum processes. This would short-circuit the frustration induced cooperative dynamics, which would emerge only at very low temperature. The kagome antiferromagnet is the prototype of geometrically frustrated systems in 2 dimensions. It is predicted that its ground state, in the classical case, remains disordered and is highly degenerate. The investigation of such a spin-liquid state is still impeded by the few available experimental materializations. Various secondary perturbations actually lead, in most known compounds, to long-range order (LRO) or spin glass phase. This occurs, though, at a temperature well below the onset of magnetic correlations and is often accompanied by a dynamical behavior persisting below the transition temperature. These dynamics are characterized by a slowing down of the magnetic fluctuations which rounds off onto a relaxation plateau. Although rather generic, the origin of this peculiar relaxation is still debated. In all the kagome compounds so far studied the magnetic entities that form the frustrated lattice of cornersharing triangles are 3d transition metal ions with weak magneto-crystalline anisotropy. Inversely, in the 3 dimensional compounds of the pyrochlore family, 4f rareearth ions with strong magneto-crystalline anisotropy occupy a frustrated lattice of corner-sharing tetrahedra. This leads to a wider variety of magnetic behaviors. Most striking, for instance, was the discovery of the spin ice state in Ho 2 Ti 2 O 7, where the frustration arises from the combined effects of multi-axial anisotropy and ferromagnetic interactions. It was expected, in contrast, that the multi-axial anisotropy would release the geometric frustration of antiferromagnetic interactions in Tb 2 Ti 2 O 7, but this compound exhibits no LRO and, instead, shows intriguing spin dynamics well below the Curie-Weiss (CW) temperature. It was recently argued that this compound would form a quantum spin ice from dynamical frustration induced through crystal field (CF) excitations and quantum many-body effects. The lately discovered Nd 3 Ga 5 SiO 14 (NGS) compound, which belongs to the langasite family, provides with the unique opportunity to study the role of a strong magnetocrystalline anisotropy in a geometrically frustrated 2 dimensional lattice. In this compound the rare-earth Nd 3+ ions fully occupy a lattice showing the kagome cornersharing triangles connectivity if only first neighbor interactions are taken into consideration. The magnetic properties of NGS powder samples and single crystal were investigated in the 1.6−400 K temperature range. Neutron diffraction and magnetization measurements on the powders confirmed that NGS does not order in a Nel phase nor shows any signature of a spin glass behaviour. Magnetization measurements on the single-crystal (cf. Fig. 4) revealed a strong magnetocrystalline anisotropy associated with CF effects on the ground multiplet J=9/2 of the Nd 3+ ions. A mean field quantitative analysis of the magnetic susceptibility at high temperature taking into account only the quadrupolar contribution to the CF yielded a CW temperature = −52 K, leading to anticipate rather strong antiferromagnetic interactions between the Nd moments. These were described as coplanar rotators in the kagome planes. A change in the anisotropy occurs around 33 K, below which the c-axis (perpendicular to the kagome planes) becomes the macroscopic magnetization axis. Recently, a neutron scattering investigation of NGS at very low temperature was reported. A weak ring of diffuse magnetic scattering was observed at 46 mK, whose momentum-transfer (Q) dependence was found in agreement with calculated magnetic scattering maps from spin-liquid models. It was inferred from additional neutron spin-echo (NSE) experiments, that the associated magnetic state would be highly dynamical. The authors also claimed to have evidenced a magnetic field induced phase transition featured by a plateau of reduced magnetization, approximately half the moment value of the free Nd 3+ ion, in agreement with magnetization measurements (1.6 B at 1.6 K). Another recent investiga- tion by SR and NMR spectroscopy established that the magnetic fluctuations slow down as the temperature is decreased to reach a relaxation plateau below 10 K, interpreted as a signature of magnetic frustration in this cooperative system. Some usual signatures of frustration therefore appeared to have been observed in NGS, magnetic spatial correlations and a fluctuating ground state, but inconsistencies soon emerge from close inspection. In reference 9, no magnetic signal is reported at 46 mK outside an energy window corresponding to fluctuating times larger than 5 10 −11 s but NSE experiments at the same temperature appears to suggest a relaxation faster than 4 10 −12 s. In addition, this fast relaxation suggested by the NSE experiment is incompatible with the characteristic fluctuation time of the SR-probed relaxation plateau, ≈ 2.5 10 −10 s. This motivated our experimental re-investigation of the spin dynamics in NGS, presented below, as well as a full characterization of the single-ion anisotropy through a complete CF analysis. Powders of Nd-langasite, synthesized as in ref. 8, were used for magnetization and specific heat measurements and neutron scattering experiments. The spin dynamics were investigated via time-of-flight (ToF) and NSE spectroscopy. The ToF experiments were performed at ILL on the IN4 spectrometer at a wavelength of 1.1 and on the IN5 spectrometer with wavelengths between 8.5 and 2.25. The ToF spectra reveal a quasielastic (QE) signal, displayed in Fig. 1, whose magnetic origin was inferred from its Q-dependence (slight decrease following the Nd 3+ squared form factor). The half width at half maximum (HWHM) of the Q-integrated spectra decreases from 300 K to 75 K. An Arrhenius law can be forced to account for the temperature dependence of the relaxation time =h/HWHM. This yields an energy barrier of the order of 130 K for a thermally activated process. At 2 K, no QE signal can be detected any more within the instrumental resolution energy window. In order to extend the time window for the observations of the dynamics, a NSE experiment was performed on the IN11C spectrometer at ILL using a wavelength of 5.5. XYZ polarization analysis was performed to experimentally select the magnetic part of the signal. The instrumental resolution was corrected with the purely elastic magnetic signal of a reference compound. The accessible time window of the NSE technique overlaps the ToF range for short times and the SR range for long times. The normalized intermediate functions S(Q, t)/S(Q, 0), measured between 1.4 and 100 K, can be fitted by stretched exponential line-shapes exp(−(t/ ) ) (cf. Fig. 2). A exponent = 1 denotes a non-unique relaxation time. It increases gradually from a constant value of 0.5 between 1.4 and 10 K to 0.8 at 40 K, indicating a change in the dynamics. The small temporal range with non-zero signal at higher temperatures prevented from obtaining a reliable value of which was therefore fixed equal to 0.8 between 60 and 100 K. Above 40 K, the thermal variation of the relaxation time agrees with a thermally activated process (ln( ) ∝ 1/T ). We get an energy barrier very close to the one extracted from the ToF QE signal (cf. Fig. 2). Below 10 K, the relaxation time does no more vary with temperature, revealing a relaxation plateau with a characteristic time ≈ 3 10 −10 s, in good agreement with the SR results (and at variance with the NSE data of ref. 9). An important finding of our NSE experiment is that the magnetic relaxation does not show any detectable Q-dependence in the range , pointing out the absence of spatial correlation down to 1.4 K since the frequency width is inversely proportional to the Q-dependent susceptibility in correlated paramagnet. The spatial correlations observed at 46 mK thus would occur in a temperature range much below the onset of the relaxation plateau. Additional insights about the magnetism of NGS were gained from the ToF scattering at higher energy transfer, specific heat measurements and investigations of magnetically diluted samples. Two CF level transitions can be identified, through their Q dependence in the ToF spectra, around 95 K (also reported in ref. 9) and 380 K (cf. Fig. 1). They however are very broad in energy, with a width at least one order of magnitude larger than the instrumental resolution. Quantitative estimations of CF effects suggest that this may be ascribed to the distribution of the charge environments associated with the Si 4+ /Ga 3+ mixed site, which also is responsible for the NMR line broadening reported in ref. 11. The specific heat measurements were performed down to 400 mK in a Quantum Design PPMS. The magnetic contribution was determined after subtraction of the specific heat measured on the isostructural non-magnetic La 3 Ga 5 SiO 14 compound. It exhibits a broad bump ranging from ≈100 K to above 300 K. A strong rise is noticeable below 2 K as the temperature is decreased down to the lowest values (cf. Fig. 3). We shall discuss this below. Also meaningful were the magnetization measurements on the magnetically diluted (Nd 0.01 La 0.99 ) 3 Ga 5 SiO 14 compound, which were performed in order to isolate the influence of the magneto-crystalline anisotropy. We found out, to our surprise, that its magnetic susceptibility does experimentally not differ from that of NGS (cf. Fig. 3), demonstrating that the exchange interaction between the Nd 3+ moments in NGS is certainly much smaller than initially estimated, at least not greater than a few K. The above results were confronted to calculations of the CF effects. In NGS, there are 3 distinct Nd 3+ ions per unit cell, each lying on a different 2-fold axis, interrelated through the 3-fold c axis of the crystal, thus giving rise to multi-axial low symmetry CF potentials. The associated Hamiltonian for each Nd 3+ ion in the ground multiplet J=9/2 can be expressed as n Racah operators and with respect to a local frame where the 2-fold axis is the quantization axis for the angular momentum. Ignoring exchange interactions this provides with an energy spectrum which can be compared with the transitions detected in the ToF spectra and can be used to calculate the specific heat. The magnetization and susceptibility are obtained from the eigenfunctions and must be averaged over the 3 Nd 3+ ions. This forced us to work in a common global frame with the c axis as the quantization axis and to perform appropriate rotations of the Racah operators. It was illusory to try to determine the 9 independent A 2q 2p coefficients at once. Thus, in a first step the A 0 2p /A 2q 2p ratios were calculated in the point charge model from the first coordination shell of eight O 2− (cf. Fig. 4). Qualitatively good results were already obtained, reproducing in particular the crossing of the susceptibility for applied fields parallel and perpendicular to c. This crossing is due to the 4 th order terms of H CF. The A 2q 2p coefficients were, in a second step, slightly varied in order to better account for all the experimental constrains (details of the calculations will be given elsewhere). With the best set of A 2q 2p parameters, the energy spectrum consists of 5 degenerate doublets, the first two being separated from the ground state doublet by 90 K and 324 K respectively, in rather good agreement with the ToF spectra considering the width of the measured excitations. The ground state in the global frame with the c quantization axis is a combination of | ± 7/2 >, | ± 5/2 > and | ± 3/2 > states with a maximum weight for the | ± 5/2 > state. The good agreement between the calculated and measured magnetic isotherms and susceptibility is shown in Fig. 4. A first observation is that the low temperature reduced moment must be attributed to a CF effect, the so-called field-induced magnetic phase being hence a polarized paramagnet, at least at 1.6 K, as in Tb 2 Ti 2 O 7. A second observation is that the susceptibility reaches the high temperature behaviour above 2000 K. This regime occurs thus at a temperature much higher than the one associated to the highest crystal field level energy (665 K). This is a consequence of the large 6 th order terms, shifting the inverse susceptibil- ities upward, which explains why the previous estimation of the exchange interactions went erroneous despite the almost linear variations of the inverse susceptibility. The CF analysis confirms the smallness of the exchange interaction in consistency with the absence of spatial correlations down to 1.4 K. This suggests a single-ion origin for the measured magnetic relaxation both in the varying and independent temperature regimes, as probed by the neutron spectroscopy. The first excited doublet of the calculated CF spectrum lies at an energy in qualitative agreement with the barrier extracted from the ToF and NSE measurements at temperatures above 40 K. The thermally activated dynamics in this temperature range are most probably mediated by the spin-phonon interaction. On decreasing the temperature, this progressively slows down, but below 10 K is short-circuited by another process with a temperature independent relaxation time. This strongly suggests quantum relaxation phenomena and calls to mind the dynamical cross-over observed in spin ice compounds. The origin of this relaxation is still unclear but could be related to the only feature not accounted for by the CF calculation: the rise of the specific heat at very low temperature. A splitting of the ground state doublet was suggested in ref. 9 from extrapolation of Tof data to zero-field under magnetic field. Assuming this suggestion, we fitted the specific heat by a T −2 law in agreement with the tail of a Schottky anomaly associated with a two-level system (cf. Fig. 3). This gives an energy gap of ≈235 mK, in good agreement with the reported zero-field extrapolated splitting. Although the cause of this splitting is unidentified, we know that it should necessarily break the time reversal symmetry, since the Nd 3+ are Kramers ions. An interaction involving odd powers of the ladder operators of the Nd 3+ angular momentum would do, by providing with non-diagonal matrix elements mixing the two orthogonal states of the doublet. The consequences of this low temperature dynamics on the cooperative magnetic phase, expected when the exchange interactions and the geometric frustration become significant, can now be addressed. A cooperative dynamical behaviour presenting longer fluctuation times than the fluctuations created by the proposed single-ion quantum process would indeed be hindered. This, thus, queries the nature of the phase associated to the ring-like Q-distribution at 46 mK. In conclusion, the experimental re-investigations of the kagome-like rare-earth NGS compound combined with CF analysis have allowed featuring its magnetism on firm grounds, solving previous inconsistencies. The interpretation of the relaxation plateau of the moment dynamics in terms of cooperative processes is ruled out. Its origin must rather be sought from single-ion quantum processes. The effects of the geometrical frustration then would be hidden emerging only at very low temperature. This work was financially supported by the ANR 06-BLAN-01871. |
At least three people were drowned when a sailboat carrying illegal immigrants ran aground off the Greek island of Rhodes on Monday. Rough Cut (no reporter narration).
ROUGH CUT (NO REPORTER NARRATION) A wooden sailboat carrying dozens of immigrants ran aground on Monday off the coast of the Greek island of Rhodes and at least three people have drowned, the Greek coast guard said. More than 90 people were rescued and 30 of those taken to hospital. The boat was totally wrecked, the coast guard said. "We have recovered three bodies so far - that of a man, a woman and a child," a Greek coast guard official said. The incident followed the drowning of hundreds of migrants after their boat capsized off the Libyan coast on Sunday. Greek TV footage showed parts of the boat in the latest disaster floating in the water off Rhodes and people holding on to it or swimming to the shore. A surge in people fleeing violence and poverty in Africa and the Middle East has increased the pressure on Greece, a gateway into the EU for migrants who attempt risky boat crossings. Greece last week announced a series of measures to deal with the wave of refugees - most of them from Syria - but said this wan international problem, not only a Greek one. About 1,500 migrants have died this year seeking to reach Europe. |
The Mad Catz Cyborg R.A.T. 9 gaming mouse was mentioned some time last year, and again at CES 2010, so was pleasantly surprised when the device was finally released. You can see from the images that nothing has changed, so that tells us that the thing is big and heavy; although Devin Coldewey from CrunchGear thinks it is awesome.
The concept behind the Mad Catz Cyborg R.A.T. 9 is that it is a customizable mouse, Coldewey points to the fact that this has already been done before. I have to say that not like this though; I do agree that the thing looks heavy, but it is much better to feel the weight of something while gaming — I believe this helps you to stay in control.
Having a brief look at the review of the device, it is clear to see that Coldewey thinks that the R.A.T. 9 is awesome, the fact that it has a precise sensor and he loves the hair-trigger main buttons. However, there is a downside; some might think that the mouse is a bit on the large side and that it eats battery life.
For those of you who love your gaming, then the Mad Catz Cyborg R.A.T. 9 is one to consider, but the reviewer believes that there are better options out there. Two that he mentions is a Mamba or Logitech MX Revolution.
I know a few PC gamers, and I am not certain that they will be too happy changing the batteries that often, this could be the one thing that goes against it. Do you think that will make a difference?
For those of you Mad Catz fans, then maybe you should consider the new accessories just for Black Ops.
no problem with the battries they last long enough trust me this is the future, did have a logitech G7 this mouse makes it look like a childs toy awsome, buy one now and you will not look back, logitech i love you but you just got owned sorry.
I think the guy that reviewed this has never used this mouse. I own it and it is flawless battery lasts for almost two days of serious use. Black mamba which I also own does not even come close. |
Binary Feature Classification for Word Disambiguation in Statistical Machine Translation In statistical machine translation, there are many source words that can present different translations. The usual approach to disambiguating these words is to use a target language model. These models are based on local phenomena and in many cases are not capable of properly translating some of these words. To deal with this problem, a new approach is proposed that is based on the so-called naive Bayesian classifier. After a process of automatic selection of ambiguous words, an adequate binary feature set that maximizes the information gain is chosen. A Bayesian classifier can be used to choose the most adequate translation of a word, using this feature set. Experimental results on a parallel corpus (approximately 650,000 Spanish-Catalan sentence pairs) show the benefits that the proposed method can achieve. |
<gh_stars>0
/*
* Copyright 2020 Google LLC
*
* 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://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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/cx/v3beta1/test_case.proto
package com.google.cloud.dialogflow.cx.v3beta1;
/**
*
*
* <pre>
* Represents a test case.
* </pre>
*
* Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TestCase}
*/
public final class TestCase extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.TestCase)
TestCaseOrBuilder {
private static final long serialVersionUID = 0L;
// Use TestCase.newBuilder() to construct.
private TestCase(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private TestCase() {
name_ = "";
tags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
displayName_ = "";
notes_ = "";
testCaseConversationTurns_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new TestCase();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private TestCase(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
tags_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
tags_.add(s);
break;
}
case 26:
{
java.lang.String s = input.readStringRequireUtf8();
displayName_ = s;
break;
}
case 34:
{
java.lang.String s = input.readStringRequireUtf8();
notes_ = s;
break;
}
case 42:
{
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
testCaseConversationTurns_ =
new java.util.ArrayList<
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>();
mutable_bitField0_ |= 0x00000002;
}
testCaseConversationTurns_.add(
input.readMessage(
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.parser(),
extensionRegistry));
break;
}
case 82:
{
com.google.protobuf.Timestamp.Builder subBuilder = null;
if (creationTime_ != null) {
subBuilder = creationTime_.toBuilder();
}
creationTime_ =
input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(creationTime_);
creationTime_ = subBuilder.buildPartial();
}
break;
}
case 98:
{
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.Builder subBuilder = null;
if (lastTestResult_ != null) {
subBuilder = lastTestResult_.toBuilder();
}
lastTestResult_ =
input.readMessage(
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(lastTestResult_);
lastTestResult_ = subBuilder.buildPartial();
}
break;
}
case 106:
{
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.Builder subBuilder = null;
if (testConfig_ != null) {
subBuilder = testConfig_.toBuilder();
}
testConfig_ =
input.readMessage(
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(testConfig_);
testConfig_ = subBuilder.buildPartial();
}
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
tags_ = tags_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
testCaseConversationTurns_ =
java.util.Collections.unmodifiableList(testCaseConversationTurns_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.cx.v3beta1.TestCaseProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_TestCase_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.cx.v3beta1.TestCaseProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_TestCase_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.cx.v3beta1.TestCase.class,
com.google.cloud.dialogflow.cx.v3beta1.TestCase.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TAGS_FIELD_NUMBER = 2;
private com.google.protobuf.LazyStringList tags_;
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @return A list containing the tags.
*/
public com.google.protobuf.ProtocolStringList getTagsList() {
return tags_;
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @return The count of tags.
*/
public int getTagsCount() {
return tags_.size();
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param index The index of the element to return.
* @return The tags at the given index.
*/
public java.lang.String getTags(int index) {
return tags_.get(index);
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param index The index of the value to return.
* @return The bytes of the tags at the given index.
*/
public com.google.protobuf.ByteString getTagsBytes(int index) {
return tags_.getByteString(index);
}
public static final int DISPLAY_NAME_FIELD_NUMBER = 3;
private volatile java.lang.Object displayName_;
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The displayName.
*/
@java.lang.Override
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
}
}
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for displayName.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int NOTES_FIELD_NUMBER = 4;
private volatile java.lang.Object notes_;
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @return The notes.
*/
@java.lang.Override
public java.lang.String getNotes() {
java.lang.Object ref = notes_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
notes_ = s;
return s;
}
}
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @return The bytes for notes.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNotesBytes() {
java.lang.Object ref = notes_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
notes_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TEST_CONFIG_FIELD_NUMBER = 13;
private com.google.cloud.dialogflow.cx.v3beta1.TestConfig testConfig_;
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*
* @return Whether the testConfig field is set.
*/
@java.lang.Override
public boolean hasTestConfig() {
return testConfig_ != null;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*
* @return The testConfig.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestConfig getTestConfig() {
return testConfig_ == null
? com.google.cloud.dialogflow.cx.v3beta1.TestConfig.getDefaultInstance()
: testConfig_;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestConfigOrBuilder getTestConfigOrBuilder() {
return getTestConfig();
}
public static final int TEST_CASE_CONVERSATION_TURNS_FIELD_NUMBER = 5;
private java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>
testCaseConversationTurns_;
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
@java.lang.Override
public java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>
getTestCaseConversationTurnsList() {
return testCaseConversationTurns_;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
@java.lang.Override
public java.util.List<? extends com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder>
getTestCaseConversationTurnsOrBuilderList() {
return testCaseConversationTurns_;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
@java.lang.Override
public int getTestCaseConversationTurnsCount() {
return testCaseConversationTurns_.size();
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn getTestCaseConversationTurns(
int index) {
return testCaseConversationTurns_.get(index);
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder
getTestCaseConversationTurnsOrBuilder(int index) {
return testCaseConversationTurns_.get(index);
}
public static final int CREATION_TIME_FIELD_NUMBER = 10;
private com.google.protobuf.Timestamp creationTime_;
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the creationTime field is set.
*/
@java.lang.Override
public boolean hasCreationTime() {
return creationTime_ != null;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The creationTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getCreationTime() {
return creationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: creationTime_;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder() {
return getCreationTime();
}
public static final int LAST_TEST_RESULT_FIELD_NUMBER = 12;
private com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult lastTestResult_;
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*
* @return Whether the lastTestResult field is set.
*/
@java.lang.Override
public boolean hasLastTestResult() {
return lastTestResult_ != null;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*
* @return The lastTestResult.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult getLastTestResult() {
return lastTestResult_ == null
? com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.getDefaultInstance()
: lastTestResult_;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestCaseResultOrBuilder
getLastTestResultOrBuilder() {
return getLastTestResult();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
for (int i = 0; i < tags_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tags_.getRaw(i));
}
if (!getDisplayNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_);
}
if (!getNotesBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, notes_);
}
for (int i = 0; i < testCaseConversationTurns_.size(); i++) {
output.writeMessage(5, testCaseConversationTurns_.get(i));
}
if (creationTime_ != null) {
output.writeMessage(10, getCreationTime());
}
if (lastTestResult_ != null) {
output.writeMessage(12, getLastTestResult());
}
if (testConfig_ != null) {
output.writeMessage(13, getTestConfig());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
{
int dataSize = 0;
for (int i = 0; i < tags_.size(); i++) {
dataSize += computeStringSizeNoTag(tags_.getRaw(i));
}
size += dataSize;
size += 1 * getTagsList().size();
}
if (!getDisplayNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, displayName_);
}
if (!getNotesBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, notes_);
}
for (int i = 0; i < testCaseConversationTurns_.size(); i++) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
5, testCaseConversationTurns_.get(i));
}
if (creationTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCreationTime());
}
if (lastTestResult_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getLastTestResult());
}
if (testConfig_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getTestConfig());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.TestCase)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.cx.v3beta1.TestCase other =
(com.google.cloud.dialogflow.cx.v3beta1.TestCase) obj;
if (!getName().equals(other.getName())) return false;
if (!getTagsList().equals(other.getTagsList())) return false;
if (!getDisplayName().equals(other.getDisplayName())) return false;
if (!getNotes().equals(other.getNotes())) return false;
if (hasTestConfig() != other.hasTestConfig()) return false;
if (hasTestConfig()) {
if (!getTestConfig().equals(other.getTestConfig())) return false;
}
if (!getTestCaseConversationTurnsList().equals(other.getTestCaseConversationTurnsList()))
return false;
if (hasCreationTime() != other.hasCreationTime()) return false;
if (hasCreationTime()) {
if (!getCreationTime().equals(other.getCreationTime())) return false;
}
if (hasLastTestResult() != other.hasLastTestResult()) return false;
if (hasLastTestResult()) {
if (!getLastTestResult().equals(other.getLastTestResult())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
if (getTagsCount() > 0) {
hash = (37 * hash) + TAGS_FIELD_NUMBER;
hash = (53 * hash) + getTagsList().hashCode();
}
hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
hash = (53 * hash) + getDisplayName().hashCode();
hash = (37 * hash) + NOTES_FIELD_NUMBER;
hash = (53 * hash) + getNotes().hashCode();
if (hasTestConfig()) {
hash = (37 * hash) + TEST_CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getTestConfig().hashCode();
}
if (getTestCaseConversationTurnsCount() > 0) {
hash = (37 * hash) + TEST_CASE_CONVERSATION_TURNS_FIELD_NUMBER;
hash = (53 * hash) + getTestCaseConversationTurnsList().hashCode();
}
if (hasCreationTime()) {
hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER;
hash = (53 * hash) + getCreationTime().hashCode();
}
if (hasLastTestResult()) {
hash = (37 * hash) + LAST_TEST_RESULT_FIELD_NUMBER;
hash = (53 * hash) + getLastTestResult().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.dialogflow.cx.v3beta1.TestCase prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
* <pre>
* Represents a test case.
* </pre>
*
* Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.TestCase}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.TestCase)
com.google.cloud.dialogflow.cx.v3beta1.TestCaseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.cx.v3beta1.TestCaseProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_TestCase_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.cx.v3beta1.TestCaseProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_TestCase_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.cx.v3beta1.TestCase.class,
com.google.cloud.dialogflow.cx.v3beta1.TestCase.Builder.class);
}
// Construct using com.google.cloud.dialogflow.cx.v3beta1.TestCase.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getTestCaseConversationTurnsFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
tags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
displayName_ = "";
notes_ = "";
if (testConfigBuilder_ == null) {
testConfig_ = null;
} else {
testConfig_ = null;
testConfigBuilder_ = null;
}
if (testCaseConversationTurnsBuilder_ == null) {
testCaseConversationTurns_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
testCaseConversationTurnsBuilder_.clear();
}
if (creationTimeBuilder_ == null) {
creationTime_ = null;
} else {
creationTime_ = null;
creationTimeBuilder_ = null;
}
if (lastTestResultBuilder_ == null) {
lastTestResult_ = null;
} else {
lastTestResult_ = null;
lastTestResultBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dialogflow.cx.v3beta1.TestCaseProto
.internal_static_google_cloud_dialogflow_cx_v3beta1_TestCase_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestCase getDefaultInstanceForType() {
return com.google.cloud.dialogflow.cx.v3beta1.TestCase.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestCase build() {
com.google.cloud.dialogflow.cx.v3beta1.TestCase result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestCase buildPartial() {
com.google.cloud.dialogflow.cx.v3beta1.TestCase result =
new com.google.cloud.dialogflow.cx.v3beta1.TestCase(this);
int from_bitField0_ = bitField0_;
result.name_ = name_;
if (((bitField0_ & 0x00000001) != 0)) {
tags_ = tags_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.tags_ = tags_;
result.displayName_ = displayName_;
result.notes_ = notes_;
if (testConfigBuilder_ == null) {
result.testConfig_ = testConfig_;
} else {
result.testConfig_ = testConfigBuilder_.build();
}
if (testCaseConversationTurnsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
testCaseConversationTurns_ =
java.util.Collections.unmodifiableList(testCaseConversationTurns_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.testCaseConversationTurns_ = testCaseConversationTurns_;
} else {
result.testCaseConversationTurns_ = testCaseConversationTurnsBuilder_.build();
}
if (creationTimeBuilder_ == null) {
result.creationTime_ = creationTime_;
} else {
result.creationTime_ = creationTimeBuilder_.build();
}
if (lastTestResultBuilder_ == null) {
result.lastTestResult_ = lastTestResult_;
} else {
result.lastTestResult_ = lastTestResultBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.TestCase) {
return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.TestCase) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.TestCase other) {
if (other == com.google.cloud.dialogflow.cx.v3beta1.TestCase.getDefaultInstance())
return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (!other.tags_.isEmpty()) {
if (tags_.isEmpty()) {
tags_ = other.tags_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureTagsIsMutable();
tags_.addAll(other.tags_);
}
onChanged();
}
if (!other.getDisplayName().isEmpty()) {
displayName_ = other.displayName_;
onChanged();
}
if (!other.getNotes().isEmpty()) {
notes_ = other.notes_;
onChanged();
}
if (other.hasTestConfig()) {
mergeTestConfig(other.getTestConfig());
}
if (testCaseConversationTurnsBuilder_ == null) {
if (!other.testCaseConversationTurns_.isEmpty()) {
if (testCaseConversationTurns_.isEmpty()) {
testCaseConversationTurns_ = other.testCaseConversationTurns_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.addAll(other.testCaseConversationTurns_);
}
onChanged();
}
} else {
if (!other.testCaseConversationTurns_.isEmpty()) {
if (testCaseConversationTurnsBuilder_.isEmpty()) {
testCaseConversationTurnsBuilder_.dispose();
testCaseConversationTurnsBuilder_ = null;
testCaseConversationTurns_ = other.testCaseConversationTurns_;
bitField0_ = (bitField0_ & ~0x00000002);
testCaseConversationTurnsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getTestCaseConversationTurnsFieldBuilder()
: null;
} else {
testCaseConversationTurnsBuilder_.addAllMessages(other.testCaseConversationTurns_);
}
}
}
if (other.hasCreationTime()) {
mergeCreationTime(other.getCreationTime());
}
if (other.hasLastTestResult()) {
mergeLastTestResult(other.getLastTestResult());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.dialogflow.cx.v3beta1.TestCase parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.cloud.dialogflow.cx.v3beta1.TestCase) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
*
* <pre>
* The unique identifier of the test case.
* [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically.
* Otherwise use format: `projects/<Project ID>/locations/<LocationID>/agents/
* <AgentID>/testCases/<TestCase ID>`.
* </pre>
*
* <code>string name = 1;</code>
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList tags_ =
com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureTagsIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
tags_ = new com.google.protobuf.LazyStringArrayList(tags_);
bitField0_ |= 0x00000001;
}
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @return A list containing the tags.
*/
public com.google.protobuf.ProtocolStringList getTagsList() {
return tags_.getUnmodifiableView();
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @return The count of tags.
*/
public int getTagsCount() {
return tags_.size();
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param index The index of the element to return.
* @return The tags at the given index.
*/
public java.lang.String getTags(int index) {
return tags_.get(index);
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param index The index of the value to return.
* @return The bytes of the tags at the given index.
*/
public com.google.protobuf.ByteString getTagsBytes(int index) {
return tags_.getByteString(index);
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param index The index to set the value at.
* @param value The tags to set.
* @return This builder for chaining.
*/
public Builder setTags(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTagsIsMutable();
tags_.set(index, value);
onChanged();
return this;
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param value The tags to add.
* @return This builder for chaining.
*/
public Builder addTags(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureTagsIsMutable();
tags_.add(value);
onChanged();
return this;
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param values The tags to add.
* @return This builder for chaining.
*/
public Builder addAllTags(java.lang.Iterable<java.lang.String> values) {
ensureTagsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_);
onChanged();
return this;
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @return This builder for chaining.
*/
public Builder clearTags() {
tags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
* <pre>
* Tags are short descriptions that users may apply to test cases for
* organizational and filtering purposes. Each tag should start with "#" and
* has a limit of 30 characters.
* </pre>
*
* <code>repeated string tags = 2;</code>
*
* @param value The bytes of the tags to add.
* @return This builder for chaining.
*/
public Builder addTagsBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureTagsIsMutable();
tags_.add(value);
onChanged();
return this;
}
private java.lang.Object displayName_ = "";
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The displayName.
*/
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for displayName.
*/
public com.google.protobuf.ByteString getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
displayName_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return This builder for chaining.
*/
public Builder clearDisplayName() {
displayName_ = getDefaultInstance().getDisplayName();
onChanged();
return this;
}
/**
*
*
* <pre>
* Required. The human-readable name of the test case, unique within the agent. Limit of
* 200 characters.
* </pre>
*
* <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The bytes for displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
displayName_ = value;
onChanged();
return this;
}
private java.lang.Object notes_ = "";
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @return The notes.
*/
public java.lang.String getNotes() {
java.lang.Object ref = notes_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
notes_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @return The bytes for notes.
*/
public com.google.protobuf.ByteString getNotesBytes() {
java.lang.Object ref = notes_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
notes_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @param value The notes to set.
* @return This builder for chaining.
*/
public Builder setNotes(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
notes_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @return This builder for chaining.
*/
public Builder clearNotes() {
notes_ = getDefaultInstance().getNotes();
onChanged();
return this;
}
/**
*
*
* <pre>
* Additional freeform notes about the test case. Limit of 400 characters.
* </pre>
*
* <code>string notes = 4;</code>
*
* @param value The bytes for notes to set.
* @return This builder for chaining.
*/
public Builder setNotesBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
notes_ = value;
onChanged();
return this;
}
private com.google.cloud.dialogflow.cx.v3beta1.TestConfig testConfig_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.TestConfig,
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.Builder,
com.google.cloud.dialogflow.cx.v3beta1.TestConfigOrBuilder>
testConfigBuilder_;
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*
* @return Whether the testConfig field is set.
*/
public boolean hasTestConfig() {
return testConfigBuilder_ != null || testConfig_ != null;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*
* @return The testConfig.
*/
public com.google.cloud.dialogflow.cx.v3beta1.TestConfig getTestConfig() {
if (testConfigBuilder_ == null) {
return testConfig_ == null
? com.google.cloud.dialogflow.cx.v3beta1.TestConfig.getDefaultInstance()
: testConfig_;
} else {
return testConfigBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
public Builder setTestConfig(com.google.cloud.dialogflow.cx.v3beta1.TestConfig value) {
if (testConfigBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
testConfig_ = value;
onChanged();
} else {
testConfigBuilder_.setMessage(value);
}
return this;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
public Builder setTestConfig(
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.Builder builderForValue) {
if (testConfigBuilder_ == null) {
testConfig_ = builderForValue.build();
onChanged();
} else {
testConfigBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
public Builder mergeTestConfig(com.google.cloud.dialogflow.cx.v3beta1.TestConfig value) {
if (testConfigBuilder_ == null) {
if (testConfig_ != null) {
testConfig_ =
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.newBuilder(testConfig_)
.mergeFrom(value)
.buildPartial();
} else {
testConfig_ = value;
}
onChanged();
} else {
testConfigBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
public Builder clearTestConfig() {
if (testConfigBuilder_ == null) {
testConfig_ = null;
onChanged();
} else {
testConfig_ = null;
testConfigBuilder_ = null;
}
return this;
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.TestConfig.Builder getTestConfigBuilder() {
onChanged();
return getTestConfigFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.TestConfigOrBuilder getTestConfigOrBuilder() {
if (testConfigBuilder_ != null) {
return testConfigBuilder_.getMessageOrBuilder();
} else {
return testConfig_ == null
? com.google.cloud.dialogflow.cx.v3beta1.TestConfig.getDefaultInstance()
: testConfig_;
}
}
/**
*
*
* <pre>
* Config for the test case.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestConfig test_config = 13;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.TestConfig,
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.Builder,
com.google.cloud.dialogflow.cx.v3beta1.TestConfigOrBuilder>
getTestConfigFieldBuilder() {
if (testConfigBuilder_ == null) {
testConfigBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.TestConfig,
com.google.cloud.dialogflow.cx.v3beta1.TestConfig.Builder,
com.google.cloud.dialogflow.cx.v3beta1.TestConfigOrBuilder>(
getTestConfig(), getParentForChildren(), isClean());
testConfig_ = null;
}
return testConfigBuilder_;
}
private java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>
testCaseConversationTurns_ = java.util.Collections.emptyList();
private void ensureTestCaseConversationTurnsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
testCaseConversationTurns_ =
new java.util.ArrayList<com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>(
testCaseConversationTurns_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder>
testCaseConversationTurnsBuilder_;
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>
getTestCaseConversationTurnsList() {
if (testCaseConversationTurnsBuilder_ == null) {
return java.util.Collections.unmodifiableList(testCaseConversationTurns_);
} else {
return testCaseConversationTurnsBuilder_.getMessageList();
}
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public int getTestCaseConversationTurnsCount() {
if (testCaseConversationTurnsBuilder_ == null) {
return testCaseConversationTurns_.size();
} else {
return testCaseConversationTurnsBuilder_.getCount();
}
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn getTestCaseConversationTurns(
int index) {
if (testCaseConversationTurnsBuilder_ == null) {
return testCaseConversationTurns_.get(index);
} else {
return testCaseConversationTurnsBuilder_.getMessage(index);
}
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder setTestCaseConversationTurns(
int index, com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn value) {
if (testCaseConversationTurnsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.set(index, value);
onChanged();
} else {
testCaseConversationTurnsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder setTestCaseConversationTurns(
int index,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder builderForValue) {
if (testCaseConversationTurnsBuilder_ == null) {
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.set(index, builderForValue.build());
onChanged();
} else {
testCaseConversationTurnsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder addTestCaseConversationTurns(
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn value) {
if (testCaseConversationTurnsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.add(value);
onChanged();
} else {
testCaseConversationTurnsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder addTestCaseConversationTurns(
int index, com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn value) {
if (testCaseConversationTurnsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.add(index, value);
onChanged();
} else {
testCaseConversationTurnsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder addTestCaseConversationTurns(
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder builderForValue) {
if (testCaseConversationTurnsBuilder_ == null) {
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.add(builderForValue.build());
onChanged();
} else {
testCaseConversationTurnsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder addTestCaseConversationTurns(
int index,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder builderForValue) {
if (testCaseConversationTurnsBuilder_ == null) {
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.add(index, builderForValue.build());
onChanged();
} else {
testCaseConversationTurnsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder addAllTestCaseConversationTurns(
java.lang.Iterable<? extends com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn>
values) {
if (testCaseConversationTurnsBuilder_ == null) {
ensureTestCaseConversationTurnsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, testCaseConversationTurns_);
onChanged();
} else {
testCaseConversationTurnsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder clearTestCaseConversationTurns() {
if (testCaseConversationTurnsBuilder_ == null) {
testCaseConversationTurns_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
testCaseConversationTurnsBuilder_.clear();
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public Builder removeTestCaseConversationTurns(int index) {
if (testCaseConversationTurnsBuilder_ == null) {
ensureTestCaseConversationTurnsIsMutable();
testCaseConversationTurns_.remove(index);
onChanged();
} else {
testCaseConversationTurnsBuilder_.remove(index);
}
return this;
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder
getTestCaseConversationTurnsBuilder(int index) {
return getTestCaseConversationTurnsFieldBuilder().getBuilder(index);
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder
getTestCaseConversationTurnsOrBuilder(int index) {
if (testCaseConversationTurnsBuilder_ == null) {
return testCaseConversationTurns_.get(index);
} else {
return testCaseConversationTurnsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public java.util.List<
? extends com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder>
getTestCaseConversationTurnsOrBuilderList() {
if (testCaseConversationTurnsBuilder_ != null) {
return testCaseConversationTurnsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(testCaseConversationTurns_);
}
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder
addTestCaseConversationTurnsBuilder() {
return getTestCaseConversationTurnsFieldBuilder()
.addBuilder(com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.getDefaultInstance());
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder
addTestCaseConversationTurnsBuilder(int index) {
return getTestCaseConversationTurnsFieldBuilder()
.addBuilder(
index, com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.getDefaultInstance());
}
/**
*
*
* <pre>
* The conversation turns uttered when the test case was created, in
* chronological order. These include the canonical set of agent utterances
* that should occur when the agent is working properly.
* </pre>
*
* <code>
* repeated .google.cloud.dialogflow.cx.v3beta1.ConversationTurn test_case_conversation_turns = 5;
* </code>
*/
public java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder>
getTestCaseConversationTurnsBuilderList() {
return getTestCaseConversationTurnsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder>
getTestCaseConversationTurnsFieldBuilder() {
if (testCaseConversationTurnsBuilder_ == null) {
testCaseConversationTurnsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurn.Builder,
com.google.cloud.dialogflow.cx.v3beta1.ConversationTurnOrBuilder>(
testCaseConversationTurns_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
testCaseConversationTurns_ = null;
}
return testCaseConversationTurnsBuilder_;
}
private com.google.protobuf.Timestamp creationTime_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
creationTimeBuilder_;
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return Whether the creationTime field is set.
*/
public boolean hasCreationTime() {
return creationTimeBuilder_ != null || creationTime_ != null;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*
* @return The creationTime.
*/
public com.google.protobuf.Timestamp getCreationTime() {
if (creationTimeBuilder_ == null) {
return creationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: creationTime_;
} else {
return creationTimeBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setCreationTime(com.google.protobuf.Timestamp value) {
if (creationTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
creationTime_ = value;
onChanged();
} else {
creationTimeBuilder_.setMessage(value);
}
return this;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder setCreationTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (creationTimeBuilder_ == null) {
creationTime_ = builderForValue.build();
onChanged();
} else {
creationTimeBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder mergeCreationTime(com.google.protobuf.Timestamp value) {
if (creationTimeBuilder_ == null) {
if (creationTime_ != null) {
creationTime_ =
com.google.protobuf.Timestamp.newBuilder(creationTime_)
.mergeFrom(value)
.buildPartial();
} else {
creationTime_ = value;
}
onChanged();
} else {
creationTimeBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public Builder clearCreationTime() {
if (creationTimeBuilder_ == null) {
creationTime_ = null;
onChanged();
} else {
creationTime_ = null;
creationTimeBuilder_ = null;
}
return this;
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.Timestamp.Builder getCreationTimeBuilder() {
onChanged();
return getCreationTimeFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
public com.google.protobuf.TimestampOrBuilder getCreationTimeOrBuilder() {
if (creationTimeBuilder_ != null) {
return creationTimeBuilder_.getMessageOrBuilder();
} else {
return creationTime_ == null
? com.google.protobuf.Timestamp.getDefaultInstance()
: creationTime_;
}
}
/**
*
*
* <pre>
* Output only. When the test was created.
* </pre>
*
* <code>
* .google.protobuf.Timestamp creation_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getCreationTimeFieldBuilder() {
if (creationTimeBuilder_ == null) {
creationTimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
getCreationTime(), getParentForChildren(), isClean());
creationTime_ = null;
}
return creationTimeBuilder_;
}
private com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult lastTestResult_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult,
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.Builder,
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResultOrBuilder>
lastTestResultBuilder_;
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*
* @return Whether the lastTestResult field is set.
*/
public boolean hasLastTestResult() {
return lastTestResultBuilder_ != null || lastTestResult_ != null;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*
* @return The lastTestResult.
*/
public com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult getLastTestResult() {
if (lastTestResultBuilder_ == null) {
return lastTestResult_ == null
? com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.getDefaultInstance()
: lastTestResult_;
} else {
return lastTestResultBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
public Builder setLastTestResult(com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult value) {
if (lastTestResultBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
lastTestResult_ = value;
onChanged();
} else {
lastTestResultBuilder_.setMessage(value);
}
return this;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
public Builder setLastTestResult(
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.Builder builderForValue) {
if (lastTestResultBuilder_ == null) {
lastTestResult_ = builderForValue.build();
onChanged();
} else {
lastTestResultBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
public Builder mergeLastTestResult(
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult value) {
if (lastTestResultBuilder_ == null) {
if (lastTestResult_ != null) {
lastTestResult_ =
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.newBuilder(lastTestResult_)
.mergeFrom(value)
.buildPartial();
} else {
lastTestResult_ = value;
}
onChanged();
} else {
lastTestResultBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
public Builder clearLastTestResult() {
if (lastTestResultBuilder_ == null) {
lastTestResult_ = null;
onChanged();
} else {
lastTestResult_ = null;
lastTestResultBuilder_ = null;
}
return this;
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.Builder
getLastTestResultBuilder() {
onChanged();
return getLastTestResultFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
public com.google.cloud.dialogflow.cx.v3beta1.TestCaseResultOrBuilder
getLastTestResultOrBuilder() {
if (lastTestResultBuilder_ != null) {
return lastTestResultBuilder_.getMessageOrBuilder();
} else {
return lastTestResult_ == null
? com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.getDefaultInstance()
: lastTestResult_;
}
}
/**
*
*
* <pre>
* The latest test result.
* </pre>
*
* <code>.google.cloud.dialogflow.cx.v3beta1.TestCaseResult last_test_result = 12;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult,
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.Builder,
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResultOrBuilder>
getLastTestResultFieldBuilder() {
if (lastTestResultBuilder_ == null) {
lastTestResultBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult,
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResult.Builder,
com.google.cloud.dialogflow.cx.v3beta1.TestCaseResultOrBuilder>(
getLastTestResult(), getParentForChildren(), isClean());
lastTestResult_ = null;
}
return lastTestResultBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.TestCase)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.TestCase)
private static final com.google.cloud.dialogflow.cx.v3beta1.TestCase DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.TestCase();
}
public static com.google.cloud.dialogflow.cx.v3beta1.TestCase getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<TestCase> PARSER =
new com.google.protobuf.AbstractParser<TestCase>() {
@java.lang.Override
public TestCase parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TestCase(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<TestCase> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<TestCase> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3beta1.TestCase getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
|
<gh_stars>0
from typing import Tuple, Dict, List
import jsonpickle as jp
import matplotlib.pyplot as plt
from pkg.config import SIZE
from pkg.state import State
def get_states() -> Dict[Tuple, State]:
with open('resources/' + str(SIZE) + '/states.txt', 'r') as json_file:
return jp.decode(json_file.read(), keys=True)
def save_states(states: Dict[Tuple, State]):
with open('resources/' + str(SIZE) + '/states.txt', 'w') as json_file:
json_file.write(jp.encode(states, keys=True))
def plot_regrets(regrets: List[float]):
plt.plot([t for t in range(len(regrets))], regrets)
plt.show()
def compute_and_save_strategy(states: List[State]):
history_to_strategy = {}
for s in states:
print(s.history)
s.compute_avg_strategy()
history_to_strategy[s.history] = s.avg_strategy
with open('output/' + str(SIZE) + '/strategy.txt', 'w') as json_file:
json_file.write(jp.encode(history_to_strategy, keys=True))
def get_history_to_strategy() -> Dict[Tuple[Tuple], Dict[Tuple, float]]:
with open('output/' + str(SIZE) + '/strategy.txt', 'r') as json_file:
return jp.decode(json_file.read(), keys=True)
|
Influence Mechanism on Supplier Emission Reduction Based on a Two-Level Supply Chain The purpose of this paper is to investigate environmental performance of a supply chain which consists of an upstream supplier and a downstream firm. A mathematical model considering both downstream firms monitoring and governmental intervention is developed. Afterwards, a numerical example is presented to show the equilibriums of these models and the optimal choices of firms and government. The results show that when customers environmental awareness increases, both total environmental impact and social welfare decrease. The downstream firms monitoring will certainly reduce the total environmental impact. In most cases, it does not matter whether the downstream firm chooses to monitor the supplier or not, the total environmental impact and social welfare would not be affected when the government chooses subsidy. If a subsidy is present, firms and environment will be better than those without subsidy. Hence, the government is more likely to choose to provide subsidy and the downstream firm will not monitor the suppliers greenhouse gas (GHG) emissions reduction effort. In a few cases when environmental impact is too large, taxation may be the optimal choice for the government and the downstream firm will choose to monitor the suppliers GHG emissions reduction investment. Introduction Increasingly stringent environmental regulations and environmental protection pressure from the public have forced the supply chain terminal enterprises to pay more attention to their suppliers' performance, and implement green supply chain management. Wal Mart attaches importance to sustainable development and is committed to helping suppliers reduce carbon emissions. Wal Mart has proposed a global "1 billion ton emission reduction project" to join hands with suppliers to reduce greenhouse gas emissions in the global business value chain by 1 billion tons by 2030. Among them, Wal Mart officially launched the global "1 billion tons emission reduction project" in China in 2019. Apple works closely with its suppliers to fulfill its commitment to the environment step by step. Apple has pledged to be carbon neutral throughout its supply chain by 2030, meaning the entire supply chain will be 100 percent carbon neutral. Next, Apple will focus on Foxconn and other manufacturing suppliers, and increase capital support for suppliers to reduce emissions. Suppliers' environmental performance has been paid more and more attention by enterprises, and methods for selecting the best supplier in consideration of environmental standards are proposed. Stackelberg game method and other methods are used to study and analyze the benefits of retailers' low-carbon investment on manufacturers and the whole supply chain. The main finding is that low carbon investment by retailers is beneficial. Through realistic exploration, it is concluded that the company can be more competitive in the market by adopting green supply chain practices. The existence of supply chain coordination contract has an incentive effect on the improvement of environmental performance of suppliers and downstream enterprises. The study of consumers' preference for low carbon driven by the reduction of carbon emissions is focused on. Consumers' concern about corporate environmental performance and the demand for sustainable products can drive the sustainable production of enterprises. In view of China's commitment to carbon emissions in 2020, China's per unit GDP carbon dioxide emissions fell 40-45% from the year of 2005, the government and enterprises are facing different levels of pressure and challenges. In order to better protect the environment, on the one hand, some governments impose taxes on enterprises to punish them for their environmental pollution. On the other hand, some government subsidies are used to guide enterprises to implement emission reduction, for example, Beijing has introduced "Beijing approach to support the use of cleaner production funds" to guide and support enterprises' effort to implement cleaner production. Haicang District of Xiamen city has implemented energy-saving emissions reduction fund grants to encourage more enterprises to carry out energy conservation and emissions reduction. It can be seen that the government's policy intervention has an important role in emission reduction. There is already a large body of work on the low-carbon supply chain and government intervention in the enterprise and government decision-making. The trade-old-forremanufactured (TOR) model for a scenario of carbon tax and government subsidies is established and found that in the absence of carbon tax constraints, the improvement of consumers' environmental awareness may lead to the increase of enterprises' carbon emissions. An economic model is developed to study the impact of the environmental awareness of consumers, the taxes and competition on corporate emissions reduction decisions. The effective implementation of green supply practices in the textile and garment supply chain requires the joint efforts of green technology innovation, consumer awareness, and government regulatory agencies. Considering a supply chain of a manufacturer and a retailer, when consumers are sensitive to the environmental profile of the manufacturer's products, the channel structure of the supply chain members is different, and the cooperation between retailers and manufacturers to promote the green innovation of the manufacturer's products, the equilibrium decision is compared. Manufacturers meet consumers' green requirements through innovative processes and provide guidance for supply chain managers. Including an upstream supplier and a downstream enterprise, it is considered who the holder of the responsibility should be and have the right to provide the contract in the supply chain. But these studies do not discuss the government's decision-making. A few scholars discuss the government subsidy for the green innovation of duopoly, and the Optimal Subsidy Policy of the government and the corresponding management decision of the manufacturer in dealing with government subsidy. Some papers discuss the government subsidies to producers for remanufacturing activities, and environmental taxes. Moreover, they also focused on the implementation by the downstream enterprise of green strategy, the evolution process of the downstream enterprise operation model under the market mechanism, and analyzed the role of the government. Some other papers discuss how to promote recycling and remanufacturing activities through subsidies and tax incentives under the extended producer responsibility system. Some scholars study the effectiveness of Sweden's carbon tax using an econometric method and notice that the use of a carbon tax alone has a small effect on carbon dioxide emissions in Sweden, except for gasoline. Subsidies for green innovation funded by carbon tax revenues can significantly reduce carbon emissions. But there are limited discussion about the emissions reduction behavior of the producers and the cooperation or supervision between the members of the supply chain. The effects of government subsidies, carbon taxes, and cost-sharing contracts for energy conservation and emission reduction of upstream and downstream enterprises on supply chain coordination are discussed. In addition, this paper does not discuss the impact of the relationship between government and consumers on environmental performance, as other scholars have done the relevant research. The impact of consumer subsidies on green technology innovation of automobiles and the environmental impact are studied, and the conclusion is that consumer subsidies have a positive impact on the environment. In view of the above, to make the research purpose more tangible, this paper uses the model and takes into account the impact of the high cost of pollution in the downstream enterprises, the monitoring of the downstream enterprises and government intervention on the supplier's decision-making, enterprise profits, ecological environment and social welfare. First, a supply chain model without downstream firm's monitoring and governmental intervention is set up. Based on the maximum profit of firms, optimal equilibriums are obtained. Second, when considering the downstream firm's monitoring, a Nash bargaining model on the supplier's emissions reduction level per unit of output produced is set up for the supplier and downstream firms. Third, when considering governmental intervention, a penalty tax may be imposed on the suppliers to force them to substantially reduce GHG emissions. Or an incentive subsidy may be provided for the supplier to encourage more emissions reduction. To solve the equilibrium decision of the government in maximizing social welfare, the environmental impact of supplier's production emissions is included in the social welfare function. Finally, the model of considering both downstream firm's monitoring and governmental intervention is developed. A numerical example is presented to show the equilibriums of these models and the optimal choices of firms and government. This paper will assist government and enterprises in formulating relevant strategies by analyzing the impact of downstream enterprise monitoring and government intervention on supplier emission reduction. Model Building and Basic Assumptions Consider the cost of the supplier's production unit product c; the supplier first gives the wholesale price of the downstream business p c. Downstream enterprises sell the products to consumers with the retail price of p. If consumers are sensitive not only to the retail price; the negative impact on the environment in the production process of the supply chain will also be perceived by consumers and have negative effects on consumer demand. The market demand function of downstream enterprises is: Because whether the consumer is sensitive to the retail price of the product is not the focus of this study, therefore, in order to simplify the calculation, assuming that the retail price sensitivity coefficient is 1. a is the total potential market demand which cannot be ignored to discuss the impact of consumers' environmental awareness on product demand, nor to ignore the role of market scale on carbon emissions in the supply chain. b is consumer awareness of environmental protection, the bigger its value, the more sensitive the consumer is to the supplier's carbon emissions, when b = 0, consumers do not care about the negative impact of carbon emissions by suppliers, therefore, when b = 0 suppliers will not reduce emissions through investment. e 0 represents the supplier's initial unit carbon emissions, ∆e represents the unit production of carbon emissions that the supplier reduces through inputs, which include production technology research and development, investment in cleaner production technology or staff training. So, (e 0 − ∆e) represents the quantity of pollutants discharged per unit of output by supplier that the consumer can perceive in the end. Make T the total carbon emissions, then T = (e 0 − ∆e)D(p,∆e). Assume that the total cost of the supplier's commitment to emission reduction is k(∆e) 2,which means that more energy is required for more emissions reductions. This paper does not consider the supplier can complete reduction, because this is inconsistent with the facts; in reality, often companies are forced to shut down because of serious pollution by the government, therefore, it is assumed that the input cost coefficient is large enough, so that the optimal output of the supplier is always less than the initial discharge, and there exists a unique optimal solution for each stage of the equilibrium solution. Similar to some existing studies, we assume that the input does not change the marginal cost of the enterprise. In addition, we consider investment in emissions reduction or investment in environmental technology innovation literature, set emissions reduction investment as a one-time investment, and only consider the single cycle model, so the cost sharing problems (such as multi cycle, time cost, etc.,) of the entire cycle will not be considered. Since emissions reductions require longer lead times than price setting, it is assumed that the order is: in the first stage the supplier determines the unit displacement ∆e, in the second stage supplier determines the wholesale price p c, in the third stage the downstream enterprises determines the retail price p. Model Analysis The supplier emission reduction model will be established and analyzed in the following three cases, that is, without government subsidy taxation and without supervision of downstream enterprises, without government subsidy taxation but with supervision of downstream enterprises, and considering government subsidy or taxation. Initial Conditions First, the profit function of downstream enterprises and suppliers is: The subscript m represents the downstream enterprise, the subscript c represents the supplier. Using the backward induction method to solve the model, we can get the optimal pricing of the downstream enterprises and suppliers: Once again, the optimal unit discharge: In order to ensure that the company's emission reduction is greater than 0, assuming 8k − b 2 > 0, e 0 < a−c b, therwise, the enterprise will be eliminated from the market. The carbon emissions per unit of output are changed by the supplier's unilateral emission reduction efforts: At this point, the total carbon emissions is: Proposition 1. In the initial case, when e 0 < e 0, with an increase in e 0, the total negative impact of carbon emissions on the environment increased; when e 0 < e 0 < a−c b, with an increase in e 0, the overall negative impact of carbon emissions on the environment is reduced. Furthermore, Proof. Slightly. From we can see that with the increase of e 0, the supplier's unit carbon emissions increased after emissions reduction, and ultimately the market demand reduced, because there is no other external pressure, the only power of enterprises emissions reduction is to keep the demand, so when e 0 is at a low level, pollution is not too serious. The negative effects that carbon emissions brought on demand are not very obvious. Enterprises lack the power of emissions reduction through investment, making the unit emissions of pollutants increase faster than the rate of decline in market demand. So, with the increase in e 0, the total negative impact on the environment caused by emissions is increasing. When e 0 is increased too much (more than 0), pollution reduced market demand significantly, reducing enterprise's orders, and the market demand reduced faster than the rate of the increase in enterprises pollution emissions. So in the case of high pollution, with the increase in e 0, the total negative impact on the environment caused by production reduces. Downstream Enterprises Urged Suppliers to Reduce Emissions Considering the supplier's production process cannot be controlled directly by the upstream and downstream enterprises, and the supplier's pollution will directly affect consumer demand for products of downstream enterprises, it has negative impact on profits and corporate social image. Therefore, in order to meet the demands of consumers, improve the environmental quality of supply chain and corporate social image, and enhance the market demand and downstream business profits, downstream companies often monitor suppliers to increase the intensity of pollution reduction in the production process. Consider the relationship between the downstream enterprises and suppliers to discuss the reduction of unit carbon emissions, which follows the Nash bargaining game as: Function indicates that when the downstream enterprise monitors the supplier, the downstream enterprise only pays attention to the change of the supplier's unit emissions, rather than sharing the cost of this. The optimal solution of ∆e obtained by backward induction is: When compared to no downstream companies to urge, after the discussion of the supplier's unit displacement has indeed been improved, the market demand has been improved, the total carbon emissions is: Comparison of the differences in the total emissions between whether the downstream enterprises urge to get: Proof. Slightly. Proposition 2 shows that although the downstream firm's drive to reduce the supplier's carbon emissions per unit, it does not fully ensure that the supplier's total emissions are reduced. As compared to the initial situation, bargaining behavior increased the level of ∆e. The unit carbon emissions after emission reductions are reduced under the condition of e 0, but because the emission reduction measures stimulate the demand to a certain extent, when the supplier is a heavy polluter(e 0 > 0), the urging behavior of downstream firms stimulates market demand and increases the production order of the firm, indirectly increasing the total carbon emissions. At the same time due to the difficult governance of heavily polluting enterprises (even if ∆e increases, the high level of e 0 will still raise the level of unit emissions after emission reduction), even if the downstream enterprises monitor and urge pollution control, it may not necessarily reduce the negative impact of production emissions on the environment. Consider Government Intervention When the government considers to adopt subsidy or tax policies, this paper is divided into four scenarios to analyze, namely, the government taxation model without supervision of downstream enterprises, the government subsidy model without supervision of downstream enterprises, the government taxation model with supervision of downstream enterprises, and the government subsidy model with supervision of downstream enterprises. Government Taxation In view of the increasing impact of economic development on the natural environment, low-carbon economy has received growing attention, "Twelfth Five-Year Plan for the Control of Greenhouse GHG Emissions" adopted by the State Council in November 2011 is a sign that China's low-carbon development has entered the stage of action. The government has the right to impose an environmental tax on the output of the polluting enterprises in order to punish the negative impact on the environment. Therefore, in this context, assuming that the government imposes a tax m on the unit output of the supplier. When the government is involved, assuming that the first stage is decided by the government, in the second stage the supplier decides the unit emissions reduction De, in the third stage the supplier decides the wholesale price p c, in the fourth stage downstream enterprise determines the retail price p. When the government levies, the downstream business's profit function is unchanged, the profit function of the supplier is: Through the backward induction method, we can obtain the optimal unit discharge: As the government's job is maximization of social welfare, the government cannot be biased toward the interests of a particular sector of the community, but should consider the impact of decision-making on all sectors of society and groups. The government regardless of the adoption of tax or subsidy policy always put the overall impact of the production operation on the environment into the scope of social welfare assessment. So, the expression of social welfare is: where CW is the consumer welfare, GR for government tax revenue, s for suppliers to produce a total carbon emissions of the negative impact on the environment. and e 0 ≤ ∨ e 0, regardless of whether the supplier to reduce emissions through investment, the government should not be taxed. Moreover, 2k−bs. If s > 2k−b 2 2b, m does not show equilibrium solution. Proof. Calculating the social welfare function can obtain the first and two order derivatives of m: It can be seen that, when s > 2k−b 2 2b, ∂ 2 SW ∂m 2 > 0, at this time m does not reach equilibrium solution, this shows that when the negative impact on the environment of production pollution is particularly serious, the social welfare will increase with the increase of government revenue, which indicates that in serious pollution situation, the government would be willing to risk corporate profits and consumer welfare in order to punish polluters, this is mainly because the environmental improvement benefits increased more than other sectors of society welfare loss. However, when s < 2k−b 2 2b, ∂ 2 SW ∂m 2 < 0, the only condition for the existence of the only optimal solution is that m > 0 and m makes e 0 − ∆e > 0. When e 0 is large enough, the first derivative of m has the unique optimal solution to maximize social welfare. Otherwise, when e 0 is small enough, the first derivative of m is always less than 0. With the increase of m, social welfare decreases, regardless of whether the supplier reduction behavior, downstream enterprises, and suppliers will add the government's penalties to the wholesale price and retail price, and ultimately increase consumer costs, reduce consumer welfare, and punitive tax greatly reducing the profits of the enterprise, which is not conducive to industrial development. Because the supplier's pollution is not serious, the welfare improvement of the environmental protection through taxation is not enough to offset its losses to the industry chain and consumers, therefore, when the supplier is a heavily polluting enterprise, even if it has the emissions reduction behavior, the government may resort to taxation; and when the supplier is lighter, the government should not levy taxes. Government Subsidies Although the government has imposed environmental taxes on production, it has been recognized by a number of national and government departments. There are also government subsidies for enterprises to invest in emissions reduction. Emissions reduction often requires companies to innovate in production technology, especially cleaner production technology, which often requires a lot of money. Therefore, assumptions are made about government subsidies for technological innovation investment, and it is assumed that the government provides a certain percentage of subsidy support for supplier emissions reductions, the subsidy ratio is f. At this point the supplier's profit function is: Through the backward induction method, we can obtain the optimal unit discharge: From the above we can see that the government's subsidy ratio must be less than 1, otherwise the supplier's unit emissions reduction is negative. At this point the expression of social welfare is: Proposition 4. If s < 32k−7b 2 8b, when k < 32bs 2 +52b 2 s+21b 3 96b+128s and e 2 < e 0 < e 3, or k > 32bs 2 +52b 2 s+21b 3 96b+128s but e 2 < e 0 < e 3 or e 4 < e 0 < e 1, the optimal subsidy ratio given by the government to the supplier is: In other cases, the f equilibrium solution does not exist. Furthermore, Proof. The first and two order derivatives of f can be obtained by calculating the social welfare function: Since the positive and negative derivatives of the second derivative of f cannot be directly observed from Equation, so first make ∂SW ∂ f = 0, the only point to make, replacing the value back to the second order condition, obtain: It is known that when s > 32k−7b 2 8b, ∂ 2 SW ∂ f 2 > 0, there is no equilibrium solution for f at this time. Similar to the case of government taxes, when the production of pollution to the environment caused by the negative impact of the environment is particularly serious, improving the environment can increase social welfare. When the case of s < 32k−7b 2 8b is considered, the equilibrium solution must make the government's equilibrium subsidy rate 0 < f < 1, and the government's optimal subsidy rate must make the supplier's emission reduction less than its initial emissions, e 0 − ∆e > 0, that is the case of that there is no government unlimited subsidies to make its emission reductions exceed their initial emissions. Considering the existence of the equilibrium solution of the government subsidy, replace the equilibrium expression of f back to Equation, when e 0 > e 4, e 0 − ∆e > 0, while e 0 making 0 < f < 1 must meet that e 0 < min{e 1, e 2 } and e 0 < e 3 or e 0 > min{e 1, e 2 } and. A simple comparison can get e 4 < e 2 and e 1 < e 2 < e 3, so when e 0 < e 3 1. e 1 < e 4, that is when k < 32bs 2 +52b 2 s+21b 3 96b+128s, the equilibrium solution exists if and only if e 2 < e 0 < e 3. Tax and Downstream Enterprise Monitoring Urges Parallel In this case, assuming that the government will impose a tax g on the supplier's output per unit, the supplier's profit function is: The process of obtaining the optimal solution for e is shown in the Formula. Through the backward induction method, we obtain the optimal unit discharge is The expression of social welfare is: The first and second order derivatives of g can be obtained by calculating the social welfare function: Proposition 5. When e 0 < max{e 5, e 6 }, in the case of downstream enterprises to urge suppliers to reduce emissions, the government should not impose a tax on suppliers; when e 0 > max{e 5, e 6 }, the government's optimal tax amount is g = ∧ g, and Government Subsidies and Downstream Enterprise Monitoring In this case, it is assumed that the government's subsidy rate to the supplier is h, and the supplier's profit function is The process of obtaining the optimal solution for ∆e is still shown in the Formula. Through the backward induction method, we obtain the optimal unit discharge: At this point the expression of social welfare is: By calculating the first derivative of the social welfare function on h, the only point that makes ∂SW ∂h = 0 is h *. Proposition 6. When h * makes ∂ 2 SW ∂h 2 < 0, 0 < f < 1 and e 0 − ∆e > 0, h * is the government's optimal subsidy ratio, otherwise the government will not subsidize the reduction of investment suppliers. Numerical Analysis Considering the complexity of the listed, using Maple software as the calculating tool to obtain approximate solutions for each formula, through the numerical analysis, the paper analyzes the enterprise profit, the negative impact of the production on the environment, and the total social welfare under different circumstances in order to get useful conclusions to provide a reference for the relevant government departments and supply chain enterprise decision-making. Because of the different parameters, the government's decision-making is different, so different parameters are used for comparative analysis. This paper uses the basic parameter a = 5000, c = 200, k = 4, s = 1, makes b {0.2,0.4,0.6,0.8}, e 0 {2200,2400,2600,2800} to represent the different levels of consumer awareness of environmental protection and initial unit emissions by suppliers. Since government's decision-making precedes the enterprise's, the government's decision-making must anticipate the decision-making of enterprises. It is seen from Tables 1 and 2, the downstream enterprises urging suppliers to reduce emissions can always increase the profits of the downstream business, but will reduce the profits of suppliers. If the downstream enterprises cannot provide enough subsidies to suppliers, suppliers and downstream enterprises will never reach an agreement. Especially when the government chooses the subsidy model, whether the downstream enterprise urges the supplier to reduce emissions does not affect the profit of the downstream enterprise. If the downstream enterprise urges the supplier to reduce emissions, the profit of the supplier will be greatly reduced, and the downstream enterprise cannot provide the funds to subsidize the supplier, so when the government chooses to subsidize the supplier, the downstream enterprise will not urge the supplier to reduce emissions. When the government chooses the tax model, it can be seen from the numbers 11 and 14 that the downstream enterprises will not urge the suppliers to reduce emissions, and from the combination of the numbers 12 and 15, downstream companies' urging suppliers to reduce emissions will increase the profits of upstream and downstream enterprises at the same time. Downstream enterprises and suppliers can reach an agreement, at this time the downstream enterprises will always urge the supplier to reduce emissions. The downstream business selection behavior is shown in Table 3. Government Policy Downstream Enterprises Subsidies to suppliers Will not urge suppliers to reduce emissions Tax on suppliers Urges its emission reduction (number 12, 15) Do not urge its emission reduction (number 11,14) As can be seen from Table 4, the stronger the consumer awareness of environmental protection, the lower the negative impact on the environment, but also the lower the social welfare. Downstream corporate oversight does reduce the negative impact of supplier production on the environment. In most cases, regardless of whether the downstream companies have urged suppliers to reduce emissions, government subsidies do not have an influence on the negative impact of supplier production on the environment and social welfare, and always better than when there is no government intervention, the government will choose the subsidy model. However, under the combination of parameters 11, 12, 14, and 15, it can be seen that government taxation is more favorable to the environment and is always better than other cases, only from the perspective of protecting the environment. As shown in Table 5, from the perspective of social welfare, only in the combination of numbers 12 and 15, the government tax is better than government subsidies. Moreover, when government taxation and downstream corporate supervision urge are implemented together, there would be greater social welfare. As mentioned earlier, under the combination of numbers 12 and 15, the downstream companies will always urge the supplier to reduce emissions, and suppliers and downstream companies can reach an agreement, and at this point the government will choose the tax model. However, under the combination of numbers 11 and 14, downstream firms will not urge suppliers to reduce emissions, and the government's choice will depend on the focus of government work. When the government is determined to tackle environmental pollution, it will prefer the taxation model. When the government wants to solve the problem of environmental pollution while taking into account the industrial development and consumer welfare, the government will tend to choose the subsidy model. In the combination of other numbers, regardless of whether the downstream companies have urged suppliers to reduce emissions, the negative impact of production on the environment and social welfare is always consistent under the government subsidy model. It is always better than other circumstances, so the government will choose the subsidy model. Therefore, considering the environmental impact and social welfare and other factors, the government's choice is shown in Table 6. In the case of the best choice between government and downstream companies in Tables 3 and 6, it can be seen that in most cases the government will choose to subsidize suppliers and downstream companies will not urge suppliers to reduce emissions; under the combination of numbers 12 and 15, the government will choose to tax the supplier, and downstream companies will urge suppliers to reduce emissions; in the number 11 and 14 combination, regardless of if the government chooses the tax or subsidy model, the downstream companies will not urge suppliers to reduce emissions. Discussion The existing literature and findings have focused on the low-carbon supply chain and government intervention in the enterprise and government decision-making, but there are limited discussion about the emissions reduction behavior of the producers and the cooperation or supervision between the members of the supply chain. To analyze the impact of downstream enterprise monitoring and government intervention on supplier emission reduction, Nash equilibrium model and mathematical models proposed in this study provide a comprehensive consideration about the downstream enterprises urging suppliers to increase emissions reductions, the government of the supplier of production pollution tax incentives or subsidies for suppliers to subsidize when consumers disapprove of supply chain emissions. It should be noted that this paper mostly belongs to the decision-making at the strategic level of enterprises, and the model does not consider various uncertainties and information asymmetry in the actual operation process, such as the uncertainty of demand, the uncertainty of output, and the recycling time of waste products. Considering these uncertainties in future research, we will make the supply chain model more realistic and better guide practice. In addition, this paper considers the relatively simple supply chain structure and the small number of upstream and downstream. In fact, the supply chain network is very complicated. A manufacturer may have multiple suppliers and distributors and face fierce peer competition. So, one of the research directions in the future will be considering horizontal competition effect on the low carbon supply chain management. Conclusions We conclude under what conditions the government should choose tax or subsidy, and the negative impact of production emissions on the environment into the social welfare calculation, the model of optimal environment and total social welfare when the consumer awareness of environmental protection and the degree of pollution of the supplier is different compared by numerical analysis. The analysis shows that under the lack of government intervention, the downstream enterprises' urging suppliers to reduce emissions is always able to enhance the profits of downstream enterprises, but will reduce the profits of suppliers. Only when the downstream enterprises give suppliers a certain amount of subsidies, business and downstream companies will agree on the extent of the reduction. When the government is involved, in most cases, the government will choose to subsidize suppliers, and downstream companies will not urge suppliers to reduce emissions. In a few cases, the government will choose to tax suppliers, while downstream companies will also urge suppliers to reduce emissions. This paper also provides a certain basis for the formulation of government policies. The government can formulate different policies according to different enterprises, distinguish between different situations, and choose taxes or subsidies to reduce pollution. From the perspective of environmental protection, government taxation is more beneficial to the environment than government subsidies, and it is always better than other situations. In terms of consumer welfare and business economic development, government subsidies are more beneficial than taxation. Therefore, the government's choice depends on its priorities. Once the government made up its mind to give priority to environmental pollution, they tend to choose taxation. However, when the government wants to solve the problem of environmental pollution while taking into account industrial development and consumer welfare, they tend to choose subsidies. |
//
// ZGVLHttpTool.h
// 微聊
//
// Created by weimi on 15/8/16.
// Copyright (c) 2015年 weimi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ZGVLHttpTool : NSObject
+ (void)POST:(NSString *)URLString parameters:(id)parameters success:(void (^)(NSDictionary *response))success failure:(void (^)(NSError *zgerror))failure;
@end
|
<reponame>reybahl/Argumentative-Element-Identification
#Import required libraries
import os # Traversing files
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from tqdm import tqdm # Checking progress
train_df = pd.read_csv("../dataset/train.csv") #Read the training csv file
# Tagging Function
# B in front of the label means it is the beginning of the discourse, I in front means it is inside the discourse
def create_ner_tokens():
tokenized_text_file = open("text.txt", "w")
labels_file = open("labels.txt", "w")
train_dir = f"../dataset/train"
for filename in tqdm(os.listdir(train_dir)): #Loop through all the files in the training directory
file_path = os.path.join(train_dir, filename) #Get file path
# checking if it is a txt file
if os.path.isfile(file_path) and os.path.splitext(file_path)[1] == ".txt":
file_id = os.path.splitext(filename)[0] #Splitting file name with the name and extension
file_df = train_df[train_df["id"] == file_id] #Selecting the part of the training dataframe that contains info about the current file
with open (file_path) as f:
file_text = f.read()
file_discourse_text_list = list(file_df.discourse_text)
file_discourse_type_list = list(file_df.discourse_type)
file_discourse_index_list = list(file_df.predictionstring)
token_list = []
label_list = []
for i, discourse_type in enumerate(file_discourse_type_list):
file_discourse_indices = str(file_discourse_index_list[i]).split() #Getting discourse indices from the predictionstring column
discourse_start = int(file_discourse_indices[0])
discourse_end = int(file_discourse_indices[-1])
if not((i == 0) or (discourse_start == int(str(file_discourse_index_list[i-1]).split()[-1]) + 1)): #Checking if a part of the text is not a discourse
no_discourse_start_index = int(str(file_discourse_index_list[i-1]).split()[-1]) + 1
no_discourse_end_index = int(str(file_discourse_index_list[i]).split()[-1])
no_discourse_text = file_text.split()[no_discourse_start_index:no_discourse_end_index]
for token in no_discourse_text:
token_list.append(token)
# Assigning label O for outside
label_list.append("O")
discourse_text_tokens = file_discourse_text_list[i].split() #Split into word tokens
for token_idx, token in enumerate(discourse_text_tokens):
token_list.append(token)
if token_idx == 0: #Checking if it is the first element
label_list.append("B-" + discourse_type.replace(" ", "")) #B for beginning (eg. B-Claim)
else:
label_list.append("I-" + discourse_type.replace(" ", "")) #I for inside (eg. I-Claim)
tokenized_text_file.write(" ".join(token_list) + "\n") #Separating each token with a space and each essay with a newline
labels_file.write(" ".join(label_list) + "\n") #Separating each label with a space and each essay's labels with a newline
tokenized_text_file.close()
labels_file.close()
create_ner_tokens()
|
extern int otb_6s_dirpopol_(
otb_6s_doublereal *xq,
otb_6s_doublereal *xu,
otb_6s_doublereal *dirpol
);
|
<filename>aspirant_application/Graphics.Textures.cpp<gh_stars>0
#include "Graphics.Textures.h"
#include "Common.Utility.h"
#include <SDL_image.h>
#include "Data.JSON.h"
#include <map>
namespace graphics::Textures
{
static std::map<std::string, SDL_Texture*> textures;
static void Finish()
{
for (auto& entry : textures)
{
if (entry.second)
{
SDL_DestroyTexture(entry.second);
entry.second = nullptr;
}
}
textures.clear();
}
static void Add(const std::string& name, SDL_Texture* texture)
{
textures[name] = texture;
}
void InitializeFromFile(SDL_Renderer* renderer, const std::string& fileName)
{
atexit(Finish);
auto properties = data::JSON::Load(fileName);
for (auto& entry : properties.items())
{
std::string imageFileName = entry.value();
Add(entry.key(), IMG_LoadTexture(renderer, imageFileName.c_str()));
}
}
SDL_Texture* Read(const std::string& name)
{
auto iter = textures.find(name);
if (iter != textures.end())
{
return iter->second;
}
return nullptr;
}
} |
Coaxial cables having uniform characteristic impedance along their entire length (for example, 50 Ohm) are widely used for efficient and distortion-free transmission of high-frequency signals ranging from MHz to GHz bands. Depending on desired characteristic impedance and other parameters of the coaxial cables, they are made in various dimensions and designs. Generally, a coaxial cable consists of a center conductor made of a copper or a copper alloy solid wire, surrounded by polyethylene or other plastic dielectric, a braided outer conductor made of tinned copper wire, and an insulating protective layer or jacket. The outer conductor of some coaxial cables is made in the form of a tubing without external jacket.
Coaxial cables are usually used in data networks for transmission and reception of data signals of relatively high frequencies. In many cases, it is necessary to use a coaxial connector for linking together such coaxial cables and circuit boards processing such signals. This is due to the fact that soldering a coaxial cable directly to a circuit board results in a poor maintenance serviceability.
Examples of conventional connectors for joining coaxial cables to circuit boards can be found in Patent Disclosures JP (1990)-223169 and JP (1991) 3-1460 made by the inventor of this utility model. In the first example, a pressure-type signal contact and a semi-cylindrical ground contact for the outer or grounding conductor are arranged inside the housing. A prepared and stripped coaxial cable is connected to these signal and ground contacts and clamped by the hinged cover. As the result, the signal conductor and the ground conductor of the coaxial cable become connected respectively to the signal contact and the ground contact. The connector according to the second example, has basically the same design as the first example; that is, it has a pressure-type signal connector and a semi-cylindrical ground contact to which the prepared end of the coaxial cable is clamped by means of the hinged cover.
Disadvantages of the connectors according to the examples described above are that they are of relatively complicated design, are expensive, and do not satisfy the requirements of miniaturization and high-density assembly. In addition, the process of connection of a coaxial cable to the connector is almost as complicated as soldering.
The purpose of this invention consists in offering a coaxial cable connector which is small enough for high-density assembly and provides simple and reliable connection. |
<reponame>rjablonx/intel-cmt-cat
################################################################################
# BSD LICENSE
#
# Copyright(c) 2019-2020 Intel Corporation. All rights reserved.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
################################################################################
from .resctrl import Resctrl
from .perf import Perf
from .features_rdt import FeaturesRdt
class FeaturesRdtOs(FeaturesRdt):
def __init__(self):
self.resctrl = Resctrl()
self.perf = Perf()
def _check_resctrl_info_dir(self, dir_name):
if not self.resctrl.is_mounted():
return False
if not self.resctrl.info_dir_exists(dir_name):
return False
return True
def is_l2_cat_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
result = self._check_resctrl_info_dir("L2")
self.resctrl.umount()
return result
def is_l2_cdp_supported(self):
self.resctrl.umount()
if not self.resctrl.mount(cdpl2=True):
return False
result = self._check_resctrl_info_dir("L2CODE") or \
self._check_resctrl_info_dir("L2DATA")
self.resctrl.umount()
return result
def is_l3_cat_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
result = self._check_resctrl_info_dir("L3")
self.resctrl.umount()
return result
def is_l3_cdp_supported(self):
self.resctrl.umount()
if not self.resctrl.mount(cdp=True):
return False
result = self._check_resctrl_info_dir("L3CODE") or \
self._check_resctrl_info_dir("L3DATA")
self.resctrl.umount()
return result
def is_cqm_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
result = self._check_resctrl_info_dir("L3_MON") or \
self._check_resctrl_info_dir("L2_MON")
self.resctrl.umount()
return result
def _resctrl_is_cqm_llc_occupancy_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
mon_features = self.resctrl.get_mon_features()
self.resctrl.umount()
return 'llc_occupancy' in mon_features
def _perf_is_cqm_llc_occupancy_supported(self):
return self.perf.is_mon_event_supported("llc_occupancy")
def is_cqm_llc_occupancy_supported(self):
return self._resctrl_is_cqm_llc_occupancy_supported() or \
self._perf_is_cqm_llc_occupancy_supported()
def is_mba_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
result = self._check_resctrl_info_dir("MB")
self.resctrl.umount()
return result
def is_mba_ctrl_supported(self):
self.resctrl.umount()
if not self.resctrl.mount(mba_mbps=True):
return False
result = self._check_resctrl_info_dir("MB") and \
self._check_resctrl_info_dir("L3_MON")
if result:
schemata = self.resctrl.get_schemata()
result = schemata.get('MB', 0) > 100
self.resctrl.umount()
return result
def _resctrl_is_mbm_local_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
mon_features = self.resctrl.get_mon_features()
self.resctrl.umount()
return 'mbm_local_bytes' in mon_features
def _perf_is_mbm_local_supported(self):
return self.perf.is_mon_event_supported("local_bytes")
def is_mbm_local_supported(self):
return self._resctrl_is_mbm_local_supported() or \
self._perf_is_mbm_local_supported()
def _resctrl_is_mbm_total_supported(self):
self.resctrl.umount()
if not self.resctrl.mount():
return False
mon_features = self.resctrl.get_mon_features()
self.resctrl.umount()
return 'mbm_total_bytes' in mon_features
def _perf_is_mbm_total_supported(self):
return self.perf.is_mon_event_supported("total_bytes")
def is_mbm_total_supported(self):
return self._resctrl_is_mbm_total_supported() or \
self._perf_is_mbm_total_supported()
|
/* To find a best fit memory partition */
Block* find_hole(int size){
Block* best_block = NULL;
Block* current_block = memory;
while(current_block->used != 0 || current_block->size < size+sizeof(Block)){
if(((void *)current_block+(current_block->size)) >= memory+memory_size){
return NULL;
}
current_block = (void *)current_block+(current_block->size);
}
best_block = current_block;
while(((void *)current_block+(current_block->size))<memory+memory_size){
current_block = (void *)current_block+(current_block->size);
if(current_block->size < best_block->size && current_block->size >= size+sizeof(Block)&& current_block->used == 0){
best_block = current_block;
}
}
return best_block;
} |
We built StarMaker so that anyone and everyone could know what it feels like to be the lead singer of their favorite song. Whether you simply want to hear your own singing voice, or you have a voice that seriously needs to be heard, we’ve created a place just for you.
With the new round of funding, StarMaker will focus on expanding its global platform to discover and elevate talent as well as launching its programming initiatives. |
Square Enix have announced that Kingdom Hearts HD 2.5 ReMIX, the HD collection of Kingdom Hearts II Final Mix, Kingdom Hearts Birth by Sleep Final Mix and Kingdom Hearts Re:coded HD Cinematic Story Videos for the PlayStation 3 will be playable at Paris Games Week 2014. Paris Games Week 2014 takes place between October 29 and November 2, 2014. It will be held at the Parc des expositions de la porte de Versailles in Paris, France.
It is likely the playable demo will be the same one from other events in Europe, North America and Australia including E3 2014 and New York Comic Con 2014 but there is a chance it will be like Tokyo Game Show 2014's with the final release of the HD collection playable with various save files. It remains to be seen if there will be a new trailer for this event but if there is we'll let you know.
Kingdom Hearts HD 2.5 ReMIX releases in North America on December 2, 2014, December 4, 2014 in Australia and December 5, 2014 in Europe exclusively on the PlayStation 3 computer entertainment system. |
/*
** EPITECH PROJECT, 2020
** my_strncmp
** File description:
** Compare nb character of the string
*/
int my_strncmp(char const *s1, char const *s2, int nb)
{
int vals1 = 0, vals2 = 0;
for (int i = 0; i != nb; i++) {
vals1 += (int)s1[i];
vals2 += (int)s2[i];
}
return (vals1 - vals2);
} |
In vivo human lower limb muscle architecture dataset obtained using diffusion tensor imaging Gold standard reference sets of human muscle architecture are based on elderly cadaveric specimens, which are unlikely to be representative of a large proportion of the human population. This is important for musculoskeletal modeling, where the muscle force-generating properties of generic models are defined by these data but may not be valid when applied to models of young, healthy individuals. Obtaining individualized muscle architecture data in vivo is difficult, however diffusion tensor magnetic resonance imaging (DTI) has recently emerged as a valid method of achieving this. DTI was used here to provide an architecture data set of 20 lower limb muscles from 10 healthy adults, including muscle fiber lengths, which are important inputs for Hill-type muscle models commonly used in musculoskeletal modeling. Maximum isometric force and muscle fiber lengths were found not to scale with subject anthropometry, suggesting that these factors may be difficult to predict using scaling or optimization algorithms. These data also highlight the high level of anatomical variation that exists between individuals in terms of lower limb muscle architecture, which supports the need of incorporating subject-specific force-generating properties into musculoskeletal models to optimize their accuracy for clinical evaluation. Introduction The musculoskeletal architecture (i.e. the macroscopic arrangement of muscle fibers ) of the human lower limb has been well defined, with several extensive data sets published. However, these "gold standard" reference data sets are based on elderly cadaveric specimens, which for various reasons, such as possible changes in muscle architecture due to aging, are unlikely to be representative of young, active and healthy adults. These differences have been highlighted in regards to muscle volumes, although the extent of variation in muscle architecture properties such as muscle fiber length, pennation angle and maximum isometric force is largely unknown. This is particularly important in the context of musculoskeletal modeling using dimensionless Hill-type muscle models, which are defined by these properties. Importantly, various sensitivity analyses have shown that these models are particularly PLOS sensitive to even small changes in muscle fiber and tendon slack lengths in particular. Furthermore, how well these parameters scale with respect to body anthropometric factors such as body or limb mass has also not been reported in detail, although it has been suggested that fiber lengths may not scale particularly strongly with bone length. While muscle architecture parameters can be estimated through optimization, directly measuring these in vivo may improve the accuracy of computational models. Using a previously established framework of diffusion tensor imaging (DTI) and fiber tractography, in combination with other magnetic resonance imaging sequences, this study aims to build on previous literature and provide a detailed human lower limb in vivo muscle architecture data set. This will also highlight the level of inter-subject variability in muscle architecture parameters which exists in young healthy adults, as well as the scaling relationships between muscle architecture and body proportions. Methods For the present study, data were gathered from 20 muscles in the right lower limbs of 10 healthy, non-professionally athletically trained adults (5 males, 5 females; Age-27 ± 4 years. Body mass-76 ± 12 kg; Table 1), who signed informed consent documents prior to participating in this IRB-approved study. The muscles analyzed were classified into 5 distinct functional groups based on major functions (Table 2), which were based on previous human muscle architecture studies. Muscle fiber length, fiber pennation angle and muscle volumes were estimated from each of these muscles, using a validated framework of magnetic resonance imaging (MRI) and DTI ; see below). MRI and DTI acquisition All MR images were acquired from the iliac crest to the ankle joint using a 3 T scanner (Biograph mMR, Siemens, Munich, Germany), with each subject in a supine position and with the lower limbs in the anatomical position. Imaging consisted of two sequences (Fig 1A and 1B): T1-weighted anatomical turbo spin echo (TSE) (voxel size 0.470.476.5 mm 3, repetition time -650 ms, echo time -23 ms, number of slices-35 per segment, number of signal averages (NSA)-1, acceleration factor-2), and diffusion-weighted single-shot dual-refocusing spin-echo planar (voxel size 2.962.966.5 mm 3, TR/TE 7900/65 ms, 12 direction diffusion gradients, b value-0 & 400 s/mm 2, strong fat suppression-spectral attenuated inversion Table 1. Study participant information. Thigh length-the distance between the most proximal aspect of the greater trochanter of the femur, and the most distal aspect of the lateral femoral condyle. Leg length-the distance between the tibial plateau and the center of the ankle (tibiotalar) joint. L L -Total lower limb length. V LM -Total lower limb muscle volume (sum of volumes of the studied muscles). V L -Total lower limb volume (sum of muscle volumes plus fat, fascia and skin)., number of slices-35 per segment, NSA-2, acceleration factor-2, bandwidth-2440 Hz/pixel). Advanced B 0 shimming was done for each segment to reduce spatial distortion and minimize the residual fat chemical shift in the diffusion-weighted images, in the phase-encoding direction (anterior to posterior). For each subject, images were acquired in an axial slice orientation, and repeated for a total of five to six segments, which were merged during post-processing using the Stitching plugin for Fiji/ImageJ. Total image acquisition time was~37mins per subject. The T1-weighted MR images were digitally segmented in Mimics (Materialise, Leuven, Belgium) to create three-dimensional meshes of each muscle (Fig 1C), which allowed for the determination of individual muscle (belly) volumes (mm 3 ). DTI pre-processing and fiber tractography The diffusion tensor images were pre-processed to reduce image artefacts and improve signal to noise ratio. To reduce image artifacts caused by the possible motion of the subjects or spatial distortion (eddy currents and/or magnetic field inhomogeneity), each diffusion-weighted image was registered to the non-diffusion weighted image (with b value 0) using an affine transformation in DTI-studio. To reduce the signal to noise ratio of the images, a Rician noise suppression algorithm was applied to the DTI images in MedINRIA (www.med.inria.fr), where the diffusion tensors for each subject were estimated and smoothed. Manual thresholding removed background pixels from the tensor estimation. Muscle fascicles for each muscle were estimated from these tensors with tractography in Camino software, producing fiber tracts, from regions of interest (ROIs) drawn based on the anatomical T1 MR images (Fig 1D). These tracts were tracked bidirectionally (step size 1mm) from seeding regions of interest (ROIs) and continued until terminated based on defined fiber curvature stopping criteria (angle change >10 degrees per 5mm). These tractography settings were kept consistent between muscles and subjects. While muscle fibers may not necessarily extend the entire length of a muscle fascicle (bundles of~5-10 fibers) and may instead be connected in series, it has been shown that fibers in this arrangement may be activated simultaneously to act like a single fiber. It was therefore assumed here that fiber lengths are functionally equivalent to fascicle lengths, and these terms are used interchangeably. Based on this assumption, custom MATLAB code (available at www.figshare.com-DOI: 10.6084/m9.figshare.9906266) was used to measure L f from these fiber tracts (equivalent to muscle fascicles), and values reported here are means of the entire range of fiber tract lengths throughout each muscle. This is standard practice when Table 2). Muscle fascicles (fibers) were tracked from the diffusion weighted MR images (D). From these 3D point cloud-based models, it was possible to measure fiber length (L f ) and surface fiber pennation angle (, angle of the fibers relative to the muscle's line of action (blue line)). https://doi.org/10.1371/journal.pone.0223531.g001 measuring muscle architecture for inputs into Hill type muscle models, and in this context has been shown to estimate L f to an average accuracy of <1 ± 7 mm. The pennation angle of these fibers was measured here as the angle of the fibers relative to the muscle's line of action. Each muscles' line of action was estimated using the "fit centerline" function on each 3D muscle mesh in Mimics (from the T1-weighted MR images), which estimates a line through the axial centroids of each mesh, and therefore accounts for their oftencurved shapes. The assumption that this line is equivalent to an anatomical line of action has been reported previously. Five superficial (2D) pennation angle measurements were manually recorded at proximal, middle and distal areas of each muscle using ImageJ to obtain a representative mean value. This is also standard practice for estimating this parameter for musculoskeletal models, and has been shown to estimate surface pennation angles to an average accuracy of 4 ± 1. All these methods were performed by the same researcher for each subject, ensuring consistency in the reported muscle architecture data. Predicting optimal fiber lengths A previously recognized limitation of measuring fiber lengths from diffusion tensor images is that estimates of optimal fiber lengths (an important input to musculoskeletal models) are not obtainable using this method alone. This is because sarcomere lengths, which are normalized to a standardized optimal resting sarcomere length to estimate optimal fiber lengths, are not directly measurable from the tracked fibers. Therefore, optimal fiber lengths were estimated using sarcomere lengths reported in, using the following equation : where L f is optimal fiber length, L f ' is raw fiber length (measured from DTI), L s is sarcomere length, and 2.7m is a generic value for optimal sarcomere length. L s values were obtained from Ward et al., who measured L s in fixed muscles dissected from limbs with most joints (other than the ankle joint) in the anatomical position, as in the present study. These parameters were then used to calculate physiological cross-sectional area (PCSA, mm 2 ), a major determinant of muscle force output, using the equation (from ): where V m is muscle (belly) volume (mm 3 ), L f is optimal muscle fiber length (mm), is muscle fiber pennation angle. To estimate maximum isometric force (an important input parameter for musculoskeletal models, F max ), individual PCSA values were multiplied by the isometric stress of skeletal muscle (or specific tension; 0.3Nmm -2 ; ). The use of this generic value for isometric stress is well established within musculoskeletal modeling research, and has been shown to be independent on body size and conserved within vertebrate phylogeny. Given that estimating this value for each individual muscle of the lower limb was out of the scope of this study, it was assumed here to be constant across all muscles. However, it is recognized that in reality this may not be the case, with a wide range of values (0.04-0.6 Nmm 2 ) reported in the literature within human lower limb muscles, depending on function or fiber type. Specializations in muscle architecture parameters within functional groups (i.e. certain muscle functional groups, such as knee extensors, show broadly similar muscle fiber orientations and by extension functional capabilities) have been demonstrated previously in the vertebrate musculoskeletal system [27,30,. Therefore, muscle architecture data obtained here for each muscle were averaged over each functional group within each individual, as well as within the grouped mean values (Tables 1, 2 & S1-S10 Tables). This gives a general insight into the degree of these muscle functional group specializations within the lower limbs of the individuals in this study, and also allows comparisons to similar functional group averages in previous architecture data sets. How these muscle architecture variables scale with body mass, height, total limb volume (V L ) and limb length (L L ) across the different individuals in our study population was tested using linear regression in GraphPad Prism (La Jolla, California, USA; www.graphpad.com). Limb length was defined as the length from the most proximal aspect of the greater trochanter of the femur, to the most distal aspect of the lateral malleolus of the fibula. Results The mean (± standard deviation) in vivo architecture properties for 20 lower limb muscles as measured from DTI and T1 MRI sequences across 10 individuals were determined (Table 3). Muscle architecture data for individual subjects are listed in S1-S10 Tables. The degree to which muscle volume, fiber length and maximum isometric force scaled with subject total limb volume (V LM ) and limb length (L L ) varied considerably between the muscle functional groups (Figs 2 and 3; S11 Table). The mean volume of the muscle groups scaled strongly with V LM (Fig 2A & 2B), although only the knee flexors and knee extensors showed statistically significant scaling relationship between F max and M L (R 2 > 0.5, p < 0.05; Fig 3C, S11 Table). Muscle belly length scaled with L L (Fig 3A & 3B), however L f did not scale particularly strongly with L L in any functional group, with the hip adductors showing the strongest and only statistically significant correlation (R 2 = 0.49, p = 0.02; Fig 3C, S11 Table). Discussion This study used a validated technique to generate an extensive data set of in vivo human lower limb muscle architecture data exclusively from MR images of 10 young healthy individuals. These data define muscle volume, length, optimal fiber length, fiber pennation angle, PCSA and maximum isometric force. The technique of using DTI and muscle fiber tractography to gather detailed muscle architecture data has been previously described and shown to be valid and repeatable [20,. In a study into the validity of the technique for gathering muscle architecture specifically for musculoskeletal models, Charles et al., found that DTI can replicate muscle masses, fiber lengths and PCSA within 4%, 1% and 6% of the corresponding variables measured from manual dissections, respectively. The accuracy of this method raised confidence in our ability to generate an accurate and reliable data set of in vivo lower limb muscle architecture from a population of young healthy adults (Table 2; S1-S10 Tables). This dataset builds on previous attempts to quantify lower limb muscle anatomy with MRI, by focusing on gathering the architecture data necessary to inform musculoskeletal models and simulations. The degree to which these muscle architecture data scale with anthropometric parameters such as limb length, limb volume and body mass, as well as age, within muscle functional groups could indicate the necessity for gathering such an extensive in vivo muscle architecture data set on young, healthy individuals. Muscle belly volume and muscle belly length both scaled reasonably well with limb mass and limb length, respectively, within most functional groups. These scaling relationships are particularly apparent in the ankle plantarflexor muscles, where F max and muscle volume show strong correlations with subject height, body mass, limb volume and limb length. These results agree with those of Handsfield et al.,, who reported similarly strong scaling relationships between muscle belly volume/length and limb length and body mass. However, these data show that muscle fiber length does not scale well with limb length in any muscle functional group, which agrees with previous studies. Table 3. Mean (± standard deviations) architecture properties of 20 lower limb muscles from 10 individuals (5 males, 5 females; Age-27.3 ± 3.95 years. Body mass-76 ± 12.5 kg), plus functional group means. L F :L m -Muscle fiber length muscle length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. Muscle Length (mm) Optimal fiber length (mm) In the context of musculoskeletal modeling, this suggests that the relationship between muscle fiber length and limb length may not necessarily be accurately predicted using scaling or optimization algorithms and could be more complex than other muscle architecture variables. So, while anthropometric scaling can be used to estimate gross anatomical properties such as muscle volume and length, subject-specific imaging of lower limb anatomy is likely necessary to accurately estimate more complex muscle architecture parameters such as muscle fiber lengths, particularly for use in musculoskeletal modeling. The lack of direct correlation between fiber lengths and limb lengths could be explained by inter-subject variation in the length of the external tendinous portion of the musculotendon unit, which has been shown to be related to joint range of motion, particularly in the distal muscle groups of the lower limb. Gathering subject-specific data is further justified by the differences between these data and previously published cadaveric architecture data, such as that described by Ward et al.,. While the general trends in mean architecture properties in our data closely followed those previously described (with many of the same muscles having large PCSA values and long optimal fiber lengths), many differences in absolute values can be seen (see supplementary information for more details). Given the anatomical variation seen within our data set, these differences are most likely due to the variable degrees of muscle architecture scaling between muscle functional groups, as well as the potential effects of ageing. In a study into the kinematic and kinetic effects of ageing, DeVita and Hortobagyi suggested that ageing results in a redistribution of joint and muscle torques throughout the lower limb, with relatively lower ankle but larger hip joint torques and muscle power in elderly compared to younger individuals. While likely associated with changes in gait kinematics with advancing age, this alteration of joint torques could also arise as a result of changes in complex muscle architecture (i.e. reductions in L f :L m ), which were shown here through comparisons to cadaveric muscle architecture and were particularly evident in distal muscles. This supports the accuracy of our data, however as muscle volumes and fiber lengths have only been predicted to decrease 25% and 10% respectively due to ageing effects, anatomical variation, in addition to effects of formalin fixation or possible pathologies in cadaveric specimens in previous dissection studies, is likely another significant reason for differences between these data and cadaveric data. This high level of anatomical variation also supports the potential need for subject-specific musculoskeletal modeling for clinical evaluation. Individualized models have become more common [11,12,, and with novel methods of gathering in vivo muscle architecture, these models could potentially provide more accurate and reliable estimates of muscle function compared to generic or scaled generic models. Limitations While this method of gathering in vivo muscle architecture is becoming more common [20,, there are still some limitations that must be overcome before widespread use in the musculoskeletal modeling and simulation community. Many of these limitations, such as assumptions in how pennation angles and fiber lengths were estimated, are similar to those discussed previously. One important drawback of this method which is particularly significant to its applications for muscle modelling is that it is not possible to estimate optimal fiber lengths. This is often done in dissection studies using laser diffraction to measure sarcomere lengths, however this parameter is not directly measurable from DTI sequences. While optimal fiber lengths were calculated here based on previously published sarcomere lengths, combining DTI with further medical imaging such as micro-endoscopy to obtain in vivo sarcomere lengths from superficial muscles could provide more accurate estimates of optimal fiber length in future studies. Without a subject-specific correction for sarcomere length, the fiber length data presented here require further testing and optimization within the musculoskeletal models to ensure the muscles are operating at the correct part of the forcelength curve. It should be noted that measurement/observer error could have contributed to any lack of correlation seen in here between subject anthropometry and muscle architecture. This most likely had an effect during manual muscle segmentation to determine muscle volumes (and by extension calculate F max ) and measuring pennation angles (which have little effect on musculoskeletal model output-see later discussion). However, as the determination of in vivo muscle fibre lengths was mostly automated and the same fiber tractography stopping criteria were used for each muscle of each subject, any errors in this parameter are likely due to variations in the quality of the diffusion tensor image images, rather than human error. As manual segmentation of vertebrate muscle is an often-used technique for measuring muscle volumes, and all the diffusion tensor images were pre-processed using the same method (see methods) before analysis, the effect of these potential errors on the overall results presented here was likely small. The accuracy and limitations of the fiber tractography framework used here have been discussed previously. However, these had a direct effect on the data presented here. While the average accuracy of the estimated muscle fiber lengths was <1 ± 7 mm, this was variable between subjects and between muscle groups (2 mm in the hip adductors, but 17 mm in the knee extensors). This variability could be due to diffusion tensor image quality or partial volume artefacts from bone or subcutaneous fat, which will have had variable affects depending on the location or size of the muscle being analyzed (see for a detailed discussion on the possible sources of measurement variation in DTI fiber tractography). Despite this variation, even the larger average discrepancies in fiber lengths and pennation angles measurement accuracy mostly fall below the repeatability coefficients reported by Heemskerk et al. (<50 mm for L f, <10.2for ), suggesting that this framework is relatively accurate and repeatable. However, it should be noted that the validation of this framework was performed on cadavers, which were not subject to the same physiological factors which may have affected the repeatability reported by Heemskerk et al. (such as motion, breathing artefacts or body temperature), which could explain the relatively high accuracies previously reported. Nevertheless, while this method shows undoubted potential for the biomechanical modelling field, improving the consistency of the fiber tractography between muscles and individuals is needed for its widespread application. Regarding pennation angles, this study reports lower angles than the limited three-dimensional angles derived from DTI tractography that are currently available in the literature. Values of~30have been previously reported in soleus and medial gastrocnemius muscles, compared to mean values of 12and 9respectively reported here, which are more similar to angles measured from ultrasound or cadaveric data [3,. While these differences to other DTI studies seem substantial, pennation angle is known to be highly dependent on joint position and has been estimated using DTI to change between 9 and 46 with 30r otations in ankle dorsiflexion/plantarflexion. While the subjects in this study were asked to remain in the anatomical position during the image acquisition (with the hip, knee and ankle joints at 0of flexion/extension), it is possible that the ankle joint was not exactly in this position for the duration of each scan. Even small deviations from a neutral position at the ankle joint could have caused large changes in pennation angles, particularly in the ankle dorsiflexor or plantarflexor muscles, and therefore could explain these differences. However, given the low sensitivity of muscle function predictions within musculoskeletal models to variations in the pennation angle input parameter, the 2D surface pennation angles presented here could be sufficient in predicting muscle functions, if these data are to be used as inputs into such models. Nevertheless, further refinements to this framework for more accurately estimating optimal fiber lengths and pennation angles could be of benefit in future studies. Impact and future study This study represents the first instance of an extensive data set of in vivo human lower limb muscle architecture generated purely from medical imaging (DTI and MRI), with a specific focus on implications for biomechanics and musculoskeletal modeling. By investigating the scaling relationships between anthropometric parameters and important muscle force generating properties such as muscle fiber length and maximum isometric force, these data show a lack of correlation between muscle fiber length and anthropometry amongst most muscle functional groups of the lower limb. This means that optimization or scaling algorithms often used to estimate muscle architecture for musculoskeletal modeling may not reliably do so, and that how muscle fiber lengths relate to body proportions may be more complex when compared to similar relationships with other muscle architecture variables. Nevertheless, given the differences between these data and previously published cadaveric architecture data, it is possible that applying the muscle parameters presented here to musculoskeletal models of individuals of similar age or anthropometry could provide more accurate estimates of muscle function than similar data from those previous studies. Furthermore, the accurate muscle fiber paths reconstructed using this method could also improve muscle functional predictions through more accurate representations of muscle moment arms, and can be incorporated into biomechanical models using methods such as that described by Chen et al.,. While this study focused on estimating muscle architecture for young, healthy individuals using DTI, this framework could further benefit the musculoskeletal modeling field by measuring similar parameters in pathological populations (e.g. individuals with cerebral palsy, muscle atrophy, muscular dystrophy, and the elderly ), whose gait and muscle function are often investigated with biomechanical models and simulations. Furthermore, the differences to previous data, as well as the variation within our data set, also lends support to the emergence of subject-specific musculoskeletal modeling. Although generic and scaled-generic models are generally effective at testing general predictions of musculoskeletal function, more detailed modeling analyses such as those predicting rehabilitation or post-surgical outcomes may require the inclusion of subject-specific muscle architecture data for maximum efficacy. Future work will focus on testing these assumptions and further validating this framework. Despite the methods used here to measure muscle architecture in vivo being previously validated specifically for use in musculoskeletal modelling, it is still unclear how accurately the data will simulate muscle functions within these models. The validity of these methods can be further assessed by comparing muscle forces predicted by subjectspecific musculoskeletal models to those measured experimentally, such as from an isokinetic dynamometer. Accurate predictions of muscle forces from subject-specific models would further raise confidence in the validity of this framework in measuring muscle architecture in vivo and forming the basis of individualized musculoskeletal models. Supporting information S1 Table. Architecture properties of 20 lower limb muscles from Subject 01, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S2 Table. Architecture properties of 20 lower limb muscles from Subject 02, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. Table. Architecture properties of 20 lower limb muscles from Subject 03, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. Table. Architecture properties of 20 lower limb muscles from Subject 04, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S5 Table. Architecture properties of 20 lower limb muscles from Subject 05, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. Table. Architecture properties of 20 lower limb muscles from Subject 06, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S7 Table. Architecture properties of 20 lower limb muscles from Subject 07, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S8 Table. Architecture properties of 20 lower limb muscles from Subject 08, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S9 Table. Architecture properties of 20 lower limb muscles from Subject 09, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S10 Table. Architecture properties of 20 lower limb muscles from Subject 10, plus functional group means (± standard deviations). Fiber lengths and pennation angles are expressed as means (± standard deviations) of multiple measurements taken at different areas of each muscle. L f :L m -muscle length fiber length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. (DOCX) S11 Table. Linear regression results (R 2 values) to test the scaling relationships between muscle architecture parameters (L f-muscle fiber length; L f :L m -muscle length fiber length ratio; F max-estimated maximum isometric force; V m-muscle volume; L m -muscle length) and subject age, height, body mass, total limb mass and lower limb length. P values are shown in parentheses. Values italicized and in bold indicate statistical significance (p � 0.05). (DOCX) S12 Table. Mean differences (% differences) between lower limb muscle architecture data derived here from MRI, and those from a previous cadaveric study. Muscle masses from our data were estimated from muscle volumes. L f :L m -Muscle fiber length muscle length ratio. PCSA-Physiological cross-sectional area. F max -estimated maximum isometric force. Sarcomere lengths used to estimate optimal fiber lengths were sourced from Ward et al.,. Table 1. Horizontal dashed line represents the mean value from Ward et al.,. (TIF) S1 File. Comparison to previous architecture data. (DOCX) Resources: William J. Anderst. Writing -original draft: James P. Charles. |
After a report from an inside source that seemed to confirm Battleborn free-to-play rumors, Gearbox’s Randy Pitchford has gone on the record to denounce the story and mention incoming details of a free trial for the game instead.
An initial report from Kotaku brought to light details from an anonymous source about an upcoming business model change for Battleborn, stating that the company had wanted to make the title free-to-play from the start but were pressured to release at retail by publisher 2K Games. The assumed timeline for the conversion was said to come in mid-November, but noted that the announcement date could shift.
Shortly after the story went live, Gearbox CEO Randy Pitchford took to Twitter to debunk the rumors, calling the story “reckless”. Instead, he did mention that the game would be offering some form of free trial that would include the option to purchase a full copy or additional DLC from within the game. According to Pitchford, this trial version is “months away” and won’t be ready for announcement until after the game’s current DLC is released.
Our Thoughts
These conversions always happen in stages, so it really seems more like a question of “when” and not “if” at this point. Battleborn is a solid multiplayer and single-player game that was the victim of poor release timing, and we’d love for the title to have the opportunity to thrive before it becomes completely swept away from the minds of gamers.
Your Thoughts
Do you think a free-to-play conversion for Battleborn will change the game’s fortunes, or is it too late? What about the proposed free trial version? Give us your thoughts about this story in our comments.
Sources: Kotaku, Twitter
Articles Related to Battleborn
SuperData Expects Battleborn Transition to Free-to-Play
Gearbox Lays Out Battleborn DLC Plan
Battleborn Player Count Begins to Flatline
Related: Battleborn |
Francis Collins is leading major HHS-wide initiatives into fighting cancer and neurological disorders. | AP Photo Trump will keep NIH director
President Donald Trump has decided to keep Francis Collins as director of the NIH, the White House announced Tuesday.
There has long been speculation about whether Trump would keep Collins on to oversee the $34 billion per year medical research agency. Rep. Andy Harris, a Republican doctor from Maryland, had also been in the running to be NIH chief.
Story Continued Below
Collins is leading major HHS-wide initiatives into fighting cancer and neurological disorders. The Precision Medicine Initiative, an effort begun last year to study the interaction of genes and environment in more than 1 million Americans, is Collins’ brainchild.
POLITICO Pulse newsletter Get the latest on the health care fight, every weekday morning — in your inbox. Email Sign Up By signing up you agree to receive email newsletters or alerts from POLITICO. You can unsubscribe at any time.
He has sought to defend NIH from the severe cuts proposed in the Trump administration, which would slash nearly $6 billion from the agency's budget.
Collins is an illustrious medical researcher who led an international effort that sequenced the first human genome in 2003. After leading human genome research institute at NIH from 1993 to 2008, he took the helm at NIH and has been there since 2009.
Collins, a guitar-playing, motorcycle-riding, born-again Christian, has written several books on science, medicine, and religion, and is a favorite of many Hill Republicans. |
1. Field of the Invention
The present invention relates to a high frequency module, and particularly relates to technology that can be effectively applied to a high frequency module including an antenna switch to be mounted on a mobile communication device or the like.
2. Background
In recent years, a mobile phone system is adopting various types of communication systems such as the GSM (Global System for Mobile Communications) (registered trademark) system and the W-CDMA (Wideband Code Division Multiple Access) system for realizing a variety of services.
Moreover, the frequency bands used in the respective systems are also diverse, and, for example, with the GSM system, an 850 MHz band, a 900 MHz band, a 1800 MHz band, a 1900 MHz band and the like are used. Moreover, with the W-CDMA system, an 800 MHz band, a 900 MHz band, a 1500 MHz band, a 1700 MHz band, a 1900 MHz band, a 2100 MHz band and the like are used.
In order to use a mobile phone in all countries of the world, a portable terminal that is compatible with a plurality of frequency bands and a plurality of systems is used, and the trend is to use a so-called multi-mode multi-band terminal.
With this type of mobile phone, a high-performance antenna switch capable of switching a plurality of frequency signals is used, and such an antenna switch is undergoing high functionality through, for example, SP4T (Single pole 4 throw) and SP6T (Single pole 6 throw) pursuant to the adoption of multi-band modes and multi-modes.
Moreover, since the CDMA system is compatible with high-speed data communication and the like, the antenna switch is demanded of high IMD (InterModulation Distortion) characteristics (low distortion) in a broad bandwidth.
As technologies for improving the IMD characteristics in this type of antenna switch, there are, for example, a type in which a voltage conversion circuit is activated and applies an output voltage to the antenna switch when the transmission power value of the transmission signal is greater than or equal to a threshold in order to improve the intermodulation distortion of the antenna switch (refer to Patent Document 1), a type which adopts a configuration of interposing in series an individual switch circuit and a common external terminal selector switch circuit in the paths between the common external terminal and the respective input/output terminal groups provided for each frequency band (refer to Patent Document 2), among others. Patent Document 1: Patent Publication JP-A-2006-50590 Patent Document 2: Patent Publication JP-A-2009-165077
However, a number of problems exist in these methods and apparatuses.
During communication using the GSM system, the antenna switch is switched such that the antenna switch and the transmission terminal are connected during transmission and the antenna switch and the reception terminal are connected during reception, but with the W-CDMA system, the transmission and the reception are
Consequently, there is a problem in that the IMD characteristics of the antenna switch will deteriorate. IMD is a phenomenon that generates an output frequency component, which is a combination of the sum or difference of harmonics from reception signals of a frequency that differs from the transmission signals caused by the nonlinearity of the transistors configuring the antenna switch.
When a reception signal is received during transmission, an output frequency component is generated, which is a combination of the sum or difference of harmonics from reception signals of a frequency that differs from the transmission signals caused by the nonlinearity of the transistors configuring the antenna switch. As a result of this output, frequency component leaks to the receiver-side circuit via a duplexer or the like causing receiver sensitivity to deteriorate. |
Transplanted Bone Marrow Mesenchymal Stem Cells Improve Memory in Rat Models of Alzheimer's Disease The present study aims to evaluate the effect of bone marrow mesenchymal stem cells (MSCs) grafts on cognition deficit in chemically and age-induced Alzheimer's models of rats. In the first experiments aged animals (30 months) were tested in Morris water maze (MWM) and divided into two groups: impaired memory and unimpaired memory. Impaired groups were divided into two groups and cannulated bilaterally at the CA1 of the hippocampus for delivery of mesenchymal stem cells (500 103/L) and PBS (phosphate buffer saline). In the second experiment, Ibotenic acid (Ibo) was injected bilaterally into the nucleus basalis magnocellularis (NBM) of young rats (3 months) and animals were tested in MWM. Then, animals with memory impairment received the following treatments: MSCs (500 103/L) and PBS. Two months after the treatments, cognitive recovery was assessed by MWM in relearning paradigm in both experiments. Results showed that MSCs treatment significantly increased learning ability and memory in both age- and Ibo-induced memory impairment. Adult bone marrow mesenchymal stem cells show promise in treating cognitive decline associated with aging and NBM lesions. Introduction Alzheimer's disease (AD) has been called the disease of the century with significant clinical and socioeconomic impacts. Epidemiological studies point out that AD affects 5% of the population over 65, and, parallel with increasing lifespan, the incidence of disease will rise dramatically. Clinically AD is characterized by a progressive learning capacity impairment and memory loss, especially memories of recent events. One of the major pathological outcomes of both aging and Alzheimer's disease is loss of neurons and function in the basal forebrain especially NBM, the main cholinergic input to the neocortex. It is obvious that classical pathological hallmarks of AD are plaques and tangles, which both are exceptionally rare in animals, particularly in small laboratory rodents. In animal populations, as in humans, age-associated cognitive decline correlates with the degeneration of basal forebrain nuclei. Experimentally excitotoxic lesion of the NBM induces memory impairment in several tasks and it is considered as a suitable approach to study cognitive deficit and dementia in animals. The current drug therapies for AD treatment are hindered due to poor efficacy and side effects. Adult neural tissues have limited sources of stem cells, which makes neurogenesis in the brain less likely. Stem cells transplantation seems to be a promising strategy for treatment of several central nervous system (CNS) degenerative diseases such as AD, amyotrophic lateral sclerosis (ALS), and Parkinson's disease. Bone marrow stem cells are an example of self-renewing multipotential cells with the developmental capacity to give rise to certain cell types. These cells seem to be able to differentiate into hepatocytes, skeletal muscle, cardiomyocytes, and neural cells in vitro. Studies showed that implanted mesenchymal cells at the site of injury are able to survive and integrate in the host brain. In this context Lee and coworkers used human umbilical cord blood mesenchymal stem cells in AD mice and demonstrated cognitive rescue with restoration of 2 Stem Cells International learning and memory function. Also Nivet and coworkers showed that human olfactory mesenchymal stem cells are able to restore learning and memory in hippocampus lesion model. The ultimate goal for cell therapy in AD is functionality. Few studies have examined cognitive function with conflicting results: improvement and no change. Regarding the fact that using autologous cell transplantation circumvents ethical and immunological problems, the present study was aimed to evaluate the therapeutic effects of MSCs in restoring cognitive function in two different models of AD in rats. Animals. All of the animals used in these experiments were housed in Cellular and Molecular Research Center animal facility. Animals were housed with free access to food and water in a 12 h light/dark cycle and constant temperature of 22 C. They were kept 4-5 in a cage. All procedures concerning animal care were in accordance with Guilan University of Medical Sciences Ethical Committee Article. Experiment 1. Forty aged (30 months) and 10 young (3 months) male Wistar rats were used in this experiment. The mean weights were 500 ± 50 for old and 200 ± 20 g for young. Animals received four trials per day for 4 consecutive days in the Morris water maze (MWM), using a 20 min intertrial interval. A probe trial during which the platform was removed was carried out on the fifth day. Rats above the mean average of latency designated as impaired were divided into grafted (n = 10) and nongrafted control groups (n = 10). Animals were placed in a computerized stereotaxic apparatus (Neurostar, Germany) and cannulated at CA1 region (at coordinates AP: −3 mm, L: ±2 mm from bregma and V: −2.8 mm from the skull surface). Performance of aged grafted animals was compared with aged nongrafted and young control groups. Experiment 2 (NBM Lesion). Forty male Wistar rats (3 months old, weighing 200 ± 20 g) were used in this part of study. To establish cognitive deficit, we infused Ibo into the NBM. On the day of surgery, the animals were anesthetized with ketamine/xylazine (50 mg/kg, i.p.) and placed in stereotaxic apparatus. The incisor bar was set at −1.14 mm posterior and ±2.46 mm lateral to the bregma and 7.9 below the top of the skull to reach the nucleus basalis magnocellularis, then guide cannula was implanted bilaterally for further infusions. Another cannula for stem cell transfusion was implanted in the CA1 at coordinates mentioned in Experiment 1. Rats received bilateral infusions of 0.5 L of Ibo (10 g/L) using a 5 L Hamilton syringe. After 14 days, rats were tested in MWM in order to test learning ability. Animals that showed memory impairment were distributed into two groups: Ibo+MSCs (n = 10) and Ibo+PBS (n = 10). Bone Marrow Stem Cells Isolation. Rat bone marrow was obtained by aspiration from tibia. This study was approved by the Institutional Ethical Committee of Guilan University of Medical Sciences. Bone marrow was collected and centrifuged with ficoll for 10 min at 1500 xg; the white blood cells buffy coat was recovered and plated in 75 cm flasks containing with Dulbecco's Modified Eagle's Medium (DMEM) and 10% fetal bovine serum (FBS). Cells were then incubated at 37 C in humidified atmosphere containing 95% air and 5% CO 2. On reaching confluence, the adherent cells were detached by 0.05% trypsin and 0.02% ethylenediaminetetraacetic acid (EDTA) for 5-10 min at 37 C, harvested and washed with DMEM, and resuspended in medium containing 10% FBS. After the first passage, the morphologically homogeneous population of MSC was analyzed for the expression of cell surface molecules using flow cytometry procedures for CD105, CD90, and CD44+. The ability of MSCs to differentiate to adipogenic lineages was assayed using adipogenic media (acid ascorbic 50 g/mL, dexametazon 100 nM, indometacin 5 g/mL, and insulin 5 g/mL). Viability of cells was determined by Trypan blue dye exclusion test. Briefly, cells were incubated with Trypan blue dye for 1 min. Blue positive and white negative cells was counted in ten 20 fields, and the percent of viable cells was calculated. Both grafted groups received infusion of 1 L (500 10 3 /L) cells from passage 2, and controls received the same volume of PBS into the CA1 of the hippocampus. The syringe was allowed to remain in place for 5 min after the injection to allow diffusion into the surrounding tissue. Behavioral Tests. Two months after transplantation, rats performed relearning task (the place of platform was different from the previous experiment) in Morris water maze. The Morris water maze consisted of a black pool (148 cm diameter) filled with water (26 ± 2 C). A circular black platform was submerged 2 cm below the water surface, in the middle of the target quadrant. The behavior of the rats in the pool could be tracked with a camera connected to Ethovision system (Ethovision XT 7, Noldus inc., The Netherlands) allowing us to measure swim speed, distance, and latency to find the platform. Rats were trained with a protocol of four trials per day, with an interval of 20 min, for 4 consecutive days. A probe trial was administered on the fifth day, when each subject was placed into the water diagonally opposite the target quadrant and allowed 90 seconds to search the water, from which the platform had been removed. Statistical Analysis. The data is expressed as means ± SEM. Group differences in the escape latency of probe task in the Morris water maze were analyzed using one-way analysis of variance (ANOVA) followed by Tukey's post hoc test. ANOVA repeated measure for multiple group comparison was used to analyze group differences of the data collected during the training days. Stem Cells Characterization. Mesenchymal stem cells were successfully cultured and expanded. A morphologically homogeneous population of fibroblast-like cells (Figure 1) with more than 90% confluence was seen after 14 days. Cells after the first passage grew exponentially, requiring weekly passages. Flow cytometric analysis was used to assess the purity of MSC cultures, which appeared uniformly positive for CD44, CD105, and CD90 ( Figure 2). Age-Induced Memory Impairment. During the training sessions in the MWM, unimpaired, impaired + PBS, and impaired + MSCs groups showed significant trial effects in learning procedure (F 2, 445 = 5.138, P < 0.0001) (Figure 3). Since none of the groups differed in swimming speed (22.3 ± 0.8 versus 23 ± 1.9 cm/s; P > 0.05), the latency to find platform was used as an indicator of learning performance. There was no interaction between the trials and the groups (F 2, 445 = 1.273, P = 0.273). Impaired + MSCs rats learned to find the platform more rapidly than impaired + PBS (F 2, 25 = 36.799, P < 0.001, n = 9, Figure 3). One rat from the cell transplanted group died after one month due to brain infection. There was significant difference in probe latency between impaired + MSCs and impaired + PBS animals (11.5 ± 0.88 versus 33.4 ± 8.48 s, P = 0.006, Figures 4 and 7). Although the impaired + MSCs group showed improvement in latency to target quadrant, they did not reach the young group score (11.5 ± 0.88 versus 4 ± 0.45 s). Ibo-Induced Memory Impairment. Acquisition of the Morris water maze task in Ibo-lesioned groups is demonstrated in Figure 5. During the experiment, the latency to escape diminished over time in lesioned and sham operated groups (F 2,445 = 26.310, P < 0.001). There was no interaction between the group and the trials (F 2,445 = 1.349, P = 0.212). Ibotenic acid severely impaired the latency to platform in the probe test compared to sham group (37 ± 1.5 versus 3.8 ± 0.6 s P < 0.0001). Ibotenic acid had no significant effect on speed of swimming (20 ± 0.82 versus 21.8 ± 1.5 cm/s). Two months after grafting the MSCs, rats learned to find the platform quickly. As expected, the rats showed less time needed to find the platform (F = 64.689, P < 0.0001). Tukey's post hoc test showed that the Ibo+MSCs significantly reduced the latency to find the platform compared with Ibo + PBS group (14 ± 2.4 versus, 34 ± 3.4 s, Figure 6). Total time spent in the target quadrant also significantly increased in Ibo + MSCs compared with Ibo + PBS (28.6 ± 2.4 versus 12.8 ± 2.08 s, P < 0.0001). The results showed that stem cell treatment attenuated Ibo-induced learning and memory impairment in the Morris water maze test. Discussion The purpose of this study was to evaluate the therapeutic effects of transplanting MSCs in memory impairment induced by aging and excitotoxic lesion of NBM. The aged animals used in our experiment showed sever impairment in spatial learning, attention, and memory. According to previous findings, cognition deficit in these animals correlates with the degenerative decline of basal forebrain nuclei. It seems that using aged animals is appropriate to evaluate memory function. In the second part of our study, the infusion of Ibo into the NBM produced significant disruption of the working memory, which is in agreement with other studies indicating association of this nucleus with working memory. Cholinergic neurons of NBM projecting to the hippocampus play major role in cognitive performance such as attention, learning, and memory. It has been shown that infusion of Ibo decreases cholinergic activities in the hippocampus and frontal cortex via hyperstimulation of the N-methyl-Daspartate receptor. Our data from both animal models shows that there is a significant improvement in learning and memory following MSCs transplantation. These results confirm the ultimate objective of stem cells transplantation, which is achievement of cognitive functional recovery. Since Ibo leads to specific loss of somata of various neuron types without affecting on other surrounding cells, such as glia and endothelial cells or even neural axons, our data indicates that transplanted stem cells probably differentiated to neurons in hippocampus. It has been known that this area is a very sensitive region of the brain that plays a pivotal role in encoding, consolidating, and retrieving learning and memory. Improvement of learning and memory in our study is in agreement with previous studies using other sources of stem cells including neural, olfactory, and umbilical cord blood stem cells. Nivet et al. indicated that transplanted olfactory MSCs not only stimulate endogenous neurogenesis but also restore synaptic transmission and enhance long-term potentiation. A study conducted by Lee et al. demonstrated that human umbilical cord blood mesenchymal stem cells transplantation reduces glial activation, oxidative stress, and apoptosis in AD mouse brain and consequently improves memory and learning. Although the present study does not aim to study the mechanisms underlying memory improvement, several mechanisms could possibly contribute to the improvement in learning and memory after stem cell transplantation in our experiments. One is the capability of these cells to add to the pool of functioning neurons [24, and integrating with neighboring cells. This mechanism needs to be supported in the future studies by electrophysiological integration of the stem cells into the host circuitry. We initiated behavioral tests two months after transplantation, which provides enough time for mesenchymal stem cells to develop synapses and electrophysiological response based on observations in previous studies in other neurodegenerative diseases and in vitro studies. Second possibility is Unimpaired Latency to platform (s) * * * Impaired + PBS Impaired + MSCs Figure 4: Comparisons of the retention performance on the Morris water maze task among the three groups two months after the treatments (unimapaired, impaired + PBS, impaired + MSCs). The mean values of the probe test for each group are shown. One-way ANOVA for the swimming time among the groups was followed by Tukey's test. * P < 0.05 as compared with the corresponding data from the impaired + PBS group. that stem cells may provide therapeutic utility by enhancing the survival and activity of the existing neurons. Wu et al. in their review article stated that neural stem cells release diffusible factors that may improve the survival of aged and degenerating neurons in human brains. Mesenchymal stem cells are very attractive in view of a possible cell therapy approach in neurodegenerative diseases because of their great plasticity. Recently, MSCs therapy has been shifted to be used in some clinical trial models like ALS. A phase I clinical trial conducted by Mazzini confirmed that MSCs transplantation into the spinal cord of ALS patients is safe and that MSCs might have a clinical use for future ALS cell-based clinical trials. In conclusion, MSC grafts reverse progressive cognitive decline associated with aging and Ibo lesion in animal models. From a clinical point of view, considering low risk of tumourigenesis and less ethical issues with bone marrow mesenchymal stem cells, these cells represent as a valuable candidate source for transplantation therapy in Alzheimer's disease. |
<filename>Printable-Template/CGT/surreal.hh
double surreal(char s[], int n) {
double r = 0;
int q = 0;
while (q < n && s[q] == s[0])
if (s[q++] == 'L') r += 1.; else r -= 1.;
for (double k = .5; q < n; k /= 2.)
if (s[q++] == 'L') r += k; else r -= k;
return r;
}
|
package org.metaborg.runtime.task.primitives;
import java.util.Set;
import org.metaborg.runtime.task.engine.ITaskEngine;
import org.spoofax.interpreter.core.IContext;
import org.spoofax.interpreter.core.InterpreterException;
import org.spoofax.interpreter.core.Tools;
import org.spoofax.interpreter.stratego.Strategy;
import org.spoofax.interpreter.terms.IStrategoTerm;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import org.spoofax.terms.util.TermUtils;
public class task_api_sources_of_0_1 extends TaskEnginePrimitive {
public static task_api_sources_of_0_1 instance = new task_api_sources_of_0_1();
public task_api_sources_of_0_1() {
super("task_api_sources_of", 0, 1);
}
@Override public boolean call(ITaskEngine taskEngine, IContext env, Strategy[] svars, IStrategoTerm[] tvars)
throws InterpreterException {
final IStrategoTerm taskIDOrTaskIDS = tvars[0];
final Set<IStrategoTerm> sources = Sets.newHashSet();
if(TermUtils.isList(taskIDOrTaskIDS)) {
for(IStrategoTerm taskID : taskIDOrTaskIDS) {
Iterables.addAll(sources, taskEngine.getSourcesOf(taskID));
}
} else {
Iterables.addAll(sources, taskEngine.getSourcesOf(taskIDOrTaskIDS));
}
env.setCurrent(env.getFactory().makeList(sources));
return true;
}
}
|
The transferable lane barrier system disclosed in U.S. Pat. Nos. 4,498,803, 4,500,225 and 4,624,601 is adapted to be lifted by a transfer vehicle and moved to a selected position on a roadway or the like. Lane barrier systems of this type find particular application at roadway construction sites and on roadways and bridges wherein the groupings of incoming and outgoing lanes of traffic must be varied, particularly during commute hours.
As discussed in applicant's co-pending U.S. patent application Ser. No. 196,435 filed on May 20, 1988 for "Anti-Crash Lane Barrier With Self-Centering Hinges," it is advantageous to provide the system with the ability to elongate or contract to accommodate positioning of the system at varied radii on a curved roadway. For example, it has been determined that when the system is moved radially outward from a 1200 ft. radius to a 1212 ft. radius, the composite length of the lane barrier system must increase by approximately 0.25 in. for each three feet in length of the barrier system to effectively accommodate this new position on the same, curved roadway. Conversely, repositioning of the barrier system radially inwardly to a new position on the curved roadway, having a radius of curvature of 1188 ft., will require a corresponding contraction of the composite length of the lane barrier system.
The invention disclosed and claimed in the above-referenced application solves this problem by providing elastomeric pads in the hinge connections, between each pair of adjacent modules of the lane barrier system, whereby the modules will: (1) elongate or contract to assume a composite varied length different from their nominal composite length in response to the imposition of a load on the system, and (2) return the modules to their nominal composite length when the load is removed.
The invention herein constitutes an improvement over the invention covered by such application in that it was recognized by applicant that preloading of the hinges, connecting adjacent pairs of modules together, would facilitate a higher degree of uniform spacing between the modules when they are loaded onto a transfer vehicle for subsequent replacement on a roadway. In addition, when the lane barier system is placed in situ on a roadway, a greater impact force would be required to move the modules thereof to thereby increase the anti-crash capabilities of the system. |
Huesaturationintensity and texture feature-based cloud detection algorithm for unmanned aerial vehicle images There are a large number of cloud-covered areas in most unmanned aerial vehicle images and lead to the loss of information in the image and affect image post procession such as image fusion and target identification. Finding the cloud-occluded area in an image is a key step in image processing. Based on the differences of color and texture characteristics between cloud and ground, a cloud detection algorithm for the unmanned aerial vehicle images is proposed. Simulation results show that the proposed algorithm is better than the classical cloud detection algorithms in accuracy rate, false-positive rate, and kappa coefficient. |
// AddOracleScriptFile compiles Wasm code (see go-owasm), adds the compiled file to filecache,
// and returns its sha256 reference name. Returns do-not-modify symbol if input is do-not-modify.
func (k Keeper) AddOracleScriptFile(file []byte) (string, error) {
if bytes.Equal(file, types.DoNotModifyBytes) {
return types.DoNotModify, nil
}
compiledFile, err := k.owasmVM.Compile(file, types.MaxCompiledWasmCodeSize)
if err != nil {
return "", sdkerrors.Wrapf(types.ErrOwasmCompilation, "with error: %s", err.Error())
}
return k.fileCache.AddFile(compiledFile), nil
} |
<commit_before>//
// substr.c
// AnsiLove/C
//
// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
// All rights reserved.
//
// This source code is licensed under the BSD 3-Clause License.
// See the file LICENSE for details.
//
#define _XOPEN_SOURCE 700
#include <string.h>
char *substr(char *str, size_t begin, size_t len)
{
if (str == 0 || strlen(str) == 0)
return 0;
return strndup(str + begin, len);
}
<commit_msg>Define _NETBSD_SOURCE macro to make 'strndup' declaration visible on NetBSD
<commit_after>//
// substr.c
// AnsiLove/C
//
// Copyright (C) 2011-2016 Stefan Vogt, Brian Cassidy, Frederic Cambus.
// All rights reserved.
//
// This source code is licensed under the BSD 3-Clause License.
// See the file LICENSE for details.
//
#define _XOPEN_SOURCE 700
#define _NETBSD_SOURCE
#include <string.h>
char *substr(char *str, size_t begin, size_t len)
{
if (str == 0 || strlen(str) == 0)
return 0;
return strndup(str + begin, len);
}
|
The intestinal barrier of patients with the gastrointestinal disease IBS allows bacteria to pass more freely than in healthy people, according to a study led by researchers at Linköping University in Sweden. The study, published in the scientific journal Gastroenterology, is the first to investigate IBS using living bacteria.
IBS, or irritable bowel syndrome, disturbs bowel function. The condition leads to repeated episodes of abdominal pain, and usually gives rise to constipation or diarrhea. Around 10% of people in Sweden suffer from IBS, and it is twice as common among women as among men.
"People affected by IBS have been regarded as a rather diffuse group. Our study has shown that people with IBS are clearly different from healthy people in the way in which the part of the intestine known as the colon (or large intestine) reacts to bacteria," says Åsa Keita, researcher at the Department of Clinical and Experimental Medicine (IKE). She has led the study together with Susanna Walter, specialist in gastrointestinal diseases at Linköping University Hospital and also a researcher at IKE.
It is still unclear why the condition arises, but there is increasing evidence that changes in the way in which the brain interacts with the bacterial flora in the gut play a role. The large intestine has a layer of mucous, which constitutes the first line of defence against the bacteria in the intestine. Behind this, there is a layer of epithelial cells known as enterocytes, and behind these is tissue that contains immune cells. The present study has looked at this layer of epithelial cells, and examined how permeable it is to bacteria.
The researchers investigated small samples of tissue taken from the large intestine of 37 women with IBS, and compared them with samples from women with no intestinal symptoms. They studied the membranes in an instrument known as a Ussing chamber, in which it is possible to measure the transport of substances and bacteria through living tissue.
Infection with the pathogenic bacterium Salmonella typhimurium is a risk factor for developing IBS, and this led the researchers to investigate how this Salmonella strain interacts with the intestinal membrane. They also studied a strain of E. coli (Escherichia coli HS), which is usually present in the intestine. Both bacteria passed through the intestinal mucosa of patients with IBS around twice as rapidly as was the case for healthy subjects.
"Patients with IBS in our study had a higher passage of bacteria in the model system. But we cannot transfer this result directly to clinical practice, and further research is needed. What we can say, however, is that there is something that makes one layer of the intestinal mucosa of patients with IBS more sensitive to bacteria than in healthy subjects," says Åsa Keita.
The researchers also looked at mast cells, a type of immune cell that is an important component of the innate immune defence, which protects against micro-organisms. They found that mast cells appear to play a significant role in regulating the passage of bacteria across the intestinal membrane, in both healthy subjects and in people with IBS. The mechanism seems, however, to be more active in those with IBS. |
// allocConstraint allocates space for a new constraint in the set and returns
// a pointer to it. The first constraint is stored inline, and subsequent
// constraints are stored in the otherConstraints slice.
func (s *Set) allocConstraint(capacity int) *Constraint {
s.length++
if s.length == 1 {
return &s.firstConstraint
}
if s.otherConstraints == nil {
s.otherConstraints = make([]Constraint, 1, capacity)
return &s.otherConstraints[0]
}
if cap(s.otherConstraints) < capacity {
panic("correct capacity should have been set when otherConstraints was allocated")
}
s.otherConstraints = s.otherConstraints[:s.length-1]
return &s.otherConstraints[s.length-2]
} |
New benzimidazole acridine derivative induces human colon cancer cell apoptosis in vitro via the ROS-JNK signaling pathway. AIM To investigate the mechanisms underlying anticancer action of the benzimidazole acridine derivative N-{(1H-benzoimidazol-2-yl)methyl}-2-butylacridin-9-amine(8m) against human colon cancer cells in vitro. METHODS Human colon cancer cell lines SW480 and HCT116 were incubated in the presence of 8m, and then the cell proliferation and apoptosis were measured. The expression of apoptotic/signaling genes and proteins was detected using RT-PCR and Western blotting. ROS generation and mitochondrial membrane depolarization were visualized with fluorescence microscopy. RESULTS 8m dose-dependently suppressed the proliferation of SW480 and HCT116 cells with IC50 values of 6.77 and 3.33 mol/L, respectively. 8m induced apoptosis of HCT116 cells, accompanied by down-regulation of Bcl-2, up-regulation of death receptor-5 (DR5), truncation of Bid, cleavage of PARP, and activation of caspases (including caspase-8 and caspase-9 as well as the downstream caspases-3 and caspase-7). Moreover, 8m selectively activated JNK and p38 without affecting ERK in HCT116 cells. Knockout of JNK1, but not p38, attenuated 8m-induced apoptosis. In addition, 8m induced ROS production and mitochondrial membrane depolarization in HCT116 cells. Pretreatment with the antioxidants N-acetyl cysteine or glutathione attenuated 8m-induced apoptosis and JNK activation in HCT116 cells. CONCLUSION The new benzimidazole acridine derivative, 8m exerts anticancer activity against human colon cancer cells in vitro by inducing both intrinsic and extrinsic apoptosis pathways via the ROS-JNK1 pathway. Introduction Colorectal carcinoma, one of the most common fatal cancers, is the second leading cause of cancer-related deaths worldwide. The primary method currently used to treat all stages of colon cancer is surgery. After tumor excision, chemotherapeutic drugs, such as irinotecan (CPT-11), 5-fluorouracil (5-FU), and oxaliplatin, are typically used to further eradicate any residual tumor cells. However, in the majority of cancer patients, currently available chemotherapies have had only partial suc-cess, owing to chemoresistance and side effects. Therefore, there is an urgent need for highly efficacious alternative chemotherapeutic agents that can selectively induce apoptosis in cancer cells. Elaboration of the molecular mechanisms responsible for colon cancer progression should facilitate the development of effective chemotherapeutic agents. Apoptosis, an intracellular suicide program possessing specific morphologic characteristics and biochemical features, is a mechanism exploited by many anticancer drugs to effect cancer cell death. The extrinsic apoptotic pathway involves two important pro-apoptotic molecules that belong to the tumor necrosis factor (TNF) receptor superfamily, death receptor 4 (DR4) and death receptor 5 (DR5). DR4 and DR5 can be assembled into a death-inducing signaling complex (DISC) after binding to tumor necrosis factor (TNF)-related apoptosis-npg inducing ligand (TRAIL). Upon association with the adaptor molecule Fas-associated protein with death domain (FADD), DISC leads to the cleavage and activation of an apoptosis initiator, caspase-8, which activates the downstream caspases-3, -6 and -7 to culminate in the extrinsic apoptosis of malignant cells. Currently, a number of studies have suggested that many therapeutic agents, such as bioymifi, lapatinib, and etoposide, up-regulate DR5, thereby acting as key triggers of apoptosis in various cancer cell types in vitro and in vivo. Crosstalk exists between the intrinsic and extrinsic apoptosis pathways: activated caspase-8 in the extrinsic pathway cleaves Bid, after which the cleaved Bid translocates to mitochondria to cause the release of cytochrome c and the subsequent initiation of the intrinsic apoptosis pathway. By triggering a variety of cellular responses leading to cell growth, differentiation, or cell death, reactive oxygen species (ROS) have recently been proposed to be involved in tumor metastasis as well as apoptosis induced by various compounds. Cancer-induced ROS is controlled by antioxidants such as N-acetyl cysteine (NAC) and glutathione (GSH) in cancer. GSH is the most abundant thiol antioxidant in mammalian cells and maintains thiol redox in the cells. GSH depletion has been implicated in the etiology of various diseases, including cancer. As a sulfhydryl donor, NAC not only contributes to the regeneration of GSH but also reacts directly with free ROS as its free thiol group is capable of interacting with electrophilic groups of ROS. Two of the downstream molecules regulated by ROS are p-21 kinase (PAK) and mitogen-activated protein kinase (MAPK). MAPKs include p38 MAPK, stress-activated protein kinase/ c-Jun NH2 terminal kinase (JNK), and extracellular signalregulated kinase (ERK). ERK is primarily involved in growth and survival, whereas JNK and p38 are generally associated with pro-apoptotic activities in many cell types. JNK includes at least ten isoforms that are encoded by three genes, JNK1, JNK2, and JNK3. JNK1 and JNK2 are ubiquitously expressed, whereas expression of JNK3 is limited to the brain and heart. Accumulating evidence suggests that JNK1 and JNK2 have different functions in the regulation of apoptosis and cell proliferation. Because of its importance in regulating apoptosis, the JNK1 signal transduction pathway is of particular relevance to the work discussed here. Substituted benzimidazole derivatives exhibit various bioactivities, such as anti-ulcerative, anti-inflammatory, antibacterial, and anti-carcinogenic properties. Acridine and its derivatives are types of polycyclic aromatic compounds with -conjugated structures that possess the ability to intercalate into DNA, subsequently inhibiting topoisomerases to elicit anticancer effects. Many investigations have reported the relationship between benzimidazole or acridine derivatives and ROS-or JNK-mediated apoptosis. However, apoptosis induced by a benzimidazole acridine derivative through the ROS-JNK1 pathway has never been studied. Our recent work has demonstrated that an analog of a benzimidazole acridine derivative (8m) possess cytotoxic activity against a variety of cancer cell lines and can induce apoptosis of K562 human leukemia cells. However, the effect of 8m on human colon cancer cells and the mechanism by which it induces apoptosis is largely unknown. In this work, we investigated the molecular events responsible for 8m-induced apoptosis in the HCT116 human colon cancer cell line. Our data provided sufficient evidence that N-{(1H-benzoimidazol-2-yl) methyl}-2-butylacridin-9-amine (8m)-induced apoptosis in HCT116 cells was strongly associated with activation of the ROS-JNK1 pathway. Cell culture All cells used in this study were obtained from the Cell Bank of the Chinese Academy of Sciences (Shanghai, China). HCT116 and SW480 were grown in RPMI-1640 supplemented with 10% FBS. All cells were cultured at 37 °C in a humidified atmosphere containing 5% CO 2. Cell viability assay The MTT assay was used to examine the growth inhibitory effect of 8m. Cells were plated in 96-well culture plates at a cell density of 5000 cells per well in 100 L of complete medium and incubated under standard cell culture conditions for 12 h. The medium was then removed and replaced Colony formation assay HCT116 cells were seeded into 6-well plates (110 3 cells/ well) and cultured overnight. Then, the culture medium was replaced with fresh medium containing the vehicle control or the indicated concentrations of 8m (or co-cultured with 5 mmol/L NAC) for 14 d. The culture medium was changed every 3 to 4 d. When colonies formed, the medium was then discarded, and each well was washed twice with PBS. After that, colonies were fixed with 100% cold ethanol for 30 min and then stained with 0.05% crystal violet. Apoptotic nuclear measurement Cells were seeded onto cover slides for 12 h and then treated with the vehicle control or various concentrations (5, 7.5, and 10 mol/L) of 8m for 24 h. After the cells were washed with cold PBS, the cells were fixed in 4% paraformaldehyde for 10 min. The cells were subsequently washed with PBS and stained with 4,6-diamidino-2-phenylindole (DAPI) for 30 min in the dark at room temperature. Cover slips containing the cells were then washed with PBS-TX (10 mL PBS+10 L 10% Tritonx-100) three times, and images were taken using a fluorescent microscope (Olympus, Tokyo, Japan). ROS generation assay Oxidative stimuli present in the cytoplasm may be transmitted to the nucleus through cellular signal transduction pathways to regulate cell division and survival. 2',7'-Dichloro-dihydrofluorescein diacetate (H 2 -DCFDA, Molecular Probes) is metabolized by nonspecific esterases to the non-fluorescent product, 2',7'-dichloro-dihydrofluoresceine, which is then oxidized by ROS to the fluorescent product DCF. HCT116 cells were incubated in 60 mm culture dishes under standard cell culture conditions for 12 h and then treated with 0, 5, 7.5, or 10 mol/L 8m for 24 h. After incubation and washing with PBS, the cells were loaded with 10 mol/L H 2 -DCFDA in complete medium for 1 h at 37 °C. After the removal of excessive H 2 -DCFDA, the cells were analyzed by a fluorescent microscope at an excitation wavelength of 485 nm and an emission wavelength of 530 nm. Flow cytometric quantification of apoptosis Apoptosis was determined by Annexin V-FITC and PI double staining. HCT116 cells were cultured in 60-mm dishes in a humidified 5% CO 2 atmosphere at 37 °C overnight and then were treated with the vehicle control or various concentrations (5 or 7. Western blot After treatment, the cells were washed twice with ice-cold PBS, and the reaction was terminated by the addition of icecold lysis buffer (10 mmol/L HEPES (pH 7.9), 10 mmol/L KCl, 1 mmol/L EDTA, 0.1% NP-40) including freshly added protease and phosphatase inhibitor cocktails. Lysates were cleared by centrifugation at 20 000g, 4 °C for 10 min, and the supernatant was snap frozen at -80 °C. Thirty micrograms of total protein was separated in 12% SDS-polyacrylamide gels and electrophoretically transferred onto PVDF membranes. Following incubation with an HRP-conjugated secondary antibody (1:3000) and after incubating the membrane in SuperSignal West Pico Chemiluminescent Substrate (Pierce, Rockford, IL, USA), protein bands were visualized on an imaging system (Bio-Rad, Munich, Germany). Statistical analysis All values are presented as the mean±SEM from experiments performed in triplicates. Significance was determined using Student's t-test; P<0.05 was considered statistically significant. Cytotoxicity and apoptosis induced by 8m against human colon cancer cells The potential of 8m ( Figure 1A) to induce cell death in human colon cancer cells was examined using the MTT assay. Treatment of SW480 and HCT116 cells with 8m induced cell death in a concentration-dependent manner, and the 50% inhibitory concentrations (IC 50 ) of 8m against SW480 and HCT116 cells were 6.77±0.19 mol/L and 3.33±0.02 mol/L, respectively ( Figure 1B, 1C). To confirm that the enhanced cytotoxic effects by 8m in HCT116 cells were due to increased apoptosis, we examined the apoptotic response using FITC-annexin V/PI double staining flow cytometric analysis. After 24 h of treatment, we found that 5 and 7.5 mol/L 8m induced apoptosis in 21.09% and 27.95% of HCT116 cells, respectively( Figure 1D). Using DAPI staining, we then examined cells for morphological features of apoptosis, such as condensed chromatin and apoptotic bodies ( Figure 1E). Collectively, these results suggested that 8m exhibited potential antitumor activity, at least in part, by inducing apoptosis in colon cancer cells. 8m-induced apoptosis involves both the extrinsic and intrinsic apoptotic pathways To ascertain the underlying mechanisms responsible for enhancement of apoptotic cell death, we examined the effects of 8m on the expression of apoptosis-related genes and proteins. To determine whether 8m acts through the extrinsic apoptotic pathway, the expression levels of two members of the tumor necrosis factor (TNF) receptor superfamily, DR4 and DR5, which are upstream mediators of the extrinsic apoptosis pathway, were examined after 8m treatment. Real-time PCR analysis revealed increased DR4 and DR5 mRNA levels, with DR5 increasing more significantly than DR4, suggesting that DR5 may play a more important role than DR4 in mediating 8m-induced apoptosis (P<0.05, Figure 2A). We then examined the expression of DR5 at the protein level and found that DR5 protein expression was induced by 8m in a concentration-and time-dependent manner. The cleavage and truncation of Bid and caspase-8, two downstream effectors, were induced by 8m, as indicated by western blotting (Figure 2B, 2C). These results suggested that 8m induced apoptosis through the extrinsic apoptotic pathway. Bcl-2 tightly regulates the release of cytochrome c from the mitochondria, thus controlling the initiation of intrinsic apoptotic pathways. Following 8m treatment, Bcl-2 and caspase-9, two hallmarks of the intrinsic apoptotic pathway, were down-regulated and cleaved, respectively, in a concentration-and time-dependent manner ( Figure 2B, 2C). These results suggested that 8m also induced apoptosis through the intrinsic apoptosis pathway. Furthermore, the subsequent activation of caspase-7, caspase-3 and poly (ADP-ribose) polymerase (PARP) were observed ( Figure 2B, 2C). Collectively, these data suggested that 8m-induced apoptosis involved both the extrinsic and the intrinsic apoptotic pathways. 8m activated mitogen-activated protein kinase signaling MAPK signaling can be activated in response to a variety of extracellular stimuli, including mitogens, heat shock and osmotic stress, and can regulate the levels of DRs, Bcl-2, and other apoptosis-related proteins. To determine whether MAPK is involved in apoptosis after 8m treatment, we examined the effects of 8m on the activa tion of MAPK pathways. Treatment of HCT116 cells with 8m increased the amounts of phosphorylated JNK and p38, which reflect the activated states of these two kinases, in a dose-dependent manner. However, the phosphorylation of ERK was minimally affected ( Figure 3A). Our subsequent analysis of the time course of JNK and p38 activation showed that the phosphorylation of JNK and p38 were time-dependent: both were induced at 4 h after exposure to 8m, reaching a maximum level at 12 h, with activity persisting until 24 h. Fluctuations in levels of phosphorylated ERK were barely apparent during this time period ( Figure 3B). In addition, we noted that c-Fos, a well-known JNK substrate, was also up-regulated by 8m treatment in the HCT116 colon cancer cell line (P<0.05, Figure 2A). JNK1 played an important role in 8m-induced apoptosis To further investigate the role of MAPK activation in 8m-induced apoptosis, we treated HCT116 cells with 8m Figure 4B). We then examined the effects of p38 siRNA, which, unexpectedly, reduced the level of phosphorylated p38; however, p38 siRNA did not affect the levels of other apoptosis-related proteins ( Figure 4D). These results suggested that JNK1 played an important role in mediating both the extrinsic and intrinsic apoptotic pathways induced by 8m. This result was further supported by our flow cytometry data, which demonstrated that JNK1 siRNA, compared with the control siRNA, rescued 8m-induced apoptosis ( Figure 4E). www.chinaphar.com Chen K et al Acta Pharmacologica Sinica npg 8m-induced apoptosis was ROS-dependent Because oxidative stress and mitochondrial membrane depolarization can each induce cancer cell apoptosis, we examined these two indicators after 8m treatment. Using a fluorescent microscope, we determined the intracellular ROS level by measuring the oxidation of non-fluorescent H 2 -DCFDA to its highly fluorescent derivative 2',7'-dichlorofluorescein (DCF). As shown in Figure 5A, 8m stimulated ROS forma tion in a concentration-dependent manner. JC-1 is a membrane-permeable dye whose maximal fluorescence emission changes from ~590 nm to ~530 nm when the mitochondrial membrane depo-larizes. By measuring the shift in the fluorescence emission peak using fluorescence microscopy, we found that 8m treatment induced mito chondrial depolarization in a concentrationdependent manner ( Figure 5B). Because both the DR and the mitochondrial apoptotic pathways mediated by JNK could be ROS-dependent, two antioxidative ROS scavengers, GSH and NAC, were used to ascertain the relationship between 8m-induced cell death and ROS. Both scavengers reduced phosphor-JNK and the levels of other 8m-induced apoptotic proteins as well as the degree of cleavage of specific apoptotic mediators. The cleavage of caspase-7 and PARP were com- Figure 5D). By using the colony formation assay, we found that the numbers of colonies formed from cells co-cultured with 5 mmol/L NAC were higher and that the sizes of the colonies were also considerably larger than those in the 8m-alone culture group ( Figure 5E). Discussion Our previous work demonstrated that treatment using a novel series of benzimidazole derivatives, 2-aryl benzimidazole compounds, can result in the pronounced apoptosis of HepG-2 cancer cells. In this study, we used an MTT assay to demonstrate that 8m, a novel benzimidazole acridine derivative, potently reduced the viability of the human colon cancer Profound increases in externalized phosphatidylserine, a hallmark of early apoptosis, was also detected via flow cytometric analysis of 8m-treated cancer cells. These results suggested that 8m decreased cell viability by inducing the apoptosis of HCT116 cells. To examine the mechanisms underlying 8m-induced apoptosis, we analyzed the changes in apoptotic proteins after 8m treatment. An apparent induction of cleaved caspase-8 and caspase-9 was detected, indicating that 8m-induced apoptosis involved both the intrinsic mitochondrial-initiated pathway and the extrinsic death receptor-mediated pathway. This result suggests that HCT116 cells are type II cells capable of amplifying apoptotic signaling initiated by the extrinsic pathway through the recruitment of the intrinsic pathway, whereby activated caspase-9 (cleaved cas pase-9) subsequently cleaves caspase-7 and caspase-3 to effect downstream apoptotic events. PARP, a family of proteins involved in DNA repair in response to environmental stress, can be cleaved by the caspase-3 executioner protein. Cleavage of PARP facilitates cellular disassembly and serves as a marker of cells undergoing apoptosis. In the current study, we found that 8m treatment increased the cleavage of caspase-7, caspase-3, and PARP in a concentration-and time-dependent manner. Bcl-2 provides a distinct survival signal to cancer cells to support neoplastic growth; therefore, we conducted an intense mechanistic study to assess the ability of Bcl-2 to suppress 8m-induced apoptosis. 8m-induced down-regulation of Bcl-2 can cause the release of cytochrome c from the mitochondria to the cytoplasm, thereby initiating the intrinsic apoptotic signaling pathway. However, it is not known whether the initiation of the intrinsic pathway is more greatly influenced by Bcl-2 down-regulation or by crosstalk with the extrinsic pathway. Further studies are warranted to elucidate the mechanism underlying the activation of the intrinsic pathway. Given its ability to trigger specific apoptotic cancer cell death without targeting normal cells, TRAIL is a promising target for cancer therapy. Nevertheless, resistance to TRAIL, resulting from decreased levels of DR4 and DR5 and/or mutations in these proteins, has been a treatment issue. Furthermore, accumulating evidence indicates that the down-regulation or mutation of death receptors (DRs) may allow malignant cells to avoid destruction by the immune system. Therefore, agents that increase the levels of DRs in cancer cells may prevent certain types of drug resistance and should therefore be investigated. In our study, 8m induced the expression of DR5 in a concentration-and time-dependent manner. This result is even more noteworthy because real-time PCR analysis suggested that after 8m treatment, DR5 may play a more important role than DR4 in apoptosis and that DR5 can transmit apoptotic signals to caspase-8 to initiate the extrinsic apoptotic pathway. This evidence demonstrated the potential of 8m as an antitumor small molecule that can up-regulate the expression of DR5, thereby promoting cancer cell apoptosis and decreasing drug resistance. A large body of evidence has shown that certain anticancer agents trigger apoptosis through the modulation of MAPK, which can play an important role in the mediation of DR5. In this work, 8m treatment induced p38 and JNK phosphorylation, whereas JNK1 inhibition (but not inhibition of JNK2 or p38) abrogated 8m-induced JNK phosphorylation as well as the cleavage of caspases and PARP. However, the function of 8m-induced p38 phosphorylation remains unclear. Figures 3A, 3B, 4B, 5C, and 5D show the JNK proteins, which have distinct molecular masses of 46 kDa (p46 JNK, the lower lane) and 54 kDa (p54 JNK, the upper lane) and are largely, but not exclusively, composed of the JNK1 and JNK2 isoforms, respectively. Integrating the results from the siRNA knockdown experiments, we have confirmed that 8m-induced JNK phosphorylation largely (but not absolutely) results from the production of phosphor-JNK1. The JNK1 signaling pathway tends to have a specific role in mediating apoptosis in several types of cancer cells, whereas JNK2 is involved particularly in cell survival signaling. The activation of JNK1 can lead to the phosphorylation of Bcl-2, resulting in Bcl-2 degradation and an inhibition of its antiapoptotic properties. However, 8m-induced JNK1 phosphorylation was only barely detectable after transfection with JNK1 siRNA. Knocking down JNK1, but not JNK2, rescued the 8m-induced down-regulation of DR5, Bcl-2, and other apoptotic proteins. Apoptosis studies via flow cytometry also demonstrated a pro-apoptotic role for JNK1 in our system. However, inhibiting JNK1 completely abolish 8m-induced cell death, as shown by Western blotting and flow cytometric assays. Thus, it is likely that JNK1-indepen dent mechanisms also participate in 8m-induced apoptosis. Environmental stimuli, especially drug stress, are known to damage mitochondrial dynamics and affect mitochondrial function, and vice versa. Mitochondrial dysfunctions include ROS overproduction and mitochondrial membrane depolarization, both of which can induce apoptosis. In this study, using the fluorescent stains H2-DCFDA and JC-1, we detected 8m-induced ROS production and mitochondrial membrane depolarization in an 8m-concentration-dependent manner. ROS, as an upstream regulator of JNK, plays an important role in various cellular responses, such as proliferation, differentiation, necrosis, and especially cell apoptosis. To examine the effect of ROS on JNK and other pathways, two potent antioxidants, NAC and GSH, were employed to detect the changes resulting from 8m-induced pathway activation or inhibition in antioxidant-pretreated cells. We observed that pretreatment with NAC or GSH prevented both 8m-induced JNK phosphorylation and caspase cleavage. The colony formation assay revealed that HCT116 cells co-cultured with NAC generated much larger colonies than the 8m-alone control. This indicated that ROS signaling was involved in the 8m-induced apoptosis of HCT116 cells and the phosphorylation of JNK1. Combined with the conclusion that JNK1 played a pro-apoptotic role in our system, we can conclude that 8m-induced apoptosis is ROS-JNK1 dependent ( Figure 5F). In accordance with our results, many anticancer drugs induce the apoptosis of cancer cells via this pathway. For example, selenite-induced apoptosis in Chang liver cells involved ROS-JNK1 signaling, and an ROS-JNK1-mediated process affected shikonin-induced apoptosis in Bcr/Abl-positive chronic myelogenous leukemia (CML) cells. In conclusion, our study demonstrated that a new benzimidazole acridine derivative (8m) had cytotoxic activity in human colon cancer cell lines. Both the intrinsic and extrinsic death pathways were activated by 8m in a concentration-and timedependent manner. Further investigation into its mechanism of action confirmed that the ROS-JNK1 pathway played an important role in mediating 8m-induced apoptosis. Furthermore, we demonstrated that 8m can upregulate DR5, a hallmark of effective anticancer agents. Therefore, our findings provide a basis for future investigations aimed at elucidating the role of apoptosis in colon cancer therapy. |
import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { JhiAlertService } from 'ng-jhipster';
import { InstructorDashboardPopupService } from './instructor-dashboard-popup.service';
import { Exercise, ExerciseService } from '../entities/exercise';
@Component({
selector: 'jhi-instructor-dashboard-cleanup-dialog',
templateUrl: './instructor-dashboard-cleanup-dialog.component.html'
})
export class InstructorDashboardCleanupDialogComponent {
exercise: Exercise;
confirmExerciseName;
deleteRepositories: boolean;
cleanupInProgress;
deleteInProgress;
constructor(
private exerciseService: ExerciseService,
public activeModal: NgbActiveModal,
private jhiAlertService: JhiAlertService
) {
this.confirmExerciseName = '';
this.deleteRepositories = false;
this.cleanupInProgress = false;
}
clear() {
this.activeModal.dismiss('cancel');
}
confirmCleanup(id: number) {
this.cleanupInProgress = true;
this.exerciseService.cleanup(id, this.deleteRepositories).subscribe(
response => {
this.deleteInProgress = false;
if (this.deleteRepositories) {
this.jhiAlertService.success('Cleanup was successful. All build plans and repositories have been deleted. All participations have been marked as Finished.');
} else {
this.jhiAlertService.success('Cleanup was successful. All build plans have been deleted. Students can resume their participation.');
}
this.activeModal.dismiss(true);
const blob = new Blob([response.body], { type: 'application/zip' });
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.setAttribute('href', url);
link.setAttribute('download', response.headers.get('filename'));
document.body.appendChild(link); // Required for FF
link.click();
window.URL.revokeObjectURL(url);
},
err => {
this.deleteInProgress = false;
});
}
}
@Component({
selector: 'jhi-instructor-dashboard-cleanup-popup',
template: ''
})
export class InstructorDashboardCleanupPopupComponent implements OnInit, OnDestroy {
routeSub: any;
constructor(
private route: ActivatedRoute,
private instructorDashboardPopupService: InstructorDashboardPopupService
) {}
ngOnInit() {
this.routeSub = this.route.params.subscribe(params => {
this.instructorDashboardPopupService
.open(InstructorDashboardCleanupDialogComponent as Component, params['id'], true);
});
}
ngOnDestroy() {
this.routeSub.unsubscribe();
}
}
|
Ever since Boo Radley came out from the shadows there’s been a steady stream of ‘more powers’ rhetoric. Well, maybe not a stream. Cameron fluffed his lines confusing ‘can’ with ‘will’ in an unfortunate slip-up in Edinburgh. Lord Strathclyde didn’t even show up to give us a glimpse of the Tories exciting ideas for the devolution, though Baron Lang of Monkton was a bit more forthright saying that the whole thing should be hush hush till later. Mum’s the word. That sort of thing.
Yesterday saw Johann Lamont Scottish suggest that it may use new devolved powers to tax the country’s highest earners, though we should wait to see that has been cross-checked with high command. We may have another Wendy Alexander moment as the Scottish parties need for some leverage will likely stretch the patience of the ‘extreme centre’ and Miliband’s Blue Labour.
Sir Menzies’ report, Campbell II (‘the second report of the home rule and community rule commission‘) was also announced, though with less fanfare than Gordon Brown’s. In fact, it was largely ignored, perhaps because it’s complete cobblers. It starts by declaring that the time was ripe to ‘revisit the constitutional debate in Scotland’.
Really? Talk about being ahead of the curve. The Liberals reasons for his shrewd observation?
‘The movement to share power in the constituent parts of the United Kingdom has gathered pace’ (?) and ‘The arguments of the Yes campaign have at last been revealed’.
Yes. At last. They’ve been kept top secret up until last week when somebody sneaked a memo to Nick Clegg CC’ing in wee Willie Rennie: ‘There’s going to be a referendum, date to be confirmed, we think it might be autumn this year, tell Menzies’. Read it here in all it’s glory.
Each of the Unionists reports play a sort of numbers game with our democracy, calculating bizarre quantities of per centages of power and accountability our parliament should be allowed whilst creating arcane arguments to justify the limitations of powers.
Meanwhile, in the real world, a far clearer numbers game emerges. Larry Elliott outlines how just five families own more that the poorest twelve and a half million people. This is an economic reality created under New Labour and sustained under the Liberal Tory Coalition. This is the real meaning of Yes, the real need for real powers and the real need for true change this September.
In their report ‘A Tale of Two Britains’, Oxfam said the poorest 20% in the UK had wealth totalling £28.1bn – an average of £2,230 each. The latest rich list from Forbes magazine showed that the five top UK entries – the family of the Duke of Westminster, David and Simon Reuben, the Hinduja brothers, the Cadogan family, and Sports Direct retail boss Mike Ashley – between them had property, savings and other assets worth £28.2bn.
Ben Phillips, from Oxfam said:
“Britain is becoming a deeply divided nation, with a wealthy elite who are seeing their incomes spiral up, while millions of families are struggling to make ends meet.
It’s deeply worrying that these extreme levels of wealth inequality exist in Britain today, where just a handful of people have more money than millions struggling to survive on the breadline.”
The parties share more than botched constitutional responses cobbled together in committee, they share a commitment to the economic practices of austerity that have created this social crisis. |
The inevitable has happened: porn stars James Deen and Andy San Dimas have made a film with Google Glass. In a thoroughly NSFW trailer, the pair use Glass cameras to capture video and see through each others' eyes in a reception room tryst — but it's not just recording. The trailer is a parody of everything you can imagine doing with a pair of futuristic glasses: turning on X-ray vision, accidentally making explicit Google searches, using a facial recognition database to look up... relevant anatomical details about a passing stranger. Did you know that "Glass" also rhymes with the name of a body part? James Deen does.
Given that Glass has been in the wild for some time, we're extremely doubtful this is the first X-rated video made with it. It is, however, the first professionally-made one we're aware of, especially with breakout star Deen involved. The glasses themselves were apparently obtained from Motherboard's Arikia Millikan, who attended the shooting, and adult app company MiKandi — whose first attempt at working with Glass was abruptly stymied when Google pulled its "Tits and Glass" app after only a few hours.
This doesn't have to be just a gimmick. It's also an interesting look into a possible future where today's point-of-view filmmakers abandon traditional cameras and simply place the devices on actors' heads. If Glass becomes as ubiquitous as Google hopes, it won't look like some William Gibson-influenced science fiction scene; it'll just be somebody wearing a pair of glasses. For now, though, the whole point is the novelty, like some kind of vicarious Silicon Valley role-play.
Deen and San Dimas, for their part, apparently weren't entirely convinced. Though Deen said he'd wanted to play with it from the moment he saw it, the glasses quickly started getting knocked off and caught in San Dimas' hair. And as the scene progressed, Glass itself started to heat up. That's not innuendo. That's what happens when you record for too long. |
<filename>header/coroutine/co_closure.h
/*
* Tencent is pleased to support the open source community by making Libco available.
* Copyright (C) 2014 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __CO_CLOSURE_H__
#define __CO_CLOSURE_H__
struct stCoClosure_t
{
public:
virtual void exec() = 0;
virtual ~stCoClosure_t(){}
};
//1.base
//-- 1.1 comac_argc
#define comac_get_args_cnt( ... ) comac_arg_n( __VA_ARGS__ )
#define comac_arg_n( _0,_1,_2,_3,_4,_5,_6,_7,N,...) N
#define comac_args_seqs() 7,6,5,4,3,2,1,0
#define comac_join_1( x,y ) x##y
#define comac_argc( ... ) comac_get_args_cnt( 0,##__VA_ARGS__,comac_args_seqs() )
#define comac_join( x,y) comac_join_1( x,y )
//-- 1.2 repeat
#define repeat_0( fun,a,... )
#define repeat_1( fun,a,... ) fun( 1,a,__VA_ARGS__ ) repeat_0( fun,__VA_ARGS__ )
#define repeat_2( fun,a,... ) fun( 2,a,__VA_ARGS__ ) repeat_1( fun,__VA_ARGS__ )
#define repeat_3( fun,a,... ) fun( 3,a,__VA_ARGS__ ) repeat_2( fun,__VA_ARGS__ )
#define repeat_4( fun,a,... ) fun( 4,a,__VA_ARGS__ ) repeat_3( fun,__VA_ARGS__ )
#define repeat_5( fun,a,... ) fun( 5,a,__VA_ARGS__ ) repeat_4( fun,__VA_ARGS__ )
#define repeat_6( fun,a,... ) fun( 6,a,__VA_ARGS__ ) repeat_5( fun,__VA_ARGS__ )
#define repeat( n,fun,... ) comac_join( repeat_,n )( fun,__VA_ARGS__)
//2.implement
#if __cplusplus <= 199711L
#define decl_typeof( i,a,... ) typedef typeof( a ) typeof_##a;
#else
#define decl_typeof( i,a,... ) typedef decltype( a ) typeof_##a;
#endif
#define impl_typeof( i,a,... ) typeof_##a & a;
#define impl_typeof_cpy( i,a,... ) typeof_##a a;
#define con_param_typeof( i,a,... ) typeof_##a & a##r,
#define param_init_typeof( i,a,... ) a(a##r),
//2.1 reference
#define co_ref( name,... )\
repeat( comac_argc(__VA_ARGS__) ,decl_typeof,__VA_ARGS__ )\
class type_##name\
{\
public:\
repeat( comac_argc(__VA_ARGS__) ,impl_typeof,__VA_ARGS__ )\
int _member_cnt;\
type_##name( \
repeat( comac_argc(__VA_ARGS__),con_param_typeof,__VA_ARGS__ ) ... ): \
repeat( comac_argc(__VA_ARGS__),param_init_typeof,__VA_ARGS__ ) _member_cnt(comac_argc(__VA_ARGS__)) \
{}\
} name( __VA_ARGS__ ) ;
//2.2 function
#define co_func(name,...)\
repeat( comac_argc(__VA_ARGS__) ,decl_typeof,__VA_ARGS__ )\
class name:public stCoClosure_t\
{\
public:\
repeat( comac_argc(__VA_ARGS__) ,impl_typeof_cpy,__VA_ARGS__ )\
int _member_cnt;\
public:\
name( repeat( comac_argc(__VA_ARGS__),con_param_typeof,__VA_ARGS__ ) ... ): \
repeat( comac_argc(__VA_ARGS__),param_init_typeof,__VA_ARGS__ ) _member_cnt(comac_argc(__VA_ARGS__))\
{}\
void exec()
#define co_func_end }
#endif
|
BC cornerback Hamp Cheevers, left, declared for the NFL Draft on Saturday.
Boston College junior cornerback Hamp Cheevers announced Saturday he will forgo his senior season and enter the 2019 NFL Draft, according to a team release sent on Sunday.
The 5-foot-10, 180-pound Cheevers recorded seven interceptions this season, — his first as a starter — and broke up seven passes, tied for second on the team in the latter category. He earned All-ACC first-team honors and played in 92 percent of the Eagles’ defensive snaps this season after playing in just 30 percent in 2017.
The Trenton, Fla., native finished his collegiate career with 56 tackles, 2.5 tackles for a loss, nine interceptions, 11 pass breakups, three forced fumbles, and a fumble recovery in 30 total games.
Brandon Chase can be reached at brandon.chase@globe.com.
After Matt Barnes gave up a one-run lead in the eighth, the visitors persevered and won on a Christian Vazquez sacrifice fly.
Brad Marchand scored twice, and a Game 7 is on for Tuesday night in Boston.
Ohashi — nicknamed ‘‘the Perfect 10’’ — ranked first nationally and scored six perfect 10s in floor exercise this season, with video of her routine drawing more than 117 million views.
The Indiana native had a big game in front of family and friends, helping the Celtics close out the Pacers.
Even if Bucks advance Monday, the conference semifinals won’t start before Saturday.
The Red Sox rookie third baseman turned a double play, handled three grounders and caught a popup in his first game at second base.
His first MLB at-bat resulted in a pinch-hit double in the ninth and was a key moment in Red Sox’ victory Saturday night. |
In general, acrylic acid is produced by a two-stage oxidation reaction process which comprises a contact reaction of propylene and oxygen in the presence of a catalyst to produce acrolein, and then a contact reaction of the resultant acrolein and oxygen. Recently, however, processes for producing acrylic acid in one stage using propane as a starting material are being investigated, and many proposals have been made on catalysts for use therein. Representative examples thereof include metal oxide catalysts such as an [Mo, Te, V, Nb] system (patent document 1) and [Mo, Sb, V, Nb] systems (patent documents 2 and 3).
Furthermore, some patent applications were recently filed with respect to processes for producing a catalyst having improved performances as compared with those metal oxide catalysts. For examples, patent document 4 discloses a process for producing a catalyst which comprises reacting a molybdenum compound, a vanadium compound, and an antimony compound in an aqueous medium at 70° C. or higher, mixing the resultant aqueous reaction solution with a niobium compound, subsequently vaporizing the resultant mixture to dryness, and calcining the solid matter at a high temperature.
Patent document 5 discloses a method of catalyst modification which comprises impregnating an [Mo, Te, V] catalyst or an [Mo, Sb, V] catalyst with a solution containing one or more elements selected from the group consisting of W, Mo, Cr, Zr, Ti, Nb, Ta, V, B, Bi, Te, Pd, Co, Ni, Fe, P, Si, rare-earth elements, alkali metals, and alkaline earth metals to thereby deposit other metal(s) on the catalyst. The catalytic performances of the modified catalyst in the ammoxidation reaction of propane are evaluated therein. Patent Document 1: JP-A-7-010801 (claims) Patent Document 2: JP-A-9-316023 (claims) Patent Document 3: JP-A-10-036311 (claims) Patent Document 4: JP-A-10-137585 (claims) Patent Document 5: JP-A-10-28862 (claims) |
<gh_stars>0
double produit(double, double);
|
A martyr in the fight for free online access to research
By killing himself, Internet activist Aaron Swartz has heated up the battle over whether the works of scientists and scholars should be available for free.
In death, Swartz has become a political martyr for the cause he championed in life: making scientific and scholarly research — much of it taxpayer-funded — freely available, not sequestered behind online pay walls out of the reach of the public.
"Aaron Swartz was not a criminal. He was a citizen and a brave soldier in a war which continues today, a war in which corrupt and venal profiteers try to steal and hoard and starve our public domain for their own private gain," said Carl Malamud, a technologist and outspoken advocate for open access to information.
They didn't just come to mourn a fallen comrade, they said. They came to carry on his fight. The memorial service held last week at the Internet Archive, a nonprofit group that occupies a former church in San Francisco, was as much political rally as solemn tribute.
SAN FRANCISCO — They came from all over Silicon Valley, hundreds packing the pews of an old church to pay their respects to Aaron Swartz, the 26-year-old programmer and Internet activist who took his own life this month.
The broader Internet freedom movement has also claimed Swartz as a cause. The self-described "hactivist" group Anonymous knocked out the website of the U.S. Sentencing Commission twice over the weekend to protest the government's treatment of Swartz.
Facing the possibility of a lengthy prison sentence if convicted on criminal charges for downloading millions of academic articles, Swartz hanged himself in his Brooklyn, N.Y., apartment. Friends say he had struggled with depression.
"Aaron's death should radicalize us," Taren Stinebrickner-Kauffman, Swartz's girlfriend, said in an emotional appeal to the open-access movement Thursday night.
Since his death, academics who support open access have posted their research online for all to see and download. And those in the movement say young people who never knew Swartz are joining their ranks, taking part in memorial hackathons and protests around the globe.
"I think a lot of people are going to be inspired by Aaron to act," said Peter Eckersley, technology projects director of the Electronic Frontier Foundation and a former roommate of Swartz's.
The battle over open access has been raging for years — and Swartz's death only promises to make that battle even more heated, activists say.
Most people can't afford the high prices charged for scholarly and scientific research published in hard-copy journals or on the Web behind pay walls, creating what Malamud says is "a members-only country club of knowledge."
With the rise of the Internet, activists had hoped to change that. About a decade ago, scholars and scientists, libraries and universities started to publish peer-reviewed research online free of charge after the release of the Budapest Open Access Initiative in 2002.
The movement steadily gained steam, said Heather Joseph, executive director of the Scholarly Publishing and Academic Resources Coalition, which works to broaden public access to scholarly research. In 2005, the National Institutes of Health adopted an open access policy. Nearly 2.5 million articles are on the NIH database, and more than 700,000 people access PubMedCentral every day. But NIH is still the only federal agency with an official public access policy on the books.
Activists have pushed legislation that would extend the NIH policy to other federal science agencies. But commercial and nonprofit publishers, professional societies and many academics have pushed back, introducing their own legislation to roll back open access at NIH. They argue that making all scholarly and scientific research freely available would upend a centuries-old system of peer review and publication and bankrupt academic journals.
Rob Weir, who teaches history at Smith College in Massachusetts, is the associate editor of a small journal. He says Swartz ignored the hidden costs and dangers of making research freely available. |
This was exactly what Rickie Fowler wanted to hear. "I'd pick him," a voice called out behind the ninth green Thursday at the TPC Boston, causing Fowler to look over his shoulder and smile. Too bad this pronouncement came from the caddie for Justin Rose, and not Ryder Cup captain Davis Love III, who now has the increasingly difficult decision of picking four players to fill out his American team.
"I'd pick him," a voice called out behind the ninth green Thursday at the TPC Boston, causing Fowler to look over his shoulder and smile.
The 99-man field in the Deutsche Bank Championship, which starts Friday, feels a lot smaller than that. This is the second event in the FedEx Cup playoffs as it moves closer to the Tour Championship and a shot at the $10 million bonus. But at least for the first few days, the chatter in a half-dozen players who face what amounts to the final audition before Love announces his picks Tuesday in New York.
Fowler is one of those players trying to make an impression. So is Hunter Mahan, who played two groups behind him in the pro-am. And right behind Mahan was Nick Watney, who wasn't even part of the Ryder Cup equation until he won The Barclays on Sunday. That made him No. 1 in the FedEx Cup standings, which made him happy. And it made Watney part of the Ryder Cup conversation, which made him ... well, he's not sure what to think.
Watney was such a long shot to make the Ryder Cup team a week ago that he hasn't been measured for a team uniform, and when Love hosted an informal dinner at the PGA Championship three weeks ago for potential Ryder Cup players, Watney didn't even get invited.
"For all I know, I'm not even in the conversation," Watney said. "I'm really not sure. All I can do is go and try to play my best. I know that's watered down and cliche, but it's really true. I'm not really shooting for any number or, 'If I finish in the top 10 I'll make it' because I'm just not sure. I guess I'll just to continue my momentum.
"And if I get that call, I could probably walk to Indy just as fast as fly because I'll be super, super excited."
Indianapolis, where the BMW Championship will be played next week, is the third stop in the playoffs. Getting to Crooked Stick is the goal for some three dozen players at the TPC Boston, because only the top 70 move on.
Among those on the bubble are Vijay Singh (No. 59), Pat Perez (No. 65), Sean O'Hair (No. 74) and Jason Day (No. 88). |
A new species of Paracomesoma (Comesomatidae) from Maldives (Indian Ocean) with an emended diagnosis and an updated key of the genus A new species from the subfamily Comesomatinae is described from the back-reef platforms of the central part of the Maldivian archipelago. Paracomesoma susannae sp. nov. is characterized by a large-sized body, very long cephalic sensilla (7291 m long), lateral differentiation of punctuations, and, in the males, 1922 minute precloacal supplements, relatively short spicules (2.32.9 anal body diameter) and a hook-like structure in the distal end of the gubernaculum. Paracomesoma susannae sp. nov. is the only species so far described of the genus which appears to have such a low ratio of the outer labial and cephalic sensilla (about 0.02). An emended diagnosis of P. paralongispiculum is proposed, along with an updated and modified key to all the valid species of the genus Paracomesoma. |
<reponame>naojsoft/g2cam
#! /usr/bin/env python
#
# Instrument configuration file.
#
import sys, os
import re
from g2base.astro.frame import Frame as AstroFrame
# NOTE: fov is specified as a RADIUS in DEGREES
insinfo = {
'IRCS': {
'name': 'IRCS',
'number': 1,
'code': 'IRC',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.011785,
'frametypes': 'AQ',
'description': u'Infra Red Camera and Spectrograph',
},
'AO': {
'name': 'AO',
'number': 2,
'code': 'AOS',
'active': False,
'interface': ('daqtk', 1.0),
'fov': 0.007000,
'frametypes': 'AQ',
'description': u'Subaru 36-elements Adaptive Optics',
},
'CIAO': {
'name': 'CIAO',
'number': 3,
'code': 'CIA',
'active': False,
'interface': ('daqtk', 1.0),
'fov': 0.007000,
'frametypes': 'AQ',
'description': u'Coronagraphic Imager with Adaptive Optics',
},
'OHS': {
'name': 'OHS',
'number': 4,
'code': 'OHS',
'active': False,
'interface': ('daqtk', 1.0),
'fov': 0.016667,
'frametypes': 'AQ',
'description': u'Cooled Infrared Spectrograph and Camera for OHS',
},
'FOCAS': {
'name': 'FOCAS',
'number': 5,
'code': 'FCS',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.05,
'frametypes': 'AQ',
'description': u'Faint Object Camera And Spectrograph',
},
'HDS': {
'name': 'HDS',
'number': 6,
'code': 'HDS',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.002778,
'frametypes': 'AQ',
'description': u'High Dispersion Spectrograph',
},
'COMICS': {
'name': 'COMICS',
'number': 7,
'code': 'COM',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.007,
'frametypes': 'AQ',
'description': u'Cooled Mid-Infrared Camera and Spectrograph',
},
'SPCAM': {
'name': 'SPCAM',
'number': 8,
'code': 'SUP',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.22433,
'frametypes': 'AQ',
'frames_per_exp': dict(A=10),
'description': u'Subaru Prime Focus Camera',
},
'SUKA': {
'name': 'SUKA',
'number': 9,
'code': 'SUK',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.004222,
'frametypes': 'AQ',
'description': u'Simulation Instrument',
},
'MIRTOS': {
'name': 'MIRTOS',
'number': 10,
'code': 'MIR',
'active': False, #???
'interface': ('daqtk', 1.0),
'fov': 0.004222,
'frametypes': 'AQ',
'description': u'',
},
'VTOS': {
'name': 'VTOS',
'number': 11,
'code': 'VTO',
'active': False, #???
'interface': ('daqtk', 1.0),
'fov': 0.004222,
'frametypes': 'AQ',
'description': u'',
},
'CAC': {
'name': 'CAC',
'number': 12,
'code': 'CAC',
'active': False,
'interface': ('daqtk', 1.0),
'fov': 0.011785,
'frametypes': 'AQ',
'description': u'Commissioning instrument',
},
'SKYMON': {
'name': 'SKYMON',
'number': 13,
'code': 'SKY',
'active': False,
'interface': ('daqtk', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'Original Sky Monitor',
},
'PI1': {
'name': 'PI1',
'number': 14,
'code': 'PI1',
'active': False, #???
'interface': ('daqtk', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'',
},
'K3D': {
'name': 'K3D',
'number': 15,
'code': 'K3D',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'',
},
'SCEXAO': {
'name': 'SCEXAO',
'number': 16,
'code': 'SCX',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.045,
'frametypes': 'BCQV',
'description': u'Subaru Coronagraphic Extreme Adaptive Optics',
},
'MOIRCS': {
'name': 'MOIRCS',
'number': 17,
'code': 'MCS',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.033333,
'frametypes': 'AQ',
'description': u'Multi-Object Infra-Red Camera and Spectrograph',
},
'FMOS': {
'name': 'FMOS',
'number': 18,
'code': 'FMS',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.22433,
'frametypes': 'AQ',
'description': u'Fiber Multi-Object Spectrograph',
},
'FLDMON': {
'name': 'FLDMON',
'number': 19,
'code': 'FLD',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'High Intensity Field Imager',
},
'AO188': {
'name': 'AO188',
'number': 20,
'code': 'AON',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.045,
'frametypes': 'AQ',
'description': u'Adaptive Optics 188',
},
'HICIAO': {
'name': 'HICIAO',
'number': 21,
'code': 'HIC',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'High Contrast Instrument for the Subaru Next Generation Adaptive Optics',
},
'WAVEPLAT': {
'name': 'WAVEPLAT',
'number': 22,
'code': 'WAV',
'active': True,
'interface': ('daqtk', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'Nasmyth Waveplate Unit for IR',
},
'LGS': {
'name': 'LGS',
'number': 23,
'code': 'LGS',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'Laser Guide Star Control',
},
'HSC': {
'name': 'HSC',
'number': 24,
'code': 'HSC',
'active': True,
'fov': 0.83,
'interface': ('g2cam', 1.0),
'frametypes': 'AQ',
'frames_per_exp': dict(A=200),
'description': u'Hyper-Suprime Cam',
},
'K3C': {
'name': 'K3C',
'number': 25,
'code': 'K3C',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'Kyoto 3D 2nd Generation Sensor',
},
'CHARIS': {
'name': 'CHARIS',
'number': 26,
'code': 'CRS',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'Coronagraphic High Angular Resolution Imaging Spectrograph',
},
'PFS': {
'name': 'PFS',
'number': 27,
'code': 'PFS',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'ABCD',
'frames_per_exp': dict(A=100, B=100, C=100, D=100),
'description': u'Prime Focus Spectrograph',
},
'IRD': {
'name': 'IRD',
'number': 28,
'code': 'IRD',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'',
},
'SWIMS': {
'name': 'SWIMS',
'number': 29,
'code': 'SWS',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'BCRS',
'frames_per_exp': dict(B=10, C=10, R=10, S=10),
'description': u'',
},
'MIMIZUKU': {
'name': 'MIMIZUKU',
'number': 30,
'code': 'MMZ',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'',
},
'VAMPIRES': {
'name': 'VAMPIRES',
'number': 31,
'code': 'VMP',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'VAMPIRES (interferometry with differential polarimetry)',
},
'MEC': {
'name': 'MEC',
'number': 32,
'code': 'MEC',
'active': False,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'',
},
'VGW': {
'name': 'VGW',
'number': 33,
'code': 'VGW',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'',
},
'TELSIM': {
'name': 'TELSIM',
'number': 34,
'code': 'TSM',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.023570,
'frametypes': 'AQ',
'description': u'Telescope simulator at the DD command level',
},
'CSW': {
'name': 'CSW',
'number': 35,
'code': 'CSW',
'active': True,
'interface': ('g2cam', 1.0),
'fov': 0.007,
'frametypes': 'AQ',
'description': u'COMICS Waveplate Unit',
},
}
class INSdata(object):
"""Class that allows you to query various information about Subaru instruments.
"""
def __init__(self, info=None):
# Make a map to the instrument info by name
self.nameMap = insinfo
# Update from supplementary info provided by config file
if info == None:
try:
infopath = os.path.join(os.environ['GEN2COMMON'],
'db', 'inscfg.yml')
if os.path.exists(infopath):
info = infopath
except:
pass
# Update from supplementary info provided by the user
if info:
if isinstance(info, str):
import yaml
with open(info, 'r') as in_f:
buf = in_f.read()
info = yaml.safe_load(buf)
assert isinstance(info, dict), Exception("argument must be a dict")
for key in info.keys():
if key in self.nameMap:
self.nameMap[key].update(info[key])
else:
self.nameMap[key] = info[key]
# Make a map to the instrument info by number
numberMap = {}
for d in insinfo.values():
numberMap[d['number']] = d
self.numberMap = numberMap
# Make a map to the instrument info by 3letter mnemonic
codeMap = {}
for d in insinfo.values():
codeMap[d['code']] = d
self.codeMap = codeMap
def getCodeByName(self, insname):
"""Get the 3-letter code used for a particular instrument name (_insname_).
Returns a string or raises a KeyError if the instrument is not found.
"""
insname = insname.upper()
return self.nameMap[insname]['code']
def getNumberByName(self, insname):
"""Get the number used for a particular instrument name (_insname_).
Returns an integer or raises a KeyError if the instrument is not found.
"""
insname = insname.upper()
return self.nameMap[insname]['number']
def getNameByCode(self, code):
"""Get the name used for a particular instrument by _code_.
Returns a string or raises a KeyError if the instrument is not found.
"""
code = code.upper()
return self.codeMap[code]['name']
def getNumberByCode(self, code):
"""Get the number used for a particular instrument _code_.
Returns an integer or raises a KeyError if the instrument is not found.
"""
code = code.upper()
return self.codeMap[code]['number']
def getNameByNumber(self, number):
"""Get the name used for a particular instrument by _number_.
Returns a string or raises a KeyError if the instrument is not found.
"""
return self.numberMap[number]['name']
def getCodeByNumber(self, number):
"""Get the 3-letter code used for a particular instrument by _number_.
Returns a string or raises a KeyError if the instrument is not found.
"""
return self.numberMap[number]['code']
def getNumbers(self, active=True):
"""Returns all the known instrument numbers.
"""
res = []
for (insname, d) in insinfo.items():
if active:
if d['active']:
res.append( self.nameMap[insname]['number'] )
else:
res.append( self.nameMap[insname]['number'] )
res.sort()
return res
def getNames(self, active=True):
"""Returns all the known instrument names.
"""
res = []
for (insname, d) in insinfo.items():
if active:
if d['active']:
res.append( self.nameMap[insname]['name'] )
else:
res.append( self.nameMap[insname]['name'] )
res.sort()
return res
def getCodes(self, active=True):
"""Returns all the known instrument codes.
"""
res = []
for (insname, d) in insinfo.items():
if active:
if d['active']:
res.append( self.nameMap[insname]['code'] )
else:
res.append( self.nameMap[insname]['code'] )
res.sort()
return res
def getOBCPInfoByName(self, insname):
"""Get the OBCP configuration used for a particular instrument by
_insname_.
Returns a dict or raises a KeyError if the instrument is not found.
"""
insname = insname.upper()
d = self.nameMap[insname]
res = {}
res.update(d)
return res
def getOBCPInfoByNumber(self, number):
insname = self.getNameByNumber(number)
return self.getOBCPInfoByName(insname)
def getOBCPInfoByCode(self, inscode):
insname = self.getNameByCode(inscode)
return self.getOBCPInfoByName(insname)
def getNameByFrameId(self, frameid):
fr = AstroFrame()
fr.from_frameid(frameid)
insname = self.getNameByCode(fr.inscode)
return insname
def getFileByFrameId(self, frameid):
insname = self.getNameByFrameId(frameid)
try:
datadir = os.environ['DATAHOME']
except KeyError:
raise Exception("Environment variable 'DATAHOME' not set")
return os.path.join(datadir, insname, frameid + '.fits')
def getFrametypesByName(self, insname):
"""Get the frame types used for a particular instrument by _insname_.
Returns a list.
"""
insname = insname.upper()
d = self.nameMap[insname]
try:
types = d['frametypes']
except KeyError:
types = 'AQ'
return list(types)
def getFramesPerExpByName(insname, frtype):
insname = insname.upper()
d = self.nameMap[insname]
try:
expnum = d['frames_per_exp'][frtype]
except KeyError:
expnum = 1
return expnum
def getInterfaceByName(self, insname):
"""Get the interface used for a particular instrument by
_insname_.
Returns a string or raises a KeyError if the instrument is not found.
"""
insname = insname.upper()
d = self.nameMap[insname]
return d['interface']
def getFovByName(self, insname):
"""Get the field of view (FOV) for a particular instrument by
_insname_. The value is the radius of the FOV and is expressed
in degrees. The FOV values in were copied from the Gen2
AgAutoSelect.cfg configuration file.
Returns a float or raises a KeyError if the instrument is not found.
"""
insname = insname.upper()
d = self.nameMap[insname]
return d['fov']
def main(options, args):
ins_data = INSdata()
show = options.show.lower()
ins_list = options.ins.upper().strip()
if ins_list == 'ACTIVE':
ins_list = ins_data.getNumbers(active=True)
elif ins_list == 'ALL':
ins_list = ins_data.getNumbers(active=False)
else:
ins_list = ins_list.split(',')
try:
# Try interpreting instrument list as numbers
ins_list = [int(elt) for elt in ins_list]
except ValueError:
try:
# Try interpreting instrument list as names
ins_list = [ins_data.getNumberByName(elt)
for elt in ins_list]
except KeyError:
try:
# Try interpreting instrument list as codes
ins_list = [ins_data.getNumberByCode(elt)
for elt in ins_list]
except KeyError:
raise Exception("I don't understand the type of items in '%s'" % options.ins)
for num in ins_list:
info = ins_data.getOBCPInfoByNumber(num)
if show == 'all':
print(info)
else:
try:
print(info[show])
except KeyError:
raise Exception("I don't understand --show=%s" % show)
if __name__ == '__main__':
# Parse command line options
from optparse import OptionParser
usage = "usage: %prog [options]"
optprs = OptionParser(usage=usage, version=('%%prog'))
optprs.add_option("--debug", dest="debug", default=False,
action="store_true",
help="Enter the pdb debugger on main()")
optprs.add_option("--show", dest="show", default='name',
help="Show name|code|number")
optprs.add_option("--ins", dest="ins", default='active',
help="List of names/codes/numbers or 'all' or 'active'")
optprs.add_option("--profile", dest="profile", action="store_true",
default=False,
help="Run the profiler on main()")
(options, args) = optprs.parse_args(sys.argv[1:])
if len(args) != 0:
optprs.error("incorrect number of arguments")
# Are we debugging this?
if options.debug:
import pdb
pdb.run('main(options, args)')
# Are we profiling this?
elif options.profile:
import profile
print("%s profile:" % sys.argv[0])
profile.run('main(options, args)')
else:
main(options, args)
#END
|
<reponame>newry/quqi
package com.quqi.impl.repository.wifi;
import org.springframework.data.repository.CrudRepository;
import com.quqi.impl.entity.wifi.UserTracking;
public interface UserTrackingRepository extends CrudRepository<UserTracking, Long> {
}
|
<reponame>nec-baas/baas-grafana-datasource
import {BaasDatasource} from "./datasource";
import {BaasDatasourceQueryCtrl} from "./query_ctrl";
import {BaasConfigCtrl} from "./config_ctrl";
export {
BaasDatasource as Datasource,
BaasDatasourceQueryCtrl as QueryCtrl,
BaasConfigCtrl as ConfigCtrl
};
|
A real-time optimal energy dispatch for microgrid including battery energy storage Microgrid is an effective system for integrating distributed generations, energy storages, loads and some auxiliary devices. To improve the efficiency of the system, the optimal energy dispatch is an effective method that can control these kinds of sources and loads. A real-time optimal energy dispatch for microgrid is proposed in this paper, which can reduce the energy loss and enhance the economy. Compared with the conventional dispatch method, that is more useful because the real-time dispatch can avoid some predictive error accumulation and the battery energy storage in the microgrid can transfer energy from one scheduled period to another. First, the object function of optimal energy dispatch is put forward and the constraints of microgrid are analyzed. Second, after the optimal model is established, the particle swarm optimization algorithm is adopted to search the optimal solution of the problem. Third, the best rated capacity of batteries of a certain microgrid is determined by simulation. At last, the optimal energy dispatch is verified by a simulation test and the result reveals this dispatch is effective and practical. |
<filename>haip/repository_test.go
package haip
import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/transip/gotransip/v6"
"github.com/transip/gotransip/v6/repository"
"io/ioutil"
"net"
"net/http"
"net/http/httptest"
"testing"
)
// mockServer struct is used to test the how the client sends a request
// and responds to a servers response
type mockServer struct {
t *testing.T
expectedURL string
expectedMethod string
statusCode int
expectedRequest string
response string
skipRequestBody bool
}
func (m *mockServer) getHTTPServer() *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
assert.Equal(m.t, m.expectedURL, req.URL.String()) // check if right expectedURL is called
if m.skipRequestBody == false && req.ContentLength != 0 {
// get the request body
// and check if the body matches the expected request body
body, err := ioutil.ReadAll(req.Body)
require.NoError(m.t, err)
assert.Equal(m.t, m.expectedRequest, string(body))
}
assert.Equal(m.t, m.expectedMethod, req.Method) // check if the right expectedRequest expectedMethod is used
rw.WriteHeader(m.statusCode) // respond with given status code
if m.response != "" {
_, err := rw.Write([]byte(m.response))
require.NoError(m.t, err, "error when writing mock response")
}
}))
}
func (m *mockServer) getClient() (*repository.Client, func()) {
httpServer := m.getHTTPServer()
config := gotransip.DemoClientConfiguration
config.URL = httpServer.URL
client, err := gotransip.NewClient(config)
require.NoError(m.t, err)
// return tearDown method with which will close the test server after the test
tearDown := func() {
httpServer.Close()
}
return &client, tearDown
}
func TestRepository_GetAll(t *testing.T) {
const apiResponse = `{ "haips": [ { "name": "example-haip", "description": "frontend cluster", "status": "active", "isLoadBalancingEnabled": true, "loadBalancingMode": "cookie", "stickyCookieName": "PHPSESSID", "healthCheckInterval": 3000, "httpHealthCheckPath": "/status.php", "httpHealthCheckPort": 443, "httpHealthCheckSsl": true, "ipv4Address": "172.16.31.10", "ipv6Address": "fdf8:f53e:61e4::18", "ipSetup": "ipv6to4", "ptrRecord": "frontend.example.com", "ipAddresses": [ "10.3.37.1", "10.3.38.1" ] } ] } `
server := mockServer{t: t, expectedURL: "/haips", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
all, err := repo.GetAll()
require.NoError(t, err)
require.Equal(t, 1, len(all))
assert.Equal(t, "example-haip", all[0].Name)
assert.Equal(t, "frontend cluster", all[0].Description)
assert.EqualValues(t, "active", all[0].Status)
assert.Equal(t, true, all[0].IsLoadBalancingEnabled)
assert.EqualValues(t, "cookie", all[0].LoadBalancingMode)
assert.Equal(t, "PHPSESSID", all[0].StickyCookieName)
assert.EqualValues(t, 3000, all[0].HealthCheckInterval)
assert.Equal(t, "/status.php", all[0].HTTPHealthCheckPath)
assert.Equal(t, 443, all[0].HTTPHealthCheckPort)
assert.Equal(t, true, all[0].HTTPHealthCheckSsl)
assert.Equal(t, "172.16.31.10", all[0].IPv4Address.String())
assert.Equal(t, "fdf8:f53e:61e4::18", all[0].IPv6Address.String())
assert.EqualValues(t, "ipv6to4", all[0].IPSetup)
assert.Equal(t, "frontend.example.com", all[0].PtrRecord)
require.Equal(t, 2, len(all[0].IPAddresses))
assert.Equal(t, "10.3.37.1", all[0].IPAddresses[0].String())
assert.Equal(t, "10.3.38.1", all[0].IPAddresses[1].String())
}
func TestRepository_GetSelection(t *testing.T) {
const apiResponse = `{ "haips": [ { "name": "example-haip", "description": "frontend cluster", "status": "active", "isLoadBalancingEnabled": true, "loadBalancingMode": "cookie", "stickyCookieName": "PHPSESSID", "healthCheckInterval": 3000, "httpHealthCheckPath": "/status.php", "httpHealthCheckPort": 443, "httpHealthCheckSsl": true, "ipv4Address": "172.16.31.10", "ipv6Address": "fdf8:f53e:61e4::18", "ipSetup": "ipv6to4", "ptrRecord": "frontend.example.com", "ipAddresses": [ "10.3.37.1", "10.3.38.1" ] } ] } `
server := mockServer{t: t, expectedURL: "/haips?page=1&pageSize=25", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
all, err := repo.GetSelection(1, 25)
require.NoError(t, err)
require.Equal(t, 1, len(all))
assert.Equal(t, "example-haip", all[0].Name)
assert.Equal(t, "frontend cluster", all[0].Description)
assert.EqualValues(t, "active", all[0].Status)
assert.Equal(t, true, all[0].IsLoadBalancingEnabled)
assert.EqualValues(t, "cookie", all[0].LoadBalancingMode)
assert.Equal(t, "PHPSESSID", all[0].StickyCookieName)
assert.EqualValues(t, 3000, all[0].HealthCheckInterval)
assert.Equal(t, "/status.php", all[0].HTTPHealthCheckPath)
assert.Equal(t, 443, all[0].HTTPHealthCheckPort)
assert.Equal(t, true, all[0].HTTPHealthCheckSsl)
assert.Equal(t, "172.16.31.10", all[0].IPv4Address.String())
assert.Equal(t, "fdf8:f53e:61e4::18", all[0].IPv6Address.String())
assert.EqualValues(t, "ipv6to4", all[0].IPSetup)
assert.Equal(t, "frontend.example.com", all[0].PtrRecord)
require.Equal(t, 2, len(all[0].IPAddresses))
assert.Equal(t, "10.3.37.1", all[0].IPAddresses[0].String())
assert.Equal(t, "10.3.38.1", all[0].IPAddresses[1].String())
}
func TestRepository_GetByName(t *testing.T) {
const apiResponse = `{ "haip": { "name": "example-haip", "description": "frontend cluster", "status": "active", "isLoadBalancingEnabled": true, "loadBalancingMode": "cookie", "stickyCookieName": "PHPSESSID", "healthCheckInterval": 3000, "httpHealthCheckPath": "/status.php", "httpHealthCheckPort": 443, "httpHealthCheckSsl": true, "ipv4Address": "172.16.31.10", "ipv6Address": "fdf8:f53e:61e4::18", "ipSetup": "ipv6to4", "ptrRecord": "frontend.example.com", "ipAddresses": [ "10.3.37.1", "10.3.38.1" ] } }`
server := mockServer{t: t, expectedURL: "/haips/example-haip", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
haip, err := repo.GetByName("example-haip")
require.NoError(t, err)
assert.Equal(t, "example-haip", haip.Name)
assert.Equal(t, "frontend cluster", haip.Description)
assert.EqualValues(t, "active", haip.Status)
assert.Equal(t, true, haip.IsLoadBalancingEnabled)
assert.EqualValues(t, "cookie", haip.LoadBalancingMode)
assert.Equal(t, "PHPSESSID", haip.StickyCookieName)
assert.EqualValues(t, 3000, haip.HealthCheckInterval)
assert.Equal(t, "/status.php", haip.HTTPHealthCheckPath)
assert.Equal(t, 443, haip.HTTPHealthCheckPort)
assert.Equal(t, true, haip.HTTPHealthCheckSsl)
assert.Equal(t, "172.16.31.10", haip.IPv4Address.String())
assert.Equal(t, "fdf8:f53e:61e4::18", haip.IPv6Address.String())
assert.EqualValues(t, "ipv6to4", haip.IPSetup)
assert.Equal(t, "frontend.example.com", haip.PtrRecord)
require.Equal(t, 2, len(haip.IPAddresses))
assert.Equal(t, "10.3.37.1", haip.IPAddresses[0].String())
assert.Equal(t, "10.3.38.1", haip.IPAddresses[1].String())
}
func TestRepository_Order(t *testing.T) {
const expectedRequestBody = `{"productName":"haip-pro-contract","description":"myhaip01"}`
server := mockServer{t: t, expectedURL: "/haips", expectedMethod: "POST", statusCode: 201, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.Order("haip-pro-contract", "myhaip01")
require.NoError(t, err)
}
func TestRepository_Update(t *testing.T) {
const expectedRequestBody = `{"haip":{"name":"example-haip","description":"frontend cluster","status":"active","isLoadBalancingEnabled":true,"loadBalancingMode":"cookie","stickyCookieName":"PHPSESSID","healthCheckInterval":3000,"httpHealthCheckPath":"/status.php","httpHealthCheckPort":443,"httpHealthCheckSsl":true,"ipv4Address":"172.16.31.10","ipv6Address":"fdf8:f53e:61e4::18","ipSetup":"ipv6to4","ptrRecord":"frontend.example.com","ipAddresses":["10.3.37.1","10.3.38.1"]}}`
server := mockServer{t: t, expectedURL: "/haips/example-haip", expectedMethod: "PUT", statusCode: 204, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
haip := Haip{
Name: "example-haip",
Description: "frontend cluster",
Status: "active",
IsLoadBalancingEnabled: true,
LoadBalancingMode: "cookie",
StickyCookieName: "PHPSESSID",
HealthCheckInterval: 3000,
HTTPHealthCheckPath: "/status.php",
HTTPHealthCheckPort: 443,
HTTPHealthCheckSsl: true,
IPv4Address: net.ParseIP("172.16.31.10"),
IPv6Address: net.ParseIP("fdf8:f53e:61e4::18"),
IPSetup: "ipv6to4",
PtrRecord: "frontend.example.com",
IPAddresses: []net.IP{net.ParseIP("10.3.37.1"), net.ParseIP("10.3.38.1")},
}
err := repo.Update(haip)
require.NoError(t, err)
}
func TestRepository_Cancel(t *testing.T) {
const expectedRequestBody = `{"endTime":"immediately"}`
server := mockServer{t: t, expectedURL: "/haips/example-haip", expectedMethod: "DELETE", statusCode: 204, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.Cancel("example-haip", gotransip.CancellationTimeImmediately)
require.NoError(t, err)
}
func TestRepository_GetAllCertificates(t *testing.T) {
const apiResponse = `{ "certificates": [ { "id": 25478, "commonName": "example.com", "expirationDate": "2019-11-23" } ] }`
server := mockServer{t: t, expectedURL: "/haips/example-haip/certificates", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
all, err := repo.GetAllCertificates("example-haip")
require.NoError(t, err)
require.Equal(t, 1, len(all))
assert.EqualValues(t, 25478, all[0].ID)
assert.Equal(t, "example.com", all[0].CommonName)
assert.Equal(t, "2019-11-23", all[0].ExpirationDate)
}
func TestRepository_AddCertificate(t *testing.T) {
const expectedRequestBody = `{"sslCertificateId":1337}`
server := mockServer{t: t, expectedURL: "/haips/example-haip/certificates", expectedMethod: "POST", statusCode: 201, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.AddCertificate("example-haip", 1337)
require.NoError(t, err)
}
func TestRepository_AddLetsEncryptCertificate(t *testing.T) {
const expectedRequestBody = `{"commonName":"foobar.example.com"}`
server := mockServer{t: t, expectedURL: "/haips/example-haip/certificates", expectedMethod: "POST", statusCode: 201, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.AddLetsEncryptCertificate("example-haip", "foobar.example.com")
require.NoError(t, err)
}
func TestRepository_DetachCertificate(t *testing.T) {
server := mockServer{t: t, expectedURL: "/haips/example-haip/certificates/1337", expectedMethod: "DELETE", statusCode: 204}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.DetachCertificate("example-haip", 1337)
require.NoError(t, err)
}
func TestRepository_GetAttachedIPAddresses(t *testing.T) {
const apiResponse = `{ "ipAddresses": [ "192.168.3.11", "192.168.3.11" ] }`
server := mockServer{t: t, expectedURL: "/haips/example-haip/ip-addresses", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
all, err := repo.GetAttachedIPAddresses("example-haip")
require.NoError(t, err)
require.Equal(t, 2, len(all))
assert.Equal(t, "192.168.3.11", all[0].String())
assert.Equal(t, "192.168.3.11", all[1].String())
}
func TestRepository_SetAttachedIPAddresses(t *testing.T) {
const expectedRequestBody = `{"ipAddresses":["10.3.37.1","10.3.37.2"]}`
server := mockServer{t: t, expectedURL: "/haips/example-haip/ip-addresses", expectedMethod: "PUT", statusCode: 204, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
ips := []net.IP{net.ParseIP("10.3.37.1"), net.ParseIP("10.3.37.2")}
err := repo.SetAttachedIPAddresses("example-haip", ips)
require.NoError(t, err)
}
func TestRepository_DetachIPAddresses(t *testing.T) {
server := mockServer{t: t, expectedURL: "/haips/example-haip/ip-addresses", expectedMethod: "DELETE", statusCode: 204}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.DetachIPAddresses("example-haip")
require.NoError(t, err)
}
func TestRepository_GetPortConfigurations(t *testing.T) {
const apiResponse = `{ "portConfigurations": [ { "id": 9865, "name": "Website Traffic", "sourcePort": 80, "targetPort": 80, "mode": "http", "endpointSslMode": "off" } ] } `
server := mockServer{t: t, expectedURL: "/haips/example-haip/port-configurations", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
all, err := repo.GetPortConfigurations("example-haip")
require.NoError(t, err)
require.Equal(t, 1, len(all))
assert.EqualValues(t, 9865, all[0].ID)
assert.Equal(t, "Website Traffic", all[0].Name)
assert.Equal(t, 80, all[0].SourcePort)
assert.Equal(t, 80, all[0].TargetPort)
assert.EqualValues(t, "http", all[0].Mode)
assert.Equal(t, "off", all[0].EndpointSslMode)
}
func TestRepository_GetPortConfiguration(t *testing.T) {
const apiResponse = `{ "portConfiguration": { "id": 9865, "name": "Website Traffic", "sourcePort": 80, "targetPort": 80, "mode": "http", "endpointSslMode": "off" } } `
server := mockServer{t: t, expectedURL: "/haips/example-haip/port-configurations/9865", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
configuration, err := repo.GetPortConfiguration("example-haip", 9865)
require.NoError(t, err)
assert.EqualValues(t, 9865, configuration.ID)
assert.Equal(t, "Website Traffic", configuration.Name)
assert.Equal(t, 80, configuration.SourcePort)
assert.Equal(t, 80, configuration.TargetPort)
assert.EqualValues(t, "http", configuration.Mode)
assert.Equal(t, "off", configuration.EndpointSslMode)
}
func TestRepository_AddPortConfiguration(t *testing.T) {
const expectedRequestBody = `{"name":"Website Traffic","sourcePort":443,"targetPort":443,"mode":"https","endpointSslMode":"on"}`
server := mockServer{t: t, expectedURL: "/haips/example-haip/port-configurations", expectedMethod: "POST", statusCode: 201, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
configuration := PortConfiguration{
Name: "Website Traffic",
SourcePort: 443,
TargetPort: 443,
Mode: "https",
EndpointSslMode: "on",
}
err := repo.AddPortConfiguration("example-haip", configuration)
require.NoError(t, err)
}
func TestRepository_UpdatePortConfiguration(t *testing.T) {
const expectedRequestBody = `{"portConfiguration":{"id":9865,"name":"Website Traffic","sourcePort":443,"targetPort":443,"mode":"https","endpointSslMode":"on"}}`
server := mockServer{t: t, expectedURL: "/haips/example-haip/port-configurations/9865", expectedMethod: "PUT", statusCode: 204, expectedRequest: expectedRequestBody}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
configuration := PortConfiguration{
ID: 9865,
Name: "Website Traffic",
SourcePort: 443,
TargetPort: 443,
Mode: "https",
EndpointSslMode: "on",
}
err := repo.UpdatePortConfiguration("example-haip", configuration)
require.NoError(t, err)
}
func TestRepository_RemovePortConfiguration(t *testing.T) {
server := mockServer{t: t, expectedURL: "/haips/example-haip/port-configurations/1337", expectedMethod: "DELETE", statusCode: 204}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
err := repo.RemovePortConfiguration("example-haip", 1337)
require.NoError(t, err)
}
func TestRepository_GetStatusReport(t *testing.T) {
const apiResponse = `{ "statusReport": [ { "ipAddress": "172.16.58.3", "port": 80, "ipVersion": 4, "loadBalancerName": "lb0", "loadBalancerIp": "192.168.127.12", "state": "up", "lastChange": "2019-09-29 16:51:18" } ] }`
server := mockServer{t: t, expectedURL: "/haips/example-haip/status-reports", expectedMethod: "GET", statusCode: 200, response: apiResponse}
client, tearDown := server.getClient()
defer tearDown()
repo := Repository{Client: *client}
all, err := repo.GetStatusReport("example-haip")
require.NoError(t, err)
require.Equal(t, 1, len(all))
assert.Equal(t, "172.16.58.3", all[0].IPAddress.String())
assert.Equal(t, 80, all[0].Port)
assert.Equal(t, 4, all[0].IPVersion)
assert.Equal(t, "lb0", all[0].LoadBalancerName)
assert.Equal(t, "192.168.127.12", all[0].LoadBalancerIP.String())
assert.Equal(t, "up", all[0].State)
assert.Equal(t, "2019-09-29 16:51:18", all[0].LastChange.Format("2006-01-02 15:04:05"))
}
|
package com.wj.servicelibrary.servlet;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import android.os.Environment;
public class GameServlet extends BaseServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setStatus(HttpServletResponse.SC_OK);
String path1 = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "WebInfos/app/gamelist1";
String path2 = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "WebInfos/app/gamelist2";
String path3 = Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "WebInfos/app/gamelist3";
String path = null;
int index = (Integer.valueOf(req.getParameter("index")) / 20) % 3;
if (index == 0) {
path = path1;
} else if (index == 1) {
path = path2;
} else {
path = path3;
}
File file = new File(path);
long length = file.length();
resp.setContentLength((int) length);
OutputStream out = resp.getOutputStream();
FileInputStream stream = new FileInputStream(file);
int count = -1;
byte[] buffer = new byte[1024];
while ((count = stream.read(buffer)) != -1) {
out.write(buffer, 0, count);
out.flush();
}
stream.close();
out.close();
}
}
|
/**
* @brief Send a adrc message
* @param chan MAVLink channel to send the message
* @param struct The MAVLink struct to serialize
*/
static inline void mavlink_msg_adrc_send_struct(mavlink_channel_t chan, const mavlink_adrc_t* adrc)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
mavlink_msg_adrc_send(chan, adrc->v, adrc->v1, adrc->v2, adrc->z1, adrc->z2, adrc->z3, adrc->s1, adrc->s2, adrc->s3);
#else
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ADRC, (const char *)adrc, MAVLINK_MSG_ID_ADRC_MIN_LEN, MAVLINK_MSG_ID_ADRC_LEN, MAVLINK_MSG_ID_ADRC_CRC);
#endif
} |
<filename>answers/ShauryaYamdagni/Day26/question1.java
import java.util.*;
class shaurya
{
public static boolean primecheck(int n)
{
// System.out.println("qwertyuiop");
int count=0;
int x;
for(x=1;x<=n;x++)
{
if(n%x==0)
count++;
// System.out.println("aaaaaaasdfghjmnbvcxz");
}
if(count==2)
return true;
else
return false;
}
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("enter the number of test case");
int n=sc.nextInt();
int pc=0,cc=0;
int y;
for(y=0;y<n;y++)
{
int low=sc.nextInt();
int high=sc.nextInt();
for(int x=low;x<=high;x++)
{
if(primecheck(x))
{
pc++;
}
else
{
cc++;
}
}
System.out.println(pc*cc);
pc=0;cc=0;
}
}
}
|
Direct Democracy and the Selection of Representative Institutions: Voter Support for Apportionment Initiatives, 1924-62 If voters had the opportunity to choose the characteristics of their representative institutions directly, how would they do so? Voters in several states selected the base of their state legislative apportionment through the initiative process prior to the reapportionment revolution of the 1960s, which provides a unique opportunity to answer this question. This study examines 13 such initiatives in four states between 1924 and 1962. Four factors are hypothesized to influence vote choice on these initiatives: urban-rural confict, partisanship, race, and economic self-interest. Through regression analysis of the county-level vote in these elections I find that economic self-interest consistently influences voter support for apportionment initiatives while these other factors influence it only occasionally. This finding suggests that distributive politics drive voters' evaluation of representative institutions and that the influence of other political factors depends on the historical and local context of an initiative. |
In 2008, India’s nominal trade-weighted exchange rate has depreciated by more than 12% whereas that of the Chinese currency has appreciated by nearly 10% (source: Bank for International Settlements). Whether by choice or default, the Chinese currency is headed in the right direction whereas the Indian rupee is headed in the wrong direction.
In a recent editorial, this newspaper had correctly identified the danger lurking in the balance of payments (BoP) statistics for the first quarter of the current fiscal year released by the Reserve Bank of India on 30 September. The editorial concluded with an advice to keep oil consumption under control so that the import bill and trade deficit would be contained. It should have made a broader point. Examining India’s the first quarter BoP statistics leads one to the conclusion that the dollar would continue to head north against the rupee while the Indian stock market is headed south.
External deficit or surplus is a mirror image of internal savings. The current account balance is the same as internal savings—investment balance. India’s household savings rate peaked in 2003-04. The corporate savings rate doubled between 2002-03 and 2006-07. Public sector savings rose, too, due to buoyant tax revenues spurred by the 9% growth in the gross domestic product (GDP). It appears that the savings rate, although on a rising trend over the long term, reached a short-term plateau in 2006-07. Hence, India’s old scourge—the current account deficit —is back.
If the current account deficit is to be arrested, it is important that domestic savings rises. It is better and efficient for India now if the government contributed to this savings increment rather than the private sector.
Paying no heed to the onset of the global credit crunch at the beginning of this year, the government opted for a profligate Budget for 2008-09. Even with the passage of the bailout plan in the US Congress, the severity of the credit crunch is unlikely to abate by much. Internationally, the dollar is in short supply due to the shrinking of the US current account deficit and due to the demand for dollars by foreign institutions whose dollar assets have dropped in value but whose dollar obligations have not.
Under these circumstances, even a modest current account deficit would continue to exert pressure on the rupee to weaken and potentially turn that into a rout if other factors—political and economic—turn unfavourable, too. It is one thing to defend an exchange rate with ample foreign exchange reserves but another thing to reinforce it with fundamental soundness. India can do the former but it must opt for the latter.
Having grown at an unsustainable rate over the last five years, the global economy is likely to grow at a sub-par rate over the next several years. With external demand thus likely subdued, there is little to be gained by keeping the rupee weak. In any case, the sensitivity of India’s exports to the rupee exchange rate is smaller than that of its imports to domestic growth. Further, India’s exports contribute little to GDP compared with domestic demand factors.
Ensuring domestic demand stays strong requires lower domestic interest rates. Structurally, lower interest rates require the fiscal deficit to decline credibly. India’s domestic debt is 90%-plus of GDP. Even if its external debt is much smaller, domestic debt is a potential inflation risk and an overhang on the currency. That deters foreign investors, especially when they are battling for survival on their home turf.
The government has to urgently embark on reducing public spending, abolish guaranteed returns on employee provident funds and resume privatization. This would lower government borrowing and domestic interest rates and restore confidence in the currency, while raising the domestic savings rate. Lower interest rates would then crowd in the needed investment from the private sector. It would greatly help, too, if the government worked on removing further impediments that have contributed to a massive underachievement of targeted generation of power and production of steel, as Pradip Baijal pointed out in the Business Standard recently.
The present government missed a fine opportunity to allow the market to set the retail price of petroleum products when crude oil was at a peak. Had it done so, retail prices could be dropping now bringing cheer to households. It is still not too late.
Setting the fiscal house in order and strengthening the fundamental underpinnings of the rupee would be a good legacy to leave for our economist-Prime Minister. Chances of this happening if a third-front government came to power are nil. Hence, the Bharatiya Janata Party (BJP), leaving its cussedness behind, must support it if the United Progressive Alliance (UPA) government takes such an initiative. Better still, if the BJP were proactive on this. It can make up for the ground it lost to the UPA on the nuclear deal. |
#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, m, k;
int l[N], r[N];
struct SegTree {
int maxi[N << 2];
int lazy[N << 2];
void propagate(int node) {
for (int i = 0; i < 2; ++i) {
maxi[node*2 + i + 1] += lazy[node];
lazy[node*2 + i + 1] += lazy[node];
}
lazy[node] = 0;
}
void update(int node, int l, int r, int ll, int rr, int val) {
// cerr << node << l << " " << r << " " << ll << " " << rr << " " << val << endl;
if (l > rr || r < ll) return;
if (l >= ll && r <= rr) {
maxi[node] += val;
lazy[node] += val;
return;
}
int mid = (l + r) >> 1;
propagate(node);
update(node*2 + 1, l, mid+0, ll, rr, val);
update(node*2 + 2, mid+1, r, ll, rr, val);
maxi[node] = max(maxi[node*2 + 1], maxi[node*2 + 2]);
}
int query(int node, int l, int r, int ll, int rr) {
// cerr << node << " " << l << " " << r << " " << ll << " " << rr << endl;
if (l > rr || r < ll) return 0;
if (l >= ll && r <= rr) return maxi[node];
int mid = (l + r) >> 1;
propagate(node);
return max(query(node*2 + 1, l, mid, ll, rr), query(node*2 + 2, mid+1, r, ll, rr));
}
void update(int l, int r, int val) {
// cerr << "UPD " << l << " " << r << " " << val << endl;
update(0, 0, n-1, l, r, val);
}
void update(int x, int val) {
update(x, x, val);
}
int query(int l, int r) {
// cerr << l << " " << r << endl;
return query(0, 0, n-1, l, r);
}
} tree;
int inter(int l, int r, int ll, int rr) {
return max(0, min(r, rr) - max(l, ll) + 1);
}
int lst[N];
int solve() {
scanf("%d %d %d", &n, &m, &k);
for (int i = 0; i < m; ++i) {
scanf("%d %d", &l[i], &r[i]);
--l[i], --r[i];
}
for (int i = 0; i < n - k + 1; ++i) {
for (int j = 0; j < m; ++j) {
tree.update(i, inter(i, i + k - 1, l[j], r[j]));
}
}
// cerr << "OK" << endl;
int ans = 0;
for (int i = 0; i < n - k + 1; ++i) {
int sum = 0;
for (int j = 0; j < m; ++j) {
int cur = inter(i, i + k - 1, l[j], r[j]);
sum += cur;
if (lst[j] < cur) {
for (int kk = lst[j] + 1; kk <= cur; ++kk) {
tree.update(max(0, l[j] - k + kk), min(n - k, r[j] - kk + 1), -1);
}
lst[j] = cur;
}
}
ans = max(ans, sum + tree.query(i + 1, n - k));
// cerr << "asdf" << endl;
}
printf("%d\n", ans);
return 0;
}
int main() {
int t = 1;
// scanf("%d", &t);
for (int tc = 0; tc < t; ++tc) {
solve();
}
return 0;
}
|
// ParseCategories sets category by string
func ParseCategories(s string) []*Category {
var cats Categories
if s != "" {
parts := strings.Split(s, ",")
for _, val := range parts {
partsCat := strings.Split(val, "_")
if len(partsCat) == 2 {
tmp, err := strconv.ParseUint(partsCat[0], 10, 8)
if err == nil {
c := uint8(tmp)
tmp, err = strconv.ParseUint(partsCat[1], 10, 8)
var sub uint8
if err == nil {
sub = uint8(tmp)
}
if categories.Exists(partsCat[0] + "_" + partsCat[1]) {
cats = append(cats, &Category{
Main: c,
Sub: sub,
})
}
}
}
}
}
return cats
} |
There has been a major shake up in the contractors involved in both of the new AP1000 nuclear power plant projects under construction in the U.S.
Westinghouse Electric Co. LLC, a group company of Toshiba Corp., announced on Oct. 27 that it signed a definitive agreement to acquire CB&I Stone & Webster Inc., the nuclear construction and integrated services businesses of CB&I.
Fluor to Manage Construction Workforce
After the transaction closes—expected by the end of 2015—Westinghouse and its affiliates would become the sole contractor over both the Plant Vogtle Unit 3 and 4 construction project in Georgia and the V.C. Summer Unit 2 and 3 construction project in South Carolina. However, Westinghouse later entered into an agreement with Fluor Corp. to manage a significant portion of the construction for the two projects.
According to Fluor, the company “will be providing project execution and direction, accountability for and management of professional staff and craft personnel, and a focus on safety, quality and project delivery certainty.”
Fluor will begin work immediately under a professional services agreement to assess the two projects, engaging the workforce and planning a transition of duties and responsibilities required to develop appropriate plans to manage plant construction. Fluor and Westinghouse have further agreed that Fluor’s scope will complete project construction at these facilities on a cost reimbursable basis, without liability for pre-existing conditions associated with prior construction.
“We are very pleased with the vote of confidence that Westinghouse, and the nuclear facility owners have placed in our company to manage the construction of these two U.S. nuclear mega-projects,” said Fluor Chairman and CEO David Seaton.
Westinghouse Enhances Nuclear Offerings
Westinghouse said the acquisition of CB&I Stone & Webster would support growth in its decontamination, decommissioning, and remediation services; enhance the company’s major nuclear project management and environmental services offerings; and add to its engineering expertise. The businesses will be part of a new Westinghouse subsidiary, which will also include a new government services business that is under development.
Under the agreement, Westinghouse will purchase the business of engineering, construction, procurement, management, design, installation, start-up, and testing of nuclear-fueled facilities, including the V.C. Summer project, the Vogtle project, and CB&I’s nuclear projects in China. Westinghouse is also acquiring CB&I's nuclear integrated services business, which includes small capital projects for existing nuclear plants in the U.S. In addition to the professional technical employees who will join Westinghouse, the company will acquire heavy cranes and equipment, and 11 facilities in the U.S. and Asia from CB&I.
“This acquisition supports our company’s strategic global growth framework, and expands our capabilities,” said Danny Roderick, Westinghouse’s president and CEO.
The agreement excludes CB&I's fossil power generation capability, its nuclear and industrial maintenance business, the mixed-oxide nuclear fuel conversion project at Savannah River, the Federal decommissioning business, and the NetPower program for the development of power generation plants with zero CO 2 emissions from the deal.
Although Westinghouse will assume full responsibility for all AP1000 nuclear projects and the nuclear integrated services business, CB&I will continue to supply discrete scopes of modules, fabricated pipe, and specialty services for the U.S. nuclear projects on a subcontract basis.
Positive Development for Nuclear Power Projects
CB&I’s President and CEO Philip K. Asherman considers the deal a positive development for all stakeholders in the current nuclear projects, saying that it will provide CB&I shareholders with “clarity and increased predictability from our growing backlog of work in markets that are more strategic to our future growth.”
Georgia Power, a subsidiary of Southern Co. and majority owner and operator of the Vogtle nuclear plant, said that the agreement is “extremely positive for the project.” As a result, the company and the other Vogtle co-owners (Oglethorpe Power Corp., Municipal Electric Authority of Georgia, and Dalton Utilities) have agreed on terms to settle all claims currently in litigation with the project's contractors and to include additional protections in the engineering, procurement, and construction (EPC) contract against future claims.
The agreement also reaffirms the current in-service dates of 2019 for Vogtle Unit 3 and 2020 for Vogtle Unit 4. Georgia Power said construction of the new units is progressing well and more than halfway complete based on contractual milestones.
South Carolina Electric & Gas Co., principal subsidiary of SCANA Corp. and majority owner and operator of the V.C. Summer nuclear plant, also considered the change to be beneficial. The amendment to its EPC contract revises the guaranteed substantial completion dates for Units 2 and 3 to August 31, 2019, and August 31, 2020, respectively, but links the dates to significantly higher delay-related liquidated damages.
“We are excited about the changes in the structure of the construction team and the amendment to the EPC contract for the new nuclear plants and see these changes as very positive,” said Kevin Marsh, SCANA’s chairman and CEO.
—Aaron Larson, associate editor (@AaronL_Power, @POWERmagazine) |
// -*- mode: go; coding: utf-8 -*-
// vi: set syntax=go :
// cSpell.language:en-GB
// cSpell:disable
package what3words
import (
"fmt"
"github.com/juju/errors"
)
// NewAutoSuggestRequest instantiate a AutoSuggestRequest object.
func NewAutoSuggestRequest(input string) *AutoSuggestRequest {
return &AutoSuggestRequest{
Input: input,
NResults: 3,
NFocusResults: 3,
PreferLand: false,
}
}
// NewAutoSuggestResponse instantiate a AutoSuggestResponse object.
func NewAutoSuggestResponse() *AutoSuggestResponse {
return &AutoSuggestResponse{}
}
// SetNResults sets the Number of results parameter.
func (ar *AutoSuggestRequest) SetNResults(number int) error {
if number <= 0 || number > 100 {
return errors.New("Number of results must be in range (0, 100]")
}
ar.NResults = number
return nil
}
// SetFocus sets the focus point.
func (ar *AutoSuggestRequest) SetFocus(focus *Coordinates) {
ar.Focus = focus
}
// SetNFocusResults sets the Number of focus results parameter.
func (ar *AutoSuggestRequest) SetNFocusResults(number int) error {
if number <= 0 || number > ar.NResults {
return errors.New("Number of results must be in range (0, Number-results]")
}
ar.NFocusResults = number
return nil
}
// SetClipToCountry sets the list of countries.
func (ar *AutoSuggestRequest) SetClipToCountry(countries []string) {
ar.ClipToCountry = countries
}
// SetClipToBoundingBox sets the cliping box.
func (ar *AutoSuggestRequest) SetClipToBoundingBox(box *Box) {
ar.ClipToBoundingBox = box
}
// SetClipToCircle sets the clipping circle.
func (ar *AutoSuggestRequest) SetClipToCircle(circle *Circle) {
ar.ClipToCircle = circle
}
// SetClipToPolyGon sets the clipping circle.
func (ar *AutoSuggestRequest) SetClipToPolyGon(polygon *PolyGon) {
ar.ClipToPolyGon = polygon
}
// SetInputType sets the Input type.
func (ar *AutoSuggestRequest) SetInputType(input string) error {
if input != vconHybrid && input != inputText && input != nmdpAsr {
return errors.New(fmt.Sprintf("Inout type must be one of '%s' '%s' or '%s'",
inputText, vconHybrid, nmdpAsr))
}
ar.InputType = input
return nil
}
// InputTypeIsText sets the Input type.
func (ar *AutoSuggestRequest) InputTypeIsText() bool {
return (ar.InputType == inputText)
}
// SetPreferLand sets the PeferLand type.
func (ar *AutoSuggestRequest) SetPreferLand(land bool) {
ar.PreferLand = land
}
|
County and federal authorities raided Santa Paula's sewer plant this week, seizing documents, computer files and water samples as part of an investigation into possible criminal conduct by a Colorado company that operates wastewater facilities across the country.
Agents from the Ventura County district attorney's office and the U.S. Environmental Protection Agency on Wednesday raided the plant on Corporation Street as part of an investigation into Englewood, Colo.-based Operations Management International.
"The entire scope of the investigation and potential charges have not been determined," said Deputy Dist. Atty. Eric Dobroth, an environmental protection specialist spearheading the local case. "It could take quite some time to review the evidence."
Operations Management, which runs 170 plants nationwide, including the site in Santa Paula and another in Fillmore, is being investigated for allegedly violating the terms of its federally issued discharging permit by dumping water that does not meet state and federal standards into the dry Santa Clara River.
In addition, according to a search warrant affidavit, the company allegedly filed false water-quality reports with state and federal officials and possibly engaged in wrongful record-keeping and reporting practices, city and county officials said. The record practice allegations involved Santa Paula and two Connecticut plants.
Susan Mays, a spokeswoman for Operations Management, said company officials were cooperating in the investigation and strongly believe there has been no wrongdoing.
"Our records of complying with applicable wastewater treatment rules and regulations is exemplary," Mays said.
The investigation came as a surprise to Santa Paula City Manager Wally Bobkiewicz, who said Friday he was unaware of any problems at the sewer plant until he saw the search warrant Wednesday.
"My sense, after reading the affidavit, is that these officials have probable cause to believe the company violated the terms of their permit," Bobkiewicz said.
Neither the city nor any of its employees is involved in the probe. Operations Management has run the city's wastewater treatment plant on contract since 1998 and employs five people at the Santa Paula and Fillmore facilities, Bobkiewicz said.
A single operations manager oversees both sites, but authorities declined to say whether he faced possible criminal prosecution along with the company. A search warrant also was served at the Fillmore plant, but only in an effort to seize records related to the Santa Paula site.
Problems at Santa Paula's wastewater treatment plant were uncovered late last year during a routine inspection by Los Angeles Regional Water Quality Control officials, Dobroth said. Later inspections by state officials confirmed the problems, he said.
Any possible environmental effects will not be known for several weeks or months, officials said. |
1. Field of the Invention
The present invention relates to a heartbeat sensing device, especially to a watch-typed heartbeat sensing device.
2. Description of the Prior Art
Heartbeat sensing device is a device for detecting and displaying a heartbeat of a user. It has been widely applied in various devices for medical diagnosis and sporting purposes. By means of the heartbeat sensing device, a heartbeat is detected and displayed, thereby a user or doctor can monitor the body status of the user or patient. For example, a heartbeat sensing device is commonly installed to work in coordination with an exercise equipment. The heartbeat of the exerciser is detected and shown via a display unit of the heartbeat sensing device. Moreover, the heartbeat sensing device may be equipped with other devices like audio device, alarm and so on, so as to provide the user multiple practical functions.
Basically, a heartbeat sensing device comprises a rubber conductor which is an electrode capable of detecting a heartbeat signal and a control circuit for processing the heartbeat signal. The rubber conductor is electrically connected to the control circuit, and the heartbeat signal detected by the rubber conductor is transmitted to the processing circuit of the control circuit for processing and then displayed in a display unit.
For a wireless heartbeat sensing device, besides the rubber conductor and control circuit, it further comprises a wireless transmitting circuit which emits the heartbeat signal wirelessly to a remote receiver which is positioned within an effective distance from the heartbeat sensing device. The remote receiver receives and displays the signal.
Currently, various types of heartbeat sensing device are available in the market. Some the heartbeat sensing devices are in the form of a watch. The watch-typed heartbeat sensing device is fitted on the wrist of the user for detecting the heartbeat.
In the operation of heartbeat sensing device, the electrical connection between the rubber connector and the control circuit is a critical part that affects the effective and precise transmission of the heartbeat signal. In the past few years, the manufacturers have been aimed and devoted to develop a good electrical connection that precisely transmits the heartbeat signal with high fidelity.
In the conventional design of electrical connection, the heartbeat sensing device generally comprises a conductive plate which is mounted at the bottom of the heartbeat sensing device. Thereby, the conductive plate directly contacts the user's body and detects his heartbeat.
FIG. 1 shows a conventional watch-typed heartbeat sensing device. As shown, the heartbeat sensing device 100a comprises a display device 10a and a first conductive contact 10b at the top surface. There is a second conductive contact at the bottom of the heartbeat sensing device 110a. When the watch-typed heartbeat sensing device 100a is put on the wrist of a user, the second conductive contact directly contacts the user's wrist. When the user touches the first conductive contact 10b with the other hand, the control circuit inside the heartbeat sensing device 100a detects the heartbeat of the user and transmits a signal to the display device 10a for displaying. However, such a watch-typed heartbeat sensing device has many drawbacks, including poor electrical connection, weak heartbeat signal, low fidelity and low precision caused by poor contact between the second conductive contact and the user's wrist, surface staining, wetting, abrasion and vibration. Those problems frequently happen in watch-typed heartbeat sensing device, and affect the normal operation and shorten the service life of heartbeat sensing device. |
/**
*
* Purpose - container for electricity meter information
*
*
* <p>Java class for ElectricityMeter complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ElectricityMeter">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="SerialNumber" type="{urn:aseXML:r38}MeterSerialNumber" minOccurs="0"/>
* <element name="NextScheduledReadDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
* <element name="Location" type="{urn:aseXML:r38}MeterLocation" minOccurs="0"/>
* <element name="Hazard" type="{urn:aseXML:r38}MeterHazard" minOccurs="0"/>
* <element name="InstallationTypeCode" type="{urn:aseXML:r38}MeterInstallationTypeCode" minOccurs="0"/>
* <element name="Route" type="{urn:aseXML:r38}MeterRoute" minOccurs="0"/>
* <element name="Use" type="{urn:aseXML:r38}MeterUse" minOccurs="0"/>
* <element name="Point" type="{urn:aseXML:r38}MeterPoint" minOccurs="0"/>
* <element name="Manufacturer" type="{urn:aseXML:r38}MeterManufacturer" minOccurs="0"/>
* <element name="Model" type="{urn:aseXML:r38}MeterModel" minOccurs="0"/>
* <element name="TransformerLocation" type="{urn:aseXML:r38}MeterTransformerLocation" minOccurs="0"/>
* <element name="TransformerType" type="{urn:aseXML:r38}MeterTransformerType" minOccurs="0"/>
* <element name="TransformerRatio" type="{urn:aseXML:r38}MeterTransformerRatio" minOccurs="0"/>
* <element name="Constant" type="{urn:aseXML:r38}MeterConstant" minOccurs="0"/>
* <element name="LastTestDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
* <element name="NextTestDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
* <element name="TestResultAccuracy" type="{urn:aseXML:r38}MeterTestResultAccuracy" minOccurs="0"/>
* <element name="TestResultNotes" type="{urn:aseXML:r38}MeterTestResultNotes" minOccurs="0"/>
* <element name="TestPerformedBy" type="{urn:aseXML:r38}MeterTestPerformedBy" minOccurs="0"/>
* <element name="MeasurementType" type="{urn:aseXML:r38}MeterMeasurementType" minOccurs="0"/>
* <element name="ReadTypeCode" type="{urn:aseXML:r38}MeterReadTypeCode" minOccurs="0"/>
* <element name="RemotePhoneNumber" type="{urn:aseXML:r38}MeterRemotePhoneNumber" minOccurs="0"/>
* <element name="CommunicationsEquipmentType" type="{urn:aseXML:r38}MeterCommunicationsEquipmentType" minOccurs="0"/>
* <element name="CommunicationsProtocol" type="{urn:aseXML:r38}MeterCommunicationsProtocol" minOccurs="0"/>
* <element name="DataConversion" type="{urn:aseXML:r38}MeterDataConversion" minOccurs="0"/>
* <element name="DataValidations" type="{urn:aseXML:r38}MeterDataValidations" minOccurs="0"/>
* <element name="Status" type="{urn:aseXML:r38}MeterStatusCode" minOccurs="0"/>
* <element name="Program" type="{urn:aseXML:r38}MeterProgram" minOccurs="0"/>
* <element name="AdditionalSiteInformation" type="{urn:aseXML:r38}MeterAdditionalSiteInformation" minOccurs="0"/>
* <element name="EstimationInstructions" type="{urn:aseXML:r38}MeterEstimationInstructions" minOccurs="0"/>
* <element name="AssetManagementPlan" type="{urn:aseXML:r38}MeterAssetManagementPlan" minOccurs="0"/>
* <element name="CalibrationTables" type="{urn:aseXML:r38}MeterCalibrationTables" minOccurs="0"/>
* <element name="UserAccessRights" type="{urn:aseXML:r38}MeterUserAccessRights" minOccurs="0"/>
* <element name="Password" type="{urn:aseXML:r38}MeterPassword" minOccurs="0"/>
* <element name="TestCalibrationProgram" type="{urn:aseXML:r38}MeterTestCalibrationProgram" minOccurs="0"/>
* <element name="KeyCode" type="{urn:aseXML:r38}KeyCode" minOccurs="0"/>
* <element name="CustomerFundedMeter" type="{urn:aseXML:r38}CustomerFundedMeter" minOccurs="0"/>
* <element name="DisplayType" type="{urn:aseXML:r38}DisplayType" minOccurs="0"/>
* <element name="SupplyPhase" type="{urn:aseXML:r38}SupplyPhase" minOccurs="0"/>
* <element name="GenerationType" type="{urn:aseXML:r38}GenerationType" minOccurs="0"/>
* <element name="GeneralSupply" type="{urn:aseXML:r38}YesNo" minOccurs="0"/>
* <element name="InstrumentTransformers" type="{urn:aseXML:r38}InstrumentTransformers" minOccurs="0"/>
* <element name="ControlEquipments" type="{urn:aseXML:r38}ControlEquipments" minOccurs="0"/>
* <element name="RegisterConfiguration" type="{urn:aseXML:r38}ElectricityMeterRegisterConfiguration" minOccurs="0"/>
* <element name="FromDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
* <element name="ToDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ElectricityMeter", propOrder = {
"serialNumber",
"nextScheduledReadDate",
"location",
"hazard",
"installationTypeCode",
"route",
"use",
"point",
"manufacturer",
"model",
"transformerLocation",
"transformerType",
"transformerRatio",
"constant",
"lastTestDate",
"nextTestDate",
"testResultAccuracy",
"testResultNotes",
"testPerformedBy",
"measurementType",
"readTypeCode",
"remotePhoneNumber",
"communicationsEquipmentType",
"communicationsProtocol",
"dataConversion",
"dataValidations",
"status",
"program",
"additionalSiteInformation",
"estimationInstructions",
"assetManagementPlan",
"calibrationTables",
"userAccessRights",
"password",
"testCalibrationProgram",
"keyCode",
"customerFundedMeter",
"displayType",
"supplyPhase",
"generationType",
"generalSupply",
"instrumentTransformers",
"controlEquipments",
"registerConfiguration",
"fromDate",
"toDate"
})
public class ElectricityMeter {
@XmlElementRef(name = "SerialNumber", type = JAXBElement.class, required = false)
protected JAXBElement<String> serialNumber;
@XmlElementRef(name = "NextScheduledReadDate", type = JAXBElement.class, required = false)
protected JAXBElement<XMLGregorianCalendar> nextScheduledReadDate;
@XmlElementRef(name = "Location", type = JAXBElement.class, required = false)
protected JAXBElement<String> location;
@XmlElementRef(name = "Hazard", type = JAXBElement.class, required = false)
protected JAXBElement<String> hazard;
@XmlElementRef(name = "InstallationTypeCode", type = JAXBElement.class, required = false)
protected JAXBElement<String> installationTypeCode;
@XmlElementRef(name = "Route", type = JAXBElement.class, required = false)
protected JAXBElement<String> route;
@XmlElementRef(name = "Use", type = JAXBElement.class, required = false)
protected JAXBElement<String> use;
@XmlElementRef(name = "Point", type = JAXBElement.class, required = false)
protected JAXBElement<String> point;
@XmlElementRef(name = "Manufacturer", type = JAXBElement.class, required = false)
protected JAXBElement<String> manufacturer;
@XmlElementRef(name = "Model", type = JAXBElement.class, required = false)
protected JAXBElement<String> model;
@XmlElementRef(name = "TransformerLocation", type = JAXBElement.class, required = false)
protected JAXBElement<String> transformerLocation;
@XmlElementRef(name = "TransformerType", type = JAXBElement.class, required = false)
protected JAXBElement<String> transformerType;
@XmlElementRef(name = "TransformerRatio", type = JAXBElement.class, required = false)
protected JAXBElement<String> transformerRatio;
@XmlElementRef(name = "Constant", type = JAXBElement.class, required = false)
protected JAXBElement<String> constant;
@XmlElementRef(name = "LastTestDate", type = JAXBElement.class, required = false)
protected JAXBElement<XMLGregorianCalendar> lastTestDate;
@XmlElementRef(name = "NextTestDate", type = JAXBElement.class, required = false)
protected JAXBElement<XMLGregorianCalendar> nextTestDate;
@XmlElementRef(name = "TestResultAccuracy", type = JAXBElement.class, required = false)
protected JAXBElement<BigDecimal> testResultAccuracy;
@XmlElementRef(name = "TestResultNotes", type = JAXBElement.class, required = false)
protected JAXBElement<String> testResultNotes;
@XmlElementRef(name = "TestPerformedBy", type = JAXBElement.class, required = false)
protected JAXBElement<String> testPerformedBy;
@XmlElementRef(name = "MeasurementType", type = JAXBElement.class, required = false)
protected JAXBElement<String> measurementType;
@XmlElementRef(name = "ReadTypeCode", type = JAXBElement.class, required = false)
protected JAXBElement<String> readTypeCode;
@XmlElementRef(name = "RemotePhoneNumber", type = JAXBElement.class, required = false)
protected JAXBElement<String> remotePhoneNumber;
@XmlElementRef(name = "CommunicationsEquipmentType", type = JAXBElement.class, required = false)
protected JAXBElement<String> communicationsEquipmentType;
@XmlElementRef(name = "CommunicationsProtocol", type = JAXBElement.class, required = false)
protected JAXBElement<String> communicationsProtocol;
@XmlElementRef(name = "DataConversion", type = JAXBElement.class, required = false)
protected JAXBElement<String> dataConversion;
@XmlElementRef(name = "DataValidations", type = JAXBElement.class, required = false)
protected JAXBElement<String> dataValidations;
@XmlElement(name = "Status")
@XmlSchemaType(name = "string")
protected MeterStatusCode status;
@XmlElementRef(name = "Program", type = JAXBElement.class, required = false)
protected JAXBElement<String> program;
@XmlElementRef(name = "AdditionalSiteInformation", type = JAXBElement.class, required = false)
protected JAXBElement<String> additionalSiteInformation;
@XmlElementRef(name = "EstimationInstructions", type = JAXBElement.class, required = false)
protected JAXBElement<String> estimationInstructions;
@XmlElementRef(name = "AssetManagementPlan", type = JAXBElement.class, required = false)
protected JAXBElement<String> assetManagementPlan;
@XmlElementRef(name = "CalibrationTables", type = JAXBElement.class, required = false)
protected JAXBElement<String> calibrationTables;
@XmlElementRef(name = "UserAccessRights", type = JAXBElement.class, required = false)
protected JAXBElement<String> userAccessRights;
@XmlElementRef(name = "Password", type = JAXBElement.class, required = false)
protected JAXBElement<String> password;
@XmlElementRef(name = "TestCalibrationProgram", type = JAXBElement.class, required = false)
protected JAXBElement<String> testCalibrationProgram;
@XmlElementRef(name = "KeyCode", type = JAXBElement.class, required = false)
protected JAXBElement<String> keyCode;
@XmlElementRef(name = "CustomerFundedMeter", type = JAXBElement.class, required = false)
protected JAXBElement<Boolean> customerFundedMeter;
@XmlElementRef(name = "DisplayType", type = JAXBElement.class, required = false)
protected JAXBElement<String> displayType;
@XmlElement(name = "SupplyPhase")
protected String supplyPhase;
@XmlElement(name = "GenerationType")
@XmlSchemaType(name = "string")
protected GenerationType generationType;
@XmlElement(name = "GeneralSupply")
@XmlSchemaType(name = "string")
protected YesNo generalSupply;
@XmlElement(name = "InstrumentTransformers")
protected InstrumentTransformers instrumentTransformers;
@XmlElementRef(name = "ControlEquipments", type = JAXBElement.class, required = false)
protected JAXBElement<ControlEquipments> controlEquipments;
@XmlElementRef(name = "RegisterConfiguration", type = JAXBElement.class, required = false)
protected JAXBElement<ElectricityMeterRegisterConfiguration> registerConfiguration;
@XmlElement(name = "FromDate")
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar fromDate;
@XmlElement(name = "ToDate")
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar toDate;
/**
* Gets the value of the serialNumber property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getSerialNumber() {
return serialNumber;
}
/**
* Sets the value of the serialNumber property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setSerialNumber(JAXBElement<String> value) {
this.serialNumber = value;
}
/**
* Gets the value of the nextScheduledReadDate property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}
*
*/
public JAXBElement<XMLGregorianCalendar> getNextScheduledReadDate() {
return nextScheduledReadDate;
}
/**
* Sets the value of the nextScheduledReadDate property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}
*
*/
public void setNextScheduledReadDate(JAXBElement<XMLGregorianCalendar> value) {
this.nextScheduledReadDate = value;
}
/**
* Gets the value of the location property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getLocation() {
return location;
}
/**
* Sets the value of the location property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setLocation(JAXBElement<String> value) {
this.location = value;
}
/**
* Gets the value of the hazard property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getHazard() {
return hazard;
}
/**
* Sets the value of the hazard property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setHazard(JAXBElement<String> value) {
this.hazard = value;
}
/**
* Gets the value of the installationTypeCode property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getInstallationTypeCode() {
return installationTypeCode;
}
/**
* Sets the value of the installationTypeCode property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setInstallationTypeCode(JAXBElement<String> value) {
this.installationTypeCode = value;
}
/**
* Gets the value of the route property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getRoute() {
return route;
}
/**
* Sets the value of the route property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setRoute(JAXBElement<String> value) {
this.route = value;
}
/**
* Gets the value of the use property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getUse() {
return use;
}
/**
* Sets the value of the use property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setUse(JAXBElement<String> value) {
this.use = value;
}
/**
* Gets the value of the point property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getPoint() {
return point;
}
/**
* Sets the value of the point property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setPoint(JAXBElement<String> value) {
this.point = value;
}
/**
* Gets the value of the manufacturer property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getManufacturer() {
return manufacturer;
}
/**
* Sets the value of the manufacturer property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setManufacturer(JAXBElement<String> value) {
this.manufacturer = value;
}
/**
* Gets the value of the model property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getModel() {
return model;
}
/**
* Sets the value of the model property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setModel(JAXBElement<String> value) {
this.model = value;
}
/**
* Gets the value of the transformerLocation property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getTransformerLocation() {
return transformerLocation;
}
/**
* Sets the value of the transformerLocation property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setTransformerLocation(JAXBElement<String> value) {
this.transformerLocation = value;
}
/**
* Gets the value of the transformerType property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getTransformerType() {
return transformerType;
}
/**
* Sets the value of the transformerType property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setTransformerType(JAXBElement<String> value) {
this.transformerType = value;
}
/**
* Gets the value of the transformerRatio property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getTransformerRatio() {
return transformerRatio;
}
/**
* Sets the value of the transformerRatio property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setTransformerRatio(JAXBElement<String> value) {
this.transformerRatio = value;
}
/**
* Gets the value of the constant property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getConstant() {
return constant;
}
/**
* Sets the value of the constant property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setConstant(JAXBElement<String> value) {
this.constant = value;
}
/**
* Gets the value of the lastTestDate property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}
*
*/
public JAXBElement<XMLGregorianCalendar> getLastTestDate() {
return lastTestDate;
}
/**
* Sets the value of the lastTestDate property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}
*
*/
public void setLastTestDate(JAXBElement<XMLGregorianCalendar> value) {
this.lastTestDate = value;
}
/**
* Gets the value of the nextTestDate property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}
*
*/
public JAXBElement<XMLGregorianCalendar> getNextTestDate() {
return nextTestDate;
}
/**
* Sets the value of the nextTestDate property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link XMLGregorianCalendar }{@code >}
*
*/
public void setNextTestDate(JAXBElement<XMLGregorianCalendar> value) {
this.nextTestDate = value;
}
/**
* Gets the value of the testResultAccuracy property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}
*
*/
public JAXBElement<BigDecimal> getTestResultAccuracy() {
return testResultAccuracy;
}
/**
* Sets the value of the testResultAccuracy property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}
*
*/
public void setTestResultAccuracy(JAXBElement<BigDecimal> value) {
this.testResultAccuracy = value;
}
/**
* Gets the value of the testResultNotes property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getTestResultNotes() {
return testResultNotes;
}
/**
* Sets the value of the testResultNotes property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setTestResultNotes(JAXBElement<String> value) {
this.testResultNotes = value;
}
/**
* Gets the value of the testPerformedBy property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getTestPerformedBy() {
return testPerformedBy;
}
/**
* Sets the value of the testPerformedBy property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setTestPerformedBy(JAXBElement<String> value) {
this.testPerformedBy = value;
}
/**
* Gets the value of the measurementType property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getMeasurementType() {
return measurementType;
}
/**
* Sets the value of the measurementType property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setMeasurementType(JAXBElement<String> value) {
this.measurementType = value;
}
/**
* Gets the value of the readTypeCode property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getReadTypeCode() {
return readTypeCode;
}
/**
* Sets the value of the readTypeCode property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setReadTypeCode(JAXBElement<String> value) {
this.readTypeCode = value;
}
/**
* Gets the value of the remotePhoneNumber property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getRemotePhoneNumber() {
return remotePhoneNumber;
}
/**
* Sets the value of the remotePhoneNumber property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setRemotePhoneNumber(JAXBElement<String> value) {
this.remotePhoneNumber = value;
}
/**
* Gets the value of the communicationsEquipmentType property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getCommunicationsEquipmentType() {
return communicationsEquipmentType;
}
/**
* Sets the value of the communicationsEquipmentType property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setCommunicationsEquipmentType(JAXBElement<String> value) {
this.communicationsEquipmentType = value;
}
/**
* Gets the value of the communicationsProtocol property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getCommunicationsProtocol() {
return communicationsProtocol;
}
/**
* Sets the value of the communicationsProtocol property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setCommunicationsProtocol(JAXBElement<String> value) {
this.communicationsProtocol = value;
}
/**
* Gets the value of the dataConversion property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getDataConversion() {
return dataConversion;
}
/**
* Sets the value of the dataConversion property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setDataConversion(JAXBElement<String> value) {
this.dataConversion = value;
}
/**
* Gets the value of the dataValidations property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getDataValidations() {
return dataValidations;
}
/**
* Sets the value of the dataValidations property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setDataValidations(JAXBElement<String> value) {
this.dataValidations = value;
}
/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link MeterStatusCode }
*
*/
public MeterStatusCode getStatus() {
return status;
}
/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link MeterStatusCode }
*
*/
public void setStatus(MeterStatusCode value) {
this.status = value;
}
/**
* Gets the value of the program property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getProgram() {
return program;
}
/**
* Sets the value of the program property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setProgram(JAXBElement<String> value) {
this.program = value;
}
/**
* Gets the value of the additionalSiteInformation property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getAdditionalSiteInformation() {
return additionalSiteInformation;
}
/**
* Sets the value of the additionalSiteInformation property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setAdditionalSiteInformation(JAXBElement<String> value) {
this.additionalSiteInformation = value;
}
/**
* Gets the value of the estimationInstructions property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getEstimationInstructions() {
return estimationInstructions;
}
/**
* Sets the value of the estimationInstructions property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setEstimationInstructions(JAXBElement<String> value) {
this.estimationInstructions = value;
}
/**
* Gets the value of the assetManagementPlan property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getAssetManagementPlan() {
return assetManagementPlan;
}
/**
* Sets the value of the assetManagementPlan property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setAssetManagementPlan(JAXBElement<String> value) {
this.assetManagementPlan = value;
}
/**
* Gets the value of the calibrationTables property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getCalibrationTables() {
return calibrationTables;
}
/**
* Sets the value of the calibrationTables property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setCalibrationTables(JAXBElement<String> value) {
this.calibrationTables = value;
}
/**
* Gets the value of the userAccessRights property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getUserAccessRights() {
return userAccessRights;
}
/**
* Sets the value of the userAccessRights property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setUserAccessRights(JAXBElement<String> value) {
this.userAccessRights = value;
}
/**
* Gets the value of the password property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getPassword() {
return password;
}
/**
* Sets the value of the password property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setPassword(JAXBElement<String> value) {
this.password = value;
}
/**
* Gets the value of the testCalibrationProgram property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getTestCalibrationProgram() {
return testCalibrationProgram;
}
/**
* Sets the value of the testCalibrationProgram property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setTestCalibrationProgram(JAXBElement<String> value) {
this.testCalibrationProgram = value;
}
/**
* Gets the value of the keyCode property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getKeyCode() {
return keyCode;
}
/**
* Sets the value of the keyCode property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setKeyCode(JAXBElement<String> value) {
this.keyCode = value;
}
/**
* Gets the value of the customerFundedMeter property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link Boolean }{@code >}
*
*/
public JAXBElement<Boolean> getCustomerFundedMeter() {
return customerFundedMeter;
}
/**
* Sets the value of the customerFundedMeter property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link Boolean }{@code >}
*
*/
public void setCustomerFundedMeter(JAXBElement<Boolean> value) {
this.customerFundedMeter = value;
}
/**
* Gets the value of the displayType property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getDisplayType() {
return displayType;
}
/**
* Sets the value of the displayType property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setDisplayType(JAXBElement<String> value) {
this.displayType = value;
}
/**
* Gets the value of the supplyPhase property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSupplyPhase() {
return supplyPhase;
}
/**
* Sets the value of the supplyPhase property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSupplyPhase(String value) {
this.supplyPhase = value;
}
/**
* Gets the value of the generationType property.
*
* @return
* possible object is
* {@link GenerationType }
*
*/
public GenerationType getGenerationType() {
return generationType;
}
/**
* Sets the value of the generationType property.
*
* @param value
* allowed object is
* {@link GenerationType }
*
*/
public void setGenerationType(GenerationType value) {
this.generationType = value;
}
/**
* Gets the value of the generalSupply property.
*
* @return
* possible object is
* {@link YesNo }
*
*/
public YesNo getGeneralSupply() {
return generalSupply;
}
/**
* Sets the value of the generalSupply property.
*
* @param value
* allowed object is
* {@link YesNo }
*
*/
public void setGeneralSupply(YesNo value) {
this.generalSupply = value;
}
/**
* Gets the value of the instrumentTransformers property.
*
* @return
* possible object is
* {@link InstrumentTransformers }
*
*/
public InstrumentTransformers getInstrumentTransformers() {
return instrumentTransformers;
}
/**
* Sets the value of the instrumentTransformers property.
*
* @param value
* allowed object is
* {@link InstrumentTransformers }
*
*/
public void setInstrumentTransformers(InstrumentTransformers value) {
this.instrumentTransformers = value;
}
/**
* Gets the value of the controlEquipments property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link ControlEquipments }{@code >}
*
*/
public JAXBElement<ControlEquipments> getControlEquipments() {
return controlEquipments;
}
/**
* Sets the value of the controlEquipments property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link ControlEquipments }{@code >}
*
*/
public void setControlEquipments(JAXBElement<ControlEquipments> value) {
this.controlEquipments = value;
}
/**
* Gets the value of the registerConfiguration property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link ElectricityMeterRegisterConfiguration }{@code >}
*
*/
public JAXBElement<ElectricityMeterRegisterConfiguration> getRegisterConfiguration() {
return registerConfiguration;
}
/**
* Sets the value of the registerConfiguration property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link ElectricityMeterRegisterConfiguration }{@code >}
*
*/
public void setRegisterConfiguration(JAXBElement<ElectricityMeterRegisterConfiguration> value) {
this.registerConfiguration = value;
}
/**
* Gets the value of the fromDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getFromDate() {
return fromDate;
}
/**
* Sets the value of the fromDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setFromDate(XMLGregorianCalendar value) {
this.fromDate = value;
}
/**
* Gets the value of the toDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getToDate() {
return toDate;
}
/**
* Sets the value of the toDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setToDate(XMLGregorianCalendar value) {
this.toDate = value;
}
} |
<reponame>DevGithub007/My_Codes
#include<stdio.h>
#include<string.h>
main()
{
int t,l,i,count;
char str[201];
scanf("%d",&t);
while(t--)
{
scanf("%s",str);
l=strlen(str);
count=4;
for(i=4;i<l-4;i++)
{
if(str[i]=='a'||str[i]=='e'||str[i]=='i'||str[i]=='o'||str[i]=='u')
continue;
else
count++;
}
printf("%d/%d\n",count,l);
}
}
|
The quest for the perfect necktie knot has endured for generations, a quest reflected in the numerous inventions directed towards assisting individuals to achieve, on a consistent basis, a symmetrical, triangular necktie knot. For example, U.S. Pat. No. 5,218,722 to Vandenberg, issued Jun. 15, 1993 discloses a tie fastener through which the necktie is threaded, to form a properly tied necktie. In the '722 patent, the tie fastener remains as part of the completed knot with the tie wrapped around the tie fastener. The tie fastener's triangular shape imparts shape to the knot.
Similarly, in U.S. Pat. No. 2,958,870 to Johnson issued Nov. 8, 1960, and U.S. Pat. No. 2,628,360 to Kush issued Feb. 17, 1953, a triangular shaped pin or clasp is provided to ensure that the knot formed around the triangular clasp is of a consistent "V" shape. In the Johnson '870 patent, a triangular shaped pin or clasp is provided that is slipped on the tie prior to knotting. The tie is then knotted such that underlying portions of the knot are engaged by members extending from the pin. As with the '722 patent to Vandenberg, the triangular shaped pin becomes part of the completed knot, helping to shape the knot. The '870 patent is disclosed for use in forming a four-in-hand knot only.
The '360 patent to Kush discloses a "necktie knot form" adapted to be incorporated within a four-in-hand knot. The necktie knot form is intended to aid in tying, forming and holding the "perfectly" formed knot. Like the Johnson and Vandenberg references, the Kush necktie knot form is placed onto the tie before the knot is formed, and remains part of the completed knot.
The prior art is primarily directed towards assisting a user who is already familiar with how to form the desired necktie knot. This assistance is rendered by providing a device designed to remain an integral part of the completed necktie, thus imparting the desired shape to the necktie knot.
Also, the prior art devices are dedicated typically to assist a user in tying one type of knot. For example, the above cited references are used for tying four-in-hand knots, and cannot readily be used to form other desired knots.
It would, therefore, be desirable to provide a device that could be used as a teaching aid for individuals unfamiliar with the art of tying neckties. It would further be desirable to be able to use this teaching device to tie a variety of different knots. |
Can the Jusuf Nurkic-less Trail Blazers fully dominate the Western Conference this season?
Despite the improvements made by most title contenders, the Golden State Warriors remain as the heavy favorite to take home the Larry O’Brien Trophy in the 2018-19 NBA season. The predictions are not surprising at all since after the Warriors won back-to-back NBA championship titles, they didn’t only retain their core of Stephen Curry, Klay Thompson, Kevin Durant, and Draymond Green, but they also managed to upgrade their roster with the acquisition of All-Star center DeMarcus Cousins in free agency.
With the Warriors expected to enter the NBA Playoffs 2019 with a starting lineup featuring five NBA All-Stars, it will definitely be hard to imagine them losing to any team in the league in a best-of-seven series. However, there are some people who don’t see the Warriors representing the Western Conference in the NBA Finals this year. Add NBA Hall of Famer and analyst Charles Barkley to that list. In an interview with Brandon Robinson of Heavy, Barkley said that the Portland Trail Blazers are the ones going to the NBA Finals 2019 and not the Warriors.
Charles Barkley said the same thing earlier in the month of March where he and fellow commentator Kenny Smith both agreed that the Trail Blazers will be making their first appearance in the NBA Finals since 1992. Smith believes that the Trail Blazers have what it takes to beat the star-studded Warriors in a best-of-seven series.
It’s easy to understand why Charles Barkley and Kenny Smith are very optimistic about the Trail Blazers’ chances to fully dominate the Western Conference. The Trail Blazers have Damian Lillard and C.J. McCollum, who are considered as one of the best backcourt duos in the league. As of now, the Trail Blazers continue to establish an impressive performance and have won eight of their last 10 games.
However, no one can blame people for not having the same insight as Charles Barkley and Kenny Smith regarding the Trail Blazers’ playoff chances. The Trail Blazers may be one of the best NBA teams during the regular season, but they failed to reciprocate the same performance in the playoffs, proven by the past two years where they were easily swept in the first round. To make things more complicated, the Trail Blazers will be entering the postseason without one of their key players, Jusuf Nurkic, who suffered a gruesome injury in their recent game against the Brooklyn Nets. |
Analyzing the Water Pollution Control Cost-Sharing Mechanism in the Yellow River and Its Two Tributaries in the Context of Regional Differences A river basin is a complex system of tributaries and a mainstream. It is vital to cooperatively manage the mainstream and the tributaries to alleviate water pollution and the ecological environment in the basin. On the other hand, existing research focuses primarily on upstream and downstream water pollution control mechanisms, ignoring coordinated control of the mainstream and tributaries, and does not consider the impacts of different environmental and economic conditions in each region on pollution control strategies. This study designed a differential game model for water pollution control in the Yellow River and two of its tributaries, taking regional differences into account and discussing the best pollution control strategies for each region under two scenarios: Nash noncooperative and cost-sharing mechanisms. Furthermore, the factors influencing regional differences in pollution control costs are analyzed, and their impacts on the cost-sharing mechanism of pollution control are discussed. The results show that: The cost-sharing mechanism based on cooperative management can improve pollutant removal efficiency in the watershed and achieve Pareto improvement in environment and economy. The greater the economic development pressure between the two tributaries, the fewer the effects of the cost-sharing mechanisms and the higher the proportion of pollution control costs paid by the mainstream government. Industry water consumption, the proportion of the urban population to the total population at the end of the year, the value-added of secondary sectors as a percentage of regional GDP, the volume of industrial wastewater discharge, and granted patent applications all influence industrial wastewater pollution treatment investment. The greater the coefficient of variation in pollution control costs between the two tributary areas, the less favorable the solution to water pollution management synergy. These findings can help governments in the basin regions negotiate cost-sharing arrangements. |
package dkeep.logic.objects;
import java.io.Serializable;
/** Door from a Level. */
public class Door extends DKObject implements Serializable {
/** Creates an instance of Door.
* @param x X-position of the door.
* @param y Y-position of the door.
* @param icon Icon of the door. */
public Door(int x, int y, char icon) {
super(x, y, icon);
}
/** Checks if the door is open.
* @return True if open, false otherwise. */
public boolean isOpen() {
return getIcon() == 'e' || getIcon() == 'S';
}
/** Checks if the door leads to an exit.
* @return True if it's an exit, false otherwise. */
public boolean isExit() {
return getIcon() == 'E' || getIcon() == 'e';
}
/** Unlocks an exit door previously locked. */
public void unlockDoor() {
if(getIcon() == 'E')
updateIcon('e');
DKObject.level.getMap()[getY()][getX()] = getIcon();
}
}
|
The state of Minnesota could be on the verge of losing a House seat after 2010 — and interestingly enough, it’s been a while since we heard Rep. Michele Bachmann (R-MN) talk about refusing to participate in the Census.
Last year, Bachmann repeatedly said she would defy the Census by not completely filling out the information on the forms, but would instead only give the number of people in her household. She said that Census data was used to conduct the 1940’s Japanese-American internment, and warned that the government was seeking to gather information about people’s mental health. But as far as we can tell, her last anti-Census public statement was in August.
The largest newspaper in Minnesota, the Star-Tribune, is calling on the state’s citizens to vigorously participate in the Census. The key issue here is that according to current population estimates, Minnesota is right on the cusp of losing one of its eight seats in Congress, and will be in a close competition with Missouri, Texas and California for that district. The Strib points out that “Minnesota traditionally has had one big advantage — the cooperation of its civic-minded citizens.”The Star-Tribune says in its editorial over the weekend:
It’s ironic that a Minnesota member of Congress, Republican Michele Bachmann, went so far last summer to declare her intention to only partially complete her census forms, and to suggest reasons for others not to comply with the census law. If Minnesota loses a congressional seat, Bachmann’s populous Sixth District could be carved into pieces. She likely would have to battle another incumbent to hang on to her seat. We’ve noticed that her anticensus rhetoric has lately ceased. We hope she got wise: Census compliance is not only in Minnesota’s best interest, but also her own.
The really fun fact, as I’ve learned from Minnesota experts, is that Bachmann’s district would likely be the first to go if the state lost a seat. The other seats are all fairly regular-shaped, logical districts built around identifiable regions of the state (Minneapolis, St. Paul, the Iron Range, and so on). Bachmann’s district is made of what’s left over after such a process, twisting and turning from a small strip of the Wisconsin border and curving deep into the middle of the state. As such, the obvious course of action if the state loses a seat is to split her district up among its neighbors. |
/**
* Game Math Utils
*/
public class GameMath {
// 获取两点间直线距离
public static int getLength(float x1, float y1, float x2, float y2) {
return (int) Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
}
/**
* 获取线段上某个点的坐标,长度为a.x - cutRadius
*
* @param a 点A
* @param b 点B
* @param cutRadius 截断距离
* @return 截断点
*/
public static PointF getBorderPoint(PointF a, PointF b, int cutRadius) {
float radian = getRadian(a, b);
// System.out.println(radian);
return new PointF(a.x + (int) (cutRadius * Math.cos(radian)), a.y
+ (int) (cutRadius * Math.sin(radian)));
}
/**
* getPointRandom
*
* @return Random PointF
*/
public static PointF getPointRandom() {
return new PointF((float) (MAP_WIDTH * Math.random()),
(float) (MAP_HEIGHT * Math.random()));
}
// 获取水平线夹角弧度
public static float getRadian(PointF start, PointF end) {
float lenA = end.x - start.x;
float lenB = end.y - start.y;
if (lenA == 0 && lenB == 0) {
return 404;
//
}
float lenC = (float) Math.sqrt(lenA * lenA + lenB * lenB);
float ang = (float) Math.acos(lenA / lenC);
ang = ang * (end.y < start.y ? -1 : 1);
return ang;
}
// 获取水平线夹角弧度
public static PointF getTarget(PointF start, float ang, float lenC) {
PointF end = new PointF();
end.x = (int) (lenC * Math.cos(ang));
end.y = (int) (lenC * Math.sin(ang));
end.offset(start.x, start.y);
// float lenA = end.x - start.x;
// float lenB = end.y - start.y;
// if (lenA == 0 && lenB == 0) {
// return 404;
// //
// }
// float lenC = (float) Math.sqrt(lenA * lenA + lenB * lenB);
// float ang = (float) Math.acos(lenA / lenC);
// ang = ang * (end.y < start.y ? -1 : 1);
return end;
}
// 获取两点的距离
public static float getDistance(PointF start, PointF end) {
float lenA = end.x - start.x;
float lenB = end.y - start.y;
return lenA == 0 && lenB == 0 ? 0 : (float) Math.sqrt(lenA * lenA + lenB * lenB);
}
// 获取两点的距离
public static boolean isCollisionForFood(Ball ball, FoodBall foodBall) {
float lenA = (float) (ball.position.x - foodBall.positionX);
float lenB = (float) (ball.position.y - foodBall.positionY);
return lenA == 0 && lenB == 0 || (float) Math.sqrt(lenA * lenA + lenB * lenB) < (ball.radius - foodBall.radius * 2) * (ball.radius - foodBall.radius * 2);
}
// 获取两点的距离
// public static float getDistance(float lenA, float lenB ) {
// if (lenA == 0 && lenB == 0) {
// return 0;
// }
// return (float) Math.sqrt(lenA*lenA+lenB*lenB);
// }
// 计算角度
public static float getRadian(float x1, float x2, float y1, float y2) {
float lenA = x2 - x1;
float lenB = y2 - y1;
if (lenA == 0 && lenB == 0) {
return 404;
}
float lenC = (float) Math.sqrt(lenA * lenA + lenB * lenB);
float ang = (float) Math.acos(lenA / lenC);
ang = ang * (y2 < y1 ? -1 : 1);
return ang;
}
public static float getAcceleratedSpeed() {
return (float) Math.random() * MAX_ACCELERATED_SPEED;
}
// public static float getDeathDistance(Ball ball1, Ball ball2) {
// return ball1.radius > ball2.radius ? (float) Math.sqrt(ball1.radius * ball1.radius - ball1.radius * ball1.radius) : (float) Math.sqrt(ball1.radius * ball1.radius - ball1.radius * ball1.radius);
// }
} |
Inauguration of George H. W. Bush, 1989.
Michael Mandelbaum is the Christian Herter Professor of American Foreign Policy at the Paul H. Nitze School of Advanced International Studies of The Johns Hopkins University, and the director of the project on East-West relations at the Council on Foreign Relations.
In 1989 the greatest geopolitical windfall in the history of American foreign policy fell into George Bush's lap. In a mere six months the communist regimes of eastern Europe collapsed, giving the West a sudden, sweeping and entirely unexpected victory in its great global conflict against the Soviet Union. Between July and December of 1989 Poland, Hungary, East Germany, Czechoslovakia, Bulgaria and Romania ousted communist leaders. Their new governments each proclaimed a commitment to democratic politics and market economics, and the withdrawal of Soviet troops from Europe began. All this happened without the West firing a single shot.
The revolutions in eastern Europe ended the Cold War by sweeping away the basic cause of the conflict between the two great global rivals: the Soviet European empire. They did so on George Bush's watch, a term that seems quite appropriate. As the revolutions occurred, he and his associates were more spectators than participants-a bit confused, generally approving, but above all passive. The president kept the United States in the background. In response to the most important international events of the second half of the twentieth century, the White House offered no soaring rhetoric, no grand gestures, no bold new programs. This approach served America's interests well. Events were moving in a favorable direction; staying in the background, taking care not to insert the United States into the middle of things, was the proper course of action. The qualities most characteristic of the Bush presidency-caution, modest public pronouncements and a fondness for private communications-were admirably suited to the moment. |
package com.pixelrifts.turtle.imgui;
import com.pixelrifts.turtle.glabs.base.Display;
import com.pixelrifts.turtle.glabs.base.Layer;
import com.pixelrifts.turtle.glabs.event.*;
import imgui.*;
import imgui.callbacks.ImStrConsumer;
import imgui.callbacks.ImStrSupplier;
import imgui.enums.ImGuiBackendFlags;
import imgui.enums.ImGuiConfigFlags;
import imgui.enums.ImGuiKey;
import imgui.enums.ImGuiMouseCursor;
import imgui.gl3.ImGuiImplGl3;
import static org.lwjgl.glfw.GLFW.*;
public class ImGuiLayer extends Layer {
private ImGuiIO io;
private final ImGuiImplGl3 imGuiGl3 = new ImGuiImplGl3();
private final long[] mouseCursors = new long[ImGuiMouseCursor.COUNT];
private final int[] fbWidth = new int[1];
private final int[] fbHeight = new int[1];
private final int[] winWidth = new int[1];
private final int[] winHeight = new int[1];
private final double[] mousePosX = new double[1];
private final double[] mousePosY = new double[1];
public ImGuiLayer() {
super("ImGui");
}
public void Init() {
ImGui.createContext();
io = ImGui.getIO();
io.setIniFilename(null);
io.setConfigFlags(ImGuiConfigFlags.NavEnableKeyboard | ImGuiConfigFlags.DockingEnable);
io.setBackendFlags(ImGuiBackendFlags.HasMouseCursors);
io.setBackendPlatformName("imgui_java_impl_glfw");
ImGui.styleColorsDark();
final int[] keyMap = new int[ImGuiKey.COUNT];
keyMap[ImGuiKey.Tab] = GLFW_KEY_TAB;
keyMap[ImGuiKey.LeftArrow] = GLFW_KEY_LEFT;
keyMap[ImGuiKey.RightArrow] = GLFW_KEY_RIGHT;
keyMap[ImGuiKey.UpArrow] = GLFW_KEY_UP;
keyMap[ImGuiKey.DownArrow] = GLFW_KEY_DOWN;
keyMap[ImGuiKey.PageUp] = GLFW_KEY_PAGE_UP;
keyMap[ImGuiKey.PageDown] = GLFW_KEY_PAGE_DOWN;
keyMap[ImGuiKey.Home] = GLFW_KEY_HOME;
keyMap[ImGuiKey.End] = GLFW_KEY_END;
keyMap[ImGuiKey.Insert] = GLFW_KEY_INSERT;
keyMap[ImGuiKey.Delete] = GLFW_KEY_DELETE;
keyMap[ImGuiKey.Backspace] = GLFW_KEY_BACKSPACE;
keyMap[ImGuiKey.Space] = GLFW_KEY_SPACE;
keyMap[ImGuiKey.Enter] = GLFW_KEY_ENTER;
keyMap[ImGuiKey.Escape] = GLFW_KEY_ESCAPE;
keyMap[ImGuiKey.KeyPadEnter] = GLFW_KEY_KP_ENTER;
keyMap[ImGuiKey.A] = GLFW_KEY_A;
keyMap[ImGuiKey.C] = GLFW_KEY_C;
keyMap[ImGuiKey.V] = GLFW_KEY_V;
keyMap[ImGuiKey.X] = GLFW_KEY_X;
keyMap[ImGuiKey.Y] = GLFW_KEY_Y;
keyMap[ImGuiKey.Z] = GLFW_KEY_Z;
io.setKeyMap(keyMap);
mouseCursors[ImGuiMouseCursor.Arrow] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
mouseCursors[ImGuiMouseCursor.TextInput] = glfwCreateStandardCursor(GLFW_IBEAM_CURSOR);
mouseCursors[ImGuiMouseCursor.ResizeAll] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
mouseCursors[ImGuiMouseCursor.ResizeNS] = glfwCreateStandardCursor(GLFW_VRESIZE_CURSOR);
mouseCursors[ImGuiMouseCursor.ResizeEW] = glfwCreateStandardCursor(GLFW_HRESIZE_CURSOR);
mouseCursors[ImGuiMouseCursor.ResizeNESW] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
mouseCursors[ImGuiMouseCursor.ResizeNWSE] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
mouseCursors[ImGuiMouseCursor.Hand] = glfwCreateStandardCursor(GLFW_HAND_CURSOR);
mouseCursors[ImGuiMouseCursor.NotAllowed] = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
io.setSetClipboardTextFn(new ImStrConsumer() {
@Override
public void accept(final String s) {
glfwSetClipboardString(Display.Window, s);
}
});
io.setGetClipboardTextFn(new ImStrSupplier() {
@Override
public String get() {
final String clipboardString = glfwGetClipboardString(Display.Window);
if (clipboardString != null)
return clipboardString;
return "";
}
});
final ImFontAtlas fontAtlas = io.getFonts();
final ImFontConfig fontConfig = new ImFontConfig();
fontConfig.setGlyphRanges(fontAtlas.getGlyphRangesCyrillic());
fontAtlas.addFontDefault();
fontConfig.setMergeMode(true);
fontConfig.setPixelSnapH(true);
fontConfig.destroy();
ImGuiFreeType.buildFontAtlas(fontAtlas, ImGuiFreeType.RasterizerFlags.LightHinting);
imGuiGl3.init("#version 330 core");
}
public void StartFrame(float deltaTime) {
glfwGetWindowSize(Display.Window, winWidth, winHeight);
glfwGetFramebufferSize(Display.Window, fbWidth, fbHeight);
glfwGetCursorPos(Display.Window, mousePosX, mousePosY);
final float scaleX = (float) fbWidth[0] / winWidth[0];
final float scaleY = (float) fbHeight[0] / winHeight[0];
io.setDisplaySize(fbWidth[0], fbHeight[0]);
io.setDisplayFramebufferScale(scaleX, scaleY);
io.setMousePos((float) mousePosX[0] * scaleX, (float) mousePosY[0] * scaleY);
io.setDeltaTime(deltaTime);
final int imguiCursor = ImGui.getMouseCursor();
glfwSetCursor(Display.Window, mouseCursors[imguiCursor]);
glfwSetInputMode(Display.Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
ImGui.newFrame();
}
public void EndFrame() {
ImGui.render();
imGuiGl3.render(ImGui.getDrawData());
}
@Override
public boolean OnLayerEvent(LayerEvent e) {
if (e instanceof KeyPressedEvent) {
KeyPressedEvent p = (KeyPressedEvent) e;
io.setKeysDown(p.GetKeyCode(), true);
io.setKeyCtrl(io.getKeysDown(GLFW_KEY_LEFT_CONTROL) || io.getKeysDown(GLFW_KEY_RIGHT_CONTROL));
io.setKeyShift(io.getKeysDown(GLFW_KEY_LEFT_SHIFT) || io.getKeysDown(GLFW_KEY_RIGHT_SHIFT));
io.setKeyAlt(io.getKeysDown(GLFW_KEY_LEFT_ALT) || io.getKeysDown(GLFW_KEY_RIGHT_ALT));
io.setKeySuper(io.getKeysDown(GLFW_KEY_LEFT_SUPER) || io.getKeysDown(GLFW_KEY_RIGHT_SUPER));
} else if (e instanceof KeyReleasedEvent) {
KeyReleasedEvent r = (KeyReleasedEvent) e;
io.setKeysDown(r.GetKeyCode(), false);
io.setKeyCtrl(io.getKeysDown(GLFW_KEY_LEFT_CONTROL) || io.getKeysDown(GLFW_KEY_RIGHT_CONTROL));
io.setKeyShift(io.getKeysDown(GLFW_KEY_LEFT_SHIFT) || io.getKeysDown(GLFW_KEY_RIGHT_SHIFT));
io.setKeyAlt(io.getKeysDown(GLFW_KEY_LEFT_ALT) || io.getKeysDown(GLFW_KEY_RIGHT_ALT));
io.setKeySuper(io.getKeysDown(GLFW_KEY_LEFT_SUPER) || io.getKeysDown(GLFW_KEY_RIGHT_SUPER));
} else if (e instanceof MouseButtonEvent) {
MouseButtonEvent m = (MouseButtonEvent) e;
int button = m.GetButton();
boolean press = m.IsPressed();
io.setMouseDown(0, button == GLFW_MOUSE_BUTTON_1 && press);
io.setMouseDown(1, button == GLFW_MOUSE_BUTTON_2 && press);
io.setMouseDown(2, button == GLFW_MOUSE_BUTTON_3 && press);
io.setMouseDown(3, button == GLFW_MOUSE_BUTTON_4 && press);
io.setMouseDown(4, button == GLFW_MOUSE_BUTTON_5 && press);
if (!io.getWantCaptureMouse() && io.getMouseDown(1)) {
ImGui.setWindowFocus(null);
}
} else if (e instanceof CharTypedEvent) {
CharTypedEvent c = (CharTypedEvent) e;
if (c.GetCharacter() != GLFW_KEY_DELETE) {
io.addInputCharacter(c.GetCharacter());
}
} else if (e instanceof MouseScrolledEvent) {
MouseScrolledEvent s = (MouseScrolledEvent) e;
io.setMouseWheelH(io.getMouseWheelH() + s.getXScroll());
io.setMouseWheel(io.getMouseWheel() + s.getYScroll());
}
return false;
}
public void Terminate() {
imGuiGl3.dispose();
ImGui.destroyContext();
}
}
|
Sodium Valproate Inhibits Small Cell Lung Cancer Tumor Growth on the Chicken Embryo Chorioallantoic Membrane and Reduces the p53 and EZH2 Expression The study aims to test the effect of different sodium valproate (NaVP) doses on small cell lung cancer NCI-H146 cells tumor in chicken embryo chorioallantoic membrane (CAM) model. Xenografts were investigated in the following groups: nontreated control and 5 groups treated with different NaVP doses (2, 3, 4, 6, and 8 mmol/L). Invasion of tumors into CAM in the nontreated group reached 76%. Tumors treated with 8 mmol/L NaVP doses significantly differed in tumor invasion frequency from the control and those treated with 2 mmol/L (P <.01). The calculated probability of 50% tumor noninvasion into CAM was when tumors were treated with 4 mmol/L of NaVP. Number of p53-positive cells in tumors was significantly reduced when treated with NaVP doses from 3 to 8 mmol/L as compared with control; number of EZH2-positive cells in control significantly differed from all NaVP-treated groups. No differences in p53- and EZH2-positive cell numbers were found among 4, 6, and 8 mmol/L NaVP-treated groups. Invaded tumors had an increased N-cadherin and reduced E-cadherin expression. The results indicate the increasing NaVP dose to be able to inhibit tumors progression. Expression of p53 and EZH2 may be promising target markers of therapeutic efficacy evaluation. Introduction The small cell lung cancer (SCLC) accounts for approximately 15% of lung cancers. 1 The SCLC is an aggressive and deadly lung cancer type, despite the fact that this cancer type is sensitive to initial chemotherapy and radiotherapy. Unfortunately, most patients die of the recurrent disease progression. 2,3 The SCLC is biologically, molecularly, and pathophysiologically very different from other lung cancers 1 and has a poor prognosis: The median survival without treatment is only 2 to 4 months, 4 and chemotherapy treatment increases the survival to 8 to 10 months. 5 Thus, the search for a targeted effective SCLC treatment is an urgent field of lung oncology. 6 The majority of SCLC tumors show neural and endocrine properties. 7 The SCLC cell lines have the malignant characteristics described as the increased proliferation resulting partly from cell cycle dysregulation. 8 The SCLC cells (NCI-H446 line) stably express the mesenchymal stem cell marker vimentin and other stem cell markers indicating their malignant phenotype; also, this cell line expresses neuroectodermal and mesodermal markers. 5 Sodium valproate (NaVP) is the histone deacetylases (HDACs) inhibitor binding the deacetylases catalytic center and causing the histone N-terminal tails hyperacetylation in vitro and in vivo. 9,10 The NaVP increases the apoptotic rate of different SCLC cell lines, including NCI-H146, 11 induces differentiation and cell cycle arrest in different cancer cell lines, and inhibits tumor growth and metastases in animal experiments; therefore, NaVP was proposed to serve as a medicine product for cancer therapy. Specific interactions between tumor cells and host tissues are necessary for tumor growth, tissue invasion, and metastases, and these cancer phenomena are in close relationship with the p53 gene expression observed in cancer cells versus normal cells; p53 mutations can disrupt the normal cell proliferation control or they can induce oncogene activation; the p53 is one of the important markers of tumorigenesis. 14,15 The prognostic value of the altered p53 expression in lung carcinomas is contradictory. 6 The significance of EZH2 as a target marker for the therapeutic efficacy of SCLC treatment is increasing: the EZH2 is functionally active in SCLC tumors, exerts protumorigenic functions in vitro, and is related with methylation profiles of PRC2 target genes in SCLC tumors 8,16 ; EZH2 is involved in cell death and cell cycle control in SCLC tumors by associations with the increased apoptotic activity by upregulating the Puma and Bad2 factors, the elevated p21 protein levels, and the decreased number of cells in the S or G2/M cell cycle phases. 7 The investigation of the EZH2 role in tumorigenesis has been performed using the chicken embryo chorioallantoic membrane (CAM) model to test EZH2 expression changes in relationship with tumor growth, angiogenesis, invasion and metastases of head and neck squamous cell carcinoma, and glioblastoma. 17,18 The CAM model is a useful tool for animal and human tumors or cancer cell transplants for evaluating the response to investigational medicine doses in relationship with the transplanted tumor growth and its invasion. A membrane-tethered form E-cadherin is a type I transmembrane glycoprotein-mediating adherent junctions among cells and is responsible for maintaining the normal structure of epithelial tissues; it is an epithelial marker important in tumor progression pathogenesis. 25,26 E-Cadherin is the central factor in the epithelial and mesenchymal phenotype transition (EMT) of cancer cells, and E-cadherin is typically expressed on the epithelial cell layers that do not form metastases. 27,28 The EMT process has been shown to potentiate cancer cells migration, invasion, and metastasis, and N-cadherin is a specific protein marker of EMT. 29 Tumor progression is related to reduction in cell-cell adhesion related to important molecular events for the facilitation of cell movement caused by the E-cadherin downregulation and the N-cadherin upregulation. 30 The study was aimed to show whether the treatment with increasing NaVP doses could influence the tumor growth and its invasion incidence into the CAM mesenchyme and the relationship of these changes with the p53 and EZH2 expression in the NCI-H146 cell tumors; also, to investigate different patterns of the epithelial marker E-cadherin and the mesenchymal marker N-cadherin expression in the NCI-H146 cell tumor in relationship with tumor invasion into the CAM mesenchyme. The study results suggest our 3-dimensional (3-D) tumor model to be appropriate for evaluating the NaVP effect in vivo and showing that NCI-H146 cell tumors invading the mesenchyme maintain clinically proven malignant features by expressing the mesenchymal marker N-cadherin. Chorioallantoic Membrane Assay Fertilized Cobb 500 chicken eggs from a local hatchery were transferred into a hatching incubator (Maino incubators, Oltrona S. M. , Italy) equipped with an automatic humidifier (Maino Enrico, R1569, Como, Italy) and an automatic rotator. The relative air humidity was 60%, and the temperature was 37 C. Eggs were automatically rotated until the third day of embryo development (EDD3). On EDD3, eggs were cleaned with warm 70% ethanol, a small hole at the air chamber was drilled, and approximately 2 mL of albumin was removed to create a false air sac above the CAM. Then a window of approximately 1 cm 2 was drilled, a window in the eggshell was opened and covered with a sterile transparent tape for the further inoculation of tumor cells. The eggs were then returned to the incubator, and the automatic egg rotation was turned off. The eggs were kept in the incubator until harvesting the CAM. The tumor cells were grafted on the seventh day of embryogenesis (EDD7). The visual fields of the tumors on CAM for investigating the p53 immunohistochemical expression in the study groups were as follows: 10 in the nontreated control, 12 in the 2 mmol/L NaVP-treated group, 16 in the 3 mmol/L NaVPtreated group, 12 in the 4 mmol/L NaVP-treated group, 18 in the 6 mmol/L NaVP-treated group, and 14 in the 8 mmol/L NaVP-treated group. The visual fields of the tumors on CAM for investigating the EZH2 expression in the studied groups were as follows: 12 in the nontreated control, 10 in the 2 mmol/L NaVP-treated group, 12 in the 3 mmol/L NaVP-treated group, 10 in the 4 mmol/L NaVP-treated group, 14 in the 6 mmol/L NaVPtreated group, and 18 in the 8 mmol/L NaVP-treated group. The number of invaded tumors in CAMs for E-and N-cadherin staining was equal to 10. Cell Culture The commercial human SCLC NCI-H146 cell line was obtained from the State Research Institute Centre for Innovative Medicine (Vilnius, Lithuania). The H146 cells were placed in 75-cm 2 tissue culture flasks and maintained in the Roswell Park Memorial Institute (RPMI)-1640 medium (Sigma-Aldrich, St. Louis, MO, USA) supplemented with 4.5 g/L of glucose, 2 mmol/L of L-glutamine, sodium pyruvate (Gibco, NY, USA), 4-(2-hydroxyethyl)-1-piperazineethanesulfonic acid containing 10% of the heat-inactivated fetal bovine serum, 100 U/mL of penicillin, and 100 mg/mL of streptomycin (Lonza, Verviers, Belgium). The cells were grown at 37 C in a humidified atmosphere of 95% air and 5% CO 2. The medium was routinely changed 2 to 3 days after seeding. The formed clusters were collected by centrifugation and resuspended in a fresh medium. Tumor Xenograft Model The cells with the growing medium were centrifuged leaving only the cell pellet without the supernatant. The amount of 1 10 6 H146 cells was resuspended in 10 mL of the serumfree RPMI-1640 medium mixed with NaVP (Sigma-Aldrich; Merck KGaA, Darmstadt, Germany). These cells were mixed with 10 mL of the type I rat tail collagen (Gibco). The final concentrations of the NaVP in the grafted tumor were 2, 3, 4, 6, and 8 mmol/L. A 20-mL portion of liquefied tumor cells was pipetted on an absorbable surgical sponge (Surgispon, Aegis Lifesciences, Gujarat, India) and cut into equal pieces of 9 mm 3 (3 3 1 mm) to make a solid form. Tumors of the control group (without NaVP) were formed only of H146 cells and the type I rat tail collagen. The formed tumors on the EDD7 were gently placed on a CAM among major blood vessels. The NaVP-treated and control specimens were collected after 5 days of incubation on 12th day of embryo development (EDD12), fixed in a buffered 10% formalin solution for 24 hours, and then paraffin embedded. Biomicroscopy In Vivo Eggs with formed tumors were visualized in ovo daily from the second until the fifth day postgrafting (ninth day of embryo development -EDD12) under an Olympus stereomicroscope (SZX2-RFA16; Tokyo, Japan) equipped with an Olympus DP72 camera and photographed using CellSens Dimension 1.9 Digital Imaging Software. Hematoxylin and Eosin Staining On EDD12, CAM with the tumors was removed, fixed in 10% neutral-buffered formalin, dehydrated, and embedded into paraffin. Chorioallantoic membranes with tumors were embedded in paraffin and cut into 3 mm sections using an LEICA RM 2155 microtome (Leica Microsystems, Inc, Buffalo Grove, Illinois). A standard hematoxylin and eosin (H&E) staining was performed. Evaluation of Tumor Invasion into CAM Mesenchyme Tumor behavior on CAMs in each of the experimental groups (nontreated and treated with different NaVP concentrations) was divided into invasive and noninvasive types: tumors that fully or partly (with chorionic epithelium erosion) invaded the CAMs mesenchyme were considered as invasive, while tumors that stayed on top of the CAM and failed to erode the chorionic epithelium were considered to be noninvasive. Immunohistochemistry For immunohistochemistry, tissue samples were placed on Superfrost adhesion histological slides, then the slides were placed 3 times in xylene for 5 minutes at room temperature and then in ethanol of graded series (70%, 80%, and 90%), each for 2 minutes. Then the slides were washed in distilled water for 1 minute 3 times. The epitope retrieval was performed using a high pH epitope retrieval solution (Dako, Glostrup, Denmark) in a pressure cooker (110 C for 3 minutes). The slides were stained using the Thermo Shandon cover plate system (Thermo Fisher Scientific, Inc. Dreieich, Germany). The peroxidaseblocking solution (Dako REAL; Dako) was followed by a tween-20 wash buffer for 10 minutes at room temperature (Dako). Then, the primary antibody solution (1:100) of the mouse monoclonal anti-p53 (aa 211-220, clone240, and CBL404; Millipore, Darmstadt, Germany), rabbit polyclonal anti-KMT6/EZH2 (phospho S21,and ab84989; Abcam, Cambridge, UK), the E-cadherin monoclonal mouse antibody Ab-4 (1:50; clone: NCH-38; NeoMarkers, CA, USA), and the monoclonal mouse anti-human N-cadherin (Clone: 6G11; Dako) were added for incubation. Slides with p53 and N-cadherin were kept at 4 C overnight, and incubation with EZH2 and E-cadherin took 30 minutes at room temperature. Then, the slides were washed with the tween-20 buffer, and the secondary antibody was added (EnVision FLEX MOUSE (LIN-KER); Dako), followed by the FLEX/HRP (EnVision FLEX/ HRP; Dako), both with incubation for 30 minutes at room temperature. The slides were then washed again with the tween-20, the 3,3 0 -diaminobenzidine chromogen (Dako) was added, and the slides were washed again. Finally, they were counterstained using the Mayers hematoxylin and mounted using a mounting medium (Roti HistoKit II, Carl Roth GbmH, Germany). Histomorphometric Analysis For the visualization and photographing of H&E stained tumors, an Olympus BX40F4 microscope (Olympus Corporation, Tokyo, Japan) and an Olympus XC30 digital camera (Olympus Corporation, Tokyo, Japan) were used. An Olympus BX43F microscope (Olympus, Corporation) equipped with an Olympus DP27 digital camera (Olympus Corporation, Tokyo, Japan) was used to photograph the immunohistochemically stained CAM. A 4 magnification was used for the visualization of H&E stained CAMs, a 20 for the visualization of immunohistochemically stained CAMs, and a 40 magnification was applied to calculate positively stained for p53 and EZH2 cells of the tumors formed on CAM. Nontreated group, 2 mmol/L NaVP-treated group, 3 mmol/L NaVP-treated group, 4 mmol/L NaVP-treated group, 6 mmol/L NaVPtreated group, and 8 mmol/L NaVP-treated group were analyzed. The histomorphometric analysis was performed using the CellSens Dimension 2010 software (version 1.3; Olympus Corporation). Two random 10 000 mm 2 fields were selected in each investigated tumor. All positively stained cells were counted in each field, and the percentage of cells positively stained for EZH2 and p53 were calculated. The data are shown as the percentage of positively stained cells in each group. Statistical Analysis Data of EZH2 and p53 stained cells in all investigated groups were expressed as median and range (minimum-maximum), and evaluated as nonparametric data using the GraphPad Prism 6.01 (GraphPad Software, Inc. CA, USA). The Mann-Whitney U test was used to compare these data among all investigated groups. The value of P <.05 was considered statistically significant. Graphical figures were performed using the SPSS version 23.0 (IBM SPSS, Armonk, New York) and Microsoft Excel (Microsoft Office 2016). The data of the tumors according to the frequency of invasion into CAM were calculated using the MedCalc statistical software (MedCalc.Ink) and the Probit regression. The w 2 test (P <.0001) and the Wald criterion (P <.0001) were the key parameters showing a highly statistically significant suitability for the chosen method of evaluation. The Pearson w 2 was used to calculate the statistical significance of tumor noninvasion among the investigated groups. The graphical figure for invasion data was done using the MedCalc statistical software. Figure 1 shows the H146 cell tumor morphology formation dynamic changes on CAM from EDD9 to EDD12 in the study groups. Nontreated H146 cells tend to form regularly shaped tumors starting from the EDD9 (Figure 1). These tumors gradually attract a large number of blood vessels toward the tumor. The formed angiogenic blood vessels are well seen in nontreated tumors (column A) at the EDD12 (they are pointed by arrows). Tumors treated with 2 mmol/L of NaVP formed visible tumors and did not attract such a great number of smalldiameter blood vessels as compared with the control, which are considered to be obviously angiogenic; only several blood vessels are seen to be extended toward the tumor ( Figure 1B, EDD12, arrows), and several larger blood vessels are present ( Figure 1B, EDD12, asterisk). In the 3 mmol/L NaVP-treated group, H146 cells are still able to form a clearly visible tumor but continue to fail attracting new blood vessels at the site of the tumor, only large preexisted blood vessels and some of the smaller diameter reaching the tumor ( Figure 1C, EDD12, arrow). In the CAMs with the tumor group treated with 4 mmol/L of NaVP, the further decrease of the amount of blood vessels is noticed ( Figure 1D, EDD12). In this group, the white area ( Figure 1D, EDD12, asterisk) indicates the disappearance of blood vessels from the tumor as compared with the "nontreated" CAM area surrounding the tumor ( Figure 1D, EDD12, quotation mark); moreover, visually a tumor appears larger because it does not penetrate the chorionic epithelium, and the main part of the tumor remains on the surface of the CAM. Macroscopic Evaluation of Tumors on CAM In the group of tumors formed by the 6 mmol/L NaVP-treated cells, tumors remained the same in size starting from the EDD9 to the EDD12 and showed no dynamic changes, although the tumor mass looked whitish, likewise those described earlier, and the area around a tumor contained a definitely lower number of blood vessels ( Figure 1E, EDD12, asterisk). Upon treating cells with 8 mmol/L of the NaVP, tumors did not attract the CAM blood vessels, and the same preexisting blood vessels were seen on days EDD9 to EDD12 (column F). Cells treated with 8 mmol/ L of NaVP formed tumors expanded on the CAM surface with the expressed lowered adhesion to the CAM (see histological results analysis data; Figure 2). NCI-H146 Cell Line Tumor Invasion Into CAM Mesenchyme at Various NaVP Concentrations and Tumor Histological Appearance The evaluation of tumor invasion (fully invaded and/or with erosion of chorionic epithelium) frequency into the CAM mesenchyme in the investigated groups depending on the used concentration of NaVP in the grafted tumor shows the following frequency: it was 76% in the control group, 76.47% in the group treated with 2 mmol/L of NaVP, 57.14% in the group treated with 3 mmol/L, 50% in the group treated with 4 mmol/L, 42.86% in the group treated with 6 mmol/L, and 16.67% in the group treated with 8 mmol/L. Comparing the invasion frequency of the control with the NaVP-treated groups, a significant difference was found when comparing the control and the 2 mmol/L groups with the 8 mmol/L NaVPtreated group (P <.01). In the other groups, the decreased invasion frequency showed only a tendency; therefore, we have calculated the probability of noninvasion regarding the used different NaVP concentrations in the tumor (Table 1 and Figure 3). The intact control CAM clearly shows all its 3 layers: the topmost layer is the chorionic epithelium (Figure 2A, ChE), the mesenchyme is below it (Figure 2A, M), and the next is the allantoic epithelium (Figure 2A, AE); the intact CAM is thin. In case the tumor invades the CAM, the mesenchyme becomes thicker. Tumors fully invading the CAM occupy almost the entire CAM mesenchyme. The tumor mass ( Figure 2B, T) is clearly visible inside the CAM mesenchyme. Another type of tumors partly invades the CAM ( Figure 2C) with the majority of the tumor (T) remaining on the top of the CAM. The CAM reacted to the tumor, and a great increase in the CAM thickness was observed. Dashed arrows show the place of tumor invasion via a completely destroyed chorionic epithelium of the CAM. The noninvaded tumor is shown in Figure 2D; this tumor is staying on the CAM, and the chorionic epithelium is well preserved; the CAM thickness is increased as compared with the intact control, and the tumor is seen to be partly surrounded by the CAM. Clear differences were observed comparing invaded tumors stained with E-cadherin ( Figure 2E) and N-cadherin ( Figure 2F). E-cadherin is more expressed in the middle of the tumor and with various intensity all around the tumor ( Figure 2E, thick arrows). An interesting outcome was noticed in the tumors stained with N-cadherin when its expression was seen at the periphery of the invaded tumor ( Figure 2F, thin arrows) at the invasive front; the middle area of the tumor ( Figure 2F) tends to have a weaker expression of the mesenchymal marker than the periphery. The Calculated Probability of Tumor Noninvasion Regarding the NaVP Concentration in Treated Tumor Cells The concentration-response curve with the corresponding NaVP concentrations and their 95% confidence interval (CI) are shown in Figure 3. The calculated values of the NaVP concentrations that correspond to a series of probabilities are shown in Table 1. We have found that ED50 (median effective concentration) is the value corresponding to a probability of.50, and the NaVP concentration about 4 mmol/L is responsible for reducing the NCI-H146 cell tumor penetration into the CAM by 50%, while the 95% CI (Figure 3, red line) for the probability of.5 is ranging from 2.8 to 5.7 mmol/L of the NaVP concentration ( Figure 3, green dashed lines, Table 1). Table 1 presents the calculated theoretically possible concentrations of the NaVP that correspond to the values of tumor noninvasion probabilities ranging from.2 to.95. To reduce tumor invasion by 80%, the 8.28 mmol/L NaVP concentration is needed (95% CI: 6.4-12.8 mmol/L). The highest NaVP concentration used in our experiments was 8 mmol/L and it decreased the tumor invasion almost by 80%. The theoretically calculated NaVP concentrations that are beyond our investigation are shown by shaded lines. The significant P values comparing the number of p53positive cells and the nontreated tumors with those treated with different NaVP concentrations are shown in Figure 4A. No difference was established in the 2 mmol/L NaVP-treated group as compared with the control (nontreated group), and no significant difference in the number of p53-positive cells was found among the 4, 6, and 8 mmol/L NaVP-treated groups. The differences in the immunohistochemical expression of p53 in nontreated and 6 mmol/L NaVP-treated groups are clearly seen ( Figure 4B and 4C, respectively). The arrangement of positive cells is seen as scattered clusters throughout all tumor area as well as around blood vessels ( Figure 4B, arrows). The nuclei of the tumor cells in the nontreated group were relatively big and stained intensively ( Figure 4B, arrowheads), while in the 6 mmol/L NaVP-treated group, only very few cells are seen to be stained positively with a reduced intensity of staining ( Figure 4C, arrowheads); blood vessels are not present in the tumor, indicating that the treatment inhibited the development and attraction of blood vessels. EZH2 Expression in NCI-H146 Cell Line Tumor in Response to Different Concentration of NaVP Treatment A high EZH2 expression was observed in the nontreated group: the median number of positively stained cells was 87.21% (ranging within 46%-97.1%). We observed a significant diminishing of the EZH2 positively stained cell numbers in all NaVP-treated groups compared with the nontreated group ( Figure 5). The number of EZH2-positive cells in the nontreated group significantly differs (P <.005) as compared with the 2 mmol/L NaVP-treated group (median 51.42, range 39.1%-80%); as described earlier, the number of p53-positive cells does not differ significantly between the nontreated and the 2 mmol/L NaVP-treated groups. This may indicate that the EZH2 marker may be more sensitive than the p53 index in the tested tumors. Comparing the nontreated group with the rest of the study groups (3,4,6, and 8 mmol/L of NaVP-treated groups), a high statistical significance was noticed. The number of EZH2positive cells in the 3 mmol/L NaVP-treated group (median 41.22% ) was found to be significantly different from the nontreated group (P.0009), the median was 29.11% (1.4%-47%) in the 4 mmol/L NaVP-treated group, 10.96% (1.5%-67.5%) in the 6 mmol/L group, and 21.13% (1.7%-33.3%) in the 8 mmol/L group. The NaVP-treated groups differed significantly from the nontreated group (P <.0001). The significant P values comparing the number of EZH2positive cells in the nontreated tumors and those treated with different NaVP concentrations are shown in Figure 5A. High amounts of positively stained EZH2 cells ( Figure 5B, arrowheads) are expressed in the nontreated group with a blood vessel in the tumor ( Figure 5B, long arrow), and groups of EZH2-positive tumor cells were found to be positioned throughout the tumor, while in the 6 mmol/L NaVP-treated group, these cells failed to make specific arrangements of positively stained cells; single positively stained cells are seen in the tumor (Figure 5C, arrowheads) with absent blood vessels. Discussion The SCLC is characterized by an aggressive, rapid tumor growth with active neoangiogenesis and with frequent early incidences of distal metastatic dissemination at the time of diagnosis; the SCLC 5-year survival is 7%. All patients with SCLC are former smokers, and the histology of the nonmalignant respiratory epithelium and SCLC-related tissue have a tobacco-damaged features. 34,35 The SCLC is a high-grade neuroendocrine tumor differing from all other lung cancers because its manifestation is characterized by several paraneoplastic syndromes. 1,36 The SCLC has a poor prognosis, and patients with the survival of 2 and more years are at a significantly higher risk of a second primary tumor development. 37 The SCLC initial response to chemotherapy is frequent; however, the recurrence of cancer and its multidrug resistance are very frequent. 31 Understanding the mechanisms of treatment resistance and finding new agents for the SCLC therapy require new experimental approaches. The majority of tested preclinically promising anticancer agents fail in the efficacy of clinical trials. Therefore, there is a need to develop, improve, and evaluate new experimental preclinical models for identifying and testing investigational therapeutics by validating molecular cancer biomarkers predicting response to targeted SCLC therapies. 1 We show the pharmacological effect of different NaVP doses in the formed NCI-H146 cell tumor growth on the CAM and the NaVP dose that acts most efficiently on tumor invasion into the CAM mesenchyme in relationship with the changed expression of p53 and EZH2 markers. Our experimental method is based on tumor cells instantly mixed with NaVP in the 3-D tumor model and then grafted onto the CAM. Such method allows a quick and reliable daily observation of the NaVP effect on tumors. It is worth noting that most of mice models are inadequate for such investigation because tumor cells are injected into the connective tissue and mechanically bypass the basement membrane of the surface epithelium-the first barrier for tumor invasion. 17 In contrast with mouse models, the CAM uppermost chorionic epithelium layer is the first barrier for the tumor cells. 17 There is only a single study that has investigated the human SCLC cell tumor xenograft on CAM. 3 Compared with mammalian models where grafted tumor growth often occurs in 3 to 6 weeks, assays using the CAM are faster: It takes up to 2 to 5 days after tumor cell inoculation for tumor xenografts to become visible and contain neoangiogenetically developed vessels of the CAM origin. 38,39 The CAM model is immunodeficient during embryonic development up to 19 days; thus, the CAM model may be used to evaluate tumor growth, its neoangiogenesis, invasion, metastases, and their response to investigational medicine, as well as to screen the effective doses of anticancer drugs. 24 However, the CAM model limitations are that it does not allow investigating the pharmacokinetics, bioavailability, and safety of medicinal products. Sodium Valproate Effect on NCI-H146 Cell Tumor Progression on the CAM Our data show the different effects of different NaVP concentrations on the NCI-H146 cell tumor dynamics on CAM, tumor ability to attach to the CAM, to destroy the chorionic epithelium, and to invade the CAM mesenchyme. The tumors treated with 8 mmol/L doses of NaVP significantly differed in tumor invasion frequency from the control tumors and those treated with 2 mmol/L of NaVP; the 6 mmol/L and 8 mmol/L NaVP-treated tumors more frequently failed to invade the CAM mesenchyme, and not invaded tumors were more spread on the CAM surface. The results of theoretical probability calculation of the effect of NaVP on the tumor invasion indicate that 4 mmol/L of NaVP is enough to reduce the NCI-H146 cell tumor invasion frequency by 50%, and the 8 mmol/L concentration reduces it by 80%. Sodium valproate is an inhibitor of HDAC and has anticancer properties with a notable effect on cell migration and invasion for both normal and malignant cells, and the treatment with HDAC inhibitors upregulates the metastasis suppressor genes and downregulates the metastasis activating genes in vitro and in vivo. Sodium valproate has been reported to inhibit tumor growth of different cancers. It significantly inhibits the growth and induces the apoptosis of different glioblastoma cell lines depending on the used doses 43 ; the 8 mmol/L NaVP dose in the U-87 cells tumor on CAM reduced tumor invasion by 90% 18 ; NaVP concentrations of 1 to 3 mmol/L induced cell differentiation and apoptosis of poorly differentiated thyroid cancer cells 43,44 ; NaVP inhibited prostate cancer cell migration by upregulating the E-cadherin expression 45 ; and the 5 to 10 mmol/L NaVP concentrations significantly induced the expression of the tumor suppressor gene IRF-3 in cancer cells, inhibiting nonsmall lung cancer cell growth. 46 Sodium valproate might markedly increase the sensitivity of lung adenocarcinoma cells resistant to erlotinib, thus strengthening NaVP as a potential medicine for resistant cancer therapy. 47 E-and N-Cadherin Expression in the Invaded Tumors The expression of mesenchymal marker N-cadherin in the tumor is known to be related with tumor progression as potentiating reduced cell-cell adhesion, increasing the migration and invasion of tumor cells. 29,30 It is known that in epithelial cells, the loss of E-cadherin and the increase in N-cadherin expression mean that the tumor cells have been converted into a metastatic phenotype. 48 Our immunohistochemical data on the NCI-H146 tumors invading the CAM mesenchyme show epithelial and mesenchymal properties as they express N-and E-cadherins; the invaded tumors were strongly expressing the mesenchymal marker N-cadherin, which appeared to be more expressed at the periphery of the invasive front of the tumor, while the middle part of the tumor stayed lightly stained and expressed only a moderate amount of N-cadherin positive NCI-H146 cells. In contrast, the epithelial marker E-cadherin expression was seen in the middle part of the invaded tumor where the expression of N-cadherin was weaker. Other researchers indicate that various tumors and tumor cell lines with a reduced expression of E-cadherin are associated with tumor progression and enhanced cell invasiveness. The Expression of p53-Positive Cells in NCI-H146 Cell Tumors on the CAM Our study shows the decreased number of p53-positive cells in the studied tumor groups to be directly dependent on the NaVP concentration used for the grafted tumor treatment. Compared with the control, the number of p53-positive cells in our investigation was significantly reduced in the 3 mmol/L NaVPtreated group, and in other groups treated with higher NaVP doses, the 6 mmol/L NaVP-treated group tumors showed the highest reduction of p53-positive cells. The recent publication of the NaVP effect on the glioblastoma U-87 cell line tumor on CAM has reported the half-inhibitory effect on mutant-p53 expression in tumors treated with 4 mmol/L of NaVP. 18 The hallmark SCLC genetic lesions including TP53 mutation and RB1 inactivation are present in all subtypes 54,55 with TP53 being more common (94.3%). 55 TP53 and RB1 are among the limited numbers of genes that are recurrently mutated in SCLC. 56 The p53 genetic alterations have been shown by immunohistochemistry in SCLC up to 70% to 100% and approximately 50% in non-SCLC. In mice, the functional inactivation of TP53 together with RB1 is sufficient for the development of SCLC. 57,58 Stratifying clinical cases by stage, 35.7% of TP53 mutations in the early-stage disease and 54.1% of mutations in the SCLC late-stage disease were found. 59 EZH2 Expression in the NCI-H146 Cell Tumors and the NaVP Effect In our study, a high EZH2 expression was observed in the nontreated tumor group: The median number of positively stained cells was 87.21%. Comparing the nontreated group and all NaVP-treated groups, we observed a significant diminishing NaVP treatment effect on the EZH2-positive cell number, and this effect decreased with an increased NaVP concentration in the groups; thus, NaVP decreases the EZH2-mediated cancer cell invasion. EZH2 is overexpressed in various cancers with a poor prognosis, among them the SCLC. 7,8,42,54,60 EZH2, the chromatin modifier, was among the most significantly overexpressed genes in SCLC; it was found to be more than 12 times higher expressed than in the normal lung tissue. 54 In the SCLC, EZH2 overexpression is related to cancer progression via related pathogenetic mechanisms as an increased cell proliferation, apoptosis suppression (via apoptosis signal-regulating kinase 1 (ASK1) or known as MAP3K5 (mitogen-activated protein kinase) and the transforming growth factor-b-SMAD pathway related to the suppression of achaete-scute homolog 1 gene (ASCL1) expression, and the suppression of SLFN11 (Schlafen family member 11) inducing resistance to chemotherapy. 7, It was shown that the EZH2 expression in H146 cell line was similar to that in other SCLC cell lines. 60 The knockdown of EZH2 inhibited the progression of SCLC. 64 The EZH2 plays a major role in SCLC pathophysiology and becomes a targeted EZH2 marker with the priority in the SCLC therapy evaluation. 65,66 Notably, the polycomb group protein EZH2 is a target of HDAC inhibitors. It has been proved that the EZH2-mediated cell invasion requires HDAC activity, and HDAC inhibitors decrease the EZH2-mediated cancer cell invasion. 42 Conclusions The tested NCI-H146 cell tumors invading the CAM mesenchyme show malignant phenotype features: the highly expressed N-cadherin at the periphery of the invasive front of the tumor, while its middle part shows the moderate amount of E-cadherin, as well as the EZH2 and p53 expression. Sodium valproate reduces the invasive capacity and the number of p53-and EZH2-positive cells in SCLC tumors as compared with the nontreated group. The NaVP effect on tumor progression depends on the NaVP concentration used for the treatment of tumor cells. Declaration of Conflicting Interests The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article. Funding The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The present study was partially funded by research fund of the Lithuanian University of Health Sciences (Grant no. V-1238). |
A Conservative Combined Laser Cryoimmunotherapy Treatment vs. Surgical Excision for Basal Cell Carcinoma Surgical excision is the standard treatment for basal cell carcinoma (BCC), but it can be challenging in elderly patients and patients with comorbidities. The non-surgical guidelines procedures are usually regarded as monotherapy options. This quasi-experimental, non-randomized, comparative effectiveness study aims to evaluate the efficacy of a combined, conservative, non-surgical BCC treatment, and compare it to standard surgical excision. Patients with primary, non-ulcerated, histopathologically confirmed BCCs were divided into a conservative treatment (129 patients) and a standard surgery subgroup (50 patients). The conservative treatment consisted of ablative CO2 laser, cryosurgery, topical occlusive 5-fluorouracil, and imiquimod. The follow-up examinations were performed 3 months after remission, then every 3 to 6 months, and were extended with telephone follow-ups. Cosmetic-self assessment was recorded during a telephone follow-up. Subjects from the conservative subgroup presented a clearance rate of 99.11%, and a recurrence rate of 0.98%. No recurrences were recorded in the surgical group, nor during the telephone follow-up. There were no differences regarding adverse events (p > 0.05). A superior self-assessment cosmetic outcome was obtained using the conservative method (p < 0.001). This conservative treatment is suitable for elders and patients with comorbidities, is not inferior to surgery in terms of clearance, relapses, or local adverse events, and displays superior cosmetic outcomes. Introduction Basal cell carcinoma (BCC) is the most common skin cancer in Caucasians, mainly diagnosed in fair-skinned individuals. BCC accounts for 80% of skin cancers, and one-third of all cancers in Western countries. This monomorphic neoplastic proliferation of the basal keratinocytes has a mild biological behavior, and is a slow-growing, non-aggressive cancer. BCC does not have precursors, and its rate of metastasis varies between 0.0028% and 0.55%. However, BCC can be locally invasive, depending on its histological subtypes: low-risk (superficial, nodular, pigmented) and high-risk (morpheiform, infiltrative, micronodular, and basosquamous). BCC treatments are standardized through international guidelines that take into account the histological subtypes: standard surgical excision, Mohs micrographic surgery, radiotherapy, photodynamic therapy, curettage, electrocautery, cryosurgery, laser ablation, topical treatment with imiquimod, 5-fluorouracil, and oral Hedgehog signaling pathway 2 of 13 inhibitors. The choice of treatment depends on tumoral features (localization, size, histological subtypes, recurrence risk, and importance of tissue preservation), patient-related factors (age, comorbidities, preferences), doctors' training, and surgical skills. Mohs and slow Mohs micrographic surgery are not widely available, and require intensive training. Radical surgical excision may also be challenging in elderly patients and patients with comorbidities in terms of anesthesia safety. On the other hand, the non-surgical guidelines procedures are usually regarded as monotherapy options. They include imiquimod or 5-fluorouracil, and tissue destructive options, such as curettage, electrocautery, cryosurgery, laser ablation, and photodynamic therapy. Since not all dermatology departments have operating theatres, conservative treatments may be more suitable in certain circumstances. Cosmetic concerns represent an attractive feature of conservative treatments, especially for less approachable areas (e.g., auricle). 5-fluorouracil is an antitumor compound whose local metabolites interfere with DNA synthesis and RNA functions. Furthermore, it increases p53 expression, and provides a potent antitumor effect by inducing apoptosis in cancerous and precancerous skin tumors, such as actinic keratosis, BCC, squamous cell carcinoma, and keratoacanthoma. As it penetrates only up to 1 mm into the skin, the low local absorption of 5-fluorouracil may represent an important limiting factor. 5-fluorouracil chemowraps (under occlusive bandages) may overcome this inconvenience, as was shown in squamous cell carcinomas and actinic keratoses ; the combination with cryosurgery was found to be efficient in treating BCCs. Imiquimod is a guanosine analog that stimulates innate immunity, and provides an antitumor effect. It is approved for the treatment of BCCs and other skin cancers, as well as cutaneous inflammatory disorders. Classic immunocryosurgery comprises imiquimod applications and cryosurgery. While imiquimod stimulates local activation of potent antigen-presenting cells, the cryosurgical insult promotes necrosis of the residual tumoral cells. The novel EADO classification for the BCC provides a five-group classification of difficult-to-treat BCCs based on five patterns of clinical circumstances ; future treatments should be guided by this current position statement. Nevertheless, current knowledge about the outcomes of a combined CO 2 laser, cryosurgery, imiquimod, and 5-fluorouracil is not sufficiently vast. The aims of this study are: to deliver an original and manageable conservative treatment (CTr); and to compare it with standard BCC surgery in terms of outcome, adverse events (AE), and cosmetic outcomes. This sequential treatment should be suitable for ambulatory care, tailored to elderly patients, patients with multiple comorbidities, or patients who refuse surgery. Study Design and Patient Recruitment A total of 179 patients with BCC from two academic centers were enrolled prospectively between 1 January 2013 and 15 December 2018 in a comparative effectiveness research study. The study includes adult patients (≥18 years) having biopsy-confirmed primary BCC. All patients provided informed consent, and the study was conducted in accordance with the ethical principles defined by the Helsinki Declaration, and was approved by the Ethics Committee of Carol Davila University of Medicine and Pharmacy (PO-35-F-03), Bucharest, Romania. Patients were divided based on their treatment choice, into 2 subgroups for evaluation: conservative treatment (n = 129) and standard surgical excision (n = 50). Patients with Gorlin syndrome, recurrent BCC, ulcerated BCC, relapsed BCC, patients with a history of severe immunosuppression (chronic uncontrolled infections, chemotherapy, radiotherapy, other immunosuppressive therapies) in the last 5 years, and pregnant patients were not included in this study. Procedures The following parameters were recorded initially in all patients: clinical examination details, digital dermoscopy, medical history, sex, age, skin Fitzpatrick's phototype, localization, size, histological BCC subtype, and the reason to undergo one of the two treatment methods (CTr or radical surgery). The anatomical sites of BCC were classified as follows: nose, neck, ears, cheeks, frontotemporal, scalp, limbs, and trunk, respectively. The BCC subtypes were classified as superficial (S), nodular (n), and others (O) (this included patients with pigmented variants and sclerosing BCCs). Before treatment, the standardized BCC dermoscopy criteria were applied. The same criteria were used for the post-procedural evaluations. Conservative Treatment A punch biopsy was performed prior to the CTr for diagnosis confirmation. The CTr consisted of a quasi-experimental protocol comprising ablative CO 2 laser, cryosurgery, and topical 5-fluorouracil and imiquimod. The novelty of this protocol consists of the combination of the otherwise monotherapeutic options into a multi-step conservative approach. The CTr (Figure 1) started with a full ablative CO 2 laser therapy and laser hemostasis under a topical anesthesia of lidocaine 2.5% and prilocaine 2.5%. For this, 1-3 laser passes with the power adjusted to 5 to 7 W/cm 2 (beam diameter 1mm) were used, with a security clinical margin of 5 mm around the suspected area. The angiogenic component guided the laser depth, and indicated the elimination of the tumor. Laser ablation was followed by a 5-fluorouracil (5FU) chemowrap for 24 h. Chemowraps consisted of 5% 5-FU cream to the skin under a compressive self-adhering bandage. Following 5FU chemowrap removal, an antibiotic powder containing zinc bacitracin 250 UI and neomycin sulfate 5000UI was applied for 5 days by the patients, twice a day. After a 7-day pause, the patients presented for cryosurgery (liquid nitrogen with 1mm diameter aperture, −196 C, freezing duration of 10 s, at 2 cm from the lesion surface), immediately followed by a 5% 5FU chemowrap for 24 h. Then, 8 occlusive applications of 5% imiquimod cream were made, with one application every two days. Patients were instructed to apply imiquimod at night, followed by an occlusive bandage, and to wash off the cream in the morning. Imiquimod applications were followed by a four-week healing phase. The second session of cryosurgery was subsequently performed, immediately followed by a 5% 5FU chemowrap for 24 h. After another four-week healing phase, clinical evaluation and dermoscopy were performed, and CTr remission (tumor clearance) was evaluated. Tumor clearance after CTr was defined as the absence of evidence of residual tumor via digital dermoscopy (Heine Delta 20 T attached to a Nikon digital camera). Surgery For the surgical subgroup, a standard scalpel elliptical excision with a minimum of 5 mm safety margins of clinically normal skin was performed in patients with a clinical and digital dermoscopy diagnosis of BCC, under a local anesthesia of lidocaine 1% and/or sedation. Subcutaneous and surface sutures were performed. The patients were reviewed at 10 to 14 days (depending on BCC localization) for the removal of sutures and a wound check. The diagnosis of BCC was histopathologically confirmed in all patients who underwent surgical excision or CTr. Adverse Events Patients were questioned about local AE (pain and pruritus) at each medical visit, following the procedure. The levels of local pain and pruritus were divided based on severity (mild, moderate, and severe), in both subgroups. The MD who performed the procedure also evaluated potential local infection, bullae after cryosurgery, scaling, and surgical wound dehiscence. If present, they were reported separately from the pain and pruritus levels. Unexpected AE were also noted, if present. All of the AE were collected for each patient during the entire treatment protocol, and were considered in the final analysis. Conservative treatment methodology. This method comprises an initial CO2 laser ablation, followed by self-application of antibiotic powder, two cryosurgery sessions, three 5-FU chemowraps (after CO2 laser and cryosurgery), and eight occlusive self-applications of imiquimod. A total of four visits to the physician's office (including the last one to establish BCC clearance) are required to complete the conservative treatment. 5-FU: 5-fluorouracil. Surgery For the surgical subgroup, a standard scalpel elliptical excision with a minimum of 5 mm safety margins of clinically normal skin was performed in patients with a clinical and digital dermoscopy diagnosis of BCC, under a local anesthesia of lidocaine 1% and/or sedation. Subcutaneous and surface sutures were performed. The patients were reviewed at 10 to 14 days (depending on BCC localization) for the removal of sutures and a wound check. The diagnosis of BCC was histopathologically confirmed in all patients who underwent surgical excision or CTr. Adverse Events Patients were questioned about local AE (pain and pruritus) at each medical visit, following the procedure. The levels of local pain and pruritus were divided based on severity (mild, moderate, and severe), in both subgroups. The MD who performed the procedure also evaluated potential local infection, bullae after cryosurgery, scaling, and surgical wound dehiscence. If present, they were reported separately from the pain and pruritus levels. Unexpected AE were also noted, if present. All of the AE were collected for each patient during the entire treatment protocol, and were considered in the final analysis. Patients Follow-Up The follow-up was performed three months after clearance, and every three to six months afterward, regardless of the treatment group. Patients who did not present for the first three month evaluation were considered lost to follow-up. Conservative treatment methodology. This method comprises an initial CO 2 laser ablation, followed by self-application of antibiotic powder, two cryosurgery sessions, three 5-FU chemowraps (after CO 2 laser and cryosurgery), and eight occlusive self-applications of imiquimod. A total of four visits to the physician's office (including the last one to establish BCC clearance) are required to complete the conservative treatment. 5-FU: 5-fluorouracil. Patients Follow-Up The follow-up was performed three months after clearance, and every three to six months afterward, regardless of the treatment group. Patients who did not present for the first three month evaluation were considered lost to follow-up. For both treatment subgroups, follow-up examinations consisted of clinical, photographic, and digital dermoscopy examinations. Surgical margins were evaluated. The absence of any BCC dermoscopy criteria was considered sufficient to exclude relapse. Follow-up examinations were extended for each patient with a telephone follow-up (TFU), three years after the clearance date. All of the examinations performed before TFU were performed in person. During TFU, signs and symptoms of recurrent BCC were questioned/recorded. The follow-up period (in-person and TFU) ended on 1 November 2021. Cosmetic Outcome Scarring and pigmentation changes were considered when assessing the final cosmetic outcome. The authors considered a minimum/absent scarring as a good cosmetic result. Cosmetic self-assessment was achieved by asking patients to rate the cosmetic outcome (very satisfied/moderately/slightly/not at all) during TFU. Statistical Analysis All investigative data were collected into a central database (Microsoft Excel) by the study coordinator. The statistical analysis was completed using the R software. Descriptive and graphical analysis was used to check assumptions of normality and linearity for all study variables. The normality of the distributions was also tested rigorously by Shapiro-Wilk test, and the symmetry of non-normal distributions by looking at the skewness and kurtosis indicators. Differences between subgroups were analyzed using an unpaired two-tailed t-test or Mann-Whitney U test for all continuous scale data between subgroups, where appropriate. A chi-square ( 2 ) or Fisher's exact test were used, where appropriate, to compare the prevalence of comorbid risk and AE between treatment subgroups. They were also used in the subgroup analyses, where we assessed whether intervention effect/AE varied by sex, skin type, site of lesion, tumor size (<10 mm, 10-30 mm, ≥30 mm), and age groups (30-54, 55-74, >75); we also tested the independence of treatment subgroups with regards to sex, skin type, subtype, and site of the lesion. Linear relations with a p-value (two-sided) ≤ 0.05 were considered significant. Participants A total of 179 patients were included in the study: 129 patients opted for conservative treatment, and 50 patients for radical surgery ( Figure 2). Among the CTr patients, 61 (47.29%) patients chose this treatment because they had surgical anxiety (refusal of surgery), 19 (14.73%) patients had comorbidities (insulin-dependent diabetes, heart failure, anticoagulation, liver disease, history of neoplasia, etc.) and considered lower risks to be associated with CTr, and 49 (37.98%) patients considered themselves too old to undergo surgery. Additionally, most of the patients also considered CTr for potential cosmetic advantages. All of the histopathological examinations confirmed non-ulcerated BCCs. A total of 113 patients completed the full CTr regimen (87.6%), 16 abandoned the regimen (12.4%) and 10 were excluded from the final analyses due to a lack of follow-up. The patients abandoned the conservative treatment for the following reasons: considered it too prolonged and chose surgery instead; left the country; accessibility reasons. Additionally, some were discovered to have visceral neoplasia in the meantime, and underwent surgery and oncological treatment. As such, they did not present for CTr continuation. Therefore, 103 patients from the conservative subgroup were analyzed. From the surgical subgroup, 4 patients were lost to follow-up, and 46 surgical patients were analyzed. An overall number of 149 patients completed the procedures and were analyzed. There were no significant differences between the two subgroups regarding gender, skin type, and BCC localizations. Subjects from the conservative subgroup were significantly older, and had a higher prevalence of comorbidities. The mean dimension of the BCCs was significantly lower in the CTr subgroup. The mean dimension of BCC varied between subgroups in patients with the histopathological nodular subtype, skin type II, and skin type III. Patients with tumor sizes below 10mm preferred the CTr to the surgical treatment, but those with BCCs between 10-30 mm preferred surgery instead (Tables 1 and 2). There were no significant differences between the two subgroups regarding gender, skin type, and BCC localizations. Subjects from the conservative subgroup were significantly older, and had a higher prevalence of comorbidities. The mean dimension of the BCCs was significantly lower in the CTr subgroup. The mean dimension of BCC varied between subgroups in patients with the histopathological nodular subtype, skin type II, and skin type III. Patients with tumor sizes below 10mm preferred the CTr to the surgical treatment, but those with BCCs between 10-30 mm preferred surgery instead (Tables 1 and 2). Outcome Data and Main Results Of the 113 patients who underwent the full CTr regimen, 112 had remission after CTr (clearance rate: 99.11%); 102 patients were followed up, and 101 patients did not show BCC recurrence during the follow-up (recurrence rate: 0.98%). The mean duration of the CTr was 3.81 ± 1.48 months. The average duration of follow-up of patients in the conservative subgroup was 21.11 ± 14.57 months (CI: 18.25, 23.97); 8.93% were lost to follow-up, 22 (19.64%) were followed up for less than 12 months, 40 (35.71%) were followed up between 12 and 24 months, and 40 (35.71%) were followed up for more than 24 months (Figure 3). An 82-year-old female patient with a 25 mm superficial BCC localized on her rior thorax did not show clearance to CTr, and was switched to radiotherapy. A 58 old female patient with a 50 mm superficial pigmented BCC at diagnosis showed c and histopathological recurrence 48 months after CTr completion. The recurrent BC removed using a surgical punch excision. All patients from the surgical group underwent successful surgery; 46 patients followed up, and we did not encounter any recurrences in the surgical group duri follow-up. The average duration of the follow-up of surgically treated patients was An 82-year-old female patient with a 25 mm superficial BCC localized on her posterior thorax did not show clearance to CTr, and was switched to radiotherapy. A 58-year-old female patient with a 50 mm superficial pigmented BCC at diagnosis showed clinical and histopathological recurrence 48 months after CTr completion. The recurrent BCC was removed using a surgical punch excision. All patients from the surgical group underwent successful surgery; 46 patients were followed up, and we did not encounter any recurrences in the surgical group during the follow-up. The average duration of the follow-up of surgically treated patients was 18 ± 9.77 months (CI: 15.09, 20.09); 8% were lost to follow-up, 6% were followed up for less than 12 months, 64% were followed up between 12 and 24 months, and 22% were followed up for more than 24 months. TFU did not reveal new BCC recurrences in the two subgroups. We did not find statistical dependencies either between clearance rate and treatment (p = 1), or between recurrence rate and treatment (p = 1). Therefore, we did not find radical surgical excision to be superior to this conservative treatment in terms of clearance or recurrence rates. Furthermore, histopathological subtypes did not correlate with clearance or recurrence rates. Adverse Events (AE) A majority of 70.8% of patients from the CTr subgroup did not present any AE during treatment. Only 14.16% had mild and 15% had moderate local AE (pain and pruritus, especially after laser/cryosurgery and/or imiquimod). 5-FU chemowraps were well tolerated. No severe local or systemic AE were encountered in the CTr subgroup. In total, two patients had a secondary impetiginization that responded promptly to a topical antibiotic powder containing zinc bacitracin 250 UI and neomycin sulfate 5000 UI, which was administered for 5 days. One patient presented a bulla after cryosurgery that was punctured with a sterile needle. None of these three patients abandoned the CTr. Within the surgical subgroup, 76% of patients did not present AE, 14% had mild, and 10% presented moderate local AE (after surgery or stitches removal). We did not encounter any wound dehiscence or wound impetiginization. In both subgroups, all of the reported AE were expected, and in a definite causal relationship with the treatment. It is worth mentioning that we did not find any statistical difference between the two subgroups regarding the AE. There was no statistically significant difference in the distribution of AE according to gender for the two subgroups. Furthermore, we have analyzed AE according to age and tumor size, and proved that there was no statistically significant difference between the conservative and the surgical subgroup for either of these subgroups (Figure 4). Cosmetic Outcome Within the Ctr subgroup, 89.32% of the patients declared themselves very satisfied, and 10.68% were satisfied. Additionally, 50% of the patients from the surgical subgroup were very satisfied, 34.78% moderately, and 15.22% slightly satisfied. Therefore, the selfassessment cosmetic outcome revealed a superior (p < 0.001) cosmetic outcome in the Ctr subgroup. We consider the healing process was superior in the CTr group, as we did not encounter any hypertrophic/keloid scarring after cryosurgery or ablative laser. Overall, the pigmentation changes and visible scarring were significantly more prominent after standard surgery. difference between the conservative and the surgical subgroup for either of these subgroups (Figure 4). blue) Cosmetic Outcome Within the Ctr subgroup, 89.32% of the patients declared themselves very satisfied, and 10.68% were satisfied. Additionally, 50% of the patients from the surgical subgroup were very satisfied, 34.78% moderately, and 15.22% slightly satisfied. Therefore, the selfassessment cosmetic outcome revealed a superior (p < 0.001) cosmetic outcome in the Ctr subgroup. We consider the healing process was superior in the CTr group, as we did not encounter any hypertrophic/keloid scarring after cryosurgery or ablative laser. Overall, the pigmentation changes and visible scarring were significantly more prominent after standard surgery. Discussion This work showed that elderly and frail patients with primary, non-ulcerated BCCs are more suitable for CTr over radical surgery. Adverse events, such as pain and pruritus, did not show a statistical significance between the two subgroups. The clearance rate and the recurrence rate were independent of the two treatments. A significantly better cosmetic outcome was displayed in the CTr subgroup, as compared to post-surgical scars; however, we are aware that patients with larger tumors are more often put forward for surgery. Both methods have advantages and disadvantages ( Figure 5), as has been revealed to the authors during the monitoring of patients. Discussion This work showed that elderly and frail patients with primary, non-ulcerated BCCs are more suitable for CTr over radical surgery. Adverse events, such as pain and pruritus, did not show a statistical significance between the two subgroups. The clearance rate and the recurrence rate were independent of the two treatments. A significantly better cosmetic outcome was displayed in the CTr subgroup, as compared to post-surgical scars; however, we are aware that patients with larger tumors are more often put forward for surgery. Both methods have advantages and disadvantages ( Figure 5), as has been revealed to the authors during the monitoring of patients. One of the strengths of our study is the large number of patients included in the CTr group. Another powerful feature is the inclusion of the so-called 'high-risk' histological subtypes, while the literature usually recommends non-surgical therapies for 'low-risk' BCC subtypes. Of note, in this study, a superficial BCC did not respond to CTr, and a superficial pigmented BCC recurred after CTr (both considered 'low-risk'). The long follow-up period, completed with TFU, represents another strength of this study. This multi-step conservative approach is based on the principle of synergistic potentiation; hence, we find it difficult to compare the singular applied steps to any other study, One of the strengths of our study is the large number of patients included in the CTr group. Another powerful feature is the inclusion of the so-called 'high-risk' histological subtypes, while the literature usually recommends non-surgical therapies for 'low-risk' BCC subtypes. Of note, in this study, a superficial BCC did not respond to CTr, and a superficial pigmented BCC recurred after CTr (both considered 'low-risk'). The long follow-up period, completed with TFU, represents another strength of this study. This multi-step conservative approach is based on the principle of synergistic potentiation; hence, we find it difficult to compare the singular applied steps to any other study, because studies comprising this kind of combination setting are lacking. Cryosurgery and topical therapies, such as imiquimod and 5 FU, can be used when alternatives to surgery are required. Geisse et al. proved that the proportion of patients who showed remission after a 12-weeks twice daily 5% imiquimod monotherapy was 100%, higher than one daily group (87.1%), 5 times a week group (80.8%), and 3 times a week group (51.7%). In a study by Gross et al., BCCs treated with 5FU twice daily for 12 weeks showed a 90% cure rate. Therefore, our clearance rate is comparable to the 12-week 5% twice daily imiquimod monotherapy treatment, but superior to the 12-week 5% twice daily 5FU monotherapy treatment. We assume that we managed to overcome the low 5-FU local penetration by applying it post-procedurally, in the form of a chemowrap. Both laser and cryosurgery may increase 5-FU local absorption. Of note, our CTr duration is comparable to the usual 12 weeks of local therapies with imiquimod or 5FU in monotherapy. Hextall et al. found that more BCC patients treated with topical imiquimod (monotherapy) develop AE, as compared to the surgical group ; however, in our study, there was no significant difference between the reported local AE from the conservative group and the surgical group, suggesting that this combined method might be a good alternative to surgery, including in patients who feel pain-related anxiety or surgical anxiety. With cure rates exceeding 90%, cryosurgery is considered the most effective for lowrisk BCCs involving the trunk and limbs. Given the long freeze time of at least 30 s, a satisfying success rate using cryosurgery alone may be accompanied by significant unwanted side effects, such as hemorrhagic blistering, edema, hypopigmentation, and scarring. Using a 10-s freeze cycle with this combination of topicals, we did not encounter severe AE, such as edema, scarring, or hypopigmentation. Furthermore, none of our patients abandoned the CTr due to adverse events. A high recurrence rate may limit conservative treatments in BCC. For example, Gollnick et al. studied the recurrence rate of superficial BCC in 182 patients, following treatment with imiquimod 5% cream, once daily, 5 per week for 6 weeks, and 89.6% had no clinical evidence of the tumor at the 12-week post-treatment assessment. In the first 12 months of follow-up, 10 clinical recurrences were noted, and the statistical data predicted a long-term outcome. Vidal et al. found that 76% of patients diagnosed with superficial, nodular, and infiltrative BCCs, treated with 24 doses of 5% imiquimod cream, showed no clinical sign of tumor at the 6-week post-treatment evaluation. There were no late relapses, and the 5-year recurrence was only 2%. In a cryoimmunotherapy study, MacFarlane and Kader El Tal studied the efficiency of cryosurgery followed by 5% imiquimod, and obtained a 2% recurrence rate. The authors assumed that cryosurgery may damage the stratum corneum, thereby facilitating imiquimod penetration into the deep skin layers. This point of view may be in line with our technique, since we have used in our method both cryosurgery and ablative CO2 laser before 5FU and imiquimod applications. Soong and Keeling found a 73% clinical cure rate at a 6-month follow-up appointment for the combination of cryosurgery and a 3-week course of 5% 5-fluorouracil in superficial BCC, which is inferior to our 3-months clearance rate. A 2021 study revealed an overall 3-month response of 84.2% with an Er:YAG ablative fractional laser (AFL)-primed MAL-PDT (Er:YAG AFL-PDT) treatment for nodular BCC, which is inferior to our results. The same study obtained higher recurrence rates (6.3%) at a shorter follow-up period (12 months). Genouw et al. found an exceptional efficacy (100%) and good to excellent aesthetic results when combining CO 2 continuous laser with PDT for superficial BCCs in a small size pilot study with a 12-month follow-up. Curettage followed by daily treatment for 6 to 10 weeks with imiquimod 5% shows optimistic results at a 3-month follow-up ; this setting may be of high interest when lasers are not available. Although occlusive imiquimod was not shown to be superior to non-occlusive imiquimod in superficial and nodular BCCs ; considering our clinical experience, we preferred the occlusion in this setting. However, occlusive imiquimod can be irritating, and patients should be appropriately advised. Adherence to imiquimod and antibiotic powder local regimens could not be monitored by the authors, and could be a limitation of this study. Although the gold standard diagnosis of BCCs is the pathology report, dermoscopy was solely used to evaluate BCC clearance and recurrences. This non-invasive method of diagnosis eliminated the local adverse events of an alternate biopsy, such as inflammation and scarring. Moreover, a biopsy scar could have seriously affected the cosmetic outcome, in both subgroups. We do not consider that this decision is a source of study limitation, since a prospective study of 3500 BCCs showed that dermoscopy has a very high sensitivity (93.3%) and specificity (91.8%) for detecting all types of BCCs. However, histological follow-up may be warranted in future studies regarding this method. As it does not represent a standard practice, tumoral depths were not recorded. At a first glance, few settings are changed when compared to the established treatments, but we end up with promising results. In summary, we conducted a prospective, comparative study that encompasses a novel conservative BCC treatment, and compares it to the standard surgical excision, in terms of clearance, recurrence rates, local adverse events, and cosmetic outcomes. This conservative approach may be more easily tolerated than cryosurgery or imiquimod alone, and has comparable efficacy to surgery. Our work addresses a relevant subject i.e., conservative treatment of BCCs when surgery might not be the best option or is rejected for different reasons. To our knowledge, this is the first conservative treatment to comprise combined CO 2 laser, cryosurgery, and topical agents for the treatment of primary, nonulcerated BCCs. We aim to design a series of prospective, randomized studies in which different combinations of this approach will be assigned to different treatment groups. Furthermore, we intend to develop similar comparative settings for easy-to-treat and stages IIA and IIB difficult-to-treat (DTT) BCCs, classified according to the novel operational staging system. Informed Consent Statement: Informed consent was obtained from all subjects involved in the study. Written informed consent has been obtained from the patients to publish this paper. |
Total serum IgE and parasite-specific IgG and IgA antibodies in human strongyloidiasis. Total serum IgE, and Strongyloides-specific IgG and IgA antibodies were studied in 27 patients with parasitologically proven strongyloidiasis. Clinical manifestations in this case series were investigated by a retrospective study of the patient's records. Total serum IgE levels were elevated (greater than 250 IU/ml) in 59% of the patients (mean concentration = 1364 IU/ml). Parasite-specific IgG and IgA antibodies were detected by ELISA in the serum of 23 (85.2%) and 21 (77.8%) patients, respectively. Elevated serum IgE and clinical manifestations were not useful indexes of the presence of strongyloidiasis. On the other hand, our results support the view that serologic tests, particularly ELISA for detecting Strongyloides-specific IgG antibodies, can be usefully exploited for diagnostic purposes in strongyloidiasis. |
Regulation of the Yeast Transcriptional Factor PHO2 Activity by Phosphorylation* The induction of yeast Saccharomyces cerevisiae gene PHO5 expression is mediated by transcriptional factors PHO2 and PHO4. PHO4 protein has been reported to be phosphorylated and inactivated by a cyclin-CDK (cyclin-dependent kinase) complex, PHO80-PHO85. We report here that PHO2 can also be phosphorylated. A Ser-230 to Ala mutation in the consensus sequence (SPIK) recognized by cdc2/CDC28-related kinase in PHO2 protein led to complete loss of its ability to activate the transcription of PHO5 gene. Further investigation showed that the Pro-231 to Ser mutation inactivated PHO2 protein as well, whereas the Ser-230 to Asp mutation did not affect PHO2 activity. Since the PHO2 Asp-230 mutant mimics Ser-230-phosphorylated PHO2, we postulate that only phosphorylated PHO2 protein could activate the transcription of PHO5 gene. Two hybrid assays showed that yeast CDC28 could interact with PHO2. CDC28 immunoprecipitate derived from the YPH499 strain grown under low phosphate conditions phosphorylated GST-PHO2 in vitro. A phosphate switch regulates the transcriptional activation activity of PHO2, and mutations of the (SPIK) site affect the transcriptional activation activity of PHO2 and the interaction between PHO2 and PHO4. BIAcore® analysis indicated that the negative charge in residue 230 of PHO2 was sufficient to help PHO2 interact with PHO4 in vitro. activates the transcriptional factor PHO4. When the concentration of phosphate in the medium is sufficiently low, PHO81 protein, which is a cyclin-dependent kinase inhibitor, inhibits the kinase activity of the PHO80⅐PHO85 complex, thus allowing the hypophosphorylated PHO4 protein, together with PHO2 protein, to activate the transcription of PHO5 gene. PHO2 has four conspicuous regions (see Fig. 1). The first one is a glutamine-rich region (amino acids 23-52), the deletion of which was showed to have no effect on PHO2 function. The other three regions include the homeodomain (amino acids 77-136), the acidic region (amino acids 294 -329), and the region (amino acids 241-258) with homology to PHO80 protein. Homeo boxes were found in many genes of higher eukaryotes involved in development (e.g. Drosophila, mouse and human). The PHO2 homeodomain is directly involved in DNA recognition. The acidic region of PHO2 contains continuous stretches of aspartic acid and asparagine. The PHO80 homologous region may be an association domain of PHO2 with PHO4, the deletion of which inactivated the PHO2 protein. The deletions at the C-terminal end of PHO2 protein may go up to residue 408 without strongly affecting the derepression of PHO5. The results of the two-hybrid assay argued that DNA binding by PHO4 is dependent on the phosphate-sensitive interaction with PHO2. It was also suggested that interaction with PHO2 increases the accessibility of the activation domain of PHO4. Recently, immunoprecipitation experiments and protein binding assays showed that PHO2 and PHO4 form a complex with a DNA fragment and interacted with each other directly in vivo. Protein phosphorylation has been found to play an important role in the control of diverse cellular processes, especially that of transcriptional factors in the regulation of gene expression. PHO80-PHO85 cyclin-CDK (CDK, cyclin-dependent kinase) complex can regulate the expression of PHO5 gene by phosphorylating PHO4. Cyclic AMP-dependent protein kinase (protein kinase A) has also been observed to exert its function in the synthesis of repressible acid phosphatase. As well, cdc2/CDC28 type kinase can affect gene expression by phosphorylation. The consensus motif of sites phosphorylated by cdc2/CDC28-type kinase is (Ser/Thr)-Pro-X-(Lys/Arg). This sequence is found more frequently in nuclear proteins involved in transcriptional regulation than in proteins generally. Many of these proteins also contain DNA binding motif such as zinc fingers or helix-turn-helix structures. In this report we describe the identification of a potential phosphorylation site near the PHO80 homologous region of PHO2 protein. The mutation of the site can affect the function of PHO2 protein. Moreover, the introduction of a negative charge to this residue seems to be necessary for PHO2 functions. We also demonstrate that PHO2 can be phosphorylated by CDC28 kinase in vitro. Yeast culture were grown at 30°C in either YPD (1% yeast extract, 2% glucose, 2% peptone) or synthetic medium (0.67% yeast nitrogen base, 2% glucose) supplemented with the appropriate amino acids as required. All yeast transformations were done using the high efficiency lithium acetate method of Gietz and Schiestl. For the experiments involving high or low phosphate, Burkholder medium was used, but the content of KH 2 PO 4 was changed as described previously. Polymerase chain reaction was used with yeast genomic DNA to amplify a 0.9-kb fragment including the entire coding region of CDC28 gene. The 5 oligonucleotide primer was ATCC GGAT CCTG ATGA GCGG TGAA TTAG CA, and the 3 oligonucleotide primer was GGAG CTGC AGTT ATGA TTCT TGGA AGTA GG. Polymerase chain reaction was also used with yeast genomic DNA to tag the CDC28 protein by adding a C-terminal extension of GAYPYDVPDYASLG, which includes a hemagglutinin antigen (HA) epitope. The same 5 oligonucleotide primer was used in conjunction with the 3 oligonucleotide primer: AGTC TGCA GTCA TCCC AAGC TAGC GTAG TCAG GAAC GTCA TATG GATA GGCG CCTG ATTC TTGG AAGT AGGG GTGG. Amplified fragments were digested with BamHI and PstI, which cleaved within the primers and, respectively, cloned into the BamHI/PstI sites of pGBT9 and the yeast expression vector pVTU102 to create plasmids pGBT9-CDC28 and pVTU102-CDC28HA. The absence of polymerase chain reaction-introduced mutations was verified by DNA sequencing. To construct plasmid pBL-PHO4, a 1.0-kb NcoI/HindIII fragment was prepared from PHO4 gene and inserted into the NcoI/HindIII sites of plasmid pBL. This plasmid produces the entire PHO4 protein (312 amino acids). Site-directed Mutagenesis of the PHO2 Gene-Five synthetic oligonucleotides were used for site-directed mutagenesis with a U-DNA mutagenesis kit (Roche Molecular Biochemicals): 5-ATCAGATCTGC-TATTTTCTTT-3; 5-GAGAAACCTAGCGCCAATAAA-3; 5-GTTGAG-AAACCTAGACCCAATAAAGAT-3; 5-AAACCTATCGTCAATAAAGA-T-3; 5-ATCGCCAATACAGATTAATAAC-3. A 1.0-kb PvuI/HindII fragment of the PHO2 gene was cloned into the M13mp18 vector to produce single-stranded DNA. The mutagenesis procedures were then conducted according to the kit protocols. The mutants were isolated and sequenced to ensure that the intended base changes were present. The fragment from the replication form of M13mp18, containing the designed mutation, was then cloned back to pRS2. Activity Assay of Acid Phosphatase-The strains to be tested were grown in 3 ml of synthetic medium lacking Leu overnight. The cells were harvested, washed twice, and used to inoculate into 3 ml of Burkholder high or low phosphate medium to an A 600 of 0.05. Incubation was carried out at 30°C for 16 h with shaking. The cells were harvested, washed with 0.05 M acetate buffer (pH 4.0), and resuspended in 1 ml of 0.05 M acetate buffer. Acid phosphatase activity was assayed according to the method described previously. Preparation of Cell Extracts-Cell cultures were first grown to saturation in synthetic medium lacking uracil at 30°C. The cells were harvested by centrifugation, washed twice with sterilized water, and then incubated into the Burkholder low phosphate medium at an A 600 of 0.05. These cultures were grown at 30°C with shaking for 8 to 16 h to a final A 600 of 0.5-1.5 before analysis. 50 ml of these cultures were washed with 10 ml of sterilized water. All subsequent steps were carried out at 4°C. Cells were resuspended in 450 l of HSB buffer (45 mM HEPES-KOH (pH 7.5), 400 mM NaCl, 10% glycerol, 1 mM EDTA, 0.5% Nonidet P-40, 2 mM dithiothreitol, 2 mM benzamidine, 1 mM phenylmethylsulfonyl fluoride, 2 g/ml pepstatin A, 2 g/ml leupeptin, 4 g/ml antipain, 10 mM NaF, 80 mM glycerol phosphate), and 0.8 mg of acid-washed glass beads (425-600 m, Sigma) were added. Cells were lysed on a Vortex (Vortex-Genie2) for 30 s at the maximum setting, followed by cooling in an ice bath for 30 s. This procedure was repeated 10 times. Lysates were clarified by centrifugation at 4°C for 15 min at 14,000 rpm twice. Expression in Escherichia coli and Purification of GST-PHO2 Fusion Protein and PHO4 Protein-Purification of recombinant GST-PHO2 protein and its mutants was performed essentially as described. BL21(DE3)-plysS E. coli cells harboring the appropriate expression vector were grown in 50 ml of LB containing ampicillin (50 g/ml) overnight at 37°C. This culture was diluted into 500 ml of LB containing ampicillin (50 g/ml) and grown at 30°C until the A 600 was approximately 0.5. Isopropyl--D-thiogalactopyranoside (Roche Molecular Biochemicals) was added to a final concentration of 1 mM, and the incubation was continued for 3 h at 30°C. The following procedures were performed at 4°C with ice-cold buffers. After the cells were centrifuged, the cell pellet was washed with 20 ml of phosphate-buffered saline (PBS) (150 mM NaCl, 16 mM Na 2 HPO 4, 4 mM NaH 2 PO 4, 10% glycerol (pH 7.3)). Cells were resuspended in 10 ml of PBS 1% Triton X-100. Cell suspension was frozen in liquid nitrogen for 15 min and then frozen in 70°C for 1 h. Frozen cells were thawed as quickly as possible at room temperature. Cell lysate was clarified by centrifugation at 14,000 rpm for 15 min 3 times. Then the cell lysate was loaded on a 1-ml Glutathione-Sepharose 4B (Amersham Pharmacia Biotech) column equilibrated in PBS 1% Triton X-100. After loading, the column was washed with 2 5 ml of PBS 1% Triton X-100, then with 3 5 ml of PBS. The bound fusion protein was eluted with 5 ml of elution buffer (10 mM glutathione in 50 mM Tris⅐HCl (pH 8.0), and 0.5-ml fractions were collected and analyzed by SDS-polyacrylamide gel electrophoresis. BL21(DE3)-plysS cells harboring the PHO4 expression vector pBL-PHO4 were grown in 4 ml of LB containing ampicillin (50 g/ml) overnight at 30°C. The culture was diluted into 400 ml of LB containing ampicillin (50 g/ml) and grown to A 600 of 0.5 at 30°C, then induced for 3 h at 42°C. The following procedures were performed as described. In Vitro Phospho-labeling Assays-For kinase reaction, 1 l of YPH499 cell extract was added to a 19 l of kinase mixture to form a reaction mixture (20 mM Tris⅐HCl (pH 7.5), 10 mM MgCl 2, 4 g GST-PHO2 (wild type or Pro-231 to Ser mutant), 50 M ATP, 10 Ci of ATP (Amersham Pharmacia Biotech)). The reaction mixtures were incubated at 30°C for 20 min. The reaction was stopped by the addition of 20 l 2 SDS sample buffer and heating to 95°C for 5 min. Denatured samples were electrophoresed on SDS, 10% polyacrylamide gel, vacuum dried, and autoradiographed. Galactosidase Filter Assays-The yeast two-hybrid system was detailed in MatchMaker two-hybrid system protocol (CLONTECH (PT1265-1)). pGBT9-CDC28 and pGAD424-PHO2 as well as combinations of vectors and the two-hybrid constructions were cotransformed into SFY526. Transformants were grown on synthetic medium agar plates lacking Trp and Leu at 30°C for 2-4 days. Some clones were spotted onto nitrocellulose filters placed on synthetic medium (-Trp, -Leu) agar plate. The plate was then placed at 30°C for 2 days. The filter was subsequently removed, snap-frozen on an aluminum foil case in a liquid nitrogen bath, and placed on Whatman 3MM paper saturated with Z buffer containing 0.33 mg/ml X-gal (5-bromo-4-chloro-3-indolyl -D-galactopyranoside). The filter was incubated at 30°C for the appearance of blue clones. Immunoprecipitation and Protein Kinase Assay-Yeast cell extracts (in any given experiment all samples were normalized to contain the same amount of total protein ) were immunoprecipitated with anti-HA monoclonal antibody 12CA5 (Roche Molecular Biochemicals) (2 g in each reaction) for 1 h on ice. After centrifugation at 12,000 rpm for 2 min, the supernatant was added to 30 l of slurry of protein A-agarose (Roche Molecular Biochemicals) equilibrated in HSB buffer followed by a 2-h rotation at 4°C. Immunoprecipitates were washed with HSB buffer three times. Histone H1 kinase assays were performed as described previously. For phosphorylation of GST-PHO2, immunoprecipitates were washed twice with kinase assay buffer (20 mM Tris⅐HCl (pH 7.5), 10 mM MgCl 2 ) and resuspended in 20 l of kinase assay mixture (20 mM Tris⅐HCl (pH 7.5), 10 mM MgCl 2, 4 g of GST-PHO2, 50 M ATP, 10 Ci of ATP (Amersham Pharmacia Biotech)). These kinase reaction mixtures were incubated at 30°C for 20 min. Reactions were stopped by addition of 20 l of 2 SDS sample buffer and heating to 95°C for 5 min. Denatured samples were electrophoresed on SDS, 10% polyacrylamide gel, vacuum-dried, and autoradiographed. Liquid Culture -Galactosidase Assay-Cell cultures were first grown to saturation in selective synthetic medium at 30°C. The cells were harvested and washed twice with sterilized water and then incubated into 3 ml of Burkholder low (or high) phosphate medium at an A 600 of 0.2. Cultures were grown at 30°C with shaking to a final A 600 of 1.5. The cells were harvested and washed twice with Z buffer. Cells were resuspended in 0.6 ml of Z buffer. 100 l of cell suspension was removed to a fresh microcentrifuge tube. Assays for -galactosidase activity were then performed as described in the protocol described in the MATCHMAKER two-hybrid system (PT1265-1) (CLONTECH). Mutations in the Consensus Sequence (SPIK) Recognized by cdc2/CDC28-type Kinase in PHO2 Led to Complete Loss of Its Activity-A survey of potential recognition sites in PHO2 protein for cdc2/CDC28-type kinase or cyclic AMP-dependent protein kinase (protein kinase A) revealed a SPIK (230 -233) site near the PHO80 homologous region and a RKKIS site in the second helix of the PHO2 homeodomain (Fig. 1). The amino acid sequence surrounding serine residue 230 resembles the consensus sequence of sites phosphorylated by cdc2/CDC28 protein kinase (20 -23). The consensus sequence R/KR/KXS is the optimal protein kinase A recognition site. The serines in the two consensus sequences were considered to be theoretical phospho-acceptors. We assumed that protein kinase A phosphorylated Ser-111 and cdc2/CDC28-type kinase phosphorylated Ser-230, thereby affecting PHO2 function. To verify our hypothesis, we mutated Ser-111 and Ser-230 to Ala and trans-formed the plasmids pRS2 (YCp containing a wild type PHO2 gene), pRS2 (Ser-111 3 Ala), and pRS2 (Ser-230 3 Ala) into PHO2-disrupted strain YJ1, then determined the acid phosphatase activity of the cell suspensions as described under "Experimental Procedures." As can be seen in Table I, the substitution of Ala for Ser-111 had no significant effect on the acid phosphatase activity under high or low phosphate conditions, whereas the mutation of PHO2 Ser-230 to Ala resulted in the loss of its ability to activate PHO5 expression. The results suggested that Ser-230 might be a critical residue for PHO2 to activate PHO5 expression. Since Ser-230 is located in the consensus sequence SPIK, which may be recognized and phosphorylated by cdc2/CDC28 type kinase in vivo, its phosphorylation may be necessary for PHO2 function. This possibility is supported by the finding that another PHO2 mutant (Pro-231 3 Ser), in which the consensus sequence has been changed, also showed no ability to confer repressible acid phosphatase activity. Interestingly, the PHO2 variant containing an acidic residue in place of Ser-230 (Ser-230 3 Asp) could activate PHO5 expression under low phosphate conditions. It seems feasible that the hydroxyl group may serve as a phospho-acceptor in vivo, and the introduction of a negative charge at residue 230 may be necessary for PHO2 function. Intriguingly, the alteration of Lys-233 to Ala showed no effect on PHO2 function to activate PHO5 expression. In Vitro Phosphorylation of GST-PHO2 Fusion Protein by YPH499 Cell Extract-To ascertain whether Ser-230 can be phosphorylated, the E. coli-expressed GST-PHO2 and GST-PHO2 (Pro-231 3 Ser) were subjected to in vitro phospholabeling experiments. The labeled proteins were separated by SDS-polyacrylamide gel electrophoresis and visualized by autoradiography. When the cell extract from a wild type YPH499 strain grown under low phosphate conditions was used as the enzyme with the GST-PHO2 fusion protein as the substrate, an approximate 90-kDa protein was observed to be phosphorylated (Fig. 2B, lane 2), but no phosphorylated band was found at the corresponding position when GST-PHO2 (Pro-231 3 Ser) was used as the substrate under identical labeling conditions (Fig. 2B, lane 3) nor when fusion protein was absent (Fig. 2B, lane 1). These results inicated that the PHO2 portion (wild type but not PHO2 (Pro-231 3 Ser)) of the fusion protein is the target of the protein kinase in cell extract from YPH499 strain grown under low phosphate conditions, and the Pro-231 to Ser mutation diminished or prevented the phosphorylation of PHO2 protein. Furthermore, we also found that GST-PHO2 could be phosphorylated by cell extract from YPH499 cells grown under high phosphate conditions (data not shown). These data allowed us to suggest that PHO2 protein can be phosphorylated in vitro by a protein kinase(s) from YPH499 cells, and the Ser-230 may be the major phosphorylation site. Protein Kinase CDC28 Can Interact with PHO2 in the Twohybrid System-Because the potential phosphorylation site of PHO2 resembles the consensus motif of sites phosphorylated by cdc2/CDC28-type protein kinase, yeast CDC28 protein was fused to the GAL4 binding domain (BD) (pGBT9-CDC28) and tested directly for interaction with GAL4 activation domain (AD)-PHO2 (expressed by pGAD424-PHO2) in the two-hybrid assay. Interaction of the two proteins was determined for their ability to activate transcription of a GAL1::lacZ reporter gene in SFY526 by -galactosidase filter assays (Fig. 3). Clones containing pGBT9-CDC28 and pGAD424 or pGBT9 and pGAD424-PHO2 were white, whereas clones containing pGBT9-CDC28 and pGAD424-PHO2 displayed a distinct blue color (Fig. 3). These results showed that CDC28 protein and PHO2 protein can interact with each other in the two-hybrid system. Immunoprecipitate of CDC28HA from Low Phosphate Cell Extract Can Phosphorylate GST-PHO2-The interaction between CDC28 and PHO2 in the two-hybrid system suggested that CDC28 may be the protein kinase of the transcriptional factor PHO2. We fused an HA tag to the C terminus of CDC28 by polymerase chain reaction for the facility of immunoprecipitation. To ascertain whether CDC28 can phosphorylate PHO2 in vitro, we used anti-HA to immunoprecipitate CDC28 from the strain YPH499 bearing CDC28HA on a multicopy expression plasmid (pVTU102-CDC28HA) grown under low phosphate conditions. The immunoprecipitated CDC28HA could phosphorylate GST-PHO2 (Fig. 4A, lane 1), whereas the immunoprecipitate from control strain YPH499 containing vector pVTU102 had very low kinase activity (Fig. 4A, lane 2). The immunoprecipitate derived from cell extract containing CDC28HA phosphorylated histone H1 (Fig. 4B, lane 1), whereas the control had only background kinase activity (Fig. 4B, lane 2). These results showed that PHO2 could be phosphorylated in vitro by CDC28 kinase complex from YPH499 (pVTU102-CDC28HA) grown under low phosphate conditions. Phosphate Switch Regulates the Transcriptional Activation Activity of PHO2 and Mutations of the (SPIK) Site Affect the Transcriptional Activation Activity of PHO2 and the Interaction between PHO2 and PHO4 -PHO2 was fused to the DNA BD of yeast transcriptional factor GAL4. The plasmid expressing GAL4 BD-PHO2 chimera, pGBT9-PHO2, was transformed into a yeast strain, SFY526, containing an integrated GAL1::lacZ reporter gene. By measuring the expression of the reporter gene (lacZ) under high and low phosphate conditions (Table II), it was found that the chimera alone could activate the expression of lacZ, and the -galactosidase activity was regulated by the phosphate switch. The activity under low phosphate condition was 8-fold more than that under high phosphate conditions. In contrast, when pVA3 (containing the fusion of murine p53 and GAL4 DNA binding domain) and pTD1 (containing a fusion of SV40 large T-antigen and GAL4 activation domain) were cotransformed into SFY526, the expression of lacZ was also activated, but the -galactosidase activity was not affected by the phosphate switch. These results demonstrated that the transcriptional activation activity of PHO2 was regulated by the phosphate switch, which was repressed under high phosphate condition and was derepressed under low phosphate conditions. The SPIK (230 -233) site near PHO80 homologous region is a potential phosphorylation site of PHO2, and the phosphorylation of Ser-230 is necessary to activate PHO5 transcription. The mutation of Ser-230 to Ala resulted in the loss of ability to be phosphorylated, so GAL4BD-PHO2 (Ser-230 3 Ala) chimera could not activate the expression of lacZ irrespective of phosphate concentration (Table II). The substitution of Asp for Ser-230, which mimics the phosphorylation state by providing a negative charge at residue 230, had no significant effect on the activation activity of PHO2. These results showed that the 3. Interaction between CDC28 and PHO2 in yeast twohybrid system. pGBT9 contains a GAL4 DNA binding domain. pGAD424 contains a GAL4 activation domain. pGBT9-CDC28 contains the fusion of CDC28 and GAL4 DNA binding domain. pGAD424-PHO2 expresses GAL4AD-PHO2 chimera. pVA3, murine p53 in pGBT9. pTD1 contains the fusion of SV40 large T-antigen and GAL4 activation domain. The cotransformant of pTD1 and pVA3 was a positive control. -Galactosidase activity of SFY526 transformants was assayed as described under "Experimental Procedures." Each was repeated twice as shown. phosphorylation of PHO2 Ser-230 is necessary for the activation activity of PHO2. The phosphorylation site-containing negative charge may resemble an acidic activation domain. However, the activity of GAL4BD-PHO2 (S230D) chimera was also regulated by the phosphate switch. The activity under low phosphate condition was 5-fold more than that under high phosphate condition. The expression of lacZ could also be activated by GAL4BD-PHO2 chimera in another strain, SFY526 (pho4::HIS3). The activity under low phosphate conditions was 3-fold more than that under high phosphate condition (Table III), although it was less than that in SFY526. When pGBT9-PHO2 was cotransformed with pRS4 (YCp containing a PHO4 gene), it had no significant effect on the -galactosidase activity under high phosphate condition, but the activity under low phosphate conditions was 1-fold more than that using the GAL4BD-PHO2 chimera alone (Table III). The results demonstrated that these two proteins may interact with each other. When pGBT9-PHO4 (for expression of GAL4BD-PHO4 chimera) was cotransformed into SFY526 (pho4::HIS3) with pGAD424-PHO2 (for expression of GAL4 AD-PHO2 chimera), the -galactosidase activity was 40% more than that using pGBT9-PHO4 and pGAD424. The result also indicated that PHO4 and PHO2 may interact in vivo. Another result showed that the phosphorylation of PHO2 is necessary for the interaction between PHO2 and PHO4. When GAL4BD-PHO2 (S230A) was coexpressed with GAL4AD-PHO4 chimera in SFY526 (pho4::HIS3), the galactosidase activity could not be detected irrespective of the phosphate switch (Table III). The result indicated that the phosphorylation site may be essential not only for the transcriptional activation activity but also for the interaction between PHO2 and PHO4, which may play a key role in maintaining the transcriptional activity of PHO2. BIAcore® Analysis of the Interaction between PHO2 and PHO4 in Vitro-The data above showed that the phosphorylation of PHO2 Ser-230 is necessary for the interaction between PHO2 and PHO4. To investigate whether the phosphorylation of Ser-230 is sufficient to mediate interaction between PHO2 and PHO4, we used purified GST-PHO2, GST-PHO2SA (Ser230 3 Ala), GST-PHO2SD (Ser-230 3 Asp), and PHO4 for BIAcore® analysis. PHO4 was covalently linked to a sensor chip (CM5). GST-PHO2, GST-PHO2SA, and GST-PHO2SD, at the same concentration of 5 M, were injected over the surface. As shown by the sensorgrams obtained (Fig. 5), a strong signal was detected when GST-PHO2SD was injected (Fig. 5B), whereas signals were very weak when GST-PHO2 (Fig. 5A) or GST-PHO2SA (Fig. 5C) was used. The sensorgram of GST-PHO2SD showed a very typical interaction. The effect of impurities and the fused GST was eliminated for the results of GST-PHO2 and GST-PHO2SA. The results indicated the negative charge of PHO2 (Ser-230 3 Asp), which mimics the phosphorylation of Ser-230, may help the interaction between PHO4 and GST-PHO2SD. DISCUSSION The functions of many transcriptional factors are regulated by phosphorylation and dephosphorylation, which may act in several aspects. First, phosphorylation can change the cellular location of some transcriptional factors. An S. cerevisiae transcriptional factor, SWI5, which is localized in the cytoplasm at the G 2 phase of cell cycle due to its phosphorylation by the cyclin-CDC28 protein kinase, enters the nucleus at Start in the G 1 phase and activates HO gene expression. Similarly, PHO4 is localized in the cytoplasm under high phosphate conditions due to hyperphosphorylation by the PHO80-PHO85 cyclin-CDK (CDK, cyclin-dependent kinase). Second, some transcriptional activation factors, such as GAL4 and GCN4, which have acidic transcriptional activation domains, may have a higher transcriptional activation activity upon point mutations to increase negative charges. It is conjectured that phosphorylation and dephosphorylation may regulate the transcriptional activation activity by the increase or decrease of negative charges in response to the change of the circumstance. 4. CDC28 phosphorylates PHO2 in vitro. A, phosphorylation of GST-PHO2 assay. The phosphorylation of GST-PHO2 was assayed by immunoprecipitates from the strain YPH499, bearing CDC28HA on a multicopy expression plasmid (pVTU102-CDC28HA) (lane1), and a control strain YPH499 containing the empty plasmid (pVTU102) (lane 2). B, histone H1 kinase assay. The immunoprecipitates from the strain YPH499 containing CDC28HA (lane 1) and the control strain (lane 2) was used in histone H1 kinase assay. TABLE II Analysis of transcriptional activation activity of yeast PHO2 protein PHO2 and its mutants, PHO2 (S230A) and PHO2 (S230D), were fused to the GAL4 DNA binding domain (in pGBT9) and expressed in yeast strain SFY526. -Galactosidase activity derived from activation of the GAL1-lacZ reporter were measured as described under "Experimental Procedures." Values are the means for triplate determinations. pVA3, murine p53 in pGBT9. pTD1 contains the fusion of SV40 large T-antigen and GAL4 activation domain. Third, phosphorylation may affect the interaction between transcriptional factors. Here we found that phosphorylation of PHO2 can affect the transcriptional activation activity. Only when PHO2 is phosphorylated, the secreted acid phosphatase, PHO5, can be expressed under low phosphate conditions. Further investigations indicated that the phosphorylation of PHO2 not only improve the transcriptional activation activity but facilitate the interaction between PHO2 and PHO4. These results suggested the pleiotropy of PHO2 phosphorylation. How the critical phosphorylation contributes to transcriptional activation activity and interaction is unclear. Because the previous deletion analysis showed that the possible PHO4 binding domain of PHO2 does not include the SPIK site and our results indicated that the negative charge of PHO2 (Ser230 3 Asp) is sufficient to help the interaction between PHO2 and PHO4 in vitro suggests that the phosphorylation of the Ser-230 residue in PHO2 may alter the conformation of PHO2, making the PHO4 binding domain of PHO2 suitable for interaction with PHO4 but not participating in the interaction directly. The phosphorylation may also increase the ability of PHO2 to activate transcription by altering the three-dimensional conformation of PHO2. Furthermore, the phosphate group may be directly involved in transcriptional activation by increasing the negative charges of activation domain of PHO2. PHO2 has a potential phosphorylation site, SPIK (230 -233), that resembles the consensus sequence of site recognized and phosphorylated by cdc2/CDC28-type kinase (20 -23). We found that GST-PHO2 fusion protein expressed in E. coli could be phosphorylated by yeast cell extract from YPH499 strain grown under low phosphate conditions. Further investigation showed that CDC28HA immunoprecipitate derived from yeast grown under low phosphate conditions could phosphorylate GST-PHO2 in vitro. These results indicate that CDC28 may be the kinase of PHO2. CDC28 is an essential regulator of cell cycle progression, whereas PHO2 is required for several metabolism processes. Another yeast cyclin-dependent kinase, PHO85, has provided a link between cell cycle regulation and phosphate metabolism. By association with different cyclin subunits, PHO85 may be directed to distinct biological functions. If CDC28 could be proved to be the physiological kinase of PHO2, another link between cell cycle progression and metabolism would be found. Perhaps a new cyclin would be found to help CDC28 participate in metabolism. In addition to PHO85, CDC28 might also serve to coordinate nutritional state and cell cycle progression. Homeo box-encoding genes appear to be associated with developmental control or cell type regulation. Previous investigations carried out by Gilliquet and Berben reveals the involvement of PHO2 that contains a homeo domain in the life cycle. Homozygous PHO2 null diploids show a deficiency to progress through meiosis, which can be corrected when the cells are transformed with PHO2-bearing plasmid. Many nuclear factors involved in the cell cycle have been observed to be phosphorylated and regulated by cdc2/CDC28-type protein kinase, which is activated only at specific cell cycle stages. Our present findings show that PHO2 may be phosphorylated by CDC28. These evidences also suggest that there is some association between metabolism and cell cycle machinery. |
<gh_stars>0
package org.stepic.droid.store.structure;
public final class DbStructureSections extends DBStructureBase {
private static String[] usedColumns = null;
public static final String SECTIONS = "sections";
public static final class Column {
@Deprecated
public static final String ID = "_id";
public static final String SECTION_ID = "section_id";
public static final String COURSE = "course";
public static final String UNITS = "units";
public static final String POSITION = "position";
public static final String PROGRESS = "section_progress";
public static final String TITLE = "title";
public static final String SLUG = "slug";
public static final String BEGIN_DATE = "begin_date";
public static final String END_DATE = "end_date";
public static final String SOFT_DEADLINE = "soft_deadline";
public static final String HARD_DEADLINE = "hard_deadline";
public static final String GRADING_POLICY = "grading_policy";
public static final String BEGIN_DATE_SOURCE = "begin_data_source";
public static final String END_DATE_SOURCE = "end_data_source";
public static final String SOFT_DEADLINE_SOURCE = "soft_deadline_source";
public static final String HARD_DEADLINE_SOURCE = "hard_deadline_source";
public static final String GRADING_POLICY_SOURCE = "grading_policy_source";
public static final String IS_ACTIVE = "is_active";
public static final String CREATE_DATE = "create_date";
public static final String UPDATE_DATE = "update_date";
public static final String IS_CACHED = "is_cached";
public static final String IS_LOADING = "is_loading";
public static final String TEST_SECTION = "can_test_section";
public static final String DISCOUNTING_POLICY = "discounting_policy";
}
public static String[] getUsedColumns() {
if (usedColumns == null) {
usedColumns = new String[]{
Column.ID,
Column.SECTION_ID,
Column.TITLE,
Column.SLUG,
Column.IS_ACTIVE,
Column.BEGIN_DATE,
Column.SOFT_DEADLINE,
Column.HARD_DEADLINE,
Column.COURSE,
Column.POSITION,
Column.UNITS,
Column.IS_CACHED,
Column.IS_LOADING,
Column.TEST_SECTION,
Column.DISCOUNTING_POLICY
};
}
return usedColumns;
}
}
|
/**
* Tries to inject the owner object in the 'owner' field of the child object.
*
* @param child injection target
* @param owner injection value
* @throws NoSuchFieldException if {@code child} does not have an 'owner' field
* @throws IllegalAccessException if the 'owner' field of {@code child} is not accessible via reflection
*/
public static void injectOwnerProperty(Object child, Object owner)
throws NoSuchFieldException, IllegalAccessException {
Class<?> clazz = child.getClass();
while (Arrays.stream(clazz.getDeclaredFields()).noneMatch(field -> field.getName().equals("owner"))) {
clazz = clazz.getSuperclass();
}
Field ownerField = clazz.getDeclaredField("owner");
ownerField.setAccessible(true);
ownerField.set(child, owner);
} |
Effects of mandibular advancement on respiratory resistance. Mandibular advancing devices are proposed as nonsurgical treatment for certain patients with an obstructive sleep apnoea syndrome. Since they act by increasing the upper airway calibre, the aim of the present study was to investigate the changes in respiratory resistance (Rrs) resulting from mandibular advancement. Rrs was measured at the nose by the forced oscillation technique (4-32 Hz). Ten normal subjects were studied under three conditions: resting mandibular position, passive mandibular advancement steadied by a wax bite, and voluntary advancement, in random order. Respiratory resistance was extrapolated to 0 Hz (R0) and estimated at 16 Hz (R16) by linear regression analysis of respiratory resistive impedance versus frequency. R0 (mean+/-SEM=3.5+/-0.2 cmH2O x L(-1) x s in the resting position) decreased significantly with passive advancement (2.9+/-0.2 cmH2O x L(-1) x s, p<0.001), but remained unchanged with voluntary mandibular advancement (3.6+/-0.2 cmH2O x L(-1) s). Similar results were obtained for R16. The results of this study demonstrate that the effects of mandibular advancement on upper airway resistance differ, depending on whether advancement is passive or active, and suggest that in order to simulate the actual effects of therapeutic devices, mandibular advancement should be passive. |
<reponame>fangsean/auto-framework
package com.auto.common.mertics;
/**
* @author auto.yin[<EMAIL>]
* 2018-10-18
* @Description: <p></p>
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author lhc
* @date 2017年12月29日 下午5:14:20
* 统计方法执行时间
*/
public class JProfileUtil {
protected static final Logger LOGGER = LoggerFactory.getLogger(JProfileUtil.class);
private static final Long defaultTime = 3000L ;
public JProfileUtil() {
}
public static void start(String message) {
JProfile.start(message);
}
public static void reset() {
JProfile.release();
long duration = JProfile.getDuration();
/* if(duration > (long)Math.max(500, defaultTime)) {
LOGGER.warn("Order request returned in {}ms\n{}\n", Long.valueOf(duration), getDetail());
}*/
JProfile.reset();
}
private static String getDetail() {
return JProfile.dump("Detail: ", " ");
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.