content
stringlengths 7
2.61M
|
---|
package dev.akif.espringexample.people.dto;
import dev.akif.espringexample.people.model.Person;
public class PersonDTOWithId extends PersonDTO {
private Long id;
public PersonDTOWithId(Long id, String name, Integer age) {
super(name, age);
this.id = id;
}
public PersonDTOWithId(Person person) {
this(person.getId(), person.getName(), person.getAge());
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
|
import Modelos.Empleado;
import com.db4o.Db4oEmbedded;
import com.db4o.ObjectContainer;
import com.db4o.ObjectSet;
public class Main {
public static void main(String[] args) {
}
}
|
After taking a year off to retool, the Assassin’s Creed series is back. The place: Egypt. The time: 48 BCE. The verdict: Pretty good; maybe even great.
The reviews are in, and Assassin’s Creed Origins is, by most accounts, a meaty, satisfying adventure with an incredible eye for historical detail.
Reviewers love its expansive, intricate world, its well-developed characters and its plethora of stuff to do. They weren’t as thrilled with the revamped combat, which can be a little finnicky, or the fact that it’s done little to change the franchise’s well-worn, decade-old formula. The bottom line is, if you like Assassin’s Creed (or want to get into the series for the first time), you should probably check it out; if you already know you dislike the series, this one probably won’t change your mind.
I reviewed Assassin’s Creed Origins for Tom’s Guide, and thoroughly enjoyed the whole package, giving it an 8/10. The setting and story stood out, while the streamlined exploration and refined character-building kept me coming back, hour after hour. The combat was a little loosey-goosey and a lot of the content is still just filler, but at least it’s fun filler.
Christian Dolan reviewed Assassin’s Creed Origins for Eurogamer, and he enjoyed the sheer amount of stuff in the game, as well as its ambitious scope. He wasn’t so crazy about the technical glitches. Eurogamer does not provide review scores, but did recommend the game.
Giving the game a score of 8.5/10, Suriel Vazquez at Game Informer thoroughly enjoyed Assassin’s Creed Origins. He praised the game’s innovative combat and huge, rewarding world. He did point out the game’s issues with frame rate and found some of the side missions repetitive.
Alessandro Fillari from Gamespot awarded Assassin’s Creed Origins a score of 7/10 — one of the lower ones from a major publication, but still pretty high in the grand scheme of things. He didn’t think the gameplay was as tight as it could have been, but loved the variety of side missions and the beautifully recreated Egypt of antiquity.
Alanah Pearce at IGN wrote one of the most enthusiastic reviews for Assassin’s Creed Origins from a major outlet, giving it a 9/10. She loved the setting, the gameplay and the technical aspects of the game, although she had harsh words for the loot grind and some performance issues.
Kirk Hamilton tackled the Assassin’s Creed Origins review for Kotaku. The review isn’t scored, but Hamilton generally enjoyed what was there. Even though most of the content is familiar, he argued, Origins delivers more of what makes Assassin’s Creed such a beloved series, even if it’s not very ambitious.
Polygon’s reviewer Colin Campbell gave Assassin’s Creed Origins 8.5/10, claiming that it was one of the best implementations of the franchise’s core formula yet. Even so, the formula itself could probably use some sprucing up, Campbell said.
Xbox One X vs. PlayStation 4 Pro: Which Powerhouse Should You Get? |
The normal vaginal flora, H2O2-producing lactobacilli, and bacterial vaginosis in pregnant women. In this study of the vaginal flora of 171 pregnant women in labor at term, the flora was categorized as normal (Lactobacillus predominant), intermediate, or representative of bacterial vaginosis (BV) on the basis of a vaginal smear. BV was diagnosed in 39 women (23%); the vaginal flora was classified as normal in 50% of cases and as intermediate in 27%. H2O2-producing lactobacilli were recovered from 5% of women with BV, 37% of those with an intermediate flora, and 61% of those with a normal flora. H2O2-negative lactobacilli were equally frequent (57%-65%) in all three groups. The microorganisms most frequently recovered from women with BV included Gardnerella vaginalis, Prevotella bivia/disiens, Bacteroides ureolyticus, Prevotella corporis/Bacteroides levii, Fusobacterium nucleatum, Mobiluncus species, Peptostreptococcus prevotii, Peptostreptococcus tetradius, Peptostreptococcus anaerobius, viridans streptococci, Ureaplasma urealyticum, and Mycoplasma hominis (P <.05 for each). The presence of all but three of these organisms was inversely related to vaginal colonization by H2O2-producing lactobacilli; the exceptions were B. ureolyticus, F. nucleatum, and P. prevotii. Other microorganisms were equally frequent among women with and without BV. We conclude that specific groups of anaerobes are associated with BV in this population and that a strong association exists between species associated with BV and those inhibited by H2O2-producing lactobacilli. |
import { Options, Meta } from '@remax/types';
import jsHelper from './jsHelper';
import jsModule from './modules';
import style from './style';
import json from './json';
import template from './template';
import usingComponents from './usingComponents';
export default function getAssets(platformConfig: Meta, resourcePath: string, options: Options) {
const assets: string[] = [
...jsModule(options, resourcePath),
...jsHelper(platformConfig, resourcePath),
...style(platformConfig, resourcePath),
...json(resourcePath),
...template(platformConfig, options, resourcePath),
...usingComponents(resourcePath, options).reduce<string[]>(
(acc, id) => [...acc, ...getAssets(platformConfig, id, options)],
[]
),
];
return assets;
}
|
The value of an operative wound swab sent in transport medium in the prediction of later clinical wound infection: A controlled clinical and bacteriological evaluation Operative wound swabs taken at 214 transperitoneal operations were examined during the course of three controlled clinical trails to determine the value of transport medium in the carriage of specimens. The use of Stuart's transport medium more than doubled the number of swabs yielding pathogens in the laboratory compared with a control series of duplicate swabs not sent in transport medium. Anaerobes were even more severely affected than aerobes by dry carriage. A polyester foam swab was shown to have no advantage over the standard cottonwool variety. Bacteriological swabs from superficial wound fat were shown to be superfluous if a peritoneal wound swab had already been taken. We suggest that operative abdominal wound swabs should not be accepted for processing by a microbiological laboratory unless sent in transport medium. |
Drug interactions-information, education, and the British National Formulary. The drug interactions appendix in the current issue of the British National Formulary lists about 3000 interactions or groups of interactions (the number of individual interactions is probably about 5000). Of those, about 900 (about 1500 individual interactions) are marked by a bullet, signifying interactions that are potentially hazardous and where combined administration of the drugs involved should be avoided (or only undertaken with caution and appropriate monitoring). The drugs or groups of drugs that earn the most bullet points are listed in Table 1. Table 1 Drugs or groups of drugs that are marked with at least ten bullet points in the drug interactions appendix in the British National Formulary (BNF 46) Unfortunately, the lists of interactions in the BNF are difficult to read and understand. They do not clearly distinguish between interactions in which the named drug is affected by the interaction (the object drug) and those in which it causes the interaction (the precipitant drug). Mechanisms are not mentioned. The categorization of drugs is inconsistent; why, for example, are diuretics with disparate modes of action grouped together, while HIV protease inhibitors (amprenavir, indinavir, lopinavir, nelfinavir, ritonavir, saquinavir) are all listed separately? And the print is small over 100 individual interactions are crammed into each page. Of course, the BNF is not a textbook, and it can be argued that bald lists are enough. Furthermore, the cost of producing it must be considered. But doctors need better guidance. For instance, the BNF says that prolonged regular use of paracetamol possibly enhances warfarin. We are not told what prolonged and regular mean, nor what to do about the interaction. Is the combination to be avoided altogether? The answer is no, but the BNF doesnt tell us that. Given the vast number of interactions that have been described, it is not surprising that the British Journal of Clinical Pharmacology publishes many papers on drugdrug and fooddrug interactions and on drug elimination by cytochrome P450 isozymes and P glycoprotein. In 2002, for example, there were 32 such original papers in a total of 141 (23%). In this issue alone there are nine. Ito, Brown, and Houston (pp. 47386) tell us how to use in vitro studies to predict in vivo interactions whose mechanism is inhibition of drug metabolism. First you calculate the hepatic input concentration of the inhibitor (Iin) and the in vitro inhibition constant (Ki) for your enzyme. Then you use Iin/Ki to predict the change in clearance of the object drug, measured as the increase in the AUC when the inhibitor is present. In a database of 149 interactions mediated by CYP3A4, CYP2D6, or CYP2C9, 102 (68%) were correctly identified and only four were missed. This type of approach will probably not reduce the number of interaction studies needed for drugs that reach the market, but it should help manufacturers to screen potential inhibitors and regulatory authorities to avoid licensing such drugs as mibefradil and cerivastatin. Now what about paracetamol and warfarin? Here is a brief summary, which does not do full justice to this interaction. Paracetamol potentiates the effect of warfarin in a dose- and time-related fashion: the more you take for longer, the bigger the effect is. The mechanism may be pharmacodynamic, perhaps via an action on factor VII. But this effect is not apparently shared by phenprocoumon and acenocoumarol , although if only a few individuals are susceptible, the studies may have been too small to detect them. Or perhaps they were poorly designed. Rather than looking for effects of paracetamol in a population of patients with INR values in the target range, it may be better to choose patients who have an INR of 6 or over and look for susceptibility factors. That is precisely what Visser et al. (pp. 5224) did in their study of the interaction of laxatives with acenocoumarol or phenprocoumon; and they found that lactulose increased the risk of an INR over 6 by 3.4 times. These drugs are commonly used, and this may therefore be a clinically important interaction, even in the UK, if it turns out that lactulose affects warfarin as well. Other papers in this issue of the Journal deal with inhibition of CYP-mediated drug metabolism by HIV protease inhibitors (pp. 43640), trimethoprim (pp. 4417), grapefruit juice (pp. 44855), perhexilene (pp. 45663), and fluvoxamine (pp. 48794) and induction by St John's wort (pp. 4959); and Davies et al. (pp. 46472) remind us that elderly people are at increased risk of drug interactions because they often take drugs that affect CYP3A4 or CYP2D6polypharmacy that is often inappropriate. Lord Reith famously declared that the BBC had three purposes: to inform, educate, and entertain. Recently, one of his successors, Greg Dyke, sought to qualify those purposes with what he modernistically called six values: to maintain trust, purvey quality and value for money, respect the audience, foster creativity, pursue diversity, and encourage internal collaboration. The British National Formulary has, in my view, a duty to do most, if not all, of those things. Most doctors do not have specialized interactions textbooks to hand. The BNF should fill that gap. And it should educate as well as inform. So what could be done to improve the presentation of information about drug interactions in the BNF? I would describe each individual drug interaction, with each drug in its own structured table, generally listing the interaction under the object drug, with a cross-reference from the precipitant drug, stating what the likely mechanism is, and giving advice about what to do. I appreciate that this would be a large task. But the BNF is a much-respected authority, and the section on interactions should be of the same exceptionally high standard as the rest of the text. Readability, comprehensibility, and clinical relevance should be favoured over compactness. |
Today at Yahoo’s first mobile developer conference, the tech giant unveiled its new Yahoo Mobile Development Suite that combines Yahoo App Publishing for monetization, Search In Apps, and App Marketing with its Flurry Analytics acquisition made last year. This is Yahoo’s “ads in dev’s clothing” strategy to convince app makers to buy and host its ads.
Flurry now has 200,000 app developers on its platform who have built 630,000 apps that reach 1.6 billion devices. Yahoo meanwhile now has 575 million monthly mobile visitors to its properties and hit $1.2 billion in mobile revenue in 2014, as it predicted.
“Today is about building innovative, game-changing applications,” said CEO Marissa Mayer when she took the stage. Now, rather than just make them itself, Yahoo is providing the tools for developers to build, grow, and earn money on their own apps.
Mobile Trends
Following Mayer, Flurry CEO Simon Khalaf took the stage to give an update on the state of mobile. He says there are three big trends in mobile right now:
A massive rise in mobile shopping Messaging apps becoming whole platforms, like WeChat’s taxi integration, Line’s games, and Snapchat’s new Snapcash payment feature that prove people want more services from their favorite apps Phablet phones driving a massive increase in media consumption
Mobile Developer Suite
Each piece of the Yahoo Mobile Development Suite is getting its own update as well as being tied together.
Flurry Explorer And Pulse
Flurry announced the new Flurry Explorer analytics tool, which an exec said is an “ad-hoc query analysis tool” that lets you “ask complex questions of your data and get the answer in seconds.” The product is free at any scale, which poises it to undercut Mixpanel, and analytics tool favorite around the industry that unfortunately can be quite expensive depending on how many in-app events are being measured.
Flurry is also launching Flurry Pulse, which lets developers securely share any of their data with their partners with ease. No additional code needs to be written. For example, mobile app publishers serving ads can send their mobile audience data directly to comScore (a Flurry Pulse launch partner).
Previously, developers would have had to integrate another comScore SDK into their apps. This shrinks app size, increases app stability thanks to minimizing code, and removes the need for extra updates. Yahoo plans to add additional partners to Flurry Pulse soon, and is now in developer preview and will roll out over the coming weeks and months.
Monetizing With Ads
To give mobile developers a better way to monetize, Yahoo today launched Yahoo App Publishing.
Now through the Flurry SDK, developers can integrate Yahoo’s Gemini native ads that fit into different app feeds, whether they’re vertical streams, or horizontal cards. No matter what an app looks like, Yahoo’s Gemini system can morph standard ads to match the app’s design.
Last year Yahoo acquired video adtech startup BrightRoll . Now developers can pipe BrightRoll ads into their apps through the Flurry SDK. So if an app features video content, they can easily monetize it without their own sales force through BrightRoll. “Isn’t this great? Grumpy Cat and Big Macs in your app, and you make money from it,” said Yahoo Senior Director of Product Management James Kelm.
Yahoo Search In Apps
Developers don’t want users bouncing from their apps when they need to run a web search. So today Yahoo launched Yahoo Search In Apps, an integratable search tool for mobile apps. The idea is that not only will users stick around in a developer’s app if they can search from there, but the developer can share in the ad revenue if users click on search ads.
Yahoo Search In Apps is now integrated in Yahoo’s main app, Yahoo News Digest, Yahoo Mail and Android launcher Yahoo Aviate. Externally, the Dodol launcher and Solo launcher apps now integrate Yahoo Search In Apps. Yahoo’s Jon Paris gave the example of someone using news app and wanting to learn more about the topic of the article. Yahoo lets them search without exiting the app.
Yahoo Mobile Marketing
Yahoo is tying together its three mobile advertising options for developers: Gemini native ads on Yahoo’s properties, video ads on third parties, and Sponsored Post social ads on Tumblr. Now developers can target ads in any of these channels using Yahoo’s identity data with a self-serve tool. That includes what people browse on Yahoo and Tumblr, and what they do across the web thanks to Flurry’s big footprint.
The Virtuous Cycle
Overall, Yahoo’s platform is a smart play because it dangles free analytics and monetization tools to lure developers towards its advertising products. Investors gave Yahoo a small 1.42 percent bump today as of 3:15 p.m. EST thanks to the launches. This “PlADform Strategy” is what I wrote Facebook and Twitter were aggressively developing last year.
Hence, Yahoo’s new platform will put it into more direct competition with Facebook and Twitter, which also offer analytics, advertising and monetization tools. Developers will be looking for which platform has ads that deliver the most valuable users, pays them the most for hosting their ads, and gives them the best understanding on what’s going on in their apps through analytics. Expect Facebook to improve its offerings in these next month at its f8 developer conference.
In a press conference after the keynote, Mayer referred to the suite as creating a “virtuous cycle” that helps developers at all stages of their app’s lifespan. “You start with people that build great products, products lead to traffic, traffic leads to revenue, and you can reinvest that.” That’s quite similar to the Build-Grow-Monetize loop Facebook talks about with its platform.
When I asked how Yahoo will nudge developers along the cycle, Mayer said it happens naturally as once someone builds a product, they want to make it better, grow it, and earn money from it. It’s the last two phases where Yahoo makes money, so getting devs there is critical.
Khalaf noted that “Our largest competitor was Sand Hill Road. They were giving money to developers and not asking them to monetize.” Venture capitalists just wanted growth now and revenue later, but Khalaf says that’s changed now, led by mobile games and big platforms like Facebook making big bucks on the small screen. Monetization is being baked into the app experience, so developers are thinking about it earlier.
Yahoo’s SVP Of Mobile Adam Cahan tells me that with that focus from the start, developers are realizing “a sales organization is an expensive beast.” They’d rather outsource it to platforms like Yahoo. Also, Cahan says “the ads suck less” thanks to new native formats and targeting, so devs are less weary to build them in. And Flurry Chief Product Officer Prashant Fuloria the parts of the cycle have synergies. Flurry analytics can teach developers who their users are so they can sell demographics to Yahoo’s advertisers, and onboard more like them through Yahoo App Marketing.
Mayer also responded to my question about where there are future opportunities for the Yahoo Mobile Development Suite, saying “What we see the most demand for is around identifying users across platforms. Some of the cookie matching we’re working with comScore on.” She’s referring to being able to target users with ads on smartphones or tablets or web based on what they do on these other devices.
Google and Facebook have taken the spotlight in ad targeting, but Mayer seems intent on closing the gap the best Yahoo can. It might not have the top search engine or social network where people volunteer personal data, but Yahoo does understand people’s interests by triangulating which of its products they use.
A few years ago, it was almost inconceivable to think about Yahoo getting mobile right for itself, let alone helping anyone else. But the company saw where the industry was going, and spun the wheel to course-correct. Mayer capped her portion of the conference by saying “Yahoo mobile went from being a hobby with just 50 people working on it to being a quarter of our business last year.” |
#include "iAnim.h"
#include <types.h>
// func_800BE9F4
#pragma GLOBAL_ASM("asm/Core/p2/iAnim.s", "iAnimInit__Fv")
// func_800BE9F8
#pragma GLOBAL_ASM("asm/Core/p2/iAnim.s", "iAnimEval__FPvfUiP5xVec3P5xQuat")
// func_800BEA18
#pragma GLOBAL_ASM("asm/Core/p2/iAnim.s", "iAnimDuration__FPv")
// func_800BEA38
#pragma GLOBAL_ASM("asm/Core/p2/iAnim.s", "iAnimBoneCount__FPv")
// func_800BEA58
#pragma GLOBAL_ASM("asm/Core/p2/iAnim.s", "iAnimBlend__FffPUsPfUiP5xVec3P5xQuatP5xVec3P5xQuatP5xVec3P5xQuat")
// func_800BF19C
#pragma GLOBAL_ASM("asm/Core/p2/iAnim.s", "__as__6RtQuatFRC6RtQuat")
|
The present invention generally relates to a biosensor, and more particularly to a biosensor including a sensing gate dielectric and a back gate dielectric
Biosensors may have a variety of applications. For example, a biosensor may be used in DNA sequencing or virus screening. Additionally, biosensors may be employed to detect a biocharge in DNA, protein, and cancer cells. As an example, detection of a biocharge may be correlated with an amount of DNA present in a chamber. Thus, a biosensor employing biocharge detection may be used to quantitatively determine an amount of DNA that is present in a test chamber.
One type of biosensor is ion-sensitive field-effect transistor (ISFET). An ion-sensitive field-effect transistor (ISFET) may be used for measuring ion concentrations in solution. For example, when the ion concentration (such as H+) changes, the current through a transistor may change accordingly. Thus, the solution may be used as the gate electrode. When a biospecies (e.g., DNA) lands on the gate dielectric of an ISFET, the charges carried by the biospecies may modulate the electrical current in the channel of the ISFET. Sensing may be achieved by monitoring a change of the transistor characteristics (e.g., threshold voltage (Vt)).
However, relatively small amounts of a biospecies, such as DNA, may carry a relatively small amount of charge. Thus, a Vt shift may be relatively small when the DNA sample is placed in the test chamber. |
Positive and negative health behaviors used to ensure compliance with the U.S. Army's weight control standards by a reserve component unit. This paper describes the results of a nonexperimental descriptive research study in which specific positive and negative health behaviors used by soldiers in a medical reserve unit to ensure compliance with the Army Weight Control standards were surveyed using a questionnaire. The findings of the survey, particularly the prevalent use of negative health behaviors to control or maintain weight, were startling. The authors offer their conclusions and propose solutions relative to changing the emphasis of the program from having a single focus, i.e., weight control, to a comprehensive focus, i.e., physical fitness and wellness. |
Cytomegalovirus immune evasion by perturbation of endosomal trafficking Cytomegaloviruses (CMVs), members of the herpesvirus family, have evolved a variety of mechanisms to evade the immune response to survive in infected hosts and to establish latent infection. They effectively hide infected cells from the effector mechanisms of adaptive immunity by eliminating cellular proteins (major histocompatibility Class I and Class II molecules) from the cell surface that display viral antigens to CD8 and CD4 T lymphocytes. CMVs also successfully escape recognition and elimination of infected cells by natural killer (NK) cells, effector cells of innate immunity, either by mimicking NK cell inhibitory ligands or by downregulating NK cell-activating ligands. To accomplish these immunoevasion functions, CMVs encode several proteins that function in the biosynthetic pathway by inhibiting the assembly and trafficking of cellular proteins that participate in immune recognition and thereby, block their appearance at the cell surface. However, elimination of these proteins from the cell surface can also be achieved by perturbation of their endosomal route and subsequent relocation from the cell surface into intracellular compartments. Namely, the physiological route of every cellular protein, including immune recognition molecules, is characterized by specific features that determine its residence time at the cell surface. In this review, we summarize the current understanding of endocytic trafficking of immune recognition molecules and perturbations of the endosomal system during infection with CMVs and other members of the herpesvirus family that contribute to their immune evasion mechanisms. INTRODUCTION To evade host immune surveillance, herpesviruses have evolved a variety of mechanisms that provide them with the capability of lifelong survival in infected hosts in the form of latent infection with the ability to reactivate when the immune surveillance is compromised. 1 These mechanisms are based on the synthesis of viral gene products that specifically interrupt the expression, either the synthesis or intracellular processing, of various effector molecules of the innate and adaptive immune response. 2 A majority of these gene products target either cellular machineries that present viral antigens to major effector cells with specific immunity (CD8 T cells, CD4 T cells and natural killer (NK) T cells) 2 or molecules that contribute to immune recognition by major effector cells that contribute to innate immunity (NK cells). 3 Cytomegaloviruses (CMVs), members of the herpesvirus family, encode a relatively large number of gene products that interfere with primary effector mechanisms. They disrupt the presentation of antigen to CD8 and CD4 T lymphocytes and attack ligands that activate NK cells. 4 To achieve this goal, they specifically target immune recognition molecules at the earliest stages of assembly and intracellular trafficking in the biosynthetic pathway. 2,5 However, interference with later stages of their intracellular life is poorly understood, although it is well known that CMVs perturb many cellular processes, especially the vesicular system. Every cellular protein that resides in the membranous system of the cell has specific features that determine its intracellular localization and lifetime. Thus, perturbation of the endosomal route of cellular proteins, including molecules that participate in immune recognition, may result in distinct cellular routing. In this review, we will focus on CMV remodeling of the endosomal system and the consequent perturbation of endocytic trafficking of major immune recognition molecules, which can contribute to immune evasion mechanisms. First, we will provide a brief overview of our current understanding of the physiology of endocytic trafficking, then we will describe known CMV effects on endocytic routes of immune recognition molecules and finally, we will give a brief overview of the mechanisms used by other herpesviruses. THE ENDOCYTIC PATHWAY Despite intensive research in the last two decades, the endosomal system and endocytic routes remain poorly understood. In fact, as increasing data are obtained for that complex pathway, the number of unresolved issues has also risen. The size and dynamics of the endocytic pathway differ significantly in various cell lines due to an extremely high degree of plasticity. Figure 1 shows a schematic of the endosomal system and endosomal routes relevant to the discussion of immune evasion by endosomal perturbation. Internalization and internalization rate Internalization represents the loss of cell surface molecules as a net result of the combined effects of endocytosis (entrance of molecules from the cell surface into the cell interior) and recycling (return of endocytosed molecules back to the cell surface). 6 Thus, the extent and rate of internalization is determined based on both the rates of endocytosis and recycling. The endocytic activity of the plasma membrane is extremely high. The equivalent of the cell surface is internalized one to five times per hour, 7 which indicates that endocytic and recycling activity are highly dynamic and well coordinated. Therefore, if a membrane protein has a constitutively higher endocytic rate than the recycling rate, more protein will accumulate in the intracellular pool. A decrease in the recycling rate (i.e., by remodeling of the endocytic route during viral infection) will result in a relocation of plasma membrane protein to the intracellular site where the trafficking rate is the slowest. Endocytic pathways and endocytic rates As mentioned previously, endocytosis can be described as a movement of membranes from the cell surface into an internal compartment by the formation of various types of endocytic invaginations and endocytic carriers. The endocytic rate is not uniform for the entire plasma membrane and depends on the membrane composition and molecular machinery used to form the endocytic invaginations and endocytic carriers. The most frequently discussed endocytic pathways involve clathrindependent endocytosis, clathrin-independent endocytosis, macropinocytosis and endocytosis through deep tubular invaginations ( Figure 1). A significant fraction of the plasma membrane concentrates membrane proteins that contain specific cytoplasmic motifs (clathrin-dependent endocytic motifs such as the tyrosine-based motif, the di-leucine-based motif, NPXY and mono/multiubiquitinylation). These motifs are recognized by adaptor proteins (AP-2), leading to rapid endocytosis by the mobilization of complex machinery containing clathrin to form clathrin-coated endocytic carriers. 8 At every moment, 1%-2% of the plasma membrane contains clathrin-coated pits, and approximately 50% of the plasma membrane is internalized each hour through this endocytic route. 7 This pathway is used to endocytose many proteins and receptors (i.e., transferrin receptor (TfR), epidermal growth factor receptor (EGFR)). Membrane proteins that do not have clathrin-dependent endocytic motifs are captured into clathrin-independent endocytic invaginations and carriers that are constitutively formed at the plasma membrane. A portion of these carriers are associated with engagement of the protein caveolin (caveolae-dependent endocytosis). Another portion is associated with the activity of the small GTPase Arf6 (known as the Arf6-associated pathway), whereas some carriers are formed by tubular invaginations that do not associate with Arf6, but require the activity of the small GTPase cdc42, Arf1 and the actin cytoskeleton, known as the cdc42-dependent pathway or GEEC (glycosylphosphatidyl anchored proteins enriched endosomal compartments) pathway. Additionally, the plasma membrane contains poorly characterized deep tubular invaginations 15 that ensure the endocytic uptake and cycling of many membrane proteins. 16 With increasing data on clathrin-independent endocytosis, it is becoming apparent that there are multiple and overlapping routes for constitutive membrane uptake, and thus, the classification of clathrin-independent endocytic routes is constantly changing. Membrane deformations and the development of endocytic invaginations depend on the lipid composition of the involved membrane region, engagement of effector molecules and association with the actin cytoskeleton. For example, membrane proteins are organized in different types of microdomains (sphingomyelin organized microdomains, 17 tetraspanin-rich microdomains 18 ) and nanoclusters of various sizes and composition. 19 The composition of membrane microdomains determines the mode of membrane deformation and development of endocytic invaginations, including the engagement of various components of the endocytic machinery that are available in the cytosol. Large lipid-organized areas of the membrane (lipid rafts) will certainly require a distinct machinery for deformation, budding and scission compared with lipid-disordered areas. Therefore, several different endocytic rate constants of constitutive endocytic uptake can be expected based on the heterogeneity of the membrane composition. In addition to endocytic uptake by clathrin-dependent and clathrin-independent mechanisms, a significant portion of the plasma membrane is also internalized by macropinocytosis (Figure 1), membrane ruffles that are formed at particular types of membrane subdomains. 20 These ruffles also mediate uptake of extracellular fluid and cargo molecules in the fluid (i.e., dextran and albumin). Taken together, it is clear that the overall endocytic rate is a composite of several endocytic activities that occur simultaneously at the plasma membrane: the rate of clathrin-dependent endocytic uptake, rates of constitutive membrane uptake via clathrin-independent endocytic carriers and deep tubular invaginations, and the rate of macropinocytic uptake. Early endosomal route After endocytic uptake, clathrin-coated endocytic carriers are rapidly uncoated and fuse together. Their phospholipid composition changes (i.e., acquire phosphatidylinositol 3-phosphate) and they bind the small GTPase Rab5 and early endosomal antigen 1 (EEA1), are tethered to microtubules and become classical early endosomes (Figure 1). 21 The same events also characterize the route of clathrin-independent endocytic vesicles. However, it seems that the latter undergo several pre-early endosomal maturation events, including the formation of recycling carriers. These actin networkassociated events are poorly characterized and represent an area of intensive research. After maturation to the point of acquisition of EEA1, non-clathrin-derived endocytic carriers fuse with classical early endosomes and mix cargo molecules with those being shuttled through the clathrin-dependent route. 21,22 Early endosomes attached to microtubules travel towards the cell center while accepting new cargo vesicles and releasing tubular extensions. 22 By enlargement, classical early endosomes mix cargo materials and form several membrane domains of maturation. Along the entire early endocytic route, endosomal membranes form recycling endosomal domains that tubulate and generate recycling endocytic carriers (Figure 1). 23 The recycling of membranes starts early after endocytic uptake, just before the stage of classical early endosomes. This poorly characterized pathway of recycling, known as rapid recycling, 24 occurs in the cortical area and requires the actin cytoskeleton. 16 Upon fusion into classical early endosomes that travel towards the cell center, early endosomal membranes continuously generate recycling domains that return cargo (i.e., TfR and EGFR) back to the cell surface. This route, known as the fast recycling route, returns both clathrin-dependent and clathrin-independent cargo molecules, although it appears that at least some clathrin-independent cargo molecules (i.e., major histocompatibility (MHC) I proteins) are recycled via tubular endosomes that are distinct from classical TfR-loaded recycling carriers. 25,26 Finally, early endosomes that reach the cell center segregate a substantial fraction of the membrane cargo into endolysosomal domains that mature into late endosomes; 21 the rest is constitutively transported into enlarged tubular endosomes that concentrate around the cell center, known as the juxtanuclear recycling compartment (JRC). 21,22 The JRC cargo molecules are slowly recycled back to the plasma membrane (slow recycling pathway, Figure 1). Recycling from the early endosomal system occurs continuously at a rate that counteracts the high rate of endocytic uptake. If an equivalent of the plasma membrane is endocytosed one to five times per hour, the majority of the endocytosed membranes should be returned via recycling at a similar rate because only,5% of the plasma membrane is newly synthesized each hour. 7 Thus, the proper functioning and integrity of the recycling system is a key regulator of the composition of membrane organelles and the cellular distribution of membrane proteins. Late endosomal route During their movement along microtubules, early endosomes enlarge by absorbing incoming early endosomal carriers. 21,27 Simultaneously to the constant generation of recycling domains, early endosomes generate an endolysosomal domain that is characterized by inward budding and the formation of intraluminal vesicles (Figure 1). This domain contributes to the formation of vacuolar early endosomes, often termed sorting endosomes, which mature into multivesicular bodies (MVBs) and either exchange cargo with late endosomes or fuse with late endosomal membranes in a process that remains poorly characterized. 21 Late endosomes are considered a highly dynamic network of vesicular endosomal membranes that mix cargo molecules and deliver them either to lysosomes for degradation or to the trans-Golgi network (TGN) for utilization in the secretory pathway. 21,28 A fraction of multivesicular endosomes either develop into specialized lysosome-related organelles 29,30 or constitutively reach the cell surface and recycle late endosomal cargo to the plasma membrane 31 (lerp, late-endosomal recycling pathway, Figure 1). Intraluminal vesicles are released in the extracellular milieu as exosomes during the process known as exocytosis. 21,32 Regulation of endosomal dynamics Endosomal carriers are formed by membrane deformations caused by changes in the membrane lipid composition (catalyzed by lipid-modifying enzymes) with the assistance of a set of cytosolic proteins or by motor proteins that attach membranes to the cytoskeleton. 33 In addition to membrane deformations, the formation of endosomal compartments requires a series of fission and fusion events along the endosomal routes in which membrane and luminal components are exchanged and sorted. All of these events are initiated by regulatory small GTPases in the Rab and Arf family, which attach to the membrane and recruit a series of effector proteins 34,35 (Figure 2). Scission of endocytic carriers from the plasma membrane and their fusion into/with early endosomes, including preearly endosomal events and rapid recycling events, is regulated by Arf1 and Arf6 GTPases. 23,24 The binding of Rab5 to early endosomes is essential for their maturation, including fusion and microtubule attachment, whereas the binding of Rab4 and Rab35 creates recycling domains that enables the production and release of recycling vesicles and facilitates fast recycling. The attachment of Rab11 to early endosomes leads to the formation of tubular extensions that convert early endosomes into a network of recycling tubules (JRC) and facilitate slow recycling. The process of slow recycling is complex and involves the concomitant activation of Rab11, Rab22a and most likely Arf1 and Arf6 GTPases. 25,36 Replacement of Rab5 on early endosomes with Rab7 generates endolysosomal domains that bud extensively into the lumen of endosomes to form enlarged vacuolar and multivesicular endosomes that mature into late endosomes. The attachment and activation of Rab7b on late endosomes results in the formation of an endosomal domain with the capacity to generate endocytic carriers that travel towards the TGN, 37 whereas the attachment of Rab27b and Rab27a leads to the formation of secretory endolysosomes and late endosomal recycling and exocytosis. 29,31,32 The remaining late endosomes with attached Rab7 fuse with lysosomes and create degradation organelles 38 (Figure 2). The recruitment of regulatory proteins onto endosomal membranes is determined by the biochemical composition of the membrane (i.e., lipid composition) and activity of guanine nucleotide exchange factors and GTPase-activating proteins. The attachment of activated regulatory proteins is followed by the replacement and activation of effector proteins that change the physiological properties of the membrane, including its capacity for deformation, motility, fusion/fission, internal budding, tubulation and vacuolization, among others. 34,35 Similar principles operate in the secretory pathway ( Figure 2). Routes of cargo molecule trafficking Based on the composition of the endosomal system and the complexity of the regulatory network, it is clear that the trafficking of cargo molecules depends on many steps along the endocytic pathway. Thus, the routes of cellular proteins are not uniform and should be explored for every protein molecules. Several examples of relatively well-characterized routes are outlined in Figure 3. Some cell surface receptors that contain specific motifs in their cytoplasmic domain that can recruit the AP-2 complex are constitutively taken up into clathrin-coated endocytic carriers that facilitate their rapid endocytic uptake. 39 An example of this type of receptor is the TfR, which cycles in the early Figure 2 Regulation of endosomal trafficking. Major regulatory proteins that shape endosomal and secretory pathway membranes and determine dynamics the extent of membrane flow. Endosomal compartments are indicated in white, and secretory pathway compartments are indicated in orange. Figure 3 Endocytic routes of some well characterized cargo proteins. (a) Tf-TfR, transferrin receptor (TfR) with bound ligand transferrin (Tf), route of clathrin-dependent cargo molecules that recycle via the fast and slow early endosomal recycling route; (b) EGF-EGFR, epidermal growth factor receptor with bound ligand (EGF), route of clathrindependent receptors that follow the late endosomal route when associated with ligand (red route) or recycle via early endosomes when unassociated with ligand; (c) LDL-LDLR, low-density lipoprotein receptor with bound ligand (LDL), route of receptor molecules that traffic into late endosomes when associated with ligand (red route) or rapidly recycle in the actin-dependent area when dissociated from ligand (green route); (d) CD63 route, a representative late endosomal resident protein that cycles between late endosomes and the plasma membrane; (e) GPI (glycosylphosphatidyl inositol)-anchored proteins (GPI-APs) follow a different route when associated with lipid rafts (rGPI-APs, red route) than those that reside in a lipid-disordered membrane environment (nrGPI-APs, green route); (f) the route followed by CD44 is an example of proteins that rapidly cycle in the cortical area of the cell (actin-dependent). Orange area, actin-dependent area; blue area, microtubule-dependent area. endosomal and juxtanuclear recycling route ( Figure 3a). The route of some receptors, such EGFR, depends on ligand binding ( Figure 3b). Unoccupied receptors are constitutively internalized via a clathrin-independent mechanism and mainly recycled back to the cell surface from early endosomes, the juxtanuclear recycling compartment or late endosomes 40 ( Figure 3b, green route). Ligand-associated EGFR is rapidly endocytosed by clathrin-dependent carriers that fuse with early endosomes and mature into late endosomes in which EGF/ EGFR are trapped in intraluminal vesicles that are destined for degradation after fusion with lysosomes 40 (Figure 3b, red route). Lysosomal targeting and degradation of EGF/EGFR is associated with ubiquitination of the receptor. 41 After binding of lipoproteins at the cell surface, the LDL receptor is rapidly internalized via clathrin-dependent endocytosis, dissociated in pre-early endosomes and recycled back to the cell surface 42 (Figure 3c, green route). Released lipoproteins (LDL) continue trafficking in early endosomes towards late endosomes, which contain the cellular machinery for the extraction of cholesterol and its routing towards various intracellular destinations 43 (Figure 3c, red route). Late endosomal resident proteins, such as CD63, Lamp1 and CD83, contain a tyrosine-based lysosomal-targeting motif 44 that targets them and is retained in late endosomes ( Figure 3d). Upon fusion of a subset of late endosomes with the plasma membrane (late endosomal recycling route), the recycled proteins are rapidly internalized via clathrin-dependent endocytosis into early endosomes and routed toward late endosomes. 30 The trafficking route of membrane proteins that are attached to the plasma membrane by the GPI moiety (GPI-AP) depends on their localization in the membrane. When they partition into a lipid-disordered membrane microenvironment, they are endocytosed by the clathrin-independent pathway into GEECs, routed into the juxtanuclear recycling compartment and recycled back to the plasma membrane 45 (Figure 3e, green route). When they partition into a lipid-organized membrane microenvironment (lipid-rafts), they are rerouted from early endosomes into late endosomes and returned to the plasma membrane via the late endosomal recycling route 46 ( Figure 3e, red route). Some clathrin-independent membrane proteins, such as CD44, CD98 and CD147 (Figure 3f), are sorted by Hook1 protein and rapidly routed into recycling tubules, avoiding the classical early and late endosomal routes. 16 This process of continuous recycling results in their prolonged lifetime on the cell surface. Endocytic trafficking of antigen-presenting molecules The trafficking route of MHC proteins is the best-characterized route of clathrin-independent cargo molecules. Fully conformed MHC I proteins are constitutively endocytosed into Arf6-associated carriers that fuse with TfR-loaded early endosomes. 26,47 During trafficking along the early endosomal route, MHC I proteins are sorted into recycling domains and found in tubular early endosomes and the juxtanuclear recycling compartment (Figure 4a). In contrast to TfR, many endocytosed fully conformed MHC I proteins (approximately 40%) are directed into late endosomes and the degradation route. 48,49 However, endosomal trafficking of MHC I proteins is more complex because MHC I molecules also can be displayed at the cell surface without antigenic peptide (empty MHC I, open MHC I conformers). In contrast to complete MHC I, they partition into distinct membrane microenvironments already present in the plasma membrane, endocytose into distinct endocytic carriers and are excluded from the early endosomal recycling domains (Figure 4b). 48,49 Although the majority of empty MHC I molecules follow the degradation route, a portion of them segregate into a specific subset of late endosomes and undergo recycling via the late endosomal recycling route (Mahmutefendi_ et al., 2014, unpublished data). 50 Thus, a detailed knowledge of the endocytic routes of both full and empty MHC I is essential to understand both antigen presentation mechanisms based on exogenous peptide loading and virus immune evasion strategies. MHC II molecules have two distinct routes. Nascent MHC II molecules associate with the invariant chain (Ii) in the endoplasmic reticulum (ER), which inhibits peptide binding. Most, if not all, Ii-MHC II complexes travel via TGN to the cell surface and are rapidly endocytosed by clathrin-dependent carriers. 51 Internalized Ii-MHC II are then delivered into a lysosome-like antigen-processing compartment (MHC II compartment; MIIC) where Ii is degraded and replaced with antigenic peptide. Peptide-loaded MHC II molecules (pMHC II) are then moved to the cell surface to display antigenic peptides to CD4 T lymphocytes (Figure 4c, red route). 51 In contrast to Ii-MHC II, peptide-loaded MHC II that reach the cell surface are endocytosed by clathrin-independent endocytic carriers, rapidly internalized into early endosomes and recycled back to the cell surface (Figure 4c, green route). 51 pMHC II internalize and reach a steady state ratio (80% at the surface, 20% intracellular) within 5 min, which indicates that cells possess efficient recycling machinery to maintain this distribution. pMHC II were found in Arf6 1, Rab35 1 and EHD1 1 elongated tubules emanating from the plasma membrane. 51 CD1 molecules, antigen-presenting molecules that are structurally related to MHC I, follow a route similar to MHC I proteins (Figure 4d-f). CD1a molecules traffic mainly through early endosomes and are recycled as MHC I proteins (Figure 4d), whereas CD1c molecules are equally distributed in early and late endosomes and recycled back to the cell surface also via the late endosomal recycling route (Figure 4f). In contrast, CD1d and CD1b are sorted mainly into late endosomes, into the same compartment as MHC II molecules (MIIC), and returned to the cell surface via the late endosomal recycling route (Figure 4e). 54 IMMUNE EVASION ACTIVITIES OF CMVS BY PERTURBATION OF THE ENDOSOMAL SYSTEM There is increasing evidence that all members of the herpesvirus family can modulate some or all effector functions of the adaptive immune response. This modulation is based on the downregulation of cell surface molecules that participate in immune recognition, both on target and on effector cells. Mechanisms that are based on disruption of the cell surface egress from the secretory pathway of newly synthesized receptors or ligands are well understood, including responsible viral gene products. 55,56 However, little is known about mechanisms that are based on the perturbation of endosomal trafficking of receptors and ligands that participate in immune recognition. This lack of information may be explained by a poor understanding of basic endosomal trafficking and endosomal perturbations in infected cells. Thus, in the following section, we provide an overview of current knowledge on the perturbation of the endosomal system and endosomal trafficking in CMVinfected cells. Unfortunately, the available data are insufficient to create an overall map of immune evasion events in the endosomal system. In general, viruses can downmodulate cell surface expression by altering the endocytic properties of a plasma membrane protein or by affecting the endosomal maturation program and thereby disrupting the physiological route of a given protein. The host immune response to CMVs involves both innate and adaptive arms of the immune system. For efficient development of the adaptive immune response to CMVs, it is essential to prime CD8 1 and CD4 1 T cells. 57 Efficient priming is based on the presentation of viral proteins by MHC I and MHC II molecules at the cell surface of either infected cells or antigen-presenting cells, killing the infected cells or initiating a specific immune response, respectively. Thus, processing of viral antigens in the MHC I and MHC II presentation pathway and recognition of MHC proteins are decisive targets for CMVs to evade effective clearance from the host. MHC I molecules sample endogenous viral antigens that are processed in the cytosol using a sophisticated mechanism involving proteasomal degradation and peptide loading onto nascent MHC I proteins. 58 Peptide-loaded MHC I proteins are displayed at the cell surface and monitored by TCR/CD3 complexes on CD8 1 T lymphocytes. Thus, interference with peptide loading and trafficking of MHC I proteins to the cell surface is an efficient immune evasion strategy that evolved in CMVs ( Figure 5). Additionally, cell surface MHC I proteins are constitutively endocytosed into endosomal compartments and recycled back to the cell surface from various points of the endosomal system 23,49,59 (Figure 4). During endosomal trafficking, MHC I proteins are exposed to the acidified endosomal environment and mixture of internalized cargo molecules, including viral peptides, 48 which also allows peptide sampling in the endosomal system and presentation of exogenous antigens (known as cross-presentation). 60,61 Therefore, interference with the endosomal trafficking of MHC I proteins and inactivation of the antigen-presenting capacity of the endosomal environment is of particular interest for CMVs ( Figure 5). MHC II molecules are expressed on specialized cells (B lymphocytes, dendritic cells, monocytes/macrophages) known as antigen-presenting cells, which are essential for the development of adoptive immune response. 62,63 MHC II molecules sample exogenously derived peptide antigens in a specialized region of the endosomal system of these cells (MIIC). 62,63 Peptide-loaded MHC II proteins are exposed at the cell surface and constitutively cycle in the endosomal system (Figure 4), including passage through the acidic gradient of endosomal compartments and exposure to exogenous peptides obtained at the cell surface. 64 Therefore, for MHC I, remodeling of MHC II trafficking in antigen-presenting cells or perturbation of the antigen-presenting compartment is of particular interest for CMVs to disrupt the development of the specific immune response ( Figure 5). NK cells are critical for defense against CMVs during the early stages of host infection and prior to the development of an effective adaptive immune response. 3,65 They recognize the altered cell surface of infected cells and provide protection by releasing interferon gamma or by direct lysis of infected cells. Their activity is controlled by a balance of activating (i.e., human MICs, ULBPs, RAET1s and murine MULT-1, H60, RAE-1) and inhibitory (i.e., MHC I) signals that are received from the cell surface of the infected cell 3,4,65,66 ( Figure 5). Thus, modulation of the cell surface expression of activating or inhibitory molecules is of particular interest for CMVs to escape recognition by NK cells. 4,65,66 This modulation can be achieved by reducing their egress to the cell surface from the secretory pathway or by rerouting their endosomal trafficking and redirecting them from the cell surface into the cell interior ( Figure 5). Recent studies indicate that NKT cells, a subset of T cells that co-express T-cell receptors and receptors of NK cells, are important during the early stages of the immune response to various pathogens, including herpesviruses. 67 NKT cells can be activated by endogenous and exogenous antigenic lipid and glycolipid ligands exposed at the cell surface of infected cells by non-polymorphic MHC I-like proteins from the CD1 family ( Figure 5). 68 CD1a samples lipid antigens in the early recycling endosomes and CD1b samples the late endocytic compartment, whereas Cd1c samples the entire endosomal system in antigen-presenting cells. 52 CD1d samples the endosomal system of all cells and thereby is crucial for early surveillance by NKT cells. Thus, a decrease in the cell surface expression of CD1 molecules by blocking their synthesis, export to the cell surface or by modifying their endosomal trafficking will modulate their sampling activity and activation of NKT cells ( Figure 5). Additionally, for those herpesviruses with tropism to immune effector cells, it is of interest either to reduce the overall expression or to perturb the endosomal trafficking of immune recognition molecules (i.e., TCR/CD3, CD4 molecule, costimulatory molecules, adhesion molecules) and thereby, reduce their cell surface expression. The spectrum of virus evasion targets by remodeling of endocytic trafficking is also confined by the cell tropism. Murine CMVs (MCMV) remodels endosomal maturation in the early phase of infection, relocating cell surface MHC I into an endosomal retention compartment MCMV encodes several immunoevasion proteins (immunoevasins) that associate with nascent MHC I molecules in the ER and cooperatively prevent supply to the cell surface of functional MHC I proteins ( Figure 5). Protein m152 retains these proteins in the ER-ERGIC route. Protein m04 forms complexes with MHC I and escorts it to the cell surface, 71,72 whereas protein m06 redirects it into lysosomes for degradation. 71,73 The net result of this cooperative activity is the loss of MCMV peptide-loaded MHC I proteins from the cell surface (downregulation of MHC I after prolonged activity of immunoevasins) and thus, the prevention of presentation to CTL. 71,74 Experiments with mutant viruses containing a deletion suggest that no other immunoevasins in the MCMV genome are required for MHC I downregulation. 74 However, in MCMV-infected fibroblasts, almost all of the MHC I proteins are rapidly cleared from the cell surface at 5-7 h after infection 75 (Figure 6). This loss occurs much earlier than expected due to the constitutive uptake of cell surface resident MHC I proteins under inhibited supply conditions by the cooperative activity of MCMV immunoevasins. Namely, the half-life of cell surface resident MHC I proteins is longer than 10 h under conditions of prevented egress (Figure 6), and constitutive Figure 5 Major effector functions in the immune response to herpesviruses and immunoevasins of cytomegaloviruses that act either in the secretory or the endosomal pathway. The secretory pathway route is illustrated in orange and the endosomal pathway route in blue. Known immunoevasins that act in the secretory pathway and the endosomal pathway are listed in the boxes. Not known, indicates that there is evidence for CMV activity, but the viral gene product is not known. Not determined, indicates that there is no evidence for CMV activity. CMV, cytomegalovirus. internalization occurs at a rate of 4%-10% per hour. 48,49,76 Thus, in the absence of additional MHC I immunoevasins, the rapid removal of MHC I from the cell surface in the early phase of MCMV infection can be explained by perturbation of the endosomal route. We have recently shown that MCMV perturbs endosomal trafficking very early during the infection by acting on distal parts of the early endosomal route and generating the early phase retention compartment. 75,77 This compartment has the characteristics of sorting endosomes at the terminal stage of their maturation. It contains markers of early endosomes (EEA1 and Rab5) but not markers of late endosomes (i.e., LBPA, GM1). It also retains incoming cargo molecules that travel through both the recycling (i.e., TfR, MHC I) and endolysosomal (EGFR, Lamp1) routes. 75 Clathrin-dependent cargo protein (TfR), which is known to be exhaustively recycled after endocytosis, is rapidly displaced from the cell surface of MCMV-infected cells as in uninfected cells (Figure 7a, middle) and accumulates in the perinuclear area (Figure 7a, right), from which it cannot leave (Figure 7a, middle) due to recycling inhibition (Figure 7a, left). 75 Clathrin-independent cargo proteins (MHC I) are constitutively internalized in MCMVinfected fibroblasts at a higher rate than in uninfected cells (Figure 7b, middle) and accumulate in the perinuclear retention compartment (Figure 7b, right) together with internalized TfR. 75 Their internalization rate is much higher in MCMVinfected fibroblasts (Figure 7b, left) due to the decreased recycling rate, 75 suggesting that MCMV infection inhibits recycling from juxtanuclear endosomes. Furthermore, our recent analysis of the CD44 route in MCMV-infected cells (Figure 7c, left) suggests that MCMV infection also perturbs proximal steps in endosomal recycling. The internalization rate of CD44 also increases in MCMV-infected cells (Figure 7c, middle), and a significant fraction of CD44 is displaced in EEA1 1 perinuclear endosomes as soon as 4 hrs post-infection (Figure 7c, right). Thus, it seems that MCMV infection extensively perturbs early endosomal trafficking during the early phase of infection, including the formation of recycling endosomal carriers and maturation of early endosomes into late endosomes, which results in the development of the perinuclear retention compartment. This early endosomal retention is associated with a reduction of the intracellular content of Rab11 and Rab7, 75 small GTPases that are essential for the formation of the recycling and endolysosomal domains of early endosomes, respectively. 34,35 The levels of cell surface proteins, such as MHC I molecules, depend on the recycling efficiency, 48,49 and inhibition of recycling may result in rapid cell surface loss and thereby, indirectly enable evasion of immune recognition by effector T cells. In addition to MHC I, remodeling of endosomal trafficking during the early phase of MCMV infection can contribute to other immunoevasion activities of MCMV, especially the downmodulation of NKG2D ligands. Three of them (RAE-1e, MULT-1 and H60) are downregulated from the cell surface via a mechanism that involves the inhibition of their endosomal recycling. 4,78 Thus, additional studies on the endosomal trafficking routes of other molecules that participate in immune recognition during MCMV infection are required, including NKG2D ligands, to better understand the physiology of MCMV immunoevasion. Human cytomegalovirus (HCMV) extensively remodels the endosomal system Remodeling of the endosomal system in HCMV-infected cells is associated with the development of the cytoplasmic 'assembly compartment'. 80,81 This compartment is a complex juxtanuclear structure that develops by reorganization of cellular organelles at sites of viral tegument, envelope and nonstructural protein accumulation to create an environment for the final tegumentation, envelopment and preparation for shedding of infectious virions. Recent data indicate that the assembly complex develops by dramatic rearrangement of the secretory and endocytic organelles in a way that endosomal membranes and TGN-derived vesicles are recruited to the cell center and represent the 'virus factory', while the Golgi and lysosomes are excluded and surround the site of assembly. 83,84,87,88 In addition to viral tegument proteins 85,86 and envelope glycoproteins, this compartment also accumulates TGN markers (i.e., TGN46), 80,81,83,84,87 redistributed early endosomal markers (i.e., EEA1, annexin I), 84,87 and cargo molecules that travel via the early endosomal route (i.e., M6PR, HRS) 87 and the recycling route (i.e., TfR,). 87 It does not contain lysosomal markers (i.e., Lamp1), 87 but contains CD63 82,83,87,88 and marker of MVBs, which also suggests the recruitment of MVB membranes to the site of virion assembly. In cell culture, the assembly complex develops slowly over 3-4 days of remodeling before the first virions are released. 81,83,84,86 The remodeling is a stepwise recruitment and expansion of existing vesicular membranes and related regulatory components, which is associated with the perturbation of trafficking routes, both in the secretory and endosomal pathways. The mechanism(s) of membranous organelle remodeling remains poorly understood. It involves extensive rearrangements of the cytoskeleton and modulation of the expression of regulatory and effector proteins that shape the endosomal and vesicular system. It has been shown at later times postinfection that HCMV upmodulates 81 genes and downmodulates 132 cellular genes that affect functions involved in vesicular trafficking. 89 In response to infection, transcription of the arf1 and arf6 genes and 13 members of the rab family genes (rab1a, -1b, -2a, -3a, -6a, -7, -13, -18, -21, -23, -31, -34 and -40b) is downmodulated; in contrast, seven rab family genes (ray/rab1C and rab2L, -8, -20, -27a, -32 and -38) were upmodulated. 89 Thus, a proper understanding of the biogenesis of the endosomal system will help reconstruct the events that lead to remodeling of the endosomal and secretory system during HCMV infection. It is still being debated whether HCMV infection expands existing compartments or generates a novel hybrid compartment with both endosomal and TGN properties. Recent data suggest that HCMV may expand transport vesicles between endosomes, TGN 87 and late endosomalderived MVBs. 80,83,90 Consistent with these findings, it was shown in HCMV-infected cells that there a threefold increase in the expression of Rab27a, 91 a small GTPase that regulates secretion via late endosome-derived lysosomal-related organelles. 29 The association of Rab27a with the assembly complex suggests that HCMV exploits the machinery of endolysosomal secretion for its assembly. Upregulation of Rab27a is also associated with heterotypic fusion of Rab11 1 membranes (early endosomal membranes of the recycling route) with Rab27b 1 multivesicular bodies (late endosomal subset that generate secretory endosomal organelles). 29,31,91 The process can be initiated by viral glycoproteins that recruit endosomal effector proteins, i.e., HCMV gM forms a dimer with gN and interacts with the Rab11 effector protein FIP4 (family of interacting protein 4) to form an intracellular ternary complex in the juxtanuclear recycling compartment. 92 In addition, it has been shown recently that HCMV encodes multiple microRNAs (miRNAs US5-1, US5-2 and UL112-1) to target various components that shape the vesicular pathway (i.e., Rab5c, Rab11a and Cdc42) and thereby, coordinately reorganize secretory pathway and perhaps endosomal organelles. 93 Present data restrict the effect of HCMV on MHC I expression to the earliest stages of MHC I assembly and trafficking in the secretory pathway HCMV encodes multiple genes to evade MHC I antigen presentation and immune recognition by CD8 1 cytotoxic T lymphocytes ( Figure 5). Similarly to MCMV, HCMV infection eliminates cell surface MHC I expression by preventing the supply to the cell surface of newly formed peptide-loaded MHC I proteins by affecting several steps in MHC I biogenesis and transport (Figure 8). The product of the HCMV US6 gene attacks the TAP (transporter associated with antigen presentation) complex and blocks peptide loading onto MHC I molecules in the ER, 94 while products of the US3 and US11 genes dislocate newly synthesized MHC I heavy chains from the ER into the cytosol for degradation. 95,96 MHC I proteins that successfully assemble and escape destruction are captured by the US3 gene product and retained in the ER. 97,98 The cooperative activity of HCMV immunoevasins would result in a gradual loss of MHC I from the cell surface with kinetics that correspond to their constitutive internalization rate (5%-10% per hour 49 ). These kinetics occur in cultured fibroblasts in which HCMV replication is slow. 99 Although there is no evidence that perturbation of the endosomal route contributes to the clearance of MHC I proteins from the cell surface, HCMV appears to perturb the same endosomal routes of other cellular proteins as MCMV. Consistent with these findings, recent data indicate that HCMV inhibits TfR recycling 86 and rapidly downregulates EGFR expression. 100 In conclusion, in cells in which the replication cycle of HCMV is slow, the effect of HCMV immediate early gene products on MHC I in the secretory pathway is sufficient to ensure MHC I eradication from the cell surface. However, in cells with a much faster replication cycle, endosomal remodeling should contribute significantly as an immunoevasion mechanism. This phenomenon has been shown for murine 75 and rat CMV infection, 101,102 but should also be considered for HCMV infection in vivo. The reputation of HCMV as a slowly replicating virus is based on the development of a cytopathic effect in cell culture. However, studies in vivo suggest that the replication of HCMV in vivo is highly dynamic, especially in immunocompromised patients. 103 HCMV inhibits late endosomal recycling and prevents egress of peptide-loaded MHC II proteins from the peptide-loading compartment during productive and latent infection In addition to MHC I trafficking, HCMV has evolved mechanism(s) that alter MHC II expression. These mechanisms are based on remodeling of their endosomal route and do not relate to known mechanisms that downregulate MHC I in the secretory pathway. HCMV infection reduces cell surface expression of MHC II in dendritic cells, 104,105 monocytes/macrophages 106,107 and professional antigen presenting cells (mature Langerhans cells). 108 These cells are major targets for HCMV infection, latency and reactivation. The mechanism of MHC II cell surface down-regulation was successfully characterized in transfected astrocytoma cells that constitutively express MHC II. 109 In HCMV-infected astrocytoma cells 109 and HCMV-infected mature Langerhans cells, 108 the early stages of endosomal transport (including recycling), entry into a peptide-loading compartment (MHC II) and assembly and peptide loading of MHC II are unaltered, but the latest stages of their transport are blocked. Peptide-loaded MHC II is retained in the perinuclear area and sequestered in an enlarged peptide-loading compartment with defective trafficking of MHC II-loaded vesicles toward the periphery. 108,109 In addition to MHC II, HCMV is also sequestered in the same location as the costimulatory molecules CD80, CD83 and CD86, 108, suggesting that HCMV attacks the late endosomal recycling route. All of these effects are not induced by the MHC I immunoevasins that localize in US1-US11 region. 109 In addition to endosomal perturbation, the immunoevasion potential of HCMV is further extended to cytoskeletal remodeling. In HCMV-infected mature Langerhans cells, the loss of peptide-loaded MHC II from the cell surface is associated with the loss of cytoskeletal extensions that provide support for dendrites of Langerhans cells, 108 which reduces their ability to cluster with T cells and decreases their capacity to stimulate T-cell proliferation. 113,114 Immunoevasion by endosomal perturbation is even more attractive in latently infected cells in which the expression of HCMV genes is restricted to CMV latency-associated transcripts, which are encoded by the immediate early (ie1/ie2) region of the viral genome. 115 These transcripts are expressed in natural and experimental latent infection. In experimental latent infection of granulocyte-macrophage progenitor cells in culture that do not express productive viral replication gene products, the cell surface level of MHC II is markedly reduced, synthesis and processing occur normally, and MHC II proteins together with HLA-DM are redistributed and retained within punctate cytoplasmic vesicles. 116 This reduction of cell surface MHC II is independent of all known immunomodulatory functions (i.e., in the US2-US11 region mutant, MHC II is downregulated and is not expressed during latent infection). 116 Thus, it appears that HCMV also perturbs the endosomal trafficking of MHC II during latent infection. The mechanism of perturbation is unclear. However, the observation that 50% of latently infected cells down-regulate MHC II and only 2%-3% contain of them contain latency associated transcripts suggests that that down-regulatioion information may be distributed in cell culture, perhaps by miRNA. HCMV evades NK cell-mediated lysis by a variety of different mechanisms that are not associated with endosomal perturbation HCMV has evolved a variety of different mechanisms to evade NK cell activation 66 that are based either on the expression of molecules that engage inhibitory NK receptors or on the downmodulation of ligands that engage activating NK receptors ( Figure 5). Surface expression of HLA-E enabled by HCMV UL40, virus-encoded MHC I homologue UL18, tegument protein pp65, and glycoprotein UL141 are examples of HCMV-encoded functions that engage inhibitory receptors. 66 HCMV also downregulates ligands that activate NKG2D (MICs, ULBPs, RAET1s), 117 either by downregulating their transcription by virus-encoded microRNAs (MICB by miRUL112) 118 or by retaining them in the ER/cis-Golgi (MICB, ULBP1, ULBP2 and ULBP6 by UL16) 119 or in the Golgi (MICA and ULBP3 by UL142). 120 Given that HCMV-infected cells are extremely resistant to NK cell lysis, it can be anticipated that the number of HCMV genes possessing NK cell-activating ligands, including HCMVmodulated cellular functions, will increase with further research. For example, two additional HCMV genes, US18 and US20, have been recently identified to promote downregulation NK cell-activating ligands by lysosomal degradation 121 ( Figure 5). This observation is the only association, to our knowledge, of a NK immunosubversive function associated with endocytic trafficking. A further understanding of a HCMV immunosubversion mechanism via down-modulation of NK cell-activating ligands, or at least MICs, will require answering the question of how HCMV deals with sequence polymorphisms of MICs (80 alleles of MICA and 33 alleles of MICB). A mechanism based on modulation of the endosomal route has been proposed recently by Agera-Gonzlez et al. 122 The short-term residence of MCIB at the cell surface of the HCMV-infected cell may result in its redistribution into a compartment that shares features with late endosomes/lysosomes, but is functionally and morphologically distinct. 122 Thus, remodeling of endocytic trafficking in concert with known activities of immunoevasins in the secretory pathway should be considered. IMMUNE EVASION POTENTIAL OF ENDOSOMAL PERTURBATION DURING INFECTION WITH OTHER HERPESVIRUSES Other herpesviruses also have evolved a variety of mechanisms to disrupt the cell surface display of immune recognition molecules. In addition to early identified effects on their biogenesis, substantial evidence indicates that herpesviruses also target endosomal trafficking. The sites of immunoevasion activities of human herpesviruses are indicated in Figure 8. Several herpesviruses modulate the earliest steps of MHC I biogenesis and trafficking in the secretory pathway. Herpes simplex virus 1 and 2 (HSV-1 and HSV-2), members of the alpha-herpesvirus subfamily, encode the ICP47 protein that inhibits peptide loading of MHC I proteins in the ER and thereby prevent the export of MHC I to the cell surface. 123,124 Similar tools also evolved in the Epstein-Barr virus (EBV), Kaposi's sarcoma-associated virus and murine herpesvirus 68, which are members of the gamma-herpesvirus subfamily. These viruses encode proteins (EBNA1 of EBV, 125 LANA1 of KSV 126 and ORF73 of murine herpesvirus 68 127 ) that suppress peptide loading of MHC I and prevent the exit of MHC I proteins from the ER. Varicella-zoster virus, another member of the alpha-herpesvirus subfamily, acts a bit later in the secretory route of MHC I. It encodes an Us3 homolog that arrests MHC I in the cis/medial-Golgi and retains it in the perinuclear area. 128 The next step in MHC I trafficking along the secretory pathway chosen by herpesviruses is their rerouting in the trans-Golgi towards rearranged late endosomal compartments. In addition to murine CMV, human herpesvirus 6 (HHV-6) and HHV-7, beta-herpesviruses, which are closely related to CMV that infects CD4 T lymphocytes, encode the U21 gene. The product of U21 associates with properly folded peptideloaded classical and non-classical MHC I proteins in the ER and reroutes them from the Golgi into the endolysosomal compartment, thereby effectively removing them from the cell surface. The U21 protein also binds to NK cell-activating ligands (ULBP1, MICA and MICB ligands for NKG2D), 131 but it does not bind to the NKT ligand CD1d. 130 U21-expressing cells sequester MHC I and ULBP1 in a perinuclear location in late endosomes and facilitate their rapid degradation. 130,131 Unlike MCMV m06, U21 does not have a di-leucine motif to reroute trafficking towards late endosomes, which suggests that U21 uses an unidentified cellular protein(s) that contains lysosomal targeting information in its cytoplasmic tail and binds to the luminal domain of MHC I and NKG2D ligands. 130 In addition to the rerouting activity of U21 in the Golgi, HHV-6 and HHV-7 encode protein U24, which functions in the endosomal route. The activity of U24 does not affect MHC I trafficking but inhibits constitutive recycling of the T-cell receptor complex (TCR-CD3) in infected CD4 T lymphocytes and retains them in Rab4 1 and Rab5 1 early endosomes. 132 Given that U24 also inhibits the recycling of TfR through the PPXY motif near the amino terminus; it appears that U24mediated downregulation of TCR-CD3 results from a general block in the recycling route used by TCR-CD3 and TfR, but not in the recycling route used by MHC I. 132 Disruption of endosomal recycling or rerouting in early endosomes and exclusion from the recycling route is a preferable target not only for beta-herpesviruses but also for other herpesviruses. Endosomal recycling is a key cellular mechanism to control the number of molecules at the cell surface. In the case of antigen-presenting molecules, recycling is a crucial step, especially for cross-presentation. Perturbation of the recycling route of antigen-presenting and immune recognition molecules, either directly or indirectly, is therefore a logical target for herpesviruses ( Figure 8). Studies of HSV-1-infected antigen-presenting cells have demonstrated that HSV-1 disrupts the endosomal recycling machinery, which strongly reduces the cell surface expression of CD1b and CD1d molecules. 133,134 Constitutively internalized CD1d molecules are redirected from the recycling route and accumulate intracellularly with a late endosome phenotype where they colocalize with viral proteins. 133,134 Thus, although there is no experimental evidence that the same mechanism affects MHC I trafficking in HSV-infected cells, there is a strong indication that the endosomal route of MHC I is affected in HSV-1-infected cells. It has been shown that HSV-1 Us3 kinase activity is required for efficient cell surface downregulation of MHC I proteins in HSV-1-infected cells. 135 Us3 does not phosphorylate MHC I and cannot downregulate MHC I expression when over-expressed alone, which suggests that it downregulates cell surface MHC I indirectly. 135 Other members of the alpha-herpesvirus subfamily, equine herpesviruses (EHV-1 and EHV-4) 136,137 and bovine herpesvirus 1, 138 rapidly downregulate cell surface MHC I very early in infection by a mechanism that involves enhanced internalization, perhaps disrupting their recycling routes. Downregulation of cell surface MHC I in EHV-1-and EHV-4-infected cells is observed as early as four hours postinfection and is associated with the expression of pUL56, a product of ORF1; however, the mechanism is poorly characterized. 137 The endosomal rerouting of cellular proteins that participate in immune recognition appears to be a dominant immune evasion strategy of gamma-herpesviruses. Kaposi's sarcomaassociated virus encodes ubiquitin ligases (kK3 and kK5, known as MIR1 and MIR2, respectively) that interact with transmembrane domains of cell surface MHC I proteins to catalyze their polyubiquitination and orchestrate their rapid removal from the cell surface. 139,140 Polyubiquitination redirects constitutive endocytic uptake of MHC I proteins into the clathrin-dependent pathway, which accelerates their endocytic uptake, 141 and excludes internalized MHC I proteins from the endosomal recycling routes. In early endosomes, ubiquitinylated MHC I proteins are sorted into endolysosomal domain, rerouted into late endosomes and from there, via the late endosomal sorting protein TSG-101, delivered into the lysosomal compartment for degradation. 142 It has been shown that kK5 has a remarkable ability to target and downregulate not only MHC I but also many immunoreceptors, including ICAM-1, 143 CD86, 143 CD1d, 144 MICA/B, 145 AICL, 145 PECAM, 146 ALCAM 147 and IFN receptors, 148 and thereby, effectively prevent recognition by cells of the adaptive (MHC I and CD1d restricted NKT cells) and the innate (NKG2D-and NKp80-restricted NK cells) immune response. In addition to polyubiquitin-mediated endosomal rerouting to lysosomal degradation (i.e., MHC I 139 and AICL 145 ), some immunoreceptors are downregulated by perturbation of the endosomal system. For example, Cd1d 144 and NKG2D ligand MICA 145 are not degraded, but redistributed and retained in an enlarged intracellular compartment that lacks clathrin, EEA1, Vps-26, Lamp1 and TGN-46. 145 EBV encodes a protein, BILF1, which associates with MHC I at the cell surface and targets it for lysosomal degradation. 149 In contrast to Kaposi's sarcoma-associated virus kK5, BILF1 does not mediate MHC I downregulation by polyubiquitinenhanced endocytosis and does not reroute them towards lysosomes. 150 It seems that BILF1 cooperates with other EBV genes that generally perturb endosomal routes to reduce cell surface MHC I. 150 This perturbation is associated with dislocation and intracellular retention of MHC I together with the costimulatory molecules CD80 (B7-1), CD83 and CD86 (B7-2) but not MHC II. 151 CONCLUSIONS Remodeling of the endosomal system is a hallmark of infection with herpesviruses, especially with CMVs. This remodeling is evident during the latest stages of CMV infection. In HCMVinfected cells, at least a part of the remodeling is associated with the development of the assembly compartment; however, very little is known about perturbations in earlier stages of infection. These perturbations might be associated with several important but still unresolved issues in CMV biology, such as cell tropism, productive infection and latency. A better understanding of the physiology of endosomal organelles and intracellular pathways will facilitate our knowledge of endosomal remodeling during CMV infection. Thus, it is important to determine the physiological route of many intracellular proteins to understand the physiology of the infected cell. The same principles would apply to cellular proteins that contribute to immune recognition. The primary target for CMVs will be modulation of antigen presentation in the endosomal system, either by retrieval of MHC I loaded with viral peptides into endosomal compartments or redirection of MHC I trafficking and disruption of endosomal peptide loading. Thus, it is not surprising that CMVs target endosomal recycling because this recycling is essential for the maintenance of MHC I at the cell surface and for the mechanism of exogenous peptide loading. Still, the peptide-loading endosomal compartment has not been discovered, and the physiological role of MHC I proteins lacking peptide remains unknown. Hopefully, research on MHC I trafficking and exogenous MHC I peptide loading in infected cells will provide additional insight into the physiology of exogenous antigen presentation and immune recognition of infected cells. Over the last decade, endocytosis research has revealed enormous complexity of the endosomal system and its functions. The complex molecular network that shapes the endosomal system ensures a high degree of plasticity, which makes interpretation of endosomal functions enormously complex, especially considering that many conclusions are based on long-term remodeling by siRNA, dominant-negative mutants or over-expression of individual molecular players. Thus, the physiological hierarchy of the molecular mechanisms has been difficult to establish. Remodeling by viruses, which is usually a rather fast process, may help to establish the patterns of molecular activities that shape physiological pathways in the endosomal system. |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-25 14:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bot', '0005_botmessage'),
]
operations = [
migrations.CreateModel(
name='Advertisement',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.TextField(default='', verbose_name='text')),
],
),
migrations.AddField(
model_name='telegramuser',
name='is_VIP',
field=models.BooleanField(default=False, verbose_name='is_VIP'),
),
migrations.AlterField(
model_name='botmessage',
name='text',
field=models.TextField(default='', verbose_name='text'),
),
]
|
/**
* @file synchronizeBlock.cc
* @author <NAME>
* @copyright (C) 2016 ACK CYFRONET AGH
* @copyright This software is released under the MIT license cited in
* 'LICENSE.txt'
*/
#include "synchronizeBlock.h"
#include "messages.pb.h"
#include <sstream>
namespace one {
namespace messages {
namespace fuse {
SynchronizeBlock::SynchronizeBlock(std::string uuid,
boost::icl::discrete_interval<off_t> block, int priority, bool prefetch)
: FileRequest{std::move(uuid)}
, m_block{block}
, m_priority{priority}
, m_prefetch{prefetch}
{
}
std::string SynchronizeBlock::toString() const
{
std::stringstream stream;
stream << "type: 'SynchronizeBlock', uuid: " << m_contextGuid
<< ", block: " << m_block << ", priority: " << m_priority
<< ", prefetch: " << m_prefetch;
return stream.str();
}
std::unique_ptr<ProtocolClientMessage> SynchronizeBlock::serializeAndDestroy()
{
auto msg = FileRequest::serializeAndDestroy();
auto *sb = msg->mutable_fuse_request()
->mutable_file_request()
->mutable_synchronize_block();
sb->set_prefetch(m_prefetch);
sb->set_priority(m_priority);
sb->mutable_block()->set_offset(boost::icl::first(m_block));
sb->mutable_block()->set_size(boost::icl::size(m_block));
return msg;
}
} // namespace fuse
} // namespace messages
} // namespace one
|
Isocitrate dehydrogenase kinase/phosphatase: aceK alleles that express kinase but not phosphatase activity For Escherichia coli, growth on acetate requires the induction of the enzymes of the glyoxylate bypass, isocitrate lyase and malate synthase. The branch point between the glyoxylate bypass and the Krebs cycle is controlled by phosphorylation of isocitrate dehydrogenase (IDH), inhibiting that enzyme's activity and thus forcing isocitrate through the bypass. This phosphorylation cycle is catalyzed by a bifunctional enzyme, IDH kinase/phosphatase, which is encoded by aceK. We have employed random mutagenesis to isolate novel alleles of aceK. These alleles were detected by the loss of ability to complement an aceK null mutation. The products of one class of these alleles retain IDH kinase activity but have suffered reductions in IDH phosphatase activity by factors of 200 to 400. Selective loss of the phosphatase activity also appears to have occurred in vivo, since cells expressing these alleles exhibit phenotypes which are reminiscent of strains lacking IDH; these strains are auxotrophic for glutamate. Assays of cell-free extracts confirmed that this phenotype resulted from nearly quantitative phosphorylation of IDH. The availability of these novel alleles of aceK allowed us to assess the significance of the precise control which is a characteristic of the IDH phosphorylation cycle in vivo. The fractional phosphorylation of IDH was varied by controlled expression of one of the mutant alleles, aceK3, in a wild-type strain. Reduction of IDH activity to 50% of the wild-type level did not adversely affect growth on acetate. However, further reductions inhibited growth, and growth arrest occurred when the IDH activity fell to 15% of the wild-type level. Thus, although wild-type cells maintain a precise effective IDH activity during growth on acetate, this precision is not critical. |
//===--- TypeInfo.h - Abstract primitive operations on values ---*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file defines the interface used to perform primitive
// operations on swift values and objects.
//
// This interface is supplemented in two ways:
// - FixedTypeInfo provides a number of operations meaningful only
// for types with a fixed-size representation
// - ReferenceTypeInfo is a further refinement of FixedTypeInfo
// which provides operations meaningful only for types with
// reference semantics
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_IRGEN_TYPEINFO_H
#define SWIFT_IRGEN_TYPEINFO_H
#include "IRGen.h"
#include "llvm/ADT/MapVector.h"
namespace llvm {
class Constant;
class Twine;
class Type;
}
namespace swift {
enum IsInitialization_t : bool;
enum IsTake_t : bool;
class SILType;
namespace irgen {
class Address;
class StackAddress;
class IRGenFunction;
class IRGenTypeVerifierFunction;
class IRGenModule;
class Explosion;
class ExplosionSchema;
class NativeConventionSchema;
enum OnHeap_t : unsigned char;
class OutliningMetadataCollector;
class OwnedAddress;
class RValue;
class RValueSchema;
/// Ways in which an object can fit into a fixed-size buffer.
enum class FixedPacking {
/// It fits at offset zero.
OffsetZero,
/// It doesn't fit and needs to be side-allocated.
Allocate,
/// It needs to be checked dynamically.
Dynamic
};
/// Information about the IR representation and generation of the
/// given type.
class TypeInfo {
TypeInfo(const TypeInfo &) = delete;
TypeInfo &operator=(const TypeInfo &) = delete;
friend class TypeConverter;
mutable const TypeInfo *NextConverted;
protected:
enum SpecialTypeInfoKind {
STIK_Unimplemented,
STIK_None,
/// Everything after this is statically fixed-size.
STIK_Fixed,
STIK_Weak,
/// Everything after this is loadable.
STIK_Loadable,
STIK_Reference,
};
TypeInfo(llvm::Type *Type, Alignment A, IsPOD_t pod,
IsBitwiseTakable_t bitwiseTakable,
IsFixedSize_t alwaysFixedSize,
SpecialTypeInfoKind stik)
: NextConverted(0), StorageType(Type), nativeReturnSchema(nullptr),
nativeParameterSchema(nullptr), StorageAlignment(A),
POD(pod), BitwiseTakable(bitwiseTakable),
AlwaysFixedSize(alwaysFixedSize), STIK(stik),
SubclassKind(InvalidSubclassKind) {
assert(STIK >= STIK_Fixed || !AlwaysFixedSize);
}
/// Change the minimum alignment of a stored value of this type.
void setStorageAlignment(Alignment alignment) {
StorageAlignment = alignment;
}
public:
virtual ~TypeInfo();
/// Unsafely cast this to the given subtype.
template <class T> const T &as() const {
// FIXME: maybe do an assert somehow if we have RTTI enabled.
return static_cast<const T &>(*this);
}
private:
/// The LLVM representation of a stored value of this type. For
/// non-fixed types, this is really useful only for forming pointers to it.
llvm::Type *StorageType;
mutable NativeConventionSchema *nativeReturnSchema;
mutable NativeConventionSchema *nativeParameterSchema;
/// The storage alignment of this type in bytes. This is never zero
/// for a completely-converted type.
Alignment StorageAlignment;
/// Whether this type is known to be POD.
unsigned POD : 1;
/// Whether this type is known to be bitwise-takable.
unsigned BitwiseTakable : 1;
/// Whether this type can be assumed to have a fixed size from all
/// resilience domains.
unsigned AlwaysFixedSize : 1;
/// The kind of supplemental API this type has, if any.
unsigned STIK : 3;
/// An arbitrary discriminator for the subclass. This is useful for
/// e.g. distinguishing between different TypeInfos that all
/// implement the same kind of type.
unsigned SubclassKind : 3;
enum { InvalidSubclassKind = 0x7 };
protected:
void setSubclassKind(unsigned kind) {
assert(kind != InvalidSubclassKind);
SubclassKind = kind;
assert(SubclassKind == kind && "kind was truncated?");
}
public:
/// Whether this type info has been completely converted.
bool isComplete() const { return !StorageAlignment.isZero(); }
/// Whether this type is known to be empty.
bool isKnownEmpty(ResilienceExpansion expansion) const;
/// Whether this type is known to be POD, i.e. to not require any
/// particular action on copy or destroy.
IsPOD_t isPOD(ResilienceExpansion expansion) const { return IsPOD_t(POD); }
/// Whether this type is known to be bitwise-takable, i.e. "initializeWithTake"
/// is equivalent to a memcpy.
IsBitwiseTakable_t isBitwiseTakable(ResilienceExpansion expansion) const {
return IsBitwiseTakable_t(BitwiseTakable);
}
/// Returns the type of special interface followed by this TypeInfo.
/// It is important for our design that this depends only on
/// immediate type structure and not on, say, properties that can
/// vary by resilience. Of course, generics can obscure these
/// properties on their parameter types, but then the program
/// can rely on them.
SpecialTypeInfoKind getSpecialTypeInfoKind() const {
return SpecialTypeInfoKind(STIK);
}
/// Returns whatever arbitrary data has been stash in the subclass
/// kind field. This mechanism allows an orthogonal dimension of
/// distinguishing between TypeInfos, which is useful when multiple
/// TypeInfo subclasses are used to implement the same kind of type.
unsigned getSubclassKind() const {
assert(SubclassKind != InvalidSubclassKind &&
"subclass kind has not been initialized!");
return SubclassKind;
}
/// Whether this type is known to be fixed-size in the local
/// resilience domain. If true, this TypeInfo can be cast to
/// FixedTypeInfo.
IsFixedSize_t isFixedSize() const {
return IsFixedSize_t(STIK >= STIK_Fixed);
}
/// Whether this type is known to be fixed-size in the given
/// resilience domain. If true, spare bits can be used.
IsFixedSize_t isFixedSize(ResilienceExpansion expansion) const {
switch (expansion) {
case ResilienceExpansion::Maximal:
return isFixedSize();
case ResilienceExpansion::Minimal:
// We can't be universally fixed size if we're not locally
// fixed size.
assert((isFixedSize() || AlwaysFixedSize == IsNotFixedSize) &&
"IsFixedSize vs IsAlwaysFixedSize mismatch");
return IsFixedSize_t(AlwaysFixedSize);
}
llvm_unreachable("Not a valid ResilienceExpansion.");
}
/// Whether this type is known to be loadable in the local
/// resilience domain. If true, this TypeInfo can be cast to
/// LoadableTypeInfo.
IsLoadable_t isLoadable() const {
return IsLoadable_t(STIK >= STIK_Loadable);
}
llvm::Type *getStorageType() const { return StorageType; }
Alignment getBestKnownAlignment() const {
return StorageAlignment;
}
/// Given a generic pointer to this type, produce an Address for it.
Address getAddressForPointer(llvm::Value *ptr) const;
/// Produce an undefined pointer to an object of this type.
Address getUndefAddress() const;
/// Return the size and alignment of this type.
virtual llvm::Value *getSize(IRGenFunction &IGF, SILType T) const = 0;
virtual llvm::Value *getAlignmentMask(IRGenFunction &IGF, SILType T) const = 0;
virtual llvm::Value *getStride(IRGenFunction &IGF, SILType T) const = 0;
virtual llvm::Value *getIsPOD(IRGenFunction &IGF, SILType T) const = 0;
virtual llvm::Value *isDynamicallyPackedInline(IRGenFunction &IGF,
SILType T) const = 0;
/// Return the statically-known size of this type, or null if it is
/// not known.
virtual llvm::Constant *getStaticSize(IRGenModule &IGM) const = 0;
/// Return the statically-known alignment mask for this type, or
/// null if it is not known.
virtual llvm::Constant *getStaticAlignmentMask(IRGenModule &IGM) const = 0;
/// Return the statically-known stride size of this type, or null if
/// it is not known.
virtual llvm::Constant *getStaticStride(IRGenModule &IGM) const = 0;
/// Add the information for exploding values of this type to the
/// given schema.
virtual void getSchema(ExplosionSchema &schema) const = 0;
/// A convenience for getting the schema of a single type.
ExplosionSchema getSchema() const;
/// Allocate a variable of this type on the stack.
virtual StackAddress allocateStack(IRGenFunction &IGF, SILType T,
const llvm::Twine &name) const = 0;
/// Deallocate a variable of this type.
virtual void deallocateStack(IRGenFunction &IGF, StackAddress addr,
SILType T) const = 0;
/// Destroy the value of a variable of this type, then deallocate its
/// memory.
virtual void destroyStack(IRGenFunction &IGF, StackAddress addr, SILType T,
bool isOutlined) const = 0;
/// Copy or take a value out of one address and into another, destroying
/// old value in the destination. Equivalent to either assignWithCopy
/// or assignWithTake depending on the value of isTake.
void assign(IRGenFunction &IGF, Address dest, Address src, IsTake_t isTake,
SILType T, bool isOutlined) const;
/// Copy a value out of an object and into another, destroying the
/// old value in the destination.
virtual void assignWithCopy(IRGenFunction &IGF, Address dest, Address src,
SILType T, bool isOutlined) const = 0;
/// Move a value out of an object and into another, destroying the
/// old value there and leaving the source object in an invalid state.
virtual void assignWithTake(IRGenFunction &IGF, Address dest, Address src,
SILType T, bool isOutlined) const = 0;
/// Copy-initialize or take-initialize an uninitialized object
/// with the value from a different object. Equivalent to either
/// initializeWithCopy or initializeWithTake depending on the value
/// of isTake.
void initialize(IRGenFunction &IGF, Address dest, Address src,
IsTake_t isTake, SILType T, bool isOutlined) const;
/// Perform a "take-initialization" from the given object. A
/// take-initialization is like a C++ move-initialization, except that
/// the old object is actually no longer permitted to be destroyed.
virtual void initializeWithTake(IRGenFunction &IGF, Address destAddr,
Address srcAddr, SILType T,
bool isOutlined) const = 0;
/// Perform a copy-initialization from the given object.
virtual void initializeWithCopy(IRGenFunction &IGF, Address destAddr,
Address srcAddr, SILType T,
bool isOutlined) const = 0;
/// Perform a copy-initialization from the given fixed-size buffer
/// into an uninitialized fixed-size buffer, allocating the buffer if
/// necessary. Returns the address of the value inside the buffer.
///
/// This is equivalent to:
/// auto srcAddress = projectBuffer(IGF, srcBuffer, T);
/// initializeBufferWithCopy(IGF, destBuffer, srcAddress, T);
/// but will be more efficient for dynamic types, since it uses a single
/// value witness call.
virtual Address initializeBufferWithCopyOfBuffer(IRGenFunction &IGF,
Address destBuffer,
Address srcBuffer,
SILType T) const;
/// Perform a take-initialization from the given fixed-size buffer
/// into an uninitialized fixed-size buffer, allocating the buffer if
/// necessary and deallocating the destination buffer. Returns the
/// address of the value inside the destination buffer.
///
/// This is equivalent to:
/// auto srcAddress = projectBuffer(IGF, srcBuffer, T);
/// initializeBufferWithTake(IGF, destBuffer, srcAddress, T);
/// deallocateBuffer(IGF, srcBuffer, T);
/// but may be able to re-use the buffer from the source buffer, and may
/// be more efficient for dynamic types, since it uses a single
/// value witness call.
virtual Address initializeBufferWithTakeOfBuffer(IRGenFunction &IGF,
Address destBuffer,
Address srcBuffer,
SILType T) const;
/// Take-initialize an address from a parameter explosion.
virtual void initializeFromParams(IRGenFunction &IGF, Explosion ¶ms,
Address src, SILType T,
bool isOutlined) const = 0;
/// Destroy an object of this type in memory.
virtual void destroy(IRGenFunction &IGF, Address address, SILType T,
bool isOutlined) const = 0;
/// Should optimizations be enabled which rely on the representation
/// for this type being a single object pointer?
///
/// \return false by default
virtual bool isSingleRetainablePointer(ResilienceExpansion expansion,
ReferenceCounting *refcounting
= nullptr) const;
/// Should optimizations be enabled which rely on the representation
/// for this type being a single Swift-retainable object pointer?
///
/// \return false by default
bool isSingleSwiftRetainablePointer(ResilienceExpansion expansion) const {
ReferenceCounting refcounting;
return (isSingleRetainablePointer(expansion, &refcounting) &&
refcounting == ReferenceCounting::Native);
}
/// Does this type statically have extra inhabitants, or may it dynamically
/// have extra inhabitants based on type arguments?
virtual bool mayHaveExtraInhabitants(IRGenModule &IGM) const = 0;
/// Map an extra inhabitant representation in memory to a unique 31-bit
/// identifier, and map a valid representation of the type to -1.
///
/// Calls to this witness must be dominated by a runtime check that the type
/// has extra inhabitants.
virtual llvm::Value *getExtraInhabitantIndex(IRGenFunction &IGF,
Address src,
SILType T) const = 0;
/// Store the extra inhabitant representation indexed by a 31-bit identifier
/// to memory.
///
/// Calls to this witness must be dominated by a runtime check that the type
/// has extra inhabitants.
virtual void storeExtraInhabitant(IRGenFunction &IGF,
llvm::Value *index,
Address dest,
SILType T) const = 0;
/// Get the tag of a single payload enum with a payload of this type (\p T) e.g
/// Optional<T>.
virtual llvm::Value *getEnumTagSinglePayload(IRGenFunction &IGF,
llvm::Value *numEmptyCases,
Address enumAddr,
SILType T) const = 0;
/// Store the tag of a single payload enum with a payload of this type.
virtual void storeEnumTagSinglePayload(IRGenFunction &IGF,
llvm::Value *whichCase,
llvm::Value *numEmptyCases,
Address enumAddr,
SILType T) const = 0;
/// Compute the packing of values of this type into a fixed-size buffer.
FixedPacking getFixedPacking(IRGenModule &IGM) const;
/// Index into an array of objects of this type.
Address indexArray(IRGenFunction &IGF, Address base, llvm::Value *offset,
SILType T) const;
/// Round up the address value \p base to the alignment of type \p T.
Address roundUpToTypeAlignment(IRGenFunction &IGF, Address base,
SILType T) const;
/// Destroy an array of objects of this type in memory.
virtual void destroyArray(IRGenFunction &IGF, Address base,
llvm::Value *count, SILType T) const;
/// Initialize an array of objects of this type in memory by copying the
/// values from another array. The arrays must not overlap.
virtual void initializeArrayWithCopy(IRGenFunction &IGF,
Address dest,
Address src,
llvm::Value *count, SILType T) const;
/// Initialize an array of objects of this type in memory by taking the
/// values from another array. The array must not overlap.
virtual void initializeArrayWithTakeNoAlias(IRGenFunction &IGF,
Address dest, Address src,
llvm::Value *count, SILType T) const;
/// Initialize an array of objects of this type in memory by taking the
/// values from another array. The destination array may overlap the head of
/// the source array because the elements are taken as if in front-to-back
/// order.
virtual void initializeArrayWithTakeFrontToBack(IRGenFunction &IGF,
Address dest, Address src,
llvm::Value *count, SILType T) const;
/// Initialize an array of objects of this type in memory by taking the
/// values from another array. The destination array may overlap the tail of
/// the source array because the elements are taken as if in back-to-front
/// order.
virtual void initializeArrayWithTakeBackToFront(IRGenFunction &IGF,
Address dest, Address src,
llvm::Value *count, SILType T) const;
/// Assign to an array of objects of this type in memory by copying the
/// values from another array. The array must not overlap.
virtual void assignArrayWithCopyNoAlias(IRGenFunction &IGF, Address dest,
Address src, llvm::Value *count,
SILType T) const;
/// Assign to an array of objects of this type in memory by copying the
/// values from another array. The destination array may overlap the head of
/// the source array because the elements are taken as if in front-to-back
/// order.
virtual void assignArrayWithCopyFrontToBack(IRGenFunction &IGF, Address dest,
Address src, llvm::Value *count,
SILType T) const;
/// Assign to an array of objects of this type in memory by copying the
/// values from another array. The destination array may overlap the tail of
/// the source array because the elements are taken as if in back-to-front
/// order.
virtual void assignArrayWithCopyBackToFront(IRGenFunction &IGF, Address dest,
Address src, llvm::Value *count,
SILType T) const;
/// Assign to an array of objects of this type in memory by taking the
/// values from another array. The array must not overlap.
virtual void assignArrayWithTake(IRGenFunction &IGF, Address dest,
Address src, llvm::Value *count,
SILType T) const;
/// Collect all the metadata necessary in order to perform value
/// operations on this type.
virtual void collectMetadataForOutlining(OutliningMetadataCollector &collector,
SILType T) const;
/// Get the native (abi) convention for a return value of this type.
const NativeConventionSchema &nativeReturnValueSchema(IRGenModule &IGM) const;
/// Get the native (abi) convention for a parameter value of this type.
const NativeConventionSchema &nativeParameterValueSchema(IRGenModule &IGM) const;
/// Emit verifier code that compares compile-time constant knowledge of
/// this kind of type's traits to its runtime manifestation.
virtual void verify(IRGenTypeVerifierFunction &IGF,
llvm::Value *typeMetadata,
SILType T) const;
void callOutlinedCopy(IRGenFunction &IGF, Address dest, Address src,
SILType T, IsInitialization_t isInit,
IsTake_t isTake) const;
void callOutlinedDestroy(IRGenFunction &IGF, Address addr, SILType T) const;
};
} // end namespace irgen
} // end namespace swift
#endif
|
def unfollow(self, followerId: 'int', followeeId: 'int') -> 'None':
self.followees[followerId].discard(followeeId) |
Research and Development of an IP network model based on PBX Asterisk on the Opnet Modeler simulation package This publication is devoted to the research and development of an IP network model is based on IP PBX Asterisk in the Opnet Modeler simulation package. The IP PBX Asterisk software solution is used for voice telephony. The hardware part of the researching network is based on Cisco network equipment. A SIP server configured to transmit multimedia traffic is selected as the server for transmitting information for IP PBX Asterisk. A brief review of sources dedicated to the use of IP PBX Asterisk on the Opnet Modeler software package is conducted. The problems related to the use of separate simulations for different types of traffic and comparing their results with each other to determine the characteristics of network delays, bandwidth between network nodes, and others are relevant (actual). Simulation in such a network is based on the two scenarios. The simulation results in the above scenarios showed that the speed of packets passing through the entire network and memory usage in each of the scenarios remains a constant value. Minimal delays are observed when transmitting Unicast traffic during videoconferencing and even during VoIP traffic. |
/**
* @author Ovidiu Feodorov <[email protected]>
* @since 11/11/16
*/
public class LineBasedContentTest {
// Constants -------------------------------------------------------------------------------------------------------
private static final Logger log = LoggerFactory.getLogger(LineBasedContent.class);
// Static ----------------------------------------------------------------------------------------------------------
// Attributes ------------------------------------------------------------------------------------------------------
// Constructors ----------------------------------------------------------------------------------------------------
// Public ----------------------------------------------------------------------------------------------------------
// empty -----------------------------------------------------------------------------------------------------------
@Test
public void empty() throws Exception {
LineBasedContent c = new LineBasedContent();
assertEquals(0, c.getLineCount());
assertEquals("", c.getText());
}
// read() ----------------------------------------------------------------------------------------------------------
@Test
public void read_edgeCase_CarriageReturnAtTheEndOfARead_1() throws Exception {
LineBasedContent c = new LineBasedContent();
String s = "a\r";
c.setBufferSize(2);
try {
c.read(new ByteArrayInputStream(s.getBytes()));
fail("should have thrown exception");
}
catch(IOException e) {
String msg = e.getMessage();
log.info(msg);
assertEquals("unsupported carriage return combination", msg);
}
}
@Test
public void read_edgeCase_CarriageReturnAtTheEndOfARead_2() throws Exception {
LineBasedContent c = new LineBasedContent();
String s = "a\rb";
c.setBufferSize(2);
try {
c.read(new ByteArrayInputStream(s.getBytes()));
fail("should have thrown exception");
}
catch(IOException e) {
String msg = e.getMessage();
log.info(msg);
assertEquals("unsupported carriage return combination", msg);
}
}
@Test
public void read_edgeCase_CarriageReturnAtTheEndOfARead_3() throws Exception {
LineBasedContent c = new LineBasedContent();
String s = "a\r\n";
c.setBufferSize(2);
c.read(new ByteArrayInputStream(s.getBytes()));
assertEquals(1, c.getLineCount());
Line line = c.get(0);
assertEquals(1, line.getLineNumber());
assertEquals("a", line.getValue());
assertEquals("\r\n", line.getNewLine());
}
@Test
public void read_edgeCase_NewLine() throws Exception {
LineBasedContent c = new LineBasedContent();
String s = "a\n";
c.setBufferSize(2);
c.read(new ByteArrayInputStream(s.getBytes()));
assertEquals(1, c.getLineCount());
Line line = c.get(0);
assertEquals(1, line.getLineNumber());
assertEquals("a", line.getValue());
assertEquals("\n", line.getNewLine());
}
@Test
public void read_edgeCase_NewLine_2() throws Exception {
LineBasedContent c = new LineBasedContent();
String s = "abcdef\n";
c.setBufferSize(4);
c.read(new ByteArrayInputStream(s.getBytes()));
assertEquals(1, c.getLineCount());
Line line = c.get(0);
assertEquals(1, line.getLineNumber());
assertEquals("abcdef", line.getValue());
assertEquals("\n", line.getNewLine());
}
@Test
public void read_edgeCase_NewLine_3() throws Exception {
LineBasedContent c = new LineBasedContent();
String s = "\n";
c.setBufferSize(4);
c.read(new ByteArrayInputStream(s.getBytes()));
assertEquals(1, c.getLineCount());
Line line = c.get(0);
assertEquals(1, line.getLineNumber());
assertEquals("", line.getValue());
assertEquals("\n", line.getNewLine());
}
@Test
public void read_endToEnd() throws Exception {
String s =
"a\n" +
"b\r\n" +
"c";
LineBasedContent c = new LineBasedContent(s);
assertEquals(3, c.getLineCount());
assertFalse(c.isDirty());
Line line;
line = c.get(0);
assertEquals(2, line.getLength());
assertEquals(1, line.getLineNumber());
assertTrue(line.hasNewLine());
assertEquals("\n", line.getNewLine());
assertEquals("a", line.getValue());
line = c.get(1);
assertEquals(3, line.getLength());
assertEquals(2, line.getLineNumber());
assertTrue(line.hasNewLine());
assertEquals("\r\n", line.getNewLine());
assertEquals("b", line.getValue());
line = c.get(2);
assertEquals(1, line.getLength());
assertEquals(3, line.getLineNumber());
assertFalse(line.hasNewLine());
assertNull(line.getNewLine());
assertEquals("c", line.getValue());
assertEquals("a\nb\r\nc", c.getText());
}
@Test
public void readOverwrites() throws Exception {
String s = "a\nb\nc\n";
LineBasedContent c = new LineBasedContent(s);
assertEquals(3, c.getLineCount());
assertEquals(s, c.getText());
String s2 = "x\ny\n";
c.read(new ByteArrayInputStream(s2.getBytes()));
assertEquals(2, c.getLineCount());
assertEquals(s2, c.getText());
}
@Test
public void clear() throws Exception {
LineBasedContent c = new LineBasedContent("a\n");
assertEquals(1, c.getLineCount());
assertFalse(c.isDirty());
c.clear();
assertEquals(0, c.getLineCount());
assertFalse(c.isDirty());
}
// get() -----------------------------------------------------------------------------------------------------------
@Test
public void get_IndexOutOfBounds() throws Exception {
LineBasedContent c = new LineBasedContent("a");
try {
c.get(-1);
fail("should have thrown exception");
}
catch (IndexOutOfBoundsException e) {
log.info(e.getMessage());
}
Line line = c.get(0);
assertNotNull(line);
try {
c.get(1);
fail("should have thrown exception");
}
catch (IndexOutOfBoundsException e) {
log.info(e.getMessage());
}
}
// replace ---------------------------------------------------------------------------------------------------------
@Test
public void replace_NoReplacementMade() throws Exception {
LineBasedContent c = new LineBasedContent(" <something>blah</something>\n");
assertFalse(c.replace(0, 15, 19, "blah"));
assertFalse(c.isDirty());
}
@Test
public void replace_NewContentShorter() throws Exception {
LineBasedContent c = new LineBasedContent(" <something>blah</something>\n");
assertTrue(c.replace(0, 15, 19, "Z"));
assertTrue(c.isDirty());
Line line = c.get(0);
assertTrue(line.isDirty());
assertEquals(" <something>Z</something>", line.getValue());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
c.write(baos);
assertFalse(c.isDirty());
assertFalse(c.get(0).isDirty());
String newValue = new String(baos.toByteArray());
assertEquals(" <something>Z</something>\n", newValue);
}
@Test
public void replace_NewContentLonger() throws Exception {
LineBasedContent c = new LineBasedContent(" <something>blah</something>\n");
assertTrue(c.replace(0, 15, 19, "somethingelse"));
assertTrue(c.isDirty());
assertTrue(c.get(0).isDirty());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
c.write(baos);
assertFalse(c.isDirty());
assertFalse(c.get(0).isDirty());
String newValue = new String(baos.toByteArray());
assertEquals(" <something>somethingelse</something>\n", newValue);
}
// write -----------------------------------------------------------------------------------------------------------
@Test
public void writeNotDirty() throws Exception {
LineBasedContent c = new LineBasedContent("a\nb\nc\n");
assertFalse(c.isDirty());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
c.write(baos);
byte[] content = baos.toByteArray();
assertEquals(6, content.length);
assertEquals('a', content[0]);
assertEquals('\n', content[1]);
assertEquals('b', content[2]);
assertEquals('\n', content[3]);
assertEquals('c', content[4]);
assertEquals('\n', content[5]);
assertFalse(c.isDirty());
}
@Test
public void writeDirty() throws Exception {
LineBasedContent c = new LineBasedContent("a\nb\nc\n");
//
// synthetic dirtiness
//
c.get(2).setDirty(true);
assertTrue(c.isDirty());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
c.write(baos);
byte[] content = baos.toByteArray();
assertEquals(6, content.length);
assertEquals('a', content[0]);
assertEquals('\n', content[1]);
assertEquals('b', content[2]);
assertEquals('\n', content[3]);
assertEquals('c', content[4]);
assertEquals('\n', content[5]);
assertFalse(c.isDirty());
}
// Package protected -----------------------------------------------------------------------------------------------
// Protected -------------------------------------------------------------------------------------------------------
// Private ---------------------------------------------------------------------------------------------------------
// Inner classes ---------------------------------------------------------------------------------------------------
} |
Monkey Features Location Identification Using Convolutional Neural Networks Understanding animal behavior in its natural habitat is a challenging task. One of the primary step for analyzing animal behavior is feature detection. In this study, we propose the use of deep convolutional neural network (CNN) to locate monkey features from raw RGB images of monkey in its natural environment. We train the model to identify features such as the nose and shoulders of the monkey at about 0.01 model loss. |
Mechanistic proposal for the formation of specific immunogenic complexes via a radical pathway: a key step in allergic contact dermatitis to olefinic hydroperoxides. The widespread use of scented products causes an increase of allergic contact dermatitis to fragrance compounds in Western countries today. Many fragrance compounds are prone to autoxidation, forming hydroperoxides as their primary oxidation products. Hydroperoxides are known to be strong allergens and to form specific immunogenic complexes. However, the mechanisms for the formation of the immunogenic complexes are largely unknown. We have investigated this mechanism for (5R)-5-isopropenyl-2-methyl-2-cyclohexene-1-hydroperoxide (Lim-2-OOH) by studying the formation of adducts in the reaction between this hydroperoxide and 5,10,15,20-tetraphenyl-21H,23H-porphine iron(III) chloride (Fe(III)TPPCl) in the presence of protected cysteine (NAc-Cys-OMe) or glutathione (GSH). Isolated adducts originate from the addition of the thiol group of NAc-Cys-OMe over the carbon-carbon double bonds of carvone. Furthermore, adducts between NAc-Cys-OMe and carveol as well as between GSH and carvone have been identified. The formation of these adducts most likely proceeds via the radical thiol-ene mechanism. The addition of a terpene moiety to cysteine offers an explanation of the specificity of the immune response to structurally different hydroperoxides. These results also explain the lack of cross-reactivity between carvone and Lim-2-OOH. In conclusion, we propose that immunogenic complexes of olefinic hydroperoxides can be formed via the radical thiol-ene mechanism. These complexes will be specific for the individual olefinic hydroperoxides due to the inclusion of a terpene moiety derived from the hydroperoxide. |
<filename>quotes/migrations/0004_quotes_amount.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-25 15:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('quotes', '0003_quotes_is_active'),
]
operations = [
migrations.AddField(
model_name='quotes',
name='amount',
field=models.DecimalField(decimal_places=4, default=1, max_digits=100),
preserve_default=False,
),
]
|
This invention relates to improvements in scanning x-ray apparatus capable of performing both x-ray diffraction and x-ray fluorescence spectroscopy.
Numerous x-ray apparatuses capable of performing both x-ray diffraction (XRD) and x-ray fluorescence (XRF) spectroscopy are well known in the x-ray art. For simplicity, apparatus of this type is referred to herein as "XRD-XRF" apparatus.
In general, XRD-XRF apparatus comprises (A) a gonimeter having a first rotatable platform and (B) means supported by the platform for holding the specimen in a position intersected by the axis of rotation of said first rotatable platform. Also included are (C) means for generating X-rays, (D) a source collimator for collimating the generated X-rays and beig so disposed that the collimated X-rays are incident on the specimen in the direction of the axis of said collimator, and (E) detecting means for detecting X-rays reflected from said specimen in response to incidence thereon of said collimated rays, said detecting means terminating at one end thereof in a snout for introducing the reflected X-rays into the detecting means.
Also included is (F) a wave-dispersive or energy-dispersive analyzer disposed near the entry end of said snout and operably associated with said detecting means for analyzing both X-ray fluorescent emission and absorption spectra and X-ray diffraction patterns generated by incidence of said collimated rays on said specimen.
Further included are, (G) first rotating means for rotating said specimen holder such that the specimen rotates relative to the incident X-rays (collimator axis) to a variable angular displacement in the plane containing the collimator axis and perpendicular to said axis of rotation, and (H) means operable in conjunction with such rotation of said specimen holder for concurrently rotating said detector such that said snout rotates relative to said collimator axis to a variable angular displacement 2.theta. in said plane such that for each value of displacement .theta. the value of 2.theta. displacement is substantially double that of displacement .theta..
An example of a well known x-ray apparatus encompassed by the above description is the XRD-6 Diffractometer introduced commercially by General Electric Company and now commercially available from the Diana Corporation (West Haven, Connecticut and Woburn, Massachusetts). The sales and technical brochures for the XRD-6 Diffractometer are incorporated herein by reference.
It has been heretofore known, in principle, that x-ray analysis and especially x-ray fluorescent spectrometry can be enhanced by employing a vacuum chamber for the x-ray path. See generally Kirk-Othmer, Encyclopedia of Chemical Technology, 2nd ed. (1968), vol. 22, pages 438-467 and the Jenkins article "Interdependence of X-Ray Diffraction and X-Ray Fluorescence Data" in Advances in X-Ray Analysis, edited by Barrett et al., vol. 21, pages 7-21. In FIG. 6 at page 20 of the referenced article, Jenkins shows a diagram of an energy dispersive spectrometer/diffractometer combination and states a disadvantage of that apparatus as "A disadvantage with this configuration is the difficulty in completely removing air from the path of the fluorescence emission and, as a result, only characteristic lines down to S(Z=16) can be measured."
The prior art attempts to enhance the quality of x-ray analysis by incorporating x-ray path vacuum chambers into XRD-XRF apparatus of the Jenkins and other configurations have not been entirely satisfactory from the standpoint of measurability of characteristic lines of light elements, i.e. elements having atomic numbers (Z) below 16.
Briefly stated, it has unexpectedly now been found, by practice of the present invention, that the sensitivity of XRD-XRF apparatus for elements having atomic no. below 16 can be substantially increased by use of an environmentally controllable three-cylinder x-ray path chamber in combination with such apparatus. Use of the chamber (described in greater detail below) has surprisingly been found to sufficiently increase the sensitivity so that element-identifying or characteristic lines of elements having atomic numbers at lest as low as 10 can be measured by the improved XRD-XRF apparatus of this invention. |
<reponame>themoment-team/K2-server<gh_stars>10-100
package com.moment.the.util;
import com.moment.the.admin.AdminDomain;
import com.moment.the.admin.repository.AdminRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Component;
/**
* 애플리케이션에서 빈번히 발생하는 작업에 대해 Bean으로 등록하여 사용할 수 있습니다.
*
* @since 1.3.1
* @author 전지환
*/
@Component
@RequiredArgsConstructor
public class AppUtil {
private final AdminRepository adminRepository;
public static String getCurrentAdminEmail(){
String userEmail;
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if(principal instanceof UserDetails) {
userEmail = ((UserDetails) principal).getUsername();
} else {
userEmail = principal.toString();
}
return userEmail;
}
public AdminDomain getCurrentAdminEntity(){
return adminRepository.findByEmail(getCurrentAdminEmail());
}
}
|
<filename>packages/dom/src/utils/getOffsetParent.ts
import {getNodeName} from './getNodeName';
import {getParentNode} from './getParentNode';
import {getWindow} from './window';
import {isHTMLElement, isTableElement} from './is';
function getTrueOffsetParent(element: Element): Element | null {
if (
!isHTMLElement(element) ||
getComputedStyle(element).position === 'fixed'
) {
return null;
}
return element.offsetParent;
}
function getContainingBlock(element: Element) {
// TODO: Try and use feature detection here instead
const isFirefox = navigator.userAgent.toLowerCase().includes('firefox');
let currentNode: Node | null = getParentNode(element);
while (
isHTMLElement(currentNode) &&
!['html', 'body'].includes(getNodeName(currentNode))
) {
const css = getComputedStyle(currentNode);
// This is non-exhaustive but covers the most common CSS properties that
// create a containing block.
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
if (
css.transform !== 'none' ||
css.perspective !== 'none' ||
css.contain === 'paint' ||
['transform', 'perspective'].includes(css.willChange) ||
(isFirefox && css.willChange === 'filter') ||
(isFirefox && css.filter && css.filter !== 'none')
) {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
}
return null;
}
// Gets the closest ancestor positioned element. Handles some edge cases,
// such as table ancestors and cross browser bugs.
export function getOffsetParent(element: Element): Element | Window {
const window = getWindow(element);
let offsetParent = getTrueOffsetParent(element);
while (
offsetParent &&
isTableElement(offsetParent) &&
getComputedStyle(offsetParent).position === 'static'
) {
offsetParent = getTrueOffsetParent(offsetParent);
}
if (
offsetParent &&
(getNodeName(offsetParent) === 'html' ||
(getNodeName(offsetParent) === 'body' &&
getComputedStyle(offsetParent).position === 'static'))
) {
return window;
}
return offsetParent || getContainingBlock(element) || window;
}
|
#ifndef __NORMAL_ESTIMATOR_H__
#define __NORMAL_ESTIMATOR_H__
#include <ANN/ANN.h>
#include "cv_header.h"
#include "structDef.h"
class NormalEstimator
{
public:
std::vector<cv::Vec3f> m_pt;
std::vector<cv::Vec3f> m_ptNorm;
std::vector<bool> m_ptNormFlag;
public:
NormalEstimator(std::vector<cv::Vec3f> pt = std::vector<cv::Vec3f>());
static void computePCA(cv::Mat& oVec, cv::Mat& eVec,cv::Mat& valVec);
void specifyPointSet(std::vector<cv::Vec3f>& pt);
virtual void fitNormal();
virtual ~NormalEstimator();
};
#endif
|
<reponame>MMKCheung/neueda-springboot<gh_stars>0
package uk.ac.belfastmet.RHI.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import uk.ac.belfastmet.RHI.domain.Beneficiary;
import uk.ac.belfastmet.RHI.repositories.BeneficiaryRepository;
@Service
public class BeneficiaryRestServiceImpl implements BeneficiaryRestService{
@Autowired
private BeneficiaryRepository beneficiaryRepository;
public BeneficiaryRestServiceImpl(BeneficiaryRepository beneficiaryRepository) {
super();
this.beneficiaryRepository = beneficiaryRepository;
}
@Override
public Iterable<Beneficiary> list() {
// TODO Auto-generated method stub
return this.beneficiaryRepository.findAll();
}
@Override
public Beneficiary create(Beneficiary beneficiary) {
// TODO Auto-generated method stub
return this.beneficiaryRepository.save(beneficiary);
}
@Override
public Beneficiary read(Integer beneficiaryId) {
// TODO Auto-generated method stub
return this.beneficiaryRepository.findOne(beneficiaryId);
}
@Override
public Beneficiary update(Integer beneficiaryId, Beneficiary update) {
Beneficiary beneficiary = this.beneficiaryRepository.findOne(beneficiaryId);
beneficiary.setName(update.getName());
beneficiary.setDate(update.getDate());
beneficiary.setLocation(update.getLocation());
beneficiary.setTechtype(update.getTechtype());
beneficiary.setCapacity(update.getCapacity());
beneficiary.setPayment(update.getPayment());
return beneficiaryRepository.save(beneficiary);
}
@Override
public void delete(Integer beneficiaryId) {
// TODO Auto-generated method stub
this.beneficiaryRepository.delete(beneficiaryId);
}
}
|
Image Gallery: Verrucous porokeratosis with characteristic histopathological and dermoscopic features DEAR EDITOR, A 35-year-old man with verrucous porokeratosis, also known as porokeratosis ptychotropica, presented with well-demarcated, scaly, redbrown and verrucous plaques on his buttocks and lower extremities for 8 years (a). Histopathological examination (haematoxylineosin) revealed a digitate epidermis with columns of parakeratosis in the form of prominent cornoid lamellae, a diminished granular layer and a number of dyskeratotic keratinocytes (b). Dermoscopy of lesions revealed a papillomatous-like pattern, dotted and globular vessels, a brown band with white rims inside and outside of the band in the periphery, rosette sign and a central scar-like area (c, d). The patient was treated with acitretin 30 mg per day for 2 months. The skin lesions showed significant improvement. Verrucous porokeratosis can mimic psoriasis and is easily misdiagnosed clinically. Histopathological and dermoscopic examinations help to make a definitive diagnosis. Y. LUO J. L IU Department of Dermatology, Peking Union Medical College Hospital, Chinese Academy of Medical Sciences and Peking Union Medical College, Beijing, China 100730 Correspondence: Jie Liu. E-mail: [email protected] |
A novel CMOS transmitter front-end for mobile RFID reader Aiming at the specified protocol of EPC global Class-1 Generation-2, design considerations are expatiated to a novel structure of transmitter front-end for mobile RFID reader with 0.18um CMOS process. The transmitter front-end consists mainly of an up-conversion mixer, a linear power amplifier (PA) and a non-linear PA. Controlled by the reader's working status, the implemented scheme can transmit high efficient carrier or linear ASK-modulation data at separate periods. The linear PA can provide a power gain of 16.3dB and a 1dB output power of 19dBm. The non-linear PA can achieve 1dB output power of 20.6dBm and a maximum power-added efficiency (PAE) of 44%. The output waveform and spectrum are tested to verify the feasibility of the designed transmitter. |
No, I didn’t get to play Halo 5 in virtual reality. I wish. But I sure as heck just stepped into a sci-fi video game dreamland at E3 2015, thanks to Microsoft’s amazing HoloLens. Getting briefed for a mission by a holographic soldier? Cross that off the bucket list.
My first stop at this year’s Electronic Entertainment Expo was Microsoft, and I knew things were going to be rather interesting when I spotted a certain phrase on my badge:
Advertisement
The last time Microsoft gave me an “optic calibration,” so to speak, it was to measure the distance between my eyes so as to properly adjust the HoloLens headset.
(What the heck’s this whole HoloLens thing about? Read this and this. Today’s headgear appears to be the same—it’s a crazy sleek plasticy cyborg prototype headband with a too-narrow field of view.)
Advertisement
Sadly, once again, I couldn’t bring a camera inside to give you any proof:
Advertisement
But once inside that armored door, sure enough: a rack of HoloLens headsets were waiting for me and my fellow journalists. The room was decked out as a sci-fi marine barracks, complete with a glowing bench and lockers—clearly the inside of some heavily armored mammoth spacecraft. Called one by one, we sat down on the bench as staffers dressed as Halo scientists helped us fit the mixed reality headgear to our skulls.
Then, the headset took care of the rest—giving us glowing, floating waypoints to follow down the spotless grey armored bulkhead of a hallway. Just like a video game! We emerged in a command center, where a giant translucent table with huge metal railings gave each of stations at which to stand—and in the center, a floating starship. The UNSC Infinity.
Advertisement
Go ahead, click the magnifying glass to see that hologram at full resolution. I’ll wait. What you can’t see: while I was staring at the UNSC Infinity, little portions of the ship would light up when I looked at them, giving me details about her armaments.
Your browser does not support HTML5 video tag.Click here to view original GIF
Your browser does not support HTML5 video tag.Click here to view original GIF
Advertisement
Sadly, Halo’s favorite holographic lady Cortana didn’t make an appearance—flitting about the galaxy with Master Chief, no doubt—but the imposing Commander Palmer made a decent substitute, decked out in aggressive Spartan-like armor. She briefed us on the skirmish we were about to face in Halo 5’s new 12 vs. 12 multiplayer mode. You know: here are the objectives you should capture, the enemies you’ll face, things like that. Except each of the buildings and foes she showed us appeared to exist, ghost-like, in the center of that table. Trust me, it’s a real trip.
Only after her speech was over, our handler asked us to take off our HoloLens headsets. That was it? Well, not quite: we also got to go play Halo 5 for a bit. Which was fun! But yeah, no Halo in virtual/augmented/mixed reality. Not yet.
It feels like exactly the kind of experience that would spiff up a really awesome amusement park ride, at the very least.
Advertisement |
HMS Puttenham
Design and description
In the early 1950s, the Royal Navy had a requirement for large numbers of minesweepers to counter the threat to British shipping from Soviet mines in the event of a conventional Third World War. The navy's existing minesweepers were obsolete, while the increasing sophistication of modern mines meant the mine warfare forces could not be supplemented by requisitioned fishing vessels as had been done in previous wars. Large orders were placed for coastal minesweepers (the Ton) and for smaller inshore minesweepers and minehunters intended to operate in inshore waters such as river estuaries (the Ham and Ley classes). As the navy did not have sufficient manpower to operate all the required ships in peacetime, it was planned to lay a large number up in reserve, so they could be manned by reservists (in may cases the crews of the fishing boats which would previously have been used in the same role) in time of emergency.
Puttenham was one of the third series of Ham-class ships, with an all-wooden hull, slightly larger than the first two series. The ship was 107 feet 5 inches (32.74 m) long overall and 100 feet 0 inches (30.48 m) between perpendiculars, with a beam of 21 feet 11 inches (6.68 m) and a draught of 5 feet 9 inches (1.75 m). Displacement was 120 long tons (120 t) standard and 159 long tons (162 t) full load. Two Paxman 12-cylinder diesel engines gave a total of 1,100 brake horsepower (820 kW) and drove two shafts, giving a top speed of 14 knots (16 mph; 26 km/h), which corresponded to a speed when sweeping of 9 knots (10 mph; 17 km/h). The design armament for the class was a single Bofors 40 mm gun, although this was generally replaced by an Oerlikon 20 mm cannon.
Service
Puttenham was built by John I. Thornycroft & Company, was launched on 25 June 1956 and completed on 9 May 1958. She was laid up in reserve ashore at Rosneath in Scotland from 1958 to 1963. In 1964, Puttenham was allocated to the Royal Naval Auxiliary Service (RNXS) at Devonport.
In June 1967, HMS Puttenham, equipped with twelve divers under the command of Engineer-Lieutenant Roy Graham, sailed to the Isles of Scilly in search of the wrecks of the great naval disaster in 1707. The wreck of HMS Association, a 90-gun second rate ship of the line, was finally located. Divers first discovered a cannon, and on the third dive, silver and gold coins were spotted. More than 2,000 coins and other artefacts were later recovered from the site and auctioned by Sotheby's in July 1969.
Puttenham remained in service with the RNXS at Plymouth until 1978. HMS Puttenham eventually ended service for the Royal Navy in 1980. She was sold to a private company and changes were later made to her superstructure. She continued serving in Greece as the passenger ferry Eleftheria until she was finally dismantled in Crete in November 2006, after 50 years at sea. |
A Weighted Robust Parsing Approach to Semantic Annotation This paper proposes a grammar-based approach to semantic annotation which combines the notions of robust parsing and fuzzy grammars. We present an overview of a preliminary research aimed to generalize some results from a recent project on interaction through speech with information systems where techniques based on the above notions have been successfully applied. The goal of the article is to give a development environment to linguists. Introduction In this article we are mainly interested in semantic annotation (Sperberg-McQueen and Burnard, 1994). We are considering the Information Extraction (I.E.) problem as a semantic annotation problem: extracting information is finding the relevant terms that contribute to describe an appropriate semantic structure of the text. Some of the most ira-. portant works in I.E. have been dealing with domain dependent documents like (;). Both systems employ complex analysis schemas. Assigning semantic field tags is in general a difficult task. This is due at least to the crucial need of the domain knowledge and also of the linguistic knowledge. Our approach considers that for some specific domains a semantic annotation can be achieved by a light parsing of the text which is based on the user of certain cue-words as a heuristic for describing its semantic structure. h case study in query generation The availability of a large collection of annotated telephone calls for querying the Swiss phone-book database (i.e the Swiss French PolyPhone corpus) allowed us to experiment our recent findings in robust text analysis obtained in the context of the Swiss National Fund research project ROTA (Robust Text Analysis), and in the recent Swisscom funded project ISIS (Interaction through Speech with Information Systems) 1 ( would produce the following query frame filling for the Swiss Phone-book database: The goal of semantic annotation is to provide a tree structure which can be superposed over the flat sentence. This structure can be supported by a PRO-LOG compound term consisting of "tag" functors and list arguments. Moreover this same structure can also be supported by the SGML structural representation. The translation between the two models is an intuitive task and an example of such translation is provided by the two following corresponding representations for a possible query call schema. Processing phases The processing of the corpus data is performed at various linguistic levels by modules organized into a pipeline Each module assumes as input the output of the preceding module The main goal of this architecture is to understand how far it is possible to go without using any kind of feedback and interactions among different linguistic modules At a first stage, morphologic and syntactic processing 2 is applied to the output from the speech recognizer module which usually produces a huge word-graph hypothesis. Thus the forest of syntactic trees produced by this phase have been used to achieve two goals: 1." The n-best analyses are used to disambiguate speech recognizer hypotheses 2. They served as supplementary input for the robust semantic analysis that we performed, that had as goal the production of query frames for the information system Although robustness can be considered as being applied at either a syntactic or semantic level, we believe it is generally at the semantic level that it is most effective. This robust analysis needs a model of the domain in which the system operates, and a way of linking this model to the lexicon used by the other components. The degree of detail required of the domain model used by the robust analyzer SOur partner institution ISSCO (Institute Dalle Molle, University of Geneva) performed this analysis phase using tools that were developed in the European Linguistics Engineering project MULTEXT. For syntactic analysis, ISSCO developed a Feature Unification Grammar based on a small sample of the Polyphone data. This grammar was taken by another of our partners (the Laboratory for Artificial Intelligence of the Swiss Federal Institute of Technology, Lausanne) and converted into a probabilistic context-free grammar, which was then applied to a sample of 500 entries from the Polyphone data. depends upon the ultimate task that must be performed --in our case, furnishing a query to an information system. The results of the processing phase of the previous example is represented below as an SGML annotation: <announce> Bonjour j'aimerais un </announce> <query> num~ro de t~l@phone ~ Saignelegier <name> <ram_name> c~est Mottaz m o deux ta z </f am_name> <first_name> Monique </first_name> </name> <address> <street> rue du printemps </street> <number> num~ro quatre </number> <city> </city> </address> </query> 2 Methodology In this section we propose the use of a "light-parser" for doing sentence-level semantic annotation The main idea comes from the observation that annotation does not always need to rely on the deep structure of the sentence (e.g. at morpho-syntactic level). It is sometimes sufficient to find some cue-words which allow us to locate the logical sub-structures of the sentence If the domain is simple enough, this task can be easily mechanized. A similar approach, using finite state parsing technology, has been proposed by Grefenstette in where the main applications are slanted to the extraction of syntactic information 2.1 Robust Definite Clause Grammars LHIP (Left-corner Head-driven Island Parser) (Ballim and Russell, 1994;Lieske and Ballim, 1998) is a system which performs robust analysis of its input, using a grammar defined in an extended form of the PROLOG Definite Clause Grammars (DCGs). The chief modifications to the standard PROLOG 'grammar rule' format are of two types: one or more righthand side (RHS) items may be marked as 'heads' (e.g. using a leading '*'), and one or more RHS items may be marked as 'ignorable' (e.g. using a leading '-'). LHIP employs a different control strategy from that used by PROLOG DCGs, in order to allow it to cope with ungrammatical or unforeseen input The behavior of LHIP can best be understood in terms of the complementary notions of span and cover A grammar rule is said to produce an island which spans input terminals ti to ti+,~ if the island starts at the i ~h terminal, and the i + n th terminal is the terminal immediately to the right of the last terminal of the island A rule is said to cover m items if m terminals are consumed in the span of the rule. Thus m < n. If m = n then the rule has completely covered the span. As implied here, rules need not cover all of the input in order to succeed. Weighted LHIP rules The main goal of introducing weights into LHIP rules is to induce a partial order over the generated hypotheses. The following schema illustrate how to build a simple weighted rule in a compositional fashion where the resulting weight is computed from the sub-constituents using the minimum operator. This strategy is not the only possible since the LHIP formalism allows a greater flexibility. Without entering into formal details we can observe that if we strictly follow the above schema and we impose a cover threshold of 1 we are dealing with fuzzy DCG grammars (Lee and Zadeh, 1969;Asveld, 1996). We actually extend this class of grammars with a notion of fuzzy-robustness where weights are used to compute confidence factors for the membership of islands to categories 3. The order of constituents may play an important role in assigning weights for different rules having the same number and type of constituents. Each LHIP rule returns a weight together with a term'which will contribute to build the resulting structure. The confidence factor for a pre-terminal rule has been assigned statically on the basis of the rule designer's domain knowledge. The methodology at work In our case study we try to integrate the above principles in order to effectively compute annotation hypotheses for the query generation task. This can be done by building a lattice of annotation hypotheses and possibly selecting the best one. This lattice is generated by means of a LHIP weighted grammar which is used to extract and assemble what we called semantic constituents. At the end of this process we presumably obtain suitable annotations from which we will able to extract the content of the query (e.g. name, address, city, etc.). The rules are designed taking into consideration the following kind of knowledge: Domain Knowledge is exploited to provide quantitative support (or confidence factor) to our rules. 3Development of this notion is currently under investigation and not yet formalized. Linguistic Knowledge (as for instance previous POS tagging or syntactic analysis) is used for determining constraints in order to prune the hypotheses space. Lexical knowledge: As pointed out in (Basili and M.T., 1997), lexical knowledge plays an important role in Information Extraction since it can contribute in guiding the analysis process at various linguistic level. In our case we are concerned with lexical knowledge when we need to specify lexical LHIP rules which represent the building blocks of our parsing system. Semantic markers are domaindependent word patterns and must be defined for a given corpus. They identify cue-words serving both as separators among logical subparts of the same sentence and as introducers of semantic constituents. In our specific case they allow us to search for the content of the query only in interesting parts of the sentence. One of the most important separators is the announcement-query separator. The LHIP clauses defining this separator can be one or more words covering rule like for instance: ann_query_separator ( It should be noted that we mix weighted and nonweighted rules, simply because non-weighted rules are rules with the highest weight 1. Generation of hypotheses The generation of annotation hypotheses is performed by: composing weighted rules, assembling constituents and filtering possible hypotheses. In this case the grammar should provide a means to provide an empty constituent when all possible hypothesis rules have failed. The highest level constituent is represented by the whole sentence structure which simply specifies the possible orders of constituents relative to annotation hypotheses. In the ann rule we have made use of the Kleene closure operator closK which allow LHIP to simply formulate regular expressions. In the query rule we have specified a possible order of constituents interleaved by semantic markers (e.g. separators and introducers). In this case we did not provide any linguistic constraint (e.g. preferring names belonging to the minimal common syntactic sub-tree or those having the longest sequence of proper names belonging to the same sub-tree). 3 Conclusions and future works In this paper we summarized a proposal for a framework for designing grammar-based automated annotation applications. Starting with a case study and following an approach which combines the notions of fuzziness and robustness in sentence parsing, we showed how to build practical domain-dependent rules which can be applied whenever it is possible to superimpose a sentence-level semantic structure to a text without relying on a previous deep syntactical analysis. Even if the query generation problem may not seem a critical application one should bear in mind that the sentence processing must be done on-line. As we have previously seen, the cue-words used as semantic markers are domain-dependent. Even their relevance disposal and their weight within the rules depends on their linguistic usage. Therefore, a complete automatic annotation system based on the approach proposed in this article seems to be adequate to give precise results. However, a semi-automatic system could satisfy our needs. This system should be based on the following techniques to achieve a high level of performance: 1. For each annotation, the system offers a list of propositions based on standard grammars as well as on external knowledge (ontologies, knowledge bases...) |
<reponame>litchiny/Camera
package com.litchiny.camera.ui;
import android.content.Context;
import android.graphics.Canvas;
import android.hardware.camera2.DngCreator;
import android.media.Image;
import android.util.Pair;
import android.view.MotionEvent;
import java.util.Date;
import java.util.List;
public interface ApplicationInterface {
void cameraClosed();
void cameraInOperation(boolean z);
void cameraSetup();
void clearColorEffectPref();
void clearExposureCompensationPref();
void clearExposureTimePref();
void clearSceneModePref();
void clearWhiteBalancePref();
double getCalibratedLevelAngle();
int getCameraIdPref();
Pair<Integer, Integer> getCameraResolutionPref();
String getColorEffectPref();
Context getContext();
boolean getDoubleTapCapturePref();
int getExpoBracketingNImagesPref();
double getExpoBracketingStopsPref();
int getExposureCompensationPref();
long getExposureTimePref();
boolean getFaceDetectionPref();
String getFlashPref();
float getFocusDistancePref();
String getFocusPref(boolean z);
boolean getForce4KPref();
int getImageQualityPref();
String getLockOrientationPref();
boolean getOptimiseAEForDROPref();
boolean getPausePreviewPref();
String getPreviewRotationPref();
String getPreviewSizePref();
long getRepeatIntervalPref();
String getRepeatPref();
String getSceneModePref();
boolean getShowToastsPref();
boolean getShutterSoundPref();
boolean getStartupFocusPref();
long getTimerPref();
boolean getTouchCapturePref();
String getWhiteBalancePref();
int getWhiteBalanceTemperaturePref();
int getZoomPref();
boolean isExpoBracketingPref();
boolean isRawPref();
boolean isTestAlwaysFocus();
void layoutUI();
void multitouchZoom(int i);
boolean onBurstPictureTaken(List<byte[]> list, Date date);
void onCameraError();
void onCaptureStarted();
void onContinuousFocusMove(boolean z);
void onDrawPreview(Canvas canvas);
void onFailedReconnectError();
void onFailedStartPreview();
void onPhotoError();
void onPictureCompleted();
boolean onPictureTaken(byte[] bArr, Date date);
boolean onRawPictureTaken(DngCreator dngCreator, Image image, Date date);
void requestCameraPermission();
void requestStoragePermission();
void setCameraIdPref(int i);
void setCameraResolutionPref(int i, int i2);
void setColorEffectPref(String str);
void setExposureCompensationPref(int i);
void setExposureTimePref(long j);
void setFlashPref(String str);
void setFocusDistancePref(float f);
void setFocusPref(String str, boolean z);
void setISOPref(String str);
void setSceneModePref(String str);
void setWhiteBalancePref(String str);
void setWhiteBalanceTemperaturePref(int i);
void setZoomPref(int i);
void timerBeep(long j);
void touchEvent(MotionEvent motionEvent);
void turnFrontScreenFlashOn();
boolean useCamera2();
boolean useCamera2FakeFlash();
boolean useCamera2FastBurst();
}
|
export const HYMNALS_ENDPOINT = 'https://api.sweethymns.com/v1/hymnals';
export const MAX_HYMNALS_IDS = 20;
export const LENGTH_HYMNAL_ID = 24;
|
The new verification badge includes a small icon of a government building and the office that the person is running for. The labels will be available to people running for Governor, U.S. Senate, and the House of Representatives who have qualified for the general election ballot during the 2018 U.S. midterm elections, which are being held on November 6, 2018. Candidates in smaller local elections won’t have the option to be verified in the new way.
Twitter says that the labels will appear on the profile landing page of the candidate and next to all tweets sent or retweeted by the candidate. The badge will also be visible wherever tweets from the candidate’s account are embedded on websites outside of the Twitter ecosystem.
“Twitter is partnering with Ballotpedia, a non-profit, civic organization that publishes nonpartisan information on federal, state, and local politics, to help identify the campaign Twitter accounts of candidates once they qualify for the general election ballot for an applicable office,” Twitter’s senior public policy manager Bridget Coyne said in a blog post.
A whopping 38 out of the 50 states have gubernatorial elections this year, and 33 of the 100 U.S. Senate seats are being contested. All 435 U.S House seats are up for grabs, since members only serve a term of two years, compared with the Senate’s 6-year terms.
Twitter is doing its part, but you can’t necessarily say the same for the U.S. government. Last week, we reported that only 13 states have requested federal funds set aside to improve election security. And just yesterday, Secretary of State Mike Pompeo testified that “there is a great deal more work to do” to counter efforts to stop foreign interference in the upcoming election.
“We have not been able to achieve deterrence, effective deterrence of some of these efforts of the Russians but this administration has taken enormous efforts to push back against Russia,” Pompeo said at a hearing on Wednesday. |
<reponame>harmonyos-mirror/OpenArkCompiler-test<filename>src/maple_me/include/me_prop.h
/*
* Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved.
*
* OpenArkCompiler is licensed under the Mulan PSL v1.
* You can use this software according to the terms and conditions of the Mulan PSL v1.
* You may obtain a copy of Mulan PSL v1 at:
*
* http://license.coscl.org.cn/MulanPSL
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
* FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v1 for more details.
*/
#ifndef MAPLE_ME_INCLUDE_MEPROP_H
#define MAPLE_ME_INCLUDE_MEPROP_H
#include "me_irmap.h"
#include "bb.h"
#include "me_phase.h"
#include "prop.h"
namespace maple {
class MeProp : public Prop {
public:
MeProp(MeIRMap &irMap, Dominance &dom, MemPool &memPool, const PropConfig &config)
: Prop(irMap, dom, memPool, std::vector<BB*>(irMap.GetFunc().GetAllBBs().begin(),
irMap.GetFunc().GetAllBBs().end()),
*irMap.GetFunc().GetCommonEntryBB(), config) {}
virtual ~MeProp() = default;
};
class MeDoMeProp : public MeFuncPhase {
public:
explicit MeDoMeProp(MePhaseID id) : MeFuncPhase(id) {}
virtual ~MeDoMeProp() = default;
AnalysisResult *Run(MeFunction *func, MeFuncResultMgr *m, ModuleResultMgr *mrm) override;
std::string PhaseName() const override {
return "hprop";
}
};
} // namespace maple
#endif // MAPLE_ME_INCLUDE_MEPROP_H
|
import { Component } from '@angular/core';
@Component({
selector: 'app-search-footer',
templateUrl: './search-footer.component.html',
styleUrls: ['./search-footer.component.css']
})
export class SearchFooterComponent { }
|
Clinical and para-clinical tests in the routine examination of headache patients. Para-clinical examinations in the diagnosis and treatment control of headache patients vary considerably between clinics and headache centers. Among the neurological societies in Europe there has been a consensus that some common procedures and recommendations should be created. In the Fall of 1998, the European Federation of Neurological Societies (EFNS) commissioned a Task Force on Neurophysiological Tests and Imaging Procedures in Headache Patients. Members of the Task Force are the present authors and we have reviewed the literature on 1) neurophysiological tests (EEG and evoked potentials), 2) autonomic nervous system and clinical tests and 3) imaging and cerebrovascular tests (X-ray, CT, MR, fMRI, PET, SPECT and transcranial Doppler). The literature was carefully evaluated with respect to validity and strength of the data. The task was to reach conclusions about each technique in the form of guidelines for clinical use. Finally, selected areas for future research will be outlined. The extensive review and the guidelines will be published by the EFNS during 2000. |
Sialic acids are a family of 9 carbon sugars (belonging to a larger family of nonoses, or nonulosonates) expressed in the tissues of every vertebrate and several “higher-order” invertebrates (1). Sialic acids serve a wide variety of biological roles, including modulating several aspects of immune function (2). For example, cell surface-associated sialic acid inhibits complement activation. As an example of immune regulation, sheep erythrocytes are resistant to lysis by the alternative pathway because surface sialic acids increase the affinity of factor H (fH; inhibitor of the alternative pathway) (3). Neuraminidase treatment of sheep erythrocytes then reduces the affinity of fH, which permits complement activation and promotes hemolysis. Recent work showed that fH C-terminal domains 19 and 20 bound simultaneously to C3b (complement factor that binds microbial cell surfaces) and glycosaminoglycans (including sialic acids), respectively, on host cells, which served to inhibit the alternative pathway (4). Loss of sialic acids decreased fH binding and enhanced activation of the alternative pathway. Typically, fH binds vertebrate cell surfaces via sialic acids to allow preferential protection of host cells (i.e. reduce complement-mediated damage).
Many microbes express sialic acids, as well as other unique microbial nonulosonates (i.e. legionaminic (Leg) and pseudaminic (Pse) acid), on their surfaces that contribute to pathogenesis in several ways including subversion of complement activation, promoting biofilm formation and facilitating colonization (5). Some pathogens such as Neisseria gonorrhoeae, Haemophilus influenzae, Histophilus somni (Haemophilus somnus) and group A N. meningitidis lack the ability to synthesize sialic or nonulosonic acids, but scavenge these molecules (such as Neu5Ac or Neu5Gc, or the CMP-activated form CMP-Neu5Ac) from the host. Other pathogens, for example, Escherichia coli K1, Streptococcus agalactiae, groups B, C, W, and Y N. meningitidis, Campylobacter jejuni and certain Leptospira, can synthesize nonulosonic acids such as Neu5Ac, Leg5Ac7Ac or Pse5Ac7Ac de novo. Sialylation of gonococcal lacto-N-neotetraose (LNT) lipooligosaccharide (LOS) enhances resistance of N. gonorrhoeae to complement-dependent killing by decreasing binding of IgG against select bacterial targets such as the porin B (PorB) protein (6), which attenuates the classical pathway. LNT LOS sialylation also enhances fH binding, which results in inhibition of the alternative pathway (7).
U.S. Pat. No. 6,096,529 and U.S. Pat. No. 6,210,933 disclose that LacNAc may be modified with a sialic acid analogue using a recombinant sialyltransferase derived from N. gonorrhoeae or N. meningitidis. These patents do not specifically mention that the sialic acid analogue could be Leg5Ac7Ac.
U.S. Pat. No. 6,168,934 discloses the proposition that it is possible to sialylate LacNAc with a sialic acid analogue using an appropriate sialyltransferase (see col. 24, lines 7-66). The patent does not specifically disclose the use of a sialyltransferase from Neisseria spp. The patent also does not specifically mention that the sialic acid analogue could be Leg5Ac7Ac.
N. gonorrhoeae has become resistant to almost every conventional antibiotic. Over the past 3 years, resistance to ceftriaxone has ushered in an era of potentially untreatable gonorrhea. There is an urgent need for novel therapeutics and vaccines against this disease. LOS sialylation is an important aspect of gonococcal pathogenesis and isogenic mutants that lack the ability to sialylate their LOS are at a disadvantage in vivo compared to their wild-type counterparts (31). Disabling the ability of gonococci to siaylate their LOS represents a novel prophylactic or treatment strategy. |
Update: The Nintendo Switch recently hit its one year anniversary. You can see how well it did in its first year here. For a list of the best Nintendo Switch games thus far, click here.
Since the inception of the Wii, Nintendo has gone down a different design path with its consoles. Rather than wage a war of processing power with Microsoft and Sony, the company sought to fundamentally rethink hardware. Some might refer to these as gimmicks. Regardless of what you call it, Nintendo struck gold with the Wii. With its motion controls, the console ended up being the company's best-selling system to date. Nintendo missed the mark with its follow-up, the Wii U, however, which is being the company's worst-performing console to date. The Nintendo Switch continues this out-of-the-box thinking with its hybrid form factor. After using it for a week, I'm glad to say that the hardware has a lot of potential and marks a strong return to form for the company.
Switch console
HDMI cable
AC power adapter
Two Joy-Con controllers
Two Joy-Con straps
Joy-Con Grip
Switch Dock
Design
Like the Wii U GamePad before it, the Switch offers a 6.2-inch touch screen. The tablet-like portion of the console is small, and measures roughly 6.7x3.9x.6 inches. Even with the Joy-Con controllers attached, its 9.4x4.1x1-inch frame make it significantly smaller than the GamePad.
The Switch has .7 inch bezels on the sides and .4 inch bezels on the top and bottom
While the dimensions of the display are the same, the Switch’s screen looks far better. Its bright, glossy 1280x720p screen certainly isn’t the sharpest panel on the market, but it offers a modest 236.87 pixel per inch (PPI) density. For reference, the iPhone 7 offers a 326 PPI. The 720p screen strikes a good balance between resolution and performance demands for the console. Unlike the GamePad’s resistive touchscreen, the Switch uses a capacitive panel, which offers a higher contrast ratio and improved touch gestures. While you can certainly play the Switch outdoors, like with your typical smartphone or tablet screen, bright lights can make it harder for you to make out finer details on the panel.
The hardware has a lot of potential and marks a strong return to form for Nintendo.
This is the top of the Switch without the Joy-Cons attached.
Above the touch screen, the Switch houses its power button, volume rocker, exhaust vent, Game Card slot, and 3.5mm headphone jack. Both sides of the console feature rails for the Joy-Con controllers to slide in. Underneath the device, there’s a USB-C power port. On the back of the unit, there’s a kickstand that you can pull out, which also reveals the MicroSD card slot underneath. The kickstand is flimsy and only offers one viewing angle. I would have liked more angular granularity to give it more versatility.
The Joy-Con controllers are very light and weigh just over 0.1 pound each. I tested the neon red and blue variant and have to say that they look surprisingly bright and charming in-person. They also come in a dark matte grey if you prefer a more subdued tone. It's easy to attach the Joy-Cons to the Switch. They generate a very satisfying snap when you slide them in place. Removing them requires a little more care, however, as you need to press down on a small button on the back of both controllers to release them. The left and right Joy-Cons are somewhat mirrored forms of each other. Both controllers offer face/directional buttons and a joystick. Attached together, either with the included Grip accessory or on the Switch, they act as a singular controller with offset joysticks, similar to what you might see on an Xbox controller. The sticks themselves are pretty short, and can’t match the travel distance of Microsoft’s variants. They are much taller than the Nintendo DS’ sticks, however, and are serviceable.
The Joy-Cons both offer four LED lights to indicate controller battery life.
While the two Joy-Cons may look like mirrored version of each other, there are slight differences to each controller. For multiplayer games that split the Joy-Cons apart, I suspect most gamers would prefer to choose the left Joy-Con, as the right Joy-Con places its joystick somewhat awkwardly in the middle of its frame. The left controller, on the other hand, has the stick more comfortably offset to the side. The right controller does house an NFC reader and an IR motion camera, however. The NFC reader allows users to sync Amiibos to the device and the IR camera allows the Switch to detect movements and hand gestures.
The home button on the right Joy-Con will light up for notifications.
The box comes with two straps for the Joy-Cons. Not only do these straps prevent you from flinging your Joy-Cons across the room, but with the straps attached and the controllers turned horizontally, they accentuate the shoulder buttons with larger triggers.
Both Joy-Cons support motion controls. In The Legend of Zelda Breath of the Wild, they allow you to augment joystick aiming. It was jarring at first, but augmented aiming eventually helped me fine tune my bow and arrow shots. There were downsides, though, vibrations on a bumpy commute can throw off your aim.
The kickstand feels a bit flimsy and only offers one angle.
In addition to motion controls, the Joy-Cons offer a very sophisticated haptic feedback system. Nintendo calls it HD Rumble, and it allows developers to create games like 1-2-Switch that tasks you with guessing how many virtual marbles are “rolling around” inside your controllers. With the controllers’ multiple motors, it does an excellent job here and feels accurate. It represents the best haptics I’ve felt to date.
Having spent several hours playing with the Switch on the go, I can say that it never felt uncomfortably heavy.
Whereas the Wii U GamePad looked and felt a bit like a Fisher Price toy, the Switch feels sturdy overall. This is even more impressive when you consider that at 0.9 pounds with the Joy-Con controllers attached, the Switch is more than 0.1 pound lighter than the GamePad. Having spent several hours playing with the Switch on the go, I can say that it never felt uncomfortably heavy. Its size made it easy to rest on my lap when some fatigue did set in.
You can connect up to eight Nintendo Switch systems
The Switch is also more portable than I imagined. With the Joy-Cons attached, the device can fit into large pants pockets, though it will most likely jut out a little. The Switch is ideally suited for backpacks, but on some loose-fitting slacks, you can most likely get away with putting both Joy-Cons into one pocket and the console in the other.
When you want to play the Switch on your TV, you’ll need to insert it into the included Switch Dock. The plastic Dock measures 6.7x4x1.9 inches and offers two USB ports on the left. Nintendo says that you can use these USB ports to connect accessories like USB-to-Ethernet dongles. There’s also a door on the back that swings open, which allows you to do some basic cable management with your power and HDMI cables. There’s also a third USB port stowed back here. It’s really easy to slide the Switch into the Dock and there’s even a guard at the bottom that depresses to protect the system once it's properly in place.
The Switch’s AC adapter uses a wall wart, which means it’s best suited for the tail end of a power strip.
When you’re playing the Switch on the TV, you’ll probably want to connect the Joy-Con controllers to the included Grip peripheral. While the Pro Controller feels amazing, the Grip configuration is surprisingly comfortable and ergonomic.
Specs
Underneath the hood, the Switch uses a heavily-customized Nvidia Tegra system-on-a-chip (SOC) that’s based on the ARM instruction set. In layman's terms, that basically means that the console uses a souped-up tablet processor.
Nintendo has yet to officially comment on RAM or GPU/CPU clock speeds, but we do know that because the Switch is based on a mobile processor, it’s not a processing powerhouse. In the Legend of Zelda Breath of the Wild, there are jaggies and faraway enemies will occasionally pop in. While the Switch is capable of delivering a 1080p signal while docked, Breath of the Wild opts to run at 900p with a 30 FPS locked frame rate here. Visually, I could tell that it often failed to meet this frame rate while docked. It tends to dip when there’s too much happening on the screen. Interestingly, I didn’t notice the same frame rate issues when I played with the Switch undocked.
This is not to say that the Switch isn’t capable of delivering beautiful graphics. Despite its occasional technical hiccups, Breath of the Wild is a beautiful game with lush colors and expansive vistas. It’s far and away the most beautiful game I’ve ever seen rendered on a mobile processor. Period. This includes any game I’ve played on Nvidia’s 2017-released Shield gaming device.
The Switch hit 39.2 degrees Celcius playing The Legend of Zelda Breath of the Wild.
The Switch uses a tiny fan and it’s super quiet. It never got obscenely hot either. Using Flir’s thermal imaging camera and playing Breath of the Wild in portable mode, the Switch hit 39.2 degrees Celsius (102.5 degrees Fahrenheit). For reference, I’ve seen the PlayStation 4 Pro hit 46.1 degrees Celsius (114.9 degrees Fahrenheit). With the console docked, temperatures hit 41.1 degrees Celsius (105.9 degrees Fahrenheit). The Switch’s power-efficient design is most likely why its temps are so moderate. Using a power meter with the console docked, the Switch consumed 7.8 watts sitting in the operating system. When I fired up Zelda, power draw roughly doubled to 15 watts. This is still incredibly modest when you consider that the PlayStation 4 Pro often hits above 140 watts, which is nearly 10 times as much.
The Switch comes with 32GB of storage. When you factor in operating system overhead, this leaves you with 25.9GB of usable space. That’s not a lot, but the console does support expandable memory via MicroSD cards up to 2 TB, though Nintendo recommends an Ultra High Speed SD card to store games.
Switch Game Cards are roughly the size of SD cards.
In terms of audio, while docked, the Switch supports 5.1 channel surround sound. The console also offers two small speakers below its touch screen. The speakers get the job done, but didn’t blow me away. They lack a little punch and were actually drowned out a bit by my Nexus 6P phone speakers when I had them blasting audio at full volume side by side. Interestingly enough, when I plugged the same set of earbuds into both devices, the 6P was able to output a much louder signal. That’s not to say the system is really quiet with earbuds, but those with hearing issues should take note.
For its battery, the Switch uses a rechargeable 4,310 mAh lithium-ion cell. This is a pretty sizable battery. For perspective, the iPhone 7 uses a 1,960 mAh solution. Nintendo claims that the Switch can last over six hours, depending on usage. For Zelda, the company says users should expect around three hours of battery. From my testing, this seems pretty accurate. With a 100-percent charge, I was able to get three hours and three minutes of battery life playing Zelda with screen brightness set to 80 percent. Reviews Editor Peter Brown set his screen brightness to 100 percent and recorded two hours and 50 minutes. If you’re wondering how fast the Switch charges, we clocked a 49 percent charge after an hour of sleep on the Dock.
In terms of wireless connections, the Switch supports Bluetooth 4.1 and 802.11ac Wi-Fi.
You can also use a USB-C phone charger with the Switch. Unfortunately, I didn’t have much luck charging the console with an external power bank. I played roughly 10 minutes of Zelda on the go with a Kingston MobileLite Wireless G3 plugged in and saw battery drop from 55 percent down to 51. The G3’s 2A battery output could have been a bottleneck, but the device wasn’t charging the Switch even when it was sleeping.
The system’s sleep mode itself seems to be very power-efficient. After a full charge, I took the Switch out of the dock and set it aside for five hours. When I woke it up, it still reported a 100-percent charge. The console also takes less than four seconds to wake up from sleep when it’s docked. It wakes up under two seconds when it’s not docked. It seems like the system was designed with sleep mode in mind and you have to navigate through the UI a bit to shut it off. The Switch performed a cold boot in about 10 seconds.
I encountered the longest loading time when I booted Breath of the Wild after closing the game. It took 17 seconds, but because the Switch seems like it was designed to run games in the background at all times, I often found I was able to pop right back into Hyrule nearly instantaneously. That’s quite impressive given the sleep mode’s power-efficient state.
User Interface and Operating System
A day-one update is preventing me from evaluating the Switch’s full capabilities at this time. Features like Nintendo’s eShop are currently offline. I’ll update this review once I get my hands on with the patch.
As it is right now, the operating system is very simple and barebones. Currently, there is no video player. Nintendo said that video-streaming applications are “being considered for a future update.”
Currently, the OS allows you to do simple things like calibrate your control sticks, test your internet connection, and go into airplane mode. The Switch allows you to capture in-game screenshots and you can view and edit these pictures with captions in the OS. An eventual update will allow you to share these images online.
The UI allows you to create different user profiles and Miis. It also offers pretty sophisticated parental controls that allow you to restrict games based on age, region, and more.
Conclusion
The Nintendo Switch feels like the culmination of years of hardware growing pains from both Nintendo and Nvidia. Unlike the Wii U GamePad, you no longer have to worry about being tethered to your TV. Because the Switch houses all of its processing power in its portable form factor, it truly allows you to carry console power with you wherever you go. The fact that it’s able to do that while being lighter than the Wii U’s GamePad is a bit of a technical marvel in my book.
The Switch isn’t perfect, but it offers multiple ways to play games; all of which are viable. As silly as the commercials may seem, I can definitely see myself bringing the Switch to social gatherings to play something like 1-2-Switch as much as I can see myself playing Zelda sitting alone in front of my TV.
The Nintendo Switch feels like the culmination of years of hardware growing pains from both Nintendo and Nvidia.
You can find more powerful consoles like the PS4 and Xbox One on sale for cheaper than the $299.99 Switch, but you’re paying for the form factor here. There’s something special about being able to play Breath of the Wild on the big screen in the living room and then continuing where you left off 15 minutes later on the bus.
Should you make the Switch? That answer should largely depend on whether you think the system’s library of games will satisfy your needs, but Nintendo has undoubtedly laid the groundwork for a great gaming device. |
/**
* This will calculate the placeholder index needed when inserting the placeholders into it's parent.
*/
protected int calculateInsertIndex(RowComponent<T> lastRow) {
int placeholderIndex = rowCount + 1;
if (dataView.isUseCategories()) {
CategoryComponent category = dataView.getCategory(lastRow.getCategoryName());
if (category != null) {
int categoryIndex = dataView.getCategories().indexOf(category);
placeholderIndex = placeholderIndex + (categoryIndex + 1);
}
}
return placeholderIndex;
} |
Renormalization group flow and symmetry restoration in de Sitter space We compute the renormalization group flow of O(N) scalar field theories in de Sitter space using nonperturbative renormalization group techniques in the local potential approximation. We obtain the flow of the effective potential on superhorizon scales for arbitrary space-time dimension D=d+1. We show that, due to strong infrared fluctuations, the latter is qualitatively similar to the corresponding one in Euclidean space with D=0. It follows that spontaneously broken symmetries are radiatively restored in any space-time dimension and for any value of N. Introduction The study of quantum field dynamics in de Sitter (dS) space is a subject of topical interest. It is of relevance for inflationary cosmology, where timely issues concern the understanding of radiative corrections to inflationary observables. Moreover, the maximally symmetric dS space offers a paradigm example for the study of quantum field theory on curved space-times, which reveals a realm of nontrivial effects as compared to Minkowski space. The case of light fields, with mass small in units of the curvature, is of particular interest both for phenomenological applications to inflationary cosmology and for it has no flat space analog. Such fields exhibit strong, semi-classical fluctuations on superhorizon scales, responsible for nonperturbative infrared/secular effects. Similar issues arise in various instances in flat space, e.g., for bosonic fields at high temperature or near a critical point, or for nonequilibrium systems. Powerful methods have been developed to deal with such situations, including, e.g., renormalization group, two-particle-irreducible, or large-N techniques. In recent years, some efforts have been put in adapting these methods to study the infrared (IR) dynamics of quantum fields in dS space. An interesting issue concerns the possibility of spontaneous symmetry breaking (SSB). It is known that the phase structure of a given theory can be dramatically affected by the space geometry. It had been argued Email address: [email protected] (J. Serreau ) in, in the case of an O scalar theory, that a spontaneously broken symmetry gets radiatively restored as a consequence of the large-distance logarithmic behavior of the two-point correlator of a massless field in dS space, in analogy to what happens in flat space in two dimensions. Similarly, a recent explicit calculation of the effective potential of O(N) theories in the large-N limit shows that strong fluctuations of superhorizon modes prevent the possibility of SSB in any space-time dimension. An simple intuitive picture may be that long range order cannot develop because of the existence of a causal horizon. If correct, this would apply to arbitrary value of N, including the discrete symmetry case N = 1. Subsequent studies have been undertaken using either the Hartree approximation or a field theoretical generalization of the Wigner-Weisskopf method, which conclude that SSB is possible in dS space for finite N and that there is a first order transition to a symmetric phase as a function of the dS radius. These studies also find that the would-be-Goldstone excitations acquire a nonzero mass. However, the Hartree approximation is known to erroneously predicts a first order transition and massive Goldstone modes in flat space, due to the neglect of important nonlocal self-energy contributions in the broken phase. This makes the analogous results in dS space dubious. Recently, employing a semiclassical stochastic approach, the authors of conclude to the impossibility of SSB for arbitrary value of N, conforting the results of and the intuitive argument above. In this Letter, we address the question of SSB em-ploying nonperturbative renormalization group (NPRG) techniques. In flat space, the latter have proven powerful tools in a wide variety of physical problems from condensed matter physics, to non-abelian gauge theories or to quantum gravity. The simple local potential approximation (LPA) is able to capture the phase structure of O(N) theories in arbitrary dimension, including nontrivial phenomena in two dimensions such as the Mermin-Wagner theorem for N > 2, or, with the inclusion of an anomalous dimension, the Kosterlitz-Thouless transition for N = 2. The LPA thus provides a unique tool to study the phase structure of O(N) theories in dS space. NPRG techniques have recently been formulated in cosmological spaces in four dimensions in, where the author explicitly derives flow equations in the LPA for the N = 1 theory in the symmetric phase in dS space. Here, we generalize this derivation to arbitrary dimensions, making use of the physical momentum representation of dS correlators, hereafter called the prepresentation. The latter exploits as much as possible dS symmetries in a momentum representation and allows for a transparent formulation of the renormalization group flow directly in physical momentum space. We derive the explicit flow equation for the effective potential in the LPA, including a nonzero anomalous dimension, for superhorizon scales. Introducing appropriately rescaled quantities, we show that, due to strong superhorizon fluctuations, the flow equation has the same form, up to a numerical factor, as the corresponding one in Euclidean space R D with D = 0. As a consequence of this dimensional reduction, the phase structure of the O(N) theory in dS space is similar to that of a zerodimensional Euclidean theory. In particular, a broken symmetry phase is not possible whatever the dimension or the value of N. We illustrate this by computing the flow of the minimum of the potential and show that, under mild assumptions, the latter runs to zero in the IR. General setup Consider the O(N)-symmetric scalar field theory with classical action (a sum over a = 1,..., N is implied) with the invariant measure x ≡ d D x √ −g, on the expanding Poincar patch of a D = (d + 1)-dimensional dS space. In terms of the comoving spatial coordinates X and the conformal time −∞ < < 0, the line-element reads (we choose the Hubble scale H = 1) In Eq., the mass term m 2 dS = m 2 + R includes a possible coupling to the Ricci scalar R = d(d + 1) and is the appropriate Laplace operator. The NPRG is conveniently formulated as a flow equation for the so-called average action at the scale, , which interpolates between the classical action for → ∞ and the full (quantum) effective action for is chosen so as to suppress fluctuations on scales below while leaving high momentum modes unaffected. The average action is defined as is the usual effective action corresponding to the action S + ∆S. The evolution of with the scale is governed by the Wetterich equation where the dot stands for ∂ and the trace concerns both O(N) indices and space-time variables. Here,. A technical remark is in order here. Quantum field theory on cosmological spaces is conveniently formulated as a nonequilibrium-like, initial value problem. In that case, the use of functional techniques requires one to introduce a closed contour C in time. where the time variable runs over the contour C. We now formulate the flow equation in dS space using the p-representation. It is preferable to choose a regulator which respects the symmetries of the problem, here the dS and the O(N) groups. However, it is also desirable to employ a momentum space description, for which the role of the regulator is transparent. The p-representation provides a compromise between those two demands, which are conflicting in dS space. By definition, the regulator R has the same prepresentation as an inverse propagator. Using spatial homogeneity and isotropy in the coordinate system, one writes with K the (conserved) comoving spatial momentum. dS symmetries imply the following p-representation where p = −K and p = −K are the physical momenta associated with the comoving momentum K at times and respectively. The closed time contour C can be traded for a closed momentum contour, on which the functionR is defined. Here, we employ a local, mass-like, O(N)-diagonal regulator where the function R (p) plays the role of a heavy mass for modes p <. The factor p −2 is such that a pindependent function R (p) would indeed correspond to a mass term. We emphasize that a p-dependent function R (p) actually breaks the full dS invariance. This is the price to pay for using a simple local regulator in physical momentum as in. The affine subgroup of the dS group, which underlies the p-representation, is left unbroken. It is important to note that this also assumes a quantum state compatible with the prepresentation. For instance, this includes the class of -vacua, but not the dS-breaking states considered, e.g., in in discussing the quantum stability of dS space. In the following we consider the Bunch-Davies ( = 0) state. Flow of the effective potential Having in mind a derivative expansion, we write where V () is the effective potential at scale and where we included a field-strength renormalization factor Z from which one defines a running anomalous dimension = − /Z. The LPA corresponds to = 0 and is sometimes called the LPA'. We stress that the fully dS invariant ansatz is not the most general one with second order derivatives compatible with the prepresentation. We use it here assuming that dS breaking terms are suppressed in the IR. The effective potential is defined as V () = − −1 =const., where = x is a volume factor. Writing Eq. at constant field, the propagator can be written in the prepresentation. Introducing the comoving Fourier transform as in, one has The function is defined on the closed momentum contour and can be decomposed in terms of a statistical (F ) and a spectral ( ) function as G ab where the sign function is understood on the contour. Note the symmetry propertiesF ab Using Eqs. - in, we obtain, after simple manipulations, We note, in particular, that the volume factors out in the p-representation. Let us first illustrate the flow equation in the deep IR in the case N = 1. With the ansatz, the correlator satisfies the inhomogeneous equation where we defined = d 2 /4 − V ()/Z. Equivalently the functionsF and satisfy a similar equation with right hand side set to zero. The latter are solved asF (p, where the function u satisfies the same homogeneous equation. Following, we employ the simple Litim regulator for which one has Demanding the Bunch-Davies vacuum at large momentum, equations and are solved as with = 2 ( + 1 2 ) and where H (z) is the Hankel function of the first kind. The continuity of u (p) and u (p) at at p = imposes The momentum integral in can be performed exactly. However, we can readily obtain the flow equation in the IR regime, ≪ 1. In this Letter, we are interested in the case of light fields, for which nontrivial infrared effects come into play. More precisely, we assume small curvature V ()/Z < d/2, such that ∈ R. As explained above, this is the case of phenomenological interest for inflationary physics. Moreover, it is the relevant case for the study of the phase structure of O(N) theories in dS space. Indeed, consider the case of a SSB potential at a UV scale ≫ 1. Integrating out subhorizon momenta generates the standard Minkowski flow which brings the effective potential to a very flat shape for scales ∼ 1. Here, we wish to study the further evolution of such a flat potential as one integrates out superhorizon scales. Finally, we mention that the IR finiteness of the flow equation ] and the definition of, we find, up to relative corrections of O( 2 ), c − = 2 ( )/(i ) and c + = −(/2 ) 2 c −. One easily checks that the contribution to from c + in is thus IR suppressed. After some simple calculations we obtain, up to relative corrections of O( 2 ), Here, the trivial dimensional factor d+2 gets modified by a large dynamical contribution ∼ −2 from enhanced IR fluctuations. To obtain a form of the flow equation with no explicit dependence on, we introduce the rescaled variable 2U ()] and the first term in bracket in gets further IR enhanced by a factor −2. We obtain, in the limit ≪ 1, and where the prime denotes a derivative with respect to. As announced, the flow equation is similar to the corresponding one in Euclidean space R D with D = 0, up to the factor A d. One thus expects the phase structure in dS space to be qualitatively the same as that of the flat Euclidean theory in low dimension. The previous analysis is easily extended to N > 1. One has to distinguish longitudinal and transverse modes according to the projectors P L ab = a b / 2 and P T ab = ab − P L ab. In particular, the curvature of the potential now becomes, in terms of the definitions, V () → 2 P L ab + 2 U ()P T ab. After similar manipulations as before, we get, in the limit As before, this equation is similar to the corresponding one in flat Euclidean space with D = 0 and the flow drives the system to the symmetric phase under mild assumptions on and g. For instance, Eq. become We conclude that the NPRG flow equations in the LPA' generically predict that spontaneously broken O(N) symmetries are radiatively restored in dS space in any dimension and for all values of N. This results from an effective dimensional reduction due to strong superhorizon fluctuations. 1 Our findings support the previous results of Refs.. This assumes, in particular, a smooth and small enough anomalous dimension. There are examples in flat space where this is not the case, such as for the Kosterlitz-Thouless transition. It is of great interest to investigate this possibility in the present case. Also of interest is the (numerical) study of the transition from the ultraviolet, where one should recovers the Minkowski flow, to the IR where strong superhorizon fluctuations come into play. Finally, it is important to study the role of possible dS symmetry breaking terms allowed by the prepresentation along the flow. |
<filename>vowpalwabbit/sender.h
/*
Copyright (c) by respective owners including Yahoo!, Microsoft, and
individual contributors. All rights reserved. Released under a BSD
license as described in the file LICENSE.
*/
namespace SENDER{
LEARNER::learner* setup(vw& all, po::variables_map& vm, vector<string> pairs);
}
|
Development and research of multilayer composite coatings with nano-dispersed structure which are deposited on cutting tools using assistance cathode-vacuum-arc processes The authors considered the problem of synthesis of multilayer coatings with nano-dispersed structure using the process of assistance filtered cathode-vacuum-arc deposition. The effect of high-energy assisting ions, generated by a special device (implanter), which the -3 vacuum-arc setting was equipped with, is analyzed in the paper. The mechanisms of modifying the properties of the deposited coatings and cutting properties of carbide inserts with coatings obtained in assisting cathode-vacuum-arc deposition with filtration of ion-vapor flow are analyzed as well. |
1. Field of the Invention
This invention relates to a low power consumption wireless data transmission and control system and, more particularly, to a data control system having a stored computer program and which is effective to receive remotely transmitted shade commands and to articulate a shade in response to the received commands while consuming a relatively small amount of electrical power during times at which no commands are transmitted.
2. Discussion
Battery powered devices are used in many applications to control many types of devices or apparatuses, such as shades, in response to remotely transmitted command signals. These signals are of such types as electro-optical, electro-magnetic, and/or sonic frequency signals.
As the use of battery powered devices becomes more widespread, the need exists to reduce the power consumption of such devices so that batteries become more cost effective as a means of avoiding the costs associated with hard wiring modifications to existing buildings. One such field of use is that of battery operated window treatment articulation. By making such devices battery operated, installers of window treatments can avoid the costs, the disruptions, and the repair to buildings associated with retrofit wiring. In order to make the devices capable of operating long periods of time between replacement of batteries, or during periods of power failure of building electrical systems, or to take advantage of intermittent power or low intensity power sources for recharging batteries, the control system must utilize a minimum of power to remain capable of receiving and processing command data. |
Managing Innovative Trends in Economic Development Technological leaps that occur periodically and replace dominant technologies with more advanced ones lead not only to the reduction of individual production costs below the socially necessary ones, but also provide higher consumer results. In world practice, one of the important instruments of state policy as an innovative trend in the development of the national economy, as well as individual territorial entities, is the priority implementation of the principles of the so-called green economy. At the centre of the transformation of economic models and transition to a green economy there are technologies based on new methods and processes of production and environmentally oriented policy of the state, consistently ensuring the strategic interests of the national and economic security of the country. The goal of transition to a green economy is not only to improve the quality of life of the world's population while minimizing the depletion of natural resources and preserving nature for future generations, but also to create a significant number of jobs. However, in practice, this cannot be done without radical reforms and investments in fixed capital, as well as the implementation of appropriate forms of priority, which do not conflict with other tasks of socio-economic development of the country. The article discusses a number of features associated with the transition of Russia to the formation of a green economy, which are determined by large territories and the heterogeneity of their potential, the issues associated with the transition to the sixth technological mode and the need to have sufficient amount of investment in the key areas of infrastructure, which constitutes the core of the green economy and the involvement of private business in order to attract investment. I. INTRODUCTION The low level of Russian economy development is a serious problem in ensuring its competitiveness in the modern international space. This situation is primarily conditioned on the extremely unsatisfactory pace of transition to the innovative path of development. In this regard, radical transformations in the economy are still relevant, which are based on an innovative mechanism that provides, firstly, the modernization of the existing economy, secondly, the creation of its new infrastructure with key actors of the innovationoriented sphere (government, business, financial and scientific organizations, universities, etc.), based on the technologies of the 6th technological order, and thirdly, the creation of new ways to attract investments. Through such a mechanism, the prospects for technological development of the relevant industry or technical and technological trends corresponding to the new technological order will be formed. In this respect, of course, innovative global trends in the world economy result in transformations, adaptability and new positioning of national economies in the global economic space. At the same time, the adaptive properties of national economies are manifested through an increase in their level of innovation. of cognizability and validity of the innovative development system at macro and micro levels. At the same time, a new strategy for the national economy development based on innovations is possible by making a combination of the abovementioned trends (benchmarks) and ideas about the vision of the economic structure focused on the corresponding priorities. II. METHODS The methodological tools of the problem under study are based on dialectical methods of cognition that provide to study them in a comprehensive and objective mode. The approach to substantiating the vectors of economic development based on the innovative trends management and activation of private business as investors of priority projects is formed using general scientific methods of knowledge: analysis and synthesis of theoretical material, generalization, classification, and grouping. To prove the hypothesis, the method of comparative analysis was used when comparing the accepted approaches to the innovative structure of the national economy. In order to prove the author's idea, a theoretical analysis of the literature devoted to this problem and a comparison of definitions are carried out. At the same time, general scientific methods of abstraction and generalization were used. The main methods of the research are the analysis of publications which offer a description of separate documents, analysis and synthesis of these publications. The expert experience of the authors of this work is also involved. III. RESULTS The rating of the Russian economy according to estimates of international competitiveness by appropriate methods, in particular, the World Economic Forum, the International Institute for Management Development, is at a low level. Thus, according to the rating of global competitiveness of countries (Global Competitiveness Index) for 2017-2018, the parameters relating directly to the state of innovation and finance are as follows: innovation potential -49th place, technological level -57th place, and financial market development -107th place. According to the expert community, this is primarily due to the fact that the Russian economy has a low efficiency of state institutions, and the potential for the development of an innovative economy is insufficient. In particular, the promising technological developments are extremely poorly applied in the economy, which is confirmed by statistics. Thus, no more than 20% of innovative developments are brought to commercial realization in view of the low demand of the real sector of the economy for domestic innovations. There are several reasons. First, the level of spending of Russian enterprises on R&D compared with innovative leaders (2.5-4.5% of GDP) is significantly 2-4 times inferior to foreign ones. Second, the renewal of fixed assets is carried out mainly through the purchase of foreign equipment. In addition, the state of the financial market (as the main source of investment) and investor confidence in it is assessed as unsatisfactory. There is a negative dynamics of demand in the country, as well as a number of other negative factors, which are considered in economic literature in sufficient detail, for example. Meanwhile, business structures compete through unique technologies in today's global market of goods and services. Moreover, the service sector takes a significant part in this process, providing stability in the conditions of fluctuation of the world economy. In this regard, the formation of a model of the national innovation economy is still a problem that requires fundamental changes in the context of the chosen vector of economic development and innovation trends of the world economy. The key trend of all transformations taking place in national economies is the strategic orientation to the formation of the 6th technological order, which allows to form a technical and technological complex within the unity of the technological method of production, functioning on the ground of the basic technology. It seems that in the future, a model of transition to a new economy, based on global trends, should be formed on the ground of a new technological order. First direction. There is a process of digitalization and robotization of the production process in industries, economy sectors and social sphere on a global scale through new digital formats and information channels, creating conditions for the formation of a digital government. Currently, there is a process of information development in the form of formation of motivation to the information society on the basis of modern information and communication technologies ("electronic management"). According to experts in this field of knowledge, we can talk about the transition to a new socio-economic formation in the form of a global information society, the trend of which is the formation of a set of national information infrastructures. In this regard, a special attention should be paid to the experience of formation support of innovative economy in the Republic of Kazakhstan. Second direction. Breakthrough technologies, which result in qualitative changes in the productive forces and structural changes in the economy. Such technologies lead to structural falls in the cost of production and capital expenditures and, as a consequence, low capital intensity of economic growth, increased efficiency and productivity. In addition, national economies have the opportunity to integrate into global value chains, specializing in the production of new types of products and services. However, to do this, it is necessary to offer innovative products and services to the global market, forming new innovative niches. Third direction. Development of technologies for environmentally friendly energy production from renewable sources (energy saving technologies, solar energy, hydrogen energy, etc.). Fourth direction. Formation of a green economy on the basis of innovative technologies that allow to stabilize the Advances in Economics, Business and Management Research, volume 131 ecological system through the effective use of resources. According to experts, priority guidelines are the ones for modern technologies in the field of extraction and use of natural resources, rational use of inexhaustible resources, as well as the return to the production process of end-use products, minimizing the load on the environment . The green economy is based on the priority of economic and technological policies aimed at sustainable development of national economies, including the creation of additional jobs. At the same time, the Russian economy has a sufficient potential of qualified personnel meeting modern requirements in all spheres of activity. In particular, a wide range of innovative educational technologies will allow in the future building a system of inclusive continuing education, close to the frontiers of science and adapted to the abilities of each citizen, as well as to form a self-organizing and selfgoverning environment, effectively extracting new knowledge and effeciently using them in innovative practices. An organized health care system, including the creation of environmentally comfortable living areas, is being built to maintain high working capacity and efficiency of labour resources. It is important to properly allocate goals, objectives and resources to accelerate the creation of a modern innovation system. Of course, the formation of a new economy can not be carried out without radical reforms and investments, among which there are public (budget funds), private (private funds and individual investors), and foreign ones. In contrast to the Russian economy, where the government's share in investment reaches 90%, the share of the government in research funding, on average, is not more than 30% in a number of countries leading the development and implementation of innovative solutions (for example, Germany and Japan). At the same time, the remaining part of the funds is covered by venture capital. It seems that innovative transformations of the Russian economy can be carried out if all levels of financial investments (initial investments, reinvestments, investments for business expansion, and investments for partial changes) are systematically involved. is not comparable with the performance of the leading countries, which is at least thrice inferior to Western European countries (for example, Germany and France). To ensure the parity of public and private capital and development of financing mechanisms it is reasonable to provide: tax advantages for accelerators and business angels; privileges and preferences for business on condition of initiative financing of scientific and technological projects; real and high-quality templates for venture transactions; instruments that ensure the flow of public money in the later stages of venture investment; banking business development by implementing deep transformations that allow to form a segment of highquality borrowers and provide the necessary level of capital to cover the growing risks of innovative projects (including within the framework of national projects); implementation of systemic measures to ensure the investment attractiveness for foreign funds (first of all, the sustainable character of existing preferences, including tax holidays, as well as conditions of fair competition, the availability of quality infrastructure for business development, etc); strengthening of communication between the federal centre and the regions in the field of investment in terms of solving problems related to the investment climate, as one of the important macroeconomic indicators. IV. DISCUSSION Nowadays there is a need to intensify the innovative development of the national economy. Innovative infrastructure of the national economy can be achieved through a fundamental change in the model of ensuring effective interaction of the government with economic entities, including through the improvement of the investment mechanism as a national project. Table I summarizes the topics studied by domestic and foreign authors within the framework of the problem., Glaziev S.Yu, Gokhberg L.M., Kondratiyev N.D., Mindeli L.E., Porter M., Seleznev A.Z., Toffler A., Freeman C., Schumpeter J., etc. Development of innovative activity Duijn JJv., Glaziev S.Yu., Clark J., Mensch G., Schumpeter J., Shumyankova N.V., Yakovets Yu.V., etc. Economic development from the position of formation and functioning of the innovation system as a factor of competitive advantages Abramova M.I., Bondareva N.N., Gokhberg L.M. [ Analyzing various points of view on the presented range of issues, we can conclude that the formation of an effective innovation environment is the implementation of new trends in economic development, which is expressed in a rational combination of priorities of science and production on the basis of an innovative approach. Advances in Economics, Business and Management Research, volume 131 The study conducted shows that an integrated system that provides a sufficiently sustainable development of the economy for the long term in conditions of high variability of the external environment has not been developed. Some elements that are usually considered beyond the system link are emphasized; that also applies to priority national projects. Thus, despite the fact that certain aspects of innovative development of the economy are elaborated in a relatively high degree complex issues of formation and functioning of the innovation system in the transition period to a new technological order remain poorly studied. Thus, the modern approach to the development of the national economy has a number of significant drawbacks. In particular, the priority directions of innovative development of the national economy in the context of the 6th technological order are not identified. In addition, there is no consensus among authors on the choice of these priorities, and a large part of publications does not present their systematization. Only a few publications are devoted to a more detailed analysis and description of innovative trends, the potential of which will largely determine the degree of economic development in the future. Examples include works by D. Bell, P.Drucker, S. Yu. Glazyev, P. S. Zavyalov, L.M. Gokhberg E. Toffler and others . We can assume that there may be other points of view on the formation of a new economy. However, despite the implemented proposals in theory and practice of innovative economic development in the context of global trends and challenges in the field of innovation, there are still a number of unresolved problems. According to authors and economists involved in formation of a fundamentally new national economy, it is necessary to develop a conceptual model of the strategy for innovative development of the economy, focused on the formation of a new technological order. At the same time, the conceptual approach to the formation of an organizational mechanism for creating a new economy based on the innovative trends outlined above should be based on the use of economic laws and conformities in solving the emerging contradictions of the economic system. V. CONCLUSION The modern situation is characterized by a number of features, among which are the following. First, there is a process of global acceleration of technical and technological development, leading to automation and robotization of processes in production and business (artificial intelligence machines, digital technologies, 3D printers in key technological sectors of the economy and others). Secondly, technologies development for environmentally friendly energy production from renewable sources has intensified. Thirdly, the government actively stimulates R&D in priority areas of the green economy, followed by the spread on a global scale in order to stabilize the economic. |
Prospective dog owners have many different breeds to choose from. Dogs vary with regard to temperament, coat type, looks, and even size, giving would-be dog owners many options to find the breeds that may suit their lifestyles. Small dogs tend to be favorites among those who live in apartments or do not have the space or time for the long exercise larger breeds may need. Diminutive breeds also travel more easily than large pooches. Keep in mind, however, that many toy breeds are too delicate to be handled by boisterous children and may require serene home environments. For those searching for a small breed, consider this list, courtesy of the American Kennel Club. |
Show full PR text American Honda Strengthens Auto Sales Division to Accelerate Sales Growth of Honda and Acura Brands
03/10/2014 - TORRANCE, CA
American Honda Motor Co., Inc., will strategically realign its automobile sales and marketing operations into separate divisions organized by brand, as the Honda Division and Acura Division. The moves, effective April 1, are intended to create greater clarity and more cohesive sales and marketing plans that are right for the products and customers of each brand.
In conjunction with the strategy, the following executive changes were announced:
Michael Accavitti will become senior vice president and general manager of the Acura Division. In his new role, Accavitti will be responsible for all sales, marketing and parts and service business for the Acura brand. Accavitti joined Honda in 2011, and is currently the senior vice president of Auto Operations, which includes responsibility for national marketing for the Honda and Acura brands.
Jeff Conrad will become senior vice president and general manager of the Honda Division. Conrad will be responsible for all sales and marketing activities for the Honda brand. Conrad joined American Honda in 1982, and is currently the vice president and general manager of Acura Sales.
American Honda automotive operations have long been separated by function rather than by brand. These moves will result in exclusive divisions, with dedicated sales and marketing teams for Honda and for Acura. Both brands will be housed under a single "American Honda Auto Division" to be headed by John Mendel, executive vice president of what is now called the Automobile Sales Division.
"Our goal is to accelerate the already strong sales growth of the Honda and Acura brands through a more cohesive strategy, with a heightened focus on the unique needs of luxury and mainstream customers," said Mendel. "These moves will more completely align the major activities for the Honda and Acura brands under dedicated brand leaders to take advantage of new opportunities in the marketplace with greater speed and efficiency."
Further, the strategy behind the creation of the Acura Division coincides with the recently announced establishment of a new Acura Business Planning Office, also effective April 1. This new entity will focus on strengthening the business and product strategies for the Acura brand. Erik Berkman, currently president of Honda R&D Americas, Inc., will become an executive vice president of Honda North America, Inc., and will lead the Acura Business Planning Office.
"The realignment strategy that has created a new Acura Division reflects our growing commitment and the increased level of resources and leadership we are focusing on the Acura brand on a global basis," said Mendel.
In addition to steady sales growth for the Honda and Acura brands in each of the past two years, both brands will continue to introduce new models in 2014. This spring, Honda will launch the all-new 2015 Honda Fit, to be followed later this year by an all-new compact Honda SUV. The Acura brand will introduce the all-new 2015 Acura TLX luxury performance sedan by mid-year.
"The best time to make a change is when you're in a position of strength and we are not only coming off a great sales year, we are continuing to create new opportunities with a series of new and exciting Honda and Acura models," said Mendel.
American Honda enjoyed near record automobile sales of 1,525,312 vehicles in 2013, the second best sales total in company history. Sales of Honda brand cars and trucks totaled 1,359,876 vehicles, an increase of 7.4 percent. Honda was led by the success of core models, with the Honda CR-V posting all-time record sales in 2013 to rank as the top-selling SUV in America, the Civic ranking as the top-selling compact car, the Odyssey ranking as the top-selling minivan, and Accord ranking as the best-selling car in America with individual car-buyers.
Sales of Acura brand cars and trucks totaled 165,436 vehicles, an increase of 5.9 percent, and its best sales total since 2007. Further, sales of the Acura MDX and RDX in 2013 combined to achieve Acura's best sales year ever for light trucks.
Every major automaker has a different way of relating between its various divisions and brands. At Volkswagen , for example, the individual brands seem to operate with a large degree of autonomy. Under the Renault Nissan Alliance, the two units share a common chief executive, but little else. The relationship between Honda and its luxury division Acura has always been rather close, but that's all about to change.American Honda Motor Company has always handled sales and marketing in the North American market for both the Honda and Acura divisions, but new reorganization plans call for the two units to be separated under their own direction. Leading the Acura division will be Michael Accavitti, who moves into the position from his role as Senior Vice President for Auto Operations at American Honda. The Honda division will meanwhile be taken over by the current head of Acura sales, Jeff Conrad.Both will report to John Mendel, the current executive vice president of the Automobile Sales Division that is being rebranded as the American Honda Auto Division. Unlike rivals Lexus and Infiniti – two brands that Acura beat to the market – Honda barely markets its luxury brand outside of North America. Its overseas presence is felt only in China, though we've yet to receive word on how the reorganization might effect that market – or for that matter, any potential of expanding into others.This reorganization is seen as a vital step in revitalizing the Acura brand, accompanied by a product line overhaul that's concentrating on new sedans like the ILX TLX and RLX , but also promises to yield new crossovers and the new NSX as its halo model. The reorganization takes effect on April 1, which may ring some alarm bells on the hoax-o-meter, but this wouldn't strike us as a very funny joke if it were one. Scroll down for the official announcement. |
In this Walk the Talk on NDTV 24×7 with The Indian Express Editor-in-Chief Shekhar Gupta, ISRO Chairman K Radhakrishnan speaks about the indigenous cryogenic engine that launched GSLV-D5 and why the Mars Orbiter Mission is crucial for India.
In this Walk the Talk on NDTV 24×7 with The Indian Express Editor-in-Chief Shekhar Gupta, ISRO Chairman K Radhakrishnan speaks about the indigenous cryogenic engine that launched GSLV-D5 and why the Mars Orbiter Mission is crucial for India.
Advertising
I’m at Antariksh Bhavan in Bangalore, the headquarters of the Indian Space Research Organisation (ISRO), where you see many smiles wherever you go and nobody is smiling more happily than its Chairman Dr K Radhakrishnan. One can’t find a space scientist with a more diverse portfolio — the Mars mission, the lunar mission, GSLV and then your own Tsunami Warning Centre, and the 24×7 Disaster Management Centre. You are a man of many parts.
The Indian space programme is people-centric and application-centric. That’s our USP, that whatever we do, it should finally find a place for the common man.
And you have had about eight launches in seven months?
Yes, since July 2013, we have had eight successful missions — PSLVs, a few satellites, the Mars Orbiter Mission and the latest GSLV-D5 with the Indian cryogenic engine and stage.
Teach us some rocket science… explain to people who can’t tell the difference between geostationary and polar.
Essentially, when we talk about a satellite doing remote-sensing, it has to go above the Earth from pole to pole. As the Earth rotates, and the satellite goes from pole to pole, the cameras in the satellite would be able to see the entire Earth. It can take pictures, as and when you require or periodically. In the case of communication satellites, what we do is put a satellite at an altitude of 36,000 km above the equator. The satellite would take 24 hours for one revolution, which is equal to what it takes for the Earth too (to rotate on its axis). So the satellite would be geostationary, that is, a stationary object with respect to us on the Earth. So these are the two things we generally talk about. The Polar Satellite Launch Vehicle can launch remote-sensing satellites, satellites for space science experiments, satellites for communication, it has also launched Chandrayaan and the Mars Orbiter. So in the PSLV family, we have three vehicles. Now, GSLV is a more powerful vehicle. The core stage of PSLV is used in GSLV too. The second stage of PSLV is adapted and used in GSLV.
Advertising
More or less replicated?
Yes, and here you will see large strap-ons, liquid engine-based strap-ons.
And I believe each one of them carries 200 tonnes of fuel?
Each of them carries 40 tonnes and the core has 139 tonnes of solid propellant. But the most important and crucial element of GSLV is the cryogenic upper stage and that’s what we tested successfully.
Sir, now that I am getting my tutorial on rocket science, tell us the meaning of cryogenic. I know ‘cryo’ is something that is cold.
There are three varieties of propulsion used for rockets. One is the solid propellant base. That means you have got the solid fuel and the solid oxidiser, plus a few additives. This can be used in the lower stages of the vehicle. It’s easy to handle once you prepare it. But when you talk about the liquid engine, there is an oxidiser and fuel. The fuel can be kerosene or liquid hydrogen. When it is liquid hydrogen, we call it cryogenic.
And now you go on to your next GSLV.
If you look at GSLV Mark III, which we are now developing, it is far more powerful compared to GSLV. In GSLV, we can put a 2,200 kg satellite into a geostationary transfer orbit — that means in an orbit where the apogee is 36,000 km and perigee is 200 km — whereas in GSLV Mark III, we can take to the orbit a satellite of 4,000 kg. So that’s almost double the capacity.
Sir, if you can explain perigee and apogee…
Perigee means the distance closest to the Earth and apogee is the farthest point.
So, as it goes into elliptical orbit around the Earth, sometimes it will be closer, sometimes it will be farther?
Exactly. So using the propulsion system in the satellite, we move it into a 36,000 km circular orbit and take it to a place above the equator.
So when are you planning this launch, the next landmark?
The first landmark is an experimental mission where we will look at the atmospheric phase of this flight and we will use a passive ignition stage, in the sense that it won’t ignite. But all the lower stages will perform and we will monitor the performance of this vehicle in the crucial atmospheric phase. This is going to happen by April 2014.
By testing out its response to atmospheric conditions, you mean that in the first 30-40 km, it will face winds and pressures which don’t exist in outer space?
Right.
So when do you expect the full launch of this?
The full launch should be possible by 2016-17. What we have done now is testing of the engine. Some of the stage components have also been tested. So for the next two years, we will go through a qualification programme for the engine as well as the stage. Once it is completed, then we will be able to release this vehicle.
Then we can launch much bigger satellites for which we today have to go overseas?
We will be able to launch communication satellites weighing about 3,500 kg to 4,000 kg. Today we do it through Ariane-5 rockets.
So, what happened in the past? Why has GSLV given us such trouble?
There are two reasons. GSLV, of course, is a beautiful vehicle and a simpler vehicle, except for the complex cryogenic stage. GSLV derives its heritage from the sub-systems of PSLV, in terms of the solid core stage and the liquid strap-ons and the second stage. It uses liquid propulsion where we need to get a lot of controlled components. During the flight or during the preparation phase, it can leak a little bit. The second part is incidental — in the first GSLV flight that was done in 2001, one of the strap-ons did not ignite, it did not get the fuel. But there was an inbuilt system for aborting the flight… that worked beautifully and the flight was aborted. Within 22 days — it was a record — our people brought it back to the launch pad.
And the whole thing was saved?
Yes. But the satellite did not stay there for more than two months because the Russian cryogenic stage at that time did not perform to its required level. It was underperformance of that stage but nevertheless it is a first developmental flight of GSLV and a very crucial milestone for the country. The second and third flights of GSLV worked very well. It launched GSAT2 and GSAT3, what you call Edusat. In the GSLV flight that we did in 2006, one of the components in a strap-on did not perform properly. That means the vehicle had to go with only three strap-ons. It was a failure. The next flight that we undertook in 2007, the control system of one of the strap-ons failed. However, the vehicle was able to put the satellite into an orbit very close to where we wanted it. And then the satellite propulsion system was used to take the satellite, INSAT-4CR, into the right place. So nothing was basically wrong with GSLV but component failure resulted in these few failures. In 2010, we had two flights. The first one was to test our Indian cryogenic engine and stage. Here too the vehicle beautifully performed up to the end of the second stage. The cryo stage ignited and we were very happy at that time. But immediately after that, a fuel booster turbo pump stopped.
Why did that happen?
We investigated and found there are three possibilities. One, of course, is contamination. It is sitting in a liquid hydrogen tank. It is at very low temperature and…
How low?
It is 20 Kelvin or -253°C. There are dissimilar materials used in the pump and the contractions will not be uniform. We also had a possibility of a casing of the pump coming out, so these two had to be corrected. But later we found out that the most probable cause was contamination from a propellant acquisition system kept in the liquid hydrogen tank. So we replaced that, redesigned it and got a new one. We also tested this pump extensively in this low temperature condition and ensured that it works. The second part of it was, had this pump worked, are we sure that the rest of the functions would take place? We did a lot of analysis and simulation. And one thing we wanted to make sure before we took off again was to see that this cryogenic engine ignites and we are sure about it at this high altitude condition where there is vacuum. We had not tested this in the past on the ground. So we created a test facility at Mahendragiri (Tamil Nadu) and then we tested it and saw to it that we are confident about it.
So that’s why this launch with an Indian cryogenic engine is such a landmark?
It’s three years of work, during which we did 45 tests on the ground on the cryogenic engine and stage. Also, why did the GSLV configuration fail? Is there something fundamentally wrong it? We did nearly 850 wind tunnel tests.
But now you don’t have that doubt?
Now, we don’t have that doubt.
So we can take the view that your successful GSLV with your own cryogenic engine is an even bigger landmark than the Mars Mission, which was ahead of the lunar mission.
Both are landmarks. One, in terms of technology, cryogenic technology is complex and we have done it.
It greatly increases your range and payload.
Yes, and the capability of India to launch heavier satellites has now been established. The Mars Orbiter Mission is critical for space exploration. It also shows India’s capability to take a spacecraft to a distance of 400 million km, control it properly there and then conduct experiments
But sir, there is also scepticism. After so many rovers, so many landers, what will this bring back?
The objective of this mission is to prove our technological capability to precisely orbit a satellite around Mars. There have been 51 Mars missions; only 21 were successful. Secondly, the scientific objective is to study the presence of methane. Why is methane important? We want to understand the existence of life on Mars.
Could we find something that has not already been explored, given so many missions that have been successful?
The presence of methane or otherwise, and the origin of that, whether it is geological or biological, that is something that this mission is going to look at. Also, the atmospheric processes on Mars…
Well, the remarkable thing is the cost of the mission.
Cost and time, both. We have done it at 1/10th the cost.
There is one more reason why this cryogenic is important. Because I was a sort of a participant in the tamasha that went on more than two decades earlier, of how this programme got a setback (the spy scandal). I used to then work for India Today and I had done a story saying these allegations of spying were wrong. Have you reflected very much on that? Was it a setback to ISRO?
The programme goes on. We have come out of all those and today we have the technology with us.
What is it that makes ISRO different? Somehow, ISRO manages to do more tangible work than most other government organisations.
When we conceive a programme, we look at how it is going to be useful for people, how to reach it to people and how to build systems so that it becomes part of the value chain of those people.
But you also have a better industry interface.
Yes, we had decided from the seventies that Indian industries, both public and private, are going to be part of us. We also make the best use of the academic community in doing research activities.
You got your MBA from IIM-Bangalore before you got your PhD from IIT-Kharagpur.
That’s true.
So you are a businessman as well as a scientist. What made you go for an MBA before you went to research?
Because of the uncertainty involved in high-technology programmes like space, they had to use several of these management techniques.
But your commercial arm Antrix has been struggling a little bit?
If you look at the turnover of Antrix, it has been going up. We recently launched a SPOT 6 satellite, one of the best remote sensing satellites in the world, and SPOT 7 is ready to be launched.
I know remote-sensing is your own special field of interest.
That’s true. Antrix has been contributing a lot to the communication satellite programme. A number of satellites of foreign countries are lined up for launch using our PSLV. The recently launched microwave remote sensing satellite… is also going to be used by foreign customers through an arrangement with Antrix.
But Antrix also got an undue share of controversy for getting into an arrangement with a private company. Two things appeared, one the word ‘spectrum’; second, the word ‘private company’. And somebody even put a figure of Rs 2 lakh crore, because we can’t settle for less than that for a scandal now.
Yes, much has been talked and written about this subject. Over the last three-and-a-half years, we have done what is best for the country, what is best for the government of India, what is best for research.
Was the controversy avoidable? Because there was no scandal.
I don’t want to get into the merit of it because it is going through a legal process at the moment. But what has been done is best for the country.
You have done the damage control?
Yes.
Kiran Karnik was on this show and he said that having seen so much of the government of India, so much of India, he has never found another Indian organisation with a commitment and integrity to match ISRO’s, which is a high compliment.
Thank you. We have done what we thought and what we think is best for the country.
And you have a track record to deserve the highest of compliments. Dr Radhakrishnan, thank you very much. I know you have many more frontiers to climb and they wait— one in April and one in a couple of years from now. And towards the end of this year, you put your Mars Orbiter in space.
September 24, 2014 is a crucial day for the Mars Orbiter, when we have to precisely reduce the velocity of the spacecraft and make it orbit. If we miss that, then we lose the mission. But we are hopeful.
Advertising
I am sure you will take no chances. Because one thing that intrigues me all the time is how religious many of your scientists are — you find coconuts being broken, pujas, mantras…
We are all Indians…
So, science or no science… you see no contradiction?
We don’t see any contradiction.
Transcribed by Sonam Chauhan |
Batson caught eight passes for 82 yards while appearing in 11 games in 2018.
Analysis: Batson joined the Titans as an undrafted free agent. Though his production was small, the fact that he made the roster for an extended period suggests he's got a chance to earn a larger role in the future. He'll look to earn more than a fringe receiver assignment in 2019.
Batson hauled in one of his two targets for seven yards in Sunday's 26-22 win over the Jets.
Analysis: Batson recorded at least one catch for his sixth consecutive game, though he has seen extremely limited volume in that span. Given the return of Taywan Taylor and the extensive involvement of Titans' tight ends in the passing attack, that's unlikely to change at any point this season.
Batson hauled in his lone target for 13 yards in Monday's 34-17 loss to the Texans.
Analysis: The continued absence of Taywan Taylor (foot) kept regular snaps open for Batson, but the slot man once again failed to draw many looks. He's recorded at least one or two catches in five consecutive games but has yet to find the end zone and hasn't exceeded 36 yards in any contest.
Batson caught his lone target for five yards and carried the ball once for one yard in Sunday's 38-10 loss to the Colts.
Analysis: Batson filled the role of third receiver in place of the injured Taywan Taylor (foot), though his contributions were limited. His lone target was from Marcus Mariota, which came midway through the second quarter. Playing in a low-volume offense, Batson is unlikely to see enough targets to be a viable fantasy option even if Taylor remains sidelined.
Batson caught two of his three targets for 36 yards in Sunday's 34-10 win against the Patriots.
Analysis: With Taywan Taylor sidelined, Batson matched the target totals of both Tajae Sharpe and Jonnu Smith. While his small frame and lack of college production make him a long shot to consistently produce, he does boast impressive athleticism. Though the Titans' offense has shown improvement across the last two weeks, they remain a low-volume passing offense, making his odds even longer to become a meaningful fantasy contributor this season.
Coach Mike Vrabel said Batson would receive more opportunities in the Titans' future games after the wideout recorded two receptions for 21 yards on three targets during Monday's 28-14 win over the Cowboys.
Batson caught two of his three targets for 21 yards in Monday's 28-14 win over the Cowboys.
Analysis: Batson appeared in the third game of his rookie campaign, recording the first multi-catch effort of his career. He wasn't a prolific producer in college, but does boast an 88th percentile SPARQ-x score. While he's not a household name, his exceptional athleticism and the lack of quality receiving options in Tennessee make him a name to monitor in deeper dynasty leagues.
Tennessee Titans wide receiver Cameron Batson is tackled in the end zone by Jacksonville Jaguars line backer Leon Jacobs. |
/*!
* \brief Use to declare the local print capability
*/
class IdaPrintCapability : public PrintLanguageCapability
{
private:
static IdaPrintCapability inst;
explicit IdaPrintCapability();
IdaPrintCapability(const IdaPrintCapability&) = default;
IdaPrintCapability& operator=(const IdaPrintCapability&) = default;
IdaPrintCapability(IdaPrintCapability&&) noexcept = default;
IdaPrintCapability& operator=(IdaPrintCapability&&) noexcept = default;
public:
PrintLanguage* buildLanguage(Architecture* glb) override;
} |
<filename>pycolortools/CIEXYZ.py<gh_stars>0
#
# Copyright 2015 <NAME>, VTT Technical Research Center of Finland
#
# 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.
#
import io
import warnings
from pkg_resources import resource_string
from scipy.interpolate import griddata
import numpy as np
from . import ColorTransforms, Illuminants
warnings.simplefilter("always")
class CIEXYZ(object):
def __init__(self):
'''
Constructor
'''
self.ct = ColorTransforms.ColorTransforms()
self.illuminants = Illuminants.Illuminants()
######################################
data = resource_string(__name__, "data/CIE_1931_STDcolorObs.txt")
# Load CIE 1931 2deg standard observer data
dtypes = {'names': ['wavelen', 'x', 'y', 'z'],
'formats': [float, float, float, float]
}
self.observer2Data1931 = np.genfromtxt(io.BytesIO(data),
dtype=dtypes)
# print(self.observer2Data1931)
# Load CIE 1964 10deg standard observer data
data = resource_string(__name__, "data/CIE_1964_STDcolorObs.txt")
dtypes = {'names': ['wavelen', 'x', 'y', 'z'],
'formats': [float, float, float, float]
}
self.observer10Data1964 = np.loadtxt(io.BytesIO(data), dtype=dtypes)
######################################
data = resource_string(__name__, "data/CIE_2006_STDcolorObs_2deg.txt")
# Load CIE 2006 2deg standard observer data
dtypes = {'names': ['wavelen', 'x', 'y', 'z'],
'formats': [float, float, float, float]
}
self.observer2Data2006 = np.loadtxt(io.BytesIO(data), dtype=dtypes)
self.observer2Data = self.observer2Data1931
# Load CIE 2006 10deg standard observer data
data = resource_string(__name__, "data/CIE_2006_STDcolorObs_10deg.txt")
dtypes = {'names': ['wavelen', 'x', 'y', 'z'],
'formats': [float, float, float, float]
}
self.observer10Data2006 = np.loadtxt(io.BytesIO(data), dtype=dtypes)
self.observer10Data = self.observer10Data1964
######################################
# Load Test Sample Spectrums
data = resource_string(__name__, 'data/TCS1-14Spectrum.txt')
dtypes = {'names': ['wavelen', 'TCS01', 'TCS02',
'TCS03', 'TCS04', 'TCS05', 'TCS06', 'TCS07',
'TCS08', 'TCS09', 'TCS10', 'TCS11', 'TCS12',
'TCS13', 'TCS14', 'TCS15'],
'formats': [float, float, float, float, float,
float, float, float, float, float,
float, float, float, float, float,
float]
}
self.tscSpect = np.loadtxt(io.BytesIO(data),
dtype=dtypes, delimiter=',')
def calculateLumFluxFromSpectrum(self, wavelen, intens, observer=2):
'''
Calculates luminous flux for given spectra.
wavelen in nm
'''
if observer == 2:
y = griddata(self.observer2Data['wavelen'],
self.observer2Data['y'], wavelen, fill_value=0.0)
else:
y = griddata(self.observer10Data['wavelen'],
self.observer10Data['y'], wavelen, fill_value=0.0)
return 683.002 * np.trapz(y * intens, x=wavelen)
def calculateCCT(self, xyz):
'''
Calculates the correlated color temperature.
Approximation for range 3 000K - 800 000K
'''
xe = 0.3366
ye = 0.1735
A0 = -949.86315
A1 = 6253.80338
t1 = 0.92159
A2 = 28.70599
t2 = 0.20039
A3 = 0.00004
t3 = 0.07125
n = (xyz[0] - xe) / (xyz[1] - ye)
# Approximation for range 3 000 - 50 000 K
CCT = A0 + A1 * np.exp(-n / t1) + A2 * \
np.exp(-n / t2) + A3 * np.exp(-n / t3)
# Approximation for range 2856K - 6504K
if CCT < 3000:
n = (xyz[0] - 0.3320) / (xyz[1] - 0.1858)
CCT = -449.0 * n ** 3 + 3525.0 * n ** 2 - 6823.3 * n + 5520.33
if CCT < 2856.0:
warnings.warn('CCT out of approximation range')
# Range 50 000 - 800 000 K
elif CCT > 50000.0:
xe = 0.3356
ye = 0.1691
A0 = 36284.48953
A1 = 0.00228
t1 = 0.07861
A2 = 5.4535e-36
t2 = 0.01543
n = (xyz[0] - xe) / (xyz[1] - ye)
CCT = A0 + A1 * np.exp(-n / t1) + A2 * \
np.exp(-n / t2) + A3 * np.exp(-n / t3)
if CCT > 800000.0:
warnings.warn('CCT out of approximation range')
CCT = np.NAN
return CCT
def cieXYZFromSpectrum(self, wavelen, intens,
reflect=None,
observer=2,
normalize=100.0):
'''
Will calculate the tristimulus values for given spectra.
Y is normalized to 100 by default.
wavelen in nm
Use normalize = None for no normalization
observer = 2 for CIE 1931 2 deg std observer
observer = 10 for CIE 1964 10 deg std observer
reflect is an array of reflectance or transmittance coefficients [0,1],
if None, they all will be ones.
'''
if observer == 2:
x = griddata(self.observer2Data['wavelen'],
self.observer2Data['x'], wavelen, fill_value=0.0)
y = griddata(self.observer2Data['wavelen'],
self.observer2Data['y'], wavelen, fill_value=0.0)
z = griddata(self.observer2Data['wavelen'],
self.observer2Data['z'], wavelen, fill_value=0.0)
else:
x = griddata(self.observer10Data['wavelen'],
self.observer10Data['x'], wavelen, fill_value=0.0)
y = griddata(self.observer10Data['wavelen'],
self.observer10Data['y'], wavelen, fill_value=0.0)
z = griddata(self.observer10Data['wavelen'],
self.observer10Data['z'], wavelen, fill_value=0.0)
if reflect is None:
reflect = np.ones(len(x), dtype=float)
X = np.trapz(x * reflect * intens, x=wavelen)
Y = np.trapz(y * reflect * intens, x=wavelen)
Yn = np.trapz(y * intens, x=wavelen)
Z = np.trapz(z * reflect * intens, x=wavelen)
XYZ = np.array([X, Y, Z], dtype=float)
# Normalize
if normalize is not None:
XYZ /= Yn
XYZ *= normalize
return XYZ
def ciexyzFromXYZ(self, XYZ):
L = np.sum(XYZ)
return XYZ / L
def ciexyzFromSpectrum(self, wavelen, intens, reflect=None):
return self.ciexyzFromXYZ(self.cieXYZFromSpectrum(wavelen,
intens,
reflect=reflect
)
)
def calculateCRI(self, wavelen, intens):
'''
Calculates CIE 1995 CRI values
wavelen in nm
'''
# Get color coordinates
xyz = self.ciexyzFromSpectrum(wavelen, intens)
uv = self.ct.transformToCIEuv(xyz)
T = self.calculateCCT(xyz)
if T > 1.0e100:
return np.zeros(15)
# Select reference source
if T < 5000:
refIntens = self.illuminants.blackbodySpectrum(wavelen, T)
else:
refIntens = self.illuminants.illuminantD(wavelen, T)
ref_xyz = self.ciexyzFromSpectrum(wavelen, refIntens)
ref_uv = self.ct.transformToCIEuv(ref_xyz)
if np.sqrt(np.sum((uv - ref_uv) ** 2)) > 5.4e-3:
warnings.warn('Test light not white enough! CRI has no meaning!')
CRI = np.zeros(15)
for tsc in np.arange(1, 15):
sampleSp = self.testSampleSpectrum(wavelen, tsc)
# Illuminate Test samples under reference light
refTest_XYZ = self.cieXYZFromSpectrum(wavelen,
refIntens,
reflect=sampleSp)
# Illuminate Test samples under test light
test_XYZ = self.cieXYZFromSpectrum(wavelen,
intens,
reflect=sampleSp)
refTest_xyz = self.ct.transformToxyz(refTest_XYZ)
test_xyz = self.ct.transformToxyz(test_XYZ)
refTest_uv = self.ct.transformToCIEuv(refTest_xyz)
test_uv = self.ct.transformToCIEuv(test_xyz)
test_uv_adapt = self.chromaticAdaptation(uv, ref_uv, test_uv)
refTest_UVW = self.ct.transformToCIEUVW(refTest_uv,
ref_uv,
refTest_XYZ[1])
test_UVW = self.ct.transformToCIEUVW(test_uv_adapt,
ref_uv,
test_XYZ[1])
CRI[tsc] = 100.0 - 4.6 * \
np.sqrt(np.sum((test_UVW - refTest_UVW) ** 2))
# 0-100 Scaling
CRI[1:] = 10.0 * np.log(np.exp(CRI[1:] / 10.0) + 1.0)
CRI[0] = np.average(CRI[1:9])
return CRI
def testSampleSpectrum(self, wavelen, TCS=1):
'''
Returns the spectrum of CIE Standard test color sample 1-14
wavelen in nm
'''
return griddata(self.tscSpect['wavelen'],
self.tscSpect['TCS{:{fill}2d}'.format(TCS, fill=0)],
wavelen, fill_value=0.0)
def chromaticAdaptation(self, uvt, uvr, uvi):
'''
CIE (1995) uses this von Kries chromatic transform equation.
Arguments:
uvt: Test light chromaticity values u, v (numpy array or list)
uvr: Reference lamp chromaticity values u, v
uvi: TCS test sample chromaticity values u, v
Returns numpy array of chromaticly adapted [u,v]
'''
ct = (4.0 - uvt[0] - 10.0 * uvt[1]) / uvt[1]
dt = (1.708 * uvt[1] - 1.481 * uvt[0] + 0.404) / uvt[1]
cti = (4.0 - uvi[0] - 10.0 * uvi[1]) / uvi[1]
dti = (1.708 * uvi[1] - 1.481 * uvi[0] + 0.404) / uvi[1]
cr = (4.0 - uvr[0] - 10.0 * uvr[1]) / uvr[1]
dr = (1.708 * uvr[1] - 1.481 * uvr[0] + 0.404) / uvr[1]
return np.array([(10.872 + 0.404 * cr / ct * cti - 4.0 * dr /
dt * dti) /
(16.518 + 1.481 * cr / ct * cti - dr / dt * dti),
(5.520) /
(16.518 + 1.481 * cr / ct * cti - dr / dt * dti)
])
|
Clark is a breaking news reporter for IBT. He grew up in Idaho, but only knows a couple of cool facts about potatoes. He's reported for the Philadelphia Inquirer, CQ Roll Call, OpenSecrets.org and the Arizona Daily Sun.
First lady Michelle Obama was scheduled to deliver her final remarks in the White House Friday.
In letters recently sold, Princess Diana wrote about her two then-children sons.
The wise men presented the child with gold, frankincense and myrrh, according to legend, and the “king of the Jews” was seen by the world.
Most of the ticket sales for the U.S. tour in 2017 go on sale in early January.
Hamza bin Laden, a son of Osama bin Laden, was officially named as a terrorist Thursday by the State Department.
The Tennessee twins, separated in November, are progressing well in their recovery.
Trump has sided with Assange on the hacking question, arguing against American intelligence officials.
Charles Manson is in the hospital and out of prison but most of his followers are still behind bars.
Millennial women in their 20s have closed the gender pay gap.
SpaceX plans to launch this weekend after a four month grounding.
Scientists say that 2016 set a record for warmest year.
Some senators are concerned with Trump's cozy relationship with Russia.
Rain and snow in the Sierra Nevada mountains could help California during its long drought.
Queen Elizabeth, who is battling a cold, is the longest serving monarch in the world.
The earthquakes hit in a zone that could have triggered major devastation in big population areas like Los Angeles.
Quotes from the famed author on his birthday.
The space administration is set to launch a couple new programs and could rely increasingly on private partnerships.
Luggage belonging to one of the passengers of the plane that went missing last week has been found.
Photos and videos of the attack have emerged showing the gunman as he attacked the popular Reina nightclub. |
/**
* Test : Implementation of ComponentefinancieroService
*/
@RunWith(MockitoJUnitRunner.class)
public class ComponentefinancieroServiceImplTest {
@InjectMocks
private ComponentefinancieroServiceImpl componentefinancieroService;
@Mock
private ComponentefinancieroPersistenceJPA componentefinancieroPersistenceJPA;
@Mock
private ComponentefinancieroServiceMapper componentefinancieroServiceMapper;
private ComponentefinancieroFactoryForTest componentefinancieroFactoryForTest = new ComponentefinancieroFactoryForTest();
private ComponentefinancieroEntityFactoryForTest componentefinancieroEntityFactoryForTest = new ComponentefinancieroEntityFactoryForTest();
private MockValues mockValues = new MockValues();
@Test
public void findById() {
// Given
Long id = mockValues.nextLong();
ComponentefinancieroEntity componentefinancieroEntity = componentefinancieroPersistenceJPA.load(id);
Componentefinanciero componentefinanciero = componentefinancieroFactoryForTest.newComponentefinanciero();
when(componentefinancieroServiceMapper.mapComponentefinancieroEntityToComponentefinanciero(componentefinancieroEntity)).thenReturn(componentefinanciero);
// When
Componentefinanciero componentefinancieroFound = componentefinancieroService.findById(id);
// Then
assertEquals(componentefinanciero.getId(),componentefinancieroFound.getId());
}
@Test
public void findAll() {
// Given
List<ComponentefinancieroEntity> componentefinancieroEntitys = new ArrayList<ComponentefinancieroEntity>();
ComponentefinancieroEntity componentefinancieroEntity1 = componentefinancieroEntityFactoryForTest.newComponentefinancieroEntity();
componentefinancieroEntitys.add(componentefinancieroEntity1);
ComponentefinancieroEntity componentefinancieroEntity2 = componentefinancieroEntityFactoryForTest.newComponentefinancieroEntity();
componentefinancieroEntitys.add(componentefinancieroEntity2);
when(componentefinancieroPersistenceJPA.loadAll()).thenReturn(componentefinancieroEntitys);
Componentefinanciero componentefinanciero1 = componentefinancieroFactoryForTest.newComponentefinanciero();
when(componentefinancieroServiceMapper.mapComponentefinancieroEntityToComponentefinanciero(componentefinancieroEntity1)).thenReturn(componentefinanciero1);
Componentefinanciero componentefinanciero2 = componentefinancieroFactoryForTest.newComponentefinanciero();
when(componentefinancieroServiceMapper.mapComponentefinancieroEntityToComponentefinanciero(componentefinancieroEntity2)).thenReturn(componentefinanciero2);
// When
List<Componentefinanciero> componentefinancierosFounds = componentefinancieroService.findAll();
// Then
assertTrue(componentefinanciero1 == componentefinancierosFounds.get(0));
assertTrue(componentefinanciero2 == componentefinancierosFounds.get(1));
}
@Test
public void create() {
// Given
Componentefinanciero componentefinanciero = componentefinancieroFactoryForTest.newComponentefinanciero();
ComponentefinancieroEntity componentefinancieroEntity = componentefinancieroEntityFactoryForTest.newComponentefinancieroEntity();
when(componentefinancieroPersistenceJPA.load(componentefinanciero.getId())).thenReturn(null);
componentefinancieroEntity = new ComponentefinancieroEntity();
componentefinancieroServiceMapper.mapComponentefinancieroToComponentefinancieroEntity(componentefinanciero, componentefinancieroEntity);
ComponentefinancieroEntity componentefinancieroEntitySaved = componentefinancieroPersistenceJPA.save(componentefinancieroEntity);
Componentefinanciero componentefinancieroSaved = componentefinancieroFactoryForTest.newComponentefinanciero();
when(componentefinancieroServiceMapper.mapComponentefinancieroEntityToComponentefinanciero(componentefinancieroEntitySaved)).thenReturn(componentefinancieroSaved);
// When
Componentefinanciero componentefinancieroResult = componentefinancieroService.create(componentefinanciero);
// Then
assertTrue(componentefinancieroResult == componentefinancieroSaved);
}
@Test
public void createKOExists() {
// Given
Componentefinanciero componentefinanciero = componentefinancieroFactoryForTest.newComponentefinanciero();
ComponentefinancieroEntity componentefinancieroEntity = componentefinancieroEntityFactoryForTest.newComponentefinancieroEntity();
when(componentefinancieroPersistenceJPA.load(componentefinanciero.getId())).thenReturn(componentefinancieroEntity);
// When
Exception exception = null;
try {
componentefinancieroService.create(componentefinanciero);
} catch(Exception e) {
exception = e;
}
// Then
assertTrue(exception instanceof IllegalStateException);
assertEquals("already.exists", exception.getMessage());
}
@Test
public void update() {
// Given
Componentefinanciero componentefinanciero = componentefinancieroFactoryForTest.newComponentefinanciero();
ComponentefinancieroEntity componentefinancieroEntity = componentefinancieroEntityFactoryForTest.newComponentefinancieroEntity();
when(componentefinancieroPersistenceJPA.load(componentefinanciero.getId())).thenReturn(componentefinancieroEntity);
ComponentefinancieroEntity componentefinancieroEntitySaved = componentefinancieroEntityFactoryForTest.newComponentefinancieroEntity();
when(componentefinancieroPersistenceJPA.save(componentefinancieroEntity)).thenReturn(componentefinancieroEntitySaved);
Componentefinanciero componentefinancieroSaved = componentefinancieroFactoryForTest.newComponentefinanciero();
when(componentefinancieroServiceMapper.mapComponentefinancieroEntityToComponentefinanciero(componentefinancieroEntitySaved)).thenReturn(componentefinancieroSaved);
// When
Componentefinanciero componentefinancieroResult = componentefinancieroService.update(componentefinanciero);
// Then
verify(componentefinancieroServiceMapper).mapComponentefinancieroToComponentefinancieroEntity(componentefinanciero, componentefinancieroEntity);
assertTrue(componentefinancieroResult == componentefinancieroSaved);
}
@Test
public void delete() {
// Given
Long id = mockValues.nextLong();
// When
componentefinancieroService.delete(id);
// Then
verify(componentefinancieroPersistenceJPA).delete(id);
}
} |
<reponame>nerdmanPc/arvore-b<gh_stars>0
# Primeiro Trabalho Pratico de EDAII (UFBA)
# Desenvolvido em dupla:
# <NAME> e <NAME>
# Versão Python 3.8.10
#
# OBSERVACAO IMPORTANTE:
# A CONSTANTE GRAUMINIMO ESTA NO ARQUIVO node.py
import os
from struct import Struct
from typing import Optional, Tuple
from enum import Enum
from node import Node
from data_base import DataBase, OpStatus
import sys
FILE_PATH = "tree.bin"
#GRAUMINIMO = 2 # Movido para node.py
def insert_entry(key:int, name:str, age:int):
data_base = DataBase(FILE_PATH)
insert_result = data_base.add_entry(key, name, age)
#print(insert_result)
if insert_result == OpStatus.OK:
print('insercao com sucesso: {}'.format(key))
elif insert_result == OpStatus.ERR_KEY_EXISTS:
print('chave ja existente: {}'.format(key))
else:
print('DEBUG: erro logico na insercao da chave {}'.format(key))
def query_entry(key:int):
data_base = DataBase(FILE_PATH)
_entry = data_base.entry_by_key(key)
if _entry is not None:
print(_entry)
else:
print('chave nao encontrada: {}'.format(key))
def print_tree():
data_base = DataBase(FILE_PATH)
data_base.print_tree()
def print_sequence():
data_base = DataBase(FILE_PATH)
data_base.print_keys_ordered()
def print_occupancy():
data_base = DataBase(FILE_PATH)
if data_base.empty():
print('arvore vazia')
return
occupancy = data_base.occupancy()
print('taxa de ocupacao: {:.1f}'.format(occupancy))
def exit_shell():
sys.exit()
#os.remove(FILE_PATH)
#Loop principal que processa os comandos
entry = input()
while entry != 'e':
if(entry == 'i'):
num_reg = input()
name_reg = input()
age_reg = input()
insert_entry(int(num_reg), name_reg, int(age_reg))
elif(entry == 'c'):
num_reg = input()
query_entry(int(num_reg))
elif(entry == 'p'):
print_tree()
elif(entry == 'o'):
print_sequence()
elif(entry == 't'):
print_occupancy()
entry = input()
exit_shell()
#Fim do loop principal |
Athletics is facing another doping crisis after what is claimed to be the biggest ever leak of blood-test data revealed a third of medals, including 55 golds, in endurance events at Olympics and world championships between 2001 and 2012 were won by athletes who recorded suspicious tests.
The newspaper claims the leak reveals “the extraordinary extent of cheating by athletes at the world’s most prestigious events”, yet alleges none of the athletes involved was stripped of their medals.
Robin Parisotto, described as one of the “world’s foremost anti-doping experts”, reviewed the data. “Never have I seen such an alarmingly abnormal set of blood values,” he said.
Ten medals at London 2012 were won by athletes who have recorded dubious results, but Mo Farah, who won 10,000m and 5,000m gold, is not among them, although there is one leading British athlete with suspicious readings.
While the evidence is not concrete proof of doping, the revelations raise more significant concerns over whether the sport’s governing body is doing enough to deal with the problem ahead of the World Athletics Championships in Beijing this month. |
Jeimer Candelario hit two home runs, left-hander Matt Moore got his work in, and the Detroit Tigers beat the Astros, 5-3.
LAKELAND, Fla. — The dog days of spring training officially arrived on Thursday afternoon with the arrival of the Houston Astros.
Their most notable arrival? Former Detroit Tiger Don Kelly, who made the Astros’ inland trip from West Palm Beach to coach first base.
Otherwise, it was your run-of-the-mill late spring training game, highlighted by a monster home run from Miguel Cabrera, who caught up with a mid-90 mph fastball and hit it onto the left field berm for his third home run of the spring.
Jeimer Candelario hit two home runs, left-hander Matt Moore got his work in, allowing three runs over five innings, and the Tigers beat the Astros, 5-3.
With the win, the Tigers moved within 3½ games of the Yankees for first place in the Grapefruit League. There are four games left.
As the assignments dwindle, the Tigers’ main concern is keeping their starting pitchers healthy. Against an Astros lineup with only a couple of regulars, Moore was OK. He did not induce many swings-and-misses, recording one strikeout. He allowed three runs on six hits, with two walks and one strikeout. Moore’s first start of the season has yet to be disclosed.
Perhaps the most encouraging sign from Cabrera this spring has been his ability to catch up to high-velocity pitches. His latest home run was no different, jumping on a 96 mph fastball from Astros prospect Corbin Martin. The home run came one pitch after Martin threw a similar pitch past him. This spring, Cabrera is hitting .324.
The Tigers’ third baseman hit his second and third home runs of the spring. In the first inning, he dropped a ball onto an umbrella on the Margaritaville Patio in right field. In the third, he hit a solo shot into the Astros bullpen in right-center field. Both home runs were wind-aided. Candelario is hitting .250 this spring.
“That’s a question for the manager,” Tigers general manager Al Avila said, when asked who was going to start on Opening Day for the Tigers.
At this point of the spring, all the Tigers are hoping is to stay injury-free. It was an unsuccessful return for Kelly, who was honored with a highlight video in the middle of the eighth inning.
The Tigers travel to Disney World for a night game on Friday night against the Braves. |
use crate::TranscendentalExpression;
use std::collections::HashSet;
impl TranscendentalExpression {
pub fn symbols(&self) -> HashSet<String> {
match self {
TranscendentalExpression::Abs(arg) => arg.symbols(),
TranscendentalExpression::Pow(base, exponential) => base
.symbols()
.into_iter()
.chain(exponential.symbols().into_iter())
.collect(),
TranscendentalExpression::Exp(arg) => arg.symbols(),
TranscendentalExpression::Log(l, antilogarithm) => l
.symbols()
.into_iter()
.chain(antilogarithm.symbols().into_iter())
.collect(),
TranscendentalExpression::Ln(arg) => arg.symbols(),
TranscendentalExpression::Sin(arg) => arg.symbols(),
TranscendentalExpression::Cos(arg) => arg.symbols(),
TranscendentalExpression::Tan(arg) => arg.symbols(),
}
}
}
|
BRUSSELS - President Nicolas Sarkozy said on Friday that France would shut its Syrian embassy due to the repression of opposition to President Bashar al-Assad and was ready to step up its support of rebels if the United Nations can give a green light.
"We will do nothing without a UN Security Council resolution," Sarkozy told a news conference at a European summit in Brussels, noting France supported the creation of a humanitarian zone close to one of Syria's borders."There's no question of acting directly or indirectly unless the Council has established legal conditions for a humanitarian zone, for arms delivery for the opposition or for corridors."
He said it was "frustrating, when you are seeing the deaths mounting up" but warned that perpetrators of crimes against humanity would be taken before the international criminal court.
"Dictators will all, one day, have to pay for their actions," said Sarkozy. |
/**
* Returns true if the argument position corresponds to a footer
*
* @param position raw position
* @return bool
*/
public boolean isSectionFooterPosition(int position) {
if (isFooter == null) {
setupIndices();
}
return isFooter[position];
} |
Changing Motor Patterns in Cerebral Palsy Three patients are reported in whom athetosis became an increasing problem late in childhood. Both a traumatic birth history and a preceding motor deficit were well defined in each case. This report emphasizes the concept that a brain injury incurred at birth may worsen or alter its clinical expression late in the first or early in the second decade. The differential diagnosis and thories of the mechanism for such an volution are discussed. |
/* return 1 if success, 0 if error
* output keys are little endian format
*/
int wolfSSL_EC25519_generate_key(unsigned char *priv, unsigned int *privSz,
unsigned char *pub, unsigned int *pubSz)
{
#ifndef WOLFSSL_KEY_GEN
WOLFSSL_MSG("No Key Gen built in");
return SSL_FAILURE;
#else
int ret = SSL_FAILURE;
int initTmpRng = 0;
WC_RNG *rng = NULL;
#ifdef WOLFSSL_SMALL_STACK
WC_RNG *tmpRNG = NULL;
#else
WC_RNG tmpRNG[1];
#endif
WOLFSSL_ENTER("wolfSSL_EC25519_generate_key");
if (priv == NULL || privSz == NULL || *privSz < CURVE25519_KEYSIZE ||
pub == NULL || pubSz == NULL || *pubSz < CURVE25519_KEYSIZE) {
WOLFSSL_MSG("Bad arguments");
return SSL_FAILURE;
}
#ifdef WOLFSSL_SMALL_STACK
tmpRNG = (WC_RNG*)XMALLOC(sizeof(WC_RNG), NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (tmpRNG == NULL)
return SSL_FAILURE;
#endif
if (wc_InitRng(tmpRNG) == 0) {
rng = tmpRNG;
initTmpRng = 1;
}
else {
WOLFSSL_MSG("Bad RNG Init, trying global");
if (initGlobalRNG == 0)
WOLFSSL_MSG("Global RNG no Init");
else
rng = &globalRNG;
}
if (rng) {
curve25519_key key;
if (wc_curve25519_init(&key) != MP_OKAY)
WOLFSSL_MSG("wc_curve25519_init failed");
else if (wc_curve25519_make_key(rng, CURVE25519_KEYSIZE, &key)!=MP_OKAY)
WOLFSSL_MSG("wc_curve25519_make_key failed");
else if (wc_curve25519_export_key_raw_ex(&key, priv, privSz, pub,
pubSz, EC25519_LITTLE_ENDIAN)
!= MP_OKAY)
WOLFSSL_MSG("wc_curve25519_export_key_raw_ex failed");
else
ret = SSL_SUCCESS;
wc_curve25519_free(&key);
}
if (initTmpRng)
wc_FreeRng(tmpRNG);
#ifdef WOLFSSL_SMALL_STACK
XFREE(tmpRNG, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif
return ret;
#endif
} |
Parabola-based face recognition and tracking Several applications such as access control, behaviour observation and videoconferencing require a real-time method for face recognition and tracking. We propose to represent faces with parabola segments with an algorithm that allows us to fit parabola segments real-time to edge pixels. Parabola offer a good description for the many edges in the object, which is advantageous for several applications. We use parabola segments for face recognition and tracking, which is done with the parabola distance function, that matches parabola segments based on distance and intensity. We propose a global matching cost for face recognition and a technique to estimate motion vectors for face tracking by statistical analysis of the parabola distance function. |
import CronJob from './components/kubernetes/details/CronJob';
import DaemonSet from './components/kubernetes/details/DaemonSet';
import Deployment from './components/kubernetes/details/Deployment';
import Job from './components/kubernetes/details/Job';
import Pod from './components/kubernetes/details/Pod';
import ReplicaSet from './components/kubernetes/details/ReplicaSet';
import ReplicationController from './components/kubernetes/details/ReplicationController';
import StatefulSet from './components/kubernetes/details/StatefulSet';
import Ingress from './components/kubernetes/details/Ingress';
import Service from './components/kubernetes/details/Service';
import ConfigMap from './components/kubernetes/details/ConfigMap';
import PersistentVolume from './components/kubernetes/details/PersistentVolume';
import PersistentVolumeClaim from './components/kubernetes/details/PersistentVolumeClaim';
import Secret from './components/kubernetes/details/Secret';
import ServiceAccount from './components/kubernetes/details/ServiceAccount';
import ClusterRole from './components/kubernetes/details/ClusterRole';
import ClusterRoleBinding from './components/kubernetes/details/ClusterRoleBinding';
import Role from './components/kubernetes/details/Role';
import RoleBinding from './components/kubernetes/details/RoleBinding';
import Event from './components/kubernetes/details/Event';
import Namespace from './components/kubernetes/details/Namespace';
import Node from './components/kubernetes/details/Node';
import CronJobItem from './components/kubernetes/items/CronJobItem';
import DaemonSetItem from './components/kubernetes/items/DaemonSetItem';
import DeploymentItem from './components/kubernetes/items/DeploymentItem';
import JobItem from './components/kubernetes/items/JobItem';
import PodItem from './components/kubernetes/items/PodItem';
import ReplicaSetItem from './components/kubernetes/items/ReplicaSetItem';
import ReplicationControllerItem from './components/kubernetes/items/ReplicationControllerItem';
import StatefulSetItem from './components/kubernetes/items/StatefulSetItem';
import IngressItem from './components/kubernetes/items/IngressItem';
import ServiceItem from './components/kubernetes/items/ServiceItem';
import ConfigMapItem from './components/kubernetes/items/ConfigMapItem';
import PersistentVolumeClaimItem from './components/kubernetes/items/PersistentVolumeClaimItem';
import PersistentVolumeItem from './components/kubernetes/items/PersistentVolumeItem';
import SecretItem from './components/kubernetes/items/SecretItem';
import ServiceAccountItem from './components/kubernetes/items/ServiceAccountItem';
import ClusterRoleBindingItem from './components/kubernetes/items/ClusterRoleBindingItem';
import ClusterRoleItem from './components/kubernetes/items/ClusterRoleItem';
import RoleBindingItem from './components/kubernetes/items/RoleBindingItem';
import RoleItem from './components/kubernetes/items/RoleItem';
import CustomResourceDefinitionItem from './components/kubernetes/items/CustomResourceDefinitionItem';
import EventItem from './components/kubernetes/items/EventItem';
import NamespaceItem from './components/kubernetes/items/NamespaceItem';
import NodeItem from './components/kubernetes/items/NodeItem';
import { IAppSections } from './declarations';
export const sections: IAppSections = {
'workloads': {
title: 'Workloads',
pages: {
'cronjobs': {
singleText: 'Cron Job',
pluralText: 'Cron Jobs',
icon: '/assets/icons/kubernetes/cronjob.png',
listURL: (namespace: string) => { return namespace ? `/apis/batch/v1beta1/namespaces/${namespace}/cronjobs` : `/apis/batch/v1beta1/cronjobs`; },
listItemComponent: CronJobItem,
detailsURL: (namespace: string, name: string) => { return `/apis/batch/v1beta1/namespaces/${namespace}/cronjobs/${name}`; },
detailsComponent: CronJob,
},
'daemonsets': {
singleText: 'Daemon Set',
pluralText: 'Daemon Sets',
icon: '/assets/icons/kubernetes/ds.png',
listURL: (namespace: string) => { return namespace ? `/apis/apps/v1/namespaces/${namespace}/daemonsets` : `/apis/apps/v1/daemonsets`; },
listItemComponent: DaemonSetItem,
detailsURL: (namespace: string, name: string) => { return `/apis/apps/v1/namespaces/${namespace}/daemonsets/${name}`; },
detailsComponent: DaemonSet,
},
'deployments': {
singleText: 'Deployment',
pluralText: 'Deployments',
icon: '/assets/icons/kubernetes/deploy.png',
listURL: (namespace: string) => { return namespace ? `/apis/apps/v1/namespaces/${namespace}/deployments` : `/apis/apps/v1/deployments`; },
listItemComponent: DeploymentItem,
detailsURL: (namespace: string, name: string) => { return `/apis/apps/v1/namespaces/${namespace}/deployments/${name}`; },
detailsComponent: Deployment,
},
'jobs': {
singleText: 'Job',
pluralText: 'Jobs',
icon: '/assets/icons/kubernetes/job.png',
listURL: (namespace: string) => { return namespace ? `/apis/batch/v1/namespaces/${namespace}/jobs` : `/apis/batch/v1/jobs`; },
listItemComponent: JobItem,
detailsURL: (namespace: string, name: string) => { return `/apis/batch/v1/namespaces/${namespace}/jobs/${name}`; },
detailsComponent: Job,
},
'pods': {
singleText: 'Pod',
pluralText: 'Pods',
icon: '/assets/icons/kubernetes/pod.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/pods` : `/api/v1/pods`; },
listItemComponent: PodItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/pods/${name}`; },
detailsComponent: Pod,
},
'replicasets': {
singleText: 'Replica Set',
pluralText: 'Replica Sets',
icon: '/assets/icons/kubernetes/rs.png',
listURL: (namespace: string) => { return namespace ? `/apis/apps/v1/namespaces/${namespace}/replicasets` : `/apis/apps/v1/replicasets`; },
listItemComponent: ReplicaSetItem,
detailsURL: (namespace: string, name: string) => { return `/apis/apps/v1/namespaces/${namespace}/replicasets/${name}`; },
detailsComponent: ReplicaSet,
},
'replicationcontrollers': {
singleText: 'Replication Controller',
pluralText: 'Replication Controllers',
icon: '/assets/icons/kubernetes/deploy.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/replicationcontrollers` : `/api/v1/replicationcontrollers`; },
listItemComponent: ReplicationControllerItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/replicationcontrollers/${name}`; },
detailsComponent: ReplicationController,
},
'statefulsets': {
singleText: 'Stateful Set',
pluralText: 'Stateful Sets',
icon: '/assets/icons/kubernetes/sts.png',
listURL: (namespace: string) => { return namespace ? `/apis/apps/v1/namespaces/${namespace}/statefulsets` : `/apis/apps/v1/statefulsets`; },
listItemComponent: StatefulSetItem,
detailsURL: (namespace: string, name: string) => { return `/apis/apps/v1/namespaces/${namespace}/statefulsets/${name}`; },
detailsComponent: StatefulSet,
},
},
},
'discovery-and-loadbalancing': {
title: 'Discovery and Load Balancing',
pages: {
'ingresses': {
singleText: 'Ingresse',
pluralText: 'Ingresses',
icon: '/assets/icons/kubernetes/ing.png',
listURL: (namespace: string) => { return namespace ? `/apis/networking.k8s.io/v1beta1/namespaces/${namespace}/ingresses` : `/apis/networking.k8s.io/v1beta1/ingresses`; },
listItemComponent: IngressItem,
detailsURL: (namespace: string, name: string) => { return `/apis/networking.k8s.io/v1beta1/namespaces/${namespace}/ingresses/${name}`; },
detailsComponent: Ingress,
},
'services': {
singleText: 'Service',
pluralText: 'Services',
icon: '/assets/icons/kubernetes/svc.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/services` : `/api/v1/services`; },
listItemComponent: ServiceItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/services/${name}`; },
detailsComponent: Service,
},
}
},
'config-and-storage': {
title: 'Config and Storage',
pages: {
'configmaps': {
singleText: 'Config Map',
pluralText: 'Config Maps',
icon: '/assets/icons/kubernetes/cm.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/configmaps` : `/api/v1/configmaps`; },
listItemComponent: ConfigMapItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/configmaps/${name}`; },
detailsComponent: ConfigMap,
},
'persistentvolumes': {
singleText: 'Persistent Volume',
pluralText: 'Persistent Volumes',
icon: '/assets/icons/kubernetes/pv.png',
listURL: (namespace: string) => { return `/api/v1/persistentvolumes`; },
listItemComponent: PersistentVolumeItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/persistentvolumes/${name}`; },
detailsComponent: PersistentVolume,
},
'persistentvolumeclaims': {
singleText: 'Persistent Volume Claim',
pluralText: 'Persistent Volume Claims',
icon: '/assets/icons/kubernetes/pvc.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/persistentvolumeclaims` : `/api/v1/persistentvolumeclaims`; },
listItemComponent: PersistentVolumeClaimItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/persistentvolumeclaims/${name}`; },
detailsComponent: PersistentVolumeClaim,
},
'secrets': {
singleText: 'Secret',
pluralText: 'Secrets',
icon: '/assets/icons/kubernetes/secret.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/secrets` : `/api/v1/secrets`; },
listItemComponent: SecretItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/secrets/${name}`; },
detailsComponent: Secret,
},
'serviceaccounts': {
singleText: 'Service Account',
pluralText: 'Service Accounts',
icon: '/assets/icons/kubernetes/sa.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/serviceaccounts` : `/api/v1/serviceaccounts`; },
listItemComponent: ServiceAccountItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/serviceaccounts/${name}`; },
detailsComponent: ServiceAccount,
},
}
},
'rbac': {
title: 'RBAC',
pages: {
'clusterroles': {
singleText: 'Cluster Role',
pluralText: 'Cluster Roles',
icon: '/assets/icons/kubernetes/c-role.png',
listURL: (namespace: string) => { return `/apis/rbac.authorization.k8s.io/v1/clusterroles`; },
listItemComponent: ClusterRoleItem,
detailsURL: (namespace: string, name: string) => { return `/apis/rbac.authorization.k8s.io/v1/clusterroles/${name}`; },
detailsComponent: ClusterRole,
},
'clusterrolebindings': {
singleText: 'Cluster Role Binding',
pluralText: 'Cluster Role Bindings',
icon: '/assets/icons/kubernetes/c-rb.png',
listURL: (namespace: string) => { return `/apis/rbac.authorization.k8s.io/v1/clusterrolebindings`; },
listItemComponent: ClusterRoleBindingItem,
detailsURL: (namespace: string, name: string) => { return `/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/${name}`; },
detailsComponent: ClusterRoleBinding,
},
'roles': {
singleText: 'Role',
pluralText: 'Roles',
icon: '/assets/icons/kubernetes/role.png',
listURL: (namespace: string) => { return namespace ? `/apis/rbac.authorization.k8s.io/v1/namespaces/${namespace}/roles` : `/apis/rbac.authorization.k8s.io/v1/roles`; },
listItemComponent: RoleItem,
detailsURL: (namespace: string, name: string) => { return `/apis/rbac.authorization.k8s.io/v1/namespaces/${namespace}/roles/${name}`; },
detailsComponent: Role,
},
'rolebindings': {
singleText: 'Role Binding',
pluralText: 'Role Bindings',
icon: '/assets/icons/kubernetes/rb.png',
listURL: (namespace: string) => { return namespace ? `/apis/rbac.authorization.k8s.io/v1/namespaces/${namespace}/rolebindings` : `/apis/rbac.authorization.k8s.io/v1/rolebindings`; },
listItemComponent: RoleBindingItem,
detailsURL: (namespace: string, name: string) => { return `/apis/rbac.authorization.k8s.io/v1/namespaces/${namespace}/rolebindings/${name}`; },
detailsComponent: RoleBinding,
},
}
},
'cluster': {
title: 'Cluster',
pages: {
'customresourcedefinitions': {
singleText: 'Custom Resource Definition',
pluralText: 'Custom Resource Definitions',
icon: '/assets/icons/kubernetes/crd.png',
listURL: (namespace: string) => { return `/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions`; },
listItemComponent: CustomResourceDefinitionItem,
detailsURL: (namespace: string, name: string) => { return `/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions`; },
detailsComponent: CustomResourceDefinitionItem,
},
'events': {
singleText: 'Event',
pluralText: 'Events',
icon: '/assets/icons/kubernetes/events.png',
listURL: (namespace: string) => { return namespace ? `/api/v1/namespaces/${namespace}/events` : `/api/v1/events`; },
listItemComponent: EventItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${namespace}/events/${name}`; },
detailsComponent: Event,
},
'namespaces': {
singleText: 'Namespace',
pluralText: 'Namespaces',
icon: '/assets/icons/kubernetes/ns.png',
listURL: (namespace: string) => { return `/api/v1/namespaces`; },
listItemComponent: NamespaceItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/namespaces/${name}`; },
detailsComponent: Namespace,
},
'nodes': {
singleText: 'Node',
pluralText: 'Nodes',
icon: '/assets/icons/kubernetes/node.png',
listURL: (namespace: string) => { return `/api/v1/nodes`; },
listItemComponent: NodeItem,
detailsURL: (namespace: string, name: string) => { return `/api/v1/nodes/${name}`; },
detailsComponent: Node,
},
}
},
};
|
package ru.tinkoff.qa.neptune.selenium.captors;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WrapsDriver;
import ru.tinkoff.qa.neptune.core.api.event.firing.captors.ImageCaptor;
import ru.tinkoff.qa.neptune.core.api.steps.annotations.Description;
import ru.tinkoff.qa.neptune.selenium.api.widget.Widget;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import static java.util.Optional.ofNullable;
import static org.openqa.selenium.OutputType.BYTES;
/**
* Takes screenshot from a whole page
*/
@Description("Browser screenshot")
public final class WebDriverImageCaptor extends ImageCaptor<WebDriver> {
@Override
public BufferedImage getData(WebDriver caught) {
try {
var in = new ByteArrayInputStream(((TakesScreenshot) caught).getScreenshotAs(BYTES));
return ImageIO.read(in);
} catch (Exception e) {
return null;
}
}
@Override
public WebDriver getCaptured(Object toBeCaptured) {
var clazz = toBeCaptured.getClass();
if (!WrapsDriver.class.isAssignableFrom(clazz) && !WebDriver.class.isAssignableFrom(clazz)) {
return null;
}
if (WebElement.class.isAssignableFrom(clazz) || Widget.class.isAssignableFrom(clazz)) {
return null;
}
if (WebDriver.class.isAssignableFrom(clazz)) {
return (WebDriver) toBeCaptured;
}
return ofNullable(((WrapsDriver) toBeCaptured).getWrappedDriver())
.map(webDriver -> {
if (TakesScreenshot.class.isAssignableFrom(webDriver.getClass())) {
return webDriver;
}
return null;
})
.orElse(null);
}
}
|
One person thought Twitter's 140-character limit may be to blame.
New Delhi: Prime Minister Narendra Modi this morning returned to India after his three-nation tour. PM Modi visited Portugal, the United States and ended his tour in the Netherlands. This year marks 70 years of Indo-Dutch diplomatic relations. So, naturally, a little Twitter diplomacy was to be expected. PM Modi tweeted enthusiastically in Dutch several times during his visit. His Dutch counterpart tweeted back in Hindi. Except, it seems like he might have had a faulty keyboard as the message was tweeted without a single space, making it quite a mouthful to read.
"Welcome to the Netherlands @narendramodi Our bilateral relations go back 70 years and with that I am extremely excited about our meeting," reads the tweet, roughly translated.
Soo overwhelmed Minister President, nice initiative to remove all space between the two countries.
Except for the space between the words, it was perfect.
Yes, but be sure it's not his language . At least he tried must be appreciated.
This is not the first time Mr Rutte has tweeted in Hindi. In 2015, he replied in Hindi to a tweet in Dutch by PM Modi, welcoming him to India. |
Political Roundup: Are Kiwis dying because the Government won't fund cancer drugs?
Are New Zealanders dying unnecessarily because the Government won't fund cancer drugs that are considered standard in other countries? That's the message from CANGO, a coalition of not-for-profit cancer organisations who launched a campaign yesterday, on World Cancer Day, for better access to cancer drugs for New Zealanders.
There is now a full-scale debate going on about whether the Government is doing enough in terms of cancer care. The allegation from cancer patient advocates is that successive governments have become complacent about cancer treatment, to the point where cancer treatment in this country is in crisis, and patients are paying the price.
Some are suggesting that Labour is already breaking promises over cancer treatment and little has changed with the change of government.
Drug funding is always one of the most contentious and prominent issues in cancer debates. A number of cancer patient advocate groups are campaigning for improved access to life-saving drugs, as well as calling for a review of the Pharmac drug-buying agency. This is best seen in Duncan Garner's call yesterday, saying "We as New Zealanders should be demanding better drugs and more funding" – see: Time for inquiry into Pharmac's funding of cancer drugs.
Garner argues New Zealanders are "getting third class medicines". For example, because of more limited access to drugs in this country, "A woman with stage four breast cancer will live five years in Holland, but just 13 months here." He says that "in the time Australia has approved 24 new cancer drugs, we have approved – wait for this – none."
The broadcaster points the finger at the new Government: "Labour promised voters world class cancer care but, of all the rocks I've looked under, I can't find any evidence anyone has done anything - and the clock is not only ticking but people are dying waiting." Furthermore, Garner alleges that Parliament's health select committee "wants a proper inquiry into Pharmac" but "the Beehive isn't keen".
Prime Minister Jacinda Ardern appeared on Garner's AM Show this morning and answered his questions about drug funding and Pharmac, putting the case in favour of the status quo – see Zane Small's Jacinda Ardern: Not fair to compare Pharmac with Australia's system.
Ardern reiterated that Pharmac has "been pointed to as being the envy of others", and she defended the system that keeps drug buying decisions "separate from politics", saying "I will always maintain the principle that I should not be the one making decisions about drug treatment in New Zealand." She also explained that Pharmac refuses to buy new medicines if they don't "add anything that a past product" already has.
The Minister of Health, David Clark, has also reportedly "been quick to dismiss any plans to review the agency" – see Ruby Macandrew's Health organisations join calls for a review into government drug-buying agency. This article details growing support, especially amongst health organisations, for a review of how Pharmac operates and why it is so slow in adopting new cancer treatments.
Apparently, in "its 25-year history Pharmac has never been reviewed". This doesn't mean that there have never been questions raised about its operations, and Breast Cancer Aotearoa Coalition chairwoman Libby Burgess says: "History shows us that navel gazing by Pharmac and the Ministry unsurprisingly leads them to the conclusion that everything is just fine. Meanwhile New Zealand patients are suffering and dying needlessly through lack of access to effective modern medicines". She argues that the "grindingly slow pace of Pharmac's opaque decision processes is a national disgrace".
The New Zealand Cancer Society appears to have sympathy with this point of view. It's medical director, Dr Chris Jackson, is reported as believing, "Pharmac need to consider an early access scheme to new cancer treatments which had not been considered for funding" – see Melanie Earley's Northland father-of-three forced to sell 'dream home' to fund cancer treatment.
According to this news report, "There are no timelines around when Pharmac needed to make decisions on whether to fund a drug or not", and Jackson says: "In the UK there are outlined timelines, I'd like to see something like that here so patients aren't left in limbo – the window of opportunity for those affected by cancer is now." Jackson also calls on Pharmac "to rethink the funding of Keytruda".
In fact, according to a statement from David Clark, the Government is considering adopting the UK model. Isobel Ewing reported yesterday, "He has officials assessing the performance of the English NHS Cancer Drugs Fund and expects to have a better idea of whether it can be adopted here by the end of this year" – see: 'Difficult situation': Cancer patient leads pleas for better Govt funding of treatments.
This news item also reports on the alliance of eight major cancer non-profit organisations, CANGO, which "wants the Government to introduce a rapid access scheme for new cancer treatments in New Zealand". According to CANGO, "thousands of New Zealanders are dying unnecessarily because treatments that are considered standard care overseas aren't available here."
Furthermore, the CEO of the Lung Foundation, Philip Hope, is also reported as explaining "Pharmac's current funding model favours low value, high volume treatments and more expensive and effective treatments get delayed or denied."
In the weekend, 1News reported on the latest plea for advanced breast cancer sufferers to get access to the two new and expensive medicines, Ibrance and Kadcyla – see: World-leading breast cancer expert calls on Pharmac to make two new breast cancer drugs more affordable. The report tells the story of how "Auckland woman Wiki Mullholland has been pushing for better treatment of advanced breast cancer since she was diagnosed in May."
There is expert weight behind this campaign: "A world authority on terminal breast cancer, oncologist Dr Fatima Cardoso is supporting the cause." Dr Cardoso also reflects on wider access to cancer drugs in New Zealand, saying "The medium survival of patients with this disease in New Zealand is about half of what it is in other developed countries. From those results, it is not good, and it needs clearly to be improved".
Cardoso's analysis of the availability of breast cancer drugs is also provided in Ruby Macandrew's news report, 'We're giving up too soon': Advanced breast cancer expert calls for attitude change in NZ.
According to this, Pharmac has already made a decision to make the two types of medicines available, albeit with some key exceptions in regard to patients already receiving other treatments. Cardoso is reportedly disappointed with this, stating: "In countries where drugs like these are available, metastatic patients [those with ABC] can sometimes live eight, nine, 10 years. So this is unacceptable that a country like New Zealand has a one-year median survival for these patients."
Finally, Garner is currently leading the charge for better access to cancer medicines, and so it's also worth looking back at his open letter to the Minister of Health in August in which he challenges him to return to his promises: "why do warrior Opposition MPs promise record spending on world-class cancer treatments when they want your vote, then upon getting the chance start talking like a stiff cold robot who is too scared of repeating the promise in case he or she has to make it come true" – see: Dr Clark, this is life or death, please help. |
//****************************************************************************
// This is a local copy from the current file
// svn.berlios.de/svnroot/repos/socketcan/trunk/kernel/2.6/include/linux/can.h
// Author: <NAME> (<EMAIL>)
//****************************************************************************
/*
* linux/can.h
*
* Definitions for CAN networklayer (socket addr / CAN frame / CAN filter)
*
* $Id: can.h 165 2007-03-05 10:14:18Z hartkopp $
*
* Authors: <NAME> <<EMAIL>>
* <NAME> <<EMAIL>>
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
* All rights reserved.
*
* Send feedback to <<EMAIL>>
*
*/
#ifndef CAN_H
#define CAN_H
#include <linux/version.h>
#include <linux/types.h>
#include <linux/socket.h>
/* controller area network (CAN) kernel definitions */
/* special address description flags for the CAN_ID */
#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
#define CAN_ERR_FLAG 0x20000000U /* error frame */
/* valid bits in CAN ID for frame formats */
#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
typedef __u32 canid_t;
struct can_frame {
canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
__u8 can_dlc; /* data length code: 0 .. 8 */
__u8 data[8] __attribute__ ((aligned(8)));
};
/* particular protocols of the protocol family PF_CAN */
#define CAN_RAW 1 /* RAW sockets */
#define CAN_BCM 2 /* Broadcast Manager */
#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
#define CAN_MCNET 5 /* Bosch MCNet */
#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
#define CAN_BAP 7 /* VAG Bedien- und Anzeigeprotokoll */
#define CAN_NPROTO 8
#define SOL_CAN_BASE 100
struct sockaddr_can {
sa_family_t can_family;
int can_ifindex;
union {
struct { canid_t rx_id, tx_id; } tp16;
struct { canid_t rx_id, tx_id; } tp20;
struct { canid_t rx_id, tx_id; } mcnet;
struct { canid_t rx_id, tx_id; } isotp;
struct { int sg_id, sg_type; } bap;
} can_addr;
};
typedef canid_t can_err_mask_t;
struct can_filter {
canid_t can_id;
canid_t can_mask;
};
#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
#endif /* CAN_H */
|
<filename>pywinrt/winsdk/src/py.Windows.Foundation.h
// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.4
#pragma once
#include "pybase.h"
#if __has_include("py.Windows.Foundation.Collections.h")
#include "py.Windows.Foundation.Collections.h"
#endif
#include <winrt/Windows.Foundation.h>
namespace py::proj::Windows::Foundation
{
struct IAsyncActionWithProgress
{
virtual ~IAsyncActionWithProgress() {};
virtual winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept = 0;
virtual std::size_t hash() noexcept = 0;
virtual PyObject* GetResults(PyObject*) noexcept = 0;
virtual PyObject* Cancel(PyObject*) noexcept = 0;
virtual PyObject* Close(PyObject*) noexcept = 0;
virtual PyObject* get_Progress() noexcept = 0;
virtual int put_Progress(PyObject*) noexcept = 0;
virtual PyObject* get_Completed() noexcept = 0;
virtual int put_Completed(PyObject*) noexcept = 0;
virtual PyObject* get_ErrorCode() noexcept = 0;
virtual PyObject* get_Id() noexcept = 0;
virtual PyObject* get_Status() noexcept = 0;
virtual PyObject* dunder_await() noexcept = 0;
};
struct IAsyncOperationWithProgress
{
virtual ~IAsyncOperationWithProgress() {};
virtual winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept = 0;
virtual std::size_t hash() noexcept = 0;
virtual PyObject* GetResults(PyObject*) noexcept = 0;
virtual PyObject* Cancel(PyObject*) noexcept = 0;
virtual PyObject* Close(PyObject*) noexcept = 0;
virtual PyObject* get_Progress() noexcept = 0;
virtual int put_Progress(PyObject*) noexcept = 0;
virtual PyObject* get_Completed() noexcept = 0;
virtual int put_Completed(PyObject*) noexcept = 0;
virtual PyObject* get_ErrorCode() noexcept = 0;
virtual PyObject* get_Id() noexcept = 0;
virtual PyObject* get_Status() noexcept = 0;
virtual PyObject* dunder_await() noexcept = 0;
};
struct IAsyncOperation
{
virtual ~IAsyncOperation() {};
virtual winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept = 0;
virtual std::size_t hash() noexcept = 0;
virtual PyObject* GetResults(PyObject*) noexcept = 0;
virtual PyObject* Cancel(PyObject*) noexcept = 0;
virtual PyObject* Close(PyObject*) noexcept = 0;
virtual PyObject* get_Completed() noexcept = 0;
virtual int put_Completed(PyObject*) noexcept = 0;
virtual PyObject* get_ErrorCode() noexcept = 0;
virtual PyObject* get_Id() noexcept = 0;
virtual PyObject* get_Status() noexcept = 0;
virtual PyObject* dunder_await() noexcept = 0;
};
struct IReferenceArray
{
virtual ~IReferenceArray() {};
virtual winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept = 0;
virtual std::size_t hash() noexcept = 0;
virtual PyObject* GetBoolean(PyObject*) noexcept = 0;
virtual PyObject* GetBooleanArray(PyObject*) noexcept = 0;
virtual PyObject* GetChar16(PyObject*) noexcept = 0;
virtual PyObject* GetChar16Array(PyObject*) noexcept = 0;
virtual PyObject* GetDateTime(PyObject*) noexcept = 0;
virtual PyObject* GetDateTimeArray(PyObject*) noexcept = 0;
virtual PyObject* GetDouble(PyObject*) noexcept = 0;
virtual PyObject* GetDoubleArray(PyObject*) noexcept = 0;
virtual PyObject* GetGuid(PyObject*) noexcept = 0;
virtual PyObject* GetGuidArray(PyObject*) noexcept = 0;
virtual PyObject* GetInspectableArray(PyObject*) noexcept = 0;
virtual PyObject* GetInt16(PyObject*) noexcept = 0;
virtual PyObject* GetInt16Array(PyObject*) noexcept = 0;
virtual PyObject* GetInt32(PyObject*) noexcept = 0;
virtual PyObject* GetInt32Array(PyObject*) noexcept = 0;
virtual PyObject* GetInt64(PyObject*) noexcept = 0;
virtual PyObject* GetInt64Array(PyObject*) noexcept = 0;
virtual PyObject* GetPoint(PyObject*) noexcept = 0;
virtual PyObject* GetPointArray(PyObject*) noexcept = 0;
virtual PyObject* GetRect(PyObject*) noexcept = 0;
virtual PyObject* GetRectArray(PyObject*) noexcept = 0;
virtual PyObject* GetSingle(PyObject*) noexcept = 0;
virtual PyObject* GetSingleArray(PyObject*) noexcept = 0;
virtual PyObject* GetSize(PyObject*) noexcept = 0;
virtual PyObject* GetSizeArray(PyObject*) noexcept = 0;
virtual PyObject* GetString(PyObject*) noexcept = 0;
virtual PyObject* GetStringArray(PyObject*) noexcept = 0;
virtual PyObject* GetTimeSpan(PyObject*) noexcept = 0;
virtual PyObject* GetTimeSpanArray(PyObject*) noexcept = 0;
virtual PyObject* GetUInt16(PyObject*) noexcept = 0;
virtual PyObject* GetUInt16Array(PyObject*) noexcept = 0;
virtual PyObject* GetUInt32(PyObject*) noexcept = 0;
virtual PyObject* GetUInt32Array(PyObject*) noexcept = 0;
virtual PyObject* GetUInt64(PyObject*) noexcept = 0;
virtual PyObject* GetUInt64Array(PyObject*) noexcept = 0;
virtual PyObject* GetUInt8(PyObject*) noexcept = 0;
virtual PyObject* GetUInt8Array(PyObject*) noexcept = 0;
virtual PyObject* get_Value() noexcept = 0;
virtual PyObject* get_IsNumericScalar() noexcept = 0;
virtual PyObject* get_Type() noexcept = 0;
};
struct IReference
{
virtual ~IReference() {};
virtual winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept = 0;
virtual std::size_t hash() noexcept = 0;
virtual PyObject* GetBoolean(PyObject*) noexcept = 0;
virtual PyObject* GetBooleanArray(PyObject*) noexcept = 0;
virtual PyObject* GetChar16(PyObject*) noexcept = 0;
virtual PyObject* GetChar16Array(PyObject*) noexcept = 0;
virtual PyObject* GetDateTime(PyObject*) noexcept = 0;
virtual PyObject* GetDateTimeArray(PyObject*) noexcept = 0;
virtual PyObject* GetDouble(PyObject*) noexcept = 0;
virtual PyObject* GetDoubleArray(PyObject*) noexcept = 0;
virtual PyObject* GetGuid(PyObject*) noexcept = 0;
virtual PyObject* GetGuidArray(PyObject*) noexcept = 0;
virtual PyObject* GetInspectableArray(PyObject*) noexcept = 0;
virtual PyObject* GetInt16(PyObject*) noexcept = 0;
virtual PyObject* GetInt16Array(PyObject*) noexcept = 0;
virtual PyObject* GetInt32(PyObject*) noexcept = 0;
virtual PyObject* GetInt32Array(PyObject*) noexcept = 0;
virtual PyObject* GetInt64(PyObject*) noexcept = 0;
virtual PyObject* GetInt64Array(PyObject*) noexcept = 0;
virtual PyObject* GetPoint(PyObject*) noexcept = 0;
virtual PyObject* GetPointArray(PyObject*) noexcept = 0;
virtual PyObject* GetRect(PyObject*) noexcept = 0;
virtual PyObject* GetRectArray(PyObject*) noexcept = 0;
virtual PyObject* GetSingle(PyObject*) noexcept = 0;
virtual PyObject* GetSingleArray(PyObject*) noexcept = 0;
virtual PyObject* GetSize(PyObject*) noexcept = 0;
virtual PyObject* GetSizeArray(PyObject*) noexcept = 0;
virtual PyObject* GetString(PyObject*) noexcept = 0;
virtual PyObject* GetStringArray(PyObject*) noexcept = 0;
virtual PyObject* GetTimeSpan(PyObject*) noexcept = 0;
virtual PyObject* GetTimeSpanArray(PyObject*) noexcept = 0;
virtual PyObject* GetUInt16(PyObject*) noexcept = 0;
virtual PyObject* GetUInt16Array(PyObject*) noexcept = 0;
virtual PyObject* GetUInt32(PyObject*) noexcept = 0;
virtual PyObject* GetUInt32Array(PyObject*) noexcept = 0;
virtual PyObject* GetUInt64(PyObject*) noexcept = 0;
virtual PyObject* GetUInt64Array(PyObject*) noexcept = 0;
virtual PyObject* GetUInt8(PyObject*) noexcept = 0;
virtual PyObject* GetUInt8Array(PyObject*) noexcept = 0;
virtual PyObject* get_Value() noexcept = 0;
virtual PyObject* get_IsNumericScalar() noexcept = 0;
virtual PyObject* get_Type() noexcept = 0;
};
}
namespace py::impl::Windows::Foundation
{
struct AsyncActionCompletedHandler
{
static winrt::Windows::Foundation::AsyncActionCompletedHandler get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename TProgress>
struct AsyncActionProgressHandler
{
static winrt::Windows::Foundation::AsyncActionProgressHandler<TProgress> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename TProgress>
struct AsyncActionWithProgressCompletedHandler
{
static winrt::Windows::Foundation::AsyncActionWithProgressCompletedHandler<TProgress> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename TResult>
struct AsyncOperationCompletedHandler
{
static winrt::Windows::Foundation::AsyncOperationCompletedHandler<TResult> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename TResult, typename TProgress>
struct AsyncOperationProgressHandler
{
static winrt::Windows::Foundation::AsyncOperationProgressHandler<TResult, TProgress> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename TResult, typename TProgress>
struct AsyncOperationWithProgressCompletedHandler
{
static winrt::Windows::Foundation::AsyncOperationWithProgressCompletedHandler<TResult, TProgress> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
struct DeferralCompletedHandler
{
static winrt::Windows::Foundation::DeferralCompletedHandler get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)]()
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle args{ nullptr };
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename T>
struct EventHandler
{
static winrt::Windows::Foundation::EventHandler<T> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template <typename TSender, typename TResult>
struct TypedEventHandler
{
static winrt::Windows::Foundation::TypedEventHandler<TSender, TResult> get(PyObject* callable)
{
py::delegate_callable _delegate{ callable };
return [delegate = std::move(_delegate)](auto param0, auto param1)
{
winrt::handle_type<py::gil_state_traits> gil_state{ PyGILState_Ensure() };
py::pyobj_handle py_param0{ py::convert(param0) };
py::pyobj_handle py_param1{ py::convert(param1) };
py::pyobj_handle args{ PyTuple_Pack(2, py_param0.get(), py_param1.get()) };
if (!args) {
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
py::pyobj_handle return_value{ PyObject_CallObject(delegate.callable(), args.get()) };
if (!return_value)
{
PyErr_WriteUnraisable(delegate.callable());
throw winrt::hresult_error();
}
};
};
};
template<typename TProgress>
struct IAsyncActionWithProgress : public py::proj::Windows::Foundation::IAsyncActionWithProgress
{
IAsyncActionWithProgress(winrt::Windows::Foundation::IAsyncActionWithProgress<TProgress> o) : _obj(o) {}
winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept override { return _obj; }
std::size_t hash() noexcept override { return py::get_instance_hash(_obj); }
PyObject* Cancel(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.Cancel();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* Close(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.Close();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetResults(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.GetResults();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* get_Progress() noexcept override
{
try
{
return py::convert(_obj.Progress());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
int put_Progress(PyObject* arg) noexcept override
{
if (arg == nullptr)
{
PyErr_SetString(PyExc_TypeError, "property delete not supported");
return -1;
}
try
{
auto param0 = py::convert_to<winrt::Windows::Foundation::AsyncActionProgressHandler<TProgress>>(arg);
_obj.Progress(param0);
return 0;
}
catch (...)
{
py::to_PyErr();
return -1;
}
}
PyObject* get_Completed() noexcept override
{
try
{
return py::convert(_obj.Completed());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
int put_Completed(PyObject* arg) noexcept override
{
if (arg == nullptr)
{
PyErr_SetString(PyExc_TypeError, "property delete not supported");
return -1;
}
try
{
auto param0 = py::convert_to<winrt::Windows::Foundation::AsyncActionWithProgressCompletedHandler<TProgress>>(arg);
_obj.Completed(param0);
return 0;
}
catch (...)
{
py::to_PyErr();
return -1;
}
}
PyObject* get_ErrorCode() noexcept override
{
try
{
return py::convert(_obj.ErrorCode());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Id() noexcept override
{
try
{
return py::convert(_obj.Id());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Status() noexcept override
{
try
{
return py::convert(_obj.Status());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* dunder_await() noexcept override { return py::dunder_await(_obj); }
winrt::Windows::Foundation::IAsyncActionWithProgress<TProgress> _obj{ nullptr };
};
template<typename TResult, typename TProgress>
struct IAsyncOperationWithProgress : public py::proj::Windows::Foundation::IAsyncOperationWithProgress
{
IAsyncOperationWithProgress(winrt::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress> o) : _obj(o) {}
winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept override { return _obj; }
std::size_t hash() noexcept override { return py::get_instance_hash(_obj); }
PyObject* Cancel(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.Cancel();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* Close(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.Close();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetResults(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetResults());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* get_Progress() noexcept override
{
try
{
return py::convert(_obj.Progress());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
int put_Progress(PyObject* arg) noexcept override
{
if (arg == nullptr)
{
PyErr_SetString(PyExc_TypeError, "property delete not supported");
return -1;
}
try
{
auto param0 = py::convert_to<winrt::Windows::Foundation::AsyncOperationProgressHandler<TResult, TProgress>>(arg);
_obj.Progress(param0);
return 0;
}
catch (...)
{
py::to_PyErr();
return -1;
}
}
PyObject* get_Completed() noexcept override
{
try
{
return py::convert(_obj.Completed());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
int put_Completed(PyObject* arg) noexcept override
{
if (arg == nullptr)
{
PyErr_SetString(PyExc_TypeError, "property delete not supported");
return -1;
}
try
{
auto param0 = py::convert_to<winrt::Windows::Foundation::AsyncOperationWithProgressCompletedHandler<TResult, TProgress>>(arg);
_obj.Completed(param0);
return 0;
}
catch (...)
{
py::to_PyErr();
return -1;
}
}
PyObject* get_ErrorCode() noexcept override
{
try
{
return py::convert(_obj.ErrorCode());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Id() noexcept override
{
try
{
return py::convert(_obj.Id());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Status() noexcept override
{
try
{
return py::convert(_obj.Status());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* dunder_await() noexcept override { return py::dunder_await(_obj); }
winrt::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress> _obj{ nullptr };
};
template<typename TResult>
struct IAsyncOperation : public py::proj::Windows::Foundation::IAsyncOperation
{
IAsyncOperation(winrt::Windows::Foundation::IAsyncOperation<TResult> o) : _obj(o) {}
winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept override { return _obj; }
std::size_t hash() noexcept override { return py::get_instance_hash(_obj); }
PyObject* Cancel(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.Cancel();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* Close(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
_obj.Close();
Py_RETURN_NONE;
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetResults(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetResults());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* get_Completed() noexcept override
{
try
{
return py::convert(_obj.Completed());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
int put_Completed(PyObject* arg) noexcept override
{
if (arg == nullptr)
{
PyErr_SetString(PyExc_TypeError, "property delete not supported");
return -1;
}
try
{
auto param0 = py::convert_to<winrt::Windows::Foundation::AsyncOperationCompletedHandler<TResult>>(arg);
_obj.Completed(param0);
return 0;
}
catch (...)
{
py::to_PyErr();
return -1;
}
}
PyObject* get_ErrorCode() noexcept override
{
try
{
return py::convert(_obj.ErrorCode());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Id() noexcept override
{
try
{
return py::convert(_obj.Id());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Status() noexcept override
{
try
{
return py::convert(_obj.Status());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* dunder_await() noexcept override { return py::dunder_await(_obj); }
winrt::Windows::Foundation::IAsyncOperation<TResult> _obj{ nullptr };
};
template<typename T>
struct IReferenceArray : public py::proj::Windows::Foundation::IReferenceArray
{
IReferenceArray(winrt::Windows::Foundation::IReferenceArray<T> o) : _obj(o) {}
winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept override { return _obj; }
std::size_t hash() noexcept override { return py::get_instance_hash(_obj); }
PyObject* GetBoolean(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetBoolean());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetBooleanArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<bool> param0 { };
_obj.GetBooleanArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetChar16(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetChar16());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetChar16Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<char16_t> param0 { };
_obj.GetChar16Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDateTime(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetDateTime());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDateTimeArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::DateTime> param0 { };
_obj.GetDateTimeArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDouble(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetDouble());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDoubleArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<double> param0 { };
_obj.GetDoubleArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetGuid(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetGuid());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetGuidArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::guid> param0 { };
_obj.GetGuidArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInspectableArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::IInspectable> param0 { };
_obj.GetInspectableArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt16(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetInt16());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt16Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<int16_t> param0 { };
_obj.GetInt16Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt32(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetInt32());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt32Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<int32_t> param0 { };
_obj.GetInt32Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt64(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetInt64());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt64Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<int64_t> param0 { };
_obj.GetInt64Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetPoint(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetPoint());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetPointArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::Point> param0 { };
_obj.GetPointArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetRect(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetRect());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetRectArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::Rect> param0 { };
_obj.GetRectArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSingle(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetSingle());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSingleArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<float> param0 { };
_obj.GetSingleArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSize(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetSize());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSizeArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::Size> param0 { };
_obj.GetSizeArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetString(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetString());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetStringArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::hstring> param0 { };
_obj.GetStringArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetTimeSpan(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetTimeSpan());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetTimeSpanArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::TimeSpan> param0 { };
_obj.GetTimeSpanArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt16(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt16());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt16Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint16_t> param0 { };
_obj.GetUInt16Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt32(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt32());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt32Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint32_t> param0 { };
_obj.GetUInt32Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt64(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt64());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt64Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint64_t> param0 { };
_obj.GetUInt64Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt8(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt8());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt8Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint8_t> param0 { };
_obj.GetUInt8Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* get_Value() noexcept override
{
try
{
return py::convert(_obj.Value());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_IsNumericScalar() noexcept override
{
try
{
return py::convert(_obj.IsNumericScalar());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Type() noexcept override
{
try
{
return py::convert(_obj.Type());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
winrt::Windows::Foundation::IReferenceArray<T> _obj{ nullptr };
};
template<typename T>
struct IReference : public py::proj::Windows::Foundation::IReference
{
IReference(winrt::Windows::Foundation::IReference<T> o) : _obj(o) {}
winrt::Windows::Foundation::IUnknown const& get_unknown() noexcept override { return _obj; }
std::size_t hash() noexcept override { return py::get_instance_hash(_obj); }
PyObject* GetBoolean(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetBoolean());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetBooleanArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<bool> param0 { };
_obj.GetBooleanArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetChar16(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetChar16());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetChar16Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<char16_t> param0 { };
_obj.GetChar16Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDateTime(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetDateTime());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDateTimeArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::DateTime> param0 { };
_obj.GetDateTimeArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDouble(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetDouble());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetDoubleArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<double> param0 { };
_obj.GetDoubleArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetGuid(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetGuid());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetGuidArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::guid> param0 { };
_obj.GetGuidArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInspectableArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::IInspectable> param0 { };
_obj.GetInspectableArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt16(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetInt16());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt16Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<int16_t> param0 { };
_obj.GetInt16Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt32(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetInt32());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt32Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<int32_t> param0 { };
_obj.GetInt32Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt64(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetInt64());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetInt64Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<int64_t> param0 { };
_obj.GetInt64Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetPoint(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetPoint());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetPointArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::Point> param0 { };
_obj.GetPointArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetRect(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetRect());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetRectArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::Rect> param0 { };
_obj.GetRectArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSingle(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetSingle());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSingleArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<float> param0 { };
_obj.GetSingleArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSize(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetSize());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetSizeArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::Size> param0 { };
_obj.GetSizeArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetString(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetString());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetStringArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::hstring> param0 { };
_obj.GetStringArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetTimeSpan(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetTimeSpan());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetTimeSpanArray(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<winrt::Windows::Foundation::TimeSpan> param0 { };
_obj.GetTimeSpanArray(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt16(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt16());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt16Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint16_t> param0 { };
_obj.GetUInt16Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt32(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt32());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt32Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint32_t> param0 { };
_obj.GetUInt32Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt64(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt64());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt64Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint64_t> param0 { };
_obj.GetUInt64Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt8(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
return py::convert(_obj.GetUInt8());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* GetUInt8Array(PyObject* args) noexcept override
{
Py_ssize_t arg_count = PyTuple_Size(args);
if (arg_count == 0)
{
try
{
winrt::com_array<uint8_t> param0 { };
_obj.GetUInt8Array(param0);
py::pyobj_handle out0{ py::convert(param0) };
if (!out0)
{
return nullptr;
}
return out0.detach();
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
else
{
py::set_invalid_arg_count_error(arg_count);
return nullptr;
}
}
PyObject* get_Value() noexcept override
{
try
{
return py::convert(_obj.Value());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_IsNumericScalar() noexcept override
{
try
{
return py::convert(_obj.IsNumericScalar());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
PyObject* get_Type() noexcept override
{
try
{
return py::convert(_obj.Type());
}
catch (...)
{
py::to_PyErr();
return nullptr;
}
}
winrt::Windows::Foundation::IReference<T> _obj{ nullptr };
};
}
namespace py::wrapper::Windows::Foundation
{
using Deferral = py::winrt_wrapper<winrt::Windows::Foundation::Deferral>;
using GuidHelper = py::winrt_wrapper<winrt::Windows::Foundation::GuidHelper>;
using MemoryBuffer = py::winrt_wrapper<winrt::Windows::Foundation::MemoryBuffer>;
using PropertyValue = py::winrt_wrapper<winrt::Windows::Foundation::PropertyValue>;
using Uri = py::winrt_wrapper<winrt::Windows::Foundation::Uri>;
using WwwFormUrlDecoder = py::winrt_wrapper<winrt::Windows::Foundation::WwwFormUrlDecoder>;
using WwwFormUrlDecoderEntry = py::winrt_wrapper<winrt::Windows::Foundation::WwwFormUrlDecoderEntry>;
using IAsyncAction = py::winrt_wrapper<winrt::Windows::Foundation::IAsyncAction>;
using IAsyncActionWithProgress = py::winrt_pinterface_wrapper<py::proj::Windows::Foundation::IAsyncActionWithProgress>;
using IAsyncInfo = py::winrt_wrapper<winrt::Windows::Foundation::IAsyncInfo>;
using IAsyncOperationWithProgress = py::winrt_pinterface_wrapper<py::proj::Windows::Foundation::IAsyncOperationWithProgress>;
using IAsyncOperation = py::winrt_pinterface_wrapper<py::proj::Windows::Foundation::IAsyncOperation>;
using IClosable = py::winrt_wrapper<winrt::Windows::Foundation::IClosable>;
using IGetActivationFactory = py::winrt_wrapper<winrt::Windows::Foundation::IGetActivationFactory>;
using IMemoryBuffer = py::winrt_wrapper<winrt::Windows::Foundation::IMemoryBuffer>;
using IMemoryBufferReference = py::winrt_wrapper<winrt::Windows::Foundation::IMemoryBufferReference>;
using IPropertyValue = py::winrt_wrapper<winrt::Windows::Foundation::IPropertyValue>;
using IReferenceArray = py::winrt_pinterface_wrapper<py::proj::Windows::Foundation::IReferenceArray>;
using IReference = py::winrt_pinterface_wrapper<py::proj::Windows::Foundation::IReference>;
using IStringable = py::winrt_wrapper<winrt::Windows::Foundation::IStringable>;
using IWwwFormUrlDecoderEntry = py::winrt_wrapper<winrt::Windows::Foundation::IWwwFormUrlDecoderEntry>;
using DateTime = py::winrt_struct_wrapper<winrt::Windows::Foundation::DateTime>;
using EventRegistrationToken = py::winrt_struct_wrapper<winrt::event_token>;
using HResult = py::winrt_struct_wrapper<winrt::hresult>;
using Point = py::winrt_struct_wrapper<winrt::Windows::Foundation::Point>;
using Rect = py::winrt_struct_wrapper<winrt::Windows::Foundation::Rect>;
using Size = py::winrt_struct_wrapper<winrt::Windows::Foundation::Size>;
using TimeSpan = py::winrt_struct_wrapper<winrt::Windows::Foundation::TimeSpan>;
}
namespace py
{
template<>
struct winrt_type<winrt::Windows::Foundation::Deferral>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::GuidHelper>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::MemoryBuffer>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::PropertyValue>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::Uri>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::WwwFormUrlDecoder>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::WwwFormUrlDecoderEntry>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IAsyncAction>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<py::proj::Windows::Foundation::IAsyncActionWithProgress>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IAsyncInfo>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<py::proj::Windows::Foundation::IAsyncOperationWithProgress>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<py::proj::Windows::Foundation::IAsyncOperation>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IClosable>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IGetActivationFactory>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IMemoryBuffer>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IMemoryBufferReference>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IPropertyValue>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<py::proj::Windows::Foundation::IReferenceArray>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<py::proj::Windows::Foundation::IReference>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IStringable>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::IWwwFormUrlDecoderEntry>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::DateTime>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::event_token>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::hresult>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::Point>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::Rect>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::Size>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template<>
struct winrt_type<winrt::Windows::Foundation::TimeSpan>
{
static PyTypeObject* python_type;
static PyTypeObject* get_python_type() { return python_type; }
};
template <typename TProgress>
struct pinterface_python_type<winrt::Windows::Foundation::IAsyncActionWithProgress<TProgress>>
{
using abstract = py::proj::Windows::Foundation::IAsyncActionWithProgress;
using concrete = py::impl::Windows::Foundation::IAsyncActionWithProgress<TProgress>;
};
template <typename TResult, typename TProgress>
struct pinterface_python_type<winrt::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress>>
{
using abstract = py::proj::Windows::Foundation::IAsyncOperationWithProgress;
using concrete = py::impl::Windows::Foundation::IAsyncOperationWithProgress<TResult, TProgress>;
};
template <typename TResult>
struct pinterface_python_type<winrt::Windows::Foundation::IAsyncOperation<TResult>>
{
using abstract = py::proj::Windows::Foundation::IAsyncOperation;
using concrete = py::impl::Windows::Foundation::IAsyncOperation<TResult>;
};
template <typename T>
struct pinterface_python_type<winrt::Windows::Foundation::IReferenceArray<T>>
{
using abstract = py::proj::Windows::Foundation::IReferenceArray;
using concrete = py::impl::Windows::Foundation::IReferenceArray<T>;
};
template <typename T>
struct pinterface_python_type<winrt::Windows::Foundation::IReference<T>>
{
using abstract = py::proj::Windows::Foundation::IReference;
using concrete = py::impl::Windows::Foundation::IReference<T>;
};
template <>
struct delegate_python_type<winrt::Windows::Foundation::AsyncActionCompletedHandler>
{
using type = py::impl::Windows::Foundation::AsyncActionCompletedHandler;
};
template <typename TProgress>
struct delegate_python_type<winrt::Windows::Foundation::AsyncActionProgressHandler<TProgress>>
{
using type = py::impl::Windows::Foundation::AsyncActionProgressHandler<TProgress>;
};
template <typename TProgress>
struct delegate_python_type<winrt::Windows::Foundation::AsyncActionWithProgressCompletedHandler<TProgress>>
{
using type = py::impl::Windows::Foundation::AsyncActionWithProgressCompletedHandler<TProgress>;
};
template <typename TResult>
struct delegate_python_type<winrt::Windows::Foundation::AsyncOperationCompletedHandler<TResult>>
{
using type = py::impl::Windows::Foundation::AsyncOperationCompletedHandler<TResult>;
};
template <typename TResult, typename TProgress>
struct delegate_python_type<winrt::Windows::Foundation::AsyncOperationProgressHandler<TResult, TProgress>>
{
using type = py::impl::Windows::Foundation::AsyncOperationProgressHandler<TResult, TProgress>;
};
template <typename TResult, typename TProgress>
struct delegate_python_type<winrt::Windows::Foundation::AsyncOperationWithProgressCompletedHandler<TResult, TProgress>>
{
using type = py::impl::Windows::Foundation::AsyncOperationWithProgressCompletedHandler<TResult, TProgress>;
};
template <>
struct delegate_python_type<winrt::Windows::Foundation::DeferralCompletedHandler>
{
using type = py::impl::Windows::Foundation::DeferralCompletedHandler;
};
template <typename T>
struct delegate_python_type<winrt::Windows::Foundation::EventHandler<T>>
{
using type = py::impl::Windows::Foundation::EventHandler<T>;
};
template <typename TSender, typename TResult>
struct delegate_python_type<winrt::Windows::Foundation::TypedEventHandler<TSender, TResult>>
{
using type = py::impl::Windows::Foundation::TypedEventHandler<TSender, TResult>;
};
template<>
struct converter<winrt::Windows::Foundation::DateTime>
{
static PyObject* convert(winrt::Windows::Foundation::DateTime instance) noexcept;
static winrt::Windows::Foundation::DateTime convert_to(PyObject* obj);
};
template<>
struct converter<winrt::hresult>
{
static PyObject* convert(winrt::hresult instance) noexcept;
static winrt::hresult convert_to(PyObject* obj);
};
template<>
struct converter<winrt::Windows::Foundation::Point>
{
static PyObject* convert(winrt::Windows::Foundation::Point instance) noexcept;
static winrt::Windows::Foundation::Point convert_to(PyObject* obj);
};
template<>
struct converter<winrt::Windows::Foundation::Rect>
{
static PyObject* convert(winrt::Windows::Foundation::Rect instance) noexcept;
static winrt::Windows::Foundation::Rect convert_to(PyObject* obj);
};
template<>
struct converter<winrt::Windows::Foundation::Size>
{
static PyObject* convert(winrt::Windows::Foundation::Size instance) noexcept;
static winrt::Windows::Foundation::Size convert_to(PyObject* obj);
};
template<>
struct converter<winrt::Windows::Foundation::TimeSpan>
{
static PyObject* convert(winrt::Windows::Foundation::TimeSpan instance) noexcept;
static winrt::Windows::Foundation::TimeSpan convert_to(PyObject* obj);
};
}
|
<gh_stars>10-100
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.yarn.server.router.webapp;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWSConsts;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodeInfo;
import org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.NodesInfo;
import org.apache.hadoop.yarn.server.router.Router;
import org.apache.hadoop.yarn.util.Times;
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet;
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.TABLE;
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.TBODY;
import org.apache.hadoop.yarn.webapp.hamlet2.Hamlet.TR;
import org.apache.hadoop.yarn.webapp.util.WebAppUtils;
import org.apache.hadoop.yarn.webapp.view.HtmlBlock;
import com.google.inject.Inject;
/**
* Nodes block for the Router Web UI.
*/
public class NodesBlock extends HtmlBlock {
private static final long BYTES_IN_MB = 1024 * 1024;
private final Router router;
@Inject
NodesBlock(Router router, ViewContext ctx) {
super(ctx);
this.router = router;
}
@Override
protected void render(Block html) {
// Get the node info from the federation
Configuration conf = this.router.getConfig();
String webAppAddress = WebAppUtils.getRouterWebAppURLWithScheme(conf);
NodesInfo nodes = RouterWebServiceUtil.genericForward(webAppAddress, null,
NodesInfo.class, HTTPMethods.GET,
RMWSConsts.RM_WEB_SERVICE_PATH + RMWSConsts.NODES, null, null);
setTitle("Nodes");
TBODY<TABLE<Hamlet>> tbody = html.table("#nodes").thead().tr()
.th(".nodelabels", "Node Labels")
.th(".rack", "Rack")
.th(".state", "Node State")
.th(".nodeaddress", "Node Address")
.th(".nodehttpaddress", "Node HTTP Address")
.th(".lastHealthUpdate", "Last health-update")
.th(".healthReport", "Health-report")
.th(".containers", "Containers")
.th(".mem", "Mem Used")
.th(".mem", "Mem Avail")
.th(".vcores", "VCores Used")
.th(".vcores", "VCores Avail")
.th(".nodeManagerVersion", "Version")
.__().__().tbody();
// Add nodes to the web UI
for (NodeInfo info : nodes.getNodes()) {
int usedMemory = (int) info.getUsedMemory();
int availableMemory = (int) info.getAvailableMemory();
TR<TBODY<TABLE<Hamlet>>> row = tbody.tr();
row.td().__(StringUtils.join(",", info.getNodeLabels())).__();
row.td().__(info.getRack()).__();
row.td().__(info.getState()).__();
row.td().__(info.getNodeId()).__();
boolean isInactive = false;
if (isInactive) {
row.td().__("N/A").__();
} else {
String httpAddress = info.getNodeHTTPAddress();
row.td().a("//" + httpAddress, httpAddress).__();
}
row.td().br().$title(String.valueOf(info.getLastHealthUpdate())).__()
.__(Times.format(info.getLastHealthUpdate())).__()
.td(info.getHealthReport())
.td(String.valueOf(info.getNumContainers())).td().br()
.$title(String.valueOf(usedMemory)).__()
.__(StringUtils.byteDesc(usedMemory * BYTES_IN_MB)).__().td().br()
.$title(String.valueOf(availableMemory)).__()
.__(StringUtils.byteDesc(availableMemory * BYTES_IN_MB)).__()
.td(String.valueOf(info.getUsedVirtualCores()))
.td(String.valueOf(info.getAvailableVirtualCores()))
.td(info.getVersion()).__();
}
tbody.__().__();
}
}
|
<reponame>Elvynia/forme-frontend
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { MissionEvent } from './mission-event';
import { EntityService, AuthService } from './core';
@Injectable()
export class EventService extends EntityService<MissionEvent> {
protected initialize() {
this.apiPath += '/event';
super.initialize();
}
getNew(): MissionEvent {
return new MissionEvent();
}
listByMission(missionId: number) {
let params = new HttpParams();
params.set('missionId', missionId.toString());
this.httpClient.get(this.apiPath + '/', {
params: params
});
}
}
|
Shape Analysis of Defect-Laden Data Shape analysis is a well-established tool for processing surfaces. It is often a first step in performing tasks such as segmentation, symmetry detection, and finding correspondences between shapes. Shape analysis is traditionally employed on well-sampled surfaces where the geometry and topology is precisely known. When the form of the surface is that of a point cloud containing nonuniform sampling, noise, and incomplete measurements, traditional shape analysis methods perform poorly. Although one may first perform reconstruction on such a point cloud prior to performing shape analysis, if the geometry and topology is far from the true surface, then this can have an adverse impact on the subsequent analysis. Furthermore, for triangulated surfaces containing noise, thin sheets, and poorly shaped triangles, existing shape analysis methods can be highly unstable. This thesis explores methods of shape analysis applied directly to such defect-laden shapes. We first study the problem of surface reconstruction, in order to obtain a better understanding of the types of point clouds for which reconstruction methods contain difficulties. To this end, we have devised a benchmark for surface reconstruction, establishing a standard for measuring error in reconstruction. We then develop a new method for consistently orienting normals of such challenging point clouds by using a collection of harmonic functions, intrinsically defined on the point cloud. Next, we develop a new shape analysis tool which is tolerant to imperfections, by constructing distances directly on the point cloud defined as the likelihood of two points belonging to a mutually common medial ball, and apply this for segmentation and reconstruction. We extend this distance measure to define a diffusion process on the point cloud, tolerant to missing data, which is used for the purposes of matching incomplete shapes undergoing a nonrigid deformation. Lastly, we have developed an intrinsic method for multiresolution remeshing of a poor-quality triangulated surface via spectral bisection. |
Nano Power Current Reference Circuit Consisting of Sub-threshold CMOS Circuits a low voltage CMOS Nano power current reference circuit has been presented in this paper and also the circuit simulation performance in 180-nm UMC CMOS technology. Most of the MOSFETs operate in sub-threshold region consisting of bias-voltage, start-up and current-source sub-circuits. A stable reference current of 4-nA lying in supply voltage range of 1 V-1.8 V has been generated with line sensitivity of 0.203% /V. Within the temperature range of 0°C to 100 °C, and the voltage level of 1.8 V, the temperature coefficient was 7592ppm/°C. At the same voltage supply, the power dissipation was found out to be 380 NW. It is suitable to use this circuit in sub threshold power aware large scale integration. |
Image copyright SPL
A senior researcher has accused the UK government of using "fake science" to justify its policy of culling badgers to control cattle TB.
Prof Rosie Woodroffe has told BBC News that ministers were creating an "illusion" of success to justify the policy.
She was speaking ahead of a scientific symposium on controlling cattle TB.
Ministers say their approach is supported by government scientists and leading vets.
When evidence is being cherry-picked and presented in the best possible light it ceases to be evidence. It is fake science Prof Rosie Woodroffe, ZSL
Prof Woodroffe, a wildlife expert at the Zoological Society of London (ZSL) who carried out the scientific assessment of culling badgers to control Cattle TB on which the current policy is based, said the government risked losing trust on how it used evidence - not just on its policy on controlling cattle TB but also on other important scientific issues.
"When evidence is being cherry-picked and presented in the best possible light, it ceases to be evidence. It is fake science.
"When it comes to (other policy areas) such as climate change and bee pollination, issues that have a big impact on lives and livelihoods of people, it is important that we can rely on the government to provide good evidence that stands up to scrutiny."
England has the highest incidence of TB in Europe and that is why we are taking strong action Defra Spokesman
A spokesman for the Department for Environment, Food and Rural Affairs (Defra), which oversees the badger cull, responded: "England has the highest incidence of TB in Europe and that is why we are taking strong action to deliver our 25-year strategy to eradicate the disease and to protect the future of our dairy and beef industries.
"Badger control in areas where TB is rife is one part of our long-term plan, which also includes strengthening cattle testing and movement controls, improving biosecurity on farm and when trading, and badger vaccination when possible."
Read also: Badger culls extended to Wales to stem spread of cattle TB
Image copyright PA Image caption Rock musician Brian May, who has campaigned against the badger cull, is aiming to reach a scientific consensus on the issue
Defra has overseen the issuing of licences to cull badgers in 10 areas in South West England to reduce the incidence of TB in cattle. The first culls began in 2013 in two areas in Somerset and Gloucestershire amid criticism from many scientists that the policy would at best have only a marginal effect on the spread of the disease and possibly increase the spread of TB.
The critics' comments stem from an eight-year trial carried out by Prof Woodroffe in the 1990s which showed that only sustained and coordinated culling of badgers can slow down the rate of increase in cattle becoming infected with TB in the immediate area.
Everyone is sincere in their views but they are diametrically opposed based on the same body of data. Brain May, Anti-cull campaigner
Crucially, the trial also showed that if less than 70% of badgers are killed, the incidence of TB will not be reduced and may even increase because of the greater movement of badgers caused by the disturbance of culling.
Since then Defra's own monitoring has concluded that it has killed enough badgers in its pilot culls and has rolled out culls in eight more areas. The department will also announce up 10 more areas later this year.
But some scientists are concerned that Defra has changed the way it assesses badger numbers in a cull area and how it sets the target for the minimum number of badgers to be killed to ensure that its culls are seen to be successful.
Image copyright Reuters Image caption Thousands of cattle are slaughtered each year because of bovine TB
The previous system involved field work by experts to inspect the number of badger setts and a system of genetically testing badger hairs. Many researchers regard this approach as a more accurate way of assessing badger numbers but it is also expensive.
The new system requires no field work. Instead, officials calculate the average number of badgers thought to be in different categories of land from government records.
The new method predicts a higher and lower number for the total number of badgers in any given cull area. This reflects the scientific uncertainty. In its advice to Natural England, who issue licences for the trials, Defra has suggested the agency require culling companies to kill the lower number. The document also states that if it becomes apparent during the cull itself that there are more or less numbers than predicted the targets should be revised accordingly.
But according to Prof Woodroffe, if the government can revise its targets then by definition the culls will always be successful
"Where few badgers were being killed, they lowered the targets; where a lot were killed, they raised them. This means that there is really no way to tell what reduction in badger numbers was achieved by these culls. Culling that was consistently ineffective would look like a low badger density and prompt a reduced target," she said.
Prof Tim Coulson, of Oxford University, who was a member of the Independent Expert Panel (IEP) that assessed the pilot culls, agrees.
"The IEP developed robust methods for assessing effectiveness. Defra has chosen to ignore these. My hope is at the end of this there is a proper independent review and those who have deliberately chosen to ignore the science and pursue an expensive and ineffective agenda on political grounds are held accountable.
"It is not helping the poor farmers. It is costing the tax payer millions. The science has already been clear, but science no longer plays a part in the decision process."
But a spokesman for the National Farmers Union (NFU), which is in favour of the culls, said that the new method for assessing and adjusting targets was justified.
"Daily data collected through the course of the cull will allow Natural England to assess whether the estimated population was a reasonable reflection of the true population. If there is evidence on the ground during culling operations that suggests the minimum and maximum numbers have been set either too low or too high, Natural England can adjust the figures accordingly."
Image copyright Will Oliver/Getty
The rock musician Brain May, who campaigns against the cull, is among the organisers of Tuesday's scientific symposium. He said he hoped that it might be possible for all parties to reach a scientific consensus.
"Everyone is sincere in their views but they are diametrically opposed based on the same body of data. My view is that it's because there are all sorts of other factors in there: there is a political element, there is an emotional element, as well as an intellectual element; and unfortunately it has become very hard to disentangle all these.
"The aim of this conference is to try to clear that out of the way and look honestly, and, if possible, without prejudice at the information that is in front of us."
Follow Pallab on Twitter. |
def applyHarmonicPositionalRestraints(system, forceConstantInKcalPerMolePerAngSquared,
positions, indexOfAtomsToBeModified):
forceConstant = u.Quantity(value=forceConstantInKcalPerMolePerAngSquared,
unit=u.kilocalorie/(u.mole * u.angstrom * u.angstrom))
force = mm.CustomExternalForce("k*periodicdistance(x, y, z, x0, y0, z0)^2")
force.addGlobalParameter("k",
forceConstant.in_units_of(u.kilojoule/(u.mole * u.nanometer * u.nanometer )))
force.addPerParticleParameter("x0")
force.addPerParticleParameter("y0")
force.addPerParticleParameter("z0")
for i in indexOfAtomsToBeModified:
force.addParticle(i, positions[i])
system.addForce(force) |
<filename>ForEach.h
//
// Created by <NAME> on 24.07.2019.
//
#ifndef PROMISE_FOREACH_H
#define PROMISE_FOREACH_H
#include "Event.h"
#include "Owner.h"
#include "Promise.h"
#include "Console.h"
/**
* For Each Task
*
* Specialisation of the Promise class with two Event types as parameters for the parent class
* The call parameters of the event functors are defined via these types
* Contains the code run by the worker thread
*/
template< typename T_ItPointer, typename T_Lambda >
class ForEachTask : public Promise< EventContainer< T_ItPointer >, EventContainer<> > {
private:
T_ItPointer m_array;
LambdaContainer< T_Lambda > m_function;
public:
template< typename T_Param >
explicit ForEachTask( Deallocator* d, T_Param&& it, T_Lambda&& lam )
: Promise< EventContainer< T_ItPointer >, EventContainer<> >( d ),
m_array( std::forward<T_Param>( it ) ), m_function( std::forward<T_Lambda>(lam) ) {}
void execute(Worker::WorkerInterface& intf) override {
Console::println( "Executing Foreach on a thread." );
for( auto& x : *m_array ) {
m_function.get()( x );
}
auto& cb= this->m_callbackResolve;
if( cb ) {
//std::get<0>(cb->getData())= std::move( m_array );
cb->getData()= std::move( m_array );
intf.sendEvent( std::move( cb ) );
}
}
};
/**
* Function to create a new Promise Builder for a ForEachTask
* @tparam T_ItPointer - Type of pointer to an iteratable object
* @tparam T_Lambda - Functor (Lambda) Type
* @param ptr - Pointer to an iteratable object
* @param p - Reference to the Worker Pool
* @param lam - Functor (Lambda) to call on each instance
* @return - New Promise Builder
*/
template< typename T_ItPointer, typename T_Allocator, typename T_Lambda >
auto forEach( T_ItPointer&& ptr, T_Allocator& alloc, WorkerPool& p, T_Lambda&& lam ) {
return createPromiseBuilder( alloc.template allocate< ForEachTask<T_ItPointer, T_Lambda> >(
std::forward<T_ItPointer>(ptr), std::forward<T_Lambda>(lam)), p, alloc );
};
#endif //PROMISE_FOREACH_H
|
<reponame>udhos/disbalance
package main
import (
"log"
"net/http"
)
type httpHandler struct {
app *server
h http.Handler
}
func (h httpHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Printf("staticHandler.ServeHTTP url=%s from=%s", r.URL.Path, r.RemoteAddr)
h.h.ServeHTTP(w, r)
}
func registerStatic(app *server, path, dir string) {
log.Printf("mapping www path %s to directory %s", path, dir)
http.Handle(path, httpHandler{app, http.StripPrefix(path, http.FileServer(http.Dir(dir)))})
}
|
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import math
from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler
from UTILS.colorful import *
import numpy as np
from UTILS.tensor_ops import _2tensor
class PPO():
def __init__(self, policy_and_critic, mcv=None):
from .reinforce_foundation import CoopAlgConfig
self.policy_and_critic = policy_and_critic
self.clip_param = CoopAlgConfig.clip_param
self.ppo_epoch = CoopAlgConfig.ppo_epoch
self.n_pieces_batch_division = CoopAlgConfig.n_pieces_batch_division
self.value_loss_coef = CoopAlgConfig.value_loss_coef
self.entropy_coef = CoopAlgConfig.entropy_coef
self.max_grad_norm = CoopAlgConfig.max_grad_norm
self.lr = CoopAlgConfig.lr
self.g_optimizer = optim.Adam(policy_and_critic.parameters(), lr=self.lr)
self.g_update_delayer = 0
self.g_initial_value_loss = 0
self.invalid_penalty = CoopAlgConfig.invalid_penalty
# 轮流训练式
self.train_switch = True
self.mcv = mcv
self.ppo_update_cnt = 0
self.loss_bias = CoopAlgConfig.balance
def train_on_traj(self, traj_pool, task):
# print(traj_pool) 从轨迹中采样
g_value_loss_epoch = 0
g_action_loss_epoch = 0
g_dist_entropy_epoch = 0
error_act_loss_epoch = 0
self.train_switch = not self.train_switch
num_updates = self.ppo_epoch * self.n_pieces_batch_division
if task == 'train_R':
flag='train_R'
print('train_R')
elif task == 'train_L':
flag='train_L'
print('train_L')
for e in range(self.ppo_epoch):
data_generator = self.轨迹采样(traj_pool, flag=flag)
n_batch = next(data_generator)
for small_batch in range(n_batch):
sample = next(data_generator)
self.g_optimizer.zero_grad()
loss_final = 0
policy_loss, entropy_loss, gx_value_loss, error_act_loss, loss_final_t = self.get_loss(flag, sample)
g_value_loss_epoch += gx_value_loss.item() / num_updates
g_action_loss_epoch += policy_loss.item() / num_updates
g_dist_entropy_epoch += entropy_loss.item() / num_updates
error_act_loss_epoch += error_act_loss.item() / num_updates
if flag == 'train_R':
loss_final += loss_final_t * self.loss_bias
if flag == 'train_L':
loss_final += loss_final_t * (1 - self.loss_bias)
loss_final.backward()
nn.utils.clip_grad_norm_(self.policy_and_critic.parameters(), self.max_grad_norm)
self.g_optimizer.step()
pass # finish small batch update
pass # finish all epoch update
self.ppo_update_cnt += 1
print亮靛('value loss', g_value_loss_epoch, 'policy loss',g_action_loss_epoch, 'entropy loss',g_dist_entropy_epoch,'invalid-action loss', error_act_loss_epoch)
return self.ppo_update_cnt
def 轨迹采样(self, traj_pool, flag):
container = {}
if flag=='train_R':
req_dict = ['g_obs', 'g_actions', 'g_actionLogProbs_R', 'return_R', 'value_R', 'ctr_mask_R' ]
req_dict_rename = ['g_obs', 'g_actions', 'g_actionLogProbs' , 'return', 'state_value', 'ctr_mask']
elif flag=='train_L':
req_dict = ['g_obs', 'g_actions', 'g_actionLogProbs_L', 'return_L', 'value_L', 'ctr_mask_L']
req_dict_rename = ['g_obs', 'g_actions', 'g_actionLogProbs' , 'return', 'state_value', 'ctr_mask']
return_rename = "return"
value_rename = "state_value"
advantage_rename = "advantage"
# 将 g_obs 替换为 g_obs>xxxx
for key_index, key in enumerate(req_dict):
key_name = req_dict[key_index]
key_rename = req_dict_rename[key_index]
if not hasattr(traj_pool[0], key_name):
real_key_list = [real_key for real_key in traj_pool[0].__dict__ if (key_name+'>' in real_key)]
assert len(real_key_list) > 0, ('检查提供的变量', key,key_index)
for real_key in real_key_list:
mainkey, subkey = real_key.split('>')
req_dict.append(real_key)
req_dict_rename.append(key_rename+'>'+subkey)
big_batch_size = -1 # 检查是不是长度统一
# 加载轨迹进container数组
for key_index, key in enumerate(req_dict):
key_name = req_dict[key_index]
key_rename = req_dict_rename[key_index]
if not hasattr(traj_pool[0], key_name): continue
set_item = np.concatenate([getattr(traj, key_name) for traj in traj_pool], axis=0)
if not (big_batch_size==set_item.shape[0] or (big_batch_size<0)):
print('error')
assert big_batch_size==set_item.shape[0] or (big_batch_size<0), (key,key_index)
big_batch_size = set_item.shape[0]
container[key_rename] = set_item # 指针赋值
container[advantage_rename] = container[return_rename] - container[value_rename]
container[advantage_rename] = ( container[advantage_rename] - container[advantage_rename].mean() ) / (container[advantage_rename].std() + 1e-5)
mini_batch_size = math.ceil(big_batch_size / self.n_pieces_batch_division) # size of minibatch for each agent
sampler = BatchSampler(SubsetRandomSampler(range(big_batch_size)), mini_batch_size, drop_last=False)
yield len(sampler)
for indices in sampler:
selected = {}
for key in container:
selected[key] = container[key][indices]
for key in [key for key in selected if '>' in key]:
# 重新把子母键值组合成二重字典
mainkey, subkey = key.split('>')
if not mainkey in selected: selected[mainkey] = {}
selected[mainkey][subkey] = selected[key]
del selected[key]
yield selected
def get_loss(self, flag, sample):
obs = _2tensor(sample['g_obs'])
# obs: $batch.$n_agent.$core_dim used in [action eval],
advantage = _2tensor(sample['advantage'])
# advantage A(s_t): $batch.$1.(advantage) used in [policy reinforce],
action = _2tensor(sample['g_actions'])
# action: $batch.$2.(two actions) not used yet
oldPi_actionLogProb = _2tensor(sample['g_actionLogProbs'])
# oldPi_actionLogProb: $batch.$1.(the output from act) used in [clipped version of value loss],
real_value = _2tensor(sample['return'])
# real_value: $batch.$1.(r_t0+r_t1+r_t2+...)
ctr_mask = _2tensor(sample['ctr_mask'])
if flag == 'train_R':
newPi_value, newPi_actionLogProb, entropy_loss, probs_, _,_,_,_ = self.policy_and_critic.evaluate_actions(obs, action)
elif flag == 'train_L':
_,_,_,_, newPi_value, newPi_actionLogProb, entropy_loss, probs_ = self.policy_and_critic.evaluate_actions(obs, action)
else:
assert False
error_act_loss = (ctr_mask*probs_).mean()
ratio = torch.exp(newPi_actionLogProb - oldPi_actionLogProb)
surr1 = ratio * advantage
surr2 = torch.clamp(ratio, 1.0 - self.clip_param, 1.0 + self.clip_param) * advantage
policy_loss = -torch.min(surr1, surr2).mean()
value_loss = 0.5 * F.mse_loss(real_value, newPi_value)
loss_final = policy_loss +value_loss*self.value_loss_coef -entropy_loss*self.entropy_coef +error_act_loss * self.invalid_penalty
return policy_loss, entropy_loss, value_loss, error_act_loss, loss_final
|
London - In the U.K., the government has recommended that certain vulnerable groups take vitamin D supplements as part of a health promotion measure. Digital Journal assesses the reasons.
Vitamin D has several important functions. For example, it helps regulate the amount of calcium and phosphate in the body. Vitamin D is, in fact, a complex of chemicals and the term refers to a group of fat-soluble secosteroids (a type of steroid.) These chemicals are responsible for enhancing intestinal absorption of calcium, iron, magnesium, phosphate and zinc.
According to the U.K. Department of Health, a lack of vitamin D can lead to bone deformities such as rickets in children, and bone pain and tenderness as a result of a condition called osteomalacia in adults.
With most people, vitamin D is obtained from sun exposure and from certain types of food. For others, the essential vitamin can be derived from supplements. With food, the choices are limited for very few foods in nature contain vitamin D. The flesh of fatty fish (such as salmon, tuna, and mackerel) and fish liver oils are among the best sources. Small amounts of vitamin D are found in beef liver, mushrooms, cheese, and egg yolks. Some foods, such as some breakfast cereals, soya products, some dairy products, powdered milks and fat spreads, have vitamin D added to them.
With sunlight, this is obviously variable depending upon the part of the world someone resides in and the time of year. The sun is less likely to provide your daily needs at higher latitudes, in the winter, or if you're older or dark skinned (skin pigment blocks light and the process is less efficient with age). In addition, excessive exposure to sunlight brings with it the risk of skin cancer.
Pregnant and breastfeeding women. It is important that women take a vitamin D supplement throughout pregnancy and while breastfeeding to ensure they get enough vitamin D and that their baby is born with enough vitamin D for early infancy.
The U.K. National Diet and Nutrition Survey rolling programme (2008 and 2009 to 2011 and 2012) indicated that up to 1 in 4 adults in the U.K. have a low vitamin D status, and are therefore at increased risk of deficiency.
Due to concerns with low intake and with the vulnerable groups, the health department has embarked on a promotion campaign and it has produced information leaflets. |
package com.jz.nebula.controller.api;
import com.jz.nebula.entity.Role;
import com.jz.nebula.entity.UserLogisticsPreference;
import com.jz.nebula.service.UserLogisticsPreferenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PagedResourcesAssembler;
import org.springframework.hateoas.EntityModel;
import org.springframework.hateoas.PagedModel;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.util.UriComponentsBuilder;
import javax.annotation.security.RolesAllowed;
import javax.servlet.http.HttpServletResponse;
@RestController
@RequestMapping("/api/preferences")
public class UserPreferenceController {
@Autowired
private UserLogisticsPreferenceService userLogisticsPreferenceService;
/**
* @param pageable
* @param uriBuilder
* @param response
* @param assembler
*
* @return
*/
@GetMapping("/logistics")
@RolesAllowed({Role.ROLE_USER, Role.ROLE_VENDOR, Role.ROLE_ADMIN})
public @ResponseBody
PagedModel<EntityModel<UserLogisticsPreference>> all(Pageable pageable, final UriComponentsBuilder uriBuilder,
final HttpServletResponse response, PagedResourcesAssembler<UserLogisticsPreference> assembler) {
return userLogisticsPreferenceService.findAll(pageable, assembler);
}
/**
* @param id
*
* @return
*/
@GetMapping("/logistics/{id}")
@RolesAllowed({Role.ROLE_USER, Role.ROLE_VENDOR, Role.ROLE_ADMIN})
public @ResponseBody
UserLogisticsPreference findById(@PathVariable("id") long id) {
return userLogisticsPreferenceService.findById(id);
}
/**
* @param userLogisticsPreference
*
* @return
*/
@PostMapping("/logistics")
@RolesAllowed({Role.ROLE_USER, Role.ROLE_VENDOR, Role.ROLE_ADMIN})
public @ResponseBody
UserLogisticsPreference create(@RequestBody UserLogisticsPreference userLogisticsPreference) {
return userLogisticsPreferenceService.save(userLogisticsPreference);
}
/**
* @param id
* @param userLogisticsPreference
*
* @return
*/
@PutMapping("/logistics/{id}")
@RolesAllowed({Role.ROLE_USER, Role.ROLE_VENDOR, Role.ROLE_ADMIN})
public @ResponseBody
UserLogisticsPreference update(@PathVariable("id") long id, @RequestBody UserLogisticsPreference userLogisticsPreference) {
userLogisticsPreference.setId(id);
return userLogisticsPreferenceService.save(userLogisticsPreference);
}
/**
* @param id
*
* @return
*/
@DeleteMapping("/logistics/{id}")
@RolesAllowed({Role.ROLE_USER, Role.ROLE_VENDOR, Role.ROLE_ADMIN})
public @ResponseBody
ResponseEntity<?> delete(@PathVariable("id") long id) {
userLogisticsPreferenceService.delete(id);
return ResponseEntity.noContent().build();
}
}
|
<reponame>eriknyquist/wip
from text_game_maker.utils import utils
class Event(object):
"""
Class to represent a generic event that handlers can be registered for
"""
def __init__(self):
self._handlers = []
def clear_handlers(self):
"""
Clear any registered handlers for event.
:return: Event instance
:rtype: text_game_maker.event.event.Event
"""
self._handlers = []
return self
def add_handler(self, handler):
"""
Registers a handler to run when this event is generated.
:param handler: handler to add. Handler should be of the form:\
``handler(*event_args)`` where ``event_args`` is all of the\
arguments for the event
:return: Event instance
:rtype: text_game_maker.event.event.Event
"""
self._handlers.append(handler)
return self
def clear_handler(self, handler):
"""
Unregisters a handler.
:param handler: the handler that was previously registered
:return: Event instance
:rtype: text_game_maker.event.event.Event
"""
try:
self._handlers.remove(handler)
except ValueError:
pass
return self
def generate(self, *event_args):
"""
Generate an event. Runs all registered handlers.
:param event_args: arguments to pass to event handlers
:return: Event instance
:rtype: text_game_maker.event.event.Event
"""
for handler in self._handlers:
handler(*event_args)
return self
def serialize(self):
return [utils.serialize_callback(cb) for cb in self._handlers]
def deserialize(self, attrs):
self._handlers = [utils.deserialize_callback(name) for name in attrs]
|
The Littlehampton RNLI team have rescued a man in the River Arun as part of two searches for people in the water.
Both searches happened on Tuesday evening 31 July following calls from UK Coastguard and the police.
The first call was at 8.30pm, reporting a person in the River Arun.
The station’s D Class lifeboat Ray of Hope and volunteer crew launched ten minutes later and headed up the river towards the reported location, near Tortington, Arundel.
The search began along the river from Tortington to the A27 at Arundel.
The Fire and Rescue Service tasked the lifeboat to search up to the old road bridge in Arundel.
The casualty was located by the lifeboat crew on the west bank of the river by the old windmill and was escorted up the river bank to the A27 by a crew member and handed over to the Coastguard Rescue Team.
The lifeboat was stood down and returned to the station at 9.40pm.
While on the slipway, having returned from the first incident, the lifeboat and same crew were called to another incident by the UK Coastguard. This was sparked by a police report of someone shouting for help near Greatham Bridge on the River Arun.
The lifeboat launched and set course at just before 10pm. In fading light, an extensive search was conducted fifteen miles upriver from the from the lifeboat station, along the river and river banks between Greatham and Timberley bridges.
At 1.10am, the teams agreed that the search should be called off as it had proved inconclusive.
The lifeboat was stood down and returned to the station at just before 1.30am, where it was refuelled and made ready for service. |
<gh_stars>0
package com.algorand.auction.rest;
import com.algorand.auction.model.Auction;
import com.algorand.auction.model.Bid;
import com.algorand.auction.model.FailureError;
import com.algorand.auction.model.Item;
import com.algorand.auction.usecase.RetrieveAuctionsUseCase;
import io.vavr.control.Either;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static org.springframework.http.ResponseEntity.ok;
import static org.springframework.http.ResponseEntity.status;
@RestController("auction")
@RequestMapping(value = "/api")
public class AuctionController {
private RetrieveAuctionsUseCase useCase;
@Autowired
public AuctionController(
RetrieveAuctionsUseCase useCase
) {
this.useCase = useCase;
}
@GetMapping("/auctions/all")
public ResponseEntity<List<Item>> getAllAuctions() {
Either<FailureError, List<Item>> result = useCase.retrieveAll();
if (result.isRight())
return ok(result.get());
else {
return status(404).build();
}
}
@GetMapping("/auctions/{auctionId}")
public ResponseEntity<Auction> getAuction(
@PathVariable Integer auctionId
) {
Either<FailureError, Auction> result = useCase.retrieveById(auctionId);
if (result.isRight())
return ok(result.get());
else {
return status(404).build();
}
}
@GetMapping("/auctions/{auctionId}/bids")
public ResponseEntity<List<Bid>> getLastBidsFor(
@PathVariable Integer auctionId
) {
Either<FailureError, List<Bid>> result = useCase.retrieveLastBidsFor(auctionId);
if (result.isRight())
return ok(result.get());
else {
return status(404).build();
}
}
}
|
// GetBot fetches the bot state for the given name
func (kos *KelpOS) GetBot(botName string) (*BotInstance, error) {
kos.botLock.Lock()
defer kos.botLock.Unlock()
b, exists := kos.bots[botName]
if !exists {
return b, fmt.Errorf("bot '%s' does not exist", botName)
}
return b, nil
} |
/*
NAME: <NAME>
ID:20200105021
SECTION:A
----------------------
CHAPTER:02
PROBLEM:05
*/
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a,b,c;
cout<<"Enter Opposite: ";
cin>>a;
cout<<"Enter Adjacent: ";
cin>>b;
c=sqrt(pow(a,2)+pow(b,2));
cout<<"Hypotenuse = "<<c;
return 0 ;
}
|
Origin of hepatitis C virus genotype 3 in Africa as estimated through an evolutionary analysis of the full-length genomes of nine subtypes, including the newly sequenced 3d and 3e. We characterized the full-length genomes of nine hepatitis C virus genotype 3 (HCV-3) isolates: QC7, QC8, QC9, QC10, QC34, QC88, NE145, NE274 and 811. To the best of our knowledge, NE274 and NE145 were the first full-length genomes for confirming the provisionally assigned subtypes 3d and 3e, respectively, whereas 811 represented the first HCV-3 isolate that had its extreme 3' UTR terminus sequenced. Based on these full-length genomes, together with 42 references representing eight assigned subtypes and an unclassified variant of HCV-3, and 10 sequences of six other genotypes, a timescaled phylogenetic tree was reconstructed after an evolutionary analysis using a coalescent Bayesian procedure. The results indicated that subtypes 3a, 3d and 3e formed a subset with a common ancestor dated to ~202.89 years ago. The analysis of all of the HCV-3 sequences as a single lineage resulted in the dating of the divergence time to ~457.81 (95% HPD: 350.62, 587.53) years ago, whereas the common ancestor of all of the seven HCV genotypes dated to ~780.86 (95% HPD: 592.15, 1021.34) years ago. As subtype 3h and the unclassified variant were relatives, and represented the oldest HCV-3 lineages with origins in Africa and the Middle East, these findings may indicate the ancestral origin of HCV-3 in Africa. We speculate that the ancestral HCV-3 strains may have been brought to South Asia from Africa by land and/or across the sea to result in its indigenous circulation in that region. The spread was estimated to have occurred in the era after Vasco da Gama had completed his expeditions by sailing along the eastern coast of Africa to India. However, before this era, Arabians had practised slave trading from Africa to the Middle East and South Asia for centuries, which may have mediated the earliest spread of HCV-3. |
Modeling of the factors influencing the dairy market in Ukraine Purpose. The present article aims to identify main determinants influencing development of demand at the dairy market in Ukraine (the average volume of milk consumption per capita), to evaluate their impact on the demand, to assess dependencies between the factors and the partial elasticity coefficients for their further use in forecasting. Methodology / approach. In the research, the authors used information from the State Statistics Service of Ukraine concerning dynamics of the volume of milk consumption per capita and supply of milk to processing enterprises in Ukraine, as well as dynamics of the main factors influencing the mentioned indicators in 20062020. The factors, which were analyzed in the work, included milk production by farms of all categories, volume of produced dairy products, the average price of milk and number of cattle. The multicollinearity was studied by applying the Farrar-Glauber test separately for each of the factors influencing the above-mentioned resulting characteristics. To develop the econometric model, the authors used the least squares method, identified density of connection, the model adequacy by the F-test, available autocorrelation and heteroscedasticity, statistical significance of the model parameters. Results. According to the results of conducted research it is determined that all conditions of adequacy of the economic-and-mathematical model are satisfied to assess the dependency of milk consumption per capita on the supply of milk to processing enterprises, dependency of the supply of milk to processing enterprises on the average price of milk, and dependency of the supply of milk to processing enterprises on the number of cattle. These models can be used for the further analysis of the corresponding economic processes at the dairy market of Ukraine. Calculation of the partial elasticity coefficients confirms that the factors impact on the resulting characteristics is characterized by low elasticity, particularly the growth of the supply of milk to processing enterprises by 1 % causes the increase of milk consumption per capita by 0.209 %, whilst the raise of the average price of milk by 1 % results in reduction of the supply of milk to processing enterprises by 0.562 %, and the increase in the number of cattle by 1 % causes the growth of the supply of milk to processing enterprises by 0.546 % under other similar conditions. By using the developed models, the authors calculated the expected volume of milk consumption per capita under increasing prices of milk and reducing number of cattle and the optimistic scenarios of agriculture development under martial law. Originality / scientific novelty. The obtained results provide a deeper study of the methodology of modeling and forecasting the main indicators influencing performance of the market of milk and dairy products in Ukraine. The authors identify the main factors influencing the demand for dairy products that enables forecasting their prospects depending on the change of some factors of the macro environment of milk processing enterprises. In addition to the above mentioned factors influencing milk consumption per capita, milk processing enterprises can partially influence the indicator by activating commercial promotion of consumption of the milk and dairy products of factory production and expanding the range of supplied products. Practical value / implications. Findings of the research can be used as an information basis to evaluate marketability of milk processing enterprises in Ukraine based on forecasting the level of the demand for milk. Moreover, the results of the research also confirm reasonability of joined efforts of milk processing enterprises to implement marketing communications in order to increase the demand for milk and dairy products of factory production. The research findings can be also used to make forecast of the conjuncture of milk and dairy market that will identify the directions of the state regulation of its development. |
<filename>peer/node/main.go
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package node
import "github.com/hyperledger/fabric/internal/peer/node"
// Start starts the peer
func Start() error {
return node.Serve([]string{})
}
|
<filename>interfaces/dia/app/sheets_dialog.c
/* Dia -- a diagram creation/manipulation program
* Copyright (C) 1998 <NAME>
*
* sheets_dialog.c : a sheets and objects dialog
* Copyright (C) 2002 <NAME>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
/*
* DO NOT EDIT THIS FILE - it is generated by Glade and then hand-coded
* to make GNOME optional and add the underline
* for accelerated buttons.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <string.h>
#undef GTK_DISABLE_DEPRECATED /* GtkOptionMenu, ... */
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include "sheets.h"
#include "sheets_dialog_callbacks.h"
#include "sheets_dialog.h"
#include "intl.h"
#include "persistence.h"
GtkWidget*
create_sheets_main_dialog (void)
{
GtkWidget *sheets_main_dialog;
GtkWidget *dialog_vbox1;
GtkWidget *table_sheets;
GtkWidget *vbuttonbox;
GtkWidget *button_copy;
GtkWidget *button_copy_all;
GtkWidget *button_move;
GtkWidget *button_move_all;
GtkWidget *optionmenu_right;
GtkWidget *optionmenu_right_menu;
GtkWidget *optionmenu_left;
GtkWidget *optionmenu_left_menu;
GtkWidget *glade_menuitem;
GtkWidget *scrolledwindow_left;
GtkWidget *scrolledwindow_right;
GtkWidget *dialog_action_area1;
GtkWidget *hbox1;
GtkWidget *button_new;
GtkWidget *button_move_up;
GtkWidget *button_move_down;
GtkWidget *button_edit;
GtkWidget *button_remove;
GtkWidget *button_apply;
GtkWidget *button_revert;
GtkWidget *button_close;
GtkAccelGroup *accel_group;
accel_group = gtk_accel_group_new ();
sheets_main_dialog = gtk_dialog_new ();
gtk_object_set_data (GTK_OBJECT (sheets_main_dialog), "sheets_main_dialog", sheets_main_dialog);
gtk_window_set_title (GTK_WINDOW (sheets_main_dialog), _("Sheets and Objects"));
gtk_window_set_role(GTK_WINDOW(sheets_main_dialog), "sheets_main_dialog");
gtk_window_set_default_size (GTK_WINDOW (sheets_main_dialog), 506, 261);
gtk_window_set_resizable (GTK_WINDOW (sheets_main_dialog), TRUE);
dialog_vbox1 = GTK_DIALOG (sheets_main_dialog)->vbox;
gtk_object_set_data (GTK_OBJECT (sheets_main_dialog), "dialog_vbox1", dialog_vbox1);
gtk_widget_show (dialog_vbox1);
table_sheets = gtk_table_new (2, 3, FALSE);
gtk_widget_ref (table_sheets);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "table_sheets", table_sheets,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table_sheets);
gtk_box_pack_start (GTK_BOX (dialog_vbox1), table_sheets, TRUE, TRUE, 0);
vbuttonbox = gtk_vbutton_box_new ();
gtk_widget_ref (vbuttonbox);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "vbuttonbox", vbuttonbox,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbuttonbox);
gtk_table_attach (GTK_TABLE (table_sheets), vbuttonbox, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 17, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox), GTK_BUTTONBOX_SPREAD);
button_copy = gtk_button_new_with_label (_("<- Copy"));
gtk_widget_ref (button_copy);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_copy", button_copy,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_copy);
gtk_container_add (GTK_CONTAINER (vbuttonbox), button_copy);
gtk_widget_add_accelerator (button_copy, "clicked", accel_group,
GDK_c, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_copy_all = gtk_button_new_with_label (_("<- Copy All"));
gtk_widget_ref (button_copy_all);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_copy_all", button_copy_all,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_copy_all);
gtk_container_add (GTK_CONTAINER (vbuttonbox), button_copy_all);
button_move = gtk_button_new_with_label (_("<- Move"));
gtk_widget_ref (button_move);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_move", button_move,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_move);
gtk_container_add (GTK_CONTAINER (vbuttonbox), button_move);
gtk_widget_add_accelerator (button_move, "clicked", accel_group,
GDK_m, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_move_all = gtk_button_new_with_label (_("<- Move All"));
gtk_widget_ref (button_move_all);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_move_all", button_move_all,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_move_all);
gtk_container_add (GTK_CONTAINER (vbuttonbox), button_move_all);
optionmenu_right = gtk_option_menu_new ();
gtk_widget_ref (optionmenu_right);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "optionmenu_right", optionmenu_right,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (optionmenu_right);
gtk_table_attach (GTK_TABLE (table_sheets), optionmenu_right, 2, 3, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
optionmenu_right_menu = gtk_menu_new ();
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_right), optionmenu_right_menu);
optionmenu_left = gtk_option_menu_new ();
gtk_widget_ref (optionmenu_left);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "optionmenu_left", optionmenu_left,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (optionmenu_left);
gtk_table_attach (GTK_TABLE (table_sheets), optionmenu_left, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
optionmenu_left_menu = gtk_menu_new ();
glade_menuitem = gtk_menu_item_new_with_label ("");
gtk_widget_show (glade_menuitem);
gtk_menu_append (GTK_MENU (optionmenu_left_menu), glade_menuitem);
gtk_option_menu_set_menu (GTK_OPTION_MENU (optionmenu_left), optionmenu_left_menu);
scrolledwindow_left = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_ref (scrolledwindow_left);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "scrolledwindow_left", scrolledwindow_left,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow_left);
gtk_table_attach (GTK_TABLE (table_sheets), scrolledwindow_left, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_left), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
scrolledwindow_right = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_ref (scrolledwindow_right);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "scrolledwindow_right", scrolledwindow_right,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow_right);
gtk_table_attach (GTK_TABLE (table_sheets), scrolledwindow_right, 2, 3, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (GTK_FILL), 0, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_right), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
dialog_action_area1 = GTK_DIALOG (sheets_main_dialog)->action_area;
gtk_object_set_data (GTK_OBJECT (sheets_main_dialog), "dialog_action_area1", dialog_action_area1);
gtk_widget_show (dialog_action_area1);
gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area1), 10);
hbox1 = gtk_hbox_new (TRUE, 0);
gtk_widget_ref (hbox1);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "hbox1", hbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbox1);
gtk_box_pack_start (GTK_BOX (dialog_action_area1), hbox1, TRUE, TRUE, 0);
button_new = gtk_button_new_from_stock(GTK_STOCK_NEW);
gtk_widget_ref (button_new);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_new", button_new,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_new);
gtk_box_pack_start (GTK_BOX (hbox1), button_new, FALSE, TRUE, 0);
gtk_widget_add_accelerator (button_new, "clicked", accel_group,
GDK_n, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_move_up = gtk_button_new_from_stock (GTK_STOCK_GO_UP);
gtk_widget_ref (button_move_up);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_move_up", button_move_up,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_move_up);
gtk_box_pack_start (GTK_BOX (hbox1), button_move_up, FALSE, TRUE, 0);
gtk_widget_add_accelerator (button_move_up, "clicked", accel_group,
GDK_u, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_move_down = gtk_button_new_from_stock (GTK_STOCK_GO_DOWN);
gtk_widget_ref (button_move_down);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_move_down", button_move_down,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_move_down);
gtk_box_pack_start (GTK_BOX (hbox1), button_move_down, FALSE, TRUE, 0);
gtk_widget_add_accelerator (button_move_down, "clicked", accel_group,
GDK_d, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_edit = gtk_button_new(); /* _with_label (_("Edit")); */
{
GtkWidget *label;
label = gtk_label_new(_("Edit"));
gtk_widget_ref(label);
gtk_label_parse_uline(GTK_LABEL(label), _("_Edit"));
gtk_container_add(GTK_CONTAINER(button_edit), label);
gtk_widget_show(label);
}
gtk_widget_ref (button_edit);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_edit", button_edit,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_edit);
gtk_box_pack_start (GTK_BOX (hbox1), button_edit, FALSE, TRUE, 0);
gtk_widget_add_accelerator (button_edit, "clicked", accel_group,
GDK_e, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_remove = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
gtk_widget_ref (button_remove);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_remove", button_remove,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_remove);
gtk_box_pack_start (GTK_BOX (hbox1), button_remove, FALSE, TRUE, 0);
gtk_widget_add_accelerator (button_remove, "clicked", accel_group,
GDK_r, GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
button_apply = gtk_button_new_from_stock(GTK_STOCK_APPLY);
gtk_widget_ref (button_apply);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_apply", button_apply,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_apply);
gtk_box_pack_start (GTK_BOX (hbox1), button_apply, FALSE, TRUE, 0);
gtk_widget_set_sensitive (button_apply, FALSE);
button_revert = gtk_button_new_with_label(_("Revert"));
gtk_widget_ref (button_revert);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_revert", button_revert,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_revert);
gtk_box_pack_start (GTK_BOX (hbox1), button_revert, FALSE, TRUE, 0);
gtk_widget_set_sensitive (button_revert, FALSE);
button_close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
gtk_widget_ref (button_close);
gtk_object_set_data_full (GTK_OBJECT (sheets_main_dialog), "button_close", button_close,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_close);
gtk_box_pack_start (GTK_BOX (hbox1), button_close, FALSE, TRUE, 0);
g_signal_connect (GTK_OBJECT (sheets_main_dialog), "delete_event",
G_CALLBACK (on_sheets_main_dialog_delete_event),
NULL);
g_signal_connect (GTK_OBJECT (button_copy), "clicked",
G_CALLBACK (on_sheets_dialog_button_copy_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_copy_all), "clicked",
G_CALLBACK (on_sheets_dialog_button_copy_all_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_move), "clicked",
G_CALLBACK (on_sheets_dialog_button_move_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_move_all), "clicked",
G_CALLBACK (on_sheets_dialog_button_move_all_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_new), "clicked",
G_CALLBACK (on_sheets_dialog_button_new_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_move_up), "clicked",
G_CALLBACK (on_sheets_dialog_button_move_up_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_move_down), "clicked",
G_CALLBACK (on_sheets_dialog_button_move_down_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_edit), "clicked",
G_CALLBACK (on_sheets_dialog_button_edit_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_remove), "clicked",
G_CALLBACK (on_sheets_dialog_button_remove_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_apply), "clicked",
G_CALLBACK (on_sheets_dialog_button_apply_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_revert), "clicked",
G_CALLBACK (on_sheets_dialog_button_revert_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_close), "clicked",
G_CALLBACK (on_sheets_dialog_button_close_clicked),
NULL);
gtk_window_add_accel_group (GTK_WINDOW (sheets_main_dialog), accel_group);
persistence_register_window(GTK_WINDOW(sheets_main_dialog));
return sheets_main_dialog;
}
GtkWidget*
create_sheets_new_dialog (void)
{
GtkWidget *sheets_new_dialog;
GtkWidget *dialog_vbox2;
GtkWidget *Typefg;
GtkWidget *table1;
GtkWidget *button_browse;
GSList *table1_group = NULL;
GtkWidget *radiobutton_svg_shape;
GtkWidget *combo_from_file;
GtkWidget *combo_entry_from_file;
GtkWidget *label_description;
GtkWidget *radiobutton_sheet;
GtkWidget *entry_sheet_name;
GtkWidget *radiobutton_line_break;
GtkWidget *entry_svg_description;
GtkWidget *entry_sheet_description;
GtkWidget *label_svg_description;
GtkWidget *dialog_action_area2;
GtkWidget *hbuttonbox1;
GtkWidget *button_ok;
GtkWidget *button_cancel;
sheets_new_dialog = gtk_dialog_new ();
gtk_object_set_data (GTK_OBJECT (sheets_new_dialog), "sheets_new_dialog", sheets_new_dialog);
gtk_window_set_title (GTK_WINDOW (sheets_new_dialog), _("New"));
gtk_window_set_role (GTK_WINDOW (sheets_new_dialog), "sheets_new_dialog");
gtk_window_set_resizable (GTK_WINDOW (sheets_new_dialog), FALSE);
dialog_vbox2 = GTK_DIALOG (sheets_new_dialog)->vbox;
gtk_object_set_data (GTK_OBJECT (sheets_new_dialog), "dialog_vbox2", dialog_vbox2);
gtk_widget_show (dialog_vbox2);
Typefg = gtk_frame_new (_("Type"));
gtk_widget_ref (Typefg);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "Typefg", Typefg,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (Typefg);
gtk_box_pack_start (GTK_BOX (dialog_vbox2), Typefg, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (Typefg), 5);
table1 = gtk_table_new (5, 4, FALSE);
gtk_widget_ref (table1);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "table1", table1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table1);
gtk_container_add (GTK_CONTAINER (Typefg), table1);
button_browse = gtk_button_new_with_label (_("Browse..."));
gtk_widget_ref (button_browse);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "button_browse", button_browse,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_browse);
gtk_table_attach (GTK_TABLE (table1), button_browse, 3, 4, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 3, 0);
radiobutton_svg_shape = gtk_radio_button_new_with_label (table1_group, _("SVG Shape:"));
table1_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_svg_shape));
gtk_widget_ref (radiobutton_svg_shape);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "radiobutton_svg_shape", radiobutton_svg_shape,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (radiobutton_svg_shape);
gtk_table_attach (GTK_TABLE (table1), radiobutton_svg_shape, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radiobutton_svg_shape), TRUE);
combo_from_file = gtk_combo_new ();
gtk_widget_ref (combo_from_file);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "combo_from_file", combo_from_file,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo_from_file);
gtk_table_attach (GTK_TABLE (table1), combo_from_file, 1, 3, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
gtk_combo_set_case_sensitive (GTK_COMBO (combo_from_file), TRUE);
combo_entry_from_file = GTK_COMBO (combo_from_file)->entry;
gtk_widget_ref (combo_entry_from_file);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "combo_entry_from_file", combo_entry_from_file,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (combo_entry_from_file);
label_description = gtk_label_new (_("description:"));
gtk_widget_ref (label_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "label_description", label_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_description);
gtk_table_attach (GTK_TABLE (table1), label_description, 0, 1, 4, 5,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive (label_description, FALSE);
gtk_label_set_justify (GTK_LABEL (label_description), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (label_description), 0.77, 0.5);
radiobutton_sheet = gtk_radio_button_new_with_label (table1_group, _("Sheet name:"));
table1_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_sheet));
gtk_widget_ref (radiobutton_sheet);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "radiobutton_sheet", radiobutton_sheet,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (radiobutton_sheet);
gtk_table_attach (GTK_TABLE (table1), radiobutton_sheet, 0, 1, 3, 4,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
entry_sheet_name = gtk_entry_new ();
gtk_widget_ref (entry_sheet_name);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "entry_sheet_name", entry_sheet_name,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_sheet_name);
gtk_table_attach (GTK_TABLE (table1), entry_sheet_name, 1, 3, 3, 4,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (entry_sheet_name, 255, -2);
gtk_widget_set_sensitive (entry_sheet_name, FALSE);
radiobutton_line_break = gtk_radio_button_new_with_label (table1_group, _("Line Break"));
table1_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_line_break));
gtk_widget_ref (radiobutton_line_break);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "radiobutton_line_break", radiobutton_line_break,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (radiobutton_line_break);
gtk_table_attach (GTK_TABLE (table1), radiobutton_line_break, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
entry_svg_description = gtk_entry_new ();
gtk_widget_ref (entry_svg_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "entry_svg_description", entry_svg_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_svg_description);
gtk_table_attach (GTK_TABLE (table1), entry_svg_description, 1, 3, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
entry_sheet_description = gtk_entry_new ();
gtk_widget_ref (entry_sheet_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "entry_sheet_description", entry_sheet_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_sheet_description);
gtk_table_attach (GTK_TABLE (table1), entry_sheet_description, 1, 3, 4, 5,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (entry_sheet_description, 255, -2);
gtk_widget_set_sensitive (entry_sheet_description, FALSE);
label_svg_description = gtk_label_new (_("description:"));
gtk_widget_ref (label_svg_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "label_svg_description", label_svg_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_svg_description);
gtk_table_attach (GTK_TABLE (table1), label_svg_description, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label_svg_description), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (label_svg_description), 0.77, 0.5);
dialog_action_area2 = GTK_DIALOG (sheets_new_dialog)->action_area;
gtk_object_set_data (GTK_OBJECT (sheets_new_dialog), "dialog_action_area2", dialog_action_area2);
gtk_widget_show (dialog_action_area2);
gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area2), 10);
hbuttonbox1 = gtk_hbutton_box_new ();
gtk_widget_ref (hbuttonbox1);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "hbuttonbox1", hbuttonbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox1);
gtk_box_pack_start (GTK_BOX (dialog_action_area2), hbuttonbox1, TRUE, TRUE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 0);
button_ok = gtk_button_new_from_stock(GTK_STOCK_OK);
gtk_widget_ref (button_ok);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "button_ok", button_ok,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_ok);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_ok);
GTK_WIDGET_SET_FLAGS (button_ok, GTK_CAN_DEFAULT);
button_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
gtk_widget_ref (button_cancel);
gtk_object_set_data_full (GTK_OBJECT (sheets_new_dialog), "button_cancel", button_cancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_cancel);
gtk_container_add (GTK_CONTAINER (hbuttonbox1), button_cancel);
GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
g_signal_connect (GTK_OBJECT (button_browse), "clicked",
G_CALLBACK (on_sheets_new_dialog_button_browse_clicked),
NULL);
g_signal_connect (GTK_OBJECT (radiobutton_svg_shape), "toggled",
G_CALLBACK (on_sheets_new_dialog_radiobutton_svg_shape_toggled),
NULL);
g_signal_connect (GTK_OBJECT (radiobutton_sheet), "toggled",
G_CALLBACK (on_sheets_new_dialog_radiobutton_sheet_toggled),
NULL);
g_signal_connect (GTK_OBJECT (radiobutton_line_break), "toggled",
G_CALLBACK (on_sheets_new_dialog_radiobutton_line_break_toggled),
NULL);
g_signal_connect (GTK_OBJECT (button_ok), "clicked",
G_CALLBACK (on_sheets_new_dialog_button_ok_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_cancel), "clicked",
G_CALLBACK (on_sheets_new_dialog_button_cancel_clicked),
NULL);
gtk_widget_grab_default (button_ok);
return sheets_new_dialog;
}
GtkWidget*
create_sheets_edit_dialog (void)
{
GtkWidget *sheets_edit_dialog;
GtkWidget *dialog_vbox3;
GtkWidget *vbox1;
GtkWidget *frame_object;
GtkWidget *table6;
GtkWidget *label_object_description;
GtkWidget *entry_object_description;
GtkWidget *label_object_type;
GtkWidget *entry_object_type;
GtkWidget *frame_object_pixmap;
GtkWidget *pixmap_object;
GtkWidget *frame_sheet;
GtkWidget *table3;
GtkWidget *label_sheet_name;
GtkWidget *entry_sheet_description;
GtkWidget *label_sheet_description;
GtkWidget *entry_sheet_name;
GtkWidget *dialog_action_area3;
GtkWidget *hbuttonbox2;
GtkWidget *button_ok;
GtkWidget *button_cancel;
sheets_edit_dialog = gtk_dialog_new ();
gtk_object_set_data (GTK_OBJECT (sheets_edit_dialog), "sheets_edit_dialog", sheets_edit_dialog);
gtk_container_set_border_width (GTK_CONTAINER (sheets_edit_dialog), 5);
gtk_window_set_title (GTK_WINDOW (sheets_edit_dialog), _("Edit Attributes"));
gtk_window_set_role (GTK_WINDOW (sheets_edit_dialog), "sheets_edit_dialog");
gtk_window_set_resizable (GTK_WINDOW (sheets_edit_dialog), FALSE);
dialog_vbox3 = GTK_DIALOG (sheets_edit_dialog)->vbox;
gtk_object_set_data (GTK_OBJECT (sheets_edit_dialog), "dialog_vbox3", dialog_vbox3);
gtk_widget_show (dialog_vbox3);
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_ref (vbox1);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "vbox1", vbox1,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox1);
gtk_box_pack_start (GTK_BOX (dialog_vbox3), vbox1, TRUE, TRUE, 0);
frame_object = gtk_frame_new (_("DiaObject"));
gtk_widget_ref (frame_object);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "frame_object", frame_object,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame_object);
gtk_box_pack_start (GTK_BOX (vbox1), frame_object, TRUE, TRUE, 0);
table6 = gtk_table_new (3, 2, FALSE);
gtk_widget_ref (table6);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "table6", table6,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table6);
gtk_container_add (GTK_CONTAINER (frame_object), table6);
gtk_container_set_border_width (GTK_CONTAINER (table6), 5);
gtk_table_set_col_spacings (GTK_TABLE (table6), 6);
label_object_description = gtk_label_new (_("Description:"));
gtk_widget_ref (label_object_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "label_object_description", label_object_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_object_description);
gtk_table_attach (GTK_TABLE (table6), label_object_description, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_object_description), 0, 0.5);
entry_object_description = gtk_entry_new ();
gtk_widget_ref (entry_object_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "entry_object_description", entry_object_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_object_description);
gtk_table_attach (GTK_TABLE (table6), entry_object_description, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
label_object_type = gtk_label_new (_("Type:"));
gtk_widget_ref (label_object_type);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "label_object_type", label_object_type,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_object_type);
gtk_table_attach (GTK_TABLE (table6), label_object_type, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_object_type), 0, 0.5);
entry_object_type = gtk_entry_new ();
gtk_widget_ref (entry_object_type);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "entry_object_type", entry_object_type,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_object_type);
gtk_table_attach (GTK_TABLE (table6), entry_object_type, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_sensitive (entry_object_type, FALSE);
gtk_entry_set_editable (GTK_ENTRY (entry_object_type), FALSE);
frame_object_pixmap = gtk_frame_new (NULL);
gtk_widget_ref (frame_object_pixmap);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "frame_object_pixmap", frame_object_pixmap,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame_object_pixmap);
gtk_table_attach (GTK_TABLE (table6), frame_object_pixmap, 0, 1, 0, 1,
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
gtk_frame_set_shadow_type (GTK_FRAME (frame_object_pixmap), GTK_SHADOW_ETCHED_OUT);
pixmap_object = create_pixmap (sheets_edit_dialog, NULL, FALSE);
gtk_widget_ref (pixmap_object);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "pixmap_object", pixmap_object,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (pixmap_object);
gtk_container_add (GTK_CONTAINER (frame_object_pixmap), pixmap_object);
frame_sheet = gtk_frame_new (_("Sheet"));
gtk_widget_ref (frame_sheet);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "frame_sheet", frame_sheet,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame_sheet);
gtk_box_pack_start (GTK_BOX (vbox1), frame_sheet, TRUE, TRUE, 0);
table3 = gtk_table_new (2, 2, FALSE);
gtk_widget_ref (table3);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "table3", table3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table3);
gtk_container_add (GTK_CONTAINER (frame_sheet), table3);
gtk_container_set_border_width (GTK_CONTAINER (table3), 5);
gtk_table_set_col_spacings (GTK_TABLE (table3), 6);
label_sheet_name = gtk_label_new (_("Name:"));
gtk_widget_ref (label_sheet_name);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "label_sheet_name", label_sheet_name,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_sheet_name);
gtk_table_attach (GTK_TABLE (table3), label_sheet_name, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_label_set_justify (GTK_LABEL (label_sheet_name), GTK_JUSTIFY_RIGHT);
gtk_misc_set_alignment (GTK_MISC (label_sheet_name), 0, 0.5);
entry_sheet_description = gtk_entry_new ();
gtk_widget_ref (entry_sheet_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "entry_sheet_description", entry_sheet_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_sheet_description);
gtk_table_attach (GTK_TABLE (table3), entry_sheet_description, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
label_sheet_description = gtk_label_new (_("Description:"));
gtk_widget_ref (label_sheet_description);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "label_sheet_description", label_sheet_description,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_sheet_description);
gtk_table_attach (GTK_TABLE (table3), label_sheet_description, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_misc_set_alignment (GTK_MISC (label_sheet_description), 0, 0.5);
entry_sheet_name = gtk_entry_new ();
gtk_widget_ref (entry_sheet_name);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "entry_sheet_name", entry_sheet_name,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_sheet_name);
gtk_table_attach (GTK_TABLE (table3), entry_sheet_name, 1, 2, 0, 1,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_widget_set_usize (entry_sheet_name, 220, -2);
dialog_action_area3 = GTK_DIALOG (sheets_edit_dialog)->action_area;
gtk_object_set_data (GTK_OBJECT (sheets_edit_dialog), "dialog_action_area3", dialog_action_area3);
gtk_widget_show (dialog_action_area3);
gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area3), 10);
hbuttonbox2 = gtk_hbutton_box_new ();
gtk_widget_ref (hbuttonbox2);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "hbuttonbox2", hbuttonbox2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox2);
gtk_box_pack_start (GTK_BOX (dialog_action_area3), hbuttonbox2, TRUE, TRUE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox2), 0);
button_ok = gtk_button_new_from_stock(GTK_STOCK_OK);
gtk_widget_ref (button_ok);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "button_ok", button_ok,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_ok);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), button_ok);
GTK_WIDGET_SET_FLAGS (button_ok, GTK_CAN_DEFAULT);
button_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
gtk_widget_ref (button_cancel);
gtk_object_set_data_full (GTK_OBJECT (sheets_edit_dialog), "button_cancel", button_cancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_cancel);
gtk_container_add (GTK_CONTAINER (hbuttonbox2), button_cancel);
GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
g_signal_connect (GTK_OBJECT (entry_object_description), "changed",
G_CALLBACK (on_sheets_edit_dialog_entry_object_description_changed),
NULL);
g_signal_connect (GTK_OBJECT (entry_sheet_description), "changed",
G_CALLBACK (on_sheets_edit_dialog_entry_sheet_description_changed),
NULL);
g_signal_connect (GTK_OBJECT (entry_sheet_name), "changed",
G_CALLBACK (on_sheets_edit_dialog_entry_sheet_name_changed),
NULL);
g_signal_connect (GTK_OBJECT (button_ok), "clicked",
G_CALLBACK (on_sheets_edit_dialog_button_ok_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_cancel), "clicked",
G_CALLBACK (on_sheets_edit_dialog_button_cancel_clicked),
NULL);
gtk_widget_grab_default (button_ok);
return sheets_edit_dialog;
}
GtkWidget*
create_sheets_remove_dialog (void)
{
GtkWidget *sheets_remove_dialog;
GtkWidget *dialog_vbox4;
GtkWidget *frame;
GtkWidget *table7;
GSList *table7_group = NULL;
GtkWidget *radiobutton_object;
GtkWidget *frame_object_pixmap;
GtkWidget *pixmap_object;
GtkWidget *radiobutton_sheet;
GtkWidget *entry_object;
GtkWidget *entry_sheet;
GtkWidget *dialog_action_area4;
GtkWidget *hbuttonbox3;
GtkWidget *button_ok;
GtkWidget *button_cancel;
sheets_remove_dialog = gtk_dialog_new ();
gtk_object_set_data (GTK_OBJECT (sheets_remove_dialog),
"sheets_remove_dialog", sheets_remove_dialog);
gtk_window_set_title (GTK_WINDOW (sheets_remove_dialog), _("Remove"));
gtk_window_set_default_size (GTK_WINDOW (sheets_remove_dialog), 316, -1);
gtk_window_set_role (GTK_WINDOW (sheets_remove_dialog),
"sheets_remove_dialog");
gtk_window_set_resizable (GTK_WINDOW (sheets_remove_dialog), TRUE);
dialog_vbox4 = GTK_DIALOG (sheets_remove_dialog)->vbox;
gtk_object_set_data (GTK_OBJECT (sheets_remove_dialog), "dialog_vbox4", dialog_vbox4);
gtk_widget_show (dialog_vbox4);
frame = gtk_frame_new (_("Type"));
gtk_widget_ref (frame);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "frame", frame,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame);
gtk_box_pack_start (GTK_BOX (dialog_vbox4), frame, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (frame), 5);
table7 = gtk_table_new (3, 2, FALSE);
gtk_widget_ref (table7);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "table7", table7,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (table7);
gtk_container_add (GTK_CONTAINER (frame), table7);
radiobutton_object = gtk_radio_button_new_with_label (table7_group, _("DiaObject:"));
table7_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_object));
gtk_widget_ref (radiobutton_object);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "radiobutton_object", radiobutton_object,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (radiobutton_object);
gtk_table_attach (GTK_TABLE (table7), radiobutton_object, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
frame_object_pixmap = gtk_frame_new (NULL);
gtk_widget_ref (frame_object_pixmap);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "frame_object_pixmap", frame_object_pixmap,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (frame_object_pixmap);
gtk_table_attach (GTK_TABLE (table7), frame_object_pixmap, 0, 1, 0, 1,
(GtkAttachOptions) (0),
(GtkAttachOptions) (0), 0, 0);
gtk_frame_set_shadow_type (GTK_FRAME (frame_object_pixmap), GTK_SHADOW_ETCHED_OUT);
pixmap_object = create_pixmap (sheets_remove_dialog, NULL, FALSE);
gtk_widget_ref (pixmap_object);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "pixmap_object", pixmap_object,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (pixmap_object);
gtk_container_add (GTK_CONTAINER (frame_object_pixmap), pixmap_object);
radiobutton_sheet = gtk_radio_button_new_with_label (table7_group, _("Sheet:"));
table7_group = gtk_radio_button_group (GTK_RADIO_BUTTON (radiobutton_sheet));
gtk_widget_ref (radiobutton_sheet);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "radiobutton_sheet", radiobutton_sheet,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (radiobutton_sheet);
gtk_table_attach (GTK_TABLE (table7), radiobutton_sheet, 0, 1, 2, 3,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
entry_object = gtk_entry_new ();
gtk_widget_ref (entry_object);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "entry_object", entry_object,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_object);
gtk_table_attach (GTK_TABLE (table7), entry_object, 1, 2, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
gtk_entry_set_editable (GTK_ENTRY (entry_object), FALSE);
entry_sheet = gtk_entry_new ();
gtk_widget_ref (entry_sheet);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "entry_sheet", entry_sheet,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (entry_sheet);
gtk_table_attach (GTK_TABLE (table7), entry_sheet, 1, 2, 2, 3,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
gtk_entry_set_editable (GTK_ENTRY (entry_sheet), FALSE);
dialog_action_area4 = GTK_DIALOG (sheets_remove_dialog)->action_area;
gtk_object_set_data (GTK_OBJECT (sheets_remove_dialog), "dialog_action_area4", dialog_action_area4);
gtk_widget_show (dialog_action_area4);
gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area4), 10);
hbuttonbox3 = gtk_hbutton_box_new ();
gtk_widget_ref (hbuttonbox3);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "hbuttonbox3", hbuttonbox3,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hbuttonbox3);
gtk_box_pack_start (GTK_BOX (dialog_action_area4), hbuttonbox3, TRUE, TRUE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox3), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox3), 0);
button_ok = gtk_button_new_from_stock(GTK_STOCK_OK);
gtk_widget_ref (button_ok);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "button_ok", button_ok,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_ok);
gtk_container_add (GTK_CONTAINER (hbuttonbox3), button_ok);
GTK_WIDGET_SET_FLAGS (button_ok, GTK_CAN_DEFAULT);
button_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
gtk_widget_ref (button_cancel);
gtk_object_set_data_full (GTK_OBJECT (sheets_remove_dialog), "button_cancel", button_cancel,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_cancel);
gtk_container_add (GTK_CONTAINER (hbuttonbox3), button_cancel);
GTK_WIDGET_SET_FLAGS (button_cancel, GTK_CAN_DEFAULT);
g_signal_connect (GTK_OBJECT (radiobutton_object), "toggled",
G_CALLBACK (on_sheets_remove_dialog_radiobutton_object_toggled),
NULL);
g_signal_connect (GTK_OBJECT (radiobutton_sheet), "toggled",
G_CALLBACK (on_sheets_remove_dialog_radiobutton_sheet_toggled),
NULL);
g_signal_connect (GTK_OBJECT (button_ok), "clicked",
G_CALLBACK (on_sheets_remove_dialog_button_ok_clicked),
NULL);
g_signal_connect (GTK_OBJECT (button_cancel), "clicked",
G_CALLBACK (on_sheets_remove_dialog_button_cancel_clicked),
NULL);
gtk_widget_grab_default (button_ok);
return sheets_remove_dialog;
}
GtkWidget*
create_sheets_shapeselection_dialog (void)
{
GtkWidget *sheets_shapeselection_dialog;
GtkWidget *ok_button;
GtkWidget *cancel_button1;
sheets_shapeselection_dialog = gtk_file_selection_new (_("Select SVG Shape File"));
gtk_object_set_data (GTK_OBJECT (sheets_shapeselection_dialog), "sheets_shapeselection_dialog", sheets_shapeselection_dialog);
gtk_container_set_border_width (GTK_CONTAINER (sheets_shapeselection_dialog), 10);
ok_button = GTK_FILE_SELECTION (sheets_shapeselection_dialog)->ok_button;
gtk_object_set_data (GTK_OBJECT (sheets_shapeselection_dialog), "ok_button", ok_button);
gtk_widget_show (ok_button);
GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT);
cancel_button1 = GTK_FILE_SELECTION (sheets_shapeselection_dialog)->cancel_button;
gtk_object_set_data (GTK_OBJECT (sheets_shapeselection_dialog), "cancel_button1", cancel_button1);
gtk_widget_show (cancel_button1);
GTK_WIDGET_SET_FLAGS (cancel_button1, GTK_CAN_DEFAULT);
g_signal_connect (GTK_OBJECT (ok_button), "clicked",
G_CALLBACK (on_sheets_shapeselection_dialog_button_ok_clicked),
NULL);
g_signal_connect (GTK_OBJECT (cancel_button1), "clicked",
G_CALLBACK (on_sheets_shapeselection_dialog_button_cancel_clicked),
NULL);
return sheets_shapeselection_dialog;
}
|
A method for the classification of folksonomy resources The paper presents a method for the automatic classification of the resources of collaborative tagging systems, also called folksonomies. Folksonomies are an easy way of representing knowledge in Web 2.0 because of its simplicity. However, due to their characteristics, the information retrieval in these systems is more difficult than in classical knowledge representation systems. This method has a high degree of precision and recall, and may adjust these values with the use of different modes of classification and thresholds, improving the performances of other resource classification methods. |
Some kinetic and chromatographic properties of detergent-dispersed adenylate cyclase. Studies on the reaction kinetics and chromatographic properties of detergent-dispersed adenylate cyclase are described. Detergent-dispersed enzyme was prepared from whole rat cerebellum and from partially purified plasma membranes from rat liver. Data were simulated to fit kinetic models for which an inhibitor is added in constant proportion to the variable substrate. Models were chosen to distinguish whether the adenylate cyclase reaction may be controlled by an inhibitory action of free ATP--4 (or HATP--3) or by a stimulatory action of free divalent cations. The various kinetic models were then tested with the dispersed brain adenylate cyclase with both Mg++ and Mn++ and in two different buffer systems. The experimental data indicate that this enzyme has a distinct cation binding site, but exhibits no significant inhibition by HATP--3 or ATP--4. The detergent-dispersed adenylate cyclase both from liver plasma membranes and from brain have been chromatographed on anion exchange material and have been subjected to gel filtration. The presence of detergent was required for elution of cyclase activity from DEAE-Sephadex but was not required when DEAE-agarose was used. Dispersed brain cyclase was also chromatographed on agarose-NH(CH2)3NH(CH2)3-NH2 which exhibits both ionic and hydrophobic properties. Fifty percent of the applied activity was recovered with a fivefold increase in specific activity. The data suggest that the relative effectiveness of a given chromatographic procedure for detergent-dispersed adenylate cyclase may reflect the influence of both hydrophobic and ionic factors. |
<reponame>lppedd/ng-zorro-antd<filename>components/table/nz-data-source.ts<gh_stars>1-10
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
import { DataSource } from '@angular/cdk/table';
// tslint:disable-next-line
const EMPTY_ITERATOR: Iterator<any> = {
// tslint:disable-next-line
next(): IteratorResult<any> {
return { done: true, value: undefined! };
}
};
export abstract class NzDataSource<T> extends DataSource<T> implements Iterable<T> {
/**
* The length of the data represented by this DataSource.
*/
abstract readonly length: number;
/**
* A default implementation for the {@link Iterable} interface, returning a zero-length iterator.
*/
[Symbol.iterator](): Iterator<T> {
return EMPTY_ITERATOR;
}
}
|
def _SetActiveTestList(self):
if self._active_test_list is not None:
path = os.path.join(self._usr_local_dest, 'factory',
test_list_common.ACTIVE_TEST_LIST_CONFIG_RELPATH)
json_utils.DumpFile(
path,
test_list_common.GenerateActiveTestListConfig(self._active_test_list)) |
import java.util.Arrays;
public class OddEvenSort {
String complexity;
OddEvenSort() {
complexity = ". Quadratic Time Complexity.";
}
void sort(int[] sortArray) {
/*
Begin Time Start
*/
double start = (double) System.nanoTime();
boolean needsSorting = true;
while (needsSorting) {
needsSorting = false;
int tempInt;
for (int count = 1; count <= sortArray.length - 2; count+=2) {
if (sortArray[count] > sortArray[count + 1]) {
tempInt = sortArray[count];
sortArray[count] = sortArray[count + 1];
sortArray[count + 1] = tempInt;
needsSorting = true;
}
}
for (int count = 0; count <= sortArray.length - 2; count+= 2) {
if (sortArray[count] > sortArray[count + 1]) {
tempInt = sortArray[count];
sortArray[count] = sortArray[count + 1];
sortArray[count + 1] = tempInt;
needsSorting = true;
}
}
}
/*
End Time
*/
double end = (double) System.nanoTime();
System.out.println("OddEvenSort: " + Arrays.toString(sortArray) + complexity + " Seconds taken was " + ((end - start) / 1000000));
}
}
|
<filename>nappy/mkcell/cell_convertor.py
#!/usr/bin/env python
"""
Convert cell from the original one.
Usage:
cell_convertor.py [options] INFILE OUTFILE
Options:
-h,--help Show this message and exit.
--specorder=SPECORDER
Set species order. [default: None]
"""
from __future__ import print_function
from docopt import docopt
import numpy as np
import nappy
__author__ = '<NAME>'
__version__ = '190524'
def monocli_to_ortho(nsys):
"""
Convert monoclinic cell to an orthogonal cell.
"""
#...Determine monoclinic axis
a0 = np.zeros((3,3),dtype=float)
a0[0] = nsys.a1 *nsys.alc
a0[1] = nsys.a2 *nsys.alc
a0[2] = nsys.a3 *nsys.alc
la0 = np.zeros(3)
la0[0] = np.linalg.norm(a0[0])
la0[1] = np.linalg.norm(a0[1])
la0[2] = np.linalg.norm(a0[2])
aa0 = np.zeros(3)
aa0[0] = np.arccos(np.dot(a0[1],a0[2])/la0[1]/la0[2])/np.pi*180.0
aa0[1] = np.arccos(np.dot(a0[0],a0[2])/la0[0]/la0[2])/np.pi*180.0
aa0[2] = np.arccos(np.dot(a0[0],a0[1])/la0[0]/la0[1])/np.pi*180.0
axis = -1
if abs(aa0[2]-90.0) > 5.0:
axis = 2
elif abs(aa0[1]-90.0) > 5.0:
axis = 1
elif abs(aa0[0]-90.0) > 5.0:
axis = 0
if axis < 0:
raise ValueError('The system seems to be orthogonal...')
#...Determine how many multiplication to each axes and get new cell vectors, a1
a1 = np.zeros((3,3),dtype=float)
a1[axis] = a0[axis]
axis1 = (axis +1) % 3
axis2 = (axis1+1) % 3
a1[axis1] = a0[axis1]
n2 = round(abs(la0[axis1])/abs(la0[axis2]*np.cos(aa0[axis]/180.0*np.pi)))
a1[axis2] = a0[axis2]*n2 -a1[axis1]*np.sign(np.dot(a0[axis1],a0[axis2]))
#...Wrap atoms that are outside the new cell
nrep = np.zeros((3),dtype=int)
nrep[axis] = 1
nrep[axis1] = 1
nrep[axis2] = n2
nsys.repeat(*nrep)
rpos = nsys.get_real_positions()
hmat1 = np.zeros((3,3))
hmat1[:,0] = a1[0]
hmat1[:,1] = a1[1]
hmat1[:,2] = a1[2]
hmat1i = np.linalg.inv(hmat1)
sposs = np.zeros((nsys.num_atoms(),3))
for i,ri in enumerate(rpos):
sposs[i] = np.dot(hmat1i,ri)
nsys.set_scaled_positions(sposs)
nsys.set_hmat(hmat1)
return nsys
if __name__ == '__main__':
args = docopt(__doc__,version=__version__)
infile = args['INFILE']
outfile = args['OUTFILE']
specorder = args['--specorder'].split(',')
if specorder[0] == 'None':
nsys = nappy.io.read(infile)
else:
nsys = nappy.io.read(infile,specorder=specorder)
newsys = monocli_to_ortho(nsys)
nappy.io.write(newsys,fname=outfile)
|
Bionic design and test of polycrystalline diamond compact bit for hard rock drilling in coal mine For hard rock drilling in coal mine, the drilling efficiency and service life of polycrystalline diamond compact bit are very low. To overcome these shortcomings, the bionic technology is applied to the design and processing of polycrystalline diamond compact bit. The bit body and polycrystalline diamond compact cutter are designed as bionic structures, and the test of the bionic polycrystalline diamond compact bit is carried out. Test results show that, when drilling in fine sandstone with hardness greater than 9, the performance of the bionic polycrystalline diamond compact bit is significantly improved. Comparing with the 113-mm concave polycrystalline diamond compact bit, the service life and drilling efficiency of the A-type bionic polycrystalline diamond compact bit increase by 54% and 230%, respectively, the service life and drilling efficiency of the B-type bionic polycrystalline diamond compact bit increase by 345% and 204%, respectively, which show that the bionic design of polycrystalline diamond compact bit can provide a new research idea for hard rock drilling in coal mine. Also the test results indicate that, when processing the bionic polycrystalline diamond compact cutter, the linear cutting process will cause thermal damage to the diamond layer of polycrystalline diamond compact cutter, while the cold grinding process shows higher comprehensive performance, therefore the one-time synthesis of bionic polycrystalline diamond compact cutter is the future research direction. Introduction Drilling construction is the main technical means to solve problems such as gas drainage, water exploration, and stratum structure prediction, and it is of great significance for the safe production of coal mines in China. However, with the increase in coal resource consumption, the mining depth is constantly increasing, and the probability of drilling hard, complex formations such as nodules is growing. 1,2 "A workman must sharpen his tools if he wants to do his work well," as a pioneer of rock breaking, the performance of drill bit directly determines the efficiency and cost of drilling construction. At present, the concave polycrystalline diamond compact (PDC) drill bit ( Figure 1) is mainly used in underground coal mine drilling, and the purpose of reducing the deflection of near horizontal hole can be achieved by utilizing the features of the concave structure. In addition, the concave PDC bit has been widely used due to its advantages of simple structure, simple processing, and low cost. 3,4 However, with the increasing formation hardness and drillability, the cost performance of the concave PDC bit is getting lower and lower, the drilling efficiency and service life of the bit are low, especially when drilling in deep holes the drill pipe needs lifting and lowering frequently, which not only causes high labor intensity, but also increases the drilling costs and construction period significantly. For solving the above problems, many scholars have carried out the PDC bit optimization design research, such as improving the performance of PDC cutter, changing the pattern of PDC cutter arrangement, and so on, finally some achievement has been made. However, there are few studies on the design of PDC bit for hard rock drilling in near-horizontal holes in coal mines. After millions of years of nature's survival of the fittest, the organism has evolved to complex body structures with non-smooth surface form to adapt to the environment and meet the needs of survival. Based on bionic engineering, it is found that the "biocoupling" structure formed by the interaction of morphology, structure, and materials has the functions of wear resistance, resistance reducing, and desorption, and the effect is remarkable. Therefore, this article combines the bionic technology with PDC bit to provide a new bit design idea to solve the problem of low drilling efficiency in hard rock. Biological prototype The mole lives underground all the year round, its feet are large and turned outwards, its claws are powerful, which is good for earthmoving. Its body is covered with short silky dark brown fluff, and the tip of the hair is not fixed in a certain direction, which is very suitable for running around in a narrow tunnel. 13,14 The mole's forefoot is short and thick, its claw toes are of different lengths, and the front of its toes are rounded ( Figure 2). All of these structural features are beneficial to release the internal stress of the soil, reduce the cutting resistance, and prevent the stick resistance. The mole's claw has an excellent mechanical function with high mining efficiency, which provides a good research idea for the development of new PDC bits. Bionic design of bit body The design of the concave PDC bit is based on the principle of full bottom hole coverage. The advantage of this bit is that it is simple in structure and easy to be processed, but it is not conducive to improve the drilling efficiency. So in this article, the bionic design of the PDC bit is carried out by virtue of the advantage of the mole's structure. Bionic design of the crown shape. The front claws of the mole are of different lengths and are arranged in a stepped shape, and the front of the toe shows circular arc transition form. Based on this structure, the crown of the bit is designed into an arc shape with a certain inner cone angle ( Figure 3). This crown shape, on the one hand, can stabilize the bit, reduce transverse vibration, and the distribution area of the cutter is large, which is beneficial to extend the life of the bit; on the other hand, the contact form between the PDC cutter and the rock is improved, the cutters are arranged in stratified and staggered form, which can enlarge the cutting free surface, realize the multi-track, multilayer, and equal-volume rock-breaking modes. Finally, the crown shape is beneficial to improve drilling efficiency and promote uniform wear of the PDC cutter. Bionic design of the cutter arrangement. The length of the mole's front claw is different, the middle toe is the strongest, and they show a certain dynamic angle when excavating. Based on this structure, the cutter arrangement of the PDC bit is optimally designed. First, on the basis of equal cutting pattern, the cutter density of the key parts of the drill bit is improved, and the high-performance PDC cutter is selected to reduce the probability of PDC cutter damage in the key parts. Second, the back rake angle of the PDC cutter is adjusted, with the increase of the rock hardness, the back rake angle increases gradually, the smaller the back rake angle, the stronger the ability of the cutter to penetrate into the rock ( Figure 4). However, as the back rake angle increases, the cutter bears lager cutting load, and becomes more vulnerable to damage, so the value of the back rake angle is generally between 10 and 20. Finally, to remove the cuttings quickly and reduce repetitive cutting, the side rake angle should be controlled between 3 and 8 according to the previous test. Bionic design of the gauge surface. The non-smooth surface morphology of the biological surface has the characteristics of wear resistance, resistance reduction, and desorption, which has been widely used in many industries. For the matrix PDC drill bit, on the basis of placing diamond polycrystalline and hard alloy on the gauge surface, the bit gauge surface is designed to be non-smooth, which can further improve the wear resistance of the gauge, reduce the bit rotary resistance, and have the anti-counterfeiting effect. The design of the non-smooth structure is mainly to determine the relevant dimensions of each non-smooth unit, such as stripe spacing and height, and so on, and the gauge surface should be easy to be processed. Figure 5 is a schematic diagram of the designed biomimetic PDC bit. Bionic design of the PDC cutter. The PDC cutter is synthesized by cemented carbide and diamond micro-powder under high temperature and high pressure. Considering the processing technology and rock-breaking mechanism, the bionic design of PDC cutter is carried out from two aspects: first, the surface of the diamond layer is designed into several grooves (A-type); second, the diamond edge is designed into a multistep micro-arc structure (B-type; Figure 6). According to the above bionic design idea, a batch of bionic PDC cutters is processed. For the processing of A-type bionic PDC cutter, considering the processing technology and cost, the groove shape of nonsmooth surface is formed by wire cutting on the cutter's diamond surface, the number of the processed grooves is 2-5, and the corresponding numbers are A2-A5. For the processing of B-type bionic PDC cutter, the micro-arc structure of the diamond edge is processed, then under the cooling condition, the diamond grinding wheel is used to grind the micro-arc structure into multi-step shape, the number of the processed step is 2 and 3, and the corresponding numbers are B2 and B3. A common plane PDC cutter is selected for the comparison test, the number of the cutter is P1. The bionic PDC cutters were welded into bolt drill bits to verify its performance (Figure 7) and the microdrilling test was carried out by the self-developed micro-drilling test bench (Figure 8). 18 The rock sample was made of fine sandstone, the experimental parameters and results are shown in Table 1. From Table 1 it can be seen that the average drilling efficiency of bionic PDC cutter is significantly higher than that of common plane PDC cutter, but the breakage of A-type cutter is more, the cutter with four grooves has the best performance. The performance of B-type cutter is relatively stable, but the cutting efficiency is lower than that of A-type PDC cutter. Therefore, A4 and B2 bionic PDC cutters are selected for field test. Producing of bionic PDC drill bit The structure of the bionic PDC drill bit is complex, so pressure-less impregnation method is used to machining the bit body. The main processing steps are as follows: first, the negative mold is made by means of three-dimensional (3D) printing technology, then rubber mold is made by turning the negative mold over, and the ceramic mold is made by turning the rubber mold; second, adjusting the formula to mix the matrix, then assembling the steel body and the mold, filling the voids between the mold and the steel body with matrix powder and impregnated solder; finally performing the sintering operation and the heat preservation. After cleaning the bionic bit body, the bionic PDC cutters are brazed to the bionic bit body which strictly abides the brazing process rules. The bionic PDC bit is shown in Figure 9. Test site and formation conditions The test site is located in Panyi Coal Mine of Huainan Mining Group. ZDY4300LP crawler drill rig, ZBQ-25/ 5 mud pump, and U73/63.5-mm wide blade spiral drill pipe were used. The drilling hole design is shown in Figure 10. The average hole depth was 41.2 m and the inclination angle was 51 -90. Previously, the U113-mm concave PDC drill bit was used, the number of the used concave PDC drill bit was 860, the total footage was 25,772 m, and the average footage per drill bit was 29.9 m. The drilled rock formations include: medium-fine sandstone (f > 9): mainly light gray-white fine sandstone with thin or interbedded fine sandstones, thickness of 16.95 m; interbedded with fine sandstone: gray sand muddy structure, thickness of 4 m; medium and fine sandstone (f > 9): medium sandstone, grayish white medium grain structure with a small amount of coarse grain composition unclear, thickness of 5.8 m; fine sandstone (f > 9): light gray white, thickness of 8.55 m; mudstone: gray partial dark gray, thickness of 3.15 m; 11-2 coal: black, semibright coal, thickness of 1.59 m; sand mudstone: light gray, thickness of 4.18 m; 11-3 coal: grayish black, thickness of 0.35 m; fine sandstone (f > 9): light grayish white, thickness of 6.41 m. Test results and analysis The preferred A-type and B-type bionic PDC cutters were brazed on the bionic bit body, and U113-mm bionic PDC drill bits were processed. The results are shown in Table 2. From Table 2 it can be seen that, compared with the U113-mm concave PDC bit used in the field, the service life and drilling efficiency of the bionic PDC bit are significantly improved. For A-type PDC drill bit, the service life increases by about 54%, and the drilling efficiency increases about 230%; for B-type PDC drill bit, the average service life increases by about 345%, and the drilling efficiency increases by about 204%. In particular, the B-type bionic PDC bit has a higher cost performance. The damage of A-type bionic PDC cutter mainly occurs in the diamond layer of the linear cutting process, which is mainly characterized by the peeling of the cutting layer, rather than the overall peeling of the diamond layer ( Figure 11). It can be seen that thermal damage of the cutter occurred because of the linear cutting processing; while the B-type bionic PDC cutter exhibits higher impact toughness, its damage form is wear indicating that the bionic PDC cutting edge processed by the grinding method is more suitable for hard rock drilling. Declaration of conflicting interests The author declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article. Funding The author disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: |
<filename>src/main/java/vocabularystudy/model/TestHistory.java
package vocabularystudy.model;
import javax.persistence.*;
@Entity
@Table(name = "TestHistory")
public class TestHistory
{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user")
private User user;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "category")
private Category category;
@Column(name = "total_score", nullable = false)
private Integer totalScore;
@Column(name = "score", nullable = false)
private Integer score;
public TestHistory() {}
public TestHistory(User user, Category category, int totalScore, int score)
{
this.user = user;
this.category = category;
this.totalScore = totalScore;
this.score = score;
}
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public User getUser()
{
return user;
}
public void setUser(User user)
{
this.user = user;
}
public Category getCategory()
{
return category;
}
public void setCategory(Category category)
{
this.category = category;
}
public Integer getTotalScore()
{
return totalScore;
}
public void setTotalScore(Integer totalScore)
{
this.totalScore = totalScore;
}
public Integer getScore()
{
return score;
}
public void setScore(Integer score)
{
this.score = score;
}
@Override
public int hashCode()
{
return this.id.hashCode();
}
@Override
public boolean equals(Object obj)
{
return (obj instanceof TestHistory)
&& (((TestHistory) obj).id.equals(this.id));
}
}
|
Violinist Christian Tetzlaff, conductor Andris Nelsons and members of the Boston Symphony Orchestra perform Felix Mendelssohn's Violin Concerto in E minor at Tanglewood in Lenox on Friday.
LENOX - Violin concertos didn't use to start with a solo.
Even now, in a symphony or even a play or a rock song, we normally have to wait for the lead actor to launch into a soliloquy or a guitarist to strut his (or her, and yes, I'm talking about you, Carrie Brownstein) stuff and show what they can do.
Felix Mendelssohn clearly didn't get that memo. In his famous Violin Concerto in E Minor, Opus 64, there's no prologue, no introduction. The soloist simply launches the fireworks right from the very first note.
That might have seemed revolutionary in 1845. But it's almost become standard for many great violin concertos since then. From Galzunov (who's concerto in A Minor thrilled audiences this past Sunday at Tanglewood, thanks to violinist Joshua Bell) to Sibelius and Prokofiev, the soloists takes center stage right from the first note.
On Friday night, violinist Christian Tetzlaff delivered a dazzling performance of Mendelssohn's violin concerto with the Boston Symphony Orchestra at Tanglewood, where the BSO also gave audiences a sneak preview of a work they will perform five times on the BSO's upcoming European tour: Mahler's 6th Symphony.
Making a grand entrance seems to come naturally to Mendelssohn. He's the composer that wrote the song that millions of couples have walked down the aisle to on their wedding day: Mendelssohn's wedding march.
That's why it should come as no surprise that the first few notes of his violin concerto require the violinist to immediately soar to stratospheric heights. Think Jimmy Page's ear-splitting solos in "Heartbreaker" or "Whole Lotta Love" - except you don't have to wait two minutes or three minutes into the song to hear the spine-tingling music.
As a light rain fell outside the Shed on Friday, Tetzlaff tore into the opening of Mendelssohn's concerto, which has a bright, cheery tone throughout the piece. There's none of the angst or doubt you find in Shostakovich's haunting first violin concerto or the tentative tone of Prokofiev's powerful first violin concerto. Mendelssohn's concerto sounds like love at first sight set to music, especially at the start of this piece.
The German soloist also perfectly captured the flurry of notes and fast changes in tempo that come several times near the end of the first movement. The same goes for the slower, soulful second movement. As a light rain fell outside, Tetzlaff vividly brought this gorgeous movement to life.
Parts of Mendelssohn's concerto also reminded me of gypsy music, which Dvorak also often incorporated into his music a generation later. And each time Mendelssohn's music veered in this direction Friday, Tetzlaff was there to deftly deliver a dazzling turn of phrase.
The final, third movement ramps up the pace. Often, the notes sound like the flutter of a hummingbird's wings. Tetzlaff perfectly performed this movement and without any of the over-the-top histrionics you sometimes see with some soloists.
The crowd immediately gave Tetzlaff and the BSO a standing ovation. Tetzlaff responded by giving the crowd a brief, satisfying encore.
There's nothing brief about Mahler's 6th Symphony. Clocking in at an hour-and-20-minutes, Mahler's 6th has a massive, monumental feel, right from the first, strident movement. Sousa might be the king of marching music, but Mahler's first movement of the 6th sure gives Sousa a run for his money.
I will confess that I am not exactly a big fan of Mahler's 6th or his 8th Symphony, which the BSO performed last Saturday at Tanglewood. Personally, I prefer Mahler's sweeping 5th symphony and his ethereal 9th symphony. I also feel like there's not enough variety from one movement to the next in Mahler's 6th.
On Friday night, the orchestra sounded absolutely fantastic as it worked its way through Mahler's mash up, which includes everything from the sound of cow bells off stage (no doubt due to the time Mahler often spent during his summer's in the Alps) to a massive drum played with a sledge-like hammer that looked like something straight out of a Looney Toons cartoon.
The orchestra's string section in particular delivered one dazzling turn of phrase after another. The same goes for the horn section and the double basses. Whenever it was time for a particular part of the orchestra to shine, they flipped the switch on, bringing a bright, cheerful tone to the Shed. Not even the rain outside could dampen or diminish the sound of the sublime orchestra.
We're truly blessed to have such great musicians in our area two months each summer. The orchestra plays its final classical concerts at Tanglewood this summer tonight and tomorrow afternoon before flying off to Europe.
I'm glad audiences in London, Paris, Milan, Berlin and other cities throughout Europe will be able to hear this wonderful orchestra this month. But I can't deny that they will be greatly missed in the Berkshires and many of us will be counting the days until they return to Tanglewood next summer. |
Knowledge expectations of patients on dialysis treatment. In order to be empowered in different situations related to dialysis care, patients need knowledge. This study describes the knowledge expectations of patients on dialysis treatment (n = 47) and selected background variables. The results indicated that patients expressed moderate knowledge expectations. Most important were the biophysiological, functional, and ethical dimensions of knowledge. The least important were the social and experiential dimensions of knowledge. Patients' age, employment status, dialysis modality, and length of dialysis were positively correlated with knowledge expectations. |
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.lob;
import java.sql.Clob;
import org.hibernate.LockOptions;
import org.hibernate.Session;
import org.hibernate.dialect.SybaseASE157Dialect;
import org.hibernate.dialect.TeradataDialect;
import org.hibernate.type.descriptor.java.DataHelper;
import org.hibernate.testing.DialectChecks;
import org.hibernate.testing.RequiresDialectFeature;
import org.hibernate.testing.SkipForDialect;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
/**
* Tests lazy materialization of data mapped by
* {@link org.hibernate.type.ClobType} as well as bounded and unbounded
* materialization and mutation.
*
* @author <NAME>
*/
@RequiresDialectFeature(
value = DialectChecks.SupportsExpectedLobUsagePattern.class,
comment = "database/driver does not support expected LOB usage pattern"
)
public class ClobLocatorTest extends BaseCoreFunctionalTestCase {
private static final int CLOB_SIZE = 10000;
public String[] getMappings() {
return new String[] { "lob/LobMappings.hbm.xml" };
}
@Test
@SkipForDialect(
value = TeradataDialect.class,
jiraKey = "HHH-6637",
comment = "Teradata requires locator to be used in same session where it was created/retrieved"
)
public void testBoundedClobLocatorAccess() throws Throwable {
String original = buildString( CLOB_SIZE, 'x' );
String changed = buildString( CLOB_SIZE, 'y' );
String empty = "";
Session s = openSession();
s.beginTransaction();
LobHolder entity = new LobHolder();
entity.setClobLocator( s.getLobHelper().createClob( original ) );
s.save( entity );
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
entity = s.get( LobHolder.class, entity.getId() );
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( original, extractData( entity.getClobLocator() ) );
s.getTransaction().commit();
s.close();
// test mutation via setting the new clob data...
if ( getDialect().supportsLobValueChangePropogation() ) {
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.byId( LobHolder.class ).with( LockOptions.UPGRADE ).load( entity.getId() );
entity.getClobLocator().truncate( 1 );
entity.getClobLocator().setString( 1, changed );
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.byId( LobHolder.class ).with( LockOptions.UPGRADE ).load( entity.getId() );
assertNotNull( entity.getClobLocator() );
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( changed, extractData( entity.getClobLocator() ) );
entity.getClobLocator().truncate( 1 );
entity.getClobLocator().setString( 1, original );
s.getTransaction().commit();
s.close();
}
// test mutation via supplying a new clob locator instance...
s = openSession();
s.beginTransaction();
entity = ( LobHolder ) s.byId( LobHolder.class ).with( LockOptions.UPGRADE ).load( entity.getId() );
assertNotNull( entity.getClobLocator() );
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( original, extractData( entity.getClobLocator() ) );
entity.setClobLocator( s.getLobHelper().createClob( changed ) );
s.getTransaction().commit();
s.close();
// test empty clob
if ( !(getDialect() instanceof SybaseASE157Dialect) ) { // Skip for Sybase. HHH-6425
s = openSession();
s.beginTransaction();
entity = s.get( LobHolder.class, entity.getId() );
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( changed, extractData( entity.getClobLocator() ) );
entity.setClobLocator( s.getLobHelper().createClob( empty ) );
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
entity = s.get( LobHolder.class, entity.getId() );
if ( entity.getClobLocator() != null) {
assertEquals( empty.length(), entity.getClobLocator().length() );
assertEquals( empty, extractData( entity.getClobLocator() ) );
}
s.delete( entity );
s.getTransaction().commit();
s.close();
}
}
@Test
@RequiresDialectFeature(
value = DialectChecks.SupportsUnboundedLobLocatorMaterializationCheck.class,
comment = "database/driver does not support materializing a LOB locator outside the owning transaction"
)
public void testUnboundedClobLocatorAccess() throws Throwable {
// Note: unbounded mutation of the underlying lob data is completely
// unsupported; most databases would not allow such a construct anyway.
// Thus here we are only testing materialization...
String original = buildString( CLOB_SIZE, 'x' );
Session s = openSession();
s.beginTransaction();
LobHolder entity = new LobHolder();
entity.setClobLocator( s.getLobHelper().createClob( original ) );
s.save( entity );
s.getTransaction().commit();
s.close();
// load the entity with the clob locator, and close the session/transaction;
// at that point it is unbounded...
s = openSession();
s.beginTransaction();
entity = s.get( LobHolder.class, entity.getId() );
s.getTransaction().commit();
s.close();
assertEquals( CLOB_SIZE, entity.getClobLocator().length() );
assertEquals( original, extractData( entity.getClobLocator() ) );
s = openSession();
s.beginTransaction();
s.delete( entity );
s.getTransaction().commit();
s.close();
}
public static String extractData(Clob clob) throws Exception {
return DataHelper.extractString( clob.getCharacterStream() );
}
public static String buildString(int size, char baseChar) {
StringBuilder buff = new StringBuilder();
for( int i = 0; i < size; i++ ) {
buff.append( baseChar );
}
return buff.toString();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.